Files
Taremin-webui-monaco-prompt/javascript/main.bundle.js
T
2023-12-18 16:46:28 +09:00

2 lines
5.3 MiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*! For license information please see main.bundle.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.MonacoPrompt=t():e.MonacoPrompt=t()}(self,(()=>(()=>{"use strict";var e={2757:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-action-bar {\n\twhite-space: nowrap;\n\theight: 100%;\n}\n\n.monaco-action-bar .actions-container {\n\tdisplay: flex;\n\tmargin: 0 auto;\n\tpadding: 0;\n\theight: 100%;\n\twidth: 100%;\n\talign-items: center;\n}\n\n.monaco-action-bar.vertical .actions-container {\n\tdisplay: inline-block;\n}\n\n.monaco-action-bar .action-item {\n\tdisplay: block;\n\talign-items: center;\n\tjustify-content: center;\n\tcursor: pointer;\n\tposition: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-action-bar .action-item.disabled {\n\tcursor: default;\n}\n\n.monaco-action-bar .action-item .icon,\n.monaco-action-bar .action-item .codicon {\n\tdisplay: block;\n}\n\n.monaco-action-bar .action-item .codicon {\n\tdisplay: flex;\n\talign-items: center;\n\twidth: 16px;\n\theight: 16px;\n}\n\n.monaco-action-bar .action-label {\n\tdisplay: flex;\n\tfont-size: 11px;\n\tpadding: 3px;\n\tborder-radius: 5px;\n}\n\n.monaco-action-bar .action-item.disabled .action-label,\n.monaco-action-bar .action-item.disabled .action-label::before,\n.monaco-action-bar .action-item.disabled .action-label:hover {\n\topacity: 0.6;\n}\n\n/* Vertical actions */\n\n.monaco-action-bar.vertical {\n\ttext-align: left;\n}\n\n.monaco-action-bar.vertical .action-item {\n\tdisplay: block;\n}\n\n.monaco-action-bar.vertical .action-label.separator {\n\tdisplay: block;\n\tborder-bottom: 1px solid #bbb;\n\tpadding-top: 1px;\n\tmargin-left: .8em;\n\tmargin-right: .8em;\n}\n\n.monaco-action-bar .action-item .action-label.separator {\n\twidth: 1px;\n\theight: 16px;\n\tmargin: 5px 4px !important;\n\tcursor: default;\n\tmin-width: 1px;\n\tpadding: 0;\n\tbackground-color: #bbb;\n}\n\n.secondary-actions .monaco-action-bar .action-label {\n\tmargin-left: 6px;\n}\n\n/* Action Items */\n.monaco-action-bar .action-item.select-container {\n\toverflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n\tflex: 1;\n\tmax-width: 170px;\n\tmin-width: 60px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-right: 10px;\n}\n\n.monaco-action-bar .action-item.action-dropdown-item {\n\tdisplay: flex;\n}\n\n.monaco-action-bar .action-item.action-dropdown-item > .action-dropdown-item-separator {\n\tdisplay: flex;\n\talign-items: center;\n\tcursor: default;\n}\n\n.monaco-action-bar .action-item.action-dropdown-item > .action-dropdown-item-separator > div {\n\twidth: 1px;\n}\n",""]);const a=r},93:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-aria-container {\n\tposition: absolute; /* try to hide from window but not from screen readers */\n\tleft:-999em;\n}",""]);const a=r},2013:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-text-button {\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\twidth: 100%;\n\tpadding: 4px;\n\tborder-radius: 2px;\n\ttext-align: center;\n\tcursor: pointer;\n\tjustify-content: center;\n\talign-items: center;\n\tborder: 1px solid var(--vscode-button-border, transparent);\n\tline-height: 18px;\n}\n\n.monaco-text-button:focus {\n\toutline-offset: 2px !important;\n}\n\n.monaco-text-button:hover {\n\ttext-decoration: none !important;\n}\n\n.monaco-button.disabled:focus,\n.monaco-button.disabled {\n\topacity: 0.4 !important;\n\tcursor: default;\n}\n\n.monaco-text-button .codicon {\n\tmargin: 0 0.2em;\n\tcolor: inherit !important;\n}\n\n.monaco-text-button.monaco-text-button-with-short-label {\n\tflex-direction: row;\n\tflex-wrap: wrap;\n\tpadding: 0 4px;\n\toverflow: hidden;\n\theight: 28px;\n}\n\n.monaco-text-button.monaco-text-button-with-short-label > .monaco-button-label {\n\tflex-basis: 100%;\n}\n\n.monaco-text-button.monaco-text-button-with-short-label > .monaco-button-label-short {\n\tflex-grow: 1;\n\twidth: 0;\n\toverflow: hidden;\n}\n\n.monaco-text-button.monaco-text-button-with-short-label > .monaco-button-label,\n.monaco-text-button.monaco-text-button-with-short-label > .monaco-button-label-short {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tfont-weight: normal;\n\tfont-style: inherit;\n\tpadding: 4px 0;\n}\n\n.monaco-button-dropdown {\n\tdisplay: flex;\n\tcursor: pointer;\n}\n\n.monaco-button-dropdown.disabled {\n\tcursor: default;\n}\n\n.monaco-button-dropdown > .monaco-button:focus {\n\toutline-offset: -1px !important;\n}\n\n.monaco-button-dropdown.disabled > .monaco-button.disabled,\n.monaco-button-dropdown.disabled > .monaco-button.disabled:focus,\n.monaco-button-dropdown.disabled > .monaco-button-dropdown-separator {\n\topacity: 0.4 !important;\n}\n\n.monaco-button-dropdown > .monaco-button.monaco-text-button {\n\tborder-right-width: 0 !important;\n}\n\n.monaco-button-dropdown .monaco-button-dropdown-separator {\n\tpadding: 4px 0;\n\tcursor: default;\n}\n\n.monaco-button-dropdown .monaco-button-dropdown-separator > div {\n\theight: 100%;\n\twidth: 1px;\n}\n\n.monaco-button-dropdown > .monaco-button.monaco-dropdown-button {\n\tborder: 1px solid var(--vscode-button-border, transparent);\n\tborder-left-width: 0 !important;\n\tborder-radius: 0 2px 2px 0;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-button-dropdown > .monaco-button.monaco-text-button {\n\tborder-radius: 2px 0 0 2px;\n}\n\n.monaco-description-button {\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tmargin: 4px 5px; /* allows button focus outline to be visible */\n}\n\n.monaco-description-button .monaco-button-description {\n\tfont-style: italic;\n\tfont-size: 11px;\n\tpadding: 4px 20px;\n}\n\n.monaco-description-button .monaco-button-label,\n.monaco-description-button .monaco-button-description {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n}\n\n.monaco-description-button .monaco-button-label > .codicon,\n.monaco-description-button .monaco-button-description > .codicon {\n\tmargin: 0 0.2em;\n\tcolor: inherit !important;\n}\n\n/* default color styles - based on CSS variables */\n\n.monaco-button.default-colors,\n.monaco-button-dropdown.default-colors > .monaco-button{\n\tcolor: var(--vscode-button-foreground);\n\tbackground-color: var(--vscode-button-background);\n}\n\n.monaco-button.default-colors:hover,\n.monaco-button-dropdown.default-colors > .monaco-button:hover {\n\tbackground-color: var(--vscode-button-hoverBackground);\n}\n\n.monaco-button.default-colors.secondary,\n.monaco-button-dropdown.default-colors > .monaco-button.secondary {\n\tcolor: var(--vscode-button-secondaryForeground);\n\tbackground-color: var(--vscode-button-secondaryBackground);\n}\n\n.monaco-button.default-colors.secondary:hover,\n.monaco-button-dropdown.default-colors > .monaco-button.secondary:hover {\n\tbackground-color: var(--vscode-button-secondaryHoverBackground);\n}\n\n.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator {\n\tbackground-color: var(--vscode-button-background);\n\tborder-top: 1px solid var(--vscode-button-border);\n\tborder-bottom: 1px solid var(--vscode-button-border);\n}\n\n.monaco-button-dropdown.default-colors .monaco-button.secondary + .monaco-button-dropdown-separator {\n\tbackground-color: var(--vscode-button-secondaryBackground);\n}\n\n.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator > div {\n\tbackground-color: var(--vscode-button-separator);\n}\n",""]);const a=r},4081:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.codicon-wrench-subaction {\n\topacity: 0.5;\n}\n\n@keyframes codicon-spin {\n\t100% {\n\t\ttransform:rotate(360deg);\n\t}\n}\n\n.codicon-sync.codicon-modifier-spin,\n.codicon-loading.codicon-modifier-spin,\n.codicon-gear.codicon-modifier-spin,\n.codicon-notebook-state-executing.codicon-modifier-spin {\n\t/* Use steps to throttle FPS to reduce CPU usage */\n\tanimation: codicon-spin 1.5s steps(30) infinite;\n}\n\n.codicon-modifier-disabled {\n\topacity: 0.4;\n}\n\n/* custom speed & easing for loading icon */\n.codicon-loading,\n.codicon-tree-item-loading::before {\n\tanimation-duration: 1s !important;\n\tanimation-timing-function: cubic-bezier(0.53, 0.21, 0.29, 0.67) !important;\n}\n",""]);const a=r},58:(e,t,i)=>{i.d(t,{Z:()=>u});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s),a=i(1667),l=i.n(a),h=new URL(i(3251),i.b),d=r()(o()),c=l()(h);d.push([e.id,`/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n@font-face {\n\tfont-family: "codicon";\n\tfont-display: block;\n\tsrc: url(${c}) format("truetype");\n}\n\n.codicon[class*='codicon-'] {\n\tfont: normal normal normal 16px/1 codicon;\n\tdisplay: inline-block;\n\ttext-decoration: none;\n\ttext-rendering: auto;\n\ttext-align: center;\n\ttext-transform: none;\n\t-webkit-font-smoothing: antialiased;\n\t-moz-osx-font-smoothing: grayscale;\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n/* icon rules are dynamically created by the platform theme service (see iconsStyleSheet.ts) */\n`,""]);const u=d},6328:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.context-view {\n\tposition: absolute;\n}\n\n.context-view.fixed {\n\tall: initial;\n\tfont-family: inherit;\n\tfont-size: 13px;\n\tposition: fixed;\n\tcolor: inherit;\n}\n",""]);const a=r},477:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-count-badge {\n\tpadding: 3px 6px;\n\tborder-radius: 11px;\n\tfont-size: 11px;\n\tmin-width: 18px;\n\tmin-height: 18px;\n\tline-height: 11px;\n\tfont-weight: normal;\n\ttext-align: center;\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n}\n\n.monaco-count-badge.long {\n\tpadding: 2px 3px;\n\tborder-radius: 2px;\n\tmin-height: auto;\n\tline-height: normal;\n}\n",""]);const a=r},5035:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-dropdown {\n\theight: 100%;\n\tpadding: 0;\n}\n\n.monaco-dropdown > .dropdown-label {\n\tcursor: pointer;\n\theight: 100%;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.monaco-dropdown > .dropdown-label > .action-label.disabled {\n\tcursor: default;\n}\n\n.monaco-dropdown-with-primary {\n\tdisplay: flex !important;\n\tflex-direction: row;\n\tborder-radius: 5px;\n}\n\n.monaco-dropdown-with-primary > .action-container > .action-label {\n\tmargin-right: 0;\n}\n\n.monaco-dropdown-with-primary > .dropdown-action-container > .monaco-dropdown > .dropdown-label .codicon[class*='codicon-'] {\n\tfont-size: 12px;\n\tpadding-left: 0px;\n\tpadding-right: 0px;\n\tline-height: 16px;\n\tmargin-left: -3px;\n}\n\n.monaco-dropdown-with-primary > .dropdown-action-container > .monaco-dropdown > .dropdown-label > .action-label {\n\tdisplay: block;\n\tbackground-size: 16px;\n\tbackground-position: center center;\n\tbackground-repeat: no-repeat;\n}\n",""]);const a=r},6266:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/* ---------- Find input ---------- */\n\n.monaco-findInput {\n\tposition: relative;\n}\n\n.monaco-findInput .monaco-inputbox {\n\tfont-size: 13px;\n\twidth: 100%;\n}\n\n.monaco-findInput > .controls {\n\tposition: absolute;\n\ttop: 3px;\n\tright: 2px;\n}\n\n.vs .monaco-findInput.disabled {\n\tbackground-color: #E1E1E1;\n}\n\n/* Theming */\n.vs-dark .monaco-findInput.disabled {\n\tbackground-color: #333;\n}\n\n/* Highlighting */\n.monaco-findInput.highlight-0 .controls,\n.hc-light .monaco-findInput.highlight-0 .controls {\n\tanimation: monaco-findInput-highlight-0 100ms linear 0s;\n}\n\n.monaco-findInput.highlight-1 .controls,\n.hc-light .monaco-findInput.highlight-1 .controls {\n\tanimation: monaco-findInput-highlight-1 100ms linear 0s;\n}\n\n.hc-black .monaco-findInput.highlight-0 .controls,\n.vs-dark .monaco-findInput.highlight-0 .controls {\n\tanimation: monaco-findInput-highlight-dark-0 100ms linear 0s;\n}\n\n.hc-black .monaco-findInput.highlight-1 .controls,\n.vs-dark .monaco-findInput.highlight-1 .controls {\n\tanimation: monaco-findInput-highlight-dark-1 100ms linear 0s;\n}\n\n@keyframes monaco-findInput-highlight-0 {\n\t0% { background: rgba(253, 255, 0, 0.8); }\n\t100% { background: transparent; }\n}\n@keyframes monaco-findInput-highlight-1 {\n\t0% { background: rgba(253, 255, 0, 0.8); }\n\t/* Made intentionally different such that the CSS minifier does not collapse the two animations into a single one*/\n\t99% { background: transparent; }\n}\n\n@keyframes monaco-findInput-highlight-dark-0 {\n\t0% { background: rgba(255, 255, 255, 0.44); }\n\t100% { background: transparent; }\n}\n@keyframes monaco-findInput-highlight-dark-1 {\n\t0% { background: rgba(255, 255, 255, 0.44); }\n\t/* Made intentionally different such that the CSS minifier does not collapse the two animations into a single one*/\n\t99% { background: transparent; }\n}\n",""]);const a=r},3039:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-hover {\n\tcursor: default;\n\tposition: absolute;\n\toverflow: hidden;\n\tuser-select: text;\n\t-webkit-user-select: text;\n\tbox-sizing: border-box;\n\tanimation: fadein 100ms linear;\n\tline-height: 1.5em;\n\twhite-space: var(--vscode-hover-whiteSpace, normal);\n}\n\n.monaco-hover.hidden {\n\tdisplay: none;\n}\n\n.monaco-hover a:hover:not(.disabled) {\n\tcursor: pointer;\n}\n\n.monaco-hover .hover-contents:not(.html-hover-contents) {\n\tpadding: 4px 8px;\n}\n\n.monaco-hover .markdown-hover > .hover-contents:not(.code-hover-contents) {\n\tmax-width: var(--vscode-hover-maxWidth, 500px);\n\tword-wrap: break-word;\n}\n\n.monaco-hover .markdown-hover > .hover-contents:not(.code-hover-contents) hr {\n\tmin-width: 100%;\n}\n\n.monaco-hover p,\n.monaco-hover .code,\n.monaco-hover ul,\n.monaco-hover h1,\n.monaco-hover h2,\n.monaco-hover h3,\n.monaco-hover h4,\n.monaco-hover h5,\n.monaco-hover h6 {\n\tmargin: 8px 0;\n}\n\n.monaco-hover h1,\n.monaco-hover h2,\n.monaco-hover h3,\n.monaco-hover h4,\n.monaco-hover h5,\n.monaco-hover h6 {\n\tline-height: 1.1;\n}\n\n.monaco-hover code {\n\tfont-family: var(--monaco-monospace-font);\n}\n\n.monaco-hover hr {\n\tbox-sizing: border-box;\n\tborder-left: 0px;\n\tborder-right: 0px;\n\tmargin-top: 4px;\n\tmargin-bottom: -4px;\n\tmargin-left: -8px;\n\tmargin-right: -8px;\n\theight: 1px;\n}\n\n.monaco-hover p:first-child,\n.monaco-hover .code:first-child,\n.monaco-hover ul:first-child {\n\tmargin-top: 0;\n}\n\n.monaco-hover p:last-child,\n.monaco-hover .code:last-child,\n.monaco-hover ul:last-child {\n\tmargin-bottom: 0;\n}\n\n/* MarkupContent Layout */\n.monaco-hover ul {\n\tpadding-left: 20px;\n}\n.monaco-hover ol {\n\tpadding-left: 20px;\n}\n\n.monaco-hover li > p {\n\tmargin-bottom: 0;\n}\n\n.monaco-hover li > ul {\n\tmargin-top: 0;\n}\n\n.monaco-hover code {\n\tborder-radius: 3px;\n\tpadding: 0 0.4em;\n}\n\n.monaco-hover .monaco-tokenized-source {\n\twhite-space: var(--vscode-hover-sourceWhiteSpace, pre-wrap);\n}\n\n.monaco-hover .hover-row.status-bar {\n\tfont-size: 12px;\n\tline-height: 22px;\n}\n\n.monaco-hover .hover-row.status-bar .info {\n\tfont-style: italic;\n\tpadding: 0px 8px;\n}\n\n.monaco-hover .hover-row.status-bar .actions {\n\tdisplay: flex;\n\tpadding: 0px 8px;\n}\n\n.monaco-hover .hover-row.status-bar .actions .action-container {\n\tmargin-right: 16px;\n\tcursor: pointer;\n}\n\n.monaco-hover .hover-row.status-bar .actions .action-container .action .icon {\n\tpadding-right: 4px;\n}\n\n.monaco-hover .markdown-hover .hover-contents .codicon {\n\tcolor: inherit;\n\tfont-size: inherit;\n\tvertical-align: middle;\n}\n\n.monaco-hover .hover-contents a.code-link:hover,\n.monaco-hover .hover-contents a.code-link {\n\tcolor: inherit;\n}\n\n.monaco-hover .hover-contents a.code-link:before {\n\tcontent: '(';\n}\n\n.monaco-hover .hover-contents a.code-link:after {\n\tcontent: ')';\n}\n\n.monaco-hover .hover-contents a.code-link > span {\n\ttext-decoration: underline;\n\t/** Hack to force underline to show **/\n\tborder-bottom: 1px solid transparent;\n\ttext-underline-position: under;\n\tcolor: var(--vscode-textLink-foreground);\n}\n\n.monaco-hover .hover-contents a.code-link > span:hover {\n\tcolor: var(--vscode-textLink-activeForeground);\n}\n\n/** Spans in markdown hovers need a margin-bottom to avoid looking cramped: https://github.com/microsoft/vscode/issues/101496 **/\n.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) span {\n\tmargin-bottom: 4px;\n\tdisplay: inline-block;\n}\n\n.monaco-hover-content .action-container a {\n\t-webkit-user-select: none;\n\tuser-select: none;\n}\n\n.monaco-hover-content .action-container.disabled {\n\tpointer-events: none;\n\topacity: 0.4;\n\tcursor: default;\n}\n",""]);const a=r},4269:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* ---------- Icon label ---------- */\n\n.monaco-icon-label {\n\tdisplay: flex; /* required for icons support :before rule */\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.monaco-icon-label::before {\n\n\t/* svg icons rendered as background image */\n\tbackground-size: 16px;\n\tbackground-position: left center;\n\tbackground-repeat: no-repeat;\n\tpadding-right: 6px;\n\twidth: 16px;\n\theight: 22px;\n\tline-height: inherit !important;\n\tdisplay: inline-block;\n\n\t/* fonts icons */\n\t-webkit-font-smoothing: antialiased;\n\t-moz-osx-font-smoothing: grayscale;\n\tvertical-align: top;\n\n\tflex-shrink: 0; /* fix for https://github.com/microsoft/vscode/issues/13787 */\n}\n\n.monaco-icon-label-container.disabled {\n\tcolor: var(--vscode-disabledForeground);\n}\n.monaco-icon-label > .monaco-icon-label-container {\n\tmin-width: 0;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tflex: 1;\n}\n\n.monaco-icon-label > .monaco-icon-label-container > .monaco-icon-name-container > .label-name {\n\tcolor: inherit;\n\twhite-space: pre; /* enable to show labels that include multiple whitespaces */\n}\n\n.monaco-icon-label > .monaco-icon-label-container > .monaco-icon-name-container > .label-name > .label-separator {\n\tmargin: 0 2px;\n\topacity: 0.5;\n}\n\n.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-suffix-container>.label-suffix {\n\topacity: .7;\n\twhite-space: pre;\n}\n\n.monaco-icon-label > .monaco-icon-label-container > .monaco-icon-description-container > .label-description {\n\topacity: .7;\n\tmargin-left: 0.5em;\n\tfont-size: 0.9em;\n\twhite-space: pre; /* enable to show labels that include multiple whitespaces */\n}\n\n.monaco-icon-label.nowrap > .monaco-icon-label-container > .monaco-icon-description-container > .label-description{\n\twhite-space: nowrap\n}\n\n.vs .monaco-icon-label > .monaco-icon-label-container > .monaco-icon-description-container > .label-description {\n\topacity: .95;\n}\n\n.monaco-icon-label.italic > .monaco-icon-label-container > .monaco-icon-name-container > .label-name,\n.monaco-icon-label.italic > .monaco-icon-label-container > .monaco-icon-description-container > .label-description {\n\tfont-style: italic;\n}\n\n.monaco-icon-label.deprecated {\n\ttext-decoration: line-through;\n\topacity: 0.66;\n}\n\n/* make sure apply italic font style to decorations as well */\n.monaco-icon-label.italic::after {\n\tfont-style: italic;\n}\n\n.monaco-icon-label.strikethrough > .monaco-icon-label-container > .monaco-icon-name-container > .label-name,\n.monaco-icon-label.strikethrough > .monaco-icon-label-container > .monaco-icon-description-container > .label-description {\n\ttext-decoration: line-through;\n}\n\n.monaco-icon-label::after {\n\topacity: 0.75;\n\tfont-size: 90%;\n\tfont-weight: 600;\n\tmargin: auto 16px 0 5px; /* https://github.com/microsoft/vscode/issues/113223 */\n\ttext-align: center;\n}\n\n/* make sure selection color wins when a label is being selected */\n.monaco-list:focus .selected .monaco-icon-label, /* list */\n.monaco-list:focus .selected .monaco-icon-label::after\n{\n\tcolor: inherit !important;\n}\n\n.monaco-list-row.focused.selected .label-description,\n.monaco-list-row.selected .label-description {\n\topacity: .8;\n}\n",""]);const a=r},1188:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-inputbox {\n\tposition: relative;\n\tdisplay: block;\n\tpadding: 0;\n\tbox-sizing:\tborder-box;\n\tborder-radius: 2px;\n\n\t/* Customizable */\n\tfont-size: inherit;\n}\n\n.monaco-inputbox > .ibwrapper > .input,\n.monaco-inputbox > .ibwrapper > .mirror {\n\n\t/* Customizable */\n\tpadding: 4px 6px;\n}\n\n.monaco-inputbox > .ibwrapper {\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.monaco-inputbox > .ibwrapper > .input {\n\tdisplay: inline-block;\n\tbox-sizing:\tborder-box;\n\twidth: 100%;\n\theight: 100%;\n\tline-height: inherit;\n\tborder: none;\n\tfont-family: inherit;\n\tfont-size: inherit;\n\tresize: none;\n\tcolor: inherit;\n}\n\n.monaco-inputbox > .ibwrapper > input {\n\ttext-overflow: ellipsis;\n}\n\n.monaco-inputbox > .ibwrapper > textarea.input {\n\tdisplay: block;\n\tscrollbar-width: none; /* Firefox: hide scrollbars */\n\toutline: none;\n}\n\n.monaco-inputbox > .ibwrapper > textarea.input::-webkit-scrollbar {\n\tdisplay: none; /* Chrome + Safari: hide scrollbar */\n}\n\n.monaco-inputbox > .ibwrapper > textarea.input.empty {\n\twhite-space: nowrap;\n}\n\n.monaco-inputbox > .ibwrapper > .mirror {\n\tposition: absolute;\n\tdisplay: inline-block;\n\twidth: 100%;\n\ttop: 0;\n\tleft: 0;\n\tbox-sizing: border-box;\n\twhite-space: pre-wrap;\n\tvisibility: hidden;\n\tword-wrap: break-word;\n}\n\n/* Context view */\n\n.monaco-inputbox-container {\n\ttext-align: right;\n}\n\n.monaco-inputbox-container .monaco-inputbox-message {\n\tdisplay: inline-block;\n\toverflow: hidden;\n\ttext-align: left;\n\twidth: 100%;\n\tbox-sizing:\tborder-box;\n\tpadding: 0.4em;\n\tfont-size: 12px;\n\tline-height: 17px;\n\tmargin-top: -1px;\n\tword-wrap: break-word;\n}\n\n/* Action bar support */\n.monaco-inputbox .monaco-action-bar {\n\tposition: absolute;\n\tright: 2px;\n\ttop: 4px;\n}\n\n.monaco-inputbox .monaco-action-bar .action-item {\n\tmargin-left: 2px;\n}\n\n.monaco-inputbox .monaco-action-bar .action-item .codicon {\n\tbackground-repeat: no-repeat;\n\twidth: 16px;\n\theight: 16px;\n}\n",""]);const a=r},2298:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-keybinding {\n\tdisplay: flex;\n\talign-items: center;\n\tline-height: 10px;\n}\n\n.monaco-keybinding > .monaco-keybinding-key {\n\tdisplay: inline-block;\n\tborder-style: solid;\n\tborder-width: 1px;\n\tborder-radius: 3px;\n\tvertical-align: middle;\n\tfont-size: 11px;\n\tpadding: 3px 5px;\n\tmargin: 0 2px;\n}\n\n.monaco-keybinding > .monaco-keybinding-key:first-child {\n\tmargin-left: 0;\n}\n\n.monaco-keybinding > .monaco-keybinding-key:last-child {\n\tmargin-right: 0;\n}\n\n.monaco-keybinding > .monaco-keybinding-key-separator {\n\tdisplay: inline-block;\n}\n\n.monaco-keybinding > .monaco-keybinding-key-chord-separator {\n\twidth: 6px;\n}\n",""]);const a=r},7703:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-list {\n\tposition: relative;\n\theight: 100%;\n\twidth: 100%;\n\twhite-space: nowrap;\n}\n\n.monaco-list.mouse-support {\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.monaco-list > .monaco-scrollable-element {\n\theight: 100%;\n}\n\n.monaco-list-rows {\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.monaco-list.horizontal-scrolling .monaco-list-rows {\n\twidth: auto;\n\tmin-width: 100%;\n}\n\n.monaco-list-row {\n\tposition: absolute;\n\tbox-sizing: border-box;\n\toverflow: hidden;\n\twidth: 100%;\n}\n\n.monaco-list.mouse-support .monaco-list-row {\n\tcursor: pointer;\n\ttouch-action: none;\n}\n\n/* Make sure the scrollbar renders above overlays (sticky scroll) */\n.monaco-list .monaco-scrollable-element > .scrollbar.vertical,\n.monaco-pane-view > .monaco-split-view2.vertical > .monaco-scrollable-element > .scrollbar.vertical {\n\tz-index: 14;\n}\n\n/* for OS X ballistic scrolling */\n.monaco-list-row.scrolling {\n\tdisplay: none !important;\n}\n\n/* Focus */\n.monaco-list.element-focused,\n.monaco-list.selection-single,\n.monaco-list.selection-multiple {\n\toutline: 0 !important;\n}\n\n/* Dnd */\n.monaco-drag-image {\n\tdisplay: inline-block;\n\tpadding: 1px 7px;\n\tborder-radius: 10px;\n\tfont-size: 12px;\n\tposition: absolute;\n\tz-index: 1000;\n}\n\n/* Filter */\n\n.monaco-list-type-filter-message {\n\tposition: absolute;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\theight: 100%;\n\ttop: 0;\n\tleft: 0;\n\tpadding: 40px 1em 1em 1em;\n\ttext-align: center;\n\twhite-space: normal;\n\topacity: 0.7;\n\tpointer-events: none;\n}\n\n.monaco-list-type-filter-message:empty {\n\tdisplay: none;\n}\n",""]);const a=r},7548:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-mouse-cursor-text {\n\tcursor: text;\n}\n",""]);const a=r},4185:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-progress-container {\n\twidth: 100%;\n\theight: 2px;\n\toverflow: hidden; /* keep progress bit in bounds */\n}\n\n.monaco-progress-container .progress-bit {\n\twidth: 2%;\n\theight: 2px;\n\tposition: absolute;\n\tleft: 0;\n\tdisplay: none;\n}\n\n.monaco-progress-container.active .progress-bit {\n\tdisplay: inherit;\n}\n\n.monaco-progress-container.discrete .progress-bit {\n\tleft: 0;\n\ttransition: width 100ms linear;\n}\n\n.monaco-progress-container.discrete.done .progress-bit {\n\twidth: 100%;\n}\n\n.monaco-progress-container.infinite .progress-bit {\n\tanimation-name: progress;\n\tanimation-duration: 4s;\n\tanimation-iteration-count: infinite;\n\ttransform: translate3d(0px, 0px, 0px);\n\tanimation-timing-function: linear;\n}\n\n.monaco-progress-container.infinite.infinite-long-running .progress-bit {\n\t/*\n\t\tThe more smooth `linear` timing function can cause\n\t\thigher GPU consumption as indicated in\n\t\thttps://github.com/microsoft/vscode/issues/97900 &\n\t\thttps://github.com/microsoft/vscode/issues/138396\n\t*/\n\tanimation-timing-function: steps(100);\n}\n\n/**\n * The progress bit has a width: 2% (1/50) of the parent container. The animation moves it from 0% to 100% of\n * that container. Since translateX is relative to the progress bit size, we have to multiple it with\n * its relative size to the parent container:\n * parent width: 5000%\n * bit width: 100%\n * translateX should be as follow:\n * 50%: 5000% * 50% - 50% (set to center) = 2450%\n * 100%: 5000% * 100% - 100% (do not overflow) = 4900%\n */\n@keyframes progress { from { transform: translateX(0%) scaleX(1) } 50% { transform: translateX(2500%) scaleX(3) } to { transform: translateX(4900%) scaleX(1) } }\n",""]);const a=r},1629:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n:root {\n\t--vscode-sash-size: 4px;\n\t--vscode-sash-hover-size: 4px;\n}\n\n.monaco-sash {\n\tposition: absolute;\n\tz-index: 35;\n\ttouch-action: none;\n}\n\n.monaco-sash.disabled {\n\tpointer-events: none;\n}\n\n.monaco-sash.mac.vertical {\n\tcursor: col-resize;\n}\n\n.monaco-sash.vertical.minimum {\n\tcursor: e-resize;\n}\n\n.monaco-sash.vertical.maximum {\n\tcursor: w-resize;\n}\n\n.monaco-sash.mac.horizontal {\n\tcursor: row-resize;\n}\n\n.monaco-sash.horizontal.minimum {\n\tcursor: s-resize;\n}\n\n.monaco-sash.horizontal.maximum {\n\tcursor: n-resize;\n}\n\n.monaco-sash.disabled {\n\tcursor: default !important;\n\tpointer-events: none !important;\n}\n\n.monaco-sash.vertical {\n\tcursor: ew-resize;\n\ttop: 0;\n\twidth: var(--vscode-sash-size);\n\theight: 100%;\n}\n\n.monaco-sash.horizontal {\n\tcursor: ns-resize;\n\tleft: 0;\n\twidth: 100%;\n\theight: var(--vscode-sash-size);\n}\n\n.monaco-sash:not(.disabled) > .orthogonal-drag-handle {\n\tcontent: \" \";\n\theight: calc(var(--vscode-sash-size) * 2);\n\twidth: calc(var(--vscode-sash-size) * 2);\n\tz-index: 100;\n\tdisplay: block;\n\tcursor: all-scroll;\n\tposition: absolute;\n}\n\n.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)\n\t> .orthogonal-drag-handle.start,\n.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)\n\t> .orthogonal-drag-handle.end {\n\tcursor: nwse-resize;\n}\n\n.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)\n\t> .orthogonal-drag-handle.end,\n.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)\n\t> .orthogonal-drag-handle.start {\n\tcursor: nesw-resize;\n}\n\n.monaco-sash.vertical > .orthogonal-drag-handle.start {\n\tleft: calc(var(--vscode-sash-size) * -0.5);\n\ttop: calc(var(--vscode-sash-size) * -1);\n}\n.monaco-sash.vertical > .orthogonal-drag-handle.end {\n\tleft: calc(var(--vscode-sash-size) * -0.5);\n\tbottom: calc(var(--vscode-sash-size) * -1);\n}\n.monaco-sash.horizontal > .orthogonal-drag-handle.start {\n\ttop: calc(var(--vscode-sash-size) * -0.5);\n\tleft: calc(var(--vscode-sash-size) * -1);\n}\n.monaco-sash.horizontal > .orthogonal-drag-handle.end {\n\ttop: calc(var(--vscode-sash-size) * -0.5);\n\tright: calc(var(--vscode-sash-size) * -1);\n}\n\n.monaco-sash:before {\n\tcontent: '';\n\tpointer-events: none;\n\tposition: absolute;\n\twidth: 100%;\n\theight: 100%;\n\tbackground: transparent;\n}\n\n.monaco-workbench:not(.reduce-motion) .monaco-sash:before {\n\ttransition: background-color 0.1s ease-out;\n}\n\n.monaco-sash.hover:before,\n.monaco-sash.active:before {\n\tbackground: var(--vscode-sash-hoverBorder);\n}\n\n.monaco-sash.vertical:before {\n\twidth: var(--vscode-sash-hover-size);\n\tleft: calc(50% - (var(--vscode-sash-hover-size) / 2));\n}\n\n.monaco-sash.horizontal:before {\n\theight: var(--vscode-sash-hover-size);\n\ttop: calc(50% - (var(--vscode-sash-hover-size) / 2));\n}\n\n.pointer-events-disabled {\n\tpointer-events: none !important;\n}\n\n/** Debug **/\n\n.monaco-sash.debug {\n\tbackground: cyan;\n}\n\n.monaco-sash.debug.disabled {\n\tbackground: rgba(0, 255, 255, 0.2);\n}\n\n.monaco-sash.debug:not(.disabled) > .orthogonal-drag-handle {\n\tbackground: red;\n}\n",""]);const a=r},7198:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* Arrows */\n.monaco-scrollable-element > .scrollbar > .scra {\n\tcursor: pointer;\n\tfont-size: 11px !important;\n}\n\n.monaco-scrollable-element > .visible {\n\topacity: 1;\n\n\t/* Background rule added for IE9 - to allow clicks on dom node */\n\tbackground:rgba(0,0,0,0);\n\n\ttransition: opacity 100ms linear;\n\t/* In front of peek view */\n\tz-index: 11;\n}\n.monaco-scrollable-element > .invisible {\n\topacity: 0;\n\tpointer-events: none;\n}\n.monaco-scrollable-element > .invisible.fade {\n\ttransition: opacity 800ms linear;\n}\n\n/* Scrollable Content Inset Shadow */\n.monaco-scrollable-element > .shadow {\n\tposition: absolute;\n\tdisplay: none;\n}\n.monaco-scrollable-element > .shadow.top {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 3px;\n\theight: 3px;\n\twidth: 100%;\n\tbox-shadow: var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset;\n}\n.monaco-scrollable-element > .shadow.left {\n\tdisplay: block;\n\ttop: 3px;\n\tleft: 0;\n\theight: 100%;\n\twidth: 3px;\n\tbox-shadow: var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset;\n}\n.monaco-scrollable-element > .shadow.top-left-corner {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 0;\n\theight: 3px;\n\twidth: 3px;\n}\n.monaco-scrollable-element > .shadow.top.left {\n\tbox-shadow: var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset;\n}\n\n.monaco-scrollable-element > .scrollbar > .slider {\n\tbackground: var(--vscode-scrollbarSlider-background);\n}\n\n.monaco-scrollable-element > .scrollbar > .slider:hover {\n\tbackground: var(--vscode-scrollbarSlider-hoverBackground);\n}\n\n.monaco-scrollable-element > .scrollbar > .slider.active {\n\tbackground: var(--vscode-scrollbarSlider-activeBackground);\n}\n",""]);const a=r},6512:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-select-box {\n\twidth: 100%;\n\tcursor: pointer;\n\tborder-radius: 2px;\n}\n\n.monaco-select-box-dropdown-container {\n\tfont-size: 13px;\n\tfont-weight: normal;\n\ttext-transform: none;\n}\n\n/** Actions */\n\n.monaco-action-bar .action-item.select-container {\n\tcursor: default;\n}\n\n.monaco-action-bar .action-item .monaco-select-box {\n\tcursor: pointer;\n\tmin-width: 100px;\n\tmin-height: 18px;\n\tpadding: 2px 23px 2px 8px;\n}\n\n.mac .monaco-action-bar .action-item .monaco-select-box {\n\tfont-size: 11px;\n\tborder-radius: 5px;\n}\n",""]);const a=r},2675:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* Use custom CSS vars to expose padding into parent select for padding calculation */\n.monaco-select-box-dropdown-padding {\n\t--dropdown-padding-top: 1px;\n\t--dropdown-padding-bottom: 1px;\n}\n\n.hc-black .monaco-select-box-dropdown-padding,\n.hc-light .monaco-select-box-dropdown-padding {\n\t--dropdown-padding-top: 3px;\n\t--dropdown-padding-bottom: 4px;\n}\n\n.monaco-select-box-dropdown-container {\n\tdisplay: none;\n\tbox-sizing:\tborder-box;\n}\n\n.monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown * {\n\tmargin: 0;\n}\n\n.monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown a:focus {\n\toutline: 1px solid -webkit-focus-ring-color;\n\toutline-offset: -1px;\n}\n\n.monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown code {\n\tline-height: 15px; /** For some reason, this is needed, otherwise <code> will take up 20px height */\n\tfont-family: var(--monaco-monospace-font);\n}\n\n\n.monaco-select-box-dropdown-container.visible {\n\tdisplay: flex;\n\tflex-direction: column;\n\ttext-align: left;\n\twidth: 1px;\n\toverflow: hidden;\n\tborder-bottom-left-radius: 3px;\n\tborder-bottom-right-radius: 3px;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container {\n\tflex: 0 0 auto;\n\talign-self: flex-start;\n\tpadding-top: var(--dropdown-padding-top);\n\tpadding-bottom: var(--dropdown-padding-bottom);\n\tpadding-left: 1px;\n\tpadding-right: 1px;\n\twidth: 100%;\n\toverflow: hidden;\n\tbox-sizing:\tborder-box;\n}\n\n.monaco-select-box-dropdown-container > .select-box-details-pane {\n\tpadding: 5px;\n}\n\n.hc-black .monaco-select-box-dropdown-container > .select-box-dropdown-list-container {\n\tpadding-top: var(--dropdown-padding-top);\n\tpadding-bottom: var(--dropdown-padding-bottom);\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row {\n\tcursor: pointer;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row > .option-text {\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\tpadding-left: 3.5px;\n\twhite-space: nowrap;\n\tfloat: left;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row > .option-detail {\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\tpadding-left: 3.5px;\n\twhite-space: nowrap;\n\tfloat: left;\n\topacity: 0.7;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row > .option-decorator-right {\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\tpadding-right: 10px;\n\twhite-space: nowrap;\n\tfloat: right;\n}\n\n\n/* Accepted CSS hiding technique for accessibility reader text */\n/* https://webaim.org/techniques/css/invisiblecontent/ */\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row > .visually-hidden {\n\t\tposition: absolute;\n\t\tleft: -10000px;\n\t\ttop: auto;\n\t\twidth: 1px;\n\t\theight: 1px;\n\t\toverflow: hidden;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-container-width-control {\n\tflex: 1 1 auto;\n\talign-self: flex-start;\n\topacity: 0;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-container-width-control > .width-control-div {\n\toverflow: hidden;\n\tmax-height: 0px;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-container-width-control > .width-control-div > .option-text-width-control {\n\tpadding-left: 4px;\n\tpadding-right: 8px;\n\twhite-space: nowrap;\n}\n",""]);const a=r},2470:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-split-view2 {\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.monaco-split-view2 > .sash-container {\n\tposition: absolute;\n\twidth: 100%;\n\theight: 100%;\n\tpointer-events: none;\n}\n\n.monaco-split-view2 > .sash-container > .monaco-sash {\n\tpointer-events: initial;\n}\n\n.monaco-split-view2 > .monaco-scrollable-element {\n\twidth: 100%;\n\theight: 100%;\n}\n\n.monaco-split-view2 > .monaco-scrollable-element > .split-view-container {\n\twidth: 100%;\n\theight: 100%;\n\twhite-space: nowrap;\n\tposition: relative;\n}\n\n.monaco-split-view2 > .monaco-scrollable-element > .split-view-container > .split-view-view {\n\twhite-space: initial;\n\tposition: absolute;\n}\n\n.monaco-split-view2 > .monaco-scrollable-element > .split-view-container > .split-view-view:not(.visible) {\n\tdisplay: none;\n}\n\n.monaco-split-view2.vertical > .monaco-scrollable-element > .split-view-container > .split-view-view {\n\twidth: 100%;\n}\n\n.monaco-split-view2.horizontal > .monaco-scrollable-element > .split-view-container > .split-view-view {\n\theight: 100%;\n}\n\n.monaco-split-view2.separator-border > .monaco-scrollable-element > .split-view-container > .split-view-view:not(:first-child)::before {\n\tcontent: ' ';\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tz-index: 5;\n\tpointer-events: none;\n\tbackground-color: var(--separator-border);\n}\n\n.monaco-split-view2.separator-border.horizontal > .monaco-scrollable-element > .split-view-container > .split-view-view:not(:first-child)::before {\n\theight: 100%;\n\twidth: 1px;\n}\n\n.monaco-split-view2.separator-border.vertical > .monaco-scrollable-element > .split-view-container > .split-view-view:not(:first-child)::before {\n\theight: 1px;\n\twidth: 100%;\n}\n",""]);const a=r},1728:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,'/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-table {\n\tdisplay: flex;\n\tflex-direction: column;\n\tposition: relative;\n\theight: 100%;\n\twidth: 100%;\n\twhite-space: nowrap;\n\toverflow: hidden;\n}\n\n.monaco-table > .monaco-split-view2 {\n\tborder-bottom: 1px solid transparent;\n}\n\n.monaco-table > .monaco-list {\n\tflex: 1;\n}\n\n.monaco-table-tr {\n\tdisplay: flex;\n\theight: 100%;\n}\n\n.monaco-table-th {\n\twidth: 100%;\n\theight: 100%;\n\tfont-weight: bold;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.monaco-table-th,\n.monaco-table-td {\n\tbox-sizing: border-box;\n\tflex-shrink: 0;\n\toverflow: hidden;\n\twhite-space: nowrap;\n\ttext-overflow: ellipsis;\n}\n\n.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {\n\tcontent: "";\n\tposition: absolute;\n\tleft: calc(var(--vscode-sash-size) / 2);\n\twidth: 0;\n\tborder-left: 1px solid transparent;\n}\n\n.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2,\n.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {\n\ttransition: border-color 0.2s ease-out;\n}\n',""]);const a=r},6310:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-custom-toggle {\n\tmargin-left: 2px;\n\tfloat: left;\n\tcursor: pointer;\n\toverflow: hidden;\n\twidth: 20px;\n\theight: 20px;\n\tborder-radius: 3px;\n\tborder: 1px solid transparent;\n\tpadding: 1px;\n\tbox-sizing:\tborder-box;\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.monaco-custom-toggle:hover {\n\tbackground-color: var(--vscode-inputOption-hoverBackground);\n}\n\n.hc-black .monaco-custom-toggle:hover,\n.hc-light .monaco-custom-toggle:hover {\n\tborder: 1px dashed var(--vscode-focusBorder);\n}\n\n.hc-black .monaco-custom-toggle,\n.hc-light .monaco-custom-toggle {\n\tbackground: none;\n}\n\n.hc-black .monaco-custom-toggle:hover,\n.hc-light .monaco-custom-toggle:hover {\n\tbackground: none;\n}\n\n.monaco-custom-toggle.monaco-checkbox {\n\theight: 18px;\n\twidth: 18px;\n\tborder: 1px solid transparent;\n\tborder-radius: 3px;\n\tmargin-right: 9px;\n\tmargin-left: 0px;\n\tpadding: 0px;\n\topacity: 1;\n\tbackground-size: 16px !important;\n}\n\n.monaco-action-bar .checkbox-action-item {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-action-bar .checkbox-action-item > .monaco-custom-toggle.monaco-checkbox {\n\tmargin-right: 4px;\n}\n\n.monaco-action-bar .checkbox-action-item > .checkbox-label {\n\tfont-size: 12px;\n}\n\n/* hide check when unchecked */\n.monaco-custom-toggle.monaco-checkbox:not(.checked)::before {\n\tvisibility: hidden;\n}\n",""]);const a=r},6651:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-toolbar {\n\theight: 100%;\n}\n\n.monaco-toolbar .toolbar-toggle-more {\n\tdisplay: inline-block;\n\tpadding: 0;\n}\n",""]);const a=r},1766:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-tl-row {\n\tdisplay: flex;\n\theight: 100%;\n\talign-items: center;\n\tposition: relative;\n}\n\n.monaco-tl-row.disabled {\n\tcursor: default;\n}\n.monaco-tl-indent {\n\theight: 100%;\n\tposition: absolute;\n\ttop: 0;\n\tleft: 16px;\n\tpointer-events: none;\n}\n\n.hide-arrows .monaco-tl-indent {\n\tleft: 12px;\n}\n\n.monaco-tl-indent > .indent-guide {\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n\theight: 100%;\n\tborder-left: 1px solid transparent;\n}\n\n.monaco-workbench:not(.reduce-motion) .monaco-tl-indent > .indent-guide {\n\ttransition: border-color 0.1s linear;\n}\n\n.monaco-tl-twistie,\n.monaco-tl-contents {\n\theight: 100%;\n}\n\n.monaco-tl-twistie {\n\tfont-size: 10px;\n\ttext-align: right;\n\tpadding-right: 6px;\n\tflex-shrink: 0;\n\twidth: 16px;\n\tdisplay: flex !important;\n\talign-items: center;\n\tjustify-content: center;\n\ttransform: translateX(3px);\n}\n\n.monaco-tl-contents {\n\tflex: 1;\n\toverflow: hidden;\n}\n\n.monaco-tl-twistie::before {\n\tborder-radius: 20px;\n}\n\n.monaco-tl-twistie.collapsed::before {\n\ttransform: rotate(-90deg);\n}\n\n.monaco-tl-twistie.codicon-tree-item-loading::before {\n\t/* Use steps to throttle FPS to reduce CPU usage */\n\tanimation: codicon-spin 1.25s steps(30) infinite;\n}\n\n.monaco-tree-type-filter {\n\tposition: absolute;\n\ttop: 0;\n\tdisplay: flex;\n\tpadding: 3px;\n\tmax-width: 200px;\n\tz-index: 100;\n\tmargin: 0 6px;\n\tborder: 1px solid var(--vscode-widget-border);\n\tborder-bottom-left-radius: 4px;\n\tborder-bottom-right-radius: 4px;\n}\n\n.monaco-workbench:not(.reduce-motion) .monaco-tree-type-filter {\n\ttransition: top 0.3s;\n}\n\n.monaco-tree-type-filter.disabled {\n\ttop: -40px !important;\n}\n\n.monaco-tree-type-filter-grab {\n\tdisplay: flex !important;\n\talign-items: center;\n\tjustify-content: center;\n\tcursor: grab;\n\tmargin-right: 2px;\n}\n\n.monaco-tree-type-filter-grab.grabbing {\n\tcursor: grabbing;\n}\n\n.monaco-tree-type-filter-input {\n\tflex: 1;\n}\n\n.monaco-tree-type-filter-input .monaco-inputbox {\n\theight: 23px;\n}\n\n.monaco-tree-type-filter-input .monaco-inputbox > .ibwrapper > .input,\n.monaco-tree-type-filter-input .monaco-inputbox > .ibwrapper > .mirror {\n\tpadding: 2px 4px;\n}\n\n.monaco-tree-type-filter-input .monaco-findInput > .controls {\n\ttop: 2px;\n}\n\n.monaco-tree-type-filter-actionbar {\n\tmargin-left: 4px;\n}\n\n.monaco-tree-type-filter-actionbar .monaco-action-bar .action-label {\n\tpadding: 2px;\n}\n\n.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container{\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 0;\n\tz-index: 13; /* Settings editor uses z-index: 12 */\n\n\t/* TODO@benibenj temporary solution, all lists should provide their background */\n\tbackground-color: var(--vscode-sideBar-background);\n}\n\n.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row.monaco-list-row{\n\tposition: absolute;\n\twidth: 100%;\n\topacity: 1 !important; /* Settings editor uses opacity < 1 */\n\toverflow: hidden;\n\n\t/* TODO@benibenj temporary solution, all lists should provide their background */\n\tbackground-color: var(--vscode-sideBar-background);\n}\n\n.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row:hover{\n\tbackground-color: var(--vscode-list-hoverBackground) !important;\n\tcursor: pointer;\n}\n\n.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow{\n\tposition: absolute;\n\tbottom: -3px;\n\tleft: 0px;\n\theight: 3px;\n\twidth: 100%;\n\tbox-shadow: var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset;\n}\n",""]);const a=r},504:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .inputarea {\n\tmin-width: 0;\n\tmin-height: 0;\n\tmargin: 0;\n\tpadding: 0;\n\tposition: absolute;\n\toutline: none !important;\n\tresize: none;\n\tborder: none;\n\toverflow: hidden;\n\tcolor: transparent;\n\tbackground-color: transparent;\n\tz-index: -10;\n}\n/*.monaco-editor .inputarea {\n\tposition: fixed !important;\n\twidth: 800px !important;\n\theight: 500px !important;\n\ttop: initial !important;\n\tleft: initial !important;\n\tbottom: 0 !important;\n\tright: 0 !important;\n\tcolor: black !important;\n\tbackground: white !important;\n\tline-height: 15px !important;\n\tfont-size: 14px !important;\n\tz-index: 10 !important;\n}*/\n.monaco-editor .inputarea.ime-input {\n\tz-index: 10;\n\tcaret-color: var(--vscode-editorCursor-foreground);\n\tcolor: var(--vscode-editor-foreground);\n}\n",""]);const a=r},9463:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .blockDecorations-container {\n\tposition: absolute;\n\ttop: 0;\n\tpointer-events: none;\n}\n\n.monaco-editor .blockDecorations-block {\n\tposition: absolute;\n\tbox-sizing: border-box;\n}\n",""]);const a=r},1260:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .view-overlays .current-line {\n\tdisplay: block;\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\tbox-sizing: border-box;\n}\n\n.monaco-editor .margin-view-overlays .current-line {\n\tdisplay: block;\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\tbox-sizing: border-box;\n}\n\n.monaco-editor .margin-view-overlays .current-line.current-line-margin.current-line-margin-both {\n\tborder-right: 0;\n}\n",""]);const a=r},1329:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/*\n\tKeeping name short for faster parsing.\n\tcdr = core decorations rendering (div)\n*/\n.monaco-editor .lines-content .cdr {\n\tposition: absolute;\n}",""]);const a=r},4827:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .glyph-margin {\n\tposition: absolute;\n\ttop: 0;\n}\n\n/*\n\tKeeping name short for faster parsing.\n\tcgmr = core glyph margin rendering (div)\n*/\n.monaco-editor .glyph-margin-widgets .cgmr {\n\tposition: absolute;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/*\n\tEnsure spinning icons are pixel-perfectly centered and avoid wobble.\n\tThis is only applied to icons that spin to avoid unnecessary\n\tGPU layers and blurry subpixel AA.\n*/\n.monaco-editor .glyph-margin-widgets .cgmr.codicon-modifier-spin::before {\n\tposition: absolute;\n\ttop: 50%;\n\tleft: 50%;\n\ttransform: translate(-50%, -50%);\n}\n",""]);const a=r},6848:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .lines-content .core-guide {\n\tposition: absolute;\n\tbox-sizing: border-box;\n}\n",""]);const a=r},6184:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .margin-view-overlays .line-numbers {\n\tfont-variant-numeric: tabular-nums;\n\tposition: absolute;\n\ttext-align: right;\n\tdisplay: inline-block;\n\tvertical-align: middle;\n\tbox-sizing: border-box;\n\tcursor: default;\n\theight: 100%;\n}\n\n.monaco-editor .relative-current-line-number {\n\ttext-align: left;\n\tdisplay: inline-block;\n\twidth: 100%;\n}\n\n.monaco-editor .margin-view-overlays .line-numbers.lh-odd {\n\tmargin-top: 1px;\n}\n\n.monaco-editor .line-numbers {\n\tcolor: var(--vscode-editorLineNumber-foreground);\n}\n\n.monaco-editor .line-numbers.active-line-number {\n\tcolor: var(--vscode-editorLineNumber-activeForeground);\n}\n",""]);const a=r},9565:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* Uncomment to see lines flashing when they're painted */\n/*.monaco-editor .view-lines > .view-line {\n\tbackground-color: none;\n\tanimation-name: flash-background;\n\tanimation-duration: 800ms;\n}\n@keyframes flash-background {\n\t0% { background-color: lightgreen; }\n\t100% { background-color: none }\n}*/\n\n.mtkcontrol {\n\tcolor: rgb(255, 255, 255) !important;\n\tbackground: rgb(150, 0, 0) !important;\n}\n\n.mtkoverflow {\n\tbackground-color: var(--vscode-button-background, var(--vscode-editor-background));\n\tcolor: var(--vscode-button-foreground, var(--vscode-editor-foreground));\n\tborder-width: 1px;\n\tborder-style: solid;\n\tborder-color: var(--vscode-contrastBorder);\n\tborder-radius: 2px;\n\tpadding: 4px;\n\tcursor: pointer;\n}\n.mtkoverflow:hover {\n\tbackground-color: var(--vscode-button-hoverBackground);\n}\n\n.monaco-editor.no-user-select .lines-content,\n.monaco-editor.no-user-select .view-line,\n.monaco-editor.no-user-select .view-lines {\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n/* Use user-select: text for lookup feature on macOS */\n/* https://github.com/microsoft/vscode/issues/85632 */\n.monaco-editor.mac .lines-content:hover,\n.monaco-editor.mac .view-line:hover,\n.monaco-editor.mac .view-lines:hover {\n\tuser-select: text;\n\t-webkit-user-select: text;\n\t-ms-user-select: text;\n}\n\n.monaco-editor.enable-user-select {\n\tuser-select: initial;\n\t-webkit-user-select: initial;\n}\n\n.monaco-editor .view-lines {\n\twhite-space: nowrap;\n}\n\n.monaco-editor .view-line {\n\tposition: absolute;\n\twidth: 100%;\n}\n\n.monaco-editor .mtkw {\n\tcolor: var(--vscode-editorWhitespace-foreground) !important;\n}\n\n.monaco-editor .mtkz {\n\tdisplay: inline-block;\n\tcolor: var(--vscode-editorWhitespace-foreground) !important;\n}\n\n/* TODO@tokenization bootstrap fix */\n/*.monaco-editor .view-line > span > span {\n\tfloat: none;\n\tmin-height: inherit;\n\tmargin-left: inherit;\n}*/\n",""]);const a=r},4444:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n.monaco-editor .lines-decorations {\n\tposition: absolute;\n\ttop: 0;\n\tbackground: white;\n}\n\n/*\n\tKeeping name short for faster parsing.\n\tcldr = core lines decorations rendering (div)\n*/\n.monaco-editor .margin-view-overlays .cldr {\n\tposition: absolute;\n\theight: 100%;\n}",""]);const a=r},1596:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .margin {\n\tbackground-color: var(--vscode-editorGutter-background);\n}\n",""]);const a=r},9364:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/*\n\tKeeping name short for faster parsing.\n\tcmdr = core margin decorations rendering (div)\n*/\n.monaco-editor .margin-view-overlays .cmdr {\n\tposition: absolute;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n}",""]);const a=r},563:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* START cover the case that slider is visible on mouseover */\n.monaco-editor .minimap.slider-mouseover .minimap-slider {\n\topacity: 0;\n\ttransition: opacity 100ms linear;\n}\n.monaco-editor .minimap.slider-mouseover:hover .minimap-slider {\n\topacity: 1;\n}\n.monaco-editor .minimap.slider-mouseover .minimap-slider.active {\n\topacity: 1;\n}\n/* END cover the case that slider is visible on mouseover */\n.monaco-editor .minimap-slider .minimap-slider-horizontal {\n\tbackground: var(--vscode-minimapSlider-background);\n}\n.monaco-editor .minimap-slider:hover .minimap-slider-horizontal {\n\tbackground: var(--vscode-minimapSlider-hoverBackground);\n}\n.monaco-editor .minimap-slider.active .minimap-slider-horizontal {\n\tbackground: var(--vscode-minimapSlider-activeBackground);\n}\n.monaco-editor .minimap-shadow-visible {\n\tbox-shadow: var(--vscode-scrollbar-shadow) -6px 0 6px -6px inset;\n}\n.monaco-editor .minimap-shadow-hidden {\n\tposition: absolute;\n\twidth: 0;\n}\n.monaco-editor .minimap-shadow-visible {\n\tposition: absolute;\n\tleft: -6px;\n\twidth: 6px;\n}\n.monaco-editor.no-minimap-shadow .minimap-shadow-visible {\n\tposition: absolute;\n\tleft: -1px;\n\twidth: 1px;\n}\n\n/* 0.5s fade in/out for the minimap */\n.minimap.autohide {\n\topacity: 0;\n\ttransition: opacity 0.5s;\n}\n.minimap.autohide:hover {\n\topacity: 1;\n}\n\n.monaco-editor .minimap {\n\tz-index: 5;\n}\n",""]);const a=r},9822:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n.monaco-editor .overlayWidgets {\n\tposition: absolute;\n\ttop: 0;\n\tleft:0;\n}",""]);const a=r},9443:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .view-ruler {\n\tposition: absolute;\n\ttop: 0;\n\tbox-shadow: 1px 0 0 0 var(--vscode-editorRuler-foreground) inset;\n}\n",""]);const a=r},9649:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .scroll-decoration {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\theight: 6px;\n\tbox-shadow: var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset;\n}\n",""]);const a=r},2595:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/*\n\tKeeping name short for faster parsing.\n\tcslr = core selections layer rendering (div)\n*/\n.monaco-editor .lines-content .cslr {\n\tposition: absolute;\n}\n\n.monaco-editor .focused .selected-text {\n\tbackground-color: var(--vscode-editor-selectionBackground);\n}\n\n.monaco-editor .selected-text {\n\tbackground-color: var(--vscode-editor-inactiveSelectionBackground);\n}\n\n.monaco-editor\t\t\t.top-left-radius\t\t{ border-top-left-radius: 3px; }\n.monaco-editor\t\t\t.bottom-left-radius\t\t{ border-bottom-left-radius: 3px; }\n.monaco-editor\t\t\t.top-right-radius\t\t{ border-top-right-radius: 3px; }\n.monaco-editor\t\t\t.bottom-right-radius\t{ border-bottom-right-radius: 3px; }\n\n.monaco-editor.hc-black .top-left-radius\t\t{ border-top-left-radius: 0; }\n.monaco-editor.hc-black .bottom-left-radius\t\t{ border-bottom-left-radius: 0; }\n.monaco-editor.hc-black .top-right-radius\t\t{ border-top-right-radius: 0; }\n.monaco-editor.hc-black .bottom-right-radius\t{ border-bottom-right-radius: 0; }\n\n.monaco-editor.hc-light .top-left-radius\t\t{ border-top-left-radius: 0; }\n.monaco-editor.hc-light .bottom-left-radius\t\t{ border-bottom-left-radius: 0; }\n.monaco-editor.hc-light .top-right-radius\t\t{ border-top-right-radius: 0; }\n.monaco-editor.hc-light .bottom-right-radius\t{ border-bottom-right-radius: 0; }\n",""]);const a=r},4057:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n.monaco-editor .cursors-layer {\n\tposition: absolute;\n\ttop: 0;\n}\n\n.monaco-editor .cursors-layer > .cursor {\n\tposition: absolute;\n\toverflow: hidden;\n\tbox-sizing: border-box;\n}\n\n/* -- smooth-caret-animation -- */\n.monaco-editor .cursors-layer.cursor-smooth-caret-animation > .cursor {\n\ttransition: all 80ms;\n}\n\n/* -- block-outline-style -- */\n.monaco-editor .cursors-layer.cursor-block-outline-style > .cursor {\n\tbackground: transparent !important;\n\tborder-style: solid;\n\tborder-width: 1px;\n}\n\n/* -- underline-style -- */\n.monaco-editor .cursors-layer.cursor-underline-style > .cursor {\n\tborder-bottom-width: 2px;\n\tborder-bottom-style: solid;\n\tbackground: transparent !important;\n}\n\n/* -- underline-thin-style -- */\n.monaco-editor .cursors-layer.cursor-underline-thin-style > .cursor {\n\tborder-bottom-width: 1px;\n\tborder-bottom-style: solid;\n\tbackground: transparent !important;\n}\n\n@keyframes monaco-cursor-smooth {\n\t0%,\n\t20% {\n\t\topacity: 1;\n\t}\n\t60%,\n\t100% {\n\t\topacity: 0;\n\t}\n}\n\n@keyframes monaco-cursor-phase {\n\t0%,\n\t20% {\n\t\topacity: 1;\n\t}\n\t90%,\n\t100% {\n\t\topacity: 0;\n\t}\n}\n\n@keyframes monaco-cursor-expand {\n\t0%,\n\t20% {\n\t\ttransform: scaleY(1);\n\t}\n\t80%,\n\t100% {\n\t\ttransform: scaleY(0);\n\t}\n}\n\n.cursor-smooth {\n\tanimation: monaco-cursor-smooth 0.5s ease-in-out 0s 20 alternate;\n}\n\n.cursor-phase {\n\tanimation: monaco-cursor-phase 0.5s ease-in-out 0s 20 alternate;\n}\n\n.cursor-expand > .cursor {\n\tanimation: monaco-cursor-expand 0.5s ease-in-out 0s 20 alternate;\n}\n",""]);const a=r},9991:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .mwh {\n\tposition: absolute;\n\tcolor: var(--vscode-editorWhitespace-foreground) !important;\n}\n",""]);const a=r},5325:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-diff-editor .diff-review-line-number {\n\ttext-align: right;\n\tdisplay: inline-block;\n\tcolor: var(--vscode-editorLineNumber-foreground);\n}\n\n.monaco-diff-editor .diff-review {\n\tposition: absolute;\n\tuser-select: none;\n\t-webkit-user-select: none;\n\tz-index: 99;\n}\n\n.monaco-diff-editor .diff-review-summary {\n\tpadding-left: 10px;\n}\n\n.monaco-diff-editor .diff-review-shadow {\n\tposition: absolute;\n\tbox-shadow: var(--vscode-scrollbar-shadow) 0 -6px 6px -6px inset;\n}\n\n.monaco-diff-editor .diff-review-row {\n\twhite-space: pre;\n}\n\n.monaco-diff-editor .diff-review-table {\n\tdisplay: table;\n\tmin-width: 100%;\n}\n\n.monaco-diff-editor .diff-review-row {\n\tdisplay: table-row;\n\twidth: 100%;\n}\n\n.monaco-diff-editor .diff-review-spacer {\n\tdisplay: inline-block;\n\twidth: 10px;\n\tvertical-align: middle;\n}\n\n.monaco-diff-editor .diff-review-spacer > .codicon {\n\tfont-size: 9px !important;\n}\n\n.monaco-diff-editor .diff-review-actions {\n\tdisplay: inline-block;\n\tposition: absolute;\n\tright: 10px;\n\ttop: 2px;\n\tz-index: 100;\n}\n\n.monaco-diff-editor .diff-review-actions .action-label {\n\twidth: 16px;\n\theight: 16px;\n\tmargin: 2px 0;\n}\n\n.monaco-diff-editor .revertButton {\n\tcursor: pointer;\n}\n",""]);const a=r},3050:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .diff-hidden-lines-widget {\n\twidth: 100%;\n}\n\n.monaco-editor .diff-hidden-lines {\n\theight: 0px; /* The children each have a fixed height, the transform confuses the browser */\n\ttransform: translate(0px, -10px);\n\tfont-size: 13px;\n\tline-height: 14px;\n}\n\n.monaco-editor .diff-hidden-lines:not(.dragging) .top:hover,\n.monaco-editor .diff-hidden-lines:not(.dragging) .bottom:hover,\n.monaco-editor .diff-hidden-lines .top.dragging,\n.monaco-editor .diff-hidden-lines .bottom.dragging {\n\tbackground-color: var(--vscode-focusBorder);\n}\n\n.monaco-editor .diff-hidden-lines .top,\n.monaco-editor .diff-hidden-lines .bottom {\n\ttransition: background-color 0.1s ease-out;\n\theight: 4px;\n\tbackground-color: transparent;\n\tbackground-clip: padding-box;\n\tborder-bottom: 2px solid transparent;\n\tborder-top: 4px solid transparent;\n\t/*cursor: n-resize;*/\n}\n\n.monaco-editor.draggingUnchangedRegion.canMoveTop:not(.canMoveBottom) *,\n.monaco-editor .diff-hidden-lines .top.canMoveTop:not(.canMoveBottom),\n.monaco-editor .diff-hidden-lines .bottom.canMoveTop:not(.canMoveBottom) {\n\tcursor: n-resize !important;\n}\n\n.monaco-editor.draggingUnchangedRegion:not(.canMoveTop).canMoveBottom *,\n.monaco-editor .diff-hidden-lines .top:not(.canMoveTop).canMoveBottom,\n.monaco-editor .diff-hidden-lines .bottom:not(.canMoveTop).canMoveBottom {\n\tcursor: s-resize !important;\n}\n\n.monaco-editor.draggingUnchangedRegion.canMoveTop.canMoveBottom *,\n.monaco-editor .diff-hidden-lines .top.canMoveTop.canMoveBottom,\n.monaco-editor .diff-hidden-lines .bottom.canMoveTop.canMoveBottom {\n\tcursor: ns-resize !important;\n}\n\n.monaco-editor .diff-hidden-lines .top {\n\ttransform: translate(0px, 4px);\n}\n\n.monaco-editor .diff-hidden-lines .bottom {\n\ttransform: translate(0px, -6px);\n}\n\n.monaco-editor .diff-unchanged-lines {\n\tbackground: var(--vscode-diffEditor-unchangedCodeBackground);\n}\n\n.monaco-editor .noModificationsOverlay {\n\tz-index: 1;\n\tbackground: var(--vscode-editor-background);\n\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n}\n\n\n.monaco-editor .diff-hidden-lines .center {\n\tbackground: var(--vscode-diffEditor-unchangedRegionBackground);\n\tcolor: var(--vscode-diffEditor-unchangedRegionForeground);\n\toverflow: hidden;\n\tdisplay: block;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n\n\theight: 24px;\n\tbox-shadow: inset 0 -5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow), inset 0 5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow);\n}\n\n.monaco-editor .diff-hidden-lines .center span.codicon {\n\tvertical-align: middle;\n}\n\n.monaco-editor .diff-hidden-lines .center a:hover .codicon {\n\tcursor: pointer;\n\tcolor: var(--vscode-editorLink-activeForeground) !important;\n}\n\n.monaco-editor .diff-hidden-lines div.breadcrumb-item {\n\tcursor: pointer;\n}\n\n.monaco-editor .diff-hidden-lines div.breadcrumb-item:hover {\n\tcolor: var(--vscode-editorLink-activeForeground);\n}\n\n.monaco-editor .movedOriginal {\n\tborder: 2px solid var(--vscode-diffEditor-move-border);\n}\n\n.monaco-editor .movedModified {\n\tborder: 2px solid var(--vscode-diffEditor-move-border);\n}\n\n.monaco-editor .movedOriginal.currentMove, .monaco-editor .movedModified.currentMove {\n\tborder: 2px solid var(--vscode-diffEditor-moveActive-border);\n}\n\n.monaco-diff-editor .moved-blocks-lines path.currentMove {\n\tstroke: var(--vscode-diffEditor-moveActive-border);\n}\n\n.monaco-diff-editor .moved-blocks-lines path {\n\tpointer-events: visiblestroke;\n}\n\n.monaco-diff-editor .moved-blocks-lines .arrow {\n\tfill: var(--vscode-diffEditor-move-border);\n}\n\n.monaco-diff-editor .moved-blocks-lines .arrow.currentMove {\n\tfill: var(--vscode-diffEditor-moveActive-border);\n}\n\n.monaco-diff-editor .moved-blocks-lines .arrow-rectangle {\n\tfill: var(--vscode-editor-background);\n}\n\n.monaco-diff-editor .moved-blocks-lines {\n\tposition: absolute;\n\tpointer-events: none;\n}\n\n.monaco-diff-editor .moved-blocks-lines path {\n\tfill: none;\n\tstroke: var(--vscode-diffEditor-move-border);\n\tstroke-width: 2;\n}\n\n.monaco-editor .char-delete.diff-range-empty {\n\tmargin-left: -1px;\n\tborder-left: solid var(--vscode-diffEditor-removedTextBackground) 3px;\n}\n\n.monaco-editor .char-insert.diff-range-empty {\n\tborder-left: solid var(--vscode-diffEditor-insertedTextBackground) 3px;\n}\n\n.monaco-editor .fold-unchanged {\n\tcursor: pointer;\n}\n\n.monaco-diff-editor .diff-moved-code-block {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\tmargin-top: -4px;\n}\n\n.monaco-diff-editor .diff-moved-code-block .action-bar .action-label.codicon {\n\twidth: 12px;\n\theight: 12px;\n\tfont-size: 12px;\n}\n\n/* ---------- DiffEditor ---------- */\n\n.monaco-diff-editor .diffOverview {\n\tz-index: 9;\n}\n\n.monaco-diff-editor .diffOverview .diffViewport {\n\tz-index: 10;\n}\n\n/* colors not externalized: using transparancy on background */\n.monaco-diff-editor.vs\t\t\t.diffOverview { background: rgba(0, 0, 0, 0.03); }\n.monaco-diff-editor.vs-dark\t\t.diffOverview { background: rgba(255, 255, 255, 0.01); }\n\n.monaco-scrollable-element.modified-in-monaco-diff-editor.vs\t\t.scrollbar { background: rgba(0,0,0,0); }\n.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark\t.scrollbar { background: rgba(0,0,0,0); }\n.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black\t.scrollbar { background: none; }\n.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-light\t.scrollbar { background: none; }\n\n.monaco-scrollable-element.modified-in-monaco-diff-editor .slider {\n\tz-index: 10;\n}\n.modified-in-monaco-diff-editor\t\t\t\t.slider.active { background: rgba(171, 171, 171, .4); }\n.modified-in-monaco-diff-editor.hc-black\t.slider.active { background: none; }\n.modified-in-monaco-diff-editor.hc-light\t.slider.active { background: none; }\n\n/* ---------- Diff ---------- */\n\n.monaco-editor .insert-sign,\n.monaco-diff-editor .insert-sign,\n.monaco-editor .delete-sign,\n.monaco-diff-editor .delete-sign {\n\tfont-size: 11px !important;\n\topacity: 0.7 !important;\n\tdisplay: flex !important;\n\talign-items: center;\n}\n.monaco-editor.hc-black .insert-sign,\n.monaco-diff-editor.hc-black .insert-sign,\n.monaco-editor.hc-black .delete-sign,\n.monaco-diff-editor.hc-black .delete-sign,\n.monaco-editor.hc-light .insert-sign,\n.monaco-diff-editor.hc-light .insert-sign,\n.monaco-editor.hc-light .delete-sign,\n.monaco-diff-editor.hc-light .delete-sign {\n\topacity: 1;\n}\n\n.monaco-editor .inline-deleted-margin-view-zone {\n\ttext-align: right;\n}\n.monaco-editor .inline-added-margin-view-zone {\n\ttext-align: right;\n}\n\n.monaco-editor .arrow-revert-change {\n\tz-index: 10;\n\tposition: absolute;\n}\n\n.monaco-editor .arrow-revert-change:hover {\n\tcursor: pointer;\n}\n\n/* ---------- Inline Diff ---------- */\n\n.monaco-editor .view-zones .view-lines .view-line span {\n\tdisplay: inline-block;\n}\n\n.monaco-editor .margin-view-zones .lightbulb-glyph:hover {\n\tcursor: pointer;\n}\n\n.monaco-editor .char-insert, .monaco-diff-editor .char-insert {\n\tbackground-color: var(--vscode-diffEditor-insertedTextBackground);\n}\n\n.monaco-editor .line-insert, .monaco-diff-editor .line-insert {\n\tbackground-color: var(--vscode-diffEditor-insertedLineBackground, var(--vscode-diffEditor-insertedTextBackground));\n}\n\n.monaco-editor .line-insert,\n.monaco-editor .char-insert {\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-diffEditor-insertedTextBorder);\n}\n.monaco-editor.hc-black .line-insert, .monaco-editor.hc-light .line-insert,\n.monaco-editor.hc-black .char-insert, .monaco-editor.hc-light .char-insert {\n\tborder-style: dashed;\n}\n\n.monaco-editor .line-delete,\n.monaco-editor .char-delete {\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-diffEditor-removedTextBorder);\n}\n.monaco-editor.hc-black .line-delete, .monaco-editor.hc-light .line-delete,\n.monaco-editor.hc-black .char-delete, .monaco-editor.hc-light .char-delete {\n\tborder-style: dashed;\n}\n\n.monaco-editor .inline-added-margin-view-zone,\n.monaco-editor .gutter-insert, .monaco-diff-editor .gutter-insert {\n\tbackground-color: var(--vscode-diffEditorGutter-insertedLineBackground, var(--vscode-diffEditor-insertedLineBackground), var(--vscode-diffEditor-insertedTextBackground));\n}\n\n.monaco-editor .char-delete, .monaco-diff-editor .char-delete {\n\tbackground-color: var(--vscode-diffEditor-removedTextBackground);\n}\n\n.monaco-editor .line-delete, .monaco-diff-editor .line-delete {\n\tbackground-color: var(--vscode-diffEditor-removedLineBackground, var(--vscode-diffEditor-removedTextBackground));\n}\n\n.monaco-editor .inline-deleted-margin-view-zone,\n.monaco-editor .gutter-delete, .monaco-diff-editor .gutter-delete {\n\tbackground-color: var(--vscode-diffEditorGutter-removedLineBackground, var(--vscode-diffEditor-removedLineBackground), var(--vscode-diffEditor-removedTextBackground));\n}\n\n.monaco-diff-editor.side-by-side .editor.modified {\n\tbox-shadow: -6px 0 5px -5px var(--vscode-scrollbar-shadow);\n\tborder-left: 1px solid var(--vscode-diffEditor-border);\n}\n\n.monaco-diff-editor .diffViewport {\n\tbackground: var(--vscode-scrollbarSlider-background);\n}\n\n.monaco-diff-editor .diffViewport:hover {\n\tbackground: var(--vscode-scrollbarSlider-hoverBackground);\n}\n\n.monaco-diff-editor .diffViewport:active {\n\tbackground: var(--vscode-scrollbarSlider-activeBackground);\n}\n\n.monaco-editor .diagonal-fill {\n\tbackground-image: linear-gradient(\n\t\t-45deg,\n\t\tvar(--vscode-diffEditor-diagonalFill) 12.5%,\n\t\t#0000 12.5%, #0000 50%,\n\t\tvar(--vscode-diffEditor-diagonalFill) 50%, var(--vscode-diffEditor-diagonalFill) 62.5%,\n\t\t#0000 62.5%, #0000 100%\n\t);\n\tbackground-size: 8px 8px;\n}\n",""]);const a=r},7337:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* -------------------- IE10 remove auto clear button -------------------- */\n\n::-ms-clear {\n\tdisplay: none;\n}\n\n/* All widgets */\n/* I am not a big fan of this rule */\n.monaco-editor .editor-widget input {\n\tcolor: inherit;\n}\n\n/* -------------------- Editor -------------------- */\n\n.monaco-editor {\n\tposition: relative;\n\toverflow: visible;\n\t-webkit-text-size-adjust: 100%;\n\tcolor: var(--vscode-editor-foreground);\n\tbackground-color: var(--vscode-editor-background);\n}\n.monaco-editor-background {\n\tbackground-color: var(--vscode-editor-background);\n}\n.monaco-editor .rangeHighlight {\n\tbackground-color: var(--vscode-editor-rangeHighlightBackground);\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-editor-rangeHighlightBorder);\n}\n.monaco-editor.hc-black .rangeHighlight, .monaco-editor.hc-light .rangeHighlight {\n\tborder-style: dotted;\n}\n.monaco-editor .symbolHighlight {\n\tbackground-color: var(--vscode-editor-symbolHighlightBackground);\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-editor-symbolHighlightBorder);\n}\n.monaco-editor.hc-black .symbolHighlight, .monaco-editor.hc-light .symbolHighlight {\n\tborder-style: dotted;\n}\n\n/* -------------------- Misc -------------------- */\n\n.monaco-editor .overflow-guard {\n\tposition: relative;\n\toverflow: hidden;\n}\n\n.monaco-editor .view-overlays {\n\tposition: absolute;\n\ttop: 0;\n}\n\n/*\n.monaco-editor .auto-closed-character {\n\topacity: 0.3;\n}\n*/\n\n\n.monaco-editor .squiggly-error {\n\tborder-bottom: 4px double var(--vscode-editorError-border);\n}\n.monaco-editor .squiggly-error::before {\n\tdisplay: block;\n\tcontent: '';\n\twidth: 100%;\n\theight: 100%;\n\tbackground: var(--vscode-editorError-background);\n}\n.monaco-editor .squiggly-warning {\n\tborder-bottom: 4px double var(--vscode-editorWarning-border);\n}\n.monaco-editor .squiggly-warning::before {\n\tdisplay: block;\n\tcontent: '';\n\twidth: 100%;\n\theight: 100%;\n\tbackground: var(--vscode-editorWarning-background);\n}\n.monaco-editor .squiggly-info {\n\tborder-bottom: 4px double var(--vscode-editorInfo-border);\n}\n.monaco-editor .squiggly-info::before {\n\tdisplay: block;\n\tcontent: '';\n\twidth: 100%;\n\theight: 100%;\n\tbackground: var(--vscode-editorInfo-background);\n}\n.monaco-editor .squiggly-hint {\n\tborder-bottom: 2px dotted var(--vscode-editorHint-border);\n}\n.monaco-editor.showUnused .squiggly-unnecessary {\n\tborder-bottom: 2px dashed var(--vscode-editorUnnecessaryCode-border);\n}\n.monaco-editor.showDeprecated .squiggly-inline-deprecated {\n\ttext-decoration: line-through;\n\ttext-decoration-color: var(--vscode-editor-foreground, inherit);\n}\n",""]);const a=r},6508:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-component .multiDiffEntry {\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.monaco-component .multiDiffEntry .editorParent {\n\tborder-left: 2px var(--vscode-tab-inactiveBackground) solid;\n}\n\n.monaco-component .multiDiffEntry.focused .editorParent {\n\tborder-left: 2px var(--vscode-notebook-focusedCellBorder) solid;\n}\n\n.monaco-component .multiDiffEntry .editorParent .editorContainer {\n\tborder-left: 17px var(--vscode-tab-inactiveBackground) solid;\n}\n\n.monaco-component .multiDiffEntry .collapse-button {\n\tmargin: 0 5px;\n\tcursor: pointer;\n}\n\n.monaco-component .multiDiffEntry .collapse-button a {\n\tdisplay: block;\n}\n\n.monaco-component .multiDiffEntry .header {\n\tdisplay: flex;\n\talign-items: center;\n\tpadding: 8px 5px;\n\tcolor: var(--vscode-foreground);\n\tbackground: var(--vscode-editor-background);\n\tz-index: 1000;\n\n\tborder-bottom: 1px var(--vscode-sideBarSectionHeader-border) solid;\n\tborder-top: 1px var(--vscode-sideBarSectionHeader-border) solid;\n\n\tborder-left: 2px var(--vscode-editor-background) solid;\n}\n.monaco-component .multiDiffEntry.focused .header {\n\tborder-left: 2px var(--vscode-notebook-focusedCellBorder) solid;\n}\n\n.monaco-component .multiDiffEntry .header.shadow {\n\tbox-shadow: var(--vscode-scrollbar-shadow) 0px 6px 6px -6px;\n}\n\n.monaco-component .multiDiffEntry .header .title {\n\tflex: 1;\n\tfont-size: 14px;\n\tline-height: 22px;\n}\n\n.monaco-component .multiDiffEntry .header .actions {\n\tpadding: 0 8px;\n}\n",""]);const a=r},4055:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .selection-anchor {\n\tbackground-color: #007ACC;\n\twidth: 2px !important;\n}\n",""]);const a=r},2205:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .bracket-match {\n\tbox-sizing: border-box;\n\tbackground-color: var(--vscode-editorBracketMatch-background);\n\tborder: 1px solid var(--vscode-editorBracketMatch-border);\n}\n",""]);const a=r},2874:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .lightBulbWidget {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.monaco-editor .lightBulbWidget:hover{\n\tcursor: pointer;\n}\n\n.monaco-editor .lightBulbWidget.codicon-light-bulb,\n.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle {\n\tcolor: var(--vscode-editorLightBulb-foreground);\n}\n\n.monaco-editor .lightBulbWidget.codicon-lightbulb-autofix,\n.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle-autofix {\n\tcolor: var(--vscode-editorLightBulbAutoFix-foreground, var(--vscode-editorLightBulb-foreground));\n}\n\n.monaco-editor .lightBulbWidget.codicon-sparkle-filled {\n\tcolor: var(--vscode-editorLightBulbAi-foreground, var(--vscode-icon-foreground));\n}\n\n.monaco-editor .lightBulbWidget:before {\n\tposition: relative;\n\tz-index: 2;\n}\n\n.monaco-editor .lightBulbWidget:after {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tcontent: '';\n\tdisplay: block;\n\twidth: 100%;\n\theight: 100%;\n\topacity: 0.3;\n\tbackground-color: var(--vscode-editor-background);\n\tz-index: 1;\n}\n",""]);const a=r},2849:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .codelens-decoration {\n\toverflow: hidden;\n\tdisplay: inline-block;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n\tcolor: var(--vscode-editorCodeLens-foreground);\n\tline-height: var(--vscode-editorCodeLens-lineHeight);\n\tfont-size: var(--vscode-editorCodeLens-fontSize);\n\tpadding-right: calc(var(--vscode-editorCodeLens-fontSize)*0.5);\n\tfont-feature-settings: var(--vscode-editorCodeLens-fontFeatureSettings);\n\tfont-family: var(--vscode-editorCodeLens-fontFamily), var(--vscode-editorCodeLens-fontFamilyDefault);\n}\n\n.monaco-editor .codelens-decoration>span,\n.monaco-editor .codelens-decoration>a {\n\tuser-select: none;\n\t-webkit-user-select: none;\n\twhite-space: nowrap;\n\tvertical-align: sub;\n}\n\n.monaco-editor .codelens-decoration>a {\n\ttext-decoration: none;\n}\n\n.monaco-editor .codelens-decoration>a:hover {\n\tcursor: pointer;\n\tcolor: var(--vscode-editorLink-activeForeground) !important;\n}\n\n.monaco-editor .codelens-decoration>a:hover .codicon {\n\tcolor: var(--vscode-editorLink-activeForeground) !important;\n}\n\n.monaco-editor .codelens-decoration .codicon {\n\tvertical-align: middle;\n\tcolor: currentColor !important;\n\tcolor: var(--vscode-editorCodeLens-foreground);\n\tline-height: var(--vscode-editorCodeLens-lineHeight);\n\tfont-size: var(--vscode-editorCodeLens-fontSize);\n}\n\n.monaco-editor .codelens-decoration>a:hover .codicon::before {\n\tcursor: pointer;\n}\n\n@keyframes fadein {\n\t0% {\n\t\topacity: 0;\n\t\tvisibility: visible;\n\t}\n\n\t100% {\n\t\topacity: 1;\n\t}\n}\n\n.monaco-editor .codelens-decoration.fadein {\n\tanimation: fadein 0.1s linear;\n}\n",""]);const a=r},2313:(e,t,i)=>{i.d(t,{Z:()=>u});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s),a=i(1667),l=i.n(a),h=new URL(i(4748),i.b),d=r()(o()),c=l()(h);d.push([e.id,`/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.colorpicker-widget {\n\theight: 190px;\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n/* Decoration */\n\n.colorpicker-color-decoration,\n.hc-light .colorpicker-color-decoration {\n\tborder: solid 0.1em #000;\n\tbox-sizing: border-box;\n\tmargin: 0.1em 0.2em 0 0.2em;\n\twidth: 0.8em;\n\theight: 0.8em;\n\tline-height: 0.8em;\n\tdisplay: inline-block;\n\tcursor: pointer;\n}\n\n.hc-black .colorpicker-color-decoration,\n.vs-dark .colorpicker-color-decoration {\n\tborder: solid 0.1em #eee;\n}\n\n/* Header */\n\n.colorpicker-header {\n\tdisplay: flex;\n\theight: 24px;\n\tposition: relative;\n\tbackground: url(${c});\n\tbackground-size: 9px 9px;\n\timage-rendering: pixelated;\n}\n\n.colorpicker-header .picked-color {\n\twidth: 240px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tline-height: 24px;\n\tcursor: pointer;\n\tcolor: white;\n\tflex: 1;\n\twhite-space: nowrap;\n\toverflow: hidden;\n}\n\n.colorpicker-header .picked-color .picked-color-presentation {\n\twhite-space: nowrap;\n\tmargin-left: 5px;\n\tmargin-right: 5px;\n}\n\n.colorpicker-header .picked-color .codicon {\n\tcolor: inherit;\n\tfont-size: 14px;\n}\n\n.colorpicker-header .picked-color.light {\n\tcolor: black;\n}\n\n.colorpicker-header .original-color {\n\twidth: 74px;\n\tz-index: inherit;\n\tcursor: pointer;\n}\n\n.standalone-colorpicker {\n\tcolor: var(--vscode-editorHoverWidget-foreground);\n\tbackground-color: var(--vscode-editorHoverWidget-background);\n\tborder: 1px solid var(--vscode-editorHoverWidget-border);\n}\n\n.colorpicker-header.standalone-colorpicker {\n\tborder-bottom: none;\n}\n\n.colorpicker-header .close-button {\n\tcursor: pointer;\n\tbackground-color: var(--vscode-editorHoverWidget-background);\n\tborder-left: 1px solid var(--vscode-editorHoverWidget-border);\n}\n\n.colorpicker-header .close-button-inner-div {\n\twidth: 100%;\n\theight: 100%;\n\ttext-align: center;\n}\n\n.colorpicker-header .close-button-inner-div:hover {\n\tbackground-color: var(--vscode-toolbar-hoverBackground);\n}\n\n.colorpicker-header .close-icon {\n\tpadding: 3px;\n}\n\n/* Body */\n\n.colorpicker-body {\n\tdisplay: flex;\n\tpadding: 8px;\n\tposition: relative;\n}\n\n.colorpicker-body .saturation-wrap {\n\toverflow: hidden;\n\theight: 150px;\n\tposition: relative;\n\tmin-width: 220px;\n\tflex: 1;\n}\n\n.colorpicker-body .saturation-box {\n\theight: 150px;\n\tposition: absolute;\n}\n\n.colorpicker-body .saturation-selection {\n\twidth: 9px;\n\theight: 9px;\n\tmargin: -5px 0 0 -5px;\n\tborder: 1px solid rgb(255, 255, 255);\n\tborder-radius: 100%;\n\tbox-shadow: 0px 0px 2px rgba(0, 0, 0, 0.8);\n\tposition: absolute;\n}\n\n.colorpicker-body .strip {\n\twidth: 25px;\n\theight: 150px;\n}\n\n.colorpicker-body .standalone-strip {\n\twidth: 25px;\n\theight: 122px;\n}\n\n.colorpicker-body .hue-strip {\n\tposition: relative;\n\tmargin-left: 8px;\n\tcursor: grab;\n\tbackground: linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);\n}\n\n.colorpicker-body .opacity-strip {\n\tposition: relative;\n\tmargin-left: 8px;\n\tcursor: grab;\n\tbackground: url(${c});\n\tbackground-size: 9px 9px;\n\timage-rendering: pixelated;\n}\n\n.colorpicker-body .strip.grabbing {\n\tcursor: grabbing;\n}\n\n.colorpicker-body .slider {\n\tposition: absolute;\n\ttop: 0;\n\tleft: -2px;\n\twidth: calc(100% + 4px);\n\theight: 4px;\n\tbox-sizing: border-box;\n\tborder: 1px solid rgba(255, 255, 255, 0.71);\n\tbox-shadow: 0px 0px 1px rgba(0, 0, 0, 0.85);\n}\n\n.colorpicker-body .strip .overlay {\n\theight: 150px;\n\tpointer-events: none;\n}\n\n.colorpicker-body .standalone-strip .standalone-overlay {\n\theight: 122px;\n\tpointer-events: none;\n}\n\n.standalone-colorpicker-body {\n\tdisplay: block;\n\tborder: 1px solid transparent;\n\tborder-bottom: 1px solid var(--vscode-editorHoverWidget-border);\n\toverflow: hidden;\n}\n\n.colorpicker-body .insert-button {\n\tposition: absolute;\n\theight: 20px;\n\twidth: 58px;\n\tpadding: 0px;\n\tright: 8px;\n\tbottom: 8px;\n\tbackground: var(--vscode-button-background);\n\tcolor: var(--vscode-button-foreground);\n\tborder-radius: 2px;\n\tborder: none;\n\tcursor: pointer;\n}\n\n.colorpicker-body .insert-button:hover{\n\tbackground: var(--vscode-button-hoverBackground);\n}\n`,""]);const u=d},7070:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor.vs .dnd-target,\n.monaco-editor.hc-light .dnd-target {\n\tborder-right: 2px dotted black;\n\tcolor: white; /* opposite of black */\n}\n.monaco-editor.vs-dark .dnd-target {\n\tborder-right: 2px dotted #AEAFAD;\n\tcolor: #51504f; /* opposite of #AEAFAD */\n}\n.monaco-editor.hc-black .dnd-target {\n\tborder-right: 2px dotted #fff;\n\tcolor: #000; /* opposite of #fff */\n}\n\n.monaco-editor.mouse-default .view-lines,\n.monaco-editor.vs-dark.mac.mouse-default .view-lines,\n.monaco-editor.hc-black.mac.mouse-default .view-lines,\n.monaco-editor.hc-light.mac.mouse-default .view-lines {\n\tcursor: default;\n}\n.monaco-editor.mouse-copy .view-lines,\n.monaco-editor.vs-dark.mac.mouse-copy .view-lines,\n.monaco-editor.hc-black.mac.mouse-copy .view-lines,\n.monaco-editor.hc-light.mac.mouse-copy .view-lines {\n\tcursor: copy;\n}\n",""]);const a=r},3399:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.post-edit-widget {\n\tbox-shadow: 0 0 8px 2px var(--vscode-widget-shadow);\n\tborder: 1px solid var(--vscode-widget-border, transparent);\n\tborder-radius: 4px;\n\tbackground-color: var(--vscode-editorWidget-background);\n\toverflow: hidden;\n}\n\n.post-edit-widget .monaco-button {\n\tpadding: 2px;\n\tborder: none;\n\tborder-radius: 0;\n}\n\n.post-edit-widget .monaco-button:hover {\n\tbackground-color: var(--vscode-button-secondaryHoverBackground) !important;\n}\n\n.post-edit-widget .monaco-button .codicon {\n\tmargin: 0;\n}\n",""]);const a=r},8875:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .findOptionsWidget {\n\tbackground-color: var(--vscode-editorWidget-background);\n\tcolor: var(--vscode-editorWidget-foreground);\n\tbox-shadow: 0 0 8px 2px var(--vscode-widget-shadow);\n\tborder: 2px solid var(--vscode-contrastBorder);\n}\n",""]);const a=r},6950:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* Find widget */\n.monaco-editor .find-widget {\n\tposition: absolute;\n\tz-index: 35;\n\theight: 33px;\n\toverflow: hidden;\n\tline-height: 19px;\n\ttransition: transform 200ms linear;\n\tpadding: 0 4px;\n\tbox-sizing: border-box;\n\ttransform: translateY(calc(-100% - 10px)); /* shadow (10px) */\n\tborder-bottom-left-radius: 4px;\n\tborder-bottom-right-radius: 4px;\n}\n\n.monaco-workbench.reduce-motion .monaco-editor .find-widget {\n\ttransition: transform 0ms linear;\n}\n\n.monaco-editor .find-widget textarea {\n\tmargin: 0px;\n}\n\n.monaco-editor .find-widget.hiddenEditor {\n\tdisplay: none;\n}\n\n/* Find widget when replace is toggled on */\n.monaco-editor .find-widget.replaceToggled > .replace-part {\n\tdisplay: flex;\n}\n\n.monaco-editor .find-widget.visible {\n\ttransform: translateY(0);\n}\n\n.monaco-editor .find-widget .monaco-inputbox.synthetic-focus {\n\toutline: 1px solid -webkit-focus-ring-color;\n\toutline-offset: -1px;\n}\n\n.monaco-editor .find-widget .monaco-inputbox .input {\n\tbackground-color: transparent;\n\tmin-height: 0;\n}\n\n.monaco-editor .find-widget .monaco-findInput .input {\n\tfont-size: 13px;\n}\n\n.monaco-editor .find-widget > .find-part,\n.monaco-editor .find-widget > .replace-part {\n\tmargin: 3px 25px 0 17px;\n\tfont-size: 12px;\n\tdisplay: flex;\n}\n\n.monaco-editor .find-widget > .find-part .monaco-inputbox,\n.monaco-editor .find-widget > .replace-part .monaco-inputbox {\n\tmin-height: 25px;\n}\n\n\n.monaco-editor .find-widget > .replace-part .monaco-inputbox > .ibwrapper > .mirror {\n\tpadding-right: 22px;\n}\n\n.monaco-editor .find-widget > .find-part .monaco-inputbox > .ibwrapper > .input,\n.monaco-editor .find-widget > .find-part .monaco-inputbox > .ibwrapper > .mirror,\n.monaco-editor .find-widget > .replace-part .monaco-inputbox > .ibwrapper > .input,\n.monaco-editor .find-widget > .replace-part .monaco-inputbox > .ibwrapper > .mirror {\n\tpadding-top: 2px;\n\tpadding-bottom: 2px;\n}\n\n.monaco-editor .find-widget > .find-part .find-actions {\n\theight: 25px;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-editor .find-widget > .replace-part .replace-actions {\n\theight: 25px;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-editor .find-widget .monaco-findInput {\n\tvertical-align: middle;\n\tdisplay: flex;\n\tflex:1;\n}\n\n.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element {\n\t/* Make sure textarea inherits the width correctly */\n\twidth: 100%;\n}\n\n.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element .scrollbar.vertical {\n\t/* Hide vertical scrollbar */\n\topacity: 0;\n}\n\n.monaco-editor .find-widget .matchesCount {\n\tdisplay: flex;\n\tflex: initial;\n\tmargin: 0 0 0 3px;\n\tpadding: 2px 0 0 2px;\n\theight: 25px;\n\tvertical-align: middle;\n\tbox-sizing: border-box;\n\ttext-align: center;\n\tline-height: 23px;\n}\n\n.monaco-editor .find-widget .button {\n\twidth: 16px;\n\theight: 16px;\n\tpadding: 3px;\n\tborder-radius: 5px;\n\tdisplay: flex;\n\tflex: initial;\n\tmargin-left: 3px;\n\tbackground-position: center center;\n\tbackground-repeat: no-repeat;\n\tcursor: pointer;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/* find in selection button */\n.monaco-editor .find-widget .codicon-find-selection {\n\twidth: 22px;\n\theight: 22px;\n\tpadding: 3px;\n\tborder-radius: 5px;\n}\n\n.monaco-editor .find-widget .button.left {\n\tmargin-left: 0;\n\tmargin-right: 3px;\n}\n\n.monaco-editor .find-widget .button.wide {\n\twidth: auto;\n\tpadding: 1px 6px;\n\ttop: -1px;\n}\n\n.monaco-editor .find-widget .button.toggle {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 3px;\n\twidth: 18px;\n\theight: 100%;\n\tborder-radius: 0;\n\tbox-sizing: border-box;\n}\n\n.monaco-editor .find-widget .button.toggle.disabled {\n\tdisplay: none;\n}\n\n.monaco-editor .find-widget .disabled {\n\tcolor: var(--vscode-disabledForeground);\n\tcursor: default;\n}\n\n.monaco-editor .find-widget > .replace-part {\n\tdisplay: none;\n}\n\n.monaco-editor .find-widget > .replace-part > .monaco-findInput {\n\tposition: relative;\n\tdisplay: flex;\n\tvertical-align: middle;\n\tflex: auto;\n\tflex-grow: 0;\n\tflex-shrink: 0;\n}\n\n.monaco-editor .find-widget > .replace-part > .monaco-findInput > .controls {\n\tposition: absolute;\n\ttop: 3px;\n\tright: 2px;\n}\n\n/* REDUCED */\n.monaco-editor .find-widget.reduced-find-widget .matchesCount {\n\tdisplay:none;\n}\n\n/* NARROW (SMALLER THAN REDUCED) */\n.monaco-editor .find-widget.narrow-find-widget {\n\tmax-width: 257px !important;\n}\n\n/* COLLAPSED (SMALLER THAN NARROW) */\n.monaco-editor .find-widget.collapsed-find-widget {\n\tmax-width: 170px !important;\n}\n\n.monaco-editor .find-widget.collapsed-find-widget .button.previous,\n.monaco-editor .find-widget.collapsed-find-widget .button.next,\n.monaco-editor .find-widget.collapsed-find-widget .button.replace,\n.monaco-editor .find-widget.collapsed-find-widget .button.replace-all,\n.monaco-editor .find-widget.collapsed-find-widget > .find-part .monaco-findInput .controls {\n\tdisplay:none;\n}\n\n.monaco-editor .findMatch {\n\tanimation-duration: 0;\n\tanimation-name: inherit !important;\n}\n\n.monaco-editor .find-widget .monaco-sash {\n\tleft: 0 !important;\n}\n\n.monaco-editor.hc-black .find-widget .button:before {\n\tposition: relative;\n\ttop: 1px;\n\tleft: 2px;\n}\n\n/* Close button position. */\n.monaco-editor .find-widget > .button.codicon-widget-close {\n\tposition: absolute;\n\ttop: 5px;\n\tright: 4px;\n}\n",""]);const a=r},3388:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,'/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n.monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,\n.monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,\n.monaco-editor .margin-view-overlays .codicon-folding-expanded,\n.monaco-editor .margin-view-overlays .codicon-folding-collapsed {\n\tcursor: pointer;\n\topacity: 0;\n\ttransition: opacity 0.5s;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tfont-size: 140%;\n\tmargin-left: 2px;\n}\n\n.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,\n.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,\n.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-expanded,\n.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-collapsed {\n\ttransition: initial;\n}\n\n.monaco-editor .margin-view-overlays:hover .codicon,\n.monaco-editor .margin-view-overlays .codicon.codicon-folding-collapsed,\n.monaco-editor .margin-view-overlays .codicon.codicon-folding-manual-collapsed,\n.monaco-editor .margin-view-overlays .codicon.alwaysShowFoldIcons {\n\topacity: 1;\n}\n\n.monaco-editor .inline-folded:after {\n\tcolor: grey;\n\tmargin: 0.1em 0.2em 0 0.2em;\n\tcontent: "\\22EF"; /* ellipses unicode character */\n\tdisplay: inline;\n\tline-height: 1em;\n\tcursor: pointer;\n}\n\n.monaco-editor .folded-background {\n\tbackground-color: var(--vscode-editor-foldBackground);\n}\n\n.monaco-editor .cldr.codicon.codicon-folding-expanded,\n.monaco-editor .cldr.codicon.codicon-folding-collapsed,\n.monaco-editor .cldr.codicon.codicon-folding-manual-expanded,\n.monaco-editor .cldr.codicon.codicon-folding-manual-collapsed {\n\tcolor: var(--vscode-editorGutter-foldingControlForeground) !important;\n}\n\n',""]);const a=r},5351:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* marker zone */\n\n.monaco-editor .peekview-widget .head .peekview-title .severity-icon {\n\tdisplay: inline-block;\n\tvertical-align: text-top;\n\tmargin-right: 4px;\n}\n\n.monaco-editor .marker-widget {\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.monaco-editor .marker-widget > .stale {\n\topacity: 0.6;\n\tfont-style: italic;\n}\n\n.monaco-editor .marker-widget .title {\n\tdisplay: inline-block;\n\tpadding-right: 5px;\n}\n\n.monaco-editor .marker-widget .descriptioncontainer {\n\tposition: absolute;\n\twhite-space: pre;\n\tuser-select: text;\n\t-webkit-user-select: text;\n\tpadding: 8px 12px 0 20px;\n}\n\n.monaco-editor .marker-widget .descriptioncontainer .message {\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.monaco-editor .marker-widget .descriptioncontainer .message .details {\n\tpadding-left: 6px;\n}\n\n.monaco-editor .marker-widget .descriptioncontainer .message .source,\n.monaco-editor .marker-widget .descriptioncontainer .message span.code {\n\topacity: 0.6;\n}\n\n.monaco-editor .marker-widget .descriptioncontainer .message a.code-link {\n\topacity: 0.6;\n\tcolor: inherit;\n}\n\n.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:before {\n\tcontent: '(';\n}\n\n.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:after {\n\tcontent: ')';\n}\n\n.monaco-editor .marker-widget .descriptioncontainer .message a.code-link > span {\n\ttext-decoration: underline;\n\t/** Hack to force underline to show **/\n\tborder-bottom: 1px solid transparent;\n\ttext-underline-position: under;\n\tcolor: var(--vscode-textLink-foreground);\n}\n\n.monaco-editor .marker-widget .descriptioncontainer .message a.code-link > span {\n\tcolor: var(--vscode-textLink-activeForeground);\n}\n\n.monaco-editor .marker-widget .descriptioncontainer .filename {\n\tcursor: pointer;\n}\n",""]);const a=r},3257:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .goto-definition-link {\n\ttext-decoration: underline;\n\tcursor: pointer;\n\tcolor: var(--vscode-editorLink-activeForeground) !important;\n}\n",""]);const a=r},879:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* -- zone widget */\n.monaco-editor .zone-widget .zone-widget-container.reference-zone-widget {\n\tborder-top-width: 1px;\n\tborder-bottom-width: 1px;\n}\n\n.monaco-editor .reference-zone-widget .inline {\n\tdisplay: inline-block;\n\tvertical-align: top;\n}\n\n.monaco-editor .reference-zone-widget .messages {\n\theight: 100%;\n\twidth: 100%;\n\ttext-align: center;\n\tpadding: 3em 0;\n}\n\n.monaco-editor .reference-zone-widget .ref-tree {\n\tline-height: 23px;\n\tbackground-color: var(--vscode-peekViewResult-background);\n\tcolor: var(--vscode-peekViewResult-lineForeground);\n}\n\n.monaco-editor .reference-zone-widget .ref-tree .reference {\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n}\n\n.monaco-editor .reference-zone-widget .ref-tree .reference-file {\n\tdisplay: inline-flex;\n\twidth: 100%;\n\theight: 100%;\n\tcolor: var(--vscode-peekViewResult-fileForeground);\n}\n\n.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .selected .reference-file {\n\tcolor: inherit !important;\n}\n\n.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) {\n\tbackground-color: var(--vscode-peekViewResult-selectionBackground);\n\tcolor: var(--vscode-peekViewResult-selectionForeground) !important;\n}\n\n.monaco-editor .reference-zone-widget .ref-tree .reference-file .count {\n\tmargin-right: 12px;\n\tmargin-left: auto;\n}\n\n.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight {\n\tbackground-color: var(--vscode-peekViewResult-matchHighlightBackground);\n}\n\n.monaco-editor .reference-zone-widget .preview .reference-decoration {\n\tbackground-color: var(--vscode-peekViewEditor-matchHighlightBackground);\n\tborder: 2px solid var(--vscode-peekViewEditor-matchHighlightBorder);\n\tbox-sizing: border-box;\n}\n\n.monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background,\n.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input {\n\tbackground-color: var(--vscode-peekViewEditor-background);\n}\n\n.monaco-editor .reference-zone-widget .preview .monaco-editor .margin {\n\tbackground-color: var(--vscode-peekViewEditorGutter-background);\n}\n\n/* High Contrast Theming */\n\n.monaco-editor.hc-black .reference-zone-widget .ref-tree .reference-file,\n.monaco-editor.hc-light .reference-zone-widget .ref-tree .reference-file {\n\tfont-weight: bold;\n}\n\n.monaco-editor.hc-black .reference-zone-widget .ref-tree .referenceMatch .highlight,\n.monaco-editor.hc-light .reference-zone-widget .ref-tree .referenceMatch .highlight {\n\tborder: 1px dotted var(--vscode-contrastActiveBorder, transparent);\n\tbox-sizing: border-box;\n}\n",""]);const a=r},1738:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .hoverHighlight {\n\tbackground-color: var(--vscode-editor-hoverHighlightBackground);\n}\n\n.monaco-editor .monaco-hover {\n\tcolor: var(--vscode-editorHoverWidget-foreground);\n\tbackground-color: var(--vscode-editorHoverWidget-background);\n\tborder: 1px solid var(--vscode-editorHoverWidget-border);\n\tborder-radius: 3px;\n}\n\n.monaco-editor .monaco-hover a {\n\tcolor: var(--vscode-textLink-foreground);\n}\n\n.monaco-editor .monaco-hover a:hover {\n\tcolor: var(--vscode-textLink-activeForeground);\n}\n\n.monaco-editor .monaco-hover .hover-row .actions {\n\tbackground-color: var(--vscode-editorHoverWidget-statusBarBackground);\n}\n\n.monaco-editor .monaco-hover code {\n\tbackground-color: var(--vscode-textCodeBlock-background);\n}\n\n\n",""]);const a=r},6921:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n\n.monaco-editor.vs .valueSetReplacement {\n\toutline: solid 2px var(--vscode-editorBracketMatch-border);\n}\n",""]);const a=r},7682:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .suggest-preview-additional-widget {\n\twhite-space: nowrap;\n}\n\n.monaco-editor .suggest-preview-additional-widget .content-spacer {\n\tcolor: transparent;\n\twhite-space: pre;\n}\n\n.monaco-editor .suggest-preview-additional-widget .button {\n\tdisplay: inline-block;\n\tcursor: pointer;\n\ttext-decoration: underline;\n\ttext-underline-position: under;\n}\n\n.monaco-editor .ghost-text-hidden {\n\topacity: 0;\n\tfont-size: 0;\n}\n\n.monaco-editor .ghost-text-decoration, .monaco-editor .suggest-preview-text .ghost-text {\n\tfont-style: italic;\n}\n\n.monaco-editor .inline-completion-text-to-replace {\n\ttext-decoration: underline;\n\ttext-underline-position: under;\n}\n\n.monaco-editor .ghost-text-decoration,\n.monaco-editor .ghost-text-decoration-preview,\n.monaco-editor .suggest-preview-text .ghost-text {\n\tcolor: var(--vscode-editorGhostText-foreground) !important;\n\tbackground-color: var(--vscode-editorGhostText-background);\n\tborder: 1px solid var(--vscode-editorGhostText-border);\n}\n",""]);const a=r},8300:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .inlineSuggestionsHints.withBorder {\n\tz-index: 39;\n\tcolor: var(--vscode-editorHoverWidget-foreground);\n\tbackground-color: var(--vscode-editorHoverWidget-background);\n\tborder: 1px solid var(--vscode-editorHoverWidget-border);\n}\n\n.monaco-editor .inlineSuggestionsHints a {\n\tcolor: var(--vscode-foreground);\n}\n\n.monaco-editor .inlineSuggestionsHints a:hover {\n\tcolor: var(--vscode-foreground);\n}\n\n.monaco-editor .inlineSuggestionsHints .keybinding {\n\tdisplay: flex;\n\tmargin-left: 4px;\n\topacity: 0.6;\n}\n\n.monaco-editor .inlineSuggestionsHints .keybinding .monaco-keybinding-key {\n\tfont-size: 8px;\n\tpadding: 2px 3px;\n}\n\n.monaco-editor .inlineSuggestionsHints .availableSuggestionCount a {\n\tdisplay: flex;\n\tmin-width: 19px;\n\tjustify-content: center;\n}\n\n.monaco-editor .inlineSuggestionStatusBarItemLabel {\n\tmargin-right: 2px;\n}\n",""]);const a=r},6668:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,'/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.inline-editor-progress-decoration {\n\tdisplay: inline-block;\n\twidth: 1em;\n\theight: 1em;\n}\n\n.inline-progress-widget {\n\tdisplay: flex !important;\n\tjustify-content: center;\n\talign-items: center;\n}\n\n.inline-progress-widget .icon {\n\tfont-size: 80% !important;\n}\n\n.inline-progress-widget:hover .icon {\n\tfont-size: 90% !important;\n\tanimation: none;\n}\n\n.inline-progress-widget:hover .icon::before {\n\tcontent: "\\ea76"; /* codicon-x */\n}\n',""]);const a=r},5040:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .linked-editing-decoration {\n\tbackground-color: var(--vscode-editor-linkedEditingBackground);\n\n\t/* Ensure decoration is visible even if range is empty */\n\tmin-width: 1px;\n}\n",""]);const a=r},8477:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n.monaco-editor .detected-link,\n.monaco-editor .detected-link-active {\n\ttext-decoration: underline;\n\ttext-underline-position: under;\n}\n\n.monaco-editor .detected-link-active {\n\tcursor: pointer;\n\tcolor: var(--vscode-editorLink-activeForeground) !important;\n}\n",""]);const a=r},1615:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .rendered-markdown kbd {\n\tbackground-color: var(--vscode-keybindingLabel-background);\n\tcolor: var(--vscode-keybindingLabel-foreground);\n\tborder-style: solid;\n\tborder-width: 1px;\n\tborder-radius: 3px;\n\tborder-color: var(--vscode-keybindingLabel-border);\n\tborder-bottom-color: var(--vscode-keybindingLabel-bottomBorder);\n\tbox-shadow: inset 0 -1px 0 var(--vscode-widget-shadow);\n\tvertical-align: middle;\n\tpadding: 1px 3px;\n}\n",""]);const a=r},5807:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .monaco-editor-overlaymessage {\n\tpadding-bottom: 8px;\n\tz-index: 10000;\n}\n\n.monaco-editor .monaco-editor-overlaymessage.below {\n\tpadding-bottom: 0;\n\tpadding-top: 8px;\n\tz-index: 10000;\n}\n\n@keyframes fadeIn {\n\tfrom { opacity: 0; }\n\tto { opacity: 1; }\n}\n.monaco-editor .monaco-editor-overlaymessage.fadeIn {\n\tanimation: fadeIn 150ms ease-out;\n}\n\n@keyframes fadeOut {\n\tfrom { opacity: 1; }\n\tto { opacity: 0; }\n}\n.monaco-editor .monaco-editor-overlaymessage.fadeOut {\n\tanimation: fadeOut 100ms ease-out;\n}\n\n.monaco-editor .monaco-editor-overlaymessage .message {\n\tpadding: 2px 4px;\n\tcolor: var(--vscode-editorHoverWidget-foreground);\n\tbackground-color: var(--vscode-editorHoverWidget-background);\n\tborder: 1px solid var(--vscode-inputValidation-infoBorder);\n\tborder-radius: 3px;\n}\n\n.monaco-editor .monaco-editor-overlaymessage .message p {\n\tmargin-block: 0px;\n}\n\n.monaco-editor .monaco-editor-overlaymessage .message a {\n\tcolor: var(--vscode-textLink-foreground);\n}\n\n.monaco-editor .monaco-editor-overlaymessage .message a:hover {\n\tcolor: var(--vscode-textLink-activeForeground);\n}\n\n.monaco-editor.hc-black .monaco-editor-overlaymessage .message,\n.monaco-editor.hc-light .monaco-editor-overlaymessage .message {\n\tborder-width: 2px;\n}\n\n.monaco-editor .monaco-editor-overlaymessage .anchor {\n\twidth: 0 !important;\n\theight: 0 !important;\n\tborder-color: transparent;\n\tborder-style: solid;\n\tz-index: 1000;\n\tborder-width: 8px;\n\tposition: absolute;\n\tleft: 2px;\n}\n\n.monaco-editor .monaco-editor-overlaymessage .anchor.top {\n\tborder-bottom-color: var(--vscode-inputValidation-infoBorder);\n}\n\n.monaco-editor .monaco-editor-overlaymessage .anchor.below {\n\tborder-top-color: var(--vscode-inputValidation-infoBorder);\n}\n\n.monaco-editor .monaco-editor-overlaymessage:not(.below) .anchor.top,\n.monaco-editor .monaco-editor-overlaymessage.below .anchor.below {\n\tdisplay: none;\n}\n\n.monaco-editor .monaco-editor-overlaymessage.below .anchor.top {\n\tdisplay: inherit;\n\ttop: -8px;\n}\n",""]);const a=r},1386:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,'/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .parameter-hints-widget {\n\t/* Must be higher than the sash\'s z-index and terminal canvases but lower than the suggest widget */\n\tz-index: 39;\n\tdisplay: flex;\n\tflex-direction: column;\n\tline-height: 1.5em;\n\tcursor: default;\n\tcolor: var(--vscode-editorHoverWidget-foreground);\n\tbackground-color: var(--vscode-editorHoverWidget-background);\n\tborder: 1px solid var(--vscode-editorHoverWidget-border);\n}\n\n.hc-black .monaco-editor .parameter-hints-widget,\n.hc-light .monaco-editor .parameter-hints-widget {\n\tborder-width: 2px;\n}\n\n.monaco-editor .parameter-hints-widget > .phwrapper {\n\tmax-width: 440px;\n\tdisplay: flex;\n\tflex-direction: row;\n}\n\n.monaco-editor .parameter-hints-widget.multiple {\n\tmin-height: 3.3em;\n\tpadding: 0;\n}\n\n.monaco-editor .parameter-hints-widget.multiple .body::before {\n\tcontent: "";\n\tdisplay: block;\n\theight: 100%;\n\tposition: absolute;\n\topacity: 0.5;\n\tborder-left: 1px solid var(--vscode-editorHoverWidget-border);\n}\n\n.monaco-editor .parameter-hints-widget p,\n.monaco-editor .parameter-hints-widget ul {\n\tmargin: 8px 0;\n}\n\n.monaco-editor .parameter-hints-widget .monaco-scrollable-element,\n.monaco-editor .parameter-hints-widget .body {\n\tdisplay: flex;\n\tflex: 1;\n\tflex-direction: column;\n\tmin-height: 100%;\n}\n\n.monaco-editor .parameter-hints-widget .signature {\n\tpadding: 4px 5px;\n\tposition: relative;\n}\n\n.monaco-editor .parameter-hints-widget .signature.has-docs::after {\n\tcontent: "";\n\tdisplay: block;\n\tposition: absolute;\n\tleft: 0;\n\twidth: 100%;\n\tpadding-top: 4px;\n\topacity: 0.5;\n\tborder-bottom: 1px solid var(--vscode-editorHoverWidget-border);\n}\n\n.monaco-editor .parameter-hints-widget .docs {\n\tpadding: 0 10px 0 5px;\n\twhite-space: pre-wrap;\n}\n\n.monaco-editor .parameter-hints-widget .docs.empty {\n\tdisplay: none;\n}\n\n.monaco-editor .parameter-hints-widget .docs a {\n\tcolor: var(--vscode-textLink-foreground);\n}\n\n.monaco-editor .parameter-hints-widget .docs a:hover {\n\tcolor: var(--vscode-textLink-activeForeground);\n\tcursor: pointer;\n}\n\n.monaco-editor .parameter-hints-widget .docs .markdown-docs {\n\twhite-space: initial;\n}\n\n.monaco-editor .parameter-hints-widget .docs code {\n\tfont-family: var(--monaco-monospace-font);\n\tborder-radius: 3px;\n\tpadding: 0 0.4em;\n\tbackground-color: var(--vscode-textCodeBlock-background);\n}\n\n.monaco-editor .parameter-hints-widget .docs .monaco-tokenized-source,\n.monaco-editor .parameter-hints-widget .docs .code {\n\twhite-space: pre-wrap;\n}\n\n.monaco-editor .parameter-hints-widget .controls {\n\tdisplay: none;\n\tflex-direction: column;\n\talign-items: center;\n\tmin-width: 22px;\n\tjustify-content: flex-end;\n}\n\n.monaco-editor .parameter-hints-widget.multiple .controls {\n\tdisplay: flex;\n\tpadding: 0 2px;\n}\n\n.monaco-editor .parameter-hints-widget.multiple .button {\n\twidth: 16px;\n\theight: 16px;\n\tbackground-repeat: no-repeat;\n\tcursor: pointer;\n}\n\n.monaco-editor .parameter-hints-widget .button.previous {\n\tbottom: 24px;\n}\n\n.monaco-editor .parameter-hints-widget .overloads {\n\ttext-align: center;\n\theight: 12px;\n\tline-height: 12px;\n\tfont-family: var(--monaco-monospace-font);\n}\n\n.monaco-editor .parameter-hints-widget .signature .parameter.active {\n\tcolor: var(--vscode-editorHoverWidget-highlightForeground);\n\tfont-weight: bold;\n}\n\n.monaco-editor .parameter-hints-widget .documentation-parameter > .parameter {\n\tfont-weight: bold;\n\tmargin-right: 0.5em;\n}\n',""]);const a=r},8881:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .peekview-widget .head {\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\tjustify-content: space-between;\n\tflex-wrap: nowrap;\n}\n\n.monaco-editor .peekview-widget .head .peekview-title {\n\tdisplay: flex;\n\talign-items: baseline;\n\tfont-size: 13px;\n\tmargin-left: 20px;\n\tmin-width: 0;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n}\n\n.monaco-editor .peekview-widget .head .peekview-title.clickable {\n\tcursor: pointer;\n}\n\n.monaco-editor .peekview-widget .head .peekview-title .dirname:not(:empty) {\n\tfont-size: 0.9em;\n\tmargin-left: 0.5em;\n}\n\n.monaco-editor .peekview-widget .head .peekview-title .meta {\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.monaco-editor .peekview-widget .head .peekview-title .dirname {\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.monaco-editor .peekview-widget .head .peekview-title .filename {\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.monaco-editor .peekview-widget .head .peekview-title .meta:not(:empty)::before {\n\tcontent: '-';\n\tpadding: 0 0.3em;\n}\n\n.monaco-editor .peekview-widget .head .peekview-actions {\n\tflex: 1;\n\ttext-align: right;\n\tpadding-right: 2px;\n}\n\n.monaco-editor .peekview-widget .head .peekview-actions > .monaco-action-bar {\n\tdisplay: inline-block;\n}\n\n.monaco-editor .peekview-widget .head .peekview-actions > .monaco-action-bar,\n.monaco-editor .peekview-widget .head .peekview-actions > .monaco-action-bar > .actions-container {\n\theight: 100%;\n}\n\n.monaco-editor .peekview-widget > .body {\n\tborder-top: 1px solid;\n\tposition: relative;\n}\n\n.monaco-editor .peekview-widget .head .peekview-title .codicon {\n\tmargin-right: 4px;\n\talign-self: center;\n}\n\n.monaco-editor .peekview-widget .monaco-list .monaco-list-row.focused .codicon {\n\tcolor: inherit !important;\n}\n",""]);const a=r},8342:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .rename-box {\n\tz-index: 100;\n\tcolor: inherit;\n\tborder-radius: 4px;\n}\n\n.monaco-editor .rename-box.preview {\n\tpadding: 4px 4px 0 4px;\n}\n\n.monaco-editor .rename-box .rename-input {\n\tpadding: 3px;\n\tborder-radius: 2px;\n}\n\n.monaco-editor .rename-box .rename-label {\n\tdisplay: none;\n\topacity: .8;\n}\n\n.monaco-editor .rename-box.preview .rename-label {\n\tdisplay: inherit;\n}\n",""]);const a=r},5756:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .snippet-placeholder {\n\tmin-width: 2px;\n\toutline-style: solid;\n\toutline-width: 1px;\n\tbackground-color: var(--vscode-editor-snippetTabstopHighlightBackground, transparent);\n\toutline-color: var(--vscode-editor-snippetTabstopHighlightBorder, transparent);\n}\n\n.monaco-editor .finish-snippet-placeholder {\n\toutline-style: solid;\n\toutline-width: 1px;\n\tbackground-color: var(--vscode-editor-snippetFinalTabstopHighlightBackground, transparent);\n\toutline-color: var(--vscode-editor-snippetFinalTabstopHighlightBorder, transparent);\n}\n",""]);const a=r},6098:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .sticky-widget {\n\toverflow: hidden;\n}\n\n.monaco-editor .sticky-widget-line-numbers {\n\tfloat: left;\n\tbackground-color: inherit;\n}\n\n.monaco-editor .sticky-widget-lines-scrollable {\n\tdisplay: inline-block;\n\tposition: absolute;\n\toverflow: hidden;\n\twidth: var(--vscode-editorStickyScroll-scrollableWidth);\n\tbackground-color: inherit;\n}\n\n.monaco-editor .sticky-widget-lines {\n\tposition: absolute;\n\tbackground-color: inherit;\n}\n\n.monaco-editor .sticky-line-number, .monaco-editor .sticky-line-content {\n\tcolor: var(--vscode-editorLineNumber-foreground);\n\twhite-space: nowrap;\n\tdisplay: inline-block;\n\tposition: absolute;\n\tbackground-color: inherit;\n}\n\n.monaco-editor .sticky-line-number .codicon-folding-expanded,\n.monaco-editor .sticky-line-number .codicon-folding-collapsed {\n\tfloat: right;\n\ttransition: var(--vscode-editorStickyScroll-foldingOpacityTransition);\n}\n\n.monaco-editor .sticky-line-content {\n\twidth: var(--vscode-editorStickyScroll-scrollableWidth);\n\tbackground-color: inherit;\n\twhite-space: nowrap;\n}\n\n.monaco-editor .sticky-line-number-inner {\n\tdisplay: inline-block;\n\ttext-align: right;\n}\n\n.monaco-editor.hc-black .sticky-widget,\n.monaco-editor.hc-light .sticky-widget {\n\tborder-bottom: 1px solid var(--vscode-contrastBorder);\n}\n\n.monaco-editor .sticky-line-content:hover {\n\tbackground-color: var(--vscode-editorStickyScrollHover-background);\n\tcursor: pointer;\n}\n\n.monaco-editor .sticky-widget {\n\twidth: 100%;\n\tbox-shadow: var(--vscode-scrollbar-shadow) 0 3px 2px -2px;\n\tz-index: 4;\n\tbackground-color: var(--vscode-editorStickyScroll-background);\n}\n\n.monaco-editor .sticky-widget.peek {\n\tbackground-color: var(--vscode-peekViewEditorStickyScroll-background);\n}\n",""]);const a=r},5224:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* Suggest widget*/\n\n.monaco-editor .suggest-widget {\n\twidth: 430px;\n\tz-index: 40;\n\tdisplay: flex;\n\tflex-direction: column;\n\tborder-radius: 3px;\n}\n\n.monaco-editor .suggest-widget.message {\n\tflex-direction: row;\n\talign-items: center;\n}\n\n.monaco-editor .suggest-widget,\n.monaco-editor .suggest-details {\n\tflex: 0 1 auto;\n\twidth: 100%;\n\tborder-style: solid;\n\tborder-width: 1px;\n\tborder-color: var(--vscode-editorSuggestWidget-border);\n\tbackground-color: var(--vscode-editorSuggestWidget-background);\n}\n\n.monaco-editor.hc-black .suggest-widget,\n.monaco-editor.hc-black .suggest-details,\n.monaco-editor.hc-light .suggest-widget,\n.monaco-editor.hc-light .suggest-details {\n\tborder-width: 2px;\n}\n\n/* Styles for status bar part */\n\n\n.monaco-editor .suggest-widget .suggest-status-bar {\n\tbox-sizing: border-box;\n\tdisplay: none;\n\tflex-flow: row nowrap;\n\tjustify-content: space-between;\n\twidth: 100%;\n\tfont-size: 80%;\n\tpadding: 0 4px 0 4px;\n\tborder-top: 1px solid var(--vscode-editorSuggestWidget-border);\n\toverflow: hidden;\n}\n\n.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar {\n\tdisplay: flex;\n}\n\n.monaco-editor .suggest-widget .suggest-status-bar .left {\n\tpadding-right: 8px;\n}\n\n.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-label {\n\tcolor: var(--vscode-editorSuggestWidgetStatus-foreground);\n}\n\n.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-item:not(:last-of-type) .action-label {\n\tmargin-right: 0;\n}\n\n.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-item:not(:last-of-type) .action-label::after {\n\tcontent: ', ';\n\tmargin-right: 0.3em;\n}\n\n.monaco-editor .suggest-widget.with-status-bar .monaco-list .monaco-list-row>.contents>.main>.right>.readMore,\n.monaco-editor .suggest-widget.with-status-bar .monaco-list .monaco-list-row.focused.string-label>.contents>.main>.right>.readMore {\n\tdisplay: none;\n}\n\n.monaco-editor .suggest-widget.with-status-bar:not(.docs-side) .monaco-list .monaco-list-row:hover>.contents>.main>.right.can-expand-details>.details-label {\n\twidth: 100%;\n}\n\n/* Styles for Message element for when widget is loading or is empty */\n\n.monaco-editor .suggest-widget>.message {\n\tpadding-left: 22px;\n}\n\n/** Styles for the list element **/\n\n.monaco-editor .suggest-widget>.tree {\n\theight: 100%;\n\twidth: 100%;\n}\n\n.monaco-editor .suggest-widget .monaco-list {\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n/** Styles for each row in the list element **/\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row {\n\tdisplay: flex;\n\t-mox-box-sizing: border-box;\n\tbox-sizing: border-box;\n\tpadding-right: 10px;\n\tbackground-repeat: no-repeat;\n\tbackground-position: 2px 2px;\n\twhite-space: nowrap;\n\tcursor: pointer;\n\ttouch-action: none;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused {\n\tcolor: var(--vscode-editorSuggestWidget-selectedForeground);\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused .codicon {\n\tcolor: var(--vscode-editorSuggestWidget-selectedIconForeground);\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents {\n\tflex: 1;\n\theight: 100%;\n\toverflow: hidden;\n\tpadding-left: 2px;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main {\n\tdisplay: flex;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: pre;\n\tjustify-content: space-between;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left,\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right {\n\tdisplay: flex;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.focused)>.contents>.main .monaco-icon-label {\n\tcolor: var(--vscode-editorSuggestWidget-foreground);\n}\n\n.monaco-editor .suggest-widget:not(.frozen) .monaco-highlighted-label .highlight {\n\tfont-weight: bold;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main .monaco-highlighted-label .highlight {\n\tcolor: var(--vscode-editorSuggestWidget-highlightForeground);\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused>.contents>.main .monaco-highlighted-label .highlight {\n\tcolor: var(--vscode-editorSuggestWidget-focusHighlightForeground);\n}\n\n/** ReadMore Icon styles **/\n\n.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close,\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore::before {\n\tcolor: inherit;\n\topacity: 1;\n\tfont-size: 14px;\n\tcursor: pointer;\n}\n\n.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close {\n\tposition: absolute;\n\ttop: 6px;\n\tright: 2px;\n}\n\n.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close:hover,\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore:hover {\n\topacity: 1;\n}\n\n/** signature, qualifier, type/details opacity **/\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label {\n\topacity: 0.7;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.signature-label {\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\topacity: 0.6;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.qualifier-label {\n\tmargin-left: 12px;\n\topacity: 0.4;\n\tfont-size: 85%;\n\tline-height: initial;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\talign-self: center;\n}\n\n/** Type Info and icon next to the label in the focused completion item **/\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label {\n\tfont-size: 85%;\n\tmargin-left: 1.1em;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label>.monaco-tokenized-source {\n\tdisplay: inline;\n}\n\n/** Details: if using CompletionItem#details, show on focus **/\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label {\n\tdisplay: none;\n}\n\n.monaco-editor .suggest-widget:not(.shows-details) .monaco-list .monaco-list-row.focused>.contents>.main>.right>.details-label {\n\tdisplay: inline;\n}\n\n/** Details: if using CompletionItemLabel#details, always show **/\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.string-label)>.contents>.main>.right>.details-label,\n.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row.focused:not(.string-label)>.contents>.main>.right>.details-label {\n\tdisplay: inline;\n}\n\n/** Ellipsis on hover **/\n\n.monaco-editor .suggest-widget:not(.docs-side) .monaco-list .monaco-list-row.focused:hover>.contents>.main>.right.can-expand-details>.details-label {\n\twidth: calc(100% - 26px);\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left {\n\tflex-shrink: 1;\n\tflex-grow: 1;\n\toverflow: hidden;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.monaco-icon-label {\n\tflex-shrink: 0;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.string-label)>.contents>.main>.left>.monaco-icon-label {\n\tmax-width: 100%;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row.string-label>.contents>.main>.left>.monaco-icon-label {\n\tflex-shrink: 1;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right {\n\toverflow: hidden;\n\tflex-shrink: 4;\n\tmax-width: 70%;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore {\n\tdisplay: inline-block;\n\tposition: absolute;\n\tright: 10px;\n\twidth: 18px;\n\theight: 18px;\n\tvisibility: hidden;\n}\n\n/** Do NOT display ReadMore when docs is side/below **/\n\n.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row>.contents>.main>.right>.readMore {\n\tdisplay: none !important;\n}\n\n/** Do NOT display ReadMore when using plain CompletionItemLabel (details/documentation might not be resolved) **/\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row.string-label>.contents>.main>.right>.readMore {\n\tdisplay: none;\n}\n\n/** Focused item can show ReadMore, but can't when docs is side/below **/\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused.string-label>.contents>.main>.right>.readMore {\n\tdisplay: inline-block;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused:hover>.contents>.main>.right>.readMore {\n\tvisibility: visible;\n}\n\n/** Styles for each row in the list **/\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated {\n\topacity: 0.66;\n\ttext-decoration: unset;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated>.monaco-icon-label-container>.monaco-icon-name-container {\n\ttext-decoration: line-through;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label::before {\n\theight: 100%;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon {\n\tdisplay: block;\n\theight: 16px;\n\twidth: 16px;\n\tmargin-left: 2px;\n\tbackground-repeat: no-repeat;\n\tbackground-size: 80%;\n\tbackground-position: center;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.hide {\n\tdisplay: none;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon {\n\tdisplay: flex;\n\talign-items: center;\n\tmargin-right: 4px;\n}\n\n.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .icon,\n.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .suggest-icon::before {\n\tdisplay: none;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.customcolor .colorspan {\n\tmargin: 0 0 0 0.3em;\n\tborder: 0.1em solid #000;\n\twidth: 0.7em;\n\theight: 0.7em;\n\tdisplay: inline-block;\n}\n\n/** Styles for the docs of the completion item in focus **/\n\n.monaco-editor .suggest-details-container {\n\tz-index: 41;\n}\n\n.monaco-editor .suggest-details {\n\tdisplay: flex;\n\tflex-direction: column;\n\tcursor: default;\n\tcolor: var(--vscode-editorSuggestWidget-foreground);\n}\n\n.monaco-editor .suggest-details.focused {\n\tborder-color: var(--vscode-focusBorder);\n}\n\n.monaco-editor .suggest-details a {\n\tcolor: var(--vscode-textLink-foreground);\n}\n\n.monaco-editor .suggest-details a:hover {\n\tcolor: var(--vscode-textLink-activeForeground);\n}\n\n.monaco-editor .suggest-details code {\n\tbackground-color: var(--vscode-textCodeBlock-background);\n}\n\n.monaco-editor .suggest-details.no-docs {\n\tdisplay: none;\n}\n\n.monaco-editor .suggest-details>.monaco-scrollable-element {\n\tflex: 1;\n}\n\n.monaco-editor .suggest-details>.monaco-scrollable-element>.body {\n\tbox-sizing: border-box;\n\theight: 100%;\n\twidth: 100%;\n}\n\n.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.type {\n\tflex: 2;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\topacity: 0.7;\n\twhite-space: pre;\n\tmargin: 0 24px 0 0;\n\tpadding: 4px 0 12px 5px;\n}\n\n.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.type.auto-wrap {\n\twhite-space: normal;\n\tword-break: break-all;\n}\n\n.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs {\n\tmargin: 0;\n\tpadding: 4px 5px;\n\twhite-space: pre-wrap;\n}\n\n.monaco-editor .suggest-details.no-type>.monaco-scrollable-element>.body>.docs {\n\tmargin-right: 24px;\n\toverflow: hidden;\n}\n\n.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs {\n\tpadding: 0;\n\twhite-space: initial;\n\tmin-height: calc(1rem + 8px);\n}\n\n.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div,\n.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>span:not(:empty) {\n\tpadding: 4px 5px;\n}\n\n.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div>p:first-child {\n\tmargin-top: 0;\n}\n\n.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div>p:last-child {\n\tmargin-bottom: 0;\n}\n\n.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs .monaco-tokenized-source {\n\twhite-space: pre;\n}\n\n.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs .code {\n\twhite-space: pre-wrap;\n\tword-wrap: break-word;\n}\n\n.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs .codicon {\n\tvertical-align: sub;\n}\n\n.monaco-editor .suggest-details>.monaco-scrollable-element>.body>p:empty {\n\tdisplay: none;\n}\n\n.monaco-editor .suggest-details code {\n\tborder-radius: 3px;\n\tpadding: 0 0.4em;\n}\n\n.monaco-editor .suggest-details ul {\n\tpadding-left: 20px;\n}\n\n.monaco-editor .suggest-details ol {\n\tpadding-left: 20px;\n}\n\n.monaco-editor .suggest-details p code {\n\tfont-family: var(--monaco-monospace-font);\n}\n",""]);const a=r},745:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .codicon.codicon-symbol-array,\n.monaco-workbench .codicon.codicon-symbol-array { color: var(--vscode-symbolIcon-arrayForeground); }\n.monaco-editor .codicon.codicon-symbol-boolean,\n.monaco-workbench .codicon.codicon-symbol-boolean { color: var(--vscode-symbolIcon-booleanForeground); }\n.monaco-editor .codicon.codicon-symbol-class,\n.monaco-workbench .codicon.codicon-symbol-class { color: var(--vscode-symbolIcon-classForeground); }\n.monaco-editor .codicon.codicon-symbol-method,\n.monaco-workbench .codicon.codicon-symbol-method { color: var(--vscode-symbolIcon-methodForeground); }\n.monaco-editor .codicon.codicon-symbol-color,\n.monaco-workbench .codicon.codicon-symbol-color { color: var(--vscode-symbolIcon-colorForeground); }\n.monaco-editor .codicon.codicon-symbol-constant,\n.monaco-workbench .codicon.codicon-symbol-constant { color: var(--vscode-symbolIcon-constantForeground); }\n.monaco-editor .codicon.codicon-symbol-constructor,\n.monaco-workbench .codicon.codicon-symbol-constructor { color: var(--vscode-symbolIcon-constructorForeground); }\n.monaco-editor .codicon.codicon-symbol-value,\n.monaco-workbench .codicon.codicon-symbol-value,\n.monaco-editor .codicon.codicon-symbol-enum,\n.monaco-workbench .codicon.codicon-symbol-enum { color: var(--vscode-symbolIcon-enumeratorForeground); }\n.monaco-editor .codicon.codicon-symbol-enum-member,\n.monaco-workbench .codicon.codicon-symbol-enum-member { color: var(--vscode-symbolIcon-enumeratorMemberForeground); }\n.monaco-editor .codicon.codicon-symbol-event,\n.monaco-workbench .codicon.codicon-symbol-event { color: var(--vscode-symbolIcon-eventForeground); }\n.monaco-editor .codicon.codicon-symbol-field,\n.monaco-workbench .codicon.codicon-symbol-field { color: var(--vscode-symbolIcon-fieldForeground); }\n.monaco-editor .codicon.codicon-symbol-file,\n.monaco-workbench .codicon.codicon-symbol-file { color: var(--vscode-symbolIcon-fileForeground); }\n.monaco-editor .codicon.codicon-symbol-folder,\n.monaco-workbench .codicon.codicon-symbol-folder { color: var(--vscode-symbolIcon-folderForeground); }\n.monaco-editor .codicon.codicon-symbol-function,\n.monaco-workbench .codicon.codicon-symbol-function { color: var(--vscode-symbolIcon-functionForeground); }\n.monaco-editor .codicon.codicon-symbol-interface,\n.monaco-workbench .codicon.codicon-symbol-interface { color: var(--vscode-symbolIcon-interfaceForeground); }\n.monaco-editor .codicon.codicon-symbol-key,\n.monaco-workbench .codicon.codicon-symbol-key { color: var(--vscode-symbolIcon-keyForeground); }\n.monaco-editor .codicon.codicon-symbol-keyword,\n.monaco-workbench .codicon.codicon-symbol-keyword { color: var(--vscode-symbolIcon-keywordForeground); }\n.monaco-editor .codicon.codicon-symbol-module,\n.monaco-workbench .codicon.codicon-symbol-module { color: var(--vscode-symbolIcon-moduleForeground); }\n.monaco-editor .codicon.codicon-symbol-namespace,\n.monaco-workbench .codicon.codicon-symbol-namespace { color: var(--vscode-symbolIcon-namespaceForeground); }\n.monaco-editor .codicon.codicon-symbol-null,\n.monaco-workbench .codicon.codicon-symbol-null { color: var(--vscode-symbolIcon-nullForeground); }\n.monaco-editor .codicon.codicon-symbol-number,\n.monaco-workbench .codicon.codicon-symbol-number { color: var(--vscode-symbolIcon-numberForeground); }\n.monaco-editor .codicon.codicon-symbol-object,\n.monaco-workbench .codicon.codicon-symbol-object { color: var(--vscode-symbolIcon-objectForeground); }\n.monaco-editor .codicon.codicon-symbol-operator,\n.monaco-workbench .codicon.codicon-symbol-operator { color: var(--vscode-symbolIcon-operatorForeground); }\n.monaco-editor .codicon.codicon-symbol-package,\n.monaco-workbench .codicon.codicon-symbol-package { color: var(--vscode-symbolIcon-packageForeground); }\n.monaco-editor .codicon.codicon-symbol-property,\n.monaco-workbench .codicon.codicon-symbol-property { color: var(--vscode-symbolIcon-propertyForeground); }\n.monaco-editor .codicon.codicon-symbol-reference,\n.monaco-workbench .codicon.codicon-symbol-reference { color: var(--vscode-symbolIcon-referenceForeground); }\n.monaco-editor .codicon.codicon-symbol-snippet,\n.monaco-workbench .codicon.codicon-symbol-snippet { color: var(--vscode-symbolIcon-snippetForeground); }\n.monaco-editor .codicon.codicon-symbol-string,\n.monaco-workbench .codicon.codicon-symbol-string { color: var(--vscode-symbolIcon-stringForeground); }\n.monaco-editor .codicon.codicon-symbol-struct,\n.monaco-workbench .codicon.codicon-symbol-struct { color: var(--vscode-symbolIcon-structForeground); }\n.monaco-editor .codicon.codicon-symbol-text,\n.monaco-workbench .codicon.codicon-symbol-text { color: var(--vscode-symbolIcon-textForeground); }\n.monaco-editor .codicon.codicon-symbol-type-parameter,\n.monaco-workbench .codicon.codicon-symbol-type-parameter { color: var(--vscode-symbolIcon-typeParameterForeground); }\n.monaco-editor .codicon.codicon-symbol-unit,\n.monaco-workbench .codicon.codicon-symbol-unit { color: var(--vscode-symbolIcon-unitForeground); }\n.monaco-editor .codicon.codicon-symbol-variable,\n.monaco-workbench .codicon.codicon-symbol-variable { color: var(--vscode-symbolIcon-variableForeground); }\n",""]);const a=r},8367:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.editor-banner {\n\tbox-sizing: border-box;\n\tcursor: default;\n\twidth: 100%;\n\tfont-size: 12px;\n\tdisplay: flex;\n\toverflow: visible;\n\n\theight: 26px;\n\n\tbackground: var(--vscode-banner-background);\n}\n\n\n.editor-banner .icon-container {\n\tdisplay: flex;\n\tflex-shrink: 0;\n\talign-items: center;\n\tpadding: 0 6px 0 10px;\n}\n\n.editor-banner .icon-container.custom-icon {\n\tbackground-repeat: no-repeat;\n\tbackground-position: center center;\n\tbackground-size: 16px;\n\twidth: 16px;\n\tpadding: 0;\n\tmargin: 0 6px 0 10px;\n}\n\n.editor-banner .message-container {\n\tdisplay: flex;\n\talign-items: center;\n\tline-height: 26px;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n\toverflow: hidden;\n}\n\n.editor-banner .message-container p {\n\tmargin-block-start: 0;\n\tmargin-block-end: 0;\n}\n\n.editor-banner .message-actions-container {\n\tflex-grow: 1;\n\tflex-shrink: 0;\n\tline-height: 26px;\n\tmargin: 0 4px;\n}\n\n.editor-banner .message-actions-container a.monaco-button {\n\twidth: inherit;\n\tmargin: 2px 8px;\n\tpadding: 0px 12px;\n}\n\n.editor-banner .message-actions-container a {\n\tpadding: 3px;\n\tmargin-left: 12px;\n\ttext-decoration: underline;\n}\n\n.editor-banner .action-container {\n\tpadding: 0 10px 0 6px;\n}\n\n.editor-banner {\n\tbackground-color: var(--vscode-banner-background);\n}\n\n.editor-banner,\n.editor-banner .action-container .codicon,\n.editor-banner .message-actions-container .monaco-link {\n\tcolor: var(--vscode-banner-foreground);\n}\n\n.editor-banner .icon-container .codicon {\n\tcolor: var(--vscode-banner-iconForeground);\n}\n",""]);const a=r},8679:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .unicode-highlight {\n\tborder: 1px solid var(--vscode-editorUnicodeHighlight-border);\n\tbackground-color: var(--vscode-editorUnicodeHighlight-background);\n\tbox-sizing: border-box;\n}\n",""]);const a=r},9620:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .focused .selectionHighlight {\n\tbackground-color: var(--vscode-editor-selectionHighlightBackground);\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-editor-selectionHighlightBorder);\n}\n.monaco-editor.hc-black .focused .selectionHighlight, .monaco-editor.hc-light .focused .selectionHighlight {\n\tborder-style: dotted;\n}\n\n.monaco-editor .wordHighlight {\n\tbackground-color: var(--vscode-editor-wordHighlightBackground);\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-editor-wordHighlightBorder);\n}\n.monaco-editor.hc-black .wordHighlight, .monaco-editor.hc-light .wordHighlight {\n\tborder-style: dotted;\n}\n\n.monaco-editor .wordHighlightStrong {\n\tbackground-color: var(--vscode-editor-wordHighlightStrongBackground);\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-editor-wordHighlightStrongBorder);\n}\n.monaco-editor.hc-black .wordHighlightStrong, .monaco-editor.hc-light .wordHighlightStrong {\n\tborder-style: dotted;\n}\n\n.monaco-editor .wordHighlightText {\n\tbackground-color: var(--vscode-editor-wordHighlightTextBackground);\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-editor-wordHighlightTextBorder);\n}\n.monaco-editor.hc-black .wordHighlightText, .monaco-editor.hc-light .wordHighlightText {\n\tborder-style: dotted;\n}\n",""]);const a=r},1564:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n.monaco-editor .zone-widget {\n\tposition: absolute;\n\tz-index: 10;\n}\n\n\n.monaco-editor .zone-widget .zone-widget-container {\n\tborder-top-style: solid;\n\tborder-bottom-style: solid;\n\tborder-top-width: 0;\n\tborder-bottom-width: 0;\n\tposition: relative;\n}\n",""]);const a=r},1556:(e,t,i)=>{i.d(t,{Z:()=>p});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s),a=i(1667),l=i.n(a),h=new URL(i(6161),i.b),d=new URL(i(1096),i.b),c=r()(o()),u=l()(h),g=l()(d);c.push([e.id,`/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .iPadShowKeyboard {\n\twidth: 58px;\n\tmin-width: 0;\n\theight: 36px;\n\tmin-height: 0;\n\tmargin: 0;\n\tpadding: 0;\n\tposition: absolute;\n\tresize: none;\n\toverflow: hidden;\n\tbackground: url(${u}) center center no-repeat;\n\tborder: 4px solid #F6F6F6;\n\tborder-radius: 4px;\n}\n\n.monaco-editor.vs-dark .iPadShowKeyboard {\n\tbackground: url(${g}) center center no-repeat;\n\tborder: 4px solid #252526;\n}`,""]);const p=c},5189:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .tokens-inspect-widget {\n\tz-index: 50;\n\tuser-select: text;\n\t-webkit-user-select: text;\n\tpadding: 10px;\n\tcolor: var(--vscode-editorHoverWidget-foreground);\n\tbackground-color: var(--vscode-editorHoverWidget-background);\n\tborder: 1px solid var(--vscode-editorHoverWidget-border);\n}\n.monaco-editor.hc-black .tokens-inspect-widget, .monaco-editor.hc-light .tokens-inspect-widget {\n\tborder-width: 2px;\n}\n\n.monaco-editor .tokens-inspect-widget .tokens-inspect-separator {\n\theight: 1px;\n\tborder: 0;\n\tbackground-color: var(--vscode-editorHoverWidget-border);\n}\n\n.monaco-editor .tokens-inspect-widget .tm-token {\n\tfont-family: var(--monaco-monospace-font);\n}\n\n.monaco-editor .tokens-inspect-widget .tm-token-length {\n\tfont-weight: normal;\n\tfont-size: 60%;\n\tfloat: right;\n}\n\n.monaco-editor .tokens-inspect-widget .tm-metadata-table {\n\twidth: 100%;\n}\n\n.monaco-editor .tokens-inspect-widget .tm-metadata-value {\n\tfont-family: var(--monaco-monospace-font);\n\ttext-align: right;\n}\n\n.monaco-editor .tokens-inspect-widget .tm-token-type {\n\tfont-family: var(--monaco-monospace-font);\n}\n",""]);const a=r},3198:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.quick-input-widget {\n\tfont-size: 13px;\n}\n\n.quick-input-widget .monaco-highlighted-label .highlight,\n.quick-input-widget .monaco-highlighted-label .highlight {\n\tcolor: #0066BF;\n}\n\n.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight,\n.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight {\n\tcolor: #9DDDFF;\n}\n\n.vs-dark .quick-input-widget .monaco-highlighted-label .highlight,\n.vs-dark .quick-input-widget .monaco-highlighted-label .highlight {\n\tcolor: #0097fb;\n}\n\n.hc-black .quick-input-widget .monaco-highlighted-label .highlight,\n.hc-black .quick-input-widget .monaco-highlighted-label .highlight {\n\tcolor: #F38518;\n}\n\n.hc-light .quick-input-widget .monaco-highlighted-label .highlight,\n.hc-light .quick-input-widget .monaco-highlighted-label .highlight {\n\tcolor: #0F4A85;\n}\n\n.monaco-keybinding > .monaco-keybinding-key {\n\tbackground-color: rgba(221, 221, 221, 0.4);\n\tborder: solid 1px rgba(204, 204, 204, 0.4);\n\tborder-bottom-color: rgba(187, 187, 187, 0.4);\n\tbox-shadow: inset 0 -1px 0 rgba(187, 187, 187, 0.4);\n\tcolor: #555;\n}\n\n.hc-black .monaco-keybinding > .monaco-keybinding-key {\n\tbackground-color: transparent;\n\tborder: solid 1px rgb(111, 195, 223);\n\tbox-shadow: none;\n\tcolor: #fff;\n}\n\n.hc-light .monaco-keybinding > .monaco-keybinding-key {\n\tbackground-color: transparent;\n\tborder: solid 1px #0F4A85;\n\tbox-shadow: none;\n\tcolor: #292929;\n}\n\n.vs-dark .monaco-keybinding > .monaco-keybinding-key {\n\tbackground-color: rgba(128, 128, 128, 0.17);\n\tborder: solid 1px rgba(51, 51, 51, 0.6);\n\tborder-bottom-color: rgba(68, 68, 68, 0.6);\n\tbox-shadow: inset 0 -1px 0 rgba(68, 68, 68, 0.6);\n\tcolor: #ccc;\n}\n",""]);const a=r},643:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,'/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n\n/* Default standalone editor fonts */\n.monaco-editor {\n\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;\n\t--monaco-monospace-font: "SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label {\n\tstroke-width: 1.2px;\n}\n\n.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,\n.monaco-editor.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,\n.monaco-editor.hc-light .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label {\n\tstroke-width: 1.2px;\n}\n\n.monaco-hover p {\n\tmargin: 0;\n}\n\n/* See https://github.com/microsoft/monaco-editor/issues/2168#issuecomment-780078600 */\n.monaco-aria-container {\n\tposition: absolute !important;\n\ttop: 0; /* avoid being placed underneath a sibling element */\n\theight: 1px;\n\twidth: 1px;\n\tmargin: -1px;\n\toverflow: hidden;\n\tpadding: 0;\n\tclip: rect(1px, 1px, 1px, 1px);\n\tclip-path: inset(50%);\n}\n\n/*.monaco-editor.vs [tabindex="0"]:focus {\n\toutline: 1px solid rgba(0, 122, 204, 0.4);\n\toutline-offset: -1px;\n\topacity: 1 !important;\n}\n\n.monaco-editor.vs-dark [tabindex="0"]:focus {\n\toutline: 1px solid rgba(14, 99, 156, 0.6);\n\toutline-offset: -1px;\n\topacity: 1 !important;\n}*/\n',""]);const a=r},711:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,'/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.action-widget {\n\tfont-size: 13px;\n\tborder-radius: 0;\n\tmin-width: 160px;\n\tmax-width: 80vw;\n\tz-index: 40;\n\tdisplay: block;\n\twidth: 100%;\n\tborder: 1px solid var(--vscode-editorWidget-border) !important;\n\tborder-radius: 2px;\n\tbackground-color: var(--vscode-editorWidget-background);\n\tcolor: var(--vscode-editorWidget-foreground);\n}\n\n.context-view-block {\n\tposition: fixed;\n\tcursor: initial;\n\tleft: 0;\n\ttop: 0;\n\twidth: 100%;\n\theight: 100%;\n\tz-index: -1;\n}\n\n.context-view-pointerBlock {\n\tposition: fixed;\n\tcursor: initial;\n\tleft: 0;\n\ttop: 0;\n\twidth: 100%;\n\theight: 100%;\n\tz-index: 2;\n}\n\n.action-widget .monaco-list {\n\tuser-select: none;\n\t-webkit-user-select: none;\n\tborder: none !important;\n\tborder-width: 0 !important;\n}\n\n.action-widget .monaco-list:focus:before {\n\toutline: 0 !important;\n}\n\n.action-widget .monaco-list .monaco-scrollable-element {\n\toverflow: visible;\n}\n\n/** Styles for each row in the list element **/\n.action-widget .monaco-list .monaco-list-row {\n\tpadding: 0 10px;\n\twhite-space: nowrap;\n\tcursor: pointer;\n\ttouch-action: none;\n\twidth: 100%;\n}\n\n.action-widget .monaco-list .monaco-list-row.action.focused:not(.option-disabled) {\n\tbackground-color: var(--vscode-quickInputList-focusBackground) !important;\n\tcolor: var(--vscode-quickInputList-focusForeground);\n\toutline: 1px solid var(--vscode-menu-selectionBorder, transparent);\n\toutline-offset: -1px;\n}\n\n.action-widget .monaco-list-row.group-header {\n\tcolor: var(--vscode-descriptionForeground) !important;\n\tfont-weight: 600;\n}\n\n.action-widget .monaco-list .group-header,\n.action-widget .monaco-list .option-disabled,\n.action-widget .monaco-list .option-disabled:before,\n.action-widget .monaco-list .option-disabled .focused,\n.action-widget .monaco-list .option-disabled .focused:before {\n\tcursor: default !important;\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\tuser-select: none;\n\tbackground-color: transparent !important;\n\toutline: 0 solid !important;\n}\n\n.action-widget .monaco-list-row.action {\n\tdisplay: flex;\n\tgap: 6px;\n\talign-items: center;\n}\n\n.action-widget .monaco-list-row.action.option-disabled,\n.action-widget .monaco-list:focus .monaco-list-row.focused.action.option-disabled,\n.action-widget .monaco-list-row.action.option-disabled .codicon,\n.action-widget .monaco-list:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused).option-disabled {\n\tcolor: var(--vscode-disabledForeground);\n}\n\n\n.action-widget .monaco-list-row.action:not(.option-disabled) .codicon {\n\tcolor: inherit;\n}\n\n.action-widget .monaco-list-row.action .title {\n\tflex: 1;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n/* Action bar */\n\n.action-widget .action-widget-action-bar {\n\tbackground-color: var(--vscode-editorHoverWidget-statusBarBackground);\n\tborder-top: 1px solid var(--vscode-editorHoverWidget-border);\n}\n\n.action-widget .action-widget-action-bar::before {\n\tdisplay: block;\n\tcontent: "";\n\twidth: 100%;\n}\n\n.action-widget .action-widget-action-bar .actions-container {\n\tpadding: 0 8px;\n}\n\n.action-widget-action-bar .action-label {\n\tcolor: var(--vscode-textLink-activeForeground);\n\tfont-size: 12px;\n\tline-height: 22px;\n\tpadding: 0;\n\tpointer-events: all;\n}\n\n.action-widget-action-bar .action-item {\n\tmargin-right: 16px;\n\tpointer-events: none;\n}\n\n.action-widget-action-bar .action-label:hover {\n\tbackground-color: transparent !important;\n}\n\n.monaco-action-bar .actions-container.highlight-toggled .action-label.checked {\n\t/* The important gives this rule precedence over the hover rule. */\n\tbackground: var(--vscode-actionBar-toggledBackground) !important;\n}\n',""]);const a=r},1854:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-action-bar .action-item.menu-entry .action-label.icon {\n\twidth: 16px;\n\theight: 16px;\n\tbackground-repeat: no-repeat;\n\tbackground-position: 50%;\n\tbackground-size: 16px;\n}\n\n.monaco-dropdown-with-default {\n\tdisplay: flex !important;\n\tflex-direction: row;\n\tborder-radius: 5px;\n}\n\n.monaco-dropdown-with-default > .action-container > .action-label {\n\tmargin-right: 0;\n}\n\n.monaco-dropdown-with-default > .action-container.menu-entry > .action-label.icon {\n\twidth: 16px;\n\theight: 16px;\n\tbackground-repeat: no-repeat;\n\tbackground-position: 50%;\n\tbackground-size: 16px;\n}\n\n.monaco-dropdown-with-default > .dropdown-action-container > .monaco-dropdown > .dropdown-label .codicon[class*='codicon-'] {\n\tfont-size: 12px;\n\tpadding-left: 0px;\n\tpadding-right: 0px;\n\tline-height: 16px;\n\tmargin-left: -3px;\n}\n\n.monaco-dropdown-with-default > .dropdown-action-container > .monaco-dropdown > .dropdown-label > .action-label {\n\tdisplay: block;\n\tbackground-size: 16px;\n\tbackground-position: center center;\n\tbackground-repeat: no-repeat;\n}\n",""]);const a=r},7150:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-link {\n\tcolor: var(--vscode-textLink-foreground);\n}\n\n.monaco-link:hover {\n\tcolor: var(--vscode-textLink-activeForeground);\n}\n\n",""]);const a=r},1961:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.quick-input-widget {\n\tposition: absolute;\n\twidth: 600px;\n\tz-index: 2550;\n\tleft: 50%;\n\tmargin-left: -300px;\n\t-webkit-app-region: no-drag;\n\tborder-radius: 6px;\n}\n\n.quick-input-titlebar {\n\tdisplay: flex;\n\talign-items: center;\n\tborder-top-left-radius: 5px; /* match border radius of quick input widget */\n\tborder-top-right-radius: 5px;\n}\n\n.quick-input-left-action-bar {\n\tdisplay: flex;\n\tmargin-left: 4px;\n\tflex: 1;\n}\n\n.quick-input-title {\n\tpadding: 3px 0px;\n\ttext-align: center;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n}\n\n.quick-input-right-action-bar {\n\tdisplay: flex;\n\tmargin-right: 4px;\n\tflex: 1;\n}\n\n.quick-input-right-action-bar > .actions-container {\n\tjustify-content: flex-end;\n}\n\n.quick-input-titlebar .monaco-action-bar .action-label.codicon {\n\tbackground-position: center;\n\tbackground-repeat: no-repeat;\n\tpadding: 2px;\n}\n\n.quick-input-description {\n\tmargin: 6px 6px 6px 11px;\n}\n\n.quick-input-header .quick-input-description {\n\tmargin: 4px 2px;\n\tflex: 1;\n}\n\n.quick-input-header {\n\tdisplay: flex;\n\tpadding: 8px 6px 6px 6px;\n}\n\n.quick-input-widget.hidden-input .quick-input-header {\n\t/* reduce margins and paddings when input box hidden */\n\tpadding: 0;\n\tmargin-bottom: 0;\n}\n\n.quick-input-and-message {\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex-grow: 1;\n\tmin-width: 0;\n\tposition: relative;\n}\n\n.quick-input-check-all {\n\talign-self: center;\n\tmargin: 0;\n}\n\n.quick-input-filter {\n\tflex-grow: 1;\n\tdisplay: flex;\n\tposition: relative;\n}\n\n.quick-input-box {\n\tflex-grow: 1;\n}\n\n.quick-input-widget.show-checkboxes .quick-input-box,\n.quick-input-widget.show-checkboxes .quick-input-message {\n\tmargin-left: 5px;\n}\n\n.quick-input-visible-count {\n\tposition: absolute;\n\tleft: -10000px;\n}\n\n.quick-input-count {\n\talign-self: center;\n\tposition: absolute;\n\tright: 4px;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.quick-input-count .monaco-count-badge {\n\tvertical-align: middle;\n\tpadding: 2px 4px;\n\tborder-radius: 2px;\n\tmin-height: auto;\n\tline-height: normal;\n}\n\n.quick-input-action {\n\tmargin-left: 6px;\n}\n\n.quick-input-action .monaco-text-button {\n\tfont-size: 11px;\n\tpadding: 0 6px;\n\tdisplay: flex;\n\theight: 25px;\n\talign-items: center;\n}\n\n.quick-input-message {\n\tmargin-top: -1px;\n\tpadding: 5px;\n\toverflow-wrap: break-word;\n}\n\n.quick-input-message > .codicon {\n\tmargin: 0 0.2em;\n\tvertical-align: text-bottom;\n}\n\n/* Links in descriptions & validations */\n.quick-input-message a {\n\tcolor: inherit;\n}\n\n.quick-input-progress.monaco-progress-container {\n\tposition: relative;\n}\n\n.quick-input-list {\n\tline-height: 22px;\n}\n\n.quick-input-widget.hidden-input .quick-input-list {\n\tmargin-top: 4px; /* reduce margins when input box hidden */\n\tpadding-bottom: 4px;\n}\n\n.quick-input-list .monaco-list {\n\toverflow: hidden;\n\tmax-height: calc(20 * 22px);\n\tpadding-bottom: 5px;\n}\n\n.quick-input-list .monaco-scrollable-element {\n\tpadding: 0px 5px;\n}\n\n.quick-input-list .quick-input-list-entry {\n\tbox-sizing: border-box;\n\toverflow: hidden;\n\tdisplay: flex;\n\theight: 100%;\n\tpadding: 0 6px;\n}\n\n.quick-input-list .quick-input-list-entry.quick-input-list-separator-border {\n\tborder-top-width: 1px;\n\tborder-top-style: solid;\n}\n\n.quick-input-list .monaco-list-row {\n\tborder-radius: 3px;\n}\n\n.quick-input-list .monaco-list-row[data-index=\"0\"] .quick-input-list-entry.quick-input-list-separator-border {\n\tborder-top-style: none;\n}\n\n.quick-input-list .quick-input-list-label {\n\toverflow: hidden;\n\tdisplay: flex;\n\theight: 100%;\n\tflex: 1;\n}\n\n.quick-input-list .quick-input-list-checkbox {\n\talign-self: center;\n\tmargin: 0;\n}\n\n.quick-input-list .quick-input-list-icon {\n\tbackground-size: 16px;\n\tbackground-position: left center;\n\tbackground-repeat: no-repeat;\n\tpadding-right: 6px;\n\twidth: 16px;\n\theight: 22px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.quick-input-list .quick-input-list-rows {\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: 100%;\n\tflex: 1;\n\tmargin-left: 5px;\n}\n\n.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-rows {\n\tmargin-left: 10px;\n}\n\n.quick-input-widget .quick-input-list .quick-input-list-checkbox {\n\tdisplay: none;\n}\n.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-checkbox {\n\tdisplay: inline;\n}\n\n.quick-input-list .quick-input-list-rows > .quick-input-list-row {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.quick-input-list .quick-input-list-rows > .quick-input-list-row .monaco-icon-label,\n.quick-input-list .quick-input-list-rows > .quick-input-list-row .monaco-icon-label .monaco-icon-label-container > .monaco-icon-name-container {\n\tflex: 1; /* make sure the icon label grows within the row */\n}\n\n.quick-input-list .quick-input-list-rows > .quick-input-list-row .codicon[class*='codicon-'] {\n\tvertical-align: text-bottom;\n}\n\n.quick-input-list .quick-input-list-rows .monaco-highlighted-label > span {\n\topacity: 1;\n}\n\n.quick-input-list .quick-input-list-entry .quick-input-list-entry-keybinding {\n\tmargin-right: 8px; /* separate from the separator label or scrollbar if any */\n}\n\n.quick-input-list .quick-input-list-label-meta {\n\topacity: 0.7;\n\tline-height: normal;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n}\n\n.quick-input-list .monaco-highlighted-label .highlight {\n\tfont-weight: bold;\n}\n\n.quick-input-list .quick-input-list-entry .quick-input-list-separator {\n\tmargin-right: 4px; /* separate from keybindings or actions */\n}\n\n.quick-input-list .quick-input-list-entry-action-bar {\n\tdisplay: flex;\n\tflex: 0;\n\toverflow: visible;\n}\n\n.quick-input-list .quick-input-list-entry-action-bar .action-label {\n\t/*\n\t * By default, actions in the quick input action bar are hidden\n\t * until hovered over them or selected.\n\t */\n\tdisplay: none;\n}\n\n.quick-input-list .quick-input-list-entry-action-bar .action-label.codicon {\n\tmargin-right: 4px;\n\tpadding: 0px 2px 2px 2px;\n}\n\n.quick-input-list .quick-input-list-entry-action-bar {\n\tmargin-top: 1px;\n}\n\n.quick-input-list .quick-input-list-entry-action-bar {\n\tmargin-right: 4px; /* separate from scrollbar */\n}\n\n.quick-input-list .quick-input-list-entry .quick-input-list-entry-action-bar .action-label.always-visible,\n.quick-input-list .quick-input-list-entry:hover .quick-input-list-entry-action-bar .action-label,\n.quick-input-list .monaco-list-row.focused .quick-input-list-entry-action-bar .action-label {\n\tdisplay: flex;\n}\n\n/* focused items in quick pick */\n.quick-input-list .monaco-list-row.focused .monaco-keybinding-key,\n.quick-input-list .monaco-list-row.focused .quick-input-list-entry .quick-input-list-separator {\n\tcolor: inherit\n}\n.quick-input-list .monaco-list-row.focused .monaco-keybinding-key {\n\tbackground: none;\n}\n\n/* Quick input separators as full-row item */\n.quick-input-list .quick-input-list-separator-as-item {\n\tfont-weight: 600;\n\tfont-size: 12px;\n}\n",""]);const a=r},1050:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .zone-widget .codicon.codicon-error,\n.markers-panel .marker-icon.error, .markers-panel .marker-icon .codicon.codicon-error,\n.text-search-provider-messages .providerMessage .codicon.codicon-error,\n.extensions-viewlet > .extensions .codicon.codicon-error,\n.extension-editor .codicon.codicon-error,\n.preferences-editor .codicon.codicon-error {\n\tcolor: var(--vscode-problemsErrorIcon-foreground);\n}\n\n.monaco-editor .zone-widget .codicon.codicon-warning,\n.markers-panel .marker-icon.warning, .markers-panel .marker-icon .codicon.codicon-warning,\n.text-search-provider-messages .providerMessage .codicon.codicon-warning,\n.extensions-viewlet > .extensions .codicon.codicon-warning,\n.extension-editor .codicon.codicon-warning,\n.preferences-editor .codicon.codicon-warning {\n\tcolor: var(--vscode-problemsWarningIcon-foreground);\n}\n\n.monaco-editor .zone-widget .codicon.codicon-info,\n.markers-panel .marker-icon.info, .markers-panel .marker-icon .codicon.codicon-info,\n.text-search-provider-messages .providerMessage .codicon.codicon-info,\n.extensions-viewlet > .extensions .codicon.codicon-info,\n.extension-editor .codicon.codicon-info,\n.preferences-editor .codicon.codicon-info {\n\tcolor: var(--vscode-problemsInfoIcon-foreground);\n}\n",""]);const a=r},7205:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-action-bar {\n\twhite-space: nowrap;\n\theight: 100%;\n}\n\n.monaco-action-bar .actions-container {\n\tdisplay: flex;\n\tmargin: 0 auto;\n\tpadding: 0;\n\theight: 100%;\n\twidth: 100%;\n\talign-items: center;\n}\n\n.monaco-action-bar.vertical .actions-container {\n\tdisplay: inline-block;\n}\n\n.monaco-action-bar .action-item {\n\tdisplay: block;\n\talign-items: center;\n\tjustify-content: center;\n\tcursor: pointer;\n\tposition: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-action-bar .action-item.disabled {\n\tcursor: default;\n}\n\n.monaco-action-bar .action-item .icon,\n.monaco-action-bar .action-item .codicon {\n\tdisplay: block;\n}\n\n.monaco-action-bar .action-item .codicon {\n\tdisplay: flex;\n\talign-items: center;\n\twidth: 16px;\n\theight: 16px;\n}\n\n.monaco-action-bar .action-label {\n\tdisplay: flex;\n\tfont-size: 11px;\n\tpadding: 3px;\n\tborder-radius: 5px;\n}\n\n.monaco-action-bar .action-item.disabled .action-label,\n.monaco-action-bar .action-item.disabled .action-label::before,\n.monaco-action-bar .action-item.disabled .action-label:hover {\n\topacity: 0.6;\n}\n\n/* Vertical actions */\n\n.monaco-action-bar.vertical {\n\ttext-align: left;\n}\n\n.monaco-action-bar.vertical .action-item {\n\tdisplay: block;\n}\n\n.monaco-action-bar.vertical .action-label.separator {\n\tdisplay: block;\n\tborder-bottom: 1px solid #bbb;\n\tpadding-top: 1px;\n\tmargin-left: .8em;\n\tmargin-right: .8em;\n}\n\n.monaco-action-bar .action-item .action-label.separator {\n\twidth: 1px;\n\theight: 16px;\n\tmargin: 5px 4px !important;\n\tcursor: default;\n\tmin-width: 1px;\n\tpadding: 0;\n\tbackground-color: #bbb;\n}\n\n.secondary-actions .monaco-action-bar .action-label {\n\tmargin-left: 6px;\n}\n\n/* Action Items */\n.monaco-action-bar .action-item.select-container {\n\toverflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n\tflex: 1;\n\tmax-width: 170px;\n\tmin-width: 60px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-right: 10px;\n}\n\n.monaco-action-bar .action-item.action-dropdown-item {\n\tdisplay: flex;\n}\n\n.monaco-action-bar .action-item.action-dropdown-item > .action-dropdown-item-separator {\n\tdisplay: flex;\n\talign-items: center;\n\tcursor: default;\n}\n\n.monaco-action-bar .action-item.action-dropdown-item > .action-dropdown-item-separator > div {\n\twidth: 1px;\n}\n",""]);const a=r},7170:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-aria-container {\n\tposition: absolute; /* try to hide from window but not from screen readers */\n\tleft:-999em;\n}",""]);const a=r},7176:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-text-button {\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\twidth: 100%;\n\tpadding: 4px;\n\tborder-radius: 2px;\n\ttext-align: center;\n\tcursor: pointer;\n\tjustify-content: center;\n\talign-items: center;\n\tborder: 1px solid var(--vscode-button-border, transparent);\n\tline-height: 18px;\n}\n\n.monaco-text-button:focus {\n\toutline-offset: 2px !important;\n}\n\n.monaco-text-button:hover {\n\ttext-decoration: none !important;\n}\n\n.monaco-button.disabled:focus,\n.monaco-button.disabled {\n\topacity: 0.4 !important;\n\tcursor: default;\n}\n\n.monaco-text-button .codicon {\n\tmargin: 0 0.2em;\n\tcolor: inherit !important;\n}\n\n.monaco-text-button.monaco-text-button-with-short-label {\n\tflex-direction: row;\n\tflex-wrap: wrap;\n\tpadding: 0 4px;\n\toverflow: hidden;\n\theight: 28px;\n}\n\n.monaco-text-button.monaco-text-button-with-short-label > .monaco-button-label {\n\tflex-basis: 100%;\n}\n\n.monaco-text-button.monaco-text-button-with-short-label > .monaco-button-label-short {\n\tflex-grow: 1;\n\twidth: 0;\n\toverflow: hidden;\n}\n\n.monaco-text-button.monaco-text-button-with-short-label > .monaco-button-label,\n.monaco-text-button.monaco-text-button-with-short-label > .monaco-button-label-short {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tfont-weight: normal;\n\tfont-style: inherit;\n\tpadding: 4px 0;\n}\n\n.monaco-button-dropdown {\n\tdisplay: flex;\n\tcursor: pointer;\n}\n\n.monaco-button-dropdown.disabled {\n\tcursor: default;\n}\n\n.monaco-button-dropdown > .monaco-button:focus {\n\toutline-offset: -1px !important;\n}\n\n.monaco-button-dropdown.disabled > .monaco-button.disabled,\n.monaco-button-dropdown.disabled > .monaco-button.disabled:focus,\n.monaco-button-dropdown.disabled > .monaco-button-dropdown-separator {\n\topacity: 0.4 !important;\n}\n\n.monaco-button-dropdown > .monaco-button.monaco-text-button {\n\tborder-right-width: 0 !important;\n}\n\n.monaco-button-dropdown .monaco-button-dropdown-separator {\n\tpadding: 4px 0;\n\tcursor: default;\n}\n\n.monaco-button-dropdown .monaco-button-dropdown-separator > div {\n\theight: 100%;\n\twidth: 1px;\n}\n\n.monaco-button-dropdown > .monaco-button.monaco-dropdown-button {\n\tborder-left-width: 0 !important;\n\tborder-radius: 0 2px 2px 0;\n}\n\n.monaco-button-dropdown > .monaco-button.monaco-text-button {\n\tborder-radius: 2px 0 0 2px;\n}\n\n.monaco-description-button {\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tmargin: 4px 5px; /* allows button focus outline to be visible */\n}\n\n.monaco-description-button .monaco-button-description {\n\tfont-style: italic;\n\tfont-size: 11px;\n\tpadding: 4px 20px;\n}\n\n.monaco-description-button .monaco-button-label,\n.monaco-description-button .monaco-button-description {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n}\n\n.monaco-description-button .monaco-button-label > .codicon,\n.monaco-description-button .monaco-button-description > .codicon {\n\tmargin: 0 0.2em;\n\tcolor: inherit !important;\n}\n",""]);const a=r},4979:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.context-view {\n\tposition: absolute;\n}\n\n.context-view.fixed {\n\tall: initial;\n\tfont-family: inherit;\n\tfont-size: 13px;\n\tposition: fixed;\n\tcolor: inherit;\n}\n",""]);const a=r},6242:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-count-badge {\n\tpadding: 3px 6px;\n\tborder-radius: 11px;\n\tfont-size: 11px;\n\tmin-width: 18px;\n\tmin-height: 18px;\n\tline-height: 11px;\n\tfont-weight: normal;\n\ttext-align: center;\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n}\n\n.monaco-count-badge.long {\n\tpadding: 2px 3px;\n\tborder-radius: 2px;\n\tmin-height: auto;\n\tline-height: normal;\n}\n",""]);const a=r},6872:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-dropdown {\n\theight: 100%;\n\tpadding: 0;\n}\n\n.monaco-dropdown > .dropdown-label {\n\tcursor: pointer;\n\theight: 100%;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.monaco-dropdown > .dropdown-label > .action-label.disabled {\n\tcursor: default;\n}\n\n.monaco-dropdown-with-primary {\n\tdisplay: flex !important;\n\tflex-direction: row;\n\tborder-radius: 5px;\n}\n\n.monaco-dropdown-with-primary > .action-container > .action-label {\n\tmargin-right: 0;\n}\n\n.monaco-dropdown-with-primary > .dropdown-action-container > .monaco-dropdown > .dropdown-label .codicon[class*='codicon-'] {\n\tfont-size: 12px;\n\tpadding-left: 0px;\n\tpadding-right: 0px;\n\tline-height: 16px;\n\tmargin-left: -3px;\n}\n\n.monaco-dropdown-with-primary > .dropdown-action-container > .monaco-dropdown > .dropdown-label > .action-label {\n\tdisplay: block;\n\tbackground-size: 16px;\n\tbackground-position: center center;\n\tbackground-repeat: no-repeat;\n}\n",""]);const a=r},7779:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/* ---------- Find input ---------- */\n\n.monaco-findInput {\n\tposition: relative;\n}\n\n.monaco-findInput .monaco-inputbox {\n\tfont-size: 13px;\n\twidth: 100%;\n}\n\n.monaco-findInput > .controls {\n\tposition: absolute;\n\ttop: 3px;\n\tright: 2px;\n}\n\n.vs .monaco-findInput.disabled {\n\tbackground-color: #E1E1E1;\n}\n\n/* Theming */\n.vs-dark .monaco-findInput.disabled {\n\tbackground-color: #333;\n}\n\n/* Highlighting */\n.monaco-findInput.highlight-0 .controls,\n.hc-light .monaco-findInput.highlight-0 .controls {\n\tanimation: monaco-findInput-highlight-0 100ms linear 0s;\n}\n\n.monaco-findInput.highlight-1 .controls,\n.hc-light .monaco-findInput.highlight-1 .controls {\n\tanimation: monaco-findInput-highlight-1 100ms linear 0s;\n}\n\n.hc-black .monaco-findInput.highlight-0 .controls,\n.vs-dark .monaco-findInput.highlight-0 .controls {\n\tanimation: monaco-findInput-highlight-dark-0 100ms linear 0s;\n}\n\n.hc-black .monaco-findInput.highlight-1 .controls,\n.vs-dark .monaco-findInput.highlight-1 .controls {\n\tanimation: monaco-findInput-highlight-dark-1 100ms linear 0s;\n}\n\n@keyframes monaco-findInput-highlight-0 {\n\t0% { background: rgba(253, 255, 0, 0.8); }\n\t100% { background: transparent; }\n}\n@keyframes monaco-findInput-highlight-1 {\n\t0% { background: rgba(253, 255, 0, 0.8); }\n\t/* Made intentionally different such that the CSS minifier does not collapse the two animations into a single one*/\n\t99% { background: transparent; }\n}\n\n@keyframes monaco-findInput-highlight-dark-0 {\n\t0% { background: rgba(255, 255, 255, 0.44); }\n\t100% { background: transparent; }\n}\n@keyframes monaco-findInput-highlight-dark-1 {\n\t0% { background: rgba(255, 255, 255, 0.44); }\n\t/* Made intentionally different such that the CSS minifier does not collapse the two animations into a single one*/\n\t99% { background: transparent; }\n}\n",""]);const a=r},3241:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* ---------- Icon label ---------- */\n\n.monaco-icon-label {\n\tdisplay: flex; /* required for icons support :before rule */\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.monaco-icon-label::before {\n\n\t/* svg icons rendered as background image */\n\tbackground-size: 16px;\n\tbackground-position: left center;\n\tbackground-repeat: no-repeat;\n\tpadding-right: 6px;\n\twidth: 16px;\n\theight: 22px;\n\tline-height: inherit !important;\n\tdisplay: inline-block;\n\n\t/* fonts icons */\n\t-webkit-font-smoothing: antialiased;\n\t-moz-osx-font-smoothing: grayscale;\n\tvertical-align: top;\n\n\tflex-shrink: 0; /* fix for https://github.com/microsoft/vscode/issues/13787 */\n}\n\n.monaco-icon-label-container.disabled {\n\tcolor: var(--vscode-disabledForeground);\n}\n.monaco-icon-label > .monaco-icon-label-container {\n\tmin-width: 0;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tflex: 1;\n}\n\n.monaco-icon-label > .monaco-icon-label-container > .monaco-icon-name-container > .label-name {\n\tcolor: inherit;\n\twhite-space: pre; /* enable to show labels that include multiple whitespaces */\n}\n\n.monaco-icon-label > .monaco-icon-label-container > .monaco-icon-name-container > .label-name > .label-separator {\n\tmargin: 0 2px;\n\topacity: 0.5;\n}\n\n.monaco-icon-label > .monaco-icon-label-container > .monaco-icon-description-container > .label-description {\n\topacity: .7;\n\tmargin-left: 0.5em;\n\tfont-size: 0.9em;\n\twhite-space: pre; /* enable to show labels that include multiple whitespaces */\n}\n\n.monaco-icon-label.nowrap > .monaco-icon-label-container > .monaco-icon-description-container > .label-description{\n\twhite-space: nowrap\n}\n\n.vs .monaco-icon-label > .monaco-icon-label-container > .monaco-icon-description-container > .label-description {\n\topacity: .95;\n}\n\n.monaco-icon-label.italic > .monaco-icon-label-container > .monaco-icon-name-container > .label-name,\n.monaco-icon-label.italic > .monaco-icon-label-container > .monaco-icon-description-container > .label-description {\n\tfont-style: italic;\n}\n\n.monaco-icon-label.deprecated {\n\ttext-decoration: line-through;\n\topacity: 0.66;\n}\n\n/* make sure apply italic font style to decorations as well */\n.monaco-icon-label.italic::after {\n\tfont-style: italic;\n}\n\n.monaco-icon-label.strikethrough > .monaco-icon-label-container > .monaco-icon-name-container > .label-name,\n.monaco-icon-label.strikethrough > .monaco-icon-label-container > .monaco-icon-description-container > .label-description {\n\ttext-decoration: line-through;\n}\n\n.monaco-icon-label::after {\n\topacity: 0.75;\n\tfont-size: 90%;\n\tfont-weight: 600;\n\tmargin: auto 16px 0 5px; /* https://github.com/microsoft/vscode/issues/113223 */\n\ttext-align: center;\n}\n\n/* make sure selection color wins when a label is being selected */\n.monaco-list:focus .selected .monaco-icon-label, /* list */\n.monaco-list:focus .selected .monaco-icon-label::after\n{\n\tcolor: inherit !important;\n}\n\n.monaco-list-row.focused.selected .label-description,\n.monaco-list-row.selected .label-description {\n\topacity: .8;\n}\n",""]);const a=r},4280:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-inputbox {\n\tposition: relative;\n\tdisplay: block;\n\tpadding: 0;\n\tbox-sizing:\tborder-box;\n\tborder-radius: 2px;\n\n\t/* Customizable */\n\tfont-size: inherit;\n}\n\n.monaco-inputbox > .ibwrapper > .input,\n.monaco-inputbox > .ibwrapper > .mirror {\n\n\t/* Customizable */\n\tpadding: 4px 6px;\n}\n\n.monaco-inputbox > .ibwrapper {\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.monaco-inputbox > .ibwrapper > .input {\n\tdisplay: inline-block;\n\tbox-sizing:\tborder-box;\n\twidth: 100%;\n\theight: 100%;\n\tline-height: inherit;\n\tborder: none;\n\tfont-family: inherit;\n\tfont-size: inherit;\n\tresize: none;\n\tcolor: inherit;\n}\n\n.monaco-inputbox > .ibwrapper > input {\n\ttext-overflow: ellipsis;\n}\n\n.monaco-inputbox > .ibwrapper > textarea.input {\n\tdisplay: block;\n\tscrollbar-width: none; /* Firefox: hide scrollbars */\n\toutline: none;\n}\n\n.monaco-inputbox > .ibwrapper > textarea.input::-webkit-scrollbar {\n\tdisplay: none; /* Chrome + Safari: hide scrollbar */\n}\n\n.monaco-inputbox > .ibwrapper > textarea.input.empty {\n\twhite-space: nowrap;\n}\n\n.monaco-inputbox > .ibwrapper > .mirror {\n\tposition: absolute;\n\tdisplay: inline-block;\n\twidth: 100%;\n\ttop: 0;\n\tleft: 0;\n\tbox-sizing: border-box;\n\twhite-space: pre-wrap;\n\tvisibility: hidden;\n\tword-wrap: break-word;\n}\n\n/* Context view */\n\n.monaco-inputbox-container {\n\ttext-align: right;\n}\n\n.monaco-inputbox-container .monaco-inputbox-message {\n\tdisplay: inline-block;\n\toverflow: hidden;\n\ttext-align: left;\n\twidth: 100%;\n\tbox-sizing:\tborder-box;\n\tpadding: 0.4em;\n\tfont-size: 12px;\n\tline-height: 17px;\n\tmargin-top: -1px;\n\tword-wrap: break-word;\n}\n\n/* Action bar support */\n.monaco-inputbox .monaco-action-bar {\n\tposition: absolute;\n\tright: 2px;\n\ttop: 4px;\n}\n\n.monaco-inputbox .monaco-action-bar .action-item {\n\tmargin-left: 2px;\n}\n\n.monaco-inputbox .monaco-action-bar .action-item .codicon {\n\tbackground-repeat: no-repeat;\n\twidth: 16px;\n\theight: 16px;\n}\n",""]);const a=r},6390:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-keybinding {\n\tdisplay: flex;\n\talign-items: center;\n\tline-height: 10px;\n}\n\n.monaco-keybinding > .monaco-keybinding-key {\n\tdisplay: inline-block;\n\tborder-style: solid;\n\tborder-width: 1px;\n\tborder-radius: 3px;\n\tvertical-align: middle;\n\tfont-size: 11px;\n\tpadding: 3px 5px;\n\tmargin: 0 2px;\n}\n\n.monaco-keybinding > .monaco-keybinding-key:first-child {\n\tmargin-left: 0;\n}\n\n.monaco-keybinding > .monaco-keybinding-key:last-child {\n\tmargin-right: 0;\n}\n\n.monaco-keybinding > .monaco-keybinding-key-separator {\n\tdisplay: inline-block;\n}\n\n.monaco-keybinding > .monaco-keybinding-key-chord-separator {\n\twidth: 6px;\n}\n",""]);const a=r},9472:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-list {\n\tposition: relative;\n\theight: 100%;\n\twidth: 100%;\n\twhite-space: nowrap;\n}\n\n.monaco-list.mouse-support {\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.monaco-list > .monaco-scrollable-element {\n\theight: 100%;\n}\n\n.monaco-list-rows {\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.monaco-list.horizontal-scrolling .monaco-list-rows {\n\twidth: auto;\n\tmin-width: 100%;\n}\n\n.monaco-list-row {\n\tposition: absolute;\n\tbox-sizing: border-box;\n\toverflow: hidden;\n\twidth: 100%;\n}\n\n.monaco-list.mouse-support .monaco-list-row {\n\tcursor: pointer;\n\ttouch-action: none;\n}\n\n/* for OS X ballistic scrolling */\n.monaco-list-row.scrolling {\n\tdisplay: none !important;\n}\n\n/* Focus */\n.monaco-list.element-focused,\n.monaco-list.selection-single,\n.monaco-list.selection-multiple {\n\toutline: 0 !important;\n}\n\n/* Dnd */\n.monaco-drag-image {\n\tdisplay: inline-block;\n\tpadding: 1px 7px;\n\tborder-radius: 10px;\n\tfont-size: 12px;\n\tposition: absolute;\n\tz-index: 1000;\n}\n\n/* Filter */\n\n.monaco-list-type-filter-message {\n\tposition: absolute;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\theight: 100%;\n\ttop: 0;\n\tleft: 0;\n\tpadding: 40px 1em 1em 1em;\n\ttext-align: center;\n\twhite-space: normal;\n\topacity: 0.7;\n\tpointer-events: none;\n}\n\n.monaco-list-type-filter-message:empty {\n\tdisplay: none;\n}\n",""]);const a=r},5626:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-mouse-cursor-text {\n\tcursor: text;\n}\n",""]);const a=r},4808:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-progress-container {\n\twidth: 100%;\n\theight: 5px;\n\toverflow: hidden; /* keep progress bit in bounds */\n}\n\n.monaco-progress-container .progress-bit {\n\twidth: 2%;\n\theight: 5px;\n\tposition: absolute;\n\tleft: 0;\n\tdisplay: none;\n}\n\n.monaco-progress-container.active .progress-bit {\n\tdisplay: inherit;\n}\n\n.monaco-progress-container.discrete .progress-bit {\n\tleft: 0;\n\ttransition: width 100ms linear;\n}\n\n.monaco-progress-container.discrete.done .progress-bit {\n\twidth: 100%;\n}\n\n.monaco-progress-container.infinite .progress-bit {\n\tanimation-name: progress;\n\tanimation-duration: 4s;\n\tanimation-iteration-count: infinite;\n\ttransform: translate3d(0px, 0px, 0px);\n\tanimation-timing-function: linear;\n}\n\n.monaco-progress-container.infinite.infinite-long-running .progress-bit {\n\t/*\n\t\tThe more smooth `linear` timing function can cause\n\t\thigher GPU consumption as indicated in\n\t\thttps://github.com/microsoft/vscode/issues/97900 &\n\t\thttps://github.com/microsoft/vscode/issues/138396\n\t*/\n\tanimation-timing-function: steps(100);\n}\n\n/**\n * The progress bit has a width: 2% (1/50) of the parent container. The animation moves it from 0% to 100% of\n * that container. Since translateX is relative to the progress bit size, we have to multiple it with\n * its relative size to the parent container:\n * parent width: 5000%\n * bit width: 100%\n * translateX should be as follow:\n * 50%: 5000% * 50% - 50% (set to center) = 2450%\n * 100%: 5000% * 100% - 100% (do not overflow) = 4900%\n */\n@keyframes progress { from { transform: translateX(0%) scaleX(1) } 50% { transform: translateX(2500%) scaleX(3) } to { transform: translateX(4900%) scaleX(1) } }\n",""]);const a=r},3829:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n:root {\n\t--vscode-sash-size: 4px;\n}\n\n.monaco-sash {\n\tposition: absolute;\n\tz-index: 35;\n\ttouch-action: none;\n}\n\n.monaco-sash.disabled {\n\tpointer-events: none;\n}\n\n.monaco-sash.mac.vertical {\n\tcursor: col-resize;\n}\n\n.monaco-sash.vertical.minimum {\n\tcursor: e-resize;\n}\n\n.monaco-sash.vertical.maximum {\n\tcursor: w-resize;\n}\n\n.monaco-sash.mac.horizontal {\n\tcursor: row-resize;\n}\n\n.monaco-sash.horizontal.minimum {\n\tcursor: s-resize;\n}\n\n.monaco-sash.horizontal.maximum {\n\tcursor: n-resize;\n}\n\n.monaco-sash.disabled {\n\tcursor: default !important;\n\tpointer-events: none !important;\n}\n\n.monaco-sash.vertical {\n\tcursor: ew-resize;\n\ttop: 0;\n\twidth: var(--vscode-sash-size);\n\theight: 100%;\n}\n\n.monaco-sash.horizontal {\n\tcursor: ns-resize;\n\tleft: 0;\n\twidth: 100%;\n\theight: var(--vscode-sash-size);\n}\n\n.monaco-sash:not(.disabled) > .orthogonal-drag-handle {\n\tcontent: \" \";\n\theight: calc(var(--vscode-sash-size) * 2);\n\twidth: calc(var(--vscode-sash-size) * 2);\n\tz-index: 100;\n\tdisplay: block;\n\tcursor: all-scroll;\n\tposition: absolute;\n}\n\n.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)\n\t> .orthogonal-drag-handle.start,\n.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)\n\t> .orthogonal-drag-handle.end {\n\tcursor: nwse-resize;\n}\n\n.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)\n\t> .orthogonal-drag-handle.end,\n.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)\n\t> .orthogonal-drag-handle.start {\n\tcursor: nesw-resize;\n}\n\n.monaco-sash.vertical > .orthogonal-drag-handle.start {\n\tleft: calc(var(--vscode-sash-size) * -0.5);\n\ttop: calc(var(--vscode-sash-size) * -1);\n}\n.monaco-sash.vertical > .orthogonal-drag-handle.end {\n\tleft: calc(var(--vscode-sash-size) * -0.5);\n\tbottom: calc(var(--vscode-sash-size) * -1);\n}\n.monaco-sash.horizontal > .orthogonal-drag-handle.start {\n\ttop: calc(var(--vscode-sash-size) * -0.5);\n\tleft: calc(var(--vscode-sash-size) * -1);\n}\n.monaco-sash.horizontal > .orthogonal-drag-handle.end {\n\ttop: calc(var(--vscode-sash-size) * -0.5);\n\tright: calc(var(--vscode-sash-size) * -1);\n}\n\n.monaco-sash:before {\n\tcontent: '';\n\tpointer-events: none;\n\tposition: absolute;\n\twidth: 100%;\n\theight: 100%;\n\ttransition: background-color 0.1s ease-out;\n\tbackground: transparent;\n}\n\n.monaco-sash.hover:before,\n.monaco-sash.active:before {\n\tbackground: var(--vscode-sash-hoverBorder);\n}\n\n.monaco-sash.vertical:before {\n\twidth: var(--vscode-sash-hover-size);\n\tleft: calc(50% - (var(--vscode-sash-hover-size) / 2));\n}\n\n.monaco-sash.horizontal:before {\n\theight: var(--vscode-sash-hover-size);\n\ttop: calc(50% - (var(--vscode-sash-hover-size) / 2));\n}\n\n.pointer-events-disabled {\n\tpointer-events: none !important;\n}\n\n/** Debug **/\n\n.monaco-sash.debug {\n\tbackground: cyan;\n}\n\n.monaco-sash.debug.disabled {\n\tbackground: rgba(0, 255, 255, 0.2);\n}\n\n.monaco-sash.debug:not(.disabled) > .orthogonal-drag-handle {\n\tbackground: red;\n}\n",""]);const a=r},4625:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* Arrows */\n.monaco-scrollable-element > .scrollbar > .scra {\n\tcursor: pointer;\n\tfont-size: 11px !important;\n}\n\n.monaco-scrollable-element > .visible {\n\topacity: 1;\n\n\t/* Background rule added for IE9 - to allow clicks on dom node */\n\tbackground:rgba(0,0,0,0);\n\n\ttransition: opacity 100ms linear;\n}\n.monaco-scrollable-element > .invisible {\n\topacity: 0;\n\tpointer-events: none;\n}\n.monaco-scrollable-element > .invisible.fade {\n\ttransition: opacity 800ms linear;\n}\n\n/* Scrollable Content Inset Shadow */\n.monaco-scrollable-element > .shadow {\n\tposition: absolute;\n\tdisplay: none;\n}\n.monaco-scrollable-element > .shadow.top {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 3px;\n\theight: 3px;\n\twidth: 100%;\n\tbox-shadow: var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset;\n}\n.monaco-scrollable-element > .shadow.left {\n\tdisplay: block;\n\ttop: 3px;\n\tleft: 0;\n\theight: 100%;\n\twidth: 3px;\n\tbox-shadow: var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset;\n}\n.monaco-scrollable-element > .shadow.top-left-corner {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 0;\n\theight: 3px;\n\twidth: 3px;\n}\n.monaco-scrollable-element > .shadow.top.left {\n\tbox-shadow: var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset;\n}\n\n.monaco-scrollable-element > .scrollbar > .slider {\n\tbackground: var(--vscode-scrollbarSlider-background);\n}\n\n.monaco-scrollable-element > .scrollbar > .slider:hover {\n\tbackground: var(--vscode-scrollbarSlider-hoverBackground);\n}\n\n.monaco-scrollable-element > .scrollbar > .slider.active {\n\tbackground: var(--vscode-scrollbarSlider-activeBackground);\n}\n",""]);const a=r},1693:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-select-box {\n\twidth: 100%;\n\tcursor: pointer;\n\tborder-radius: 2px;\n}\n\n.monaco-select-box-dropdown-container {\n\tfont-size: 13px;\n\tfont-weight: normal;\n\ttext-transform: none;\n}\n\n/** Actions */\n\n.monaco-action-bar .action-item.select-container {\n\tcursor: default;\n}\n\n.monaco-action-bar .action-item .monaco-select-box {\n\tcursor: pointer;\n\tmin-width: 100px;\n\tmin-height: 18px;\n\tpadding: 2px 23px 2px 8px;\n}\n\n.mac .monaco-action-bar .action-item .monaco-select-box {\n\tfont-size: 11px;\n\tborder-radius: 5px;\n}\n",""]);const a=r},8045:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* Use custom CSS vars to expose padding into parent select for padding calculation */\n.monaco-select-box-dropdown-padding {\n\t--dropdown-padding-top: 1px;\n\t--dropdown-padding-bottom: 1px;\n}\n\n.hc-black .monaco-select-box-dropdown-padding,\n.hc-light .monaco-select-box-dropdown-padding {\n\t--dropdown-padding-top: 3px;\n\t--dropdown-padding-bottom: 4px;\n}\n\n.monaco-select-box-dropdown-container {\n\tdisplay: none;\n\tbox-sizing:\tborder-box;\n}\n\n.monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown * {\n\tmargin: 0;\n}\n\n.monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown a:focus {\n\toutline: 1px solid -webkit-focus-ring-color;\n\toutline-offset: -1px;\n}\n\n.monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown code {\n\tline-height: 15px; /** For some reason, this is needed, otherwise <code> will take up 20px height */\n\tfont-family: var(--monaco-monospace-font);\n}\n\n\n.monaco-select-box-dropdown-container.visible {\n\tdisplay: flex;\n\tflex-direction: column;\n\ttext-align: left;\n\twidth: 1px;\n\toverflow: hidden;\n\tborder-bottom-left-radius: 3px;\n\tborder-bottom-right-radius: 3px;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container {\n\tflex: 0 0 auto;\n\talign-self: flex-start;\n\tpadding-top: var(--dropdown-padding-top);\n\tpadding-bottom: var(--dropdown-padding-bottom);\n\tpadding-left: 1px;\n\tpadding-right: 1px;\n\twidth: 100%;\n\toverflow: hidden;\n\tbox-sizing:\tborder-box;\n}\n\n.monaco-select-box-dropdown-container > .select-box-details-pane {\n\tpadding: 5px;\n}\n\n.hc-black .monaco-select-box-dropdown-container > .select-box-dropdown-list-container {\n\tpadding-top: var(--dropdown-padding-top);\n\tpadding-bottom: var(--dropdown-padding-bottom);\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row {\n\tcursor: pointer;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row > .option-text {\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\tpadding-left: 3.5px;\n\twhite-space: nowrap;\n\tfloat: left;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row > .option-detail {\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\tpadding-left: 3.5px;\n\twhite-space: nowrap;\n\tfloat: left;\n\topacity: 0.7;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row > .option-decorator-right {\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\tpadding-right: 10px;\n\twhite-space: nowrap;\n\tfloat: right;\n}\n\n\n/* Accepted CSS hiding technique for accessibility reader text */\n/* https://webaim.org/techniques/css/invisiblecontent/ */\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row > .visually-hidden {\n\t\tposition: absolute;\n\t\tleft: -10000px;\n\t\ttop: auto;\n\t\twidth: 1px;\n\t\theight: 1px;\n\t\toverflow: hidden;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-container-width-control {\n\tflex: 1 1 auto;\n\talign-self: flex-start;\n\topacity: 0;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-container-width-control > .width-control-div {\n\toverflow: hidden;\n\tmax-height: 0px;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-container-width-control > .width-control-div > .option-text-width-control {\n\tpadding-left: 4px;\n\tpadding-right: 8px;\n\twhite-space: nowrap;\n}\n",""]);const a=r},1369:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-split-view2 {\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.monaco-split-view2 > .sash-container {\n\tposition: absolute;\n\twidth: 100%;\n\theight: 100%;\n\tpointer-events: none;\n}\n\n.monaco-split-view2 > .sash-container > .monaco-sash {\n\tpointer-events: initial;\n}\n\n.monaco-split-view2 > .monaco-scrollable-element {\n\twidth: 100%;\n\theight: 100%;\n}\n\n.monaco-split-view2 > .monaco-scrollable-element > .split-view-container {\n\twidth: 100%;\n\theight: 100%;\n\twhite-space: nowrap;\n\tposition: relative;\n}\n\n.monaco-split-view2 > .monaco-scrollable-element > .split-view-container > .split-view-view {\n\twhite-space: initial;\n\tposition: absolute;\n}\n\n.monaco-split-view2 > .monaco-scrollable-element > .split-view-container > .split-view-view:not(.visible) {\n\tdisplay: none;\n}\n\n.monaco-split-view2.vertical > .monaco-scrollable-element > .split-view-container > .split-view-view {\n\twidth: 100%;\n}\n\n.monaco-split-view2.horizontal > .monaco-scrollable-element > .split-view-container > .split-view-view {\n\theight: 100%;\n}\n\n.monaco-split-view2.separator-border > .monaco-scrollable-element > .split-view-container > .split-view-view:not(:first-child)::before {\n\tcontent: ' ';\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tz-index: 20;\n\tpointer-events: none;\n\tbackground-color: var(--separator-border);\n}\n\n.monaco-split-view2.separator-border.horizontal > .monaco-scrollable-element > .split-view-container > .split-view-view:not(:first-child)::before {\n\theight: 100%;\n\twidth: 1px;\n}\n\n.monaco-split-view2.separator-border.vertical > .monaco-scrollable-element > .split-view-container > .split-view-view:not(:first-child)::before {\n\theight: 1px;\n\twidth: 100%;\n}\n",""]);const a=r},9251:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,'/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-table {\n\tdisplay: flex;\n\tflex-direction: column;\n\tposition: relative;\n\theight: 100%;\n\twidth: 100%;\n\twhite-space: nowrap;\n\toverflow: hidden;\n}\n\n.monaco-table > .monaco-split-view2 {\n\tborder-bottom: 1px solid transparent;\n}\n\n.monaco-table > .monaco-list {\n\tflex: 1;\n}\n\n.monaco-table-tr {\n\tdisplay: flex;\n\theight: 100%;\n}\n\n.monaco-table-th {\n\twidth: 100%;\n\theight: 100%;\n\tfont-weight: bold;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.monaco-table-th,\n.monaco-table-td {\n\tbox-sizing: border-box;\n\tflex-shrink: 0;\n\toverflow: hidden;\n\twhite-space: nowrap;\n\ttext-overflow: ellipsis;\n}\n\n.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {\n\tcontent: "";\n\tposition: absolute;\n\tleft: calc(var(--vscode-sash-size) / 2);\n\twidth: 0;\n\tborder-left: 1px solid transparent;\n}\n\n.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2,\n.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {\n\ttransition: border-color 0.2s ease-out;\n}\n',""]);const a=r},2647:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-custom-toggle {\n\tmargin-left: 2px;\n\tfloat: left;\n\tcursor: pointer;\n\toverflow: hidden;\n\twidth: 20px;\n\theight: 20px;\n\tborder-radius: 3px;\n\tborder: 1px solid transparent;\n\tpadding: 1px;\n\tbox-sizing:\tborder-box;\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.monaco-custom-toggle:hover {\n\tbackground-color: var(--vscode-inputOption-hoverBackground);\n}\n\n.hc-black .monaco-custom-toggle:hover,\n.hc-light .monaco-custom-toggle:hover {\n\tborder: 1px dashed var(--vscode-focusBorder);\n}\n\n.hc-black .monaco-custom-toggle,\n.hc-light .monaco-custom-toggle {\n\tbackground: none;\n}\n\n.hc-black .monaco-custom-toggle:hover,\n.hc-light .monaco-custom-toggle:hover {\n\tbackground: none;\n}\n\n.monaco-custom-toggle.monaco-checkbox {\n\theight: 18px;\n\twidth: 18px;\n\tborder: 1px solid transparent;\n\tborder-radius: 3px;\n\tmargin-right: 9px;\n\tmargin-left: 0px;\n\tpadding: 0px;\n\topacity: 1;\n\tbackground-size: 16px !important;\n}\n\n/* hide check when unchecked */\n.monaco-custom-toggle.monaco-checkbox:not(.checked)::before {\n\tvisibility: hidden;\n}\n",""]);const a=r},98:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-tl-row {\n\tdisplay: flex;\n\theight: 100%;\n\talign-items: center;\n\tposition: relative;\n}\n\n.monaco-tl-row.disabled {\n\tcursor: default;\n}\n.monaco-tl-indent {\n\theight: 100%;\n\tposition: absolute;\n\ttop: 0;\n\tleft: 16px;\n\tpointer-events: none;\n}\n\n.hide-arrows .monaco-tl-indent {\n\tleft: 12px;\n}\n\n.monaco-tl-indent > .indent-guide {\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n\theight: 100%;\n\tborder-left: 1px solid transparent;\n}\n\n.monaco-tl-indent > .indent-guide {\n\ttransition: border-color 0.1s linear;\n}\n\n.monaco-tl-twistie,\n.monaco-tl-contents {\n\theight: 100%;\n}\n\n.monaco-tl-twistie {\n\tfont-size: 10px;\n\ttext-align: right;\n\tpadding-right: 6px;\n\tflex-shrink: 0;\n\twidth: 16px;\n\tdisplay: flex !important;\n\talign-items: center;\n\tjustify-content: center;\n\ttransform: translateX(3px);\n}\n\n.monaco-tl-contents {\n\tflex: 1;\n\toverflow: hidden;\n}\n\n.monaco-tl-twistie::before {\n\tborder-radius: 20px;\n}\n\n.monaco-tl-twistie.collapsed::before {\n\ttransform: rotate(-90deg);\n}\n\n.monaco-tl-twistie.codicon-tree-item-loading::before {\n\t/* Use steps to throttle FPS to reduce CPU usage */\n\tanimation: codicon-spin 1.25s steps(30) infinite;\n}\n\n.monaco-tree-type-filter {\n\tposition: absolute;\n\ttop: 0;\n\tdisplay: flex;\n\tpadding: 3px;\n\ttransition: top 0.3s;\n\tmax-width: 200px;\n\tz-index: 100;\n\tmargin: 0 6px;\n}\n\n.monaco-tree-type-filter.disabled {\n\ttop: -40px !important;\n}\n\n.monaco-tree-type-filter-grab {\n\tdisplay: flex !important;\n\talign-items: center;\n\tjustify-content: center;\n\tcursor: grab;\n\tmargin-right: 2px;\n}\n\n.monaco-tree-type-filter-grab.grabbing {\n\tcursor: grabbing;\n}\n\n.monaco-tree-type-filter-input {\n\tflex: 1;\n}\n\n.monaco-tree-type-filter-input .monaco-inputbox {\n\theight: 23px;\n}\n\n.monaco-tree-type-filter-input .monaco-inputbox > .ibwrapper > .input,\n.monaco-tree-type-filter-input .monaco-inputbox > .ibwrapper > .mirror {\n\tpadding: 2px 4px;\n}\n\n.monaco-tree-type-filter-input .monaco-findInput > .controls {\n\ttop: 2px;\n}\n\n.monaco-tree-type-filter-actionbar {\n\tmargin-left: 4px;\n}\n\n.monaco-tree-type-filter-actionbar .monaco-action-bar .action-label {\n\tpadding: 2px;\n}\n",""]);const a=r},4548:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.quick-input-widget {\n\tposition: absolute;\n\twidth: 600px;\n\tz-index: 2550;\n\tleft: 50%;\n\tmargin-left: -300px;\n\t-webkit-app-region: no-drag;\n\tborder-radius: 6px;\n}\n\n.quick-input-titlebar {\n\tdisplay: flex;\n\talign-items: center;\n\tborder-top-left-radius: 5px; /* match border radius of quick input widget */\n\tborder-top-right-radius: 5px;\n}\n\n.quick-input-left-action-bar {\n\tdisplay: flex;\n\tmargin-left: 4px;\n\tflex: 1;\n}\n\n.quick-input-title {\n\tpadding: 3px 0px;\n\ttext-align: center;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n}\n\n.quick-input-right-action-bar {\n\tdisplay: flex;\n\tmargin-right: 4px;\n\tflex: 1;\n}\n\n.quick-input-right-action-bar > .actions-container {\n\tjustify-content: flex-end;\n}\n\n.quick-input-titlebar .monaco-action-bar .action-label.codicon {\n\tbackground-position: center;\n\tbackground-repeat: no-repeat;\n\tpadding: 2px;\n}\n\n.quick-input-description {\n\tmargin: 6px;\n}\n\n.quick-input-header .quick-input-description {\n\tmargin: 4px 2px;\n}\n\n.quick-input-header {\n\tdisplay: flex;\n\tpadding: 8px 6px 6px 6px;\n}\n\n.quick-input-widget.hidden-input .quick-input-header {\n\t/* reduce margins and paddings when input box hidden */\n\tpadding: 0;\n\tmargin-bottom: 0;\n}\n\n.quick-input-and-message {\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex-grow: 1;\n\tmin-width: 0;\n\tposition: relative;\n}\n\n.quick-input-check-all {\n\talign-self: center;\n\tmargin: 0;\n}\n\n.quick-input-filter {\n\tflex-grow: 1;\n\tdisplay: flex;\n\tposition: relative;\n}\n\n.quick-input-box {\n\tflex-grow: 1;\n}\n\n.quick-input-widget.show-checkboxes .quick-input-box,\n.quick-input-widget.show-checkboxes .quick-input-message {\n\tmargin-left: 5px;\n}\n\n.quick-input-visible-count {\n\tposition: absolute;\n\tleft: -10000px;\n}\n\n.quick-input-count {\n\talign-self: center;\n\tposition: absolute;\n\tright: 4px;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.quick-input-count .monaco-count-badge {\n\tvertical-align: middle;\n\tpadding: 2px 4px;\n\tborder-radius: 2px;\n\tmin-height: auto;\n\tline-height: normal;\n}\n\n.quick-input-action {\n\tmargin-left: 6px;\n}\n\n.quick-input-action .monaco-text-button {\n\tfont-size: 11px;\n\tpadding: 0 6px;\n\tdisplay: flex;\n\theight: 25px;\n\talign-items: center;\n}\n\n.quick-input-message {\n\tmargin-top: -1px;\n\tpadding: 5px;\n\toverflow-wrap: break-word;\n}\n\n.quick-input-message > .codicon {\n\tmargin: 0 0.2em;\n\tvertical-align: text-bottom;\n}\n\n.quick-input-progress.monaco-progress-container {\n\tposition: relative;\n}\n\n.quick-input-progress.monaco-progress-container,\n.quick-input-progress.monaco-progress-container .progress-bit {\n\theight: 2px;\n}\n\n.quick-input-list {\n\tline-height: 22px;\n}\n\n.quick-input-widget.hidden-input .quick-input-list {\n\tmargin-top: 4px; /* reduce margins when input box hidden */\n\tpadding-bottom: 4px;\n}\n\n.quick-input-list .monaco-list {\n\toverflow: hidden;\n\tmax-height: calc(20 * 22px);\n\tpadding-bottom: 5px;\n}\n\n.quick-input-list .monaco-scrollable-element {\n\tpadding: 0px 5px;\n}\n\n.quick-input-list .quick-input-list-entry {\n\tbox-sizing: border-box;\n\toverflow: hidden;\n\tdisplay: flex;\n\theight: 100%;\n\tpadding: 0 6px;\n}\n\n.quick-input-list .quick-input-list-entry.quick-input-list-separator-border {\n\tborder-top-width: 1px;\n\tborder-top-style: solid;\n}\n\n.quick-input-list .monaco-list-row {\n\tborder-radius: 3px;\n}\n\n.quick-input-list .monaco-list-row[data-index=\"0\"] .quick-input-list-entry.quick-input-list-separator-border {\n\tborder-top-style: none;\n}\n\n.quick-input-list .quick-input-list-label {\n\toverflow: hidden;\n\tdisplay: flex;\n\theight: 100%;\n\tflex: 1;\n}\n\n.quick-input-list .quick-input-list-checkbox {\n\talign-self: center;\n\tmargin: 0;\n}\n\n.quick-input-list .quick-input-list-rows {\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: 100%;\n\tflex: 1;\n\tmargin-left: 5px;\n}\n\n.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-rows {\n\tmargin-left: 10px;\n}\n\n.quick-input-widget .quick-input-list .quick-input-list-checkbox {\n\tdisplay: none;\n}\n.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-checkbox {\n\tdisplay: inline;\n}\n\n.quick-input-list .quick-input-list-rows > .quick-input-list-row {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.quick-input-list .quick-input-list-rows > .quick-input-list-row .monaco-icon-label,\n.quick-input-list .quick-input-list-rows > .quick-input-list-row .monaco-icon-label .monaco-icon-label-container > .monaco-icon-name-container {\n\tflex: 1; /* make sure the icon label grows within the row */\n}\n\n.quick-input-list .quick-input-list-rows > .quick-input-list-row .codicon[class*='codicon-'] {\n\tvertical-align: text-bottom;\n}\n\n.quick-input-list .quick-input-list-rows .monaco-highlighted-label > span {\n\topacity: 1;\n}\n\n.quick-input-list .quick-input-list-entry .quick-input-list-entry-keybinding {\n\tmargin-right: 8px; /* separate from the separator label or scrollbar if any */\n}\n\n.quick-input-list .quick-input-list-label-meta {\n\topacity: 0.7;\n\tline-height: normal;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n}\n\n.quick-input-list .monaco-highlighted-label .highlight {\n\tfont-weight: bold;\n}\n\n.quick-input-list .quick-input-list-entry .quick-input-list-separator {\n\tmargin-right: 4px; /* separate from keybindings or actions */\n}\n\n.quick-input-list .quick-input-list-entry-action-bar {\n\tdisplay: flex;\n\tflex: 0;\n\toverflow: visible;\n}\n\n.quick-input-list .quick-input-list-entry-action-bar .action-label {\n\t/*\n\t * By default, actions in the quick input action bar are hidden\n\t * until hovered over them or selected.\n\t */\n\tdisplay: none;\n}\n\n.quick-input-list .quick-input-list-entry-action-bar .action-label.codicon {\n\tmargin-right: 4px;\n\tpadding: 0px 2px 2px 2px;\n}\n\n.quick-input-list .quick-input-list-entry-action-bar {\n\tmargin-top: 1px;\n}\n\n.quick-input-list .quick-input-list-entry-action-bar {\n\tmargin-right: 4px; /* separate from scrollbar */\n}\n\n.quick-input-list .quick-input-list-entry .quick-input-list-entry-action-bar .action-label.always-visible,\n.quick-input-list .quick-input-list-entry:hover .quick-input-list-entry-action-bar .action-label,\n.quick-input-list .monaco-list-row.focused .quick-input-list-entry-action-bar .action-label {\n\tdisplay: flex;\n}\n\n/* focused items in quick pick */\n.quick-input-list .monaco-list-row.focused .monaco-keybinding-key,\n.quick-input-list .monaco-list-row.focused .quick-input-list-entry .quick-input-list-separator {\n\tcolor: inherit\n}\n.quick-input-list .monaco-list-row.focused .monaco-keybinding-key {\n\tbackground: none;\n}\n",""]);const a=r},9657:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .inputarea {\n\tmin-width: 0;\n\tmin-height: 0;\n\tmargin: 0;\n\tpadding: 0;\n\tposition: absolute;\n\toutline: none !important;\n\tresize: none;\n\tborder: none;\n\toverflow: hidden;\n\tcolor: transparent;\n\tbackground-color: transparent;\n\tz-index: -10;\n}\n/*.monaco-editor .inputarea {\n\tposition: fixed !important;\n\twidth: 800px !important;\n\theight: 500px !important;\n\ttop: initial !important;\n\tleft: initial !important;\n\tbottom: 0 !important;\n\tright: 0 !important;\n\tcolor: black !important;\n\tbackground: white !important;\n\tline-height: 15px !important;\n\tfont-size: 14px !important;\n\tz-index: 10 !important;\n}*/\n.monaco-editor .inputarea.ime-input {\n\tz-index: 10;\n\tcaret-color: var(--vscode-editorCursor-foreground);\n\tcolor: var(--vscode-editor-foreground);\n}\n",""]);const a=r},2246:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .blockDecorations-container {\n\tposition: absolute;\n\ttop: 0;\n}\n\n.monaco-editor .blockDecorations-block {\n\tposition: absolute;\n\tbox-sizing: border-box;\n}\n",""]);const a=r},3334:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .view-overlays .current-line {\n\tdisplay: block;\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\tbox-sizing: border-box;\n}\n\n.monaco-editor .margin-view-overlays .current-line {\n\tdisplay: block;\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\tbox-sizing: border-box;\n}\n\n.monaco-editor .margin-view-overlays .current-line.current-line-margin.current-line-margin-both {\n\tborder-right: 0;\n}\n",""]);const a=r},4926:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/*\n\tKeeping name short for faster parsing.\n\tcdr = core decorations rendering (div)\n*/\n.monaco-editor .lines-content .cdr {\n\tposition: absolute;\n}",""]);const a=r},9430:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .glyph-margin {\n\tposition: absolute;\n\ttop: 0;\n}\n\n/*\n\tKeeping name short for faster parsing.\n\tcgmr = core glyph margin rendering (div)\n*/\n.monaco-editor .margin-view-overlays .cgmr {\n\tposition: absolute;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n",""]);const a=r},256:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .lines-content .core-guide {\n\tposition: absolute;\n\tbox-sizing: border-box;\n}\n\n.monaco-editor .lines-content .core-guide-indent {\n\tbox-shadow: 1px 0 0 0 var(--vscode-editorIndentGuide-background) inset;\n}\n\n.monaco-editor .lines-content .core-guide-indent-active {\n\tbox-shadow: 1px 0 0 0 var(--vscode-editorIndentGuide-activeBackground, --vscode-editorIndentGuide-background) inset;\n}\n",""]);const a=r},5792:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .margin-view-overlays .line-numbers {\n\tfont-variant-numeric: tabular-nums;\n\tposition: absolute;\n\ttext-align: right;\n\tdisplay: inline-block;\n\tvertical-align: middle;\n\tbox-sizing: border-box;\n\tcursor: default;\n\theight: 100%;\n}\n\n.monaco-editor .relative-current-line-number {\n\ttext-align: left;\n\tdisplay: inline-block;\n\twidth: 100%;\n}\n\n.monaco-editor .margin-view-overlays .line-numbers.lh-odd {\n\tmargin-top: 1px;\n}\n\n.monaco-editor .line-numbers {\n\tcolor: var(--vscode-editorLineNumber-foreground);\n}\n\n.monaco-editor .line-numbers.active-line-number {\n\tcolor: var(--vscode-editorLineNumber-activeForeground);\n}\n",""]);const a=r},1413:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* Uncomment to see lines flashing when they're painted */\n/*.monaco-editor .view-lines > .view-line {\n\tbackground-color: none;\n\tanimation-name: flash-background;\n\tanimation-duration: 800ms;\n}\n@keyframes flash-background {\n\t0% { background-color: lightgreen; }\n\t100% { background-color: none }\n}*/\n\n.mtkcontrol {\n\tcolor: rgb(255, 255, 255) !important;\n\tbackground: rgb(150, 0, 0) !important;\n}\n\n.mtkoverflow {\n\tbackground-color: var(--vscode-button-background, --vscode-editor-background);\n\tcolor: var(--vscode-button-foreground, --vscode-editor-foreground);\n\tborder-width: 1px;\n\tborder-style: solid;\n\tborder-color: var(--vscode-contrastBorder);\n\tborder-radius: 2px;\n\tpadding: 4px;\n\tcursor: pointer;\n}\n.mtkoverflow:hover {\n\tbackground-color: var(--vscode-button-hoverBackground);\n}\n\n.monaco-editor.no-user-select .lines-content,\n.monaco-editor.no-user-select .view-line,\n.monaco-editor.no-user-select .view-lines {\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n/* Use user-select: text for lookup feature on macOS */\n/* https://github.com/microsoft/vscode/issues/85632 */\n.monaco-editor.mac .lines-content:hover,\n.monaco-editor.mac .view-line:hover,\n.monaco-editor.mac .view-lines:hover {\n\tuser-select: text;\n\t-webkit-user-select: text;\n\t-ms-user-select: text;\n}\n\n.monaco-editor.enable-user-select {\n\tuser-select: initial;\n\t-webkit-user-select: initial;\n}\n\n.monaco-editor .view-lines {\n\twhite-space: nowrap;\n}\n\n.monaco-editor .view-line {\n\tposition: absolute;\n\twidth: 100%;\n}\n\n.monaco-editor .mtkw {\n\tcolor: var(--vscode-editorWhitespace-foreground) !important;\n}\n\n.monaco-editor .mtkz {\n\tdisplay: inline-block;\n\tcolor: var(--vscode-editorWhitespace-foreground) !important;\n}\n\n/* TODO@tokenization bootstrap fix */\n/*.monaco-editor .view-line > span > span {\n\tfloat: none;\n\tmin-height: inherit;\n\tmargin-left: inherit;\n}*/\n",""]);const a=r},7361:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n.monaco-editor .lines-decorations {\n\tposition: absolute;\n\ttop: 0;\n\tbackground: white;\n}\n\n/*\n\tKeeping name short for faster parsing.\n\tcldr = core lines decorations rendering (div)\n*/\n.monaco-editor .margin-view-overlays .cldr {\n\tposition: absolute;\n\theight: 100%;\n}",""]);const a=r},4209:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .margin {\n\tbackground-color: var(--vscode-editorGutter-background);\n}\n",""]);const a=r},9591:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/*\n\tKeeping name short for faster parsing.\n\tcmdr = core margin decorations rendering (div)\n*/\n.monaco-editor .margin-view-overlays .cmdr {\n\tposition: absolute;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n}",""]);const a=r},6997:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* START cover the case that slider is visible on mouseover */\n.monaco-editor .minimap.slider-mouseover .minimap-slider {\n\topacity: 0;\n\ttransition: opacity 100ms linear;\n}\n.monaco-editor .minimap.slider-mouseover:hover .minimap-slider {\n\topacity: 1;\n}\n.monaco-editor .minimap.slider-mouseover .minimap-slider.active {\n\topacity: 1;\n}\n/* END cover the case that slider is visible on mouseover */\n.monaco-editor .minimap-slider .minimap-slider-horizontal {\n\tbackground: var(--vscode-minimapSlider-background);\n}\n.monaco-editor .minimap-slider:hover .minimap-slider-horizontal {\n\tbackground: var(--vscode-minimapSlider-hoverBackground);\n}\n.monaco-editor .minimap-slider.active .minimap-slider-horizontal {\n\tbackground: var(--vscode-minimapSlider-activeBackground);\n}\n.monaco-editor .minimap-shadow-visible {\n\tbox-shadow: var(--vscode-scrollbar-shadow) -6px 0 6px -6px inset;\n}\n.monaco-editor .minimap-shadow-hidden {\n\tposition: absolute;\n\twidth: 0;\n}\n.monaco-editor .minimap-shadow-visible {\n\tposition: absolute;\n\tleft: -6px;\n\twidth: 6px;\n}\n.monaco-editor.no-minimap-shadow .minimap-shadow-visible {\n\tposition: absolute;\n\tleft: -1px;\n\twidth: 1px;\n}\n\n/* 0.5s fade in/out for the minimap */\n.minimap.autohide {\n\topacity: 0;\n\ttransition: opacity 0.5s;\n}\n.minimap.autohide:hover {\n\topacity: 1;\n}\n",""]);const a=r},5691:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n.monaco-editor .overlayWidgets {\n\tposition: absolute;\n\ttop: 0;\n\tleft:0;\n}",""]);const a=r},1941:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .view-ruler {\n\tposition: absolute;\n\ttop: 0;\n\tbox-shadow: 1px 0 0 0 var(--vscode-editorRuler-foreground) inset;\n}\n",""]);const a=r},6650:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .scroll-decoration {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\theight: 6px;\n\tbox-shadow: var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset;\n}\n",""]);const a=r},8588:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/*\n\tKeeping name short for faster parsing.\n\tcslr = core selections layer rendering (div)\n*/\n.monaco-editor .lines-content .cslr {\n\tposition: absolute;\n}\n\n.monaco-editor .focused .selected-text {\n\tbackground-color: var(--vscode-editor-selectionBackground);\n}\n\n.monaco-editor .selected-text {\n\tbackground-color: var(--vscode-editor-inactiveSelectionBackground);\n}\n\n.monaco-editor\t\t\t.top-left-radius\t\t{ border-top-left-radius: 3px; }\n.monaco-editor\t\t\t.bottom-left-radius\t\t{ border-bottom-left-radius: 3px; }\n.monaco-editor\t\t\t.top-right-radius\t\t{ border-top-right-radius: 3px; }\n.monaco-editor\t\t\t.bottom-right-radius\t{ border-bottom-right-radius: 3px; }\n\n.monaco-editor.hc-black .top-left-radius\t\t{ border-top-left-radius: 0; }\n.monaco-editor.hc-black .bottom-left-radius\t\t{ border-bottom-left-radius: 0; }\n.monaco-editor.hc-black .top-right-radius\t\t{ border-top-right-radius: 0; }\n.monaco-editor.hc-black .bottom-right-radius\t{ border-bottom-right-radius: 0; }\n\n.monaco-editor.hc-light .top-left-radius\t\t{ border-top-left-radius: 0; }\n.monaco-editor.hc-light .bottom-left-radius\t\t{ border-bottom-left-radius: 0; }\n.monaco-editor.hc-light .top-right-radius\t\t{ border-top-right-radius: 0; }\n.monaco-editor.hc-light .bottom-right-radius\t{ border-bottom-right-radius: 0; }\n",""]);const a=r},1276:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n.monaco-editor .cursors-layer {\n\tposition: absolute;\n\ttop: 0;\n}\n\n.monaco-editor .cursors-layer > .cursor {\n\tposition: absolute;\n\toverflow: hidden;\n\tbox-sizing: border-box;\n}\n\n/* -- smooth-caret-animation -- */\n.monaco-editor .cursors-layer.cursor-smooth-caret-animation > .cursor {\n\ttransition: all 80ms;\n}\n\n/* -- block-outline-style -- */\n.monaco-editor .cursors-layer.cursor-block-outline-style > .cursor {\n\tbackground: transparent !important;\n\tborder-style: solid;\n\tborder-width: 1px;\n}\n\n/* -- underline-style -- */\n.monaco-editor .cursors-layer.cursor-underline-style > .cursor {\n\tborder-bottom-width: 2px;\n\tborder-bottom-style: solid;\n\tbackground: transparent !important;\n}\n\n/* -- underline-thin-style -- */\n.monaco-editor .cursors-layer.cursor-underline-thin-style > .cursor {\n\tborder-bottom-width: 1px;\n\tborder-bottom-style: solid;\n\tbackground: transparent !important;\n}\n\n@keyframes monaco-cursor-smooth {\n\t0%,\n\t20% {\n\t\topacity: 1;\n\t}\n\t60%,\n\t100% {\n\t\topacity: 0;\n\t}\n}\n\n@keyframes monaco-cursor-phase {\n\t0%,\n\t20% {\n\t\topacity: 1;\n\t}\n\t90%,\n\t100% {\n\t\topacity: 0;\n\t}\n}\n\n@keyframes monaco-cursor-expand {\n\t0%,\n\t20% {\n\t\ttransform: scaleY(1);\n\t}\n\t80%,\n\t100% {\n\t\ttransform: scaleY(0);\n\t}\n}\n\n.cursor-smooth {\n\tanimation: monaco-cursor-smooth 0.5s ease-in-out 0s 20 alternate;\n}\n\n.cursor-phase {\n\tanimation: monaco-cursor-phase 0.5s ease-in-out 0s 20 alternate;\n}\n\n.cursor-expand > .cursor {\n\tanimation: monaco-cursor-expand 0.5s ease-in-out 0s 20 alternate;\n}\n",""]);const a=r},4638:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .mwh {\n\tposition: absolute;\n\tcolor: var(--vscode-editorWhitespace-foreground) !important;\n}\n",""]);const a=r},9618:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/* ---------- DiffEditor ---------- */\n\n.monaco-diff-editor .diffOverview {\n\tz-index: 9;\n}\n\n.monaco-diff-editor .diffOverview .diffViewport {\n\tz-index: 10;\n}\n\n/* colors not externalized: using transparancy on background */\n.monaco-diff-editor.vs\t\t\t.diffOverview { background: rgba(0, 0, 0, 0.03); }\n.monaco-diff-editor.vs-dark\t\t.diffOverview { background: rgba(255, 255, 255, 0.01); }\n\n.monaco-scrollable-element.modified-in-monaco-diff-editor.vs\t\t.scrollbar { background: rgba(0,0,0,0); }\n.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark\t.scrollbar { background: rgba(0,0,0,0); }\n.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black\t.scrollbar { background: none; }\n.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-light\t.scrollbar { background: none; }\n\n.monaco-scrollable-element.modified-in-monaco-diff-editor .slider {\n\tz-index: 10;\n}\n.modified-in-monaco-diff-editor\t\t\t\t.slider.active { background: rgba(171, 171, 171, .4); }\n.modified-in-monaco-diff-editor.hc-black\t.slider.active { background: none; }\n.modified-in-monaco-diff-editor.hc-light\t.slider.active { background: none; }\n\n/* ---------- Diff ---------- */\n\n.monaco-editor .insert-sign,\n.monaco-diff-editor .insert-sign,\n.monaco-editor .delete-sign,\n.monaco-diff-editor .delete-sign {\n\tfont-size: 11px !important;\n\topacity: 0.7 !important;\n\tdisplay: flex !important;\n\talign-items: center;\n}\n.monaco-editor.hc-black .insert-sign,\n.monaco-diff-editor.hc-black .insert-sign,\n.monaco-editor.hc-black .delete-sign,\n.monaco-diff-editor.hc-black .delete-sign,\n.monaco-editor.hc-light .insert-sign,\n.monaco-diff-editor.hc-light .insert-sign,\n.monaco-editor.hc-light .delete-sign,\n.monaco-diff-editor.hc-light .delete-sign {\n\topacity: 1;\n}\n\n.monaco-editor .inline-deleted-margin-view-zone {\n\ttext-align: right;\n}\n.monaco-editor .inline-added-margin-view-zone {\n\ttext-align: right;\n}\n\n.monaco-editor .arrow-revert-change {\n\tz-index: 10;\n\tposition: absolute;\n}\n\n.monaco-editor .arrow-revert-change:hover {\n\tcursor: pointer;\n}\n\n/* ---------- Inline Diff ---------- */\n\n.monaco-editor .view-zones .view-lines .view-line span {\n\tdisplay: inline-block;\n}\n\n.monaco-editor .margin-view-zones .lightbulb-glyph:hover {\n\tcursor: pointer;\n}\n\n.monaco-editor .char-insert, .monaco-diff-editor .char-insert {\n\tbackground-color: var(--vscode-diffEditor-insertedTextBackground);\n}\n\n.monaco-editor .line-insert, .monaco-diff-editor .line-insert {\n\tbackground-color: var(--vscode-diffEditor-insertedLineBackground, --vscode-diffEditor-insertedTextBackground);\n}\n\n.monaco-editor .line-insert,\n.monaco-editor .char-insert {\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-diffEditor-insertedTextBorder);\n}\n.monaco-editor.hc-black .line-insert, .monaco-editor.hc-light .line-insert,\n.monaco-editor.hc-black .char-insert, .monaco-editor.hc-light .char-insert {\n\tborder-style: dashed;\n}\n\n.monaco-editor .line-delete,\n.monaco-editor .char-delete {\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-diffEditor-removedTextBorder);\n}\n.monaco-editor.hc-black .line-delete, .monaco-editor.hc-light .line-delete,\n.monaco-editor.hc-black .char-delete, .monaco-editor.hc-light .char-delete {\n\tborder-style: dashed;\n}\n\n.monaco-editor .inline-added-margin-view-zone,\n.monaco-editor .gutter-insert, .monaco-diff-editor .gutter-insert {\n\tbackground-color: var(--vscode-diffEditorGutter-insertedLineBackground, --vscode-diffEditor-insertedLineBackground, --vscode-diffEditor-insertedTextBackground);\n}\n\n.monaco-editor .char-delete, .monaco-diff-editor .char-delete {\n\tbackground-color: var(--vscode-diffEditor-removedTextBackground);\n}\n\n.monaco-editor .line-delete, .monaco-diff-editor .line-delete {\n\tbackground-color: var(--vscode-diffEditor-removedLineBackground, --vscode-diffEditor-removedTextBackground);\n}\n\n.monaco-editor .inline-deleted-margin-view-zone,\n.monaco-editor .gutter-delete, .monaco-diff-editor .gutter-delete {\n\tbackground-color: var(--vscode-diffEditorGutter-removedLineBackground, --vscode-diffEditor-removedLineBackground, --vscode-diffEditor-removedTextBackground);\n}\n\n.monaco-diff-editor.side-by-side .editor.modified {\n\tbox-shadow: -6px 0 5px -5px var(--vscode-scrollbar-shadow);\n\tborder-left: 1px solid var(--vscode-diffEditor-border);\n}\n\n.monaco-diff-editor .diffViewport {\n\tbackground: var(--vscode-scrollbarSlider-background);\n}\n\n.monaco-diff-editor .diffViewport:hover {\n\tbackground: var(--vscode-scrollbarSlider-hoverBackground);\n}\n\n.monaco-diff-editor .diffViewport:active {\n\tbackground: var(--vscode-scrollbarSlider-activeBackground);\n}\n",""]);const a=r},4672:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-diff-editor .diff-review-line-number {\n\ttext-align: right;\n\tdisplay: inline-block;\n\tcolor: var(--vscode-editorLineNumber-foreground);\n}\n\n.monaco-diff-editor .diff-review {\n\tposition: absolute;\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.monaco-diff-editor .diff-review-summary {\n\tpadding-left: 10px;\n}\n\n.monaco-diff-editor .diff-review-shadow {\n\tposition: absolute;\n\tbox-shadow: var(--vscode-scrollbar-shadow) 0 -6px 6px -6px inset;\n}\n\n.monaco-diff-editor .diff-review-row {\n\twhite-space: pre;\n}\n\n.monaco-diff-editor .diff-review-table {\n\tdisplay: table;\n\tmin-width: 100%;\n}\n\n.monaco-diff-editor .diff-review-row {\n\tdisplay: table-row;\n\twidth: 100%;\n}\n\n.monaco-diff-editor .diff-review-spacer {\n\tdisplay: inline-block;\n\twidth: 10px;\n\tvertical-align: middle;\n}\n\n.monaco-diff-editor .diff-review-spacer > .codicon {\n\tfont-size: 9px !important;\n}\n\n.monaco-diff-editor .diff-review-actions {\n\tdisplay: inline-block;\n\tposition: absolute;\n\tright: 10px;\n\ttop: 2px;\n}\n\n.monaco-diff-editor .diff-review-actions .action-label {\n\twidth: 16px;\n\theight: 16px;\n\tmargin: 2px 0;\n}\n",""]);const a=r},8073:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* -------------------- IE10 remove auto clear button -------------------- */\n\n::-ms-clear {\n\tdisplay: none;\n}\n\n/* All widgets */\n/* I am not a big fan of this rule */\n.monaco-editor .editor-widget input {\n\tcolor: inherit;\n}\n\n/* -------------------- Editor -------------------- */\n\n.monaco-editor {\n\tposition: relative;\n\toverflow: visible;\n\t-webkit-text-size-adjust: 100%;\n\tcolor: var(--vscode-editor-foreground);\n\tbackground-color: var(--vscode-editor-background);\n}\n.monaco-editor-background {\n\tbackground-color: var(--vscode-editor-background);\n}\n.monaco-editor .rangeHighlight {\n\tbackground-color: var(--vscode-editor-rangeHighlightBackground);\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-editor-rangeHighlightBorder);\n}\n.monaco-editor.hc-black .rangeHighlight, .monaco-editor.hc-light .rangeHighlight {\n\tborder-style: dotted;\n}\n.monaco-editor .symbolHighlight {\n\tbackground-color: var(--vscode-editor-symbolHighlightBackground);\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-editor-symbolHighlightBorder);\n}\n.monaco-editor.hc-black .symbolHighlight, .monaco-editor.hc-light .symbolHighlight {\n\tborder-style: dotted;\n}\n\n/* -------------------- Misc -------------------- */\n\n.monaco-editor .overflow-guard {\n\tposition: relative;\n\toverflow: hidden;\n}\n\n.monaco-editor .view-overlays {\n\tposition: absolute;\n\ttop: 0;\n}\n\n/*\n.monaco-editor .auto-closed-character {\n\topacity: 0.3;\n}\n*/\n\n\n.monaco-editor .squiggly-error {\n\tborder-bottom: 4px double var(--vscode-editorError-border);\n}\n.monaco-editor .squiggly-error::before {\n\tdisplay: block;\n\tcontent: '';\n\twidth: 100%;\n\theight: 100%;\n\tbackground: var(--vscode-editorError-background);\n}\n.monaco-editor .squiggly-warning {\n\tborder-bottom: 4px double var(--vscode-editorWarning-border);\n}\n.monaco-editor .squiggly-warning::before {\n\tdisplay: block;\n\tcontent: '';\n\twidth: 100%;\n\theight: 100%;\n\tbackground: var(--vscode-editorWarning-background);\n}\n.monaco-editor .squiggly-info {\n\tborder-bottom: 4px double var(--vscode-editorInfo-border);\n}\n.monaco-editor .squiggly-info::before {\n\tdisplay: block;\n\tcontent: '';\n\twidth: 100%;\n\theight: 100%;\n\tbackground: var(--vscode-editorInfo-background);\n}\n.monaco-editor .squiggly-hint {\n\tborder-bottom: 2px dotted var(--vscode-editorHint-border);\n}\n.monaco-editor.showUnused .squiggly-unnecessary {\n\tborder-bottom: 2px dashed var(--vscode-editorUnnecessaryCode-border);\n}\n.monaco-editor.showDeprecated .squiggly-inline-deprecated {\n\ttext-decoration: line-through;\n\ttext-decoration-color: var(--vscode-editor-foreground, inherit);\n}\n",""]);const a=r},8425:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.quick-input-widget {\n\tfont-size: 13px;\n}\n\n.quick-input-widget .monaco-highlighted-label .highlight,\n.quick-input-widget .monaco-highlighted-label .highlight {\n\tcolor: #0066BF;\n}\n\n.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight,\n.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight {\n\tcolor: #9DDDFF;\n}\n\n.vs-dark .quick-input-widget .monaco-highlighted-label .highlight,\n.vs-dark .quick-input-widget .monaco-highlighted-label .highlight {\n\tcolor: #0097fb;\n}\n\n.hc-black .quick-input-widget .monaco-highlighted-label .highlight,\n.hc-black .quick-input-widget .monaco-highlighted-label .highlight {\n\tcolor: #F38518;\n}\n\n.hc-light .quick-input-widget .monaco-highlighted-label .highlight,\n.hc-light .quick-input-widget .monaco-highlighted-label .highlight {\n\tcolor: #0F4A85;\n}\n\n.monaco-keybinding > .monaco-keybinding-key {\n\tbackground-color: rgba(221, 221, 221, 0.4);\n\tborder: solid 1px rgba(204, 204, 204, 0.4);\n\tborder-bottom-color: rgba(187, 187, 187, 0.4);\n\tbox-shadow: inset 0 -1px 0 rgba(187, 187, 187, 0.4);\n\tcolor: #555;\n}\n\n.hc-black .monaco-keybinding > .monaco-keybinding-key {\n\tbackground-color: transparent;\n\tborder: solid 1px rgb(111, 195, 223);\n\tbox-shadow: none;\n\tcolor: #fff;\n}\n\n.hc-light .monaco-keybinding > .monaco-keybinding-key {\n\tbackground-color: transparent;\n\tborder: solid 1px #0F4A85;\n\tbox-shadow: none;\n\tcolor: #292929;\n}\n\n.vs-dark .monaco-keybinding > .monaco-keybinding-key {\n\tbackground-color: rgba(128, 128, 128, 0.17);\n\tborder: solid 1px rgba(51, 51, 51, 0.6);\n\tborder-bottom-color: rgba(68, 68, 68, 0.6);\n\tbox-shadow: inset 0 -1px 0 rgba(68, 68, 68, 0.6);\n\tcolor: #ccc;\n}\n",""]);const a=r},7030:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,'/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n\n/* Default standalone editor fonts */\n.monaco-editor {\n\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;\n\t--monaco-monospace-font: "SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label {\n\tstroke-width: 1.2px;\n}\n\n.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,\n.monaco-editor.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,\n.monaco-editor.hc-light .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label {\n\tstroke-width: 1.2px;\n}\n\n.monaco-hover p {\n\tmargin: 0;\n}\n\n/* See https://github.com/microsoft/monaco-editor/issues/2168#issuecomment-780078600 */\n.monaco-aria-container {\n\tposition: absolute !important;\n\ttop: 0; /* avoid being placed underneath a sibling element */\n\theight: 1px;\n\twidth: 1px;\n\tmargin: -1px;\n\toverflow: hidden;\n\tpadding: 0;\n\tclip: rect(1px, 1px, 1px, 1px);\n\tclip-path: inset(50%);\n}\n\n/*.monaco-editor.vs [tabindex="0"]:focus {\n\toutline: 1px solid rgba(0, 122, 204, 0.4);\n\toutline-offset: -1px;\n\topacity: 1 !important;\n}\n\n.monaco-editor.vs-dark [tabindex="0"]:focus {\n\toutline: 1px solid rgba(14, 99, 156, 0.6);\n\toutline-offset: -1px;\n\topacity: 1 !important;\n}*/\n',""]);const a=r},6112:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-action-bar .action-item.menu-entry .action-label.icon {\n\twidth: 16px;\n\theight: 16px;\n\tbackground-repeat: no-repeat;\n\tbackground-position: 50%;\n\tbackground-size: 16px;\n}\n\n.monaco-dropdown-with-default {\n\tdisplay: flex !important;\n\tflex-direction: row;\n\tborder-radius: 5px;\n}\n\n.monaco-dropdown-with-default > .action-container > .action-label {\n\tmargin-right: 0;\n}\n\n.monaco-dropdown-with-default > .action-container.menu-entry > .action-label.icon {\n\twidth: 16px;\n\theight: 16px;\n\tbackground-repeat: no-repeat;\n\tbackground-position: 50%;\n\tbackground-size: 16px;\n}\n\n.monaco-dropdown-with-default > .dropdown-action-container > .monaco-dropdown > .dropdown-label .codicon[class*='codicon-'] {\n\tfont-size: 12px;\n\tpadding-left: 0px;\n\tpadding-right: 0px;\n\tline-height: 16px;\n\tmargin-left: -3px;\n}\n\n.monaco-dropdown-with-default > .dropdown-action-container > .monaco-dropdown > .dropdown-label > .action-label {\n\tdisplay: block;\n\tbackground-size: 16px;\n\tbackground-position: center center;\n\tbackground-repeat: no-repeat;\n}\n",""]);const a=r},1580:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,".index__inner___epnFX {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n}\n\n.index__main___FoijY {\n flex-grow: 1;\n overflow-y: auto;\n}\n\n.index__header___LlNrw {\n display: flex;\n justify-content: start;\n flex-wrap: wrap;\n}\n\n.index__footer___hVbYe {\n height: 1.5em;\n}\n\n.index__monaco___x5J_G {\n height: 100%;\n}\n\n.index__status___mW72Q {\n}\n",""]),r.locals={inner:"index__inner___epnFX",main:"index__main___FoijY",header:"index__header___LlNrw",footer:"index__footer___hVbYe",monaco:"index__monaco___x5J_G",status:"index__status___mW72Q"};const a=r},3645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i="",n=void 0!==t[5];return t[4]&&(i+="@supports (".concat(t[4],") {")),t[2]&&(i+="@media ".concat(t[2]," {")),n&&(i+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),i+=e(t),n&&(i+="}"),t[2]&&(i+="}"),t[4]&&(i+="}"),i})).join("")},t.i=function(e,i,n,o,s){"string"==typeof e&&(e=[[null,e,void 0]]);var r={};if(n)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(r[l]=!0)}for(var h=0;h<e.length;h++){var d=[].concat(e[h]);n&&r[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),i&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=i):d[2]=i),o&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=o):d[4]="".concat(o)),t.push(d))}},t}},1667:e=>{e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},8081:e=>{e.exports=function(e){return e[1]}},3379:e=>{var t=[];function i(e){for(var i=-1,n=0;n<t.length;n++)if(t[n].identifier===e){i=n;break}return i}function n(e,n){for(var s={},r=[],a=0;a<e.length;a++){var l=e[a],h=n.base?l[0]+n.base:l[0],d=s[h]||0,c="".concat(h," ").concat(d);s[h]=d+1;var u=i(c),g={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==u)t[u].references++,t[u].updater(g);else{var p=o(g,n);n.byIndex=a,t.splice(a,0,{identifier:c,updater:p,references:1})}r.push(c)}return r}function o(e,t){var i=t.domAPI(t);return i.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;i.update(e=t)}else i.remove()}}e.exports=function(e,o){var s=n(e=e||[],o=o||{});return function(e){e=e||[];for(var r=0;r<s.length;r++){var a=i(s[r]);t[a].references--}for(var l=n(e,o),h=0;h<s.length;h++){var d=i(s[h]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}s=l}}},569:e=>{var t={};e.exports=function(e,i){var n=function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}t[e]=i}return t[e]}(e);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(i)}},9216:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},3565:(e,t,i)=>{e.exports=function(e){var t=i.nc;t&&e.setAttribute("nonce",t)}},7795:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(i){!function(e,t,i){var n="";i.supports&&(n+="@supports (".concat(i.supports,") {")),i.media&&(n+="@media ".concat(i.media," {"));var o=void 0!==i.layer;o&&(n+="@layer".concat(i.layer.length>0?" ".concat(i.layer):""," {")),n+=i.css,o&&(n+="}"),i.media&&(n+="}"),i.supports&&(n+="}");var s=i.sourceMap;s&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(n,e,t.options)}(t,e,i)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},4589:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},4748:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII="},6161:e=>{e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjNDI0MjQyIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="},1096:e=>{e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjQzVDNUM1Ii8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="},3251:(e,t,i)=>{e.exports=i.p+"184be8c3aa435ca6c3f5.ttf"}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={id:n,exports:{}};return e[n](s,s.exports,i),s.exports}i.m=e,i.amdO={},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&!e;)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),i.b=document.baseURI||self.location.href,i.nc=void 0;var n={};return(()=>{i.r(n);var e={};i.r(e),i.d(e,{PixelRatio:()=>Hde,addMatchMediaChangeListener:()=>zde,getZoomFactor:()=>Ude,isAndroid:()=>Qde,isChrome:()=>$de,isElectron:()=>Yde,isFirefox:()=>jde,isSafari:()=>Gde,isStandalone:()=>Jde,isWebKit:()=>qde,isWebkitWebView:()=>Zde});var t={};i.r(t),i.d(t,{VD:()=>yGe,Ly:()=>SGe,e6:()=>kGe,Y1:()=>LGe,a$:()=>xGe,j6:()=>DGe});var o={};i.r(o),i.d(o,{conf:()=>YGe,language:()=>QGe});var s={};i.r(s),i.d(s,{conf:()=>XGe,language:()=>JGe});const r=window,a=r,l=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout((()=>{if(e.stack){if(v.isErrorNoTelemetry(e))throw new v(e.message+"\n\n"+e.stack);throw new Error(e.message+"\n\n"+e.stack)}throw e}),0)}}emit(e){this.listeners.forEach((t=>{t(e)}))}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function h(e){g(e)||l.onUnexpectedError(e)}function d(e){g(e)||l.onUnexpectedExternalError(e)}function c(e){if(e instanceof Error){const{name:t,message:i}=e;return{$isError:!0,name:t,message:i,stack:e.stacktrace||e.stack,noTelemetry:v.isErrorNoTelemetry(e)}}return e}const u="Canceled";function g(e){return e instanceof p||e instanceof Error&&e.name===u&&e.message===u}class p extends Error{constructor(){super(u),this.name=this.message}}function m(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")}function f(e){return e?new Error(`Illegal state: ${e}`):new Error("Illegal state")}class _ extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class v extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof v)return e;const t=new v;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return"CodeExpectedError"===e.name}}class b extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,b.prototype)}}function w(e,t){const i=this;let n,o=!1;return function(){if(o)return n;if(o=!0,t)try{n=e.apply(i,arguments)}finally{t()}else n=e.apply(i,arguments);return n}}var C;!function(e){function t(e){return e&&"object"==typeof e&&"function"==typeof e[Symbol.iterator]}e.is=t;const i=Object.freeze([]);function*n(e){yield e}e.empty=function(){return i},e.single=n,e.wrap=function(e){return t(e)?e:n(e)},e.from=function(e){return e||i},e.reverse=function*(e){for(let t=e.length-1;t>=0;t--)yield e[t]},e.isEmpty=function(e){return!e||!0===e[Symbol.iterator]().next().done},e.first=function(e){return e[Symbol.iterator]().next().value},e.some=function(e,t){for(const i of e)if(t(i))return!0;return!1},e.find=function(e,t){for(const i of e)if(t(i))return i},e.filter=function*(e,t){for(const i of e)t(i)&&(yield i)},e.map=function*(e,t){let i=0;for(const n of e)yield t(n,i++)},e.concat=function*(...e){for(const t of e)yield*t},e.reduce=function(e,t,i){let n=i;for(const i of e)n=t(n,i);return n},e.slice=function*(e,t,i=e.length){for(t<0&&(t+=e.length),i<0?i+=e.length:i>e.length&&(i=e.length);t<i;t++)yield e[t]},e.consume=function(t,i=Number.POSITIVE_INFINITY){const n=[];if(0===i)return[n,t];const o=t[Symbol.iterator]();for(let t=0;t<i;t++){const t=o.next();if(t.done)return[n,e.empty()];n.push(t.value)}return[n,{[Symbol.iterator]:()=>o}]}}(C||(C={}));let y=null;function S(e){return null==y||y.trackDisposable(e),e}function k(e){null==y||y.markAsDisposed(e)}function L(e,t){null==y||y.setParent(e,t)}function x(e){return null==y||y.markAsSingleton(e),e}function D(e){return"function"==typeof e.dispose&&0===e.dispose.length}function E(e){if(C.is(e)){const t=[];for(const i of e)if(i)try{i.dispose()}catch(e){t.push(e)}if(1===t.length)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function N(...e){const t=I((()=>E(e)));return function(e,t){if(y)for(const i of e)y.setParent(i,t)}(e,t),t}function I(e){const t=S({dispose:w((()=>{k(t),e()}))});return t}class M{constructor(){this._toDispose=new Set,this._isDisposed=!1,S(this)}dispose(){this._isDisposed||(k(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(0!==this._toDispose.size)try{E(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return L(e,this),this._isDisposed?M.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),L(e,null))}}M.DISABLE_DISPOSED_WARNING=!1;class T{constructor(){this._store=new M,S(this),L(this._store,this)}dispose(){k(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}T.None=Object.freeze({dispose(){}});class A{constructor(){this._isDisposed=!1,S(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||(null===(t=this._value)||void 0===t||t.dispose(),e&&L(e,this),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,k(this),null===(e=this._value)||void 0===e||e.dispose(),this._value=void 0}}class R{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return 0==--this._counter&&this._disposable.dispose(),this}}class O{constructor(e){this.object=e}dispose(){}}class P{constructor(){this._store=new Map,this._isDisposed=!1,S(this)}dispose(){k(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{E(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){var n;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||null===(n=this._store.get(e))||void 0===n||n.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;null===(t=this._store.get(e))||void 0===t||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}class F{constructor(e){this.element=e,this.next=F.Undefined,this.prev=F.Undefined}}F.Undefined=new F(void 0);class B{constructor(){this._first=F.Undefined,this._last=F.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===F.Undefined}clear(){let e=this._first;for(;e!==F.Undefined;){const t=e.next;e.prev=F.Undefined,e.next=F.Undefined,e=t}this._first=F.Undefined,this._last=F.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new F(e);if(this._first===F.Undefined)this._first=i,this._last=i;else if(t){const e=this._last;this._last=i,i.prev=e,e.next=i}else{const e=this._first;this._first=i,i.next=e,e.prev=i}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(i))}}shift(){if(this._first!==F.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==F.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==F.Undefined&&e.next!==F.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===F.Undefined&&e.next===F.Undefined?(this._first=F.Undefined,this._last=F.Undefined):e.next===F.Undefined?(this._last=this._last.prev,this._last.next=F.Undefined):e.prev===F.Undefined&&(this._first=this._first.next,this._first.prev=F.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==F.Undefined;)yield e.element,e=e.next}}const W=globalThis.performance&&"function"==typeof globalThis.performance.now;class V{static create(e){return new V(e)}constructor(e){this._now=W&&!1===e?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}elapsed(){return-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime}}var z;!function(e){function t(e){return(t,i=null,n)=>{let o,s=!1;return o=e((e=>{if(!s)return o?o.dispose():s=!0,t.call(i,e)}),null,n),s&&o.dispose(),o}}function i(e,t,i){return o(((i,n=null,o)=>e((e=>i.call(n,t(e))),null,o)),i)}function n(e,t,i){return o(((i,n=null,o)=>e((e=>t(e)&&i.call(n,e)),null,o)),i)}function o(e,t){let i;const n=new q({onWillAddFirstListener(){i=e(n.fire,n)},onDidRemoveLastListener(){null==i||i.dispose()}});return null==t||t.add(n),n.event}function s(e,t,i=100,n=!1,o=!1,s,r){let a,l,h,d,c=0;const u=new q({leakWarningThreshold:s,onWillAddFirstListener(){a=e((e=>{c++,l=t(l,e),n&&!h&&(u.fire(l),l=void 0),d=()=>{const e=l;l=void 0,h=void 0,(!n||c>1)&&u.fire(e),c=0},"number"==typeof i?(clearTimeout(h),h=setTimeout(d,i)):void 0===h&&(h=0,queueMicrotask(d))}))},onWillRemoveListener(){o&&c>0&&(null==d||d())},onDidRemoveLastListener(){d=void 0,a.dispose()}});return null==r||r.add(u),u.event}e.None=()=>T.None,e.defer=function(e,t){return s(e,(()=>{}),0,void 0,!0,void 0,t)},e.once=t,e.map=i,e.forEach=function(e,t,i){return o(((i,n=null,o)=>e((e=>{t(e),i.call(n,e)}),null,o)),i)},e.filter=n,e.signal=function(e){return e},e.any=function(...e){return(t,i=null,n)=>{return o=N(...e.map((e=>e((e=>t.call(i,e)))))),(s=n)instanceof Array?s.push(o):s&&s.add(o),o;var o,s}},e.reduce=function(e,t,n,o){let s=n;return i(e,(e=>(s=t(s,e),s)),o)},e.debounce=s,e.accumulate=function(t,i=0,n){return e.debounce(t,((e,t)=>e?(e.push(t),e):[t]),i,void 0,!0,void 0,n)},e.latch=function(e,t=((e,t)=>e===t),i){let o,s=!0;return n(e,(e=>{const i=s||!t(e,o);return s=!1,o=e,i}),i)},e.split=function(t,i,n){return[e.filter(t,i,n),e.filter(t,(e=>!i(e)),n)]},e.buffer=function(e,t=!1,i=[],n){let o=i.slice(),s=e((e=>{o?o.push(e):a.fire(e)}));n&&n.add(s);const r=()=>{null==o||o.forEach((e=>a.fire(e))),o=null},a=new q({onWillAddFirstListener(){s||(s=e((e=>a.fire(e))),n&&n.add(s))},onDidAddFirstListener(){o&&(t?setTimeout(r):r())},onDidRemoveLastListener(){s&&s.dispose(),s=null}});return n&&n.add(a),a.event},e.chain=function(e,t){return(i,n,o)=>{const s=t(new a);return e((function(e){const t=s.evaluate(e);t!==r&&i.call(n,t)}),void 0,o)}};const r=Symbol("HaltChainable");class a{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push((t=>(e(t),t))),this}filter(e){return this.steps.push((t=>e(t)?t:r)),this}reduce(e,t){let i=t;return this.steps.push((t=>(i=e(i,t),i))),this}latch(e=((e,t)=>e===t)){let t,i=!0;return this.steps.push((n=>{const o=i||!e(n,t);return i=!1,t=n,o?n:r})),this}evaluate(e){for(const t of this.steps)if((e=t(e))===r)break;return e}}e.fromNodeEventEmitter=function(e,t,i=(e=>e)){const n=(...e)=>o.fire(i(...e)),o=new q({onWillAddFirstListener:()=>e.on(t,n),onDidRemoveLastListener:()=>e.removeListener(t,n)});return o.event},e.fromDOMEventEmitter=function(e,t,i=(e=>e)){const n=(...e)=>o.fire(i(...e)),o=new q({onWillAddFirstListener:()=>e.addEventListener(t,n),onDidRemoveLastListener:()=>e.removeEventListener(t,n)});return o.event},e.toPromise=function(e){return new Promise((i=>t(e)(i)))},e.fromPromise=function(e){const t=new q;return e.then((e=>{t.fire(e)}),(()=>{t.fire(void 0)})).finally((()=>{t.dispose()})),t.event},e.runAndSubscribe=function(e,t,i){return t(i),e((e=>t(e)))},e.runAndSubscribeWithStore=function(e,t){let i=null;function n(e){null==i||i.dispose(),i=new M,t(e,i)}n(void 0);const o=e((e=>n(e)));return I((()=>{o.dispose(),null==i||i.dispose()}))};class l{constructor(e,t){this._observable=e,this._counter=0,this._hasChanged=!1;const i={onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}};this.emitter=new q(i),t&&t.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,0===this._counter&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}e.fromObservable=function(e,t){return new l(e,t).emitter.event},e.fromObservableLight=function(e){return(t,i,n)=>{let o=0,s=!1;const r={beginUpdate(){o++},endUpdate(){o--,0===o&&(e.reportChanges(),s&&(s=!1,t.call(i)))},handlePossibleChange(){},handleChange(){s=!0}};e.addObserver(r),e.reportChanges();const a={dispose(){e.removeObserver(r)}};return n instanceof M?n.add(a):Array.isArray(n)&&n.push(a),a}}}(z||(z={}));class H{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${H._idPool++}`,H.all.add(this)}start(e){this._stopWatch=new V,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}H.all=new Set,H._idPool=0;class U{constructor(e,t=Math.random().toString(18).slice(2,5)){this.threshold=e,this.name=t,this._warnCountdown=0}dispose(){var e;null===(e=this._stacks)||void 0===e||e.clear()}check(e,t){const i=this.threshold;if(i<=0||t<i)return;this._stacks||(this._stacks=new Map);const n=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,n+1),this._warnCountdown-=1,this._warnCountdown<=0){let e;this._warnCountdown=.5*i;let n=0;for(const[t,i]of this._stacks)(!e||n<i)&&(e=t,n=i);console.warn(`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${n}):`),console.warn(e)}return()=>{const t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}}class K{static create(){var e;return new K(null!==(e=(new Error).stack)&&void 0!==e?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split("\n").slice(2).join("\n"))}}class j{constructor(e){this.value=e}}class q{constructor(e){var t,i,n,o,s;this._size=0,this._options=e,this._leakageMon=(null===(t=this._options)||void 0===t?void 0:t.leakWarningThreshold)?new U(null!==(n=null===(i=this._options)||void 0===i?void 0:i.leakWarningThreshold)&&void 0!==n?n:-1):void 0,this._perfMon=(null===(o=this._options)||void 0===o?void 0:o._profName)?new H(this._options._profName):void 0,this._deliveryQueue=null===(s=this._options)||void 0===s?void 0:s.deliveryQueue}dispose(){var e,t,i,n;this._disposed||(this._disposed=!0,(null===(e=this._deliveryQueue)||void 0===e?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),null===(i=null===(t=this._options)||void 0===t?void 0:t.onDidRemoveLastListener)||void 0===i||i.call(t),null===(n=this._leakageMon)||void 0===n||n.dispose())}get event(){var e;return null!==(e=this._event)&&void 0!==e||(this._event=(e,t,i)=>{var n,o,s,r,a;if(this._leakageMon&&this._size>3*this._leakageMon.threshold)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),T.None;if(this._disposed)return T.None;t&&(e=e.bind(t));const l=new j(e);let h;this._leakageMon&&this._size>=Math.ceil(.2*this._leakageMon.threshold)&&(l.stack=K.create(),h=this._leakageMon.check(l.stack,this._size+1)),this._listeners?this._listeners instanceof j?(null!==(a=this._deliveryQueue)&&void 0!==a||(this._deliveryQueue=new $),this._listeners=[this._listeners,l]):this._listeners.push(l):(null===(o=null===(n=this._options)||void 0===n?void 0:n.onWillAddFirstListener)||void 0===o||o.call(n,this),this._listeners=l,null===(r=null===(s=this._options)||void 0===s?void 0:s.onDidAddFirstListener)||void 0===r||r.call(s,this)),this._size++;const d=I((()=>{null==h||h(),this._removeListener(l)}));return i instanceof M?i.add(d):Array.isArray(i)&&i.push(d),d}),this._event}_removeListener(e){var t,i,n,o;if(null===(i=null===(t=this._options)||void 0===t?void 0:t.onWillRemoveListener)||void 0===i||i.call(t,this),!this._listeners)return;if(1===this._size)return this._listeners=void 0,null===(o=null===(n=this._options)||void 0===n?void 0:n.onDidRemoveLastListener)||void 0===o||o.call(n,this),void(this._size=0);const s=this._listeners,r=s.indexOf(e);if(-1===r)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,s[r]=void 0;const a=this._deliveryQueue.current===this;if(2*this._size<=s.length){let e=0;for(let t=0;t<s.length;t++)s[t]?s[e++]=s[t]:a&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);s.length=e}}_deliver(e,t){var i;if(!e)return;const n=(null===(i=this._options)||void 0===i?void 0:i.onListenerError)||h;if(n)try{e.value(t)}catch(e){n(e)}else e.value(t)}_deliverQueue(e){const t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,i,n,o;if((null===(t=this._deliveryQueue)||void 0===t?void 0:t.current)&&(this._deliverQueue(this._deliveryQueue),null===(i=this._perfMon)||void 0===i||i.stop()),null===(n=this._perfMon)||void 0===n||n.start(this._size),this._listeners)if(this._listeners instanceof j)this._deliver(this._listeners,e);else{const t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}null===(o=this._perfMon)||void 0===o||o.stop()}hasListeners(){return this._size>0}}class ${constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class G extends q{constructor(e){super(e),this._isPaused=0,this._eventQueue=new B,this._mergeFn=null==e?void 0:e.merge}pause(){this._isPaused++}resume(){if(0!==this._isPaused&&0==--this._isPaused)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&0!==this._eventQueue.size;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(0!==this._isPaused?this._eventQueue.push(e):super.fire(e))}}class Z extends G{constructor(e){var t;super(e),this._delay=null!==(t=e.delay)&&void 0!==t?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout((()=>{this._handle=void 0,this.resume()}),this._delay)),super.fire(e)}}class Y extends q{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=null==e?void 0:e.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),1===this._queuedEvents.length&&queueMicrotask((()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach((e=>super.fire(e))),this._queuedEvents=[]})))}}class Q{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new q({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),I(w((()=>{this.hasListeners&&this.unhook(t);const e=this.events.indexOf(t);this.events.splice(e,1)})))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach((e=>this.hook(e)))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach((e=>this.unhook(e)))}hook(e){e.listener=e.event((e=>this.emitter.fire(e)))}unhook(e){e.listener&&e.listener.dispose(),e.listener=null}dispose(){this.emitter.dispose()}}class X{constructor(){this.buffers=[]}wrapEvent(e){return(t,i,n)=>e((e=>{const n=this.buffers[this.buffers.length-1];n?n.push((()=>t.call(i,e))):t.call(i,e)}),void 0,n)}bufferEvents(e){const t=[];this.buffers.push(t);const i=e();return this.buffers.pop(),t.forEach((e=>e())),i}}class J{constructor(){this.listening=!1,this.inputEvent=z.None,this.inputEventListener=T.None,this.emitter=new q({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}class ee{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}ee.INSTANCE=new ee;class te extends T{constructor(){super(),this._onDidChange=this._register(new q),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(!0),this._mediaQueryList=null,this._handleChange(!1)}_handleChange(e){var t;null===(t=this._mediaQueryList)||void 0===t||t.removeEventListener("change",this._listener),this._mediaQueryList=a.matchMedia(`(resolution: ${a.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),e&&this._onDidChange.fire()}}class ie extends T{get value(){return this._value}constructor(){super(),this._onDidChange=this._register(new q),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio();const e=this._register(new te);this._register(e.onDidChange((()=>{this._value=this._getPixelRatio(),this._onDidChange.fire(this._value)})))}_getPixelRatio(){const e=document.createElement("canvas").getContext("2d");return(a.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}}function ne(e,t){"string"==typeof e&&(e=a.matchMedia(e)),e.addEventListener("change",t)}const oe=new class{constructor(){this._pixelRatioMonitor=null}_getOrCreatePixelRatioMonitor(){return this._pixelRatioMonitor||(this._pixelRatioMonitor=x(new ie)),this._pixelRatioMonitor}get value(){return this._getOrCreatePixelRatioMonitor().value}get onDidChange(){return this._getOrCreatePixelRatioMonitor().onDidChange}},se=navigator.userAgent,re=se.indexOf("Firefox")>=0,ae=se.indexOf("AppleWebKit")>=0,le=se.indexOf("Chrome")>=0,he=!le&&se.indexOf("Safari")>=0,de=!le&&!he&&ae,ce=(se.indexOf("Electron/"),se.indexOf("Android")>=0);let ue=!1;if(a.matchMedia){const e=a.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=a.matchMedia("(display-mode: fullscreen)");ue=e.matches,ne(e,(({matches:e})=>{ue&&t.matches||(ue=e)}))}let ge="undefined"!=typeof document&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function pe(e,t){let i;return i=0===t.length?e:e.replace(/\{(\d+)\}/g,((e,i)=>{const n=i[0],o=t[n];let s=e;return"string"==typeof o?s=o:"number"!=typeof o&&"boolean"!=typeof o&&null!=o||(s=String(o)),s})),ge&&(i="["+i.replace(/[aouei]/g,"$&$&")+"]"),i}function me(e,t,...i){return pe(t,i)}function fe(e,t,...i){const n=pe(t,i);return{value:n,original:n}}var _e;const ve="en";let be,we,Ce=!1,ye=!1,Se=!1,ke=!1,Le=!1,xe=!1,De=!1,Ee=!1,Ne=!1,Ie=!1,Me=ve,Te=null,Ae=null;const Re=globalThis;let Oe;void 0!==Re.vscode&&void 0!==Re.vscode.process?Oe=Re.vscode.process:"undefined"!=typeof process&&(Oe=process);const Pe="string"==typeof(null===(_e=null==Oe?void 0:Oe.versions)||void 0===_e?void 0:_e.electron),Fe=Pe&&"renderer"===(null==Oe?void 0:Oe.type);if("object"!=typeof navigator||Fe)if("object"==typeof Oe){Ce="win32"===Oe.platform,ye="darwin"===Oe.platform,Se="linux"===Oe.platform,ke=Se&&!!Oe.env.SNAP&&!!Oe.env.SNAP_REVISION,De=Pe,Ne=!!Oe.env.CI||!!Oe.env.BUILD_ARTIFACTSTAGINGDIRECTORY,be=ve,Me=ve;const e=Oe.env.VSCODE_NLS_CONFIG;if(e)try{const t=JSON.parse(e),i=t.availableLanguages["*"];be=t.locale,Te=t.osLocale,Me=i||ve,Ae=t._translationsConfigFile}catch(e){}Le=!0}else console.error("Unable to resolve platform.");else we=navigator.userAgent,Ce=we.indexOf("Windows")>=0,ye=we.indexOf("Macintosh")>=0,Ee=(we.indexOf("Macintosh")>=0||we.indexOf("iPad")>=0||we.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Se=we.indexOf("Linux")>=0,Ie=(null==we?void 0:we.indexOf("Mobi"))>=0,xe=!0,be=void me(0,"_")||ve,Me=be,Te=navigator.language;let Be=0;ye?Be=1:Ce?Be=3:Se&&(Be=2);const We=Ce,Ve=ye,ze=Se,He=Le,Ue=xe,Ke=xe&&"function"==typeof Re.importScripts?Re.origin:void 0,je=Ee,qe=Ie,$e=we,Ge=Me,Ze="function"==typeof Re.postMessage&&!Re.importScripts,Ye=(()=>{if(Ze){const e=[];Re.addEventListener("message",(t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,n=e.length;i<n;i++){const n=e[i];if(n.id===t.data.vscodeScheduleAsyncWork)return e.splice(i,1),void n.callback()}}));let t=0;return i=>{const n=++t;e.push({id:n,callback:i}),Re.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})(),Qe=ye||Ee?2:Ce?1:3;let Xe=!0,Je=!1;function et(){if(!Je){Je=!0;const e=new Uint8Array(2);e[0]=1,e[1]=2;const t=new Uint16Array(e.buffer);Xe=513===t[0]}return Xe}const tt=!!($e&&$e.indexOf("Chrome")>=0),it=!!($e&&$e.indexOf("Firefox")>=0),nt=!!(!tt&&$e&&$e.indexOf("Safari")>=0),ot=!!($e&&$e.indexOf("Edg/")>=0),st=($e&&$e.indexOf("Android"),He||document.queryCommandSupported&&document.queryCommandSupported("copy")||navigator&&navigator.clipboard&&navigator.clipboard.writeText,He||navigator&&navigator.clipboard&&navigator.clipboard.readText,He||ue||navigator.keyboard,"ontouchstart"in r||navigator.maxTouchPoints,r.PointerEvent&&("ontouchstart"in r||navigator.maxTouchPoints>0||navigator.maxTouchPoints>0));class rt{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const at=new rt,lt=new rt,ht=new rt,dt=new Array(230),ct={},ut=[],gt=Object.create(null),pt=Object.create(null),mt=[],ft=[];for(let e=0;e<=193;e++)mt[e]=-1;for(let e=0;e<=132;e++)ft[e]=-1;var _t;function vt(e,t){return(e|(65535&t)<<16>>>0)>>>0}function bt(e,t){if("number"==typeof e){if(0===e)return null;const i=(65535&e)>>>0,n=(4294901760&e)>>>16;return new yt(0!==n?[wt(i,t),wt(n,t)]:[wt(i,t)])}{const i=[];for(let n=0;n<e.length;n++)i.push(wt(e[n],t));return new yt(i)}}function wt(e,t){const i=!!(2048&e),n=!!(256&e);return new Ct(2===t?n:i,!!(1024&e),!!(512&e),2===t?i:n,255&e)}!function(){const e="",t=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",e,e],[1,1,"Hyper",0,e,0,e,e,e],[1,2,"Super",0,e,0,e,e,e],[1,3,"Fn",0,e,0,e,e,e],[1,4,"FnLock",0,e,0,e,e,e],[1,5,"Suspend",0,e,0,e,e,e],[1,6,"Resume",0,e,0,e,e,e],[1,7,"Turbo",0,e,0,e,e,e],[1,8,"Sleep",0,e,0,"VK_SLEEP",e,e],[1,9,"WakeUp",0,e,0,e,e,e],[0,10,"KeyA",31,"A",65,"VK_A",e,e],[0,11,"KeyB",32,"B",66,"VK_B",e,e],[0,12,"KeyC",33,"C",67,"VK_C",e,e],[0,13,"KeyD",34,"D",68,"VK_D",e,e],[0,14,"KeyE",35,"E",69,"VK_E",e,e],[0,15,"KeyF",36,"F",70,"VK_F",e,e],[0,16,"KeyG",37,"G",71,"VK_G",e,e],[0,17,"KeyH",38,"H",72,"VK_H",e,e],[0,18,"KeyI",39,"I",73,"VK_I",e,e],[0,19,"KeyJ",40,"J",74,"VK_J",e,e],[0,20,"KeyK",41,"K",75,"VK_K",e,e],[0,21,"KeyL",42,"L",76,"VK_L",e,e],[0,22,"KeyM",43,"M",77,"VK_M",e,e],[0,23,"KeyN",44,"N",78,"VK_N",e,e],[0,24,"KeyO",45,"O",79,"VK_O",e,e],[0,25,"KeyP",46,"P",80,"VK_P",e,e],[0,26,"KeyQ",47,"Q",81,"VK_Q",e,e],[0,27,"KeyR",48,"R",82,"VK_R",e,e],[0,28,"KeyS",49,"S",83,"VK_S",e,e],[0,29,"KeyT",50,"T",84,"VK_T",e,e],[0,30,"KeyU",51,"U",85,"VK_U",e,e],[0,31,"KeyV",52,"V",86,"VK_V",e,e],[0,32,"KeyW",53,"W",87,"VK_W",e,e],[0,33,"KeyX",54,"X",88,"VK_X",e,e],[0,34,"KeyY",55,"Y",89,"VK_Y",e,e],[0,35,"KeyZ",56,"Z",90,"VK_Z",e,e],[0,36,"Digit1",22,"1",49,"VK_1",e,e],[0,37,"Digit2",23,"2",50,"VK_2",e,e],[0,38,"Digit3",24,"3",51,"VK_3",e,e],[0,39,"Digit4",25,"4",52,"VK_4",e,e],[0,40,"Digit5",26,"5",53,"VK_5",e,e],[0,41,"Digit6",27,"6",54,"VK_6",e,e],[0,42,"Digit7",28,"7",55,"VK_7",e,e],[0,43,"Digit8",29,"8",56,"VK_8",e,e],[0,44,"Digit9",30,"9",57,"VK_9",e,e],[0,45,"Digit0",21,"0",48,"VK_0",e,e],[1,46,"Enter",3,"Enter",13,"VK_RETURN",e,e],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE",e,e],[1,48,"Backspace",1,"Backspace",8,"VK_BACK",e,e],[1,49,"Tab",2,"Tab",9,"VK_TAB",e,e],[1,50,"Space",10,"Space",32,"VK_SPACE",e,e],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,e,0,e,e,e],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",e,e],[1,64,"F1",59,"F1",112,"VK_F1",e,e],[1,65,"F2",60,"F2",113,"VK_F2",e,e],[1,66,"F3",61,"F3",114,"VK_F3",e,e],[1,67,"F4",62,"F4",115,"VK_F4",e,e],[1,68,"F5",63,"F5",116,"VK_F5",e,e],[1,69,"F6",64,"F6",117,"VK_F6",e,e],[1,70,"F7",65,"F7",118,"VK_F7",e,e],[1,71,"F8",66,"F8",119,"VK_F8",e,e],[1,72,"F9",67,"F9",120,"VK_F9",e,e],[1,73,"F10",68,"F10",121,"VK_F10",e,e],[1,74,"F11",69,"F11",122,"VK_F11",e,e],[1,75,"F12",70,"F12",123,"VK_F12",e,e],[1,76,"PrintScreen",0,e,0,e,e,e],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL",e,e],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",e,e],[1,79,"Insert",19,"Insert",45,"VK_INSERT",e,e],[1,80,"Home",14,"Home",36,"VK_HOME",e,e],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",e,e],[1,82,"Delete",20,"Delete",46,"VK_DELETE",e,e],[1,83,"End",13,"End",35,"VK_END",e,e],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT",e,e],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",e],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",e],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",e],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",e],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK",e,e],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE",e,e],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY",e,e],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT",e,e],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD",e,e],[1,94,"NumpadEnter",3,e,0,e,e,e],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1",e,e],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2",e,e],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3",e,e],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4",e,e],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5",e,e],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6",e,e],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7",e,e],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8",e,e],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9",e,e],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0",e,e],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL",e,e],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102",e,e],[1,107,"ContextMenu",58,"ContextMenu",93,e,e,e],[1,108,"Power",0,e,0,e,e,e],[1,109,"NumpadEqual",0,e,0,e,e,e],[1,110,"F13",71,"F13",124,"VK_F13",e,e],[1,111,"F14",72,"F14",125,"VK_F14",e,e],[1,112,"F15",73,"F15",126,"VK_F15",e,e],[1,113,"F16",74,"F16",127,"VK_F16",e,e],[1,114,"F17",75,"F17",128,"VK_F17",e,e],[1,115,"F18",76,"F18",129,"VK_F18",e,e],[1,116,"F19",77,"F19",130,"VK_F19",e,e],[1,117,"F20",78,"F20",131,"VK_F20",e,e],[1,118,"F21",79,"F21",132,"VK_F21",e,e],[1,119,"F22",80,"F22",133,"VK_F22",e,e],[1,120,"F23",81,"F23",134,"VK_F23",e,e],[1,121,"F24",82,"F24",135,"VK_F24",e,e],[1,122,"Open",0,e,0,e,e,e],[1,123,"Help",0,e,0,e,e,e],[1,124,"Select",0,e,0,e,e,e],[1,125,"Again",0,e,0,e,e,e],[1,126,"Undo",0,e,0,e,e,e],[1,127,"Cut",0,e,0,e,e,e],[1,128,"Copy",0,e,0,e,e,e],[1,129,"Paste",0,e,0,e,e,e],[1,130,"Find",0,e,0,e,e,e],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE",e,e],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP",e,e],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN",e,e],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR",e,e],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1",e,e],[1,136,"KanaMode",0,e,0,e,e,e],[0,137,"IntlYen",0,e,0,e,e,e],[1,138,"Convert",0,e,0,e,e,e],[1,139,"NonConvert",0,e,0,e,e,e],[1,140,"Lang1",0,e,0,e,e,e],[1,141,"Lang2",0,e,0,e,e,e],[1,142,"Lang3",0,e,0,e,e,e],[1,143,"Lang4",0,e,0,e,e,e],[1,144,"Lang5",0,e,0,e,e,e],[1,145,"Abort",0,e,0,e,e,e],[1,146,"Props",0,e,0,e,e,e],[1,147,"NumpadParenLeft",0,e,0,e,e,e],[1,148,"NumpadParenRight",0,e,0,e,e,e],[1,149,"NumpadBackspace",0,e,0,e,e,e],[1,150,"NumpadMemoryStore",0,e,0,e,e,e],[1,151,"NumpadMemoryRecall",0,e,0,e,e,e],[1,152,"NumpadMemoryClear",0,e,0,e,e,e],[1,153,"NumpadMemoryAdd",0,e,0,e,e,e],[1,154,"NumpadMemorySubtract",0,e,0,e,e,e],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR",e,e],[1,156,"NumpadClearEntry",0,e,0,e,e,e],[1,0,e,5,"Ctrl",17,"VK_CONTROL",e,e],[1,0,e,4,"Shift",16,"VK_SHIFT",e,e],[1,0,e,6,"Alt",18,"VK_MENU",e,e],[1,0,e,57,"Meta",91,"VK_COMMAND",e,e],[1,157,"ControlLeft",5,e,0,"VK_LCONTROL",e,e],[1,158,"ShiftLeft",4,e,0,"VK_LSHIFT",e,e],[1,159,"AltLeft",6,e,0,"VK_LMENU",e,e],[1,160,"MetaLeft",57,e,0,"VK_LWIN",e,e],[1,161,"ControlRight",5,e,0,"VK_RCONTROL",e,e],[1,162,"ShiftRight",4,e,0,"VK_RSHIFT",e,e],[1,163,"AltRight",6,e,0,"VK_RMENU",e,e],[1,164,"MetaRight",57,e,0,"VK_RWIN",e,e],[1,165,"BrightnessUp",0,e,0,e,e,e],[1,166,"BrightnessDown",0,e,0,e,e,e],[1,167,"MediaPlay",0,e,0,e,e,e],[1,168,"MediaRecord",0,e,0,e,e,e],[1,169,"MediaFastForward",0,e,0,e,e,e],[1,170,"MediaRewind",0,e,0,e,e,e],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",e,e],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",e,e],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP",e,e],[1,174,"Eject",0,e,0,e,e,e],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",e,e],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",e,e],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",e,e],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",e,e],[1,179,"LaunchApp1",0,e,0,"VK_MEDIA_LAUNCH_APP1",e,e],[1,180,"SelectTask",0,e,0,e,e,e],[1,181,"LaunchScreenSaver",0,e,0,e,e,e],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH",e,e],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME",e,e],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK",e,e],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD",e,e],[1,186,"BrowserStop",0,e,0,"VK_BROWSER_STOP",e,e],[1,187,"BrowserRefresh",0,e,0,"VK_BROWSER_REFRESH",e,e],[1,188,"BrowserFavorites",0,e,0,"VK_BROWSER_FAVORITES",e,e],[1,189,"ZoomToggle",0,e,0,e,e,e],[1,190,"MailReply",0,e,0,e,e,e],[1,191,"MailForward",0,e,0,e,e,e],[1,192,"MailSend",0,e,0,e,e,e],[1,0,e,114,"KeyInComposition",229,e,e,e],[1,0,e,116,"ABNT_C2",194,"VK_ABNT_C2",e,e],[1,0,e,96,"OEM_8",223,"VK_OEM_8",e,e],[1,0,e,0,e,0,"VK_KANA",e,e],[1,0,e,0,e,0,"VK_HANGUL",e,e],[1,0,e,0,e,0,"VK_JUNJA",e,e],[1,0,e,0,e,0,"VK_FINAL",e,e],[1,0,e,0,e,0,"VK_HANJA",e,e],[1,0,e,0,e,0,"VK_KANJI",e,e],[1,0,e,0,e,0,"VK_CONVERT",e,e],[1,0,e,0,e,0,"VK_NONCONVERT",e,e],[1,0,e,0,e,0,"VK_ACCEPT",e,e],[1,0,e,0,e,0,"VK_MODECHANGE",e,e],[1,0,e,0,e,0,"VK_SELECT",e,e],[1,0,e,0,e,0,"VK_PRINT",e,e],[1,0,e,0,e,0,"VK_EXECUTE",e,e],[1,0,e,0,e,0,"VK_SNAPSHOT",e,e],[1,0,e,0,e,0,"VK_HELP",e,e],[1,0,e,0,e,0,"VK_APPS",e,e],[1,0,e,0,e,0,"VK_PROCESSKEY",e,e],[1,0,e,0,e,0,"VK_PACKET",e,e],[1,0,e,0,e,0,"VK_DBE_SBCSCHAR",e,e],[1,0,e,0,e,0,"VK_DBE_DBCSCHAR",e,e],[1,0,e,0,e,0,"VK_ATTN",e,e],[1,0,e,0,e,0,"VK_CRSEL",e,e],[1,0,e,0,e,0,"VK_EXSEL",e,e],[1,0,e,0,e,0,"VK_EREOF",e,e],[1,0,e,0,e,0,"VK_PLAY",e,e],[1,0,e,0,e,0,"VK_ZOOM",e,e],[1,0,e,0,e,0,"VK_NONAME",e,e],[1,0,e,0,e,0,"VK_PA1",e,e],[1,0,e,0,e,0,"VK_OEM_CLEAR",e,e]],i=[],n=[];for(const e of t){const[t,o,s,r,a,l,h,d,c]=e;if(n[o]||(n[o]=!0,ut[o]=s,gt[s]=o,pt[s.toLowerCase()]=o,t&&(mt[o]=r,0!==r&&3!==r&&5!==r&&4!==r&&6!==r&&57!==r&&(ft[r]=o))),!i[r]){if(i[r]=!0,!a)throw new Error(`String representation missing for key code ${r} around scan code ${s}`);at.define(r,a),lt.define(r,d||a),ht.define(r,c||d||a)}l&&(dt[l]=r),h&&(ct[h]=r)}ft[3]=46}(),function(e){e.toString=function(e){return at.keyCodeToStr(e)},e.fromString=function(e){return at.strToKeyCode(e)},e.toUserSettingsUS=function(e){return lt.keyCodeToStr(e)},e.toUserSettingsGeneral=function(e){return ht.keyCodeToStr(e)},e.fromUserSettings=function(e){return lt.strToKeyCode(e)||ht.strToKeyCode(e)},e.toElectronAccelerator=function(e){if(e>=98&&e<=113)return null;switch(e){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return at.keyCodeToStr(e)}}(_t||(_t={}));class Ct{constructor(e,t,i,n,o){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyCode=o}equals(e){return e instanceof Ct&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}isModifierKey(){return 0===this.keyCode||5===this.keyCode||57===this.keyCode||6===this.keyCode||4===this.keyCode}isDuplicateModifierCase(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode}}class yt{constructor(e){if(0===e.length)throw m("chords");this.chords=e}}class St{constructor(e,t,i,n,o,s){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyLabel=o,this.keyAriaLabel=s}}class kt{}const Lt=Ve?256:2048,xt=Ve?2048:256;class Dt{constructor(e){this._standardKeyboardEventBrand=!0;const t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState("AltGraph"),this.keyCode=function(e){if(e.charCode){const t=String.fromCharCode(e.charCode).toUpperCase();return _t.fromString(t)}const t=e.keyCode;if(3===t)return 7;if(re)switch(t){case 59:return 85;case 60:if(ze)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Ve)return 57}else if(ae){if(Ve&&93===t)return 57;if(!Ve&&92===t)return 57}return dt[t]||0}(t),this.code=t.code,this.ctrlKey=this.ctrlKey||5===this.keyCode,this.altKey=this.altKey||6===this.keyCode,this.shiftKey=this.shiftKey||4===this.keyCode,this.metaKey=this.metaKey||57===this.keyCode,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=Lt),this.altKey&&(t|=512),this.shiftKey&&(t|=1024),this.metaKey&&(t|=xt),t|=e,t}_computeKeyCodeChord(){let e=0;return 5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode),new Ct(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}const Et=new WeakMap;function Nt(e){if(!e.parent||e.parent===e)return null;try{const t=e.location,i=e.parent.location;if("null"!==t.origin&&"null"!==i.origin&&t.origin!==i.origin)return null}catch(e){return null}return e.parent}class It{static getSameOriginWindowChain(e){let t=Et.get(e);if(!t){t=[],Et.set(e,t);let i,n=e;do{i=Nt(n),i?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=i}while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){var i,n;if(!t||e===t)return{top:0,left:0};let o=0,s=0;const r=this.getSameOriginWindowChain(e);for(const e of r){const r=e.window.deref();if(o+=null!==(i=null==r?void 0:r.scrollY)&&void 0!==i?i:0,s+=null!==(n=null==r?void 0:r.scrollX)&&void 0!==n?n:0,r===t)break;if(!e.iframeElement)break;const a=e.iframeElement.getBoundingClientRect();o+=a.top,s+=a.left}return{top:o,left:s}}}class Mt{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=0===t.button,this.middleButton=1===t.button,this.rightButton=2===t.button,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,"dblclick"===t.type&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,"number"==typeof t.pageX?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);const i=It.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=i.left,this.posy-=i.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class Tt{constructor(e,t=0,i=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t,e){const t=e,i=e;if(void 0!==t.wheelDeltaY)this.deltaY=t.wheelDeltaY/120;else if(void 0!==i.VERTICAL_AXIS&&i.axis===i.VERTICAL_AXIS)this.deltaY=-i.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?this.deltaY=re&&!Ve?-e.deltaY/3:-e.deltaY:this.deltaY=-e.deltaY/40}if(void 0!==t.wheelDeltaX)this.deltaX=he&&We?-t.wheelDeltaX/120:t.wheelDeltaX/120;else if(void 0!==i.HORIZONTAL_AXIS&&i.axis===i.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?this.deltaX=re&&!Ve?-e.deltaX/3:-e.deltaX:this.deltaX=-e.deltaX/40}0===this.deltaY&&0===this.deltaX&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;null===(e=this.browserEvent)||void 0===e||e.preventDefault()}stopPropagation(){var e;null===(e=this.browserEvent)||void 0===e||e.stopPropagation()}}const At=Object.freeze((function(e,t){const i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}));var Rt;!function(e){e.isCancellationToken=function(t){return t===e.None||t===e.Cancelled||t instanceof Ot||!(!t||"object"!=typeof t)&&"boolean"==typeof t.isCancellationRequested&&"function"==typeof t.onCancellationRequested},e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:z.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:At})}(Rt||(Rt={}));class Ot{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?At:(this._emitter||(this._emitter=new q),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class Pt{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new Ot),this._token}cancel(){this._token?this._token instanceof Ot&&this._token.cancel():this._token=Rt.Cancelled}dispose(e=!1){var t;e&&this.cancel(),null===(t=this._parentListener)||void 0===t||t.dispose(),this._token?this._token instanceof Ot&&this._token.dispose():this._token=Rt.None}}const Ft=Symbol("MicrotaskDelay");function Bt(e){return!!e&&"function"==typeof e.then}function Wt(e){const t=new Pt,i=e(t.token),n=new Promise(((e,n)=>{const o=t.token.onCancellationRequested((()=>{o.dispose(),t.dispose(),n(new p)}));Promise.resolve(i).then((i=>{o.dispose(),t.dispose(),e(i)}),(e=>{o.dispose(),t.dispose(),n(e)}))}));return new class{cancel(){t.cancel()}then(e,t){return n.then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return n.finally(e)}}}function Vt(e,t,i){return new Promise(((n,o)=>{const s=t.onCancellationRequested((()=>{s.dispose(),n(i)}));e.then(n,o).finally((()=>s.dispose()))}))}class zt{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const e=()=>{if(this.queuedPromise=null,this.isDisposed)return;const e=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,e};this.queuedPromise=new Promise((t=>{this.activePromise.then(e,e).then(t)}))}return new Promise(((e,t)=>{this.queuedPromise.then(e,t)}))}return this.activePromise=e(),new Promise(((e,t)=>{this.activePromise.then((t=>{this.activePromise=null,e(t)}),(e=>{this.activePromise=null,t(e)}))}))}dispose(){this.isDisposed=!0}}class Ht{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise(((e,t)=>{this.doResolve=e,this.doReject=t})).then((()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const e=this.task;return this.task=null,e()}})));const i=()=>{var e;this.deferred=null,null===(e=this.doResolve)||void 0===e||e.call(this,null)};return this.deferred=t===Ft?(e=>{let t=!0;return queueMicrotask((()=>{t&&(t=!1,e())})),{isTriggered:()=>t,dispose:()=>{t=!1}}})(i):((e,t)=>{let i=!0;const n=setTimeout((()=>{i=!1,t()}),e);return{isTriggered:()=>i,dispose:()=>{clearTimeout(n),i=!1}}})(t,i),this.completionPromise}isTriggered(){var e;return!!(null===(e=this.deferred)||void 0===e?void 0:e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&(null===(e=this.doReject)||void 0===e||e.call(this,new p),this.completionPromise=null)}cancelTimeout(){var e;null===(e=this.deferred)||void 0===e||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class Ut{constructor(e){this.delayer=new Ht(e),this.throttler=new zt}trigger(e,t){return this.delayer.trigger((()=>this.throttler.queue(e)),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function Kt(e,t){return t?new Promise(((i,n)=>{const o=setTimeout((()=>{s.dispose(),i()}),e),s=t.onCancellationRequested((()=>{clearTimeout(o),s.dispose(),n(new p)}))})):Wt((t=>Kt(e,t)))}function jt(e,t=0,i){const n=setTimeout((()=>{e(),i&&o.dispose()}),t),o=I((()=>{clearTimeout(n),null==i||i.deleteAndLeak(o)}));return null==i||i.add(o),o}function qt(e,t=(e=>!!e),i=null){let n=0;const o=e.length,s=()=>{if(n>=o)return Promise.resolve(i);const r=e[n++];return Promise.resolve(r()).then((e=>t(e)?Promise.resolve(e):s()))};return s()}class $t{constructor(e,t){this._token=-1,"function"==typeof e&&"number"==typeof t&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){-1!==this._token&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout((()=>{this._token=-1,e()}),t)}setIfNotSet(e,t){-1===this._token&&(this._token=setTimeout((()=>{this._token=-1,e()}),t))}}class Gt{constructor(){this.disposable=void 0}cancel(){var e;null===(e=this.disposable)||void 0===e||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){this.cancel();const n=i.setInterval((()=>{e()}),t);this.disposable=I((()=>{i.clearInterval(n),this.disposable=void 0}))}dispose(){this.cancel()}}class Zt{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return-1!==this.timeoutToken}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;null===(e=this.runner)||void 0===e||e.call(this)}}let Yt,Qt;Qt="function"!=typeof globalThis.requestIdleCallback||"function"!=typeof globalThis.cancelIdleCallback?(e,t)=>{Ye((()=>{if(i)return;const e=Date.now()+15,n={didTimeout:!0,timeRemaining:()=>Math.max(0,e-Date.now())};t(Object.freeze(n))}));let i=!1;return{dispose(){i||(i=!0)}}}:(e,t,i)=>{const n=e.requestIdleCallback(t,"number"==typeof i?{timeout:i}:void 0);let o=!1;return{dispose(){o||(o=!0,e.cancelIdleCallback(n))}}},Yt=e=>Qt(globalThis,e);class Xt{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(e){this._error=e}finally{this._didRun=!0}},this._handle=Qt(e,(()=>this._executor()))}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}class Jt extends Xt{constructor(e){super(globalThis,e)}}class ei{get isRejected(){var e;return 1===(null===(e=this.outcome)||void 0===e?void 0:e.outcome)}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise(((e,t)=>{this.completeCallback=e,this.errorCallback=t}))}complete(e){return new Promise((t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()}))}error(e){return new Promise((t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()}))}cancel(){return this.error(new p)}}var ti;!function(e){e.settled=async function(e){let t;const i=await Promise.all(e.map((e=>e.then((e=>e),(e=>{t||(t=e)})))));if(void 0!==t)throw t;return i},e.withAsyncBody=function(e){return new Promise((async(t,i)=>{try{await e(t,i)}catch(e){i(e)}}))}}(ti||(ti={}));class ii{static fromArray(e){return new ii((t=>{t.emitMany(e)}))}static fromPromise(e){return new ii((async t=>{t.emitMany(await e)}))}static fromPromises(e){return new ii((async t=>{await Promise.all(e.map((async e=>t.emitOne(await e))))}))}static merge(e){return new ii((async t=>{await Promise.all(e.map((async e=>{for await(const i of e)t.emitOne(i)})))}))}constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new q,queueMicrotask((async()=>{const t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}}))}[Symbol.asyncIterator](){let e=0;return{next:async()=>{for(;;){if(2===this._state)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(1===this._state)return{done:!0,value:void 0};await z.toPromise(this._onStateChanged.event)}}}}static map(e,t){return new ii((async i=>{for await(const n of e)i.emitOne(t(n))}))}map(e){return ii.map(this,e)}static filter(e,t){return new ii((async i=>{for await(const n of e)t(n)&&i.emitOne(n)}))}filter(e){return ii.filter(this,e)}static coalesce(e){return ii.filter(e,(e=>!!e))}coalesce(){return ii.coalesce(this)}static async toPromise(e){const t=[];for await(const i of e)t.push(i);return t}toPromise(){return ii.toPromise(this)}emitOne(e){0===this._state&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){0===this._state&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){0===this._state&&(this._state=1,this._onStateChanged.fire())}reject(e){0===this._state&&(this._state=2,this._error=e,this._onStateChanged.fire())}}ii.EMPTY=ii.fromArray([]);class ni extends ii{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}const{entries:oi,setPrototypeOf:si,isFrozen:ri,getPrototypeOf:ai,getOwnPropertyDescriptor:li}=Object;let{freeze:hi,seal:di,create:ci}=Object,{apply:ui,construct:gi}="undefined"!=typeof Reflect&&Reflect;ui||(ui=function(e,t,i){return e.apply(t,i)}),hi||(hi=function(e){return e}),di||(di=function(e){return e}),gi||(gi=function(e,t){return new e(...t)});const pi=xi(Array.prototype.forEach),mi=xi(Array.prototype.pop),fi=xi(Array.prototype.push),_i=xi(String.prototype.toLowerCase),vi=xi(String.prototype.toString),bi=xi(String.prototype.match),wi=xi(String.prototype.replace),Ci=xi(String.prototype.indexOf),yi=xi(String.prototype.trim),Si=xi(RegExp.prototype.test),ki=(Li=TypeError,function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return gi(Li,t)});var Li;function xi(e){return function(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];return ui(e,t,n)}}function Di(e,t,i){var n;i=null!==(n=i)&&void 0!==n?n:_i,si&&si(e,null);let o=t.length;for(;o--;){let n=t[o];if("string"==typeof n){const e=i(n);e!==n&&(ri(t)||(t[o]=e),n=e)}e[n]=!0}return e}function Ei(e){const t=ci(null);for(const[i,n]of oi(e))t[i]=n;return t}function Ni(e,t){for(;null!==e;){const i=li(e,t);if(i){if(i.get)return xi(i.get);if("function"==typeof i.value)return xi(i.value)}e=ai(e)}return function(e){return console.warn("fallback value for",e),null}}const Ii=hi(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Mi=hi(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ti=hi(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ai=hi(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ri=hi(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Oi=hi(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Pi=hi(["#text"]),Fi=hi(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Bi=hi(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Wi=hi(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Vi=hi(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),zi=di(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Hi=di(/<%[\w\W]*|[\w\W]*%>/gm),Ui=di(/\${[\w\W]*}/gm),Ki=di(/^data-[\-\w.\u00B7-\uFFFF]/),ji=di(/^aria-[\-\w]+$/),qi=di(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$i=di(/^(?:\w+script|data):/i),Gi=di(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Zi=di(/^html$/i);var Yi=Object.freeze({__proto__:null,MUSTACHE_EXPR:zi,ERB_EXPR:Hi,TMPLIT_EXPR:Ui,DATA_ATTR:Ki,ARIA_ATTR:ji,IS_ALLOWED_URI:qi,IS_SCRIPT_OR_DATA:$i,ATTR_WHITESPACE:Gi,DOCTYPE_NAME:Zi});const Qi=()=>"undefined"==typeof window?null:window;var Xi=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qi();const i=t=>e(t);if(i.version="3.0.5",i.removed=[],!t||!t.document||9!==t.document.nodeType)return i.isSupported=!1,i;const n=t.document,o=n.currentScript;let{document:s}=t;const{DocumentFragment:r,HTMLTemplateElement:a,Node:l,Element:h,NodeFilter:d,NamedNodeMap:c=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:u,DOMParser:g,trustedTypes:p}=t,m=h.prototype,f=Ni(m,"cloneNode"),_=Ni(m,"nextSibling"),v=Ni(m,"childNodes"),b=Ni(m,"parentNode");if("function"==typeof a){const e=s.createElement("template");e.content&&e.content.ownerDocument&&(s=e.content.ownerDocument)}let w,C="";const{implementation:y,createNodeIterator:S,createDocumentFragment:k,getElementsByTagName:L}=s,{importNode:x}=n;let D={};i.isSupported="function"==typeof oi&&"function"==typeof b&&y&&void 0!==y.createHTMLDocument;const{MUSTACHE_EXPR:E,ERB_EXPR:N,TMPLIT_EXPR:I,DATA_ATTR:M,ARIA_ATTR:T,IS_SCRIPT_OR_DATA:A,ATTR_WHITESPACE:R}=Yi;let{IS_ALLOWED_URI:O}=Yi,P=null;const F=Di({},[...Ii,...Mi,...Ti,...Ri,...Pi]);let B=null;const W=Di({},[...Fi,...Bi,...Wi,...Vi]);let V=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),z=null,H=null,U=!0,K=!0,j=!1,q=!0,$=!1,G=!1,Z=!1,Y=!1,Q=!1,X=!1,J=!1,ee=!0,te=!1,ie=!0,ne=!1,oe={},se=null;const re=Di({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ae=null;const le=Di({},["audio","video","img","source","image","track"]);let he=null;const de=Di({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ce="http://www.w3.org/1998/Math/MathML",ue="http://www.w3.org/2000/svg",ge="http://www.w3.org/1999/xhtml";let pe=ge,me=!1,fe=null;const _e=Di({},[ce,ue,ge],vi);let ve;const be=["application/xhtml+xml","text/html"];let we,Ce=null;const ye=s.createElement("form"),Se=function(e){return e instanceof RegExp||e instanceof Function},ke=function(e){if(!Ce||Ce!==e){if(e&&"object"==typeof e||(e={}),e=Ei(e),ve=ve=-1===be.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,we="application/xhtml+xml"===ve?vi:_i,P="ALLOWED_TAGS"in e?Di({},e.ALLOWED_TAGS,we):F,B="ALLOWED_ATTR"in e?Di({},e.ALLOWED_ATTR,we):W,fe="ALLOWED_NAMESPACES"in e?Di({},e.ALLOWED_NAMESPACES,vi):_e,he="ADD_URI_SAFE_ATTR"in e?Di(Ei(de),e.ADD_URI_SAFE_ATTR,we):de,ae="ADD_DATA_URI_TAGS"in e?Di(Ei(le),e.ADD_DATA_URI_TAGS,we):le,se="FORBID_CONTENTS"in e?Di({},e.FORBID_CONTENTS,we):re,z="FORBID_TAGS"in e?Di({},e.FORBID_TAGS,we):{},H="FORBID_ATTR"in e?Di({},e.FORBID_ATTR,we):{},oe="USE_PROFILES"in e&&e.USE_PROFILES,U=!1!==e.ALLOW_ARIA_ATTR,K=!1!==e.ALLOW_DATA_ATTR,j=e.ALLOW_UNKNOWN_PROTOCOLS||!1,q=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,$=e.SAFE_FOR_TEMPLATES||!1,G=e.WHOLE_DOCUMENT||!1,Q=e.RETURN_DOM||!1,X=e.RETURN_DOM_FRAGMENT||!1,J=e.RETURN_TRUSTED_TYPE||!1,Y=e.FORCE_BODY||!1,ee=!1!==e.SANITIZE_DOM,te=e.SANITIZE_NAMED_PROPS||!1,ie=!1!==e.KEEP_CONTENT,ne=e.IN_PLACE||!1,O=e.ALLOWED_URI_REGEXP||qi,pe=e.NAMESPACE||ge,V=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(V.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(V.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(V.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),$&&(K=!1),X&&(Q=!0),oe&&(P=Di({},[...Pi]),B=[],!0===oe.html&&(Di(P,Ii),Di(B,Fi)),!0===oe.svg&&(Di(P,Mi),Di(B,Bi),Di(B,Vi)),!0===oe.svgFilters&&(Di(P,Ti),Di(B,Bi),Di(B,Vi)),!0===oe.mathMl&&(Di(P,Ri),Di(B,Wi),Di(B,Vi))),e.ADD_TAGS&&(P===F&&(P=Ei(P)),Di(P,e.ADD_TAGS,we)),e.ADD_ATTR&&(B===W&&(B=Ei(B)),Di(B,e.ADD_ATTR,we)),e.ADD_URI_SAFE_ATTR&&Di(he,e.ADD_URI_SAFE_ATTR,we),e.FORBID_CONTENTS&&(se===re&&(se=Ei(se)),Di(se,e.FORBID_CONTENTS,we)),ie&&(P["#text"]=!0),G&&Di(P,["html","head","body"]),P.table&&(Di(P,["tbody"]),delete z.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw ki('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw ki('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=e.TRUSTED_TYPES_POLICY,C=w.createHTML("")}else void 0===w&&(w=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let i=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(i=t.getAttribute(n));const o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(p,o)),null!==w&&"string"==typeof C&&(C=w.createHTML(""));hi&&hi(e),Ce=e}},Le=Di({},["mi","mo","mn","ms","mtext"]),xe=Di({},["foreignobject","desc","title","annotation-xml"]),De=Di({},["title","style","font","a","script"]),Ee=Di({},Mi);Di(Ee,Ti),Di(Ee,Ai);const Ne=Di({},Ri);Di(Ne,Oi);const Ie=function(e){fi(i.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},Me=function(e,t){try{fi(i.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){fi(i.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!B[e])if(Q||X)try{Ie(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Te=function(e){let t,i;if(Y)e="<remove></remove>"+e;else{const t=bi(e,/^[\r\n\t ]+/);i=t&&t[0]}"application/xhtml+xml"===ve&&pe===ge&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const n=w?w.createHTML(e):e;if(pe===ge)try{t=(new g).parseFromString(n,ve)}catch(e){}if(!t||!t.documentElement){t=y.createDocument(pe,"template",null);try{t.documentElement.innerHTML=me?C:n}catch(e){}}const o=t.body||t.documentElement;return e&&i&&o.insertBefore(s.createTextNode(i),o.childNodes[0]||null),pe===ge?L.call(t,G?"html":"body")[0]:G?t.documentElement:o},Ae=function(e){return S.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT,null,!1)},Re=function(e){return"object"==typeof l?e instanceof l:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Oe=function(e,t,n){D[e]&&pi(D[e],(e=>{e.call(i,t,n,Ce)}))},Pe=function(e){let t;if(Oe("beforeSanitizeElements",e,null),(n=e)instanceof u&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof c)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore||"function"!=typeof n.hasChildNodes))return Ie(e),!0;var n;const o=we(e.nodeName);if(Oe("uponSanitizeElement",e,{tagName:o,allowedTags:P}),e.hasChildNodes()&&!Re(e.firstElementChild)&&(!Re(e.content)||!Re(e.content.firstElementChild))&&Si(/<[/\w]/g,e.innerHTML)&&Si(/<[/\w]/g,e.textContent))return Ie(e),!0;if(!P[o]||z[o]){if(!z[o]&&Be(o)){if(V.tagNameCheck instanceof RegExp&&Si(V.tagNameCheck,o))return!1;if(V.tagNameCheck instanceof Function&&V.tagNameCheck(o))return!1}if(ie&&!se[o]){const t=b(e)||e.parentNode,i=v(e)||e.childNodes;if(i&&t)for(let n=i.length-1;n>=0;--n)t.insertBefore(f(i[n],!0),_(e))}return Ie(e),!0}return e instanceof h&&!function(e){let t=b(e);t&&t.tagName||(t={namespaceURI:pe,tagName:"template"});const i=_i(e.tagName),n=_i(t.tagName);return!!fe[e.namespaceURI]&&(e.namespaceURI===ue?t.namespaceURI===ge?"svg"===i:t.namespaceURI===ce?"svg"===i&&("annotation-xml"===n||Le[n]):Boolean(Ee[i]):e.namespaceURI===ce?t.namespaceURI===ge?"math"===i:t.namespaceURI===ue?"math"===i&&xe[n]:Boolean(Ne[i]):e.namespaceURI===ge?!(t.namespaceURI===ue&&!xe[n])&&!(t.namespaceURI===ce&&!Le[n])&&!Ne[i]&&(De[i]||!Ee[i]):!("application/xhtml+xml"!==ve||!fe[e.namespaceURI]))}(e)?(Ie(e),!0):"noscript"!==o&&"noembed"!==o&&"noframes"!==o||!Si(/<\/no(script|embed|frames)/i,e.innerHTML)?($&&3===e.nodeType&&(t=e.textContent,t=wi(t,E," "),t=wi(t,N," "),t=wi(t,I," "),e.textContent!==t&&(fi(i.removed,{element:e.cloneNode()}),e.textContent=t)),Oe("afterSanitizeElements",e,null),!1):(Ie(e),!0)},Fe=function(e,t,i){if(ee&&("id"===t||"name"===t)&&(i in s||i in ye))return!1;if(K&&!H[t]&&Si(M,t));else if(U&&Si(T,t));else if(!B[t]||H[t]){if(!(Be(e)&&(V.tagNameCheck instanceof RegExp&&Si(V.tagNameCheck,e)||V.tagNameCheck instanceof Function&&V.tagNameCheck(e))&&(V.attributeNameCheck instanceof RegExp&&Si(V.attributeNameCheck,t)||V.attributeNameCheck instanceof Function&&V.attributeNameCheck(t))||"is"===t&&V.allowCustomizedBuiltInElements&&(V.tagNameCheck instanceof RegExp&&Si(V.tagNameCheck,i)||V.tagNameCheck instanceof Function&&V.tagNameCheck(i))))return!1}else if(he[t]);else if(Si(O,wi(i,R,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Ci(i,"data:")||!ae[e])if(j&&!Si(A,wi(i,R,"")));else if(i)return!1;return!0},Be=function(e){return e.indexOf("-")>0},We=function(e){let t,n,o,s;Oe("beforeSanitizeAttributes",e,null);const{attributes:r}=e;if(!r)return;const a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:B};for(s=r.length;s--;){t=r[s];const{name:l,namespaceURI:h}=t;if(n="value"===l?t.value:yi(t.value),o=we(l),a.attrName=o,a.attrValue=n,a.keepAttr=!0,a.forceKeepAttr=void 0,Oe("uponSanitizeAttribute",e,a),n=a.attrValue,a.forceKeepAttr)continue;if(Me(l,e),!a.keepAttr)continue;if(!q&&Si(/\/>/i,n)){Me(l,e);continue}$&&(n=wi(n,E," "),n=wi(n,N," "),n=wi(n,I," "));const d=we(e.nodeName);if(Fe(d,o,n)){if(!te||"id"!==o&&"name"!==o||(Me(l,e),n="user-content-"+n),w&&"object"==typeof p&&"function"==typeof p.getAttributeType)if(h);else switch(p.getAttributeType(d,o)){case"TrustedHTML":n=w.createHTML(n);break;case"TrustedScriptURL":n=w.createScriptURL(n)}try{h?e.setAttributeNS(h,l,n):e.setAttribute(l,n),mi(i.removed)}catch(e){}}}Oe("afterSanitizeAttributes",e,null)},Ve=function e(t){let i;const n=Ae(t);for(Oe("beforeSanitizeShadowDOM",t,null);i=n.nextNode();)Oe("uponSanitizeShadowNode",i,null),Pe(i)||(i.content instanceof r&&e(i.content),We(i));Oe("afterSanitizeShadowDOM",t,null)};return i.sanitize=function(e){let t,o,s,a,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(me=!e,me&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Re(e)){if("function"!=typeof e.toString)throw ki("toString is not a function");if("string"!=typeof(e=e.toString()))throw ki("dirty is not a string, aborting")}if(!i.isSupported)return e;if(Z||ke(h),i.removed=[],"string"==typeof e&&(ne=!1),ne){if(e.nodeName){const t=we(e.nodeName);if(!P[t]||z[t])throw ki("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)t=Te("\x3c!----\x3e"),o=t.ownerDocument.importNode(e,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?t=o:t.appendChild(o);else{if(!Q&&!$&&!G&&-1===e.indexOf("<"))return w&&J?w.createHTML(e):e;if(t=Te(e),!t)return Q?null:J?C:""}t&&Y&&Ie(t.firstChild);const d=Ae(ne?e:t);for(;s=d.nextNode();)Pe(s)||(s.content instanceof r&&Ve(s.content),We(s));if(ne)return e;if(Q){if(X)for(a=k.call(t.ownerDocument);t.firstChild;)a.appendChild(t.firstChild);else a=t;return(B.shadowroot||B.shadowrootmode)&&(a=x.call(n,a,!0)),a}let c=G?t.outerHTML:t.innerHTML;return G&&P["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&Si(Zi,t.ownerDocument.doctype.name)&&(c="<!DOCTYPE "+t.ownerDocument.doctype.name+">\n"+c),$&&(c=wi(c,E," "),c=wi(c,N," "),c=wi(c,I," ")),w&&J?w.createHTML(c):c},i.setConfig=function(e){ke(e),Z=!0},i.clearConfig=function(){Ce=null,Z=!1},i.isValidAttribute=function(e,t,i){Ce||ke({});const n=we(e),o=we(t);return Fe(n,o,i)},i.addHook=function(e,t){"function"==typeof t&&(D[e]=D[e]||[],fi(D[e],t))},i.removeHook=function(e){if(D[e])return mi(D[e])},i.removeHooks=function(e){D[e]&&(D[e]=[])},i.removeAllHooks=function(){D={}},i}();Xi.version,Xi.isSupported;const Ji=Xi.sanitize,en=(Xi.setConfig,Xi.clearConfig,Xi.isValidAttribute,Xi.addHook),tn=Xi.removeHook;Xi.removeHooks,Xi.removeAllHooks;class nn{get cachedValues(){return this._map}constructor(e){this.fn=e,this._map=new Map}get(e){if(this._map.has(e))return this._map.get(e);const t=this.fn(e);return this._map.set(e,t),t}}class on{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}var sn;function rn(e){return!e||"string"!=typeof e||0===e.trim().length}const an=/{(\d+)}/g;function ln(e,...t){return 0===t.length?e:e.replace(an,(function(e,i){const n=parseInt(i,10);return isNaN(n)||n<0||n>=t.length?e:t[n]}))}function hn(e){return e.replace(/[<>&]/g,(function(e){switch(e){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return e}}))}function dn(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function cn(e,t=" "){return gn(un(e,t),t)}function un(e,t){if(!e||!t)return e;const i=t.length;if(0===i||0===e.length)return e;let n=0;for(;e.indexOf(t,n)===n;)n+=i;return e.substring(n)}function gn(e,t){if(!e||!t)return e;const i=t.length,n=e.length;if(0===i||0===n)return e;let o=n,s=-1;for(;s=e.lastIndexOf(t,o-1),-1!==s&&s+i===o;){if(0===s)return"";o=s}return e.substring(0,o)}function pn(e,t,i={}){if(!e)throw new Error("Cannot create regex from empty string");t||(e=dn(e)),i.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));let n="";return i.global&&(n+="g"),i.matchCase||(n+="i"),i.multiline&&(n+="m"),i.unicode&&(n+="u"),new RegExp(e,n)}function mn(e){return e.split(/\r\n|\r|\n/)}function fn(e){for(let t=0,i=e.length;t<i;t++){const i=e.charCodeAt(t);if(32!==i&&9!==i)return t}return-1}function _n(e,t=0,i=e.length){for(let n=t;n<i;n++){const i=e.charCodeAt(n);if(32!==i&&9!==i)return e.substring(t,n)}return e.substring(t,i)}function vn(e,t=e.length-1){for(let i=t;i>=0;i--){const t=e.charCodeAt(i);if(32!==t&&9!==t)return i}return-1}function bn(e,t){return e<t?-1:e>t?1:0}function wn(e,t,i=0,n=e.length,o=0,s=t.length){for(;i<n&&o<s;i++,o++){const n=e.charCodeAt(i),s=t.charCodeAt(o);if(n<s)return-1;if(n>s)return 1}const r=n-i,a=s-o;return r<a?-1:r>a?1:0}function Cn(e,t){return yn(e,t,0,e.length,0,t.length)}function yn(e,t,i=0,n=e.length,o=0,s=t.length){for(;i<n&&o<s;i++,o++){let r=e.charCodeAt(i),a=t.charCodeAt(o);if(r===a)continue;if(r>=128||a>=128)return wn(e.toLowerCase(),t.toLowerCase(),i,n,o,s);kn(r)&&(r-=32),kn(a)&&(a-=32);const l=r-a;if(0!==l)return l}const r=n-i,a=s-o;return r<a?-1:r>a?1:0}function Sn(e){return e>=48&&e<=57}function kn(e){return e>=97&&e<=122}function Ln(e){return e>=65&&e<=90}function xn(e,t){return e.length===t.length&&0===yn(e,t)}function Dn(e,t){const i=t.length;return!(t.length>e.length)&&0===yn(e,t,0,i)}function En(e,t){const i=Math.min(e.length,t.length);let n;for(n=0;n<i;n++)if(e.charCodeAt(n)!==t.charCodeAt(n))return n;return i}function Nn(e,t){const i=Math.min(e.length,t.length);let n;const o=e.length-1,s=t.length-1;for(n=0;n<i;n++)if(e.charCodeAt(o-n)!==t.charCodeAt(s-n))return n;return i}function In(e){return 55296<=e&&e<=56319}function Mn(e){return 56320<=e&&e<=57343}function Tn(e,t){return t-56320+(e-55296<<10)+65536}function An(e,t,i){const n=e.charCodeAt(i);if(In(n)&&i+1<t){const t=e.charCodeAt(i+1);if(Mn(t))return Tn(n,t)}return n}class Rn{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=function(e,t){const i=e.charCodeAt(t-1);if(Mn(i)&&t>1){const n=e.charCodeAt(t-2);if(In(n))return Tn(n,i)}return i}(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=An(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class On{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new Rn(e,t)}nextGraphemeLength(){const e=Yn.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const i=t.offset,o=e.getGraphemeBreakType(t.nextCodePoint());if(Zn(n,o)){t.setOffset(i);break}n=o}return t.offset-i}prevGraphemeLength(){const e=Yn.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const i=t.offset,o=e.getGraphemeBreakType(t.prevCodePoint());if(Zn(o,n)){t.setOffset(i);break}n=o}return i-t.offset}eol(){return this._iterator.eol()}}function Pn(e,t){return new On(e,t).nextGraphemeLength()}function Fn(e,t){return new On(e,t).prevGraphemeLength()}let Bn;function Wn(e){return Bn||(Bn=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/),Bn.test(e)}const Vn=/^[\t\n\r\x20-\x7E]*$/;function zn(e){return Vn.test(e)}const Hn=/[\u2028\u2029]/;function Un(e){return Hn.test(e)}function Kn(e){return e>=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}function jn(e){return e>=127462&&e<=127487||8986===e||8987===e||9200===e||9203===e||e>=9728&&e<=10175||11088===e||11093===e||e>=127744&&e<=128591||e>=128640&&e<=128764||e>=128992&&e<=129008||e>=129280&&e<=129535||e>=129648&&e<=129782}const qn=String.fromCharCode(65279);function $n(e){return!!(e&&e.length>0&&65279===e.charCodeAt(0))}function Gn(e){return(e%=52)<26?String.fromCharCode(97+e):String.fromCharCode(65+e-26)}function Zn(e,t){return 0===e?5!==t&&7!==t:!(2===e&&3===t||4!==e&&2!==e&&3!==e&&4!==t&&2!==t&&3!==t&&(8===e&&(8===t||9===t||11===t||12===t)||!(11!==e&&9!==e||9!==t&&10!==t)||(12===e||10===e)&&10===t||5===t||13===t||7===t||1===e||13===e&&14===t||6===e&&6===t))}class Yn{static getInstance(){return Yn._INSTANCE||(Yn._INSTANCE=new Yn),Yn._INSTANCE}constructor(){this._data=JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}getGraphemeBreakType(e){if(e<32)return 10===e?3:13===e?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let n=1;for(;n<=i;)if(e<t[3*n])n*=2;else{if(!(e>t[3*n+1]))return t[3*n+2];n=2*n+1}return 0}}function Qn(e){return 127995<=e&&e<=127999}Yn._INSTANCE=null;class Xn{static getInstance(e){return sn.cache.get(Array.from(e))}static getLocales(){return sn._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}sn=Xn,Xn.ambiguousCharacterData=new on((()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'))),Xn.cache=new class{constructor(e){this.fn=e,this.lastCache=void 0,this.lastArgKey=void 0}get(e){const t=JSON.stringify(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this.fn(e)),this.lastCache}}((e=>{function t(e){const t=new Map;for(let i=0;i<e.length;i+=2)t.set(e[i],e[i+1]);return t}function i(e,t){if(!e)return t;const i=new Map;for(const[n,o]of e)t.has(n)&&i.set(n,o);return i}const n=sn.ambiguousCharacterData.value;let o,s=e.filter((e=>!e.startsWith("_")&&e in n));0===s.length&&(s=["_default"]);for(const e of s)o=i(o,t(n[e]));const r=function(e,t){const i=new Map(e);for(const[e,n]of t)i.set(e,n);return i}(t(n._common),o);return new sn(r)})),Xn._locales=new on((()=>Object.keys(sn.ambiguousCharacterData.value).filter((e=>!e.startsWith("_")))));class Jn{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static getData(){return this._data||(this._data=new Set(Jn.getRawData())),this._data}static isInvisibleCharacter(e){return Jn.getData().has(e)}static get codePoints(){return Jn.getData()}}let eo;Jn._data=void 0;const to=globalThis.vscode;if(void 0!==to&&void 0!==to.process){const e=to.process;eo={get platform(){return e.platform},get arch(){return e.arch},get env(){return e.env},cwd:()=>e.cwd()}}else eo="undefined"!=typeof process?{get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd:()=>process.env.VSCODE_CWD||process.cwd()}:{get platform(){return We?"win32":Ve?"darwin":"linux"},get arch(){},get env(){return{}},cwd:()=>"/"};const io=eo.cwd,no=eo.env,oo=eo.platform,so=46,ro=47,ao=92,lo=58;class ho extends Error{constructor(e,t,i){let n;"string"==typeof t&&0===t.indexOf("not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";const o=-1!==e.indexOf(".")?"property":"argument";let s=`The "${e}" ${o} ${n} of type ${t}`;s+=". Received type "+typeof i,super(s),this.code="ERR_INVALID_ARG_TYPE"}}function co(e,t){if("string"!=typeof e)throw new ho(t,"string",e)}const uo="win32"===oo;function go(e){return e===ro||e===ao}function po(e){return e===ro}function mo(e){return e>=65&&e<=90||e>=97&&e<=122}function fo(e,t,i,n){let o="",s=0,r=-1,a=0,l=0;for(let h=0;h<=e.length;++h){if(h<e.length)l=e.charCodeAt(h);else{if(n(l))break;l=ro}if(n(l)){if(r===h-1||1===a);else if(2===a){if(o.length<2||2!==s||o.charCodeAt(o.length-1)!==so||o.charCodeAt(o.length-2)!==so){if(o.length>2){const e=o.lastIndexOf(i);-1===e?(o="",s=0):(o=o.slice(0,e),s=o.length-1-o.lastIndexOf(i)),r=h,a=0;continue}if(0!==o.length){o="",s=0,r=h,a=0;continue}}t&&(o+=o.length>0?`${i}..`:"..",s=2)}else o.length>0?o+=`${i}${e.slice(r+1,h)}`:o=e.slice(r+1,h),s=h-r-1;r=h,a=0}else l===so&&-1!==a?++a:a=-1}return o}function _o(e,t){!function(e,t){if(null===e||"object"!=typeof e)throw new ho("pathObject","Object",e)}(t);const i=t.dir||t.root,n=t.base||`${t.name||""}${t.ext||""}`;return i?i===t.root?`${i}${n}`:`${i}${e}${n}`:n}const vo={resolve(...e){let t="",i="",n=!1;for(let o=e.length-1;o>=-1;o--){let s;if(o>=0){if(s=e[o],co(s,"path"),0===s.length)continue}else 0===t.length?s=io():(s=no[`=${t}`]||io(),(void 0===s||s.slice(0,2).toLowerCase()!==t.toLowerCase()&&s.charCodeAt(2)===ao)&&(s=`${t}\\`));const r=s.length;let a=0,l="",h=!1;const d=s.charCodeAt(0);if(1===r)go(d)&&(a=1,h=!0);else if(go(d))if(h=!0,go(s.charCodeAt(1))){let e=2,t=e;for(;e<r&&!go(s.charCodeAt(e));)e++;if(e<r&&e!==t){const i=s.slice(t,e);for(t=e;e<r&&go(s.charCodeAt(e));)e++;if(e<r&&e!==t){for(t=e;e<r&&!go(s.charCodeAt(e));)e++;e!==r&&e===t||(l=`\\\\${i}\\${s.slice(t,e)}`,a=e)}}}else a=1;else mo(d)&&s.charCodeAt(1)===lo&&(l=s.slice(0,2),a=2,r>2&&go(s.charCodeAt(2))&&(h=!0,a=3));if(l.length>0)if(t.length>0){if(l.toLowerCase()!==t.toLowerCase())continue}else t=l;if(n){if(t.length>0)break}else if(i=`${s.slice(a)}\\${i}`,n=h,h&&t.length>0)break}return i=fo(i,!n,"\\",go),n?`${t}\\${i}`:`${t}${i}`||"."},normalize(e){co(e,"path");const t=e.length;if(0===t)return".";let i,n=0,o=!1;const s=e.charCodeAt(0);if(1===t)return po(s)?"\\":e;if(go(s))if(o=!0,go(e.charCodeAt(1))){let o=2,s=o;for(;o<t&&!go(e.charCodeAt(o));)o++;if(o<t&&o!==s){const r=e.slice(s,o);for(s=o;o<t&&go(e.charCodeAt(o));)o++;if(o<t&&o!==s){for(s=o;o<t&&!go(e.charCodeAt(o));)o++;if(o===t)return`\\\\${r}\\${e.slice(s)}\\`;o!==s&&(i=`\\\\${r}\\${e.slice(s,o)}`,n=o)}}}else n=1;else mo(s)&&e.charCodeAt(1)===lo&&(i=e.slice(0,2),n=2,t>2&&go(e.charCodeAt(2))&&(o=!0,n=3));let r=n<t?fo(e.slice(n),!o,"\\",go):"";return 0!==r.length||o||(r="."),r.length>0&&go(e.charCodeAt(t-1))&&(r+="\\"),void 0===i?o?`\\${r}`:r:o?`${i}\\${r}`:`${i}${r}`},isAbsolute(e){co(e,"path");const t=e.length;if(0===t)return!1;const i=e.charCodeAt(0);return go(i)||t>2&&mo(i)&&e.charCodeAt(1)===lo&&go(e.charCodeAt(2))},join(...e){if(0===e.length)return".";let t,i;for(let n=0;n<e.length;++n){const o=e[n];co(o,"path"),o.length>0&&(void 0===t?t=i=o:t+=`\\${o}`)}if(void 0===t)return".";let n=!0,o=0;if("string"==typeof i&&go(i.charCodeAt(0))){++o;const e=i.length;e>1&&go(i.charCodeAt(1))&&(++o,e>2&&(go(i.charCodeAt(2))?++o:n=!1))}if(n){for(;o<t.length&&go(t.charCodeAt(o));)o++;o>=2&&(t=`\\${t.slice(o)}`)}return vo.normalize(t)},relative(e,t){if(co(e,"from"),co(t,"to"),e===t)return"";const i=vo.resolve(e),n=vo.resolve(t);if(i===n)return"";if((e=i.toLowerCase())===(t=n.toLowerCase()))return"";let o=0;for(;o<e.length&&e.charCodeAt(o)===ao;)o++;let s=e.length;for(;s-1>o&&e.charCodeAt(s-1)===ao;)s--;const r=s-o;let a=0;for(;a<t.length&&t.charCodeAt(a)===ao;)a++;let l=t.length;for(;l-1>a&&t.charCodeAt(l-1)===ao;)l--;const h=l-a,d=r<h?r:h;let c=-1,u=0;for(;u<d;u++){const i=e.charCodeAt(o+u);if(i!==t.charCodeAt(a+u))break;i===ao&&(c=u)}if(u!==d){if(-1===c)return n}else{if(h>d){if(t.charCodeAt(a+u)===ao)return n.slice(a+u+1);if(2===u)return n.slice(a+u)}r>d&&(e.charCodeAt(o+u)===ao?c=u:2===u&&(c=3)),-1===c&&(c=0)}let g="";for(u=o+c+1;u<=s;++u)u!==s&&e.charCodeAt(u)!==ao||(g+=0===g.length?"..":"\\..");return a+=c,g.length>0?`${g}${n.slice(a,l)}`:(n.charCodeAt(a)===ao&&++a,n.slice(a,l))},toNamespacedPath(e){if("string"!=typeof e||0===e.length)return e;const t=vo.resolve(e);if(t.length<=2)return e;if(t.charCodeAt(0)===ao){if(t.charCodeAt(1)===ao){const e=t.charCodeAt(2);if(63!==e&&e!==so)return`\\\\?\\UNC\\${t.slice(2)}`}}else if(mo(t.charCodeAt(0))&&t.charCodeAt(1)===lo&&t.charCodeAt(2)===ao)return`\\\\?\\${t}`;return e},dirname(e){co(e,"path");const t=e.length;if(0===t)return".";let i=-1,n=0;const o=e.charCodeAt(0);if(1===t)return go(o)?e:".";if(go(o)){if(i=n=1,go(e.charCodeAt(1))){let o=2,s=o;for(;o<t&&!go(e.charCodeAt(o));)o++;if(o<t&&o!==s){for(s=o;o<t&&go(e.charCodeAt(o));)o++;if(o<t&&o!==s){for(s=o;o<t&&!go(e.charCodeAt(o));)o++;if(o===t)return e;o!==s&&(i=n=o+1)}}}}else mo(o)&&e.charCodeAt(1)===lo&&(i=t>2&&go(e.charCodeAt(2))?3:2,n=i);let s=-1,r=!0;for(let i=t-1;i>=n;--i)if(go(e.charCodeAt(i))){if(!r){s=i;break}}else r=!1;if(-1===s){if(-1===i)return".";s=i}return e.slice(0,s)},basename(e,t){void 0!==t&&co(t,"ext"),co(e,"path");let i,n=0,o=-1,s=!0;if(e.length>=2&&mo(e.charCodeAt(0))&&e.charCodeAt(1)===lo&&(n=2),void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let r=t.length-1,a=-1;for(i=e.length-1;i>=n;--i){const l=e.charCodeAt(i);if(go(l)){if(!s){n=i+1;break}}else-1===a&&(s=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1==--r&&(o=i):(r=-1,o=a))}return n===o?o=a:-1===o&&(o=e.length),e.slice(n,o)}for(i=e.length-1;i>=n;--i)if(go(e.charCodeAt(i))){if(!s){n=i+1;break}}else-1===o&&(s=!1,o=i+1);return-1===o?"":e.slice(n,o)},extname(e){co(e,"path");let t=0,i=-1,n=0,o=-1,s=!0,r=0;e.length>=2&&e.charCodeAt(1)===lo&&mo(e.charCodeAt(0))&&(t=n=2);for(let a=e.length-1;a>=t;--a){const t=e.charCodeAt(a);if(go(t)){if(!s){n=a+1;break}}else-1===o&&(s=!1,o=a+1),t===so?-1===i?i=a:1!==r&&(r=1):-1!==i&&(r=-1)}return-1===i||-1===o||0===r||1===r&&i===o-1&&i===n+1?"":e.slice(i,o)},format:_o.bind(null,"\\"),parse(e){co(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.length;let n=0,o=e.charCodeAt(0);if(1===i)return go(o)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(go(o)){if(n=1,go(e.charCodeAt(1))){let t=2,o=t;for(;t<i&&!go(e.charCodeAt(t));)t++;if(t<i&&t!==o){for(o=t;t<i&&go(e.charCodeAt(t));)t++;if(t<i&&t!==o){for(o=t;t<i&&!go(e.charCodeAt(t));)t++;t===i?n=t:t!==o&&(n=t+1)}}}}else if(mo(o)&&e.charCodeAt(1)===lo){if(i<=2)return t.root=t.dir=e,t;if(n=2,go(e.charCodeAt(2))){if(3===i)return t.root=t.dir=e,t;n=3}}n>0&&(t.root=e.slice(0,n));let s=-1,r=n,a=-1,l=!0,h=e.length-1,d=0;for(;h>=n;--h)if(o=e.charCodeAt(h),go(o)){if(!l){r=h+1;break}}else-1===a&&(l=!1,a=h+1),o===so?-1===s?s=h:1!==d&&(d=1):-1!==s&&(d=-1);return-1!==a&&(-1===s||0===d||1===d&&s===a-1&&s===r+1?t.base=t.name=e.slice(r,a):(t.name=e.slice(r,s),t.base=e.slice(r,a),t.ext=e.slice(s,a))),t.dir=r>0&&r!==n?e.slice(0,r-1):t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},bo=(()=>{if(uo){const e=/\\/g;return()=>{const t=io().replace(e,"/");return t.slice(t.indexOf("/"))}}return()=>io()})(),wo={resolve(...e){let t="",i=!1;for(let n=e.length-1;n>=-1&&!i;n--){const o=n>=0?e[n]:bo();co(o,"path"),0!==o.length&&(t=`${o}/${t}`,i=o.charCodeAt(0)===ro)}return t=fo(t,!i,"/",po),i?`/${t}`:t.length>0?t:"."},normalize(e){if(co(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===ro,i=e.charCodeAt(e.length-1)===ro;return 0===(e=fo(e,!t,"/",po)).length?t?"/":i?"./":".":(i&&(e+="/"),t?`/${e}`:e)},isAbsolute:e=>(co(e,"path"),e.length>0&&e.charCodeAt(0)===ro),join(...e){if(0===e.length)return".";let t;for(let i=0;i<e.length;++i){const n=e[i];co(n,"path"),n.length>0&&(void 0===t?t=n:t+=`/${n}`)}return void 0===t?".":wo.normalize(t)},relative(e,t){if(co(e,"from"),co(t,"to"),e===t)return"";if((e=wo.resolve(e))===(t=wo.resolve(t)))return"";const i=e.length,n=i-1,o=t.length-1,s=n<o?n:o;let r=-1,a=0;for(;a<s;a++){const i=e.charCodeAt(1+a);if(i!==t.charCodeAt(1+a))break;i===ro&&(r=a)}if(a===s)if(o>s){if(t.charCodeAt(1+a)===ro)return t.slice(1+a+1);if(0===a)return t.slice(1+a)}else n>s&&(e.charCodeAt(1+a)===ro?r=a:0===a&&(r=0));let l="";for(a=1+r+1;a<=i;++a)a!==i&&e.charCodeAt(a)!==ro||(l+=0===l.length?"..":"/..");return`${l}${t.slice(1+r)}`},toNamespacedPath:e=>e,dirname(e){if(co(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===ro;let i=-1,n=!0;for(let t=e.length-1;t>=1;--t)if(e.charCodeAt(t)===ro){if(!n){i=t;break}}else n=!1;return-1===i?t?"/":".":t&&1===i?"//":e.slice(0,i)},basename(e,t){void 0!==t&&co(t,"ext"),co(e,"path");let i,n=0,o=-1,s=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let r=t.length-1,a=-1;for(i=e.length-1;i>=0;--i){const l=e.charCodeAt(i);if(l===ro){if(!s){n=i+1;break}}else-1===a&&(s=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1==--r&&(o=i):(r=-1,o=a))}return n===o?o=a:-1===o&&(o=e.length),e.slice(n,o)}for(i=e.length-1;i>=0;--i)if(e.charCodeAt(i)===ro){if(!s){n=i+1;break}}else-1===o&&(s=!1,o=i+1);return-1===o?"":e.slice(n,o)},extname(e){co(e,"path");let t=-1,i=0,n=-1,o=!0,s=0;for(let r=e.length-1;r>=0;--r){const a=e.charCodeAt(r);if(a!==ro)-1===n&&(o=!1,n=r+1),a===so?-1===t?t=r:1!==s&&(s=1):-1!==t&&(s=-1);else if(!o){i=r+1;break}}return-1===t||-1===n||0===s||1===s&&t===n-1&&t===i+1?"":e.slice(t,n)},format:_o.bind(null,"/"),parse(e){co(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.charCodeAt(0)===ro;let n;i?(t.root="/",n=1):n=0;let o=-1,s=0,r=-1,a=!0,l=e.length-1,h=0;for(;l>=n;--l){const t=e.charCodeAt(l);if(t!==ro)-1===r&&(a=!1,r=l+1),t===so?-1===o?o=l:1!==h&&(h=1):-1!==o&&(h=-1);else if(!a){s=l+1;break}}if(-1!==r){const n=0===s&&i?1:s;-1===o||0===h||1===h&&o===r-1&&o===s+1?t.base=t.name=e.slice(n,r):(t.name=e.slice(n,o),t.base=e.slice(n,r),t.ext=e.slice(o,r))}return s>0?t.dir=e.slice(0,s-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};wo.win32=vo.win32=vo,wo.posix=vo.posix=wo;const Co=uo?vo.normalize:wo.normalize,yo=uo?vo.resolve:wo.resolve,So=uo?vo.relative:wo.relative,ko=uo?vo.dirname:wo.dirname,Lo=uo?vo.basename:wo.basename,xo=uo?vo.extname:wo.extname,Do=uo?vo.sep:wo.sep,Eo=/^\w[\w\d+.-]*$/,No=/^\//,Io=/^\/\//,Mo="",To="/",Ao=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class Ro{static isUri(e){return e instanceof Ro||!!e&&"string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString}constructor(e,t,i,n,o,s=!1){"object"==typeof e?(this.scheme=e.scheme||Mo,this.authority=e.authority||Mo,this.path=e.path||Mo,this.query=e.query||Mo,this.fragment=e.fragment||Mo):(this.scheme=function(e,t){return e||t?e:"file"}(e,s),this.authority=t||Mo,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==To&&(t=To+t):t=To}return t}(this.scheme,i||Mo),this.query=n||Mo,this.fragment=o||Mo,function(e,t){if(!e.scheme&&t)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!Eo.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!No.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(Io.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,s))}get fsPath(){return Vo(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:n,query:o,fragment:s}=e;return void 0===t?t=this.scheme:null===t&&(t=Mo),void 0===i?i=this.authority:null===i&&(i=Mo),void 0===n?n=this.path:null===n&&(n=Mo),void 0===o?o=this.query:null===o&&(o=Mo),void 0===s?s=this.fragment:null===s&&(s=Mo),t===this.scheme&&i===this.authority&&n===this.path&&o===this.query&&s===this.fragment?this:new Po(t,i,n,o,s)}static parse(e,t=!1){const i=Ao.exec(e);return i?new Po(i[2]||Mo,Ko(i[4]||Mo),Ko(i[5]||Mo),Ko(i[7]||Mo),Ko(i[9]||Mo),t):new Po(Mo,Mo,Mo,Mo,Mo)}static file(e){let t=Mo;if(We&&(e=e.replace(/\\/g,To)),e[0]===To&&e[1]===To){const i=e.indexOf(To,2);-1===i?(t=e.substring(2),e=To):(t=e.substring(2,i),e=e.substring(i)||To)}return new Po("file",t,e,Mo,Mo)}static from(e,t){return new Po(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return i=We&&"file"===e.scheme?Ro.file(vo.join(Vo(e,!0),...t)).path:wo.join(e.path,...t),e.with({path:i})}toString(e=!1){return zo(this,e)}toJSON(){return this}static revive(e){var t,i;if(e){if(e instanceof Ro)return e;{const n=new Po(e);return n._formatted=null!==(t=e.external)&&void 0!==t?t:null,n._fsPath=e._sep===Oo&&null!==(i=e.fsPath)&&void 0!==i?i:null,n}}return e}}const Oo=We?1:void 0;class Po extends Ro{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=Vo(this,!1)),this._fsPath}toString(e=!1){return e?zo(this,!0):(this._formatted||(this._formatted=zo(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=Oo),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}const Fo={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function Bo(e,t,i){let n,o=-1;for(let s=0;s<e.length;s++){const r=e.charCodeAt(s);if(r>=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||45===r||46===r||95===r||126===r||t&&47===r||i&&91===r||i&&93===r||i&&58===r)-1!==o&&(n+=encodeURIComponent(e.substring(o,s)),o=-1),void 0!==n&&(n+=e.charAt(s));else{void 0===n&&(n=e.substr(0,s));const t=Fo[r];void 0!==t?(-1!==o&&(n+=encodeURIComponent(e.substring(o,s)),o=-1),n+=t):-1===o&&(o=s)}}return-1!==o&&(n+=encodeURIComponent(e.substring(o))),void 0!==n?n:e}function Wo(e){let t;for(let i=0;i<e.length;i++){const n=e.charCodeAt(i);35===n||63===n?(void 0===t&&(t=e.substr(0,i)),t+=Fo[n]):void 0!==t&&(t+=e[i])}return void 0!==t?t:e}function Vo(e,t){let i;return i=e.authority&&e.path.length>1&&"file"===e.scheme?`//${e.authority}${e.path}`:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,We&&(i=i.replace(/\//g,"\\")),i}function zo(e,t){const i=t?Wo:Bo;let n="",{scheme:o,authority:s,path:r,query:a,fragment:l}=e;if(o&&(n+=o,n+=":"),(s||"file"===o)&&(n+=To,n+=To),s){let e=s.indexOf("@");if(-1!==e){const t=s.substr(0,e);s=s.substr(e+1),e=t.lastIndexOf(":"),-1===e?n+=i(t,!1,!1):(n+=i(t.substr(0,e),!1,!1),n+=":",n+=i(t.substr(e+1),!1,!0)),n+="@"}s=s.toLowerCase(),e=s.lastIndexOf(":"),-1===e?n+=i(s,!1,!0):(n+=i(s.substr(0,e),!1,!0),n+=s.substr(e))}if(r){if(r.length>=3&&47===r.charCodeAt(0)&&58===r.charCodeAt(2)){const e=r.charCodeAt(1);e>=65&&e<=90&&(r=`/${String.fromCharCode(e+32)}:${r.substr(3)}`)}else if(r.length>=2&&58===r.charCodeAt(1)){const e=r.charCodeAt(0);e>=65&&e<=90&&(r=`${String.fromCharCode(e+32)}:${r.substr(2)}`)}n+=i(r,!0,!1)}return a&&(n+="?",n+=i(a,!1,!1)),l&&(n+="#",n+=t?l:Bo(l,!1,!1)),n}function Ho(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+Ho(e.substr(3)):e}}const Uo=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function Ko(e){return e.match(Uo)?e.replace(Uo,(e=>Ho(e))):e}var jo;function qo(e,t){return Ro.isUri(e)?xn(e.scheme,t):Dn(e,t+":")}function $o(e,...t){return t.some((t=>qo(e,t)))}!function(e){e.inMemory="inmemory",e.vscode="vscode",e.internal="private",e.walkThrough="walkThrough",e.walkThroughSnippet="walkThroughSnippet",e.http="http",e.https="https",e.file="file",e.mailto="mailto",e.untitled="untitled",e.data="data",e.command="command",e.vscodeRemote="vscode-remote",e.vscodeRemoteResource="vscode-remote-resource",e.vscodeManagedRemoteResource="vscode-managed-remote-resource",e.vscodeUserData="vscode-userdata",e.vscodeCustomEditor="vscode-custom-editor",e.vscodeNotebookCell="vscode-notebook-cell",e.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",e.vscodeNotebookCellOutput="vscode-notebook-cell-output",e.vscodeInteractiveInput="vscode-interactive-input",e.vscodeSettings="vscode-settings",e.vscodeWorkspaceTrust="vscode-workspace-trust",e.vscodeTerminal="vscode-terminal",e.vscodeChatSesssion="vscode-chat-editor",e.webviewPanel="webview-panel",e.vscodeWebview="vscode-webview",e.extension="extension",e.vscodeFileResource="vscode-file",e.tmp="tmp",e.vsls="vsls",e.vscodeSourceControl="vscode-scm"}(jo||(jo={}));const Go=new class{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${jo.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(t){return h(t),e}const t=e.authority;let i=this._hosts[t];i&&-1!==i.indexOf(":")&&-1===i.indexOf("[")&&(i=`[${i}]`);const n=this._ports[t],o=this._connectionTokens[t];let s=`path=${encodeURIComponent(e.path)}`;return"string"==typeof o&&(s+=`&tkn=${encodeURIComponent(o)}`),Ro.from({scheme:Ue?this._preferredWebSchema:jo.vscodeRemoteResource,authority:`${i}:${n}`,path:this._remoteResourcesPath,query:s})}};class Zo{uriToBrowserUri(e){return e.scheme===jo.vscodeRemote?Go.rewrite(e):e.scheme!==jo.file||!He&&Ke!==`${jo.vscodeFileResource}://${Zo.FALLBACK_AUTHORITY}`?e:e.with({scheme:jo.vscodeFileResource,authority:e.authority||Zo.FALLBACK_AUTHORITY,query:null,fragment:null})}}Zo.FALLBACK_AUTHORITY="vscode-app";const Yo=new Zo;var Qo;function Xo(e){return Jo(e,0)}function Jo(e,t){switch(typeof e){case"object":return null===e?es(349,t):Array.isArray(e)?(i=e,n=es(104579,n=t),i.reduce(((e,t)=>Jo(t,e)),n)):function(e,t){return t=es(181387,t),Object.keys(e).sort().reduce(((t,i)=>(t=ts(i,t),Jo(e[i],t))),t)}(e,t);case"string":return ts(e,t);case"boolean":return function(e,t){return es(e?433:863,t)}(e,t);case"number":return es(e,t);case"undefined":return es(937,t);default:return es(617,t)}var i,n}function es(e,t){return(t<<5)-t+e|0}function ts(e,t){t=es(149417,t);for(let i=0,n=e.length;i<n;i++)t=es(e.charCodeAt(i),t);return t}function is(e,t,i=32){const n=i-t;return(e<<t|(~((1<<n)-1)&e)>>>n)>>>0}function ns(e,t=0,i=e.byteLength,n=0){for(let o=0;o<i;o++)e[t+o]=n}function os(e,t=32){return e instanceof ArrayBuffer?Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join(""):function(e,t,i="0"){for(;e.length<t;)e=i+e;return e}((e>>>0).toString(16),t/4)}!function(e){const t=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);e.CoopAndCoep=Object.freeze(t.get("3"));const i="vscode-coi";e.getHeadersFromQuery=function(e){let n;"string"==typeof e?n=new URL(e).searchParams:e instanceof URL?n=e.searchParams:Ro.isUri(e)&&(n=new URL(e.toString(!0)).searchParams);const o=null==n?void 0:n.get(i);if(o)return t.get(o)},e.addSearchParam=function(e,t,n){if(!globalThis.crossOriginIsolated)return;const o=t&&n?"3":n?"2":"1";e instanceof URLSearchParams?e.set(i,o):e[i]=o}}(Qo||(Qo={}));class ss{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(0===t)return;const i=this._buff;let n,o,s=this._buffLen,r=this._leftoverHighSurrogate;for(0!==r?(n=r,o=-1,r=0):(n=e.charCodeAt(0),o=0);;){let a=n;if(In(n)){if(!(o+1<t)){r=n;break}{const t=e.charCodeAt(o+1);Mn(t)?(o++,a=Tn(n,t)):a=65533}}else Mn(n)&&(a=65533);if(s=this._push(i,s,a),o++,!(o<t))break;n=e.charCodeAt(o)}this._buffLen=s,this._leftoverHighSurrogate=r}_push(e,t,i){return i<128?e[t++]=i:i<2048?(e[t++]=192|(1984&i)>>>6,e[t++]=128|(63&i)>>>0):i<65536?(e[t++]=224|(61440&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0):(e[t++]=240|(1835008&i)>>>18,e[t++]=128|(258048&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),os(this._h0)+os(this._h1)+os(this._h2)+os(this._h3)+os(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,ns(this._buff,this._buffLen),this._buffLen>56&&(this._step(),ns(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=ss._bigBlock32,t=this._buffDV;for(let i=0;i<64;i+=4)e.setUint32(i,t.getUint32(i,!1),!1);for(let t=64;t<320;t+=4)e.setUint32(t,is(e.getUint32(t-12,!1)^e.getUint32(t-32,!1)^e.getUint32(t-56,!1)^e.getUint32(t-64,!1),1),!1);let i,n,o,s=this._h0,r=this._h1,a=this._h2,l=this._h3,h=this._h4;for(let t=0;t<80;t++)t<20?(i=r&a|~r&l,n=1518500249):t<40?(i=r^a^l,n=1859775393):t<60?(i=r&a|r&l|a&l,n=2400959708):(i=r^a^l,n=3395469782),o=is(s,5)+i+h+n+e.getUint32(4*t,!1)&4294967295,h=l,l=a,a=is(r,30),r=s,s=o;this._h0=this._h0+s&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+l&4294967295,this._h4=this._h4+h&4294967295}}ss._bigBlock32=new DataView(new ArrayBuffer(320));const{registerWindow:rs,getWindow:as,getDocument:ls,getWindows:hs,getWindowsCount:ds,getWindowId:cs,getWindowById:us,hasWindow:gs,onDidRegisterWindow:ps,onWillUnregisterWindow:ms,onDidUnregisterWindow:fs}=function(){const e=new Map;!function(e,t){const i=e;"number"!=typeof i.vscodeWindowId&&Object.defineProperty(i,"vscodeWindowId",{get:()=>1})}(r),e.set(r.vscodeWindowId,{window:r,disposables:new M});const t=new q,i=new q,n=new q;return{onDidRegisterWindow:t.event,onWillUnregisterWindow:n.event,onDidUnregisterWindow:i.event,registerWindow(o){if(e.has(o.vscodeWindowId))return T.None;const s=new M,r={window:o,disposables:s.add(new M)};return e.set(o.vscodeWindowId,r),s.add(I((()=>{e.delete(o.vscodeWindowId),i.fire(o)}))),s.add(bs(o,or.BEFORE_UNLOAD,(()=>{n.fire(o)}))),t.fire(r),s},getWindows:()=>e.values(),getWindowsCount:()=>e.size,getWindowId:e=>e.vscodeWindowId,hasWindow:t=>e.has(t),getWindowById:t=>e.get(t),getWindow(e){var t;const i=e;if(null===(t=null==i?void 0:i.ownerDocument)||void 0===t?void 0:t.defaultView)return i.ownerDocument.defaultView.window;const n=e;return(null==n?void 0:n.view)?n.view.window:r},getDocument:e=>as(e).document}}();function _s(e){for(;e.firstChild;)e.firstChild.remove()}class vs{constructor(e,t,i,n){this._node=e,this._type=t,this._handler=i,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function bs(e,t,i,n){return new vs(e,t,i,n)}function ws(e,t){return function(i){return t(new Mt(e,i))}}const Cs=function(e,t,i,n){let o=i;return"click"===t||"mousedown"===t?o=ws(as(e),i):"keydown"!==t&&"keypress"!==t&&"keyup"!==t||(o=function(e){return function(t){return e(new Dt(t))}}(i)),bs(e,t,o,n)};function ys(e,t,i){return Qt(e,t,i)}class Ss extends Xt{constructor(e,t){super(e,t)}}let ks,Ls;class xs extends Gt{cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i)}}class Ds{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){h(e)}}static sort(e,t){return t.priority-e.priority}}function Es(e){return as(e).getComputedStyle(e,null)}function Ns(e,t){const i=as(e),n=i.document;if(e!==n.body)return new Ms(e.clientWidth,e.clientHeight);if(je&&(null==i?void 0:i.visualViewport))return new Ms(i.visualViewport.width,i.visualViewport.height);if((null==i?void 0:i.innerWidth)&&i.innerHeight)return new Ms(i.innerWidth,i.innerHeight);if(n.body&&n.body.clientWidth&&n.body.clientHeight)return new Ms(n.body.clientWidth,n.body.clientHeight);if(n.documentElement&&n.documentElement.clientWidth&&n.documentElement.clientHeight)return new Ms(n.documentElement.clientWidth,n.documentElement.clientHeight);if(t)return Ns(t);throw new Error("Unable to figure out browser width and height")}!function(){const e=new Map,t=new Map,i=new Map,n=new Map;Ls=(o,s,r=0)=>{const a=cs(o),l=new Ds(s,r);let h=e.get(a);return h||(h=[],e.set(a,h)),h.push(l),i.get(a)||(i.set(a,!0),o.requestAnimationFrame((()=>(o=>{var s;i.set(o,!1);const r=null!==(s=e.get(o))&&void 0!==s?s:[];for(t.set(o,r),e.set(o,[]),n.set(o,!0);r.length>0;)r.sort(Ds.sort),r.shift().execute();n.set(o,!1)})(a)))),l},ks=(e,i,o)=>{const s=cs(e);if(n.get(s)){const e=new Ds(i,o);let n=t.get(s);return n||(n=[],t.set(s,n)),n.push(e),e}return Ls(e,i,o)}}();class Is{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const n=Es(e),o=n?n.getPropertyValue(t):"0";return Is.convertToPixels(e,o)}static getBorderLeftWidth(e){return Is.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return Is.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return Is.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return Is.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return Is.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return Is.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return Is.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return Is.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return Is.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return Is.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return Is.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return Is.getDimension(e,"margin-bottom","marginBottom")}}class Ms{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new Ms(e,t):this}static is(e){return"object"==typeof e&&"number"==typeof e.height&&"number"==typeof e.width}static lift(e){return e instanceof Ms?e:new Ms(e.width,e.height)}static equals(e,t){return e===t||!(!e||!t)&&e.width===t.width&&e.height===t.height}}function Ts(e){let t=e.offsetParent,i=e.offsetTop,n=e.offsetLeft;for(;null!==(e=e.parentNode)&&e!==e.ownerDocument.body&&e!==e.ownerDocument.documentElement;){i-=e.scrollTop;const o=Vs(e)?null:Es(e);o&&(n-="rtl"!==o.direction?e.scrollLeft:-e.scrollLeft),e===t&&(n+=Is.getBorderLeftWidth(e),i+=Is.getBorderTopWidth(e),i+=e.offsetTop,n+=e.offsetLeft,t=e.offsetParent)}return{left:n,top:i}}function As(e){const t=e.getBoundingClientRect(),i=as(e);return{left:t.left+i.scrollX,top:t.top+i.scrollY,width:t.width,height:t.height}}function Rs(e){const t=Is.getMarginLeft(e)+Is.getMarginRight(e);return e.offsetWidth+t}function Os(e){const t=Is.getBorderLeftWidth(e)+Is.getBorderRightWidth(e),i=Is.getPaddingLeft(e)+Is.getPaddingRight(e);return e.offsetWidth-t-i}function Ps(e){const t=Is.getBorderTopWidth(e)+Is.getBorderBottomWidth(e),i=Is.getPaddingTop(e)+Is.getPaddingBottom(e);return e.offsetHeight-t-i}function Fs(e){const t=Is.getMarginTop(e)+Is.getMarginBottom(e);return e.offsetHeight+t}function Bs(e,t){return Boolean(null==t?void 0:t.contains(e))}function Ws(e,t,i){return!!function(e,t,i){for(;e&&e.nodeType===e.ELEMENT_NODE;){if(e.classList.contains(t))return e;if(i)if("string"==typeof i){if(e.classList.contains(i))return null}else if(e===i)return null;e=e.parentNode}return null}(e,t,i)}function Vs(e){return e&&!!e.host&&!!e.mode}function zs(e){return!!Hs(e)}function Hs(e){for(var t;e.parentNode;){if(e===(null===(t=e.ownerDocument)||void 0===t?void 0:t.body))return null;e=e.parentNode}return Vs(e)?e:null}function Us(){let e=js().activeElement;for(;null==e?void 0:e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Ks(e){return e.ownerDocument.activeElement===e}function js(){var e;return ds()<=1?document:null!==(e=Array.from(hs()).map((({window:e})=>e.document)).find((e=>e.hasFocus())))&&void 0!==e?e:document}Ms.None=new Ms(0,0);const qs=new Map;function $s(e=r.document.head,t,i){const n=document.createElement("style");if(n.type="text/css",n.media="screen",null==t||t(n),e.appendChild(n),i&&i.add(I((()=>e.removeChild(n)))),e===r.document.head){const e=new Set;qs.set(n,e);for(const{window:t,disposables:o}of hs()){if(t===r)continue;const s=o.add(Gs(n,e,t));null==i||i.add(s)}}return n}function Gs(e,t,i){var n,o;const s=new M,r=e.cloneNode(!0);i.document.head.appendChild(r),s.add(I((()=>i.document.head.removeChild(r))));for(const t of Xs(e))null===(n=r.sheet)||void 0===n||n.insertRule(t.cssText,null===(o=r.sheet)||void 0===o?void 0:o.cssRules.length);return s.add(Zs.observe(e,s,{childList:!0})((()=>{r.textContent=e.textContent}))),t.add(r),s.add(I((()=>t.delete(r)))),s}const Zs=new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let n=this.mutationObservers.get(e);n||(n=new Map,this.mutationObservers.set(e,n));const o=Xo(i);let s=n.get(o);if(s)s.users+=1;else{const r=new q,a=new MutationObserver((e=>r.fire(e)));a.observe(e,i);const l=s={users:1,observer:a,onDidMutate:r.event};t.add(I((()=>{l.users-=1,0===l.users&&(r.dispose(),a.disconnect(),null==n||n.delete(o),0===(null==n?void 0:n.size)&&this.mutationObservers.delete(e))}))),n.set(o,s)}return s.onDidMutate}};let Ys=null;function Qs(){return Ys||(Ys=$s()),Ys}function Xs(e){var t,i;return(null===(t=null==e?void 0:e.sheet)||void 0===t?void 0:t.rules)?e.sheet.rules:(null===(i=null==e?void 0:e.sheet)||void 0===i?void 0:i.cssRules)?e.sheet.cssRules:[]}function Js(e,t,i=Qs()){var n,o;if(i&&t){null===(n=i.sheet)||void 0===n||n.insertRule(`${e} {${t}}`,0);for(const n of null!==(o=qs.get(i))&&void 0!==o?o:[])Js(e,t,n)}}function er(e,t=Qs()){var i,n;if(!t)return;const o=Xs(t),s=[];for(let t=0;t<o.length;t++){const i=o[t];tr(i)&&-1!==i.selectorText.indexOf(e)&&s.push(t)}for(let e=s.length-1;e>=0;e--)null===(i=t.sheet)||void 0===i||i.deleteRule(s[e]);for(const i of null!==(n=qs.get(t))&&void 0!==n?n:[])er(e,i)}function tr(e){return"string"==typeof e.selectorText}function ir(e){return e instanceof MouseEvent||e instanceof as(e).MouseEvent}function nr(e){return e instanceof KeyboardEvent||e instanceof as(e).KeyboardEvent}const or={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:ae?"webkitAnimationStart":"animationstart",ANIMATION_END:ae?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:ae?"webkitAnimationIteration":"animationiteration"};function sr(e){const t=e;return!(!t||"function"!=typeof t.preventDefault||"function"!=typeof t.stopPropagation)}const rr=(e,t)=>(e.preventDefault(),t&&e.stopPropagation(),e);class ar extends T{static hasFocusWithin(e){if(e instanceof HTMLElement){const t=Hs(e);return Bs(t?t.activeElement:e.ownerDocument.activeElement,e)}{const t=e;return Bs(t.document.activeElement,t.document)}}constructor(e){super(),this._onDidFocus=this._register(new q),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new q),this.onDidBlur=this._onDidBlur.event;let t=ar.hasFocusWithin(e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,(e instanceof HTMLElement?as(e):e).setTimeout((()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())}),0))};this._refreshStateHandler=()=>{ar.hasFocusWithin(e)!==t&&(t?o():n())},this._register(bs(e,or.FOCUS,n,!0)),this._register(bs(e,or.BLUR,o,!0)),e instanceof HTMLElement&&(this._register(bs(e,or.FOCUS_IN,(()=>this._refreshStateHandler()))),this._register(bs(e,or.FOCUS_OUT,(()=>this._refreshStateHandler()))))}}function lr(e){return new ar(e)}function hr(e,...t){if(e.append(...t),1===t.length&&"string"!=typeof t[0])return t[0]}function dr(e,t){return e.insertBefore(t,e.firstChild),t}function cr(e,...t){e.innerText="",hr(e,...t)}const ur=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var gr;function pr(e,t,i,...n){const o=ur.exec(t);if(!o)throw new Error("Bad use of emmet");const s=o[1]||"div";let r;return r=e!==gr.HTML?document.createElementNS(e,s):document.createElement(s),o[3]&&(r.id=o[3]),o[4]&&(r.className=o[4].replace(/\./g," ").trim()),i&&Object.entries(i).forEach((([e,t])=>{void 0!==t&&(/^on\w+$/.test(e)?r[e]=t:"selected"===e?t&&r.setAttribute(e,"true"):r.setAttribute(e,t))})),r.append(...n),r}function mr(e,t,...i){return pr(gr.HTML,e,t,...i)}function fr(...e){for(const t of e)t.style.display="",t.removeAttribute("aria-hidden")}function _r(...e){for(const t of e)t.style.display="none",t.setAttribute("aria-hidden","true")}function vr(e,t){const i=e.devicePixelRatio*t;return Math.max(1,Math.floor(i))/e.devicePixelRatio}function br(e){r.open(e,"_blank","noopener")}function wr(e){return e?`url('${Yo.uriToBrowserUri(e).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function Cr(e){return`'${e.replace(/'/g,"%27")}'`}function yr(e,t){if(void 0!==e){const i=e.match(/^\s*var\((.+)\)$/);if(i){const e=i[1].split(",",2);return 2===e.length&&(t=yr(e[1].trim(),t)),`var(${e[0]}, ${t})`}return e}return t}!function(e){e.HTML="http://www.w3.org/1999/xhtml",e.SVG="http://www.w3.org/2000/svg"}(gr||(gr={})),mr.SVG=function(e,t,...i){return pr(gr.SVG,e,t,...i)},Go.setPreferredWebSchema(/^https:/.test(r.location.href)?"https":"http");const Sr=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]);Object.freeze({ALLOWED_TAGS:["a","button","blockquote","code","div","h1","h2","h3","h4","h5","h6","hr","input","label","li","p","pre","select","small","span","strong","textarea","ul","ol"],ALLOWED_ATTR:["href","data-href","data-command","target","title","name","src","alt","class","id","role","tabindex","style","data-code","width","height","align","x-dispatch","required","checked","placeholder","type","start"],RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1,RETURN_TRUSTED_TYPE:!0});class kr extends q{constructor(){super(),this._subscriptions=new M,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(z.runAndSubscribe(ps,(({window:e,disposables:t})=>this.registerListeners(e,t)),{window:r,disposables:this._subscriptions}))}registerListeners(e,t){t.add(bs(e,"keydown",(e=>{if(e.defaultPrevented)return;const t=new Dt(e);if(6!==t.keyCode||!e.repeat){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else{if(6===t.keyCode)return;this._keyStatus.lastKeyPressed=void 0}this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}}),!0)),t.add(bs(e,"keyup",(e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))}),!0)),t.add(bs(e.document.body,"mousedown",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),t.add(bs(e.document.body,"mouseup",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),t.add(bs(e.document.body,"mousemove",(e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)}),!0)),t.add(bs(e,"blur",(()=>{this.resetKeyStatus()})))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return kr.instance||(kr.instance=new kr),kr.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class Lr extends T{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(bs(this.element,or.DRAG_START,(e=>{var t,i;null===(i=(t=this.callbacks).onDragStart)||void 0===i||i.call(t,e)}))),this.callbacks.onDrag&&this._register(bs(this.element,or.DRAG,(e=>{var t,i;null===(i=(t=this.callbacks).onDrag)||void 0===i||i.call(t,e)}))),this._register(bs(this.element,or.DRAG_ENTER,(e=>{var t,i;this.counter++,this.dragStartTime=e.timeStamp,null===(i=(t=this.callbacks).onDragEnter)||void 0===i||i.call(t,e)}))),this._register(bs(this.element,or.DRAG_OVER,(e=>{var t,i;e.preventDefault(),null===(i=(t=this.callbacks).onDragOver)||void 0===i||i.call(t,e,e.timeStamp-this.dragStartTime)}))),this._register(bs(this.element,or.DRAG_LEAVE,(e=>{var t,i;this.counter--,0===this.counter&&(this.dragStartTime=0,null===(i=(t=this.callbacks).onDragLeave)||void 0===i||i.call(t,e))}))),this._register(bs(this.element,or.DRAG_END,(e=>{var t,i;this.counter=0,this.dragStartTime=0,null===(i=(t=this.callbacks).onDragEnd)||void 0===i||i.call(t,e)}))),this._register(bs(this.element,or.DROP,(e=>{var t,i;this.counter=0,this.dragStartTime=0,null===(i=(t=this.callbacks).onDrop)||void 0===i||i.call(t,e)})))}}const xr=/(?<tag>[\w\-]+)?(?:#(?<id>[\w\-]+))?(?<class>(?:\.(?:[\w\-]+))*)(?:@(?<name>(?:[\w\_])+))?/;function Dr(e,...t){let i,n;Array.isArray(t[0])?(i={},n=t[0]):(i=t[0]||{},n=t[1]);const o=xr.exec(e);if(!o||!o.groups)throw new Error("Bad use of h");const s=o.groups.tag||"div",r=document.createElement(s);o.groups.id&&(r.id=o.groups.id);const a=[];if(o.groups.class)for(const e of o.groups.class.split("."))""!==e&&a.push(e);if(void 0!==i.className)for(const e of i.className.split("."))""!==e&&a.push(e);a.length>0&&(r.className=a.join(" "));const l={};if(o.groups.name&&(l[o.groups.name]=r),n)for(const e of n)e instanceof HTMLElement?r.appendChild(e):"string"==typeof e?r.append(e):"root"in e&&(Object.assign(l,e),r.appendChild(e.root));for(const[e,t]of Object.entries(i))if("className"!==e)if("style"===e)for(const[e,i]of Object.entries(t))r.style.setProperty(Er(e),"number"==typeof i?i+"px":""+i);else"tabIndex"===e?r.tabIndex=t:r.setAttribute(Er(e),t.toString());return l.root=r,l}function Er(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var Nr=i(3379),Ir=i.n(Nr),Mr=i(7795),Tr=i.n(Mr),Ar=i(569),Rr=i.n(Ar),Or=i(3565),Pr=i.n(Or),Fr=i(9216),Br=i.n(Fr),Wr=i(4589),Vr=i.n(Wr),zr=i(93),Hr={};Hr.styleTagTransform=Vr(),Hr.setAttributes=Pr(),Hr.insert=Rr().bind(null,"head"),Hr.domAPI=Tr(),Hr.insertStyleElement=Br(),Ir()(zr.Z,Hr),zr.Z&&zr.Z.locals&&zr.Z.locals;const Ur=2e4;let Kr,jr,qr,$r,Gr;function Zr(e){Kr&&(jr.textContent!==e?(_s(qr),Qr(jr,e)):(_s(jr),Qr(qr,e)))}function Yr(e){Kr&&($r.textContent!==e?(_s(Gr),Qr($r,e)):(_s($r),Qr(Gr,e)))}function Qr(e,t){_s(e),t.length>Ur&&(t=t.substr(0,Ur)),e.textContent=t,e.style.visibility="hidden",e.style.visibility="visible"}var Xr,Jr;class ea{constructor(e,t){this.uri=e,this.value=t}}class ta{constructor(e,t){if(this[Xr]="ResourceMap",e instanceof ta)this.map=new Map(e.map),this.toKey=null!=t?t:ta.defaultToKey;else if(function(e){return Array.isArray(e)}(e)){this.map=new Map,this.toKey=null!=t?t:ta.defaultToKey;for(const[t,i]of e)this.set(t,i)}else this.map=new Map,this.toKey=null!=e?e:ta.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new ea(e,t)),this}get(e){var t;return null===(t=this.map.get(this.toKey(e)))||void 0===t?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){void 0!==t&&(e=e.bind(t));for(const[t,i]of this.map)e(i.value,i.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(Xr=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}ta.defaultToKey=e=>e.toString();class ia{constructor(){this[Jr]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return null===(e=this._head)||void 0===e?void 0:e.value}get last(){var e;return null===(e=this._tail)||void 0===e?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return 0!==t&&this.touch(i,t),i.value}set(e,t,i=0){let n=this._map.get(e);if(n)n.value=t,0!==i&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case 0:case 2:default:this.addItemLast(n);break;case 1:this.addItemFirst(n)}this._map.set(e,n),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const i=this._state;let n=this._head;for(;n;){if(t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");n=n.next}}keys(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.key,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}values(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.value,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}entries(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:[i.key,i.value],done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}[(Jr=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(1===t||2===t)if(1===t){if(e===this._head)return;const t=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(t.previous=i,i.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(2===t){if(e===this._tail)return;const t=e.next,i=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=i,i.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}toJSON(){const e=[];return this.forEach(((t,i)=>{e.push([i,t])})),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}class na extends ia{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}class oa{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,i]of e)this.set(t,i)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const t=this._m1.get(e);return void 0!==t&&(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}}class sa{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),0===i.size&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}get(e){return this.map.get(e)||new Set}}let ra=0;const aa=new Uint32Array(10);function la(e,t,i){var n;e>=i&&e<i+t.length&&(0!==(n=t[e-i])&&(aa[ra++]=255&n,n>>8&&(aa[ra++]=n>>8&255),n>>16&&(aa[ra++]=n>>16&255)))}const ha=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),da=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),ca=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),ua=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]);function ga(...e){return function(t,i){for(let n=0,o=e.length;n<o;n++){const o=e[n](t,i);if(o)return o}return null}}ma.bind(void 0,!1);const pa=ma.bind(void 0,!0);function ma(e,t,i){if(!i||i.length<t.length)return null;let n;return n=e?Dn(i,t):0===i.indexOf(t),n?t.length>0?[{start:0,end:t.length}]:[]:null}function fa(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1===i?null:[{start:i,end:i+e.length}]}function _a(e,t){return va(e.toLowerCase(),t.toLowerCase(),0,0)}function va(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]===t[n]){let o=null;return(o=va(e,t,i+1,n+1))?Na({start:n,end:n+1},o):null}return va(e,t,i,n+1)}function ba(e){return 97<=e&&e<=122}function wa(e){return 65<=e&&e<=90}function Ca(e){return 48<=e&&e<=57}function ya(e){return 32===e||9===e||10===e||13===e}const Sa=new Set;function ka(e){return ya(e)||Sa.has(e)}function La(e,t){return e===t||ka(e)&&ka(t)}"()[]{}<>`'\"-/;:,.?!".split("").forEach((e=>Sa.add(e.charCodeAt(0))));const xa=new Map;function Da(e){if(xa.has(e))return xa.get(e);let t;const i=function(e){const t=function(e){if(ra=0,la(e,ha,4352),ra>0)return aa.subarray(0,ra);if(la(e,da,4449),ra>0)return aa.subarray(0,ra);if(la(e,ca,4520),ra>0)return aa.subarray(0,ra);if(la(e,ua,12593),ra)return aa.subarray(0,ra);if(e>=44032&&e<=55203){const t=e-44032,i=t%588,n=Math.floor(t/588),o=Math.floor(i/28),s=i%28-1;if(n<ha.length?la(n,ha,0):4352+n-12593<ua.length&&la(4352+n,ua,12593),o<da.length?la(o,da,0):4449+o-12593<ua.length&&la(4449+o-12593,ua,12593),s>=0&&(s<ca.length?la(s,ca,0):4520+s-12593<ua.length&&la(4520+s-12593,ua,12593)),ra>0)return aa.subarray(0,ra)}}(e);if(t&&t.length>0)return new Uint32Array(t)}(e);return i&&(t=i),xa.set(e,t),t}function Ea(e){return ba(e)||wa(e)||Ca(e)}function Na(e,t){return 0===t.length?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function Ia(e,t){for(let i=t;i<e.length;i++){const t=e.charCodeAt(i);if(wa(t)||Ca(t)||i>0&&!Ea(e.charCodeAt(i-1)))return i}return e.length}function Ma(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]!==t[n].toLowerCase())return null;{let o=null,s=n+1;for(o=Ma(e,t,i+1,n+1);!o&&(s=Ia(t,s))<t.length;)o=Ma(e,t,i+1,s),s++;return null===o?null:Na({start:n,end:n+1},o)}}function Ta(e,t){if(!t)return null;if(0===(t=t.trim()).length)return null;if(!function(e){let t=0,i=0,n=0,o=0;for(let s=0;s<e.length;s++)n=e.charCodeAt(s),wa(n)&&t++,ba(n)&&i++,ya(n)&&o++;return 0!==t&&0!==i||0!==o?t<=5:e.length<=30}(e))return null;if(t.length>60)return null;const i=function(e){let t=0,i=0,n=0,o=0,s=0;for(let r=0;r<e.length;r++)s=e.charCodeAt(r),wa(s)&&t++,ba(s)&&i++,Ea(s)&&n++,Ca(s)&&o++;return{upperPercent:t/e.length,lowerPercent:i/e.length,alphaPercent:n/e.length,numericPercent:o/e.length}}(t);if(!function(e){const{upperPercent:t,lowerPercent:i,alphaPercent:n,numericPercent:o}=e;return i>.2&&t<.8&&n>.6&&o<.2}(i)){if(!function(e){const{upperPercent:t,lowerPercent:i}=e;return 0===i&&t>.6}(i))return null;t=t.toLowerCase()}let n=null,o=0;for(e=e.toLowerCase();o<t.length&&null===(n=Ma(e,t,0,o));)o=Ia(t,o+1);return n}function Aa(e,t,i,n,o){let s=0;if(i===e.length)return[];if(n===t.length)return null;if(!La(e.charCodeAt(i),t.charCodeAt(n))){const o=Da(e.charCodeAt(i));if(!o)return null;for(let e=0;e<o.length;e++)if(!La(o[e],t.charCodeAt(n+e)))return null;s+=o.length-1}let r=null,a=n+s+1;if(r=Aa(e,t,i+1,a,o),!o)for(;!r&&(a=Ra(t,a))<t.length;)r=Aa(e,t,i+1,a,o),a++;if(!r)return null;if(e.charCodeAt(i)!==t.charCodeAt(n)){const o=Da(e.charCodeAt(i));if(!o)return r;for(let e=0;e<o.length;e++)if(o[e]!==t.charCodeAt(n+e))return r}return Na({start:n,end:n+s+1},r)}function Ra(e,t){for(let i=t;i<e.length;i++)if(ka(e.charCodeAt(i))||i>0&&ka(e.charCodeAt(i-1)))return i;return e.length}const Oa=ga(pa,Ta,fa),Pa=ga(pa,Ta,_a),Fa=new na(1e4);function Ba(e,t,i=!1){if("string"!=typeof e||"string"!=typeof t)return null;let n=Fa.get(e);n||(n=new RegExp(e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*"),"i"),Fa.set(e,n));const o=n.exec(t);return o?[{start:o.index,end:o.index+o[0].length}]:i?Pa(e,t):Oa(e,t)}function Wa(e,t){const i=nl(e,e.toLowerCase(),0,t,t.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return i?za(i):null}function Va(e,t,i,n,o,s){const r=Math.min(13,e.length);for(;i<r;i++){const r=nl(e,t,i,n,o,s,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(r)return r}return[0,s]}function za(e){if(void 0===e)return[];const t=[],i=e[1];for(let n=e.length-1;n>1;n--){const o=e[n]+i,s=t[t.length-1];s&&s.end===o?s.end=o+1:t.push({start:o,end:o+1})}return t}const Ha=128;function Ua(){const e=[],t=[];for(let e=0;e<=Ha;e++)t[e]=0;for(let i=0;i<=Ha;i++)e.push(t.slice(0));return e}function Ka(e){const t=[];for(let i=0;i<=e;i++)t[i]=0;return t}const ja=Ka(2*Ha),qa=Ka(2*Ha),$a=Ua(),Ga=Ua(),Za=Ua(),Ya=!1;function Qa(e,t,i,n,o){function s(e,t,i=" "){for(;e.length<t;)e=i+e;return e}let r=` | |${n.split("").map((e=>s(e,3))).join("|")}\n`;for(let n=0;n<=i;n++)r+=0===n?" |":`${t[n-1]}|`,r+=e[n].slice(0,o+1).map((e=>s(e.toString(),3))).join("|")+"\n";return r}function Xa(e,t){if(t<0||t>=e.length)return!1;const i=e.codePointAt(t);switch(i){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!jn(i)}}function Ja(e,t){if(t<0||t>=e.length)return!1;switch(e.charCodeAt(t)){case 32:case 9:return!0;default:return!1}}function el(e,t,i){return t[e]!==i[e]}var tl;!function(e){e.Default=[-100,0],e.isDefault=function(e){return!e||2===e.length&&-100===e[0]&&0===e[1]}}(tl||(tl={}));class il{constructor(e,t){this.firstMatchCanBeWeak=e,this.boostFullMatch=t}}function nl(e,t,i,n,o,s,r=il.default){const a=e.length>Ha?Ha:e.length,l=n.length>Ha?Ha:n.length;if(i>=a||s>=l||a-i>l-s)return;if(!function(e,t,i,n,o,s,r=!1){for(;t<i&&o<s;)e[t]===n[o]&&(r&&(ja[t]=o),t+=1),o+=1;return t===i}(t,i,a,o,s,l,!0))return;!function(e,t,i,n,o,s){let r=e-1,a=t-1;for(;r>=i&&a>=n;)o[r]===s[a]&&(qa[r]=a,r--),a--}(a,l,i,s,t,o);let h=1,d=1,c=i,u=s;const g=[!1];for(h=1,c=i;c<a;h++,c++){const r=ja[c],p=qa[c],m=c+1<a?qa[c+1]:l;for(d=r-s+1,u=r;u<m;d++,u++){let a=Number.MIN_SAFE_INTEGER,m=!1;u<=p&&(a=ol(e,t,c,i,n,o,u,l,s,0===$a[h-1][d-1],g));let f=0;a!==Number.MAX_SAFE_INTEGER&&(m=!0,f=a+Ga[h-1][d-1]);const _=u>r,v=_?Ga[h][d-1]+($a[h][d-1]>0?-5:0):0,b=u>r+1&&$a[h][d-1]>0,w=b?Ga[h][d-2]+($a[h][d-2]>0?-5:0):0;if(b&&(!_||w>=v)&&(!m||w>=f))Ga[h][d]=w,Za[h][d]=3,$a[h][d]=0;else if(_&&(!m||v>=f))Ga[h][d]=v,Za[h][d]=2,$a[h][d]=0;else{if(!m)throw new Error("not possible");Ga[h][d]=f,Za[h][d]=1,$a[h][d]=$a[h-1][d-1]+1}}}if(Ya&&function(e,t,i,n){e=e.substr(t),i=i.substr(n),console.log(Qa(Ga,e,e.length,i,i.length)),console.log(Qa(Za,e,e.length,i,i.length)),console.log(Qa($a,e,e.length,i,i.length))}(e,i,n,s),!g[0]&&!r.firstMatchCanBeWeak)return;h--,d--;const p=[Ga[h][d],s];let m=0,f=0;for(;h>=1;){let e=d;do{const t=Za[h][e];if(3===t)e-=2;else{if(2!==t)break;e-=1}}while(e>=1);m>1&&t[i+h-1]===o[s+d-1]&&!el(e+s-1,n,o)&&m+1>$a[h][e]&&(e=d),e===d?m++:m=1,f||(f=e),h--,d=e-1,p.push(d)}l===a&&r.boostFullMatch&&(p[0]+=2);const _=f-a;return p[0]-=_,p}function ol(e,t,i,n,o,s,r,a,l,h,d){if(t[i]!==s[r])return Number.MIN_SAFE_INTEGER;let c=1,u=!1;return r===i-n?c=e[i]===o[r]?7:5:!el(r,o,s)||0!==r&&el(r-1,o,s)?!Xa(s,r)||0!==r&&Xa(s,r-1)?(Xa(s,r-1)||Ja(s,r-1))&&(c=5,u=!0):c=5:(c=e[i]===o[r]?7:5,u=!0),c>1&&i===n&&(d[0]=!0),u||(u=el(r,o,s)||Xa(s,r-1)||Ja(s,r-1)),i===n?r>l&&(c-=u?3:5):c+=h?u?2:0:u?0:1,r+1===a&&(c-=u?3:5),c}function sl(e,t,i,n,o,s,r){return function(e,t,i,n,o,s,r,a){let l=nl(e,t,i,n,o,s,a);if(e.length>=3){const t=Math.min(7,e.length-1);for(let r=i+1;r<t;r++){const t=rl(e,r);if(t){const e=nl(t,t.toLowerCase(),i,n,o,s,a);e&&(e[0]-=3,(!l||e[0]>l[0])&&(l=e))}}}return l}(e,t,i,n,o,s,0,r)}function rl(e,t){if(t+1>=e.length)return;const i=e[t],n=e[t+1];return i!==n?e.slice(0,t)+n+i+e.slice(t+2):void 0}function al(e){return"string"==typeof e}function ll(e){return!("object"!=typeof e||null===e||Array.isArray(e)||e instanceof RegExp||e instanceof Date)}function hl(e){const t=Object.getPrototypeOf(Uint8Array);return"object"==typeof e&&e instanceof t}function dl(e){return"number"==typeof e&&!isNaN(e)}function cl(e){return!!e&&"function"==typeof e[Symbol.iterator]}function ul(e){return!0===e||!1===e}function gl(e){return void 0===e}function pl(e){return!ml(e)}function ml(e){return gl(e)||null===e}function fl(e,t){if(!e)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function _l(e){if(ml(e))throw new Error("Assertion Failed: argument is undefined or null");return e}function vl(e){return"function"==typeof e}function bl(e,t){if(al(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(vl(t)){try{if(e instanceof t)return}catch(e){}if(!ml(e)&&e.constructor===t)return;if(1===t.length&&!0===t.call(void 0,e))return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}il.default={boostFullMatch:!0,firstMatchCanBeWeak:!1};const wl=Object.create(null);function Cl(e,t){if(al(t)){const i=wl[t];if(void 0===i)throw new Error(`${e} references an unknown codicon: ${t}`);t=i}return wl[e]=t,{id:e}}function yl(){return wl}const Sl={add:Cl("add",6e4),plus:Cl("plus",6e4),gistNew:Cl("gist-new",6e4),repoCreate:Cl("repo-create",6e4),lightbulb:Cl("lightbulb",60001),lightBulb:Cl("light-bulb",60001),repo:Cl("repo",60002),repoDelete:Cl("repo-delete",60002),gistFork:Cl("gist-fork",60003),repoForked:Cl("repo-forked",60003),gitPullRequest:Cl("git-pull-request",60004),gitPullRequestAbandoned:Cl("git-pull-request-abandoned",60004),recordKeys:Cl("record-keys",60005),keyboard:Cl("keyboard",60005),tag:Cl("tag",60006),tagAdd:Cl("tag-add",60006),tagRemove:Cl("tag-remove",60006),gitPullRequestLabel:Cl("git-pull-request-label",60006),person:Cl("person",60007),personFollow:Cl("person-follow",60007),personOutline:Cl("person-outline",60007),personFilled:Cl("person-filled",60007),gitBranch:Cl("git-branch",60008),gitBranchCreate:Cl("git-branch-create",60008),gitBranchDelete:Cl("git-branch-delete",60008),sourceControl:Cl("source-control",60008),mirror:Cl("mirror",60009),mirrorPublic:Cl("mirror-public",60009),star:Cl("star",60010),starAdd:Cl("star-add",60010),starDelete:Cl("star-delete",60010),starEmpty:Cl("star-empty",60010),comment:Cl("comment",60011),commentAdd:Cl("comment-add",60011),alert:Cl("alert",60012),warning:Cl("warning",60012),search:Cl("search",60013),searchSave:Cl("search-save",60013),logOut:Cl("log-out",60014),signOut:Cl("sign-out",60014),logIn:Cl("log-in",60015),signIn:Cl("sign-in",60015),eye:Cl("eye",60016),eyeUnwatch:Cl("eye-unwatch",60016),eyeWatch:Cl("eye-watch",60016),circleFilled:Cl("circle-filled",60017),primitiveDot:Cl("primitive-dot",60017),closeDirty:Cl("close-dirty",60017),debugBreakpoint:Cl("debug-breakpoint",60017),debugBreakpointDisabled:Cl("debug-breakpoint-disabled",60017),debugHint:Cl("debug-hint",60017),primitiveSquare:Cl("primitive-square",60018),edit:Cl("edit",60019),pencil:Cl("pencil",60019),info:Cl("info",60020),issueOpened:Cl("issue-opened",60020),gistPrivate:Cl("gist-private",60021),gitForkPrivate:Cl("git-fork-private",60021),lock:Cl("lock",60021),mirrorPrivate:Cl("mirror-private",60021),close:Cl("close",60022),removeClose:Cl("remove-close",60022),x:Cl("x",60022),repoSync:Cl("repo-sync",60023),sync:Cl("sync",60023),clone:Cl("clone",60024),desktopDownload:Cl("desktop-download",60024),beaker:Cl("beaker",60025),microscope:Cl("microscope",60025),vm:Cl("vm",60026),deviceDesktop:Cl("device-desktop",60026),file:Cl("file",60027),fileText:Cl("file-text",60027),more:Cl("more",60028),ellipsis:Cl("ellipsis",60028),kebabHorizontal:Cl("kebab-horizontal",60028),mailReply:Cl("mail-reply",60029),reply:Cl("reply",60029),organization:Cl("organization",60030),organizationFilled:Cl("organization-filled",60030),organizationOutline:Cl("organization-outline",60030),newFile:Cl("new-file",60031),fileAdd:Cl("file-add",60031),newFolder:Cl("new-folder",60032),fileDirectoryCreate:Cl("file-directory-create",60032),trash:Cl("trash",60033),trashcan:Cl("trashcan",60033),history:Cl("history",60034),clock:Cl("clock",60034),folder:Cl("folder",60035),fileDirectory:Cl("file-directory",60035),symbolFolder:Cl("symbol-folder",60035),logoGithub:Cl("logo-github",60036),markGithub:Cl("mark-github",60036),github:Cl("github",60036),terminal:Cl("terminal",60037),console:Cl("console",60037),repl:Cl("repl",60037),zap:Cl("zap",60038),symbolEvent:Cl("symbol-event",60038),error:Cl("error",60039),stop:Cl("stop",60039),variable:Cl("variable",60040),symbolVariable:Cl("symbol-variable",60040),array:Cl("array",60042),symbolArray:Cl("symbol-array",60042),symbolModule:Cl("symbol-module",60043),symbolPackage:Cl("symbol-package",60043),symbolNamespace:Cl("symbol-namespace",60043),symbolObject:Cl("symbol-object",60043),symbolMethod:Cl("symbol-method",60044),symbolFunction:Cl("symbol-function",60044),symbolConstructor:Cl("symbol-constructor",60044),symbolBoolean:Cl("symbol-boolean",60047),symbolNull:Cl("symbol-null",60047),symbolNumeric:Cl("symbol-numeric",60048),symbolNumber:Cl("symbol-number",60048),symbolStructure:Cl("symbol-structure",60049),symbolStruct:Cl("symbol-struct",60049),symbolParameter:Cl("symbol-parameter",60050),symbolTypeParameter:Cl("symbol-type-parameter",60050),symbolKey:Cl("symbol-key",60051),symbolText:Cl("symbol-text",60051),symbolReference:Cl("symbol-reference",60052),goToFile:Cl("go-to-file",60052),symbolEnum:Cl("symbol-enum",60053),symbolValue:Cl("symbol-value",60053),symbolRuler:Cl("symbol-ruler",60054),symbolUnit:Cl("symbol-unit",60054),activateBreakpoints:Cl("activate-breakpoints",60055),archive:Cl("archive",60056),arrowBoth:Cl("arrow-both",60057),arrowDown:Cl("arrow-down",60058),arrowLeft:Cl("arrow-left",60059),arrowRight:Cl("arrow-right",60060),arrowSmallDown:Cl("arrow-small-down",60061),arrowSmallLeft:Cl("arrow-small-left",60062),arrowSmallRight:Cl("arrow-small-right",60063),arrowSmallUp:Cl("arrow-small-up",60064),arrowUp:Cl("arrow-up",60065),bell:Cl("bell",60066),bold:Cl("bold",60067),book:Cl("book",60068),bookmark:Cl("bookmark",60069),debugBreakpointConditionalUnverified:Cl("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:Cl("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:Cl("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:Cl("debug-breakpoint-data-unverified",60072),debugBreakpointData:Cl("debug-breakpoint-data",60073),debugBreakpointDataDisabled:Cl("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:Cl("debug-breakpoint-log-unverified",60074),debugBreakpointLog:Cl("debug-breakpoint-log",60075),debugBreakpointLogDisabled:Cl("debug-breakpoint-log-disabled",60075),briefcase:Cl("briefcase",60076),broadcast:Cl("broadcast",60077),browser:Cl("browser",60078),bug:Cl("bug",60079),calendar:Cl("calendar",60080),caseSensitive:Cl("case-sensitive",60081),check:Cl("check",60082),checklist:Cl("checklist",60083),chevronDown:Cl("chevron-down",60084),dropDownButton:Cl("drop-down-button",60084),chevronLeft:Cl("chevron-left",60085),chevronRight:Cl("chevron-right",60086),chevronUp:Cl("chevron-up",60087),chromeClose:Cl("chrome-close",60088),chromeMaximize:Cl("chrome-maximize",60089),chromeMinimize:Cl("chrome-minimize",60090),chromeRestore:Cl("chrome-restore",60091),circle:Cl("circle",60092),circleOutline:Cl("circle-outline",60092),debugBreakpointUnverified:Cl("debug-breakpoint-unverified",60092),circleSlash:Cl("circle-slash",60093),circuitBoard:Cl("circuit-board",60094),clearAll:Cl("clear-all",60095),clippy:Cl("clippy",60096),closeAll:Cl("close-all",60097),cloudDownload:Cl("cloud-download",60098),cloudUpload:Cl("cloud-upload",60099),code:Cl("code",60100),collapseAll:Cl("collapse-all",60101),colorMode:Cl("color-mode",60102),commentDiscussion:Cl("comment-discussion",60103),compareChanges:Cl("compare-changes",60157),creditCard:Cl("credit-card",60105),dash:Cl("dash",60108),dashboard:Cl("dashboard",60109),database:Cl("database",60110),debugContinue:Cl("debug-continue",60111),debugDisconnect:Cl("debug-disconnect",60112),debugPause:Cl("debug-pause",60113),debugRestart:Cl("debug-restart",60114),debugStart:Cl("debug-start",60115),debugStepInto:Cl("debug-step-into",60116),debugStepOut:Cl("debug-step-out",60117),debugStepOver:Cl("debug-step-over",60118),debugStop:Cl("debug-stop",60119),debug:Cl("debug",60120),deviceCameraVideo:Cl("device-camera-video",60121),deviceCamera:Cl("device-camera",60122),deviceMobile:Cl("device-mobile",60123),diffAdded:Cl("diff-added",60124),diffIgnored:Cl("diff-ignored",60125),diffModified:Cl("diff-modified",60126),diffRemoved:Cl("diff-removed",60127),diffRenamed:Cl("diff-renamed",60128),diff:Cl("diff",60129),discard:Cl("discard",60130),editorLayout:Cl("editor-layout",60131),emptyWindow:Cl("empty-window",60132),exclude:Cl("exclude",60133),extensions:Cl("extensions",60134),eyeClosed:Cl("eye-closed",60135),fileBinary:Cl("file-binary",60136),fileCode:Cl("file-code",60137),fileMedia:Cl("file-media",60138),filePdf:Cl("file-pdf",60139),fileSubmodule:Cl("file-submodule",60140),fileSymlinkDirectory:Cl("file-symlink-directory",60141),fileSymlinkFile:Cl("file-symlink-file",60142),fileZip:Cl("file-zip",60143),files:Cl("files",60144),filter:Cl("filter",60145),flame:Cl("flame",60146),foldDown:Cl("fold-down",60147),foldUp:Cl("fold-up",60148),fold:Cl("fold",60149),folderActive:Cl("folder-active",60150),folderOpened:Cl("folder-opened",60151),gear:Cl("gear",60152),gift:Cl("gift",60153),gistSecret:Cl("gist-secret",60154),gist:Cl("gist",60155),gitCommit:Cl("git-commit",60156),gitCompare:Cl("git-compare",60157),gitMerge:Cl("git-merge",60158),githubAction:Cl("github-action",60159),githubAlt:Cl("github-alt",60160),globe:Cl("globe",60161),grabber:Cl("grabber",60162),graph:Cl("graph",60163),gripper:Cl("gripper",60164),heart:Cl("heart",60165),home:Cl("home",60166),horizontalRule:Cl("horizontal-rule",60167),hubot:Cl("hubot",60168),inbox:Cl("inbox",60169),issueClosed:Cl("issue-closed",60324),issueReopened:Cl("issue-reopened",60171),issues:Cl("issues",60172),italic:Cl("italic",60173),jersey:Cl("jersey",60174),json:Cl("json",60175),bracket:Cl("bracket",60175),kebabVertical:Cl("kebab-vertical",60176),key:Cl("key",60177),law:Cl("law",60178),lightbulbAutofix:Cl("lightbulb-autofix",60179),linkExternal:Cl("link-external",60180),link:Cl("link",60181),listOrdered:Cl("list-ordered",60182),listUnordered:Cl("list-unordered",60183),liveShare:Cl("live-share",60184),loading:Cl("loading",60185),location:Cl("location",60186),mailRead:Cl("mail-read",60187),mail:Cl("mail",60188),markdown:Cl("markdown",60189),megaphone:Cl("megaphone",60190),mention:Cl("mention",60191),milestone:Cl("milestone",60192),gitPullRequestMilestone:Cl("git-pull-request-milestone",60192),mortarBoard:Cl("mortar-board",60193),move:Cl("move",60194),multipleWindows:Cl("multiple-windows",60195),mute:Cl("mute",60196),noNewline:Cl("no-newline",60197),note:Cl("note",60198),octoface:Cl("octoface",60199),openPreview:Cl("open-preview",60200),package:Cl("package",60201),paintcan:Cl("paintcan",60202),pin:Cl("pin",60203),play:Cl("play",60204),run:Cl("run",60204),plug:Cl("plug",60205),preserveCase:Cl("preserve-case",60206),preview:Cl("preview",60207),project:Cl("project",60208),pulse:Cl("pulse",60209),question:Cl("question",60210),quote:Cl("quote",60211),radioTower:Cl("radio-tower",60212),reactions:Cl("reactions",60213),references:Cl("references",60214),refresh:Cl("refresh",60215),regex:Cl("regex",60216),remoteExplorer:Cl("remote-explorer",60217),remote:Cl("remote",60218),remove:Cl("remove",60219),replaceAll:Cl("replace-all",60220),replace:Cl("replace",60221),repoClone:Cl("repo-clone",60222),repoForcePush:Cl("repo-force-push",60223),repoPull:Cl("repo-pull",60224),repoPush:Cl("repo-push",60225),report:Cl("report",60226),requestChanges:Cl("request-changes",60227),rocket:Cl("rocket",60228),rootFolderOpened:Cl("root-folder-opened",60229),rootFolder:Cl("root-folder",60230),rss:Cl("rss",60231),ruby:Cl("ruby",60232),saveAll:Cl("save-all",60233),saveAs:Cl("save-as",60234),save:Cl("save",60235),screenFull:Cl("screen-full",60236),screenNormal:Cl("screen-normal",60237),searchStop:Cl("search-stop",60238),server:Cl("server",60240),settingsGear:Cl("settings-gear",60241),settings:Cl("settings",60242),shield:Cl("shield",60243),smiley:Cl("smiley",60244),sortPrecedence:Cl("sort-precedence",60245),splitHorizontal:Cl("split-horizontal",60246),splitVertical:Cl("split-vertical",60247),squirrel:Cl("squirrel",60248),starFull:Cl("star-full",60249),starHalf:Cl("star-half",60250),symbolClass:Cl("symbol-class",60251),symbolColor:Cl("symbol-color",60252),symbolCustomColor:Cl("symbol-customcolor",60252),symbolConstant:Cl("symbol-constant",60253),symbolEnumMember:Cl("symbol-enum-member",60254),symbolField:Cl("symbol-field",60255),symbolFile:Cl("symbol-file",60256),symbolInterface:Cl("symbol-interface",60257),symbolKeyword:Cl("symbol-keyword",60258),symbolMisc:Cl("symbol-misc",60259),symbolOperator:Cl("symbol-operator",60260),symbolProperty:Cl("symbol-property",60261),wrench:Cl("wrench",60261),wrenchSubaction:Cl("wrench-subaction",60261),symbolSnippet:Cl("symbol-snippet",60262),tasklist:Cl("tasklist",60263),telescope:Cl("telescope",60264),textSize:Cl("text-size",60265),threeBars:Cl("three-bars",60266),thumbsdown:Cl("thumbsdown",60267),thumbsup:Cl("thumbsup",60268),tools:Cl("tools",60269),triangleDown:Cl("triangle-down",60270),triangleLeft:Cl("triangle-left",60271),triangleRight:Cl("triangle-right",60272),triangleUp:Cl("triangle-up",60273),twitter:Cl("twitter",60274),unfold:Cl("unfold",60275),unlock:Cl("unlock",60276),unmute:Cl("unmute",60277),unverified:Cl("unverified",60278),verified:Cl("verified",60279),versions:Cl("versions",60280),vmActive:Cl("vm-active",60281),vmOutline:Cl("vm-outline",60282),vmRunning:Cl("vm-running",60283),watch:Cl("watch",60284),whitespace:Cl("whitespace",60285),wholeWord:Cl("whole-word",60286),window:Cl("window",60287),wordWrap:Cl("word-wrap",60288),zoomIn:Cl("zoom-in",60289),zoomOut:Cl("zoom-out",60290),listFilter:Cl("list-filter",60291),listFlat:Cl("list-flat",60292),listSelection:Cl("list-selection",60293),selection:Cl("selection",60293),listTree:Cl("list-tree",60294),debugBreakpointFunctionUnverified:Cl("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:Cl("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:Cl("debug-breakpoint-function-disabled",60296),debugStackframeActive:Cl("debug-stackframe-active",60297),circleSmallFilled:Cl("circle-small-filled",60298),debugStackframeDot:Cl("debug-stackframe-dot",60298),debugStackframe:Cl("debug-stackframe",60299),debugStackframeFocused:Cl("debug-stackframe-focused",60299),debugBreakpointUnsupported:Cl("debug-breakpoint-unsupported",60300),symbolString:Cl("symbol-string",60301),debugReverseContinue:Cl("debug-reverse-continue",60302),debugStepBack:Cl("debug-step-back",60303),debugRestartFrame:Cl("debug-restart-frame",60304),callIncoming:Cl("call-incoming",60306),callOutgoing:Cl("call-outgoing",60307),menu:Cl("menu",60308),expandAll:Cl("expand-all",60309),feedback:Cl("feedback",60310),gitPullRequestReviewer:Cl("git-pull-request-reviewer",60310),groupByRefType:Cl("group-by-ref-type",60311),ungroupByRefType:Cl("ungroup-by-ref-type",60312),account:Cl("account",60313),gitPullRequestAssignee:Cl("git-pull-request-assignee",60313),bellDot:Cl("bell-dot",60314),debugConsole:Cl("debug-console",60315),library:Cl("library",60316),output:Cl("output",60317),runAll:Cl("run-all",60318),syncIgnored:Cl("sync-ignored",60319),pinned:Cl("pinned",60320),githubInverted:Cl("github-inverted",60321),debugAlt:Cl("debug-alt",60305),serverProcess:Cl("server-process",60322),serverEnvironment:Cl("server-environment",60323),pass:Cl("pass",60324),stopCircle:Cl("stop-circle",60325),playCircle:Cl("play-circle",60326),record:Cl("record",60327),debugAltSmall:Cl("debug-alt-small",60328),vmConnect:Cl("vm-connect",60329),cloud:Cl("cloud",60330),merge:Cl("merge",60331),exportIcon:Cl("export",60332),graphLeft:Cl("graph-left",60333),magnet:Cl("magnet",60334),notebook:Cl("notebook",60335),redo:Cl("redo",60336),checkAll:Cl("check-all",60337),pinnedDirty:Cl("pinned-dirty",60338),passFilled:Cl("pass-filled",60339),circleLargeFilled:Cl("circle-large-filled",60340),circleLarge:Cl("circle-large",60341),circleLargeOutline:Cl("circle-large-outline",60341),combine:Cl("combine",60342),gather:Cl("gather",60342),table:Cl("table",60343),variableGroup:Cl("variable-group",60344),typeHierarchy:Cl("type-hierarchy",60345),typeHierarchySub:Cl("type-hierarchy-sub",60346),typeHierarchySuper:Cl("type-hierarchy-super",60347),gitPullRequestCreate:Cl("git-pull-request-create",60348),runAbove:Cl("run-above",60349),runBelow:Cl("run-below",60350),notebookTemplate:Cl("notebook-template",60351),debugRerun:Cl("debug-rerun",60352),workspaceTrusted:Cl("workspace-trusted",60353),workspaceUntrusted:Cl("workspace-untrusted",60354),workspaceUnspecified:Cl("workspace-unspecified",60355),terminalCmd:Cl("terminal-cmd",60356),terminalDebian:Cl("terminal-debian",60357),terminalLinux:Cl("terminal-linux",60358),terminalPowershell:Cl("terminal-powershell",60359),terminalTmux:Cl("terminal-tmux",60360),terminalUbuntu:Cl("terminal-ubuntu",60361),terminalBash:Cl("terminal-bash",60362),arrowSwap:Cl("arrow-swap",60363),copy:Cl("copy",60364),personAdd:Cl("person-add",60365),filterFilled:Cl("filter-filled",60366),wand:Cl("wand",60367),debugLineByLine:Cl("debug-line-by-line",60368),inspect:Cl("inspect",60369),layers:Cl("layers",60370),layersDot:Cl("layers-dot",60371),layersActive:Cl("layers-active",60372),compass:Cl("compass",60373),compassDot:Cl("compass-dot",60374),compassActive:Cl("compass-active",60375),azure:Cl("azure",60376),issueDraft:Cl("issue-draft",60377),gitPullRequestClosed:Cl("git-pull-request-closed",60378),gitPullRequestDraft:Cl("git-pull-request-draft",60379),debugAll:Cl("debug-all",60380),debugCoverage:Cl("debug-coverage",60381),runErrors:Cl("run-errors",60382),folderLibrary:Cl("folder-library",60383),debugContinueSmall:Cl("debug-continue-small",60384),beakerStop:Cl("beaker-stop",60385),graphLine:Cl("graph-line",60386),graphScatter:Cl("graph-scatter",60387),pieChart:Cl("pie-chart",60388),bracketDot:Cl("bracket-dot",60389),bracketError:Cl("bracket-error",60390),lockSmall:Cl("lock-small",60391),azureDevops:Cl("azure-devops",60392),verifiedFilled:Cl("verified-filled",60393),newLine:Cl("newline",60394),layout:Cl("layout",60395),layoutActivitybarLeft:Cl("layout-activitybar-left",60396),layoutActivitybarRight:Cl("layout-activitybar-right",60397),layoutPanelLeft:Cl("layout-panel-left",60398),layoutPanelCenter:Cl("layout-panel-center",60399),layoutPanelJustify:Cl("layout-panel-justify",60400),layoutPanelRight:Cl("layout-panel-right",60401),layoutPanel:Cl("layout-panel",60402),layoutSidebarLeft:Cl("layout-sidebar-left",60403),layoutSidebarRight:Cl("layout-sidebar-right",60404),layoutStatusbar:Cl("layout-statusbar",60405),layoutMenubar:Cl("layout-menubar",60406),layoutCentered:Cl("layout-centered",60407),layoutSidebarRightOff:Cl("layout-sidebar-right-off",60416),layoutPanelOff:Cl("layout-panel-off",60417),layoutSidebarLeftOff:Cl("layout-sidebar-left-off",60418),target:Cl("target",60408),indent:Cl("indent",60409),recordSmall:Cl("record-small",60410),errorSmall:Cl("error-small",60411),arrowCircleDown:Cl("arrow-circle-down",60412),arrowCircleLeft:Cl("arrow-circle-left",60413),arrowCircleRight:Cl("arrow-circle-right",60414),arrowCircleUp:Cl("arrow-circle-up",60415),heartFilled:Cl("heart-filled",60420),map:Cl("map",60421),mapFilled:Cl("map-filled",60422),circleSmall:Cl("circle-small",60423),bellSlash:Cl("bell-slash",60424),bellSlashDot:Cl("bell-slash-dot",60425),commentUnresolved:Cl("comment-unresolved",60426),gitPullRequestGoToChanges:Cl("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:Cl("git-pull-request-new-changes",60428),searchFuzzy:Cl("search-fuzzy",60429),commentDraft:Cl("comment-draft",60430),send:Cl("send",60431),sparkle:Cl("sparkle",60432),insert:Cl("insert",60433),mic:Cl("mic",60434),thumbsDownFilled:Cl("thumbsdown-filled",60435),thumbsUpFilled:Cl("thumbsup-filled",60436),coffee:Cl("coffee",60437),snake:Cl("snake",60438),game:Cl("game",60439),vr:Cl("vr",60440),chip:Cl("chip",60441),piano:Cl("piano",60442),music:Cl("music",60443),micFilled:Cl("mic-filled",60444),gitFetch:Cl("git-fetch",60445),copilot:Cl("copilot",60446),lightbulbSparkle:Cl("lightbulb-sparkle",60447),lightbulbSparkleAutofix:Cl("lightbulb-sparkle-autofix",60447),robot:Cl("robot",60448),sparkleFilled:Cl("sparkle-filled",60449),diffSingle:Cl("diff-single",60450),diffMultiple:Cl("diff-multiple",60451),dialogError:Cl("dialog-error","error"),dialogWarning:Cl("dialog-warning","warning"),dialogInfo:Cl("dialog-info","info"),dialogClose:Cl("dialog-close","close"),treeItemExpanded:Cl("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:Cl("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:Cl("tree-filter-on-type-off","list-selection"),treeFilterClear:Cl("tree-filter-clear","close"),treeItemLoading:Cl("tree-item-loading","loading"),menuSelection:Cl("menu-selection","check"),menuSubmenu:Cl("menu-submenu","chevron-right"),menuBarMore:Cl("menubar-more","more"),scrollbarButtonLeft:Cl("scrollbar-button-left","triangle-left"),scrollbarButtonRight:Cl("scrollbar-button-right","triangle-right"),scrollbarButtonUp:Cl("scrollbar-button-up","triangle-up"),scrollbarButtonDown:Cl("scrollbar-button-down","triangle-down"),toolBarMore:Cl("toolbar-more","more"),quickInputBack:Cl("quick-input-back","arrow-left")};var kl,Ll;!function(e){e.isThemeColor=function(e){return e&&"object"==typeof e&&"string"==typeof e.id}}(kl||(kl={})),function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9-]+",e.iconModifierExpression="~[A-Za-z]+",e.iconNameCharacter="[A-Za-z0-9~-]";const t=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function i(e){const n=t.exec(e.id);if(!n)return i(Sl.error);const[,o,s]=n,r=["codicon","codicon-"+o];return s&&r.push("codicon-modifier-"+s.substring(1)),r}e.asClassNameArray=i,e.asClassName=function(e){return i(e).join(" ")},e.asCSSSelector=function(e){return"."+i(e).join(".")},e.isThemeIcon=function(e){return e&&"object"==typeof e&&"string"==typeof e.id&&(void 0===e.color||kl.isThemeColor(e.color))};const n=new RegExp(`^\\$\\((${e.iconNameExpression}(?:${e.iconModifierExpression})?)\\)$`);e.fromString=function(e){const t=n.exec(e);if(!t)return;const[,i]=t;return{id:i}},e.fromId=function(e){return{id:e}},e.modify=function(e,t){let i=e.id;const n=i.lastIndexOf("~");return-1!==n&&(i=i.substring(0,n)),t&&(i=`${i}~${t}`),{id:i}},e.getModifier=function(e){const t=e.id.lastIndexOf("~");if(-1!==t)return e.id.substring(t+1)},e.isEqual=function(e,t){var i,n;return e.id===t.id&&(null===(i=e.color)||void 0===i?void 0:i.id)===(null===(n=t.color)||void 0===n?void 0:n.id)}}(Ll||(Ll={}));const xl=new RegExp(`\\$\\(${Ll.iconNameExpression}(?:${Ll.iconModifierExpression})?\\)`,"g"),Dl=new RegExp(`(\\\\)?${xl.source}`,"g"),El=new RegExp(`\\\\${xl.source}`,"g"),Nl=new RegExp(`(\\s)?(\\\\)?${xl.source}(\\s)?`,"g");function Il(e){return-1===e.indexOf("$(")?e:e.replace(Nl,((e,t,i,n)=>i?e:t||n||""))}const Ml=new RegExp(`\\$\\(${Ll.iconNameCharacter}+\\)`,"g");function Tl(e){Ml.lastIndex=0;let t="";const i=[];let n=0;for(;;){const o=Ml.lastIndex,s=Ml.exec(e),r=e.substring(o,null==s?void 0:s.index);if(r.length>0){t+=r;for(let e=0;e<r.length;e++)i.push(n)}if(!s)break;n+=s[0].length}return{text:t,iconOffsets:i}}function Al(e,t,i=!1){const{text:n,iconOffsets:o}=t;if(!o||0===o.length)return Ba(e,n,i);const s=un(n," "),r=n.length-s.length,a=Ba(e,s,i);if(a)for(const e of a){const t=o[e.start+r]+r;e.start+=t,e.end+=t}return a}function Rl(e){return 47===e||92===e}function Ol(e){return e.replace(/[\\/]/g,wo.sep)}function Pl(e,t=wo.sep){if(!e)return"";const i=e.length,n=e.charCodeAt(0);if(Rl(n)){if(Rl(e.charCodeAt(1))&&!Rl(e.charCodeAt(2))){let n=3;const o=n;for(;n<i&&!Rl(e.charCodeAt(n));n++);if(o!==n&&!Rl(e.charCodeAt(n+1)))for(n+=1;n<i;n++)if(Rl(e.charCodeAt(n)))return e.slice(0,n+1).replace(/[\\/]/g,t)}return t}if(Bl(n)&&58===e.charCodeAt(1))return Rl(e.charCodeAt(2))?e.slice(0,2)+t:e.slice(0,2);let o=e.indexOf("://");if(-1!==o)for(o+=3;o<i;o++)if(Rl(e.charCodeAt(o)))return e.slice(0,o+1);return""}function Fl(e,t,i,n=Do){if(e===t)return!0;if(!e||!t)return!1;if(t.length>e.length)return!1;if(i){if(!Dn(e,t))return!1;if(t.length===e.length)return!0;let i=t.length;return t.charAt(t.length-1)===n&&i--,e.charAt(i)===n}return t.charAt(t.length-1)!==n&&(t+=n),0===e.indexOf(t)}function Bl(e){return e>=65&&e<=90||e>=97&&e<=122}function Wl(e){return Vo(e,!0)}class Vl{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:bn(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t||!(!e||!t)&&this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===jo.file)return Fl(Wl(e),Wl(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(Ql(e.authority,t.authority))return Fl(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return Ro.joinPath(e,...t)}basenameOrAuthority(e){return Kl(e)||e.authority}basename(e){return wo.basename(e.path)}extname(e){return wo.extname(e.path)}dirname(e){if(0===e.path.length)return e;let t;return e.scheme===jo.file?t=Ro.file(ko(Wl(e))).path:(t=wo.dirname(e.path),e.authority&&t.length&&47!==t.charCodeAt(0)&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return t=e.scheme===jo.file?Ro.file(Co(Wl(e))).path:wo.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!Ql(e.authority,t.authority))return;if(e.scheme===jo.file){const i=So(Wl(e),Wl(t));return We?Ol(i):i}let i=e.path||"/";const n=t.path||"/";if(this._ignorePathCasing(e)){let e=0;for(const t=Math.min(i.length,n.length);e<t&&(i.charCodeAt(e)===n.charCodeAt(e)||i.charAt(e).toLowerCase()===n.charAt(e).toLowerCase());e++);i=n.substr(0,e)+i.substr(e)}return wo.relative(i,n)}resolvePath(e,t){if(e.scheme===jo.file){const i=Ro.file(yo(Wl(e),t));return e.with({authority:i.authority,path:i.path})}var i;return-1===(i=t).indexOf("/")&&(i=Ol(i)),/^[a-zA-Z]:(\/|$)/.test(i)&&(i="/"+i),t=i,e.with({path:wo.resolve(e.path,t)})}isAbsolutePath(e){return!!e.path&&"/"===e.path[0]}isEqualAuthority(e,t){return e===t||void 0!==e&&void 0!==t&&xn(e,t)}hasTrailingPathSeparator(e,t=Do){if(e.scheme===jo.file){const i=Wl(e);return i.length>Pl(i).length&&i[i.length-1]===t}{const t=e.path;return t.length>1&&47===t.charCodeAt(t.length-1)&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=Do){return Xl(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=Do){let i=!1;if(e.scheme===jo.file){const n=Wl(e);i=void 0!==n&&n.length===Pl(n).length&&n[n.length-1]===t}else{t="/";const n=e.path;i=1===n.length&&47===n.charCodeAt(n.length-1)}return i||Xl(e,t)?e:e.with({path:e.path+"/"})}}const zl=new Vl((()=>!1)),Hl=(new Vl((e=>e.scheme!==jo.file||!ze)),new Vl((e=>!0)),zl.isEqual.bind(zl)),Ul=(zl.isEqualOrParent.bind(zl),zl.getComparisonKey.bind(zl),zl.basenameOrAuthority.bind(zl)),Kl=zl.basename.bind(zl),jl=zl.extname.bind(zl),ql=zl.dirname.bind(zl),$l=zl.joinPath.bind(zl),Gl=zl.normalizePath.bind(zl),Zl=zl.relativePath.bind(zl),Yl=zl.resolvePath.bind(zl),Ql=(zl.isAbsolutePath.bind(zl),zl.isEqualAuthority.bind(zl)),Xl=zl.hasTrailingPathSeparator.bind(zl);var Jl;zl.removeTrailingPathSeparator.bind(zl),zl.addTrailingPathSeparator.bind(zl),function(e){e.META_DATA_LABEL="label",e.META_DATA_DESCRIPTION="description",e.META_DATA_SIZE="size",e.META_DATA_MIME="mime",e.parseMetaData=function(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach((e=>{const[t,n]=e.split(":");t&&n&&i.set(t,n)}));const n=t.path.substring(0,t.path.indexOf(";"));return n&&i.set(e.META_DATA_MIME,n),i}}(Jl||(Jl={}));class eh{constructor(e="",t=!1){var i,n,o;if(this.value=e,"string"!=typeof this.value)throw m("value");"boolean"==typeof t?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=null!==(i=t.isTrusted)&&void 0!==i?i:void 0,this.supportThemeIcons=null!==(n=t.supportThemeIcons)&&void 0!==n&&n,this.supportHtml=null!==(o=t.supportHtml)&&void 0!==o&&o)}appendText(e,t=0){var i;return this.value+=function(e){return e.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}(this.supportThemeIcons?(i=e,i.replace(Dl,((e,t)=>t?e:`\\${e}`))):e).replace(/([ \t]+)/g,((e,t)=>"&nbsp;".repeat(t.length))).replace(/\>/gm,"\\>").replace(/\n/g,1===t?"\\\n":"\n\n"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+="\n",this.value+=t,this.value+="\n```\n",this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(dn(t),"g");return e.replace(i,((t,i)=>"\\"!==e.charAt(i-1)?`\\${t}`:t))}}function th(e){return ih(e)?!e.value:!Array.isArray(e)||e.every(th)}function ih(e){return e instanceof eh||!(!e||"object"!=typeof e)&&!("string"!=typeof e.value||"boolean"!=typeof e.isTrusted&&"object"!=typeof e.isTrusted&&void 0!==e.isTrusted||"boolean"!=typeof e.supportThemeIcons&&void 0!==e.supportThemeIcons)}function nh(e){return e.replace(/"/g,"&quot;")}function oh(e){return e?e.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1"):e}var sh,rh=i(4055),ah={};ah.styleTagTransform=Vr(),ah.setAttributes=Pr(),ah.insert=Rr().bind(null,"head"),ah.domAPI=Tr(),ah.insertStyleElement=Br(),Ir()(rh.Z,ah),rh.Z&&rh.Z.locals&&rh.Z.locals,function(e){e.serviceIds=new Map,e.DI_TARGET="$di$target",e.DI_DEPENDENCIES="$di$dependencies",e.getServiceDependencies=function(t){return t[e.DI_DEPENDENCIES]||[]}}(sh||(sh={}));const lh=hh("instantiationService");function hh(e){if(sh.serviceIds.has(e))return sh.serviceIds.get(e);const t=function(e,i,n){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");!function(e,t,i){t[sh.DI_TARGET]===t?t[sh.DI_DEPENDENCIES].push({id:e,index:i}):(t[sh.DI_DEPENDENCIES]=[{id:e,index:i}],t[sh.DI_TARGET]=t)}(t,e,n)};return t.toString=()=>e,sh.serviceIds.set(e,t),t}const dh=hh("codeEditorService");class ch{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new ch(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return ch.equals(this,e)}static equals(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return ch.isBefore(this,e)}static isBefore(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<t.column}isBeforeOrEqual(e){return ch.isBeforeOrEqual(this,e)}static isBeforeOrEqual(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<=t.column}static compare(e,t){const i=0|e.lineNumber,n=0|t.lineNumber;return i===n?(0|e.column)-(0|t.column):i-n}clone(){return new ch(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(e){return new ch(e.lineNumber,e.column)}static isIPosition(e){return e&&"number"==typeof e.lineNumber&&"number"==typeof e.column}toJSON(){return{lineNumber:this.lineNumber,column:this.column}}}const uh=hh("modelService"),gh=hh("textModelService");class ph extends T{constructor(e,t="",i="",n=!0,o){super(),this._onDidChange=this._register(new q),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=n,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}async run(e,t){this._actionCallback&&await this._actionCallback(e)}}class mh extends T{constructor(){super(...arguments),this._onWillRun=this._register(new q),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new q),this.onDidRun=this._onDidRun.event}async run(e,t){if(!e.enabled)return;let i;this._onWillRun.fire({action:e});try{await this.runAction(e,t)}catch(e){i=e}this._onDidRun.fire({action:e,error:i})}async runAction(e,t){await e.run(t)}}class fh{constructor(){this.id=fh.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const i of e)i.length&&(t=t.length?[...t,new fh,...i]:i);return t}async run(){}}fh.ID="vs.actions.separator";class _h{get actions(){return this._actions}constructor(e,t,i,n){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=n,this._actions=i}async run(){}}class vh extends ph{constructor(){super(vh.ID,me(0,"(empty)"),void 0,!1)}}function bh(e){var t,i;return{id:e.id,label:e.label,class:e.class,enabled:null===(t=e.enabled)||void 0===t||t,checked:null!==(i=e.checked)&&void 0!==i&&i,run:async(...t)=>e.run(...t),tooltip:e.label}}vh.ID="vs.actions.empty";const wh=hh("commandService"),Ch=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new q,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,t){if(!e)throw new Error("invalid command");if("string"==typeof e){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t})}if(e.metadata&&Array.isArray(e.metadata.args)){const t=[];for(const i of e.metadata.args)t.push(i.constraint);const i=e.handler;e.handler=function(e,...n){return function(e,t){const i=Math.min(e.length,t.length);for(let n=0;n<i;n++)bl(e[n],t[n])}(n,t),i(e,...n)}}const{id:i}=e;let n=this._commands.get(i);n||(n=new B,this._commands.set(i,n));const o=n.unshift(e),s=I((()=>{o();const e=this._commands.get(i);(null==e?void 0:e.isEmpty())&&this._commands.delete(i)}));return this._onDidRegisterCommand.fire(i),s}registerCommandAlias(e,t){return Ch.registerCommand(e,((e,...i)=>e.get(wh).executeCommand(t,...i)))}getCommand(e){const t=this._commands.get(e);if(t&&!t.isEmpty())return C.first(t)}getCommands(){const e=new Map;for(const t of this._commands.keys()){const i=this.getCommand(t);i&&e.set(t,i)}return e}};function yh(...e){switch(e.length){case 1:return me(0,"Did you mean {0}?",e[0]);case 2:return me(0,"Did you mean {0} or {1}?",e[0],e[1]);case 3:return me(0,"Did you mean {0}, {1} or {2}?",e[0],e[1],e[2]);default:return}}Ch.registerCommand("noop",(()=>{}));const Sh=me(0,"Did you forget to open or close the quote?"),kh=me(0,"Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");class Lh{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:case 8:return">=";case 9:return"=~";case 10:case 17:case 18:case 19:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 20:return"EOF";default:throw f(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const e=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:e})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const e=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:e})}else this._match(126)?this._addToken(9):this._error(yh("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(yh("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(yh("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return!this._isAtEnd()&&this._input.charCodeAt(this._current)===e&&(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,i=this._input.substring(this._start,this._current),n={type:19,offset:this._start,lexeme:i};this._errors.push({offset:t,lexeme:i,additionalInfo:e}),this._tokens.push(n)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const t=this._input.substring(this._start,this._current),i=Lh._keywords.get(t);i?this._addToken(i):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;39!==this._peek()&&!this._isAtEnd();)this._advance();this._isAtEnd()?this._error(Sh):(this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1}))}_regex(){let e=this._current,t=!1,i=!1;for(;;){if(e>=this._input.length)return this._current=e,void this._error(kh);const n=this._input.charCodeAt(e);if(t)t=!1;else{if(47===n&&!i){e++;break}91===n?i=!0:92===n?t=!0:93===n&&(i=!1)}e++}for(;e<this._input.length&&Lh._regexFlags.has(this._input.charCodeAt(e));)e++;this._current=e;const n=this._input.substring(this._start,this._current);this._tokens.push({type:10,lexeme:n,offset:this._start})}_isAtEnd(){return this._current>=this._input.length}}Lh._regexFlags=new Set(["i","g","s","m","y","u"].map((e=>e.charCodeAt(0)))),Lh._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const xh=new Map;xh.set("false",!1),xh.set("true",!0),xh.set("isMac",Ve),xh.set("isLinux",ze),xh.set("isWindows",We),xh.set("isWeb",Ue),xh.set("isMacNative",Ve&&!Ue),xh.set("isEdge",ot),xh.set("isFirefox",it),xh.set("isChrome",tt),xh.set("isSafari",nt);const Dh=Object.prototype.hasOwnProperty,Eh={regexParsingWithErrorRecovery:!0},Nh=me(0,"Empty context key expression"),Ih=me(0,"Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),Mh=me(0,"'in' after 'not'."),Th=me(0,"closing parenthesis ')'"),Ah=me(0,"Unexpected token"),Rh=me(0,"Did you forget to put && or || before the token?"),Oh=me(0,"Unexpected end of expression"),Ph=me(0,"Did you forget to put a context key?");class Fh{constructor(e=Eh){this._config=e,this._scanner=new Lh,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(""!==e){this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const e=this._expr();if(!this._isAtEnd()){const e=this._peek(),t=17===e.type?Rh:void 0;throw this._parsingErrors.push({message:Ah,offset:e.offset,lexeme:Lh.getLexeme(e),additionalInfo:t}),Fh._parseError}return e}catch(e){if(e!==Fh._parseError)throw e;return}}else this._parsingErrors.push({message:Nh,offset:0,lexeme:"",additionalInfo:Ih})}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return 1===e.length?e[0]:Bh.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return 1===e.length?e[0]:Bh.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),Vh.INSTANCE;case 12:return this._advance(),zh.INSTANCE;case 0:{this._advance();const e=this._expr();return this._consume(1,Th),null==e?void 0:e.negate()}case 17:return this._advance(),$h.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),Bh.true();case 12:return this._advance(),Bh.false();case 0:{this._advance();const e=this._expr();return this._consume(1,Th),e}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const e=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),10!==e.type)throw this._errExpectedButGot("REGEX",e);const i=e.lexeme,n=i.lastIndexOf("/"),o=n===i.length-1?void 0:this._removeFlagsGY(i.substring(n+1));let s;try{s=new RegExp(i.substring(1,n),o)}catch(t){throw this._errExpectedButGot("REGEX",e)}return Jh.create(t,s)}switch(e.type){case 10:case 19:{const i=[e.lexeme];this._advance();let n=this._peek(),o=0;for(let t=0;t<e.lexeme.length;t++)40===e.lexeme.charCodeAt(t)?o++:41===e.lexeme.charCodeAt(t)&&o--;for(;!this._isAtEnd()&&15!==n.type&&16!==n.type;){switch(n.type){case 0:o++;break;case 1:o--;break;case 10:case 18:for(let t=0;t<n.lexeme.length;t++)40===n.lexeme.charCodeAt(t)?o++:41===e.lexeme.charCodeAt(t)&&o--}if(o<0)break;i.push(Lh.getLexeme(n)),this._advance(),n=this._peek()}const s=i.join(""),r=s.lastIndexOf("/"),a=r===s.length-1?void 0:this._removeFlagsGY(s.substring(r+1));let l;try{l=new RegExp(s.substring(1,r),a)}catch(t){throw this._errExpectedButGot("REGEX",e)}return Bh.regex(t,l)}case 18:{const i=e.lexeme;this._advance();let n=null;if(!rn(i)){const t=i.indexOf("/"),o=i.lastIndexOf("/");if(t!==o&&t>=0){const s=i.slice(t+1,o),r="i"===i[o+1]?"i":"";try{n=new RegExp(s,r)}catch(t){throw this._errExpectedButGot("REGEX",e)}}}if(null===n)throw this._errExpectedButGot("REGEX",e);return Jh.create(t,n)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,Mh);const e=this._value();return Bh.notIn(t,e)}switch(this._peek().type){case 3:{this._advance();const e=this._value();if(18===this._previous().type)return Bh.equals(t,e);switch(e){case"true":return Bh.has(t);case"false":return Bh.not(t);default:return Bh.equals(t,e)}}case 4:{this._advance();const e=this._value();if(18===this._previous().type)return Bh.notEquals(t,e);switch(e){case"true":return Bh.not(t);case"false":return Bh.has(t);default:return Bh.notEquals(t,e)}}case 5:return this._advance(),Qh.create(t,this._value());case 6:return this._advance(),Xh.create(t,this._value());case 7:return this._advance(),Zh.create(t,this._value());case 8:return this._advance(),Yh.create(t,this._value());case 13:return this._advance(),Bh.in(t,this._value());default:return Bh.has(t)}}case 20:throw this._parsingErrors.push({message:Oh,offset:e.offset,lexeme:"",additionalInfo:Ph}),Fh._parseError;default:throw this._errExpectedButGot("true | false | KEY \n\t| KEY '=~' REGEX \n\t| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value",this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return!!this._check(e)&&(this._advance(),!0)}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,i){const n=me(0,"Expected: {0}\nReceived: '{1}'.",e,Lh.getLexeme(t)),o=t.offset,s=Lh.getLexeme(t);return this._parsingErrors.push({message:n,offset:o,lexeme:s,additionalInfo:i}),Fh._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return 20===this._peek().type}}Fh._parseError=new Error;class Bh{static false(){return Vh.INSTANCE}static true(){return zh.INSTANCE}static has(e){return Hh.create(e)}static equals(e,t){return Uh.create(e,t)}static notEquals(e,t){return qh.create(e,t)}static regex(e,t){return Jh.create(e,t)}static in(e,t){return Kh.create(e,t)}static notIn(e,t){return jh.create(e,t)}static not(e){return $h.create(e)}static and(...e){return id.create(e,null,!0)}static or(...e){return nd.create(e,null,!0)}static deserialize(e){if(null!=e)return this._parser.parse(e)}}function Wh(e,t){return e.cmp(t)}Bh._parser=new Fh({regexParsingWithErrorRecovery:!1});class Vh{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return zh.INSTANCE}}Vh.INSTANCE=new Vh;class zh{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return Vh.INSTANCE}}zh.INSTANCE=new zh;class Hh{static create(e,t=null){const i=xh.get(e);return"boolean"==typeof i?i?zh.INSTANCE:Vh.INSTANCE:new Hh(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:rd(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=xh.get(this.key);return"boolean"==typeof e?e?zh.INSTANCE:Vh.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=$h.create(this.key,this)),this.negated}}class Uh{static create(e,t,i=null){if("boolean"==typeof t)return t?Hh.create(e,i):$h.create(e,i);const n=xh.get(e);return"boolean"==typeof n?t===(n?"true":"false")?zh.INSTANCE:Vh.INSTANCE:new Uh(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:ad(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){const e=xh.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?zh.INSTANCE:Vh.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=qh.create(this.key,this.value,this)),this.negated}}class Kh{static create(e,t){return new Kh(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:ad(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type&&this.key===e.key&&this.valueKey===e.valueKey}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):"string"==typeof i&&"object"==typeof t&&null!==t&&Dh.call(t,i)}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=jh.create(this.key,this.valueKey)),this.negated}}class jh{static create(e,t){return new jh(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=Kh.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type&&this._negated.equals(e._negated)}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class qh{static create(e,t,i=null){if("boolean"==typeof t)return t?$h.create(e,i):Hh.create(e,i);const n=xh.get(e);return"boolean"==typeof n?t===(n?"true":"false")?Vh.INSTANCE:zh.INSTANCE:new qh(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:ad(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){const e=xh.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?Vh.INSTANCE:zh.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Uh.create(this.key,this.value,this)),this.negated}}class $h{static create(e,t=null){const i=xh.get(e);return"boolean"==typeof i?i?Vh.INSTANCE:zh.INSTANCE:new $h(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:rd(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=xh.get(this.key);return"boolean"==typeof e?e?Vh.INSTANCE:zh.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Hh.create(this.key,this)),this.negated}}function Gh(e,t){if("string"==typeof e){const t=parseFloat(e);isNaN(t)||(e=t)}return"string"==typeof e||"number"==typeof e?t(e):Vh.INSTANCE}class Zh{static create(e,t,i=null){return Gh(t,(t=>new Zh(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:ad(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Xh.create(this.key,this.value,this)),this.negated}}class Yh{static create(e,t,i=null){return Gh(t,(t=>new Yh(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:ad(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Qh.create(this.key,this.value,this)),this.negated}}class Qh{static create(e,t,i=null){return Gh(t,(t=>new Qh(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:ad(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Yh.create(this.key,this.value,this)),this.negated}}class Xh{static create(e,t,i=null){return Gh(t,(t=>new Xh(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:ad(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Zh.create(this.key,this.value,this)),this.negated}}class Jh{static create(e,t){return new Jh(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.key<e.key)return-1;if(this.key>e.key)return 1;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return t<i?-1:t>i?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return!!this.regexp&&this.regexp.test(t)}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ed.create(this)),this.negated}}class ed{static create(e){return new ed(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type&&this._actual.equals(e._actual)}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function td(e){let t=null;for(let i=0,n=e.length;i<n;i++){const n=e[i].substituteConstants();if(e[i]!==n&&null===t){t=[];for(let n=0;n<i;n++)t[n]=e[n]}null!==t&&(t[i]=n)}return null===t?e:t}class id{static create(e,t,i){return id._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=6}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,i=this.expr.length;t<i;t++){const i=Wh(this.expr[t],e.expr[t]);if(0!==i)return i}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=td(this.expr);return e===this.expr?this:id.create(e,this.negated,!1)}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].evaluate(e))return!1;return!0}static _normalizeArr(e,t,i){const n=[];let o=!1;for(const t of e)if(t)if(1!==t.type){if(0===t.type)return Vh.INSTANCE;6!==t.type?n.push(t):n.push(...t.expr)}else o=!0;if(0===n.length&&o)return zh.INSTANCE;if(0!==n.length){if(1===n.length)return n[0];n.sort(Wh);for(let e=1;e<n.length;e++)n[e-1].equals(n[e])&&(n.splice(e,1),e--);if(1===n.length)return n[0];for(;n.length>1;){const e=n[n.length-1];if(9!==e.type)break;n.pop();const t=n.pop(),o=0===n.length,s=nd.create(e.expr.map((e=>id.create([e,t],null,i))),null,o);s&&(n.push(s),n.sort(Wh))}if(1===n.length)return n[0];if(i){for(let e=0;e<n.length;e++)for(let t=e+1;t<n.length;t++)if(n[e].negate().equals(n[t]))return Vh.INSTANCE;if(1===n.length)return n[0]}return new id(n,t)}}serialize(){return this.expr.map((e=>e.serialize())).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=nd.create(e,this,!0)}return this.negated}}class nd{static create(e,t,i){return nd._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,i=this.expr.length;t<i;t++){const i=Wh(this.expr[t],e.expr[t]);if(0!==i)return i}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=td(this.expr);return e===this.expr?this:nd.create(e,this.negated,!1)}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(this.expr[t].evaluate(e))return!0;return!1}static _normalizeArr(e,t,i){let n=[],o=!1;if(e){for(let t=0,i=e.length;t<i;t++){const i=e[t];if(i)if(0!==i.type){if(1===i.type)return zh.INSTANCE;9!==i.type?n.push(i):n=n.concat(i.expr)}else o=!0}if(0===n.length&&o)return Vh.INSTANCE;n.sort(Wh)}if(0!==n.length){if(1===n.length)return n[0];for(let e=1;e<n.length;e++)n[e-1].equals(n[e])&&(n.splice(e,1),e--);if(1===n.length)return n[0];if(i){for(let e=0;e<n.length;e++)for(let t=e+1;t<n.length;t++)if(n[e].negate().equals(n[t]))return zh.INSTANCE;if(1===n.length)return n[0]}return new nd(n,t)}}serialize(){return this.expr.map((e=>e.serialize())).join(" || ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),i=e.shift(),n=[];for(const e of dd(t))for(const t of dd(i))n.push(id.create([e,t],null,!1));e.unshift(nd.create(n,null,!1))}this.negated=nd.create(e,this,!0)}return this.negated}}class od extends Hh{static all(){return od._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,"object"==typeof i?od._info.push({...i,key:e}):!0!==i&&od._info.push({key:e,description:i,type:null!=t?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return Uh.create(this.key,e)}}od._info=[];const sd=hh("contextKeyService");function rd(e,t){return e<t?-1:e>t?1:0}function ad(e,t,i,n){return e<i?-1:e>i?1:t<n?-1:t>n?1:0}function ld(e,t){if(0===e.type||1===t.type)return!0;if(9===e.type)return 9===t.type&&hd(e.expr,t.expr);if(9===t.type){for(const i of t.expr)if(ld(e,i))return!0;return!1}if(6===e.type){if(6===t.type)return hd(t.expr,e.expr);for(const i of e.expr)if(ld(i,t))return!0;return!1}return e.equals(t)}function hd(e,t){let i=0,n=0;for(;i<e.length&&n<t.length;){const o=e[i].cmp(t[n]);if(o<0)return!1;0===o?(i++,n++):n++}return i===e.length}function dd(e){return 9===e.type?e.expr:[e]}function cd(e,t){if(!e)throw new Error(t?`Assertion failed (${t})`:"Assertion Failed")}function ud(e,t="Unreachable"){throw new Error(t)}function gd(e){e()||(e(),h(new b("Assertion Failed")))}function pd(e,t){let i=0;for(;i<e.length-1;){if(!t(e[i],e[i+1]))return!1;i++}return!0}const md=new class{constructor(){this.data=new Map}add(e,t){cd(al(e)),cd(ll(t)),cd(!this.data.has(e),"There is already an extension with this id"),this.data.set(e,t)}as(e){return this.data.get(e)||null}};class fd{constructor(){this._coreKeybindings=new B,this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(1===Qe){if(e&&e.win)return e.win}else if(2===Qe){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=fd.bindToCurrentPlatform(e),i=new M;if(t&&t.primary){const n=bt(t.primary,Qe);n&&i.add(this._registerDefaultKeybinding(n,e.id,e.args,e.weight,0,e.when))}if(t&&Array.isArray(t.secondary))for(let n=0,o=t.secondary.length;n<o;n++){const o=bt(t.secondary[n],Qe);o&&i.add(this._registerDefaultKeybinding(o,e.id,e.args,e.weight,-n-1,e.when))}return i}registerCommandAndKeybindingRule(e){return N(this.registerKeybindingRule(e),Ch.registerCommand(e))}_registerDefaultKeybinding(e,t,i,n,o,s){const r=this._coreKeybindings.push({keybinding:e,command:t,commandArgs:i,when:s,weight1:n,weight2:o,extensionId:null,isBuiltinExtension:!1});return this._cachedMergedKeybindings=null,I((()=>{r(),this._cachedMergedKeybindings=null}))}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(vd)),this._cachedMergedKeybindings.slice(0)}}const _d=new fd;function vd(e,t){if(e.weight1!==t.weight1)return e.weight1-t.weight1;if(e.command&&t.command){if(e.command<t.command)return-1;if(e.command>t.command)return 1}return e.weight2-t.weight2}md.add("platform.keybindingsRegistry",_d);var bd,wd=function(e,t){return function(i,n){t(i,n,e)}};function Cd(e){return void 0!==e.command}class yd{constructor(e){if(yd._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);yd._instances.set(e,this),this.id=e}}yd._instances=new Map,yd.CommandPalette=new yd("CommandPalette"),yd.DebugBreakpointsContext=new yd("DebugBreakpointsContext"),yd.DebugCallStackContext=new yd("DebugCallStackContext"),yd.DebugConsoleContext=new yd("DebugConsoleContext"),yd.DebugVariablesContext=new yd("DebugVariablesContext"),yd.DebugWatchContext=new yd("DebugWatchContext"),yd.DebugToolBar=new yd("DebugToolBar"),yd.DebugToolBarStop=new yd("DebugToolBarStop"),yd.EditorContext=new yd("EditorContext"),yd.SimpleEditorContext=new yd("SimpleEditorContext"),yd.EditorContent=new yd("EditorContent"),yd.EditorLineNumberContext=new yd("EditorLineNumberContext"),yd.EditorContextCopy=new yd("EditorContextCopy"),yd.EditorContextPeek=new yd("EditorContextPeek"),yd.EditorContextShare=new yd("EditorContextShare"),yd.EditorTitle=new yd("EditorTitle"),yd.EditorTitleRun=new yd("EditorTitleRun"),yd.EditorTitleContext=new yd("EditorTitleContext"),yd.EditorTitleContextShare=new yd("EditorTitleContextShare"),yd.EmptyEditorGroup=new yd("EmptyEditorGroup"),yd.EmptyEditorGroupContext=new yd("EmptyEditorGroupContext"),yd.EditorTabsBarContext=new yd("EditorTabsBarContext"),yd.EditorTabsBarShowTabsSubmenu=new yd("EditorTabsBarShowTabsSubmenu"),yd.EditorActionsPositionSubmenu=new yd("EditorActionsPositionSubmenu"),yd.ExplorerContext=new yd("ExplorerContext"),yd.ExplorerContextShare=new yd("ExplorerContextShare"),yd.ExtensionContext=new yd("ExtensionContext"),yd.GlobalActivity=new yd("GlobalActivity"),yd.CommandCenter=new yd("CommandCenter"),yd.CommandCenterCenter=new yd("CommandCenterCenter"),yd.LayoutControlMenuSubmenu=new yd("LayoutControlMenuSubmenu"),yd.LayoutControlMenu=new yd("LayoutControlMenu"),yd.MenubarMainMenu=new yd("MenubarMainMenu"),yd.MenubarAppearanceMenu=new yd("MenubarAppearanceMenu"),yd.MenubarDebugMenu=new yd("MenubarDebugMenu"),yd.MenubarEditMenu=new yd("MenubarEditMenu"),yd.MenubarCopy=new yd("MenubarCopy"),yd.MenubarFileMenu=new yd("MenubarFileMenu"),yd.MenubarGoMenu=new yd("MenubarGoMenu"),yd.MenubarHelpMenu=new yd("MenubarHelpMenu"),yd.MenubarLayoutMenu=new yd("MenubarLayoutMenu"),yd.MenubarNewBreakpointMenu=new yd("MenubarNewBreakpointMenu"),yd.PanelAlignmentMenu=new yd("PanelAlignmentMenu"),yd.PanelPositionMenu=new yd("PanelPositionMenu"),yd.ActivityBarPositionMenu=new yd("ActivityBarPositionMenu"),yd.MenubarPreferencesMenu=new yd("MenubarPreferencesMenu"),yd.MenubarRecentMenu=new yd("MenubarRecentMenu"),yd.MenubarSelectionMenu=new yd("MenubarSelectionMenu"),yd.MenubarShare=new yd("MenubarShare"),yd.MenubarSwitchEditorMenu=new yd("MenubarSwitchEditorMenu"),yd.MenubarSwitchGroupMenu=new yd("MenubarSwitchGroupMenu"),yd.MenubarTerminalMenu=new yd("MenubarTerminalMenu"),yd.MenubarViewMenu=new yd("MenubarViewMenu"),yd.MenubarHomeMenu=new yd("MenubarHomeMenu"),yd.OpenEditorsContext=new yd("OpenEditorsContext"),yd.OpenEditorsContextShare=new yd("OpenEditorsContextShare"),yd.ProblemsPanelContext=new yd("ProblemsPanelContext"),yd.SCMInputBox=new yd("SCMInputBox"),yd.SCMHistoryItem=new yd("SCMHistoryItem"),yd.SCMChangeContext=new yd("SCMChangeContext"),yd.SCMResourceContext=new yd("SCMResourceContext"),yd.SCMResourceContextShare=new yd("SCMResourceContextShare"),yd.SCMResourceFolderContext=new yd("SCMResourceFolderContext"),yd.SCMResourceGroupContext=new yd("SCMResourceGroupContext"),yd.SCMSourceControl=new yd("SCMSourceControl"),yd.SCMTitle=new yd("SCMTitle"),yd.SearchContext=new yd("SearchContext"),yd.SearchActionMenu=new yd("SearchActionContext"),yd.StatusBarWindowIndicatorMenu=new yd("StatusBarWindowIndicatorMenu"),yd.StatusBarRemoteIndicatorMenu=new yd("StatusBarRemoteIndicatorMenu"),yd.StickyScrollContext=new yd("StickyScrollContext"),yd.TestItem=new yd("TestItem"),yd.TestItemGutter=new yd("TestItemGutter"),yd.TestMessageContext=new yd("TestMessageContext"),yd.TestMessageContent=new yd("TestMessageContent"),yd.TestPeekElement=new yd("TestPeekElement"),yd.TestPeekTitle=new yd("TestPeekTitle"),yd.TouchBarContext=new yd("TouchBarContext"),yd.TitleBarContext=new yd("TitleBarContext"),yd.TitleBarTitleContext=new yd("TitleBarTitleContext"),yd.TunnelContext=new yd("TunnelContext"),yd.TunnelPrivacy=new yd("TunnelPrivacy"),yd.TunnelProtocol=new yd("TunnelProtocol"),yd.TunnelPortInline=new yd("TunnelInline"),yd.TunnelTitle=new yd("TunnelTitle"),yd.TunnelLocalAddressInline=new yd("TunnelLocalAddressInline"),yd.TunnelOriginInline=new yd("TunnelOriginInline"),yd.ViewItemContext=new yd("ViewItemContext"),yd.ViewContainerTitle=new yd("ViewContainerTitle"),yd.ViewContainerTitleContext=new yd("ViewContainerTitleContext"),yd.ViewTitle=new yd("ViewTitle"),yd.ViewTitleContext=new yd("ViewTitleContext"),yd.CommentEditorActions=new yd("CommentEditorActions"),yd.CommentThreadTitle=new yd("CommentThreadTitle"),yd.CommentThreadActions=new yd("CommentThreadActions"),yd.CommentThreadAdditionalActions=new yd("CommentThreadAdditionalActions"),yd.CommentThreadTitleContext=new yd("CommentThreadTitleContext"),yd.CommentThreadCommentContext=new yd("CommentThreadCommentContext"),yd.CommentTitle=new yd("CommentTitle"),yd.CommentActions=new yd("CommentActions"),yd.InteractiveToolbar=new yd("InteractiveToolbar"),yd.InteractiveCellTitle=new yd("InteractiveCellTitle"),yd.InteractiveCellDelete=new yd("InteractiveCellDelete"),yd.InteractiveCellExecute=new yd("InteractiveCellExecute"),yd.InteractiveInputExecute=new yd("InteractiveInputExecute"),yd.NotebookToolbar=new yd("NotebookToolbar"),yd.NotebookStickyScrollContext=new yd("NotebookStickyScrollContext"),yd.NotebookCellTitle=new yd("NotebookCellTitle"),yd.NotebookCellDelete=new yd("NotebookCellDelete"),yd.NotebookCellInsert=new yd("NotebookCellInsert"),yd.NotebookCellBetween=new yd("NotebookCellBetween"),yd.NotebookCellListTop=new yd("NotebookCellTop"),yd.NotebookCellExecute=new yd("NotebookCellExecute"),yd.NotebookCellExecutePrimary=new yd("NotebookCellExecutePrimary"),yd.NotebookDiffCellInputTitle=new yd("NotebookDiffCellInputTitle"),yd.NotebookDiffCellMetadataTitle=new yd("NotebookDiffCellMetadataTitle"),yd.NotebookDiffCellOutputsTitle=new yd("NotebookDiffCellOutputsTitle"),yd.NotebookOutputToolbar=new yd("NotebookOutputToolbar"),yd.NotebookEditorLayoutConfigure=new yd("NotebookEditorLayoutConfigure"),yd.NotebookKernelSource=new yd("NotebookKernelSource"),yd.BulkEditTitle=new yd("BulkEditTitle"),yd.BulkEditContext=new yd("BulkEditContext"),yd.TimelineItemContext=new yd("TimelineItemContext"),yd.TimelineTitle=new yd("TimelineTitle"),yd.TimelineTitleContext=new yd("TimelineTitleContext"),yd.TimelineFilterSubMenu=new yd("TimelineFilterSubMenu"),yd.AccountsContext=new yd("AccountsContext"),yd.SidebarTitle=new yd("SidebarTitle"),yd.PanelTitle=new yd("PanelTitle"),yd.AuxiliaryBarTitle=new yd("AuxiliaryBarTitle"),yd.TerminalInstanceContext=new yd("TerminalInstanceContext"),yd.TerminalEditorInstanceContext=new yd("TerminalEditorInstanceContext"),yd.TerminalNewDropdownContext=new yd("TerminalNewDropdownContext"),yd.TerminalTabContext=new yd("TerminalTabContext"),yd.TerminalTabEmptyAreaContext=new yd("TerminalTabEmptyAreaContext"),yd.TerminalStickyScrollContext=new yd("TerminalStickyScrollContext"),yd.WebviewContext=new yd("WebviewContext"),yd.InlineCompletionsActions=new yd("InlineCompletionsActions"),yd.NewFile=new yd("NewFile"),yd.MergeInput1Toolbar=new yd("MergeToolbar1Toolbar"),yd.MergeInput2Toolbar=new yd("MergeToolbar2Toolbar"),yd.MergeBaseToolbar=new yd("MergeBaseToolbar"),yd.MergeInputResultToolbar=new yd("MergeToolbarResultToolbar"),yd.InlineSuggestionToolbar=new yd("InlineSuggestionToolbar"),yd.ChatContext=new yd("ChatContext"),yd.ChatCodeBlock=new yd("ChatCodeblock"),yd.ChatMessageTitle=new yd("ChatMessageTitle"),yd.ChatExecute=new yd("ChatExecute"),yd.ChatInputSide=new yd("ChatInputSide"),yd.AccessibleView=new yd("AccessibleView"),yd.MultiDiffEditorFileToolbar=new yd("MultiDiffEditorFileToolbar");const Sd=hh("menuService");class kd{static for(e){let t=this._all.get(e);return t||(t=new kd(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof kd&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}}kd._all=new Map;const Ld=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Y({merge:kd.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(e){return this._commands.set(e.id,e),this._onDidChangeMenu.fire(kd.for(yd.CommandPalette)),I((()=>{this._commands.delete(e.id)&&this._onDidChangeMenu.fire(kd.for(yd.CommandPalette))}))}getCommand(e){return this._commands.get(e)}getCommands(){const e=new Map;return this._commands.forEach(((t,i)=>e.set(i,t))),e}appendMenuItem(e,t){let i=this._menuItems.get(e);i||(i=new B,this._menuItems.set(e,i));const n=i.push(t);return this._onDidChangeMenu.fire(kd.for(e)),I((()=>{n(),this._onDidChangeMenu.fire(kd.for(e))}))}appendMenuItems(e){const t=new M;for(const{id:i,item:n}of e)t.add(this.appendMenuItem(i,n));return t}getMenuItems(e){let t;return t=this._menuItems.has(e)?[...this._menuItems.get(e)]:[],e===yd.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(e){const t=new Set;for(const i of e)Cd(i)&&(t.add(i.command.id),i.alt&&t.add(i.alt.id));this._commands.forEach(((i,n)=>{t.has(n)||e.push({command:i})}))}};class xd extends _h{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,"string"==typeof e.title?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let Dd=bd=class{static label(e,t){return(null==t?void 0:t.renderShortTitle)&&e.shortTitle?"string"==typeof e.shortTitle?e.shortTitle:e.shortTitle.value:"string"==typeof e.title?e.title:e.title.value}constructor(e,t,i,n,o,s){var r,a;let l;if(this.hideActions=n,this._commandService=s,this.id=e.id,this.label=bd.label(e,i),this.tooltip=null!==(a="string"==typeof e.tooltip?e.tooltip:null===(r=e.tooltip)||void 0===r?void 0:r.value)&&void 0!==a?a:"",this.enabled=!e.precondition||o.contextMatchesRules(e.precondition),this.checked=void 0,e.toggled){const t=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=o.contextMatchesRules(t.condition),this.checked&&t.tooltip&&(this.tooltip="string"==typeof t.tooltip?t.tooltip:t.tooltip.value),this.checked&&Ll.isThemeIcon(t.icon)&&(l=t.icon),this.checked&&t.title&&(this.label="string"==typeof t.title?t.title:t.title.value)}l||(l=Ll.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new bd(t,void 0,i,n,o,s):void 0,this._options=i,this.class=l&&Ll.asClassName(l)}run(...e){var t,i;let n=[];return(null===(t=this._options)||void 0===t?void 0:t.arg)&&(n=[...n,this._options.arg]),(null===(i=this._options)||void 0===i?void 0:i.shouldForwardArgs)&&(n=[...n,...e]),this._commandService.executeCommand(this.id,...n)}};Dd=bd=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([wd(4,sd),wd(5,wh)],Dd);class Ed{constructor(e){this.desc=e}}function Nd(e){const t=new M,i=new e,{f1:n,menu:o,keybinding:s,...r}=i.desc;if(t.add(Ch.registerCommand({id:r.id,handler:(e,...t)=>i.run(e,...t),metadata:r.metadata})),Array.isArray(o))for(const e of o)t.add(Ld.appendMenuItem(e.id,{command:{...r,precondition:null===e.precondition?void 0:r.precondition},...e}));else o&&t.add(Ld.appendMenuItem(o.id,{command:{...r,precondition:null===o.precondition?void 0:r.precondition},...o}));if(n&&(t.add(Ld.appendMenuItem(yd.CommandPalette,{command:r,when:r.precondition})),t.add(Ld.addCommand(r))),Array.isArray(s))for(const e of s)t.add(_d.registerKeybindingRule({...e,id:r.id,when:r.precondition?Bh.and(r.precondition,e.when):e.when}));else s&&t.add(_d.registerKeybindingRule({...s,id:r.id,when:r.precondition?Bh.and(r.precondition,s.when):s.when}));return t}const Id=hh("telemetryService"),Md=hh("logService");var Td;!function(e){e[e.Off=0]="Off",e[e.Trace=1]="Trace",e[e.Debug=2]="Debug",e[e.Info=3]="Info",e[e.Warning=4]="Warning",e[e.Error=5]="Error"}(Td||(Td={}));const Ad=Td.Info;class Rd extends T{constructor(){super(...arguments),this.level=Ad,this._onDidChangeLogLevel=this._register(new q),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==Td.Off&&this.level<=e}}class Od extends Rd{constructor(e=Ad,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(Td.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(Td.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(Td.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(Td.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(Td.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}dispose(){}}class Pd extends Rd{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const i of this.loggers)i.trace(e,...t)}debug(e,...t){for(const i of this.loggers)i.debug(e,...t)}info(e,...t){for(const i of this.loggers)i.info(e,...t)}warn(e,...t){for(const i of this.loggers)i.warn(e,...t)}error(e,...t){for(const i of this.loggers)i.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose()}}new od("logLevel",function(e){switch(e){case Td.Trace:return"trace";case Td.Debug:return"debug";case Td.Info:return"info";case Td.Warning:return"warn";case Td.Error:return"error";case Td.Off:return"off"}}(Td.Info));class Fd{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this.metadata=e.metadata}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let e=t.kbExpr;this.precondition&&(e=e?Bh.and(e,this.precondition):this.precondition);const i={id:this.id,weight:t.weight,args:t.args,when:e,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};_d.registerKeybindingRule(i)}}Ch.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata})}_registerMenuItem(e){Ld.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}}class Bd extends Fd{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,n){return this._implementations.push({priority:e,name:t,implementation:i,when:n}),this._implementations.sort(((e,t)=>t.priority-e.priority)),{dispose:()=>{for(let e=0;e<this._implementations.length;e++)if(this._implementations[e].implementation===i)return void this._implementations.splice(e,1)}}}runCommand(e,t){const i=e.get(Md),n=e.get(sd);i.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);for(const o of this._implementations){if(o.when){const e=n.getContext(Us());if(!o.when.evaluate(e))continue}const s=o.implementation(e,t);if(s){if(i.trace(`Command '${this.id}' was handled by '${o.name}'.`),"boolean"==typeof s)return;return s}}i.trace(`The Command '${this.id}' was not handled by any implementation.`)}}class Wd extends Fd{constructor(e,t){super(t),this.command=e}runCommand(e,t){return this.command.runCommand(e,t)}}class Vd extends Fd{static bindToContribution(e){return class extends Vd{constructor(e){super(e),this._callback=e.handler}runEditorCommand(t,i,n){const o=e(i);o&&this._callback(o,n)}}}static runEditorCommand(e,t,i,n){const o=e.get(dh),s=o.getFocusedCodeEditor()||o.getActiveCodeEditor();if(s)return s.invokeWithinContext((e=>{if(e.get(sd).contextMatchesRules(null!=i?i:void 0))return n(e,s,t)}))}runCommand(e,t){return Vd.runEditorCommand(e,t,this.precondition,((e,t,i)=>this.runEditorCommand(e,t,i)))}}class zd extends Vd{static convertOptions(e){let t;function i(t){return t.menuId||(t.menuId=yd.EditorContext),t.title||(t.title=e.label),t.when=Bh.and(e.precondition,t.when),t}return t=Array.isArray(e.menuOpts)?e.menuOpts:e.menuOpts?[e.menuOpts]:[],Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(zd.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(Id).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class Hd extends zd{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort(((e,t)=>t[0]-e[0])),{dispose:()=>{for(let e=0;e<this._implementations.length;e++)if(this._implementations[e][1]===t)return void this._implementations.splice(e,1)}}}run(e,t,i){for(const n of this._implementations){const o=n[1](e,t,i);if(o){if("boolean"==typeof o)return;return o}}}}class Ud extends Ed{run(e,...t){const i=e.get(dh),n=i.getFocusedCodeEditor()||i.getActiveCodeEditor();if(n)return n.invokeWithinContext((e=>{var i,o;const s=e.get(sd),r=e.get(Md);if(s.contextMatchesRules(null!==(i=this.desc.precondition)&&void 0!==i?i:void 0))return this.runEditorCommand(e,n,...t);r.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,null===(o=this.desc.precondition)||void 0===o?void 0:o.serialize())}))}}function Kd(e,t){Ch.registerCommand(e,(function(e,...i){const n=e.get(lh),[o,s]=i;fl(Ro.isUri(o)),fl(ch.isIPosition(s));const r=e.get(uh).getModel(o);if(r){const e=ch.lift(s);return n.invokeFunction(t,r,e,...i.slice(2))}return e.get(gh).createModelReference(o).then((e=>new Promise(((o,r)=>{try{o(n.invokeFunction(t,e.object.textEditorModel,ch.lift(s),i.slice(2)))}catch(e){r(e)}})).finally((()=>{e.dispose()}))))}))}function jd(e){return Yd.INSTANCE.registerEditorCommand(e),e}function qd(e){const t=new e;return Yd.INSTANCE.registerEditorAction(t),t}function $d(e){return Yd.INSTANCE.registerEditorAction(e),e}function Gd(e,t,i){Yd.INSTANCE.registerEditorContribution(e,t,i)}var Zd;!function(e){e.getEditorCommand=function(e){return Yd.INSTANCE.getEditorCommand(e)},e.getEditorActions=function(){return Yd.INSTANCE.getEditorActions()},e.getEditorContributions=function(){return Yd.INSTANCE.getEditorContributions()},e.getSomeEditorContributions=function(e){return Yd.INSTANCE.getEditorContributions().filter((t=>e.indexOf(t.id)>=0))},e.getDiffEditorContributions=function(){return Yd.INSTANCE.getDiffEditorContributions()}}(Zd||(Zd={}));class Yd{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}function Qd(e){return e.register(),e}Yd.INSTANCE=new Yd,md.add("editor.contributions",Yd.INSTANCE);const Xd=Qd(new Bd({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:yd.MenubarEditMenu,group:"1_do",title:me(0,"&&Undo"),order:1},{menuId:yd.CommandPalette,group:"",title:me(0,"Undo"),order:1}]}));Qd(new Wd(Xd,{id:"default:undo",precondition:void 0}));const Jd=Qd(new Bd({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:yd.MenubarEditMenu,group:"1_do",title:me(0,"&&Redo"),order:2},{menuId:yd.CommandPalette,group:"",title:me(0,"Redo"),order:1}]}));Qd(new Wd(Jd,{id:"default:redo",precondition:void 0}));const ec=Qd(new Bd({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:yd.MenubarSelectionMenu,group:"1_basic",title:me(0,"&&Select All"),order:1},{menuId:yd.CommandPalette,group:"",title:me(0,"Select All"),order:1}]}));class tc{constructor(e,t,i,n){e>i||e===i&&t>n?(this.startLineNumber=i,this.startColumn=n,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=n)}isEmpty(){return tc.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return tc.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<e.startColumn||t.lineNumber===e.endLineNumber&&t.column>e.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return tc.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>e.endColumn)}strictContainsRange(e){return tc.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return tc.plusRange(this,e)}static plusRange(e,t){let i,n,o,s;return t.startLineNumber<e.startLineNumber?(i=t.startLineNumber,n=t.startColumn):t.startLineNumber===e.startLineNumber?(i=t.startLineNumber,n=Math.min(t.startColumn,e.startColumn)):(i=e.startLineNumber,n=e.startColumn),t.endLineNumber>e.endLineNumber?(o=t.endLineNumber,s=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,s=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,s=e.endColumn),new tc(i,n,o,s)}intersectRanges(e){return tc.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn;const r=t.startLineNumber,a=t.startColumn,l=t.endLineNumber,h=t.endColumn;return i<r?(i=r,n=a):i===r&&(n=Math.max(n,a)),o>l?(o=l,s=h):o===l&&(s=Math.min(s,h)),i>o||i===o&&n>s?null:new tc(i,n,o,s)}equalsRange(e){return tc.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t||!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return tc.getEndPosition(this)}static getEndPosition(e){return new ch(e.endLineNumber,e.endColumn)}getStartPosition(){return tc.getStartPosition(this)}static getStartPosition(e){return new ch(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new tc(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new tc(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return tc.collapseToStart(this)}static collapseToStart(e){return new tc(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return tc.collapseToEnd(this)}static collapseToEnd(e){return new tc(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new tc(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new tc(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new tc(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&"number"==typeof e.startLineNumber&&"number"==typeof e.startColumn&&"number"==typeof e.endLineNumber&&"number"==typeof e.endColumn}static areIntersectingOrTouching(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn)}static areIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<=t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<=e.startColumn)}static compareRangesUsingStarts(e,t){if(e&&t){const i=0|e.startLineNumber,n=0|t.startLineNumber;if(i===n){const i=0|e.startColumn,n=0|t.startColumn;if(i===n){const i=0|e.endLineNumber,n=0|t.endLineNumber;return i===n?(0|e.endColumn)-(0|t.endColumn):i-n}return i-n}return i-n}return(e?1:0)-(t?1:0)}static compareRangesUsingEnds(e,t){return e.endLineNumber===t.endLineNumber?e.endColumn===t.endColumn?e.startLineNumber===t.startLineNumber?e.startColumn-t.startColumn:e.startLineNumber-t.startLineNumber:e.endColumn-t.endColumn:e.endLineNumber-t.endLineNumber}static spansMultipleLines(e){return e.endLineNumber>e.startLineNumber}toJSON(){return this}}class ic extends tc{constructor(e,t,i,n){super(e,t,i,n),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=n}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return ic.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return 0===this.getDirection()?new ic(this.startLineNumber,this.startColumn,e,t):new ic(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new ch(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new ch(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return 0===this.getDirection()?new ic(e,t,this.endLineNumber,this.endColumn):new ic(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new ic(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return 0===t?new ic(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new ic(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new ic(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,n=e.length;i<n;i++)if(!this.selectionsEqual(e[i],t[i]))return!1;return!0}static isISelection(e){return e&&"number"==typeof e.selectionStartLineNumber&&"number"==typeof e.selectionStartColumn&&"number"==typeof e.positionLineNumber&&"number"==typeof e.positionColumn}static createWithDirection(e,t,i,n,o){return 0===o?new ic(e,t,i,n):new ic(i,n,e,t)}}var nc;!function(e){e.editorSimpleInput=new od("editorSimpleInput",!1,!0),e.editorTextFocus=new od("editorTextFocus",!1,me(0,"Whether the editor text has focus (cursor is blinking)")),e.focus=new od("editorFocus",!1,me(0,"Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),e.textInputFocus=new od("textInputFocus",!1,me(0,"Whether an editor or a rich text input has focus (cursor is blinking)")),e.readOnly=new od("editorReadonly",!1,me(0,"Whether the editor is read-only")),e.inDiffEditor=new od("inDiffEditor",!1,me(0,"Whether the context is a diff editor")),e.isEmbeddedDiffEditor=new od("isEmbeddedDiffEditor",!1,me(0,"Whether the context is an embedded diff editor")),e.inMultiDiffEditor=new od("inMultiDiffEditor",!1,me(0,"Whether the context is a multi diff editor")),e.multiDiffEditorAllCollapsed=new od("multiDiffEditorAllCollapsed",void 0,me(0,"Whether all files in multi diff editor are collapsed")),e.hasChanges=new od("diffEditorHasChanges",!1,me(0,"Whether the diff editor has changes")),e.comparingMovedCode=new od("comparingMovedCode",!1,me(0,"Whether a moved code block is selected for comparison")),e.accessibleDiffViewerVisible=new od("accessibleDiffViewerVisible",!1,me(0,"Whether the accessible diff viewer is visible")),e.diffEditorRenderSideBySideInlineBreakpointReached=new od("diffEditorRenderSideBySideInlineBreakpointReached",!1,me(0,"Whether the diff editor render side by side inline breakpoint is reached")),e.columnSelection=new od("editorColumnSelection",!1,me(0,"Whether `editor.columnSelection` is enabled")),e.writable=e.readOnly.toNegated(),e.hasNonEmptySelection=new od("editorHasSelection",!1,me(0,"Whether the editor has text selected")),e.hasOnlyEmptySelection=e.hasNonEmptySelection.toNegated(),e.hasMultipleSelections=new od("editorHasMultipleSelections",!1,me(0,"Whether the editor has multiple selections")),e.hasSingleSelection=e.hasMultipleSelections.toNegated(),e.tabMovesFocus=new od("editorTabMovesFocus",!1,me(0,"Whether `Tab` will move focus out of the editor")),e.tabDoesNotMoveFocus=e.tabMovesFocus.toNegated(),e.isInWalkThroughSnippet=new od("isInEmbeddedEditor",!1,!0),e.canUndo=new od("canUndo",!1,!0),e.canRedo=new od("canRedo",!1,!0),e.hoverVisible=new od("editorHoverVisible",!1,me(0,"Whether the editor hover is visible")),e.hoverFocused=new od("editorHoverFocused",!1,me(0,"Whether the editor hover is focused")),e.stickyScrollFocused=new od("stickyScrollFocused",!1,me(0,"Whether the sticky scroll is focused")),e.stickyScrollVisible=new od("stickyScrollVisible",!1,me(0,"Whether the sticky scroll is visible")),e.standaloneColorPickerVisible=new od("standaloneColorPickerVisible",!1,me(0,"Whether the standalone color picker is visible")),e.standaloneColorPickerFocused=new od("standaloneColorPickerFocused",!1,me(0,"Whether the standalone color picker is focused")),e.inCompositeEditor=new od("inCompositeEditor",void 0,me(0,"Whether the editor is part of a larger editor (e.g. notebooks)")),e.notInCompositeEditor=e.inCompositeEditor.toNegated(),e.languageId=new od("editorLangId","",me(0,"The language identifier of the editor")),e.hasCompletionItemProvider=new od("editorHasCompletionItemProvider",!1,me(0,"Whether the editor has a completion item provider")),e.hasCodeActionsProvider=new od("editorHasCodeActionsProvider",!1,me(0,"Whether the editor has a code actions provider")),e.hasCodeLensProvider=new od("editorHasCodeLensProvider",!1,me(0,"Whether the editor has a code lens provider")),e.hasDefinitionProvider=new od("editorHasDefinitionProvider",!1,me(0,"Whether the editor has a definition provider")),e.hasDeclarationProvider=new od("editorHasDeclarationProvider",!1,me(0,"Whether the editor has a declaration provider")),e.hasImplementationProvider=new od("editorHasImplementationProvider",!1,me(0,"Whether the editor has an implementation provider")),e.hasTypeDefinitionProvider=new od("editorHasTypeDefinitionProvider",!1,me(0,"Whether the editor has a type definition provider")),e.hasHoverProvider=new od("editorHasHoverProvider",!1,me(0,"Whether the editor has a hover provider")),e.hasDocumentHighlightProvider=new od("editorHasDocumentHighlightProvider",!1,me(0,"Whether the editor has a document highlight provider")),e.hasDocumentSymbolProvider=new od("editorHasDocumentSymbolProvider",!1,me(0,"Whether the editor has a document symbol provider")),e.hasReferenceProvider=new od("editorHasReferenceProvider",!1,me(0,"Whether the editor has a reference provider")),e.hasRenameProvider=new od("editorHasRenameProvider",!1,me(0,"Whether the editor has a rename provider")),e.hasSignatureHelpProvider=new od("editorHasSignatureHelpProvider",!1,me(0,"Whether the editor has a signature help provider")),e.hasInlayHintsProvider=new od("editorHasInlayHintsProvider",!1,me(0,"Whether the editor has an inline hints provider")),e.hasDocumentFormattingProvider=new od("editorHasDocumentFormattingProvider",!1,me(0,"Whether the editor has a document formatting provider")),e.hasDocumentSelectionFormattingProvider=new od("editorHasDocumentSelectionFormattingProvider",!1,me(0,"Whether the editor has a document selection formatting provider")),e.hasMultipleDocumentFormattingProvider=new od("editorHasMultipleDocumentFormattingProvider",!1,me(0,"Whether the editor has multiple document formatting providers")),e.hasMultipleDocumentSelectionFormattingProvider=new od("editorHasMultipleDocumentSelectionFormattingProvider",!1,me(0,"Whether the editor has multiple document selection formatting providers"))}(nc||(nc={}));var oc;const sc=new od("selectionAnchorSet",!1);let rc=oc=class{static get(e){return e.getContribution(oc.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=sc.bindTo(t),this.modelChangeListener=e.onDidChangeModel((()=>this.selectionAnchorSetContextKey.reset()))}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations((t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(ic.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:(new eh).appendText(me(0,"Selection Anchor")),className:"selection-anchor"})})),this.selectionAnchorSetContextKey.set(!!this.decorationId),Zr(me(0,"Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(ic.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations((t=>{t.removeDecoration(e),this.decorationId=void 0})),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};var ac,lc;rc.ID="editor.contrib.selectionAnchorController",rc=oc=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([(ac=1,lc=sd,function(e,t){lc(e,t,ac)})],rc),Gd(rc.ID,rc,4),qd(class extends zd{constructor(){super({id:"editor.action.setSelectionAnchor",label:me(0,"Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:nc.editorTextFocus,primary:vt(2089,2080),weight:100}})}async run(e,t){var i;null===(i=rc.get(t))||void 0===i||i.setSelectionAnchor()}}),qd(class extends zd{constructor(){super({id:"editor.action.goToSelectionAnchor",label:me(0,"Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:sc})}async run(e,t){var i;null===(i=rc.get(t))||void 0===i||i.goToSelectionAnchor()}}),qd(class extends zd{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:me(0,"Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:sc,kbOpts:{kbExpr:nc.editorTextFocus,primary:vt(2089,2089),weight:100}})}async run(e,t){var i;null===(i=rc.get(t))||void 0===i||i.selectFromAnchorToCursor()}}),qd(class extends zd{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:me(0,"Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:sc,kbOpts:{kbExpr:nc.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;null===(i=rc.get(t))||void 0===i||i.cancelSelectionAnchor()}});var hc=i(2205),dc={};function cc(e){if(!e||"object"!=typeof e)return e;if(e instanceof RegExp)return e;const t=Array.isArray(e)?[]:{};return Object.entries(e).forEach((([e,i])=>{t[e]=i&&"object"==typeof i?cc(i):i})),t}dc.styleTagTransform=Vr(),dc.setAttributes=Pr(),dc.insert=Rr().bind(null,"head"),dc.domAPI=Tr(),dc.insertStyleElement=Br(),Ir()(hc.Z,dc),hc.Z&&hc.Z.locals&&hc.Z.locals;const uc=Object.prototype.hasOwnProperty;function gc(e,t){return pc(e,t,new Set)}function pc(e,t,i){if(ml(e))return e;const n=t(e);if(void 0!==n)return n;if(Array.isArray(e)){const n=[];for(const o of e)n.push(pc(o,t,i));return n}if(ll(e)){if(i.has(e))throw new Error("Cannot clone recursive data-structure");i.add(e);const n={};for(const o in e)uc.call(e,o)&&(n[o]=pc(e[o],t,i));return i.delete(e),n}return e}function mc(e,t,i=!0){return ll(e)?(ll(t)&&Object.keys(t).forEach((n=>{n in e?i&&(ll(e[n])&&ll(t[n])?mc(e[n],t[n],i):e[n]=t[n]):e[n]=t[n]})),e):t}function fc(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;let i,n;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(!fc(e[i],t[i]))return!1}else{const o=[];for(n in e)o.push(n);o.sort();const s=[];for(n in t)s.push(n);if(s.sort(),!fc(o,s))return!1;for(i=0;i<o.length;i++)if(!fc(e[o[i]],t[o[i]]))return!1}return!0}function _c(e){const t=[];for(const i of function(e){let t=[];for(;Object.prototype!==e;)t=t.concat(Object.getOwnPropertyNames(e)),e=Object.getPrototypeOf(e);return t}(e))"function"==typeof e[i]&&t.push(i);return t}var vc,bc,wc,Cc,yc;!function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"}(vc||(vc={})),function(e){e[e.Left=1]="Left",e[e.Right=2]="Right"}(bc||(bc={})),function(e){e[e.Inline=1]="Inline",e[e.Gutter=2]="Gutter"}(wc||(wc={})),function(e){e[e.Both=0]="Both",e[e.Right=1]="Right",e[e.Left=2]="Left",e[e.None=3]="None"}(Cc||(Cc={}));class Sc{get originalIndentSize(){return this._indentSizeIsTabSize?"tabSize":this.indentSize}constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,0|e.tabSize),"tabSize"===e.indentSize?(this.indentSize=this.tabSize,this._indentSizeIsTabSize=!0):(this.indentSize=Math.max(1,0|e.indentSize),this._indentSizeIsTabSize=!1),this.insertSpaces=Boolean(e.insertSpaces),this.defaultEOL=0|e.defaultEOL,this.trimAutoWhitespace=Boolean(e.trimAutoWhitespace),this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this._indentSizeIsTabSize===e._indentSizeIsTabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&fc(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}}class kc{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}class Lc{constructor(e,t,i,n,o,s){this.identifier=e,this.range=t,this.text=i,this.forceMoveMarkers=n,this.isAutoWhitespaceEdit=o,this._isTracked=s}}class xc{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}class Dc{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}function Ec(e){return!e.isTooLargeForSyncing()&&!e.isForSimpleWidget}function Nc(e,t=0){return e[e.length-(1+t)]}function Ic(e,t,i=((e,t)=>e===t)){if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(let n=0,o=e.length;n<o;n++)if(!i(e[n],t[n]))return!1;return!0}function Mc(e,t,i){return function(n,o){let s=0,r=n-1;for(;s<=r;){const n=(s+r)/2|0,o=i(e[n],t);if(o<0)s=n+1;else{if(!(o>0))return n;r=n-1}}return-(s+1)}(e.length)}function Tc(e,t,i){if((e|=0)>=t.length)throw new TypeError("invalid index");const n=t[Math.floor(t.length*Math.random())],o=[],s=[],r=[];for(const e of t){const t=i(e,n);t<0?o.push(e):t>0?s.push(e):r.push(e)}return e<o.length?Tc(e,o,i):e<o.length+r.length?r[0]:Tc(e-(o.length+r.length),s,i)}function Ac(e,t){const i=[];let n;for(const o of e.slice(0).sort(t))n&&0===t(n[0],o)?n.push(o):(n=[o],i.push(n));return i}function*Rc(e,t){let i,n;for(const o of e)void 0!==n&&t(n,o)?i.push(o):(i&&(yield i),i=[o]),n=o;i&&(yield i)}function Oc(e,t){for(let i=0;i<=e.length;i++)t(0===i?void 0:e[i-1],i===e.length?void 0:e[i])}function Pc(e){return e.filter((e=>!!e))}function Fc(e){let t=0;for(let i=0;i<e.length;i++)e[i]&&(e[t]=e[i],t+=1);e.length=t}function Bc(e){return!Array.isArray(e)||0===e.length}function Wc(e){return Array.isArray(e)&&e.length>0}function Vc(e,t=(e=>e)){const i=new Set;return e.filter((e=>{const n=t(e);return!i.has(n)&&(i.add(n),!0)}))}function zc(e,t){return e.length>0?e[0]:t}function Hc(e,t){let i="number"==typeof t?e:0;"number"==typeof t?i=e:(i=0,t=e);const n=[];if(i<=t)for(let e=i;e<t;e++)n.push(e);else for(let e=i;e>t;e--)n.push(e);return n}function Uc(e,t,i){const n=e.slice(0,t),o=e.slice(t);return n.concat(i,o)}function Kc(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.unshift(t))}function jc(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.push(t))}function qc(e,t){for(const i of t)e.push(i)}function $c(e){return Array.isArray(e)?e:[e]}function Gc(e,t,i,n){const o=Zc(e,t);let s=e.splice(o,i);return void 0===s&&(s=[]),function(e,t,i){const n=Zc(e,t),o=e.length,s=i.length;e.length=o+s;for(let t=o-1;t>=n;t--)e[t+s]=e[t];for(let t=0;t<s;t++)e[t+n]=i[t]}(e,o,n),s}function Zc(e,t){return t<0?Math.max(t+e.length,0):Math.min(t,e.length)}function Yc(e,t){return(i,n)=>t(e(i),e(n))}!function(e){e.isLessThan=function(e){return e<0},e.isLessThanOrEqual=function(e){return e<=0},e.isGreaterThan=function(e){return e>0},e.isNeitherLessOrGreaterThan=function(e){return 0===e},e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0}(yc||(yc={}));const Qc=(e,t)=>e-t,Xc=(e,t)=>Qc(e?1:0,t?1:0);function Jc(e){return(t,i)=>-e(t,i)}class eu{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;const i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(0!==this.length)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class tu{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate((t=>(e.push(t),!0))),e}filter(e){return new tu((t=>this.iterate((i=>!e(i)||t(i)))))}map(e){return new tu((t=>this.iterate((i=>t(e(i))))))}findLast(e){let t;return this.iterate((i=>(e(i)&&(t=i),!0))),t}findLastMaxBy(e){let t,i=!0;return this.iterate((n=>((i||yc.isGreaterThan(e(n,t)))&&(i=!1,t=n),!0))),t}}function iu(e,t){const i=Math.pow(10,t);return Math.round(e*i)/i}tu.empty=new tu((e=>{}));class nu{constructor(e,t,i,n=1){this._rgbaBrand=void 0,this.r=0|Math.min(255,Math.max(0,e)),this.g=0|Math.min(255,Math.max(0,t)),this.b=0|Math.min(255,Math.max(0,i)),this.a=iu(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class ou{constructor(e,t,i,n){this._hslaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=iu(Math.max(Math.min(1,t),0),3),this.l=iu(Math.max(Math.min(1,i),0),3),this.a=iu(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,n=e.b/255,o=e.a,s=Math.max(t,i,n),r=Math.min(t,i,n);let a=0,l=0;const h=(r+s)/2,d=s-r;if(d>0){switch(l=Math.min(h<=.5?d/(2*h):d/(2-2*h),1),s){case t:a=(i-n)/d+(i<n?6:0);break;case i:a=(n-t)/d+2;break;case n:a=(t-i)/d+4}a*=60,a=Math.round(a)}return new ou(a,l,h,o)}static _hue2rgb(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:n,a:o}=e;let s,r,a;if(0===i)s=r=a=n;else{const e=n<.5?n*(1+i):n+i-n*i,o=2*n-e;s=ou._hue2rgb(o,e,t+1/3),r=ou._hue2rgb(o,e,t),a=ou._hue2rgb(o,e,t-1/3)}return new nu(Math.round(255*s),Math.round(255*r),Math.round(255*a),o)}}class su{constructor(e,t,i,n){this._hsvaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=iu(Math.max(Math.min(1,t),0),3),this.v=iu(Math.max(Math.min(1,i),0),3),this.a=iu(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,n=e.b/255,o=Math.max(t,i,n),s=o-Math.min(t,i,n),r=0===o?0:s/o;let a;return a=0===s?0:o===t?((i-n)/s%6+6)%6:o===i?(n-t)/s+2:(t-i)/s+4,new su(Math.round(60*a),r,o,e.a)}static toRGBA(e){const{h:t,s:i,v:n,a:o}=e,s=n*i,r=s*(1-Math.abs(t/60%2-1)),a=n-s;let[l,h,d]=[0,0,0];return t<60?(l=s,h=r):t<120?(l=r,h=s):t<180?(h=s,d=r):t<240?(h=r,d=s):t<300?(l=r,d=s):t<=360&&(l=s,d=r),l=Math.round(255*(l+a)),h=Math.round(255*(h+a)),d=Math.round(255*(d+a)),new nu(l,h,d,o)}}class ru{static fromHex(e){return ru.Format.CSS.parseHex(e)||ru.red}static equals(e,t){return!e&&!t||!(!e||!t)&&e.equals(t)}get hsla(){return this._hsla?this._hsla:ou.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:su.fromRGBA(this.rgba)}constructor(e){if(!e)throw new Error("Color needs a value");if(e instanceof nu)this.rgba=e;else if(e instanceof ou)this._hsla=e,this.rgba=ou.toRGBA(e);else{if(!(e instanceof su))throw new Error("Invalid color ctor argument");this._hsva=e,this.rgba=su.toRGBA(e)}}equals(e){return!!e&&nu.equals(this.rgba,e.rgba)&&ou.equals(this.hsla,e.hsla)&&su.equals(this.hsva,e.hsva)}getRelativeLuminance(){return iu(.2126*ru._relativeLuminanceForComponent(this.rgba.r)+.7152*ru._relativeLuminanceForComponent(this.rgba.g)+.0722*ru._relativeLuminanceForComponent(this.rgba.b),4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3>=128}isLighterThan(e){return this.getRelativeLuminance()>e.getRelativeLuminance()}isDarkerThan(e){return this.getRelativeLuminance()<e.getRelativeLuminance()}lighten(e){return new ru(new ou(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*e,this.hsla.a))}darken(e){return new ru(new ou(this.hsla.h,this.hsla.s,this.hsla.l-this.hsla.l*e,this.hsla.a))}transparent(e){const{r:t,g:i,b:n,a:o}=this.rgba;return new ru(new nu(t,i,n,o*e))}isTransparent(){return 0===this.rgba.a}isOpaque(){return 1===this.rgba.a}opposite(){return new ru(new nu(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}makeOpaque(e){if(this.isOpaque()||1!==e.rgba.a)return this;const{r:t,g:i,b:n,a:o}=this.rgba;return new ru(new nu(e.rgba.r-o*(e.rgba.r-t),e.rgba.g-o*(e.rgba.g-i),e.rgba.b-o*(e.rgba.b-n),1))}toString(){return this._toString||(this._toString=ru.Format.CSS.format(this)),this._toString}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;const n=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(o-n)/o,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;const n=e.getRelativeLuminance();return i=i*(n-t.getRelativeLuminance())/n,e.darken(i)}}function au(e){let t=0,i=0,n=0,o=0;for(let s=0,r=e.length;s<r;s++){const a=e.charCodeAt(s);13===a?(0===t&&(i=s),t++,s+1<r&&10===e.charCodeAt(s+1)?(o|=2,s++):o|=3,n=s+1):10===a&&(o|=1,0===t&&(i=s),t++,n=s+1)}return 0===t&&(i=e.length),[t,i,e.length-n,o]}ru.white=new ru(new nu(255,255,255,1)),ru.black=new ru(new nu(0,0,0,1)),ru.red=new ru(new nu(255,0,0,1)),ru.blue=new ru(new nu(0,0,255,1)),ru.green=new ru(new nu(0,255,0,1)),ru.cyan=new ru(new nu(0,255,255,1)),ru.lightgrey=new ru(new nu(211,211,211,1)),ru.transparent=new ru(new nu(0,0,0,0)),function(e){let t;!function(t){let i;!function(t){function i(e){const t=e.toString(16);return 2!==t.length?"0"+t:t}function n(e){switch(e){case 48:return 0;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case 97:case 65:return 10;case 98:case 66:return 11;case 99:case 67:return 12;case 100:case 68:return 13;case 101:case 69:return 14;case 102:case 70:return 15}return 0}t.formatRGB=function(t){return 1===t.rgba.a?`rgb(${t.rgba.r}, ${t.rgba.g}, ${t.rgba.b})`:e.Format.CSS.formatRGBA(t)},t.formatRGBA=function(e){return`rgba(${e.rgba.r}, ${e.rgba.g}, ${e.rgba.b}, ${+e.rgba.a.toFixed(2)})`},t.formatHSL=function(t){return 1===t.hsla.a?`hsl(${t.hsla.h}, ${(100*t.hsla.s).toFixed(2)}%, ${(100*t.hsla.l).toFixed(2)}%)`:e.Format.CSS.formatHSLA(t)},t.formatHSLA=function(e){return`hsla(${e.hsla.h}, ${(100*e.hsla.s).toFixed(2)}%, ${(100*e.hsla.l).toFixed(2)}%, ${e.hsla.a.toFixed(2)})`},t.formatHex=function(e){return`#${i(e.rgba.r)}${i(e.rgba.g)}${i(e.rgba.b)}`},t.formatHexA=function(t,n=!1){return n&&1===t.rgba.a?e.Format.CSS.formatHex(t):`#${i(t.rgba.r)}${i(t.rgba.g)}${i(t.rgba.b)}${i(Math.round(255*t.rgba.a))}`},t.format=function(t){return t.isOpaque()?e.Format.CSS.formatHex(t):e.Format.CSS.formatRGBA(t)},t.parseHex=function(t){const i=t.length;if(0===i)return null;if(35!==t.charCodeAt(0))return null;if(7===i){const i=16*n(t.charCodeAt(1))+n(t.charCodeAt(2)),o=16*n(t.charCodeAt(3))+n(t.charCodeAt(4)),s=16*n(t.charCodeAt(5))+n(t.charCodeAt(6));return new e(new nu(i,o,s,1))}if(9===i){const i=16*n(t.charCodeAt(1))+n(t.charCodeAt(2)),o=16*n(t.charCodeAt(3))+n(t.charCodeAt(4)),s=16*n(t.charCodeAt(5))+n(t.charCodeAt(6)),r=16*n(t.charCodeAt(7))+n(t.charCodeAt(8));return new e(new nu(i,o,s,r/255))}if(4===i){const i=n(t.charCodeAt(1)),o=n(t.charCodeAt(2)),s=n(t.charCodeAt(3));return new e(new nu(16*i+i,16*o+o,16*s+s))}if(5===i){const i=n(t.charCodeAt(1)),o=n(t.charCodeAt(2)),s=n(t.charCodeAt(3)),r=n(t.charCodeAt(4));return new e(new nu(16*i+i,16*o+o,16*s+s,(16*r+r)/255))}return null}}(i=t.CSS||(t.CSS={}))}(t=e.Format||(e.Format={}))}(ru||(ru={}));class lu{static _nextVisibleColumn(e,t,i){return 9===e?lu.nextRenderTabStop(t,i):Kn(e)||jn(e)?t+2:t+1}static visibleColumnFromColumn(e,t,i){const n=Math.min(t-1,e.length),o=e.substring(0,n),s=new On(o);let r=0;for(;!s.eol();){const e=An(o,n,s.offset);s.nextGraphemeLength(),r=this._nextVisibleColumn(e,r,i)}return r}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;const n=e.length,o=new On(e);let s=0,r=1;for(;!o.eol();){const a=An(e,n,o.offset);o.nextGraphemeLength();const l=this._nextVisibleColumn(a,s,i),h=o.offset+1;if(l>=t)return l-t<t-s?h:r;s=l,r=h}return n+1}static nextRenderTabStop(e,t){return e+t-e%t}static nextIndentTabStop(e,t){return e+t-e%t}static prevRenderTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}static prevIndentTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}}function hu(e,t,i){let n=fn(e);return-1===n&&(n=e.length),function(e,t,i){let n=0;for(let i=0;i<e.length;i++)"\t"===e.charAt(i)?n=lu.nextIndentTabStop(n,t):n++;let o="";if(!i){const e=Math.floor(n/t);n%=t;for(let t=0;t<e;t++)o+="\t"}for(let e=0;e<n;e++)o+=" ";return o}(e.substring(0,n),t,i)+e.substring(n)}class du{static addRange(e,t){let i=0;for(;i<t.length&&t[i].endExclusive<e.start;)i++;let n=i;for(;n<t.length&&t[n].start<=e.endExclusive;)n++;if(i===n)t.splice(i,0,e);else{const o=Math.min(e.start,t[i].start),s=Math.max(e.endExclusive,t[n-1].endExclusive);t.splice(i,n-i,new du(o,s))}}static tryCreate(e,t){if(!(e>t))return new du(e,t)}static ofLength(e){return new du(0,e)}static ofStartAndLength(e,t){return new du(e,e+t)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new b(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new du(this.start+e,this.endExclusive+e)}deltaStart(e){return new du(this.start+e,this.endExclusive)}deltaEnd(e){return new du(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e<this.endExclusive}join(e){return new du(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}intersect(e){const t=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);if(t<=i)return new du(t,i)}isBefore(e){return this.endExclusive<=e.start}isAfter(e){return this.start>=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new b(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new b(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;t<this.endExclusive;t++)e(t)}}class cu{constructor(){this._sortedRanges=[]}addRange(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<e.start;)t++;let i=t;for(;i<this._sortedRanges.length&&this._sortedRanges[i].start<=e.endExclusive;)i++;if(t===i)this._sortedRanges.splice(t,0,e);else{const n=Math.min(e.start,this._sortedRanges[t].start),o=Math.max(e.endExclusive,this._sortedRanges[i-1].endExclusive);this._sortedRanges.splice(t,i-t,new du(n,o))}}toString(){return this._sortedRanges.map((e=>e.toString())).join(", ")}intersectsStrict(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<=e.start;)t++;return t<this._sortedRanges.length&&this._sortedRanges[t].start<e.endExclusive}intersectWithRange(e){const t=new cu;for(const i of this._sortedRanges){const n=i.intersect(e);n&&t.addRange(n)}return t}intersectWithRangeLength(e){return this.intersectWithRange(e).length}get length(){return this._sortedRanges.reduce(((e,t)=>e+t.length),0)}}function uu(e,t,i){const n=function(e,t,i=e.length-1){for(let n=i;n>=0;n--)if(t(e[n]))return n;return-1}(e,t);if(-1!==n)return e[n]}function gu(e,t){const i=pu(e,t);return-1===i?void 0:e[i]}function pu(e,t,i=0,n=e.length){let o=i,s=n;for(;o<s;){const i=Math.floor((o+s)/2);t(e[i])?o=i+1:s=i}return o-1}function mu(e,t,i=0,n=e.length){let o=i,s=n;for(;o<s;){const i=Math.floor((o+s)/2);t(e[i])?s=i:o=i+1}return o}class fu{constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(e){if(fu.assertInvariants){if(this._prevFindLastPredicate)for(const t of this._array)if(this._prevFindLastPredicate(t)&&!e(t))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.");this._prevFindLastPredicate=e}const t=pu(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=t+1,-1===t?void 0:this._array[t]}}function _u(e,t){if(0===e.length)return;let i=e[0];for(let n=1;n<e.length;n++){const o=e[n];t(o,i)>0&&(i=o)}return i}function vu(e,t){if(0===e.length)return-1;let i=0;for(let n=1;n<e.length;n++)t(e[n],e[i])>0&&(i=n);return i}fu.assertInvariants=!1;class bu{static fromRange(e){return new bu(e.startLineNumber,e.endLineNumber)}static fromRangeInclusive(e){return new bu(e.startLineNumber,e.endLineNumber+1)}static joinMany(e){if(0===e.length)return[];let t=new wu(e[0].slice());for(let i=1;i<e.length;i++)t=t.getUnion(new wu(e[i].slice()));return t.ranges}static ofLength(e,t){return new bu(e,e+t)}static deserialize(e){return new bu(e[0],e[1])}constructor(e,t){if(e>t)throw new b(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&e<this.endLineNumberExclusive}get isEmpty(){return this.startLineNumber===this.endLineNumberExclusive}delta(e){return new bu(this.startLineNumber+e,this.endLineNumberExclusive+e)}deltaLength(e){return new bu(this.startLineNumber,this.endLineNumberExclusive+e)}get length(){return this.endLineNumberExclusive-this.startLineNumber}join(e){return new bu(Math.min(this.startLineNumber,e.startLineNumber),Math.max(this.endLineNumberExclusive,e.endLineNumberExclusive))}toString(){return`[${this.startLineNumber},${this.endLineNumberExclusive})`}intersect(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumberExclusive,e.endLineNumberExclusive);if(t<=i)return new bu(t,i)}intersectsStrict(e){return this.startLineNumber<e.endLineNumberExclusive&&e.startLineNumber<this.endLineNumberExclusive}overlapOrTouch(e){return this.startLineNumber<=e.endLineNumberExclusive&&e.startLineNumber<=this.endLineNumberExclusive}equals(e){return this.startLineNumber===e.startLineNumber&&this.endLineNumberExclusive===e.endLineNumberExclusive}toInclusiveRange(){return this.isEmpty?null:new tc(this.startLineNumber,1,this.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER)}toExclusiveRange(){return new tc(this.startLineNumber,1,this.endLineNumberExclusive,1)}mapToLineArray(e){const t=[];for(let i=this.startLineNumber;i<this.endLineNumberExclusive;i++)t.push(e(i));return t}forEach(e){for(let t=this.startLineNumber;t<this.endLineNumberExclusive;t++)e(t)}serialize(){return[this.startLineNumber,this.endLineNumberExclusive]}includes(e){return this.startLineNumber<=e&&e<this.endLineNumberExclusive}toOffsetRange(){return new du(this.startLineNumber-1,this.endLineNumberExclusive-1)}}class wu{constructor(e=[]){this._normalizedRanges=e}get ranges(){return this._normalizedRanges}addRange(e){if(0===e.length)return;const t=mu(this._normalizedRanges,(t=>t.endLineNumberExclusive>=e.startLineNumber)),i=pu(this._normalizedRanges,(t=>t.startLineNumber<=e.endLineNumberExclusive))+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const i=this._normalizedRanges[t];this._normalizedRanges[t]=i.join(e)}else{const n=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,n)}}contains(e){const t=gu(this._normalizedRanges,(t=>t.startLineNumber<=e));return!!t&&t.endLineNumberExclusive>e}intersects(e){const t=gu(this._normalizedRanges,(t=>t.startLineNumber<e.endLineNumberExclusive));return!!t&&t.endLineNumberExclusive>e.startLineNumber}getUnion(e){if(0===this._normalizedRanges.length)return e;if(0===e._normalizedRanges.length)return this;const t=[];let i=0,n=0,o=null;for(;i<this._normalizedRanges.length||n<e._normalizedRanges.length;){let s=null;if(i<this._normalizedRanges.length&&n<e._normalizedRanges.length){const t=this._normalizedRanges[i],o=e._normalizedRanges[n];t.startLineNumber<o.startLineNumber?(s=t,i++):(s=o,n++)}else i<this._normalizedRanges.length?(s=this._normalizedRanges[i],i++):(s=e._normalizedRanges[n],n++);null===o?o=s:o.endLineNumberExclusive>=s.startLineNumber?o=new bu(o.startLineNumber,Math.max(o.endLineNumberExclusive,s.endLineNumberExclusive)):(t.push(o),o=s)}return null!==o&&t.push(o),new wu(t)}subtractFrom(e){const t=mu(this._normalizedRanges,(t=>t.endLineNumberExclusive>=e.startLineNumber)),i=pu(this._normalizedRanges,(t=>t.startLineNumber<=e.endLineNumberExclusive))+1;if(t===i)return new wu([e]);const n=[];let o=e.startLineNumber;for(let e=t;e<i;e++){const t=this._normalizedRanges[e];t.startLineNumber>o&&n.push(new bu(o,t.startLineNumber)),o=t.endLineNumberExclusive}return o<e.endLineNumberExclusive&&n.push(new bu(o,e.endLineNumberExclusive)),new wu(n)}toString(){return this._normalizedRanges.map((e=>e.toString())).join(", ")}getIntersection(e){const t=[];let i=0,n=0;for(;i<this._normalizedRanges.length&&n<e._normalizedRanges.length;){const o=this._normalizedRanges[i],s=e._normalizedRanges[n],r=o.intersect(s);r&&!r.isEmpty&&t.push(r),o.endLineNumberExclusive<s.endLineNumberExclusive?i++:n++}return new wu(t)}getWithDelta(e){return new wu(this._normalizedRanges.map((t=>t.delta(e))))}}const Cu={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}},yu=hh("languageService"),Su="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?",ku=function(e=""){let t="(-?\\d*\\.\\d\\w*)|([^";for(const i of Su)e.indexOf(i)>=0||(t+="\\"+i);return t+="\\s]+)",new RegExp(t,"g")}();function Lu(e){let t=ku;if(e&&e instanceof RegExp)if(e.global)t=e;else{let i="g";e.ignoreCase&&(i+="i"),e.multiline&&(i+="m"),e.unicode&&(i+="u"),t=new RegExp(e.source,i)}return t.lastIndex=0,t}const xu=new B;function Du(e,t,i,n,o){if(t=Lu(t),o||(o=C.first(xu)),i.length>o.maxLen){let s=e-o.maxLen/2;return s<0?s=0:n+=s,Du(e,t,i=i.substring(s,e+o.maxLen/2),n,o)}const s=Date.now(),r=e-1-n;let a=-1,l=null;for(let e=1;!(Date.now()-s>=o.timeBudget);e++){const n=r-o.windowSize*e;t.lastIndex=Math.max(0,n);const s=Eu(t,i,r,a);if(!s&&l)break;if(l=s,n<=0)break;a=n}if(l){const e={word:l[0],startColumn:n+1+l.index,endColumn:n+1+l.index+l[0].length};return t.lastIndex=0,e}return null}function Eu(e,t,i,n){let o;for(;o=e.exec(t);){const t=o.index||0;if(t<=i&&e.lastIndex>=i)return o;if(n>0&&t>n)return null}return null}var Nu,Iu;xu.unshift({maxLen:1e3,windowSize:15,timeBudget:150}),(Iu=Nu||(Nu={}))[Iu.None=0]="None",Iu[Iu.Indent=1]="Indent",Iu[Iu.IndentOutdent=2]="IndentOutdent",Iu[Iu.Outdent=3]="Outdent";class Mu{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t<i;t++)switch(e.notIn[t]){case"string":this._inString=!1;break;case"comment":this._inComment=!1;break;case"regex":this._inRegEx=!1}}isOK(e){switch(e){case 0:return!0;case 1:return this._inComment;case 2:return this._inString;case 3:return this._inRegEx}}shouldAutoClose(e,t){if(0===e.getTokenCount())return!0;const i=e.findTokenIndexAtOffset(t-2),n=e.getStandardTokenType(i);return this.isOK(n)}_findNeutralCharacterInRange(e,t){for(let i=e;i<=t;i++){const e=String.fromCharCode(i);if(!this.open.includes(e)&&!this.close.includes(e))return e}return null}findNeutralCharacter(){return this._neutralCharacterSearched||(this._neutralCharacterSearched=!0,this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(48,57)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(97,122)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(65,90))),this._neutralCharacter}}class Tu{constructor(e){this.autoClosingPairsOpenByStart=new Map,this.autoClosingPairsOpenByEnd=new Map,this.autoClosingPairsCloseByStart=new Map,this.autoClosingPairsCloseByEnd=new Map,this.autoClosingPairsCloseSingleChar=new Map;for(const t of e)Au(this.autoClosingPairsOpenByStart,t.open.charAt(0),t),Au(this.autoClosingPairsOpenByEnd,t.open.charAt(t.open.length-1),t),Au(this.autoClosingPairsCloseByStart,t.close.charAt(0),t),Au(this.autoClosingPairsCloseByEnd,t.close.charAt(t.close.length-1),t),1===t.close.length&&1===t.open.length&&Au(this.autoClosingPairsCloseSingleChar,t.close,t)}}function Au(e,t,i){e.has(t)?e.get(t).push(i):e.set(t,[i])}function Ru(e,t){const i=e.getCount(),n=e.findTokenIndexAtOffset(t),o=e.getLanguageId(n);let s=n;for(;s+1<i&&e.getLanguageId(s+1)===o;)s++;let r=n;for(;r>0&&e.getLanguageId(r-1)===o;)r--;return new Ou(e,o,r,s+1,e.getStartOffset(r),e.getEndOffset(s))}class Ou{constructor(e,t,i,n,o,s){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=o,this._lastCharOffset=s}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}}function Pu(e){return 0!=(3&e)}class Fu{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map((e=>new Mu(e))):e.brackets?this._autoClosingPairs=e.brackets.map((e=>new Mu({open:e[0],close:e[1]}))):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new Mu({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes="string"==typeof e.autoCloseBefore?e.autoCloseBefore:Fu.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets="string"==typeof e.autoCloseBefore?e.autoCloseBefore:Fu.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}}Fu.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=";:.,=}])> \n\t",Fu.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS="'\"`;:.,=}])> \n\t";const Bu="undefined"!=typeof Buffer;let Wu,Vu,zu,Hu;new on((()=>new Uint8Array(256)));class Uu{static wrap(e){return Bu&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new Uu(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return Bu?this.buffer.toString():(Wu||(Wu=new TextDecoder),Wu.decode(this.buffer))}}function Ku(e,t){return e[t+0]<<0>>>0|e[t+1]<<8>>>0}function ju(e,t,i){e[i+0]=255&t,t>>>=8,e[i+1]=255&t}function qu(e,t){return e[t]*2**24+65536*e[t+1]+256*e[t+2]+e[t+3]}function $u(e,t,i){e[i+3]=t,t>>>=8,e[i+2]=t,t>>>=8,e[i+1]=t,t>>>=8,e[i]=t}function Gu(e,t){return e[t]}function Zu(e,t,i){e[i]=t}function Yu(){return Vu||(Vu=new TextDecoder("UTF-16LE")),Vu}function Qu(){return Hu||(Hu=et()?Yu():(zu||(zu=new TextDecoder("UTF-16BE")),zu)),Hu}class Xu{constructor(e){this._capacity=0|e,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}reset(){this._completedStrings=null,this._bufferLength=0}build(){return null!==this._completedStrings?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()}_buildBuffer(){if(0===this._bufferLength)return"";const e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return Qu().decode(e)}_flushBuffer(){const e=this._buildBuffer();this._bufferLength=0,null===this._completedStrings?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}appendCharCode(e){const t=this._capacity-this._bufferLength;t<=1&&(0===t||In(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIICharCode(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendString(e){const t=e.length;if(this._bufferLength+t>=this._capacity)return this._flushBuffer(),void(this._completedStrings[this._completedStrings.length]=e);for(let i=0;i<t;i++)this._buffer[this._bufferLength++]=e.charCodeAt(i)}}class Ju{constructor(e,t,i,n,o,s){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=i,this.close=n,this.forwardRegex=o,this.reversedRegex=s,this._openSet=Ju._toSet(this.open),this._closeSet=Ju._toSet(this.close)}isOpen(e){return this._openSet.has(e)}isClose(e){return this._closeSet.has(e)}static _toSet(e){const t=new Set;for(const i of e)t.add(i);return t}}class eg{constructor(e,t){this._richEditBracketsBrand=void 0;const i=function(e){const t=e.length;e=e.map((e=>[e[0].toLowerCase(),e[1].toLowerCase()]));const i=[];for(let e=0;e<t;e++)i[e]=e;const n=(e,t)=>{const[i,n]=e,[o,s]=t;return i===o||i===s||n===o||n===s},o=(e,n)=>{const o=Math.min(e,n),s=Math.max(e,n);for(let e=0;e<t;e++)i[e]===s&&(i[e]=o)};for(let s=0;s<t;s++){const r=e[s];for(let a=s+1;a<t;a++)n(r,e[a])&&o(i[s],i[a])}const s=[];for(let n=0;n<t;n++){const o=[],r=[];for(let s=0;s<t;s++)if(i[s]===n){const[t,i]=e[s];o.push(t),r.push(i)}o.length>0&&s.push({open:o,close:r})}return s}(t);this.brackets=i.map(((t,n)=>new Ju(e,n,t.open,t.close,function(e,t,i,n){let o=[];o=o.concat(e),o=o.concat(t);for(let e=0,t=o.length;e<t;e++)tg(o[e],i,n,o);return o=ng(o),o.sort(ig),o.reverse(),sg(o)}(t.open,t.close,i,n),function(e,t,i,n){let o=[];o=o.concat(e),o=o.concat(t);for(let e=0,t=o.length;e<t;e++)tg(o[e],i,n,o);return o=ng(o),o.sort(ig),o.reverse(),sg(o.map(rg))}(t.open,t.close,i,n)))),this.forwardRegex=function(e){let t=[];for(const i of e){for(const e of i.open)t.push(e);for(const e of i.close)t.push(e)}return t=ng(t),sg(t)}(this.brackets),this.reversedRegex=function(e){let t=[];for(const i of e){for(const e of i.open)t.push(e);for(const e of i.close)t.push(e)}return t=ng(t),sg(t.map(rg))}(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const e of this.brackets){for(const t of e.open)this.textIsBracket[t]=e,this.textIsOpenBracket[t]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,t.length);for(const t of e.close)this.textIsBracket[t]=e,this.textIsOpenBracket[t]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,t.length)}}}function tg(e,t,i,n){for(let o=0,s=t.length;o<s;o++){if(o===i)continue;const s=t[o];for(const t of s.open)t.indexOf(e)>=0&&n.push(t);for(const t of s.close)t.indexOf(e)>=0&&n.push(t)}}function ig(e,t){return e.length-t.length}function ng(e){if(e.length<=1)return e;const t=[],i=new Set;for(const n of e)i.has(n)||(t.push(n),i.add(n));return t}function og(e){const t=/^[\w ]+$/.test(e);return e=dn(e),t?`\\b${e}\\b`:e}function sg(e){return pn(`(${e.map(og).join(")|(")})`,!0)}const rg=function(){let e=null,t=null;return function(i){return e!==i&&(e=i,t=function(e){const t=new Uint16Array(e.length);let i=0;for(let n=e.length-1;n>=0;n--)t[i++]=e.charCodeAt(n);return Qu().decode(t)}(e)),t}}();class ag{static _findPrevBracketInText(e,t,i,n){const o=i.match(e);if(!o)return null;const s=i.length-(o.index||0),r=o[0].length,a=n+s;return new tc(t,a-r+1,t,a+1)}static findPrevBracketInRange(e,t,i,n,o){const s=rg(i).substring(i.length-o,i.length-n);return this._findPrevBracketInText(e,t,s,n)}static findNextBracketInText(e,t,i,n){const o=i.match(e);if(!o)return null;const s=o.index||0,r=o[0].length;if(0===r)return null;const a=n+s;return new tc(t,a+1,t,a+1+r)}static findNextBracketInRange(e,t,i,n,o){const s=i.substring(n,o);return this.findNextBracketInText(e,t,s,n)}}class lg{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const t=i.charAt(i.length-1);e.push(t)}return Vc(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||0===this._richEditBrackets.brackets.length)return null;const n=t.findTokenIndexAtOffset(i-1);if(Pu(t.getStandardTokenType(n)))return null;const o=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,i-1)+e,r=ag.findPrevBracketInRange(o,1,s,0,s.length);if(!r)return null;const a=s.substring(r.startColumn-1,r.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[a])return null;const l=t.getActualLineContentBefore(r.startColumn-1);return/^\s*$/.test(l)?{matchOpenBracket:a}:null}}function hg(e){return e.global&&(e.lastIndex=0),!0}class dg{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&hg(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&hg(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&hg(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&hg(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class cg{constructor(e){(e=e||{}).brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach((e=>{const t=cg._createOpenBracketRegExp(e[0]),i=cg._createCloseBracketRegExp(e[1]);t&&i&&this._brackets.push({open:e[0],openRegExp:t,close:e[1],closeRegExp:i})})),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,n){if(e>=3)for(let e=0,o=this._regExpRules.length;e<o;e++){const o=this._regExpRules[e];if([{reg:o.beforeText,text:i},{reg:o.afterText,text:n},{reg:o.previousLineText,text:t}].every((e=>!e.reg||(e.reg.lastIndex=0,e.reg.test(e.text)))))return o.action}if(e>=2&&i.length>0&&n.length>0)for(let e=0,t=this._brackets.length;e<t;e++){const t=this._brackets[e];if(t.openRegExp.test(i)&&t.closeRegExp.test(n))return{indentAction:Nu.IndentOutdent}}if(e>=2&&i.length>0)for(let e=0,t=this._brackets.length;e<t;e++)if(this._brackets[e].openRegExp.test(i))return{indentAction:Nu.Indent};return null}static _createOpenBracketRegExp(e){let t=dn(e);return/\B/.test(t.charAt(0))||(t="\\b"+t),t+="\\s*$",cg._safeRegExp(t)}static _createCloseBracketRegExp(e){let t=dn(e);return/\B/.test(t.charAt(t.length-1))||(t+="\\b"),t="^\\s*"+t,cg._safeRegExp(t)}static _safeRegExp(e){try{return new RegExp(e)}catch(e){return h(e),null}}}const ug=hh("configurationService");function gg(e,t){const i=Object.create(null);for(const n in e)pg(i,n,e[n],t);return i}function pg(e,t,i,n){const o=t.split("."),s=o.pop();let r=e;for(let e=0;e<o.length;e++){const i=o[e];let s=r[i];switch(typeof s){case"undefined":s=r[i]=Object.create(null);break;case"object":break;default:return void n(`Ignoring ${t} as ${o.slice(0,e+1).join(".")} is ${JSON.stringify(s)}`)}r=s}if("object"==typeof r&&null!==r)try{r[s]=i}catch(e){n(`Ignoring ${t} as ${o.join(".")} is ${JSON.stringify(r)}`)}else n(`Ignoring ${t} as ${o.join(".")} is ${JSON.stringify(r)}`)}function mg(e,t){fg(e,t.split("."))}function fg(e,t){const i=t.shift();if(0!==t.length){if(-1!==Object.keys(e).indexOf(i)){const n=e[i];"object"!=typeof n||Array.isArray(n)||(fg(n,t),0===Object.keys(n).length&&delete e[i])}}else delete e[i]}function _g(e,t,i){const n=function(e,t){let i=e;for(const e of t){if("object"!=typeof i||null===i)return;i=i[e]}return i}(e,t.split("."));return void 0===n?i:n}class vg{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const bg=[];function wg(e,t,i){t instanceof vg||(t=new vg(t,[],Boolean(i))),bg.push([e,t])}function Cg(){return bg}const yg=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),Sg="base.contributions.json",kg=new class{constructor(){this._onDidChangeSchema=new q,this.schemasById={}}registerSchema(e,t){var i;this.schemasById[(i=e,i.length>0&&"#"===i.charAt(i.length-1)?i.substring(0,i.length-1):i)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}};md.add(Sg,kg);const Lg="base.contributions.configuration",xg={properties:{},patternProperties:{}},Dg={properties:{},patternProperties:{}},Eg={properties:{},patternProperties:{}},Ng={properties:{},patternProperties:{}},Ig={properties:{},patternProperties:{}},Mg={properties:{},patternProperties:{}},Tg="vscode://schemas/settings/resourceLanguage",Ag=md.as(Sg),Rg="\\[([^\\]]+)\\]",Og=new RegExp(Rg,"g"),Pg=`^(${Rg})+$`,Fg=new RegExp(Pg);function Bg(e){const t=[];if(Fg.test(e)){let i=Og.exec(e);for(;null==i?void 0:i.length;){const n=i[1].trim();n&&t.push(n),i=Og.exec(e)}}return Vc(t)}const Wg=new class{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new q,this._onDidUpdateConfiguration=new q,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:me(0,"Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},Ag.registerSchema(Tg,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),Ag.registerSchema(Tg,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){var i;const n=[];for(const{overrides:o,source:s}of e)for(const e in o)if(t.add(e),Fg.test(e)){const t=this.configurationDefaultsOverrides.get(e),r=null!==(i=null==t?void 0:t.valuesSources)&&void 0!==i?i:new Map;if(s)for(const t of Object.keys(o[e]))r.set(t,s);const a={...(null==t?void 0:t.value)||{},...o[e]};this.configurationDefaultsOverrides.set(e,{source:s,value:a,valuesSources:r});const l={type:"object",default:a,description:me(0,"Configure settings to be overridden for the {0} language.",e.replace(/[\[\]]/g,"")),$ref:Tg,defaultDefaultValue:a,source:al(s)?void 0:s,defaultValueSource:s};n.push(...Bg(e)),this.configurationProperties[e]=l,this.defaultLanguageConfigurationOverridesNode.properties[e]=l}else{this.configurationDefaultsOverrides.set(e,{value:o[e],source:s});const t=this.configurationProperties[e];t&&(this.updatePropertyDefaultValue(e,t),this.updateSchema(e,t))}this.doRegisterOverrideIdentifiers(n)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach((e=>{this.validateAndRegisterProperties(e,t,e.extensionInfo,e.restrictedProperties,void 0,i),this.configurationContributors.push(e),this.registerJSONConfiguration(e)}))}validateAndRegisterProperties(e,t=!0,i,n,o=3,s){var r;o=ml(e.scope)?o:e.scope;const a=e.properties;if(a)for(const e in a){const l=a[e];t&&Vg(e,l)?delete a[e]:(l.source=i,l.defaultDefaultValue=a[e].default,this.updatePropertyDefaultValue(e,l),Fg.test(e)?l.scope=void 0:(l.scope=ml(l.scope)?o:l.scope,l.restricted=ml(l.restricted)?!!(null==n?void 0:n.includes(e)):l.restricted),!a[e].hasOwnProperty("included")||a[e].included?(this.configurationProperties[e]=a[e],(null===(r=a[e].policy)||void 0===r?void 0:r.name)&&this.policyConfigurations.set(a[e].policy.name,e),!a[e].deprecationMessage&&a[e].markdownDeprecationMessage&&(a[e].deprecationMessage=a[e].markdownDeprecationMessage),s.add(e)):(this.excludedConfigurationProperties[e]=a[e],delete a[e]))}const l=e.allOf;if(l)for(const e of l)this.validateAndRegisterProperties(e,t,i,n,o,s)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=e=>{const i=e.properties;if(i)for(const e in i)this.updateSchema(e,i[e]);const n=e.allOf;null==n||n.forEach(t)};t(e)}updateSchema(e,t){switch(xg.properties[e]=t,t.scope){case 1:Dg.properties[e]=t;break;case 2:Eg.properties[e]=t;break;case 6:Ng.properties[e]=t;break;case 3:Ig.properties[e]=t;break;case 4:Mg.properties[e]=t;break;case 5:Mg.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:me(0,"Configure editor settings to be overridden for a language."),errorMessage:me(0,"This setting does not support per-language configuration."),$ref:Tg};this.updatePropertyDefaultValue(t,i),xg.properties[t]=i,Dg.properties[t]=i,Eg.properties[t]=i,Ng.properties[t]=i,Ig.properties[t]=i,Mg.properties[t]=i}}registerOverridePropertyPatternKey(){const e={type:"object",description:me(0,"Configure editor settings to be overridden for a language."),errorMessage:me(0,"This setting does not support per-language configuration."),$ref:Tg};xg.patternProperties[Pg]=e,Dg.patternProperties[Pg]=e,Eg.patternProperties[Pg]=e,Ng.patternProperties[Pg]=e,Ig.patternProperties[Pg]=e,Mg.patternProperties[Pg]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e);let n=null==i?void 0:i.value,o=null==i?void 0:i.source;gl(n)&&(n=t.defaultDefaultValue,o=void 0),gl(n)&&(n=function(e){switch(Array.isArray(e)?e[0]:e){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}(t.type)),t.default=n,t.defaultValueSource=o}};function Vg(e,t){var i,n,o,s;return e.trim()?Fg.test(e)?me(0,"Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",e):void 0!==Wg.getConfigurationProperties()[e]?me(0,"Cannot register '{0}'. This property is already registered.",e):(null===(i=t.policy)||void 0===i?void 0:i.name)&&void 0!==Wg.getPolicyConfigurations().get(null===(n=t.policy)||void 0===n?void 0:n.name)?me(0,"Cannot register '{0}'. The associated policy {1} is already registered with {2}.",e,null===(o=t.policy)||void 0===o?void 0:o.name,Wg.getPolicyConfigurations().get(null===(s=t.policy)||void 0===s?void 0:s.name)):null:me(0,"Cannot register an empty property")}md.add(Lg,Wg);const zg=new class{constructor(){this._onDidChangeLanguages=new q,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t<i;t++)if(this._languages[t]===e)return void this._languages.splice(t,1)}}}getLanguages(){return this._languages}};md.add("editor.modesRegistry",zg);const Hg="plaintext";zg.registerLanguage({id:Hg,extensions:[".txt"],aliases:[me(0,"Plain Text"),"text"],mimetypes:[yg.text]}),md.as(Lg).registerDefaultConfigurations([{overrides:{"[plaintext]":{"editor.unicodeHighlight.ambiguousCharacters":!1,"editor.unicodeHighlight.invisibleCharacters":!1}}}]);class Ug{constructor(e,t){this.languageId=e;const i=t.brackets?Kg(t.brackets):[],n=new nn((e=>{const t=new Set;return{info:new qg(this,e,t),closing:t}})),o=new nn((e=>{const t=new Set,i=new Set;return{info:new $g(this,e,t,i),opening:t,openingColorized:i}}));for(const[e,t]of i){const i=n.get(e),s=o.get(t);i.closing.add(s.info),s.opening.add(i.info)}const s=t.colorizedBracketPairs?Kg(t.colorizedBracketPairs):i.filter((e=>!("<"===e[0]&&">"===e[1])));for(const[e,t]of s){const i=n.get(e),s=o.get(t);i.closing.add(s.info),s.openingColorized.add(i.info),s.opening.add(i.info)}this._openingBrackets=new Map([...n.cachedValues].map((([e,t])=>[e,t.info]))),this._closingBrackets=new Map([...o.cachedValues].map((([e,t])=>[e,t.info])))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}}function Kg(e){return e.filter((([e,t])=>""!==e&&""!==t))}class jg{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class qg extends jg{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class $g extends jg{constructor(e,t,i,n){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=n,this.isOpeningBracket=!1}closes(e){return e.config===this.config&&this.openingBrackets.has(e)}closesColorized(e){return e.config===this.config&&this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}var Gg=function(e,t){return function(i,n){t(i,n,e)}};class Zg{constructor(e){this.languageId=e}affects(e){return!this.languageId||this.languageId===e}}const Yg=hh("languageConfigurationService");let Qg=class extends T{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new rp),this.onDidChangeEmitter=this._register(new q),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(Xg));this._register(this.configurationService.onDidChangeConfiguration((e=>{const t=e.change.keys.some((e=>i.has(e))),n=e.change.overrides.filter((([e,t])=>t.some((e=>i.has(e))))).map((([e])=>e));if(t)this.configurations.clear(),this.onDidChangeEmitter.fire(new Zg(void 0));else for(const e of n)this.languageService.isRegisteredLanguageId(e)&&(this.configurations.delete(e),this.onDidChangeEmitter.fire(new Zg(e)))}))),this._register(this._registry.onDidChange((e=>{this.configurations.delete(e.languageId),this.onDidChangeEmitter.fire(new Zg(e.languageId))})))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=function(e,t,i,n){let o=t.getLanguageConfiguration(e);if(!o){if(!n.isRegisteredLanguageId(e))return new ap(e,{});o=new ap(e,{})}const s=function(e,t){const i=t.getValue(Xg.brackets,{overrideIdentifier:e}),n=t.getValue(Xg.colorizedBracketPairs,{overrideIdentifier:e});return{brackets:Jg(i),colorizedBracketPairs:Jg(n)}}(o.languageId,i),r=np([o.underlyingConfig,s]);return new ap(o.languageId,r)}(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};Qg=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Gg(0,ug),Gg(1,yu)],Qg);const Xg={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function Jg(e){if(Array.isArray(e))return e.map((e=>{if(Array.isArray(e)&&2===e.length)return[e[0],e[1]]})).filter((e=>!!e))}function ep(e,t,i){let n=_n(e.getLineContent(t));return n.length>i-1&&(n=n.substring(0,i-1)),n}function tp(e,t,i){return e.tokenization.forceTokenization(t),Ru(e.tokenization.getLineTokens(t),void 0===i?e.getLineMaxColumn(t)-1:i-1)}class ip{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new op(e,t,++this._order);return this._entries.push(i),this._resolved=null,I((()=>{for(let e=0;e<this._entries.length;e++)if(this._entries[e]===i){this._entries.splice(e,1),this._resolved=null;break}}))}getResolvedConfiguration(){if(!this._resolved){const e=this._resolve();e&&(this._resolved=new ap(this.languageId,e))}return this._resolved}_resolve(){return 0===this._entries.length?null:(this._entries.sort(op.cmp),np(this._entries.map((e=>e.configuration))))}}function np(e){let t={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const i of e)t={comments:i.comments||t.comments,brackets:i.brackets||t.brackets,wordPattern:i.wordPattern||t.wordPattern,indentationRules:i.indentationRules||t.indentationRules,onEnterRules:i.onEnterRules||t.onEnterRules,autoClosingPairs:i.autoClosingPairs||t.autoClosingPairs,surroundingPairs:i.surroundingPairs||t.surroundingPairs,autoCloseBefore:i.autoCloseBefore||t.autoCloseBefore,folding:i.folding||t.folding,colorizedBracketPairs:i.colorizedBracketPairs||t.colorizedBracketPairs,__electricCharacterSupport:i.__electricCharacterSupport||t.__electricCharacterSupport};return t}class op{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class sp{constructor(e){this.languageId=e}}class rp extends T{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new q),this.onDidChange=this._onDidChange.event,this._register(this.register(Hg,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let n=this._entries.get(e);n||(n=new ip(e),this._entries.set(e,n));const o=n.register(t,i);return this._onDidChange.fire(new sp(e)),I((()=>{o.dispose(),this._onDidChange.fire(new sp(e))}))}getLanguageConfiguration(e){const t=this._entries.get(e);return(null==t?void 0:t.getResolvedConfiguration())||null}}class ap{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new cg(this.underlyingConfig):null,this.comments=ap._handleComments(this.underlyingConfig),this.characterPair=new Fu(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||ku,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new dg(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new Ug(e,this.underlyingConfig)}getWordDefinition(){return Lu(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new eg(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new lg(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}getAutoClosingPairs(){return new Tu(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){const[e,n]=t.blockComment;i.blockCommentStartToken=e,i.blockCommentEndToken=n}return i}}wg(Yg,Qg,1);class lp{constructor(e,t,i,n){this.range=e,this.nestingLevel=t,this.nestingLevelOfEqualBracketType=i,this.isInvalid=n}}class hp{constructor(e,t,i,n,o,s){this.range=e,this.openingBracketRange=t,this.closingBracketRange=i,this.nestingLevel=n,this.nestingLevelOfEqualBracketType=o,this.bracketPairNode=s}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}}class dp extends hp{constructor(e,t,i,n,o,s,r){super(e,t,i,n,o,s),this.minVisibleColumnIndentation=r}}class cp{constructor(e,t){this.lineCount=e,this.columnCount=t}toString(){return`${this.lineCount},${this.columnCount}`}}cp.zero=new cp(0,0);const up=0;function gp(e){return 0===e}const pp=2**26;function mp(e,t){return e*pp+t}function fp(e){const t=e,i=Math.floor(t/pp);return new cp(i,t-i*pp)}function _p(e,t){let i=e+t;return t>=pp&&(i-=e%pp),i}function vp(e,t){return e.reduce(((e,i)=>_p(e,t(i))),up)}function bp(e,t){return e===t}function wp(e,t){const i=e,n=t;if(n-i<=0)return up;const o=Math.floor(i/pp),s=Math.floor(n/pp),r=n-s*pp;return o===s?mp(0,r-(i-o*pp)):mp(s-o,r)}function Cp(e,t){return e<t}function yp(e,t){return e<=t}function Sp(e,t){return e>=t}function kp(e){return mp(e.lineNumber-1,e.column-1)}function Lp(e,t){const i=e,n=Math.floor(i/pp),o=i-n*pp,s=t,r=Math.floor(s/pp);return new tc(n+1,o+1,r+1,s-r*pp+1)}class xp{static fromModelContentChanges(e){const t=e.map((e=>{const t=tc.lift(e.range);return new xp(kp(t.getStartPosition()),kp(t.getEndPosition()),function(e){const t=mn(e);return mp(t.length-1,t[t.length-1].length)}(e.text))})).reverse();return t}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${fp(this.startOffset)}...${fp(this.endOffset)}) -> ${fp(this.newLength)}`}}class Dp{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map((e=>Ep.from(e)))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return null===i?null:wp(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?mp(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):mp(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=fp(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?mp(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):mp(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx<this.edits.length;){const t=this.edits[this.nextEditIdx],i=this.translateOldToCur(t.endOffsetAfterObj);if(!yp(i,e))break;{this.nextEditIdx++;const e=fp(i),n=fp(this.translateOldToCur(t.endOffsetBeforeObj)),o=e.lineCount-n.lineCount;this.deltaOldToNewLineCount+=o;const s=this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0,r=e.columnCount-n.columnCount;this.deltaOldToNewColumnCount=s+r,this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}}}}class Ep{static from(e){return new Ep(e.startOffset,e.endOffset,e.newLength)}constructor(e,t,i){this.endOffsetBeforeObj=fp(t),this.endOffsetAfterObj=fp(_p(e,i)),this.offsetObj=fp(e)}}const Np=[];class Ip{static create(e,t){if(e<=128&&0===t.length){let i=Ip.cache[e];return i||(i=new Ip(e,t),Ip.cache[e]=i),i}return new Ip(e,t)}static getEmpty(){return this.empty}constructor(e,t){this.items=e,this.additionalItems=t}add(e,t){const i=t.getKey(e);let n=i>>5;if(0===n){const e=1<<i|this.items;return e===this.items?this:Ip.create(e,this.additionalItems)}n--;const o=this.additionalItems.slice(0);for(;o.length<n;)o.push(0);return o[n]|=1<<(31&i),Ip.create(this.items,o)}merge(e){const t=this.items|e.items;if(this.additionalItems===Np&&e.additionalItems===Np)return t===this.items?this:t===e.items?e:Ip.create(t,Np);const i=[];for(let t=0;t<Math.max(this.additionalItems.length,e.additionalItems.length);t++){const n=this.additionalItems[t]||0,o=e.additionalItems[t]||0;i.push(n|o)}return Ip.create(t,i)}intersects(e){if(0!=(this.items&e.items))return!0;for(let t=0;t<Math.min(this.additionalItems.length,e.additionalItems.length);t++)if(0!=(this.additionalItems[t]&e.additionalItems[t]))return!0;return!1}}Ip.cache=new Array(129),Ip.empty=Ip.create(0,Np);const Mp={getKey:e=>e};class Tp{constructor(){this.items=new Map}getKey(e){let t=this.items.get(e);return void 0===t&&(t=this.items.size,this.items.set(e,t)),t}}class Ap{get length(){return this._length}constructor(e){this._length=e}}class Rp extends Ap{static create(e,t,i){let n=e.length;return t&&(n=_p(n,t.length)),i&&(n=_p(n,i.length)),new Rp(n,e,t,i,t?t.missingOpeningBracketIds:Ip.getEmpty())}get kind(){return 2}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw new Error("Invalid child index")}get children(){const e=[];return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}constructor(e,t,i,n,o){super(e),this.openingBracket=t,this.child=i,this.closingBracket=n,this.missingOpeningBracketIds=o}canBeReused(e){return null!==this.closingBracket&&!e.intersects(this.missingOpeningBracketIds)}deepClone(){return new Rp(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation(_p(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class Op extends Ap{static create23(e,t,i,n=!1){let o=e.length,s=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(o=_p(o,t.length),s=s.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");o=_p(o,i.length),s=s.merge(i.missingOpeningBracketIds)}return n?new Fp(o,e.listHeight+1,e,t,i,s):new Pp(o,e.listHeight+1,e,t,i,s)}static getEmpty(){return new Wp(up,0,[],Ip.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}constructor(e,t,i){super(e),this.listHeight=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();const e=this.childrenLength;if(0===e)return;const t=this.getChild(e-1),i=4===t.kind?t.toMutable():t;return t!==i&&this.setChild(e-1,i),i}makeFirstElementMutable(){if(this.throwIfImmutable(),0===this.childrenLength)return;const e=this.getChild(0),t=4===e.kind?e.toMutable():e;return e!==t&&this.setChild(0,t),t}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds))return!1;if(0===this.childrenLength)return!1;let t=this;for(;4===t.kind;){const e=t.childrenLength;if(0===e)throw new b;t=t.getChild(e-1)}return t.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();const e=this.childrenLength;let t=this.getChild(0).length,i=this.getChild(0).missingOpeningBracketIds;for(let n=1;n<e;n++){const e=this.getChild(n);t=_p(t,e.length),i=i.merge(e.missingOpeningBracketIds)}this._length=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}computeMinIndentation(e,t){if(-1!==this.cachedMinIndentation)return this.cachedMinIndentation;let i=Number.MAX_SAFE_INTEGER,n=e;for(let e=0;e<this.childrenLength;e++){const o=this.getChild(e);o&&(i=Math.min(i,o.computeMinIndentation(n,t)),n=_p(n,o.length))}return this.cachedMinIndentation=i,i}}class Pp extends Op{get childrenLength(){return null!==this._item3?3:2}getChild(e){switch(e){case 0:return this._item1;case 1:return this._item2;case 2:return this._item3}throw new Error("Invalid child index")}setChild(e,t){switch(e){case 0:return void(this._item1=t);case 1:return void(this._item2=t);case 2:return void(this._item3=t)}throw new Error("Invalid child index")}get children(){return this._item3?[this._item1,this._item2,this._item3]:[this._item1,this._item2]}get item1(){return this._item1}get item2(){return this._item2}get item3(){return this._item3}constructor(e,t,i,n,o,s){super(e,t,s),this._item1=i,this._item2=n,this._item3=o}deepClone(){return new Pp(this.length,this.listHeight,this._item1.deepClone(),this._item2.deepClone(),this._item3?this._item3.deepClone():null,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){if(this._item3)throw new Error("Cannot append to a full (2,3) tree node");this.throwIfImmutable(),this._item3=e,this.handleChildrenChanged()}unappendChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item3;return this._item3=null,this.handleChildrenChanged(),e}prependChildOfSameHeight(e){if(this._item3)throw new Error("Cannot prepend to a full (2,3) tree node");this.throwIfImmutable(),this._item3=this._item2,this._item2=this._item1,this._item1=e,this.handleChildrenChanged()}unprependChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item1;return this._item1=this._item2,this._item2=this._item3,this._item3=null,this.handleChildrenChanged(),e}toMutable(){return this}}class Fp extends Pp{toMutable(){return new Pp(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}class Bp extends Op{get childrenLength(){return this._children.length}getChild(e){return this._children[e]}setChild(e,t){this._children[e]=t}get children(){return this._children}constructor(e,t,i,n){super(e,t,n),this._children=i}deepClone(){const e=new Array(this._children.length);for(let t=0;t<this._children.length;t++)e[t]=this._children[t].deepClone();return new Bp(this.length,this.listHeight,e,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){this.throwIfImmutable(),this._children.push(e),this.handleChildrenChanged()}unappendChild(){this.throwIfImmutable();const e=this._children.pop();return this.handleChildrenChanged(),e}prependChildOfSameHeight(e){this.throwIfImmutable(),this._children.unshift(e),this.handleChildrenChanged()}unprependChild(){this.throwIfImmutable();const e=this._children.shift();return this.handleChildrenChanged(),e}toMutable(){return this}}class Wp extends Bp{toMutable(){return new Bp(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}const Vp=[];class zp extends Ap{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return Vp}deepClone(){return this}}class Hp extends zp{get kind(){return 0}get missingOpeningBracketIds(){return Ip.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){const i=fp(e),n=(0===i.columnCount?i.lineCount:i.lineCount+1)+1,o=(s=_p(e,this.length),Math.floor(s/pp)+1);var s;let r=Number.MAX_SAFE_INTEGER;for(let e=n;e<=o;e++){const i=t.getLineFirstNonWhitespaceColumn(e),n=t.getLineContent(e);if(0===i)continue;const o=lu.visibleColumnFromColumn(n,i,t.getOptions().tabSize);r=Math.min(r,o)}return r}}class Up extends zp{static create(e,t,i){return new Up(e,t,i)}get kind(){return 1}get missingOpeningBracketIds(){return Ip.getEmpty()}constructor(e,t,i){super(e),this.bracketInfo=t,this.bracketIds=i}get text(){return this.bracketInfo.bracketText}get languageId(){return this.bracketInfo.languageId}canBeReused(e){return!1}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class Kp extends zp{get kind(){return 3}constructor(e,t){super(t),this.missingOpeningBracketIds=e}canBeReused(e){return!e.intersects(this.missingOpeningBracketIds)}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class jp{static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(768&e)>>>8}static containsBalancedBrackets(e){return 0!=(1024&e)}static getFontStyle(e){return(30720&e)>>>11}static getForeground(e){return(16744448&e)>>>15}static getBackground(e){return(4278190080&e)>>>24}static getClassNameFromMetadata(e){let t="mtk"+this.getForeground(e);const i=this.getFontStyle(e);return 1&i&&(t+=" mtki"),2&i&&(t+=" mtkb"),4&i&&(t+=" mtku"),8&i&&(t+=" mtks"),t}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),n=this.getFontStyle(e);let o=`color: ${t[i]};`;1&n&&(o+="font-style: italic;"),2&n&&(o+="font-weight: bold;");let s="";return 4&n&&(s+=" underline"),8&n&&(s+=" line-through"),s&&(o+=`text-decoration:${s};`),o}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:Boolean(1&i),bold:Boolean(2&i),underline:Boolean(4&i),strikethrough:Boolean(8&i)}}}class qp{constructor(e,t,i,n,o){this.length=e,this.kind=t,this.bracketId=i,this.bracketIds=n,this.astNode=o}}class $p{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new Gp(this.textModel,this.bracketTokens),this._offset=up,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return mp(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=_p(this._offset,e);const t=fp(this._offset);this.reader.setPosition(t.lineCount,t.columnCount)}read(){let e;return this.peeked?(this.didPeek=!1,e=this.peeked):e=this.reader.read(),e&&(this._offset=_p(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class Gp{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}setPosition(e,t){e===this.lineIdx?(this.lineCharOffset=t,null!==this.line&&(this.lineTokenOffset=0===this.lineCharOffset?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))):(this.lineIdx=e,this.lineCharOffset=t,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){const e=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=e.length,e}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;null===this.line&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=0===this.lineCharOffset?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const n=this.lineTokens,o=n.getCount();let s=null;if(this.lineTokenOffset<o){const r=n.getMetadata(this.lineTokenOffset);for(;this.lineTokenOffset+1<o&&r===n.getMetadata(this.lineTokenOffset+1);)this.lineTokenOffset++;const a=0===jp.getTokenType(r),l=jp.containsBalancedBrackets(r),h=n.getEndOffset(this.lineTokenOffset);if(l&&a&&this.lineCharOffset<h){const e=n.getLanguageId(this.lineTokenOffset),t=this.line.substring(this.lineCharOffset,h),i=this.bracketTokens.getSingleLanguageBracketTokens(e),o=i.regExpGlobal;if(o){o.lastIndex=0;const e=o.exec(t);e&&(s=i.getToken(e[0]),s&&(this.lineCharOffset+=e.index))}}if(i+=h-this.lineCharOffset,s){if(e!==this.lineIdx||t!==this.lineCharOffset){this.peekedToken=s;break}return this.lineCharOffset+=s.length,s}this.lineTokenOffset++,this.lineCharOffset=h}else{if(this.lineIdx===this.textBufferLineCount-1)break;if(this.lineIdx++,this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.lineTokenOffset=0,this.line=this.lineTokens.getLineContent(),this.lineCharOffset=0,i+=33,i>1e3)break}if(i>1500)break}const n=(o=e,s=t,r=this.lineIdx,a=this.lineCharOffset,o!==r?mp(r-o,a):mp(0,a-s));var o,s,r,a;return new qp(n,0,-1,Ip.getEmpty(),new Hp(n))}}class Zp{constructor(e,t){this.text=e,this._offset=up,this.idx=0;const i=t.getRegExpStr(),n=i?new RegExp(i+"|\n","gi"):null,o=[];let s,r=0,a=0,l=0,h=0;const d=[];for(let e=0;e<60;e++)d.push(new qp(mp(0,e),0,-1,Ip.getEmpty(),new Hp(mp(0,e))));const c=[];for(let e=0;e<60;e++)c.push(new qp(mp(1,e),0,-1,Ip.getEmpty(),new Hp(mp(1,e))));if(n)for(n.lastIndex=0;null!==(s=n.exec(e));){const e=s.index,i=s[0];if("\n"===i)r++,a=e+1;else{if(l!==e){let t;if(h===r){const i=e-l;if(i<d.length)t=d[i];else{const e=mp(0,i);t=new qp(e,0,-1,Ip.getEmpty(),new Hp(e))}}else{const i=r-h,n=e-a;if(1===i&&n<c.length)t=c[n];else{const e=mp(i,n);t=new qp(e,0,-1,Ip.getEmpty(),new Hp(e))}}o.push(t)}o.push(t.getToken(i)),l=e+i.length,h=r}}const u=e.length;if(l!==u){const e=h===r?mp(0,u-l):mp(r-h,u-a);o.push(new qp(e,0,-1,Ip.getEmpty(),new Hp(e)))}this.length=mp(r,u-a),this.tokens=o}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new _}}class Yp{static createFromLanguage(e,t){function i(e){return t.getKey(`${e.languageId}:::${e.bracketText}`)}const n=new Map;for(const t of e.bracketsNew.openingBrackets){const e=mp(0,t.bracketText.length),o=i(t),s=Ip.getEmpty().add(o,Mp);n.set(t.bracketText,new qp(e,1,o,s,Up.create(e,t,s)))}for(const t of e.bracketsNew.closingBrackets){const e=mp(0,t.bracketText.length);let o=Ip.getEmpty();const s=t.getOpeningBrackets();for(const e of s)o=o.add(i(e),Mp);n.set(t.bracketText,new qp(e,2,i(s[0]),o,Up.create(e,t,o)))}return new Yp(n)}constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}getRegExpStr(){if(this.isEmpty)return null;{const e=[...this.map.keys()];return e.sort(),e.reverse(),e.map((e=>function(e){let t=dn(e);return/^[\w ]+/.test(e)&&(t=`\\b${t}`),/[\w ]+$/.test(e)&&(t=`${t}\\b`),t}(e))).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(2===i.kind&&i.bracketIds.intersects(e))return t}get isEmpty(){return 0===this.map.size}}class Qp{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=Yp.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function Xp(e,t=!1){if(0===e.length)return null;if(1===e.length)return e[0];let i=e.length;for(;i>3;){const n=i>>1;for(let o=0;o<n;o++){const n=o<<1;e[o]=Op.create23(e[n],e[n+1],n+3===i?e[n+2]:null,t)}i=n}return Op.create23(e[0],e[1],i>=3?e[2]:null,t)}function Jp(e,t){return Math.abs(e.listHeight-t.listHeight)}function em(e,t){return e.listHeight===t.listHeight?Op.create23(e,t,null,!1):e.listHeight>t.listHeight?function(e,t){let i=e=e.toMutable();const n=[];let o;for(;;){if(t.listHeight===i.listHeight){o=t;break}if(4!==i.kind)throw new Error("unexpected");n.push(i),i=i.makeLastElementMutable()}for(let e=n.length-1;e>=0;e--){const t=n[e];o?t.childrenLength>=3?o=Op.create23(t.unappendChild(),o,null,!1):(t.appendChildOfSameHeight(o),o=void 0):t.handleChildrenChanged()}return o?Op.create23(e,o,null,!1):e}(e,t):function(e,t){let i=e=e.toMutable();const n=[];for(;t.listHeight!==i.listHeight;){if(4!==i.kind)throw new Error("unexpected");n.push(i),i=i.makeFirstElementMutable()}let o=t;for(let e=n.length-1;e>=0;e--){const t=n[e];o?t.childrenLength>=3?o=Op.create23(o,t.unprependChild(),null,!1):(t.prependChildOfSameHeight(o),o=void 0):t.handleChildrenChanged()}return o?Op.create23(o,e,null,!1):e}(t,e)}class tm{constructor(e){this.lastOffset=up,this.nextNodes=[e],this.offsets=[up],this.idxs=[]}readLongestNodeAt(e,t){if(Cp(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=nm(this.nextNodes);if(!i)return;const n=nm(this.offsets);if(Cp(e,n))return;if(Cp(n,e))if(_p(n,i.length)<=e)this.nextNodeAfterCurrent();else{const e=im(i);-1!==e?(this.nextNodes.push(i.getChild(e)),this.offsets.push(n),this.idxs.push(e)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const e=im(i);if(-1===e)return void this.nextNodeAfterCurrent();this.nextNodes.push(i.getChild(e)),this.offsets.push(n),this.idxs.push(e)}}}}nextNodeAfterCurrent(){for(;;){const e=nm(this.offsets),t=nm(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),0===this.idxs.length)break;const i=nm(this.nextNodes),n=im(i,this.idxs[this.idxs.length-1]);if(-1!==n){this.nextNodes.push(i.getChild(n)),this.offsets.push(_p(e,t.length)),this.idxs[this.idxs.length-1]=n;break}this.idxs.pop()}}}function im(e,t=-1){for(;;){if(++t>=e.childrenLength)return-1;if(e.getChild(t))return t}}function nm(e){return e.length>0?e[e.length-1]:void 0}function om(e,t,i,n){return new sm(e,t,i,n).parseDocument()}class sm{constructor(e,t,i,n){if(this.tokenizer=e,this.createImmutableLists=n,this._itemsConstructed=0,this._itemsFromCache=0,i&&n)throw new Error("Not supported");this.oldNodeReader=i?new tm(i):void 0,this.positionMapper=new Dp(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(Ip.getEmpty(),0);return e||(e=Op.getEmpty()),e}parseList(e,t){const i=[];for(;;){let n=this.tryReadChildFromCache(e);if(!n){const i=this.tokenizer.peek();if(!i||2===i.kind&&i.bracketIds.intersects(e))break;n=this.parseChild(e,t+1)}4===n.kind&&0===n.childrenLength||i.push(n)}const n=this.oldNodeReader?function(e){if(0===e.length)return null;if(1===e.length)return e[0];let t=0;function i(){if(t>=e.length)return null;const i=t,n=e[i].listHeight;for(t++;t<e.length&&e[t].listHeight===n;)t++;return t-i>=2?Xp(0===i&&t===e.length?e:e.slice(i,t),!1):e[i]}let n=i(),o=i();if(!o)return n;for(let e=i();e;e=i())Jp(n,o)<=Jp(o,e)?(n=em(n,o),o=e):o=em(o,e);return em(n,o)}(i):Xp(i,this.createImmutableLists);return n}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(null===t||!gp(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),(i=>!(null!==t&&!Cp(i.length,t))&&i.canBeReused(e)));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e,t){this._itemsConstructed++;const i=this.tokenizer.read();switch(i.kind){case 2:return new Kp(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new Hp(i.length);const n=e.merge(i.bracketIds),o=this.parseList(n,t+1),s=this.tokenizer.peek();return s&&2===s.kind&&(s.bracketId===i.bracketId||s.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),Rp.create(i.astNode,o,s.astNode)):Rp.create(i.astNode,o,null)}default:throw new Error("unexpected")}}}function rm(e,t){if(0===e.length)return t;if(0===t.length)return e;const i=new eu(lm(e)),n=lm(t);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let o=i.dequeue();function s(e){if(void 0===e){const e=i.takeWhile((e=>!0))||[];return o&&e.unshift(o),e}const t=[];for(;o&&!gp(e);){const[n,s]=o.splitAt(e);t.push(n),e=wp(n.lengthAfter,e),o=null!=s?s:i.dequeue()}return gp(e)||t.push(new am(!1,e,e)),t}const r=[];function a(e,t,i){if(r.length>0&&bp(r[r.length-1].endOffset,e)){const e=r[r.length-1];r[r.length-1]=new xp(e.startOffset,t,_p(e.newLength,i))}else r.push({startOffset:e,endOffset:t,newLength:i})}let l=up;for(const e of n){const t=s(e.lengthBefore);if(e.modified){const i=_p(l,vp(t,(e=>e.lengthBefore)));a(l,i,e.lengthAfter),l=i}else for(const e of t){const t=l;l=_p(l,e.lengthBefore),e.modified&&a(t,l,e.lengthAfter)}}return r}class am{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=wp(e,this.lengthAfter);return bp(t,up)?[this,void 0]:this.modified?[new am(this.modified,this.lengthBefore,e),new am(this.modified,up,t)]:[new am(this.modified,e,e),new am(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${fp(this.lengthBefore)} -> ${fp(this.lengthAfter)}`}}function lm(e){const t=[];let i=up;for(const n of e){const e=wp(i,n.startOffset);gp(e)||t.push(new am(!1,e,e));const o=wp(n.startOffset,n.endOffset);t.push(new am(!0,o,n.newLength)),i=n.endOffset}return t}class hm extends T{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new q,this.denseKeyProvider=new Tp,this.brackets=new Qp(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)2===e.tokenization.backgroundTokenizationState?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const e=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),t=new Zp(this.textModel.getValue(),e);this.initialAstWithoutTokens=om(t,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(2===this.textModel.tokenization.backgroundTokenizationState){const e=void 0===this.initialAstWithoutTokens;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map((e=>new xp(mp(e.fromLineNumber-1,0),mp(e.toLineNumber,0),mp(e.toLineNumber-e.fromLineNumber+1,0))));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=xp.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=rm(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=rm(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){const n=t;return om(new $p(this.textModel,this.brackets),e,n,i)}getBracketsInRange(e,t){this.flushQueue();const i=mp(e.startLineNumber-1,e.startColumn-1),n=mp(e.endLineNumber-1,e.endColumn-1);return new tu((e=>{const o=this.initialAstWithoutTokens||this.astWithTokens;um(o,up,o.length,i,n,e,0,0,new Map,t)}))}getBracketPairsInRange(e,t){this.flushQueue();const i=kp(e.getStartPosition()),n=kp(e.getEndPosition());return new tu((e=>{const o=this.initialAstWithoutTokens||this.astWithTokens,s=new gm(e,t,this.textModel);pm(o,up,o.length,i,n,s,0,new Map)}))}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return cm(t,up,t.length,kp(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return dm(t,up,t.length,kp(e))}}function dm(e,t,i,n){if(4===e.kind||2===e.kind){const o=[];for(const n of e.children)i=_p(t,n.length),o.push({nodeOffsetStart:t,nodeOffsetEnd:i}),t=i;for(let t=o.length-1;t>=0;t--){const{nodeOffsetStart:i,nodeOffsetEnd:s}=o[t];if(Cp(i,n)){const o=dm(e.children[t],i,s,n);if(o)return o}}return null}if(3===e.kind)return null;if(1===e.kind){const n=Lp(t,i);return{bracketInfo:e.bracketInfo,range:n}}return null}function cm(e,t,i,n){if(4===e.kind||2===e.kind){for(const o of e.children){if(Cp(n,i=_p(t,o.length))){const e=cm(o,t,i,n);if(e)return e}t=i}return null}if(3===e.kind)return null;if(1===e.kind){const n=Lp(t,i);return{bracketInfo:e.bracketInfo,range:n}}return null}function um(e,t,i,n,o,s,r,a,l,h,d=!1){if(r>200)return!0;e:for(;;)switch(e.kind){case 4:{const a=e.childrenLength;for(let d=0;d<a;d++){const a=e.getChild(d);if(a){if(i=_p(t,a.length),yp(t,o)&&Sp(i,n)){if(Sp(i,o)){e=a;continue e}if(!um(a,t,i,n,o,s,r,0,l,h))return!1}t=i}}return!0}case 2:{const d=!h||!e.closingBracket||e.closingBracket.bracketInfo.closesColorized(e.openingBracket.bracketInfo);let c=0;if(l){let t=l.get(e.openingBracket.text);void 0===t&&(t=0),c=t,d&&(t++,l.set(e.openingBracket.text,t))}const u=e.childrenLength;for(let g=0;g<u;g++){const u=e.getChild(g);if(u){if(i=_p(t,u.length),yp(t,o)&&Sp(i,n)){if(Sp(i,o)&&1!==u.kind){e=u,d?(r++,a=c+1):a=c;continue e}if((d||1!==u.kind||!e.closingBracket)&&!um(u,t,i,n,o,s,d?r+1:r,d?c+1:c,l,h,!e.closingBracket))return!1}t=i}}return null==l||l.set(e.openingBracket.text,c),!0}case 3:{const e=Lp(t,i);return s(new lp(e,r-1,0,!0))}case 1:{const e=Lp(t,i);return s(new lp(e,r-1,a-1,d))}case 0:return!0}}class gm{constructor(e,t,i){this.push=e,this.includeMinIndentation=t,this.textModel=i}}function pm(e,t,i,n,o,s,r,a){var l;if(r>200)return!0;let h=!0;if(2===e.kind){let d=0;if(a){let t=a.get(e.openingBracket.text);void 0===t&&(t=0),d=t,t++,a.set(e.openingBracket.text,t)}const c=_p(t,e.openingBracket.length);let u=-1;if(s.includeMinIndentation&&(u=e.computeMinIndentation(t,s.textModel)),h=s.push(new dp(Lp(t,i),Lp(t,c),e.closingBracket?Lp(_p(c,(null===(l=e.child)||void 0===l?void 0:l.length)||up),i):void 0,r,d,e,u)),t=c,h&&e.child){const l=e.child;if(i=_p(t,l.length),yp(t,o)&&Sp(i,n)&&(h=pm(l,t,i,n,o,s,r+1,a),!h))return!1}null==a||a.set(e.openingBracket.text,d)}else{let i=t;for(const t of e.children){const e=i;if(i=_p(i,t.length),yp(e,o)&&yp(n,i)&&(h=pm(t,e,i,n,o,s,r,a),!h))return!1}}return h}class mm extends T{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new A),this.onDidChangeEmitter=new q,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange((e=>{var t;e.languageId&&!(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.didLanguageChange(e.languageId))||(this.bracketPairsTree.clear(),this.updateBracketPairsTree())})))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;null===(t=this.bracketPairsTree.value)||void 0===t||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;null===(e=this.bracketPairsTree.value)||void 0===e||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;null===(t=this.bracketPairsTree.value)||void 0===t||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const i=new M;this.bracketPairsTree.value=(e=i.add(new hm(this.textModel,(e=>this.languageConfigurationService.getLanguageConfiguration(e)))),t=i,{object:e,dispose:()=>null==t?void 0:t.dispose()}),i.add(this.bracketPairsTree.value.object.onDidChange((e=>this.onDidChangeEmitter.fire(e)))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire());var e,t}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getBracketPairsInRange(e,!1))||tu.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getBracketPairsInRange(e,!0))||tu.empty}getBracketsInRange(e,t=!1){var i;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(i=this.bracketPairsTree.value)||void 0===i?void 0:i.object.getBracketsInRange(e,t))||tu.empty}findMatchingBracketUp(e,t,i){const n=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(n.lineNumber,n.column);if(this.canBuildAST){const i=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!i)return null;const n=this.getBracketPairsInRange(tc.fromPositions(t,t)).findLast((e=>i.closes(e.openingBracketInfo)));return n?n.openingBracketRange:null}{const t=e.toLowerCase(),s=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!s)return null;const r=s.textIsBracket[t];return r?vm(this._findMatchingBracketUp(r,n,fm(i))):null}}matchBracket(e,t){if(this.canBuildAST){const t=this.getBracketPairsInRange(tc.fromPositions(e,e)).filter((t=>void 0!==t.closingBracketRange&&(t.openingBracketRange.containsPosition(e)||t.closingBracketRange.containsPosition(e)))).findLastMaxBy(Yc((t=>t.openingBracketRange.containsPosition(e)?t.openingBracketRange:t.closingBracketRange),tc.compareRangesUsingStarts));return t?[t.openingBracketRange,t.closingBracketRange]:null}{const i=fm(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,n){const o=t.getCount(),s=t.getLanguageId(n);let r=Math.max(0,e.column-1-i.maxBracketLength);for(let e=n-1;e>=0;e--){const i=t.getEndOffset(e);if(i<=r)break;if(Pu(t.getStandardTokenType(e))||t.getLanguageId(e)!==s){r=i;break}}let a=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let e=n+1;e<o;e++){const i=t.getStartOffset(e);if(i>=a)break;if(Pu(t.getStandardTokenType(e))||t.getLanguageId(e)!==s){a=i;break}}return{searchStartOffset:r,searchEndOffset:a}}_matchBracket(e,t){const i=e.lineNumber,n=this.textModel.tokenization.getLineTokens(i),o=this.textModel.getLineContent(i),s=n.findTokenIndexAtOffset(e.column-1);if(s<0)return null;const r=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(s)).brackets;if(r&&!Pu(n.getStandardTokenType(s))){let{searchStartOffset:a,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,r,s),h=null;for(;;){const n=ag.findNextBracketInRange(r.forwardRegex,i,o,a,l);if(!n)break;if(n.startColumn<=e.column&&e.column<=n.endColumn){const e=o.substring(n.startColumn-1,n.endColumn-1).toLowerCase(),i=this._matchFoundBracket(n,r.textIsBracket[e],r.textIsOpenBracket[e],t);if(i){if(i instanceof _m)return null;h=i}}a=n.endColumn-1}if(h)return h}if(s>0&&n.getStartOffset(s)===e.column-1){const r=s-1,a=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(r)).brackets;if(a&&!Pu(n.getStandardTokenType(r))){const{searchStartOffset:s,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,a,r),h=ag.findPrevBracketInRange(a.reversedRegex,i,o,s,l);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const e=o.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),i=this._matchFoundBracket(h,a.textIsBracket[e],a.textIsOpenBracket[e],t);if(i)return i instanceof _m?null:i}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return o?o instanceof _m?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,o=e.reversedRegex;let s=-1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return _m.INSTANCE;const h=ag.findPrevBracketInRange(o,t,n,a,l);if(!h)break;const d=n.substring(h.startColumn-1,h.endColumn-1).toLowerCase();if(e.isOpen(d)?s++:e.isClose(d)&&s--,0===s)return h;l=h.startColumn-1}return null};for(let e=t.lineNumber;e>=1;e--){const i=this.textModel.tokenization.getLineTokens(e),o=i.getCount(),s=this.textModel.getLineContent(e);let r=o-1,l=s.length,h=s.length;e===t.lineNumber&&(r=i.findTokenIndexAtOffset(t.column-1),l=t.column-1,h=t.column-1);let d=!0;for(;r>=0;r--){const t=i.getLanguageId(r)===n&&!Pu(i.getStandardTokenType(r));if(t)d?l=i.getStartOffset(r):(l=i.getStartOffset(r),h=i.getEndOffset(r));else if(d&&l!==h){const t=a(e,s,l,h);if(t)return t}d=t}if(d&&l!==h){const t=a(e,s,l,h);if(t)return t}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageId,o=e.forwardRegex;let s=1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return _m.INSTANCE;const h=ag.findNextBracketInRange(o,t,n,a,l);if(!h)break;const d=n.substring(h.startColumn-1,h.endColumn-1).toLowerCase();if(e.isOpen(d)?s++:e.isClose(d)&&s--,0===s)return h;a=h.endColumn-1}return null},l=this.textModel.getLineCount();for(let e=t.lineNumber;e<=l;e++){const i=this.textModel.tokenization.getLineTokens(e),o=i.getCount(),s=this.textModel.getLineContent(e);let r=0,l=0,h=0;e===t.lineNumber&&(r=i.findTokenIndexAtOffset(t.column-1),l=t.column-1,h=t.column-1);let d=!0;for(;r<o;r++){const t=i.getLanguageId(r)===n&&!Pu(i.getStandardTokenType(r));if(t)d||(l=i.getStartOffset(r)),h=i.getEndOffset(r);else if(d&&l!==h){const t=a(e,s,l,h);if(t)return t}d=t}if(d&&l!==h){const t=a(e,s,l,h);if(t)return t}}return null}findPrevBracket(e){var t;const i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getFirstBracketBefore(i))||null;let n=null,o=null,s=null;for(let e=i.lineNumber;e>=1;e--){const t=this.textModel.tokenization.getLineTokens(e),r=t.getCount(),a=this.textModel.getLineContent(e);let l=r-1,h=a.length,d=a.length;if(e===i.lineNumber){l=t.findTokenIndexAtOffset(i.column-1),h=i.column-1,d=i.column-1;const e=t.getLanguageId(l);n!==e&&(n=e,o=this.languageConfigurationService.getLanguageConfiguration(n).brackets,s=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let c=!0;for(;l>=0;l--){const i=t.getLanguageId(l);if(n!==i){if(o&&s&&c&&h!==d){const t=ag.findPrevBracketInRange(o.reversedRegex,e,a,h,d);if(t)return this._toFoundBracket(s,t);c=!1}n=i,o=this.languageConfigurationService.getLanguageConfiguration(n).brackets,s=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew}const r=!!o&&!Pu(t.getStandardTokenType(l));if(r)c?h=t.getStartOffset(l):(h=t.getStartOffset(l),d=t.getEndOffset(l));else if(s&&o&&c&&h!==d){const t=ag.findPrevBracketInRange(o.reversedRegex,e,a,h,d);if(t)return this._toFoundBracket(s,t)}c=r}if(s&&o&&c&&h!==d){const t=ag.findPrevBracketInRange(o.reversedRegex,e,a,h,d);if(t)return this._toFoundBracket(s,t)}}return null}findNextBracket(e){var t;const i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getFirstBracketAfter(i))||null;const n=this.textModel.getLineCount();let o=null,s=null,r=null;for(let e=i.lineNumber;e<=n;e++){const t=this.textModel.tokenization.getLineTokens(e),n=t.getCount(),a=this.textModel.getLineContent(e);let l=0,h=0,d=0;if(e===i.lineNumber){l=t.findTokenIndexAtOffset(i.column-1),h=i.column-1,d=i.column-1;const e=t.getLanguageId(l);o!==e&&(o=e,s=this.languageConfigurationService.getLanguageConfiguration(o).brackets,r=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let c=!0;for(;l<n;l++){const i=t.getLanguageId(l);if(o!==i){if(r&&s&&c&&h!==d){const t=ag.findNextBracketInRange(s.forwardRegex,e,a,h,d);if(t)return this._toFoundBracket(r,t);c=!1}o=i,s=this.languageConfigurationService.getLanguageConfiguration(o).brackets,r=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew}const n=!!s&&!Pu(t.getStandardTokenType(l));if(n)c||(h=t.getStartOffset(l)),d=t.getEndOffset(l);else if(r&&s&&c&&h!==d){const t=ag.findNextBracketInRange(s.forwardRegex,e,a,h,d);if(t)return this._toFoundBracket(r,t)}c=n}if(r&&s&&c&&h!==d){const t=ag.findNextBracketInRange(s.forwardRegex,e,a,h,d);if(t)return this._toFoundBracket(r,t)}}return null}findEnclosingBrackets(e,t){const i=this.textModel.validatePosition(e);if(this.canBuildAST){const e=tc.fromPositions(i),t=this.getBracketPairsInRange(tc.fromPositions(i,i)).findLast((t=>void 0!==t.closingBracketRange&&t.range.strictContainsRange(e)));return t?[t.openingBracketRange,t.closingBracketRange]:null}const n=fm(t),o=this.textModel.getLineCount(),s=new Map;let r=[];const a=(e,t)=>{if(!s.has(e)){const i=[];for(let e=0,n=t?t.brackets.length:0;e<n;e++)i[e]=0;s.set(e,i)}r=s.get(e)};let l=0;const h=(e,t,i,o,s)=>{for(;;){if(n&&++l%100==0&&!n())return _m.INSTANCE;const a=ag.findNextBracketInRange(e.forwardRegex,t,i,o,s);if(!a)break;const h=i.substring(a.startColumn-1,a.endColumn-1).toLowerCase(),d=e.textIsBracket[h];if(d&&(d.isOpen(h)?r[d.index]++:d.isClose(h)&&r[d.index]--,-1===r[d.index]))return this._matchFoundBracket(a,d,!1,n);o=a.endColumn-1}return null};let d=null,c=null;for(let e=i.lineNumber;e<=o;e++){const t=this.textModel.tokenization.getLineTokens(e),n=t.getCount(),o=this.textModel.getLineContent(e);let s=0,r=0,l=0;if(e===i.lineNumber){s=t.findTokenIndexAtOffset(i.column-1),r=i.column-1,l=i.column-1;const e=t.getLanguageId(s);d!==e&&(d=e,c=this.languageConfigurationService.getLanguageConfiguration(d).brackets,a(d,c))}let u=!0;for(;s<n;s++){const i=t.getLanguageId(s);if(d!==i){if(c&&u&&r!==l){const t=h(c,e,o,r,l);if(t)return vm(t);u=!1}d=i,c=this.languageConfigurationService.getLanguageConfiguration(d).brackets,a(d,c)}const n=!!c&&!Pu(t.getStandardTokenType(s));if(n)u||(r=t.getStartOffset(s)),l=t.getEndOffset(s);else if(c&&u&&r!==l){const t=h(c,e,o,r,l);if(t)return vm(t)}u=n}if(c&&u&&r!==l){const t=h(c,e,o,r,l);if(t)return vm(t)}}return null}_toFoundBracket(e,t){if(!t)return null;let i=this.textModel.getValueInRange(t);i=i.toLowerCase();const n=e.getBracketInfo(i);return n?{range:t,bracketInfo:n}:null}}function fm(e){if(void 0===e)return()=>!0;{const t=Date.now();return()=>Date.now()-t<=e}}class _m{constructor(){this._searchCanceledBrand=void 0}}function vm(e){return e instanceof _m?null:e}function bm(e){return`--vscode-${e.replace(/\./g,"-")}`}function wm(e){return`var(${bm(e)})`}_m.INSTANCE=new _m;const Cm="base.contributions.colors",ym=new class{constructor(){this._onDidChangeSchema=new q,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,n=!1,o){const s={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:o};this.colorsById[e]=s;const r={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(r.deprecationMessage=o),this.colorSchema.properties[e]=r,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map((e=>this.colorsById[e]))}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults)return Lv(i.defaults[t.type],t)}getColorSchema(){return this.colorSchema}toString(){return Object.keys(this.colorsById).sort(((e,t)=>{const i=-1===e.indexOf(".")?0:1,n=-1===t.indexOf(".")?0:1;return i!==n?i-n:e.localeCompare(t)})).map((e=>`- \`${e}\`: ${this.colorsById[e].description}`)).join("\n")}};function Sm(e,t,i,n,o){return ym.registerColor(e,t,i,n,o)}md.add(Cm,ym);const km=Sm("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},me(0,"Overall foreground color. This color is only used if not overridden by a component.")),Lm=(Sm("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},me(0,"Overall foreground for disabled elements. This color is only used if not overridden by a component.")),Sm("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},me(0,"Overall foreground color for error messages. This color is only used if not overridden by a component."))),xm=(Sm("descriptionForeground",{light:"#717171",dark:yv(km,.7),hcDark:yv(km,.7),hcLight:yv(km,.7)},me(0,"Foreground color for description text providing additional information, for example for a label.")),Sm("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},me(0,"The default color for icons in the workbench."))),Dm=Sm("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},me(0,"Overall border color for focused elements. This color is only used if not overridden by a component.")),Em=Sm("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},me(0,"An extra border around elements to separate them from others for greater contrast.")),Nm=Sm("contrastActiveBorder",{light:null,dark:null,hcDark:Dm,hcLight:Dm},me(0,"An extra border around active elements to separate them from others for greater contrast.")),Im=(Sm("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},me(0,"The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor.")),Sm("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:ru.black,hcLight:"#292929"},me(0,"Color for text separators.")),Sm("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},me(0,"Foreground color for links in text."))),Mm=(Sm("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},me(0,"Foreground color for links in text when clicked on and on mouse hover.")),Sm("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},me(0,"Foreground color for preformatted text segments.")),Sm("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},me(0,"Background color for preformatted text segments.")),Sm("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},me(0,"Background color for block quotes in text.")),Sm("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:ru.white,hcLight:"#292929"},me(0,"Border color for block quotes in text.")),Sm("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:ru.black,hcLight:"#F2F2F2"},me(0,"Background color for code blocks in text.")),Sm("widget.shadow",{dark:yv(ru.black,.36),light:yv(ru.black,.16),hcDark:null,hcLight:null},me(0,"Shadow color of widgets such as find/replace inside the editor."))),Tm=Sm("widget.border",{dark:null,light:null,hcDark:Em,hcLight:Em},me(0,"Border color of widgets such as find/replace inside the editor.")),Am=Sm("input.background",{dark:"#3C3C3C",light:ru.white,hcDark:ru.black,hcLight:ru.white},me(0,"Input box background.")),Rm=Sm("input.foreground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"Input box foreground.")),Om=Sm("input.border",{dark:null,light:null,hcDark:Em,hcLight:Em},me(0,"Input box border.")),Pm=Sm("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:Em,hcLight:Em},me(0,"Border color of activated options in input fields.")),Fm=(Sm("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},me(0,"Background color of activated options in input fields.")),Sm("inputOption.activeBackground",{dark:yv(Dm,.4),light:yv(Dm,.2),hcDark:ru.transparent,hcLight:ru.transparent},me(0,"Background hover color of options in input fields."))),Bm=Sm("inputOption.activeForeground",{dark:ru.white,light:ru.black,hcDark:km,hcLight:km},me(0,"Foreground color of activated options in input fields.")),Wm=(Sm("input.placeholderForeground",{light:yv(km,.5),dark:yv(km,.5),hcDark:yv(km,.7),hcLight:yv(km,.7)},me(0,"Input box foreground color for placeholder text.")),Sm("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:ru.black,hcLight:ru.white},me(0,"Input validation background color for information severity."))),Vm=Sm("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:km},me(0,"Input validation foreground color for information severity.")),zm=Sm("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:Em,hcLight:Em},me(0,"Input validation border color for information severity.")),Hm=Sm("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:ru.black,hcLight:ru.white},me(0,"Input validation background color for warning severity.")),Um=Sm("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:km},me(0,"Input validation foreground color for warning severity.")),Km=Sm("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:Em,hcLight:Em},me(0,"Input validation border color for warning severity.")),jm=Sm("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:ru.black,hcLight:ru.white},me(0,"Input validation background color for error severity.")),qm=Sm("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:km},me(0,"Input validation foreground color for error severity.")),$m=Sm("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:Em,hcLight:Em},me(0,"Input validation border color for error severity.")),Gm=Sm("dropdown.background",{dark:"#3C3C3C",light:ru.white,hcDark:ru.black,hcLight:ru.white},me(0,"Dropdown background.")),Zm=Sm("dropdown.listBackground",{dark:null,light:null,hcDark:ru.black,hcLight:ru.white},me(0,"Dropdown list background.")),Ym=Sm("dropdown.foreground",{dark:"#F0F0F0",light:km,hcDark:ru.white,hcLight:km},me(0,"Dropdown foreground.")),Qm=Sm("dropdown.border",{dark:Gm,light:"#CECECE",hcDark:Em,hcLight:Em},me(0,"Dropdown border.")),Xm=Sm("button.foreground",{dark:ru.white,light:ru.white,hcDark:ru.white,hcLight:ru.white},me(0,"Button foreground color.")),Jm=Sm("button.separator",{dark:yv(Xm,.4),light:yv(Xm,.4),hcDark:yv(Xm,.4),hcLight:yv(Xm,.4)},me(0,"Button separator color.")),ef=Sm("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},me(0,"Button background color.")),tf=Sm("button.hoverBackground",{dark:Cv(ef,.2),light:wv(ef,.2),hcDark:ef,hcLight:ef},me(0,"Button background color when hovering.")),nf=Sm("button.border",{dark:Em,light:Em,hcDark:Em,hcLight:Em},me(0,"Button border color.")),of=Sm("button.secondaryForeground",{dark:ru.white,light:ru.white,hcDark:ru.white,hcLight:km},me(0,"Secondary button foreground color.")),sf=Sm("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:ru.white},me(0,"Secondary button background color.")),rf=Sm("button.secondaryHoverBackground",{dark:Cv(sf,.2),light:wv(sf,.2),hcDark:null,hcLight:null},me(0,"Secondary button background color when hovering.")),af=Sm("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:ru.black,hcLight:"#0F4A85"},me(0,"Badge background color. Badges are small information labels, e.g. for search results count.")),lf=Sm("badge.foreground",{dark:ru.white,light:"#333",hcDark:ru.white,hcLight:ru.white},me(0,"Badge foreground color. Badges are small information labels, e.g. for search results count.")),hf=Sm("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},me(0,"Scrollbar shadow to indicate that the view is scrolled.")),df=Sm("scrollbarSlider.background",{dark:ru.fromHex("#797979").transparent(.4),light:ru.fromHex("#646464").transparent(.4),hcDark:yv(Em,.6),hcLight:yv(Em,.4)},me(0,"Scrollbar slider background color.")),cf=Sm("scrollbarSlider.hoverBackground",{dark:ru.fromHex("#646464").transparent(.7),light:ru.fromHex("#646464").transparent(.7),hcDark:yv(Em,.8),hcLight:yv(Em,.8)},me(0,"Scrollbar slider background color when hovering.")),uf=Sm("scrollbarSlider.activeBackground",{dark:ru.fromHex("#BFBFBF").transparent(.4),light:ru.fromHex("#000000").transparent(.6),hcDark:Em,hcLight:Em},me(0,"Scrollbar slider background color when clicked on.")),gf=Sm("progressBar.background",{dark:ru.fromHex("#0E70C0"),light:ru.fromHex("#0E70C0"),hcDark:Em,hcLight:Em},me(0,"Background color of the progress bar that can show for long running operations.")),pf=(Sm("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Sm("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},me(0,"Foreground color of error squigglies in the editor."))),mf=Sm("editorError.border",{dark:null,light:null,hcDark:ru.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},me(0,"If set, color of double underlines for errors in the editor.")),ff=(Sm("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Sm("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},me(0,"Foreground color of warning squigglies in the editor."))),_f=Sm("editorWarning.border",{dark:null,light:null,hcDark:ru.fromHex("#FFCC00").transparent(.8),hcLight:ru.fromHex("#FFCC00").transparent(.8)},me(0,"If set, color of double underlines for warnings in the editor.")),vf=(Sm("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Sm("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},me(0,"Foreground color of info squigglies in the editor."))),bf=Sm("editorInfo.border",{dark:null,light:null,hcDark:ru.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},me(0,"If set, color of double underlines for infos in the editor.")),wf=Sm("editorHint.foreground",{dark:ru.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},me(0,"Foreground color of hint squigglies in the editor.")),Cf=(Sm("editorHint.border",{dark:null,light:null,hcDark:ru.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},me(0,"If set, color of double underlines for hints in the editor.")),Sm("sash.hoverBorder",{dark:Dm,light:Dm,hcDark:Dm,hcLight:Dm},me(0,"Border color of active sashes.")),Sm("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:ru.black,hcLight:ru.white},me(0,"Editor background color."))),yf=Sm("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:ru.white,hcLight:km},me(0,"Editor default foreground color.")),Sf=(Sm("editorStickyScroll.background",{light:Cf,dark:Cf,hcDark:Cf,hcLight:Cf},me(0,"Sticky scroll background color for the editor")),Sm("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:ru.fromHex("#0F4A85").transparent(.1)},me(0,"Sticky scroll on hover background color for the editor")),Sm("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:ru.white},me(0,"Background color of editor widgets, such as find/replace."))),kf=Sm("editorWidget.foreground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"Foreground color of editor widgets, such as find/replace.")),Lf=Sm("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:Em,hcLight:Em},me(0,"Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.")),xf=Sm("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},me(0,"Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")),Df=Sm("quickInput.background",{dark:Sf,light:Sf,hcDark:Sf,hcLight:Sf},me(0,"Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),Ef=Sm("quickInput.foreground",{dark:kf,light:kf,hcDark:kf,hcLight:kf},me(0,"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Nf=Sm("quickInputTitle.background",{dark:new ru(new nu(255,255,255,.105)),light:new ru(new nu(0,0,0,.06)),hcDark:"#000000",hcLight:ru.white},me(0,"Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),If=Sm("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:ru.white,hcLight:"#0F4A85"},me(0,"Quick picker color for grouping labels.")),Mf=Sm("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:ru.white,hcLight:"#0F4A85"},me(0,"Quick picker color for grouping borders.")),Tf=Sm("keybindingLabel.background",{dark:new ru(new nu(128,128,128,.17)),light:new ru(new nu(221,221,221,.4)),hcDark:ru.transparent,hcLight:ru.transparent},me(0,"Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),Af=Sm("keybindingLabel.foreground",{dark:ru.fromHex("#CCCCCC"),light:ru.fromHex("#555555"),hcDark:ru.white,hcLight:km},me(0,"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),Rf=Sm("keybindingLabel.border",{dark:new ru(new nu(51,51,51,.6)),light:new ru(new nu(204,204,204,.4)),hcDark:new ru(new nu(111,195,223)),hcLight:Em},me(0,"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Of=Sm("keybindingLabel.bottomBorder",{dark:new ru(new nu(68,68,68,.6)),light:new ru(new nu(187,187,187,.4)),hcDark:new ru(new nu(111,195,223)),hcLight:km},me(0,"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),Pf=Sm("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},me(0,"Color of the editor selection.")),Ff=Sm("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:ru.white},me(0,"Color of the selected text for high contrast.")),Bf=Sm("editor.inactiveSelectionBackground",{light:yv(Pf,.5),dark:yv(Pf,.5),hcDark:yv(Pf,.7),hcLight:yv(Pf,.5)},me(0,"Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),Wf=Sm("editor.selectionHighlightBackground",{light:kv(Pf,Cf,.3,.6),dark:kv(Pf,Cf,.3,.6),hcDark:null,hcLight:null},me(0,"Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0),Vf=(Sm("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:Nm,hcLight:Nm},me(0,"Border color for regions with the same content as the selection.")),Sm("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},me(0,"Color of the current search match."))),zf=Sm("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},me(0,"Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),Hf=Sm("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},me(0,"Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),Uf=Sm("editor.findMatchBorder",{light:null,dark:null,hcDark:Nm,hcLight:Nm},me(0,"Border color of the current search match.")),Kf=Sm("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:Nm,hcLight:Nm},me(0,"Border color of the other search matches.")),jf=Sm("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:yv(Nm,.4),hcLight:yv(Nm,.4)},me(0,"Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),qf=(Sm("searchEditor.findMatchBackground",{light:yv(zf,.66),dark:yv(zf,.66),hcDark:zf,hcLight:zf},me(0,"Color of the Search Editor query matches.")),Sm("searchEditor.findMatchBorder",{light:yv(Kf,.66),dark:yv(Kf,.66),hcDark:Kf,hcLight:Kf},me(0,"Border color of the Search Editor query matches.")),Sm("search.resultsInfoForeground",{light:km,dark:yv(km,.65),hcDark:km,hcLight:km},me(0,"Color of the text in the search viewlet's completion message.")),Sm("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},me(0,"Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),Sm("editorHoverWidget.background",{light:Sf,dark:Sf,hcDark:Sf,hcLight:Sf},me(0,"Background color of the editor hover."))),$f=(Sm("editorHoverWidget.foreground",{light:kf,dark:kf,hcDark:kf,hcLight:kf},me(0,"Foreground color of the editor hover.")),Sm("editorHoverWidget.border",{light:Lf,dark:Lf,hcDark:Lf,hcLight:Lf},me(0,"Border color of the editor hover."))),Gf=(Sm("editorHoverWidget.statusBarBackground",{dark:Cv(qf,.2),light:wv(qf,.05),hcDark:Sf,hcLight:Sf},me(0,"Background color of the editor hover status bar.")),Sm("editorLink.activeForeground",{dark:"#4E94CE",light:ru.blue,hcDark:ru.cyan,hcLight:"#292929"},me(0,"Color of active links."))),Zf=Sm("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:ru.white,hcLight:ru.black},me(0,"Foreground color of inline hints")),Yf=Sm("editorInlayHint.background",{dark:yv(af,.1),light:yv(af,.1),hcDark:yv(ru.white,.1),hcLight:yv(af,.1)},me(0,"Background color of inline hints")),Qf=Sm("editorInlayHint.typeForeground",{dark:Zf,light:Zf,hcDark:Zf,hcLight:Zf},me(0,"Foreground color of inline hints for types")),Xf=Sm("editorInlayHint.typeBackground",{dark:Yf,light:Yf,hcDark:Yf,hcLight:Yf},me(0,"Background color of inline hints for types")),Jf=Sm("editorInlayHint.parameterForeground",{dark:Zf,light:Zf,hcDark:Zf,hcLight:Zf},me(0,"Foreground color of inline hints for parameters")),e_=Sm("editorInlayHint.parameterBackground",{dark:Yf,light:Yf,hcDark:Yf,hcLight:Yf},me(0,"Background color of inline hints for parameters")),t_=(Sm("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},me(0,"The color used for the lightbulb actions icon.")),Sm("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},me(0,"The color used for the lightbulb auto fix actions icon.")),Sm("editorLightBulbAi.foreground",{dark:wv(xm,.4),light:Cv(xm,1.7),hcDark:xm,hcLight:xm},me(0,"The color used for the lightbulb AI icon.")),new ru(new nu(155,185,85,.2))),i_=new ru(new nu(255,0,0,.2)),n_=Sm("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},me(0,"Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),o_=Sm("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},me(0,"Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),s_=(Sm("diffEditor.insertedLineBackground",{dark:t_,light:t_,hcDark:null,hcLight:null},me(0,"Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),Sm("diffEditor.removedLineBackground",{dark:i_,light:i_,hcDark:null,hcLight:null},me(0,"Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),Sm("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"Background color for the margin where lines got inserted.")),Sm("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"Background color for the margin where lines got removed.")),Sm("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"Diff overview ruler foreground for inserted content."))),r_=Sm("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"Diff overview ruler foreground for removed content.")),a_=(Sm("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},me(0,"Outline color for the text that got inserted.")),Sm("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},me(0,"Outline color for text that got removed.")),Sm("diffEditor.border",{dark:null,light:null,hcDark:Em,hcLight:Em},me(0,"Border color between the two text editors.")),Sm("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},me(0,"Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.")),Sm("diffEditor.unchangedRegionBackground",{dark:"sideBar.background",light:"sideBar.background",hcDark:"sideBar.background",hcLight:"sideBar.background"},me(0,"The background color of unchanged blocks in the diff editor.")),Sm("diffEditor.unchangedRegionForeground",{dark:"foreground",light:"foreground",hcDark:"foreground",hcLight:"foreground"},me(0,"The foreground color of unchanged blocks in the diff editor.")),Sm("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},me(0,"The background color of unchanged code in the diff editor.")),Sm("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not."))),l_=Sm("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),h_=Sm("list.focusOutline",{dark:Dm,light:Dm,hcDark:Nm,hcLight:Nm},me(0,"List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),d_=Sm("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),c_=Sm("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:ru.fromHex("#0F4A85").transparent(.1)},me(0,"List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),u_=Sm("list.activeSelectionForeground",{dark:ru.white,light:ru.white,hcDark:null,hcLight:null},me(0,"List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),g_=Sm("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),p_=Sm("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:ru.fromHex("#0F4A85").transparent(.1)},me(0,"List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),m_=Sm("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),f_=Sm("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),__=Sm("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),v_=Sm("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),b_=Sm("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:ru.white.transparent(.1),hcLight:ru.fromHex("#0F4A85").transparent(.1)},me(0,"List/Tree background when hovering over items using the mouse.")),w_=Sm("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"List/Tree foreground when hovering over items using the mouse.")),C_=Sm("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},me(0,"List/Tree drag and drop background when moving items around using the mouse.")),y_=Sm("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Dm,hcLight:Dm},me(0,"List/Tree foreground color of the match highlights when searching inside the list/tree.")),S_=Sm("list.focusHighlightForeground",{dark:y_,light:(k_=c_,L_=y_,"#BBE7FF",{op:6,if:k_,then:L_,else:"#BBE7FF"}),hcDark:y_,hcLight:y_},me(0,"List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));var k_,L_;Sm("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},me(0,"List/Tree foreground color for invalid items, for example an unresolved root in explorer.")),Sm("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},me(0,"Foreground color of list items containing errors.")),Sm("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},me(0,"Foreground color of list items containing warnings."));const x_=Sm("listFilterWidget.background",{light:wv(Sf,0),dark:Cv(Sf,0),hcDark:Sf,hcLight:Sf},me(0,"Background color of the type filter widget in lists and trees.")),D_=Sm("listFilterWidget.outline",{dark:ru.transparent,light:ru.transparent,hcDark:"#f38518",hcLight:"#007ACC"},me(0,"Outline color of the type filter widget in lists and trees.")),E_=Sm("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:Em,hcLight:Em},me(0,"Outline color of the type filter widget in lists and trees, when there are no matches.")),N_=Sm("listFilterWidget.shadow",{dark:Mm,light:Mm,hcDark:Mm,hcLight:Mm},me(0,"Shadow color of the type filter widget in lists and trees.")),I_=(Sm("list.filterMatchBackground",{dark:zf,light:zf,hcDark:null,hcLight:null},me(0,"Background color of the filtered match.")),Sm("list.filterMatchBorder",{dark:Kf,light:Kf,hcDark:Em,hcLight:Nm},me(0,"Border color of the filtered match.")),Sm("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},me(0,"Tree stroke color for the indentation guides."))),M_=Sm("tree.inactiveIndentGuidesStroke",{dark:yv(I_,.4),light:yv(I_,.4),hcDark:yv(I_,.4),hcLight:yv(I_,.4)},me(0,"Tree stroke color for the indentation guides that are not active.")),T_=Sm("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},me(0,"Table border color between columns.")),A_=Sm("tree.tableOddRowsBackground",{dark:yv(km,.04),light:yv(km,.04),hcDark:null,hcLight:null},me(0,"Background color for odd table rows.")),R_=(Sm("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},me(0,"List/Tree foreground color for items that are deemphasized. ")),Sm("checkbox.background",{dark:Gm,light:Gm,hcDark:Gm,hcLight:Gm},me(0,"Background color of checkbox widget."))),O_=(Sm("checkbox.selectBackground",{dark:Sf,light:Sf,hcDark:Sf,hcLight:Sf},me(0,"Background color of checkbox widget when the element it's in is selected.")),Sm("checkbox.foreground",{dark:Ym,light:Ym,hcDark:Ym,hcLight:Ym},me(0,"Foreground color of checkbox widget."))),P_=Sm("checkbox.border",{dark:Qm,light:Qm,hcDark:Qm,hcLight:Qm},me(0,"Border color of checkbox widget.")),F_=(Sm("checkbox.selectBorder",{dark:xm,light:xm,hcDark:xm,hcLight:xm},me(0,"Border color of checkbox widget when the element it's in is selected.")),Sm("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,me(0,"Please use quickInputList.focusBackground instead"))),B_=Sm("quickInputList.focusForeground",{dark:u_,light:u_,hcDark:u_,hcLight:u_},me(0,"Quick picker foreground color for the focused item.")),W_=Sm("quickInputList.focusIconForeground",{dark:g_,light:g_,hcDark:g_,hcLight:g_},me(0,"Quick picker icon foreground color for the focused item.")),V_=Sm("quickInputList.focusBackground",{dark:Sv(F_,c_),light:Sv(F_,c_),hcDark:null,hcLight:null},me(0,"Quick picker background color for the focused item.")),z_=Sm("menu.border",{dark:null,light:null,hcDark:Em,hcLight:Em},me(0,"Border color of menus.")),H_=Sm("menu.foreground",{dark:Ym,light:Ym,hcDark:Ym,hcLight:Ym},me(0,"Foreground color of menu items.")),U_=Sm("menu.background",{dark:Gm,light:Gm,hcDark:Gm,hcLight:Gm},me(0,"Background color of menu items.")),K_=Sm("menu.selectionForeground",{dark:u_,light:u_,hcDark:u_,hcLight:u_},me(0,"Foreground color of the selected menu item in menus.")),j_=Sm("menu.selectionBackground",{dark:c_,light:c_,hcDark:c_,hcLight:c_},me(0,"Background color of the selected menu item in menus.")),q_=Sm("menu.selectionBorder",{dark:null,light:null,hcDark:Nm,hcLight:Nm},me(0,"Border color of the selected menu item in menus.")),$_=Sm("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:Em,hcLight:Em},me(0,"Color of a separator menu item in menus.")),G_=Sm("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},me(0,"Toolbar background when hovering over actions using the mouse")),Z_=(Sm("toolbar.hoverOutline",{dark:null,light:null,hcDark:Nm,hcLight:Nm},me(0,"Toolbar outline when hovering over actions using the mouse")),Sm("toolbar.activeBackground",{dark:Cv(G_,.1),light:wv(G_,.1),hcDark:null,hcLight:null},me(0,"Toolbar background when holding the mouse over actions")),Sm("editor.snippetTabstopHighlightBackground",{dark:new ru(new nu(124,124,124,.3)),light:new ru(new nu(10,50,100,.2)),hcDark:new ru(new nu(124,124,124,.3)),hcLight:new ru(new nu(10,50,100,.2))},me(0,"Highlight background color of a snippet tabstop.")),Sm("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"Highlight border color of a snippet tabstop.")),Sm("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"Highlight background color of the final tabstop of a snippet.")),Sm("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new ru(new nu(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},me(0,"Highlight border color of the final tabstop of a snippet.")),Sm("breadcrumb.foreground",{light:yv(km,.8),dark:yv(km,.8),hcDark:yv(km,.8),hcLight:yv(km,.8)},me(0,"Color of focused breadcrumb items."))),Y_=Sm("breadcrumb.background",{light:Cf,dark:Cf,hcDark:Cf,hcLight:Cf},me(0,"Background color of breadcrumb items.")),Q_=Sm("breadcrumb.focusForeground",{light:wv(km,.2),dark:Cv(km,.1),hcDark:Cv(km,.1),hcLight:Cv(km,.1)},me(0,"Color of focused breadcrumb items.")),X_=Sm("breadcrumb.activeSelectionForeground",{light:wv(km,.2),dark:Cv(km,.1),hcDark:Cv(km,.1),hcLight:Cv(km,.1)},me(0,"Color of selected breadcrumb items.")),J_=(Sm("breadcrumbPicker.background",{light:Sf,dark:Sf,hcDark:Sf,hcLight:Sf},me(0,"Background color of breadcrumb item picker.")),ru.fromHex("#40C8AE").transparent(.5)),ev=ru.fromHex("#40A6FF").transparent(.5),tv=ru.fromHex("#606060").transparent(.4),iv=.4,nv=Sm("merge.currentHeaderBackground",{dark:J_,light:J_,hcDark:null,hcLight:null},me(0,"Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),ov=(Sm("merge.currentContentBackground",{dark:yv(nv,iv),light:yv(nv,iv),hcDark:yv(nv,iv),hcLight:yv(nv,iv)},me(0,"Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),Sm("merge.incomingHeaderBackground",{dark:ev,light:ev,hcDark:null,hcLight:null},me(0,"Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0)),sv=(Sm("merge.incomingContentBackground",{dark:yv(ov,iv),light:yv(ov,iv),hcDark:yv(ov,iv),hcLight:yv(ov,iv)},me(0,"Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),Sm("merge.commonHeaderBackground",{dark:tv,light:tv,hcDark:null,hcLight:null},me(0,"Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0)),rv=(Sm("merge.commonContentBackground",{dark:yv(sv,iv),light:yv(sv,iv),hcDark:yv(sv,iv),hcLight:yv(sv,iv)},me(0,"Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),Sm("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},me(0,"Border color on headers and the splitter in inline merge-conflicts."))),av=(Sm("editorOverviewRuler.currentContentForeground",{dark:yv(nv,1),light:yv(nv,1),hcDark:rv,hcLight:rv},me(0,"Current overview ruler foreground for inline merge-conflicts.")),Sm("editorOverviewRuler.incomingContentForeground",{dark:yv(ov,1),light:yv(ov,1),hcDark:rv,hcLight:rv},me(0,"Incoming overview ruler foreground for inline merge-conflicts.")),Sm("editorOverviewRuler.commonContentForeground",{dark:yv(sv,1),light:yv(sv,1),hcDark:rv,hcLight:rv},me(0,"Common ancestor overview ruler foreground for inline merge-conflicts.")),Sm("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},me(0,"Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0)),lv=Sm("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},me(0,"Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),hv=Sm("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},me(0,"Minimap marker color for find matches."),!0),dv=Sm("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},me(0,"Minimap marker color for repeating editor selections."),!0),cv=Sm("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},me(0,"Minimap marker color for the editor selection."),!0),uv=Sm("minimap.infoHighlight",{dark:vf,light:vf,hcDark:bf,hcLight:bf},me(0,"Minimap marker color for infos.")),gv=Sm("minimap.warningHighlight",{dark:ff,light:ff,hcDark:_f,hcLight:_f},me(0,"Minimap marker color for warnings.")),pv=Sm("minimap.errorHighlight",{dark:new ru(new nu(255,18,18,.7)),light:new ru(new nu(255,18,18,.7)),hcDark:new ru(new nu(255,50,50,1)),hcLight:"#B5200D"},me(0,"Minimap marker color for errors.")),mv=Sm("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"Minimap background color.")),fv=Sm("minimap.foregroundOpacity",{dark:ru.fromHex("#000f"),light:ru.fromHex("#000f"),hcDark:ru.fromHex("#000f"),hcLight:ru.fromHex("#000f")},me(0,'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.')),_v=(Sm("minimapSlider.background",{light:yv(df,.5),dark:yv(df,.5),hcDark:yv(df,.5),hcLight:yv(df,.5)},me(0,"Minimap slider background color.")),Sm("minimapSlider.hoverBackground",{light:yv(cf,.5),dark:yv(cf,.5),hcDark:yv(cf,.5),hcLight:yv(cf,.5)},me(0,"Minimap slider background color when hovering.")),Sm("minimapSlider.activeBackground",{light:yv(uf,.5),dark:yv(uf,.5),hcDark:yv(uf,.5),hcLight:yv(uf,.5)},me(0,"Minimap slider background color when clicked on.")),Sm("problemsErrorIcon.foreground",{dark:pf,light:pf,hcDark:pf,hcLight:pf},me(0,"The color used for the problems error icon."))),vv=Sm("problemsWarningIcon.foreground",{dark:ff,light:ff,hcDark:ff,hcLight:ff},me(0,"The color used for the problems warning icon.")),bv=Sm("problemsInfoIcon.foreground",{dark:vf,light:vf,hcDark:vf,hcLight:vf},me(0,"The color used for the problems info icon."));function wv(e,t){return{op:0,value:e,factor:t}}function Cv(e,t){return{op:1,value:e,factor:t}}function yv(e,t){return{op:2,value:e,factor:t}}function Sv(...e){return{op:4,values:e}}function kv(e,t,i,n){return{op:5,value:e,background:t,factor:i,transparency:n}}function Lv(e,t){if(null!==e)return"string"==typeof e?"#"===e[0]?ru.fromHex(e):t.getColor(e):e instanceof ru?e:"object"==typeof e?function(e,t){var i,n,o,s;switch(e.op){case 0:return null===(i=Lv(e.value,t))||void 0===i?void 0:i.darken(e.factor);case 1:return null===(n=Lv(e.value,t))||void 0===n?void 0:n.lighten(e.factor);case 2:return null===(o=Lv(e.value,t))||void 0===o?void 0:o.transparent(e.factor);case 3:{const i=Lv(e.background,t);return i?null===(s=Lv(e.value,t))||void 0===s?void 0:s.makeOpaque(i):Lv(e.value,t)}case 4:for(const i of e.values){const e=Lv(i,t);if(e)return e}return;case 6:return Lv(t.defines(e.if)?e.then:e.else,t);case 5:{const i=Lv(e.value,t);if(!i)return;const n=Lv(e.background,t);return n?i.isDarkerThan(n)?ru.getLighterColor(i,n,e.factor).transparent(e.transparency):ru.getDarkerColor(i,n,e.factor).transparent(e.transparency):i.transparent(e.factor*e.transparency)}default:throw ud()}}(e,t):void 0}Sm("charts.foreground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color used in charts.")),Sm("charts.lines",{dark:yv(km,.5),light:yv(km,.5),hcDark:yv(km,.5),hcLight:yv(km,.5)},me(0,"The color used for horizontal lines in charts.")),Sm("charts.red",{dark:pf,light:pf,hcDark:pf,hcLight:pf},me(0,"The red color used in chart visualizations.")),Sm("charts.blue",{dark:vf,light:vf,hcDark:vf,hcLight:vf},me(0,"The blue color used in chart visualizations.")),Sm("charts.yellow",{dark:ff,light:ff,hcDark:ff,hcLight:ff},me(0,"The yellow color used in chart visualizations.")),Sm("charts.orange",{dark:hv,light:hv,hcDark:hv,hcLight:hv},me(0,"The orange color used in chart visualizations.")),Sm("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},me(0,"The green color used in chart visualizations.")),Sm("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},me(0,"The purple color used in chart visualizations."));const xv="vscode://schemas/workbench-colors",Dv=md.as(Sg);Dv.registerSchema(xv,ym.getColorSchema());const Ev=new Zt((()=>Dv.notifySchemaChanged(xv)),200);var Nv;function Iv(e){return e===Nv.HIGH_CONTRAST_DARK||e===Nv.HIGH_CONTRAST_LIGHT}function Mv(e){return e===Nv.DARK||e===Nv.HIGH_CONTRAST_DARK}ym.onDidChangeSchema((()=>{Ev.isScheduled()||Ev.schedule()})),function(e){e.DARK="dark",e.LIGHT="light",e.HIGH_CONTRAST_DARK="hcDark",e.HIGH_CONTRAST_LIGHT="hcLight"}(Nv||(Nv={}));const Tv=hh("themeService");function Av(e){return{id:e}}function Rv(e){switch(e){case Nv.DARK:return"vs-dark";case Nv.HIGH_CONTRAST_DARK:return"hc-black";case Nv.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const Ov="base.contributions.theming",Pv=new class{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new q}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),I((()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)}))}getThemingParticipants(){return this.themingParticipants}};function Fv(e){return Pv.onColorThemeChange(e)}md.add(Ov,Pv);class Bv extends T{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange((e=>this.onThemeChange(e))))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}const Wv=Sm("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"Background color for the highlight of line at the cursor position.")),Vv=Sm("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:Em},me(0,"Background color for the border around the line at the cursor position.")),zv=(Sm("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},me(0,"Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0),Sm("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:Nm,hcLight:Nm},me(0,"Background color of the border around highlighted ranges."),!0),Sm("editor.symbolHighlightBackground",{dark:zf,light:zf,hcDark:null,hcLight:null},me(0,"Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0),Sm("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:Nm,hcLight:Nm},me(0,"Background color of the border around highlighted symbols."),!0),Sm("editorCursor.foreground",{dark:"#AEAFAD",light:ru.black,hcDark:ru.white,hcLight:"#0F4A85"},me(0,"Color of the editor cursor."))),Hv=Sm("editorCursor.background",null,me(0,"The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),Uv=Sm("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},me(0,"Color of whitespace characters in the editor.")),Kv=Sm("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:ru.white,hcLight:"#292929"},me(0,"Color of editor line numbers.")),jv=Sm("editorIndentGuide.background",{dark:Uv,light:Uv,hcDark:Uv,hcLight:Uv},me(0,"Color of the editor indentation guides."),!1,me(0,"'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),qv=Sm("editorIndentGuide.activeBackground",{dark:Uv,light:Uv,hcDark:Uv,hcLight:Uv},me(0,"Color of the active editor indentation guides."),!1,me(0,"'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),$v=Sm("editorIndentGuide.background1",{dark:jv,light:jv,hcDark:jv,hcLight:jv},me(0,"Color of the editor indentation guides (1).")),Gv=Sm("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Color of the editor indentation guides (2).")),Zv=Sm("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Color of the editor indentation guides (3).")),Yv=Sm("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Color of the editor indentation guides (4).")),Qv=Sm("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Color of the editor indentation guides (5).")),Xv=Sm("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Color of the editor indentation guides (6).")),Jv=Sm("editorIndentGuide.activeBackground1",{dark:qv,light:qv,hcDark:qv,hcLight:qv},me(0,"Color of the active editor indentation guides (1).")),eb=Sm("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Color of the active editor indentation guides (2).")),tb=Sm("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Color of the active editor indentation guides (3).")),ib=Sm("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Color of the active editor indentation guides (4).")),nb=Sm("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Color of the active editor indentation guides (5).")),ob=Sm("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Color of the active editor indentation guides (6).")),sb=Sm("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Nm,hcLight:Nm},me(0,"Color of editor active line number"),!1,me(0,"Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),rb=(Sm("editorLineNumber.activeForeground",{dark:sb,light:sb,hcDark:sb,hcLight:sb},me(0,"Color of editor active line number")),Sm("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"Color of the final editor line when editor.renderFinalNewline is set to dimmed."))),ab=(Sm("editorRuler.foreground",{dark:"#5A5A5A",light:ru.lightgrey,hcDark:ru.white,hcLight:"#292929"},me(0,"Color of the editor rulers.")),Sm("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},me(0,"Foreground color of editor CodeLens")),Sm("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},me(0,"Background color behind matching brackets")),Sm("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:Em,hcLight:Em},me(0,"Color for matching brackets boxes")),Sm("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},me(0,"Color of the overview ruler border."))),lb=Sm("editorOverviewRuler.background",null,me(0,"Background color of the editor overview ruler.")),hb=(Sm("editorGutter.background",{dark:Cf,light:Cf,hcDark:Cf,hcLight:Cf},me(0,"Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),Sm("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:ru.fromHex("#fff").transparent(.8),hcLight:Em},me(0,"Border color of unnecessary (unused) source code in the editor.")),Sm("editorUnnecessaryCode.opacity",{dark:ru.fromHex("#000a"),light:ru.fromHex("#0007"),hcDark:null,hcLight:null},me(0,"Opacity of unnecessary (unused) source code in the editor. For example, \"#000000c0\" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out."))),db=(Sm("editorGhostText.border",{dark:null,light:null,hcDark:ru.fromHex("#fff").transparent(.8),hcLight:ru.fromHex("#292929").transparent(.8)},me(0,"Border color of ghost text in the editor.")),Sm("editorGhostText.foreground",{dark:ru.fromHex("#ffffff56"),light:ru.fromHex("#0007"),hcDark:null,hcLight:null},me(0,"Foreground color of the ghost text in the editor.")),Sm("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},me(0,"Background color of the ghost text in the editor.")),new ru(new nu(0,122,204,.6))),cb=Sm("editorOverviewRuler.rangeHighlightForeground",{dark:db,light:db,hcDark:db,hcLight:db},me(0,"Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),ub=Sm("editorOverviewRuler.errorForeground",{dark:new ru(new nu(255,18,18,.7)),light:new ru(new nu(255,18,18,.7)),hcDark:new ru(new nu(255,50,50,1)),hcLight:"#B5200D"},me(0,"Overview ruler marker color for errors.")),gb=Sm("editorOverviewRuler.warningForeground",{dark:ff,light:ff,hcDark:_f,hcLight:_f},me(0,"Overview ruler marker color for warnings.")),pb=Sm("editorOverviewRuler.infoForeground",{dark:vf,light:vf,hcDark:bf,hcLight:bf},me(0,"Overview ruler marker color for infos.")),mb=Sm("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},me(0,"Foreground color of brackets (1). Requires enabling bracket pair colorization.")),fb=Sm("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},me(0,"Foreground color of brackets (2). Requires enabling bracket pair colorization.")),_b=Sm("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},me(0,"Foreground color of brackets (3). Requires enabling bracket pair colorization.")),vb=Sm("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Foreground color of brackets (4). Requires enabling bracket pair colorization.")),bb=Sm("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Foreground color of brackets (5). Requires enabling bracket pair colorization.")),wb=Sm("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Foreground color of brackets (6). Requires enabling bracket pair colorization.")),Cb=Sm("editorBracketHighlight.unexpectedBracket.foreground",{dark:new ru(new nu(255,18,18,.8)),light:new ru(new nu(255,18,18,.8)),hcDark:new ru(new nu(255,50,50,1)),hcLight:""},me(0,"Foreground color of unexpected brackets.")),yb=Sm("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),Sb=Sm("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),kb=Sm("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),Lb=Sm("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),xb=Sm("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),Db=Sm("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),Eb=Sm("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),Nb=Sm("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),Ib=Sm("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),Mb=Sm("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),Tb=Sm("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),Ab=Sm("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},me(0,"Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));Sm("editorUnicodeHighlight.border",{dark:"#BD9B03",light:"#CEA33D",hcDark:"#ff0000",hcLight:"#CEA33D"},me(0,"Border color used to highlight unicode characters.")),Sm("editorUnicodeHighlight.background",{dark:"#bd9b0326",light:"#cea33d14",hcDark:"#00000000",hcLight:"#cea33d14"},me(0,"Background color used to highlight unicode characters.")),Fv(((e,t)=>{const i=e.getColor(Cf),n=e.getColor(Wv),o=n&&!n.isTransparent()?n:i;o&&t.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${o}; }`)}));class Rb extends T{constructor(e){super(),this.textModel=e,this.colorProvider=new Ob,this.onDidChangeEmitter=new q,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange((e=>{this.onDidChangeEmitter.fire()})))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,n){return n||void 0===t?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map((e=>({id:`bracket${e.range.toString()}-${e.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(e,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:e.range}))).toArray():[]}getAllDecorations(e,t){return void 0===e?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new tc(1,1,this.textModel.getLineCount(),1),e,t):[]}}class Ob{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return"bracket-highlighting-"+e%30}}function Pb(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}Fv(((e,t)=>{const i=[mb,fb,_b,vb,bb,wb],n=new Ob;t.addRule(`.monaco-editor .${n.unexpectedClosingBracketClassName} { color: ${e.getColor(Cb)}; }`);const o=i.map((t=>e.getColor(t))).filter((e=>!!e)).filter((e=>!e.isTransparent()));for(let e=0;e<30;e++){const i=o[e%o.length];t.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(e)} { color: ${i}; }`)}}));class Fb{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,i,n){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=n}toString(){return 0===this.oldText.length?`(insert@${this.oldPosition} "${Pb(this.newText)}")`:0===this.newText.length?`(delete@${this.oldPosition} "${Pb(this.oldText)}")`:`(replace@${this.oldPosition} "${Pb(this.oldText)}" with "${Pb(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;$u(e,n,i),i+=4;for(let o=0;o<n;o++)ju(e,t.charCodeAt(o),i),i+=2;return i}static _readString(e,t){const i=qu(e,t);return function(e,t,i){const n=new Uint16Array(e.buffer,t,i);return i>0&&(65279===n[0]||65534===n[0])?function(e,t,i){const n=[];let o=0;for(let s=0;s<i;s++){const i=Ku(e,t);t+=2,n[o++]=String.fromCharCode(i)}return n.join("")}(e,t,i):Yu().decode(n)}(e,t+=4,i)}writeSize(){return 8+Fb._writeStringSize(this.oldText)+Fb._writeStringSize(this.newText)}write(e,t){return $u(e,this.oldPosition,t),t+=4,$u(e,this.newPosition,t),t+=4,t=Fb._writeString(e,this.oldText,t),Fb._writeString(e,this.newText,t)}static read(e,t,i){const n=qu(e,t),o=qu(e,t+=4);t+=4;const s=Fb._readString(e,t);t+=Fb._writeStringSize(s);const r=Fb._readString(e,t);return t+=Fb._writeStringSize(r),i.push(new Fb(n,s,o,r)),t}}class Bb{constructor(e,t){this._prevEdits=e,this._currEdits=t,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let e=0,t=0,i=this._getPrev(e),n=this._getCurr(t);for(;e<this._prevLen||t<this._currLen;){if(null===i){this._acceptCurr(n),n=this._getCurr(++t);continue}if(null===n){this._acceptPrev(i),i=this._getPrev(++e);continue}if(n.oldEnd<=i.newPosition){this._acceptCurr(n),n=this._getCurr(++t);continue}if(i.newEnd<=n.oldPosition){this._acceptPrev(i),i=this._getPrev(++e);continue}if(n.oldPosition<i.newPosition){const[e,t]=Bb._splitCurr(n,i.newPosition-n.oldPosition);this._acceptCurr(e),n=t;continue}if(i.newPosition<n.oldPosition){const[e,t]=Bb._splitPrev(i,n.oldPosition-i.newPosition);this._acceptPrev(e),i=t;continue}let o,s;if(n.oldEnd===i.newEnd)o=i,s=n,i=this._getPrev(++e),n=this._getCurr(++t);else if(n.oldEnd<i.newEnd){const[e,r]=Bb._splitPrev(i,n.oldLength);o=e,s=n,i=r,n=this._getCurr(++t)}else{const[t,r]=Bb._splitCurr(n,i.newLength);o=i,s=t,i=this._getPrev(++e),n=r}this._result[this._resultLen++]=new Fb(o.oldPosition,o.oldText,s.newPosition,s.newText),this._prevDeltaOffset+=o.newLength-o.oldLength,this._currDeltaOffset+=s.newLength-s.oldLength}const o=Bb._merge(this._result);return Bb._removeNoOps(o)}_acceptCurr(e){this._result[this._resultLen++]=Bb._rebaseCurr(this._prevDeltaOffset,e),this._currDeltaOffset+=e.newLength-e.oldLength}_getCurr(e){return e<this._currLen?this._currEdits[e]:null}_acceptPrev(e){this._result[this._resultLen++]=Bb._rebasePrev(this._currDeltaOffset,e),this._prevDeltaOffset+=e.newLength-e.oldLength}_getPrev(e){return e<this._prevLen?this._prevEdits[e]:null}static _rebaseCurr(e,t){return new Fb(t.oldPosition-e,t.oldText,t.newPosition,t.newText)}static _rebasePrev(e,t){return new Fb(t.oldPosition,t.oldText,t.newPosition+e,t.newText)}static _splitPrev(e,t){const i=e.newText.substr(0,t),n=e.newText.substr(t);return[new Fb(e.oldPosition,e.oldText,e.newPosition,i),new Fb(e.oldEnd,"",e.newPosition+t,n)]}static _splitCurr(e,t){const i=e.oldText.substr(0,t),n=e.oldText.substr(t);return[new Fb(e.oldPosition,i,e.newPosition,e.newText),new Fb(e.oldPosition+t,n,e.newEnd,"")]}static _merge(e){if(0===e.length)return e;const t=[];let i=0,n=e[0];for(let o=1;o<e.length;o++){const s=e[o];n.oldEnd===s.oldPosition?n=new Fb(n.oldPosition,n.oldText+s.oldText,n.newPosition,n.newText+s.newText):(t[i++]=n,n=s)}return t[i++]=n,t}static _removeNoOps(e){if(0===e.length)return e;const t=[];let i=0;for(let n=0;n<e.length;n++){const o=e[n];o.oldText!==o.newText&&(t[i++]=o)}return t}}function Wb(e){return e.toString()}class Vb{static create(e,t){const i=e.getAlternativeVersionId(),n=Ub(e);return new Vb(i,i,n,n,t,t,[])}constructor(e,t,i,n,o,s,r){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=n,this.beforeCursorState=o,this.afterCursorState=s,this.changes=r}append(e,t,i,n,o){var s,r;t.length>0&&(this.changes=(r=t,null===(s=this.changes)||0===s.length?r:new Bb(s,r).compress())),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+16*(e?e.length:0)}static _writeSelections(e,t,i){if($u(e,t?t.length:0,i),i+=4,t)for(const n of t)$u(e,n.selectionStartLineNumber,i),i+=4,$u(e,n.selectionStartColumn,i),i+=4,$u(e,n.positionLineNumber,i),i+=4,$u(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=qu(e,t);t+=4;for(let o=0;o<n;o++){const n=qu(e,t),o=qu(e,t+=4),s=qu(e,t+=4),r=qu(e,t+=4);t+=4,i.push(new ic(n,o,s,r))}return t}serialize(){let e=10+Vb._writeSelectionsSize(this.beforeCursorState)+Vb._writeSelectionsSize(this.afterCursorState)+4;for(const t of this.changes)e+=t.writeSize();const t=new Uint8Array(e);let i=0;$u(t,this.beforeVersionId,i),i+=4,$u(t,this.afterVersionId,i),i+=4,Zu(t,this.beforeEOL,i),i+=1,Zu(t,this.afterEOL,i),i+=1,i=Vb._writeSelections(t,this.beforeCursorState,i),i=Vb._writeSelections(t,this.afterCursorState,i),$u(t,this.changes.length,i),i+=4;for(const e of this.changes)i=e.write(t,i);return t.buffer}static deserialize(e){const t=new Uint8Array(e);let i=0;const n=qu(t,i);i+=4;const o=qu(t,i);i+=4;const s=Gu(t,i);i+=1;const r=Gu(t,i);i+=1;const a=[];i=Vb._readSelections(t,i,a);const l=[];i=Vb._readSelections(t,i,l);const h=qu(t,i);i+=4;const d=[];for(let e=0;e<h;e++)i=Fb.read(t,i,d);return new Vb(n,o,s,r,a,l,d)}}class zb{get type(){return 0}get resource(){return Ro.isUri(this.model)?this.model:this.model.uri}constructor(e,t,i,n){this.label=e,this.code=t,this.model=i,this._data=Vb.create(i,n)}toString(){return(this._data instanceof Vb?this._data:Vb.deserialize(this._data)).changes.map((e=>e.toString())).join(", ")}matchesResource(e){return(Ro.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof Vb}append(e,t,i,n,o){this._data instanceof Vb&&this._data.append(e,t,i,n,o)}close(){this._data instanceof Vb&&(this._data=this._data.serialize())}open(){this._data instanceof Vb||(this._data=Vb.deserialize(this._data))}undo(){if(Ro.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Vb&&(this._data=this._data.serialize());const e=Vb.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(Ro.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Vb&&(this._data=this._data.serialize());const e=Vb.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Vb&&(this._data=this._data.serialize()),this._data.byteLength+168}}class Hb{get resources(){return this._editStackElementsArr.map((e=>e.resource))}constructor(e,t,i){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const e of this._editStackElementsArr){const t=Wb(e.resource);this._editStackElementsMap.set(t,e)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=Wb(e);return this._editStackElementsMap.has(t)}setModel(e){const t=Wb(Ro.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=Wb(e.uri);return!!this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).canAppend(e)}append(e,t,i,n,o){const s=Wb(e.uri);this._editStackElementsMap.get(s).append(e,t,i,n,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=Wb(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${Kl(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function Ub(e){return"\n"===e.getEOL()?0:1}function Kb(e){return!!e&&(e instanceof zb||e instanceof Hb)}class jb{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Kb(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Kb(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(Kb(i)&&i.canAppend(this._model))return i;const n=new zb(me(0,"Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(n,t),n}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],Ub(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n){const o=this._getOrCreateEditStackElement(e,n),s=this._model.applyEdits(t,!0),r=jb._computeCursorState(i,s),a=s.map(((e,t)=>({index:t,textChange:e.textChange})));return a.sort(((e,t)=>e.textChange.oldPosition===t.textChange.oldPosition?e.index-t.index:e.textChange.oldPosition-t.textChange.oldPosition)),o.append(this._model,a.map((e=>e.textChange)),Ub(this._model),this._model.getAlternativeVersionId(),r),r}static _computeCursorState(e,t){try{return e?e(t):null}catch(e){return h(e),null}}}class qb extends T{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function $b(e,t){let i=0,n=0;const o=e.length;for(;n<o;){const o=e.charCodeAt(n);if(32===o)i++;else{if(9!==o)break;i=i-i%t+t}n++}return n===o?-1:i}var Gb;!function(e){e[e.Disabled=0]="Disabled",e[e.EnabledForActive=1]="EnabledForActive",e[e.Enabled=2]="Enabled"}(Gb||(Gb={}));class Zb{constructor(e,t,i,n,o,s){if(this.visibleColumn=e,this.column=t,this.className=i,this.horizontalLine=n,this.forWrappedLinesAfterColumn=o,this.forWrappedLinesBeforeOrAtColumn=s,-1!==e==(-1!==t))throw new Error}}class Yb{constructor(e,t){this.top=e,this.endColumn=t}}class Qb extends qb{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return $b(this.textModel.getLineContent(e+1),this.textModel.getOptions().tabSize)}getActiveIndentGuide(e,t,i){this.assertNotDisposed();const n=this.textModel.getLineCount();if(e<1||e>n)throw new b("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=Boolean(o&&o.offSide);let r=-2,a=-1,l=-2,h=-1;const d=e=>{if(-1!==r&&(-2===r||r>e-1)){r=-1,a=-1;for(let t=e-2;t>=0;t--){const e=this._computeIndentLevel(t);if(e>=0){r=t,a=e;break}}}if(-2===l){l=-1,h=-1;for(let t=e;t<n;t++){const e=this._computeIndentLevel(t);if(e>=0){l=t,h=e;break}}}};let c=-2,u=-1,g=-2,p=-1;const m=e=>{if(-2===c){c=-1,u=-1;for(let t=e-2;t>=0;t--){const e=this._computeIndentLevel(t);if(e>=0){c=t,u=e;break}}}if(-1!==g&&(-2===g||g<e-1)){g=-1,p=-1;for(let t=e;t<n;t++){const e=this._computeIndentLevel(t);if(e>=0){g=t,p=e;break}}}};let f=0,_=!0,v=0,w=!0,C=0,y=0;for(let o=0;_||w;o++){const r=e-o,g=e+o;o>1&&(r<1||r<t)&&(_=!1),o>1&&(g>n||g>i)&&(w=!1),o>5e4&&(_=!1,w=!1);let b=-1;if(_&&r>=1){const e=this._computeIndentLevel(r-1);e>=0?(l=r-1,h=e,b=Math.ceil(e/this.textModel.getOptions().indentSize)):(d(r),b=this._getIndentLevelForWhitespaceLine(s,a,h))}let S=-1;if(w&&g<=n){const e=this._computeIndentLevel(g-1);e>=0?(c=g-1,u=e,S=Math.ceil(e/this.textModel.getOptions().indentSize)):(m(g),S=this._getIndentLevelForWhitespaceLine(s,u,p))}if(0!==o){if(1===o){if(g<=n&&S>=0&&y+1===S){_=!1,f=g,v=g,C=S;continue}if(r>=1&&b>=0&&b-1===y){w=!1,f=r,v=r,C=b;continue}if(f=e,v=e,C=y,0===C)return{startLineNumber:f,endLineNumber:v,indent:C}}_&&(b>=C?f=r:_=!1),w&&(S>=C?v=g:w=!1)}else y=b}return{startLineNumber:f,endLineNumber:v,indent:C}}getLinesBracketGuides(e,t,i,n){var o;const s=[];for(let i=e;i<=t;i++)s.push([]);const r=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new tc(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let a;i&&r.length>0&&(a=null===(o=uu((e<=i.lineNumber&&i.lineNumber<=t?r:this.textModel.bracketPairs.getBracketPairsInRange(tc.fromPositions(i)).toArray()).filter((e=>tc.strictContainsPosition(e.range,i))),(e=>!0)))||void 0===o?void 0:o.range);const l=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,h=new Xb;for(const i of r){if(!i.closingBracketRange)continue;const o=a&&i.range.equalsRange(a);if(!o&&!n.includeInactive)continue;const r=h.getInlineClassName(i.nestingLevel,i.nestingLevelOfEqualBracketType,l)+(n.highlightActive&&o?" "+h.activeClassName:""),d=i.openingBracketRange.getStartPosition(),c=i.closingBracketRange.getStartPosition(),u=n.horizontalGuides===Gb.Enabled||n.horizontalGuides===Gb.EnabledForActive&&o;if(i.range.startLineNumber===i.range.endLineNumber){u&&s[i.range.startLineNumber-e].push(new Zb(-1,i.openingBracketRange.getEndPosition().column,r,new Yb(!1,c.column),-1,-1));continue}const g=this.getVisibleColumnFromPosition(c),p=this.getVisibleColumnFromPosition(i.openingBracketRange.getStartPosition()),m=Math.min(p,g,i.minVisibleColumnIndentation+1);let f=!1;fn(this.textModel.getLineContent(i.closingBracketRange.startLineNumber))<i.closingBracketRange.startColumn-1&&(f=!0);const _=Math.max(d.lineNumber,e),v=Math.min(c.lineNumber,t),b=f?1:0;for(let t=_;t<v+b;t++)s[t-e].push(new Zb(m,-1,r,null,t===d.lineNumber?d.column:-1,t===c.lineNumber?c.column:-1));u&&(d.lineNumber>=e&&p>m&&s[d.lineNumber-e].push(new Zb(m,-1,r,new Yb(!1,d.column),-1,-1)),c.lineNumber<=t&&g>m&&s[c.lineNumber-e].push(new Zb(m,-1,r,new Yb(!f,c.column),-1,-1)))}for(const e of s)e.sort(((e,t)=>e.visibleColumn-t.visibleColumn));return s}getVisibleColumnFromPosition(e){return lu.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const n=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=Boolean(o&&o.offSide),r=new Array(t-e+1);let a=-2,l=-1,h=-2,d=-1;for(let o=e;o<=t;o++){const t=o-e,c=this._computeIndentLevel(o-1);if(c>=0)a=o-1,l=c,r[t]=Math.ceil(c/n.indentSize);else{if(-2===a){a=-1,l=-1;for(let e=o-2;e>=0;e--){const t=this._computeIndentLevel(e);if(t>=0){a=e,l=t;break}}}if(-1!==h&&(-2===h||h<o-1)){h=-1,d=-1;for(let e=o;e<i;e++){const t=this._computeIndentLevel(e);if(t>=0){h=e,d=t;break}}}r[t]=this._getIndentLevelForWhitespaceLine(s,l,d)}}return r}_getIndentLevelForWhitespaceLine(e,t,i){const n=this.textModel.getOptions();return-1===t||-1===i?0:t<i?1+Math.floor(t/n.indentSize):t===i||e?Math.ceil(i/n.indentSize):1+Math.floor(i/n.indentSize)}}class Xb{constructor(){this.activeClassName="indent-active"}getInlineClassName(e,t,i){return this.getInlineClassNameOfLevel(i?t:e)}getInlineClassNameOfLevel(e){return"bracket-indent-guide lvl-"+e%30}}class Jb{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function ew(e,t,i,n,o){let s;for(o.spacesDiff=0,o.looksLikeAlignment=!1,s=0;s<t&&s<n&&e.charCodeAt(s)===i.charCodeAt(s);s++);let r=0,a=0;for(let i=s;i<t;i++)32===e.charCodeAt(i)?r++:a++;let l=0,h=0;for(let e=s;e<n;e++)32===i.charCodeAt(e)?l++:h++;if(r>0&&a>0)return;if(l>0&&h>0)return;const d=Math.abs(a-h),c=Math.abs(r-l);if(0===d)return o.spacesDiff=c,void(c>0&&0<=l-1&&l-1<e.length&&l<i.length&&32!==i.charCodeAt(l)&&32===e.charCodeAt(l-1)&&44===e.charCodeAt(e.length-1)&&(o.looksLikeAlignment=!0));c%d!=0||(o.spacesDiff=c/d)}function tw(e,t,i){const n=Math.min(e.getLineCount(),1e4);let o=0,s=0,r="",a=0;const l=[2,4,6,8,3,5,7],h=[0,0,0,0,0,0,0,0,0],d=new Jb;for(let l=1;l<=n;l++){const n=e.getLineLength(l),c=e.getLineContent(l),u=n<=65536;let g=!1,p=0,m=0,f=0;for(let t=0,i=n;t<i;t++){const i=u?c.charCodeAt(t):e.getLineCharCode(l,t);if(9===i)f++;else{if(32!==i){g=!0,p=t;break}m++}}if(!g)continue;if(f>0?o++:m>1&&s++,ew(r,a,c,p,d),d.looksLikeAlignment&&(!i||t!==d.spacesDiff))continue;const _=d.spacesDiff;_<=8&&h[_]++,r=c,a=p}let c=i;o!==s&&(c=o<s);let u=t;if(c){let e=c?0:.1*n;l.forEach((t=>{const i=h[t];i>e&&(e=i,u=t)})),4===u&&h[4]>0&&h[2]>0&&h[2]>=h[4]/2&&(u=2)}return{insertSpaces:c,tabSize:u}}function iw(e){return(1&e.metadata)>>>0}function nw(e,t){e.metadata=254&e.metadata|t<<0}function ow(e){return(2&e.metadata)>>>1==1}function sw(e,t){e.metadata=253&e.metadata|(t?1:0)<<1}function rw(e){return(4&e.metadata)>>>2==1}function aw(e,t){e.metadata=251&e.metadata|(t?1:0)<<2}function lw(e){return(64&e.metadata)>>>6==1}function hw(e,t){e.metadata=191&e.metadata|(t?1:0)<<6}function dw(e,t){e.metadata=231&e.metadata|t<<3}function cw(e,t){e.metadata=223&e.metadata|(t?1:0)<<5}class uw{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,nw(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,aw(this,!1),hw(this,!1),dw(this,1),cw(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,sw(this,!1)}reset(e,t,i,n){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=n}setOptions(e){this.options=e;const t=this.options.className;aw(this,"squiggly-error"===t||"squiggly-warning"===t||"squiggly-info"===t),hw(this,null!==this.options.glyphMarginClassName),dw(this,this.options.stickiness),cw(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const gw=new uw(null,0,0);gw.parent=gw,gw.left=gw,gw.right=gw,nw(gw,0);class pw{constructor(){this.root=gw,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,o,s){return this.root===gw?[]:function(e,t,i,n,o,s,r){let a=e.root,l=0,h=0,d=0,c=0;const u=[];let g=0;for(;a!==gw;)if(ow(a))sw(a.left,!1),sw(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;else{if(!ow(a.left)){if(h=l+a.maxEnd,h<t){sw(a,!0);continue}if(a.left!==gw){a=a.left;continue}}if(d=l+a.start,d>i)sw(a,!0);else{if(c=l+a.end,c>=t){a.setCachedOffsets(d,c,s);let e=!0;n&&a.ownerId&&a.ownerId!==n&&(e=!1),o&&rw(a)&&(e=!1),r&&!lw(a)&&(e=!1),e&&(u[g++]=a)}sw(a,!0),a.right===gw||ow(a.right)||(l+=a.delta,a=a.right)}}return sw(e.root,!1),u}(this,e,t,i,n,o,s)}search(e,t,i,n){return this.root===gw?[]:function(e,t,i,n,o){let s=e.root,r=0,a=0,l=0;const h=[];let d=0;for(;s!==gw;){if(ow(s)){sw(s.left,!1),sw(s.right,!1),s===s.parent.right&&(r-=s.parent.delta),s=s.parent;continue}if(s.left!==gw&&!ow(s.left)){s=s.left;continue}a=r+s.start,l=r+s.end,s.setCachedOffsets(a,l,n);let e=!0;t&&s.ownerId&&s.ownerId!==t&&(e=!1),i&&rw(s)&&(e=!1),o&&!lw(s)&&(e=!1),e&&(h[d++]=s),sw(s,!0),s.right===gw||ow(s.right)||(r+=s.delta,s=s.right)}return sw(e.root,!1),h}(this,e,t,i,n)}collectNodesFromOwner(e){return function(e,t){let i=e.root;const n=[];let o=0;for(;i!==gw;)ow(i)?(sw(i.left,!1),sw(i.right,!1),i=i.parent):i.left===gw||ow(i.left)?(i.ownerId===t&&(n[o++]=i),sw(i,!0),i.right===gw||ow(i.right)||(i=i.right)):i=i.left;return sw(e.root,!1),n}(this,e)}collectNodesPostOrder(){return function(e){let t=e.root;const i=[];let n=0;for(;t!==gw;)ow(t)?(sw(t.left,!1),sw(t.right,!1),t=t.parent):t.left===gw||ow(t.left)?t.right===gw||ow(t.right)?(i[n++]=t,sw(t,!0)):t=t.right:t=t.left;return sw(e.root,!1),i}(this)}insert(e){_w(this,e),this._normalizeDeltaIfNecessary()}delete(e){vw(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let n=0;for(;e!==this.root;)e===e.parent.right&&(n+=e.parent.delta),e=e.parent;const o=i.start+n,s=i.end+n;i.setCachedOffsets(o,s,t)}acceptReplace(e,t,i,n){const o=function(e,t,i){let n=e.root,o=0,s=0,r=0,a=0;const l=[];let h=0;for(;n!==gw;)if(ow(n))sw(n.left,!1),sw(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),n=n.parent;else{if(!ow(n.left)){if(s=o+n.maxEnd,s<t){sw(n,!0);continue}if(n.left!==gw){n=n.left;continue}}r=o+n.start,r>i?sw(n,!0):(a=o+n.end,a>=t&&(n.setCachedOffsets(r,a,0),l[h++]=n),sw(n,!0),n.right===gw||ow(n.right)||(o+=n.delta,n=n.right))}return sw(e.root,!1),l}(this,e,e+t);for(let e=0,t=o.length;e<t;e++)vw(this,o[e]);this._normalizeDeltaIfNecessary(),function(e,t,i,n){let o=e.root,s=0,r=0,a=0;const l=n-(i-t);for(;o!==gw;)if(ow(o))sw(o.left,!1),sw(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),Sw(o),o=o.parent;else{if(!ow(o.left)){if(r=s+o.maxEnd,r<t){sw(o,!0);continue}if(o.left!==gw){o=o.left;continue}}a=s+o.start,a>i?(o.start+=l,o.end+=l,o.delta+=l,(o.delta<-1073741824||o.delta>1073741824)&&(e.requestNormalizeDelta=!0),sw(o,!0)):(sw(o,!0),o.right===gw||ow(o.right)||(s+=o.delta,o=o.right))}sw(e.root,!1)}(this,e,e+t,i),this._normalizeDeltaIfNecessary();for(let s=0,r=o.length;s<r;s++){const r=o[s];r.start=r.cachedAbsoluteStart,r.end=r.cachedAbsoluteEnd,fw(r,e,e+t,i,n),r.maxEnd=r.end,_w(this,r)}this._normalizeDeltaIfNecessary()}_normalizeDeltaIfNecessary(){this.requestNormalizeDelta&&(this.requestNormalizeDelta=!1,function(e){let t=e.root,i=0;for(;t!==gw;)t.left===gw||ow(t.left)?t.right===gw||ow(t.right)?(t.start=i+t.start,t.end=i+t.end,t.delta=0,Sw(t),sw(t,!0),sw(t.left,!1),sw(t.right,!1),t===t.parent.right&&(i-=t.parent.delta),t=t.parent):(i+=t.delta,t=t.right):t=t.left;sw(e.root,!1)}(this))}}function mw(e,t,i,n){return e<i||!(e>i)&&1!==n&&(2===n||t)}function fw(e,t,i,n,o){const s=function(e){return(24&e.metadata)>>>3}(e),r=0===s||2===s,a=1===s||2===s,l=i-t,h=n,d=Math.min(l,h),c=e.start;let u=!1;const g=e.end;let p=!1;t<=c&&g<=i&&function(e){return(32&e.metadata)>>>5==1}(e)&&(e.start=t,u=!0,e.end=t,p=!0);{const e=o?1:l>0?2:0;!u&&mw(c,r,t,e)&&(u=!0),!p&&mw(g,a,t,e)&&(p=!0)}if(d>0&&!o){const e=l>h?2:0;!u&&mw(c,r,t+d,e)&&(u=!0),!p&&mw(g,a,t+d,e)&&(p=!0)}{const n=o?1:0;!u&&mw(c,r,i,n)&&(e.start=t+h,u=!0),!p&&mw(g,a,i,n)&&(e.end=t+h,p=!0)}const m=h-l;u||(e.start=Math.max(0,c+m)),p||(e.end=Math.max(0,g+m)),e.start>e.end&&(e.end=e.start)}function _w(e,t){if(e.root===gw)return t.parent=gw,t.left=gw,t.right=gw,nw(t,0),e.root=t,e.root;!function(e,t){let i=0,n=e.root;const o=t.start,s=t.end;for(;;)if(r=o,a=s,l=n.start+i,h=n.end+i,(r===l?a-h:r-l)<0){if(n.left===gw){t.start-=i,t.end-=i,t.maxEnd-=i,n.left=t;break}n=n.left}else{if(n.right===gw){t.start-=i+n.delta,t.end-=i+n.delta,t.maxEnd-=i+n.delta,n.right=t;break}i+=n.delta,n=n.right}var r,a,l,h;t.parent=n,t.left=gw,t.right=gw,nw(t,1)}(e,t),kw(t.parent);let i=t;for(;i!==e.root&&1===iw(i.parent);)if(i.parent===i.parent.parent.left){const t=i.parent.parent.right;1===iw(t)?(nw(i.parent,0),nw(t,0),nw(i.parent.parent,1),i=i.parent.parent):(i===i.parent.right&&(i=i.parent,ww(e,i)),nw(i.parent,0),nw(i.parent.parent,1),Cw(e,i.parent.parent))}else{const t=i.parent.parent.left;1===iw(t)?(nw(i.parent,0),nw(t,0),nw(i.parent.parent,1),i=i.parent.parent):(i===i.parent.left&&(i=i.parent,Cw(e,i)),nw(i.parent,0),nw(i.parent.parent,1),ww(e,i.parent.parent))}return nw(e.root,0),t}function vw(e,t){let i,n;if(t.left===gw?(i=t.right,n=t,i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta):t.right===gw?(i=t.left,n=t):(n=function(e){for(;e.left!==gw;)e=e.left;return e}(t.right),i=n.right,i.start+=n.delta,i.end+=n.delta,i.delta+=n.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta,n.delta=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0)),n===e.root)return e.root=i,nw(i,0),t.detach(),bw(),Sw(i),void(e.root.parent=gw);const o=1===iw(n);if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?i.parent=n.parent:(n.parent===t?i.parent=n:i.parent=n.parent,n.left=t.left,n.right=t.right,n.parent=t.parent,nw(n,iw(t)),t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==gw&&(n.left.parent=n),n.right!==gw&&(n.right.parent=n)),t.detach(),o)return kw(i.parent),n!==t&&(kw(n),kw(n.parent)),void bw();let s;for(kw(i),kw(i.parent),n!==t&&(kw(n),kw(n.parent));i!==e.root&&0===iw(i);)i===i.parent.left?(s=i.parent.right,1===iw(s)&&(nw(s,0),nw(i.parent,1),ww(e,i.parent),s=i.parent.right),0===iw(s.left)&&0===iw(s.right)?(nw(s,1),i=i.parent):(0===iw(s.right)&&(nw(s.left,0),nw(s,1),Cw(e,s),s=i.parent.right),nw(s,iw(i.parent)),nw(i.parent,0),nw(s.right,0),ww(e,i.parent),i=e.root)):(s=i.parent.left,1===iw(s)&&(nw(s,0),nw(i.parent,1),Cw(e,i.parent),s=i.parent.left),0===iw(s.left)&&0===iw(s.right)?(nw(s,1),i=i.parent):(0===iw(s.left)&&(nw(s.right,0),nw(s,1),ww(e,s),s=i.parent.left),nw(s,iw(i.parent)),nw(i.parent,0),nw(s.left,0),Cw(e,i.parent),i=e.root));nw(i,0),bw()}function bw(){gw.parent=gw,gw.delta=0,gw.start=0,gw.end=0}function ww(e,t){const i=t.right;i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta,t.right=i.left,i.left!==gw&&(i.left.parent=t),i.parent=t.parent,t.parent===gw?e.root=i:t===t.parent.left?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i,Sw(t),Sw(i)}function Cw(e,t){const i=t.left;t.delta-=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(e.requestNormalizeDelta=!0),t.start-=i.delta,t.end-=i.delta,t.left=i.right,i.right!==gw&&(i.right.parent=t),i.parent=t.parent,t.parent===gw?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i,Sw(t),Sw(i)}function yw(e){let t=e.end;if(e.left!==gw){const i=e.left.maxEnd;i>t&&(t=i)}if(e.right!==gw){const i=e.right.maxEnd+e.delta;i>t&&(t=i)}return t}function Sw(e){e.maxEnd=yw(e)}function kw(e){for(;e!==gw;){const t=yw(e);if(e.maxEnd===t)return;e.maxEnd=t,e=e.parent}}class Lw{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==xw)return Dw(this.right);let e=this;for(;e.parent!==xw&&e.parent.left!==e;)e=e.parent;return e.parent===xw?xw:e.parent}prev(){if(this.left!==xw)return Ew(this.left);let e=this;for(;e.parent!==xw&&e.parent.right!==e;)e=e.parent;return e.parent===xw?xw:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const xw=new Lw(null,0);function Dw(e){for(;e.left!==xw;)e=e.left;return e}function Ew(e){for(;e.right!==xw;)e=e.right;return e}function Nw(e){return e===xw?0:e.size_left+e.piece.length+Nw(e.right)}function Iw(e){return e===xw?0:e.lf_left+e.piece.lineFeedCnt+Iw(e.right)}function Mw(){xw.parent=xw}function Tw(e,t){const i=t.right;i.size_left+=t.size_left+(t.piece?t.piece.length:0),i.lf_left+=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),t.right=i.left,i.left!==xw&&(i.left.parent=t),i.parent=t.parent,t.parent===xw?e.root=i:t.parent.left===t?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i}function Aw(e,t){const i=t.left;t.left=i.right,i.right!==xw&&(i.right.parent=t),i.parent=t.parent,t.size_left-=i.size_left+(i.piece?i.piece.length:0),t.lf_left-=i.lf_left+(i.piece?i.piece.lineFeedCnt:0),t.parent===xw?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i}function Rw(e,t){let i,n;if(t.left===xw?(n=t,i=n.right):t.right===xw?(n=t,i=n.left):(n=Dw(t.right),i=n.right),n===e.root)return e.root=i,i.color=0,t.detach(),Mw(),void(e.root.parent=xw);const o=1===n.color;if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?(i.parent=n.parent,Fw(e,i)):(n.parent===t?i.parent=n:i.parent=n.parent,Fw(e,i),n.left=t.left,n.right=t.right,n.parent=t.parent,n.color=t.color,t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==xw&&(n.left.parent=n),n.right!==xw&&(n.right.parent=n),n.size_left=t.size_left,n.lf_left=t.lf_left,Fw(e,n)),t.detach(),i.parent.left===i){const t=Nw(i),n=Iw(i);if(t!==i.parent.size_left||n!==i.parent.lf_left){const o=t-i.parent.size_left,s=n-i.parent.lf_left;i.parent.size_left=t,i.parent.lf_left=n,Pw(e,i.parent,o,s)}}if(Fw(e,i.parent),o)return void Mw();let s;for(;i!==e.root&&0===i.color;)i===i.parent.left?(s=i.parent.right,1===s.color&&(s.color=0,i.parent.color=1,Tw(e,i.parent),s=i.parent.right),0===s.left.color&&0===s.right.color?(s.color=1,i=i.parent):(0===s.right.color&&(s.left.color=0,s.color=1,Aw(e,s),s=i.parent.right),s.color=i.parent.color,i.parent.color=0,s.right.color=0,Tw(e,i.parent),i=e.root)):(s=i.parent.left,1===s.color&&(s.color=0,i.parent.color=1,Aw(e,i.parent),s=i.parent.left),0===s.left.color&&0===s.right.color?(s.color=1,i=i.parent):(0===s.left.color&&(s.right.color=0,s.color=1,Tw(e,s),s=i.parent.left),s.color=i.parent.color,i.parent.color=0,s.left.color=0,Aw(e,i.parent),i=e.root));i.color=0,Mw()}function Ow(e,t){for(Fw(e,t);t!==e.root&&1===t.parent.color;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.right&&Tw(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,Aw(e,t.parent.parent))}else{const i=t.parent.parent.left;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.left&&Aw(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,Tw(e,t.parent.parent))}e.root.color=0}function Pw(e,t,i,n){for(;t!==e.root&&t!==xw;)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}function Fw(e,t){let i=0,n=0;if(t!==e.root){for(;t!==e.root&&t===t.parent.right;)t=t.parent;if(t!==e.root)for(i=Nw((t=t.parent).left)-t.size_left,n=Iw(t.left)-t.lf_left,t.size_left+=i,t.lf_left+=n;t!==e.root&&(0!==i||0!==n);)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}}function Bw(e){return e<0?0:e>255?255:0|e}function Ww(e){return e<0?0:e>4294967295?4294967295:0|e}xw.parent=xw,xw.left=xw,xw.right=xw,xw.color=0;class Vw{constructor(e){const t=Bw(e);this._defaultValue=t,this._asciiMap=Vw._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){const t=new Uint8Array(256);return t.fill(e),t}set(e,t){const i=Bw(t);e>=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}class zw{constructor(){this._actual=new Vw(0)}add(e){this._actual.set(e,1)}has(e){return 1===this._actual.get(e)}clear(){return this._actual.clear()}}class Hw extends Vw{constructor(e){super(0);for(let t=0,i=e.length;t<i;t++)this.set(e.charCodeAt(t),2);this.set(32,1),this.set(9,1)}}const Uw=function(e){const t={};return e=>(t.hasOwnProperty(e)||(t[e]=(e=>new Hw(e))(e)),t[e])}();class Kw{constructor(e,t,i,n){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=n}parseSearchRequest(){if(""===this.searchString)return null;let e;e=this.isRegex?function(e){if(!e||0===e.length)return!1;for(let t=0,i=e.length;t<i;t++){const n=e.charCodeAt(t);if(10===n)return!0;if(92===n){if(t++,t>=i)break;const n=e.charCodeAt(t);if(110===n||114===n||87===n)return!0}}return!1}(this.searchString):this.searchString.indexOf("\n")>=0;let t=null;try{t=pn(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch(e){return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new xc(t,this.wordSeparators?Uw(this.wordSeparators):null,i?this.searchString:null)}}function jw(e,t,i){if(!i)return new kc(e,null);const n=[];for(let e=0,i=t.length;e<i;e++)n[e]=t[e];return new kc(e,n)}class qw{constructor(e){const t=[];let i=0;for(let n=0,o=e.length;n<o;n++)10===e.charCodeAt(n)&&(t[i++]=n);this._lineFeedsOffsets=t}findLineFeedCountBeforeOffset(e){const t=this._lineFeedsOffsets;let i=0,n=t.length-1;if(-1===n)return 0;if(e<=t[0])return 0;for(;i<n;){const o=i+((n-i)/2>>0);t[o]>=e?n=o-1:t[o+1]>=e?(i=o,n=o):i=o+1}return i+1}}class $w{static findMatches(e,t,i,n,o){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,i,new Zw(s.wordSeparators,s.regex),n,o):this._doFindMatchesLineByLine(e,i,s,n,o):[]}static _getMultilineMatchRange(e,t,i,n,o,s){let r,a,l=0;if(n?(l=n.findLineFeedCountBeforeOffset(o),r=t+o+l):r=t+o,n){const e=n.findLineFeedCountBeforeOffset(o+s.length)-l;a=r+s.length+e}else a=r+s.length;const h=e.getPositionAt(r),d=e.getPositionAt(a);return new tc(h.lineNumber,h.column,d.lineNumber,d.column)}static _doFindMatchesMultiline(e,t,i,n,o){const s=e.getOffsetAt(t.getStartPosition()),r=e.getValueInRange(t,1),a="\r\n"===e.getEOL()?new qw(r):null,l=[];let h,d=0;for(i.reset(0);h=i.next(r);)if(l[d++]=jw(this._getMultilineMatchRange(e,s,r,a,h.index,h[0]),h,n),d>=o)return l;return l}static _doFindMatchesLineByLine(e,t,i,n,o){const s=[];let r=0;if(t.startLineNumber===t.endLineNumber){const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return r=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,r,s,n,o),s}const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);r=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,r,s,n,o);for(let a=t.startLineNumber+1;a<t.endLineNumber&&r<o;a++)r=this._findMatchesInLine(i,e.getLineContent(a),a,0,r,s,n,o);if(r<o){const a=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);r=this._findMatchesInLine(i,a,t.endLineNumber,0,r,s,n,o)}return s}static _findMatchesInLine(e,t,i,n,o,s,r,a){const l=e.wordSeparators;if(!r&&e.simpleSearch){const r=e.simpleSearch,h=r.length,d=t.length;let c=-h;for(;-1!==(c=t.indexOf(r,c+h));)if((!l||Gw(l,t,d,c,h))&&(s[o++]=new kc(new tc(i,c+1+n,i,c+1+h+n),null),o>=a))return o;return o}const h=new Zw(e.wordSeparators,e.regex);let d;h.reset(0);do{if(d=h.next(t),d&&(s[o++]=jw(new tc(i,d.index+1+n,i,d.index+1+d[0].length+n),d,r),o>=a))return o}while(d);return o}static findNextMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const s=new Zw(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,s,n):this._doFindNextMatchLineByLine(e,i,s,n)}static _doFindNextMatchMultiline(e,t,i,n){const o=new ch(t.lineNumber,1),s=e.getOffsetAt(o),r=e.getLineCount(),a=e.getValueInRange(new tc(o.lineNumber,o.column,r,e.getLineMaxColumn(r)),1),l="\r\n"===e.getEOL()?new qw(a):null;i.reset(t.column-1);const h=i.next(a);return h?jw(this._getMultilineMatchRange(e,s,a,l,h.index,h[0]),h,n):1!==t.lineNumber||1!==t.column?this._doFindNextMatchMultiline(e,new ch(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const o=e.getLineCount(),s=t.lineNumber,r=e.getLineContent(s),a=this._findFirstMatchInLine(i,r,s,t.column,n);if(a)return a;for(let t=1;t<=o;t++){const r=(s+t-1)%o,a=e.getLineContent(r+1),l=this._findFirstMatchInLine(i,a,r+1,1,n);if(l)return l}return null}static _findFirstMatchInLine(e,t,i,n,o){e.reset(n-1);const s=e.next(t);return s?jw(new tc(i,s.index+1,i,s.index+1+s[0].length),s,o):null}static findPreviousMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const s=new Zw(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,s,n):this._doFindPreviousMatchLineByLine(e,i,s,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const o=this._doFindMatchesMultiline(e,new tc(1,1,t.lineNumber,t.column),i,n,9990);if(o.length>0)return o[o.length-1];const s=e.getLineCount();return t.lineNumber!==s||t.column!==e.getLineMaxColumn(s)?this._doFindPreviousMatchMultiline(e,new ch(s,e.getLineMaxColumn(s)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const o=e.getLineCount(),s=t.lineNumber,r=e.getLineContent(s).substring(0,t.column-1),a=this._findLastMatchInLine(i,r,s,n);if(a)return a;for(let t=1;t<=o;t++){const r=(o+s-t-1)%o,a=e.getLineContent(r+1),l=this._findLastMatchInLine(i,a,r+1,n);if(l)return l}return null}static _findLastMatchInLine(e,t,i,n){let o,s=null;for(e.reset(0);o=e.next(t);)s=jw(new tc(i,o.index+1,i,o.index+1+o[0].length),o,n);return s}}function Gw(e,t,i,n,o){return function(e,t,i,n,o){if(0===n)return!0;const s=t.charCodeAt(n-1);if(0!==e.get(s))return!0;if(13===s||10===s)return!0;if(o>0){const i=t.charCodeAt(n);if(0!==e.get(i))return!0}return!1}(e,t,0,n,o)&&function(e,t,i,n,o){if(n+o===i)return!0;const s=t.charCodeAt(n+o);if(0!==e.get(s))return!0;if(13===s||10===s)return!0;if(o>0){const i=t.charCodeAt(n+o-1);if(0!==e.get(i))return!0}return!1}(e,t,i,n,o)}class Zw{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t)return null;if(i=this._searchRegex.exec(e),!i)return null;const n=i.index,o=i[0].length;if(n===this._prevMatchStartIndex&&o===this._prevMatchLength){if(0===o){An(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=o,!this._wordSeparators||Gw(this._wordSeparators,e,t,n,o))return i}while(i);return null}}const Yw=65535;function Qw(e){let t;return t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length),t.set(e,0),t}class Xw{constructor(e,t,i,n,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=o}}function Jw(e,t=!0){const i=[0];let n=1;for(let t=0,o=e.length;t<o;t++){const s=e.charCodeAt(t);13===s?t+1<o&&10===e.charCodeAt(t+1)?(i[n++]=t+2,t++):i[n++]=t+1:10===s&&(i[n++]=t+1)}return t?Qw(i):i}class eC{constructor(e,t,i,n,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=o}}class tC{constructor(e,t){this.buffer=e,this.lineStarts=t}}class iC{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==xw&&e.iterate(e.root,(e=>(e!==xw&&this._pieces.push(e.piece),!0)))}read(){return 0===this._pieces.length?0===this._index?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:0===this._index?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class nC{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber<e&&i.nodeStartLineNumber+i.node.piece.lineFeedCnt>=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const i=this._cache;for(let n=0;n<i.length;n++){const o=i[n];(null===o.node.parent||o.nodeStartOffset>=e)&&(i[n]=null,t=!0)}if(t){const e=[];for(const t of i)null!==t&&e.push(t);this._cache=e}}}class oC{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new tC("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=xw,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let t=0,i=e.length;t<i;t++)if(e[t].buffer.length>0){e[t].lineStarts||(e[t].lineStarts=Jw(e[t].buffer));const i=new eC(t+1,{line:0,column:0},{line:e[t].lineStarts.length-1,column:e[t].buffer.length-e[t].lineStarts[e[t].lineStarts.length-1]},e[t].lineStarts.length-1,e[t].buffer.length);this._buffers.push(e[t]),n=this.rbInsertRight(n,i)}this._searchCache=new nC(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=65535-Math.floor(21845),i=2*t;let n="",o=0;const s=[];if(this.iterate(this.root,(r=>{const a=this.getNodeContent(r),l=a.length;if(o<=t||o+l<i)return n+=a,o+=l,!0;const h=n.replace(/\r\n|\r|\n/g,e);return s.push(new tC(h,Jw(h))),n=a,o=l,!0})),o>0){const t=n.replace(/\r\n|\r|\n/g,e);s.push(new tC(t,Jw(t)))}this.create(s,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new iC(this,e)}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==xw;)if(n.left!==xw&&n.lf_left+1>=e)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt+1>=e)return i+=n.size_left,i+(this.getAccumulatedValue(n,e-n.lf_left-2)+t-1);e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right}return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const n=e;for(;t!==xw;)if(0!==t.size_left&&t.size_left>=e)t=t.left;else{if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+o.index,0===o.index){const e=this.getOffsetAt(i+1,1);return new ch(i+1,n-e+1)}return new ch(i+1,o.remainder+1)}if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===xw){const t=this.getOffsetAt(i+1,1);return new ch(i+1,n-e-t+1)}t=t.right}return new ch(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const i=this.nodeAt2(e.startLineNumber,e.startColumn),n=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,n);return t?t===this._EOL&&this._EOLNormalized&&t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const i=e.node,n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n.substring(o+e.remainder,o+t.remainder)}let i=e.node;const n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let s=n.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==xw;){const e=this._buffers[i.piece.bufferIndex].buffer,n=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){s+=e.substring(n,n+t.remainder);break}s+=e.substr(n,i.piece.length),i=i.next()}return s}getLinesContent(){const e=[];let t=0,i="",n=!1;return this.iterate(this.root,(o=>{if(o===xw)return!0;const s=o.piece;let r=s.length;if(0===r)return!0;const a=this._buffers[s.bufferIndex].buffer,l=this._buffers[s.bufferIndex].lineStarts,h=s.start.line,d=s.end.line;let c=l[h]+s.start.column;if(n&&(10===a.charCodeAt(c)&&(c++,r--),e[t++]=i,i="",n=!1,0===r))return!0;if(h===d)return this._EOLNormalized||13!==a.charCodeAt(c+r-1)?i+=a.substr(c,r):(n=!0,i+=a.substr(c,r-1)),!0;i+=this._EOLNormalized?a.substring(c,Math.max(c,l[h+1]-this._EOLLength)):a.substring(c,l[h+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let n=h+1;n<d;n++)i=this._EOLNormalized?a.substring(l[n],l[n+1]-this._EOLLength):a.substring(l[n],l[n+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;return this._EOLNormalized||13!==a.charCodeAt(l[d]+s.end.column-1)?i=a.substr(l[d],s.end.column):(n=!0,0===s.end.column?t--:i=a.substr(l[d],s.end.column-1)),!0})),n&&(e[t++]=i,i=""),e[t++]=i,e}getLength(){return this._length}getLineCount(){return this._lineCnt}getLineContent(e){return this._lastVisitedLine.lineNumber===e||(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,"")),this._lastVisitedLine.value}_getCharCode(e){if(e.remainder===e.node.piece.length){const t=e.node.next();if(!t)return 0;const i=this._buffers[t.piece.bufferIndex],n=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start);return i.buffer.charCodeAt(n)}{const t=this._buffers[e.node.piece.bufferIndex],i=this.offsetInBuffer(e.node.piece.bufferIndex,e.node.piece.start)+e.remainder;return t.buffer.charCodeAt(i)}}getLineCharCode(e,t){const i=this.nodeAt2(e,t+1);return this._getCharCode(i)}getLineLength(e){if(e===this.getLineCount()){const t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength}findMatchesInNode(e,t,i,n,o,s,r,a,l,h,d){const c=this._buffers[e.piece.bufferIndex],u=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),g=this.offsetInBuffer(e.piece.bufferIndex,o),p=this.offsetInBuffer(e.piece.bufferIndex,s);let m;const f={line:0,column:0};let _,v;t._wordSeparators?(_=c.buffer.substring(g,p),v=e=>e+g,t.reset(0)):(_=c.buffer,v=e=>e,t.reset(g));do{if(m=t.next(_),m){if(v(m.index)>=p)return h;this.positionInBuffer(e,v(m.index)-u,f);const t=this.getLineFeedCnt(e.piece.bufferIndex,o,f),s=f.line===o.line?f.column-o.column+n:f.column+1,r=s+m[0].length;if(d[h++]=jw(new tc(i+t,s,i+t,r),m,a),v(m.index)+m[0].length>=p)return h;if(h>=l)return h}}while(m);return h}findMatchesLineByLine(e,t,i,n){const o=[];let s=0;const r=new Zw(t.wordSeparators,t.regex);let a=this.nodeAt2(e.startLineNumber,e.startColumn);if(null===a)return[];const l=this.nodeAt2(e.endLineNumber,e.endColumn);if(null===l)return[];let h=this.positionInBuffer(a.node,a.remainder);const d=this.positionInBuffer(l.node,l.remainder);if(a.node===l.node)return this.findMatchesInNode(a.node,r,e.startLineNumber,e.startColumn,h,d,t,i,n,s,o),o;let c=e.startLineNumber,u=a.node;for(;u!==l.node;){const l=this.getLineFeedCnt(u.piece.bufferIndex,h,u.piece.end);if(l>=1){const a=this._buffers[u.piece.bufferIndex].lineStarts,d=this.offsetInBuffer(u.piece.bufferIndex,u.piece.start),g=a[h.line+l],p=c===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(u,r,c,p,h,this.positionInBuffer(u,g-d),t,i,n,s,o),s>=n)return o;c+=l}const d=c===e.startLineNumber?e.startColumn-1:0;if(c===e.endLineNumber){const a=this.getLineContent(c).substring(d,e.endColumn-1);return s=this._findMatchesInLine(t,r,a,e.endLineNumber,d,s,o,i,n),o}if(s=this._findMatchesInLine(t,r,this.getLineContent(c).substr(d),c,d,s,o,i,n),s>=n)return o;c++,a=this.nodeAt2(c,1),u=a.node,h=this.positionInBuffer(a.node,a.remainder)}if(c===e.endLineNumber){const a=c===e.startLineNumber?e.startColumn-1:0,l=this.getLineContent(c).substring(a,e.endColumn-1);return s=this._findMatchesInLine(t,r,l,e.endLineNumber,a,s,o,i,n),o}const g=c===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(l.node,r,c,g,h,d,t,i,n,s,o),o}_findMatchesInLine(e,t,i,n,o,s,r,a,l){const h=e.wordSeparators;if(!a&&e.simpleSearch){const t=e.simpleSearch,a=t.length,d=i.length;let c=-a;for(;-1!==(c=i.indexOf(t,c+a));)if((!h||Gw(h,i,d,c,a))&&(r[s++]=new kc(new tc(n,c+1+o,n,c+1+a+o),null),s>=l))return s;return s}let d;t.reset(0);do{if(d=t.next(i),d&&(r[s++]=jw(new tc(n,d.index+1+o,n,d.index+1+d[0].length+o),d,a),s>=l))return s}while(d);return s}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==xw){const{node:i,remainder:n,nodeStartOffset:o}=this.nodeAt(e),s=i.piece,r=s.bufferIndex,a=this.positionInBuffer(i,n);if(0===i.piece.bufferIndex&&s.end.line===this._lastChangeBufferPos.line&&s.end.column===this._lastChangeBufferPos.column&&o+s.length===e&&t.length<Yw)return this.appendToNode(i,t),void this.computeBufferMetadata();if(o===e)this.insertContentToNodeLeft(t,i),this._searchCache.validate(e);else if(o+i.piece.length>e){const e=[];let o=new eC(s.bufferIndex,a,s.end,this.getLineFeedCnt(s.bufferIndex,a,s.end),this.offsetInBuffer(r,s.end)-this.offsetInBuffer(r,a));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&10===this.nodeCharCodeAt(i,n)){const e={line:o.start.line+1,column:0};o=new eC(o.bufferIndex,e,o.end,this.getLineFeedCnt(o.bufferIndex,e,o.end),o.length-1),t+="\n"}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(13===this.nodeCharCodeAt(i,n-1)){const o=this.positionInBuffer(i,n-1);this.deleteNodeTail(i,o),t="\r"+t,0===i.piece.length&&e.push(i)}else this.deleteNodeTail(i,a);else this.deleteNodeTail(i,a);const l=this.createNewPieces(t);o.length>0&&this.rbInsertRight(i,o);let h=i;for(let e=0;e<l.length;e++)h=this.rbInsertRight(h,l[e]);this.deleteNodes(e)}else this.insertContentToNodeRight(t,i)}else{const e=this.createNewPieces(t);let i=this.rbInsertLeft(null,e[0]);for(let t=1;t<e.length;t++)i=this.rbInsertRight(i,e[t])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===xw)return;const i=this.nodeAt(e),n=this.nodeAt(e+t),o=i.node,s=n.node;if(o===s){const s=this.positionInBuffer(o,i.remainder),r=this.positionInBuffer(o,n.remainder);if(i.nodeStartOffset===e){if(t===o.piece.length){const e=o.next();return Rw(this,o),this.validateCRLFWithPrevNode(e),void this.computeBufferMetadata()}return this.deleteNodeHead(o,r),this._searchCache.validate(e),this.validateCRLFWithPrevNode(o),void this.computeBufferMetadata()}return i.nodeStartOffset+o.piece.length===e+t?(this.deleteNodeTail(o,s),this.validateCRLFWithNextNode(o),void this.computeBufferMetadata()):(this.shrinkNode(o,s,r),void this.computeBufferMetadata())}const r=[],a=this.positionInBuffer(o,i.remainder);this.deleteNodeTail(o,a),this._searchCache.validate(e),0===o.piece.length&&r.push(o);const l=this.positionInBuffer(s,n.remainder);this.deleteNodeHead(s,l),0===s.piece.length&&r.push(s);for(let e=o.next();e!==xw&&e!==s;e=e.next())r.push(e);const h=0===o.piece.length?o.prev():o;this.deleteNodes(r),this.validateCRLFWithNextNode(h),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){const i=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){const n=t.piece,o={line:n.start.line+1,column:0},s=new eC(n.bufferIndex,o,n.end,this.getLineFeedCnt(n.bufferIndex,o,n.end),n.length-1);t.piece=s,e+="\n",Pw(this,t,-1,-1),0===t.piece.length&&i.push(t)}const n=this.createNewPieces(e);let o=this.rbInsertLeft(t,n[n.length-1]);for(let e=n.length-2;e>=0;e--)o=this.rbInsertLeft(o,n[e]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+="\n");const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let o=n;for(let e=1;e<i.length;e++)o=this.rbInsertRight(o,i[e]);this.validateCRLFWithPrevNode(n)}positionInBuffer(e,t,i){const n=e.piece,o=e.piece.bufferIndex,s=this._buffers[o].lineStarts,r=s[n.start.line]+n.start.column+t;let a=n.start.line,l=n.end.line,h=0,d=0,c=0;for(;a<=l&&(h=a+(l-a)/2|0,c=s[h],h!==l);)if(d=s[h+1],r<c)l=h-1;else{if(!(r>=d))break;a=h+1}return i?(i.line=h,i.column=r-c,null):{line:h,column:r-c}}getLineFeedCnt(e,t,i){if(0===i.column)return i.line-t.line;const n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;const o=n[i.line+1],s=n[i.line]+i.column;if(o>s+1)return i.line-t.line;const r=s-1;return 13===this._buffers[e].buffer.charCodeAt(r)?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;t<e.length;t++)Rw(this,e[t])}createNewPieces(e){if(e.length>Yw){const t=[];for(;e.length>Yw;){const i=e.charCodeAt(65534);let n;13===i||i>=55296&&i<=56319?(n=e.substring(0,65534),e=e.substring(65534)):(n=e.substring(0,Yw),e=e.substring(Yw));const o=Jw(n);t.push(new eC(this._buffers.length,{line:0,column:0},{line:o.length-1,column:n.length-o[o.length-1]},o.length-1,n.length)),this._buffers.push(new tC(n,o))}const i=Jw(e);return t.push(new eC(this._buffers.length,{line:0,column:0},{line:i.length-1,column:e.length-i[i.length-1]},i.length-1,e.length)),this._buffers.push(new tC(e,i)),t}let t=this._buffers[0].buffer.length;const i=Jw(e,!1);let n=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&0!==t&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},n=this._lastChangeBufferPos;for(let e=0;e<i.length;e++)i[e]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+="_"+e,t+=1}else{if(0!==t)for(let e=0;e<i.length;e++)i[e]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+=e}const o=this._buffers[0].buffer.length,s=this._buffers[0].lineStarts.length-1,r={line:s,column:o-this._buffers[0].lineStarts[s]},a=new eC(0,n,r,this.getLineFeedCnt(0,n,r),o-t);return this._lastChangeBufferPos=r,[a]}getLineRawContent(e,t=0){let i=this.root,n="";const o=this._searchCache.get2(e);if(o){i=o.node;const s=this.getAccumulatedValue(i,e-o.nodeStartLineNumber-1),r=this._buffers[i.piece.bufferIndex].buffer,a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(o.nodeStartLineNumber+i.piece.lineFeedCnt!==e){const n=this.getAccumulatedValue(i,e-o.nodeStartLineNumber);return r.substring(a+s,a+n-t)}n=r.substring(a+s,a+i.piece.length)}else{let o=0;const s=e;for(;i!==xw;)if(i.left!==xw&&i.lf_left>=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){const n=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return o+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:o,nodeStartLineNumber:s-(e-1-i.lf_left)}),a.substring(l+n,l+r-t)}if(i.lf_left+i.piece.lineFeedCnt===e-1){const t=this.getAccumulatedValue(i,e-i.lf_left-2),o=this._buffers[i.piece.bufferIndex].buffer,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=o.substring(s+t,s+i.piece.length);break}e-=i.lf_left+i.piece.lineFeedCnt,o+=i.size_left+i.piece.length,i=i.right}}for(i=i.next();i!==xw;){const e=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(i,0),s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=e.substring(s,s+o-t),n}{const t=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=e.substr(t,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==xw;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){const i=e.piece,n=this.positionInBuffer(e,t),o=n.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const t=this.getLineFeedCnt(e.piece.bufferIndex,i.start,n);if(t!==o)return{index:t,remainder:0}}return{index:o,remainder:n.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,n=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?n[i.end.line]+i.end.column-n[i.start.line]-i.start.column:n[o]-n[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),s=t,r=this.offsetInBuffer(i.bufferIndex,s),a=this.getLineFeedCnt(i.bufferIndex,i.start,s),l=a-n,h=r-o,d=i.length+h;e.piece=new eC(i.bufferIndex,i.start,s,a,d),Pw(this,e,h,l)}deleteNodeHead(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),s=t,r=this.getLineFeedCnt(i.bufferIndex,s,i.end),a=r-n,l=o-this.offsetInBuffer(i.bufferIndex,s),h=i.length+l;e.piece=new eC(i.bufferIndex,s,i.end,r,h),Pw(this,e,l,a)}shrinkNode(e,t,i){const n=e.piece,o=n.start,s=n.end,r=n.length,a=n.lineFeedCnt,l=t,h=this.getLineFeedCnt(n.bufferIndex,n.start,l),d=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,o);e.piece=new eC(n.bufferIndex,n.start,l,h,d),Pw(this,e,d-r,h-a);const c=new eC(n.bufferIndex,i,s,this.getLineFeedCnt(n.bufferIndex,i,s),this.offsetInBuffer(n.bufferIndex,s)-this.offsetInBuffer(n.bufferIndex,i)),u=this.rbInsertRight(e,c);this.validateCRLFWithPrevNode(u)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+="\n");const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=Jw(t,!1);for(let e=0;e<o.length;e++)o[e]+=n;if(i){const e=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:n-e}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(o.slice(1));const s=this._buffers[0].lineStarts.length-1,r={line:s,column:this._buffers[0].buffer.length-this._buffers[0].lineStarts[s]},a=e.piece.length+t.length,l=e.piece.lineFeedCnt,h=this.getLineFeedCnt(0,e.piece.start,r),d=h-l;e.piece=new eC(e.piece.bufferIndex,e.piece.start,r,h,a),this._lastChangeBufferPos=r,Pw(this,e,t.length,d)}nodeAt(e){let t=this.root;const i=this._searchCache.get(e);if(i)return{node:i.node,nodeStartOffset:i.nodeStartOffset,remainder:e-i.nodeStartOffset};let n=0;for(;t!==xw;)if(t.size_left>e)t=t.left;else{if(t.size_left+t.piece.length>=e){n+=t.size_left;const i={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(i),i}e-=t.size_left+t.piece.length,n+=t.size_left+t.piece.length,t=t.right}return null}nodeAt2(e,t){let i=this.root,n=0;for(;i!==xw;)if(i.left!==xw&&i.lf_left>=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2),s=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(o+t-1,s),nodeStartOffset:n}}if(i.lf_left+i.piece.lineFeedCnt===e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:n};t-=i.piece.length-o;break}e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==xw;){if(i.piece.lineFeedCnt>0){const e=this.getAccumulatedValue(i,0),n=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,e),nodeStartOffset:n}}if(i.piece.length>=t-1)return{node:i,remainder:t-1,nodeStartOffset:this.offsetOfNode(i)};t-=i.piece.length,i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(n)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&"\n"===this._EOL)}startWithLF(e){if("string"==typeof e)return 10===e.charCodeAt(0);if(e===xw||0===e.piece.lineFeedCnt)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,o=i[n]+t.start.column;return n!==i.length-1&&(!(i[n+1]>o+1)&&10===this._buffers[t.bufferIndex].buffer.charCodeAt(o))}endWithCR(e){return"string"==typeof e?13===e.charCodeAt(e.length-1):e!==xw&&0!==e.piece.lineFeedCnt&&13===this.nodeCharCodeAt(e,e.piece.length-1)}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],n=this._buffers[e.piece.bufferIndex].lineStarts;let o;o=0===e.piece.end.column?{line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};const s=e.piece.length-1,r=e.piece.lineFeedCnt-1;e.piece=new eC(e.piece.bufferIndex,e.piece.start,o,r,s),Pw(this,e,-1,-1),0===e.piece.length&&i.push(e);const a={line:t.piece.start.line+1,column:0},l=t.piece.length-1,h=this.getLineFeedCnt(t.piece.bufferIndex,a,t.piece.end);t.piece=new eC(t.piece.bufferIndex,a,t.piece.end,h,l),Pw(this,t,-1,-1),0===t.piece.length&&i.push(t);const d=this.createNewPieces("\r\n");this.rbInsertRight(e,d[0]);for(let e=0;e<i.length;e++)Rw(this,i[e])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const i=t.next();if(this.startWithLF(i)){if(e+="\n",1===i.piece.length)Rw(this,i);else{const e=i.piece,t={line:e.start.line+1,column:0},n=e.length-1,o=this.getLineFeedCnt(e.bufferIndex,t,e.end);i.piece=new eC(e.bufferIndex,t,e.end,o,n),Pw(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===xw)return t(xw);const i=this.iterate(e.left,t);return i?t(e)&&this.iterate(e.right,t):i}getNodeContent(e){if(e===xw)return"";const t=this._buffers[e.piece.bufferIndex],i=e.piece,n=this.offsetInBuffer(i.bufferIndex,i.start),o=this.offsetInBuffer(i.bufferIndex,i.end);return t.buffer.substring(n,o)}getPieceContent(e){const t=this._buffers[e.bufferIndex],i=this.offsetInBuffer(e.bufferIndex,e.start),n=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(i,n)}rbInsertRight(e,t){const i=new Lw(t,1);if(i.left=xw,i.right=xw,i.parent=xw,i.size_left=0,i.lf_left=0,this.root===xw)this.root=i,i.color=0;else if(e.right===xw)e.right=i,i.parent=e;else{const t=Dw(e.right);t.left=i,i.parent=t}return Ow(this,i),i}rbInsertLeft(e,t){const i=new Lw(t,1);if(i.left=xw,i.right=xw,i.parent=xw,i.size_left=0,i.lf_left=0,this.root===xw)this.root=i,i.color=0;else if(e.left===xw)e.left=i,i.parent=e;else{const t=Ew(e.left);t.right=i,i.parent=t}return Ow(this,i),i}}class sC extends T{constructor(e,t,i,n,o,s,r){super(),this._onDidChangeContent=this._register(new q),this._BOM=t,this._mightContainNonBasicASCII=!s,this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._pieceTree=new oC(e,i,r)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:"")}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){const i=e+t,n=this.getPositionAt(e),o=this.getPositionAt(i);return new tc(n.lineNumber,n.column,o.lineNumber,o.column)}getValueInRange(e,t=0){if(e.isEmpty())return"";const i=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,i)}getValueLengthInRange(e,t=0){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;const i=this.getOffsetAt(e.startLineNumber,e.startColumn),n=this.getOffsetAt(e.endLineNumber,e.endColumn);let o=0;const s=this._getEndOfLine(t),r=this.getEOL();return s.length!==r.length&&(o=(s.length-r.length)*(e.endLineNumber-e.startLineNumber)),n-i+o}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0;const n=e.startLineNumber,o=e.endLineNumber;for(let t=n;t<=o;t++){const s=this.getLineContent(t),r=t===n?e.startColumn-1:0,a=t===o?e.endColumn-1:s.length;for(let e=r;e<a;e++)In(s.charCodeAt(e))?(i+=1,e+=1):i+=1}return i+=this._getEndOfLine(t).length*(o-n),i}return this.getValueLengthInRange(e,t)}getLength(){return this._pieceTree.getLength()}getLineCount(){return this._pieceTree.getLineCount()}getLinesContent(){return this._pieceTree.getLinesContent()}getLineContent(e){return this._pieceTree.getLineContent(e)}getLineCharCode(e,t){return this._pieceTree.getLineCharCode(e,t)}getLineLength(e){return this._pieceTree.getLineLength(e)}getLineFirstNonWhitespaceColumn(e){const t=fn(this.getLineContent(e));return-1===t?0:t+1}getLineLastNonWhitespaceColumn(e){const t=vn(this.getLineContent(e));return-1===t?0:t+2}_getEndOfLine(e){switch(e){case 1:return"\n";case 2:return"\r\n";case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,i){let n=this._mightContainRTL,o=this._mightContainUnusualLineTerminators,s=this._mightContainNonBasicASCII,r=!0,a=[];for(let t=0;t<e.length;t++){const i=e[t];r&&i._isTracked&&(r=!1);const l=i.range;if(i.text){let e=!0;s||(e=!zn(i.text),s=e),!n&&e&&(n=Wn(i.text)),!o&&e&&(o=Un(i.text))}let h="",d=0,c=0,u=0;if(i.text){let e;[d,c,u,e]=au(i.text);const t=this.getEOL();h=0===e||e===("\r\n"===t?2:1)?i.text:i.text.replace(/\r\n|\r|\n/g,t)}a[t]={sortIndex:t,identifier:i.identifier||null,range:l,rangeOffset:this.getOffsetAt(l.startLineNumber,l.startColumn),rangeLength:this.getValueLengthInRange(l),text:h,eolCount:d,firstLineLength:c,lastLineLength:u,forceMoveMarkers:Boolean(i.forceMoveMarkers),isAutoWhitespaceEdit:i.isAutoWhitespaceEdit||!1}}a.sort(sC._sortOpsAscending);let l=!1;for(let e=0,t=a.length-1;e<t;e++){const t=a[e].range.getEndPosition(),i=a[e+1].range.getStartPosition();if(i.isBeforeOrEqual(t)){if(i.isBefore(t))throw new Error("Overlapping ranges are not allowed!");l=!0}}r&&(a=this._reduceOperations(a));const h=i||t?sC._getInverseEditRanges(a):[],d=[];if(t)for(let e=0;e<a.length;e++){const t=a[e],i=h[e];if(t.isAutoWhitespaceEdit&&t.range.isEmpty())for(let e=i.startLineNumber;e<=i.endLineNumber;e++){let n="";e===i.startLineNumber&&(n=this.getLineContent(t.range.startLineNumber),-1!==fn(n))||d.push({lineNumber:e,oldContent:n})}}let c=null;if(i){let e=0;c=[];for(let t=0;t<a.length;t++){const i=a[t],n=h[t],o=this.getValueInRange(i.range),s=i.rangeOffset+e;e+=i.text.length-o.length,c[t]={sortIndex:i.sortIndex,identifier:i.identifier,range:n,text:o,textChange:new Fb(i.rangeOffset,o,s,i.text)}}l||c.sort(((e,t)=>e.sortIndex-t.sortIndex))}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=s;const u=this._doApplyEdits(a);let g=null;if(t&&d.length>0){d.sort(((e,t)=>t.lineNumber-e.lineNumber)),g=[];for(let e=0,t=d.length;e<t;e++){const t=d[e].lineNumber;if(e>0&&d[e-1].lineNumber===t)continue;const i=d[e].oldContent,n=this.getLineContent(t);0!==n.length&&n!==i&&-1===fn(n)&&g.push(t)}}return this._onDidChangeContent.fire(),new Dc(c,u,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,n=e[e.length-1].range,o=new tc(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let s=i.startLineNumber,r=i.startColumn;const a=[];for(let i=0,n=e.length;i<n;i++){const n=e[i],o=n.range;t=t||n.forceMoveMarkers,a.push(this.getValueInRange(new tc(s,r,o.startLineNumber,o.startColumn))),n.text.length>0&&a.push(n.text),s=o.endLineNumber,r=o.endColumn}const l=a.join(""),[h,d,c]=au(l);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:l,eolCount:h,firstLineLength:d,lastLineLength:c,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(sC._sortOpsDescending);const t=[];for(let i=0;i<e.length;i++){const n=e[i],o=n.range.startLineNumber,s=n.range.startColumn,r=n.range.endLineNumber,a=n.range.endColumn;if(o===r&&s===a&&0===n.text.length)continue;n.text?(this._pieceTree.delete(n.rangeOffset,n.rangeLength),this._pieceTree.insert(n.rangeOffset,n.text,!0)):this._pieceTree.delete(n.rangeOffset,n.rangeLength);const l=new tc(o,s,r,a);t.push({range:l,rangeLength:n.rangeLength,text:n.text,rangeOffset:n.rangeOffset,forceMoveMarkers:n.forceMoveMarkers})}return t}findMatchesLineByLine(e,t,i,n){return this._pieceTree.findMatchesLineByLine(e,t,i,n)}static _getInverseEditRanges(e){const t=[];let i=0,n=0,o=null;for(let s=0,r=e.length;s<r;s++){const r=e[s];let a,l,h;if(o?o.range.endLineNumber===r.range.startLineNumber?(a=i,l=n+(r.range.startColumn-o.range.endColumn)):(a=i+(r.range.startLineNumber-o.range.endLineNumber),l=r.range.startColumn):(a=r.range.startLineNumber,l=r.range.startColumn),r.text.length>0){const e=r.eolCount+1;h=1===e?new tc(a,l,a,l+r.firstLineLength):new tc(a,l,a+e-1,r.lastLineLength+1)}else h=new tc(a,l,a,l);i=h.endLineNumber,n=h.endColumn,t.push(h),o=r}return t}static _sortOpsAscending(e,t){const i=tc.compareRangesUsingEnds(e.range,t.range);return 0===i?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=tc.compareRangesUsingEnds(e.range,t.range);return 0===i?t.sortIndex-e.sortIndex:-i}}class rC{constructor(e,t,i,n,o,s,r,a,l){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=o,this._containsRTL=s,this._containsUnusualLineTerminators=r,this._isBasicASCII=a,this._normalizeEOL=l}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return 0===t?1===e?"\n":"\r\n":i>t/2?"\r\n":"\n"}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&("\r\n"===t&&(this._cr>0||this._lf>0)||"\n"===t&&(this._cr>0||this._crlf>0)))for(let e=0,n=i.length;e<n;e++){const n=i[e].buffer.replace(/\r\n|\r|\n/g,t),o=Jw(n);i[e]=new tC(n,o)}const n=new sC(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:n,disposable:n}}}class aC{constructor(){this.chunks=[],this.BOM="",this._hasPreviousChar=!1,this._previousChar=0,this._tmpLineStarts=[],this.cr=0,this.lf=0,this.crlf=0,this.containsRTL=!1,this.containsUnusualLineTerminators=!1,this.isBasicASCII=!0}acceptChunk(e){if(0===e.length)return;0===this.chunks.length&&$n(e)&&(this.BOM=qn,e=e.substr(1));const t=e.charCodeAt(e.length-1);13===t||t>=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){(t||0!==e.length)&&(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=function(e,t){e.length=0,e[0]=0;let i=1,n=0,o=0,s=0,r=!0;for(let a=0,l=t.length;a<l;a++){const h=t.charCodeAt(a);13===h?a+1<l&&10===t.charCodeAt(a+1)?(s++,e[i++]=a+2,a++):(n++,e[i++]=a+1):10===h?(o++,e[i++]=a+1):r&&9!==h&&(h<32||h>126)&&(r=!1)}const a=new Xw(Qw(e),n,o,s,r);return e.length=0,a}(this._tmpLineStarts,e);this.chunks.push(new tC(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=Wn(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=Un(e)))}finish(e=!0){return this._finish(),new rC(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(0===this.chunks.length&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=Jw(e.buffer);e.lineStarts=t,13===this._previousChar&&this.cr++}}}class lC extends T{get isResolved(){return this._isResolved}constructor(e,t,i){super(),this._registry=e,this._languageId=t,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){const e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}}class hC{constructor(e,t,i){this.offset=e,this.type=t,this.language=i,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}}class dC{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class cC{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var uC,gC,pC,mC;!function(e){const t=new Map;t.set(0,Sl.symbolMethod),t.set(1,Sl.symbolFunction),t.set(2,Sl.symbolConstructor),t.set(3,Sl.symbolField),t.set(4,Sl.symbolVariable),t.set(5,Sl.symbolClass),t.set(6,Sl.symbolStruct),t.set(7,Sl.symbolInterface),t.set(8,Sl.symbolModule),t.set(9,Sl.symbolProperty),t.set(10,Sl.symbolEvent),t.set(11,Sl.symbolOperator),t.set(12,Sl.symbolUnit),t.set(13,Sl.symbolValue),t.set(15,Sl.symbolEnum),t.set(14,Sl.symbolConstant),t.set(15,Sl.symbolEnum),t.set(16,Sl.symbolEnumMember),t.set(17,Sl.symbolKeyword),t.set(27,Sl.symbolSnippet),t.set(18,Sl.symbolText),t.set(19,Sl.symbolColor),t.set(20,Sl.symbolFile),t.set(21,Sl.symbolReference),t.set(22,Sl.symbolCustomColor),t.set(23,Sl.symbolFolder),t.set(24,Sl.symbolTypeParameter),t.set(25,Sl.account),t.set(26,Sl.issues),e.toIcon=function(e){let i=t.get(e);return i||(console.info("No codicon found for CompletionItemKind "+e),i=Sl.symbolProperty),i};const i=new Map;i.set("method",0),i.set("function",1),i.set("constructor",2),i.set("field",3),i.set("variable",4),i.set("class",5),i.set("struct",6),i.set("interface",7),i.set("module",8),i.set("property",9),i.set("event",10),i.set("operator",11),i.set("unit",12),i.set("value",13),i.set("constant",14),i.set("enum",15),i.set("enum-member",16),i.set("enumMember",16),i.set("keyword",17),i.set("snippet",27),i.set("text",18),i.set("color",19),i.set("file",20),i.set("reference",21),i.set("customcolor",22),i.set("folder",23),i.set("type-parameter",24),i.set("typeParameter",24),i.set("account",25),i.set("issue",26),e.fromString=function(e,t){let n=i.get(e);return void 0!==n||t||(n=9),n}}(uC||(uC={})),function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"}(gC||(gC={}));class fC{constructor(e,t,i,n){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=n}equals(e){return tc.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}!function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(pC||(pC={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(mC||(mC={}));const _C={17:me(0,"array"),16:me(0,"boolean"),4:me(0,"class"),13:me(0,"constant"),8:me(0,"constructor"),9:me(0,"enumeration"),21:me(0,"enumeration member"),23:me(0,"event"),7:me(0,"field"),0:me(0,"file"),11:me(0,"function"),10:me(0,"interface"),19:me(0,"key"),5:me(0,"method"),1:me(0,"module"),2:me(0,"namespace"),20:me(0,"null"),15:me(0,"number"),18:me(0,"object"),24:me(0,"operator"),3:me(0,"package"),6:me(0,"property"),14:me(0,"string"),22:me(0,"struct"),25:me(0,"type parameter"),12:me(0,"variable")};var vC,bC,wC;!function(e){const t=new Map;t.set(0,Sl.symbolFile),t.set(1,Sl.symbolModule),t.set(2,Sl.symbolNamespace),t.set(3,Sl.symbolPackage),t.set(4,Sl.symbolClass),t.set(5,Sl.symbolMethod),t.set(6,Sl.symbolProperty),t.set(7,Sl.symbolField),t.set(8,Sl.symbolConstructor),t.set(9,Sl.symbolEnum),t.set(10,Sl.symbolInterface),t.set(11,Sl.symbolFunction),t.set(12,Sl.symbolVariable),t.set(13,Sl.symbolConstant),t.set(14,Sl.symbolString),t.set(15,Sl.symbolNumber),t.set(16,Sl.symbolBoolean),t.set(17,Sl.symbolArray),t.set(18,Sl.symbolObject),t.set(19,Sl.symbolKey),t.set(20,Sl.symbolNull),t.set(21,Sl.symbolEnumMember),t.set(22,Sl.symbolStruct),t.set(23,Sl.symbolEvent),t.set(24,Sl.symbolOperator),t.set(25,Sl.symbolTypeParameter),e.toIcon=function(e){let i=t.get(e);return i||(console.info("No codicon found for SymbolKind "+e),i=Sl.symbolProperty),i}}(vC||(vC={}));class CC{static fromValue(e){switch(e){case"comment":return CC.Comment;case"imports":return CC.Imports;case"region":return CC.Region}return new CC(e)}constructor(e){this.value=e}}CC.Comment=new CC("comment"),CC.Imports=new CC("imports"),CC.Region=new CC("region"),function(e){e.is=function(e){return!(!e||"object"!=typeof e)&&"string"==typeof e.id&&"string"==typeof e.title}}(bC||(bC={})),function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"}(wC||(wC={}));class yC{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then((e=>{e&&e.dispose()}))}get tokenizationSupport(){return this._tokenizationSupport||(this._tokenizationSupport=this.createSupport()),this._tokenizationSupport}}const SC=new class{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new q,this.onDidChange=this._onDidChange.event,this._colorMap=null}handleChange(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._tokenizationSupports.set(e,t),this.handleChange([e]),I((()=>{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))}))}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var i;null===(i=this._factories.get(e))||void 0===i||i.dispose();const n=new lC(this,e,t);return this._factories.set(e,n),I((()=>{const t=this._factories.get(e);t&&t===n&&(this._factories.delete(e),t.dispose())}))}async getOrCreate(e){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(await i.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;const t=this._factories.get(e);return!(t&&!t.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}},kC=new class{clone(){return this}equals(e){return this===e}};function LC(e,t){return new dC([new hC(0,"",e)],t)}function xC(e,t){const i=new Uint32Array(2);return i[0]=0,i[1]=(32768|e<<0|2<<24)>>>0,new cC(i,null===t?kC:t)}class DC{constructor(e){this._default=e,this._store=[]}get(e){return e<this._store.length?this._store[e]:this._default}set(e,t){for(;e>=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,i){if(e>=this._store.length)return;if(0===t)return void this.insert(e,i);if(0===i)return void this.delete(e,t);const n=this._store.slice(0,e),o=this._store.slice(e+t),s=function(e,t){const i=[];for(let n=0;n<e;n++)i[n]=t;return i}(i,this._default);this._store=n.concat(s,o)}delete(e,t){0===t||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(0===t||e>=this._store.length)return;const i=[];for(let e=0;e<t;e++)i[e]=this._default;this._store=Uc(this._store,e,i)}}class EC{get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}constructor(e,t){this._startLineNumber=e,this._tokens=t}getLineTokens(e){return this._tokens[e-this._startLineNumber]}appendLineTokens(e){this._tokens.push(e)}}class NC{constructor(){this._tokens=[]}add(e,t){if(this._tokens.length>0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e)return void i.appendLineTokens(t)}this._tokens.push(new EC(e,[t]))}finalize(){return this._tokens}}class IC{static createEmpty(e,t){const i=IC.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new IC(n,e,t)}constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=i}equals(e){return e instanceof IC&&this.slicedEquals(e,0,this._tokensCount)}slicedEquals(e,t,i){if(this._text!==e._text)return!1;if(this._tokensCount!==e._tokensCount)return!1;const n=t<<1,o=n+(i<<1);for(let t=n;t<o;t++)if(this._tokens[t]!==e._tokens[t])return!1;return!0}getLineContent(){return this._text}getCount(){return this._tokensCount}getStartOffset(e){return e>0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[1+(e<<1)]}getLanguageId(e){const t=this._tokens[1+(e<<1)],i=jp.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[1+(e<<1)];return jp.getTokenType(t)}getForeground(e){const t=this._tokens[1+(e<<1)];return jp.getForeground(t)}getClassName(e){const t=this._tokens[1+(e<<1)];return jp.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[1+(e<<1)];return jp.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[1+(e<<1)];return jp.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return IC.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new MC(this,e,t,i)}static convertToEndOffset(e,t){const i=(e.length>>>1)-1;for(let t=0;t<i;t++)e[t<<1]=e[t+1<<1];e[i<<1]=t}static findIndexInTokensArray(e,t){if(e.length<=2)return 0;let i=0,n=(e.length>>>1)-1;for(;i<n;){const o=i+Math.floor((n-i)/2),s=e[o<<1];if(s===t)return o+1;s<t?i=o+1:s>t&&(n=o)}return i}withInserted(e){if(0===e.length)return this;let t=0,i=0,n="";const o=new Array;let s=0;for(;;){const r=t<this._tokensCount?this._tokens[t<<1]:-1,a=i<e.length?e[i]:null;if(-1!==r&&(null===a||r<=a.offset)){n+=this._text.substring(s,r);const e=this._tokens[1+(t<<1)];o.push(n.length,e),t++,s=r}else{if(!a)break;if(a.offset>s){n+=this._text.substring(s,a.offset);const e=this._tokens[1+(t<<1)];o.push(n.length,e),s=a.offset}n+=a.text,o.push(n.length,a.tokenMetadata),i++}}return new IC(new Uint32Array(o),n,this._languageIdCodec)}}IC.defaultTokenMetadata=33587200;class MC{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let t=this._firstTokenIndex,n=e.getCount();t<n&&!(e.getStartOffset(t)>=i);t++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof MC&&this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount)}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}class TC{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new RC(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class AC extends TC{constructor(e,t,i,n){super(e,t),this._textModel=i,this._languageIdCodec=n}updateTokensUntilLine(e,t){const i=this._textModel.getLanguageId();for(;;){const n=this.getFirstInvalidLine();if(!n||n.lineNumber>t)break;const o=this._textModel.getLineContent(n.lineNumber),s=FC(this._languageIdCodec,i,this.tokenizationSupport,o,!0,n.startState);e.add(n.lineNumber,s.tokens),this.store.setEndState(n.lineNumber,s.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return 0;const n=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),s=o.substring(0,e.column-1)+t+o.substring(e.column-1),r=FC(this._languageIdCodec,n,this.tokenizationSupport,s,!0,i),a=new IC(r.tokens,s,this._languageIdCodec);if(0===a.getCount())return 0;const l=a.findTokenIndexAtOffset(e.column-1);return a.getStandardTokenType(l)}tokenizeLineWithEdit(e,t,i){const n=e.lineNumber,o=e.column,s=this.getStartState(n);if(!s)return null;const r=this._textModel.getLineContent(n),a=r.substring(0,o-1)+i+r.substring(o-1+t),l=this._textModel.getLanguageIdAtPosition(n,0),h=FC(this._languageIdCodec,l,this.tokenizationSupport,a,!0,s);return new IC(h.tokens,a,this._languageIdCodec)}isCheapToTokenize(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e<t||e===t&&this._textModel.getLineLength(e)<2048}tokenizeHeuristically(e,t,i){if(i<=this.store.getFirstInvalidEndStateLineNumberOrMax())return{heuristicTokens:!1};if(t<=this.store.getFirstInvalidEndStateLineNumberOrMax())return this.updateTokensUntilLine(e,i),{heuristicTokens:!1};let n=this.guessStartState(t);const o=this._textModel.getLanguageId();for(let s=t;s<=i;s++){const t=this._textModel.getLineContent(s),i=FC(this._languageIdCodec,o,this.tokenizationSupport,t,!0,n);e.add(s,i.tokens),n=i.endState}return{heuristicTokens:!0}}guessStartState(e){let t=this._textModel.getLineFirstNonWhitespaceColumn(e);const i=[];let n=null;for(let o=e-1;t>1&&o>=1;o--){const e=this._textModel.getLineFirstNonWhitespaceColumn(o);if(0!==e&&e<t&&(i.push(this._textModel.getLineContent(o)),t=e,n=this.getStartState(o),n))break}n||(n=this.tokenizationSupport.getInitialState()),i.reverse();const o=this._textModel.getLanguageId();let s=n;for(const e of i)s=FC(this._languageIdCodec,o,this.tokenizationSupport,e,!1,s).endState;return s}}class RC{constructor(e){this.lineCount=e,this._tokenizationStateStore=new OC,this._invalidEndStatesLineNumbers=new PC,this._invalidEndStatesLineNumbers.addRange(new du(1,e+1))}getEndState(e){return this._tokenizationStateStore.getEndState(e)}setEndState(e,t){if(!t)throw new b("Cannot set null/undefined state");this._invalidEndStatesLineNumbers.delete(e);const i=this._tokenizationStateStore.setEndState(e,t);return i&&e<this.lineCount&&this._invalidEndStatesLineNumbers.addRange(new du(e+1,e+2)),i}acceptChange(e,t){this.lineCount+=t-e.length,this._tokenizationStateStore.acceptChange(e,t),this._invalidEndStatesLineNumbers.addRangeAndResize(new du(e.startLineNumber,e.endLineNumberExclusive),t)}acceptChanges(e){for(const t of e){const[e]=au(t.text);this.acceptChange(new bu(t.range.startLineNumber,t.range.endLineNumber+1),e+1)}}invalidateEndStateRange(e){this._invalidEndStatesLineNumbers.addRange(new du(e.startLineNumber,e.endLineNumberExclusive))}getFirstInvalidEndStateLineNumber(){return this._invalidEndStatesLineNumbers.min}getFirstInvalidEndStateLineNumberOrMax(){return this.getFirstInvalidEndStateLineNumber()||Number.MAX_SAFE_INTEGER}allStatesValid(){return null===this._invalidEndStatesLineNumbers.min}getStartState(e,t){return 1===e?t:this.getEndState(e-1)}getFirstInvalidLine(e){const t=this.getFirstInvalidEndStateLineNumber();if(null===t)return null;const i=this.getStartState(t,e);if(!i)throw new b("Start state must be defined");return{lineNumber:t,startState:i}}}class OC{constructor(){this._lineEndStates=new DC(null)}getEndState(e){return this._lineEndStates.get(e)}setEndState(e,t){const i=this._lineEndStates.get(e);return!(i&&i.equals(t)||(this._lineEndStates.set(e,t),0))}acceptChange(e,t){let i=e.length;t>0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}}class PC{constructor(){this._ranges=[]}get min(){return 0===this._ranges.length?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex((t=>t.contains(e)));if(-1!==t){const i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new du(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new du(i.start,e):this._ranges.splice(t,1,new du(i.start,e),new du(e+1,i.endExclusive))}}addRange(e){du.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let n=i;for(;!(n>=this._ranges.length||e.endExclusive<this._ranges[n].start);)n++;const o=t-e.length;for(let e=n;e<this._ranges.length;e++)this._ranges[e]=this._ranges[e].delta(o);if(i===n){const n=new du(e.start,e.start+t);n.isEmpty||this._ranges.splice(i,0,n)}else{const t=Math.min(e.start,this._ranges[i].start),s=Math.max(e.endExclusive,this._ranges[n-1].endExclusive),r=new du(t,s+o);r.isEmpty?this._ranges.splice(i,n-i):this._ranges.splice(i,n-i,r)}}toString(){return this._ranges.map((e=>e.toString())).join(" + ")}}function FC(e,t,i,n,o,s){let r=null;if(i)try{r=i.tokenizeEncoded(n,o,s.clone())}catch(e){h(e)}return r||(r=xC(e.encodeLanguageId(t),s)),IC.convertToEndOffset(r.tokens,n.length),r}class BC{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){!this._isScheduled&&this._tokenizerWithStateStore._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&(this._isScheduled=!0,Yt((e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)})))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),i=()=>{!this._isDisposed&&this._tokenizerWithStateStore._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&(this._backgroundTokenizeForAtLeast1ms(),Date.now()<t?Ye(i):this._beginBackgroundTokenization())};i()}_backgroundTokenizeForAtLeast1ms(){const e=this._tokenizerWithStateStore._textModel.getLineCount(),t=new NC,i=V.create(!1);do{if(i.elapsed()>1)break;if(this._tokenizeOneInvalidLine(t)>=e)break}while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return!!this._tokenizerWithStateStore&&!this._tokenizerWithStateStore.store.allStatesValid()}_tokenizeOneInvalidLine(e){var t;const i=null===(t=this._tokenizerWithStateStore)||void 0===t?void 0:t.getFirstInvalidLine();return i?(this._tokenizerWithStateStore.updateTokensUntilLine(e,i.lineNumber),i.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new bu(e,t))}}const WC=new Uint32Array(0).buffer;class VC{static deleteBeginning(e,t){return null===e||e===WC?e:VC.delete(e,0,t)}static deleteEnding(e,t){if(null===e||e===WC)return e;const i=zC(e),n=i[i.length-2];return VC.delete(e,t,n)}static delete(e,t,i){if(null===e||e===WC||t===i)return e;const n=zC(e),o=n.length>>>1;if(0===t&&n[n.length-2]===i)return WC;const s=IC.findIndexInTokensArray(n,t),r=s>0?n[s-1<<1]:0;if(i<n[s<<1]){const r=i-t;for(let e=s;e<o;e++)n[e<<1]-=r;return e}let a,l;r!==t?(n[s<<1]=t,a=s+1<<1,l=t):(a=s<<1,l=r);const h=i-t;for(let e=s+1;e<o;e++){const t=n[e<<1]-h;t>l&&(n[a++]=t,n[a++]=n[1+(e<<1)],l=t)}if(a===n.length)return e;const d=new Uint32Array(a);return d.set(n.subarray(0,a),0),d.buffer}static append(e,t){if(t===WC)return e;if(e===WC)return t;if(null===e)return e;if(null===t)return null;const i=zC(e),n=zC(t),o=n.length>>>1,s=new Uint32Array(i.length+n.length);s.set(i,0);let r=i.length;const a=i[i.length-2];for(let e=0;e<o;e++)s[r++]=n[e<<1]+a,s[r++]=n[1+(e<<1)];return s.buffer}static insert(e,t,i){if(null===e||e===WC)return e;const n=zC(e),o=n.length>>>1;let s=IC.findIndexInTokensArray(n,t);s>0&&n[s-1<<1]===t&&s--;for(let e=s;e<o;e++)n[e<<1]+=i;return e}}function zC(e){return e instanceof Uint32Array?e:new Uint32Array(e)}class HC{constructor(e){this._lineTokens=[],this._len=0,this._languageIdCodec=e}flush(){this._lineTokens=[],this._len=0}get hasTokens(){return this._lineTokens.length>0}getTokens(e,t,i){let n=null;if(t<this._len&&(n=this._lineTokens[t]),null!==n&&n!==WC)return new IC(zC(n),i,this._languageIdCodec);const o=new Uint32Array(2);return o[0]=i.length,o[1]=UC(this._languageIdCodec.encodeLanguageId(e)),new IC(o,i,this._languageIdCodec)}static _massageTokens(e,t,i){const n=i?zC(i):null;if(0===t){let t=!1;if(n&&n.length>1&&(t=jp.getLanguageId(n[1])!==e),!t)return WC}if(!n||0===n.length){const i=new Uint32Array(2);return i[0]=t,i[1]=UC(e),i.buffer}return n[n.length-2]=t,0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(0===t)return;const i=[];for(let e=0;e<t;e++)i[e]=null;this._lineTokens=Uc(this._lineTokens,e,i),this._len+=t}setTokens(e,t,i,n,o){const s=HC._massageTokens(this._languageIdCodec.encodeLanguageId(e),i,n);this._ensureLine(t);const r=this._lineTokens[t];return this._lineTokens[t]=s,!!o&&!HC._equals(r,s)}static _equals(e,t){if(!e||!t)return!e&&!t;const i=zC(e),n=zC(t);if(i.length!==n.length)return!1;for(let e=0,t=i.length;e<t;e++)if(i[e]!==n[e])return!1;return!0}acceptEdit(e,t,i){this._acceptDeleteRange(e),this._acceptInsertText(new ch(e.startLineNumber,e.startColumn),t,i)}_acceptDeleteRange(e){const t=e.startLineNumber-1;if(t>=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;return void(this._lineTokens[t]=VC.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1))}this._lineTokens[t]=VC.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i<this._len&&(n=VC.deleteBeginning(this._lineTokens[i],e.endColumn-1)),this._lineTokens[t]=VC.append(this._lineTokens[t],n),this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t,i){if(0===t&&0===i)return;const n=e.lineNumber-1;n>=this._len||(0!==t?(this._lineTokens[n]=VC.deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=VC.insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)):this._lineTokens[n]=VC.insert(this._lineTokens[n],e.column-1,i))}setMultilineTokens(e,t){if(0===e.length)return{changes:[]};const i=[];for(let n=0,o=e.length;n<o;n++){const o=e[n];let s=0,r=0,a=!1;for(let e=o.startLineNumber;e<=o.endLineNumber;e++)a?(this.setTokens(t.getLanguageId(),e-1,t.getLineLength(e),o.getLineTokens(e),!1),r=e):this.setTokens(t.getLanguageId(),e-1,t.getLineLength(e),o.getLineTokens(e),!0)&&(a=!0,s=e,r=e);a&&i.push({fromLineNumber:s,toLineNumber:r})}return{changes:i}}}function UC(e){return(32768|e<<0|2<<24|1024)>>>0}class KC{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return 0===this._pieces.length}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const n=t[0].getRange(),o=t[t.length-1].getRange();if(!n||!o)return e;i=e.plusRange(n).plusRange(o)}let n=null;for(let e=0,t=this._pieces.length;e<t;e++){const o=this._pieces[e];if(o.endLineNumber<i.startLineNumber)continue;if(o.startLineNumber>i.endLineNumber){n=n||{index:e};break}if(o.removeTokens(i),o.isEmpty()){this._pieces.splice(e,1),e--,t--;continue}if(o.endLineNumber<i.startLineNumber)continue;if(o.startLineNumber>i.endLineNumber){n=n||{index:e};continue}const[s,r]=o.split(i);s.isEmpty()?n=n||{index:e}:r.isEmpty()||(this._pieces.splice(e,1,s,r),e++,t++,n=n||{index:e})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=Uc(this._pieces,n.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(0===t.getLineContent().length)return t;const i=this._pieces;if(0===i.length)return t;const n=i[KC._findFirstPieceWithLine(i,e)].getLineTokens(e);if(!n)return t;const o=t.getCount(),s=n.getCount();let r=0;const a=[];let l=0,h=0;const d=(e,t)=>{e!==h&&(h=e,a[l++]=e,a[l++]=t)};for(let e=0;e<s;e++){const i=n.getStartCharacter(e),s=n.getEndCharacter(e),a=n.getMetadata(e),l=((1&a?2048:0)|(2&a?4096:0)|(4&a?8192:0)|(8&a?16384:0)|(16&a?16744448:0)|(32&a?4278190080:0))>>>0,h=~l>>>0;for(;r<o&&t.getEndOffset(r)<=i;)d(t.getEndOffset(r),t.getMetadata(r)),r++;for(r<o&&t.getStartOffset(r)<i&&d(i,t.getMetadata(r));r<o&&t.getEndOffset(r)<s;)d(t.getEndOffset(r),t.getMetadata(r)&h|a&l),r++;if(r<o)d(s,t.getMetadata(r)&h|a&l),t.getEndOffset(r)===s&&r++;else{const e=Math.min(Math.max(0,r-1),o-1);d(s,t.getMetadata(e)&h|a&l)}}for(;r<o;)d(t.getEndOffset(r),t.getMetadata(r)),r++;return new IC(new Uint32Array(a),t.getLineContent(),this._languageIdCodec)}static _findFirstPieceWithLine(e,t){let i=0,n=e.length-1;for(;i<n;){let o=i+Math.floor((n-i)/2);if(e[o].endLineNumber<t)i=o+1;else{if(!(e[o].startLineNumber>t)){for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}n=o-1}}return i}acceptEdit(e,t,i,n,o){for(const s of this._pieces)s.acceptEdit(e,t,i,n,o)}}class jC extends qb{constructor(e,t,i,n,o,s){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=n,this._languageId=o,this._attachedViews=s,this._semanticTokens=new KC(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new q),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new q),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new q),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new qC(this._languageService.languageIdCodec,this._textModel,(()=>this._languageId),this._attachedViews)),this._register(this._languageConfigurationService.onDidChange((e=>{e.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})}))),this._register(this.grammarTokens.onDidChangeTokens((e=>{this._emitModelTokensChangedEvent(e)}))),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState((e=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()})))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[e,i,n]=au(t.text);this._semanticTokens.acceptEdit(t.range,e,i,n,t.text.length>0?t.text.charCodeAt(0):0)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.grammarTokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new b("Illegal value for lineNumber")}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLineWithEdit(e,t,i){return this.grammarTokens.tokenizeLineWithEdit(e,t,i)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({semanticTokensApplied:null!==e,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),n=this.getLineTokens(t.lineNumber),o=n.findTokenIndexAtOffset(t.column-1),[s,r]=jC._findLanguageBoundaries(n,o),a=Du(t.column,this.getLanguageConfiguration(n.getLanguageId(o)).getWordDefinition(),i.substring(s,r),s);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a;if(o>0&&s===t.column-1){const[s,r]=jC._findLanguageBoundaries(n,o-1),a=Du(t.column,this.getLanguageConfiguration(n.getLanguageId(o-1)).getWordDefinition(),i.substring(s,r),s);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let n=0;for(let o=t;o>=0&&e.getLanguageId(o)===i;o--)n=e.getStartOffset(o);let o=e.getLineContent().length;for(let n=t,s=e.getCount();n<s&&e.getLanguageId(n)===i;n++)o=e.getEndOffset(n);return[n,o]}getWordUntilPosition(e){const t=this.getWordAtPosition(e);return t?{word:t.word.substr(0,e.column-t.startColumn),startColumn:t.startColumn,endColumn:e.column}:{word:"",startColumn:e.column,endColumn:e.column}}getLanguageId(){return this._languageId}getLanguageIdAtPosition(e,t){const i=this._textModel.validatePosition(new ch(e,t)),n=this.getLineTokens(i.lineNumber);return n.getLanguageId(n.findTokenIndexAtOffset(i.column-1))}setLanguageId(e,t="api"){if(this._languageId===e)return;const i={oldLanguage:this._languageId,newLanguage:e,source:t};this._languageId=e,this._bracketPairsTextModelPart.handleDidChangeLanguage(i),this.grammarTokens.resetTokenization(),this._onDidChangeLanguage.fire(i),this._onDidChangeLanguageConfiguration.fire({})}}class qC extends T{get backgroundTokenizationState(){return this._backgroundTokenizationState}constructor(e,t,i,n){super(),this._languageIdCodec=e,this._textModel=t,this.getLanguageId=i,this._tokenizer=null,this._defaultBackgroundTokenizer=null,this._backgroundTokenizer=this._register(new A),this._tokens=new HC(this._languageIdCodec),this._debugBackgroundTokenizer=this._register(new A),this._backgroundTokenizationState=1,this._onDidChangeBackgroundTokenizationState=this._register(new q),this.onDidChangeBackgroundTokenizationState=this._onDidChangeBackgroundTokenizationState.event,this._onDidChangeTokens=this._register(new q),this.onDidChangeTokens=this._onDidChangeTokens.event,this._attachedViewStates=this._register(new P),this._register(SC.onDidChange((e=>{const t=this.getLanguageId();-1!==e.changedLanguages.indexOf(t)&&this.resetTokenization()}))),this.resetTokenization(),this._register(n.onDidChangeVisibleRanges((({view:e,state:t})=>{if(t){let i=this._attachedViewStates.get(e);i||(i=new $C((()=>this.refreshRanges(i.lineRanges))),this._attachedViewStates.set(e,i)),i.handleStateChange(t)}else this._attachedViewStates.deleteAndDispose(e)})))}resetTokenization(e=!0){var t;this._tokens.flush(),null===(t=this._debugBackgroundTokens)||void 0===t||t.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new RC(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const[i,n]=(()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const e=SC.get(this.getLanguageId());if(!e)return[null,null];let t;try{t=e.getInitialState()}catch(e){return h(e),[null,null]}return[e,t]})();if(this._tokenizer=i&&n?new AC(this._textModel.getLineCount(),i,this._textModel,this._languageIdCodec):null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const e={setTokens:e=>{this.setTokens(e)},backgroundTokenizationFinished:()=>{2!==this._backgroundTokenizationState&&(this._backgroundTokenizationState=2,this._onDidChangeBackgroundTokenizationState.fire())},setEndState:(e,t)=>{var i;if(!this._tokenizer)return;const n=this._tokenizer.store.getFirstInvalidEndStateLineNumber();null!==n&&e>=n&&(null===(i=this._tokenizer)||void 0===i||i.store.setEndState(e,t))}};i&&i.createBackgroundTokenizer&&!i.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,e)),this._backgroundTokenizer.value||(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new BC(this._tokenizer,e),this._defaultBackgroundTokenizer.handleChanges()),(null==i?void 0:i.backgroundTokenizerShouldOnlyVerifyTokens)&&i.createBackgroundTokenizer?(this._debugBackgroundTokens=new HC(this._languageIdCodec),this._debugBackgroundStates=new RC(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,{setTokens:e=>{var t;null===(t=this._debugBackgroundTokens)||void 0===t||t.setMultilineTokens(e,this._textModel)},backgroundTokenizationFinished(){},setEndState:(e,t)=>{var i;null===(i=this._debugBackgroundStates)||void 0===i||i.setEndState(e,t)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;null===(e=this._defaultBackgroundTokenizer)||void 0===e||e.handleChanges()}handleDidChangeContent(e){var t,i,n;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const i of e.changes){const[e,n]=au(i.text);this._tokens.acceptEdit(i.range,e,n),null===(t=this._debugBackgroundTokens)||void 0===t||t.acceptEdit(i.range,e,n)}null===(i=this._debugBackgroundStates)||void 0===i||i.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),null===(n=this._defaultBackgroundTokenizer)||void 0===n||n.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=bu.joinMany([...this._attachedViewStates].map((([e,t])=>t.lineRanges)));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var i,n;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const o=new NC,{heuristicTokens:s}=this._tokenizer.tokenizeHeuristically(o,e,t),r=this.setTokens(o.finalize());if(s)for(const e of r.changes)null===(i=this._backgroundTokenizer.value)||void 0===i||i.requestTokens(e.fromLineNumber,e.toLineNumber+1);null===(n=this._defaultBackgroundTokenizer)||void 0===n||n.checkFinished()}forceTokenization(e){var t,i;const n=new NC;null===(t=this._tokenizer)||void 0===t||t.updateTokensUntilLine(n,e),this.setTokens(n.finalize()),null===(i=this._defaultBackgroundTokenizer)||void 0===i||i.checkFinished()}isCheapToTokenize(e){return!this._tokenizer||this._tokenizer.isCheapToTokenize(e)}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var t;const i=this._textModel.getLineContent(e),n=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,i);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const o=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,i);!n.equals(o)&&(null===(t=this._debugBackgroundTokenizer.value)||void 0===t?void 0:t.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return n}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return 0;const n=this._textModel.validatePosition(new ch(e,t));return this.forceTokenization(n.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(n,i)}tokenizeLineWithEdit(e,t,i){if(!this._tokenizer)return null;const n=this._textModel.validatePosition(e);return this.forceTokenization(n.lineNumber),this._tokenizer.tokenizeLineWithEdit(n,t,i)}get hasTokens(){return this._tokens.hasTokens}}class $C extends T{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new Zt((()=>this.update()),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Ic(this._computedLineRanges,this._lineRanges,((e,t)=>e.equals(t)))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}class GC{constructor(){this.changeType=1}}class ZC{static applyInjectedText(e,t){if(!t||0===t.length)return e;let i="",n=0;for(const o of t)i+=e.substring(n,o.column-1),n=o.column-1,i+=o.options.content;return i+=e.substring(n),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new ZC(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new ZC(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort(((e,t)=>e.lineNumber===t.lineNumber?e.column===t.column?e.order-t.order:e.column-t.column:e.lineNumber-t.lineNumber)),t}constructor(e,t,i,n,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=n,this.order=o}}class YC{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class QC{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class XC{constructor(e,t,i,n){this.changeType=4,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class JC{constructor(){this.changeType=5}}class ey{constructor(e,t,i,n){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=n,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;t<i;t++)if(this.changes[t].changeType===e)return!0;return!1}static merge(e,t){const i=[].concat(e.changes).concat(t.changes),n=t.versionId,o=e.isUndoing||t.isUndoing,s=e.isRedoing||t.isRedoing;return new ey(i,n,o,s)}}class ty{constructor(e){this.changes=e}}class iy{constructor(e,t){this.rawContentChangedEvent=e,this.contentChangedEvent=t}merge(e){const t=ey.merge(this.rawContentChangedEvent,e.rawContentChangedEvent),i=iy._mergeChangeEvents(this.contentChangedEvent,e.contentChangedEvent);return new iy(t,i)}static _mergeChangeEvents(e,t){const i=[].concat(e.changes).concat(t.changes),n=t.eol,o=t.versionId,s=e.isUndoing||t.isUndoing,r=e.isRedoing||t.isRedoing,a=e.isFlush||t.isFlush;return{changes:i,eol:n,isEolChange:e.isEolChange&&t.isEolChange,versionId:o,isUndoing:s,isRedoing:r,isFlush:a}}}const ny=hh("undoRedoService");class oy{constructor(e,t){this.resource=e,this.elements=t}}class sy{constructor(){this.id=sy._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}}sy._ID=0,sy.None=new sy;class ry{constructor(){this.id=ry._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}}ry._ID=0,ry.None=new ry;var ay,ly=function(e,t){return function(i,n){t(i,n,e)}};function hy(e,t){let i;var n;return i="string"==typeof e?function(e){const t=new aC;return t.acceptChunk(e),t.finish()}(e):(n=e)&&"function"==typeof n.read?function(e){const t=new aC;let i;for(;"string"==typeof(i=e.read());)t.acceptChunk(i);return t.finish()}(e):e,i.create(t)}let dy=0;class cy{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;for(;;){const n=this._source.read();if(null===n)return this._eos=!0,0===t?null:e.join("");if(n.length>0&&(e[t++]=n,i+=n.length),i>=65536)return e.join("")}}}const uy=()=>{throw new Error("Invalid change accessor")};let gy=ay=class extends T{static resolveOptions(e,t){if(t.detectIndentation){const i=tw(e,t.tabSize,t.insertSpaces);return new Sc({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new Sc(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent((t=>e(t.contentChangedEvent)))}onDidChangeContentOrInjectedText(e){return N(this._eventEmitter.fastEvent((t=>e(t))),this._onDidChangeInjectedText.event((t=>e(t))))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,i,n=null,o,s,r){super(),this._undoRedoService=o,this._languageService=s,this._languageConfigurationService=r,this._onWillDispose=this._register(new q),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new xy((e=>this.handleBeforeFireDecorationsChangedEvent(e)))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new q),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new q),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new q),this._eventEmitter=this._register(new Dy),this._languageSelectionListener=this._register(new A),this._deltaDecorationCallCnt=0,this._attachedViews=new Ey,dy++,this.id="$model"+dy,this.isForSimpleWidget=i.isForSimpleWidget,this._associatedResource=null==n?Ro.parse("inmemory://model/"+dy):n,this._attachedEditorCount=0;const{textBuffer:a,disposable:l}=hy(e,i.defaultEOL);this._buffer=a,this._bufferDisposable=l,this._options=ay.resolveOptions(this._buffer,i);const h="string"==typeof t?t:t.languageId;"string"!=typeof t&&(this._languageSelectionListener.value=t.onDidChange((()=>this._setLanguage(t.languageId)))),this._bracketPairs=this._register(new mm(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new Qb(this,this._languageConfigurationService)),this._decorationProvider=this._register(new Rb(this)),this._tokenizationTextModelPart=new jC(this._languageService,this._languageConfigurationService,this,this._bracketPairs,h,this._attachedViews);const d=this._buffer.getLineCount(),c=this._buffer.getValueLengthInRange(new tc(1,1,d,this._buffer.getLineLength(d)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=c>ay.LARGE_FILE_SIZE_THRESHOLD||d>ay.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=c>ay.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=c>ay._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=Gn(dy),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new fy,this._commandManager=new jb(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange((()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()}))),this._languageService.requestRichLanguageFeatures(h)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new sC([],"","\n",!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=T.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new iy(e,t)))}setValue(e){if(this._assertNotDisposed(),null==e)throw m();const{textBuffer:t,disposable:i}=hy(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,o,s,r,a){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),isEolChange:a,versionId:this.getVersionId(),isUndoing:o,isRedoing:s,isFlush:r}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new fy,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new ey([new GC],this._versionId,!1,!1),this._createContentChanged2(new tc(1,1,o,s),0,n,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=1===e?"\r\n":"\n";if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new ey([new JC],this._versionId,!1,!1),this._createContentChanged2(new tc(1,1,o,s),0,n,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i<n;i++){const n=t[i],o=n.range,s=n.cachedAbsoluteStart-n.start,r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);n.cachedAbsoluteStart=r,n.cachedAbsoluteEnd=a,n.cachedVersionId=e,n.start=r-s,n.end=a-s,Sw(n)}}onBeforeAttached(){return this._attachedEditorCount++,1===this._attachedEditorCount&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.attachView()}onBeforeDetached(e){this._attachedEditorCount--,0===this._attachedEditorCount&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.detachView(e)}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let n=1;n<=i;n++){const i=this._buffer.getLineLength(n);i>=1e4?t+=i:e+=i}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=void 0!==e.tabSize?e.tabSize:this._options.tabSize,i=void 0!==e.indentSize?e.indentSize:this._options.originalIndentSize,n=void 0!==e.insertSpaces?e.insertSpaces:this._options.insertSpaces,o=void 0!==e.trimAutoWhitespace?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s=void 0!==e.bracketColorizationOptions?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,r=new Sc({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:s});if(this._options.equals(r))return;const a=this._options.createChangeEvent(r);this._options=r,this._bracketPairs.handleDidChangeOptions(a),this._decorationProvider.handleDidChangeOptions(a),this._onDidChangeOptions.fire(a)}detectIndentation(e,t){this._assertNotDisposed();const i=tw(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),hu(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(Hn.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map((e=>({range:e.range,text:null}))),(()=>null))}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new b("Operation would exceed heap memory limits");const i=this.getFullModelRange(),n=this.getValueInRange(i,e);return t?this._buffer.getBOM()+n:n}createSnapshot(e=!1){return new cy(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+n:n}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new b("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new b("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new b("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),"\n"===this._buffer.getEOL()?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new b("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new b("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new b("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let o=Math.floor("number"!=typeof i||isNaN(i)?1:i),s=Math.floor("number"!=typeof n||isNaN(n)?1:n);if(o<1)o=1,s=1;else if(o>t)o=t,s=this.getLineMaxColumn(o);else if(s<=1)s=1;else{const e=this.getLineMaxColumn(o);s>=e&&(s=e)}const r=e.endLineNumber,a=e.endColumn;let l=Math.floor("number"!=typeof r||isNaN(r)?1:r),h=Math.floor("number"!=typeof a||isNaN(a)?1:a);if(l<1)l=1,h=1;else if(l>t)l=t,h=this.getLineMaxColumn(l);else if(h<=1)h=1;else{const e=this.getLineMaxColumn(l);h>=e&&(h=e)}return i===o&&n===s&&r===l&&a===h&&e instanceof tc&&!(e instanceof ic)?e:new tc(o,s,l,h)}_isValidPosition(e,t,i){return"number"==typeof e&&"number"==typeof t&&(!isNaN(e)&&!isNaN(t)&&(!(e<1||t<1)&&((0|e)===e&&(0|t)===t&&(!(e>this._buffer.getLineCount())&&(1===t||!(t>this.getLineMaxColumn(e))&&(1!==i||!In(this._buffer.getLineCharCode(e,t-2))))))))}_validatePosition(e,t,i){const n=Math.floor("number"!=typeof e||isNaN(e)?1:e),o=Math.floor("number"!=typeof t||isNaN(t)?1:t),s=this._buffer.getLineCount();if(n<1)return new ch(1,1);if(n>s)return new ch(s,this.getLineMaxColumn(s));if(o<=1)return new ch(n,1);const r=this.getLineMaxColumn(n);return o>=r?new ch(n,r):1===i&&In(this._buffer.getLineCharCode(n,o-2))?new ch(n,o-1):new ch(n,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof ch&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn;if(!this._isValidPosition(i,n,0))return!1;if(!this._isValidPosition(o,s,0))return!1;if(1===t){const e=n>1?this._buffer.getLineCharCode(i,n-2):0,t=s>1&&s<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,s-2):0,r=In(e),a=In(t);return!r&&!a}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof tc&&!(e instanceof ic)&&this._isValidRange(e,1))return e;const t=this._validatePosition(e.startLineNumber,e.startColumn,0),i=this._validatePosition(e.endLineNumber,e.endColumn,0),n=t.lineNumber,o=t.column,s=i.lineNumber,r=i.column;{const e=o>1?this._buffer.getLineCharCode(n,o-2):0,t=r>1&&r<=this._buffer.getLineLength(s)?this._buffer.getLineCharCode(s,r-2):0,i=In(e),a=In(t);return i||a?n===s&&o===r?new tc(n,o-1,s,r-1):i&&a?new tc(n,o-1,s,r+1):i?new tc(n,o-1,s,r):new tc(n,o,s,r+1):new tc(n,o,s,r)}}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new tc(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,o,s,r=999){this._assertNotDisposed();let a=null;null!==t&&(Array.isArray(t)||(t=[t]),t.every((e=>tc.isIRange(e)))&&(a=t.map((e=>this.validateRange(e))))),null===a&&(a=[this.getFullModelRange()]),a=a.sort(((e,t)=>e.startLineNumber-t.startLineNumber||e.startColumn-t.startColumn));const l=[];let h;if(l.push(a.reduce(((e,t)=>tc.areIntersecting(e,t)?e.plusRange(t):(l.push(e),t)))),!i&&e.indexOf("\n")<0){const t=new Kw(e,i,n,o).parseSearchRequest();if(!t)return[];h=e=>this.findMatchesLineByLine(e,t,s,r)}else h=t=>$w.findMatches(this,new Kw(e,i,n,o),t,s,r);return l.map(h).reduce(((e,t)=>e.concat(t)),[])}findNextMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);if(!i&&e.indexOf("\n")<0){const t=new Kw(e,i,n,o).parseSearchRequest();if(!t)return null;const a=this.getLineCount();let l=new tc(r.lineNumber,r.column,a,this.getLineMaxColumn(a)),h=this.findMatchesLineByLine(l,t,s,1);return $w.findNextMatch(this,new Kw(e,i,n,o),r,s),h.length>0?h[0]:(l=new tc(1,1,r.lineNumber,this.getLineMaxColumn(r.lineNumber)),h=this.findMatchesLineByLine(l,t,s,1),h.length>0?h[0]:null)}return $w.findNextMatch(this,new Kw(e,i,n,o),r,s)}findPreviousMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);return $w.findPreviousMatch(this,new Kw(e,i,n,o),r,s)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if(("\n"===this.getEOL()?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof Lc?e:new Lc(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this._validateEditOperation(e[i]);return t}pushEditOperations(e,t,i,n){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),i,n)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,i,n){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){const i=t.map((e=>({range:this.validateRange(e.range),text:e.text})));let n=!0;if(e)for(let t=0,o=e.length;t<o;t++){const o=e[t];let s=!1;for(let e=0,t=i.length;e<t;e++){const t=i[e].range,n=t.startLineNumber>o.endLineNumber,r=o.startLineNumber>t.endLineNumber;if(!n&&!r){s=!0;break}}if(!s){n=!1;break}}if(n)for(let e=0,n=this._trimAutoWhitespaceLines.length;e<n;e++){const n=this._trimAutoWhitespaceLines[e],o=this.getLineMaxColumn(n);let s=!0;for(let e=0,t=i.length;e<t;e++){const t=i[e].range,r=i[e].text;if(!(n<t.startLineNumber||n>t.endLineNumber||n===t.startLineNumber&&t.startColumn===o&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(0)||n===t.startLineNumber&&1===t.startColumn&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(r.length-1))){s=!1;break}}if(s){const e=new tc(n,1,n,o);t.push(new Lc(null,e,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,n)}_applyUndo(e,t,i,n){const o=e.map((e=>{const t=this.getPositionAt(e.newPosition),i=this.getPositionAt(e.newEnd);return{range:new tc(t.lineNumber,t.column,i.lineNumber,i.column),text:e.oldText}}));this._applyUndoRedoEdits(o,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const o=e.map((e=>{const t=this.getPositionAt(e.oldPosition),i=this.getPositionAt(e.oldEnd);return{range:new tc(t.lineNumber,t.column,i.lineNumber,i.column),text:e.newText}}));this._applyUndoRedoEdits(o,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,o,s){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(s),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),n=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),s=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,0!==s.length){for(let e=0,t=s.length;e<t;e++){const t=s[e];this._decorationsTree.acceptReplace(t.rangeOffset,t.rangeLength,t.text.length,t.forceMoveMarkers)}const e=[];this._increaseVersionId();let t=i;for(let i=0,n=s.length;i<n;i++){const n=s[i],[r]=au(n.text);this._onDidChangeDecorations.fire();const a=n.range.startLineNumber,l=n.range.endLineNumber,h=l-a,d=r,c=Math.min(h,d),u=d-h,g=o-t-u+a,p=g,m=g+d,f=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new ch(p,1)),this.getOffsetAt(new ch(m,this.getLineMaxColumn(m))),0),_=ZC.fromDecorations(f),v=new eu(_);for(let t=c;t>=0;t--){const i=a+t,n=g+t;v.takeFromEndWhile((e=>e.lineNumber>n));const o=v.takeFromEndWhile((e=>e.lineNumber===n));e.push(new YC(i,this.getLineContent(n),o))}if(c<h){const t=a+c;e.push(new QC(t+1,l))}if(c<d){const i=new eu(_),n=a+c,s=d-c,r=o-t-s+n+1,l=[],h=[];for(let e=0;e<s;e++){const t=r+e;h[e]=this.getLineContent(t),i.takeWhile((e=>e.lineNumber<t)),l[e]=i.takeWhile((e=>e.lineNumber===t))}e.push(new XC(n+1,a+d,h,l))}t+=u}this._emitContentChangedEvent(new ey(e,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:s,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return null===n.reverseEdits?void 0:n.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(null===e||0===e.size)return;const t=Array.from(e).map((e=>new YC(e,this.getLineContent(e),this._getInjectedTextInLine(e))));this._onDidChangeInjectedText.fire(new ty(t))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(t,i)=>this._deltaDecorationsImpl(e,[],[{range:t,options:i}])[0],changeDecoration:(e,t)=>{this._changeDecorationImpl(e,t)},changeDecorationOptions:(e,t)=>{this._changeDecorationOptionsImpl(e,Ly(t))},removeDecoration:t=>{this._deltaDecorationsImpl(e,[t],[])},deltaDecorations:(t,i)=>0===t.length&&0===i.length?[]:this._deltaDecorationsImpl(e,t,i)};let n=null;try{n=t(i)}catch(e){h(e)}return i.addDecoration=uy,i.changeDecoration=uy,i.changeDecorationOptions=uy,i.removeDecoration=uy,i.deltaDecorations=uy,n}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),0===e.length&&0===t.length)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),h(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const n=e?this._decorations[e]:null;if(!n)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:ky[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;const o=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),r=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(n),n.reset(this.getVersionId(),s,r,o),n.setOptions(ky[i]),this._decorationsTree.insert(n),n.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let e=0,i=t.length;e<i;e++){const i=t[e];this._decorationsTree.delete(i),delete this._decorations[i.id]}}getDecorationOptions(e){const t=this._decorations[e];return t?t.options:null}getDecorationRange(e){const t=this._decorations[e];return t?this._decorationsTree.getNodeRange(this,t):null}getLineDecorations(e,t=0,i=!1){return e<1||e>this.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,n=!1,o=!1){const s=this.getLineCount(),r=Math.min(s,Math.max(1,e)),a=Math.min(s,Math.max(1,t)),l=this.getLineMaxColumn(a),h=new tc(r,1,a,l),d=this._getDecorationsInRange(h,i,n,o);return qc(d,this._decorationProvider.getDecorationsInRange(h,i,n)),d}getDecorationsInRange(e,t=0,i=!1,n=!1,o=!1){const s=this.validateRange(e),r=this._getDecorationsInRange(s,t,i,o);return qc(r,this._decorationProvider.getDecorationsInRange(s,t,i,n)),r}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),n=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return ZC.fromDecorations(n).filter((t=>t.lineNumber===e))}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,i,n){const o=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),s=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,o,s,t,i,n)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const i=this._decorations[e];if(!i)return;if(i.options.after){const t=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(t.endLineNumber)}if(i.options.before){const t=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(t.startLineNumber)}const n=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(n.startLineNumber,n.startColumn),s=this._buffer.getOffsetAt(n.endLineNumber,n.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),o,s,n),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(n.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(n.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const n=!(!i.options.overviewRuler||!i.options.overviewRuler.color),o=!(!t.overviewRuler||!t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const e=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(i.options.before||t.before){const e=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}n!==o?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,n=!1){const o=this.getVersionId(),s=t.length;let r=0;const a=i.length;let l=0;this._onDidChangeDecorations.beginDeferredEmit();try{const h=new Array(a);for(;r<s||l<a;){let d=null;if(r<s){do{d=this._decorations[t[r++]]}while(!d&&r<s);if(d){if(d.options.after){const e=this._decorationsTree.getNodeRange(this,d);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(d.options.before){const e=this._decorationsTree.getNodeRange(this,d);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}this._decorationsTree.delete(d),n||this._onDidChangeDecorations.checkAffectedAndFire(d.options)}}if(l<a){if(!d){const e=++this._lastDecorationId,t=`${this._instanceId};${e}`;d=new uw(t,0,0),this._decorations[t]=d}const t=i[l],s=this._validateRangeRelaxedNoAllocations(t.range),r=Ly(t.options),a=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),c=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);d.ownerId=e,d.reset(o,a,c,s),d.setOptions(r),d.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber),d.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber),n||this._onDidChangeDecorations.checkAffectedAndFire(r),this._decorationsTree.insert(d),h[l]=d.id,l++}else d&&delete this._decorations[d.id]}return h}finally{this._onDidChangeDecorations.endDeferredEmit()}}getLanguageId(){return this.tokenization.getLanguageId()}setLanguage(e,t){"string"==typeof e?(this._languageSelectionListener.clear(),this._setLanguage(e,t)):(this._languageSelectionListener.value=e.onDidChange((()=>this._setLanguage(e.languageId,t))),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return function(e){let t=0;for(const i of e){if(" "!==i&&"\t"!==i)break;t++}return t}(this.getLineContent(e))+1}};function py(e){return!(!e.options.overviewRuler||!e.options.overviewRuler.color)}function my(e){return!!e.options.after||!!e.options.before}gy._MODEL_SYNC_LIMIT=52428800,gy.LARGE_FILE_SIZE_THRESHOLD=20971520,gy.LARGE_FILE_LINE_COUNT_THRESHOLD=3e5,gy.LARGE_FILE_HEAP_OPERATION_THRESHOLD=268435456,gy.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:Cu.tabSize,indentSize:Cu.indentSize,insertSpaces:Cu.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:Cu.trimAutoWhitespace,largeFileOptimizations:Cu.largeFileOptimizations,bracketPairColorizationOptions:Cu.bracketPairColorizationOptions},gy=ay=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([ly(4,ny),ly(5,yu),ly(6,Yg)],gy);class fy{constructor(){this._decorationsTree0=new pw,this._decorationsTree1=new pw,this._injectedTextDecorationsTree=new pw}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)null===i.range&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,n,o,s){const r=e.getVersionId(),a=this._intervalSearch(t,i,n,o,r,s);return this._ensureNodesHaveRanges(e,a)}_intervalSearch(e,t,i,n,o,s){const r=this._decorationsTree0.intervalSearch(e,t,i,n,o,s),a=this._decorationsTree1.intervalSearch(e,t,i,n,o,s),l=this._injectedTextDecorationsTree.intervalSearch(e,t,i,n,o,s);return r.concat(a).concat(l)}getInjectedTextInInterval(e,t,i,n){const o=e.getVersionId(),s=this._injectedTextDecorationsTree.intervalSearch(t,i,n,!1,o,!1);return this._ensureNodesHaveRanges(e,s).filter((e=>e.options.showIfCollapsed||!e.range.isEmpty()))}getAllInjectedText(e,t){const i=e.getVersionId(),n=this._injectedTextDecorationsTree.search(t,!1,i,!1);return this._ensureNodesHaveRanges(e,n).filter((e=>e.options.showIfCollapsed||!e.range.isEmpty()))}getAll(e,t,i,n,o){const s=e.getVersionId(),r=this._search(t,i,n,s,o);return this._ensureNodesHaveRanges(e,r)}_search(e,t,i,n,o){if(i)return this._decorationsTree1.search(e,t,n,o);{const i=this._decorationsTree0.search(e,t,n,o),s=this._decorationsTree1.search(e,t,n,o),r=this._injectedTextDecorationsTree.search(e,t,n,o);return i.concat(s).concat(r)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),n=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(n)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){my(e)?this._injectedTextDecorationsTree.insert(e):py(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){my(e)?this._injectedTextDecorationsTree.delete(e):py(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),null===t.range&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){my(e)?this._injectedTextDecorationsTree.resolveNode(e,t):py(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,n){this._decorationsTree0.acceptReplace(e,t,i,n),this._decorationsTree1.acceptReplace(e,t,i,n),this._injectedTextDecorationsTree.acceptReplace(e,t,i,n)}}function _y(e){return e.replace(/[^a-z0-9\-_]/gi," ")}class vy{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class by extends vy{constructor(e){super(e),this._resolvedColor=null,this.position="number"==typeof e.position?e.position:vc.Center}getColor(e){return this._resolvedColor||("light"!==e.type&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if("string"==typeof e)return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class wy{constructor(e){var t;this.position=null!==(t=null==e?void 0:e.position)&&void 0!==t?t:bc.Left}}class Cy extends vy{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||("light"!==e.type&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return"string"==typeof e?ru.fromHex(e):t.getColor(e.id)}}class yy{static from(e){return e instanceof yy?e:new yy(e)}constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class Sy{static register(e){return new Sy(e)}static createDynamic(e){return new Sy(e)}constructor(e){var t,i,n,o,s,r;this.description=e.description,this.blockClassName=e.blockClassName?_y(e.blockClassName):null,this.blockDoesNotCollapse=null!==(t=e.blockDoesNotCollapse)&&void 0!==t?t:null,this.blockIsAfterEnd=null!==(i=e.blockIsAfterEnd)&&void 0!==i?i:null,this.blockPadding=null!==(n=e.blockPadding)&&void 0!==n?n:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?_y(e.className):null,this.shouldFillLineOnLineBreak=null!==(o=e.shouldFillLineOnLineBreak)&&void 0!==o?o:null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new by(e.overviewRuler):null,this.minimap=e.minimap?new Cy(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new wy(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?_y(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?_y(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?_y(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?_y(e.marginClassName):null,this.inlineClassName=e.inlineClassName?_y(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?_y(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?_y(e.afterContentClassName):null,this.after=e.after?yy.from(e.after):null,this.before=e.before?yy.from(e.before):null,this.hideInCommentTokens=null!==(s=e.hideInCommentTokens)&&void 0!==s&&s,this.hideInStringTokens=null!==(r=e.hideInStringTokens)&&void 0!==r&&r}}Sy.EMPTY=Sy.register({description:"empty"});const ky=[Sy.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),Sy.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),Sy.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),Sy.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function Ly(e){return e instanceof Sy?e:Sy.createDynamic(e)}class xy extends T{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new q),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,0===this._deferredCnt&&(this._shouldFireDeferred&&this.doFire(),null===(e=this._affectedInjectedTextLines)||void 0===e||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||(this._affectsMinimap=!(!e.minimap||!e.minimap.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!(!e.overviewRuler||!e.overviewRuler.color)),this._affectsGlyphMargin||(this._affectsGlyphMargin=!!e.glyphMarginClassName),this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){0===this._deferredCnt?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class Dy extends T{constructor(){super(),this._fastEmitter=this._register(new q),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new q),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,0===this._deferredCnt&&null!==this._deferredEvent){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){this._deferredCnt>0?this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e:(this._fastEmitter.fire(e),this._slowEmitter.fire(e))}}class Ey{constructor(){this._onDidChangeVisibleRanges=new q,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new Ny((t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})}));return this._views.add(e),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0})}}class Ny{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map((e=>new bu(e.startLineNumber,e.endLineNumber+1)));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}const Iy=Sm("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},me(0,"Overview ruler marker color for matching brackets."));class My{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class Ty extends T{static get(e){return e.getContribution(Ty.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Zt((()=>this._updateBrackets()),50)),this._matchBrackets=this._editor.getOption(71),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition((e=>{"never"!==this._matchBrackets&&this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeModelContent((e=>{this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeModel((e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeModelLanguageConfiguration((e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeConfiguration((e=>{e.hasChanged(71)&&(this._matchBrackets=this._editor.getOption(71),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())}))),this._register(e.onDidBlurEditorWidget((()=>{this._updateBracketsSoon.schedule()}))),this._register(e.onDidFocusEditorWidget((()=>{this._updateBracketsSoon.schedule()})))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map((t=>{const i=t.getStartPosition(),n=e.bracketPairs.matchBracket(i);let o=null;if(n)n[0].containsPosition(i)&&!n[1].containsPosition(i)?o=n[1].getStartPosition():n[1].containsPosition(i)&&(o=n[0].getStartPosition());else{const t=e.bracketPairs.findEnclosingBrackets(i);if(t)o=t[1].getStartPosition();else{const t=e.bracketPairs.findNextBracket(i);t&&t.range&&(o=t.range.getStartPosition())}}return o?new ic(o.lineNumber,o.column,o.lineNumber,o.column):new ic(i.lineNumber,i.column,i.lineNumber,i.column)}));this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach((n=>{const o=n.getStartPosition();let s=t.bracketPairs.matchBracket(o);if(!s&&(s=t.bracketPairs.findEnclosingBrackets(o),!s)){const e=t.bracketPairs.findNextBracket(o);e&&e.range&&(s=t.bracketPairs.matchBracket(e.range.getStartPosition()))}let r=null,a=null;if(s){s.sort(tc.compareRangesUsingStarts);const[t,i]=s;if(r=e?t.getStartPosition():t.getEndPosition(),a=e?i.getEndPosition():i.getStartPosition(),i.containsPosition(o)){const e=r;r=a,a=e}}r&&a&&i.push(new ic(r.lineNumber,r.column,a.lineNumber,a.column))})),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach((i=>{const n=i.getPosition();let o=t.bracketPairs.matchBracket(n);o||(o=t.bracketPairs.findEnclosingBrackets(n)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())}))}_updateBrackets(){if("never"===this._matchBrackets)return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus())return this._lastBracketsData=[],void(this._lastVersionId=0);const e=this._editor.getSelections();if(e.length>100)return this._lastBracketsData=[],void(this._lastVersionId=0);const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const o=[];let s=0;for(let t=0,i=e.length;t<i;t++){const i=e[t];i.isEmpty()&&(o[s++]=i.getStartPosition())}o.length>1&&o.sort(ch.compare);const r=[];let a=0,l=0;const h=n.length;for(let e=0,i=o.length;e<i;e++){const i=o[e];for(;l<h&&n[l].position.isBefore(i);)l++;if(l<h&&n[l].position.equals(i))r[a++]=n[l];else{let e=t.bracketPairs.matchBracket(i,20),n=Ty._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;e||"always"!==this._matchBrackets||(e=t.bracketPairs.findEnclosingBrackets(i,20),n=Ty._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),r[a++]=new My(i,e,n)}}this._lastBracketsData=r,this._lastVersionId=i}}Ty.ID="editor.contrib.bracketMatchingController",Ty._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Sy.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:Av(Iy),position:vc.Center}}),Ty._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Sy.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"}),Gd(Ty.ID,Ty,1),qd(class extends zd{constructor(){super({id:"editor.action.selectToBracket",label:me(0,"Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:fe(0,"Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var n;let o=!0;i&&!1===i.selectBrackets&&(o=!1),null===(n=Ty.get(t))||void 0===n||n.selectToBracket(o)}}),qd(class extends zd{constructor(){super({id:"editor.action.jumpToBracket",label:me(0,"Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:nc.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;null===(i=Ty.get(t))||void 0===i||i.jumpToBracket()}}),qd(class extends zd{constructor(){super({id:"editor.action.removeBrackets",label:me(0,"Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:nc.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;null===(i=Ty.get(t))||void 0===i||i.removeBrackets(this.id)}}),Ld.appendMenuItem(yd.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:me(0,"Go to &&Bracket")},order:2});const Ay=()=>!0,Ry=()=>!1,Oy=e=>" "===e||"\t"===e;class Py{static shouldRecreate(e){return e.hasChanged(143)||e.hasChanged(129)||e.hasChanged(37)||e.hasChanged(76)||e.hasChanged(78)||e.hasChanged(79)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(127)||e.hasChanged(50)||e.hasChanged(90)}constructor(e,t,i,n){var o;this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const s=i.options,r=s.get(143),a=s.get(50);this.readOnly=s.get(90),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=s.get(115),this.lineHeight=a.lineHeight,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(r.height/this.lineHeight)-2),this.useTabStops=s.get(127),this.wordSeparators=s.get(129),this.emptySelectionClipboard=s.get(37),this.copyWithSyntaxHighlighting=s.get(25),this.multiCursorMergeOverlapping=s.get(76),this.multiCursorPaste=s.get(78),this.multiCursorLimit=s.get(79),this.autoClosingBrackets=s.get(6),this.autoClosingComments=s.get(7),this.autoClosingQuotes=s.get(11),this.autoClosingDelete=s.get(9),this.autoClosingOvertype=s.get(10),this.autoSurround=s.get(14),this.autoIndent=s.get(12),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const l=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(l)for(const e of l)this.surroundingPairs[e.open]=e.close;const h=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=null!==(o=null==h?void 0:h.blockCommentStartToken)&&void 0!==o?o:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=null===(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)||void 0===e?void 0:e.getElectricCharacters();if(t)for(const e of t)this._electricChars[e]=!0}return this._electricChars}onElectricCharacter(e,t,i){const n=Ru(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return o?o.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return hu(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return Oy;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return Ay;case"never":return Ry}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return e=>-1!==i.indexOf(e)}visibleColumnFromColumn(e,t){return lu.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const n=lu.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(n<o)return o;const s=e.getLineMaxColumn(t);return n>s?s:n}}class Fy{static fromModelState(e){return new By(e)}static fromViewState(e){return new Wy(e)}static fromModelSelection(e){const t=ic.liftSelection(e),i=new Vy(tc.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return Fy.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this.fromModelSelection(e[i]);return t}constructor(e,t){this._cursorStateBrand=void 0,this.modelState=e,this.viewState=t}equals(e){return this.viewState.equals(e.viewState)&&this.modelState.equals(e.modelState)}}class By{constructor(e){this.modelState=e,this.viewState=null}}class Wy{constructor(e){this.modelState=null,this.viewState=e}}class Vy{constructor(e,t,i,n,o){this.selectionStart=e,this.selectionStartKind=t,this.selectionStartLeftoverVisibleColumns=i,this.position=n,this.leftoverVisibleColumns=o,this._singleCursorStateBrand=void 0,this.selection=Vy._computeSelection(this.selectionStart,this.position)}equals(e){return this.selectionStartLeftoverVisibleColumns===e.selectionStartLeftoverVisibleColumns&&this.leftoverVisibleColumns===e.leftoverVisibleColumns&&this.selectionStartKind===e.selectionStartKind&&this.position.equals(e.position)&&this.selectionStart.equalsRange(e.selectionStart)}hasSelection(){return!this.selection.isEmpty()||!this.selectionStart.isEmpty()}move(e,t,i,n){return e?new Vy(this.selectionStart,this.selectionStartKind,this.selectionStartLeftoverVisibleColumns,new ch(t,i),n):new Vy(new tc(t,i,t,i),0,n,new ch(t,i),n)}static _computeSelection(e,t){return e.isEmpty()||!t.isBeforeOrEqual(e.getStartPosition())?ic.fromPositions(e.getStartPosition(),t):ic.fromPositions(e.getEndPosition(),t)}}class zy{constructor(e,t,i){this._editOperationResultBrand=void 0,this.type=e,this.commands=t,this.shouldPushStackElementBefore=i.shouldPushStackElementBefore,this.shouldPushStackElementAfter=i.shouldPushStackElementAfter}}function Hy(e){return"'"===e||'"'===e||"`"===e}class Uy{static columnSelect(e,t,i,n,o,s){const r=Math.abs(o-i)+1,a=i>o,l=n>s,h=n<s,d=[];for(let o=0;o<r;o++){const r=i+(a?-o:o),c=e.columnFromVisibleColumn(t,r,n),u=e.columnFromVisibleColumn(t,r,s),g=e.visibleColumnFromColumn(t,new ch(r,c)),p=e.visibleColumnFromColumn(t,new ch(r,u));if(h){if(g>s)continue;if(p<n)continue}if(l){if(p>n)continue;if(g<s)continue}d.push(new Vy(new tc(r,c,r,c),0,0,new ch(r,u),0))}if(0===d.length)for(let e=0;e<r;e++){const n=i+(a?-e:e),o=t.getLineMaxColumn(n);d.push(new Vy(new tc(n,o,n,o),0,0,new ch(n,o),0))}return{viewStates:d,reversed:a,fromLineNumber:i,fromVisualColumn:n,toLineNumber:o,toVisualColumn:s}}static columnSelectLeft(e,t,i){let n=i.toViewVisualColumn;return n>0&&n--,Uy.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),s=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let i=o;i<=s;i++){const o=t.getLineMaxColumn(i),s=e.visibleColumnFromColumn(t,new ch(i,o));n=Math.max(n,s)}let r=i.toViewVisualColumn;return r<n&&r++,this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,r)}static columnSelectUp(e,t,i,n){const o=n?e.pageSize:1,s=Math.max(1,i.toViewLineNumber-o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,s,i.toViewVisualColumn)}static columnSelectDown(e,t,i,n){const o=n?e.pageSize:1,s=Math.min(t.getLineCount(),i.toViewLineNumber+o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,s,i.toViewVisualColumn)}}class Ky{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return ic.fromPositions(i.getEndPosition())}}class jy{constructor(e,t){this._range=e,this._text=t}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return ic.fromRange(i,0)}}class qy{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return ic.fromPositions(i.getStartPosition())}}class $y{constructor(e,t,i,n,o=!1){this._range=e,this._text=t,this._columnDeltaOffset=n,this._lineNumberDeltaOffset=i,this.insertsAutoWhitespace=o}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return ic.fromPositions(i.getEndPosition().delta(this._lineNumberDeltaOffset,this._columnDeltaOffset))}}class Gy{constructor(e,t,i,n=!1){this._range=e,this._text=t,this._initialSelection=i,this._forceMoveMarkers=n,this._selectionId=null}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text,this._forceMoveMarkers),this._selectionId=t.trackSelection(this._initialSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}class Zy{static whitespaceVisibleColumn(e,t,i){const n=e.length;let o=0,s=-1,r=-1;for(let a=0;a<n;a++){if(a===t)return[s,r,o];switch(o%i==0&&(s=a,r=o),e.charCodeAt(a)){case 32:o+=1;break;case 9:o=lu.nextRenderTabStop(o,i);break;default:return[-1,-1,-1]}}return t===n?[s,r,o]:[-1,-1,-1]}static atomicPosition(e,t,i,n){const o=e.length,[s,r,a]=Zy.whitespaceVisibleColumn(e,t,i);if(-1===a)return-1;let l;switch(n){case 0:l=!0;break;case 1:l=!1;break;case 2:if(a%i==0)return t;l=a%i<=i/2}if(l){if(-1===s)return-1;let t=r;for(let n=s;n<o;++n){if(t===r+i)return s;switch(e.charCodeAt(n)){case 32:t+=1;break;case 9:t=lu.nextRenderTabStop(t,i);break;default:return-1}}return t===r+i?s:-1}const h=lu.nextRenderTabStop(a,i);let d=a;for(let n=t;n<o;n++){if(d===h)return n;switch(e.charCodeAt(n)){case 32:d+=1;break;case 9:d=lu.nextRenderTabStop(d,i);break;default:return-1}}return d===h?o:-1}}class Yy{constructor(e,t,i){this._cursorPositionBrand=void 0,this.lineNumber=e,this.column=t,this.leftoverVisibleColumns=i}}class Qy{static leftPosition(e,t){if(t.column>e.getLineMinColumn(t.lineNumber))return t.delta(void 0,-Fn(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new ch(i,e.getLineMaxColumn(i))}return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const n=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),s=Zy.atomicPosition(o,t.column-1,i,0);if(-1!==s&&s+1>=n)return new ch(t.lineNumber,s+1)}return this.leftPosition(e,t)}static left(e,t,i){const n=e.stickyTabStops?Qy.leftPositionAtomicSoftTabs(t,i,e.tabSize):Qy.leftPosition(t,i);return new Yy(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,o){let s,r;if(i.hasSelection()&&!n)s=i.selection.startLineNumber,r=i.selection.startColumn;else{const n=i.position.delta(void 0,-(o-1)),a=t.normalizePosition(Qy.clipPositionColumn(n,t),0),l=Qy.left(e,t,a);s=l.lineNumber,r=l.column}return i.move(n,s,r,0)}static clipPositionColumn(e,t){return new ch(e.lineNumber,Qy.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return e<t?t:e>i?i:e}static rightPosition(e,t,i){return i<e.getLineMaxColumn(t)?i+=Pn(e.getLineContent(t),i-1):t<e.getLineCount()&&(t+=1,i=e.getLineMinColumn(t)),new ch(t,i)}static rightPositionAtomicSoftTabs(e,t,i,n,o){if(i<e.getLineIndentColumn(t)){const o=e.getLineContent(t),s=Zy.atomicPosition(o,i-1,n,1);if(-1!==s)return new ch(t,s+1)}return this.rightPosition(e,t,i)}static right(e,t,i){const n=e.stickyTabStops?Qy.rightPositionAtomicSoftTabs(t,i.lineNumber,i.column,e.tabSize,e.indentSize):Qy.rightPosition(t,i.lineNumber,i.column);return new Yy(n.lineNumber,n.column,0)}static moveRight(e,t,i,n,o){let s,r;if(i.hasSelection()&&!n)s=i.selection.endLineNumber,r=i.selection.endColumn;else{const n=i.position.delta(void 0,o-1),a=t.normalizePosition(Qy.clipPositionColumn(n,t),1),l=Qy.right(e,t,a);s=l.lineNumber,r=l.column}return i.move(n,s,r,0)}static vertical(e,t,i,n,o,s,r,a){const l=lu.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize)+o,h=t.getLineCount(),d=1===i&&1===n,c=i===h&&n===t.getLineMaxColumn(i),u=s<i?d:c;if((i=s)<1?(i=1,n=r?t.getLineMinColumn(i):Math.min(t.getLineMaxColumn(i),n)):i>h?(i=h,n=r?t.getLineMaxColumn(i):Math.min(t.getLineMaxColumn(i),n)):n=e.columnFromVisibleColumn(t,i,l),o=u?0:l-lu.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),void 0!==a){const e=new ch(i,n),s=t.normalizePosition(e,a);o+=n-s.column,i=s.lineNumber,n=s.column}return new Yy(i,n,o)}static down(e,t,i,n,o,s,r){return this.vertical(e,t,i,n,o,i+s,r,4)}static moveDown(e,t,i,n,o){let s,r;i.hasSelection()&&!n?(s=i.selection.endLineNumber,r=i.selection.endColumn):(s=i.position.lineNumber,r=i.position.column);let a,l=0;do{if(a=Qy.down(e,t,s+l,r,i.leftoverVisibleColumns,o,!0),t.normalizePosition(new ch(a.lineNumber,a.column),2).lineNumber>s)break}while(l++<10&&s+l<t.getLineCount());return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateDown(e,t,i){const n=i.selection,o=Qy.down(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=Qy.down(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new Vy(new tc(o.lineNumber,o.column,o.lineNumber,o.column),0,o.leftoverVisibleColumns,new ch(s.lineNumber,s.column),s.leftoverVisibleColumns)}static up(e,t,i,n,o,s,r){return this.vertical(e,t,i,n,o,i-s,r,3)}static moveUp(e,t,i,n,o){let s,r;i.hasSelection()&&!n?(s=i.selection.startLineNumber,r=i.selection.startColumn):(s=i.position.lineNumber,r=i.position.column);const a=Qy.up(e,t,s,r,i.leftoverVisibleColumns,o,!0);return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateUp(e,t,i){const n=i.selection,o=Qy.up(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=Qy.up(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new Vy(new tc(o.lineNumber,o.column,o.lineNumber,o.column),0,o.leftoverVisibleColumns,new ch(s.lineNumber,s.column),s.leftoverVisibleColumns)}static _isBlankLine(e,t){return 0===e.getLineFirstNonWhitespaceColumn(t)}static moveToPrevBlankLine(e,t,i,n){let o=i.position.lineNumber;for(;o>1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(n,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,n){const o=t.getLineCount();let s=i.position.lineNumber;for(;s<o&&this._isBlankLine(t,s);)s++;for(;s<o&&!this._isBlankLine(t,s);)s++;return i.move(n,s,t.getLineMinColumn(s),0)}static moveToBeginningOfLine(e,t,i,n){const o=i.position.lineNumber,s=t.getLineMinColumn(o),r=t.getLineFirstNonWhitespaceColumn(o)||s;let a;return a=i.position.column===r?s:r,i.move(n,o,a,0)}static moveToEndOfLine(e,t,i,n,o){const s=i.position.lineNumber,r=t.getLineMaxColumn(s);return i.move(n,s,r,o?1073741824-r:0)}static moveToBeginningOfBuffer(e,t,i,n){return i.move(n,1,1,0)}static moveToEndOfBuffer(e,t,i,n){const o=t.getLineCount(),s=t.getLineMaxColumn(o);return i.move(n,o,s,0)}}class Xy{static deleteRight(e,t,i,n){const o=[];let s=3!==e;for(let e=0,r=n.length;e<r;e++){const r=n[e];let a=r;if(a.isEmpty()){const e=r.getPosition(),n=Qy.right(t,i,e);a=new tc(n.lineNumber,n.column,e.lineNumber,e.column)}a.isEmpty()?o[e]=null:(a.startLineNumber!==a.endLineNumber&&(s=!0),o[e]=new Ky(a,""))}return[s,o]}static isAutoClosingPairDelete(e,t,i,n,o,s,r){if("never"===t&&"never"===i)return!1;if("never"===e)return!1;for(let a=0,l=s.length;a<l;a++){const l=s[a],h=l.getPosition();if(!l.isEmpty())return!1;const d=o.getLineContent(h.lineNumber);if(h.column<2||h.column>=d.length+1)return!1;const c=d.charAt(h.column-2),u=n.get(c);if(!u)return!1;if(Hy(c)){if("never"===i)return!1}else if("never"===t)return!1;const g=d.charAt(h.column-1);let p=!1;for(const e of u)e.open===c&&e.close===g&&(p=!0);if(!p)return!1;if("auto"===e){let e=!1;for(let t=0,i=r.length;t<i;t++){const i=r[t];if(h.lineNumber===i.startLineNumber&&h.column===i.startColumn){e=!0;break}}if(!e)return!1}}return!0}static _runAutoClosingPairDelete(e,t,i){const n=[];for(let e=0,t=i.length;e<t;e++){const t=i[e].getPosition(),o=new tc(t.lineNumber,t.column-1,t.lineNumber,t.column+1);n[e]=new Ky(o,"")}return[!0,n]}static deleteLeft(e,t,i,n,o){if(this.isAutoClosingPairDelete(t.autoClosingDelete,t.autoClosingBrackets,t.autoClosingQuotes,t.autoClosingPairs.autoClosingPairsOpenByEnd,i,n,o))return this._runAutoClosingPairDelete(t,i,n);const s=[];let r=2!==e;for(let e=0,o=n.length;e<o;e++){const o=Xy.getDeleteRange(n[e],i,t);o.isEmpty()?s[e]=null:(o.startLineNumber!==o.endLineNumber&&(r=!0),s[e]=new Ky(o,""))}return[r,s]}static getDeleteRange(e,t,i){if(!e.isEmpty())return e;const n=e.getPosition();if(i.useTabStops&&n.column>1){const e=t.getLineContent(n.lineNumber),o=fn(e),s=-1===o?e.length+1:o+1;if(n.column<=s){const e=i.visibleColumnFromColumn(t,n),o=lu.prevIndentTabStop(e,i.indentSize),s=i.columnFromVisibleColumn(t,n.lineNumber,o);return new tc(n.lineNumber,s,n.lineNumber,n.column)}}return tc.fromPositions(Xy.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=function(e,t){if(0===e)return 0;const i=function(e,t){const i=new Rn(t,e);let n=i.prevCodePoint();for(;Qn(n)||65039===n||8419===n;){if(0===i.offset)return;n=i.prevCodePoint()}if(!jn(n))return;let o=i.offset;return o>0&&8205===i.prevCodePoint()&&(o=i.offset),o}(e,t);if(void 0!==i)return i;const n=new Rn(t,e);return n.prevCodePoint(),n.offset}(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}if(e.lineNumber>1){const i=e.lineNumber-1;return new ch(i,t.getLineMaxColumn(i))}return e}static cut(e,t,i){const n=[];let o=null;i.sort(((e,t)=>ch.compare(e.getStartPosition(),t.getEndPosition())));for(let s=0,r=i.length;s<r;s++){const r=i[s];if(r.isEmpty())if(e.emptySelectionClipboard){const e=r.getPosition();let i,a,l,h;e.lineNumber<t.getLineCount()?(i=e.lineNumber,a=1,l=e.lineNumber+1,h=1):e.lineNumber>1&&(null==o?void 0:o.endLineNumber)!==e.lineNumber?(i=e.lineNumber-1,a=t.getLineMaxColumn(e.lineNumber-1),l=e.lineNumber,h=t.getLineMaxColumn(e.lineNumber)):(i=e.lineNumber,a=1,l=e.lineNumber,h=t.getLineMaxColumn(e.lineNumber));const d=new tc(i,a,l,h);o=d,d.isEmpty()?n[s]=null:n[s]=new Ky(d,"")}else n[s]=null;else n[s]=new Ky(r,"")}return new zy(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class Jy{static _createWord(e,t,i,n,o){return{start:n,end:o,wordType:t,nextCharClass:i}}static _findPreviousWordOnLine(e,t,i){const n=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(n,e,i)}static _doFindPreviousWordOnLine(e,t,i){let n=0;for(let o=i.column-2;o>=0;o--){const i=e.charCodeAt(o),s=t.get(i);if(0===s){if(2===n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1));n=1}else if(2===s){if(1===n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1));n=2}else if(1===s&&0!==n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1))}return 0!==n?this._createWord(e,n,1,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){const o=e.length;for(let s=n;s<o;s++){const n=e.charCodeAt(s),o=t.get(n);if(1===o)return s;if(1===i&&2===o)return s;if(2===i&&0===o)return s}return o}static _findNextWordOnLine(e,t,i){const n=t.getLineContent(i.lineNumber);return this._doFindNextWordOnLine(n,e,i)}static _doFindNextWordOnLine(e,t,i){let n=0;const o=e.length;for(let s=i.column-1;s<o;s++){const i=e.charCodeAt(s),o=t.get(i);if(0===o){if(2===n)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,s-1),s);n=1}else if(2===o){if(1===n)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,s-1),s);n=2}else if(1===o&&0!==n)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,s-1),s)}return 0!==n?this._createWord(e,n,1,this._findStartOfWord(e,t,n,o-1),o):null}static _findStartOfWord(e,t,i,n){for(let o=n;o>=0;o--){const n=e.charCodeAt(o),s=t.get(n);if(1===s)return o+1;if(1===i&&2===s)return o+1;if(2===i&&0===s)return o+1}return 0}static moveWordLeft(e,t,i,n){let o=i.lineNumber,s=i.column;1===s&&o>1&&(o-=1,s=t.getLineMaxColumn(o));let r=Jy._findPreviousWordOnLine(e,t,new ch(o,s));if(0===n)return new ch(o,r?r.start+1:1);if(1===n)return r&&2===r.wordType&&r.end-r.start==1&&0===r.nextCharClass&&(r=Jy._findPreviousWordOnLine(e,t,new ch(o,r.start+1))),new ch(o,r?r.start+1:1);if(3===n){for(;r&&2===r.wordType;)r=Jy._findPreviousWordOnLine(e,t,new ch(o,r.start+1));return new ch(o,r?r.start+1:1)}return r&&s<=r.end+1&&(r=Jy._findPreviousWordOnLine(e,t,new ch(o,r.start+1))),new ch(o,r?r.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(1===t.column)return i>1?new ch(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let e=t.column-1;e>1;e--){const t=o.charCodeAt(e-2),s=o.charCodeAt(e-1);if(95===t&&95!==s)return new ch(i,e);if(45===t&&45!==s)return new ch(i,e);if((kn(t)||Sn(t))&&Ln(s))return new ch(i,e);if(Ln(t)&&Ln(s)&&e+1<n){const t=o.charCodeAt(e);if(kn(t)||Sn(t))return new ch(i,e)}}return new ch(i,1)}static moveWordRight(e,t,i,n){let o=i.lineNumber,s=i.column,r=!1;s===t.getLineMaxColumn(o)&&o<t.getLineCount()&&(r=!0,o+=1,s=1);let a=Jy._findNextWordOnLine(e,t,new ch(o,s));if(2===n)a&&2===a.wordType&&a.end-a.start==1&&0===a.nextCharClass&&(a=Jy._findNextWordOnLine(e,t,new ch(o,a.end+1))),s=a?a.end+1:t.getLineMaxColumn(o);else if(3===n){for(r&&(s=0);a&&(2===a.wordType||a.start+1<=s);)a=Jy._findNextWordOnLine(e,t,new ch(o,a.end+1));s=a?a.start+1:t.getLineMaxColumn(o)}else a&&!r&&s>=a.start+1&&(a=Jy._findNextWordOnLine(e,t,new ch(o,a.end+1))),s=a?a.start+1:t.getLineMaxColumn(o);return new ch(o,s)}static _moveWordPartRight(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===n)return i<e.getLineCount()?new ch(i+1,1):t;const o=e.getLineContent(i);for(let e=t.column+1;e<n;e++){const t=o.charCodeAt(e-2),s=o.charCodeAt(e-1);if(95!==t&&95===s)return new ch(i,e);if(45!==t&&45===s)return new ch(i,e);if((kn(t)||Sn(t))&&Ln(s))return new ch(i,e);if(Ln(t)&&Ln(s)&&e+1<n){const t=o.charCodeAt(e);if(kn(t)||Sn(t))return new ch(i,e)}}return new ch(i,n)}static _deleteWordLeftWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=t.column-2,o=vn(i,n);return o+1<n?new tc(t.lineNumber,o+2,t.lineNumber,t.column):null}static deleteWordLeft(e,t){const i=e.wordSeparators,n=e.model,o=e.selection,s=e.whitespaceHeuristics;if(!o.isEmpty())return o;if(Xy.isAutoClosingPairDelete(e.autoClosingDelete,e.autoClosingBrackets,e.autoClosingQuotes,e.autoClosingPairs.autoClosingPairsOpenByEnd,e.model,[e.selection],e.autoClosedCharacters)){const t=e.selection.getPosition();return new tc(t.lineNumber,t.column-1,t.lineNumber,t.column+1)}const r=new ch(o.positionLineNumber,o.positionColumn);let a=r.lineNumber,l=r.column;if(1===a&&1===l)return null;if(s){const e=this._deleteWordLeftWhitespace(n,r);if(e)return e}let h=Jy._findPreviousWordOnLine(i,n,r);return 0===t?h?l=h.start+1:l>1?l=1:(a--,l=n.getLineMaxColumn(a)):(h&&l<=h.end+1&&(h=Jy._findPreviousWordOnLine(i,n,new ch(a,h.start+1))),h?l=h.end+1:l>1?l=1:(a--,l=n.getLineMaxColumn(a))),new tc(a,l,r.lineNumber,r.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new ch(i.positionLineNumber,i.positionColumn);return this._deleteInsideWordWhitespace(t,n)||this._deleteInsideWordDetermineDeleteRange(e,t,n)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return 32===i||9===i}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=i.length;if(0===n)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let s=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,s))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;s+1<n&&this._charAtIsWhitespace(i,s+1);)s++;return new tc(t.lineNumber,o+1,t.lineNumber,s+2)}static _deleteInsideWordDetermineDeleteRange(e,t,i){const n=t.getLineContent(i.lineNumber),o=n.length;if(0===o)return i.lineNumber>1?new tc(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumber<t.getLineCount()?new tc(i.lineNumber,1,i.lineNumber+1,1):new tc(i.lineNumber,1,i.lineNumber,1);const s=e=>e.start+1<=i.column&&i.column<=e.end+1,r=(e,t)=>(e=Math.min(e,i.column),t=Math.max(t,i.column),new tc(i.lineNumber,e,i.lineNumber,t)),a=e=>{let t=e.start+1,i=e.end+1,s=!1;for(;i-1<o&&this._charAtIsWhitespace(n,i-1);)s=!0,i++;if(!s)for(;t>1&&this._charAtIsWhitespace(n,t-2);)t--;return r(t,i)},l=Jy._findPreviousWordOnLine(e,t,i);if(l&&s(l))return a(l);const h=Jy._findNextWordOnLine(e,t,i);return h&&s(h)?a(h):l&&h?r(l.end+1,h.start+1):l?r(l.start+1,l.end+1):h?r(h.start+1,h.end+1):r(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=Jy._moveWordPartLeft(e,i);return new tc(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let n=t;n<i;n++){const t=e.charAt(n);if(" "!==t&&"\t"!==t)return n}return i}static _deleteWordRightWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=t.column-1,o=this._findFirstNonWhitespaceChar(i,n);return n+1<o?new tc(t.lineNumber,t.column,t.lineNumber,o+1):null}static deleteWordRight(e,t){const i=e.wordSeparators,n=e.model,o=e.selection,s=e.whitespaceHeuristics;if(!o.isEmpty())return o;const r=new ch(o.positionLineNumber,o.positionColumn);let a=r.lineNumber,l=r.column;const h=n.getLineCount(),d=n.getLineMaxColumn(a);if(a===h&&l===d)return null;if(s){const e=this._deleteWordRightWhitespace(n,r);if(e)return e}let c=Jy._findNextWordOnLine(i,n,r);return 2===t?c?l=c.end+1:l<d||a===h?l=d:(a++,c=Jy._findNextWordOnLine(i,n,new ch(a,1)),l=c?c.start+1:n.getLineMaxColumn(a)):(c&&l>=c.start+1&&(c=Jy._findNextWordOnLine(i,n,new ch(a,c.end+1))),c?l=c.start+1:l<d||a===h?l=d:(a++,c=Jy._findNextWordOnLine(i,n,new ch(a,1)),l=c?c.start+1:n.getLineMaxColumn(a))),new tc(a,l,r.lineNumber,r.column)}static _deleteWordPartRight(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=Jy._moveWordPartRight(e,i);return new tc(i.lineNumber,i.column,n.lineNumber,n.column)}static _createWordAtPosition(e,t,i){const n=new tc(t,i.start+1,t,i.end+1);return{word:e.getValueInRange(n),startColumn:n.startColumn,endColumn:n.endColumn}}static getWordAtPosition(e,t,i){const n=Uw(t),o=Jy._findPreviousWordOnLine(n,e,i);if(o&&1===o.wordType&&o.start<=i.column-1&&i.column-1<=o.end)return Jy._createWordAtPosition(e,i.lineNumber,o);const s=Jy._findNextWordOnLine(n,e,i);return s&&1===s.wordType&&s.start<=i.column-1&&i.column-1<=s.end?Jy._createWordAtPosition(e,i.lineNumber,s):null}static word(e,t,i,n,o){const s=Uw(e.wordSeparators),r=Jy._findPreviousWordOnLine(s,t,o),a=Jy._findNextWordOnLine(s,t,o);if(!n){let e,i;return r&&1===r.wordType&&r.start<=o.column-1&&o.column-1<=r.end?(e=r.start+1,i=r.end+1):a&&1===a.wordType&&a.start<=o.column-1&&o.column-1<=a.end?(e=a.start+1,i=a.end+1):(e=r?r.end+1:1,i=a?a.start+1:t.getLineMaxColumn(o.lineNumber)),new Vy(new tc(o.lineNumber,e,o.lineNumber,i),1,0,new ch(o.lineNumber,i),0)}let l,h;r&&1===r.wordType&&r.start<o.column-1&&o.column-1<r.end?(l=r.start+1,h=r.end+1):a&&1===a.wordType&&a.start<o.column-1&&o.column-1<a.end?(l=a.start+1,h=a.end+1):(l=o.column,h=o.column);const d=o.lineNumber;let c;if(i.selectionStart.containsPosition(o))c=i.selectionStart.endColumn;else if(o.isBeforeOrEqual(i.selectionStart.getStartPosition())){c=l;const e=new ch(d,c);i.selectionStart.containsPosition(e)&&(c=i.selectionStart.endColumn)}else{c=h;const e=new ch(d,c);i.selectionStart.containsPosition(e)&&(c=i.selectionStart.startColumn)}return i.move(!0,d,c,0)}}class eS extends Jy{static deleteWordPartLeft(e){const t=tS([Jy.deleteWordLeft(e,0),Jy.deleteWordLeft(e,2),Jy._deleteWordPartLeft(e.model,e.selection)]);return t.sort(tc.compareRangesUsingEnds),t[2]}static deleteWordPartRight(e){const t=tS([Jy.deleteWordRight(e,0),Jy.deleteWordRight(e,2),Jy._deleteWordPartRight(e.model,e.selection)]);return t.sort(tc.compareRangesUsingStarts),t[0]}static moveWordPartLeft(e,t,i){const n=tS([Jy.moveWordLeft(e,t,i,0),Jy.moveWordLeft(e,t,i,2),Jy._moveWordPartLeft(t,i)]);return n.sort(ch.compare),n[2]}static moveWordPartRight(e,t,i){const n=tS([Jy.moveWordRight(e,t,i,0),Jy.moveWordRight(e,t,i,2),Jy._moveWordPartRight(t,i)]);return n.sort(ch.compare),n[0]}}function tS(e){return e.filter((e=>Boolean(e)))}class iS{static addCursorDown(e,t,i){const n=[];let o=0;for(let s=0,r=t.length;s<r;s++){const r=t[s];n[o++]=new Fy(r.modelState,r.viewState),n[o++]=i?Fy.fromModelState(Qy.translateDown(e.cursorConfig,e.model,r.modelState)):Fy.fromViewState(Qy.translateDown(e.cursorConfig,e,r.viewState))}return n}static addCursorUp(e,t,i){const n=[];let o=0;for(let s=0,r=t.length;s<r;s++){const r=t[s];n[o++]=new Fy(r.modelState,r.viewState),n[o++]=i?Fy.fromModelState(Qy.translateUp(e.cursorConfig,e.model,r.modelState)):Fy.fromViewState(Qy.translateUp(e.cursorConfig,e,r.viewState))}return n}static moveToBeginningOfLine(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o];n[o]=this._moveToLineStart(e,s,i)}return n}static _moveToLineStart(e,t,i){const n=t.viewState.position.column,o=n===t.modelState.position.column,s=t.viewState.position.lineNumber,r=e.getLineFirstNonWhitespaceColumn(s);return o||n===r?this._moveToLineStartByModel(e,t,i):this._moveToLineStartByView(e,t,i)}static _moveToLineStartByView(e,t,i){return Fy.fromViewState(Qy.moveToBeginningOfLine(e.cursorConfig,e,t.viewState,i))}static _moveToLineStartByModel(e,t,i){return Fy.fromModelState(Qy.moveToBeginningOfLine(e.cursorConfig,e.model,t.modelState,i))}static moveToEndOfLine(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=this._moveToLineEnd(e,r,i,n)}return o}static _moveToLineEnd(e,t,i,n){const o=t.viewState.position,s=e.getLineMaxColumn(o.lineNumber),r=o.column===s,a=t.modelState.position,l=e.model.getLineMaxColumn(a.lineNumber),h=s-o.column==l-a.column;return r||h?this._moveToLineEndByModel(e,t,i,n):this._moveToLineEndByView(e,t,i,n)}static _moveToLineEndByView(e,t,i,n){return Fy.fromViewState(Qy.moveToEndOfLine(e.cursorConfig,e,t.viewState,i,n))}static _moveToLineEndByModel(e,t,i,n){return Fy.fromModelState(Qy.moveToEndOfLine(e.cursorConfig,e.model,t.modelState,i,n))}static expandLineSelection(e,t){const i=[];for(let n=0,o=t.length;n<o;n++){const o=t[n],s=o.modelState.selection.startLineNumber,r=e.model.getLineCount();let a,l=o.modelState.selection.endLineNumber;l===r?a=e.model.getLineMaxColumn(r):(l++,a=1),i[n]=Fy.fromModelState(new Vy(new tc(s,1,s,1),0,0,new ch(l,a),0))}return i}static moveToBeginningOfBuffer(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o];n[o]=Fy.fromModelState(Qy.moveToBeginningOfBuffer(e.cursorConfig,e.model,s.modelState,i))}return n}static moveToEndOfBuffer(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o];n[o]=Fy.fromModelState(Qy.moveToEndOfBuffer(e.cursorConfig,e.model,s.modelState,i))}return n}static selectAll(e,t){const i=e.model.getLineCount(),n=e.model.getLineMaxColumn(i);return Fy.fromModelState(new Vy(new tc(1,1,1,1),0,0,new ch(i,n),0))}static line(e,t,i,n,o){const s=e.model.validatePosition(n),r=o?e.coordinatesConverter.validateViewPosition(new ch(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);if(!i){const t=e.model.getLineCount();let i=s.lineNumber+1,n=1;return i>t&&(i=t,n=e.model.getLineMaxColumn(i)),Fy.fromModelState(new Vy(new tc(s.lineNumber,1,i,n),2,0,new ch(i,n),0))}const a=t.modelState.selectionStart.getStartPosition().lineNumber;if(s.lineNumber<a)return Fy.fromViewState(t.viewState.move(!0,r.lineNumber,1,0));if(s.lineNumber>a){const i=e.getLineCount();let n=r.lineNumber+1,o=1;return n>i&&(n=i,o=e.getLineMaxColumn(n)),Fy.fromViewState(t.viewState.move(!0,n,o,0))}{const e=t.modelState.selectionStart.getEndPosition();return Fy.fromModelState(t.modelState.move(!0,e.lineNumber,e.column,0))}}static word(e,t,i,n){const o=e.model.validatePosition(n);return Fy.fromModelState(Jy.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Fy(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return Fy.fromViewState(new Vy(new tc(i,n,i,n),0,0,new ch(i,n),0))}static moveTo(e,t,i,n,o){if(i){if(1===t.modelState.selectionStartKind)return this.word(e,t,i,n);if(2===t.modelState.selectionStartKind)return this.line(e,t,i,n,o)}const s=e.model.validatePosition(n),r=o?e.coordinatesConverter.validateViewPosition(new ch(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);return Fy.fromViewState(t.viewState.move(i,r.lineNumber,r.column,0))}static simpleMove(e,t,i,n,o,s){switch(i){case 0:return 4===s?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,o);case 1:return 4===s?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,o);case 2:return 2===s?this._moveUpByViewLines(e,t,n,o):this._moveUpByModelLines(e,t,n,o);case 3:return 2===s?this._moveDownByViewLines(e,t,n,o):this._moveDownByModelLines(e,t,n,o);case 4:return 2===s?t.map((t=>Fy.fromViewState(Qy.moveToPrevBlankLine(e.cursorConfig,e,t.viewState,n)))):t.map((t=>Fy.fromModelState(Qy.moveToPrevBlankLine(e.cursorConfig,e.model,t.modelState,n))));case 5:return 2===s?t.map((t=>Fy.fromViewState(Qy.moveToNextBlankLine(e.cursorConfig,e,t.viewState,n)))):t.map((t=>Fy.fromModelState(Qy.moveToNextBlankLine(e.cursorConfig,e.model,t.modelState,n))));case 6:return this._moveToViewMinColumn(e,t,n);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case 8:return this._moveToViewCenterColumn(e,t,n);case 9:return this._moveToViewMaxColumn(e,t,n);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,o){const s=e.getCompletelyVisibleViewRange(),r=e.coordinatesConverter.convertViewRangeToModelRange(s);switch(i){case 11:{const i=this._firstLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 13:{const i=this._lastLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 12:{const i=Math.round((r.startLineNumber+r.endLineNumber)/2),o=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,o)]}case 14:{const i=[];for(let o=0,r=t.length;o<r;o++){const r=t[o];i[o]=this.findPositionInViewportIfOutside(e,r,s,n)}return i}default:return null}}static findPositionInViewportIfOutside(e,t,i,n){const o=t.viewState.position.lineNumber;if(i.startLineNumber<=o&&o<=i.endLineNumber-1)return new Fy(t.modelState,t.viewState);{let s;s=o>i.endLineNumber-1?i.endLineNumber-1:o<i.startLineNumber?i.startLineNumber:o;const r=Qy.vertical(e.cursorConfig,e,o,t.viewState.position.column,t.viewState.leftoverVisibleColumns,s,!1);return Fy.fromViewState(t.viewState.move(n,r.lineNumber,r.column,r.leftoverVisibleColumns))}}static _firstLineNumberInRange(e,t,i){let n=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(n)&&n++,Math.min(t.endLineNumber,n+i-1)}static _lastLineNumberInRange(e,t,i){let n=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(n)&&n++,Math.max(n,t.endLineNumber-i+1)}static _moveLeft(e,t,i,n){return t.map((t=>Fy.fromViewState(Qy.moveLeft(e.cursorConfig,e,t.viewState,i,n))))}static _moveHalfLineLeft(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=Math.round(e.getLineLength(r)/2);n[o]=Fy.fromViewState(Qy.moveLeft(e.cursorConfig,e,s.viewState,i,a))}return n}static _moveRight(e,t,i,n){return t.map((t=>Fy.fromViewState(Qy.moveRight(e.cursorConfig,e,t.viewState,i,n))))}static _moveHalfLineRight(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=Math.round(e.getLineLength(r)/2);n[o]=Fy.fromViewState(Qy.moveRight(e.cursorConfig,e,s.viewState,i,a))}return n}static _moveDownByViewLines(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=Fy.fromViewState(Qy.moveDown(e.cursorConfig,e,r.viewState,i,n))}return o}static _moveDownByModelLines(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=Fy.fromModelState(Qy.moveDown(e.cursorConfig,e.model,r.modelState,i,n))}return o}static _moveUpByViewLines(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=Fy.fromViewState(Qy.moveUp(e.cursorConfig,e,r.viewState,i,n))}return o}static _moveUpByModelLines(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=Fy.fromModelState(Qy.moveUp(e.cursorConfig,e.model,r.modelState,i,n))}return o}static _moveToViewPosition(e,t,i,n,o){return Fy.fromViewState(t.viewState.move(i,n,o,0))}static _moveToModelPosition(e,t,i,n,o){return Fy.fromModelState(t.modelState.move(i,n,o,0))}static _moveToViewMinColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineMinColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewFirstNonWhitespaceColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineFirstNonWhitespaceColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewCenterColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=Math.round((e.getLineMaxColumn(r)+e.getLineMinColumn(r))/2);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewMaxColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineMaxColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewLastNonWhitespaceColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineLastNonWhitespaceColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}}var nS;function oS(e,t,i,n){const o=tp(t,i.startLineNumber,i.startColumn),s=n.getLanguageConfiguration(o.languageId);if(!s)return null;const r=o.getLineContent(),a=r.substr(0,i.startColumn-1-o.firstCharOffset);let l;l=i.isEmpty()?r.substr(i.startColumn-1-o.firstCharOffset):tp(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-o.firstCharOffset);let h="";if(i.startLineNumber>1&&0===o.firstCharOffset){const e=tp(t,i.startLineNumber-1);e.languageId===o.languageId&&(h=e.getLineContent())}const d=s.onEnter(e,h,a,l);if(!d)return null;const c=d.indentAction;let u=d.appendText;const g=d.removeText||0;u?c===Nu.Indent&&(u="\t"+u):u=c===Nu.Indent||c===Nu.IndentOutdent?"\t":"";let p=ep(t,i.startLineNumber,i.startColumn);return g&&(p=p.substring(0,p.length-g)),{indentAction:c,appendText:u,removeText:g,indentation:p}}!function(e){e.metadata={description:"Move cursor to a logical position in the view",args:[{name:"Cursor move argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'to': A mandatory logical position value providing where to move the cursor.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',\n\t\t\t\t\t\t'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'\n\t\t\t\t\t\t'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'\n\t\t\t\t\t\t'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'line', 'wrappedLine', 'character', 'halfLine'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'select': If 'true' makes the selection. Default is 'false'.\n\t\t\t\t",constraint:function(e){if(!ll(e))return!1;const t=e;return!(!al(t.to)||!gl(t.select)&&!ul(t.select)||!gl(t.by)&&!al(t.by)||!gl(t.value)&&!dl(t.value))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},e.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},e.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"},e.parse=function(t){if(!t.to)return null;let i;switch(t.to){case e.RawDirection.Left:i=0;break;case e.RawDirection.Right:i=1;break;case e.RawDirection.Up:i=2;break;case e.RawDirection.Down:i=3;break;case e.RawDirection.PrevBlankLine:i=4;break;case e.RawDirection.NextBlankLine:i=5;break;case e.RawDirection.WrappedLineStart:i=6;break;case e.RawDirection.WrappedLineFirstNonWhitespaceCharacter:i=7;break;case e.RawDirection.WrappedLineColumnCenter:i=8;break;case e.RawDirection.WrappedLineEnd:i=9;break;case e.RawDirection.WrappedLineLastNonWhitespaceCharacter:i=10;break;case e.RawDirection.ViewPortTop:i=11;break;case e.RawDirection.ViewPortBottom:i=13;break;case e.RawDirection.ViewPortCenter:i=12;break;case e.RawDirection.ViewPortIfOutside:i=14;break;default:return null}let n=0;switch(t.by){case e.RawUnit.Line:n=1;break;case e.RawUnit.WrappedLine:n=2;break;case e.RawUnit.Character:n=3;break;case e.RawUnit.HalfLine:n=4}return{direction:i,unit:n,select:!!t.select,value:t.value||1}}}(nS||(nS={}));var sS;const rS=Object.create(null);function aS(e,t){if(t<=0)return"";rS[e]||(rS[e]=["",e]);const i=rS[e];for(let n=i.length;n<=t;n++)i[n]=i[n-1]+e;return i[t]}let lS=sS=class{static unshiftIndent(e,t,i,n,o){const s=lu.visibleColumnFromColumn(e,t,i);if(o){const e=aS(" ",n);return aS(e,lu.prevIndentTabStop(s,n)/n)}return aS("\t",lu.prevRenderTabStop(s,i)/i)}static shiftIndent(e,t,i,n,o){const s=lu.visibleColumnFromColumn(e,t,i);if(o){const e=aS(" ",n);return aS(e,lu.nextIndentTabStop(s,n)/n)}return aS("\t",lu.nextRenderTabStop(s,i)/i)}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let n=this._selection.endLineNumber;1===this._selection.endColumn&&i!==n&&(n-=1);const{tabSize:o,indentSize:s,insertSpaces:r}=this._opts,a=i===n;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let l=0,h=0;for(let d=i;d<=n;d++,l=h){h=0;const n=e.getLineContent(d);let c,u=fn(n);if((!this._opts.isUnshift||0!==n.length&&0!==u)&&(a||this._opts.isUnshift||0!==n.length)){if(-1===u&&(u=n.length),d>1&&lu.visibleColumnFromColumn(n,u+1,o)%s!=0&&e.tokenization.isCheapToTokenize(d-1)){const t=oS(this._opts.autoIndent,e,new tc(d-1,e.getLineMaxColumn(d-1),d-1,e.getLineMaxColumn(d-1)),this._languageConfigurationService);if(t){if(h=l,t.appendText)for(let e=0,i=t.appendText.length;e<i&&h<s&&32===t.appendText.charCodeAt(e);e++)h++;t.removeText&&(h=Math.max(0,h-t.removeText));for(let e=0;e<h&&0!==u&&32===n.charCodeAt(u-1);e++)u--}}this._opts.isUnshift&&0===u||(c=this._opts.isUnshift?sS.unshiftIndent(n,u+1,o,s,r):sS.shiftIndent(n,u+1,o,s,r),this._addEditOperation(t,new tc(d,1,d,u+1),c),d!==i||this._selection.isEmpty()||(this._selectionStartColumnStaysPut=this._selection.startColumn<=u+1))}}}else{!this._opts.isUnshift&&this._selection.isEmpty()&&0===e.getLineLength(i)&&(this._useLastEditRangeForCursorEndPosition=!0);const o=r?aS(" ",s):"\t";for(let r=i;r<=n;r++){const n=e.getLineContent(r);let l=fn(n);if((!this._opts.isUnshift||0!==n.length&&0!==l)&&(a||this._opts.isUnshift||0!==n.length)&&(-1===l&&(l=n.length),!this._opts.isUnshift||0!==l))if(this._opts.isUnshift){l=Math.min(l,s);for(let e=0;e<l;e++)if(9===n.charCodeAt(e)){l=e+1;break}this._addEditOperation(t,new tc(r,1,r,l+1),"")}else this._addEditOperation(t,new tc(r,1,r,1),o),r!==i||this._selection.isEmpty()||(this._selectionStartColumnStaysPut=1===this._selection.startColumn)}}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){if(this._useLastEditRangeForCursorEndPosition){const e=t.getInverseEditOperations()[0];return new ic(e.range.endLineNumber,e.range.endColumn,e.range.endLineNumber,e.range.endColumn)}const i=t.getTrackedSelection(this._selectionId);if(this._selectionStartColumnStaysPut){const e=this._selection.startColumn;return i.startColumn<=e?i:0===i.getDirection()?new ic(i.startLineNumber,e,i.endLineNumber,i.endColumn):new ic(i.endLineNumber,i.endColumn,i.startLineNumber,e)}return i}};lS=sS=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(2,Yg)],lS);class hS{constructor(e,t,i){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=i}getEditOperations(e,t){t.addTrackedEditOperation(new tc(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new tc(this._range.endLineNumber,this._range.endColumn,this._range.endLineNumber,this._range.endColumn),this._charAfterSelection)}computeCursorState(e,t){const i=t.getInverseEditOperations(),n=i[0].range,o=i[1].range;return new ic(n.endLineNumber,n.endColumn,o.endLineNumber,o.endColumn-this._charAfterSelection.length)}}class dS{constructor(e,t,i){this._position=e,this._text=t,this._charAfter=i}getEditOperations(e,t){t.addTrackedEditOperation(new tc(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column),this._text+this._charAfter)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return new ic(i.endLineNumber,i.startColumn,i.endLineNumber,i.endColumn-this._charAfter.length)}}function cS(e,t,i,n=!0,o){if(e<4)return null;const s=o.getLanguageConfiguration(t.tokenization.getLanguageId()).indentRulesSupport;if(!s)return null;if(i<=1)return{indentation:"",action:null};for(let e=i-1;e>0&&""===t.getLineContent(e);e--)if(1===e)return{indentation:"",action:null};const r=function(e,t,i){const n=e.tokenization.getLanguageIdAtPosition(t,0);if(t>1){let o,s=-1;for(o=t-1;o>=1;o--){if(e.tokenization.getLanguageIdAtPosition(o,0)!==n)return s;const t=e.getLineContent(o);if(!i.shouldIgnore(t)&&!/^\s+$/.test(t)&&""!==t)return o;s=o}}return-1}(t,i,s);if(r<0)return null;if(r<1)return{indentation:"",action:null};const a=t.getLineContent(r);if(s.shouldIncrease(a)||s.shouldIndentNextLine(a))return{indentation:_n(a),action:Nu.Indent,line:r};if(s.shouldDecrease(a))return{indentation:_n(a),action:null,line:r};{if(1===r)return{indentation:_n(t.getLineContent(r)),action:null,line:r};const e=r-1,i=s.getIndentMetadata(t.getLineContent(e));if(!(3&i)&&4&i){let i=0;for(let n=e-1;n>0;n--)if(!s.shouldIndentNextLine(t.getLineContent(n))){i=n;break}return{indentation:_n(t.getLineContent(i+1)),action:null,line:i+1}}if(n)return{indentation:_n(t.getLineContent(r)),action:null,line:r};for(let e=r;e>0;e--){const i=t.getLineContent(e);if(s.shouldIncrease(i))return{indentation:_n(i),action:Nu.Indent,line:e};if(s.shouldIndentNextLine(i)){let i=0;for(let n=e-1;n>0;n--)if(!s.shouldIndentNextLine(t.getLineContent(e))){i=n;break}return{indentation:_n(t.getLineContent(i+1)),action:null,line:i+1}}if(s.shouldDecrease(i))return{indentation:_n(i),action:null,line:e}}return{indentation:_n(t.getLineContent(1)),action:null,line:1}}}function uS(e,t,i,n,o,s){if(e<4)return null;const r=s.getLanguageConfiguration(i);if(!r)return null;const a=s.getLanguageConfiguration(i).indentRulesSupport;if(!a)return null;const l=cS(e,t,n,void 0,s),h=t.getLineContent(n);if(l){const i=l.line;if(void 0!==i){let s=!0;for(let e=i;e<n-1;e++)if(!/^\s*$/.test(t.getLineContent(e))){s=!1;break}if(s){const n=r.onEnter(e,"",t.getLineContent(i),"");if(n){let e=_n(t.getLineContent(i));return n.removeText&&(e=e.substring(0,e.length-n.removeText)),n.indentAction===Nu.Indent||n.indentAction===Nu.IndentOutdent?e=o.shiftIndent(e):n.indentAction===Nu.Outdent&&(e=o.unshiftIndent(e)),a.shouldDecrease(h)&&(e=o.unshiftIndent(e)),n.appendText&&(e+=n.appendText),_n(e)}}}return a.shouldDecrease(h)?l.action===Nu.Indent?l.indentation:o.unshiftIndent(l.indentation):l.action===Nu.Indent?o.shiftIndent(l.indentation):l.indentation}return null}function gS(e,t,i){const n=i.getLanguageConfiguration(e.getLanguageId()).indentRulesSupport;return n?t<1||t>e.getLineCount()?null:n.getIndentMetadata(e.getLineContent(t)):null}class pS{static indent(e,t,i){if(null===t||null===i)return[];const n=[];for(let t=0,o=i.length;t<o;t++)n[t]=new lS(i[t],{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return n}static outdent(e,t,i){const n=[];for(let t=0,o=i.length;t<o;t++)n[t]=new lS(i[t],{isUnshift:!0,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return n}static shiftIndent(e,t,i){return i=i||1,lS.shiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static unshiftIndent(e,t,i){return i=i||1,lS.unshiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static _distributedPaste(e,t,i,n){const o=[];for(let e=0,t=i.length;e<t;e++)o[e]=new Ky(i[e],n[e]);return new zy(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _simplePaste(e,t,i,n,o){const s=[];for(let e=0,t=i.length;e<t;e++){const t=i[e],r=t.getPosition();if(o&&!t.isEmpty()&&(o=!1),o&&n.indexOf("\n")!==n.length-1&&(o=!1),o){const i=new tc(r.lineNumber,1,r.lineNumber,1);s[e]=new Gy(i,n,t,!0)}else s[e]=new Ky(t,n)}return new zy(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _distributePasteToCursors(e,t,i,n,o){if(n)return null;if(1===t.length)return null;if(o&&o.length===t.length)return o;if("spread"===e.multiCursorPaste){10===i.charCodeAt(i.length-1)&&(i=i.substr(0,i.length-1)),13===i.charCodeAt(i.length-1)&&(i=i.substr(0,i.length-1));const e=mn(i);if(e.length===t.length)return e}return null}static paste(e,t,i,n,o,s){const r=this._distributePasteToCursors(e,i,n,o,s);return r?(i=i.sort(tc.compareRangesUsingStarts),this._distributedPaste(e,t,i,r)):this._simplePaste(e,t,i,n,o)}static _goodIndentForLine(e,t,i){let n=null,o="";const s=cS(e.autoIndent,t,i,!1,e.languageConfigurationService);if(s)n=s.action,o=s.indentation;else if(i>1){let n;for(n=i-1;n>=1&&!(vn(t.getLineContent(n))>=0);n--);if(n<1)return null;const s=t.getLineMaxColumn(n),r=oS(e.autoIndent,t,new tc(n,s,n,s),e.languageConfigurationService);r&&(o=r.indentation+r.appendText)}return n&&(n===Nu.Indent&&(o=pS.shiftIndent(e,o)),n===Nu.Outdent&&(o=pS.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,n){let o="";const s=i.getStartPosition();if(e.insertSpaces){const i=e.visibleColumnFromColumn(t,s),n=e.indentSize,r=n-i%n;for(let e=0;e<r;e++)o+=" "}else o="\t";return new Ky(i,o,n)}static tab(e,t,i){const n=[];for(let o=0,s=i.length;o<s;o++){const s=i[o];if(s.isEmpty()){const i=t.getLineContent(s.startLineNumber);if(/^\s*$/.test(i)&&t.tokenization.isCheapToTokenize(s.startLineNumber)){let r=this._goodIndentForLine(e,t,s.startLineNumber);r=r||"\t";const a=e.normalizeIndentation(r);if(!i.startsWith(a)){n[o]=new Ky(new tc(s.startLineNumber,1,s.startLineNumber,i.length+1),a,!0);continue}}n[o]=this._replaceJumpToNextIndent(e,t,s,!0)}else{if(s.startLineNumber===s.endLineNumber){const i=t.getLineMaxColumn(s.startLineNumber);if(1!==s.startColumn||s.endColumn!==i){n[o]=this._replaceJumpToNextIndent(e,t,s,!1);continue}}n[o]=new lS(s,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService)}}return n}static compositionType(e,t,i,n,o,s,r,a){const l=n.map((e=>this._compositionType(i,e,o,s,r,a)));return new zy(4,l,{shouldPushStackElementBefore:vS(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,o,s){if(!t.isEmpty())return null;const r=t.getPosition(),a=Math.max(1,r.column-n),l=Math.min(e.getLineMaxColumn(r.lineNumber),r.column+o),h=new tc(r.lineNumber,a,r.lineNumber,l);return e.getValueInRange(h)===i&&0===s?null:new $y(h,i,0,s)}static _typeCommand(e,t,i){return i?new qy(e,t,!0):new Ky(e,t,!0)}static _enter(e,t,i,n){if(0===e.autoIndent)return pS._typeCommand(n,"\n",i);if(!t.tokenization.isCheapToTokenize(n.getStartPosition().lineNumber)||1===e.autoIndent){const o=_n(t.getLineContent(n.startLineNumber)).substring(0,n.startColumn-1);return pS._typeCommand(n,"\n"+e.normalizeIndentation(o),i)}const o=oS(e.autoIndent,t,n,e.languageConfigurationService);if(o){if(o.indentAction===Nu.None)return pS._typeCommand(n,"\n"+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Nu.Indent)return pS._typeCommand(n,"\n"+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Nu.IndentOutdent){const t=e.normalizeIndentation(o.indentation),s=e.normalizeIndentation(o.indentation+o.appendText),r="\n"+s+"\n"+t;return i?new qy(n,r,!0):new $y(n,r,-1,s.length-t.length,!0)}if(o.indentAction===Nu.Outdent){const t=pS.unshiftIndent(e,o.indentation);return pS._typeCommand(n,"\n"+e.normalizeIndentation(t+o.appendText),i)}}const s=_n(t.getLineContent(n.startLineNumber)).substring(0,n.startColumn-1);if(e.autoIndent>=4){const o=function(e,t,i,n,o){if(e<4)return null;t.tokenization.forceTokenization(i.startLineNumber);const s=t.tokenization.getLineTokens(i.startLineNumber),r=Ru(s,i.startColumn-1),a=r.getLineContent();let l,h,d=!1;r.firstCharOffset>0&&s.getLanguageId(0)!==r.languageId?(d=!0,l=a.substr(0,i.startColumn-1-r.firstCharOffset)):l=s.getLineContent().substring(0,i.startColumn-1),h=i.isEmpty()?a.substr(i.startColumn-1-r.firstCharOffset):tp(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-r.firstCharOffset);const c=o.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!c)return null;const u=l,g=_n(l),p={tokenization:{getLineTokens:e=>t.tokenization.getLineTokens(e),getLanguageId:()=>t.getLanguageId(),getLanguageIdAtPosition:(e,i)=>t.getLanguageIdAtPosition(e,i)},getLineContent:e=>e===i.startLineNumber?u:t.getLineContent(e)},m=_n(s.getLineContent()),f=cS(e,p,i.startLineNumber+1,void 0,o);if(!f){const e=d?m:g;return{beforeEnter:e,afterEnter:e}}let _=d?m:f.indentation;return f.action===Nu.Indent&&(_=n.shiftIndent(_)),c.shouldDecrease(h)&&(_=n.unshiftIndent(_)),{beforeEnter:d?m:g,afterEnter:_}}(e.autoIndent,t,n,{unshiftIndent:t=>pS.unshiftIndent(e,t),shiftIndent:t=>pS.shiftIndent(e,t),normalizeIndentation:t=>e.normalizeIndentation(t)},e.languageConfigurationService);if(o){let s=e.visibleColumnFromColumn(t,n.getEndPosition());const r=n.endColumn,a=fn(t.getLineContent(n.endLineNumber));if(n=a>=0?n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,a+1)):n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new qy(n,"\n"+e.normalizeIndentation(o.afterEnter),!0);{let t=0;return r<=a+1&&(e.insertSpaces||(s=Math.ceil(s/e.indentSize)),t=Math.min(s+1-e.normalizeIndentation(o.afterEnter).length-1,0)),new $y(n,"\n"+e.normalizeIndentation(o.afterEnter),0,t,!0)}}}return pS._typeCommand(n,"\n"+e.normalizeIndentation(s),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let e=0,n=i.length;e<n;e++)if(!t.tokenization.isCheapToTokenize(i[e].getEndPosition().lineNumber))return!1;return!0}static _runAutoIndentType(e,t,i,n){const o=ep(t,i.startLineNumber,i.startColumn),s=function(e,t,i,n,o,s){if(e<4)return null;const r=tp(t,i.startLineNumber,i.startColumn);if(r.firstCharOffset)return null;const a=s.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!a)return null;const l=r.getLineContent(),h=l.substr(0,i.startColumn-1-r.firstCharOffset);let d;if(d=i.isEmpty()?l.substr(i.startColumn-1-r.firstCharOffset):tp(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-r.firstCharOffset),!a.shouldDecrease(h+d)&&a.shouldDecrease(h+n+d)){const n=cS(e,t,i.startLineNumber,!1,s);if(!n)return null;let r=n.indentation;return n.action!==Nu.Indent&&(r=o.unshiftIndent(r)),r}return null}(e.autoIndent,t,i,n,{shiftIndent:t=>pS.shiftIndent(e,t),unshiftIndent:t=>pS.unshiftIndent(e,t)},e.languageConfigurationService);if(null===s)return null;if(s!==e.normalizeIndentation(o)){const o=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return 0===o?pS._typeCommand(new tc(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+n,!1):pS._typeCommand(new tc(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+t.getLineContent(i.startLineNumber).substring(o-1,i.startColumn-1)+n,!1)}return null}static _isAutoClosingOvertype(e,t,i,n,o){if("never"===e.autoClosingOvertype)return!1;if(!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let s=0,r=i.length;s<r;s++){const r=i[s];if(!r.isEmpty())return!1;const a=r.getPosition(),l=t.getLineContent(a.lineNumber);if(l.charAt(a.column-1)!==o)return!1;const h=Hy(o);if(92===(a.column>2?l.charCodeAt(a.column-2):0)&&h)return!1;if("auto"===e.autoClosingOvertype){let e=!1;for(let t=0,i=n.length;t<i;t++){const i=n[t];if(a.lineNumber===i.startLineNumber&&a.column===i.startColumn){e=!0;break}}if(!e)return!1}}return!0}static _runAutoClosingOvertype(e,t,i,n,o){const s=[];for(let e=0,t=n.length;e<t;e++){const t=n[e].getPosition(),i=new tc(t.lineNumber,t.column,t.lineNumber,t.column+1);s[e]=new Ky(i,o)}return new zy(4,s,{shouldPushStackElementBefore:vS(e,4),shouldPushStackElementAfter:!1})}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],o=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],s=n.some((e=>t.startsWith(e.open))),r=o.some((e=>t.startsWith(e.close)));return!s&&r}static _findAutoClosingPairOpen(e,t,i,n){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!o)return null;let s=null;for(const e of o)if(null===s||e.open.length>s.open.length){let o=!0;for(const s of i)if(t.getValueInRange(new tc(s.lineNumber,s.column-e.open.length+1,s.lineNumber,s.column))+n!==e.open){o=!1;break}o&&(s=e)}return s}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const e of n)e.open!==t.open&&t.open.includes(e.open)&&t.close.endsWith(e.close)&&(!o||e.open.length>o.open.length)&&(o=e);return o}static _getAutoClosingPairClose(e,t,i,n,o){for(const e of i)if(!e.isEmpty())return null;const s=i.map((e=>{const t=e.getPosition();return o?{lineNumber:t.lineNumber,beforeColumn:t.column-n.length,afterColumn:t.column}:{lineNumber:t.lineNumber,beforeColumn:t.column,afterColumn:t.column}})),r=this._findAutoClosingPairOpen(e,t,s.map((e=>new ch(e.lineNumber,e.beforeColumn))),n);if(!r)return null;let a,l;if(Hy(n)?(a=e.autoClosingQuotes,l=e.shouldAutoCloseBefore.quote):e.blockCommentStartToken&&r.open.includes(e.blockCommentStartToken)?(a=e.autoClosingComments,l=e.shouldAutoCloseBefore.comment):(a=e.autoClosingBrackets,l=e.shouldAutoCloseBefore.bracket),"never"===a)return null;const h=this._findContainedAutoClosingPair(e,r),d=h?h.close:"";let c=!0;for(const i of s){const{lineNumber:o,beforeColumn:s,afterColumn:h}=i,u=t.getLineContent(o),g=u.substring(0,s-1),p=u.substring(h-1);if(p.startsWith(d)||(c=!1),p.length>0){const t=p.charAt(0);if(!pS._isBeforeClosingBrace(e,p)&&!l(t))return null}if(1===r.open.length&&("'"===n||'"'===n)&&"always"!==a){const t=Uw(e.wordSeparators);if(g.length>0){const e=g.charCodeAt(g.length-1);if(0===t.get(e))return null}}if(!t.tokenization.isCheapToTokenize(o))return null;t.tokenization.forceTokenization(o);const m=Ru(t.tokenization.getLineTokens(o),s-1);if(!r.shouldAutoClose(m,s-m.firstCharOffset))return null;const f=r.findNeutralCharacter();if(f){const e=t.tokenization.getTokenTypeIfInsertingCharacter(o,s,f);if(!r.isOK(e))return null}}return c?r.close.substring(0,r.close.length-d.length):r.close}static _runAutoClosingOpenCharType(e,t,i,n,o,s,r){const a=[];for(let e=0,t=n.length;e<t;e++){const t=n[e];a[e]=new mS(t,o,!s,r)}return new zy(4,a,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static _shouldSurroundChar(e,t){return Hy(t)?"quotes"===e.autoSurround||"languageDefined"===e.autoSurround:"brackets"===e.autoSurround||"languageDefined"===e.autoSurround}static _isSurroundSelectionType(e,t,i,n){if(!pS._shouldSurroundChar(e,n)||!e.surroundingPairs.hasOwnProperty(n))return!1;const o=Hy(n);for(const e of i){if(e.isEmpty())return!1;let i=!0;for(let n=e.startLineNumber;n<=e.endLineNumber;n++){const o=t.getLineContent(n),s=n===e.startLineNumber?e.startColumn-1:0,r=n===e.endLineNumber?e.endColumn-1:o.length,a=o.substring(s,r);if(/[^ \t]/.test(a)){i=!1;break}}if(i)return!1;if(o&&e.startLineNumber===e.endLineNumber&&e.startColumn+1===e.endColumn&&Hy(t.getValueInRange(e)))return!1}return!0}static _runSurroundSelectionType(e,t,i,n,o){const s=[];for(let e=0,i=n.length;e<i;e++){const i=n[e],r=t.surroundingPairs[o];s[e]=new hS(i,o,r)}return new zy(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _isTypeInterceptorElectricChar(e,t,i){return!(1!==i.length||!t.tokenization.isCheapToTokenize(i[0].getEndPosition().lineNumber))}static _typeInterceptorElectricChar(e,t,i,n,o){if(!t.electricChars.hasOwnProperty(o)||!n.isEmpty())return null;const s=n.getPosition();i.tokenization.forceTokenization(s.lineNumber);const r=i.tokenization.getLineTokens(s.lineNumber);let a;try{a=t.onElectricCharacter(o,r,s.column)}catch(e){return h(e),null}if(!a)return null;if(a.matchOpenBracket){const n=(r.getLineContent()+o).lastIndexOf(a.matchOpenBracket)+1,l=i.bracketPairs.findMatchingBracketUp(a.matchOpenBracket,{lineNumber:s.lineNumber,column:n},500);if(l){if(l.startLineNumber===s.lineNumber)return null;const n=_n(i.getLineContent(l.startLineNumber)),r=t.normalizeIndentation(n),a=i.getLineContent(s.lineNumber),h=i.getLineFirstNonWhitespaceColumn(s.lineNumber)||s.column,d=r+a.substring(h-1,s.column-1)+o,c=new tc(s.lineNumber,1,s.lineNumber,s.column),u=new Ky(c,d);return new zy(_S(d,e),[u],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!0})}}return null}static compositionEndWithInterceptors(e,t,i,n,o,s){if(!n)return null;let r=null;for(const e of n)if(null===r)r=e.insertedText;else if(r!==e.insertedText)return null;if(!r||1!==r.length)return null;const a=r;let l=!1;for(const e of n)if(0!==e.deletedText.length){l=!0;break}if(l){if(!pS._shouldSurroundChar(t,a)||!t.surroundingPairs.hasOwnProperty(a))return null;const e=Hy(a);for(const t of n){if(0!==t.deletedSelectionStart||t.deletedSelectionEnd!==t.deletedText.length)return null;if(/^[ \t]+$/.test(t.deletedText))return null;if(e&&Hy(t.deletedText))return null}const i=[];for(const e of o){if(!e.isEmpty())return null;i.push(e.getPosition())}if(i.length!==n.length)return null;const s=[];for(let e=0,o=i.length;e<o;e++)s.push(new dS(i[e],n[e].deletedText,t.surroundingPairs[a]));return new zy(4,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(t,i,o,s,a)){const e=o.map((e=>new Ky(new tc(e.positionLineNumber,e.positionColumn,e.positionLineNumber,e.positionColumn+1),"",!1)));return new zy(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const h=this._getAutoClosingPairClose(t,i,o,a,!0);return null!==h?this._runAutoClosingOpenCharType(e,t,i,o,a,!0,h):null}static typeWithInterceptors(e,t,i,n,o,s,r){if(!e&&"\n"===r){const e=[];for(let t=0,s=o.length;t<s;t++)e[t]=pS._enter(i,n,!1,o[t]);return new zy(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoIndentType(i,n,o)){const e=[];let t=!1;for(let s=0,a=o.length;s<a;s++)if(e[s]=this._runAutoIndentType(i,n,o[s],r),!e[s]){t=!0;break}if(!t)return new zy(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(i,n,o,s,r))return this._runAutoClosingOvertype(t,i,n,o,r);if(!e){const e=this._getAutoClosingPairClose(i,n,o,r,!1);if(e)return this._runAutoClosingOpenCharType(t,i,n,o,r,!1,e)}if(!e&&this._isSurroundSelectionType(i,n,o,r))return this._runSurroundSelectionType(t,i,n,o,r);if(!e&&this._isTypeInterceptorElectricChar(i,n,o)){const e=this._typeInterceptorElectricChar(t,i,n,o[0],r);if(e)return e}const a=[];for(let e=0,t=o.length;e<t;e++)a[e]=new Ky(o[e],r);const l=_S(r,t);return new zy(l,a,{shouldPushStackElementBefore:vS(t,l),shouldPushStackElementAfter:!1})}static typeWithoutInterceptors(e,t,i,n,o){const s=[];for(let e=0,t=n.length;e<t;e++)s[e]=new Ky(n[e],o);const r=_S(o,e);return new zy(r,s,{shouldPushStackElementBefore:vS(e,r),shouldPushStackElementAfter:!1})}static lineInsertBefore(e,t,i){if(null===t||null===i)return[];const n=[];for(let o=0,s=i.length;o<s;o++){let s=i[o].positionLineNumber;if(1===s)n[o]=new qy(new tc(1,1,1,1),"\n");else{s--;const i=t.getLineMaxColumn(s);n[o]=this._enter(e,t,!1,new tc(s,i,s,i))}}return n}static lineInsertAfter(e,t,i){if(null===t||null===i)return[];const n=[];for(let o=0,s=i.length;o<s;o++){const s=i[o].positionLineNumber,r=t.getLineMaxColumn(s);n[o]=this._enter(e,t,!1,new tc(s,r,s,r))}return n}static lineBreakInsert(e,t,i){const n=[];for(let o=0,s=i.length;o<s;o++)n[o]=this._enter(e,t,!0,i[o]);return n}}class mS extends $y{constructor(e,t,i,n){super(e,(i?t:"")+n,0,-n.length),this._openCharacter=t,this._closeCharacter=n,this.closeCharacterRange=null,this.enclosingRange=null}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return this.closeCharacterRange=new tc(i.startLineNumber,i.endColumn-this._closeCharacter.length,i.endLineNumber,i.endColumn),this.enclosingRange=new tc(i.startLineNumber,i.endColumn-this._openCharacter.length-this._closeCharacter.length,i.endLineNumber,i.endColumn),super.computeCursorState(e,t)}}class fS{constructor(e,t,i,n,o,s){this.deletedText=e,this.deletedSelectionStart=t,this.deletedSelectionEnd=i,this.insertedText=n,this.insertedSelectionStart=o,this.insertedSelectionEnd=s}}function _S(e,t){return" "===e?5===t||6===t?6:5:4}function vS(e,t){return!(!wS(e)||wS(t))||5!==e&&bS(e)!==bS(t)}function bS(e){return 6===e||5===e?"space":e}function wS(e){return 4===e||5===e||6===e}class CS extends Vd{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i||{})}}var yS,SS,kS;!function(e){e.metadata={description:"Scroll editor in the given direction",args:[{name:"Editor scroll argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'to': A mandatory direction value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'up', 'down'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'line', 'wrappedLine', 'page', 'halfPage', 'editor'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'revealCursor': If 'true' reveals the cursor if it is outside view port.\n\t\t\t\t",constraint:function(e){if(!ll(e))return!1;const t=e;return!(!al(t.to)||!gl(t.by)&&!al(t.by)||!gl(t.value)&&!dl(t.value)||!gl(t.revealCursor)&&!ul(t.revealCursor))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["up","down"]},by:{type:"string",enum:["line","wrappedLine","page","halfPage","editor"]},value:{type:"number",default:1},revealCursor:{type:"boolean"}}}}]},e.RawDirection={Up:"up",Right:"right",Down:"down",Left:"left"},e.RawUnit={Line:"line",WrappedLine:"wrappedLine",Page:"page",HalfPage:"halfPage",Editor:"editor",Column:"column"},e.parse=function(t){let i,n;switch(t.to){case e.RawDirection.Up:i=1;break;case e.RawDirection.Right:i=2;break;case e.RawDirection.Down:i=3;break;case e.RawDirection.Left:i=4;break;default:return null}switch(t.by){case e.RawUnit.Line:n=1;break;case e.RawUnit.WrappedLine:n=2;break;case e.RawUnit.Page:n=3;break;case e.RawUnit.HalfPage:n=4;break;case e.RawUnit.Editor:n=5;break;case e.RawUnit.Column:n=6;break;default:n=2}return{direction:i,unit:n,value:Math.floor(t.value||1),revealCursor:!!t.revealCursor,select:!!t.select}}}(yS||(yS={})),function(e){e.metadata={description:"Reveal the given line at the given logical position",args:[{name:"Reveal line argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'lineNumber': A mandatory line number value.\n\t\t\t\t\t* 'at': Logical position at which line has to be revealed.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'top', 'center', 'bottom'\n\t\t\t\t\t\t```\n\t\t\t\t",constraint:function(e){if(!ll(e))return!1;const t=e;return!(!dl(t.lineNumber)&&!al(t.lineNumber)||!gl(t.at)&&!al(t.at))},schema:{type:"object",required:["lineNumber"],properties:{lineNumber:{type:["number","string"]},at:{type:"string",enum:["top","center","bottom"]}}}}]},e.RawAtArgument={Top:"top",Center:"center",Bottom:"bottom"}}(SS||(SS={}));class LS{constructor(e){e.addImplementation(1e4,"code-editor",((e,t)=>{const i=e.get(dh).getFocusedCodeEditor();return!(!i||!i.hasTextFocus())&&this._runEditorCommand(e,i,t)})),e.addImplementation(1e3,"generic-dom-input-textarea",((e,t)=>{const i=Us();return!!(i&&["input","textarea"].indexOf(i.tagName.toLowerCase())>=0)&&(this.runDOMCommand(i),!0)})),e.addImplementation(0,"generic-dom",((e,t)=>{const i=e.get(dh).getActiveCodeEditor();return!!i&&(i.focus(),this._runEditorCommand(e,i,t))}))}_runEditorCommand(e,t,i){return this.runEditorCommand(e,t,i)||!0}}!function(e){class t extends CS{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[iS.moveTo(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)])&&2!==t.revealType&&e.revealPrimaryCursor(t.source,!0,!0))}}e.MoveTo=jd(new t({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),e.MoveToSelect=jd(new t({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class i extends CS{runCoreEditorCommand(e,t){e.model.pushStackElement();const i=this._getColumnSelectResult(e,e.getPrimaryCursorState(),e.getCursorColumnSelectData(),t);null!==i&&(e.setCursorStates(t.source,3,i.viewStates.map((e=>Fy.fromViewState(e)))),e.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:i.fromLineNumber,fromViewVisualColumn:i.fromVisualColumn,toViewLineNumber:i.toLineNumber,toViewVisualColumn:i.toVisualColumn}),i.reversed?e.revealTopMostCursor(t.source):e.revealBottomMostCursor(t.source))}}e.ColumnSelect=jd(new class extends i{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(e,t,i,n){if(void 0===n.position||void 0===n.viewPosition||void 0===n.mouseColumn)return null;const o=e.model.validatePosition(n.position),s=e.coordinatesConverter.validateViewPosition(new ch(n.viewPosition.lineNumber,n.viewPosition.column),o),r=n.doColumnSelect?i.fromViewLineNumber:s.lineNumber,a=n.doColumnSelect?i.fromViewVisualColumn:n.mouseColumn-1;return Uy.columnSelect(e.cursorConfig,e,r,a,s.lineNumber,n.mouseColumn-1)}}),e.CursorColumnSelectLeft=jd(new class extends i{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return Uy.columnSelectLeft(e.cursorConfig,e,i)}}),e.CursorColumnSelectRight=jd(new class extends i{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return Uy.columnSelectRight(e.cursorConfig,e,i)}});class n extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return Uy.columnSelectUp(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectUp=jd(new n({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:3600,linux:{primary:0}}})),e.CursorColumnSelectPageUp=jd(new n({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:3595,linux:{primary:0}}}));class o extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return Uy.columnSelectDown(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectDown=jd(new o({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:3602,linux:{primary:0}}})),e.CursorColumnSelectPageDown=jd(new o({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:3596,linux:{primary:0}}}));class s extends CS{constructor(){super({id:"cursorMove",precondition:void 0,metadata:nS.metadata})}runCoreEditorCommand(e,t){const i=nS.parse(t);i&&this._runCursorMove(e,t.source,i)}_runCursorMove(e,t,i){e.model.pushStackElement(),e.setCursorStates(t,3,s._move(e,e.getCursorStates(),i)),e.revealPrimaryCursor(t,!0)}static _move(e,t,i){const n=i.select,o=i.value;switch(i.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return iS.simpleMove(e,t,i.direction,n,o,i.unit);case 11:case 13:case 12:case 14:return iS.viewportMove(e,t,i.direction,n,o);default:return null}}}e.CursorMoveImpl=s,e.CursorMove=jd(new s);class r extends CS{constructor(e){super(e),this._staticArgs=e.args}runCoreEditorCommand(e,t){let i=this._staticArgs;-1===this._staticArgs.value&&(i={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:t.pageSize||e.cursorConfig.pageSize}),e.model.pushStackElement(),e.setCursorStates(t.source,3,iS.simpleMove(e,e.getCursorStates(),i.direction,i.select,i.value,i.unit)),e.revealPrimaryCursor(t.source,!0)}}e.CursorLeft=jd(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),e.CursorLeftSelect=jd(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:1039}})),e.CursorRight=jd(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),e.CursorRightSelect=jd(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:1041}})),e.CursorUp=jd(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),e.CursorUpSelect=jd(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),e.CursorPageUp=jd(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:11}})),e.CursorPageUpSelect=jd(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:1035}})),e.CursorDown=jd(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),e.CursorDownSelect=jd(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),e.CursorPageDown=jd(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:12}})),e.CursorPageDownSelect=jd(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:1036}})),e.CreateCursor=jd(new class extends CS{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;let i;i=t.wholeLine?iS.line(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition):iS.moveTo(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition);const n=e.getCursorStates();if(n.length>1){const o=i.modelState?i.modelState.position:null,s=i.viewState?i.viewState.position:null;for(let i=0,r=n.length;i<r;i++){const r=n[i];if((!o||r.modelState.selection.containsPosition(o))&&(!s||r.viewState.selection.containsPosition(s)))return n.splice(i,1),e.model.pushStackElement(),void e.setCursorStates(t.source,3,n)}}n.push(i),e.model.pushStackElement(),e.setCursorStates(t.source,3,n)}}),e.LastCursorMoveToSelect=jd(new class extends CS{constructor(){super({id:"_lastCursorMoveToSelect",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0);o[i]=iS.moveTo(e,n[i],!0,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}});class a extends CS{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,iS.moveToBeginningOfLine(e,e.getCursorStates(),this._inSelectionMode)),e.revealPrimaryCursor(t.source,!0)}}e.CursorHome=jd(new a({inSelectionMode:!1,id:"cursorHome",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:14,mac:{primary:14,secondary:[2063]}}})),e.CursorHomeSelect=jd(new a({inSelectionMode:!0,id:"cursorHomeSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:1038,mac:{primary:1038,secondary:[3087]}}}));class l extends CS{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,this._exec(e.getCursorStates())),e.revealPrimaryCursor(t.source,!0)}_exec(e){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i],o=n.modelState.position.lineNumber;t[i]=Fy.fromModelState(n.modelState.move(this._inSelectionMode,o,1,0))}return t}}e.CursorLineStart=jd(new l({inSelectionMode:!1,id:"cursorLineStart",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:0,mac:{primary:287}}})),e.CursorLineStartSelect=jd(new l({inSelectionMode:!0,id:"cursorLineStartSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:0,mac:{primary:1311}}}));class h extends CS{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,iS.moveToEndOfLine(e,e.getCursorStates(),this._inSelectionMode,t.sticky||!1)),e.revealPrimaryCursor(t.source,!0)}}e.CursorEnd=jd(new h({inSelectionMode:!1,id:"cursorEnd",precondition:void 0,kbOpts:{args:{sticky:!1},weight:0,kbExpr:nc.textInputFocus,primary:13,mac:{primary:13,secondary:[2065]}},metadata:{description:"Go to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:me(0,"Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}})),e.CursorEndSelect=jd(new h({inSelectionMode:!0,id:"cursorEndSelect",precondition:void 0,kbOpts:{args:{sticky:!1},weight:0,kbExpr:nc.textInputFocus,primary:1037,mac:{primary:1037,secondary:[3089]}},metadata:{description:"Select to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:me(0,"Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}}));class d extends CS{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,this._exec(e,e.getCursorStates())),e.revealPrimaryCursor(t.source,!0)}_exec(e,t){const i=[];for(let n=0,o=t.length;n<o;n++){const o=t[n],s=o.modelState.position.lineNumber,r=e.model.getLineMaxColumn(s);i[n]=Fy.fromModelState(o.modelState.move(this._inSelectionMode,s,r,0))}return i}}e.CursorLineEnd=jd(new d({inSelectionMode:!1,id:"cursorLineEnd",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:0,mac:{primary:291}}})),e.CursorLineEndSelect=jd(new d({inSelectionMode:!0,id:"cursorLineEndSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:0,mac:{primary:1315}}}));class c extends CS{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,iS.moveToBeginningOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealPrimaryCursor(t.source,!0)}}e.CursorTop=jd(new c({inSelectionMode:!1,id:"cursorTop",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:2062,mac:{primary:2064}}})),e.CursorTopSelect=jd(new c({inSelectionMode:!0,id:"cursorTopSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:3086,mac:{primary:3088}}}));class u extends CS{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,iS.moveToEndOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealPrimaryCursor(t.source,!0)}}e.CursorBottom=jd(new u({inSelectionMode:!1,id:"cursorBottom",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:2061,mac:{primary:2066}}})),e.CursorBottomSelect=jd(new u({inSelectionMode:!0,id:"cursorBottomSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:3085,mac:{primary:3090}}}));class g extends CS{constructor(){super({id:"editorScroll",precondition:void 0,metadata:yS.metadata})}determineScrollMethod(e){return[6].includes(e.unit)&&[4,2].includes(e.direction)?this._runHorizontalEditorScroll.bind(this):[1,2,3,4,5,6].includes(e.unit)&&[1,3].includes(e.direction)?this._runVerticalEditorScroll.bind(this):null}runCoreEditorCommand(e,t){const i=yS.parse(t);if(!i)return;const n=this.determineScrollMethod(i);n&&n(e,t.source,i)}_runVerticalEditorScroll(e,t,i){const n=this._computeDesiredScrollTop(e,i);if(i.revealCursor){const o=e.getCompletelyVisibleViewRangeAtScrollTop(n);e.setCursorStates(t,3,[iS.findPositionInViewportIfOutside(e,e.getPrimaryCursorState(),o,i.select)])}e.viewLayout.setScrollPosition({scrollTop:n},0)}_computeDesiredScrollTop(e,t){if(1===t.unit){const i=e.viewLayout.getFutureViewport(),n=e.getCompletelyVisibleViewRangeAtScrollTop(i.top),o=e.coordinatesConverter.convertViewRangeToModelRange(n);let s;s=1===t.direction?Math.max(1,o.startLineNumber-t.value):Math.min(e.model.getLineCount(),o.startLineNumber+t.value);const r=e.coordinatesConverter.convertModelPositionToViewPosition(new ch(s,1));return e.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber)}if(5===t.unit){let i=0;return 3===t.direction&&(i=e.model.getLineCount()-e.cursorConfig.pageSize),e.viewLayout.getVerticalOffsetForLineNumber(i)}let i;i=3===t.unit?e.cursorConfig.pageSize*t.value:4===t.unit?Math.round(e.cursorConfig.pageSize/2)*t.value:t.value;const n=(1===t.direction?-1:1)*i;return e.viewLayout.getCurrentScrollTop()+n*e.cursorConfig.lineHeight}_runHorizontalEditorScroll(e,t,i){const n=this._computeDesiredScrollLeft(e,i);e.viewLayout.setScrollPosition({scrollLeft:n},0)}_computeDesiredScrollLeft(e,t){const i=(4===t.direction?-1:1)*t.value;return e.viewLayout.getCurrentScrollLeft()+i*e.cursorConfig.typicalHalfwidthCharacterWidth}}e.EditorScrollImpl=g,e.EditorScroll=jd(new g),e.ScrollLineUp=jd(new class extends CS{constructor(){super({id:"scrollLineUp",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:2064,mac:{primary:267}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:yS.RawDirection.Up,by:yS.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollPageUp=jd(new class extends CS{constructor(){super({id:"scrollPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:2059,win:{primary:523},linux:{primary:523}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:yS.RawDirection.Up,by:yS.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollEditorTop=jd(new class extends CS{constructor(){super({id:"scrollEditorTop",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:yS.RawDirection.Up,by:yS.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollLineDown=jd(new class extends CS{constructor(){super({id:"scrollLineDown",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:2066,mac:{primary:268}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:yS.RawDirection.Down,by:yS.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollPageDown=jd(new class extends CS{constructor(){super({id:"scrollPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:2060,win:{primary:524},linux:{primary:524}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:yS.RawDirection.Down,by:yS.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollEditorBottom=jd(new class extends CS{constructor(){super({id:"scrollEditorBottom",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:yS.RawDirection.Down,by:yS.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollLeft=jd(new class extends CS{constructor(){super({id:"scrollLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:yS.RawDirection.Left,by:yS.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollRight=jd(new class extends CS{constructor(){super({id:"scrollRight",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:yS.RawDirection.Right,by:yS.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:i.source})}});class p extends CS{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[iS.word(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position)]),2!==t.revealType&&e.revealPrimaryCursor(t.source,!0,!0))}}e.WordSelect=jd(new p({inSelectionMode:!1,id:"_wordSelect",precondition:void 0})),e.WordSelectDrag=jd(new p({inSelectionMode:!0,id:"_wordSelectDrag",precondition:void 0})),e.LastCursorWordSelect=jd(new class extends CS{constructor(){super({id:"lastCursorWordSelect",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0),s=n[i];o[i]=iS.word(e,s,s.modelState.hasSelection(),t.position),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}});class m extends CS{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[iS.line(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)]),2!==t.revealType&&e.revealPrimaryCursor(t.source,!1,!0))}}e.LineSelect=jd(new m({inSelectionMode:!1,id:"_lineSelect",precondition:void 0})),e.LineSelectDrag=jd(new m({inSelectionMode:!0,id:"_lineSelectDrag",precondition:void 0}));class f extends CS{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){if(!t.position)return;const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0);o[i]=iS.line(e,n[i],this._inSelectionMode,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}}e.LastCursorLineSelect=jd(new f({inSelectionMode:!1,id:"lastCursorLineSelect",precondition:void 0})),e.LastCursorLineSelectDrag=jd(new f({inSelectionMode:!0,id:"lastCursorLineSelectDrag",precondition:void 0})),e.CancelSelection=jd(new class extends CS{constructor(){super({id:"cancelSelection",precondition:nc.hasNonEmptySelection,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[iS.cancelSelection(e,e.getPrimaryCursorState())]),e.revealPrimaryCursor(t.source,!0)}}),e.RemoveSecondaryCursors=jd(new class extends CS{constructor(){super({id:"removeSecondaryCursors",precondition:nc.hasMultipleSelections,kbOpts:{weight:1,kbExpr:nc.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[e.getPrimaryCursorState()]),e.revealPrimaryCursor(t.source,!0),Yr(me(0,"Removed secondary cursors"))}}),e.RevealLine=jd(new class extends CS{constructor(){super({id:"revealLine",precondition:void 0,metadata:SS.metadata})}runCoreEditorCommand(e,t){const i=t,n=i.lineNumber||0;let o="number"==typeof n?n+1:parseInt(n)+1;o<1&&(o=1);const s=e.model.getLineCount();o>s&&(o=s);const r=new tc(o,1,o,e.model.getLineMaxColumn(o));let a=0;if(i.at)switch(i.at){case SS.RawAtArgument.Top:a=3;break;case SS.RawAtArgument.Center:a=1;break;case SS.RawAtArgument.Bottom:a=4}const l=e.coordinatesConverter.convertModelRangeToViewRange(r);e.revealRange(t.source,!1,l,a,0)}}),e.SelectAll=new class extends LS{constructor(){super(ec)}runDOMCommand(e){re&&(e.focus(),e.select()),e.ownerDocument.execCommand("selectAll")}runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i)}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates("keyboard",3,[iS.selectAll(e,e.getPrimaryCursorState())])}},e.SetSelection=jd(new class extends CS{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(e,t){t.selection&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[Fy.fromModelSelection(t.selection)]))}})}(kS||(kS={}));const xS=Bh.and(nc.textInputFocus,nc.columnSelection);function DS(e,t){_d.registerKeybindingRule({id:e,primary:t,when:xS,weight:1})}function ES(e){return e.register(),e}var NS,IS;DS(kS.CursorColumnSelectLeft.id,1039),DS(kS.CursorColumnSelectRight.id,1041),DS(kS.CursorColumnSelectUp.id,1040),DS(kS.CursorColumnSelectPageUp.id,1035),DS(kS.CursorColumnSelectDown.id,1042),DS(kS.CursorColumnSelectPageDown.id,1036),function(e){class t extends Vd{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditingCommand(t,n,i||{})}}e.CoreEditingCommand=t,e.LineBreakInsert=jd(new class extends t{constructor(){super({id:"lineBreakInsert",precondition:nc.writable,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,pS.lineBreakInsert(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection))))}}),e.Outdent=jd(new class extends t{constructor(){super({id:"outdent",precondition:nc.writable,kbOpts:{weight:0,kbExpr:Bh.and(nc.editorTextFocus,nc.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,pS.outdent(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)))),e.pushUndoStop()}}),e.Tab=jd(new class extends t{constructor(){super({id:"tab",precondition:nc.writable,kbOpts:{weight:0,kbExpr:Bh.and(nc.editorTextFocus,nc.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,pS.tab(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)))),e.pushUndoStop()}}),e.DeleteLeft=jd(new class extends t{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(e,t,i){const[n,o]=Xy.deleteLeft(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)),t.getCursorAutoClosedCharacters());n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(2)}}),e.DeleteRight=jd(new class extends t{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(e,t,i){const[n,o]=Xy.deleteRight(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)));n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(3)}}),e.Undo=new class extends LS{constructor(){super(Xd)}runDOMCommand(e){e.ownerDocument.execCommand("undo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(90))return t.getModel().undo()}},e.Redo=new class extends LS{constructor(){super(Jd)}runDOMCommand(e){e.ownerDocument.execCommand("redo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(90))return t.getModel().redo()}}}(NS||(NS={}));class MS extends Fd{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){const i=e.get(dh).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function TS(e,t){ES(new MS("default:"+e,e)),ES(new MS(e,e,t))}TS("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]}),TS("replacePreviousChar"),TS("compositionType"),TS("compositionStart"),TS("compositionEnd"),TS("paste"),TS("cut");class AS{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,o=this._selection.endColumn;if((!this._isMovingLeft||1!==n)&&(this._isMovingLeft||o!==e.getLineMaxColumn(i)))if(this._isMovingLeft){const s=new tc(i,n-1,i,n),r=e.getValueInRange(s);t.addEditOperation(s,null),t.addEditOperation(new tc(i,o,i,o),r)}else{const s=new tc(i,o,i,o+1),r=e.getValueInRange(s);t.addEditOperation(s,null),t.addEditOperation(new tc(i,n,i,n),r)}}computeCursorState(e,t){return this._isMovingLeft?new ic(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new ic(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class RS extends zd{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const e of n)i.push(new AS(e,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}qd(class extends RS{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:me(0,"Move Selected Text Left"),alias:"Move Selected Text Left",precondition:nc.writable})}}),qd(class extends RS{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:me(0,"Move Selected Text Right"),alias:"Move Selected Text Right",precondition:nc.writable})}}),qd(class extends zd{constructor(){super({id:"editor.action.transposeLetters",label:me(0,"Transpose Letters"),alias:"Transpose Letters",precondition:nc.writable,kbOpts:{kbExpr:nc.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],o=t.getSelections();for(const e of o){if(!e.isEmpty())continue;const t=e.startLineNumber,o=e.startColumn,s=i.getLineMaxColumn(t);if(1===t&&(1===o||2===o&&2===s))continue;const r=o===s?e.getPosition():Qy.rightPosition(i,e.getPosition().lineNumber,e.getPosition().column),a=Qy.leftPosition(i,r),l=Qy.leftPosition(i,a),h=i.getValueInRange(tc.fromPositions(l,a)),d=i.getValueInRange(tc.fromPositions(a,r)),c=tc.fromPositions(l,r);n.push(new Ky(c,d+h))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}});class OS{get event(){return this.emitter.event}constructor(e,t,i){const n=e=>this.emitter.fire(e);this.emitter=new q({onWillAddFirstListener:()=>e.addEventListener(t,n,i),onDidRemoveLastListener:()=>e.removeEventListener(t,n,i)})}dispose(){this.emitter.dispose()}}!function(e){const t={total:0,min:Number.MAX_VALUE,max:0},i={...t},n={...t},o={...t};let s=0;const r={keydown:0,input:0,render:0};function a(){1===r.keydown&&(performance.mark("keydown/end"),r.keydown=2)}function l(){performance.mark("input/start"),r.input=1,c()}function h(){1===r.input&&(performance.mark("input/end"),r.input=2)}function d(){1===r.render&&(performance.mark("render/end"),r.render=2)}function c(){setTimeout(u)}function u(){2===r.keydown&&2===r.input&&2===r.render&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),g("keydown",t),g("input",i),g("render",n),g("inputlatency",o),s++,performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),r.keydown=0,r.input=0,r.render=0)}function g(e,t){const i=performance.getEntriesByName(e)[0].duration;t.total+=i,t.min=Math.min(t.min,i),t.max=Math.max(t.max,i)}function p(e){return{average:e.total/s,max:e.max,min:e.min}}function m(e){e.total=0,e.min=Number.MAX_VALUE,e.max=0}e.onKeyDown=function(){u(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),r.keydown=1,queueMicrotask(a)},e.onBeforeInput=l,e.onInput=function(){0===r.input&&l(),queueMicrotask(h)},e.onKeyUp=function(){u()},e.onSelectionChange=function(){u()},e.onRenderStart=function(){2===r.keydown&&2===r.input&&0===r.render&&(performance.mark("render/start"),r.render=1,queueMicrotask(d),c())},e.getAndClearMeasurements=function(){if(0===s)return;const e={keydown:p(t),input:p(i),render:p(n),total:p(o),sampleCount:s};return m(t),m(i),m(n),m(o),s=0,e}}(IS||(IS={}));class PS{constructor(e,t,i,n,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=n,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),n=e.getSelectionStart(),o=e.getSelectionEnd();let s;return t&&i.substring(0,n)===t.value.substring(0,t.selectionStart)&&(s=t.newlineCountBeforeSelection),new PS(i,n,o,null,s)}collapseSelection(){return this.selectionStart===this.value.length?this:new PS(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var t,i,n,o,s,r,a,l;if(e<=this.selectionStart){const n=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(null!==(i=null===(t=this.selection)||void 0===t?void 0:t.getStartPosition())&&void 0!==i?i:null,n,-1)}if(e>=this.selectionEnd){const t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(null!==(o=null===(n=this.selection)||void 0===n?void 0:n.getEndPosition())&&void 0!==o?o:null,t,1)}const h=this.value.substring(this.selectionStart,e);if(-1===h.indexOf(String.fromCharCode(8230)))return this._finishDeduceEditorPosition(null!==(r=null===(s=this.selection)||void 0===s?void 0:s.getStartPosition())&&void 0!==r?r:null,h,1);const d=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(null!==(l=null===(a=this.selection)||void 0===a?void 0:a.getEndPosition())&&void 0!==l?l:null,d,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,o=-1;for(;-1!==(o=t.indexOf("\n",o+1));)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const n=Math.min(En(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(Nn(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd),s=(e.value.substring(n,e.value.length-o),t.value.substring(n,t.value.length-o)),r=e.selectionStart-n,a=e.selectionEnd-n;if(t.selectionStart-n===t.selectionEnd-n){return{text:s,replacePrevCharCnt:e.selectionStart-n,replaceNextCharCnt:0,positionDelta:0}}return{text:s,replacePrevCharCnt:a-r,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(En(e.value,t.value),e.selectionEnd),n=Math.min(Nn(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-n),s=t.value.substring(i,t.value.length-n),r=(e.selectionStart,e.selectionEnd-i),a=(t.selectionStart,t.selectionEnd-i);return{text:s,replacePrevCharCnt:r,replaceNextCharCnt:o.length-r,positionDelta:a-s.length}}}PS.EMPTY=new PS("",0,0,null,void 0);class FS{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t;return new tc(i+1,1,i+t+1,1)}static fromEditorSelection(e,t,i,n){const o=500,s=FS._getPageOfLine(t.startLineNumber,i),r=FS._getRangeForPage(s,i),a=FS._getPageOfLine(t.endLineNumber,i),l=FS._getRangeForPage(a,i);let h=r.intersectRanges(new tc(1,1,t.startLineNumber,t.startColumn));if(n&&e.getValueLengthInRange(h,1)>o){const t=e.modifyPosition(h.getEndPosition(),-500);h=tc.fromPositions(t,h.getEndPosition())}const d=e.getValueInRange(h,1),c=e.getLineCount(),u=e.getLineMaxColumn(c);let g=l.intersectRanges(new tc(t.endLineNumber,t.endColumn,c,u));if(n&&e.getValueLengthInRange(g,1)>o){const t=e.modifyPosition(g.getStartPosition(),o);g=tc.fromPositions(g.getStartPosition(),t)}const p=e.getValueInRange(g,1);let m;if(s===a||s+1===a)m=e.getValueInRange(t,1);else{const i=r.intersectRanges(t),n=l.intersectRanges(t);m=e.getValueInRange(i,1)+String.fromCharCode(8230)+e.getValueInRange(n,1)}return n&&m.length>1e3&&(m=m.substring(0,o)+String.fromCharCode(8230)+m.substring(m.length-o,m.length)),new PS(d+m+p,d.length,d.length+m.length,t,h.endLineNumber-h.startLineNumber)}}const BS=hh("accessibilityService"),WS=new od("accessibilityModeEnabled",!1),VS=hh("accessibleNotificationService");var zS,HS=function(e,t){return function(i,n){t(i,n,e)}};!function(e){e.Tap="-monaco-textarea-synthetic-tap"}(zS||(zS={}));const US={forceCopyWithSyntaxHighlighting:!1};class KS{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}}KS.INSTANCE=new KS;class jS{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){const t={text:e=e||"",replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}let qS=class extends T{get textAreaState(){return this._textAreaState}constructor(e,t,i,n,o,s){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._accessibilityService=o,this._logService=s,this._onFocus=this._register(new q),this.onFocus=this._onFocus.event,this._onBlur=this._register(new q),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new q),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new q),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new q),this.onCut=this._onCut.event,this._onPaste=this._register(new q),this.onPaste=this._onPaste.event,this._onType=this._register(new q),this.onType=this._onType.event,this._onCompositionStart=this._register(new q),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new q),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new q),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new q),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new A),this._asyncTriggerCut=this._register(new Zt((()=>this._onCut.fire()),0)),this._textAreaState=PS.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(z.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,(()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new Zt((()=>this.writeNativeTextAreaContent("asyncFocusGain")),0)):this._asyncFocusGainWriteScreenReaderContent.clear()}))),this._hasFocus=!1,this._currentComposition=null;let r=null;this._register(this._textArea.onKeyDown((e=>{const t=new Dt(e);(114===t.keyCode||this._currentComposition&&1===t.keyCode)&&t.stopPropagation(),t.equals(9)&&t.preventDefault(),r=t,this._onKeyDown.fire(t)}))),this._register(this._textArea.onKeyUp((e=>{const t=new Dt(e);this._onKeyUp.fire(t)}))),this._register(this._textArea.onCompositionStart((e=>{const t=new jS;if(this._currentComposition)this._currentComposition=t;else{if(this._currentComposition=t,2===this._OS&&r&&r.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===e.data&&("ArrowRight"===r.code||"ArrowLeft"===r.code))return t.handleCompositionUpdate("x"),void this._onCompositionStart.fire({data:e.data});this._browser.isAndroid,this._onCompositionStart.fire({data:e.data})}}))),this._register(this._textArea.onCompositionUpdate((e=>{const t=this._currentComposition;if(!t)return;if(this._browser.isAndroid){const t=PS.readFromTextArea(this._textArea,this._textAreaState),i=PS.deduceAndroidCompositionInput(this._textAreaState,t);return this._textAreaState=t,this._onType.fire(i),void this._onCompositionUpdate.fire(e)}const i=t.handleCompositionUpdate(e.data);this._textAreaState=PS.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(i),this._onCompositionUpdate.fire(e)}))),this._register(this._textArea.onCompositionEnd((e=>{const t=this._currentComposition;if(!t)return;if(this._currentComposition=null,this._browser.isAndroid){const e=PS.readFromTextArea(this._textArea,this._textAreaState),t=PS.deduceAndroidCompositionInput(this._textAreaState,e);return this._textAreaState=e,this._onType.fire(t),void this._onCompositionEnd.fire()}const i=t.handleCompositionUpdate(e.data);this._textAreaState=PS.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(i),this._onCompositionEnd.fire()}))),this._register(this._textArea.onInput((e=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const t=PS.readFromTextArea(this._textArea,this._textAreaState),i=PS.deduceInput(this._textAreaState,t,2===this._OS);(0!==i.replacePrevCharCnt||1!==i.text.length||!In(i.text.charCodeAt(0))&&127!==i.text.charCodeAt(0))&&(this._textAreaState=t,""===i.text&&0===i.replacePrevCharCnt&&0===i.replaceNextCharCnt&&0===i.positionDelta||this._onType.fire(i))}))),this._register(this._textArea.onCut((e=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(e),this._asyncTriggerCut.schedule()}))),this._register(this._textArea.onCopy((e=>{this._ensureClipboardGetsEditorSelection(e)}))),this._register(this._textArea.onPaste((e=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),e.preventDefault(),!e.clipboardData)return;let[t,i]=$S.getTextData(e.clipboardData);t&&(i=i||KS.INSTANCE.get(t),this._onPaste.fire({text:t,metadata:i}))}))),this._register(this._textArea.onFocus((()=>{const e=this._hasFocus;this._setHasFocus(!0),this._accessibilityService.isScreenReaderOptimized()&&this._browser.isSafari&&!e&&this._hasFocus&&(this._asyncFocusGainWriteScreenReaderContent.value||(this._asyncFocusGainWriteScreenReaderContent.value=new Zt((()=>this.writeNativeTextAreaContent("asyncFocusGain")),0)),this._asyncFocusGainWriteScreenReaderContent.value.schedule())}))),this._register(this._textArea.onBlur((()=>{this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)}))),this._register(this._textArea.onSyntheticTap((()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())})))}_installSelectionChangeListener(){let e=0;return bs(this._textArea.ownerDocument,"selectionchange",(t=>{if(IS.onSelectionChange(),!this._hasFocus)return;if(this._currentComposition)return;if(!this._browser.isChrome)return;const i=Date.now(),n=i-e;if(e=i,n<5)return;const o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100)return;if(!this._textAreaState.selection)return;const s=this._textArea.getValue();if(this._textAreaState.value!==s)return;const r=this._textArea.getSelectionStart(),a=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===r&&this._textAreaState.selectionEnd===a)return;const l=this._textAreaState.deduceEditorPosition(r),h=this._host.deduceModelPosition(l[0],l[1],l[2]),d=this._textAreaState.deduceEditorPosition(a),c=this._host.deduceModelPosition(d[0],d[1],d[2]),u=new ic(h.lineNumber,h.column,c.lineNumber,c.column);this._onSelectionChangeRequest.fire(u)}))}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeNativeTextAreaContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeNativeTextAreaContent(e){!this._accessibilityService.isScreenReaderOptimized()&&"render"===e||this._currentComposition||(this._logService.trace(`writeTextAreaState(reason: ${e})`),this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent()))}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};KS.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,"\n"):t.text,i),e.preventDefault(),e.clipboardData&&$S.setTextData(e.clipboardData,t.text,t.html,i)}};qS=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([HS(4,BS),HS(5,Md)],qS);const $S={getTextData(e){const t=e.getData(yg.text);let i=null;const n=e.getData("vscode-editor-data");if("string"==typeof n)try{i=JSON.parse(n),1!==i.version&&(i=null)}catch(e){}return 0===t.length&&null===i&&e.files.length>0?[Array.prototype.slice.call(e.files,0).map((e=>e.name)).join("\n"),null]:[t,i]},setTextData(e,t,i,n){e.setData(yg.text,t),"string"==typeof i&&e.setData("text/html",i),e.setData("vscode-editor-data",JSON.stringify(n))}};class GS extends T{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new OS(this._actual,"keydown")).event,this.onKeyUp=this._register(new OS(this._actual,"keyup")).event,this.onCompositionStart=this._register(new OS(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new OS(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new OS(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new OS(this._actual,"beforeinput")).event,this.onInput=this._register(new OS(this._actual,"input")).event,this.onCut=this._register(new OS(this._actual,"cut")).event,this.onCopy=this._register(new OS(this._actual,"copy")).event,this.onPaste=this._register(new OS(this._actual,"paste")).event,this.onFocus=this._register(new OS(this._actual,"focus")).event,this.onBlur=this._register(new OS(this._actual,"blur")).event,this._onSyntheticTap=this._register(new q),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown((()=>IS.onKeyDown()))),this._register(this.onBeforeInput((()=>IS.onBeforeInput()))),this._register(this.onInput((()=>IS.onInput()))),this._register(this.onKeyUp((()=>IS.onKeyUp()))),this._register(bs(this._actual,zS.Tap,(()=>this._onSyntheticTap.fire())))}hasFocus(){const e=Hs(this._actual);return e?e.activeElement===this._actual:!!this._actual.isConnected&&this._actual.ownerDocument.activeElement===this._actual}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return"backward"===this._actual.selectionDirection?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return"backward"===this._actual.selectionDirection?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const n=this._actual;let o=null;const s=Hs(n);o=s?s.activeElement:n.ownerDocument.activeElement;const r=as(o),a=o===n,l=n.selectionStart,h=n.selectionEnd;if(a&&l===t&&h===i)re&&r.parent!==r&&n.focus();else{if(a)return this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),void(re&&r.parent!==r&&n.focus());try{const e=function(e){const t=[];for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)t[i]=e.scrollTop,e=e.parentNode;return t}(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),function(e,t){for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)e.scrollTop!==t[i]&&(e.scrollTop=t[i]),e=e.parentNode}(n,e)}catch(e){}}}}const ZS=hh("clipboardService"),YS="9_cutcopypaste",QS=He||document.queryCommandSupported("cut"),XS=He||document.queryCommandSupported("copy"),JS=void 0!==navigator.clipboard&&!re||document.queryCommandSupported("paste");function ek(e){return e.register(),e}const tk=QS?ek(new Bd({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:He?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:yd.MenubarEditMenu,group:"2_ccp",title:me(0,"Cu&&t"),order:1},{menuId:yd.EditorContext,group:YS,title:me(0,"Cut"),when:nc.writable,order:1},{menuId:yd.CommandPalette,group:"",title:me(0,"Cut"),order:1},{menuId:yd.SimpleEditorContext,group:YS,title:me(0,"Cut"),when:nc.writable,order:1}]})):void 0,ik=XS?ek(new Bd({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:He?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:yd.MenubarEditMenu,group:"2_ccp",title:me(0,"&&Copy"),order:2},{menuId:yd.EditorContext,group:YS,title:me(0,"Copy"),order:2},{menuId:yd.CommandPalette,group:"",title:me(0,"Copy"),order:1},{menuId:yd.SimpleEditorContext,group:YS,title:me(0,"Copy"),order:2}]})):void 0;Ld.appendMenuItem(yd.MenubarEditMenu,{submenu:yd.MenubarCopy,title:{value:me(0,"Copy As"),original:"Copy As"},group:"2_ccp",order:3}),Ld.appendMenuItem(yd.EditorContext,{submenu:yd.EditorContextCopy,title:{value:me(0,"Copy As"),original:"Copy As"},group:YS,order:3}),Ld.appendMenuItem(yd.EditorContext,{submenu:yd.EditorContextShare,title:{value:me(0,"Share"),original:"Share"},group:"11_share",order:-1,when:Bh.and(Bh.notEquals("resourceScheme","output"),nc.editorTextFocus)}),Ld.appendMenuItem(yd.EditorTitleContext,{submenu:yd.EditorTitleContextShare,title:{value:me(0,"Share"),original:"Share"},group:"11_share",order:-1}),Ld.appendMenuItem(yd.ExplorerContext,{submenu:yd.ExplorerContextShare,title:{value:me(0,"Share"),original:"Share"},group:"11_share",order:-1});const nk=JS?ek(new Bd({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:He?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:yd.MenubarEditMenu,group:"2_ccp",title:me(0,"&&Paste"),order:4},{menuId:yd.EditorContext,group:YS,title:me(0,"Paste"),when:nc.writable,order:4},{menuId:yd.CommandPalette,group:"",title:me(0,"Paste"),order:1},{menuId:yd.SimpleEditorContext,group:YS,title:me(0,"Paste"),when:nc.writable,order:4}]})):void 0;function ok(e,t){e&&(e.addImplementation(1e4,"code-editor",((e,i)=>{const n=e.get(dh).getFocusedCodeEditor();if(n&&n.hasTextFocus()){const e=n.getOption(37),i=n.getSelection();return i&&i.isEmpty()&&!e||n.getContainerDomNode().ownerDocument.execCommand(t),!0}return!1})),e.addImplementation(0,"generic-dom",((e,i)=>(js().execCommand(t),!0))))}ok(tk,"cut"),ok(ik,"copy"),nk&&(nk.addImplementation(1e4,"code-editor",((e,t)=>{const i=e.get(dh),n=e.get(ZS),o=i.getFocusedCodeEditor();return!(!o||!o.hasTextFocus())&&(!(!o.getContainerDomNode().ownerDocument.execCommand("paste")&&Ue)||(async()=>{const e=await n.readText();if(""!==e){const t=KS.INSTANCE.get(e);let i=!1,n=null,s=null;t&&(i=o.getOption(37)&&!!t.isFromEmptySelection,n=void 0!==t.multicursorText?t.multicursorText:null,s=t.mode),o.trigger("keyboard","paste",{text:e,pasteOnNewLine:i,multicursorText:n,mode:s})}})())})),nk.addImplementation(0,"generic-dom",((e,t)=>(js().execCommand("paste"),!0)))),XS&&qd(class extends zd{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:me(0,"Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:nc.textInputFocus,primary:0,weight:100}})}run(e,t){t.hasModel()&&(!t.getOption(37)&&t.getSelection().isEmpty()||(US.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),US.forceCopyWithSyntaxHighlighting=!1))}});const sk={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0};class rk{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class ak{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class lk{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return dk(e,t)}compute(e,t,i){return i}}class hk{constructor(e,t){this.newValue=e,this.didChange=t}}function dk(e,t){if("object"!=typeof e||"object"!=typeof t||!e||!t)return new hk(t,e!==t);if(Array.isArray(e)||Array.isArray(t)){const i=Array.isArray(e)&&Array.isArray(t)&&Ic(e,t);return new hk(t,!i)}let i=!1;for(const n in t)if(t.hasOwnProperty(n)){const o=dk(e[n],t[n]);o.didChange&&(e[n]=o.newValue,i=!0)}return new hk(e,i)}class ck{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return dk(e,t)}validate(e){return this.defaultValue}}class uk{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return dk(e,t)}validate(e){return void 0===e?this.defaultValue:e}compute(e,t,i){return i}}function gk(e,t){return void 0===e?t:"false"!==e&&Boolean(e)}class pk extends uk{constructor(e,t,i,n=void 0){void 0!==n&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return gk(e,this.defaultValue)}}function mk(e,t,i,n){if(void 0===e)return t;let o=parseInt(e,10);return isNaN(o)?t:(o=Math.max(i,o),o=Math.min(n,o),0|o)}class fk extends uk{static clampedInt(e,t,i,n){return mk(e,t,i,n)}constructor(e,t,i,n,o,s=void 0){void 0!==s&&(s.type="integer",s.default=i,s.minimum=n,s.maximum=o),super(e,t,i,s),this.minimum=n,this.maximum=o}validate(e){return fk.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function _k(e,t,i,n){if(void 0===e)return t;const o=vk.float(e,t);return vk.clamp(o,i,n)}class vk extends uk{static clamp(e,t,i){return e<t?t:e>i?i:e}static float(e,t){if("number"==typeof e)return e;if(void 0===e)return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,n,o){void 0!==o&&(o.type="number",o.default=i),super(e,t,i,o),this.validationFn=n}validate(e){return this.validationFn(vk.float(e,this.defaultValue))}}class bk extends uk{static string(e,t){return"string"!=typeof e?t:e}constructor(e,t,i,n=void 0){void 0!==n&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return bk.string(e,this.defaultValue)}}function wk(e,t,i,n){return"string"!=typeof e?t:n&&e in n?n[e]:-1===i.indexOf(e)?t:e}class Ck extends uk{constructor(e,t,i,n,o=void 0){void 0!==o&&(o.type="string",o.enum=n,o.default=i),super(e,t,i,o),this._allowedValues=n}validate(e){return wk(e,this.defaultValue,this._allowedValues)}}class yk extends lk{constructor(e,t,i,n,o,s,r=void 0){void 0!==r&&(r.type="string",r.enum=o,r.default=n),super(e,t,i,r),this._allowedValues=o,this._convert=s}validate(e){return"string"!=typeof e||-1===this._allowedValues.indexOf(e)?this.defaultValue:this._convert(e)}}var Sk,kk;!function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"}(Sk||(Sk={}));class Lk extends lk{constructor(){super(51,"fontLigatures",Lk.OFF,{anyOf:[{type:"boolean",description:me(0,"Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:me(0,"Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:me(0,"Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return void 0===e?this.defaultValue:"string"==typeof e?"false"===e?Lk.OFF:"true"===e?Lk.ON:e:Boolean(e)?Lk.ON:Lk.OFF}}Lk.OFF='"liga" off, "calt" off',Lk.ON='"liga" on, "calt" on';class xk extends lk{constructor(){super(54,"fontVariations",xk.OFF,{anyOf:[{type:"boolean",description:me(0,"Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:me(0,"Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:me(0,"Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return void 0===e?this.defaultValue:"string"==typeof e?"false"===e?xk.OFF:"true"===e?xk.TRANSLATE:e:Boolean(e)?xk.TRANSLATE:xk.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}xk.OFF="normal",xk.TRANSLATE="translate";class Dk extends lk{constructor(){super(53,"fontWeight",Vk.fontWeight,{anyOf:[{type:"number",minimum:Dk.MINIMUM_VALUE,maximum:Dk.MAXIMUM_VALUE,errorMessage:me(0,'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:Dk.SUGGESTION_VALUES}],default:Vk.fontWeight,description:me(0,'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return"normal"===e||"bold"===e?e:String(fk.clampedInt(e,Vk.fontWeight,Dk.MINIMUM_VALUE,Dk.MAXIMUM_VALUE))}}Dk.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],Dk.MINIMUM_VALUE=1,Dk.MAXIMUM_VALUE=1e3;class Ek extends ck{constructor(){super(143)}compute(e,t,i){return Ek.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let n=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(n=Math.max(n,t-1));const o=(i+e.viewLineCount+n)/(e.pixelRatio*e.height);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:n,desiredRatio:o,minimapLineCount:Math.floor(e.viewLineCount/o)}}static _computeMinimapLayout(e,t){const i=e.outerWidth,n=e.outerHeight,o=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(o*n),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:n};const s=t.stableMinimapLayoutInput,r=s&&e.outerHeight===s.outerHeight&&e.lineHeight===s.lineHeight&&e.typicalHalfwidthCharacterWidth===s.typicalHalfwidthCharacterWidth&&e.pixelRatio===s.pixelRatio&&e.scrollBeyondLastLine===s.scrollBeyondLastLine&&e.paddingTop===s.paddingTop&&e.paddingBottom===s.paddingBottom&&e.minimap.enabled===s.minimap.enabled&&e.minimap.side===s.minimap.side&&e.minimap.size===s.minimap.size&&e.minimap.showSlider===s.minimap.showSlider&&e.minimap.renderCharacters===s.minimap.renderCharacters&&e.minimap.maxColumn===s.minimap.maxColumn&&e.minimap.scale===s.minimap.scale&&e.verticalScrollbarWidth===s.verticalScrollbarWidth&&e.isViewportWrapping===s.isViewportWrapping,a=e.lineHeight,l=e.typicalHalfwidthCharacterWidth,h=e.scrollBeyondLastLine,d=e.minimap.renderCharacters;let c=o>=2?Math.round(2*e.minimap.scale):e.minimap.scale;const u=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,m=e.verticalScrollbarWidth,f=e.viewLineCount,_=e.remainingWidth,v=e.isViewportWrapping,b=d?2:3;let w=Math.floor(o*n);const C=w/o;let y=!1,S=!1,k=b*c,L=c/o,x=1;if("fill"===g||"fit"===g){const{typicalViewportLineCount:i,extraLinesBeforeFirstLine:s,extraLinesBeyondLastLine:l,desiredRatio:d,minimapLineCount:u}=Ek.computeContainedMinimapLineCount({viewLineCount:f,scrollBeyondLastLine:h,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:n,lineHeight:a,pixelRatio:o});if(f/u>1)y=!0,S=!0,c=1,k=1,L=c/o;else{let n=!1,h=c+1;if("fit"===g){const e=Math.ceil((s+f+l)*k);v&&r&&_<=t.stableFitRemainingWidth?(n=!0,h=t.stableFitMaxMinimapScale):n=e>w}if("fill"===g||n){y=!0;const n=c;k=Math.min(a*o,Math.max(1,Math.floor(1/d))),v&&r&&_<=t.stableFitRemainingWidth&&(h=t.stableFitMaxMinimapScale),c=Math.min(h,Math.max(1,Math.floor(k/b))),c>n&&(x=Math.min(2,c/n)),L=c/o/x,w=Math.ceil(Math.max(i,s+f+l)*k),v?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=_,t.stableFitMaxMinimapScale=c):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const D=Math.floor(u*L),E=Math.min(D,Math.max(0,Math.floor((_-m-2)*L/(l+L)))+8);let N=Math.floor(o*E);const I=N/o;return N=Math.floor(N*x),{renderMinimap:d?1:2,minimapLeft:"left"===p?0:i-E-m,minimapWidth:E,minimapHeightIsEditorHeight:y,minimapIsSampling:S,minimapScale:c,minimapLineHeight:k,minimapCanvasInnerWidth:N,minimapCanvasInnerHeight:w,minimapCanvasOuterWidth:I,minimapCanvasOuterHeight:C}}static computeLayout(e,t){const i=0|t.outerWidth,n=0|t.outerHeight,o=0|t.lineHeight,s=0|t.lineNumbersDigitCount,r=t.typicalHalfwidthCharacterWidth,a=t.maxDigitWidth,l=t.pixelRatio,h=t.viewLineCount,d=e.get(135),c="inherit"===d?e.get(134):d,u="inherit"===c?e.get(130):c,g=e.get(133),p=t.isDominatedByLongLines,m=e.get(57),f=0!==e.get(67).renderType,_=e.get(68),v=e.get(104),b=e.get(83),w=e.get(72),C=e.get(102),y=C.verticalScrollbarSize,S=C.verticalHasArrows,k=C.arrowSize,L=C.horizontalScrollbarSize,x=e.get(43),D="never"!==e.get(109);let E=e.get(65);x&&D&&(E+=16);let N=0;if(f){const e=Math.max(s,_);N=Math.round(e*a)}let I=0;m&&(I=o*t.glyphMarginDecorationLaneCount);let M=0,T=M+I,A=T+N,R=A+E;const O=i-I-N-E;let P=!1,F=!1,B=-1;"inherit"===c&&p?(P=!0,F=!0):"on"===u||"bounded"===u?F=!0:"wordWrapColumn"===u&&(B=g);const W=Ek._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:o,typicalHalfwidthCharacterWidth:r,pixelRatio:l,scrollBeyondLastLine:v,paddingTop:b.top,paddingBottom:b.bottom,minimap:w,verticalScrollbarWidth:y,viewLineCount:h,remainingWidth:O,isViewportWrapping:F},t.memory||new ak);0!==W.renderMinimap&&0===W.minimapLeft&&(M+=W.minimapWidth,T+=W.minimapWidth,A+=W.minimapWidth,R+=W.minimapWidth);const V=O-W.minimapWidth,z=Math.max(1,Math.floor((V-y-2)/r)),H=S?k:0;return F&&(B=Math.max(1,z),"bounded"===u&&(B=Math.min(B,g))),{width:i,height:n,glyphMarginLeft:M,glyphMarginWidth:I,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:T,lineNumbersWidth:N,decorationsLeft:A,decorationsWidth:E,contentLeft:R,contentWidth:V,minimap:W,viewportColumn:z,isWordWrapMinified:P,isViewportWrapping:F,wrappingColumn:B,verticalScrollbarWidth:y,horizontalScrollbarHeight:L,overviewRuler:{top:H,width:y,height:n-2*H,right:0}}}}function Nk(e){const t=e.get(97);return"editable"===t?e.get(90):"on"!==t}function Ik(e,t){if("string"!=typeof e)return t;switch(e){case"hidden":return 2;case"visible":return 3;default:return 1}}!function(e){e.Off="off",e.OnCode="onCode",e.On="on"}(kk||(kk={}));const Mk="inUntrustedWorkspace",Tk="editor.unicodeHighlight.allowedCharacters",Ak="editor.unicodeHighlight.invisibleCharacters",Rk="editor.unicodeHighlight.nonBasicASCII",Ok="editor.unicodeHighlight.ambiguousCharacters",Pk="editor.unicodeHighlight.includeComments",Fk="editor.unicodeHighlight.includeStrings",Bk="editor.unicodeHighlight.allowedLocales";function Wk(e,t,i){const n=i.indexOf(e);return-1===n?t:i[n]}const Vk={fontFamily:Ve?"Menlo, Monaco, 'Courier New', monospace":ze?"'Droid Sans Mono', 'monospace', monospace":"Consolas, 'Courier New', monospace",fontWeight:"normal",fontSize:Ve?12:14,lineHeight:0,letterSpacing:0},zk=[];function Hk(e){return zk[e.id]=e,e}const Uk={acceptSuggestionOnCommitCharacter:Hk(new pk(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:me(0,"Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:Hk(new Ck(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",me(0,"Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:me(0,"Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:Hk(new class extends lk{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[me(0,"Use platform APIs to detect when a Screen Reader is attached."),me(0,"Optimize for usage with a Screen Reader."),me(0,"Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:me(0,"Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return 0===i?e.accessibilitySupport:i}}),accessibilityPageSize:Hk(new fk(3,"accessibilityPageSize",10,1,1073741824,{description:me(0,"Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),ariaLabel:Hk(new bk(4,"ariaLabel",me(0,"Editor content"))),ariaRequired:Hk(new pk(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:Hk(new pk(8,"screenReaderAnnounceInlineSuggestion",!0,{description:me(0,"Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:Hk(new Ck(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",me(0,"Use language configurations to determine when to autoclose brackets."),me(0,"Autoclose brackets only when the cursor is to the left of whitespace."),""],description:me(0,"Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:Hk(new Ck(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",me(0,"Use language configurations to determine when to autoclose comments."),me(0,"Autoclose comments only when the cursor is to the left of whitespace."),""],description:me(0,"Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:Hk(new Ck(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",me(0,"Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:me(0,"Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:Hk(new Ck(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",me(0,"Type over closing quotes or brackets only if they were automatically inserted."),""],description:me(0,"Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:Hk(new Ck(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",me(0,"Use language configurations to determine when to autoclose quotes."),me(0,"Autoclose quotes only when the cursor is to the left of whitespace."),""],description:me(0,"Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:Hk(new yk(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],(function(e){switch(e){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}),{enumDescriptions:[me(0,"The editor will not insert indentation automatically."),me(0,"The editor will keep the current line's indentation."),me(0,"The editor will keep the current line's indentation and honor language defined brackets."),me(0,"The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),me(0,"The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:me(0,"Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:Hk(new pk(13,"automaticLayout",!1)),autoSurround:Hk(new Ck(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[me(0,"Use language configurations to determine when to automatically surround selections."),me(0,"Surround with quotes but not brackets."),me(0,"Surround with brackets but not quotes."),""],description:me(0,"Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:Hk(new class extends lk{constructor(){const e={enabled:Cu.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:Cu.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:me(0,"Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:me(0,"Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:gk(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:gk(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}),bracketPairGuides:Hk(new class extends lk{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(16,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[me(0,"Enables bracket pair guides."),me(0,"Enables bracket pair guides only for the active bracket pair."),me(0,"Disables bracket pair guides.")],default:e.bracketPairs,description:me(0,"Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[me(0,"Enables horizontal guides as addition to vertical bracket pair guides."),me(0,"Enables horizontal guides only for the active bracket pair."),me(0,"Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:me(0,"Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:me(0,"Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:me(0,"Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[me(0,"Highlights the active indent guide."),me(0,"Highlights the active indent guide even if bracket guides are highlighted."),me(0,"Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:me(0,"Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{bracketPairs:Wk(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:Wk(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:gk(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:gk(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:Wk(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}),stickyTabStops:Hk(new pk(115,"stickyTabStops",!1,{description:me(0,"Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:Hk(new pk(17,"codeLens",!0,{description:me(0,"Controls whether the editor shows CodeLens.")})),codeLensFontFamily:Hk(new bk(18,"codeLensFontFamily","",{description:me(0,"Controls the font family for CodeLens.")})),codeLensFontSize:Hk(new fk(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:me(0,"Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:Hk(new pk(20,"colorDecorators",!0,{description:me(0,"Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:Hk(new Ck(146,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[me(0,"Make the color picker appear both on click and hover of the color decorator"),me(0,"Make the color picker appear on hover of the color decorator"),me(0,"Make the color picker appear on click of the color decorator")],description:me(0,"Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:Hk(new fk(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:me(0,"Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:Hk(new pk(22,"columnSelection",!1,{description:me(0,"Enable that the selection with the mouse and keys is doing column selection.")})),comments:Hk(new class extends lk{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:me(0,"Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:me(0,"Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertSpace:gk(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:gk(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}),contextmenu:Hk(new pk(24,"contextmenu",!0)),copyWithSyntaxHighlighting:Hk(new pk(25,"copyWithSyntaxHighlighting",!0,{description:me(0,"Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:Hk(new yk(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],(function(e){switch(e){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}),{description:me(0,"Control the cursor animation style.")})),cursorSmoothCaretAnimation:Hk(new Ck(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[me(0,"Smooth caret animation is disabled."),me(0,"Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),me(0,"Smooth caret animation is always enabled.")],description:me(0,"Controls whether the smooth caret animation should be enabled.")})),cursorStyle:Hk(new yk(28,"cursorStyle",Sk.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],(function(e){switch(e){case"line":return Sk.Line;case"block":return Sk.Block;case"underline":return Sk.Underline;case"line-thin":return Sk.LineThin;case"block-outline":return Sk.BlockOutline;case"underline-thin":return Sk.UnderlineThin}}),{description:me(0,"Controls the cursor style.")})),cursorSurroundingLines:Hk(new fk(29,"cursorSurroundingLines",0,0,1073741824,{description:me(0,"Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:Hk(new Ck(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[me(0,"`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),me(0,"`cursorSurroundingLines` is enforced always.")],markdownDescription:me(0,"Controls when `#cursorSurroundingLines#` should be enforced.")})),cursorWidth:Hk(new fk(31,"cursorWidth",0,0,1073741824,{markdownDescription:me(0,"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:Hk(new pk(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:Hk(new pk(33,"disableMonospaceOptimizations",!1)),domReadOnly:Hk(new pk(34,"domReadOnly",!1)),dragAndDrop:Hk(new pk(35,"dragAndDrop",!0,{description:me(0,"Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:Hk(new class extends pk{constructor(){super(37,"emptySelectionClipboard",!0,{description:me(0,"Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}),dropIntoEditor:Hk(new class extends lk{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:me(0,"Controls whether you can drag and drop a file into a text editor by holding down `Shift`-key (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:me(0,"Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[me(0,"Show the drop selector widget after a file is dropped into the editor."),me(0,"Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:gk(t.enabled,this.defaultValue.enabled),showDropSelector:wk(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}),stickyScroll:Hk(new class extends lk{constructor(){const e={enabled:!1,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(114,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:me(0,"Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:10,description:me(0,"Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:me(0,"Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:me(0,"Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:gk(t.enabled,this.defaultValue.enabled),maxLineCount:fk.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:wk(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:gk(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}),experimentalWhitespaceRendering:Hk(new Ck(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[me(0,"Use a new rendering method with svgs."),me(0,"Use a new rendering method with font characters."),me(0,"Use the stable rendering method.")],description:me(0,"Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:Hk(new bk(39,"extraEditorClassName","")),fastScrollSensitivity:Hk(new vk(40,"fastScrollSensitivity",5,(e=>e<=0?5:e),{markdownDescription:me(0,"Scrolling speed multiplier when pressing `Alt`.")})),find:Hk(new class extends lk{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:me(0,"Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[me(0,"Never seed search string from the editor selection."),me(0,"Always seed search string from the editor selection, including word at cursor position."),me(0,"Only seed search string from the editor selection.")],description:me(0,"Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[me(0,"Never turn on Find in Selection automatically (default)."),me(0,"Always turn on Find in Selection automatically."),me(0,"Turn on Find in Selection automatically when multiple lines of content are selected.")],description:me(0,"Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:me(0,"Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:Ve},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:me(0,"Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:me(0,"Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{cursorMoveOnType:gk(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:"boolean"==typeof e.seedSearchStringFromSelection?e.seedSearchStringFromSelection?"always":"never":wk(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:"boolean"==typeof e.autoFindInSelection?e.autoFindInSelection?"always":"never":wk(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:gk(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:gk(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:gk(t.loop,this.defaultValue.loop)}}}),fixedOverflowWidgets:Hk(new pk(42,"fixedOverflowWidgets",!1)),folding:Hk(new pk(43,"folding",!0,{description:me(0,"Controls whether the editor has code folding enabled.")})),foldingStrategy:Hk(new Ck(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[me(0,"Use a language-specific folding strategy if available, else the indentation-based one."),me(0,"Use the indentation-based folding strategy.")],description:me(0,"Controls the strategy for computing folding ranges.")})),foldingHighlight:Hk(new pk(45,"foldingHighlight",!0,{description:me(0,"Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:Hk(new pk(46,"foldingImportsByDefault",!1,{description:me(0,"Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:Hk(new fk(47,"foldingMaximumRegions",5e3,10,65e3,{description:me(0,"The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:Hk(new pk(48,"unfoldOnClickAfterEndOfLine",!1,{description:me(0,"Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:Hk(new bk(49,"fontFamily",Vk.fontFamily,{description:me(0,"Controls the font family.")})),fontInfo:Hk(new class extends ck{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}),fontLigatures2:Hk(new Lk),fontSize:Hk(new class extends uk{constructor(){super(52,"fontSize",Vk.fontSize,{type:"number",minimum:6,maximum:100,default:Vk.fontSize,description:me(0,"Controls the font size in pixels.")})}validate(e){const t=vk.float(e,this.defaultValue);return 0===t?Vk.fontSize:vk.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}),fontWeight:Hk(new Dk),fontVariations:Hk(new xk),formatOnPaste:Hk(new pk(55,"formatOnPaste",!1,{description:me(0,"Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:Hk(new pk(56,"formatOnType",!1,{description:me(0,"Controls whether the editor should automatically format the line after typing.")})),glyphMargin:Hk(new pk(57,"glyphMargin",!0,{description:me(0,"Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:Hk(new class extends lk{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[me(0,"Show Peek view of the results (default)"),me(0,"Go to the primary result and show a Peek view"),me(0,"Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:me(0,"This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":{description:me(0,"Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:me(0,"Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:me(0,"Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:me(0,"Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:me(0,"Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:me(0,"Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:me(0,"Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:me(0,"Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:me(0,"Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:me(0,"Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,n,o,s;if(!e||"object"!=typeof e)return this.defaultValue;const r=e;return{multiple:wk(r.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:null!==(t=r.multipleDefinitions)&&void 0!==t?t:wk(r.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:null!==(i=r.multipleTypeDefinitions)&&void 0!==i?i:wk(r.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:null!==(n=r.multipleDeclarations)&&void 0!==n?n:wk(r.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:null!==(o=r.multipleImplementations)&&void 0!==o?o:wk(r.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:null!==(s=r.multipleReferences)&&void 0!==s?s:wk(r.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:bk.string(r.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:bk.string(r.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:bk.string(r.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:bk.string(r.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:bk.string(r.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}),hideCursorInOverviewRuler:Hk(new pk(59,"hideCursorInOverviewRuler",!1,{description:me(0,"Controls whether the cursor should be hidden in the overview ruler.")})),hover:Hk(new class extends lk{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:me(0,"Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:me(0,"Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:me(0,"Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:me(0,"Controls the delay in milliseconds after which the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:me(0,"Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:gk(t.enabled,this.defaultValue.enabled),delay:fk.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:gk(t.sticky,this.defaultValue.sticky),hidingDelay:fk.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:gk(t.above,this.defaultValue.above)}}}),inDiffEditor:Hk(new pk(61,"inDiffEditor",!1)),letterSpacing:Hk(new vk(63,"letterSpacing",Vk.letterSpacing,(e=>vk.clamp(e,-5,20)),{description:me(0,"Controls the letter spacing in pixels.")})),lightbulb:Hk(new class extends lk{constructor(){const e={enabled:!0,experimental:{showAiIcon:kk.Off}};super(64,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:me(0,"Enables the Code Action lightbulb in the editor.")},"editor.lightbulb.experimental.showAiIcon":{type:"string",enum:[kk.Off,kk.OnCode,kk.On],default:e.experimental.showAiIcon,enumDescriptions:[me(0,"Don not show the AI icon."),me(0,"Show an AI icon when the code action menu contains an AI action, but only on code."),me(0,"Show an AI icon when the code action menu contains an AI action, on code and empty lines.")],description:me(0,"Show an AI icon along with the lightbulb when the code action menu contains an AI action.")}})}validate(e){var t,i;if(!e||"object"!=typeof e)return this.defaultValue;const n=e;return{enabled:gk(n.enabled,this.defaultValue.enabled),experimental:{showAiIcon:wk(null===(t=n.experimental)||void 0===t?void 0:t.showAiIcon,null===(i=this.defaultValue.experimental)||void 0===i?void 0:i.showAiIcon,[kk.Off,kk.OnCode,kk.On])}}}}),lineDecorationsWidth:Hk(new class extends lk{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){return"string"==typeof e&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):fk.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?fk.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}),lineHeight:Hk(new class extends vk{constructor(){super(66,"lineHeight",Vk.lineHeight,(e=>vk.clamp(e,0,150)),{markdownDescription:me(0,"Controls the line height. \n - Use 0 to automatically compute the line height from the font size.\n - Values between 0 and 8 will be used as a multiplier with the font size.\n - Values greater than or equal to 8 will be used as effective values.")})}compute(e,t,i){return e.fontInfo.lineHeight}}),lineNumbers:Hk(new class extends lk{constructor(){super(67,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[me(0,"Line numbers are not rendered."),me(0,"Line numbers are rendered as absolute number."),me(0,"Line numbers are rendered as distance in lines to cursor position."),me(0,"Line numbers are rendered every 10 lines.")],default:"on",description:me(0,"Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return void 0!==e&&("function"==typeof e?(t=4,i=e):t="interval"===e?3:"relative"===e?2:"on"===e?1:0),{renderType:t,renderFn:i}}}),lineNumbersMinChars:Hk(new fk(68,"lineNumbersMinChars",5,1,300)),linkedEditing:Hk(new pk(69,"linkedEditing",!1,{description:me(0,"Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:Hk(new pk(70,"links",!0,{description:me(0,"Controls whether the editor should detect links and make them clickable.")})),matchBrackets:Hk(new Ck(71,"matchBrackets","always",["always","near","never"],{description:me(0,"Highlight matching brackets.")})),minimap:Hk(new class extends lk{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(72,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:me(0,"Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:me(0,"Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[me(0,"The minimap has the same size as the editor contents (and might scroll)."),me(0,"The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),me(0,"The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:me(0,"Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:me(0,"Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:me(0,"Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:me(0,"Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:me(0,"Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:me(0,"Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:gk(t.enabled,this.defaultValue.enabled),autohide:gk(t.autohide,this.defaultValue.autohide),size:wk(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:wk(t.side,this.defaultValue.side,["right","left"]),showSlider:wk(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:gk(t.renderCharacters,this.defaultValue.renderCharacters),scale:fk.clampedInt(t.scale,1,1,3),maxColumn:fk.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}),mouseStyle:Hk(new Ck(73,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:Hk(new vk(74,"mouseWheelScrollSensitivity",1,(e=>0===e?1:e),{markdownDescription:me(0,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:Hk(new pk(75,"mouseWheelZoom",!1,{markdownDescription:me(0,"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:Hk(new pk(76,"multiCursorMergeOverlapping",!0,{description:me(0,"Merge multiple cursors when they are overlapping.")})),multiCursorModifier:Hk(new yk(77,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],(function(e){return"ctrlCmd"===e?Ve?"metaKey":"ctrlKey":"altKey"}),{markdownEnumDescriptions:[me(0,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),me(0,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:me(0,"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:Hk(new Ck(78,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[me(0,"Each cursor pastes a single line of the text."),me(0,"Each cursor pastes the full text.")],markdownDescription:me(0,"Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:Hk(new fk(79,"multiCursorLimit",1e4,1,1e5,{markdownDescription:me(0,"Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:Hk(new Ck(80,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[me(0,"Does not highlight occurrences."),me(0,"Highlights occurrences only in the current file."),me(0,"Experimental: Highlights occurrences across all valid open files.")],markdownDescription:me(0,"Controls whether occurrences should be highlighted across open files.")})),overviewRulerBorder:Hk(new pk(81,"overviewRulerBorder",!0,{description:me(0,"Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:Hk(new fk(82,"overviewRulerLanes",3,0,3)),padding:Hk(new class extends lk{constructor(){super(83,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:me(0,"Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:me(0,"Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{top:fk.clampedInt(t.top,0,0,1e3),bottom:fk.clampedInt(t.bottom,0,0,1e3)}}}),pasteAs:Hk(new class extends lk{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(84,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:me(0,"Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:me(0,"Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[me(0,"Show the paste selector widget after content is pasted into the editor."),me(0,"Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:gk(t.enabled,this.defaultValue.enabled),showPasteSelector:wk(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}),parameterHints:Hk(new class extends lk{constructor(){const e={enabled:!0,cycle:!0};super(85,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:me(0,"Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:me(0,"Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:gk(t.enabled,this.defaultValue.enabled),cycle:gk(t.cycle,this.defaultValue.cycle)}}}),peekWidgetDefaultFocus:Hk(new Ck(86,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[me(0,"Focus the tree when opening peek"),me(0,"Focus the editor when opening peek")],description:me(0,"Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:Hk(new pk(87,"definitionLinkOpensInPeek",!1,{description:me(0,"Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:Hk(new class extends lk{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[me(0,"Quick suggestions show inside the suggest widget"),me(0,"Quick suggestions show as ghost text"),me(0,"Quick suggestions are disabled")]}];super(88,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:me(0,"Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:me(0,"Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:me(0,"Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:me(0,"Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the '{0}'-setting which controls if suggestions are triggered by special characters.","#editor.suggestOnTriggerCharacters#")}),this.defaultValue=e}validate(e){if("boolean"==typeof e){const t=e?"on":"off";return{comments:t,strings:t,other:t}}if(!e||"object"!=typeof e)return this.defaultValue;const{other:t,comments:i,strings:n}=e,o=["on","inline","off"];let s,r,a;return s="boolean"==typeof t?t?"on":"off":wk(t,this.defaultValue.other,o),r="boolean"==typeof i?i?"on":"off":wk(i,this.defaultValue.comments,o),a="boolean"==typeof n?n?"on":"off":wk(n,this.defaultValue.strings,o),{other:s,comments:r,strings:a}}}),quickSuggestionsDelay:Hk(new fk(89,"quickSuggestionsDelay",10,0,1073741824,{description:me(0,"Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:Hk(new pk(90,"readOnly",!1)),readOnlyMessage:Hk(new class extends lk{constructor(){super(91,"readOnlyMessage",void 0)}validate(e){return e&&"object"==typeof e?e:this.defaultValue}}),renameOnType:Hk(new pk(92,"renameOnType",!1,{description:me(0,"Controls whether the editor auto renames on type."),markdownDeprecationMessage:me(0,"Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:Hk(new pk(93,"renderControlCharacters",!0,{description:me(0,"Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:Hk(new Ck(94,"renderFinalNewline",ze?"dimmed":"on",["off","on","dimmed"],{description:me(0,"Render last line number when the file ends with a newline.")})),renderLineHighlight:Hk(new Ck(95,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",me(0,"Highlights both the gutter and the current line.")],description:me(0,"Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:Hk(new pk(96,"renderLineHighlightOnlyWhenFocus",!1,{description:me(0,"Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:Hk(new Ck(97,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:Hk(new Ck(98,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",me(0,"Render whitespace characters except for single spaces between words."),me(0,"Render whitespace characters only on selected text."),me(0,"Render only trailing whitespace characters."),""],description:me(0,"Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:Hk(new fk(99,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:Hk(new pk(100,"roundedSelection",!0,{description:me(0,"Controls whether selections should have rounded corners.")})),rulers:Hk(new class extends lk{constructor(){const e=[],t={type:"number",description:me(0,"Number of monospace characters at which this editor ruler will render.")};super(101,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:me(0,"Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:me(0,"Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const t=[];for(const i of e)if("number"==typeof i)t.push({column:fk.clampedInt(i,0,0,1e4),color:null});else if(i&&"object"==typeof i){const e=i;t.push({column:fk.clampedInt(e.column,0,0,1e4),color:e.color})}return t.sort(((e,t)=>e.column-t.column)),t}return this.defaultValue}}),scrollbar:Hk(new class extends lk{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1,ignoreHorizontalScrollbarInContentHeight:!1};super(102,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[me(0,"The vertical scrollbar will be visible only when necessary."),me(0,"The vertical scrollbar will always be visible."),me(0,"The vertical scrollbar will always be hidden.")],default:"auto",description:me(0,"Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[me(0,"The horizontal scrollbar will be visible only when necessary."),me(0,"The horizontal scrollbar will always be visible."),me(0,"The horizontal scrollbar will always be hidden.")],default:"auto",description:me(0,"Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:me(0,"The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:me(0,"The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:me(0,"Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:me(0,"When set, the horizontal scrollbar will not increase the size of the editor's content.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e,i=fk.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=fk.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:fk.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:Ik(t.vertical,this.defaultValue.vertical),horizontal:Ik(t.horizontal,this.defaultValue.horizontal),useShadows:gk(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:gk(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:gk(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:gk(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:gk(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:fk.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:fk.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:gk(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:gk(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}}),scrollBeyondLastColumn:Hk(new fk(103,"scrollBeyondLastColumn",4,0,1073741824,{description:me(0,"Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:Hk(new pk(104,"scrollBeyondLastLine",!0,{description:me(0,"Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:Hk(new pk(105,"scrollPredominantAxis",!0,{description:me(0,"Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:Hk(new pk(106,"selectionClipboard",!0,{description:me(0,"Controls whether the Linux primary clipboard should be supported."),included:ze})),selectionHighlight:Hk(new pk(107,"selectionHighlight",!0,{description:me(0,"Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:Hk(new pk(108,"selectOnLineNumbers",!0)),showFoldingControls:Hk(new Ck(109,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[me(0,"Always show the folding controls."),me(0,"Never show the folding controls and reduce the gutter size."),me(0,"Only show the folding controls when the mouse is over the gutter.")],description:me(0,"Controls when the folding controls on the gutter are shown.")})),showUnused:Hk(new pk(110,"showUnused",!0,{description:me(0,"Controls fading out of unused code.")})),showDeprecated:Hk(new pk(138,"showDeprecated",!0,{description:me(0,"Controls strikethrough deprecated variables.")})),inlayHints:Hk(new class extends lk{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(139,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:me(0,"Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[me(0,"Inlay hints are enabled"),me(0,"Inlay hints are showing by default and hide when holding {0}",Ve?"Ctrl+Option":"Ctrl+Alt"),me(0,"Inlay hints are hidden by default and show when holding {0}",Ve?"Ctrl+Option":"Ctrl+Alt"),me(0,"Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:me(0,"Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:me(0,"Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:me(0,"Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return"boolean"==typeof t.enabled&&(t.enabled=t.enabled?"on":"off"),{enabled:wk(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:fk.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:bk.string(t.fontFamily,this.defaultValue.fontFamily),padding:gk(t.padding,this.defaultValue.padding)}}}),snippetSuggestions:Hk(new Ck(111,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[me(0,"Show snippet suggestions on top of other suggestions."),me(0,"Show snippet suggestions below other suggestions."),me(0,"Show snippets suggestions with other suggestions."),me(0,"Do not show snippet suggestions.")],description:me(0,"Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:Hk(new class extends lk{constructor(){super(112,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:me(0,"Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:me(0,"Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return e&&"object"==typeof e?{selectLeadingAndTrailingWhitespace:gk(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:gk(e.selectSubwords,this.defaultValue.selectSubwords)}:this.defaultValue}}),smoothScrolling:Hk(new pk(113,"smoothScrolling",!1,{description:me(0,"Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:Hk(new fk(116,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:Hk(new class extends lk{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(117,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[me(0,"Insert suggestion without overwriting text right of the cursor."),me(0,"Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:me(0,"Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:me(0,"Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:me(0,"Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:me(0,"Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[me(0,"Always select a suggestion when automatically triggering IntelliSense."),me(0,"Never select a suggestion when automatically triggering IntelliSense."),me(0,"Select a suggestion only when triggering IntelliSense from a trigger character."),me(0,"Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:me(0,"Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:me(0,"Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:me(0,"Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:me(0,"Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:me(0,"Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:me(0,"Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:me(0,"This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:me(0,"This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:me(0,"When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertMode:wk(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:gk(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:gk(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:gk(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:gk(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:wk(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:gk(t.showIcons,this.defaultValue.showIcons),showStatusBar:gk(t.showStatusBar,this.defaultValue.showStatusBar),preview:gk(t.preview,this.defaultValue.preview),previewMode:wk(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:gk(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:gk(t.showMethods,this.defaultValue.showMethods),showFunctions:gk(t.showFunctions,this.defaultValue.showFunctions),showConstructors:gk(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:gk(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:gk(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:gk(t.showFields,this.defaultValue.showFields),showVariables:gk(t.showVariables,this.defaultValue.showVariables),showClasses:gk(t.showClasses,this.defaultValue.showClasses),showStructs:gk(t.showStructs,this.defaultValue.showStructs),showInterfaces:gk(t.showInterfaces,this.defaultValue.showInterfaces),showModules:gk(t.showModules,this.defaultValue.showModules),showProperties:gk(t.showProperties,this.defaultValue.showProperties),showEvents:gk(t.showEvents,this.defaultValue.showEvents),showOperators:gk(t.showOperators,this.defaultValue.showOperators),showUnits:gk(t.showUnits,this.defaultValue.showUnits),showValues:gk(t.showValues,this.defaultValue.showValues),showConstants:gk(t.showConstants,this.defaultValue.showConstants),showEnums:gk(t.showEnums,this.defaultValue.showEnums),showEnumMembers:gk(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:gk(t.showKeywords,this.defaultValue.showKeywords),showWords:gk(t.showWords,this.defaultValue.showWords),showColors:gk(t.showColors,this.defaultValue.showColors),showFiles:gk(t.showFiles,this.defaultValue.showFiles),showReferences:gk(t.showReferences,this.defaultValue.showReferences),showFolders:gk(t.showFolders,this.defaultValue.showFolders),showTypeParameters:gk(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:gk(t.showSnippets,this.defaultValue.showSnippets),showUsers:gk(t.showUsers,this.defaultValue.showUsers),showIssues:gk(t.showIssues,this.defaultValue.showIssues)}}}),inlineSuggest:Hk(new class extends lk{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:me(0,"Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[me(0,"Show the inline suggestion toolbar whenever an inline suggestion is shown."),me(0,"Show the inline suggestion toolbar when hovering over an inline suggestion."),me(0,"Never show the inline suggestion toolbar.")],description:me(0,"Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:me(0,"Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:gk(t.enabled,this.defaultValue.enabled),mode:wk(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:wk(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:gk(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:gk(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}),inlineCompletionsAccessibilityVerbose:Hk(new pk(147,"inlineCompletionsAccessibilityVerbose",!1,{description:me(0,"Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:Hk(new fk(118,"suggestFontSize",0,0,1e3,{markdownDescription:me(0,"Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:Hk(new fk(119,"suggestLineHeight",0,0,1e3,{markdownDescription:me(0,"Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:Hk(new pk(120,"suggestOnTriggerCharacters",!0,{description:me(0,"Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:Hk(new Ck(121,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[me(0,"Always select the first suggestion."),me(0,"Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),me(0,"Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:me(0,"Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:Hk(new Ck(122,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[me(0,"Tab complete will insert the best matching suggestion when pressing tab."),me(0,"Disable tab completions."),me(0,"Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:me(0,"Enables tab completions.")})),tabIndex:Hk(new fk(123,"tabIndex",0,-1,1073741824)),unicodeHighlight:Hk(new class extends lk{constructor(){const e={nonBasicASCII:Mk,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Mk,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(124,"unicodeHighlight",e,{[Rk]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Mk],default:e.nonBasicASCII,description:me(0,"Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[Ak]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:me(0,"Controls whether characters that just reserve space or have no width at all are highlighted.")},[Ok]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:me(0,"Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[Pk]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Mk],default:e.includeComments,description:me(0,"Controls whether characters in comments should also be subject to Unicode highlighting.")},[Fk]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Mk],default:e.includeStrings,description:me(0,"Controls whether characters in strings should also be subject to Unicode highlighting.")},[Tk]:{restricted:!0,type:"object",default:e.allowedCharacters,description:me(0,"Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Bk]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:me(0,"Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(fc(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},i=!0)),t.allowedLocales&&e&&(fc(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},i=!0));const n=super.applyUpdate(e,t);return i?new hk(n.newValue,!0):n}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{nonBasicASCII:Wk(t.nonBasicASCII,Mk,[!0,!1,Mk]),invisibleCharacters:gk(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:gk(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:Wk(t.includeComments,Mk,[!0,!1,Mk]),includeStrings:Wk(t.includeStrings,Mk,[!0,!1,Mk]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if("object"!=typeof e||!e)return t;const i={};for(const[t,n]of Object.entries(e))!0===n&&(i[t]=!0);return i}}),unusualLineTerminators:Hk(new Ck(125,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[me(0,"Unusual line terminators are automatically removed."),me(0,"Unusual line terminators are ignored."),me(0,"Unusual line terminators prompt to be removed.")],description:me(0,"Remove unusual line terminators that might cause problems.")})),useShadowDOM:Hk(new pk(126,"useShadowDOM",!0)),useTabStops:Hk(new pk(127,"useTabStops",!0,{description:me(0,"Inserting and deleting whitespace follows tab stops.")})),wordBreak:Hk(new Ck(128,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[me(0,"Use the default line break rule."),me(0,"Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:me(0,"Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:Hk(new bk(129,"wordSeparators",Su,{description:me(0,"Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:Hk(new Ck(130,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[me(0,"Lines will never wrap."),me(0,"Lines will wrap at the viewport width."),me(0,"Lines will wrap at `#editor.wordWrapColumn#`."),me(0,"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:me(0,"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:Hk(new bk(131,"wordWrapBreakAfterCharacters"," \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:Hk(new bk(132,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:Hk(new fk(133,"wordWrapColumn",80,1,1073741824,{markdownDescription:me(0,"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:Hk(new Ck(134,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:Hk(new Ck(135,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:Hk(new class extends ck{constructor(){super(140)}compute(e,t,i){const n=["monaco-editor"];return t.get(39)&&n.push(t.get(39)),e.extraEditorClassName&&n.push(e.extraEditorClassName),"default"===t.get(73)?n.push("mouse-default"):"copy"===t.get(73)&&n.push("mouse-copy"),t.get(110)&&n.push("showUnused"),t.get(138)&&n.push("showDeprecated"),n.join(" ")}}),defaultColorDecorators:Hk(new pk(145,"defaultColorDecorators",!1,{markdownDescription:me(0,"Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:Hk(new class extends ck{constructor(){super(141)}compute(e,t,i){return e.pixelRatio}}),tabFocusMode:Hk(new pk(142,"tabFocusMode",!1,{markdownDescription:me(0,"Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:Hk(new Ek),wrappingInfo:Hk(new class extends ck{constructor(){super(144)}compute(e,t,i){const n=t.get(143);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}}),wrappingIndent:Hk(new class extends lk{constructor(){super(136,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[me(0,"No indentation. Wrapped lines begin at column 1."),me(0,"Wrapped lines get the same indentation as the parent."),me(0,"Wrapped lines get +1 indentation toward the parent."),me(0,"Wrapped lines get +2 indentation toward the parent.")],description:me(0,"Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,i){return 2===t.get(2)?0:i}}),wrappingStrategy:Hk(new class extends lk{constructor(){super(137,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[me(0,"Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),me(0,"Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:me(0,"Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return wk(e,"simple",["simple","advanced"])}compute(e,t,i){return 2===t.get(2)?"advanced":i}})},Kk=Object.freeze({id:"editor",order:5,type:"object",title:me(0,"Editor"),scope:5}),jk={...Kk,properties:{"editor.tabSize":{type:"number",default:Cu.tabSize,minimum:1,markdownDescription:me(0,"The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:me(0,'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:Cu.insertSpaces,markdownDescription:me(0,"Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:Cu.detectIndentation,markdownDescription:me(0,"Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:Cu.trimAutoWhitespace,description:me(0,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Cu.largeFileOptimizations,description:me(0,"Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[me(0,"Turn off Word Based Suggestions."),me(0,"Only suggest words from the active document."),me(0,"Suggest words from all open documents of the same language."),me(0,"Suggest words from all open documents.")],description:me(0,"Controls whether completions should be computed based on words in the document and from which documents they are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[me(0,"Semantic highlighting enabled for all color themes."),me(0,"Semantic highlighting disabled for all color themes."),me(0,"Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:me(0,"Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:me(0,"Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:me(0,"Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:me(0,"Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:me(0,"Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:me(0,"Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:me(0,"Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:me(0,"The opening bracket character or string sequence.")},{type:"string",description:me(0,"The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:me(0,"Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:me(0,"The opening bracket character or string sequence.")},{type:"string",description:me(0,"The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:sk.maxComputationTime,description:me(0,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:sk.maxFileSize,description:me(0,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:sk.renderSideBySide,description:me(0,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:sk.renderSideBySideInlineBreakpoint,description:me(0,"If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:sk.useInlineViewWhenSpaceIsLimited,description:me(0,"If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:sk.renderMarginRevertIcon,description:me(0,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:sk.ignoreTrimWhitespace,description:me(0,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:sk.renderIndicators,description:me(0,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:sk.diffCodeLens,description:me(0,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:sk.diffWordWrap,markdownEnumDescriptions:[me(0,"Lines will never wrap."),me(0,"Lines will wrap at the viewport width."),me(0,"Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:sk.diffAlgorithm,markdownEnumDescriptions:[me(0,"Uses the legacy diffing algorithm."),me(0,"Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:sk.hideUnchangedRegions.enabled,markdownDescription:me(0,"Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:sk.hideUnchangedRegions.revealLineCount,markdownDescription:me(0,"Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:sk.hideUnchangedRegions.minimumLineCount,markdownDescription:me(0,"Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:sk.hideUnchangedRegions.contextLineCount,markdownDescription:me(0,"Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:sk.experimental.showMoves,markdownDescription:me(0,"Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:sk.experimental.showEmptyDecorations,description:me(0,"Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}};for(const e of zk){const t=e.schema;if(void 0!==t)if(void 0!==(qk=t).type||void 0!==qk.anyOf)jk.properties[`editor.${e.name}`]=t;else for(const e in t)Object.hasOwnProperty.call(t,e)&&(jk.properties[e]=t[e])}var qk;let $k=null;function Gk(){return null===$k&&($k=Object.create(null),Object.keys(jk.properties).forEach((e=>{$k[e]=!0}))),$k}md.as(Lg).registerConfiguration(jk);const Zk=hh("IWorkspaceEditService");class Yk{constructor(e){this.metadata=e}static convert(e){return e.edits.map((e=>{if(Qk.is(e))return Qk.lift(e);if(Xk.is(e))return Xk.lift(e);throw new Error("Unsupported edit")}))}}class Qk extends Yk{static is(e){return e instanceof Qk||ll(e)&&Ro.isUri(e.resource)&&ll(e.textEdit)}static lift(e){return e instanceof Qk?e:new Qk(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i}}class Xk extends Yk{static is(e){return e instanceof Xk||ll(e)&&(Boolean(e.newResource)||Boolean(e.oldResource))}static lift(e){return e instanceof Xk?e:new Xk(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},n){super(n),this.oldResource=e,this.newResource=t,this.options=i}}const Jk=hh("ILanguageFeaturesService"),eL=hh("IEditorCancelService"),tL=new od("cancellableOperation",!1,me(0,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));wg(eL,class{constructor(){this._tokens=new WeakMap}add(e,t){let i,n=this._tokens.get(e);return n||(n=e.invokeWithinContext((e=>({key:tL.bindTo(e.get(sd)),tokens:new B}))),this._tokens.set(e,n)),n.key.set(!0),i=n.tokens.push(t),()=>{i&&(i(),n.key.set(!n.tokens.isEmpty()),i=void 0)}}cancel(e){const t=this._tokens.get(e);if(!t)return;const i=t.tokens.pop();i&&(i.cancel(),t.key.set(!t.tokens.isEmpty()))}},1);class iL extends Pt{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext((t=>t.get(eL).add(e,this)))}dispose(){this._unregister(),super.dispose()}}jd(new class extends Vd{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:tL})}runEditorCommand(e,t){e.get(eL).cancel(t)}});class nL{constructor(e,t){if(this.flags=t,0!=(1&this.flags)){const t=e.getModel();this.modelVersionId=t?ln("{0}#{1}",t.uri.toString(),t.getVersionId()):null}else this.modelVersionId=null;0!=(4&this.flags)?this.position=e.getPosition():this.position=null,0!=(2&this.flags)?this.selection=e.getSelection():this.selection=null,0!=(8&this.flags)?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof nL))return!1;const t=e;return this.modelVersionId===t.modelVersionId&&this.scrollLeft===t.scrollLeft&&this.scrollTop===t.scrollTop&&!(!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position))&&!(!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new nL(e,this.flags))}}class oL extends iL{constructor(e,t,i,n){super(e,n),this._listener=new M,4&t&&this._listener.add(e.onDidChangeCursorPosition((e=>{i&&tc.containsPosition(i,e.position)||this.cancel()}))),2&t&&this._listener.add(e.onDidChangeCursorSelection((e=>{i&&tc.containsRange(i,e.selection)||this.cancel()}))),8&t&&this._listener.add(e.onDidScrollChange((e=>this.cancel()))),1&t&&(this._listener.add(e.onDidChangeModel((e=>this.cancel()))),this._listener.add(e.onDidChangeModelContent((e=>this.cancel()))))}dispose(){this._listener.dispose(),super.dispose()}}class sL extends Pt{constructor(e,t){super(t),this._listener=e.onDidChangeContent((()=>this.cancel()))}dispose(){this._listener.dispose(),super.dispose()}}var rL;!function(e){e[e.Ignore=0]="Ignore",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(rL||(rL={})),function(e){const t="error",i="warning",n="info";e.fromValue=function(o){return o?xn(t,o)?e.Error:xn(i,o)||xn("warn",o)?e.Warning:xn(n,o)?e.Info:e.Ignore:e.Ignore},e.toString=function(o){switch(o){case e.Error:return t;case e.Warning:return i;case e.Info:return n;default:return"ignore"}}}(rL||(rL={}));const aL=rL;var lL=aL;const hL=hh("notificationService"),dL=hh("progressService");Object.freeze({total(){},worked(){},done(){}});class cL{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}}cL.None=Object.freeze({report(){}});const uL=hh("editorProgressService");class gL{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||""===this.value||e.value.startsWith(this.value+gL.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new gL(this.value+gL.sep+e)}}var pL;function mL(e,t,i){return!(!t.contains(e)||i&&t.contains(i))}gL.sep=".",gL.None=new gL("@@none@@"),gL.Empty=new gL(""),gL.QuickFix=new gL("quickfix"),gL.Refactor=new gL("refactor"),gL.RefactorExtract=gL.Refactor.append("extract"),gL.RefactorInline=gL.Refactor.append("inline"),gL.RefactorMove=gL.Refactor.append("move"),gL.RefactorRewrite=gL.Refactor.append("rewrite"),gL.Notebook=new gL("notebook"),gL.Source=new gL("source"),gL.SourceOrganizeImports=gL.Source.append("organizeImports"),gL.SourceFixAll=gL.Source.append("fixAll"),gL.SurroundWith=gL.Refactor.append("surround"),function(e){e.Refactor="refactor",e.RefactorPreview="refactor preview",e.Lightbulb="lightbulb",e.Default="other (default)",e.SourceAction="source action",e.QuickFix="quick fix action",e.FixAll="fix all",e.OrganizeImports="organize imports",e.AutoFix="auto fix",e.QuickFixHover="quick fix hover window",e.OnSave="save participants",e.ProblemsView="problems view"}(pL||(pL={}));class fL{static fromUser(e,t){return e&&"object"==typeof e?new fL(fL.getKindFromUser(e,t.kind),fL.getApplyFromUser(e,t.apply),fL.getPreferredUser(e)):new fL(t.kind,t.apply,!1)}static getApplyFromUser(e,t){switch("string"==typeof e.apply?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return"string"==typeof e.kind?new gL(e.kind):t}static getPreferredUser(e){return"boolean"==typeof e.preferred&&e.preferred}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class _L{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}async resolve(e){var t;if((null===(t=this.provider)||void 0===t?void 0:t.resolveCodeAction)&&!this.action.edit){let t;try{t=await this.provider.resolveCodeAction(this.action,e)}catch(e){d(e)}t&&(this.action.edit=t.edit)}return this}}const vL="editor.action.codeAction",bL="editor.action.quickFix",wL="editor.action.autoFix",CL="editor.action.refactor",yL="editor.action.sourceAction",SL="editor.action.organizeImports",kL="editor.action.fixAll";class LL extends T{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:Wc(e.diagnostics)?Wc(t.diagnostics)?LL.codeActionsPreferredComparator(e,t):-1:Wc(t.diagnostics)?1:LL.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(LL.codeActionsComparator),this.validActions=this.allActions.filter((({action:e})=>!e.disabled))}get hasAutoFix(){return this.validActions.some((({action:e})=>!!e.kind&&gL.QuickFix.contains(new gL(e.kind))&&!!e.isPreferred))}get hasAIFix(){return this.validActions.some((({action:e})=>!!e.isAI))}get allAIFixes(){return this.validActions.every((({action:e})=>!!e.isAI))}}const xL={actions:[],documentation:void 0};async function DL(e,t,i,n,o,s){var r;const a=n.filter||{},l={...a,excludes:[...a.excludes||[],gL.Notebook]},h={only:null===(r=a.include)||void 0===r?void 0:r.value,trigger:n.type},c=new sL(t,s),u=2===n.type,p=function(e,t,i){return e.all(t).filter((e=>!e.providedCodeActionKinds||e.providedCodeActionKinds.some((e=>function(e,t){return!(e.include&&!e.include.intersects(t)||e.excludes&&e.excludes.some((i=>mL(t,i,e.include)))||!e.includeSourceActions&&gL.Source.contains(t))}(i,new gL(e))))))}(e,t,u?l:a),m=new M,f=p.map((async e=>{try{o.report(e);const n=await e.provideCodeActions(t,i,h,c.token);if(n&&m.add(n),c.token.isCancellationRequested)return xL;const s=((null==n?void 0:n.actions)||[]).filter((e=>e&&function(e,t){const i=t.kind?new gL(t.kind):void 0;return!(!(!e.include||i&&e.include.contains(i))||e.excludes&&i&&e.excludes.some((t=>mL(i,t,e.include)))||!e.includeSourceActions&&i&&gL.Source.contains(i)||e.onlyIncludePreferredActions&&!t.isPreferred)}(a,e))),r=function(e,t,i){if(!e.documentation)return;const n=e.documentation.map((e=>({kind:new gL(e.kind),command:e.command})));if(i){let e;for(const t of n)t.kind.contains(i)&&(e?e.kind.contains(t.kind)&&(e=t):e=t);if(e)return null==e?void 0:e.command}for(const e of t)if(e.kind)for(const t of n)if(t.kind.contains(new gL(e.kind)))return t.command}(e,s,a.include);return{actions:s.map((t=>new _L(t,e))),documentation:r}}catch(e){if(g(e))throw e;return d(e),xL}})),_=e.onDidChange((()=>{Ic(e.all(t),p)||c.cancel()}));try{const i=await Promise.all(f),o=i.map((e=>e.actions)).flat(),s=[...Pc(i.map((e=>e.documentation))),...EL(e,t,n,o)];return new LL(o,s,m)}finally{_.dispose(),c.dispose()}}function*EL(e,t,i,n){var o,s,r;if(t&&n.length)for(const a of e.all(t))a._getAdditionalMenuItems&&(yield*null===(o=a._getAdditionalMenuItems)||void 0===o?void 0:o.call(a,{trigger:i.type,only:null===(r=null===(s=i.filter)||void 0===s?void 0:s.include)||void 0===r?void 0:r.value},n.map((e=>e.action))))}var NL;async function IL(e,t,i,n,o=Rt.None){var s;const r=e.get(Zk),a=e.get(wh),l=e.get(Id),h=e.get(hL);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:t.action.title,codeActionKind:t.action.kind,codeActionIsPreferred:!!t.action.isPreferred,reason:i}),await t.resolve(o),!o.isCancellationRequested){if((null===(s=t.action.edit)||void 0===s?void 0:s.edits.length)&&!(await r.apply(t.action.edit,{editor:null==n?void 0:n.editor,label:t.action.title,quotableLabel:t.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:i!==NL.OnSave,showPreview:null==n?void 0:n.preview})).isApplied)return;if(t.action.command)try{await a.executeCommand(t.action.command.id,...t.action.command.arguments||[])}catch(e){const t=function(e){return"string"==typeof e?e:e instanceof Error&&"string"==typeof e.message?e.message:void 0}(e);h.error("string"==typeof t?t:me(0,"An unknown error occurred while applying the code action"))}}}!function(e){e.OnSave="onSave",e.FromProblemsView="fromProblemsView",e.FromCodeActions="fromCodeActions"}(NL||(NL={})),Ch.registerCommand("_executeCodeActionProvider",(async function(e,t,i,n,o){if(!(t instanceof Ro))throw m();const{codeActionProvider:s}=e.get(Jk),r=e.get(uh).getModel(t);if(!r)throw m();const a=ic.isISelection(i)?ic.liftSelection(i):tc.isIRange(i)?r.validateRange(i):void 0;if(!a)throw m();const l="string"==typeof n?new gL(n):void 0,h=await DL(s,r,a,{type:1,triggerAction:pL.Default,filter:{includeSourceActions:!0,include:l}},cL.None,Rt.None),d=[],c=Math.min(h.validActions.length,"number"==typeof o?o:0);for(let e=0;e<c;e++)d.push(h.validActions[e].resolve(Rt.None));try{return await Promise.all(d),h.validActions.map((e=>e.action))}finally{setTimeout((()=>h.dispose()),100)}}));const ML=hh("keybindingService");var TL;let AL=TL=class{constructor(e){this.keybindingService=e}getResolver(){const e=new on((()=>this.keybindingService.getKeybindings().filter((e=>TL.codeActionCommands.indexOf(e.command)>=0)).filter((e=>e.resolvedKeybinding)).map((e=>{let t=e.commandArgs;return e.command===SL?t={kind:gL.SourceOrganizeImports.value}:e.command===kL&&(t={kind:gL.SourceFixAll.value}),{resolvedKeybinding:e.resolvedKeybinding,...fL.fromUser(t,{kind:gL.None,apply:"never"})}}))));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return null==i?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new gL(e.kind);return t.filter((e=>e.kind.contains(i))).filter((t=>!t.preferred||e.isPreferred)).reduceRight(((e,t)=>e?e.kind.contains(t.kind)?t:e:t),void 0)}};AL.codeActionCommands=[CL,vL,yL,SL,kL],AL=TL=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,ML)],AL);var RL=i(58),OL={};OL.styleTagTransform=Vr(),OL.setAttributes=Pr(),OL.insert=Rr().bind(null,"head"),OL.domAPI=Tr(),OL.insertStyleElement=Br(),Ir()(RL.Z,OL),RL.Z&&RL.Z.locals&&RL.Z.locals;var PL=i(4081),FL={};FL.styleTagTransform=Vr(),FL.setAttributes=Pr(),FL.insert=Rr().bind(null,"head"),FL.domAPI=Tr(),FL.insertStyleElement=Br(),Ir()(PL.Z,FL),PL.Z&&PL.Z.locals&&PL.Z.locals;var BL=i(745),WL={};WL.styleTagTransform=Vr(),WL.setAttributes=Pr(),WL.insert=Rr().bind(null,"head"),WL.domAPI=Tr(),WL.insertStyleElement=Br(),Ir()(BL.Z,WL),BL.Z&&BL.Z.locals&&BL.Z.locals,Sm("symbolIcon.arrayForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.booleanForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},me(0,"The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.colorForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.constantForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},me(0,"The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},me(0,"The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},me(0,"The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},me(0,"The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},me(0,"The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.fileForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.folderForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},me(0,"The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},me(0,"The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.keyForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.keywordForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},me(0,"The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.moduleForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.namespaceForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.nullForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.numberForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.objectForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.operatorForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.packageForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.propertyForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.referenceForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.snippetForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.stringForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.structForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.textForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.typeParameterForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.unitForeground",{dark:km,light:km,hcDark:km,hcLight:km},me(0,"The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Sm("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},me(0,"The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const VL=Object.freeze({kind:gL.Empty,title:me(0,"More Actions...")}),zL=Object.freeze([{kind:gL.QuickFix,title:me(0,"Quick Fix")},{kind:gL.RefactorExtract,title:me(0,"Extract"),icon:Sl.wrench},{kind:gL.RefactorInline,title:me(0,"Inline"),icon:Sl.wrench},{kind:gL.RefactorRewrite,title:me(0,"Rewrite"),icon:Sl.wrench},{kind:gL.RefactorMove,title:me(0,"Move"),icon:Sl.wrench},{kind:gL.SurroundWith,title:me(0,"Surround With"),icon:Sl.symbolSnippet},{kind:gL.Source,title:me(0,"Source Action"),icon:Sl.symbolFile},VL]);function HL(e,t,i){let n=null,o=null;if("function"==typeof i.value?(n="value",o=i.value,0!==o.length&&console.warn("Memoize should only be used in functions with zero parameters")):"function"==typeof i.get&&(n="get",o=i.get),!o)throw new Error("not supported");const s=`$memoize$${t}`;i[n]=function(...e){return this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,e)}),this[s]}}var UL;!function(e){e.Tap="-monaco-gesturetap",e.Change="-monaco-gesturechange",e.Start="-monaco-gesturestart",e.End="-monaco-gesturesend",e.Contextmenu="-monaco-gesturecontextmenu"}(UL||(UL={}));class KL extends T{constructor(){super(),this.dispatched=!1,this.targets=new B,this.ignoreTargets=new B,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(z.runAndSubscribe(ps,(({window:e,disposables:t})=>{t.add(bs(e.document,"touchstart",(e=>this.onTouchStart(e)),{passive:!1})),t.add(bs(e.document,"touchend",(t=>this.onTouchEnd(e,t)))),t.add(bs(e.document,"touchmove",(e=>this.onTouchMove(e)),{passive:!1}))}),{window:r,disposables:this._store}))}static addTarget(e){return KL.isTouchDevice()?(KL.INSTANCE||(KL.INSTANCE=x(new KL)),I(KL.INSTANCE.targets.push(e))):T.None}static ignoreTarget(e){return KL.isTouchDevice()?(KL.INSTANCE||(KL.INSTANCE=x(new KL)),I(KL.INSTANCE.ignoreTargets.push(e))):T.None}static isTouchDevice(){return"ontouchstart"in r||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,n=e.targetTouches.length;i<n;i++){const n=e.targetTouches.item(i);this.activeTouches[n.identifier]={id:n.identifier,initialTarget:n.target,initialTimeStamp:t,initialPageX:n.pageX,initialPageY:n.pageY,rollingTimestamps:[t],rollingPageX:[n.pageX],rollingPageY:[n.pageY]};const o=this.newGestureEvent(UL.Start,n.target);o.pageX=n.pageX,o.pageY=n.pageY,this.dispatchEvent(o)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e,t){const i=Date.now(),n=Object.keys(this.activeTouches).length;for(let o=0,s=t.changedTouches.length;o<s;o++){const s=t.changedTouches.item(o);if(!this.activeTouches.hasOwnProperty(String(s.identifier))){console.warn("move of an UNKNOWN touch",s);continue}const r=this.activeTouches[s.identifier],a=Date.now()-r.initialTimeStamp;if(a<KL.HOLD_DELAY&&Math.abs(r.initialPageX-Nc(r.rollingPageX))<30&&Math.abs(r.initialPageY-Nc(r.rollingPageY))<30){const e=this.newGestureEvent(UL.Tap,r.initialTarget);e.pageX=Nc(r.rollingPageX),e.pageY=Nc(r.rollingPageY),this.dispatchEvent(e)}else if(a>=KL.HOLD_DELAY&&Math.abs(r.initialPageX-Nc(r.rollingPageX))<30&&Math.abs(r.initialPageY-Nc(r.rollingPageY))<30){const e=this.newGestureEvent(UL.Contextmenu,r.initialTarget);e.pageX=Nc(r.rollingPageX),e.pageY=Nc(r.rollingPageY),this.dispatchEvent(e)}else if(1===n){const t=Nc(r.rollingPageX),n=Nc(r.rollingPageY),o=Nc(r.rollingTimestamps)-r.rollingTimestamps[0],s=t-r.rollingPageX[0],a=n-r.rollingPageY[0],l=[...this.targets].filter((e=>r.initialTarget instanceof Node&&e.contains(r.initialTarget)));this.inertia(e,l,i,Math.abs(s)/o,s>0?1:-1,t,Math.abs(a)/o,a>0?1:-1,n)}this.dispatchEvent(this.newGestureEvent(UL.End,r.initialTarget)),delete this.activeTouches[s.identifier]}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===UL.Tap){const t=(new Date).getTime();let i=0;i=t-this._lastSetTapCountTime>KL.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=t,e.tapCount=i}else e.type!==UL.Change&&e.type!==UL.Contextmenu||(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const t of this.ignoreTargets)if(t.contains(e.initialTarget))return;for(const t of this.targets)t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)}}inertia(e,t,i,n,o,s,r,a,l){this.handle=Ls(e,(()=>{const h=Date.now(),d=h-i;let c=0,u=0,g=!0;n+=KL.SCROLL_FRICTION*d,r+=KL.SCROLL_FRICTION*d,n>0&&(g=!1,c=o*n*d),r>0&&(g=!1,u=a*r*d);const p=this.newGestureEvent(UL.Change);p.translationX=c,p.translationY=u,t.forEach((e=>e.dispatchEvent(p))),g||this.inertia(e,t,h,n,o,s+c,r,a,l+u)}))}onTouchMove(e){const t=Date.now();for(let i=0,n=e.changedTouches.length;i<n;i++){const n=e.changedTouches.item(i);if(!this.activeTouches.hasOwnProperty(String(n.identifier))){console.warn("end of an UNKNOWN touch",n);continue}const o=this.activeTouches[n.identifier],s=this.newGestureEvent(UL.Change,o.initialTarget);s.translationX=n.pageX-Nc(o.rollingPageX),s.translationY=n.pageY-Nc(o.rollingPageY),s.pageX=n.pageX,s.pageY=n.pageY,this.dispatchEvent(s),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(n.pageX),o.rollingPageY.push(n.pageY),o.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}KL.SCROLL_FRICTION=-.005,KL.HOLD_DELAY=700,KL.CLEAR_TAP_COUNT_TIME=400,function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);s>3&&r&&Object.defineProperty(t,i,r)}([HL],KL,"isTouchDevice",null);var jL=i(2874),qL={};qL.styleTagTransform=Vr(),qL.setAttributes=Pr(),qL.insert=Rr().bind(null,"head"),qL.domAPI=Tr(),qL.insertStyleElement=Br(),Ir()(jL.Z,qL),jL.Z&&jL.Z.locals&&jL.Z.locals;var $L,GL,ZL=function(e,t){return function(i,n){t(i,n,e)}};!function(e){e.Hidden={type:0},e.Showing=class{constructor(e,t,i,n){this.actions=e,this.trigger=t,this.editorPosition=i,this.widgetPosition=n,this.type=1}}}(GL||(GL={}));let YL=$L=class extends T{constructor(e,t,i){var n,o,s;super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new q),this.onClick=this._onClick.event,this._state=GL.Hidden,this._iconClasses=[],this._domNode=mr("div.lightBulbWidget"),this._register(KL.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent((e=>{const t=this._editor.getModel();(1!==this.state.type||!t||this.state.editorPosition.lineNumber>=t.getLineCount())&&this.hide()}))),this._register((n=this._domNode,o=e=>{var t;if(1!==this.state.type)return;const n=this._editor.getOption(64).experimental.showAiIcon;if((n===kk.On||n===kk.OnCode)&&this.state.actions.allAIFixes&&1===this.state.actions.validActions.length){const n=this.state.actions.validActions[0].action;if(null===(t=n.command)||void 0===t?void 0:t.id)return i.executeCommand(n.command.id,...n.command.arguments||[]),void e.preventDefault()}this._editor.focus(),e.preventDefault();const{top:o,height:s}=As(this._domNode),r=this._editor.getOption(66);let a=Math.floor(r/3);null!==this.state.widgetPosition.position&&this.state.widgetPosition.position.lineNumber<this.state.editorPosition.lineNumber&&(a+=r),this._onClick.fire({x:e.posx,y:o+s+a,actions:this.state.actions,trigger:this.state.trigger})},function(e,t,i){return bs(e,je&&st?or.POINTER_DOWN:or.MOUSE_DOWN,t,i)}(n,ws(as(n),o),s))),this._register(bs(this._domNode,"mouseenter",(e=>{1==(1&e.buttons)&&this.hide()}))),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(64)&&(this._editor.getOption(64).enabled||this.hide(),this._updateLightBulbTitleAndIcon())}))),this._register(z.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,(()=>{var e,t,i,n;this._preferredKbLabel=null!==(t=null===(e=this._keybindingService.lookupKeybinding(wL))||void 0===e?void 0:e.getLabel())&&void 0!==t?t:void 0,this._quickFixKbLabel=null!==(n=null===(i=this._keybindingService.lookupKeybinding(bL))||void 0===i?void 0:i.getLabel())&&void 0!==n?n:void 0,this._updateLightBulbTitleAndIcon()})))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return 1===this._state.type?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();const n=this._editor.getOptions();if(!n.get(64).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:s,column:r}=o.validatePosition(i),a=o.getOptions().tabSize,l=n.get(50),h=$b(o.getLineContent(s),a),d=e=>e>2&&this._editor.getTopForLineNumber(e)===this._editor.getTopForLineNumber(e-1);let c=s;if(!(l.spaceWidth*h>22))if(s>1&&!d(s-1))c-=1;else if(d(s+1)){if(r*l.spaceWidth<22)return this.hide()}else c+=1;this.state=new GL.Showing(e,t,i,{position:{lineNumber:c,column:o.getLineContent(c).match(/^\S\s*$/)?2:1},preference:$L._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==GL.Hidden&&(this.state=GL.Hidden,this._editor.layoutContentWidget(this))}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){var e,t,i;if(this._domNode.classList.remove(...this._iconClasses),this._iconClasses=[],1!==this.state.type)return;const n=()=>{this._preferredKbLabel&&(this.title=me(0,"Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel))},o=()=>{this._quickFixKbLabel?this.title=me(0,"Show Code Actions ({0})",this._quickFixKbLabel):this.title=me(0,"Show Code Actions")};let s;const r=this._editor.getOption(64).experimental.showAiIcon;if(r===kk.On||r===kk.OnCode)if(r===kk.On&&this.state.actions.allAIFixes)if(s=Sl.sparkleFilled,this.state.actions.allAIFixes&&1===this.state.actions.validActions.length)if("inlineChat.start"===(null===(e=this.state.actions.validActions[0].action.command)||void 0===e?void 0:e.id)){const e=null!==(i=null===(t=this._keybindingService.lookupKeybinding("inlineChat.start"))||void 0===t?void 0:t.getLabel())&&void 0!==i?i:void 0;this.title=e?me(0,"Start Inline Chat ({0})",e):me(0,"Start Inline Chat")}else this.title=me(0,"Trigger AI Action");else o();else this.state.actions.hasAutoFix?(s=this.state.actions.hasAIFix?Sl.lightbulbSparkleAutofix:Sl.lightbulbAutofix,n()):this.state.actions.hasAIFix?(s=Sl.lightbulbSparkle,o()):(s=Sl.lightBulb,o());else this.state.actions.hasAutoFix?(s=Sl.lightbulbAutofix,n()):(s=Sl.lightBulb,o());this._iconClasses=Ll.asClassNameArray(s),this._domNode.classList.add(...this._iconClasses)}set title(e){this._domNode.title=e}};function QL(e,t={}){const i=XL(t);return ex(i,function(e,t){const i={type:1,children:[]};let n=0,o=i;const s=[],r=new JL(e);for(;!r.eos();){let e=r.next();const i="\\"===e&&0!==tx(r.peek(),t);if(i&&(e=r.next()),i||0===tx(e,t)||e!==r.peek())if("\n"===e)2===o.type&&(o=s.pop()),o.children.push({type:8});else if(2!==o.type){const t={type:2,content:e};o.children.push(t),s.push(o),o=t}else o.content+=e;else{r.advance(),2===o.type&&(o=s.pop());const i=tx(e,t);if(o.type===i||5===o.type&&6===i)o=s.pop();else{const e={type:i,children:[]};5===i&&(e.index=n,n++),o.children.push(e),s.push(o),o=e}}}return 2===o.type&&(o=s.pop()),s.length,i}(e,!!t.renderCodeSegments),t.actionHandler,t.renderCodeSegments),i}function XL(e){const t=e.inline?"span":"div",i=document.createElement(t);return e.className&&(i.className=e.className),i}YL.ID="editor.contrib.lightbulbWidget",YL._posPref=[0],YL=$L=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([ZL(1,ML),ZL(2,wh)],YL);class JL{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function ex(e,t,i,n){let o;if(2===t.type)o=document.createTextNode(t.content||"");else if(3===t.type)o=document.createElement("b");else if(4===t.type)o=document.createElement("i");else if(7===t.type&&n)o=document.createElement("code");else if(5===t.type&&i){const e=document.createElement("a");i.disposables.add(Cs(e,"click",(e=>{i.callback(String(t.index),e)}))),o=e}else 8===t.type?o=document.createElement("br"):1===t.type&&(o=e);o&&e!==o&&e.appendChild(o),o&&Array.isArray(t.children)&&t.children.forEach((e=>{ex(o,e,i,n)}))}function tx(e,t){switch(e){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return t?7:0;default:return 0}}const ix=new RegExp(`(\\\\)?\\$\\((${Ll.iconNameExpression}(?:${Ll.iconModifierExpression})?)\\)`,"g");function nx(e){const t=new Array;let i,n=0,o=0;for(;null!==(i=ix.exec(e));){o=i.index||0,n<o&&t.push(e.substring(n,o)),n=(i.index||0)+i[0].length;const[,s,r]=i;t.push(s?`$(${r})`:ox({id:r}))}return n<e.length&&t.push(e.substring(n)),t}function ox(e){const t=mr("span");return t.classList.add(...Ll.asClassNameArray(e)),t}class sx{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const rx=new sx("id#");let ax={};!function(){function e(e,t){t(ax)}e.amd=!0,function(t,i){e.amd?e(0,i):"object"==typeof exports?i(exports):i((t="undefined"!=typeof globalThis?globalThis:t||self).marked={})}(this,(function(e){function t(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function n(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};var s=/[&<>"']/,r=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,h={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},d=function(e){return h[e]};function c(e,t){if(t){if(s.test(e))return e.replace(r,d)}else if(a.test(e))return e.replace(l,d);return e}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function g(e){return e.replace(u,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var p=/(^|[^\[])\^/g;function m(e,t){e="string"==typeof e?e:e.source,t=t||"";var i={replace:function(t,n){return n=(n=n.source||n).replace(p,"$1"),e=e.replace(t,n),i},getRegex:function(){return new RegExp(e,t)}};return i}var f=/[^\w:]/g,_=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function v(e,t,i){if(e){var n;try{n=decodeURIComponent(g(i)).replace(f,"").toLowerCase()}catch(e){return null}if(0===n.indexOf("javascript:")||0===n.indexOf("vbscript:")||0===n.indexOf("data:"))return null}t&&!_.test(i)&&(i=function(e,t){b[" "+e]||(w.test(e)?b[" "+e]=e+"/":b[" "+e]=x(e,"/",!0));var i=-1===(e=b[" "+e]).indexOf(":");return"//"===t.substring(0,2)?i?t:e.replace(C,"$1")+t:"/"===t.charAt(0)?i?t:e.replace(y,"$1")+t:e+t}(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(e){return null}return i}var b={},w=/^[^:]+:\/*[^/]*$/,C=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/,S={exec:function(){}};function k(e){for(var t,i,n=1;n<arguments.length;n++)for(i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}function L(e,t){var i=e.replace(/\|/g,(function(e,t,i){for(var n=!1,o=t;--o>=0&&"\\"===i[o];)n=!n;return n?"|":" |"})).split(/ \|/),n=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(/\\\|/g,"|");return i}function x(e,t,i){var n=e.length;if(0===n)return"";for(var o=0;o<n;){var s=e.charAt(n-o-1);if(s!==t||i){if(s===t||!i)break;o++}else o++}return e.slice(0,n-o)}function D(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function E(e,t){if(t<1)return"";for(var i="";t>1;)1&t&&(i+=e),t>>=1,e+=e;return i+e}function N(e,t,i,n){var o=t.href,s=t.title?c(t.title):null,r=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;var a={type:"link",raw:i,href:o,title:s,text:r,tokens:n.inlineTokens(r)};return n.state.inLink=!1,a}return{type:"image",raw:i,href:o,title:s,text:c(r)}}var I=function(){function t(t){this.options=t||e.defaults}var i=t.prototype;return i.space=function(e){var t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}},i.code=function(e){var t=this.rules.block.code.exec(e);if(t){var i=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?i:x(i,"\n")}}},i.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var i=t[0],n=function(e,t){var i=e.match(/^(\s+)(?:```)/);if(null===i)return t;var n=i[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=n.length?e.slice(n.length):e})).join("\n")}(i,t[3]||"");return{type:"code",raw:i,lang:t[2]?t[2].trim():t[2],text:n}}},i.heading=function(e){var t=this.rules.block.heading.exec(e);if(t){var i=t[2].trim();if(/#$/.test(i)){var n=x(i,"#");this.options.pedantic?i=n.trim():n&&!/ $/.test(n)||(i=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:i,tokens:this.lexer.inline(i)}}},i.hr=function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}},i.blockquote=function(e){var t=this.rules.block.blockquote.exec(e);if(t){var i=t[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(i,[]),text:i}}},i.list=function(e){var t=this.rules.block.list.exec(e);if(t){var i,o,s,r,a,l,h,d,c,u,g,p,m=t[1].trim(),f=m.length>1,_={type:"list",raw:"",ordered:f,start:f?+m.slice(0,-1):"",loose:!1,items:[]};m=f?"\\d{1,9}\\"+m.slice(-1):"\\"+m,this.options.pedantic&&(m=f?m:"[*+-]");for(var v=new RegExp("^( {0,3}"+m+")((?:[\t ][^\\n]*)?(?:\\n|$))");e&&(p=!1,t=v.exec(e))&&!this.rules.block.hr.test(e);){if(i=t[0],e=e.substring(i.length),d=t[2].split("\n",1)[0],c=e.split("\n",1)[0],this.options.pedantic?(r=2,g=d.trimLeft()):(r=(r=t[2].search(/[^ ]/))>4?1:r,g=d.slice(r),r+=t[1].length),l=!1,!d&&/^ *$/.test(c)&&(i+=c+"\n",e=e.substring(c.length+1),p=!0),!p)for(var b=new RegExp("^ {0,"+Math.min(3,r-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),w=new RegExp("^ {0,"+Math.min(3,r-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),C=new RegExp("^ {0,"+Math.min(3,r-1)+"}(?:```|~~~)"),y=new RegExp("^ {0,"+Math.min(3,r-1)+"}#");e&&(d=u=e.split("\n",1)[0],this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!C.test(d))&&!y.test(d)&&!b.test(d)&&!w.test(e);){if(d.search(/[^ ]/)>=r||!d.trim())g+="\n"+d.slice(r);else{if(l)break;g+="\n"+d}l||d.trim()||(l=!0),i+=u+"\n",e=e.substring(u.length+1)}_.loose||(h?_.loose=!0:/\n *\n *$/.test(i)&&(h=!0)),this.options.gfm&&(o=/^\[[ xX]\] /.exec(g))&&(s="[ ] "!==o[0],g=g.replace(/^\[[ xX]\] +/,"")),_.items.push({type:"list_item",raw:i,task:!!o,checked:s,loose:!1,text:g}),_.raw+=i}_.items[_.items.length-1].raw=i.trimRight(),_.items[_.items.length-1].text=g.trimRight(),_.raw=_.raw.trimRight();var S=_.items.length;for(a=0;a<S;a++){this.lexer.state.top=!1,_.items[a].tokens=this.lexer.blockTokens(_.items[a].text,[]);var k=_.items[a].tokens.filter((function(e){return"space"===e.type})),L=k.every((function(e){for(var t,i=0,o=n(e.raw.split(""));!(t=o()).done;)if("\n"===t.value&&(i+=1),i>1)return!0;return!1}));!_.loose&&k.length&&L&&(_.loose=!0,_.items[a].loose=!0)}return _}},i.html=function(e){var t=this.rules.block.html.exec(e);if(t){var i={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};if(this.options.sanitize){var n=this.options.sanitizer?this.options.sanitizer(t[0]):c(t[0]);i.type="paragraph",i.text=n,i.tokens=this.lexer.inline(n)}return i}},i.def=function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}},i.table=function(e){var t=this.rules.block.table.exec(e);if(t){var i={type:"table",header:L(t[1]).map((function(e){return{text:e}})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(i.header.length===i.align.length){i.raw=t[0];var n,o,s,r,a=i.align.length;for(n=0;n<a;n++)/^ *-+: *$/.test(i.align[n])?i.align[n]="right":/^ *:-+: *$/.test(i.align[n])?i.align[n]="center":/^ *:-+ *$/.test(i.align[n])?i.align[n]="left":i.align[n]=null;for(a=i.rows.length,n=0;n<a;n++)i.rows[n]=L(i.rows[n],i.header.length).map((function(e){return{text:e}}));for(a=i.header.length,o=0;o<a;o++)i.header[o].tokens=this.lexer.inline(i.header[o].text);for(a=i.rows.length,o=0;o<a;o++)for(r=i.rows[o],s=0;s<r.length;s++)r[s].tokens=this.lexer.inline(r[s].text);return i}}},i.lheading=function(e){var t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}},i.paragraph=function(e){var t=this.rules.block.paragraph.exec(e);if(t){var i="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:i,tokens:this.lexer.inline(i)}}},i.text=function(e){var t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}},i.escape=function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:c(t[1])}},i.tag=function(e){var t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):c(t[0]):t[0]}},i.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var i=t[2].trim();if(!this.options.pedantic&&/^</.test(i)){if(!/>$/.test(i))return;var n=x(i.slice(0,-1),"\\");if((i.length-n.length)%2==0)return}else{var o=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var i=e.length,n=0,o=0;o<i;o++)if("\\"===e[o])o++;else if(e[o]===t[0])n++;else if(e[o]===t[1]&&--n<0)return o;return-1}(t[2],"()");if(o>-1){var s=(0===t[0].indexOf("!")?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,s).trim(),t[3]=""}}var r=t[2],a="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);l&&(r=l[1],a=l[3])}else a=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(r=this.options.pedantic&&!/>$/.test(i)?r.slice(1):r.slice(1,-1)),N(t,{href:r?r.replace(this.rules.inline._escapes,"$1"):r,title:a?a.replace(this.rules.inline._escapes,"$1"):a},t[0],this.lexer)}},i.reflink=function(e,t){var i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){var n=(i[2]||i[1]).replace(/\s+/g," ");if(!(n=t[n.toLowerCase()])||!n.href){var o=i[0].charAt(0);return{type:"text",raw:o,text:o}}return N(i,n,i[0],this.lexer)}},i.emStrong=function(e,t,i){void 0===i&&(i="");var n=this.rules.inline.emStrong.lDelim.exec(e);if(n&&(!n[3]||!i.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var o=n[1]||n[2]||"";if(!o||o&&(""===i||this.rules.inline.punctuation.exec(i))){var s,r,a=n[0].length-1,l=a,h=0,d="*"===n[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+a);null!=(n=d.exec(t));)if(s=n[1]||n[2]||n[3]||n[4]||n[5]||n[6])if(r=s.length,n[3]||n[4])l+=r;else if(!((n[5]||n[6])&&a%3)||(a+r)%3){if(!((l-=r)>0)){if(r=Math.min(r,r+l+h),Math.min(a,r)%2){var c=e.slice(1,a+n.index+r);return{type:"em",raw:e.slice(0,a+n.index+r+1),text:c,tokens:this.lexer.inlineTokens(c)}}var u=e.slice(2,a+n.index+r-1);return{type:"strong",raw:e.slice(0,a+n.index+r+1),text:u,tokens:this.lexer.inlineTokens(u)}}}else h+=r}}},i.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var i=t[2].replace(/\n/g," "),n=/[^ ]/.test(i),o=/^ /.test(i)&&/ $/.test(i);return n&&o&&(i=i.substring(1,i.length-1)),i=c(i,!0),{type:"codespan",raw:t[0],text:i}}},i.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},i.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}},i.autolink=function(e,t){var i,n,o=this.rules.inline.autolink.exec(e);if(o)return n="@"===o[2]?"mailto:"+(i=c(this.options.mangle?t(o[1]):o[1])):i=c(o[1]),{type:"link",raw:o[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}},i.url=function(e,t){var i;if(i=this.rules.inline.url.exec(e)){var n,o;if("@"===i[2])o="mailto:"+(n=c(this.options.mangle?t(i[0]):i[0]));else{var s;do{s=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(s!==i[0]);n=c(i[0]),o="www."===i[1]?"http://"+n:n}return{type:"link",raw:i[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}},i.inlineText=function(e,t){var i,n=this.rules.inline.text.exec(e);if(n)return i=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):c(n[0]):n[0]:c(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:i}},t}(),M={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?<?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:S,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};M.def=m(M.def).replace("label",M._label).replace("title",M._title).getRegex(),M.bullet=/(?:[*+-]|\d{1,9}[.)])/,M.listItemStart=m(/^( *)(bull) */).replace("bull",M.bullet).getRegex(),M.list=m(M.list).replace(/bull/g,M.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+M.def.source+")").getRegex(),M._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",M._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,M.html=m(M.html,"i").replace("comment",M._comment).replace("tag",M._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),M.paragraph=m(M._paragraph).replace("hr",M.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",M._tag).getRegex(),M.blockquote=m(M.blockquote).replace("paragraph",M.paragraph).getRegex(),M.normal=k({},M),M.gfm=k({},M.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),M.gfm.table=m(M.gfm.table).replace("hr",M.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",M._tag).getRegex(),M.gfm.paragraph=m(M._paragraph).replace("hr",M.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",M.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",M._tag).getRegex(),M.pedantic=k({},M.normal,{html:m("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",M._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:S,paragraph:m(M.normal._paragraph).replace("hr",M.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",M.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var T={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:S,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:S,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function A(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function R(e){var t,i,n="",o=e.length;for(t=0;t<o;t++)i=e.charCodeAt(t),Math.random()>.5&&(i="x"+i.toString(16)),n+="&#"+i+";";return n}T._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",T.punctuation=m(T.punctuation).replace(/punctuation/g,T._punctuation).getRegex(),T.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,T.escapedEmSt=/\\\*|\\_/g,T._comment=m(M._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),T.emStrong.lDelim=m(T.emStrong.lDelim).replace(/punct/g,T._punctuation).getRegex(),T.emStrong.rDelimAst=m(T.emStrong.rDelimAst,"g").replace(/punct/g,T._punctuation).getRegex(),T.emStrong.rDelimUnd=m(T.emStrong.rDelimUnd,"g").replace(/punct/g,T._punctuation).getRegex(),T._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,T._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,T._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,T.autolink=m(T.autolink).replace("scheme",T._scheme).replace("email",T._email).getRegex(),T._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,T.tag=m(T.tag).replace("comment",T._comment).replace("attribute",T._attribute).getRegex(),T._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,T._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,T._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,T.link=m(T.link).replace("label",T._label).replace("href",T._href).replace("title",T._title).getRegex(),T.reflink=m(T.reflink).replace("label",T._label).replace("ref",M._label).getRegex(),T.nolink=m(T.nolink).replace("ref",M._label).getRegex(),T.reflinkSearch=m(T.reflinkSearch,"g").replace("reflink",T.reflink).replace("nolink",T.nolink).getRegex(),T.normal=k({},T),T.pedantic=k({},T.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:m(/^!?\[(label)\]\((.*?)\)/).replace("label",T._label).getRegex(),reflink:m(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",T._label).getRegex()}),T.gfm=k({},T.normal,{escape:m(T.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),T.gfm.url=m(T.gfm.url,"i").replace("email",T.gfm._extended_email).getRegex(),T.breaks=k({},T.gfm,{br:m(T.br).replace("{2,}","*").getRegex(),text:m(T.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var O=function(){function i(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||e.defaults,this.options.tokenizer=this.options.tokenizer||new I,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var i={block:M.normal,inline:T.normal};this.options.pedantic?(i.block=M.pedantic,i.inline=T.pedantic):this.options.gfm&&(i.block=M.gfm,this.options.breaks?i.inline=T.breaks:i.inline=T.gfm),this.tokenizer.rules=i}i.lex=function(e,t){return new i(t).lex(e)},i.lexInline=function(e,t){return new i(t).inlineTokens(e)};var n,o,s=i.prototype;return s.lex=function(e){var t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens},s.blockTokens=function(e,t){var i,n,o,s,r=this;for(void 0===t&&(t=[]),e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,(function(e,t,i){return t+" ".repeat(i.length)}));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((function(n){return!!(i=n.call({lexer:r},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)}))))if(i=this.tokenizer.space(e))e=e.substring(i.raw.length),1===i.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(i);else if(i=this.tokenizer.code(e))e=e.substring(i.raw.length),!(n=t[t.length-1])||"paragraph"!==n.type&&"text"!==n.type?t.push(i):(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(i=this.tokenizer.fences(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.heading(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.hr(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.blockquote(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.list(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.html(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.def(e))e=e.substring(i.raw.length),!(n=t[t.length-1])||"paragraph"!==n.type&&"text"!==n.type?this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title}):(n.raw+="\n"+i.raw,n.text+="\n"+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(i=this.tokenizer.table(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.lheading(e))e=e.substring(i.raw.length),t.push(i);else if(o=e,this.options.extensions&&this.options.extensions.startBlock&&function(){var t=1/0,i=e.slice(1),n=void 0;r.options.extensions.startBlock.forEach((function(e){"number"==typeof(n=e.call({lexer:this},i))&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}(),this.state.top&&(i=this.tokenizer.paragraph(o)))n=t[t.length-1],s&&"paragraph"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i),s=o.length!==e.length,e=e.substring(i.raw.length);else if(i=this.tokenizer.text(e))e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i);else if(e){var a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}throw new Error(a)}return this.state.top=!0,t},s.inline=function(e,t){return void 0===t&&(t=[]),this.inlineQueue.push({src:e,tokens:t}),t},s.inlineTokens=function(e,t){var i,n,o,s=this;void 0===t&&(t=[]);var r,a,l,h=e;if(this.tokens.links){var d=Object.keys(this.tokens.links);if(d.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(h));)d.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(h=h.slice(0,r.index)+"["+E("a",r[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(h));)h=h.slice(0,r.index)+"["+E("a",r[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.escapedEmSt.exec(h));)h=h.slice(0,r.index)+"++"+h.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(a||(l=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((function(n){return!!(i=n.call({lexer:s},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)}))))if(i=this.tokenizer.escape(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.tag(e))e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.link(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.emStrong(e,h,l))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.codespan(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.br(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.del(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.autolink(e,R))e=e.substring(i.raw.length),t.push(i);else if(this.state.inLink||!(i=this.tokenizer.url(e,R))){if(o=e,this.options.extensions&&this.options.extensions.startInline&&function(){var t=1/0,i=e.slice(1),n=void 0;s.options.extensions.startInline.forEach((function(e){"number"==typeof(n=e.call({lexer:this},i))&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}(),i=this.tokenizer.inlineText(o,A))e=e.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(l=i.raw.slice(-1)),a=!0,(n=t[t.length-1])&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(e){var c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}else e=e.substring(i.raw.length),t.push(i);return t},n=i,o=[{key:"rules",get:function(){return{block:M,inline:T}}}],null&&t(n.prototype,null),o&&t(n,o),Object.defineProperty(n,"prototype",{writable:!1}),i}(),P=function(){function t(t){this.options=t||e.defaults}var i=t.prototype;return i.code=function(e,t,i){var n=(t||"").match(/\S*/)[0];if(this.options.highlight){var o=this.options.highlight(e,n);null!=o&&o!==e&&(i=!0,e=o)}return e=e.replace(/\n$/,"")+"\n",n?'<pre><code class="'+this.options.langPrefix+c(n,!0)+'">'+(i?e:c(e,!0))+"</code></pre>\n":"<pre><code>"+(i?e:c(e,!0))+"</code></pre>\n"},i.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},i.html=function(e){return e},i.heading=function(e,t,i,n){return this.options.headerIds?"<h"+t+' id="'+(this.options.headerPrefix+n.slug(i))+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},i.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},i.list=function(e,t,i){var n=t?"ol":"ul";return"<"+n+(t&&1!==i?' start="'+i+'"':"")+">\n"+e+"</"+n+">\n"},i.listitem=function(e){return"<li>"+e+"</li>\n"},i.checkbox=function(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},i.paragraph=function(e){return"<p>"+e+"</p>\n"},i.table=function(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"},i.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},i.tablecell=function(e,t){var i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+"</"+i+">\n"},i.strong=function(e){return"<strong>"+e+"</strong>"},i.em=function(e){return"<em>"+e+"</em>"},i.codespan=function(e){return"<code>"+e+"</code>"},i.br=function(){return this.options.xhtml?"<br/>":"<br>"},i.del=function(e){return"<del>"+e+"</del>"},i.link=function(e,t,i){if(null===(e=v(this.options.sanitize,this.options.baseUrl,e)))return i;var n='<a href="'+c(e)+'"';return t&&(n+=' title="'+t+'"'),n+">"+i+"</a>"},i.image=function(e,t,i){if(null===(e=v(this.options.sanitize,this.options.baseUrl,e)))return i;var n='<img src="'+e+'" alt="'+i+'"';return t&&(n+=' title="'+t+'"'),n+(this.options.xhtml?"/>":">")},i.text=function(e){return e},t}(),F=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,i){return""+i},t.image=function(e,t,i){return""+i},t.br=function(){return""},e}(),B=function(){function e(){this.seen={}}var t=e.prototype;return t.serialize=function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},t.getNextSafeSlug=function(e,t){var i=e,n=0;if(this.seen.hasOwnProperty(i)){n=this.seen[e];do{i=e+"-"+ ++n}while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=n,this.seen[i]=0),i},t.slug=function(e,t){void 0===t&&(t={});var i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)},e}(),W=function(){function t(t){this.options=t||e.defaults,this.options.renderer=this.options.renderer||new P,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new F,this.slugger=new B}t.parse=function(e,i){return new t(i).parse(e)},t.parseInline=function(e,i){return new t(i).parseInline(e)};var i=t.prototype;return i.parse=function(e,t){void 0===t&&(t=!0);var i,n,o,s,r,a,l,h,d,c,u,p,m,f,_,v,b,w,C,y="",S=e.length;for(i=0;i<S;i++)if(c=e[i],!(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[c.type])||!1===(C=this.options.extensions.renderers[c.type].call({parser:this},c))&&["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type))switch(c.type){case"space":continue;case"hr":y+=this.renderer.hr();continue;case"heading":y+=this.renderer.heading(this.parseInline(c.tokens),c.depth,g(this.parseInline(c.tokens,this.textRenderer)),this.slugger);continue;case"code":y+=this.renderer.code(c.text,c.lang,c.escaped);continue;case"table":for(h="",l="",s=c.header.length,n=0;n<s;n++)l+=this.renderer.tablecell(this.parseInline(c.header[n].tokens),{header:!0,align:c.align[n]});for(h+=this.renderer.tablerow(l),d="",s=c.rows.length,n=0;n<s;n++){for(l="",r=(a=c.rows[n]).length,o=0;o<r;o++)l+=this.renderer.tablecell(this.parseInline(a[o].tokens),{header:!1,align:c.align[o]});d+=this.renderer.tablerow(l)}y+=this.renderer.table(h,d);continue;case"blockquote":d=this.parse(c.tokens),y+=this.renderer.blockquote(d);continue;case"list":for(u=c.ordered,p=c.start,m=c.loose,s=c.items.length,d="",n=0;n<s;n++)v=(_=c.items[n]).checked,b=_.task,f="",_.task&&(w=this.renderer.checkbox(v),m?_.tokens.length>0&&"paragraph"===_.tokens[0].type?(_.tokens[0].text=w+" "+_.tokens[0].text,_.tokens[0].tokens&&_.tokens[0].tokens.length>0&&"text"===_.tokens[0].tokens[0].type&&(_.tokens[0].tokens[0].text=w+" "+_.tokens[0].tokens[0].text)):_.tokens.unshift({type:"text",text:w}):f+=w),f+=this.parse(_.tokens,m),d+=this.renderer.listitem(f,b,v);y+=this.renderer.list(d,u,p);continue;case"html":y+=this.renderer.html(c.text);continue;case"paragraph":y+=this.renderer.paragraph(this.parseInline(c.tokens));continue;case"text":for(d=c.tokens?this.parseInline(c.tokens):c.text;i+1<S&&"text"===e[i+1].type;)d+="\n"+((c=e[++i]).tokens?this.parseInline(c.tokens):c.text);y+=t?this.renderer.paragraph(d):d;continue;default:var k='Token with "'+c.type+'" type was not found.';if(this.options.silent)return void console.error(k);throw new Error(k)}else y+=C||"";return y},i.parseInline=function(e,t){t=t||this.renderer;var i,n,o,s="",r=e.length;for(i=0;i<r;i++)if(n=e[i],!(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[n.type])||!1===(o=this.options.extensions.renderers[n.type].call({parser:this},n))&&["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type))switch(n.type){case"escape":case"text":s+=t.text(n.text);break;case"html":s+=t.html(n.text);break;case"link":s+=t.link(n.href,n.title,this.parseInline(n.tokens,t));break;case"image":s+=t.image(n.href,n.title,n.text);break;case"strong":s+=t.strong(this.parseInline(n.tokens,t));break;case"em":s+=t.em(this.parseInline(n.tokens,t));break;case"codespan":s+=t.codespan(n.text);break;case"br":s+=t.br();break;case"del":s+=t.del(this.parseInline(n.tokens,t));break;default:var a='Token with "'+n.type+'" type was not found.';if(this.options.silent)return void console.error(a);throw new Error(a)}else s+=o||"";return s},t}();function V(e,t,i){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(i=t,t=null),D(t=k({},V.defaults,t||{})),i){var n,o=t.highlight;try{n=O.lex(e,t)}catch(e){return i(e)}var s=function(e){var s;if(!e)try{t.walkTokens&&V.walkTokens(n,t.walkTokens),s=W.parse(n,t)}catch(t){e=t}return t.highlight=o,e?i(e):i(null,s)};if(!o||o.length<3)return s();if(delete t.highlight,!n.length)return s();var r=0;return V.walkTokens(n,(function(e){"code"===e.type&&(r++,setTimeout((function(){o(e.text,e.lang,(function(t,i){if(t)return s(t);null!=i&&i!==e.text&&(e.text=i,e.escaped=!0),0==--r&&s()}))}),0))})),void(0===r&&s())}function a(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+c(e.message+"",!0)+"</pre>";throw e}try{var l=O.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(V.walkTokens(l,t.walkTokens)).then((function(){return W.parse(l,t)})).catch(a);V.walkTokens(l,t.walkTokens)}return W.parse(l,t)}catch(e){a(e)}}V.options=V.setOptions=function(t){var i;return k(V.defaults,t),i=V.defaults,e.defaults=i,V},V.getDefaults=o,V.defaults=e.defaults,V.use=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var n,o=k.apply(void 0,[{}].concat(t)),s=V.defaults.extensions||{renderers:{},childTokens:{}};t.forEach((function(e){if(e.extensions&&(n=!0,e.extensions.forEach((function(e){if(!e.name)throw new Error("extension name required");if(e.renderer){var t=s.renderers?s.renderers[e.name]:null;s.renderers[e.name]=t?function(){for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];var s=e.renderer.apply(this,n);return!1===s&&(s=t.apply(this,n)),s}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");s[e.level]?s[e.level].unshift(e.tokenizer):s[e.level]=[e.tokenizer],e.start&&("block"===e.level?s.startBlock?s.startBlock.push(e.start):s.startBlock=[e.start]:"inline"===e.level&&(s.startInline?s.startInline.push(e.start):s.startInline=[e.start]))}e.childTokens&&(s.childTokens[e.name]=e.childTokens)}))),e.renderer&&function(){var t=V.defaults.renderer||new P,i=function(i){var n=t[i];t[i]=function(){for(var o=arguments.length,s=new Array(o),r=0;r<o;r++)s[r]=arguments[r];var a=e.renderer[i].apply(t,s);return!1===a&&(a=n.apply(t,s)),a}};for(var n in e.renderer)i(n);o.renderer=t}(),e.tokenizer&&function(){var t=V.defaults.tokenizer||new I,i=function(i){var n=t[i];t[i]=function(){for(var o=arguments.length,s=new Array(o),r=0;r<o;r++)s[r]=arguments[r];var a=e.tokenizer[i].apply(t,s);return!1===a&&(a=n.apply(t,s)),a}};for(var n in e.tokenizer)i(n);o.tokenizer=t}(),e.walkTokens){var t=V.defaults.walkTokens;o.walkTokens=function(i){var n=[];return n.push(e.walkTokens.call(this,i)),t&&(n=n.concat(t.call(this,i))),n}}n&&(o.extensions=s),V.setOptions(o)}))},V.walkTokens=function(e,t){for(var i,o=[],s=function(){var e=i.value;switch(o=o.concat(t.call(V,e)),e.type){case"table":for(var s,r=n(e.header);!(s=r()).done;){var a=s.value;o=o.concat(V.walkTokens(a.tokens,t))}for(var l,h=n(e.rows);!(l=h()).done;)for(var d,c=n(l.value);!(d=c()).done;){var u=d.value;o=o.concat(V.walkTokens(u.tokens,t))}break;case"list":o=o.concat(V.walkTokens(e.items,t));break;default:V.defaults.extensions&&V.defaults.extensions.childTokens&&V.defaults.extensions.childTokens[e.type]?V.defaults.extensions.childTokens[e.type].forEach((function(i){o=o.concat(V.walkTokens(e[i],t))})):e.tokens&&(o=o.concat(V.walkTokens(e.tokens,t)))}},r=n(e);!(i=r()).done;)s();return o},V.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");D(t=k({},V.defaults,t||{}));try{var i=O.lexInline(e,t);return t.walkTokens&&V.walkTokens(i,t.walkTokens),W.parseInline(i,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+c(e.message+"",!0)+"</pre>";throw e}},V.Parser=W,V.parser=W.parse,V.Renderer=P,V.TextRenderer=F,V.Lexer=O,V.lexer=O.lex,V.Tokenizer=I,V.Slugger=B,V.parse=V;var z=V.options,H=V.setOptions,U=V.use,K=V.walkTokens,j=V.parseInline,q=V,$=W.parse,G=O.lex;e.Lexer=O,e.Parser=W,e.Renderer=P,e.Slugger=B,e.TextRenderer=F,e.Tokenizer=I,e.getDefaults=o,e.lexer=G,e.marked=V,e.options=z,e.parse=q,e.parseInline=j,e.parser=$,e.setOptions=H,e.use=U,e.walkTokens=K,Object.defineProperty(e,"__esModule",{value:!0})}))}(),ax.Lexer||exports.Lexer,ax.Parser||exports.Parser,ax.Renderer||exports.Renderer,ax.Slugger||exports.Slugger,ax.TextRenderer||exports.TextRenderer,ax.Tokenizer||exports.Tokenizer,ax.getDefaults||exports.getDefaults,ax.lexer||exports.lexer;var lx=ax.marked||exports.marked;function hx(e){let t=JSON.parse(e);return t=cx(t),t}function dx(e,t){return t instanceof RegExp?{$mid:2,source:t.source,flags:t.flags}:t}function cx(e,t=0){if(!e||t>200)return e;if("object"==typeof e){switch(e.$mid){case 1:return Ro.revive(e);case 2:return new RegExp(e.source,e.flags);case 17:return new Date(e.source)}if(e instanceof Uu||e instanceof Uint8Array)return e;if(Array.isArray(e))for(let i=0;i<e.length;++i)e[i]=cx(e[i],t+1);else for(const i in e)Object.hasOwnProperty.call(e,i)&&(e[i]=cx(e[i],t+1))}return e}ax.options||exports.options,ax.parse||exports.parse,ax.parseInline||exports.parseInline,ax.parser||exports.parser,ax.setOptions||exports.setOptions,ax.use||exports.use,ax.walkTokens||exports.walkTokens;const ux=Object.freeze({image:(e,t,i)=>{let n=[],o=[];return e&&(({href:e,dimensions:n}=function(e){const t=[],i=e.split("|").map((e=>e.trim()));e=i[0];const n=i[1];if(n){const e=/height=(\d+)/.exec(n),i=/width=(\d+)/.exec(n),o=e?e[1]:"",s=i?i[1]:"",r=isFinite(parseInt(s)),a=isFinite(parseInt(o));r&&t.push(`width="${s}"`),a&&t.push(`height="${o}"`)}return{href:e,dimensions:t}}(e)),o.push(`src="${nh(e)}"`)),i&&o.push(`alt="${nh(i)}"`),t&&o.push(`title="${nh(t)}"`),n.length&&(o=o.concat(n)),"<img "+o.join(" ")+">"},paragraph:e=>`<p>${e}</p>`,link:(e,t,i)=>"string"!=typeof e?"":(e===i&&(i=oh(i)),t="string"==typeof t?nh(oh(t)):"",`<a href="${e=(e=oh(e)).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}" title="${t||e}" draggable="false">${i}</a>`)});function gx(e,t={},i={}){var n,o;const s=new M;let r=!1;const a=XL(t),l=function(t){let i;try{i=hx(decodeURIComponent(t))}catch(e){}return i?(i=gc(i,(t=>e.uris&&e.uris[t]?Ro.revive(e.uris[t]):void 0)),encodeURIComponent(JSON.stringify(i))):t},d=function(t,i){const n=e.uris&&e.uris[t];let o=Ro.revive(n);return i?t.startsWith(jo.data+":")?t:(o||(o=Ro.parse(t)),Yo.uriToBrowserUri(o).toString(!0)):o?Ro.parse(t).toString()===o.toString()?t:(o.query&&(o=o.with({query:l(o.query)})),o.toString()):t},c=new lx.Renderer;c.image=ux.image,c.link=ux.link,c.paragraph=ux.paragraph;const u=[],g=[];if(t.codeBlockRendererSync?c.code=(e,i)=>{const n=rx.nextId(),o=t.codeBlockRendererSync(px(i),e);return g.push([n,o]),`<div class="code" data-code="${n}">${hn(e)}</div>`}:t.codeBlockRenderer&&(c.code=(e,i)=>{const n=rx.nextId(),o=t.codeBlockRenderer(px(i),e);return u.push(o.then((e=>[n,e]))),`<div class="code" data-code="${n}">${hn(e)}</div>`}),t.actionHandler){const i=function(i){let n=i.target;if("A"===n.tagName||(n=n.parentElement,n&&"A"===n.tagName))try{let o=n.dataset.href;o&&(e.baseUri&&(o=mx(Ro.from(e.baseUri),o)),t.actionHandler.callback(o,i))}catch(e){h(e)}finally{i.preventDefault()}},n=t.actionHandler.disposables.add(new OS(a,"click")),o=t.actionHandler.disposables.add(new OS(a,"auxclick"));t.actionHandler.disposables.add(z.any(n.event,o.event)((e=>{const t=new Mt(as(a),e);(t.leftButton||t.middleButton)&&i(t)}))),t.actionHandler.disposables.add(bs(a,"keydown",(e=>{const t=new Dt(e);(t.equals(10)||t.equals(3))&&i(t)})))}e.supportHtml||(i.sanitizer=t=>(e.isTrusted?t.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?t:"",i.sanitize=!0,i.silent=!0),i.renderer=c;let p,m=null!==(n=e.value)&&void 0!==n?n:"";if(m.length>1e5&&(m=`${m.substr(0,1e5)}…`),e.supportThemeIcons&&(m=m.replace(El,(e=>`\\${e}`))),t.fillInIncompleteTokens){const e={...lx.defaults,...i},t=function(e){let t,i;for(t=0;t<e.length;t++){const n=e[t];if("paragraph"===n.type&&n.raw.match(/(\n|^)```/)){i=yx(e.slice(t));break}if("paragraph"===n.type&&n.raw.match(/(\n|^)\|/)){i=Nx(e.slice(t));break}if(t===e.length-1&&"paragraph"===n.type){const e=Cx(n);if(e){i=[e];break}}}if(i){const n=[...e.slice(0,t),...i];return n.links=e.links,n}return e}(lx.lexer(m,e));p=lx.parser(t,e)}else p=lx.parse(m,i);e.supportThemeIcons&&(p=nx(p).map((e=>"string"==typeof e?e:e.outerHTML)).join(""));const f=(new DOMParser).parseFromString(fx(e,p),"text/html");if(f.body.querySelectorAll("img").forEach((t=>{const i=t.getAttribute("src");if(i){let n=i;try{e.baseUri&&(n=mx(Ro.from(e.baseUri),n))}catch(e){}t.src=d(n,!0)}})),f.body.querySelectorAll("a").forEach((t=>{const i=t.getAttribute("href");if(t.setAttribute("href",""),!i||/^data:|javascript:/i.test(i)||/^command:/i.test(i)&&!e.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(i))t.replaceWith(...t.childNodes);else{let n=d(i,!1);e.baseUri&&(n=mx(Ro.from(e.baseUri),i)),t.dataset.href=n}})),a.innerHTML=fx(e,f.body.innerHTML),u.length>0)Promise.all(u).then((e=>{var i,n;if(r)return;const o=new Map(e),s=a.querySelectorAll("div[data-code]");for(const e of s){const t=o.get(null!==(i=e.dataset.code)&&void 0!==i?i:"");t&&cr(e,t)}null===(n=t.asyncRenderCallback)||void 0===n||n.call(t)}));else if(g.length>0){const e=new Map(g),t=a.querySelectorAll("div[data-code]");for(const i of t){const t=e.get(null!==(o=i.dataset.code)&&void 0!==o?o:"");t&&cr(i,t)}}if(t.asyncRenderCallback)for(const e of a.getElementsByTagName("img")){const i=s.add(bs(e,"load",(()=>{i.dispose(),t.asyncRenderCallback()})))}return{element:a,dispose:()=>{r=!0,s.dispose()}}}function px(e){if(!e)return"";const t=e.split(/[\s+|:|,|\{|\?]/,1);return t.length?t[0]:e}function mx(e,t){return/^\w[\w\d+.-]*:/.test(t)?t:e.path.endsWith("/")?Yl(e,t).toString():Yl(ql(e),t).toString()}function fx(e,t){const{config:i,allowedSchemes:n}=function(e){const t=[jo.http,jo.https,jo.mailto,jo.data,jo.file,jo.vscodeFileResource,jo.vscodeRemote,jo.vscodeRemoteResource];return e.isTrusted&&t.push(jo.command),{config:{ALLOWED_TAGS:[...Sr],ALLOWED_ATTR:_x,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:t}}(e);en("uponSanitizeAttribute",((e,t)=>{if("style"!==t.attrName&&"class"!==t.attrName);else{if("SPAN"===e.tagName){if("style"===t.attrName)return void(t.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(t.attrValue));if("class"===t.attrName)return void(t.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(t.attrValue))}t.keepAttr=!1}}));const o=function(e,t=!1){const i=document.createElement("a");return en("afterSanitizeAttributes",(n=>{for(const o of["href","src"])if(n.hasAttribute(o)){const s=n.getAttribute(o);if("href"===o&&s.startsWith("#"))continue;if(i.href=s,!e.includes(i.protocol.replace(/:$/,""))){if(t&&"src"===o&&i.href.startsWith("data:"))continue;n.removeAttribute(o)}}})),I((()=>{tn("afterSanitizeAttributes")}))}(n);try{return Ji(t,{...i,RETURN_TRUSTED_TYPE:!0})}finally{tn("uponSanitizeAttribute"),o.dispose()}}const _x=["align","autoplay","alt","class","controls","data-code","data-href","draggable","height","href","loop","muted","playsinline","poster","src","style","target","title","width","start"];const vx=new Map([["&quot;",'"'],["&nbsp;"," "],["&amp;","&"],["&#39;","'"],["&lt;","<"],["&gt;",">"]]),bx=new on((()=>{const e=new lx.Renderer;return e.code=e=>e,e.blockquote=e=>e,e.html=e=>"",e.heading=(e,t,i)=>e+"\n",e.hr=()=>"",e.list=(e,t)=>e,e.listitem=e=>e+"\n",e.paragraph=e=>e+"\n",e.table=(e,t)=>e+t+"\n",e.tablerow=e=>e,e.tablecell=(e,t)=>e+" ",e.strong=e=>e,e.em=e=>e,e.codespan=e=>e,e.br=()=>"\n",e.del=e=>e,e.image=(e,t,i)=>"",e.text=e=>e,e.link=(e,t,i)=>i,e}));function wx(e){let t="";return e.forEach((e=>{t+=e.raw})),t}function Cx(e){for(const t of e.tokens)if("text"===t.type){const i=t.raw.split("\n"),n=i[i.length-1];if(n.includes("`"))return Sx(e);if(n.includes("**"))return Ex(e,"**");if(n.match(/\*\w/))return Ex(e,"*");if(n.match(/(^|\s)__\w/))return Dx(e);if(n.match(/(^|\s)_\w/))return kx(e);if(n.match(/(^|\s)\[.*\]\(\w*/))return Lx(e);if(n.match(/(^|\s)\[\w/))return xx(e)}}function yx(e){const t=wx(e);return lx.lexer(t+"\n```")}function Sx(e){return Ex(e,"`")}function kx(e){return Ex(e,"_")}function Lx(e){return Ex(e,")")}function xx(e){return Ex(e,"](about:blank)")}function Dx(e){return Ex(e,"__")}function Ex(e,t){const i=wx(Array.isArray(e)?e:[e]);return lx.lexer(i+t)[0]}function Nx(e){const t=wx(e),i=t.split("\n");let n,o=!1;for(let e=0;e<i.length;e++){const t=i[e].trim();if(void 0===n&&t.match(/^\s*\|/)){const e=t.match(/(\|[^\|]+)(?=\||$)/g);e&&(n=e.length)}else if("number"==typeof n){if(!t.match(/^\s*\|/))return;if(e!==i.length-1)return;o=!0}}if("number"==typeof n&&n>0){const e=o?i.slice(0,-1).join("\n"):t,s=!!e.match(/\|\s*$/),r=e+(s?"":"|")+`\n|${" --- |".repeat(n)}`;return lx.lexer(r)}}var Ix=i(5807),Mx={};function Tx(e,t){var i;const n=globalThis.MonacoEnvironment;if(null==n?void 0:n.createTrustedTypesPolicy)try{return n.createTrustedTypesPolicy(e,t)}catch(e){return void h(e)}try{return null===(i=r.trustedTypes)||void 0===i?void 0:i.createPolicy(e,t)}catch(e){return void h(e)}}Mx.styleTagTransform=Vr(),Mx.setAttributes=Pr(),Mx.insert=Rr().bind(null,"head"),Mx.domAPI=Tr(),Mx.insertStyleElement=Br(),Ir()(Ix.Z,Mx),Ix.Z&&Ix.Z.locals&&Ix.Z.locals;var Ax=i(1615),Rx={};Rx.styleTagTransform=Vr(),Rx.setAttributes=Pr(),Rx.insert=Rr().bind(null,"head"),Rx.domAPI=Tr(),Rx.insertStyleElement=Br(),Ir()(Ax.Z,Rx),Ax.Z&&Ax.Z.locals&&Ax.Z.locals;class Ox{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){const t=Px(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=Px(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=Px(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=Px(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=Px(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=Px(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=Px(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=Px(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const t=Px(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=Px(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=Px(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function Px(e){return"number"==typeof e?`${e}px`:e}function Fx(e){return new Ox(e)}function Bx(e,t){e instanceof Ox?(e.setFontFamily(t.getMassagedFontFamily()),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setFontFeatureSettings(t.fontFeatureSettings),e.setFontVariationSettings(t.fontVariationSettings),e.setLineHeight(t.lineHeight),e.setLetterSpacing(t.letterSpacing)):(e.style.fontFamily=t.getMassagedFontFamily(),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+"px",e.style.fontFeatureSettings=t.fontFeatureSettings,e.style.fontVariationSettings=t.fontVariationSettings,e.style.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px")}const Wx={getInitialState:()=>kC,tokenizeEncoded:(e,t,i)=>xC(0,i)};function Vx(e,t,i,n,o,s,r){let a="<div>",l=n,h=0,d=!0;for(let c=0,u=t.getCount();c<u;c++){const u=t.getEndOffset(c);if(u<=n)continue;let g="";for(;l<u&&l<o;l++){const t=e.charCodeAt(l);switch(t){case 9:{let e=s-(l+h)%s;for(h+=e-1;e>0;)r&&d?(g+="&#160;",d=!1):(g+=" ",d=!0),e--;break}case 60:g+="&lt;",d=!1;break;case 62:g+="&gt;",d=!1;break;case 38:g+="&amp;",d=!1;break;case 0:g+="&#00;",d=!1;break;case 65279:case 8232:case 8233:case 133:g+="�",d=!1;break;case 13:g+="&#8203",d=!1;break;case 32:r&&d?(g+="&#160;",d=!1):(g+=" ",d=!0);break;default:g+=String.fromCharCode(t),d=!1}}if(a+=`<span style="${t.getInlineStyle(c,i)}">${g}</span>`,u>o||l>=o)break}return a+="</div>",a}function zx(e,t,i){let n='<div class="monaco-tokenized-source">';const o=mn(e);let s=i.getInitialState();for(let e=0,r=o.length;e<r;e++){const r=o[e];e>0&&(n+="<br/>");const a=i.tokenizeEncoded(r,!0,s);IC.convertToEndOffset(a.tokens,r.length);const l=new IC(a.tokens,r,t).inflate();let h=0;for(let e=0,t=l.getCount();e<t;e++){const t=l.getClassName(e),i=l.getEndOffset(e);n+=`<span class="${t}">${hn(r.substring(h,i))}</span>`,h=i}s=a.endState}return n+="</div>",n}const Hx=hh("openerService");var Ux,Kx=function(e,t){return function(i,n){t(i,n,e)}};let jx=Ux=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new q,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const n=new M,o=n.add(gx(e,{...this._getRenderOptions(e,n),...t},i));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(e,t)=>{var i,n,o;let s;e?s=this._languageService.getLanguageIdByLanguageName(e):this._options.editor&&(s=null===(i=this._options.editor.getModel())||void 0===i?void 0:i.getLanguageId()),s||(s=Hg);const r=await async function(e,t,i){if(!i)return zx(t,e.languageIdCodec,Wx);const n=await SC.getOrCreate(i);return zx(t,e.languageIdCodec,n||Wx)}(this._languageService,t,s),a=document.createElement("span");return a.innerHTML=null!==(o=null===(n=Ux._ttpTokenizer)||void 0===n?void 0:n.createHTML(r))&&void 0!==o?o:r,this._options.editor?Bx(a,this._options.editor.getOption(50)):this._options.codeBlockFontFamily&&(a.style.fontFamily=this._options.codeBlockFontFamily),void 0!==this._options.codeBlockFontSize&&(a.style.fontSize=this._options.codeBlockFontSize),a},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:t=>qx(this._openerService,t,e.isTrusted),disposables:t}}}};async function qx(e,t,i){try{return await e.open(t,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:$x(i)})}catch(e){return h(e),!1}}function $x(e){return!0===e||!(!e||!Array.isArray(e.enabledCommands))&&e.enabledCommands}jx._ttpTokenizer=Tx("tokenizeToString",{createHTML:e=>e}),jx=Ux=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Kx(1,yu),Kx(2,Hx)],jx);var Gx,Zx=function(e,t){return function(i,n){t(i,n,e)}};let Yx=Gx=class{static get(e){return e.getContribution(Gx.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new A,this._messageListeners=new M,this._mouseOverMessage=!1,this._editor=e,this._visible=Gx.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;null===(e=this._message)||void 0===e||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){let i;Zr(ih(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=ih(e)?gx(e,{actionHandler:{callback:t=>qx(this._openerService,t,ih(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new Qx(this._editor,t,"string"==typeof e?e:this._message.element),this._messageListeners.add(z.debounce(this._editor.onDidBlurEditorText,((e,t)=>t),0)((()=>{this._mouseOverMessage||this._messageWidget.value&&Bs(Us(),this._messageWidget.value.getDomNode())||this.closeMessage()}))),this._messageListeners.add(this._editor.onDidChangeCursorPosition((()=>this.closeMessage()))),this._messageListeners.add(this._editor.onDidDispose((()=>this.closeMessage()))),this._messageListeners.add(this._editor.onDidChangeModel((()=>this.closeMessage()))),this._messageListeners.add(bs(this._messageWidget.value.getDomNode(),or.MOUSE_ENTER,(()=>this._mouseOverMessage=!0),!0)),this._messageListeners.add(bs(this._messageWidget.value.getDomNode(),or.MOUSE_LEAVE,(()=>this._mouseOverMessage=!1),!0)),this._messageListeners.add(this._editor.onMouseMove((e=>{e.target.position&&(i?i.containsPosition(e.target.position)||this.closeMessage():i=new tc(t.lineNumber-3,1,e.target.position.lineNumber+3,1))})))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Qx.fadeOut(this._messageWidget.value))}};Yx.ID="editor.contrib.messageController",Yx.MESSAGE_VISIBLE=new od("messageVisible",!1,me(0,"Whether the editor is currently showing an inline message")),Yx=Gx=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Zx(1,sd),Zx(2,Hx)],Yx),jd(new(Vd.bindToContribution(Yx.get))({id:"leaveEditorMessage",precondition:Yx.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}}));class Qx{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const s=document.createElement("div");"string"==typeof n?(s.classList.add("message"),s.textContent=n):(n.classList.add("message"),s.appendChild(n)),this._domNode.appendChild(s);const r=document.createElement("div");r.classList.add("anchor","below"),this._domNode.appendChild(r),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",2===e)}}Gd(Yx.ID,Yx,4);const Xx={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:yg.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};class Jx{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){var n;if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let o;if(void 0===e||al(e)||e instanceof HTMLElement)o=e;else if(vl(e.markdown)){this._hoverWidget||this.show(me(0,"Loading..."),t),this._cancellationTokenSource=new Pt;const i=this._cancellationTokenSource.token;if(o=await e.markdown(i),void 0===o&&(o=e.markdownNotSupportedFallback),this.isDisposed||i.isCancellationRequested)return}else o=null!==(n=e.markdown)&&void 0!==n?n:e.markdownNotSupportedFallback;this.show(o,t,i)}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const o={content:e,target:this.target,appearance:{showPointer:"element"===this.hoverDelegate.placement,skipFadeInAnimation:!this.fadeInAnimation||!!n},position:{hoverPosition:2},...i};this._hoverWidget=this.hoverDelegate.showHover(o,t)}null==n||n.dispose()}hasContent(e){return!(!e||ih(e)&&!e.value)}get isDisposed(){var e;return null===(e=this._hoverWidget)||void 0===e?void 0:e.isDisposed}dispose(){var e,t;null===(e=this._hoverWidget)||void 0===e||e.dispose(),null===(t=this._cancellationTokenSource)||void 0===t||t.dispose(!0),this._cancellationTokenSource=void 0}}function eD(e,t,i,n){let o,s;const r=(t,i)=>{var n;const r=void 0!==s;t&&(null==s||s.dispose(),s=void 0),i&&(null==o||o.dispose(),o=void 0),r&&(null===(n=e.onDidHideHover)||void 0===n||n.call(e))},a=(o,r,a)=>new $t((async()=>{s&&!s.isDisposed||(s=new Jx(e,a||t,o>0),await s.update(i,r,n))}),o),l=bs(t,or.MOUSE_OVER,(()=>{if(o)return;const i=new M;i.add(bs(t,or.MOUSE_LEAVE,(e=>r(!1,e.fromElement===t)),!0)),i.add(bs(t,or.MOUSE_DOWN,(()=>r(!0,!0)),!0));const n={targetElements:[t],dispose:()=>{}};if(void 0===e.placement||"mouse"===e.placement){const e=e=>{n.x=e.x+10,e.target instanceof HTMLElement&&e.target.classList.contains("action-label")&&r(!0,!0)};i.add(bs(t,or.MOUSE_MOVE,e,!0))}i.add(a(e.delay,!1,n)),o=i}),!0),h=bs(t,or.FOCUS,(()=>{if(o)return;const i={targetElements:[t],dispose:()=>{}},n=new M;n.add(bs(t,or.BLUR,(()=>r(!0,!0)),!0)),n.add(a(e.delay,!1,i)),o=n}),!0);return{show:e=>{r(!1,!0),a(0,e)},hide:()=>{r(!0,!0)},update:async(e,t)=>{i=e,await(null==s?void 0:s.update(i,void 0,t))},dispose:()=>{l.dispose(),h.dispose(),r(!0,!0)}}}class tD{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach((n=>n.splice(e,t,i)))}}function iD(e,t,i){return Math.min(Math.max(e,t),i)}class nD{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}class oD{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){const t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n<this._values.length&&(this._n+=1),this._val=this._sum/this._n,this._val}get value(){return this._val}}var sD=i(7703),rD={};rD.styleTagTransform=Vr(),rD.setAttributes=Pr(),rD.insert=Rr().bind(null,"head"),rD.domAPI=Tr(),rD.insertStyleElement=Br(),Ir()(sD.Z,rD),sD.Z&&sD.Z.locals&&sD.Z.locals;class aD extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}class lD{constructor(){this._hooks=new M,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,n,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=o;let s=e;try{e.setPointerCapture(t),this._hooks.add(I((()=>{try{e.releasePointerCapture(t)}catch(e){}})))}catch(t){s=as(e)}this._hooks.add(bs(s,or.POINTER_MOVE,(e=>{e.buttons===i?(e.preventDefault(),this._pointerMoveCallback(e)):this.stopMonitoring(!0)}))),this._hooks.add(bs(s,or.POINTER_UP,(e=>this.stopMonitoring(!0))))}}class hD extends T{onclick(e,t){this._register(bs(e,or.CLICK,(i=>t(new Mt(as(e),i)))))}onmousedown(e,t){this._register(bs(e,or.MOUSE_DOWN,(i=>t(new Mt(as(e),i)))))}onmouseover(e,t){this._register(bs(e,or.MOUSE_OVER,(i=>t(new Mt(as(e),i)))))}onmouseleave(e,t){this._register(bs(e,or.MOUSE_LEAVE,(i=>t(new Mt(as(e),i)))))}onkeydown(e,t){this._register(bs(e,or.KEY_DOWN,(e=>t(new Dt(e)))))}onkeyup(e,t){this._register(bs(e,or.KEY_UP,(e=>t(new Dt(e)))))}oninput(e,t){this._register(bs(e,or.INPUT,t))}onblur(e,t){this._register(bs(e,or.BLUR,t))}onfocus(e,t){this._register(bs(e,or.FOCUS,t))}ignoreGesture(e){return KL.ignoreTarget(e)}}class dD extends hD{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",void 0!==e.top&&(this.bgDomNode.style.top="0px"),void 0!==e.left&&(this.bgDomNode.style.left="0px"),void 0!==e.bottom&&(this.bgDomNode.style.bottom="0px"),void 0!==e.right&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...Ll.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width="11px",this.domNode.style.height="11px",void 0!==e.top&&(this.domNode.style.top=e.top+"px"),void 0!==e.left&&(this.domNode.style.left=e.left+"px"),void 0!==e.bottom&&(this.domNode.style.bottom=e.bottom+"px"),void 0!==e.right&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new lD),this._register(Cs(this.bgDomNode,or.POINTER_DOWN,(e=>this._arrowPointerDown(e)))),this._register(Cs(this.domNode,or.POINTER_DOWN,(e=>this._arrowPointerDown(e)))),this._pointerdownRepeatTimer=this._register(new xs),this._pointerdownScheduleRepeatTimer=this._register(new $t)}_arrowPointerDown(e){e.target&&e.target instanceof Element&&(this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet((()=>{this._pointerdownRepeatTimer.cancelAndSet((()=>this._onActivate()),1e3/24,as(e))}),200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>{}),(()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()})),e.preventDefault())}}class cD extends T{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new $t)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return 2!==this._visibility&&(3===this._visibility||this._rawShouldBeVisible)}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){this._isNeeded?this._shouldBeVisible?this._reveal():this._hide(!0):this._hide(!1)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet((()=>{var e;null===(e=this._domNode)||void 0===e||e.setClassName(this._visibleClassName)}),0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,null===(t=this._domNode)||void 0===t||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}class uD extends hD{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new cD(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new lD),this._shouldRender=!0,this.domNode=Fx(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(bs(this.domNode.domNode,or.POINTER_DOWN,(e=>this._domNodePointerDown(e))))}_createArrow(e){const t=this._register(new dD(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=Fx(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),"number"==typeof i&&this.slider.setWidth(i),"number"==typeof n&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(bs(this.slider.domNode,or.POINTER_DOWN,(e=>{0===e.button&&(e.preventDefault(),this._sliderPointerDown(e))}))),this.onclick(this.slider.domNode,(e=>{e.leftButton&&e.stopPropagation()}))}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);i<=o&&o<=n?0===e.button&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&"number"==typeof e.offsetX&&"number"==typeof e.offsetY)t=e.offsetX,i=e.offsetY;else{const n=As(this.domNode.domNode);t=e.pageX-n.left,i=e.pageY-n.top}const n=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),0===e.button&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!(e.target&&e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>{const o=this._sliderOrthogonalPointerPosition(e),s=Math.abs(o-i);if(We&&s>140)return void this._setDesiredScrollPositionNow(n.getScrollPosition());const r=this._sliderPointerPosition(e)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(r))}),(()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()})),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}class gD{constructor(e,t,i,n,o,s){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=o,this._scrollPosition=s,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new gD(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t&&(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,n,o){const s=Math.max(0,i-e),r=Math.max(0,s-2*t),a=n>0&&n>i;if(!a)return{computedAvailableSize:Math.round(s),computedIsNeeded:a,computedSliderSize:Math.round(r),computedSliderRatio:0,computedSliderPosition:0};const l=Math.round(Math.max(20,Math.floor(i*r/n))),h=(r-l)/(n-i),d=o*h;return{computedAvailableSize:Math.round(s),computedIsNeeded:a,computedSliderSize:Math.round(l),computedSliderRatio:h,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){const e=gD._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return t<this._computedSliderPosition?i-=this._visibleSize:i+=this._visibleSize,i}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;const t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}}class pD extends uD{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new gD(t.horizontalHasArrows?t.arrowSize:0,2===t.horizontal?0:t.horizontalScrollbarSize,2===t.vertical?0:t.verticalScrollbarSize,n.width,n.scrollWidth,o.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows){const e=(t.arrowSize-11)/2,i=(t.horizontalScrollbarSize-11)/2;this._createArrow({className:"scra",icon:Sl.scrollbarButtonLeft,top:i,left:e,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Tt(null,1,0))}),this._createArrow({className:"scra",icon:Sl.scrollbarButtonRight,top:i,left:void 0,bottom:void 0,right:e,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Tt(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(2===e.horizontal?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class mD extends uD{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new gD(t.verticalHasArrows?t.arrowSize:0,2===t.vertical?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const e=(t.arrowSize-11)/2,i=(t.verticalScrollbarSize-11)/2;this._createArrow({className:"scra",icon:Sl.scrollbarButtonUp,top:e,left:i,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Tt(null,0,1))}),this._createArrow({className:"scra",icon:Sl.scrollbarButtonDown,top:void 0,left:i,bottom:e,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Tt(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class fD{constructor(e,t,i,n,o,s,r){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,i|=0,n|=0,o|=0,s|=0,r|=0),this.rawScrollLeft=n,this.rawScrollTop=r,t<0&&(t=0),n+t>i&&(n=i-t),n<0&&(n=0),o<0&&(o=0),r+o>s&&(r=s-o),r<0&&(r=0),this.width=t,this.scrollWidth=i,this.scrollLeft=n,this.height=o,this.scrollHeight=s,this.scrollTop=r}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new fD(this._forceIntegerValues,void 0!==e.width?e.width:this.width,void 0!==e.scrollWidth?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,void 0!==e.height?e.height:this.height,void 0!==e.scrollHeight?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new fD(this._forceIntegerValues,this.width,this.scrollWidth,void 0!==e.scrollLeft?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,void 0!==e.scrollTop?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,s=this.height!==e.height,r=this.scrollHeight!==e.scrollHeight,a=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:n,scrollLeftChanged:o,heightChanged:s,scrollHeightChanged:r,scrollTopChanged:a}}}class _D extends T{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new q),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new fD(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var i;const n=this._state.withScrollDimensions(e,t);this._setState(n,Boolean(this._smoothScrolling)),null===(i=this._smoothScrolling)||void 0===i||i.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(0===this._smoothScrollDuration)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:void 0===e.scrollLeft?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:void 0===e.scrollTop?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;n=t?new wD(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{const t=this._state.withScrollPosition(e);this._smoothScrolling=wD.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))}hasPendingScrollAnimation(){return Boolean(this._smoothScrolling)}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);return this._setState(t,!0),this._smoothScrolling?e.isDone?(this._smoothScrolling.dispose(),void(this._smoothScrolling=null)):void(this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))):void 0}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class vD{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function bD(e,t){const i=t-e;return function(t){return e+i*(1-(n=1-t,Math.pow(n,3)));var n}}class wD{constructor(e,t,i,n){this.from=e,this.to=t,this.duration=n,this.startTime=i,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,i){if(Math.abs(e-t)>2.5*i){let r,a;return e<t?(r=e+.75*i,a=t-.75*i):(r=e-.75*i,a=t+.75*i),n=bD(e,r),o=bD(a,t),s=.33,function(e){return e<s?n(e/s):o((e-s)/(1-s))}}var n,o,s;return bD(e,t)}dispose(){null!==this.animationFrameDisposable&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){const t=(e-this.startTime)/this.duration;if(t<1){const e=this.scrollLeft(t),i=this.scrollTop(t);return new vD(e,i,!1)}return new vD(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,t,i){return wD.start(e,t,i)}static start(e,t,i){i+=10;const n=Date.now()-10;return new wD(e,t,n,i)}}var CD,yD=i(7198),SD={};SD.styleTagTransform=Vr(),SD.setAttributes=Pr(),SD.insert=Rr().bind(null,"head"),SD.domAPI=Tr(),SD.insertStyleElement=Br(),Ir()(yD.Z,SD),yD.Z&&yD.Z.locals&&yD.Z.locals;class kD{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}class LD{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(-1===this._front&&-1===this._rear)return!1;let e=1,t=0,i=1,n=this._rear;for(;;){const o=n===this._front?e:Math.pow(2,-i);if(e-=o,t+=this._memory[n].score*o,n===this._front)break;n=(this._capacity+n-1)%this._capacity,i++}return t<=.5}acceptStandardWheelEvent(e){const t=as(e.browserEvent).devicePixelRatio/ee.INSTANCE.getZoomFactor();We||ze?this.accept(Date.now(),e.deltaX/t,e.deltaY/t):this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,i){const n=new kD(e,t,i);n.score=this._computeScore(n),-1===this._front&&-1===this._rear?(this._memory[0]=n,this._front=0,this._rear=0):(this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=n)}_computeScore(e){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let t=.5;return-1===this._front&&-1===this._rear||this._memory[this._rear],this._isAlmostInt(e.deltaX)&&this._isAlmostInt(e.deltaY)||(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}LD.INSTANCE=new LD;class xD extends hD{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new q),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new q),e.style.overflow="hidden",this._options=function(e){const t={lazyRender:void 0!==e.lazyRender&&e.lazyRender,className:void 0!==e.className?e.className:"",useShadows:void 0===e.useShadows||e.useShadows,handleMouseWheel:void 0===e.handleMouseWheel||e.handleMouseWheel,flipAxes:void 0!==e.flipAxes&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:void 0!==e.consumeMouseWheelIfScrollbarIsNeeded&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:void 0!==e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:void 0!==e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:void 0!==e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:void 0!==e.fastScrollSensitivity?e.fastScrollSensitivity:5,scrollPredominantAxis:void 0===e.scrollPredominantAxis||e.scrollPredominantAxis,mouseWheelSmoothScroll:void 0===e.mouseWheelSmoothScroll||e.mouseWheelSmoothScroll,arrowSize:void 0!==e.arrowSize?e.arrowSize:11,listenOnDomNode:void 0!==e.listenOnDomNode?e.listenOnDomNode:null,horizontal:void 0!==e.horizontal?e.horizontal:1,horizontalScrollbarSize:void 0!==e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:void 0!==e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:void 0!==e.horizontalHasArrows&&e.horizontalHasArrows,vertical:void 0!==e.vertical?e.vertical:1,verticalScrollbarSize:void 0!==e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:void 0!==e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:void 0!==e.verticalSliderSize?e.verticalSliderSize:0,scrollByPage:void 0!==e.scrollByPage&&e.scrollByPage};return t.horizontalSliderSize=void 0!==e.horizontalSliderSize?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=void 0!==e.verticalSliderSize?e.verticalSliderSize:t.verticalScrollbarSize,Ve&&(t.className+=" mac"),t}(t),this._scrollable=i,this._register(this._scrollable.onScroll((e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)})));const n={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new mD(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new pD(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Fx(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Fx(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Fx(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,(e=>this._onMouseOver(e))),this.onmouseleave(this._listenOnDomNode,(e=>this._onMouseLeave(e))),this._hideTimeout=this._register(new $t),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=E(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Ve&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){void 0!==e.handleMouseWheel&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),void 0!==e.mouseWheelScrollSensitivity&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),void 0!==e.fastScrollSensitivity&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),void 0!==e.scrollPredominantAxis&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),void 0!==e.horizontal&&(this._options.horizontal=e.horizontal),void 0!==e.vertical&&(this._options.vertical=e.vertical),void 0!==e.horizontalScrollbarSize&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),void 0!==e.verticalScrollbarSize&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),void 0!==e.scrollByPage&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Tt(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=E(this._mouseWheelToDispose),e)){const e=e=>{this._onMouseWheel(new Tt(e))};this._mouseWheelToDispose.push(bs(this._listenOnDomNode,or.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(e){var t;if(null===(t=e.browserEvent)||void 0===t?void 0:t.defaultPrevented)return;const i=LD.INSTANCE;i.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let t=e.deltaY*this._options.mouseWheelScrollSensitivity,o=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&o+t===0?o=t=0:Math.abs(t)>=Math.abs(o)?o=0:t=0),this._options.flipAxes&&([t,o]=[o,t]);const s=!Ve&&e.browserEvent&&e.browserEvent.shiftKey;!this._options.scrollYToX&&!s||o||(o=t,t=0),e.browserEvent&&e.browserEvent.altKey&&(o*=this._options.fastScrollSensitivity,t*=this._options.fastScrollSensitivity);const r=this._scrollable.getFutureScrollPosition();let a={};if(t){const e=50*t,i=r.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(a,i)}if(o){const e=50*o,t=r.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(a,t)}a=this._scrollable.validateScrollPosition(a),(r.scrollLeft!==a.scrollLeft||r.scrollTop!==a.scrollTop)&&(this._options.mouseWheelSmoothScroll&&i.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(a):this._scrollable.setScrollPositionNow(a),n=!0)}let o=n;!o&&this._options.alwaysConsumeMouseWheel&&(o=!0),!o&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(o=!0),o&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,n=i?" left":"",o=t?" top":"",s=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${o}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){this._mouseIsOver||this._isDragging||(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){this._mouseIsOver||this._isDragging||this._hideTimeout.cancelAndSet((()=>this._hide()),500)}}class DD extends xD{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const i=new _D({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:t=>Ls(as(e),t)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class ED extends xD{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class ND extends xD{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const i=new _D({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:t=>Ls(as(e),t)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll((e=>{e.scrollTopChanged&&(this._element.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this._element.scrollLeft=e.scrollLeft)}))),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function ID(e,t){const i=[];for(const n of t){if(e.start>=n.range.end)continue;if(e.end<n.range.start)break;const t=CD.intersect(e,n.range);CD.isEmpty(t)||i.push({range:t,size:n.size})}return i}function MD({start:e,end:t},i){return{start:e+i,end:t+i}}!function(e){function t(e,t){if(e.start>=t.end||t.start>=e.end)return{start:0,end:0};const i=Math.max(e.start,t.start),n=Math.min(e.end,t.end);return n-i<=0?{start:0,end:0}:{start:i,end:n}}function i(e){return e.end-e.start<=0}e.intersect=t,e.isEmpty=i,e.intersects=function(e,n){return!i(t(e,n))},e.relativeComplement=function(e,t){const n=[],o={start:e.start,end:Math.min(t.start,e.end)},s={start:Math.max(t.end,e.start),end:e.end};return i(o)||n.push(o),i(s)||n.push(s),n}}(CD||(CD={}));class TD{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=null!=e?e:0,this._size=this._paddingTop}splice(e,t,i=[]){const n=i.length-t,o=ID({start:0,end:e},this.groups),s=ID({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map((e=>({range:MD(e.range,n),size:e.size}))),r=i.map(((t,i)=>({range:{start:e+i,end:e+i+1},size:t.size})));this.groups=function(...e){return function(e){const t=[];let i=null;for(const n of e){const e=n.range.start,o=n.range.end,s=n.size;i&&s===i.size?i.range.end=o:(i={range:{start:e,end:o},size:s},t.push(i))}return t}(e.reduce(((e,t)=>e.concat(t)),[]))}(o,r,s),this._size=this._paddingTop+this.groups.reduce(((e,t)=>e+t.size*(t.range.end-t.range.start)),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e<this._paddingTop)return 0;let t=0,i=this._paddingTop;for(const n of this.groups){const o=n.range.end-n.range.start,s=i+o*n.size;if(e<s)return t+Math.floor((e-i)/n.size);t+=o,i=s}return t}indexAfter(e){return Math.min(this.indexAt(e)+1,this.count)}positionAt(e){if(e<0)return-1;let t=0,i=0;for(const n of this.groups){const o=n.range.end-n.range.start,s=i+o;if(e<s)return this._paddingTop+t+(e-i)*n.size;t+=o*n.size,i=s}return-1}}class AD{constructor(e){this.renderers=e,this.cache=new Map,this.transactionNodesPendingRemoval=new Set,this.inTransaction=!1}alloc(e){let t=this.getTemplateCache(e).pop(),i=!1;if(t)i=this.transactionNodesPendingRemoval.has(t.domNode),i&&this.transactionNodesPendingRemoval.delete(t.domNode);else{const i=mr(".monaco-list-row");t={domNode:i,templateId:e,templateData:this.getRenderer(e).renderTemplate(i)}}return{row:t,isReusingConnectedDomNode:i}}release(e){e&&this.releaseRow(e)}transact(e){if(this.inTransaction)throw new Error("Already in transaction");this.inTransaction=!0;try{e()}finally{for(const e of this.transactionNodesPendingRemoval)this.doRemoveNode(e);this.transactionNodesPendingRemoval.clear(),this.inTransaction=!1}}releaseRow(e){const{domNode:t,templateId:i}=e;t&&(this.inTransaction?this.transactionNodesPendingRemoval.add(t):this.doRemoveNode(t)),this.getTemplateCache(i).push(e)}doRemoveNode(e){e.classList.remove("scrolling"),function(e){var t;try{null===(t=e.parentElement)||void 0===t||t.removeChild(e)}catch(e){}}(e)}getTemplateCache(e){let t=this.cache.get(e);return t||(t=[],this.cache.set(e,t)),t}dispose(){this.cache.forEach(((e,t)=>{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null})),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var RD=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};const OD={CurrentDragAndDropData:void 0},PD={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements:e=>[e],getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class FD{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class BD{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class WD{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;t<e.files.length;t++){const i=e.files.item(t);i&&(i.size||i.type)&&this.files.push(i)}}}getData(){return{types:this.types,files:this.files}}}class VD{constructor(e){(null==e?void 0:e.getSetSize)?this.getSetSize=e.getSetSize.bind(e):this.getSetSize=(e,t,i)=>i,(null==e?void 0:e.getPosInSet)?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(e,t)=>t+1,(null==e?void 0:e.getRole)?this.getRole=e.getRole.bind(e):this.getRole=e=>"listitem",(null==e?void 0:e.isChecked)?this.isChecked=e.isChecked.bind(e):this.isChecked=e=>{}}}class zD{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const e of this.items)this.measureItemWidth(e);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:Os(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,i,n=PD){var o,s,r,a,l,h,d,c,u,g,p,m,f;if(this.virtualDelegate=t,this.domId="list_id_"+ ++zD.InstanceCount,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Ht(50),this.splicing=!1,this.dragOverAnimationStopDisposable=T.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=T.None,this.onDragLeaveTimeout=T.None,this.disposables=new M,this._onDidChangeContentHeight=new q,this._onDidChangeContentWidth=new q,this.onDidChangeContentHeight=z.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this._horizontalScrolling=!1,n.horizontalScrolling&&n.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new TD(null!==(o=n.paddingTop)&&void 0!==o?o:0);for(const e of i)this.renderers.set(e.templateId,e);this.cache=this.disposables.add(new AD(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support","boolean"!=typeof n.mouseSupport||n.mouseSupport),this._horizontalScrolling=null!==(s=n.horizontalScrolling)&&void 0!==s?s:PD.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=void 0===n.paddingBottom?0:n.paddingBottom,this.accessibilityProvider=new VD(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(null!==(r=n.transformOptimization)&&void 0!==r?r:PD.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(KL.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new _D({forceIntegerValues:!0,smoothScrollDuration:null!==(a=n.smoothScrolling)&&void 0!==a&&a?125:0,scheduleAtNextAnimationFrame:e=>Ls(as(this.domNode),e)})),this.scrollableElement=this.disposables.add(new ED(this.rowsContainer,{alwaysConsumeMouseWheel:null!==(l=n.alwaysConsumeMouseWheel)&&void 0!==l?l:PD.alwaysConsumeMouseWheel,horizontal:1,vertical:null!==(h=n.verticalScrollMode)&&void 0!==h?h:PD.verticalScrollMode,useShadows:null!==(d=n.useShadows)&&void 0!==d?d:PD.useShadows,mouseWheelScrollSensitivity:n.mouseWheelScrollSensitivity,fastScrollSensitivity:n.fastScrollSensitivity,scrollByPage:n.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(bs(this.rowsContainer,UL.Change,(e=>this.onTouchChange(e)))),this.disposables.add(bs(this.scrollableElement.getDomNode(),"scroll",(e=>e.target.scrollTop=0))),this.disposables.add(bs(this.domNode,"dragover",(e=>this.onDragOver(this.toDragEvent(e))))),this.disposables.add(bs(this.domNode,"drop",(e=>this.onDrop(this.toDragEvent(e))))),this.disposables.add(bs(this.domNode,"dragleave",(e=>this.onDragLeave(this.toDragEvent(e))))),this.disposables.add(bs(this.domNode,"dragend",(e=>this.onDragEnd(e)))),this.setRowLineHeight=null!==(c=n.setRowLineHeight)&&void 0!==c?c:PD.setRowLineHeight,this.setRowHeight=null!==(u=n.setRowHeight)&&void 0!==u?u:PD.setRowHeight,this.supportDynamicHeights=null!==(g=n.supportDynamicHeights)&&void 0!==g?g:PD.supportDynamicHeights,this.dnd=null!==(p=n.dnd)&&void 0!==p?p:this.disposables.add(PD.dnd),this.layout(null===(m=n.initialSize)||void 0===m?void 0:m.height,null===(f=n.initialSize)||void 0===f?void 0:f.width)}updateOptions(e){let t;if(void 0!==e.paddingBottom&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),void 0!==e.smoothScrolling&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),void 0!==e.horizontalScrolling&&(this.horizontalScrolling=e.horizontalScrolling),void 0!==e.scrollByPage&&(t={...null!=t?t:{},scrollByPage:e.scrollByPage}),void 0!==e.mouseWheelScrollSensitivity&&(t={...null!=t?t:{},mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),void 0!==e.fastScrollSensitivity&&(t={...null!=t?t:{},fastScrollSensitivity:e.fastScrollSensitivity}),t&&this.scrollableElement.updateOptions(t),void 0!==e.paddingTop&&e.paddingTop!==this.rangeMap.paddingTop){const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),i=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(t,Math.max(0,this.lastRenderTop+i),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},s=CD.intersect(n,o),r=new Map;for(let e=s.end-1;e>=s.start;e--){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){let i=r.get(t.templateId);i||(i=[],r.set(t.templateId,i));const n=this.renderers.get(t.templateId);n&&n.disposeElement&&n.disposeElement(t.element,e,t.row.templateData,t.size),i.push(t.row)}t.row=null}const a={start:e+t,end:this.items.length},l=CD.intersect(a,n),h=CD.relativeComplement(a,n),d=i.map((e=>({id:String(this.itemId++),element:e,templateId:this.virtualDelegate.getTemplateId(e),size:this.virtualDelegate.getHeight(e),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(e),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:T.None,checkedDisposable:T.None})));let c;0===e&&t>=this.items.length?(this.rangeMap=new TD(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,d),c=this.items,this.items=d):(this.rangeMap.splice(e,t,d),c=this.items.splice(e,t,...d));const u=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=MD(l,u),m=CD.intersect(g,p);for(let e=m.start;e<m.end;e++)this.updateItemInDOM(this.items[e],e);const f=CD.relativeComplement(p,g);for(const e of f)for(let t=e.start;t<e.end;t++)this.removeItemFromDOM(t);const _=h.map((e=>MD(e,u))),v=[{start:e,end:e+i.length},..._].map((e=>CD.intersect(g,e))),b=this.getNextToLastElement(v);for(const e of v)for(let t=e.start;t<e.end;t++){const e=this.items[t],i=r.get(e.templateId),n=null==i?void 0:i.pop();this.insertItemInDOM(t,b,n)}for(const e of r.values())for(const t of e)this.cache.release(t);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),c.map((e=>e.element))}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Ls(as(this.domNode),(()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null})))}eventuallyUpdateScrollWidth(){this.horizontalScrolling?this.scrollableElementWidthDelayer.trigger((()=>this.updateScrollWidth())):this.scrollableElementWidthDelayer.cancel()}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)void 0!==t.width&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:0===e?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){return this.getRenderRange(this.lastRenderTop,this.lastRenderHeight).start}element(e){return this.items[e].element}indexOf(e){return this.items.findIndex((t=>t.element===e))}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){const i={height:"number"==typeof e?e:Ps(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),void 0!==t&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:"number"==typeof t?t:Os(this.domNode)})}render(e,t,i,n,o,s=!1){const r=this.getRenderRange(t,i),a=CD.relativeComplement(r,e),l=CD.relativeComplement(e,r),h=this.getNextToLastElement(a);if(s){const t=CD.intersect(e,r);for(let e=t.start;e<t.end;e++)this.updateItemInDOM(this.items[e],e)}this.cache.transact((()=>{for(const e of l)for(let t=e.start;t<e.end;t++)this.removeItemFromDOM(t);for(const e of a)for(let t=e.start;t<e.end;t++)this.insertItemInDOM(t,h)})),void 0!==n&&(this.rowsContainer.style.left=`-${n}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&void 0!==o&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t,i){const n=this.items[e];let o=!1;if(!n.row)if(i)n.row=i;else{const e=this.cache.alloc(n.templateId);n.row=e.row,o=e.isReusingConnectedDomNode}const s=this.accessibilityProvider.getRole(n.element)||"listitem";n.row.domNode.setAttribute("role",s);const r=this.accessibilityProvider.isChecked(n.element);if("boolean"==typeof r)n.row.domNode.setAttribute("aria-checked",String(!!r));else if(r){const e=e=>n.row.domNode.setAttribute("aria-checked",String(!!e));e(r.value),n.checkedDisposable=r.onDidChange(e)}!o&&n.row.domNode.parentElement||(t?this.rowsContainer.insertBefore(n.row.domNode,t):this.rowsContainer.appendChild(n.row.domNode)),this.updateItemInDOM(n,e);const a=this.renderers.get(n.templateId);if(!a)throw new Error(`No renderer found for template id ${n.templateId}`);null==a||a.renderElement(n.element,e,n.row.templateData,n.size);const l=this.dnd.getDragURI(n.element);n.dragStartDisposable.dispose(),n.row.domNode.draggable=!!l,l&&(n.dragStartDisposable=bs(n.row.domNode,"dragstart",(e=>this.onDragStart(n.element,l,e)))),this.horizontalScrolling&&(this.measureItemWidth(n),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=Os(e.row.domNode);const t=as(e.row.domNode).getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2==0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const i=this.renderers.get(t.templateId);i&&i.disposeElement&&i.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return z.map(this.disposables.add(new OS(this.domNode,"click")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseDblClick(){return z.map(this.disposables.add(new OS(this.domNode,"dblclick")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseMiddleClick(){return z.filter(z.map(this.disposables.add(new OS(this.domNode,"auxclick")).event,(e=>this.toMouseEvent(e)),this.disposables),(e=>1===e.browserEvent.button),this.disposables)}get onMouseDown(){return z.map(this.disposables.add(new OS(this.domNode,"mousedown")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseOver(){return z.map(this.disposables.add(new OS(this.domNode,"mouseover")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseOut(){return z.map(this.disposables.add(new OS(this.domNode,"mouseout")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onContextMenu(){return z.any(z.map(this.disposables.add(new OS(this.domNode,"contextmenu")).event,(e=>this.toMouseEvent(e)),this.disposables),z.map(this.disposables.add(new OS(this.domNode,UL.Contextmenu)).event,(e=>this.toGestureEvent(e)),this.disposables))}get onTouchStart(){return z.map(this.disposables.add(new OS(this.domNode,"touchstart")).event,(e=>this.toTouchEvent(e)),this.disposables)}get onTap(){return z.map(this.disposables.add(new OS(this.rowsContainer,UL.Tap)).event,(e=>this.toGestureEvent(e)),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){var n,o;if(!i.dataTransfer)return;const s=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(Xx.TEXT,t),i.dataTransfer.setDragImage){let e;this.dnd.getDragLabel&&(e=this.dnd.getDragLabel(s,i)),void 0===e&&(e=String(s.length));const t=mr(".monaco-drag-image");t.textContent=e;const n=(e=>{for(;e&&!e.classList.contains("monaco-workbench");)e=e.parentElement;return e||this.domNode.ownerDocument})(this.domNode);n.appendChild(t),i.dataTransfer.setDragImage(t,-10,-10),setTimeout((()=>n.removeChild(t)),0)}this.domNode.classList.add("dragging"),this.currentDragData=new FD(s),OD.CurrentDragAndDropData=new BD(s),null===(o=(n=this.dnd).onDragStart)||void 0===o||o.call(n,this.currentDragData,i)}onDragOver(e){var t;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),OD.CurrentDragAndDropData&&"vscode-ui"===OD.CurrentDragAndDropData.getData())return!1;if(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer)return!1;if(!this.currentDragData)if(OD.CurrentDragAndDropData)this.currentDragData=OD.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new WD}const i=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop="boolean"==typeof i?i:i.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;let n;if(e.browserEvent.dataTransfer.dropEffect="boolean"!=typeof i&&0===i.effect?"copy":"move",n="boolean"!=typeof i&&i.feedback?i.feedback:void 0===e.index?[-1]:[e.index],n=Vc(n).filter((e=>e>=-1&&e<this.length)).sort(((e,t)=>e-t)),n=-1===n[0]?[-1]:n,o=this.currentDragFeedback,s=n,Array.isArray(o)&&Array.isArray(s)?Ic(o,s):o===s)return!0;var o,s;if(this.currentDragFeedback=n,this.currentDragFeedbackDisposable.dispose(),-1===n[0])this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=I((()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")}));else{for(const e of n){const i=this.items[e];i.dropTarget=!0,null===(t=i.row)||void 0===t||t.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=I((()=>{var e;for(const t of n){const i=this.items[t];i.dropTarget=!1,null===(e=i.row)||void 0===e||e.domNode.classList.remove("drop-target")}}))}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=jt((()=>this.clearDragOverFeedback()),100,this.disposables),this.currentDragData&&(null===(i=(t=this.dnd).onDragLeave)||void 0===i||i.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,OD.CurrentDragAndDropData=void 0,t&&e.browserEvent.dataTransfer&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.browserEvent))}onDragEnd(e){var t,i;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,OD.CurrentDragAndDropData=void 0,null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=T.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const e=Ts(this.domNode).top;this.dragOverAnimationDisposable=function(e,t){const i=()=>{t(),n=Ls(e,i)};let n=Ls(e,i);return I((()=>n.dispose()))}(as(this.domNode),this.animateDragAndDropScrollTop.bind(this,e))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=jt((()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}),1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(void 0===this.dragOverMouseY)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;i instanceof HTMLElement&&i!==this.rowsContainer&&t.contains(i);){const e=i.getAttribute("data-index");if(e){const t=Number(e);if(!isNaN(t))return t}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){const n=this.getRenderRange(e,t);let o,s;e===this.elementTop(n.start)?(o=n.start,s=0):n.end-n.start>1&&(o=n.start+1,s=this.elementTop(o)-e);let r=0;for(;;){const a=this.getRenderRange(e,t);let l=!1;for(let e=a.start;e<a.end;e++){const t=this.probeDynamicHeight(e);0!==t&&this.rangeMap.splice(e,1,[this.items[e]]),r+=t,l=l||0!==t}if(!l){0!==r&&this.eventuallyUpdateScrollDimensions();const t=CD.relativeComplement(n,a);for(const e of t)for(let t=e.start;t<e.end;t++)this.items[t].row&&this.removeItemFromDOM(t);const l=CD.relativeComplement(a,n);for(const e of l)for(let t=e.start;t<e.end;t++){const e=t+1,i=e<this.items.length?this.items[e].row:null,n=i?i.domNode:null;this.insertItemInDOM(t,n)}for(let e=a.start;e<a.end;e++)this.items[e].row&&this.updateItemInDOM(this.items[e],e);if("number"==typeof o){const t=this.scrollable.getFutureScrollPosition().scrollTop-e,n=this.elementTop(o)-s+t;this.setScrollTop(n,i)}return void this._onDidChangeContentHeight.fire(this.contentHeight)}}}probeDynamicHeight(e){var t,i,n;const o=this.items[e];if(this.virtualDelegate.getDynamicHeight){const e=this.virtualDelegate.getDynamicHeight(o.element);if(null!==e){const t=o.size;return o.size=e,o.lastDynamicHeightWidth=this.renderWidth,e-t}}if(!o.hasDynamicHeight||o.lastDynamicHeightWidth===this.renderWidth)return 0;if(this.virtualDelegate.hasDynamicHeight&&!this.virtualDelegate.hasDynamicHeight(o.element))return 0;const s=o.size;if(o.row)return o.row.domNode.style.height="",o.size=o.row.domNode.offsetHeight,o.lastDynamicHeightWidth=this.renderWidth,o.size-s;const{row:r}=this.cache.alloc(o.templateId);r.domNode.style.height="",this.rowsContainer.appendChild(r.domNode);const a=this.renderers.get(o.templateId);if(!a)throw new b("Missing renderer for templateId: "+o.templateId);return a.renderElement(o.element,e,r.templateData,void 0),o.size=r.domNode.offsetHeight,null===(t=a.disposeElement)||void 0===t||t.call(a,o.element,e,r.templateData,void 0),null===(n=(i=this.virtualDelegate).setDynamicHeight)||void 0===n||n.call(i,o.element,o.size),o.lastDynamicHeightWidth=this.renderWidth,this.rowsContainer.removeChild(r.domNode),this.cache.release(r),o.size-s}getNextToLastElement(e){const t=e[e.length-1];if(!t)return null;const i=this.items[t.end];return i&&i.row?i.row.domNode:null}getElementDomId(e){return`${this.domId}_${e}`}dispose(){var e,t;for(const t of this.items)if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const i=this.renderers.get(t.row.templateId);i&&(null===(e=i.disposeElement)||void 0===e||e.call(i,t.element,-1,t.row.templateData,void 0),i.disposeTemplate(t.row.templateData))}this.items=[],this.domNode&&this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),null===(t=this.dragOverAnimationDisposable)||void 0===t||t.dispose(),this.disposables.dispose()}}zD.InstanceCount=0,RD([HL],zD.prototype,"onMouseClick",null),RD([HL],zD.prototype,"onMouseDblClick",null),RD([HL],zD.prototype,"onMouseMiddleClick",null),RD([HL],zD.prototype,"onMouseDown",null),RD([HL],zD.prototype,"onMouseOver",null),RD([HL],zD.prototype,"onMouseOut",null),RD([HL],zD.prototype,"onContextMenu",null),RD([HL],zD.prototype,"onTouchStart",null),RD([HL],zD.prototype,"onTap",null);var HD,UD,KD=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};class jD{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const n=this.renderedElements.findIndex((e=>e.templateData===i));if(n>=0){const e=this.renderedElements[n];this.trait.unrender(i),e.index=t}else{const e={index:t,templateData:i};this.renderedElements.push(e)}this.trait.renderIndex(t,i)}splice(e,t,i){const n=[];for(const o of this.renderedElements)o.index<e?n.push(o):o.index>=e+t&&n.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=n}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex((t=>t.templateData===e));t<0||this.renderedElements.splice(t,1)}}class qD{get name(){return this._trait}get renderer(){return new jD(this)}constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new q,this.onChange=this._onChange.event}splice(e,t,i){var n;t=Math.max(0,Math.min(t,this.length-e));const o=i.length-t,s=e+t,r=[];let a=0;for(;a<this.sortedIndexes.length&&this.sortedIndexes[a]<e;)r.push(this.sortedIndexes[a++]);for(let t=0;t<i.length;t++)i[t]&&r.push(t+e);for(;a<this.sortedIndexes.length&&this.sortedIndexes[a]>=s;)r.push(this.sortedIndexes[a++]+o);const l=this.length+o;if(this.sortedIndexes.length>0&&0===r.length&&l>0){const t=null!==(n=this.sortedIndexes.find((t=>t>=e)))&&void 0!==n?n:l-1;r.push(Math.min(t,l-1))}this.renderer.splice(e,t,i.length),this._set(r,r),this.length=l}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(cE),t)}_set(e,t,i){const n=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=dE(o,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return Mc(this.sortedIndexes,e,cE)>=0}dispose(){E(this._onChange)}}KD([HL],qD.prototype,"renderer",null);class $D extends qD{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class GD{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,new Array(i.length).fill(!1));const n=this.trait.get().map((e=>this.identityProvider.getId(this.view.element(e)).toString()));if(0===n.length)return this.trait.splice(e,t,new Array(i.length).fill(!1));const o=new Set(n),s=i.map((e=>o.has(this.identityProvider.getId(e).toString())));this.trait.splice(e,t,s)}}function ZD(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName}function YD(e,t){return!!e.classList.contains(t)||!e.classList.contains("monaco-list")&&!!e.parentElement&&YD(e.parentElement,t)}function QD(e){return YD(e,"monaco-editor")}function XD(e){return!!("A"===e.tagName&&e.classList.contains("monaco-button")||"DIV"===e.tagName&&e.classList.contains("monaco-button-dropdown"))||!e.classList.contains("monaco-list")&&!!e.parentElement&&XD(e.parentElement)}class JD{get onKeyDown(){return z.chain(this.disposables.add(new OS(this.view.domNode,"keydown")).event,(e=>e.filter((e=>!ZD(e.target))).map((e=>new Dt(e)))))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new M,this.multipleSelectionDisposables=new M,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown((e=>{switch(e.keyCode){case 3:return this.onEnter(e);case 16:return this.onUpArrow(e);case 18:return this.onDownArrow(e);case 11:return this.onPageUpArrow(e);case 12:return this.onPageDownArrow(e);case 9:return this.onEscape(e);case 31:this.multipleSelectionSupport&&(Ve?e.metaKey:e.ctrlKey)&&this.onCtrlA(e)}})))}updateOptions(e){void 0!==e.multipleSelectionSupport&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(Hc(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}KD([HL],JD.prototype,"onKeyDown",null),function(e){e[e.Automatic=0]="Automatic",e[e.Trigger=1]="Trigger"}(HD||(HD={})),function(e){e[e.Idle=0]="Idle",e[e.Typing=1]="Typing"}(UD||(UD={}));const eE=new class{mightProducePrintableCharacter(e){return!(e.ctrlKey||e.metaKey||e.altKey)&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30||e.keyCode>=98&&e.keyCode<=107||e.keyCode>=85&&e.keyCode<=95)}};class tE{constructor(e,t,i,n,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=n,this.delegate=o,this.enabled=!1,this.state=UD.Idle,this.mode=HD.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new M,this.disposables=new M,this.updateOptions(e.options)}updateOptions(e){var t,i;null===(t=e.typeNavigationEnabled)||void 0===t||t?this.enable():this.disable(),this.mode=null!==(i=e.typeNavigationMode)&&void 0!==i?i:HD.Automatic}enable(){if(this.enabled)return;let e=!1;const t=z.chain(this.enabledDisposables.add(new OS(this.view.domNode,"keydown")).event,(t=>t.filter((e=>!ZD(e.target))).filter((()=>this.mode===HD.Automatic||this.triggered)).map((e=>new Dt(e))).filter((t=>e||this.keyboardNavigationEventFilter(t))).filter((e=>this.delegate.mightProducePrintableCharacter(e))).forEach((e=>rr(e,!0))).map((e=>e.browserEvent.key)))),i=z.debounce(t,(()=>null),800,void 0,void 0,void 0,this.enabledDisposables);z.reduce(z.any(t,i),((e,t)=>null===t?null:(e||"")+t),void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t((()=>e=!0),void 0,this.enabledDisposables),i((()=>e=!1),void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const i=null===(e=this.list.options.accessibilityProvider)||void 0===e?void 0:e.getAriaLabel(this.list.element(t[0]));i&&Zr(i)}this.previouslyFocused=-1}onInput(e){if(!e)return this.state=UD.Idle,void(this.triggered=!1);const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===UD.Idle?1:0;this.state=UD.Typing;for(let t=0;t<this.list.length;t++){const o=(i+t+n)%this.list.length,s=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(o)),r=s&&s.toString();if(this.list.options.typeNavigationEnabled){if(void 0!==r){if(pa(e,r))return this.previouslyFocused=i,this.list.setFocus([o]),void this.list.reveal(o);const t=Wa(e,r);if(t&&t[0].end-t[0].start>1&&1===t.length)return this.previouslyFocused=i,this.list.setFocus([o]),void this.list.reveal(o)}}else if(void 0===r||pa(e,r))return this.previouslyFocused=i,this.list.setFocus([o]),void this.list.reveal(o)}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class iE{constructor(e,t){this.list=e,this.view=t,this.disposables=new M;const i=z.chain(this.disposables.add(new OS(t.domNode,"keydown")).event,(e=>e.filter((e=>!ZD(e.target))).map((e=>new Dt(e))))),n=z.chain(i,(e=>e.filter((e=>!(2!==e.keyCode||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)))));n(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(0===t.length)return;const i=this.view.domElement(t[0]);if(!i)return;const n=i.querySelector("[tabIndex]");if(!(n&&n instanceof HTMLElement&&-1!==n.tabIndex))return;const o=as(n).getComputedStyle(n);"hidden"!==o.visibility&&"none"!==o.display&&(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function nE(e){return Ve?e.browserEvent.metaKey:e.browserEvent.ctrlKey}function oE(e){return e.browserEvent.shiftKey}const sE={isSelectionSingleChangeEvent:nE,isSelectionRangeChangeEvent:oE};class rE{constructor(e){this.list=e,this.disposables=new M,this._onPointer=new q,this.onPointer=this._onPointer.event,!1!==e.options.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||sE),this.mouseSupport=void 0===e.options.mouseSupport||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(KL.addTarget(e.getHTMLElement()))),z.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){void 0!==e.multipleSelectionSupport&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||sE))}isSelectionSingleChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionSingleChangeEvent(e)}isSelectionRangeChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionRangeChangeEvent(e)}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){QD(e.browserEvent.target)||Us()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(ZD(e.browserEvent.target)||QD(e.browserEvent.target))return;const t=void 0===e.index?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport)return;if(ZD(e.browserEvent.target)||QD(e.browserEvent.target))return;if(e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;return void 0===t?(this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),void this.list.setAnchor(void 0)):this.isSelectionChangeEvent(e)?this.changeSelection(e):(this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),ir(i=e.browserEvent)&&2===i.button||this.list.setSelection([t],e.browserEvent),void this._onPointer.fire(e));var i}onDoubleClick(e){if(ZD(e.browserEvent.target)||QD(e.browserEvent.target))return;if(this.isSelectionChangeEvent(e))return;if(e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(void 0===i){const e=this.list.getFocus()[0];i=null!=e?e:t,this.list.setAnchor(i)}const n=Hc(Math.min(i,t),Math.max(i,t)+1),o=this.list.getSelection(),s=function(e,t){const i=e.indexOf(t);if(-1===i)return[];const n=[];let o=i-1;for(;o>=0&&e[o]===t-(i-o);)n.push(e[o--]);for(n.reverse(),o=i;o<e.length&&e[o]===t+(o-i);)n.push(e[o++]);return n}(dE(o,[i]),i);if(0===s.length)return;const r=dE(n,function(e,t){const i=[];let n=0,o=0;for(;n<e.length||o<t.length;)if(n>=e.length)i.push(t[o++]);else if(o>=t.length)i.push(e[n++]);else{if(e[n]===t[o]){n++,o++;continue}e[n]<t[o]?i.push(e[n++]):o++}return i}(o,s));this.list.setSelection(r,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const i=this.list.getSelection(),n=i.filter((e=>e!==t));this.list.setFocus([t]),this.list.setAnchor(t),i.length===n.length?this.list.setSelection([...n,t],e.browserEvent):this.list.setSelection(n,e.browserEvent)}}dispose(){this.disposables.dispose()}}class aE{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,i;const n=this.selectorSuffix&&`.${this.selectorSuffix}`,o=[];e.listBackground&&o.push(`.monaco-list${n} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(o.push(`.monaco-list${n}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),o.push(`.monaco-list${n}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&o.push(`.monaco-list${n}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(o.push(`.monaco-list${n}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),o.push(`.monaco-list${n}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&o.push(`.monaco-list${n}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&o.push(`.monaco-list${n}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&o.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${n}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }\n\t\t\t`),e.listFocusAndSelectionForeground&&o.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${n}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }\n\t\t\t`),e.listInactiveFocusForeground&&(o.push(`.monaco-list${n} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),o.push(`.monaco-list${n} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&o.push(`.monaco-list${n} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(o.push(`.monaco-list${n} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),o.push(`.monaco-list${n} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(o.push(`.monaco-list${n} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),o.push(`.monaco-list${n} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&o.push(`.monaco-list${n} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&o.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&o.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const s=yr(e.listFocusAndSelectionOutline,yr(e.listSelectionOutline,null!==(t=e.listFocusOutline)&&void 0!==t?t:""));s&&o.push(`.monaco-list${n}:focus .monaco-list-row.focused.selected { outline: 1px solid ${s}; outline-offset: -1px;}`),e.listFocusOutline&&o.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${n}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t\t.monaco-workbench.context-menu-visible .monaco-list${n}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t`);const r=yr(e.listSelectionOutline,null!==(i=e.listInactiveFocusOutline)&&void 0!==i?i:"");r&&o.push(`.monaco-list${n} .monaco-list-row.focused.selected { outline: 1px dotted ${r}; outline-offset: -1px; }`),e.listSelectionOutline&&o.push(`.monaco-list${n} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&o.push(`.monaco-list${n} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&o.push(`.monaco-list${n} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&o.push(`\n\t\t\t\t.monaco-list${n}.drop-target,\n\t\t\t\t.monaco-list${n} .monaco-list-rows.drop-target,\n\t\t\t\t.monaco-list${n} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; }\n\t\t\t`),e.tableColumnsBorder&&o.push(`\n\t\t\t\t.monaco-table > .monaco-split-view2,\n\t\t\t\t.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before,\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2,\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: ${e.tableColumnsBorder};\n\t\t\t\t}\n\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2,\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: transparent;\n\t\t\t\t}\n\t\t\t`),e.tableOddRowsBackgroundColor&&o.push(`\n\t\t\t\t.monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {\n\t\t\t\t\tbackground-color: ${e.tableOddRowsBackgroundColor};\n\t\t\t\t}\n\t\t\t`),this.styleElement.textContent=o.join("\n")}}const lE={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropBackground:"#383B3D",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:ru.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:ru.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:ru.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0},hE={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){},dispose(){}}};function dE(e,t){const i=[];let n=0,o=0;for(;n<e.length||o<t.length;)if(n>=e.length)i.push(t[o++]);else if(o>=t.length)i.push(e[n++]);else{if(e[n]===t[o]){i.push(e[n]),n++,o++;continue}e[n]<t[o]?i.push(e[n++]):i.push(t[o++])}return i}const cE=(e,t)=>e-t;class uE{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map((t=>t.renderTemplate(e)))}renderElement(e,t,i,n){let o=0;for(const s of this.renderers)s.renderElement(e,t,i[o++],n)}disposeElement(e,t,i,n){var o;let s=0;for(const r of this.renderers)null===(o=r.disposeElement)||void 0===o||o.call(r,e,t,i[s],n),s+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class gE{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e);n?i.setAttribute("aria-label",n):i.removeAttribute("aria-label");const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);"number"==typeof o?i.setAttribute("aria-level",`${o}`):i.removeAttribute("aria-level")}disposeTemplate(e){}}class pE{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){var i,n;null===(n=(i=this.dnd).onDragStart)||void 0===n||n.call(i,e,t)}onDragOver(e,t,i,n){return this.dnd.onDragOver(e,t,i,n)}onDragLeave(e,t,i,n){var o,s;null===(s=(o=this.dnd).onDragLeave)||void 0===s||s.call(o,e,t,i,n)}onDragEnd(e){var t,i;null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}drop(e,t,i,n){this.dnd.drop(e,t,i,n)}dispose(){this.dnd.dispose()}}class mE{get onDidChangeFocus(){return z.map(this.eventBufferer.wrapEvent(this.focus.onChange),(e=>this.toListEvent(e)),this.disposables)}get onDidChangeSelection(){return z.map(this.eventBufferer.wrapEvent(this.selection.onChange),(e=>this.toListEvent(e)),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=z.chain(this.disposables.add(new OS(this.view.domNode,"keydown")).event,(t=>t.map((e=>new Dt(e))).filter((t=>e=58===t.keyCode||t.shiftKey&&68===t.keyCode)).map((e=>rr(e,!0))).filter((()=>!1)))),i=z.chain(this.disposables.add(new OS(this.view.domNode,"keyup")).event,(t=>t.forEach((()=>e=!1)).map((e=>new Dt(e))).filter((e=>58===e.keyCode||e.shiftKey&&68===e.keyCode)).map((e=>rr(e,!0))).map((({browserEvent:e})=>{const t=this.getFocus(),i=t.length?t[0]:void 0;return{index:i,element:void 0!==i?this.view.element(i):void 0,anchor:void 0!==i?this.view.domElement(i):this.view.domNode,browserEvent:e}})))),n=z.chain(this.view.onContextMenu,(t=>t.filter((t=>!e)).map((({element:e,index:t,browserEvent:i})=>({element:e,index:t,anchor:new Mt(as(this.view.domNode),i),browserEvent:i})))));return z.any(t,i,n)}get onKeyDown(){return this.disposables.add(new OS(this.view.domNode,"keydown")).event}get onDidFocus(){return z.signal(this.disposables.add(new OS(this.view.domNode,"focus",!0)).event)}constructor(e,t,i,n,o=hE){var s,r,a,l;this.user=e,this._options=o,this.focus=new qD("focused"),this.anchor=new qD("anchor"),this.eventBufferer=new X,this._ariaLabel="",this.disposables=new M,this._onDidDispose=new q,this.onDidDispose=this._onDidDispose.event;const h=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?null===(s=this._options.accessibilityProvider)||void 0===s?void 0:s.getWidgetRole():"list";this.selection=new $D("listbox"!==h);const d=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(d.push(new gE(this.accessibilityProvider)),null===(a=(r=this.accessibilityProvider).onDidChangeActiveDescendant)||void 0===a||a.call(r,this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map((e=>new uE(e.templateId,[...d,e])));const c={...o,dnd:o.dnd&&new pE(this,o.dnd)};if(this.view=this.createListView(t,i,n,c),this.view.domNode.setAttribute("role",h),o.styleController)this.styleController=o.styleController(this.view.domId);else{const e=$s(this.view.domNode);this.styleController=new aE(e,this.view.domId)}if(this.spliceable=new tD([new GD(this.focus,this.view,o.identityProvider),new GD(this.selection,this.view,o.identityProvider),new GD(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new iE(this,this.view)),("boolean"!=typeof o.keyboardSupport||o.keyboardSupport)&&(this.keyboardController=new JD(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const e=o.keyboardNavigationDelegate||eE;this.typeNavigationController=new tE(this,this.view,o.keyboardNavigationLabelProvider,null!==(l=o.keyboardNavigationEventFilter)&&void 0!==l?l:()=>!0,e),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),!1!==this._options.multipleSelectionSupport&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,n){return new zD(e,t,i,n)}createMouseController(e){return new rE(this)}updateOptions(e={}){var t,i;this._options={...this._options,...e},null===(t=this.typeNavigationController)||void 0===t||t.updateOptions(this._options),void 0!==this._options.multipleSelectionController&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),null===(i=this.keyboardController)||void 0===i||i.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new aD(this.user,`Invalid start index: ${e}`);if(t<0)throw new aD(this.user,`Invalid delete count: ${t}`);0===t&&0===i.length||this.eventBufferer.bufferEvents((()=>this.spliceable.splice(e,t,i)))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}indexOf(e){return this.view.indexOf(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const t of e)if(t<0||t>=this.length)throw new aD(this.user,`Invalid index ${t}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map((e=>this.view.element(e)))}setAnchor(e){if(void 0!==e){if(e<0||e>=this.length)throw new aD(this.user,`Invalid index ${e}`);this.anchor.set([e])}else this.anchor.set([])}getAnchor(){return zc(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return void 0===e?void 0:this.element(e)}setFocus(e,t){for(const t of e)if(t<0||t>=this.length)throw new aD(this.user,`Invalid index ${t}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(0===this.length)return;const o=this.focus.get(),s=this.findNextIndex(o.length>0?o[0]+e:0,t,n);s>-1&&this.setFocus([s],i)}focusPrevious(e=1,t=!1,i,n){if(0===this.length)return;const o=this.focus.get(),s=this.findPreviousIndex(o.length>0?o[0]-e:0,t,n);s>-1&&this.setFocus([s],i)}async focusNextPage(e,t){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=0===i?0:i-1;const n=this.getFocus()[0];if(n!==i&&(void 0===n||i>n)){const o=this.findPreviousIndex(i,!1,t);o>-1&&n!==o?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();let s=o+this.view.renderHeight;i>n&&(s-=this.view.elementHeight(i)),this.view.setScrollTop(s),this.view.getScrollTop()!==o&&(this.setFocus([]),await Kt(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t){let i;const n=this.view.getScrollTop();i=0===n?this.view.indexAt(n):this.view.indexAfter(n-1);const o=this.getFocus()[0];if(o!==i&&(void 0===o||o>=i)){const n=this.findNextIndex(i,!1,t);n>-1&&o!==n?this.setFocus([n],e):this.setFocus([i],e)}else{const i=n;this.view.setScrollTop(n-this.view.renderHeight),this.view.getScrollTop()!==i&&(this.setFocus([]),await Kt(0),await this.focusPreviousPage(e,t))}}focusLast(e,t){if(0===this.length)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(0===this.length)return;const n=this.findNextIndex(e,!1,i);n>-1&&this.setFocus([n],t)}findNextIndex(e,t=!1,i){for(let n=0;n<this.length;n++){if(e>=this.length&&!t)return-1;if(e%=this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let n=0;n<this.length;n++){if(e<0&&!t)return-1;if(e=(this.length+e%this.length)%this.length,!i||i(this.element(e)))return e;e--}return-1}getFocus(){return this.focus.get()}getFocusedElements(){return this.getFocus().map((e=>this.view.element(e)))}reveal(e,t,i=0){if(e<0||e>=this.length)throw new aD(this.user,`Invalid index ${e}`);const n=this.view.getScrollTop(),o=this.view.elementTop(e),s=this.view.elementHeight(e);if(dl(t)){const e=s-this.view.renderHeight+i;this.view.setScrollTop(e*iD(t,0,1)+o-i)}else{const e=o+s,t=n+this.view.renderHeight;o<n+i&&e>=t||(o<n+i||e>=t&&s>=this.view.renderHeight?this.view.setScrollTop(o-i):e>=t&&this.view.setScrollTop(e-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new aD(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),n=this.view.elementTop(e),o=this.view.elementHeight(e);if(n<i+t||n+o>i+this.view.renderHeight)return null;const s=o-this.view.renderHeight+t;return Math.abs((i+t-n)/s)}getHTMLElement(){return this.view.domNode}getScrollableElement(){return this.view.scrollableElementDomNode}getElementID(e){return this.view.getElementDomId(e)}getElementTop(e){return this.view.elementTop(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map((e=>this.view.element(e))),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const t=this.focus.get();if(t.length>0){let i;(null===(e=this.accessibilityProvider)||void 0===e?void 0:e.getActiveDescendantId)&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",0===e.length),this.view.domNode.classList.toggle("selection-single",1===e.length),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}KD([HL],mE.prototype,"onDidChangeFocus",null),KD([HL],mE.prototype,"onDidChangeSelection",null),KD([HL],mE.prototype,"onContextMenu",null),KD([HL],mE.prototype,"onKeyDown",null),KD([HL],mE.prototype,"onDidFocus",null);var fE=i(2675),_E={};_E.styleTagTransform=Vr(),_E.setAttributes=Pr(),_E.insert=Rr().bind(null,"head"),_E.domAPI=Tr(),_E.insertStyleElement=Br(),Ir()(fE.Z,_E),fE.Z&&fE.Z.locals&&fE.Z.locals;const vE=mr,bE="selectOption.entry.template";class wE{get templateId(){return bE}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=hr(e,vE(".option-text")),t.detail=hr(e,vE(".option-detail")),t.decoratorRight=hr(e,vE(".option-decorator-right")),t}renderElement(e,t,i){const n=i,o=e.text,s=e.detail,r=e.decoratorRight,a=e.isDisabled;n.text.textContent=o,n.detail.textContent=s||"",n.decoratorRight.innerText=r||"",a?n.root.classList.add("option-disabled"):n.root.classList.remove("option-disabled")}disposeTemplate(e){}}class CE extends T{constructor(e,t,i,n,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=n,this.selectBoxOptions=o||Object.create(null),"number"!=typeof this.selectBoxOptions.minBottomMargin?this.selectBoxOptions.minBottomMargin=CE.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding","string"==typeof this.selectBoxOptions.ariaLabel&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),"string"==typeof this.selectBoxOptions.ariaDescription&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new q,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}getHeight(){return 22}getTemplateId(){return bE}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=mr(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=hr(this.selectDropDownContainer,vE(".select-box-details-pane"));const t=hr(this.selectDropDownContainer,vE(".select-box-dropdown-container-width-control")),i=hr(t,vE(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",hr(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=$s(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(bs(this.selectDropDownContainer,or.DRAG_START,(e=>{rr(e,!0)})))}registerListeners(){let e;this._register(Cs(this.selectElement,"change",(e=>{this.selected=e.target.selectedIndex,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)}))),this._register(bs(this.selectElement,or.CLICK,(e=>{rr(e),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()}))),this._register(bs(this.selectElement,or.MOUSE_DOWN,(e=>{rr(e)}))),this._register(bs(this.selectElement,"touchstart",(t=>{e=this._isVisible}))),this._register(bs(this.selectElement,"touchend",(t=>{rr(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()}))),this._register(bs(this.selectElement,or.KEY_DOWN,(e=>{const t=new Dt(e);let i=!1;Ve?18!==t.keyCode&&16!==t.keyCode&&10!==t.keyCode&&3!==t.keyCode||(i=!0):(18===t.keyCode&&t.altKey||16===t.keyCode&&t.altKey||10===t.keyCode||3===t.keyCode)&&(i=!0),i&&(this.showSelectDropDown(),rr(e,!0))})))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Ic(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach(((e,t)=>{this.selectElement.add(this.createOption(e.text,t,e.isDisabled)),"string"==typeof e.description&&(this._hasDetails=!0)}))),void 0!==t&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;null===(e=this.selectList)||void 0===e||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join("\n")}styleSelectElement(){var e,t,i;const n=null!==(e=this.styles.selectBackground)&&void 0!==e?e:"",o=null!==(t=this.styles.selectForeground)&&void 0!==t?t:"",s=null!==(i=this.styles.selectBorder)&&void 0!==i?i:"";this.selectElement.style.backgroundColor=n,this.selectElement.style.color=o,this.selectElement.style.borderColor=s}styleList(){var e,t;const i=null!==(e=this.styles.selectBackground)&&void 0!==e?e:"",n=yr(this.styles.selectListBackground,i);this.selectDropDownListContainer.style.backgroundColor=n,this.selectionDetailsPane.style.backgroundColor=n;const o=null!==(t=this.styles.focusBorder)&&void 0!==t?t:"";this.selectDropDownContainer.style.outlineColor=o,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}showSelectDropDown(){this.selectionDetailsPane.innerText="",this.contextViewProvider&&!this._isVisible&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){this.contextViewProvider&&this._isVisible&&(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch(e){}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach(((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)})),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=as(this.selectElement),i=As(this.selectElement),n=as(this.selectElement).getComputedStyle(this.selectElement),o=parseFloat(n.getPropertyValue("--dropdown-padding-top"))+parseFloat(n.getPropertyValue("--dropdown-padding-bottom")),s=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),r=i.top-CE.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,a=this.selectElement.offsetWidth,l=this.setWidthControlElement(this.widthControlElement),h=Math.max(l,Math.round(a)).toString()+"px";this.selectDropDownContainer.style.width=h,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let d=this.selectList.contentHeight;this._hasDetails&&void 0===this._cachedMaxDetailsHeight&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const c=this._hasDetails?this._cachedMaxDetailsHeight:0,u=d+o+c,g=Math.floor((s-o-c)/this.getHeight()),p=Math.floor((r-o-c)/this.getHeight());if(e)return!(i.top+i.height>t.innerHeight-22||i.top<CE.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||g<1&&p<1||(g<CE.DEFAULT_MINIMUM_VISIBLE_OPTIONS&&p>g&&this.options.length>g?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),0));if(i.top+i.height>t.innerHeight-22||i.top<CE.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||0===this._dropDownPosition&&g<1||1===this._dropDownPosition&&p<1)return this.hideSelectDropDown(!0),!1;if(0===this._dropDownPosition){if(this._isVisible&&g+p<1)return this.hideSelectDropDown(!0),!1;u>s&&(d=g*this.getHeight())}else u>r&&(d=p*this.getHeight());return this.selectList.layout(d),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=d+o+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=d+o+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=h,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}return!1}setWidthControlElement(e){let t=0;if(e){let i=0,n=0;this.options.forEach(((e,t)=>{const o=e.detail?e.detail.length:0,s=e.decoratorRight?e.decoratorRight.length:0,r=e.text.length+o+s;r>n&&(i=t,n=r)})),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=Rs(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=hr(e,vE(".select-box-dropdown-list-container")),this.listRenderer=new wE,this.selectList=new mE("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:e=>{let t=e.text;return e.detail&&(t+=`. ${e.detail}`),e.decoratorRight&&(t+=`. ${e.decoratorRight}`),e.description&&(t+=`. ${e.description}`),t},getWidgetAriaLabel:()=>me(0,"Select Box"),getRole:()=>Ve?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new OS(this.selectDropDownListContainer,"keydown")),i=z.chain(t.event,(e=>e.filter((()=>this.selectList.length>0)).map((e=>new Dt(e)))));this._register(z.chain(i,(e=>e.filter((e=>3===e.keyCode))))(this.onEnter,this)),this._register(z.chain(i,(e=>e.filter((e=>2===e.keyCode))))(this.onEnter,this)),this._register(z.chain(i,(e=>e.filter((e=>9===e.keyCode))))(this.onEscape,this)),this._register(z.chain(i,(e=>e.filter((e=>16===e.keyCode))))(this.onUpArrow,this)),this._register(z.chain(i,(e=>e.filter((e=>18===e.keyCode))))(this.onDownArrow,this)),this._register(z.chain(i,(e=>e.filter((e=>12===e.keyCode))))(this.onPageDown,this)),this._register(z.chain(i,(e=>e.filter((e=>11===e.keyCode))))(this.onPageUp,this)),this._register(z.chain(i,(e=>e.filter((e=>14===e.keyCode))))(this.onHome,this)),this._register(z.chain(i,(e=>e.filter((e=>13===e.keyCode))))(this.onEnd,this)),this._register(z.chain(i,(e=>e.filter((e=>e.keyCode>=21&&e.keyCode<=56||e.keyCode>=85&&e.keyCode<=113))))(this.onCharacter,this)),this._register(bs(this.selectList.getHTMLElement(),or.POINTER_UP,(e=>this.onPointerUp(e)))),this._register(this.selectList.onMouseOver((e=>void 0!==e.index&&this.selectList.setFocus([e.index])))),this._register(this.selectList.onDidChangeFocus((e=>this.onListFocus(e)))),this._register(bs(this.selectDropDownContainer,or.FOCUS_OUT,(e=>{this._isVisible&&!Bs(e.relatedTarget,this.selectDropDownContainer)&&this.onListBlur()}))),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;rr(e);const t=e.target;if(!t)return;if(t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const n=Number(i.getAttribute("data-index")),o=i.classList.contains("option-disabled");n>=0&&n<this.options.length&&!o&&(this.selected=n,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)),this.hideSelectDropDown(!0))}onListBlur(){this._sticky||(this.selected!==this._currentSelection&&this.select(this._currentSelection),this.hideSelectDropDown(!1))}renderDescriptionMarkdown(e,t){const i=e=>{for(let t=0;t<e.childNodes.length;t++){const n=e.childNodes.item(t);"img"===(n.tagName&&n.tagName.toLowerCase())?e.removeChild(n):i(n)}},n=gx({value:e,supportThemeIcons:!0},{actionHandler:t});return n.element.classList.add("select-box-description-markdown"),i(n.element),n.element}onListFocus(e){this._isVisible&&this._hasDetails&&this.updateDetail(e.indexes[0])}updateDetail(e){var t,i;this.selectionDetailsPane.innerText="";const n=this.options[e],o=null!==(t=null==n?void 0:n.description)&&void 0!==t?t:"",s=null!==(i=null==n?void 0:n.descriptionIsMarkdown)&&void 0!==i&&i;if(o){if(s){const e=n.descriptionMarkdownActionHandler;this.selectionDetailsPane.appendChild(this.renderDescriptionMarkdown(o,e))}else this.selectionDetailsPane.innerText=o;this.selectionDetailsPane.style.display="block"}else this.selectionDetailsPane.style.display="none";this._skipLayout=!0,this.contextViewProvider.layout(),this._skipLayout=!1}onEscape(e){rr(e),this.select(this._currentSelection),this.hideSelectDropDown(!0)}onEnter(e){rr(e),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)),this.hideSelectDropDown(!0)}onDownArrow(e){if(this.selected<this.options.length-1){rr(e,!0);const t=this.options[this.selected+1].isDisabled;if(t&&this.options.length>this.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(rr(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){rr(e),this.selectList.focusPreviousPage(),setTimeout((()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected<this.options.length-1&&(this.selected++,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)}),1)}onPageDown(e){rr(e),this.selectList.focusNextPage(),setTimeout((()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)}),1)}onHome(e){rr(e),this.options.length<2||(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){rr(e),this.options.length<2||(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=_t.toString(e.keyCode);let i=-1;for(let n=0;n<this.options.length-1;n++)if(i=(n+this.selected+1)%this.options.length,this.options[i].text.charAt(0).toUpperCase()===t&&!this.options[i].isDisabled){this.select(i),this.selectList.setFocus([i]),this.selectList.reveal(this.selectList.getFocus()[0]),rr(e);break}}dispose(){this.hideSelectDropDown(!1),super.dispose()}}CE.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN=32,CE.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN=2,CE.DEFAULT_MINIMUM_VISIBLE_OPTIONS=3;class yE extends T{constructor(e,t,i,n){super(),this.selected=0,this.selectBoxOptions=n||Object.create(null),this.options=[],this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box","string"==typeof this.selectBoxOptions.ariaLabel&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),"string"==typeof this.selectBoxOptions.ariaDescription&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=this._register(new q),this.styles=i,this.registerListeners(),this.setOptions(e,t)}registerListeners(){this._register(KL.addTarget(this.selectElement)),[UL.Tap].forEach((e=>{this._register(bs(this.selectElement,e,(e=>{this.selectElement.focus()})))})),this._register(Cs(this.selectElement,"click",(e=>{rr(e,!0)}))),this._register(Cs(this.selectElement,"change",(e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})}))),this._register(Cs(this.selectElement,"keydown",(e=>{let t=!1;Ve?18!==e.keyCode&&16!==e.keyCode&&10!==e.keyCode||(t=!0):(18===e.keyCode&&e.altKey||10===e.keyCode||3===e.keyCode)&&(t=!0),t&&e.stopPropagation()})))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){this.options&&Ic(this.options,e)||(this.options=e,this.selectElement.options.length=0,this.options.forEach(((e,t)=>{this.selectElement.add(this.createOption(e.text,t,e.isDisabled))}))),void 0!==t&&this.select(t)}select(e){0===this.options.length?this.selected=0:e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected<this.options.length&&"string"==typeof this.options[this.selected].text?this.selectElement.title=this.options[this.selected].text:this.selectElement.title=""}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){e.classList.add("select-container"),e.appendChild(this.selectElement),this.setOptions(this.options,this.selected),this.applyStyles()}applyStyles(){var e,t,i;this.selectElement&&(this.selectElement.style.backgroundColor=null!==(e=this.styles.selectBackground)&&void 0!==e?e:"",this.selectElement.style.color=null!==(t=this.styles.selectForeground)&&void 0!==t?t:"",this.selectElement.style.borderColor=null!==(i=this.styles.selectBorder)&&void 0!==i?i:"")}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}}var SE=i(6512),kE={};kE.styleTagTransform=Vr(),kE.setAttributes=Pr(),kE.insert=Rr().bind(null,"head"),kE.domAPI=Tr(),kE.insertStyleElement=Br(),Ir()(SE.Z,kE),SE.Z&&SE.Z.locals&&SE.Z.locals;class LE extends hD{constructor(e,t,i,n,o){super(),Ve&&!(null==o?void 0:o.useCustomDrawn)?this.selectBoxDelegate=new yE(e,t,n,o):this.selectBoxDelegate=new CE(e,t,i,n,o),this._register(this.selectBoxDelegate)}get onDidSelect(){return this.selectBoxDelegate.onDidSelect}setOptions(e,t){this.selectBoxDelegate.setOptions(e,t)}select(e){this.selectBoxDelegate.select(e)}focus(){this.selectBoxDelegate.focus()}blur(){this.selectBoxDelegate.blur()}setFocusable(e){this.selectBoxDelegate.setFocusable(e)}render(e){this.selectBoxDelegate.render(e)}}var xE=i(2757),DE={};DE.styleTagTransform=Vr(),DE.setAttributes=Pr(),DE.insert=Rr().bind(null,"head"),DE.domAPI=Tr(),DE.insertStyleElement=Br(),Ir()(xE.Z,DE),xE.Z&&xE.Z.locals&&xE.Z.locals;class EE extends T{get action(){return this._action}constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof ph&&this._register(t.onDidChange((e=>{this.element&&this.handleActionChangeEvent(e)})))}handleActionChangeEvent(e){void 0!==e.enabled&&this.updateEnabled(),void 0!==e.checked&&this.updateChecked(),void 0!==e.class&&this.updateClass(),void 0!==e.label&&(this.updateLabel(),this.updateTooltip()),void 0!==e.tooltip&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new mh)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(KL.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,re&&this._register(bs(e,or.DRAG_START,(e=>{var t;return null===(t=e.dataTransfer)||void 0===t?void 0:t.setData(Xx.TEXT,this._action.label)})))),this._register(bs(t,UL.Tap,(e=>this.onClick(e,!0)))),this._register(bs(t,or.MOUSE_DOWN,(e=>{i||rr(e,!0),this._action.enabled&&0===e.button&&t.classList.add("active")}))),Ve&&this._register(bs(t,or.CONTEXT_MENU,(e=>{0===e.button&&!0===e.ctrlKey&&this.onClick(e)}))),this._register(bs(t,or.CLICK,(e=>{rr(e,!0),this.options&&this.options.isMenu||this.onClick(e)}))),this._register(bs(t,or.DBLCLICK,(e=>{rr(e,!0)}))),[or.MOUSE_UP,or.MOUSE_OUT].forEach((e=>{this._register(bs(t,e,(e=>{rr(e),t.classList.remove("active")})))}))}onClick(e,t=!1){var i;rr(e,!0);const n=ml(this._context)?(null===(i=this.options)||void 0===i?void 0:i.useEventAsContext)?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,n)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}updateTooltip(){var e;if(!this.element)return;const t=null!==(e=this.getTooltip())&&void 0!==e?e:"";this.updateAriaLabel(),this.options.hoverDelegate?(this.element.title="",this.customHover?this.customHover.update(t):(this.customHover=eD(this.options.hoverDelegate,this.element,t),this._store.add(this.customHover))):this.element.title=t}updateAriaLabel(){var e;if(this.element){const t=null!==(e=this.getTooltip())&&void 0!==e?e:"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class NE extends EE{constructor(e,t,i){super(e,t,i),this.options=i,this.options.icon=void 0!==i.icon&&i.icon,this.options.label=void 0===i.label||i.label,this.cssClass=""}render(e){super.render(e),fl(this.element);const t=document.createElement("a");if(t.classList.add("action-label"),t.setAttribute("role",this.getDefaultAriaRole()),this.label=t,this.element.appendChild(t),this.options.label&&this.options.keybinding){const e=document.createElement("span");e.classList.add("keybinding"),e.textContent=this.options.keybinding,this.element.appendChild(e)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===fh.ID?"presentation":this.options.isMenu?"menuitem":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=me(0,"{0} ({1})",e,this.options.keybinding))),null!=e?e:void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getClass(),this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):null===(e=this.label)||void 0===e||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),null===(e=this.element)||void 0===e||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),null===(t=this.element)||void 0===t||t.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){const t=null!==(e=this.getTooltip())&&void 0!==e?e:"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(void 0!==this.action.checked?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.removeAttribute("aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class IE extends EE{constructor(e,t,i,n,o,s,r){super(e,t),this.selectBox=new LE(i,n,o,s,r),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect((e=>this.runAction(e.selected,e.index))))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){var e;null===(e=this.selectBox)||void 0===e||e.focus()}blur(){var e;null===(e=this.selectBox)||void 0===e||e.blur()}render(e){this.selectBox.render(e)}}class ME extends T{constructor(e,t={}){var i,n,o,s,r,a;let l,h;switch(super(),this._actionRunnerDisposables=this._register(new M),this.viewItemDisposables=this._register(new P),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new q),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new q({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new q),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new q),this.onWillRun=this._onWillRun.event,this.options=t,this._context=null!==(i=t.context)&&void 0!==i?i:null,this._orientation=null!==(n=this.options.orientation)&&void 0!==n?n:0,this._triggerKeys={keyDown:null!==(s=null===(o=this.options.triggerKeys)||void 0===o?void 0:o.keyDown)&&void 0!==s&&s,keys:null!==(a=null===(r=this.options.triggerKeys)||void 0===r?void 0:r.keys)&&void 0!==a?a:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new mh,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun((e=>this._onDidRun.fire(e)))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun((e=>this._onWillRun.fire(e)))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",!1!==t.animated&&this.domNode.classList.add("animated"),this._orientation){case 0:l=[15],h=[17];break;case 1:l=[16],h=[18],this.domNode.className+=" vertical"}this._register(bs(this.domNode,or.KEY_DOWN,(e=>{const t=new Dt(e);let i=!0;const n="number"==typeof this.focusedItem?this.viewItems[this.focusedItem]:void 0;l&&(t.equals(l[0])||t.equals(l[1]))?i=this.focusPrevious():h&&(t.equals(h[0])||t.equals(h[1]))?i=this.focusNext():t.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():t.equals(14)?i=this.focusFirst():t.equals(13)?i=this.focusLast():t.equals(2)&&n instanceof EE&&n.trapsArrowNavigation?i=this.focusNext():this.isTriggerKeyEvent(t)?this._triggerKeys.keyDown?this.doTrigger(t):this.triggerKeyDown=!0:i=!1,i&&(t.preventDefault(),t.stopPropagation())}))),this._register(bs(this.domNode,or.KEY_UP,(e=>{const t=new Dt(e);this.isTriggerKeyEvent(t)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(t)),t.preventDefault(),t.stopPropagation()):(t.equals(2)||t.equals(1026)||t.equals(16)||t.equals(18)||t.equals(15)||t.equals(17))&&this.updateFocusedItem()}))),this.focusTracker=this._register(lr(this.domNode)),this._register(this.focusTracker.onDidBlur((()=>{Us()!==this.domNode&&Bs(Us(),this.domNode)||(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)}))),this._register(this.focusTracker.onDidFocus((()=>this.updateFocusedItem()))),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=1?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const e=this.viewItems.find((e=>e instanceof EE&&e.isEnabled()));e instanceof EE&&e.setFocusable(!0)}else this.viewItems.forEach((e=>{e instanceof EE&&e.setFocusable(!1)}))}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach((i=>{t=t||e.equals(i)})),t}updateFocusedItem(){var e,t;for(let i=0;i<this.actionsList.children.length;i++){const n=this.actionsList.children[i];if(Bs(Us(),n)){this.focusedItem=i,null===(t=null===(e=this.viewItems[this.focusedItem])||void 0===e?void 0:e.showHover)||void 0===t||t.call(e);break}}}get context(){return this._context}set context(e){this._context=e,this.viewItems.forEach((t=>t.setActionContext(e)))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun((e=>this._onDidRun.fire(e)))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun((e=>this._onWillRun.fire(e)))),this.viewItems.forEach((t=>t.actionRunner=e))}getContainer(){return this.domNode}getAction(e){var t;if("number"==typeof e)return null===(t=this.viewItems[e])||void 0===t?void 0:t.action;if(e instanceof HTMLElement){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let t=0;t<this.actionsList.childNodes.length;t++)if(this.actionsList.childNodes[t]===e)return this.viewItems[t].action}}push(e,t={}){const i=Array.isArray(e)?e:[e];let n=dl(t.index)?t.index:null;i.forEach((e=>{const i=document.createElement("li");let o;i.className="action-item",i.setAttribute("role","presentation");const s={hoverDelegate:this.options.hoverDelegate,...t};this.options.actionViewItemProvider&&(o=this.options.actionViewItemProvider(e,s)),o||(o=new NE(this.context,e,s)),this.options.allowContextMenu||this.viewItemDisposables.set(o,bs(i,or.CONTEXT_MENU,(e=>{rr(e,!0)}))),o.actionRunner=this._actionRunner,o.setActionContext(this.context),o.render(i),this.focusable&&o instanceof EE&&0===this.viewItems.length&&o.setFocusable(!0),null===n||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(i),this.viewItems.push(o)):(this.actionsList.insertBefore(i,this.actionsList.children[n]),this.viewItems.splice(n,0,o),n++)})),"number"==typeof this.focusedItem&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=E(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),_s(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return 0===this.viewItems.length}focus(e){let t,i=!1;if(void 0===e?i=!0:"number"==typeof e?t=e:"boolean"==typeof e&&(i=e),i&&void 0===this.focusedItem){const e=this.viewItems.findIndex((e=>e.isEnabled()));this.focusedItem=-1===e?void 0:e,this.updateFocus(void 0,void 0,!0)}else void 0!==t&&(this.focusedItem=t),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(void 0===this.focusedItem)this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=t,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===fh.ID));return this.updateFocus(),!0}focusPrevious(e){if(void 0===this.focusedItem)this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===fh.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){var n,o;void 0===this.focusedItem&&this.actionsList.focus({preventScroll:t}),void 0!==this.previouslyFocusedItem&&this.previouslyFocusedItem!==this.focusedItem&&(null===(n=this.viewItems[this.previouslyFocusedItem])||void 0===n||n.blur());const s=void 0!==this.focusedItem?this.viewItems[this.focusedItem]:void 0;if(s){let n=!0;vl(s.focus)||(n=!1),this.options.focusOnlyEnabledItems&&vl(s.isEnabled)&&!s.isEnabled()&&(n=!1),s.action.id===fh.ID&&(n=!1),n&&(null===(o=s.showHover)||void 0===o||o.call(s)),n?(i||this.previouslyFocusedItem!==this.focusedItem)&&(s.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0)}}doTrigger(e){if(void 0===this.focusedItem)return;const t=this.viewItems[this.focusedItem];if(t instanceof EE){const i=null===t._context||void 0===t._context?e:t._context;this.run(t._action,i)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=E(this.viewItems),this.getContainer().remove(),super.dispose()}}var TE=i(711),AE={};AE.styleTagTransform=Vr(),AE.setAttributes=Pr(),AE.insert=Rr().bind(null,"head"),AE.domAPI=Tr(),AE.insertStyleElement=Br(),Ir()(TE.Z,AE),TE.Z&&TE.Z.locals&&TE.Z.locals;class RE{constructor(e,t,i=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=i}toLabel(e,t,i){if(0===t.length)return null;const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=i(s);if(null===r)return null;n[o]=WE(s,r,this.modifierLabels[e])}return n.join(" ")}}const OE=new RE({ctrlKey:"⌃",shiftKey:"⇧",altKey:"⌥",metaKey:"⌘",separator:""},{ctrlKey:me(0,"Ctrl"),shiftKey:me(0,"Shift"),altKey:me(0,"Alt"),metaKey:me(0,"Windows"),separator:"+"},{ctrlKey:me(0,"Ctrl"),shiftKey:me(0,"Shift"),altKey:me(0,"Alt"),metaKey:me(0,"Super"),separator:"+"}),PE=new RE({ctrlKey:me(0,"Control"),shiftKey:me(0,"Shift"),altKey:me(0,"Option"),metaKey:me(0,"Command"),separator:"+"},{ctrlKey:me(0,"Control"),shiftKey:me(0,"Shift"),altKey:me(0,"Alt"),metaKey:me(0,"Windows"),separator:"+"},{ctrlKey:me(0,"Control"),shiftKey:me(0,"Shift"),altKey:me(0,"Alt"),metaKey:me(0,"Super"),separator:"+"}),FE=new RE({ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Cmd",separator:"+"},{ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Super",separator:"+"}),BE=new RE({ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"cmd",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"win",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"meta",separator:"+"});function WE(e,t,i){if(null===t)return"";const n=[];return e.ctrlKey&&n.push(i.ctrlKey),e.shiftKey&&n.push(i.shiftKey),e.altKey&&n.push(i.altKey),e.metaKey&&n.push(i.metaKey),""!==t&&n.push(t),n.join(i.separator)}var VE=i(2298),zE={};zE.styleTagTransform=Vr(),zE.setAttributes=Pr(),zE.insert=Rr().bind(null,"head"),zE.domAPI=Tr(),zE.insertStyleElement=Br(),Ir()(VE.Z,zE),VE.Z&&VE.Z.locals&&VE.Z.locals;const HE=mr,UE={keybindingLabelBackground:void 0,keybindingLabelForeground:void 0,keybindingLabelBorder:void 0,keybindingLabelBottomBorder:void 0,keybindingLabelShadow:void 0};class KE{constructor(e,t,i){this.os=t,this.keyElements=new Set,this.options=i||Object.create(null);const n=this.options.keybindingLabelForeground;this.domNode=hr(e,HE(".monaco-keybinding")),n&&(this.domNode.style.color=n),this.didEverRender=!1,e.appendChild(this.domNode)}get element(){return this.domNode}set(e,t){this.didEverRender&&this.keybinding===e&&KE.areSame(this.matches,t)||(this.keybinding=e,this.matches=t,this.render())}render(){var e;if(this.clear(),this.keybinding){const t=this.keybinding.getChords();t[0]&&this.renderChord(this.domNode,t[0],this.matches?this.matches.firstPart:null);for(let e=1;e<t.length;e++)hr(this.domNode,HE("span.monaco-keybinding-key-chord-separator",void 0," ")),this.renderChord(this.domNode,t[e],this.matches?this.matches.chordPart:null);const i=null!==(e=this.options.disableTitle)&&void 0!==e&&e?void 0:this.keybinding.getAriaLabel()||void 0;void 0!==i?this.domNode.title=i:this.domNode.removeAttribute("title")}else this.options&&this.options.renderUnboundKeybindings&&this.renderUnbound(this.domNode);this.didEverRender=!0}clear(){_s(this.domNode),this.keyElements.clear()}renderChord(e,t,i){const n=OE.modifierLabels[this.os];t.ctrlKey&&this.renderKey(e,n.ctrlKey,Boolean(null==i?void 0:i.ctrlKey),n.separator),t.shiftKey&&this.renderKey(e,n.shiftKey,Boolean(null==i?void 0:i.shiftKey),n.separator),t.altKey&&this.renderKey(e,n.altKey,Boolean(null==i?void 0:i.altKey),n.separator),t.metaKey&&this.renderKey(e,n.metaKey,Boolean(null==i?void 0:i.metaKey),n.separator);const o=t.keyLabel;o&&this.renderKey(e,o,Boolean(null==i?void 0:i.keyCode),"")}renderKey(e,t,i,n){hr(e,this.createKeyElement(t,i?".highlight":"")),n&&hr(e,HE("span.monaco-keybinding-key-separator",void 0,n))}renderUnbound(e){hr(e,this.createKeyElement(me(0,"Unbound")))}createKeyElement(e,t=""){const i=HE("span.monaco-keybinding-key"+t,void 0,e);return this.keyElements.add(i),this.options.keybindingLabelBackground&&(i.style.backgroundColor=this.options.keybindingLabelBackground),this.options.keybindingLabelBorder&&(i.style.borderColor=this.options.keybindingLabelBorder),this.options.keybindingLabelBottomBorder&&(i.style.borderBottomColor=this.options.keybindingLabelBottomBorder),this.options.keybindingLabelShadow&&(i.style.boxShadow=`inset 0 -1px 0 ${this.options.keybindingLabelShadow}`),i}static areSame(e,t){return e===t||!e&&!t||!!e&&!!t&&fc(e.firstPart,t.firstPart)&&fc(e.chordPart,t.chordPart)}}const jE=hh("contextViewService"),qE=hh("contextMenuService"),$E={keybindingLabelBackground:wm(Tf),keybindingLabelForeground:wm(Af),keybindingLabelBorder:wm(Rf),keybindingLabelBottomBorder:wm(Of),keybindingLabelShadow:wm(Mm)},GE={buttonForeground:wm(Xm),buttonSeparator:wm(Jm),buttonBackground:wm(ef),buttonHoverBackground:wm(tf),buttonSecondaryForeground:wm(of),buttonSecondaryBackground:wm(sf),buttonSecondaryHoverBackground:wm(rf),buttonBorder:wm(nf)},ZE={progressBarBackground:wm(gf)},YE={inputActiveOptionBorder:wm(Pm),inputActiveOptionForeground:wm(Bm),inputActiveOptionBackground:wm(Fm)},QE=(wm(R_),wm(P_),wm(O_),wm(Sf),wm(kf),wm(Mm),wm(Em),wm(_v),wm(vv),wm(bv),wm(Im),{inputBackground:wm(Am),inputForeground:wm(Rm),inputBorder:wm(Om),inputValidationInfoBorder:wm(zm),inputValidationInfoBackground:wm(Wm),inputValidationInfoForeground:wm(Vm),inputValidationWarningBorder:wm(Km),inputValidationWarningBackground:wm(Hm),inputValidationWarningForeground:wm(Um),inputValidationErrorBorder:wm($m),inputValidationErrorBackground:wm(jm),inputValidationErrorForeground:wm(qm)}),XE={listFilterWidgetBackground:wm(x_),listFilterWidgetOutline:wm(D_),listFilterWidgetNoMatchesOutline:wm(E_),listFilterWidgetShadow:wm(N_),inputBoxStyles:QE,toggleStyles:YE},JE={badgeBackground:wm(af),badgeForeground:wm(lf),badgeBorder:wm(Em)},eN=(wm(Y_),wm(Z_),wm(Q_),wm(Q_),wm(X_),{listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:wm(a_),listFocusForeground:wm(l_),listFocusOutline:wm(h_),listActiveSelectionBackground:wm(c_),listActiveSelectionForeground:wm(u_),listActiveSelectionIconForeground:wm(g_),listFocusAndSelectionOutline:wm(d_),listFocusAndSelectionBackground:wm(c_),listFocusAndSelectionForeground:wm(u_),listInactiveSelectionBackground:wm(p_),listInactiveSelectionIconForeground:wm(f_),listInactiveSelectionForeground:wm(m_),listInactiveFocusBackground:wm(__),listInactiveFocusOutline:wm(v_),listHoverBackground:wm(b_),listHoverForeground:wm(w_),listDropBackground:wm(C_),listSelectionOutline:wm(Nm),listHoverOutline:wm(Nm),treeIndentGuidesStroke:wm(I_),treeInactiveIndentGuidesStroke:wm(M_),tableColumnsBorder:wm(T_),tableOddRowsBackgroundColor:wm(A_)});function tN(e){return function(e,t){const i={...t};for(const t in e){const n=e[t];i[t]=void 0!==n?wm(n):void 0}return i}(e,eN)}const iN={selectBackground:wm(Gm),selectListBackground:wm(Zm),selectForeground:wm(Ym),decoratorRightForeground:wm(If),selectBorder:wm(Qm),focusBorder:wm(Dm),listFocusBackground:wm(V_),listInactiveSelectionIconForeground:wm(W_),listFocusForeground:wm(B_),listFocusOutline:(nN=Nm,oN=ru.transparent.toString(),`var(${bm(nN)}, ${oN})`),listHoverBackground:wm(b_),listHoverForeground:wm(w_),listHoverOutline:wm(Nm),selectListBorder:wm(Lf),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0};var nN,oN;const sN={shadowColor:wm(Mm),borderColor:wm(z_),foregroundColor:wm(H_),backgroundColor:wm(U_),selectionForegroundColor:wm(K_),selectionBackgroundColor:wm(j_),selectionBorderColor:wm(q_),separatorColor:wm($_),scrollbarShadow:wm(hf),scrollbarSliderBackground:wm(df),scrollbarSliderHoverBackground:wm(cf),scrollbarSliderActiveBackground:wm(uf)};var rN=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},aN=function(e,t){return function(i,n){t(i,n,e)}};const lN="acceptSelectedCodeAction",hN="previewSelectedCodeAction";class dN{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){var n,o;i.text.textContent=null!==(o=null===(n=e.group)||void 0===n?void 0:n.title)&&void 0!==o?o:""}disposeTemplate(e){}}let cN=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");return i.className="title",e.append(i),{container:e,icon:t,text:i,keybinding:new KE(e,Qe)}}renderElement(e,t,i){var n,o,s;if((null===(n=e.group)||void 0===n?void 0:n.icon)?(i.icon.className=Ll.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=wm(e.group.icon.color.id))):(i.icon.className=Ll.asClassName(Sl.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=fN(e.label),i.keybinding.set(e.keybinding),function(e,...t){e?fr(...t):_r(...t)}(!!e.keybinding,i.keybinding.element);const r=null===(o=this._keybindingService.lookupKeybinding(lN))||void 0===o?void 0:o.getLabel(),a=null===(s=this._keybindingService.lookupKeybinding(hN))||void 0===s?void 0:s.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:r&&a?this._supportsPreview&&e.canPreview?i.container.title=me(0,"{0} to apply, {1} to preview",r,a):i.container.title=me(0,"{0} to apply",r):i.container.title=""}disposeTemplate(e){}};cN=rN([aN(1,ML)],cN);class uN extends UIEvent{constructor(){super("acceptSelectedAction")}}class gN extends UIEvent{constructor(){super("previewSelectedAction")}}function pN(e){if("action"===e.kind)return e.label}let mN=class extends T{constructor(e,t,i,n,o,s){super(),this._delegate=n,this._contextViewService=o,this._keybindingService=s,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new Pt),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const r={getHeight:e=>"header"===e.kind?this._headerLineHeight:this._actionLineHeight,getTemplateId:e=>e.kind};this._list=this._register(new mE(e,this.domNode,r,[new cN(t,this._keybindingService),new dN],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:pN},accessibilityProvider:{getAriaLabel:e=>{if("action"===e.kind){let t=e.label?fN(null==e?void 0:e.label):"";return e.disabled&&(t=me(0,"{0}, Disabled Reason: {1}",t,e.disabled)),t}return null},getWidgetAriaLabel:()=>me(0,"Action Widget"),getRole:e=>"action"===e.kind?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(eN),this._register(this._list.onMouseClick((e=>this.onListClick(e)))),this._register(this._list.onMouseOver((e=>this.onListHover(e)))),this._register(this._list.onDidChangeFocus((()=>this.onFocus()))),this._register(this._list.onDidChangeSelection((e=>this.onListSelection(e)))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&"action"===e.kind}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter((e=>"header"===e.kind)).length,i=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(i);let n=e;if(this._allMenuItems.length>=50)n=380;else{const t=this._allMenuItems.map(((e,t)=>{const i=this.domNode.ownerDocument.getElementById(this._list.getElementID(t));if(i){i.style.width="auto";const e=i.getBoundingClientRect().width;return i.style.width="",e}return 0}));n=Math.max(...t,e)}const o=Math.min(i,.7*this.domNode.ownerDocument.body.clientHeight);return this._list.layout(o,n),this.domNode.style.height=`${o}px`,this._list.domFocus(),n}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(0===t.length)return;const i=t[0],n=this._list.element(i);if(!this.focusCondition(n))return;const o=e?new gN:new uN;this._list.setSelection([i],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof gN):this._list.setSelection([])}onFocus(){var e,t;this._list.domFocus();const i=this._list.getFocus();if(0===i.length)return;const n=i[0],o=this._list.element(n);null===(t=(e=this._delegate).onFocus)||void 0===t||t.call(e,o.item)}async onListHover(e){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&"action"===t.kind){const e=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=e?e.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus("number"==typeof e.index?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};function fN(e){return e.replace(/\r\n|\r|\n/g," ")}mN=rN([aN(4,jE),aN(5,ML)],mN);var _N=function(e,t){return function(i,n){t(i,n,e)}};Sm("actionBar.toggledBackground",{dark:Fm,light:Fm,hcDark:Fm,hcLight:Fm},me(0,"Background color for toggled action items in action bar."));const vN={Visible:new od("codeActionMenuVisible",!1,me(0,"Whether the action widget list is visible"))},bN=hh("actionWidgetService");let wN=class extends T{get isVisible(){return vN.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new A)}show(e,t,i,n,o,s,r){const a=vN.Visible.bindTo(this._contextKeyService),l=this._instantiationService.createInstance(mN,e,t,i,n);this._contextViewService.showContextView({getAnchor:()=>o,render:e=>(a.set(!0),this._renderWidget(e,l,null!=r?r:[])),onHide:e=>{a.reset(),this._onWidgetClosed(e)}},s,!1)}acceptSelected(e){var t;null===(t=this._list.value)||void 0===t||t.acceptSelected(e)}focusPrevious(){var e,t;null===(t=null===(e=this._list)||void 0===e?void 0:e.value)||void 0===t||t.focusPrevious()}focusNext(){var e,t;null===(t=null===(e=this._list)||void 0===e?void 0:e.value)||void 0===t||t.focusNext()}hide(){var e;null===(e=this._list.value)||void 0===e||e.hide(),this._list.clear()}_renderWidget(e,t,i){var n;const o=document.createElement("div");if(o.classList.add("action-widget"),e.appendChild(o),this._list.value=t,!this._list.value)throw new Error("List has no value");o.appendChild(this._list.value.domNode);const s=new M,r=document.createElement("div"),a=e.appendChild(r);a.classList.add("context-view-block"),s.add(bs(a,or.MOUSE_DOWN,(e=>e.stopPropagation())));const l=document.createElement("div"),h=e.appendChild(l);h.classList.add("context-view-pointerBlock"),s.add(bs(h,or.POINTER_MOVE,(()=>h.remove()))),s.add(bs(h,or.MOUSE_DOWN,(()=>h.remove())));let d=0;if(i.length){const e=this._createActionBar(".action-widget-action-bar",i);e&&(o.appendChild(e.getContainer().parentElement),s.add(e),d=e.getContainer().offsetWidth)}const c=null===(n=this._list.value)||void 0===n?void 0:n.layout(d);o.style.width=`${c}px`;const u=s.add(lr(e));return s.add(u.onDidBlur((()=>this.hide()))),s}_createActionBar(e,t){if(!t.length)return;const i=mr(e),n=new ME(i);return n.push(t,{icon:!1,label:!0}),n}_onWidgetClosed(e){var t;null===(t=this._list.value)||void 0===t||t.hide(e)}};wN=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([_N(0,jE),_N(1,sd),_N(2,lh)],wN),wg(bN,wN,1);const CN=1100;var yN,SN;Nd(class extends Ed{constructor(){super({id:"hideCodeActionWidget",title:{value:me(0,"Hide action widget"),original:"Hide action widget"},precondition:vN.Visible,keybinding:{weight:CN,primary:9,secondary:[1033]}})}run(e){e.get(bN).hide()}}),Nd(class extends Ed{constructor(){super({id:"selectPrevCodeAction",title:{value:me(0,"Select previous action"),original:"Select previous action"},precondition:vN.Visible,keybinding:{weight:CN,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(e){const t=e.get(bN);t instanceof wN&&t.focusPrevious()}}),Nd(class extends Ed{constructor(){super({id:"selectNextCodeAction",title:{value:me(0,"Select next action"),original:"Select next action"},precondition:vN.Visible,keybinding:{weight:CN,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(e){const t=e.get(bN);t instanceof wN&&t.focusNext()}}),Nd(class extends Ed{constructor(){super({id:lN,title:{value:me(0,"Accept selected action"),original:"Accept selected action"},precondition:vN.Visible,keybinding:{weight:CN,primary:3,secondary:[2137]}})}run(e){const t=e.get(bN);t instanceof wN&&t.acceptSelected()}}),Nd(class extends Ed{constructor(){super({id:hN,title:{value:me(0,"Preview selected action"),original:"Preview selected action"},precondition:vN.Visible,keybinding:{weight:CN,primary:2051}})}run(e){const t=e.get(bN);t instanceof wN&&t.acceptSelected(!0)}}),function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"}(yN||(yN={})),function(e){e.compare=function(e,t){return t-e};const t=Object.create(null);t[e.Error]=me(0,"Error"),t[e.Warning]=me(0,"Warning"),t[e.Info]=me(0,"Info"),e.toString=function(e){return t[e]||""},e.fromSeverity=function(t){switch(t){case aL.Error:return e.Error;case aL.Warning:return e.Warning;case aL.Info:return e.Info;case aL.Ignore:return e.Hint}},e.toSeverity=function(t){switch(t){case e.Error:return aL.Error;case e.Warning:return aL.Warning;case e.Info:return aL.Info;case e.Hint:return aL.Ignore}}}(yN||(yN={})),function(e){const t="";function i(e,i){const n=[t];return e.source?n.push(e.source.replace("¦","\\¦")):n.push(t),e.code?"string"==typeof e.code?n.push(e.code.replace("¦","\\¦")):n.push(e.code.value.replace("¦","\\¦")):n.push(t),void 0!==e.severity&&null!==e.severity?n.push(yN.toString(e.severity)):n.push(t),e.message&&i?n.push(e.message.replace("¦","\\¦")):n.push(t),void 0!==e.startLineNumber&&null!==e.startLineNumber?n.push(e.startLineNumber.toString()):n.push(t),void 0!==e.startColumn&&null!==e.startColumn?n.push(e.startColumn.toString()):n.push(t),void 0!==e.endLineNumber&&null!==e.endLineNumber?n.push(e.endLineNumber.toString()):n.push(t),void 0!==e.endColumn&&null!==e.endColumn?n.push(e.endColumn.toString()):n.push(t),n.push(t),n.join("¦")}e.makeKey=function(e){return i(e,!0)},e.makeKeyOptionalMessage=i}(SN||(SN={}));const kN=hh("markerService"),LN=new od("supportedCodeAction","");class xN extends T{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new $t),this._register(this._markerService.onMarkerChanged((e=>this._onMarkerChanges(e)))),this._register(this._editor.onDidChangeCursorPosition((()=>this._tryAutoTrigger())))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some((e=>Hl(e,t.uri)))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet((()=>{this.trigger({type:2,triggerAction:pL.Default})}),this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){var t;if(!this._editor.hasModel())return;const i=this._editor.getModel(),n=this._editor.getSelection();if(n.isEmpty()&&2===e.type){const{lineNumber:e,column:o}=n.getPosition(),s=i.getLineContent(e);if(0===s.length){if((null===(t=this._editor.getOption(64).experimental)||void 0===t?void 0:t.showAiIcon)!==kk.On)return}else if(1===o){if(/\s/.test(s[0]))return}else if(o===i.getLineMaxColumn(e)){if(/\s/.test(s[s.length-1]))return}else if(/\s/.test(s[o-2])&&/\s/.test(s[o-1]))return}return n}}var DN;!function(e){e.Empty={type:0},e.Triggered=class{constructor(e,t,i){this.trigger=e,this.position=t,this._cancellablePromise=i,this.type=1,this.actions=i.catch((e=>{if(g(e))return EN;throw e}))}cancel(){this._cancellablePromise.cancel()}}}(DN||(DN={}));const EN=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class NN extends T{constructor(e,t,i,n,o,s){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._configurationService=s,this._codeActionOracle=this._register(new A),this._state=DN.Empty,this._onDidChangeState=this._register(new q),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=LN.bindTo(n),this._register(this._editor.onDidChangeModel((()=>this._update()))),this._register(this._editor.onDidChangeModelLanguage((()=>this._update()))),this._register(this._registry.onDidChange((()=>this._update()))),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(DN.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=null===(e=this._editor)||void 0===e?void 0:e.getModel();return!!this._configurationService&&this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:null==t?void 0:t.uri})}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(DN.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const t=this._registry.all(e).flatMap((e=>{var t;return null!==(t=e.providedCodeActionKinds)&&void 0!==t?t:[]}));this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new xN(this._editor,this._markerService,(t=>{var i;if(!t)return void this.setState(DN.Empty);const n=t.selection.getStartPosition(),o=Wt((async i=>{var n,o,s,r,a,l;if(this._settingEnabledNearbyQuickfixes()&&1===t.trigger.type&&(t.trigger.triggerAction===pL.QuickFix||(null===(o=null===(n=t.trigger.filter)||void 0===n?void 0:n.include)||void 0===o?void 0:o.contains(gL.QuickFix)))){const n=await DL(this._registry,e,t.selection,t.trigger,cL.None,i),o=[...n.allActions];if(i.isCancellationRequested)return EN;if(!(null===(s=n.validActions)||void 0===s?void 0:s.some((e=>!!e.action.kind&&gL.QuickFix.contains(new gL(e.action.kind)))))){const s=this._markerService.read({resource:e.uri});if(s.length>0){const h=t.selection.getPosition();let d=h,c=Number.MAX_VALUE;const u=[...n.validActions];for(const g of s){const s=g.endColumn,p=g.endLineNumber,m=g.startLineNumber;if(p===h.lineNumber||m===h.lineNumber){d=new ch(p,s);const g={type:t.trigger.type,triggerAction:t.trigger.triggerAction,filter:{include:(null===(r=t.trigger.filter)||void 0===r?void 0:r.include)?null===(a=t.trigger.filter)||void 0===a?void 0:a.include:gL.QuickFix},autoApply:t.trigger.autoApply,context:{notAvailableMessage:(null===(l=t.trigger.context)||void 0===l?void 0:l.notAvailableMessage)||"",position:d}},m=new ic(d.lineNumber,d.column,d.lineNumber,d.column),f=await DL(this._registry,e,m,g,cL.None,i);if(0!==f.validActions.length){for(const e of f.validActions)e.highlightRange=e.action.isPreferred;0===n.allActions.length&&o.push(...f.allActions),Math.abs(h.column-s)<c?u.unshift(...f.validActions):u.push(...f.validActions)}c=Math.abs(h.column-s)}}const g=u.filter(((e,t,i)=>i.findIndex((t=>t.action.title===e.action.title))===t));return g.sort(((e,t)=>e.action.isPreferred&&!t.action.isPreferred?-1:!e.action.isPreferred&&t.action.isPreferred||e.action.isAI&&!t.action.isAI?1:!e.action.isAI&&t.action.isAI?-1:0)),{validActions:g,allActions:o,documentation:n.documentation,hasAutoFix:n.hasAutoFix,hasAIFix:n.hasAIFix,allAIFixes:n.allAIFixes,dispose:()=>{n.dispose()}}}}}return DL(this._registry,e,t.selection,t.trigger,cL.None,i)}));1===t.trigger.type&&(null===(i=this._progressService)||void 0===i||i.showWhile(o,250)),this.setState(new DN.Triggered(t.trigger,n,o))}),void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:pL.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;null===(t=this._codeActionOracle.value)||void 0===t||t.trigger(e)}setState(e,t){e!==this._state&&(1===this._state.type&&this._state.cancel(),this._state=e,t||this._disposed||this._onDidChangeState.fire(e))}}var IN,MN=function(e,t){return function(i,n){t(i,n,e)}};let TN=IN=class extends T{static get(e){return e.getContribution(IN.ID)}constructor(e,t,i,n,o,s,r,a,l,h){super(),this._commandService=r,this._configurationService=a,this._actionWidgetService=l,this._instantiationService=h,this._activeCodeActions=this._register(new A),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new NN(this._editor,o.codeActionProvider,t,i,s,a)),this._register(this._model.onDidChangeState((e=>this.update(e)))),this._lightBulbWidget=new on((()=>{const e=this._editor.getContribution(YL.ID);return e&&this._register(e.onClick((e=>this.showCodeActionList(e.actions,e,{includeDisabledActions:!1,fromLightbulb:!0})))),e})),this._resolver=n.createInstance(AL),this._register(this._editor.onDidLayoutChange((()=>this._actionWidgetService.hide())))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,n){var o;if(!this._editor.hasModel())return;null===(o=Yx.get(this._editor))||void 0===o||o.closeMessage();const s=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:n,context:{notAvailableMessage:e,position:s}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,i){try{await this._instantiationService.invokeFunction(IL,e,NL.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:pL.QuickFix,filter:{}})}}async update(e){var t,i,n,o,s,r,a;if(1!==e.type)return void(null===(t=this._lightBulbWidget.rawValue)||void 0===t||t.hide());let l;try{l=await e.actions}catch(e){return void h(e)}if(!this._disposed)if(null===(i=this._lightBulbWidget.value)||void 0===i||i.update(l,e.trigger,e.position),1===e.trigger.type){if(null===(n=e.trigger.filter)||void 0===n?void 0:n.include){const t=this.tryGetValidActionToApply(e.trigger,l);if(t){try{null===(o=this._lightBulbWidget.value)||void 0===o||o.hide(),await this._applyCodeAction(t,!1,!1)}finally{l.dispose()}return}if(e.trigger.context){const t=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,l);if(t&&t.action.disabled)return null===(s=Yx.get(this._editor))||void 0===s||s.showMessage(t.action.disabled,e.trigger.context.position),void l.dispose()}}const t=!!(null===(r=e.trigger.filter)||void 0===r?void 0:r.include);if(e.trigger.context&&(!l.allActions.length||!t&&!l.validActions.length))return null===(a=Yx.get(this._editor))||void 0===a||a.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=l,void l.dispose();this._activeCodeActions.value=l,this.showCodeActionList(l,this.toCoords(e.position),{includeDisabledActions:t,fromLightbulb:!1})}else this._actionWidgetService.isVisible?l.dispose():this._activeCodeActions.value=l}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length)return"first"===e.autoApply&&0===t.validActions.length||"ifSingle"===e.autoApply&&1===t.allActions.length?t.allActions.find((({action:e})=>e.disabled)):void 0}tryGetValidActionToApply(e,t){if(t.validActions.length)return"first"===e.autoApply&&t.validActions.length>0||"ifSingle"===e.autoApply&&1===t.validActions.length?t.validActions[0]:void 0}async showCodeActionList(e,t,i){const n=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const s=i.includeDisabledActions&&(this._showDisabled||0===e.validActions.length)?e.allActions:e.validActions;if(!s.length)return;const r=ch.isIPosition(t)?this.toCoords(t):t,a={onSelect:async(e,t)=>{this._applyCodeAction(e,!0,!!t),this._actionWidgetService.hide(),n.clear()},onHide:()=>{var e;null===(e=this._editor)||void 0===e||e.focus(),n.clear()},onHover:async(e,t)=>{var i;if(await e.resolve(t),!t.isCancellationRequested)return{canPreview:!!(null===(i=e.action.edit)||void 0===i?void 0:i.edits.length)}},onFocus:e=>{var t,i;if(e&&e.highlightRange&&e.action.diagnostics){const o=[{range:e.action.diagnostics[0],options:IN.DECORATION}];n.set(o);const s=e.action.diagnostics[0];Yr(me(0,"Context: {0} at line {1} and column {2}.",null===(i=null===(t=this._editor.getModel())||void 0===t?void 0:t.getWordAtPosition({lineNumber:s.startLineNumber,column:s.startColumn}))||void 0===i?void 0:i.word,s.startLineNumber,s.startColumn))}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,function(e,t,i){if(!t)return e.map((e=>{var t;return{kind:"action",item:e,group:VL,disabled:!!e.action.disabled,label:e.action.disabled||e.action.title,canPreview:!!(null===(t=e.action.edit)||void 0===t?void 0:t.edits.length)}}));const n=zL.map((e=>({group:e,actions:[]})));for(const t of e){const e=t.action.kind?new gL(t.action.kind):gL.None;for(const i of n)if(i.group.kind.contains(e)){i.actions.push(t);break}}const o=[];for(const e of n)if(e.actions.length){o.push({kind:"header",group:e.group});for(const t of e.actions){const n=e.group;o.push({kind:"action",item:t,group:t.action.isAI?{title:n.title,kind:n.kind,icon:Sl.sparkle}:n,label:t.action.title,disabled:!!t.action.disabled,keybinding:i(t.action)})}}return o}(s,this._shouldShowHeaders(),this._resolver.getResolver()),a,r,o,this._getActionBarActions(e,t,i))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=As(this._editor.getDomNode());return{x:i.left+t.left,y:i.top+t.top+t.height}}_shouldShowHeaders(){var e;const t=null===(e=this._editor)||void 0===e?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:null==t?void 0:t.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const n=e.documentation.map((e=>{var t;return{id:e.id,label:e.title,tooltip:null!==(t=e.tooltip)&&void 0!==t?t:"",class:void 0,enabled:!0,run:()=>{var t;return this._commandService.executeCommand(e.id,...null!==(t=e.arguments)&&void 0!==t?t:[])}}}));return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&n.push(this._showDisabled?{id:"hideMoreActions",label:me(0,"Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:me(0,"Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),n}};function AN(e){return Bh.regex(LN.keys()[0],new RegExp("(\\s|^)"+dn(e.value)+"\\b"))}TN.ID="editor.contrib.codeActionController",TN.DECORATION=Sy.register({description:"quickfix-highlight",className:"quickfix-edit-highlight"}),TN=IN=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([MN(1,kN),MN(2,sd),MN(3,lh),MN(4,Jk),MN(5,uL),MN(6,wh),MN(7,ug),MN(8,bN),MN(9,lh)],TN),Fv(((e,t)=>{((e,i)=>{i&&t.addRule(`.monaco-editor .quickfix-edit-highlight { background-color: ${i}; }`)})(0,e.getColor(zf));const i=e.getColor(Kf);i&&t.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Iv(e.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)}));const RN={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:me(0,"Kind of the code action to run.")},apply:{type:"string",description:me(0,"Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[me(0,"Always apply the first returned code action."),me(0,"Apply the first returned code action if it is the only one."),me(0,"Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:me(0,"Controls if only preferred code actions should be returned.")}}};function ON(e,t,i,n,o=pL.Default){if(e.hasModel()){const s=TN.get(e);null==s||s.manualTriggerAtCurrentPosition(t,o,i,n)}}Gd(TN.ID,TN,3),Gd(YL.ID,YL,4),qd(class extends zd{constructor(){super({id:bL,label:me(0,"Quick Fix..."),alias:"Quick Fix...",precondition:Bh.and(nc.writable,nc.hasCodeActionsProvider),kbOpts:{kbExpr:nc.textInputFocus,primary:2137,weight:100}})}run(e,t){return ON(t,me(0,"No code actions available"),void 0,void 0,pL.QuickFix)}}),qd(class extends zd{constructor(){super({id:CL,label:me(0,"Refactor..."),alias:"Refactor...",precondition:Bh.and(nc.writable,nc.hasCodeActionsProvider),kbOpts:{kbExpr:nc.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:Bh.and(nc.writable,AN(gL.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:RN}]}})}run(e,t,i){const n=fL.fromUser(i,{kind:gL.Refactor,apply:"never"});return ON(t,"string"==typeof(null==i?void 0:i.kind)?n.preferred?me(0,"No preferred refactorings for '{0}' available",i.kind):me(0,"No refactorings for '{0}' available",i.kind):n.preferred?me(0,"No preferred refactorings available"):me(0,"No refactorings available"),{include:gL.Refactor.contains(n.kind)?n.kind:gL.None,onlyIncludePreferredActions:n.preferred},n.apply,pL.Refactor)}}),qd(class extends zd{constructor(){super({id:yL,label:me(0,"Source Action..."),alias:"Source Action...",precondition:Bh.and(nc.writable,nc.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:Bh.and(nc.writable,AN(gL.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:RN}]}})}run(e,t,i){const n=fL.fromUser(i,{kind:gL.Source,apply:"never"});return ON(t,"string"==typeof(null==i?void 0:i.kind)?n.preferred?me(0,"No preferred source actions for '{0}' available",i.kind):me(0,"No source actions for '{0}' available",i.kind):n.preferred?me(0,"No preferred source actions available"):me(0,"No source actions available"),{include:gL.Source.contains(n.kind)?n.kind:gL.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,pL.SourceAction)}}),qd(class extends zd{constructor(){super({id:SL,label:me(0,"Organize Imports"),alias:"Organize Imports",precondition:Bh.and(nc.writable,AN(gL.SourceOrganizeImports)),kbOpts:{kbExpr:nc.textInputFocus,primary:1581,weight:100}})}run(e,t){return ON(t,me(0,"No organize imports action available"),{include:gL.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",pL.OrganizeImports)}}),qd(class extends zd{constructor(){super({id:wL,label:me(0,"Auto Fix..."),alias:"Auto Fix...",precondition:Bh.and(nc.writable,AN(gL.QuickFix)),kbOpts:{kbExpr:nc.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return ON(t,me(0,"No auto fixes available"),{include:gL.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",pL.AutoFix)}}),qd(class extends zd{constructor(){super({id:kL,label:me(0,"Fix All"),alias:"Fix All",precondition:Bh.and(nc.writable,AN(gL.SourceFixAll))})}run(e,t){return ON(t,me(0,"No fix all action available"),{include:gL.SourceFixAll,includeSourceActions:!0},"ifSingle",pL.FixAll)}}),jd(new class extends Vd{constructor(){super({id:vL,precondition:Bh.and(nc.writable,nc.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:RN}]}})}runEditorCommand(e,t,i){const n=fL.fromUser(i,{kind:gL.Empty,apply:"ifSingle"});return ON(t,"string"==typeof(null==i?void 0:i.kind)?n.preferred?me(0,"No preferred code actions for '{0}' available",i.kind):me(0,"No code actions for '{0}' available",i.kind):n.preferred?me(0,"No preferred code actions available"):me(0,"No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}),md.as(Lg).registerConfiguration({...Kk,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:me(0,"Enable/disable showing group headers in the Code Action menu."),default:!0}}}),md.as(Lg).registerConfiguration({...Kk,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:5,description:me(0,"Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});class PN{static capture(e){if(0===e.getScrollTop()||e.hasPendingScrollAnimation())return new PN(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const n=e.getVisibleRanges();if(n.length>0){t=n[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}return new PN(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,n,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n,this._cursorPosition=o}restore(e){if((this._initialContentHeight!==e.getContentHeight()||this._initialScrollTop!==e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i)}}class FN{constructor(){this.lenses=[],this._disposables=new M}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}async function BN(e,t,i){const n=e.ordered(t),o=new Map,s=new FN,r=n.map((async(e,n)=>{o.set(e,n);try{const n=await Promise.resolve(e.provideCodeLenses(t,i));n&&s.add(n,e)}catch(e){d(e)}}));return await Promise.all(r),s.lenses=s.lenses.sort(((e,t)=>e.symbol.range.startLineNumber<t.symbol.range.startLineNumber?-1:e.symbol.range.startLineNumber>t.symbol.range.startLineNumber?1:o.get(e.provider)<o.get(t.provider)?-1:o.get(e.provider)>o.get(t.provider)?1:e.symbol.range.startColumn<t.symbol.range.startColumn?-1:e.symbol.range.startColumn>t.symbol.range.startColumn?1:0)),s}var WN,VN;Ch.registerCommand("_executeCodeLensProvider",(function(e,...t){let[i,n]=t;fl(Ro.isUri(i)),fl("number"==typeof n||!n);const{codeLensProvider:o}=e.get(Jk),s=e.get(uh).getModel(i);if(!s)throw m();const r=[],a=new M;return BN(o,s,Rt.None).then((e=>{a.add(e);const t=[];for(const i of e.lenses)null==n||Boolean(i.symbol.command)?r.push(i.symbol):n-- >0&&i.provider.resolveCodeLens&&t.push(Promise.resolve(i.provider.resolveCodeLens(s,i.symbol,Rt.None)).then((e=>r.push(e||i.symbol))));return Promise.all(t)})).then((()=>r)).finally((()=>{setTimeout((()=>a.dispose()),100)}))})),function(e){e[e.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",e[e.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"}(WN||(WN={})),function(e){e[e.None=0]="None",e[e.Initialized=1]="Initialized",e[e.Closed=2]="Closed"}(VN||(VN={}));class zN extends T{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new G),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=VN.None,this.cache=new Map,this.flushDelayer=this._register(new Ut(zN.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal((e=>this.onDidChangeItemsExternal(e))))}onDidChangeItemsExternal(e){var t,i;this._onDidChangeStorage.pause();try{null===(t=e.changed)||void 0===t||t.forEach(((e,t)=>this.acceptExternal(t,e))),null===(i=e.deleted)||void 0===i||i.forEach((e=>this.acceptExternal(e,void 0)))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===VN.Closed)return;let i=!1;ml(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const i=this.cache.get(e);return ml(i)?t:i}getBoolean(e,t){const i=this.get(e);return ml(i)?t:"true"===i}getNumber(e,t){const i=this.get(e);return ml(i)?t:parseInt(i,10)}async set(e,t,i=!1){if(this.state===VN.Closed)return;if(ml(t))return this.delete(e,i);const n=ll(t)||Array.isArray(t)?(o=t,JSON.stringify(o,dx)):String(t);var o;return this.cache.get(e)!==n?(this.cache.set(e,n),this.pendingInserts.set(e,n),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()):void 0}async delete(e,t=!1){if(this.state!==VN.Closed)return this.cache.delete(e)?(this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()):void 0}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally((()=>{var e;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)null===(e=this.whenFlushedCallbacks.pop())||void 0===e||e()}))}async doFlush(e){return this.options.hint===WN.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger((()=>this.flushPending()),e)}}zN.DEFAULT_FLUSH_DELAY=100;class HN{constructor(){this.onDidChangeItemsExternal=z.None,this.items=new Map}async updateItems(e){var t,i;null===(t=e.insert)||void 0===t||t.forEach(((e,t)=>this.items.set(t,e))),null===(i=e.delete)||void 0===i||i.forEach((e=>this.items.delete(e)))}}const UN="__$__targetStorageMarker",KN=hh("storageService");var jN;!function(e){e[e.NONE=0]="NONE",e[e.SHUTDOWN=1]="SHUTDOWN"}(jN||(jN={}));class qN extends T{constructor(e={flushInterval:qN.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new G),this._onDidChangeTarget=this._register(new G),this._onWillSaveState=this._register(new q),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return z.filter(this._onDidChangeValue.event,(i=>i.scope===e&&(void 0===t||i.key===t)),i)}emitDidChangeValue(e,t){const{key:i,external:n}=t;if(i===UN){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:n})}get(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.get(e,i)}getBoolean(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.getBoolean(e,i)}getNumber(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.getNumber(e,i)}store(e,t,i,n,o=!1){ml(t)?this.remove(e,i,o):this.withPausedEmitters((()=>{var s;this.updateKeyTarget(e,i,n),null===(s=this.getStorage(i))||void 0===s||s.set(e,t,o)}))}remove(e,t,i=!1){this.withPausedEmitters((()=>{var n;this.updateKeyTarget(e,t,void 0),null===(n=this.getStorage(t))||void 0===n||n.delete(e,i)}))}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i,n=!1){var o,s;const r=this.getKeyTargets(t);"number"==typeof i?r[e]!==i&&(r[e]=i,null===(o=this.getStorage(t))||void 0===o||o.set(UN,JSON.stringify(r),n)):"number"==typeof r[e]&&(delete r[e],null===(s=this.getStorage(t))||void 0===s||s.set(UN,JSON.stringify(r),n))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?function(e){const t=e.get(UN);if(t)try{return JSON.parse(t)}catch(e){}return Object.create(null)}(t):Object.create(null)}}qN.DEFAULT_FLUSH_INTERVAL=6e4;const $N=hh("ICodeLensCache");class GN{constructor(e,t){this.lineCount=e,this.data=t}}let ZN=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new na(20,.75),ys(r,(()=>e.remove("codelens/cache",1)));const t="codelens/cache2",i=e.get(t,1,"{}");this._deserialize(i),z.once(e.onWillSaveState)((i=>{i.reason===jN.SHUTDOWN&&e.store(t,this._serialize(),1,1)}))}put(e,t){const i=t.lenses.map((e=>{var t;return{range:e.symbol.range,command:e.symbol.command&&{id:"",title:null===(t=e.symbol.command)||void 0===t?void 0:t.title}}})),n=new FN;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const o=new GN(e.getLineCount(),n);this._cache.set(e.uri.toString(),o)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const n=new Set;for(const e of i.data.lenses)n.add(e.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...n.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const e in t){const i=t[e],n=[];for(const e of i.lines)n.push({range:new tc(e,1,e,11)});const o=new FN;o.add({lenses:n,dispose(){}},this._fakeProvider),this._cache.set(e,new GN(i.lineCount,o))}}catch(e){}}};ZN=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,KN)],ZN),wg($N,ZN,1);var YN=i(2849),QN={};QN.styleTagTransform=Vr(),QN.setAttributes=Pr(),QN.insert=Rr().bind(null,"head"),QN.domAPI=Tr(),QN.insertStyleElement=Br(),Ir()(YN.Z,QN),YN.Z&&YN.Z.locals&&YN.Z.locals;class XN{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){void 0===this._lastHeight?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return 0!==this._lastHeight&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class JN{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id="codelens.widget-"+JN._idPool++,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let n=!1;for(let t=0;t<e.length;t++){const o=e[t];if(o&&(n=!0,o.command)){const n=nx(o.command.title.trim());o.command.id?(i.push(mr("a",{id:String(t),title:o.command.tooltip,role:"button"},...n)),this._commands.set(String(t),o.command)):i.push(mr("span",{title:o.command.tooltip},...n)),t+1<e.length&&i.push(mr("span",void 0," | "))}}n?(cr(this._domNode,...i),this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):cr(this._domNode,mr("span",void 0,"no commands"))}getCommand(e){return e.parentElement===this._domNode?this._commands.get(e.id):void 0}getId(){return this._id}getDomNode(){return this._domNode}updatePosition(e){const t=this._editor.getModel().getLineFirstNonWhitespaceColumn(e);this._widgetPosition={position:{lineNumber:e,column:t},preference:[1]}}getPosition(){return this._widgetPosition||null}}JN._idPool=0;class eI{constructor(){this._removeDecorations=[],this._addDecorations=[],this._addDecorationsCallbacks=[]}addDecoration(e,t){this._addDecorations.push(e),this._addDecorationsCallbacks.push(t)}removeDecoration(e){this._removeDecorations.push(e)}commit(e){const t=e.deltaDecorations(this._removeDecorations,this._addDecorations);for(let e=0,i=t.length;e<i;e++)this._addDecorationsCallbacks[e](t[e])}}const tI=Sy.register({collapseOnReplaceEdit:!0,description:"codelens"});class iI{constructor(e,t,i,n,o,s){let r;this._isDisposed=!1,this._editor=t,this._data=e,this._decorationIds=[];const a=[];this._data.forEach(((e,t)=>{e.symbol.command&&a.push(e.symbol),i.addDecoration({range:e.symbol.range,options:tI},(e=>this._decorationIds[t]=e)),r=r?tc.plusRange(r,e.symbol.range):tc.lift(e.symbol.range)})),this._viewZone=new XN(r.startLineNumber-1,o,s),this._viewZoneId=n.addZone(this._viewZone),a.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(a,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new JN(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],null==t||t.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some(((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),n=this._data[t].symbol;return!(!i||tc.isEmpty(n.range)!==i.isEmpty())}))}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach(((e,i)=>{t.addDecoration({range:e.symbol.range,options:tI},(e=>this._decorationIds[i]=e))}))}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t<this._decorationIds.length;t++){const i=e.getDecorationRange(this._decorationIds[t]);i&&(this._data[t].symbol.range=i)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){const i=e[t];if(i){const{symbol:e}=this._data[t];e.command=i.command||e.command}}}getCommand(e){var t;return null===(t=this._contentWidget)||void 0===t?void 0:t.getCommand(e)}getLineNumber(){const e=this._editor.getModel().getDecorationRange(this._decorationIds[0]);return e?e.startLineNumber:-1}update(e){if(this.isValid()){const t=this._editor.getModel().getDecorationRange(this._decorationIds[0]);t&&(this._viewZone.afterLineNumber=t.startLineNumber-1,e.layoutZone(this._viewZoneId),this._contentWidget&&(this._contentWidget.updatePosition(t.startLineNumber),this._editor.layoutContentWidget(this._contentWidget)))}}}const nI={ctrlCmd:!1,alt:!1};var oI,sI;!function(e){e[e.Blur=1]="Blur",e[e.Gesture=2]="Gesture",e[e.Other=3]="Other"}(oI||(oI={})),function(e){e[e.NONE=0]="NONE",e[e.FIRST=1]="FIRST",e[e.SECOND=2]="SECOND",e[e.LAST=3]="LAST"}(sI||(sI={})),new class{constructor(e){this.options=e}};const rI=hh("quickInputService"),aI=hh("environmentService");var lI=function(e,t){return function(i,n){t(i,n,e)}};const hI=hh("ILanguageFeatureDebounceService");var dI;!function(e){const t=new WeakMap;let i=0;e.of=function(e){let n=t.get(e);return void 0===n&&(n=++i,t.set(e,n)),n}}(dI||(dI={}));class cI{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class uI{constructor(e,t,i,n,o,s){this._logService=e,this._name=t,this._registry=i,this._default=n,this._min=o,this._max=s,this._cache=new na(50,.7)}_key(e){return e.id+this._registry.all(e).reduce(((e,t)=>Jo(dI.of(t),e)),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?iD(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let n=this._cache.get(i);n||(n=new oD(6),this._cache.set(i,n));const o=iD(n.update(t),this._min,this._max);return qo(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new nD;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){return iD(0|this._overall()||this._default,this._min,this._max)}}let gI=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){var n,o,s;const r=null!==(n=null==i?void 0:i.min)&&void 0!==n?n:50,a=null!==(o=null==i?void 0:i.max)&&void 0!==o?o:r**2,l=null!==(s=null==i?void 0:i.key)&&void 0!==s?s:void 0,h=`${dI.of(e)},${r}${l?","+l:""}`;let d=this._data.get(h);return d||(this._isDev?d=new uI(this._logService,t,e,0|this._overallAverage()||1.5*r,r,a):(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),d=new cI(1.5*r)),this._data.set(h,d)),d}_overallAverage(){const e=new nD;for(const t of this._data.values())e.update(t.default());return e.value}};gI=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([lI(0,Md),lI(1,aI)],gI),wg(hI,gI,1);var pI=function(e,t){return function(i,n){t(i,n,e)}};let mI=class{constructor(e,t,i,n,o,s){this._editor=e,this._languageFeaturesService=t,this._commandService=n,this._notificationService=o,this._codeLensCache=s,this._disposables=new M,this._localToDispose=new M,this._lenses=[],this._oldCodeLensModels=new M,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Zt((()=>this._resolveCodeLensesInViewport()),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel((()=>this._onModelChange()))),this._disposables.add(this._editor.onDidChangeModelLanguage((()=>this._onModelChange()))),this._disposables.add(this._editor.onDidChangeConfiguration((e=>{(e.hasChanged(50)||e.hasChanged(19)||e.hasChanged(18))&&this._updateLensStyle(),e.hasChanged(17)&&this._onModelChange()}))),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),null===(e=this._currentCodeLensModel)||void 0===e||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(66)/this._editor.getOption(52));let t=this._editor.getOption(19);return(!t||t<5)&&(t=.9*this._editor.getOption(52)|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(18),n=this._editor.getOption(50),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",n.fontFeatureSettings),i&&(o.setProperty("--vscode-editorCodeLens-fontFamily",i),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",Vk.fontFamily)),this._editor.changeViewZones((t=>{for(const i of this._lenses)i.updateHeight(e,t)}))}_localDispose(){var e,t,i;null===(e=this._getCodeLensModelPromise)||void 0===e||e.cancel(),this._getCodeLensModelPromise=void 0,null===(t=this._resolveCodeLensesPromise)||void 0===t||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),null===(i=this._currentCodeLensModel)||void 0===i||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e)return;if(!this._editor.getOption(17)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e))return void(t&&jt((()=>{const i=this._codeLensCache.get(e);t===i&&(this._codeLensCache.delete(e),this._onModelChange())}),3e4,this._localToDispose));for(const t of this._languageFeaturesService.codeLensProvider.all(e))if("function"==typeof t.onDidChange){const e=t.onDidChange((()=>i.schedule()));this._localToDispose.add(e)}const i=new Zt((()=>{var t;const n=Date.now();null===(t=this._getCodeLensModelPromise)||void 0===t||t.cancel(),this._getCodeLensModelPromise=Wt((t=>BN(this._languageFeaturesService.codeLensProvider,e,t))),this._getCodeLensModelPromise.then((t=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=t,this._codeLensCache.put(e,t);const o=this._provideCodeLensDebounce.update(e,Date.now()-n);i.delay=o,this._renderCodeLensSymbols(t),this._resolveCodeLensesInViewportSoon()}),h)}),this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(I((()=>this._resolveCodeLensesScheduler.cancel()))),this._localToDispose.add(this._editor.onDidChangeModelContent((()=>{var e;this._editor.changeDecorations((e=>{this._editor.changeViewZones((t=>{const i=[];let n=-1;this._lenses.forEach((e=>{e.isValid()&&n!==e.getLineNumber()?(e.update(t),n=e.getLineNumber()):i.push(e)}));const o=new eI;i.forEach((e=>{e.dispose(o,t),this._lenses.splice(this._lenses.indexOf(e),1)})),o.commit(e)}))})),i.schedule(),this._resolveCodeLensesScheduler.cancel(),null===(e=this._resolveCodeLensesPromise)||void 0===e||e.cancel(),this._resolveCodeLensesPromise=void 0}))),this._localToDispose.add(this._editor.onDidFocusEditorWidget((()=>{i.schedule()}))),this._localToDispose.add(this._editor.onDidBlurEditorText((()=>{i.cancel()}))),this._localToDispose.add(this._editor.onDidScrollChange((e=>{e.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()}))),this._localToDispose.add(this._editor.onDidLayoutChange((()=>{this._resolveCodeLensesInViewportSoon()}))),this._localToDispose.add(I((()=>{if(this._editor.getModel()){const e=PN.capture(this._editor);this._editor.changeDecorations((e=>{this._editor.changeViewZones((t=>{this._disposeAllLenses(e,t)}))})),e.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)}))),this._localToDispose.add(this._editor.onMouseDown((e=>{if(9!==e.target.type)return;let t=e.target.element;if("SPAN"===(null==t?void 0:t.tagName)&&(t=t.parentElement),"A"===(null==t?void 0:t.tagName))for(const e of this._lenses){const i=e.getCommand(t);if(i){this._commandService.executeCommand(i.id,...i.arguments||[]).catch((e=>this._notificationService.error(e)));break}}}))),i.schedule()}_disposeAllLenses(e,t){const i=new eI;for(const e of this._lenses)e.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let n;for(const o of e.lenses){const e=o.symbol.range.startLineNumber;e<1||e>t||(n&&n[n.length-1].symbol.range.startLineNumber===e?n.push(o):(n=[o],i.push(n)))}if(!i.length&&!this._lenses.length)return;const o=PN.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations((e=>{this._editor.changeViewZones((t=>{const n=new eI;let o=0,r=0;for(;r<i.length&&o<this._lenses.length;){const e=i[r][0].symbol.range.startLineNumber,a=this._lenses[o].getLineNumber();a<e?(this._lenses[o].dispose(n,t),this._lenses.splice(o,1)):a===e?(this._lenses[o].updateCodeLensSymbols(i[r],n),r++,o++):(this._lenses.splice(o,0,new iI(i[r],this._editor,n,t,s.codeLensHeight,(()=>this._resolveCodeLensesInViewportSoon()))),o++,r++)}for(;o<this._lenses.length;)this._lenses[o].dispose(n,t),this._lenses.splice(o,1);for(;r<i.length;)this._lenses.push(new iI(i[r],this._editor,n,t,s.codeLensHeight,(()=>this._resolveCodeLensesInViewportSoon()))),r++;n.commit(e)}))})),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;null===(e=this._resolveCodeLensesPromise)||void 0===e||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const i=[],n=[];if(this._lenses.forEach((e=>{const o=e.computeIfNecessary(t);o&&(i.push(o),n.push(e))})),0===i.length)return;const o=Date.now(),s=Wt((e=>{const o=i.map(((i,o)=>{const s=new Array(i.length),r=i.map(((i,n)=>i.symbol.command||"function"!=typeof i.provider.resolveCodeLens?(s[n]=i.symbol,Promise.resolve(void 0)):Promise.resolve(i.provider.resolveCodeLens(t,i.symbol,e)).then((e=>{s[n]=e}),d)));return Promise.all(r).then((()=>{e.isCancellationRequested||n[o].isDisposed()||n[o].updateCommands(s)}))}));return Promise.all(o)}));this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then((()=>{const e=this._resolveCodeLensesDebounce.update(t,Date.now()-o);this._resolveCodeLensesScheduler.delay=e,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)}),(e=>{h(e),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)}))}async getModel(){var e;return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,(null===(e=this._currentCodeLensModel)||void 0===e?void 0:e.isDisposed)?void 0:this._currentCodeLensModel}};mI.ID="css.editor.codeLens",mI=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([pI(1,Jk),pI(2,hI),pI(3,wh),pI(4,hL),pI(5,$N)],mI),Gd(mI.ID,mI,1),qd(class extends zd{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:nc.hasCodeLensProvider,label:me(0,"Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}async run(e,t){if(!t.hasModel())return;const i=e.get(rI),n=e.get(wh),o=e.get(hL),s=t.getSelection().positionLineNumber,r=t.getContribution(mI.ID);if(!r)return;const a=await r.getModel();if(!a)return;const l=[];for(const e of a.lenses)e.symbol.command&&e.symbol.range.startLineNumber===s&&l.push({label:e.symbol.command.title,command:e.symbol.command});if(0===l.length)return;const h=await i.pick(l,{canPickMany:!1,placeHolder:me(0,"Select a command")});if(!h)return;let d=h.command;if(a.isDisposed){const e=await r.getModel(),t=null==e?void 0:e.lenses.find((e=>{var t;return e.symbol.range.startLineNumber===s&&(null===(t=e.symbol.command)||void 0===t?void 0:t.title)===d.title}));if(!t||!t.symbol.command)return;d=t.symbol.command}try{await n.executeCommand(d.id,...d.arguments||[])}catch(e){o.error(e)}}});class fI{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new _I(this.x-e.scrollX,this.y-e.scrollY)}}class _I{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new fI(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class vI{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}class bI{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function wI(e){const t=As(e);return new vI(t.left,t.top,t.width,t.height)}function CI(e,t,i){const n=t.width/e.offsetWidth,o=t.height/e.offsetHeight,s=(i.x-t.x)/n,r=(i.y-t.y)/o;return new bI(s,r)}class yI extends Mt{constructor(e,t,i){super(as(i),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new fI(this.posx,this.posy),this.editorPos=wI(i),this.relativePos=CI(i,this.editorPos,this.pos)}}class SI{constructor(e){this._editorViewDomNode=e}_create(e){return new yI(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return bs(e,"contextmenu",(e=>{t(this._create(e))}))}onMouseUp(e,t){return bs(e,"mouseup",(e=>{t(this._create(e))}))}onMouseDown(e,t){return bs(e,or.MOUSE_DOWN,(e=>{t(this._create(e))}))}onPointerDown(e,t){return bs(e,or.POINTER_DOWN,(e=>{t(this._create(e),e.pointerId)}))}onMouseLeave(e,t){return bs(e,or.MOUSE_LEAVE,(e=>{t(this._create(e))}))}onMouseMove(e,t){return bs(e,"mousemove",(e=>t(this._create(e))))}}class kI{constructor(e){this._editorViewDomNode=e}_create(e){return new yI(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return bs(e,"pointerup",(e=>{t(this._create(e))}))}onPointerDown(e,t){return bs(e,or.POINTER_DOWN,(e=>{t(this._create(e),e.pointerId)}))}onPointerLeave(e,t){return bs(e,or.POINTER_LEAVE,(e=>{t(this._create(e))}))}onPointerMove(e,t){return bs(e,"pointermove",(e=>t(this._create(e))))}}class LI extends T{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new lD),this._keydownListener=null}startMonitoring(e,t,i,n,o){this._keydownListener=Cs(e.ownerDocument,"keydown",(e=>{e.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,e.browserEvent)}),!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,(e=>{n(new yI(e,!0,this._editorViewDomNode))}),(e=>{this._keydownListener.dispose(),o(e)}))}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class xI{constructor(e){this._editor=e,this._instanceId=++xI._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new Zt((()=>this.garbageCollect()),1e3)}createClassNameRef(e){const t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const t=this.computeUniqueKey(e);let i=this._rules.get(t);if(!i){const n=this._counter++;i=new DI(t,`dyn-rule-${this._instanceId}-${n}`,zs(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}}xI._idPool=0;class DI{constructor(e,t,i,n){this.key=e,this.className=t,this.properties=n,this._referenceCount=0,this._styleElementDisposables=new M,this._styleElement=$s(i,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const e in t){const n=t[e];let o;o="object"==typeof n?wm(n.id):n,i+=`\n\t${EI(e)}: ${o};`}return i+="\n}",i}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function EI(e){return e.replace(/(^[A-Z])/,(([e])=>e.toLowerCase())).replace(/([A-Z])/g,(([e])=>`-${e.toLowerCase()}`))}let NI=!1;function II(e){Ue&&(NI||(NI=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(e.message))}class MI{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.method=i,this.args=n,this.type=0}}class TI{constructor(e,t,i,n){this.vsWorker=e,this.seq=t,this.res=i,this.err=n,this.type=1}}class AI{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=n,this.type=2}}class RI{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class OI{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class PI{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){const i=String(++this._lastSentReq);return new Promise(((n,o)=>{this._pendingReplies[i]={resolve:n,reject:o},this._send(new MI(this._workerId,i,e,t))}))}listen(e,t){let i=null;const n=new q({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,n),this._send(new AI(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new OI(this._workerId,i)),i=null}});return n.event}handleMessage(e){e&&e.vsWorker&&(-1!==this._workerId&&e.vsWorker!==this._workerId||this._handleMessage(e))}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq])return void console.warn("Got reply to unknown seq");const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;return e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),void t.reject(i)}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then((e=>{this._send(new TI(this._workerId,t,e,void 0))}),(e=>{e.detail instanceof Error&&(e.detail=c(e.detail)),this._send(new TI(this._workerId,t,void 0,c(e)))}))}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)((e=>{this._send(new RI(this._workerId,t,e))}));this._pendingEvents.set(t,i)}_handleEventMessage(e){this._pendingEmitters.has(e.req)?this._pendingEmitters.get(e.req).fire(e.event):console.warn("Got event for unknown req")}_handleUnsubscribeEventMessage(e){this._pendingEvents.has(e.req)?(this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)):console.warn("Got unsubscribe for unknown req")}_send(e){const t=[];if(0===e.type)for(let i=0;i<e.args.length;i++)e.args[i]instanceof ArrayBuffer&&t.push(e.args[i]);else 1===e.type&&e.res instanceof ArrayBuffer&&t.push(e.res);this._handler.sendMessage(e,t)}}class FI extends T{constructor(e,t,i){super();let n=null;this._worker=this._register(e.create("vs/base/common/worker/simpleWorker",(e=>{this._protocol.handleMessage(e)}),(e=>{null==n||n(e)}))),this._protocol=new PI({sendMessage:(e,t)=>{this._worker.postMessage(e,t)},handleMessage:(e,t)=>{if("function"!=typeof i[e])return Promise.reject(new Error("Missing method "+e+" on main thread host."));try{return Promise.resolve(i[e].apply(i,t))}catch(e){return Promise.reject(e)}},handleEvent:(e,t)=>{if(WI(e)){const n=i[e].call(i,t);if("function"!=typeof n)throw new Error(`Missing dynamic event ${e} on main thread host.`);return n}if(BI(e)){const t=i[e];if("function"!=typeof t)throw new Error(`Missing event ${e} on main thread host.`);return t}throw new Error(`Malformed event name ${e}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;const s=globalThis.require;void 0!==s&&"function"==typeof s.getConfig?o=s.getConfig():void 0!==globalThis.requirejs&&(o=globalThis.requirejs.s.contexts._.config);const r=_c(i);this._onModuleLoaded=this._protocol.sendMessage("$initialize",[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,r]);const a=(e,t)=>this._request(e,t),l=(e,t)=>this._protocol.listen(e,t);this._lazyProxy=new Promise(((e,i)=>{n=i,this._onModuleLoaded.then((t=>{e(function(e,t,i){const n=e=>function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)},o=e=>function(t){return i(e,t)},s={};for(const t of e)WI(t)?s[t]=o(t):BI(t)?s[t]=i(t,void 0):s[t]=n(t);return s}(t,a,l))}),(e=>{i(e),this._onError("Worker failed to load "+t,e)}))}))}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise(((i,n)=>{this._onModuleLoaded.then((()=>{this._protocol.sendMessage(e,t).then(i,n)}),n)}))}_onError(e,t){console.error(e),console.info(t)}}function BI(e){return"o"===e[0]&&"n"===e[1]&&Ln(e.charCodeAt(2))}function WI(e){return/^onDynamic/.test(e)&&Ln(e.charCodeAt(9))}const VI=Tx("defaultWorkerFactory",{createScriptURL:e=>e});class zI{constructor(e,t,i,n,o){this.id=t,this.label=i;const s=function(e){const t=globalThis.MonacoEnvironment;if(t){if("function"==typeof t.getWorker)return t.getWorker("workerMain.js",e);if("function"==typeof t.getWorkerUrl){const i=t.getWorkerUrl("workerMain.js",e);return new Worker(VI?VI.createScriptURL(i):i,{name:e})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}(i);"function"==typeof s.then?this.worker=s:this.worker=Promise.resolve(s),this.postMessage(e,[]),this.worker.then((e=>{e.onmessage=function(e){n(e.data)},e.onmessageerror=o,"function"==typeof e.addEventListener&&e.addEventListener("error",o)}))}getId(){return this.id}postMessage(e,t){var i;null===(i=this.worker)||void 0===i||i.then((i=>{try{i.postMessage(e,t)}catch(e){h(e),h(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:e}))}}))}dispose(){var e;null===(e=this.worker)||void 0===e||e.then((e=>e.terminate())),this.worker=null}}class HI{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const n=++HI.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new zI(e,n,this._label||"anonymous"+n,t,(e=>{II(e),this._webWorkerFailedBeforeError=e,i(e)}))}}HI.LAST_WORKER_ID=0;class UI{constructor(e,t,i,n){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=n}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class KI{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,n=e.length;i<n;i++)t[i]=e.charCodeAt(i);return t}}function jI(e,t,i){return new ZI(new KI(e),new KI(t)).ComputeDiff(i).changes}class qI{static Assert(e,t){if(!e)throw new Error(t)}}class $I{static Copy(e,t,i,n,o){for(let s=0;s<o;s++)i[n+s]=e[t+s]}static Copy2(e,t,i,n,o){for(let s=0;s<o;s++)i[n+s]=e[t+s]}}class GI{constructor(){this.m_changes=[],this.m_originalStart=1073741824,this.m_modifiedStart=1073741824,this.m_originalCount=0,this.m_modifiedCount=0}MarkNextChange(){(this.m_originalCount>0||this.m_modifiedCount>0)&&this.m_changes.push(new UI(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class ZI{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[n,o,s]=ZI._getElements(e),[r,a,l]=ZI._getElements(t);this._hasStrings=s&&l,this._originalStringElements=n,this._originalElementsOrHash=o,this._modifiedStringElements=r,this._modifiedElementsOrHash=a,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&"string"==typeof e[0]}static _getElements(e){const t=e.getElements();if(ZI._isStringArray(t)){const e=new Int32Array(t.length);for(let i=0,n=t.length;i<n;i++)e[i]=ts(t[i],0);return[t,e,!0]}return t instanceof Int32Array?[[],t,!1]:[[],new Int32Array(t),!1]}ElementsAreEqual(e,t){return this._originalElementsOrHash[e]===this._modifiedElementsOrHash[t]&&(!this._hasStrings||this._originalStringElements[e]===this._modifiedStringElements[t])}ElementsAreStrictEqual(e,t){return!!this.ElementsAreEqual(e,t)&&ZI._getStrictElement(this._originalSequence,e)===ZI._getStrictElement(this._modifiedSequence,t)}static _getStrictElement(e,t){return"function"==typeof e.getStrictElement?e.getStrictElement(t):null}OriginalElementsAreEqual(e,t){return this._originalElementsOrHash[e]===this._originalElementsOrHash[t]&&(!this._hasStrings||this._originalStringElements[e]===this._originalStringElements[t])}ModifiedElementsAreEqual(e,t){return this._modifiedElementsOrHash[e]===this._modifiedElementsOrHash[t]&&(!this._hasStrings||this._modifiedStringElements[e]===this._modifiedStringElements[t])}ComputeDiff(e){return this._ComputeDiff(0,this._originalElementsOrHash.length-1,0,this._modifiedElementsOrHash.length-1,e)}_ComputeDiff(e,t,i,n,o){const s=[!1];let r=this.ComputeDiffRecursive(e,t,i,n,s);return o&&(r=this.PrettifyChanges(r)),{quitEarly:s[0],changes:r}}ComputeDiffRecursive(e,t,i,n,o){for(o[0]=!1;e<=t&&i<=n&&this.ElementsAreEqual(e,i);)e++,i++;for(;t>=e&&n>=i&&this.ElementsAreEqual(t,n);)t--,n--;if(e>t||i>n){let o;return i<=n?(qI.Assert(e===t+1,"originalStart should only be one more than originalEnd"),o=[new UI(e,0,i,n-i+1)]):e<=t?(qI.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),o=[new UI(e,t-e+1,i,0)]):(qI.Assert(e===t+1,"originalStart should only be one more than originalEnd"),qI.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),o=[]),o}const s=[0],r=[0],a=this.ComputeRecursionPoint(e,t,i,n,s,r,o),l=s[0],h=r[0];if(null!==a)return a;if(!o[0]){const s=this.ComputeDiffRecursive(e,l,i,h,o);let r=[];return r=o[0]?[new UI(l+1,t-(l+1)+1,h+1,n-(h+1)+1)]:this.ComputeDiffRecursive(l+1,t,h+1,n,o),this.ConcatenateChanges(s,r)}return[new UI(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,o,s,r,a,l,h,d,c,u,g,p,m,f,_){let v=null,b=null,w=new GI,C=t,y=i,S=u[0]-m[0]-n,k=-1073741824,L=this.m_forwardHistory.length-1;do{const t=S+e;t===C||t<y&&l[t-1]<l[t+1]?(g=(d=l[t+1])-S-n,d<k&&w.MarkNextChange(),k=d,w.AddModifiedElement(d+1,g),S=t+1-e):(g=(d=l[t-1]+1)-S-n,d<k&&w.MarkNextChange(),k=d-1,w.AddOriginalElement(d,g+1),S=t-1-e),L>=0&&(e=(l=this.m_forwardHistory[L])[0],C=1,y=l.length-1)}while(--L>=-1);if(v=w.getReverseChanges(),_[0]){let e=u[0]+1,t=m[0]+1;if(null!==v&&v.length>0){const i=v[v.length-1];e=Math.max(e,i.getOriginalEnd()),t=Math.max(t,i.getModifiedEnd())}b=[new UI(e,c-e+1,t,p-t+1)]}else{w=new GI,C=s,y=r,S=u[0]-m[0]-a,k=1073741824,L=f?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const e=S+o;e===C||e<y&&h[e-1]>=h[e+1]?(g=(d=h[e+1]-1)-S-a,d>k&&w.MarkNextChange(),k=d+1,w.AddOriginalElement(d+1,g+1),S=e+1-o):(g=(d=h[e-1])-S-a,d>k&&w.MarkNextChange(),k=d,w.AddModifiedElement(d+1,g+1),S=e-1-o),L>=0&&(o=(h=this.m_reverseHistory[L])[0],C=1,y=h.length-1)}while(--L>=-1);b=w.getChanges()}return this.ConcatenateChanges(v,b)}ComputeRecursionPoint(e,t,i,n,o,s,r){let a=0,l=0,h=0,d=0,c=0,u=0;e--,i--,o[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(n-i),p=g+1,m=new Int32Array(p),f=new Int32Array(p),_=n-i,v=t-e,b=e-i,w=t-n,C=(v-_)%2==0;m[_]=e,f[v]=t,r[0]=!1;for(let y=1;y<=g/2+1;y++){let g=0,S=0;h=this.ClipDiagonalBound(_-y,y,_,p),d=this.ClipDiagonalBound(_+y,y,_,p);for(let e=h;e<=d;e+=2){a=e===h||e<d&&m[e-1]<m[e+1]?m[e+1]:m[e-1]+1,l=a-(e-_)-b;const i=a;for(;a<t&&l<n&&this.ElementsAreEqual(a+1,l+1);)a++,l++;if(m[e]=a,a+l>g+S&&(g=a,S=l),!C&&Math.abs(e-v)<=y-1&&a>=f[e])return o[0]=a,s[0]=l,i<=f[e]&&y<=1448?this.WALKTRACE(_,h,d,b,v,c,u,w,m,f,a,t,o,l,n,s,C,r):null}const k=(g-e+(S-i)-y)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(g,k))return r[0]=!0,o[0]=g,s[0]=S,k>0&&y<=1448?this.WALKTRACE(_,h,d,b,v,c,u,w,m,f,a,t,o,l,n,s,C,r):(e++,i++,[new UI(e,t-e+1,i,n-i+1)]);c=this.ClipDiagonalBound(v-y,y,v,p),u=this.ClipDiagonalBound(v+y,y,v,p);for(let g=c;g<=u;g+=2){a=g===c||g<u&&f[g-1]>=f[g+1]?f[g+1]-1:f[g-1],l=a-(g-v)-w;const p=a;for(;a>e&&l>i&&this.ElementsAreEqual(a,l);)a--,l--;if(f[g]=a,C&&Math.abs(g-_)<=y&&a<=m[g])return o[0]=a,s[0]=l,p>=m[g]&&y<=1448?this.WALKTRACE(_,h,d,b,v,c,u,w,m,f,a,t,o,l,n,s,C,r):null}if(y<=1447){let e=new Int32Array(d-h+2);e[0]=_-h+1,$I.Copy2(m,h,e,1,d-h+1),this.m_forwardHistory.push(e),e=new Int32Array(u-c+2),e[0]=v-c+1,$I.Copy2(f,c,e,1,u-c+1),this.m_reverseHistory.push(e)}}return this.WALKTRACE(_,h,d,b,v,c,u,w,m,f,a,t,o,l,n,s,C,r)}PrettifyChanges(e){for(let t=0;t<e.length;t++){const i=e[t],n=t<e.length-1?e[t+1].originalStart:this._originalElementsOrHash.length,o=t<e.length-1?e[t+1].modifiedStart:this._modifiedElementsOrHash.length,s=i.originalLength>0,r=i.modifiedLength>0;for(;i.originalStart+i.originalLength<n&&i.modifiedStart+i.modifiedLength<o&&(!s||this.OriginalElementsAreEqual(i.originalStart,i.originalStart+i.originalLength))&&(!r||this.ModifiedElementsAreEqual(i.modifiedStart,i.modifiedStart+i.modifiedLength));){const e=this.ElementsAreStrictEqual(i.originalStart,i.modifiedStart);if(this.ElementsAreStrictEqual(i.originalStart+i.originalLength,i.modifiedStart+i.modifiedLength)&&!e)break;i.originalStart++,i.modifiedStart++}const a=[null];t<e.length-1&&this.ChangesOverlap(e[t],e[t+1],a)&&(e[t]=a[0],e.splice(t+1,1),t--)}for(let t=e.length-1;t>=0;t--){const i=e[t];let n=0,o=0;if(t>0){const i=e[t-1];n=i.originalStart+i.originalLength,o=i.modifiedStart+i.modifiedLength}const s=i.originalLength>0,r=i.modifiedLength>0;let a=0,l=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let e=1;;e++){const t=i.originalStart-e,h=i.modifiedStart-e;if(t<n||h<o)break;if(s&&!this.OriginalElementsAreEqual(t,t+i.originalLength))break;if(r&&!this.ModifiedElementsAreEqual(h,h+i.modifiedLength))break;const d=(t===n&&h===o?5:0)+this._boundaryScore(t,i.originalLength,h,i.modifiedLength);d>l&&(l=d,a=e)}i.originalStart-=a,i.modifiedStart-=a;const h=[null];t>0&&this.ChangesOverlap(e[t-1],e[t],h)&&(e[t-1]=h[0],e.splice(t,1),t++)}if(this._hasStrings)for(let t=1,i=e.length;t<i;t++){const i=e[t-1],n=e[t],o=n.originalStart-i.originalStart-i.originalLength,s=i.originalStart,r=n.originalStart+n.originalLength,a=r-s,l=i.modifiedStart,h=n.modifiedStart+n.modifiedLength,d=h-l;if(o<5&&a<20&&d<20){const e=this._findBetterContiguousSequence(s,a,l,d,o);if(e){const[t,s]=e;t===i.originalStart+i.originalLength&&s===i.modifiedStart+i.modifiedLength||(i.originalLength=t-i.originalStart,i.modifiedLength=s-i.modifiedStart,n.originalStart=t+o,n.modifiedStart=s+o,n.originalLength=r-n.originalStart,n.modifiedLength=h-n.modifiedStart)}}}return e}_findBetterContiguousSequence(e,t,i,n,o){if(t<o||n<o)return null;const s=e+t-o+1,r=i+n-o+1;let a=0,l=0,h=0;for(let t=e;t<s;t++)for(let e=i;e<r;e++){const i=this._contiguousSequenceScore(t,e,o);i>0&&i>a&&(a=i,l=t,h=e)}return a>0?[l,h]:null}_contiguousSequenceScore(e,t,i){let n=0;for(let o=0;o<i;o++){if(!this.ElementsAreEqual(e+o,t+o))return 0;n+=this._originalStringElements[e+o].length}return n}_OriginalIsBoundary(e){return e<=0||e>=this._originalElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,n){return(this._OriginalRegionIsBoundary(e,t)?1:0)+(this._ModifiedRegionIsBoundary(i,n)?1:0)}ConcatenateChanges(e,t){const i=[];if(0===e.length||0===t.length)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const n=new Array(e.length+t.length-1);return $I.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],$I.Copy(t,1,n,e.length,t.length-1),n}{const i=new Array(e.length+t.length);return $I.Copy(e,0,i,0,e.length),$I.Copy(t,0,i,e.length,t.length),i}}ChangesOverlap(e,t,i){if(qI.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),qI.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const n=e.originalStart;let o=e.originalLength;const s=e.modifiedStart;let r=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(r=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new UI(n,o,s,r),!0}return i[0]=null,!1}ClipDiagonalBound(e,t,i,n){if(e>=0&&e<n)return e;const o=t%2==0;return e<0?o===(i%2==0)?0:1:o===((n-i-1)%2==0)?n-1:n-2}}class YI{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=Ww(e);const i=this.values,n=this.prefixSum,o=t.length;return 0!==o&&(this.values=new Uint32Array(i.length+o),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+o),this.values.set(t,e),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSum=new Uint32Array(this.values.length),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=Ww(e),t=Ww(t),this.values[e]!==t&&(this.values[e]=t,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,t){e=Ww(e),t=Ww(t);const i=this.values,n=this.prefixSum;if(e>=i.length)return!1;const o=i.length-e;return t>=o&&(t=o),0!==t&&(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return 0===this.values.length?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=Ww(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;0===t&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,n=0,o=0,s=0;for(;t<=i;)if(n=t+(i-t)/2|0,o=this.prefixSum[n],s=o-this.values[n],e<s)i=n-1;else{if(!(e>=o))break;t=n+1}return new XI(n,e-s)}}class QI{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),0===e?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new XI(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=Uc(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e<t;e++){const t=this._values[e],i=e>0?this._prefixSum[e-1]:0;this._prefixSum[e]=i+t;for(let n=0;n<t;n++)this._indexBySum[i+n]=e}this._prefixSum.length=this._values.length,this._indexBySum.length=this._prefixSum[this._prefixSum.length-1],this._isValid=!0,this._validEndIndex=this._values.length-1}}setValue(e,t){this._values[e]!==t&&(this._values[e]=t,this._invalidate(e))}}class XI{constructor(e,t){this.index=e,this.remainder=t,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=t}}class JI{constructor(e,t,i,n){this._uri=e,this._lines=t,this._eol=i,this._versionId=n,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}get version(){return this._versionId}getText(){return null===this._cachedTextValue&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(e){e.eol&&e.eol!==this._eol&&(this._eol=e.eol,this._lineStarts=null);const t=e.changes;for(const e of t)this._acceptDeleteRange(e.range),this._acceptInsertText(new ch(e.range.startLineNumber,e.range.startColumn),e.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){const e=this._eol.length,t=this._lines.length,i=new Uint32Array(t);for(let n=0;n<t;n++)i[n]=this._lines[n].length+e;this._lineStarts=new YI(i)}}_setLineText(e,t){this._lines[e]=t,this._lineStarts&&this._lineStarts.setValue(e,this._lines[e].length+this._eol.length)}_acceptDeleteRange(e){if(e.startLineNumber!==e.endLineNumber)this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.endLineNumber-1].substring(e.endColumn-1)),this._lines.splice(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineStarts&&this._lineStarts.removeValues(e.startLineNumber,e.endLineNumber-e.startLineNumber);else{if(e.startColumn===e.endColumn)return;this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.startLineNumber-1].substring(e.endColumn-1))}}_acceptInsertText(e,t){if(0===t.length)return;const i=mn(t);if(1===i.length)return void this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+i[0]+this._lines[e.lineNumber-1].substring(e.column-1));i[i.length-1]+=this._lines[e.lineNumber-1].substring(e.column-1),this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+i[0]);const n=new Uint32Array(i.length-1);for(let t=1;t<i.length;t++)this._lines.splice(e.lineNumber+t-1,0,i[t]),n[t-1]=i[t].length+this._eol.length;this._lineStarts&&this._lineStarts.insertValues(e.lineNumber,n)}}class eM{constructor(e,t,i){const n=new Uint8Array(e*t);for(let o=0,s=e*t;o<s;o++)n[o]=i;this._data=n,this.rows=e,this.cols=t}get(e,t){return this._data[e*this.cols+t]}set(e,t,i){this._data[e*this.cols+t]=i}}class tM{constructor(e){let t=0,i=0;for(let n=0,o=e.length;n<o;n++){const[o,s,r]=e[n];s>t&&(t=s),o>i&&(i=o),r>i&&(i=r)}t++,i++;const n=new eM(i,t,0);for(let t=0,i=e.length;t<i;t++){const[i,o,s]=e[t];n.set(i,o,s)}this._states=n,this._maxCharCode=t}nextState(e,t){return t<0||t>=this._maxCharCode?0:this._states.get(e,t)}}let iM=null,nM=null;class oM{static _createLink(e,t,i,n,o){let s=o-1;do{const i=t.charCodeAt(s);if(2!==e.get(i))break;s--}while(s>n);if(n>0){const e=t.charCodeAt(n-1),i=t.charCodeAt(s);(40===e&&41===i||91===e&&93===i||123===e&&125===i)&&s--}return{range:{startLineNumber:i,startColumn:n+1,endLineNumber:i,endColumn:s+2},url:t.substring(n,s+1)}}static computeLinks(e,t=function(){return null===iM&&(iM=new tM([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),iM}()){const i=function(){if(null===nM){nM=new Vw(0);const e=" \t<>'\"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…";for(let t=0;t<e.length;t++)nM.set(e.charCodeAt(t),1);const t=".,;:";for(let e=0;e<t.length;e++)nM.set(t.charCodeAt(e),2)}return nM}(),n=[];for(let o=1,s=e.getLineCount();o<=s;o++){const s=e.getLineContent(o),r=s.length;let a=0,l=0,h=0,d=1,c=!1,u=!1,g=!1,p=!1;for(;a<r;){let e=!1;const r=s.charCodeAt(a);if(13===d){let t;switch(r){case 40:c=!0,t=0;break;case 41:t=c?0:1;break;case 91:g=!0,u=!0,t=0;break;case 93:g=!1,t=u?0:1;break;case 123:p=!0,t=0;break;case 125:t=p?0:1;break;case 39:case 34:case 96:t=h===r?1:39===h||34===h||96===h?0:1;break;case 42:t=42===h?1:0;break;case 124:t=124===h?1:0;break;case 32:t=g?0:1;break;default:t=i.get(r)}1===t&&(n.push(oM._createLink(i,s,o,l,a)),e=!0)}else if(12===d){let t;91===r?(u=!0,t=0):t=i.get(r),1===t?e=!0:d=13}else d=t.nextState(d,r),0===d&&(e=!0);e&&(d=1,c=!1,u=!1,p=!1,l=a+1,h=r),a++}13===d&&n.push(oM._createLink(i,s,o,l,r))}return n}}class sM{constructor(){this._defaultValueSet=[["true","false"],["True","False"],["Private","Public","Friend","ReadOnly","Partial","Protected","WriteOnly"],["public","protected","private"]]}navigateValueSet(e,t,i,n,o){if(e&&t){const i=this.doNavigateValueSet(t,o);if(i)return{range:e,value:i}}if(i&&n){const e=this.doNavigateValueSet(n,o);if(e)return{range:i,value:e}}return null}doNavigateValueSet(e,t){const i=this.numberReplace(e,t);return null!==i?i:this.textReplace(e,t)}numberReplace(e,t){const i=Math.pow(10,e.length-(e.lastIndexOf(".")+1));let n=Number(e);const o=parseFloat(e);return isNaN(n)||isNaN(o)||n!==o?null:0!==n||t?(n=Math.floor(n*i),n+=t?i:-i,String(n/i)):null}textReplace(e,t){return this.valueSetsReplace(this._defaultValueSet,e,t)}valueSetsReplace(e,t,i){let n=null;for(let o=0,s=e.length;null===n&&o<s;o++)n=this.valueSetReplace(e[o],t,i);return n}valueSetReplace(e,t,i){let n=e.indexOf(t);return n>=0?(n+=i?1:-1,n<0?n=e.length-1:n%=e.length,e[n]):null}}var rM,aM,lM,hM,dM,cM,uM,gM,pM,mM,fM,_M,vM,bM,wM,CM,yM,SM,kM,LM,xM,DM,EM,NM,IM,MM,TM,AM,RM,OM,PM,FM,BM,WM,VM,zM,HM,UM,KM,jM;sM.INSTANCE=new sM,function(e){e[e.Unknown=0]="Unknown",e[e.Disabled=1]="Disabled",e[e.Enabled=2]="Enabled"}(rM||(rM={})),function(e){e[e.Invoke=1]="Invoke",e[e.Auto=2]="Auto"}(aM||(aM={})),function(e){e[e.None=0]="None",e[e.KeepWhitespace=1]="KeepWhitespace",e[e.InsertAsSnippet=4]="InsertAsSnippet"}(lM||(lM={})),function(e){e[e.Method=0]="Method",e[e.Function=1]="Function",e[e.Constructor=2]="Constructor",e[e.Field=3]="Field",e[e.Variable=4]="Variable",e[e.Class=5]="Class",e[e.Struct=6]="Struct",e[e.Interface=7]="Interface",e[e.Module=8]="Module",e[e.Property=9]="Property",e[e.Event=10]="Event",e[e.Operator=11]="Operator",e[e.Unit=12]="Unit",e[e.Value=13]="Value",e[e.Constant=14]="Constant",e[e.Enum=15]="Enum",e[e.EnumMember=16]="EnumMember",e[e.Keyword=17]="Keyword",e[e.Text=18]="Text",e[e.Color=19]="Color",e[e.File=20]="File",e[e.Reference=21]="Reference",e[e.Customcolor=22]="Customcolor",e[e.Folder=23]="Folder",e[e.TypeParameter=24]="TypeParameter",e[e.User=25]="User",e[e.Issue=26]="Issue",e[e.Snippet=27]="Snippet"}(hM||(hM={})),function(e){e[e.Deprecated=1]="Deprecated"}(dM||(dM={})),function(e){e[e.Invoke=0]="Invoke",e[e.TriggerCharacter=1]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"}(cM||(cM={})),function(e){e[e.EXACT=0]="EXACT",e[e.ABOVE=1]="ABOVE",e[e.BELOW=2]="BELOW"}(uM||(uM={})),function(e){e[e.NotSet=0]="NotSet",e[e.ContentFlush=1]="ContentFlush",e[e.RecoverFromMarkers=2]="RecoverFromMarkers",e[e.Explicit=3]="Explicit",e[e.Paste=4]="Paste",e[e.Undo=5]="Undo",e[e.Redo=6]="Redo"}(gM||(gM={})),function(e){e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(pM||(pM={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(mM||(mM={})),function(e){e[e.None=0]="None",e[e.Keep=1]="Keep",e[e.Brackets=2]="Brackets",e[e.Advanced=3]="Advanced",e[e.Full=4]="Full"}(fM||(fM={})),function(e){e[e.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",e[e.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",e[e.accessibilitySupport=2]="accessibilitySupport",e[e.accessibilityPageSize=3]="accessibilityPageSize",e[e.ariaLabel=4]="ariaLabel",e[e.ariaRequired=5]="ariaRequired",e[e.autoClosingBrackets=6]="autoClosingBrackets",e[e.autoClosingComments=7]="autoClosingComments",e[e.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",e[e.autoClosingDelete=9]="autoClosingDelete",e[e.autoClosingOvertype=10]="autoClosingOvertype",e[e.autoClosingQuotes=11]="autoClosingQuotes",e[e.autoIndent=12]="autoIndent",e[e.automaticLayout=13]="automaticLayout",e[e.autoSurround=14]="autoSurround",e[e.bracketPairColorization=15]="bracketPairColorization",e[e.guides=16]="guides",e[e.codeLens=17]="codeLens",e[e.codeLensFontFamily=18]="codeLensFontFamily",e[e.codeLensFontSize=19]="codeLensFontSize",e[e.colorDecorators=20]="colorDecorators",e[e.colorDecoratorsLimit=21]="colorDecoratorsLimit",e[e.columnSelection=22]="columnSelection",e[e.comments=23]="comments",e[e.contextmenu=24]="contextmenu",e[e.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",e[e.cursorBlinking=26]="cursorBlinking",e[e.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",e[e.cursorStyle=28]="cursorStyle",e[e.cursorSurroundingLines=29]="cursorSurroundingLines",e[e.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",e[e.cursorWidth=31]="cursorWidth",e[e.disableLayerHinting=32]="disableLayerHinting",e[e.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",e[e.domReadOnly=34]="domReadOnly",e[e.dragAndDrop=35]="dragAndDrop",e[e.dropIntoEditor=36]="dropIntoEditor",e[e.emptySelectionClipboard=37]="emptySelectionClipboard",e[e.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",e[e.extraEditorClassName=39]="extraEditorClassName",e[e.fastScrollSensitivity=40]="fastScrollSensitivity",e[e.find=41]="find",e[e.fixedOverflowWidgets=42]="fixedOverflowWidgets",e[e.folding=43]="folding",e[e.foldingStrategy=44]="foldingStrategy",e[e.foldingHighlight=45]="foldingHighlight",e[e.foldingImportsByDefault=46]="foldingImportsByDefault",e[e.foldingMaximumRegions=47]="foldingMaximumRegions",e[e.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",e[e.fontFamily=49]="fontFamily",e[e.fontInfo=50]="fontInfo",e[e.fontLigatures=51]="fontLigatures",e[e.fontSize=52]="fontSize",e[e.fontWeight=53]="fontWeight",e[e.fontVariations=54]="fontVariations",e[e.formatOnPaste=55]="formatOnPaste",e[e.formatOnType=56]="formatOnType",e[e.glyphMargin=57]="glyphMargin",e[e.gotoLocation=58]="gotoLocation",e[e.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",e[e.hover=60]="hover",e[e.inDiffEditor=61]="inDiffEditor",e[e.inlineSuggest=62]="inlineSuggest",e[e.letterSpacing=63]="letterSpacing",e[e.lightbulb=64]="lightbulb",e[e.lineDecorationsWidth=65]="lineDecorationsWidth",e[e.lineHeight=66]="lineHeight",e[e.lineNumbers=67]="lineNumbers",e[e.lineNumbersMinChars=68]="lineNumbersMinChars",e[e.linkedEditing=69]="linkedEditing",e[e.links=70]="links",e[e.matchBrackets=71]="matchBrackets",e[e.minimap=72]="minimap",e[e.mouseStyle=73]="mouseStyle",e[e.mouseWheelScrollSensitivity=74]="mouseWheelScrollSensitivity",e[e.mouseWheelZoom=75]="mouseWheelZoom",e[e.multiCursorMergeOverlapping=76]="multiCursorMergeOverlapping",e[e.multiCursorModifier=77]="multiCursorModifier",e[e.multiCursorPaste=78]="multiCursorPaste",e[e.multiCursorLimit=79]="multiCursorLimit",e[e.occurrencesHighlight=80]="occurrencesHighlight",e[e.overviewRulerBorder=81]="overviewRulerBorder",e[e.overviewRulerLanes=82]="overviewRulerLanes",e[e.padding=83]="padding",e[e.pasteAs=84]="pasteAs",e[e.parameterHints=85]="parameterHints",e[e.peekWidgetDefaultFocus=86]="peekWidgetDefaultFocus",e[e.definitionLinkOpensInPeek=87]="definitionLinkOpensInPeek",e[e.quickSuggestions=88]="quickSuggestions",e[e.quickSuggestionsDelay=89]="quickSuggestionsDelay",e[e.readOnly=90]="readOnly",e[e.readOnlyMessage=91]="readOnlyMessage",e[e.renameOnType=92]="renameOnType",e[e.renderControlCharacters=93]="renderControlCharacters",e[e.renderFinalNewline=94]="renderFinalNewline",e[e.renderLineHighlight=95]="renderLineHighlight",e[e.renderLineHighlightOnlyWhenFocus=96]="renderLineHighlightOnlyWhenFocus",e[e.renderValidationDecorations=97]="renderValidationDecorations",e[e.renderWhitespace=98]="renderWhitespace",e[e.revealHorizontalRightPadding=99]="revealHorizontalRightPadding",e[e.roundedSelection=100]="roundedSelection",e[e.rulers=101]="rulers",e[e.scrollbar=102]="scrollbar",e[e.scrollBeyondLastColumn=103]="scrollBeyondLastColumn",e[e.scrollBeyondLastLine=104]="scrollBeyondLastLine",e[e.scrollPredominantAxis=105]="scrollPredominantAxis",e[e.selectionClipboard=106]="selectionClipboard",e[e.selectionHighlight=107]="selectionHighlight",e[e.selectOnLineNumbers=108]="selectOnLineNumbers",e[e.showFoldingControls=109]="showFoldingControls",e[e.showUnused=110]="showUnused",e[e.snippetSuggestions=111]="snippetSuggestions",e[e.smartSelect=112]="smartSelect",e[e.smoothScrolling=113]="smoothScrolling",e[e.stickyScroll=114]="stickyScroll",e[e.stickyTabStops=115]="stickyTabStops",e[e.stopRenderingLineAfter=116]="stopRenderingLineAfter",e[e.suggest=117]="suggest",e[e.suggestFontSize=118]="suggestFontSize",e[e.suggestLineHeight=119]="suggestLineHeight",e[e.suggestOnTriggerCharacters=120]="suggestOnTriggerCharacters",e[e.suggestSelection=121]="suggestSelection",e[e.tabCompletion=122]="tabCompletion",e[e.tabIndex=123]="tabIndex",e[e.unicodeHighlighting=124]="unicodeHighlighting",e[e.unusualLineTerminators=125]="unusualLineTerminators",e[e.useShadowDOM=126]="useShadowDOM",e[e.useTabStops=127]="useTabStops",e[e.wordBreak=128]="wordBreak",e[e.wordSeparators=129]="wordSeparators",e[e.wordWrap=130]="wordWrap",e[e.wordWrapBreakAfterCharacters=131]="wordWrapBreakAfterCharacters",e[e.wordWrapBreakBeforeCharacters=132]="wordWrapBreakBeforeCharacters",e[e.wordWrapColumn=133]="wordWrapColumn",e[e.wordWrapOverride1=134]="wordWrapOverride1",e[e.wordWrapOverride2=135]="wordWrapOverride2",e[e.wrappingIndent=136]="wrappingIndent",e[e.wrappingStrategy=137]="wrappingStrategy",e[e.showDeprecated=138]="showDeprecated",e[e.inlayHints=139]="inlayHints",e[e.editorClassName=140]="editorClassName",e[e.pixelRatio=141]="pixelRatio",e[e.tabFocusMode=142]="tabFocusMode",e[e.layoutInfo=143]="layoutInfo",e[e.wrappingInfo=144]="wrappingInfo",e[e.defaultColorDecorators=145]="defaultColorDecorators",e[e.colorDecoratorsActivatedOn=146]="colorDecoratorsActivatedOn",e[e.inlineCompletionsAccessibilityVerbose=147]="inlineCompletionsAccessibilityVerbose"}(_M||(_M={})),function(e){e[e.TextDefined=0]="TextDefined",e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(vM||(vM={})),function(e){e[e.LF=0]="LF",e[e.CRLF=1]="CRLF"}(bM||(bM={})),function(e){e[e.Left=1]="Left",e[e.Right=2]="Right"}(wM||(wM={})),function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(CM||(CM={})),function(e){e[e.Both=0]="Both",e[e.Right=1]="Right",e[e.Left=2]="Left",e[e.None=3]="None"}(yM||(yM={})),function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"}(SM||(SM={})),function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"}(kM||(kM={})),function(e){e[e.DependsOnKbLayout=-1]="DependsOnKbLayout",e[e.Unknown=0]="Unknown",e[e.Backspace=1]="Backspace",e[e.Tab=2]="Tab",e[e.Enter=3]="Enter",e[e.Shift=4]="Shift",e[e.Ctrl=5]="Ctrl",e[e.Alt=6]="Alt",e[e.PauseBreak=7]="PauseBreak",e[e.CapsLock=8]="CapsLock",e[e.Escape=9]="Escape",e[e.Space=10]="Space",e[e.PageUp=11]="PageUp",e[e.PageDown=12]="PageDown",e[e.End=13]="End",e[e.Home=14]="Home",e[e.LeftArrow=15]="LeftArrow",e[e.UpArrow=16]="UpArrow",e[e.RightArrow=17]="RightArrow",e[e.DownArrow=18]="DownArrow",e[e.Insert=19]="Insert",e[e.Delete=20]="Delete",e[e.Digit0=21]="Digit0",e[e.Digit1=22]="Digit1",e[e.Digit2=23]="Digit2",e[e.Digit3=24]="Digit3",e[e.Digit4=25]="Digit4",e[e.Digit5=26]="Digit5",e[e.Digit6=27]="Digit6",e[e.Digit7=28]="Digit7",e[e.Digit8=29]="Digit8",e[e.Digit9=30]="Digit9",e[e.KeyA=31]="KeyA",e[e.KeyB=32]="KeyB",e[e.KeyC=33]="KeyC",e[e.KeyD=34]="KeyD",e[e.KeyE=35]="KeyE",e[e.KeyF=36]="KeyF",e[e.KeyG=37]="KeyG",e[e.KeyH=38]="KeyH",e[e.KeyI=39]="KeyI",e[e.KeyJ=40]="KeyJ",e[e.KeyK=41]="KeyK",e[e.KeyL=42]="KeyL",e[e.KeyM=43]="KeyM",e[e.KeyN=44]="KeyN",e[e.KeyO=45]="KeyO",e[e.KeyP=46]="KeyP",e[e.KeyQ=47]="KeyQ",e[e.KeyR=48]="KeyR",e[e.KeyS=49]="KeyS",e[e.KeyT=50]="KeyT",e[e.KeyU=51]="KeyU",e[e.KeyV=52]="KeyV",e[e.KeyW=53]="KeyW",e[e.KeyX=54]="KeyX",e[e.KeyY=55]="KeyY",e[e.KeyZ=56]="KeyZ",e[e.Meta=57]="Meta",e[e.ContextMenu=58]="ContextMenu",e[e.F1=59]="F1",e[e.F2=60]="F2",e[e.F3=61]="F3",e[e.F4=62]="F4",e[e.F5=63]="F5",e[e.F6=64]="F6",e[e.F7=65]="F7",e[e.F8=66]="F8",e[e.F9=67]="F9",e[e.F10=68]="F10",e[e.F11=69]="F11",e[e.F12=70]="F12",e[e.F13=71]="F13",e[e.F14=72]="F14",e[e.F15=73]="F15",e[e.F16=74]="F16",e[e.F17=75]="F17",e[e.F18=76]="F18",e[e.F19=77]="F19",e[e.F20=78]="F20",e[e.F21=79]="F21",e[e.F22=80]="F22",e[e.F23=81]="F23",e[e.F24=82]="F24",e[e.NumLock=83]="NumLock",e[e.ScrollLock=84]="ScrollLock",e[e.Semicolon=85]="Semicolon",e[e.Equal=86]="Equal",e[e.Comma=87]="Comma",e[e.Minus=88]="Minus",e[e.Period=89]="Period",e[e.Slash=90]="Slash",e[e.Backquote=91]="Backquote",e[e.BracketLeft=92]="BracketLeft",e[e.Backslash=93]="Backslash",e[e.BracketRight=94]="BracketRight",e[e.Quote=95]="Quote",e[e.OEM_8=96]="OEM_8",e[e.IntlBackslash=97]="IntlBackslash",e[e.Numpad0=98]="Numpad0",e[e.Numpad1=99]="Numpad1",e[e.Numpad2=100]="Numpad2",e[e.Numpad3=101]="Numpad3",e[e.Numpad4=102]="Numpad4",e[e.Numpad5=103]="Numpad5",e[e.Numpad6=104]="Numpad6",e[e.Numpad7=105]="Numpad7",e[e.Numpad8=106]="Numpad8",e[e.Numpad9=107]="Numpad9",e[e.NumpadMultiply=108]="NumpadMultiply",e[e.NumpadAdd=109]="NumpadAdd",e[e.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",e[e.NumpadSubtract=111]="NumpadSubtract",e[e.NumpadDecimal=112]="NumpadDecimal",e[e.NumpadDivide=113]="NumpadDivide",e[e.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",e[e.ABNT_C1=115]="ABNT_C1",e[e.ABNT_C2=116]="ABNT_C2",e[e.AudioVolumeMute=117]="AudioVolumeMute",e[e.AudioVolumeUp=118]="AudioVolumeUp",e[e.AudioVolumeDown=119]="AudioVolumeDown",e[e.BrowserSearch=120]="BrowserSearch",e[e.BrowserHome=121]="BrowserHome",e[e.BrowserBack=122]="BrowserBack",e[e.BrowserForward=123]="BrowserForward",e[e.MediaTrackNext=124]="MediaTrackNext",e[e.MediaTrackPrevious=125]="MediaTrackPrevious",e[e.MediaStop=126]="MediaStop",e[e.MediaPlayPause=127]="MediaPlayPause",e[e.LaunchMediaPlayer=128]="LaunchMediaPlayer",e[e.LaunchMail=129]="LaunchMail",e[e.LaunchApp2=130]="LaunchApp2",e[e.Clear=131]="Clear",e[e.MAX_VALUE=132]="MAX_VALUE"}(LM||(LM={})),function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"}(xM||(xM={})),function(e){e[e.Unnecessary=1]="Unnecessary",e[e.Deprecated=2]="Deprecated"}(DM||(DM={})),function(e){e[e.Inline=1]="Inline",e[e.Gutter=2]="Gutter"}(EM||(EM={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.TEXTAREA=1]="TEXTAREA",e[e.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",e[e.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",e[e.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",e[e.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",e[e.CONTENT_TEXT=6]="CONTENT_TEXT",e[e.CONTENT_EMPTY=7]="CONTENT_EMPTY",e[e.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",e[e.CONTENT_WIDGET=9]="CONTENT_WIDGET",e[e.OVERVIEW_RULER=10]="OVERVIEW_RULER",e[e.SCROLLBAR=11]="SCROLLBAR",e[e.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",e[e.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"}(NM||(NM={})),function(e){e[e.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",e[e.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",e[e.TOP_CENTER=2]="TOP_CENTER"}(IM||(IM={})),function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"}(MM||(MM={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.None=2]="None",e[e.LeftOfInjectedText=3]="LeftOfInjectedText",e[e.RightOfInjectedText=4]="RightOfInjectedText"}(TM||(TM={})),function(e){e[e.Off=0]="Off",e[e.On=1]="On",e[e.Relative=2]="Relative",e[e.Interval=3]="Interval",e[e.Custom=4]="Custom"}(AM||(AM={})),function(e){e[e.None=0]="None",e[e.Text=1]="Text",e[e.Blocks=2]="Blocks"}(RM||(RM={})),function(e){e[e.Smooth=0]="Smooth",e[e.Immediate=1]="Immediate"}(OM||(OM={})),function(e){e[e.Auto=1]="Auto",e[e.Hidden=2]="Hidden",e[e.Visible=3]="Visible"}(PM||(PM={})),function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"}(FM||(FM={})),function(e){e.Off="off",e.OnCode="onCode",e.On="on"}(BM||(BM={})),function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(WM||(WM={})),function(e){e[e.File=0]="File",e[e.Module=1]="Module",e[e.Namespace=2]="Namespace",e[e.Package=3]="Package",e[e.Class=4]="Class",e[e.Method=5]="Method",e[e.Property=6]="Property",e[e.Field=7]="Field",e[e.Constructor=8]="Constructor",e[e.Enum=9]="Enum",e[e.Interface=10]="Interface",e[e.Function=11]="Function",e[e.Variable=12]="Variable",e[e.Constant=13]="Constant",e[e.String=14]="String",e[e.Number=15]="Number",e[e.Boolean=16]="Boolean",e[e.Array=17]="Array",e[e.Object=18]="Object",e[e.Key=19]="Key",e[e.Null=20]="Null",e[e.EnumMember=21]="EnumMember",e[e.Struct=22]="Struct",e[e.Event=23]="Event",e[e.Operator=24]="Operator",e[e.TypeParameter=25]="TypeParameter"}(VM||(VM={})),function(e){e[e.Deprecated=1]="Deprecated"}(zM||(zM={})),function(e){e[e.Hidden=0]="Hidden",e[e.Blink=1]="Blink",e[e.Smooth=2]="Smooth",e[e.Phase=3]="Phase",e[e.Expand=4]="Expand",e[e.Solid=5]="Solid"}(HM||(HM={})),function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"}(UM||(UM={})),function(e){e[e.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",e[e.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",e[e.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",e[e.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"}(KM||(KM={})),function(e){e[e.None=0]="None",e[e.Same=1]="Same",e[e.Indent=2]="Indent",e[e.DeepIndent=3]="DeepIndent"}(jM||(jM={}));class qM{static chord(e,t){return vt(e,t)}}function $M(){return{editor:void 0,languages:void 0,CancellationTokenSource:Pt,Emitter:q,KeyCode:LM,KeyMod:qM,Position:ch,Range:tc,Selection:ic,SelectionDirection:FM,MarkerSeverity:xM,MarkerTag:DM,Uri:Ro,Token:hC}}qM.CtrlCmd=2048,qM.Shift=1024,qM.Alt=512,qM.WinCtrl=256;class GM{static computeUnicodeHighlights(e,t,i){const n=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),s=new ZM(t),r=s.getCandidateCodePoints();let a;a="allNonBasicAscii"===r?new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):new RegExp(`[${dn(Array.from(r).map((e=>String.fromCodePoint(e))).join(""))}]`,"g");const l=new Zw(null,a),h=[];let d,c=!1,u=0,g=0,p=0;e:for(let t=n,i=o;t<=i;t++){const i=e.getLineContent(t),n=i.length;l.reset(0);do{if(d=l.next(i),d){let e=d.index,o=d.index+d[0].length;e>0&&In(i.charCodeAt(e-1))&&e--,o+1<n&&In(i.charCodeAt(o-1))&&o++;const r=i.substring(e,o);let a=Du(e+1,ku,i,0);a&&a.endColumn<=e+1&&(a=null);const l=s.shouldHighlightNonBasicASCII(r,a?a.word:null);if(0!==l){3===l?u++:2===l?g++:1===l?p++:ud();const i=1e3;if(h.length>=i){c=!0;break e}h.push(new tc(t,e+1,t,o+1))}}}while(d)}return{ranges:h,hasMore:c,ambiguousCharacterCount:u,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const i=new ZM(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const n=e.codePointAt(0),o=i.ambiguousCharacters.getPrimaryConfusable(n),s=Xn.getLocales().filter((e=>!Xn.getInstance(new Set([...t.allowedLocales,e])).isAmbiguous(n)));return{kind:0,confusableWith:String.fromCodePoint(o),notAmbiguousInLocales:s}}case 1:return{kind:2}}}}class ZM{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=Xn.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of Jn.codePoints)YM(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return 0;if(this.options.nonBasicASCII)return 1;let n=!1,o=!1;if(t)for(const e of t){const t=e.codePointAt(0),i=zn(e);n=n||i,i||this.ambiguousCharacters.isAmbiguous(t)||Jn.isInvisibleCharacter(t)||(o=!0)}return!n&&o?0:this.options.invisibleCharacters&&!YM(e)&&Jn.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function YM(e){return" "===e||"\n"===e||"\t"===e}class QM{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class XM{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class JM{static inverse(e,t,i){const n=[];let o=1,s=1;for(const t of e){const e=new eT(new bu(o,t.original.startLineNumber),new bu(s,t.modified.startLineNumber),void 0);e.modified.isEmpty||n.push(e),o=t.original.endLineNumberExclusive,s=t.modified.endLineNumberExclusive}const r=new eT(new bu(o,t+1),new bu(s,i+1),void 0);return r.modified.isEmpty||n.push(r),n}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new JM(this.modified,this.original)}join(e){return new JM(this.original.join(e.original),this.modified.join(e.modified))}}class eT extends JM{constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){var e;return new eT(this.modified,this.original,null===(e=this.innerChanges)||void 0===e?void 0:e.map((e=>e.flip())))}}class tT{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new tT(this.modifiedRange,this.originalRange)}}class iT{computeDiff(e,t,i){var n;const o=new lT(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),s=[];let r=null;for(const e of o.changes){let t,i;t=0===e.originalEndLineNumber?new bu(e.originalStartLineNumber+1,e.originalStartLineNumber+1):new bu(e.originalStartLineNumber,e.originalEndLineNumber+1),i=0===e.modifiedEndLineNumber?new bu(e.modifiedStartLineNumber+1,e.modifiedStartLineNumber+1):new bu(e.modifiedStartLineNumber,e.modifiedEndLineNumber+1);let o=new eT(t,i,null===(n=e.charChanges)||void 0===n?void 0:n.map((e=>new tT(new tc(e.originalStartLineNumber,e.originalStartColumn,e.originalEndLineNumber,e.originalEndColumn),new tc(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn)))));r&&(r.modified.endLineNumberExclusive!==o.modified.startLineNumber&&r.original.endLineNumberExclusive!==o.original.startLineNumber||(o=new eT(r.original.join(o.original),r.modified.join(o.modified),r.innerChanges&&o.innerChanges?r.innerChanges.concat(o.innerChanges):void 0),s.pop())),s.push(o),r=o}return gd((()=>pd(s,((e,t)=>t.original.startLineNumber-e.original.endLineNumberExclusive==t.modified.startLineNumber-e.modified.endLineNumberExclusive&&e.original.endLineNumberExclusive<t.original.startLineNumber&&e.modified.endLineNumberExclusive<t.modified.startLineNumber)))),new QM(s,[],o.quitEarly)}}function nT(e,t,i,n){return new ZI(e,t,i).ComputeDiff(n)}class oT{constructor(e){const t=[],i=[];for(let n=0,o=e.length;n<o;n++)t[n]=hT(e[n],1),i[n]=dT(e[n],1);this.lines=e,this._startColumns=t,this._endColumns=i}getElements(){const e=[];for(let t=0,i=this.lines.length;t<i;t++)e[t]=this.lines[t].substring(this._startColumns[t]-1,this._endColumns[t]-1);return e}getStrictElement(e){return this.lines[e]}getStartLineNumber(e){return e+1}getEndLineNumber(e){return e+1}createCharSequence(e,t,i){const n=[],o=[],s=[];let r=0;for(let a=t;a<=i;a++){const t=this.lines[a],l=e?this._startColumns[a]:1,h=e?this._endColumns[a]:t.length+1;for(let e=l;e<h;e++)n[r]=t.charCodeAt(e-1),o[r]=a+1,s[r]=e,r++;!e&&a<i&&(n[r]=10,o[r]=a+1,s[r]=t.length+1,r++)}return new sT(n,o,s)}}class sT{constructor(e,t,i){this._charCodes=e,this._lineNumbers=t,this._columns=i}toString(){return"["+this._charCodes.map(((e,t)=>(10===e?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`)).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return-1===e?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),10===this._charCodes[e]?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return-1===e?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),10===this._charCodes[e]?1:this._columns[e]+1)}}class rT{constructor(e,t,i,n,o,s,r,a){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=n,this.modifiedStartLineNumber=o,this.modifiedStartColumn=s,this.modifiedEndLineNumber=r,this.modifiedEndColumn=a}static createFromDiffChange(e,t,i){const n=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),s=t.getEndLineNumber(e.originalStart+e.originalLength-1),r=t.getEndColumn(e.originalStart+e.originalLength-1),a=i.getStartLineNumber(e.modifiedStart),l=i.getStartColumn(e.modifiedStart),h=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),d=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new rT(n,o,s,r,a,l,h,d)}}class aT{constructor(e,t,i,n,o){this.originalStartLineNumber=e,this.originalEndLineNumber=t,this.modifiedStartLineNumber=i,this.modifiedEndLineNumber=n,this.charChanges=o}static createFromDiffResult(e,t,i,n,o,s,r){let a,l,h,d,c;if(0===t.originalLength?(a=i.getStartLineNumber(t.originalStart)-1,l=0):(a=i.getStartLineNumber(t.originalStart),l=i.getEndLineNumber(t.originalStart+t.originalLength-1)),0===t.modifiedLength?(h=n.getStartLineNumber(t.modifiedStart)-1,d=0):(h=n.getStartLineNumber(t.modifiedStart),d=n.getEndLineNumber(t.modifiedStart+t.modifiedLength-1)),s&&t.originalLength>0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const s=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),a=n.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(s.getElements().length>0&&a.getElements().length>0){let e=nT(s,a,o,!0).changes;r&&(e=function(e){if(e.length<=1)return e;const t=[e[0]];let i=t[0];for(let n=1,o=e.length;n<o;n++){const o=e[n],s=o.originalStart-(i.originalStart+i.originalLength),r=o.modifiedStart-(i.modifiedStart+i.modifiedLength);Math.min(s,r)<3?(i.originalLength=o.originalStart+o.originalLength-i.originalStart,i.modifiedLength=o.modifiedStart+o.modifiedLength-i.modifiedStart):(t.push(o),i=o)}return t}(e)),c=[];for(let t=0,i=e.length;t<i;t++)c.push(rT.createFromDiffChange(e[t],s,a))}}return new aT(a,l,h,d,c)}}class lT{constructor(e,t,i){this.shouldComputeCharChanges=i.shouldComputeCharChanges,this.shouldPostProcessCharChanges=i.shouldPostProcessCharChanges,this.shouldIgnoreTrimWhitespace=i.shouldIgnoreTrimWhitespace,this.shouldMakePrettyDiff=i.shouldMakePrettyDiff,this.originalLines=e,this.modifiedLines=t,this.original=new oT(e),this.modified=new oT(t),this.continueLineDiff=cT(i.maxComputationTime),this.continueCharDiff=cT(0===i.maxComputationTime?0:Math.min(i.maxComputationTime,5e3))}computeDiff(){if(1===this.original.lines.length&&0===this.original.lines[0].length)return 1===this.modified.lines.length&&0===this.modified.lines[0].length?{quitEarly:!1,changes:[]}:{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:1,modifiedStartLineNumber:1,modifiedEndLineNumber:this.modified.lines.length,charChanges:void 0}]};if(1===this.modified.lines.length&&0===this.modified.lines[0].length)return{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:this.original.lines.length,modifiedStartLineNumber:1,modifiedEndLineNumber:1,charChanges:void 0}]};const e=nT(this.original,this.modified,this.continueLineDiff,this.shouldMakePrettyDiff),t=e.changes,i=e.quitEarly;if(this.shouldIgnoreTrimWhitespace){const e=[];for(let i=0,n=t.length;i<n;i++)e.push(aT.createFromDiffResult(this.shouldIgnoreTrimWhitespace,t[i],this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges));return{quitEarly:i,changes:e}}const n=[];let o=0,s=0;for(let e=-1,i=t.length;e<i;e++){const r=e+1<i?t[e+1]:null,a=r?r.originalStart:this.originalLines.length,l=r?r.modifiedStart:this.modifiedLines.length;for(;o<a&&s<l;){const e=this.originalLines[o],t=this.modifiedLines[s];if(e!==t){{let i=hT(e,1),r=hT(t,1);for(;i>1&&r>1&&e.charCodeAt(i-2)===t.charCodeAt(r-2);)i--,r--;(i>1||r>1)&&this._pushTrimWhitespaceCharChange(n,o+1,1,i,s+1,1,r)}{let i=dT(e,1),r=dT(t,1);const a=e.length+1,l=t.length+1;for(;i<a&&r<l&&e.charCodeAt(i-1)===e.charCodeAt(r-1);)i++,r++;(i<a||r<l)&&this._pushTrimWhitespaceCharChange(n,o+1,i,a,s+1,r,l)}}o++,s++}r&&(n.push(aT.createFromDiffResult(this.shouldIgnoreTrimWhitespace,r,this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges)),o+=r.originalLength,s+=r.modifiedLength)}return{quitEarly:i,changes:n}}_pushTrimWhitespaceCharChange(e,t,i,n,o,s,r){if(this._mergeTrimWhitespaceCharChange(e,t,i,n,o,s,r))return;let a;this.shouldComputeCharChanges&&(a=[new rT(t,i,t,n,o,s,o,r)]),e.push(new aT(t,t,o,o,a))}_mergeTrimWhitespaceCharChange(e,t,i,n,o,s,r){const a=e.length;if(0===a)return!1;const l=e[a-1];return 0!==l.originalEndLineNumber&&0!==l.modifiedEndLineNumber&&(l.originalEndLineNumber===t&&l.modifiedEndLineNumber===o?(this.shouldComputeCharChanges&&l.charChanges&&l.charChanges.push(new rT(t,i,t,n,o,s,o,r)),!0):l.originalEndLineNumber+1===t&&l.modifiedEndLineNumber+1===o&&(l.originalEndLineNumber=t,l.modifiedEndLineNumber=o,this.shouldComputeCharChanges&&l.charChanges&&l.charChanges.push(new rT(t,i,t,n,o,s,o,r)),!0))}}function hT(e,t){const i=fn(e);return-1===i?t:i+1}function dT(e,t){const i=vn(e);return-1===i?t:i+2}function cT(e){if(0===e)return()=>!0;const t=Date.now();return()=>Date.now()-t<e}class uT{static trivial(e,t){return new uT([new gT(du.ofLength(e.length),du.ofLength(t.length))],!1)}static trivialTimedOut(e,t){return new uT([new gT(du.ofLength(e.length),du.ofLength(t.length))],!0)}constructor(e,t){this.diffs=e,this.hitTimeout=t}}class gT{static invert(e,t){const i=[];return Oc(e,((e,n)=>{i.push(gT.fromOffsetPairs(e?e.getEndExclusives():pT.zero,n?n.getStarts():new pT(t,(e?e.seq2Range.endExclusive-e.seq1Range.endExclusive:0)+t)))})),i}static fromOffsetPairs(e,t){return new gT(new du(e.offset1,t.offset1),new du(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new gT(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new gT(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return 0===e?this:new gT(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return 0===e?this:new gT(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return 0===e?this:new gT(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(t&&i)return new gT(t,i)}getStarts(){return new pT(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new pT(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class pT{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}}pT.zero=new pT(0,0),pT.max=new pT(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class mT{isValid(){return!0}}mT.instance=new mT;class fT{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new b("timeout must be positive")}isValid(){return!(Date.now()-this.startTime<this.timeout)&&this.valid&&(this.valid=!1),this.valid}}class _T{constructor(e,t){this.width=e,this.height=t,this.array=[],this.array=new Array(e*t)}get(e,t){return this.array[e+t*this.width]}set(e,t,i){this.array[e+t*this.width]=i}}function vT(e){return 32===e||9===e}class bT{static getKey(e){let t=this.chrKeys.get(e);return void 0===t&&(t=this.chrKeys.size,this.chrKeys.set(e,t)),t}constructor(e,t,i){this.range=e,this.lines=t,this.source=i,this.histogram=[];let n=0;for(let i=e.startLineNumber-1;i<e.endLineNumberExclusive-1;i++){const e=t[i];for(let t=0;t<e.length;t++){n++;const i=e[t],o=bT.getKey(i);this.histogram[o]=(this.histogram[o]||0)+1}n++;const o=bT.getKey("\n");this.histogram[o]=(this.histogram[o]||0)+1}this.totalCount=n}computeSimilarity(e){var t,i;let n=0;const o=Math.max(this.histogram.length,e.histogram.length);for(let s=0;s<o;s++)n+=Math.abs((null!==(t=this.histogram[s])&&void 0!==t?t:0)-(null!==(i=e.histogram[s])&&void 0!==i?i:0));return 1-n/(this.totalCount+e.totalCount)}}bT.chrKeys=new Map;class wT{compute(e,t,i=mT.instance,n){if(0===e.length||0===t.length)return uT.trivial(e,t);const o=new _T(e.length,t.length),s=new _T(e.length,t.length),r=new _T(e.length,t.length);for(let a=0;a<e.length;a++)for(let l=0;l<t.length;l++){if(!i.isValid())return uT.trivialTimedOut(e,t);const h=0===a?0:o.get(a-1,l),d=0===l?0:o.get(a,l-1);let c;e.getElement(a)===t.getElement(l)?(c=0===a||0===l?0:o.get(a-1,l-1),a>0&&l>0&&3===s.get(a-1,l-1)&&(c+=r.get(a-1,l-1)),c+=n?n(a,l):1):c=-1;const u=Math.max(h,d,c);if(u===c){const e=a>0&&l>0?r.get(a-1,l-1):0;r.set(a,l,e+1),s.set(a,l,3)}else u===h?(r.set(a,l,0),s.set(a,l,1)):u===d&&(r.set(a,l,0),s.set(a,l,2));o.set(a,l,u)}const a=[];let l=e.length,h=t.length;function d(e,t){e+1===l&&t+1===h||a.push(new gT(new du(e+1,l),new du(t+1,h))),l=e,h=t}let c=e.length-1,u=t.length-1;for(;c>=0&&u>=0;)3===s.get(c,u)?(d(c,u),c--,u--):1===s.get(c,u)?c--:u--;return d(-1,-1),a.reverse(),new uT(a,!1)}}class CT{compute(e,t,i=mT.instance){if(0===e.length||0===t.length)return uT.trivial(e,t);const n=e,o=t;function s(e,t){for(;e<n.length&&t<o.length&&n.getElement(e)===o.getElement(t);)e++,t++;return e}let r=0;const a=new ST;a.set(0,s(0,0));const l=new kT;l.set(0,0===a.get(0)?null:new yT(null,0,0,a.get(0)));let h=0;e:for(;;){if(r++,!i.isValid())return uT.trivialTimedOut(n,o);const e=-Math.min(r,o.length+r%2),t=Math.min(r,n.length+r%2);for(h=e;h<=t;h+=2){let i=0;const r=h===t?-1:a.get(h+1),d=h===e?-1:a.get(h-1)+1;i++;const c=Math.min(Math.max(r,d),n.length),u=c-h;if(i++,c>n.length||u>o.length)continue;const g=s(c,u);a.set(h,g);const p=c===r?l.get(h+1):l.get(h-1);if(l.set(h,g!==c?new yT(p,c,u,g-c):p),a.get(h)===n.length&&a.get(h)-h===o.length)break e}}let d=l.get(h);const c=[];let u=n.length,g=o.length;for(;;){const e=d?d.x+d.length:0,t=d?d.y+d.length:0;if(e===u&&t===g||c.push(new gT(new du(e,u),new du(t,g))),!d)break;u=d.x,g=d.y,d=d.prev}return c.reverse(),new uT(c,!1)}}class yT{constructor(e,t,i,n){this.prev=e,this.x=t,this.y=i,this.length=n}}class ST{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if((e=-e-1)>=this.negativeArr.length){const e=this.negativeArr;this.negativeArr=new Int32Array(2*e.length),this.negativeArr.set(e)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const e=this.positiveArr;this.positiveArr=new Int32Array(2*e.length),this.positiveArr.set(e)}this.positiveArr[e]=t}}}class kT{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}class LT{constructor(e,t,i){this.lines=e,this.considerWhitespaceChanges=i,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let n=!1;t.start>0&&t.endExclusive>=e.length&&(t=new du(t.start-1,t.endExclusive),n=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let t=this.lineRange.start;t<this.lineRange.endExclusive;t++){let o=e[t],s=0;if(n)s=o.length,o="",n=!1;else if(!i){const e=o.trimStart();s=o.length-e.length,o=e.trimEnd()}this.additionalOffsetByLine.push(s);for(let e=0;e<o.length;e++)this.elements.push(o.charCodeAt(e));t<e.length-1&&(this.elements.push("\n".charCodeAt(0)),this.firstCharOffsetByLine[t-this.lineRange.start+1]=this.elements.length)}this.additionalOffsetByLine.push(0)}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new du(0,this.length))}getText(e){return this.elements.slice(e.start,e.endExclusive).map((e=>String.fromCharCode(e))).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=NT(e>0?this.elements[e-1]:-1),i=NT(e<this.elements.length?this.elements[e]:-1);if(7===t&&8===i)return 0;let n=0;return t!==i&&(n+=10,0===t&&1===i&&(n+=1)),n+=ET(t),n+=ET(i),n}translateOffset(e){if(this.lineRange.isEmpty)return new ch(this.lineRange.start+1,1);const t=pu(this.firstCharOffsetByLine,(t=>t<=e));return new ch(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return tc.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length)return;if(!xT(this.elements[e]))return;let t=e;for(;t>0&&xT(this.elements[t-1]);)t--;let i=e;for(;i<this.elements.length&&xT(this.elements[i]);)i++;return new du(t,i)}countLinesIn(e){return this.translateOffset(e.endExclusive).lineNumber-this.translateOffset(e.start).lineNumber}isStronglyEqual(e,t){return this.elements[e]===this.elements[t]}extendToFullLines(e){var t,i;const n=null!==(t=gu(this.firstCharOffsetByLine,(t=>t<=e.start)))&&void 0!==t?t:0,o=null!==(i=function(t,i){const n=mu(t,(t=>e.endExclusive<=t));return n===t.length?void 0:t[n]}(this.firstCharOffsetByLine))&&void 0!==i?i:this.elements.length;return new du(n,o)}}function xT(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57}const DT={0:0,1:0,2:0,3:10,4:2,5:3,6:3,7:10,8:10};function ET(e){return DT[e]}function NT(e){return 10===e?8:13===e?7:vT(e)?6:e>=97&&e<=122?0:e>=65&&e<=90?1:e>=48&&e<=57?2:-1===e?3:44===e||59===e?5:4}function IT(e,t,i){if(e.trim()===t.trim())return!0;if(e.length>300&&t.length>300)return!1;const n=(new CT).compute(new LT([e],new du(0,1),!1),new LT([t],new du(0,1),!1),i);let o=0;const s=gT.invert(n.diffs,e.length);for(const t of s)t.seq1Range.forEach((t=>{vT(e.charCodeAt(t))||o++}));const r=function(t){let i=0;for(let n=0;n<e.length;n++)vT(t.charCodeAt(n))||i++;return i}(e.length>t.length?e:t);return o/r>.6&&r>10}function MT(e,t,i){let n=i;return n=TT(e,t,n),n=TT(e,t,n),n=function(e,t,i){if(!e.getBoundaryScore||!t.getBoundaryScore)return i;for(let n=0;n<i.length;n++){const o=n>0?i[n-1]:void 0,s=i[n],r=n+1<i.length?i[n+1]:void 0,a=new du(o?o.seq1Range.start+1:0,r?r.seq1Range.endExclusive-1:e.length),l=new du(o?o.seq2Range.start+1:0,r?r.seq2Range.endExclusive-1:t.length);s.seq1Range.isEmpty?i[n]=AT(s,e,t,a,l):s.seq2Range.isEmpty&&(i[n]=AT(s.swap(),t,e,l,a).swap())}return i}(e,t,n),n}function TT(e,t,i){if(0===i.length)return i;const n=[];n.push(i[0]);for(let o=1;o<i.length;o++){const s=n[n.length-1];let r=i[o];if(r.seq1Range.isEmpty||r.seq2Range.isEmpty){const i=r.seq1Range.start-s.seq1Range.endExclusive;let o;for(o=1;o<=i&&e.getElement(r.seq1Range.start-o)===e.getElement(r.seq1Range.endExclusive-o)&&t.getElement(r.seq2Range.start-o)===t.getElement(r.seq2Range.endExclusive-o);o++);if(o--,o===i){n[n.length-1]=new gT(new du(s.seq1Range.start,r.seq1Range.endExclusive-i),new du(s.seq2Range.start,r.seq2Range.endExclusive-i));continue}r=r.delta(-o)}n.push(r)}const o=[];for(let i=0;i<n.length-1;i++){const s=n[i+1];let r=n[i];if(r.seq1Range.isEmpty||r.seq2Range.isEmpty){const o=s.seq1Range.start-r.seq1Range.endExclusive;let a;for(a=0;a<o&&e.isStronglyEqual(r.seq1Range.start+a,r.seq1Range.endExclusive+a)&&t.isStronglyEqual(r.seq2Range.start+a,r.seq2Range.endExclusive+a);a++);if(a===o){n[i+1]=new gT(new du(r.seq1Range.start+o,s.seq1Range.endExclusive),new du(r.seq2Range.start+o,s.seq2Range.endExclusive));continue}a>0&&(r=r.delta(a))}o.push(r)}return n.length>0&&o.push(n[n.length-1]),o}function AT(e,t,i,n,o){let s=1;for(;e.seq1Range.start-s>=n.start&&e.seq2Range.start-s>=o.start&&i.isStronglyEqual(e.seq2Range.start-s,e.seq2Range.endExclusive-s)&&s<100;)s++;s--;let r=0;for(;e.seq1Range.start+r<n.endExclusive&&e.seq2Range.endExclusive+r<o.endExclusive&&i.isStronglyEqual(e.seq2Range.start+r,e.seq2Range.endExclusive+r)&&r<100;)r++;if(0===s&&0===r)return e;let a=0,l=-1;for(let n=-s;n<=r;n++){const o=e.seq2Range.start+n,s=e.seq2Range.endExclusive+n,r=e.seq1Range.start+n,h=t.getBoundaryScore(r)+i.getBoundaryScore(o)+i.getBoundaryScore(s);h>l&&(l=h,a=n)}return e.delta(a)}class RT{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){return 1e3-((0===e?0:OT(this.lines[e-1]))+(e===this.lines.length?0:OT(this.lines[e])))}getText(e){return this.lines.slice(e.start,e.endExclusive).join("\n")}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function OT(e){let t=0;for(;t<e.length&&(32===e.charCodeAt(t)||9===e.charCodeAt(t));)t++;return t}class PT{constructor(){this.dynamicProgrammingDiffing=new wT,this.myersDiffingAlgorithm=new CT}computeDiff(e,t,i){if(e.length<=1&&Ic(e,t,((e,t)=>e===t)))return new QM([],[],!1);if(1===e.length&&0===e[0].length||1===t.length&&0===t[0].length)return new QM([new eT(new bu(1,e.length+1),new bu(1,t.length+1),[new tT(new tc(1,1,e.length,e[0].length+1),new tc(1,1,t.length,t[0].length+1))])],[],!1);const n=0===i.maxComputationTimeMs?mT.instance:new fT(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,s=new Map;function r(e){let t=s.get(e);return void 0===t&&(t=s.size,s.set(e,t)),t}const a=e.map((e=>r(e.trim()))),l=t.map((e=>r(e.trim()))),h=new RT(a,e),d=new RT(l,t),c=(()=>h.length+d.length<1700?this.dynamicProgrammingDiffing.compute(h,d,n,((i,n)=>e[i]===t[n]?0===t[n].length?.1:1+Math.log(1+t[n].length):.99)):this.myersDiffingAlgorithm.compute(h,d))();let u=c.diffs,g=c.hitTimeout;u=MT(h,d,u),u=function(e,t,i){let n=i;if(0===n.length)return n;let o,s=0;do{o=!1;const r=[n[0]];for(let a=1;a<n.length;a++){const l=n[a],h=r[r.length-1];function d(t,i){const n=new du(h.seq1Range.endExclusive,l.seq1Range.start);return e.getText(n).replace(/\s/g,"").length<=4&&(t.seq1Range.length+t.seq2Range.length>5||i.seq1Range.length+i.seq2Range.length>5)}d(h,l)?(o=!0,r[r.length-1]=r[r.length-1].join(l)):r.push(l)}n=r}while(s++<10&&o);return n}(h,0,u);const p=[],m=i=>{if(o)for(let s=0;s<i;s++){const i=f+s,r=_+s;if(e[i]!==t[r]){const s=this.refineDiff(e,t,new gT(new du(i,i+1),new du(r,r+1)),n,o);for(const e of s.mappings)p.push(e);s.hitTimeout&&(g=!0)}}};let f=0,_=0;for(const i of u){gd((()=>i.seq1Range.start-f==i.seq2Range.start-_)),m(i.seq1Range.start-f),f=i.seq1Range.endExclusive,_=i.seq2Range.endExclusive;const s=this.refineDiff(e,t,i,n,o);s.hitTimeout&&(g=!0);for(const e of s.mappings)p.push(e)}m(e.length-f);const v=FT(p,e,t);let b=[];return i.computeMoves&&(b=this.computeMoves(v,e,t,a,l,n,o)),gd((()=>{function i(e,t){if(e.lineNumber<1||e.lineNumber>t.length)return!1;const i=t[e.lineNumber-1];return!(e.column<1||e.column>i.length+1)}function n(e,t){return!(e.startLineNumber<1||e.startLineNumber>t.length+1||e.endLineNumberExclusive<1||e.endLineNumberExclusive>t.length+1)}for(const o of v){if(!o.innerChanges)return!1;for(const n of o.innerChanges)if(!(i(n.modifiedRange.getStartPosition(),t)&&i(n.modifiedRange.getEndPosition(),t)&&i(n.originalRange.getStartPosition(),e)&&i(n.originalRange.getEndPosition(),e)))return!1;if(!n(o.modified,t)||!n(o.original,e))return!1}return!0})),new QM(v,b,g)}computeMoves(e,t,i,n,o,s,r){return function(e,t,i,n,o,s){let{moves:r,excludedChanges:a}=function(e,t,i,n){const o=[],s=e.filter((e=>e.modified.isEmpty&&e.original.length>=3)).map((e=>new bT(e.original,t,e))),r=new Set(e.filter((e=>e.original.isEmpty&&e.modified.length>=3)).map((e=>new bT(e.modified,i,e)))),a=new Set;for(const e of s){let t,i=-1;for(const n of r){const o=e.computeSimilarity(n);o>i&&(i=o,t=n)}if(i>.9&&t&&(r.delete(t),o.push(new JM(e.range,t.range)),a.add(e.source),a.add(t.source)),!n.isValid())return{moves:o,excludedChanges:a}}return{moves:o,excludedChanges:a}}(e,t,i,s);if(!s.isValid())return[];const l=function(e,t,i,n,o,s){const r=[],a=new sa;for(const i of e)for(let e=i.original.startLineNumber;e<i.original.endLineNumberExclusive-2;e++){const i=`${t[e-1]}:${t[e+1-1]}:${t[e+2-1]}`;a.add(i,{range:new bu(e,e+3)})}const l=[];e.sort(Yc((e=>e.modified.startLineNumber),Qc));for(const t of e){let e=[];for(let n=t.modified.startLineNumber;n<t.modified.endLineNumberExclusive-2;n++){const t=`${i[n-1]}:${i[n+1-1]}:${i[n+2-1]}`,o=new bu(n,n+3),s=[];a.forEach(t,(({range:t})=>{for(const i of e)if(i.originalLineRange.endLineNumberExclusive+1===t.endLineNumberExclusive&&i.modifiedLineRange.endLineNumberExclusive+1===o.endLineNumberExclusive)return i.originalLineRange=new bu(i.originalLineRange.startLineNumber,t.endLineNumberExclusive),i.modifiedLineRange=new bu(i.modifiedLineRange.startLineNumber,o.endLineNumberExclusive),void s.push(i);const i={modifiedLineRange:o,originalLineRange:t};l.push(i),s.push(i)})),e=s}if(!s.isValid())return[]}l.sort(Jc(Yc((e=>e.modifiedLineRange.length),Qc)));const h=new wu,d=new wu;for(const e of l){const t=e.modifiedLineRange.startLineNumber-e.originalLineRange.startLineNumber,i=h.subtractFrom(e.modifiedLineRange),n=d.subtractFrom(e.originalLineRange).getWithDelta(t),o=i.getIntersection(n);for(const e of o.ranges){if(e.length<3)continue;const i=e,n=e.delta(-t);r.push(new JM(n,i)),h.addRange(i),d.addRange(n)}}r.sort(Yc((e=>e.original.startLineNumber),Qc));const c=new fu(e);for(let t=0;t<r.length;t++){const i=r[t],a=c.findLastMonotonous((e=>e.original.startLineNumber<=i.original.startLineNumber)),l=gu(e,(e=>e.modified.startLineNumber<=i.modified.startLineNumber)),u=Math.max(i.original.startLineNumber-a.original.startLineNumber,i.modified.startLineNumber-l.modified.startLineNumber),g=c.findLastMonotonous((e=>e.original.startLineNumber<i.original.endLineNumberExclusive)),p=gu(e,(e=>e.modified.startLineNumber<i.modified.endLineNumberExclusive)),m=Math.max(g.original.endLineNumberExclusive-i.original.endLineNumberExclusive,p.modified.endLineNumberExclusive-i.modified.endLineNumberExclusive);let f,_;for(f=0;f<u;f++){const e=i.original.startLineNumber-f-1,t=i.modified.startLineNumber-f-1;if(e>n.length||t>o.length)break;if(h.contains(t)||d.contains(e))break;if(!IT(n[e-1],o[t-1],s))break}for(f>0&&(d.addRange(new bu(i.original.startLineNumber-f,i.original.startLineNumber)),h.addRange(new bu(i.modified.startLineNumber-f,i.modified.startLineNumber))),_=0;_<m;_++){const e=i.original.endLineNumberExclusive+_,t=i.modified.endLineNumberExclusive+_;if(e>n.length||t>o.length)break;if(h.contains(t)||d.contains(e))break;if(!IT(n[e-1],o[t-1],s))break}_>0&&(d.addRange(new bu(i.original.endLineNumberExclusive,i.original.endLineNumberExclusive+_)),h.addRange(new bu(i.modified.endLineNumberExclusive,i.modified.endLineNumberExclusive+_))),(f>0||_>0)&&(r[t]=new JM(new bu(i.original.startLineNumber-f,i.original.endLineNumberExclusive+_),new bu(i.modified.startLineNumber-f,i.modified.endLineNumberExclusive+_)))}return r}(e.filter((e=>!a.has(e))),n,o,t,i,s);return qc(r,l),r=function(e){if(0===e.length)return e;e.sort(Yc((e=>e.original.startLineNumber),Qc));const t=[e[0]];for(let i=1;i<e.length;i++){const n=t[t.length-1],o=e[i],s=o.original.startLineNumber-n.original.endLineNumberExclusive,r=o.modified.startLineNumber-n.modified.endLineNumberExclusive;s>=0&&r>=0&&s+r<=2?t[t.length-1]=n.join(o):t.push(o)}return t}(r),r=r.filter((e=>{const i=e.original.toOffsetRange().slice(t).map((e=>e.trim()));return i.join("\n").length>=15&&function(e,t){let i=0;for(const t of e)t.length>=2&&i++;return i}(i)>=2})),r=function(e,t){const i=new fu(e);return t.filter((t=>(i.findLastMonotonous((e=>e.original.startLineNumber<t.original.endLineNumberExclusive))||new JM(new bu(1,1),new bu(1,1)))!==gu(e,(e=>e.modified.startLineNumber<t.modified.endLineNumberExclusive))))}(e,r),r}(e,t,i,n,o,s).map((e=>{const n=FT(this.refineDiff(t,i,new gT(e.original.toOffsetRange(),e.modified.toOffsetRange()),s,r).mappings,t,i,!0);return new XM(e,n)}))}refineDiff(e,t,i,n,o){const s=new LT(e,i.seq1Range,o),r=new LT(t,i.seq2Range,o),a=s.length+r.length<500?this.dynamicProgrammingDiffing.compute(s,r,n):this.myersDiffingAlgorithm.compute(s,r,n);let l=a.diffs;return l=MT(s,r,l),l=function(e,t,i){const n=[];let o;function s(){if(!o)return;const e=o.s1Range.length-o.deleted;o.s2Range.length,o.added,Math.max(o.deleted,o.added)+(o.count-1)>e&&n.push(new gT(o.s1Range,o.s2Range)),o=void 0}for(const r of i){function a(e,t){var i,n,a,l;if(!o||!o.s1Range.containsRange(e)||!o.s2Range.containsRange(t))if(!o||o.s1Range.endExclusive<e.start&&o.s2Range.endExclusive<t.start)s(),o={added:0,deleted:0,count:0,s1Range:e,s2Range:t};else{const s=du.tryCreate(o.s1Range.endExclusive,e.start),r=du.tryCreate(o.s2Range.endExclusive,t.start);o.deleted+=null!==(i=null==s?void 0:s.length)&&void 0!==i?i:0,o.added+=null!==(n=null==r?void 0:r.length)&&void 0!==n?n:0,o.s1Range=o.s1Range.join(e),o.s2Range=o.s2Range.join(t)}const h=e.intersect(r.seq1Range),d=t.intersect(r.seq2Range);o.count++,o.deleted+=null!==(a=null==h?void 0:h.length)&&void 0!==a?a:0,o.added+=null!==(l=null==d?void 0:d.length)&&void 0!==l?l:0}const l=e.findWordContaining(r.seq1Range.start-1),h=t.findWordContaining(r.seq2Range.start-1),d=e.findWordContaining(r.seq1Range.endExclusive),c=t.findWordContaining(r.seq2Range.endExclusive);l&&d&&h&&c&&l.equals(d)&&h.equals(c)?a(l,h):(l&&h&&a(l,h),d&&c&&a(d,c))}return s(),function(e,t){const i=[];for(;e.length>0||t.length>0;){const n=e[0],o=t[0];let s;s=n&&(!o||n.seq1Range.start<o.seq1Range.start)?e.shift():t.shift(),i.length>0&&i[i.length-1].seq1Range.endExclusive>=s.seq1Range.start?i[i.length-1]=i[i.length-1].join(s):i.push(s)}return i}(i,n)}(s,r,l),l=function(e,t,i){const n=[];for(const e of i){const t=n[n.length-1];t&&(e.seq1Range.start-t.seq1Range.endExclusive<=2||e.seq2Range.start-t.seq2Range.endExclusive<=2)?n[n.length-1]=new gT(t.seq1Range.join(e.seq1Range),t.seq2Range.join(e.seq2Range)):n.push(e)}return n}(0,0,l),l=function(e,t,i){let n=i;if(0===n.length)return n;let o,s=0;do{o=!1;const a=[n[0]];for(let l=1;l<n.length;l++){const h=n[l],d=a[a.length-1];function c(i,n){const o=new du(d.seq1Range.endExclusive,h.seq1Range.start);if(e.countLinesIn(o)>5||o.length>500)return!1;const s=e.getText(o).trim();if(s.length>20||s.split(/\r\n|\r|\n/).length>1)return!1;const r=e.countLinesIn(i.seq1Range),a=i.seq1Range.length,l=t.countLinesIn(i.seq2Range),c=i.seq2Range.length,u=e.countLinesIn(n.seq1Range),g=n.seq1Range.length,p=t.countLinesIn(n.seq2Range),m=n.seq2Range.length;function f(e){return Math.min(e,130)}return Math.pow(Math.pow(f(40*r+a),1.5)+Math.pow(f(40*l+c),1.5),1.5)+Math.pow(Math.pow(f(40*u+g),1.5)+Math.pow(f(40*p+m),1.5),1.5)>74184.96480721243}c(d,h)?(o=!0,a[a.length-1]=a[a.length-1].join(h)):a.push(h)}n=a}while(s++<10&&o);const r=[];return function(e,t){for(let i=0;i<e.length;i++)t(0===i?void 0:e[i-1],e[i],i+1===e.length?void 0:e[i+1])}(n,((t,i,n)=>{let o=i;function s(e){return e.length>0&&e.trim().length<=3&&i.seq1Range.length+i.seq2Range.length>100}const a=e.extendToFullLines(i.seq1Range),l=e.getText(new du(a.start,i.seq1Range.start));s(l)&&(o=o.deltaStart(-l.length));const h=e.getText(new du(i.seq1Range.endExclusive,a.endExclusive));s(h)&&(o=o.deltaEnd(h.length));const d=gT.fromOffsetPairs(t?t.getEndExclusives():pT.zero,n?n.getStarts():pT.max),c=o.intersect(d);r.push(c)})),r}(s,r,l),{mappings:l.map((e=>new tT(s.translateRange(e.seq1Range),r.translateRange(e.seq2Range)))),hitTimeout:a.hitTimeout}}}function FT(e,t,i,n=!1){const o=[];for(const n of Rc(e.map((e=>function(e,t,i){let n=0,o=0;1===e.modifiedRange.endColumn&&1===e.originalRange.endColumn&&e.originalRange.startLineNumber+n<=e.originalRange.endLineNumber&&e.modifiedRange.startLineNumber+n<=e.modifiedRange.endLineNumber&&(o=-1),e.modifiedRange.startColumn-1>=i[e.modifiedRange.startLineNumber-1].length&&e.originalRange.startColumn-1>=t[e.originalRange.startLineNumber-1].length&&e.originalRange.startLineNumber<=e.originalRange.endLineNumber+o&&e.modifiedRange.startLineNumber<=e.modifiedRange.endLineNumber+o&&(n=1);const s=new bu(e.originalRange.startLineNumber+n,e.originalRange.endLineNumber+1+o),r=new bu(e.modifiedRange.startLineNumber+n,e.modifiedRange.endLineNumber+1+o);return new eT(s,r,[e])}(e,t,i))),((e,t)=>e.original.overlapOrTouch(t.original)||e.modified.overlapOrTouch(t.modified)))){const e=n[0],t=n[n.length-1];o.push(new eT(e.original.join(t.original),e.modified.join(t.modified),n.map((e=>e.innerChanges[0]))))}return gd((()=>!(!n&&o.length>0&&o[0].original.startLineNumber!==o[0].modified.startLineNumber)&&pd(o,((e,t)=>t.original.startLineNumber-e.original.endLineNumberExclusive==t.modified.startLineNumber-e.modified.endLineNumberExclusive&&e.original.endLineNumberExclusive<t.original.startLineNumber&&e.modified.endLineNumberExclusive<t.modified.startLineNumber)))),o}function BT(e){const t=[];for(const i of e){const e=Number(i);(e||0===e&&""!==i.replace(/\s/g,""))&&t.push(e)}return t}function WT(e,t,i,n){return{red:e/255,blue:i/255,green:t/255,alpha:n}}function VT(e,t){const i=t.index,n=t[0].length;if(!i)return;const o=e.positionAt(i);return{startLineNumber:o.lineNumber,startColumn:o.column,endLineNumber:o.lineNumber,endColumn:o.column+n}}function zT(e,t){if(!e)return;const i=ru.Format.CSS.parseHex(t);return i?{range:e,color:WT(i.rgba.r,i.rgba.g,i.rgba.b,i.rgba.a)}:void 0}function HT(e,t,i){if(!e||1!==t.length)return;const n=BT(t[0].values());return{range:e,color:WT(n[0],n[1],n[2],i?n[3]:1)}}function UT(e,t,i){if(!e||1!==t.length)return;const n=BT(t[0].values()),o=new ru(new ou(n[0],n[1]/100,n[2]/100,i?n[3]:1));return{range:e,color:WT(o.rgba.r,o.rgba.g,o.rgba.b,o.rgba.a)}}function KT(e,t){return"string"==typeof e?[...e.matchAll(t)]:e.findMatches(t)}class jT extends JI{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let i=0;i<this._lines.length;i++){const n=this._lines[i],o=this.offsetAt(new ch(i+1,1)),s=n.matchAll(e);for(const e of s)(e.index||0===e.index)&&(e.index=e.index+o),t.push(e)}return t}getLinesContent(){return this._lines.slice(0)}getLineCount(){return this._lines.length}getLineContent(e){return this._lines[e-1]}getWordAtPosition(e,t){const i=Du(e.column,Lu(t),this._lines[e.lineNumber-1],0);return i?new tc(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn):null}words(e){const t=this._lines,i=this._wordenize.bind(this);let n=0,o="",s=0,r=[];return{*[Symbol.iterator](){for(;;)if(s<r.length){const e=o.substring(r[s].start,r[s].end);s+=1,yield e}else{if(!(n<t.length))break;o=t[n],r=i(o,e),s=0,n+=1}}}}getLineWords(e,t){const i=this._lines[e-1],n=this._wordenize(i,t),o=[];for(const e of n)o.push({word:i.substring(e.start,e.end),startColumn:e.start+1,endColumn:e.end+1});return o}_wordenize(e,t){const i=[];let n;for(t.lastIndex=0;(n=t.exec(e))&&0!==n[0].length;)i.push({start:n.index,end:n.index+n[0].length});return i}getValueInRange(e){if((e=this._validateRange(e)).startLineNumber===e.endLineNumber)return this._lines[e.startLineNumber-1].substring(e.startColumn-1,e.endColumn-1);const t=this._eol,i=e.startLineNumber-1,n=e.endLineNumber-1,o=[];o.push(this._lines[i].substring(e.startColumn-1));for(let e=i+1;e<n;e++)o.push(this._lines[e]);return o.push(this._lines[n].substring(0,e.endColumn-1)),o.join(t)}offsetAt(e){return e=this._validatePosition(e),this._ensureLineStarts(),this._lineStarts.getPrefixSum(e.lineNumber-2)+(e.column-1)}positionAt(e){e=Math.floor(e),e=Math.max(0,e),this._ensureLineStarts();const t=this._lineStarts.getIndexOf(e),i=this._lines[t.index].length;return{lineNumber:1+t.index,column:1+Math.min(t.remainder,i)}}_validateRange(e){const t=this._validatePosition({lineNumber:e.startLineNumber,column:e.startColumn}),i=this._validatePosition({lineNumber:e.endLineNumber,column:e.endColumn});return t.lineNumber!==e.startLineNumber||t.column!==e.startColumn||i.lineNumber!==e.endLineNumber||i.column!==e.endColumn?{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:i.lineNumber,endColumn:i.column}:e}_validatePosition(e){if(!ch.isIPosition(e))throw new Error("bad position");let{lineNumber:t,column:i}=e,n=!1;if(t<1)t=1,i=1,n=!0;else if(t>this._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,n=!0;else{const e=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>e&&(i=e,n=!0)}return n?{lineNumber:t,column:i}:e}}class qT{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){const e=[];return Object.keys(this._models).forEach((t=>e.push(this._models[t]))),e}acceptNewModel(e){this._models[e.url]=new jT(Ro.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){this._models[e]&&this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}async computeUnicodeHighlights(e,t,i){const n=this._getModel(e);return n?GM.computeUnicodeHighlights(n,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async computeDiff(e,t,i,n){const o=this._getModel(e),s=this._getModel(t);return o&&s?qT.computeDiff(o,s,i,n):null}static computeDiff(e,t,i,n){const o="advanced"===n?new PT:new iT,s=e.getLinesContent(),r=t.getLinesContent(),a=o.computeDiff(s,r,i);function l(e){return e.map((e=>{var t;return[e.original.startLineNumber,e.original.endLineNumberExclusive,e.modified.startLineNumber,e.modified.endLineNumberExclusive,null===(t=e.innerChanges)||void 0===t?void 0:t.map((e=>[e.originalRange.startLineNumber,e.originalRange.startColumn,e.originalRange.endLineNumber,e.originalRange.endColumn,e.modifiedRange.startLineNumber,e.modifiedRange.startColumn,e.modifiedRange.endLineNumber,e.modifiedRange.endColumn]))]}))}return{identical:!(a.changes.length>0)&&this._modelsAreIdentical(e,t),quitEarly:a.hitTimeout,changes:l(a.changes),moves:a.moves.map((e=>[e.lineRangeMapping.original.startLineNumber,e.lineRangeMapping.original.endLineNumberExclusive,e.lineRangeMapping.modified.startLineNumber,e.lineRangeMapping.modified.endLineNumberExclusive,l(e.changes)]))}}static _modelsAreIdentical(e,t){const i=e.getLineCount();if(i!==t.getLineCount())return!1;for(let n=1;n<=i;n++)if(e.getLineContent(n)!==t.getLineContent(n))return!1;return!0}async computeMoreMinimalEdits(e,t,i){const n=this._getModel(e);if(!n)return t;const o=[];let s;t=t.slice(0).sort(((e,t)=>e.range&&t.range?tc.compareRangesUsingStarts(e.range,t.range):(e.range?0:1)-(t.range?0:1)));let r=0;for(let e=1;e<t.length;e++)tc.getEndPosition(t[r].range).equals(tc.getStartPosition(t[e].range))?(t[r].range=tc.fromPositions(tc.getStartPosition(t[r].range),tc.getEndPosition(t[e].range)),t[r].text+=t[e].text):(r++,t[r]=t[e]);t.length=r+1;for(let{range:e,text:r,eol:a}of t){if("number"==typeof a&&(s=a),tc.isEmpty(e)&&!r)continue;const t=n.getValueInRange(e);if(r=r.replace(/\r\n|\n|\r/g,n.eol),t===r)continue;if(Math.max(r.length,t.length)>qT._diffLimit){o.push({range:e,text:r});continue}const l=jI(t,r,i),h=n.offsetAt(tc.lift(e).getStartPosition());for(const e of l){const t=n.positionAt(h+e.originalStart),i=n.positionAt(h+e.originalStart+e.originalLength),s={text:r.substr(e.modifiedStart,e.modifiedLength),range:{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:i.lineNumber,endColumn:i.column}};n.getValueInRange(s.range)!==s.text&&o.push(s)}}return"number"==typeof s&&o.push({eol:s,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o}async computeLinks(e){const t=this._getModel(e);return t?function(e){return e&&"function"==typeof e.getLineCount&&"function"==typeof e.getLineContent?oM.computeLinks(e):[]}(t):null}async computeDefaultDocumentColors(e){const t=this._getModel(e);return t?function(e){return e&&"function"==typeof e.getValue&&"function"==typeof e.positionAt?function(e){const t=[],i=KT(e,/\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|(#)([A-Fa-f0-9]{3})\b|(#)([A-Fa-f0-9]{4})\b|(#)([A-Fa-f0-9]{6})\b|(#)([A-Fa-f0-9]{8})\b/gm);if(i.length>0)for(const n of i){const i=n.filter((e=>void 0!==e)),o=i[1],s=i[2];if(!s)continue;let r;if("rgb"===o){const t=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;r=HT(VT(e,n),KT(s,t),!1)}else if("rgba"===o){const t=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;r=HT(VT(e,n),KT(s,t),!0)}else if("hsl"===o){const t=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;r=UT(VT(e,n),KT(s,t),!1)}else if("hsla"===o){const t=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;r=UT(VT(e,n),KT(s,t),!0)}else"#"===o&&(r=zT(VT(e,n),o+s));r&&t.push(r)}return t}(e):[]}(t):null}async textualSuggest(e,t,i,n){const o=new V,s=new RegExp(i,n),r=new Set;e:for(const i of e){const e=this._getModel(i);if(e)for(const i of e.words(s))if(i!==t&&isNaN(Number(i))&&(r.add(i),r.size>qT._suggestionsLimit))break e}return{words:Array.from(r),duration:o.elapsed()}}async computeWordRanges(e,t,i,n){const o=this._getModel(e);if(!o)return Object.create(null);const s=new RegExp(i,n),r=Object.create(null);for(let e=t.startLineNumber;e<t.endLineNumber;e++){const t=o.getLineWords(e,s);for(const i of t){if(!isNaN(Number(i.word)))continue;let t=r[i.word];t||(t=[],r[i.word]=t),t.push({startLineNumber:e,startColumn:i.startColumn,endLineNumber:e,endColumn:i.endColumn})}}return r}async navigateValueSet(e,t,i,n,o){const s=this._getModel(e);if(!s)return null;const r=new RegExp(n,o);t.startColumn===t.endColumn&&(t={startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn+1});const a=s.getValueInRange(t),l=s.getWordAtPosition({lineNumber:t.startLineNumber,column:t.startColumn},r);if(!l)return null;const h=s.getValueInRange(l);return sM.INSTANCE.navigateValueSet(t,a,l,h,i)}loadForeignModule(e,t,i){const n=function(e,t){const i=e=>function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)},n={};for(const t of e)n[t]=i(t);return n}(i,((e,t)=>this._host.fhr(e,t))),o={host:n,getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(o,t),Promise.resolve(_c(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||"function"!=typeof this._foreignModule[e])return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(e){return Promise.reject(e)}}}qT._diffLimit=1e5,qT._suggestionsLimit=1e4,"function"==typeof importScripts&&(globalThis.monaco=$M());const $T=hh("textResourceConfigurationService"),GT=hh("textResourcePropertiesService");var ZT=function(e,t){return function(i,n){t(i,n,e)}};function YT(e,t){const i=e.getModel(t);return!!i&&!i.isTooLargeForSyncing()}let QT=class extends T{constructor(e,t,i,n,o){super(),this._modelService=e,this._workerManager=this._register(new JT(this._modelService,n)),this._logService=i,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(e,t)=>YT(this._modelService,e.uri)?this._workerManager.withWorker().then((t=>t.computeLinks(e.uri))).then((e=>e&&{links:e})):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new XT(this._workerManager,t,this._modelService,n)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return YT(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then((n=>n.computedUnicodeHighlights(e,t,i)))}async computeDiff(e,t,i,n){const o=await this._workerManager.withWorker().then((o=>o.computeDiff(e,t,i,n)));return o?{identical:o.identical,quitEarly:o.quitEarly,changes:s(o.changes),moves:o.moves.map((e=>new XM(new JM(new bu(e[0],e[1]),new bu(e[2],e[3])),s(e[4]))))}:null;function s(e){return e.map((e=>{var t;return new eT(new bu(e[0],e[1]),new bu(e[2],e[3]),null===(t=e[4])||void 0===t?void 0:t.map((e=>new tT(new tc(e[0],e[1],e[2],e[3]),new tc(e[4],e[5],e[6],e[7])))))}))}}computeMoreMinimalEdits(e,t,i=!1){if(Wc(t)){if(!YT(this._modelService,e))return Promise.resolve(t);const n=V.create(),o=this._workerManager.withWorker().then((n=>n.computeMoreMinimalEdits(e,t,i)));return o.finally((()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),n.elapsed()))),Promise.race([o,Kt(1e3).then((()=>t))])}return Promise.resolve(void 0)}canNavigateValueSet(e){return YT(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then((n=>n.navigateValueSet(e,t,i)))}canComputeWordRanges(e){return YT(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then((i=>i.computeWordRanges(e,t)))}};QT=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([ZT(0,uh),ZT(1,$T),ZT(2,Md),ZT(3,Yg),ZT(4,Jk)],QT);class XT{constructor(e,t,i,n){this.languageConfigurationService=n,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}async provideCompletionItems(e,t){const i=this._configurationService.getValue(e.uri,t,"editor");if("off"===i.wordBasedSuggestions)return;const n=[];if("currentDocument"===i.wordBasedSuggestions)YT(this._modelService,e.uri)&&n.push(e.uri);else for(const t of this._modelService.getModels())YT(this._modelService,t.uri)&&(t===e?n.unshift(t.uri):"allDocuments"!==i.wordBasedSuggestions&&t.getLanguageId()!==e.getLanguageId()||n.push(t.uri));if(0===n.length)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),s=e.getWordAtPosition(t),r=s?new tc(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):tc.fromPositions(t),a=r.setEndPosition(t.lineNumber,t.column),l=await this._workerManager.withWorker(),h=await l.textualSuggest(n,null==s?void 0:s.word,o);return h?{duration:h.duration,suggestions:h.words.map((e=>({kind:18,label:e,insertText:e,range:{insert:a,replace:r}})))}:void 0}}class JT extends T{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=(new Date).getTime(),this._register(new xs).cancelAndSet((()=>this._checkStopIdleWorker()),Math.round(15e4),a),this._register(this._modelService.onModelRemoved((e=>this._checkStopEmptyWorker())))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){this._editorWorkerClient&&0===this._modelService.getModels().length&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){this._editorWorkerClient&&(new Date).getTime()-this._lastWorkerUsedTime>3e5&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=(new Date).getTime(),this._editorWorkerClient||(this._editorWorkerClient=new nA(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class eA extends T{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const e=new Gt;e.cancelAndSet((()=>this._checkStopModelSync()),Math.round(3e4)),this._register(e)}}dispose(){for(const e in this._syncedModels)E(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){const e=i.toString();this._syncedModels[e]||this._beginModelSync(i,t),this._syncedModels[e]&&(this._syncedModelsLastUsedTime[e]=(new Date).getTime())}}_checkStopModelSync(){const e=(new Date).getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>6e4&&t.push(i);for(const e of t)this._stopModelSync(e)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i)return;if(!t&&i.isTooLargeForSyncing())return;const n=e.toString();this._proxy.acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const o=new M;o.add(i.onDidChangeContent((e=>{this._proxy.acceptModelChanged(n.toString(),e)}))),o.add(i.onWillDispose((()=>{this._stopModelSync(n)}))),o.add(I((()=>{this._proxy.acceptRemovedModel(n)}))),this._syncedModels[n]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],E(t)}}class tA{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class iA{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class nA extends T{constructor(e,t,i,n){super(),this.languageConfigurationService=n,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new HI(i),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new FI(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new iA(this)))}catch(e){II(e),this._worker=new tA(new qT(new iA(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,(e=>(II(e),this._worker=new tA(new qT(new iA(this),null)),this._getOrCreateWorker().getProxyObject())))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new eA(e,this._modelService,this._keepIdleModels))),this._modelManager}async _withSyncedResources(e,t=!1){return this._disposed?Promise.reject(function(){const e=new Error(u);return e.name=e.message,e}()):this._getProxy().then((i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i)))}computedUnicodeHighlights(e,t,i){return this._withSyncedResources([e]).then((n=>n.computeUnicodeHighlights(e.toString(),t,i)))}computeDiff(e,t,i,n){return this._withSyncedResources([e,t],!0).then((o=>o.computeDiff(e.toString(),t.toString(),i,n)))}computeMoreMinimalEdits(e,t,i){return this._withSyncedResources([e]).then((n=>n.computeMoreMinimalEdits(e.toString(),t,i)))}computeLinks(e){return this._withSyncedResources([e]).then((t=>t.computeLinks(e.toString())))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then((t=>t.computeDefaultDocumentColors(e.toString())))}async textualSuggest(e,t,i){const n=await this._withSyncedResources(e),o=i.source,s=i.flags;return n.textualSuggest(e.map((e=>e.toString())),t,o,s)}computeWordRanges(e,t){return this._withSyncedResources([e]).then((i=>{const n=this._modelService.getModel(e);if(!n)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId()).getWordDefinition(),s=o.source,r=o.flags;return i.computeWordRanges(e.toString(),t,s,r)}))}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then((n=>{const o=this._modelService.getModel(e);if(!o)return null;const s=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),r=s.source,a=s.flags;return n.navigateValueSet(e.toString(),t,i,r,a)}))}dispose(){super.dispose(),this._disposed=!0}}const oA=[];function sA(e){oA.push(e)}function rA(){return oA.slice(0)}var aA=function(e,t){return function(i,n){t(i,n,e)}};class lA{constructor(e,t){this._editorWorkerClient=new nA(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const n=t.range,o=t.color,s=o.alpha,r=new ru(new nu(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),s)),a=s?ru.Format.CSS.formatRGB(r):ru.Format.CSS.formatRGBA(r),l=s?ru.Format.CSS.formatHSL(r):ru.Format.CSS.formatHSLA(r),h=s?ru.Format.CSS.formatHex(r):ru.Format.CSS.formatHexA(r),d=[];return d.push({label:a,textEdit:{range:n,text:a}}),d.push({label:l,textEdit:{range:n,text:l}}),d.push({label:h,textEdit:{range:n,text:h}}),d}}let hA=class extends T{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new lA(e,t)))}};async function dA(e,t,i,n=!0){return mA(new uA,e,t,i,n)}function cA(e,t,i,n){return Promise.resolve(i.provideColorPresentations(e,t,n))}hA=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([aA(0,uh),aA(1,Yg),aA(2,Jk)],hA),sA(hA);class uA{constructor(){}async compute(e,t,i,n){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const t of o)n.push({colorInfo:t,provider:e});return Array.isArray(o)}}class gA{constructor(){}async compute(e,t,i,n){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const e of o)n.push({range:e.range,color:[e.color.red,e.color.green,e.color.blue,e.color.alpha]});return Array.isArray(o)}}class pA{constructor(e){this.colorInfo=e}async compute(e,t,i,n){const o=await e.provideColorPresentations(t,this.colorInfo,Rt.None);return Array.isArray(o)&&n.push(...o),Array.isArray(o)}}async function mA(e,t,i,n,o){let s,r=!1;const a=[],l=t.ordered(i);for(let t=l.length-1;t>=0;t--){const o=l[t];if(o instanceof lA)s=o;else try{await e.compute(o,i,n,a)&&(r=!0)}catch(e){d(e)}}return r?a:s&&o?(await e.compute(s,i,n,a),a):[]}function fA(e,t){const{colorProvider:i}=e.get(Jk),n=e.get(uh).getModel(t);if(!n)throw m();return{model:n,colorProviderRegistry:i,isDefaultColorDecoratorsEnabled:e.get(ug).getValue("editor.defaultColorDecorators",{resource:t})}}Ch.registerCommand("_executeDocumentColorProvider",(function(e,...t){const[i]=t;if(!(i instanceof Ro))throw m();const{model:n,colorProviderRegistry:o,isDefaultColorDecoratorsEnabled:s}=fA(e,i);return mA(new gA,o,n,Rt.None,s)})),Ch.registerCommand("_executeColorPresentationProvider",(function(e,...t){const[i,n]=t,{uri:o,range:s}=n;if(!(o instanceof Ro&&Array.isArray(i)&&4===i.length&&tc.isIRange(s)))throw m();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=fA(e,o),[h,d,c,u]=i;return mA(new pA({range:s,color:{red:h,green:d,blue:c,alpha:u}}),a,r,Rt.None,l)}));var _A,vA=function(e,t){return function(i,n){t(i,n,e)}};const bA=Object.create({});let wA=_A=class extends T{constructor(e,t,i,n){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new M),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new xI(this._editor),this._decoratorLimitReporter=new CA,this._colorDecorationClassRefs=this._register(new M),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:_A.RECOMPUTE_TIME}),this._register(e.onDidChangeModel((()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()}))),this._register(e.onDidChangeModelLanguage((()=>this.updateColors()))),this._register(i.colorProvider.onDidChange((()=>this.updateColors()))),this._register(e.onDidChangeConfiguration((e=>{const t=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);const i=t!==this._isColorDecoratorsEnabled||e.hasChanged(21),n=e.hasChanged(145);(i||n)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())}))),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&"object"==typeof i){const e=i.colorDecorators;if(e&&void 0!==e.enable&&!e.enable)return e.enable}return this._editor.getOption(20)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();e&&this._languageFeaturesService.colorProvider.has(e)&&(this._localToDispose.add(this._editor.onDidChangeModelContent((()=>{this._timeoutTimer||(this._timeoutTimer=new $t,this._timeoutTimer.cancelAndSet((()=>{this._timeoutTimer=null,this.beginCompute()}),this._debounceInformation.get(e)))}))),this.beginCompute())}async beginCompute(){this._computePromise=Wt((async e=>{const t=this._editor.getModel();if(!t)return[];const i=new V(!1),n=await dA(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),n}));try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){h(e)}}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map((e=>({range:{startLineNumber:e.colorInfo.range.startLineNumber,startColumn:e.colorInfo.range.startColumn,endLineNumber:e.colorInfo.range.endLineNumber,endColumn:e.colorInfo.range.endColumn},options:Sy.EMPTY})));this._editor.changeDecorations((i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach(((t,i)=>this._colorDatas.set(t,e[i])))}))}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(21);for(let n=0;n<e.length&&t.length<i;n++){const{red:i,green:o,blue:s,alpha:r}=e[n].colorInfo.color,a=new nu(Math.round(255*i),Math.round(255*o),Math.round(255*s),r),l=`rgba(${a.r}, ${a.g}, ${a.b}, ${a.a})`,h=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:l}));t.push({range:{startLineNumber:e[n].colorInfo.range.startLineNumber,startColumn:e[n].colorInfo.range.startColumn,endLineNumber:e[n].colorInfo.range.endLineNumber,endColumn:e[n].colorInfo.range.endColumn},options:{description:"colorDetector",before:{content:" ",inlineClassName:`${h.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:bA}}})}const n=i<e.length&&i;this._decoratorLimitReporter.update(e.length,n),this._colorDecoratorIds.set(t)}removeAllDecorations(){this._editor.removeDecorations(this._decorationsIds),this._decorationsIds=[],this._colorDecoratorIds.clear(),this._colorDecorationClassRefs.clear()}getColorData(e){const t=this._editor.getModel();if(!t)return null;const i=t.getDecorationsInRange(tc.fromPositions(e,e)).filter((e=>this._colorDatas.has(e.id)));return 0===i.length?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};wA.ID="editor.contrib.colorDetector",wA.RECOMPUTE_TIME=1e3,wA=_A=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([vA(1,ug),vA(2,Jk),vA(3,hI)],wA);class CA{constructor(){this._onDidChange=new q,this._computed=0,this._limited=!1}update(e,t){e===this._computed&&t===this._limited||(this._computed=e,this._limited=t,this._onDidChange.fire())}}Gd(wA.ID,wA,1);class yA{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new q,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new q,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new q,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let e=0;e<this.colorPresentations.length;e++)if(t.toLowerCase()===this.colorPresentations[e].label){i=e;break}if(-1===i){const e=t.split("(")[0].toLowerCase();for(let t=0;t<this.colorPresentations.length;t++)if(this.colorPresentations[t].label.toLowerCase().startsWith(e)){i=t;break}}-1!==i&&i!==this.presentationIndex&&(this.presentationIndex=i,this._onDidChangePresentation.fire(this.presentation))}flushColor(){this._onColorFlushed.fire(this._color)}}var SA,kA,LA=i(2313),xA={};xA.styleTagTransform=Vr(),xA.setAttributes=Pr(),xA.insert=Rr().bind(null,"head"),xA.domAPI=Tr(),xA.insertStyleElement=Br(),Ir()(LA.Z,xA),LA.Z&&LA.Z.locals&&LA.Z.locals,function(e){e.getDefinition=function(e,t){let i=e.defaults;for(;Ll.isThemeIcon(i);){const e=DA.getIcon(i.id);if(!e)return;i=e.defaults}return i}}(SA||(SA={})),function(e){e.toJSONObject=function(e){return{weight:e.weight,style:e.style,src:e.src.map((e=>({format:e.format,location:e.location.toString()})))}},e.fromJSONObject=function(e){const t=e=>al(e)?e:void 0;if(e&&Array.isArray(e.src)&&e.src.every((e=>al(e.format)&&al(e.location))))return{weight:t(e.weight),style:t(e.style),src:e.src.map((e=>({format:e.format,location:Ro.parse(e.location)})))}}}(kA||(kA={}));const DA=new class{constructor(){this._onDidChange=new q,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:me(0,"The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:me(0,"The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Ll.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,n){const o=this.iconsById[e];if(o){if(i&&!o.description){o.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const t=this.iconReferenceSchema.enum.indexOf(e);-1!==t&&(this.iconReferenceSchema.enumDescriptions[t]=i),this._onDidChange.fire()}return o}const s={id:e,description:i,defaults:t,deprecationMessage:n};this.iconsById[e]=s;const r={$ref:"#/definitions/icons"};return n&&(r.deprecationMessage=n),i&&(r.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=r,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map((e=>this.iconsById[e]))}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(e,t)=>e.id.localeCompare(t.id),t=e=>{for(;Ll.isThemeIcon(e.defaults);)e=this.iconsById[e.defaults.id];return`codicon codicon-${e?e.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const n=Object.keys(this.iconsById).map((e=>this.iconsById[e]));for(const o of n.filter((e=>!!e.description)).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|${Ll.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of n.filter((e=>!Ll.isThemeIcon(e.defaults))).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|`);return i.join("\n")}};function EA(e,t,i,n){return DA.registerIcon(e,t,i,n)}function NA(){return DA}md.add("base.contributions.icons",DA),function(){const e=yl();for(const t in e){const i="\\"+e[t].toString(16);DA.registerIcon(t,{fontCharacter:i})}}();const IA="vscode://schemas/icons",MA=md.as(Sg);MA.registerSchema(IA,DA.getIconSchema());const TA=new Zt((()=>MA.notifySchemaChanged(IA)),200);DA.onDidChange((()=>{TA.isScheduled()||TA.schedule()}));const AA=EA("widget-close",Sl.close,me(0,"Icon for the close action in widgets.")),RA=(EA("goto-previous-location",Sl.arrowUp,me(0,"Icon for goto previous editor location.")),EA("goto-next-location",Sl.arrowDown,me(0,"Icon for goto next editor location.")),Ll.modify(Sl.sync,"spin"),Ll.modify(Sl.loading,"spin"),mr);class OA extends T{constructor(e,t,i,n=!1){super(),this.model=t,this.showingStandaloneColorPicker=n,this._closeButton=null,this._domNode=RA(".colorpicker-header"),hr(e,this._domNode),this._pickedColorNode=hr(this._domNode,RA(".picked-color")),hr(this._pickedColorNode,RA("span.codicon.codicon-color-mode")),this._pickedColorPresentation=hr(this._pickedColorNode,document.createElement("span")),this._pickedColorPresentation.classList.add("picked-color-presentation");const o=me(0,"Click to toggle color options (rgb/hsl/hex)");this._pickedColorNode.setAttribute("title",o),this._originalColorNode=hr(this._domNode,RA(".original-color")),this._originalColorNode.style.backgroundColor=ru.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor(qf)||ru.white,this._register(i.onDidColorThemeChange((e=>{this.backgroundColor=e.getColor(qf)||ru.white}))),this._register(bs(this._pickedColorNode,or.CLICK,(()=>this.model.selectNextColorPresentation()))),this._register(bs(this._originalColorNode,or.CLICK,(()=>{this.model.color=this.model.originalColor,this.model.flushColor()}))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=ru.Format.CSS.format(t.color)||"",this._pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color),this.showingStandaloneColorPicker&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new PA(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=ru.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}class PA extends T{constructor(e){super(),this._onClicked=this._register(new q),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),hr(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),hr(this._button,t),hr(t,RA(".button"+Ll.asCSSSelector(EA("color-picker-close",Sl.close,me(0,"Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class FA extends T{constructor(e,t,i,n=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=RA(".colorpicker-body"),hr(e,this._domNode),this._saturationBox=new BA(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new VA(this._domNode,this.model,n),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new zA(this._domNode,this.model,n),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),n&&(this._insertButton=this._register(new HA(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new ru(new su(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new ru(new su(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=360*(1-e);this.model.color=new ru(new su(360===i?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class BA extends T{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new q,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new q,this.onColorFlushed=this._onColorFlushed.event,this._domNode=RA(".saturation-wrap"),hr(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",hr(this._domNode,this._canvas),this.selection=RA(".saturation-selection"),hr(this._domNode,this.selection),this.layout(),this._register(bs(this._domNode,or.POINTER_DOWN,(e=>this.onPointerDown(e)))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!(e.target&&e.target instanceof Element))return;this.monitor=this._register(new lD);const t=As(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>this.onDidChangePosition(e.pageX-t.left,e.pageY-t.top)),(()=>null));const i=bs(e.target.ownerDocument,or.POINTER_UP,(()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)}),!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),n=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,n),this._onDidChange.fire({s:i,v:n})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new ru(new su(e.h,1,1,1)),i=this._canvas.getContext("2d"),n=i.createLinearGradient(0,0,this._canvas.width,0);n.addColorStop(0,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),n.addColorStop(1,"rgba(255, 255, 255, 0)");const o=i.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=ru.Format.CSS.format(t),i.fill(),i.fillStyle=n,i.fill(),i.fillStyle=o,i.fill()}paintSelection(e,t){this.selection.style.left=e*this.width+"px",this.selection.style.top=this.height-t*this.height+"px"}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class WA extends T{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new q,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new q,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=hr(e,RA(".standalone-strip")),this.overlay=hr(this.domNode,RA(".standalone-overlay"))):(this.domNode=hr(e,RA(".strip")),this.overlay=hr(this.domNode,RA(".overlay"))),this.slider=hr(this.domNode,RA(".slider")),this.slider.style.top="0px",this._register(bs(this.domNode,or.POINTER_DOWN,(e=>this.onPointerDown(e)))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!(e.target&&e.target instanceof Element))return;const t=this._register(new lD),i=As(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,(e=>this.onDidChangeTop(e.pageY-i.top)),(()=>null));const n=bs(e.target.ownerDocument,or.POINTER_UP,(()=>{this._onColorFlushed.fire(),n.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")}),!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=(1-e)*this.height+"px"}}class VA extends WA{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:i,b:n}=e.rgba,o=new ru(new nu(t,i,n,1)),s=new ru(new nu(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${s} 100%)`}getValue(e){return e.hsva.a}}class zA extends WA{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class HA extends T{constructor(e){super(),this._onClicked=this._register(new q),this.onClicked=this._onClicked.event,this._button=hr(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._button.onclick=e=>{this._onClicked.fire()}}get button(){return this._button}}class UA extends hD{constructor(e,t,i,n,o=!1){super(),this.model=t,this.pixelRatio=i,this._register(oe.onDidChange((()=>this.layout())));const s=RA(".colorpicker-widget");e.appendChild(s),this.header=this._register(new OA(s,this.model,n,o)),this.body=this._register(new FA(s,this.model,this.pixelRatio,o))}layout(){this.body.layout()}}var KA=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},jA=function(e,t){return function(i,n){t(i,n,e)}};class qA{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let $A=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return ii.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];const n=wA.get(this._editor);if(!n)return[];for(const e of t){if(!n.isColorDecoration(e))continue;const t=n.getColorData(e.range.getStartPosition());if(t)return[await YA(this,this._editor.getModel(),t.colorInfo,t.provider)]}return[]}renderHoverParts(e,t){return QA(this,this._editor,this._themeService,t,e)}};$A=KA([jA(1,Tv)],$A);class GA{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n}}let ZA=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}async createColorHover(e,t,i){if(!this._editor.hasModel())return null;if(!wA.get(this._editor))return null;const n=await dA(i,this._editor.getModel(),Rt.None);let o=null,s=null;for(const t of n){const i=t.colorInfo;tc.containsRange(i.range,e.range)&&(o=i,s=t.provider)}const r=null!=o?o:e,a=null!=s?s:t,l=!!o;return{colorHover:await YA(this,this._editor.getModel(),r,a),foundInEditor:l}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let i=new tc(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await JA(this._editor.getModel(),t,this._color,i,e),i=XA(this._editor,i,t))}renderHoverParts(e,t){return QA(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};async function YA(e,t,i,n){const o=t.getValueInRange(i.range),{red:s,green:r,blue:a,alpha:l}=i.color,h=new nu(Math.round(255*s),Math.round(255*r),Math.round(255*a),l),d=new ru(h),c=await cA(t,i,n,Rt.None),u=new yA(d,[],0);return u.colorPresentations=c||[],u.guessColorPresentation(d,o),e instanceof $A?new qA(e,tc.lift(i.range),u,n):new GA(e,tc.lift(i.range),u,n)}function QA(e,t,i,n,o){if(0===n.length||!t.hasModel())return T.None;if(o.setMinimumDimensions){const e=t.getOption(66)+8;o.setMinimumDimensions(new Ms(302,e))}const s=new M,r=n[0],a=t.getModel(),l=r.model,h=s.add(new UA(o.fragment,l,t.getOption(141),i,e instanceof ZA));o.setColorPicker(h);let d=!1,c=new tc(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(e instanceof ZA){const t=n[0].model.color;e.color=t,JA(a,l,t,c,r),s.add(l.onColorFlushed((t=>{e.color=t})))}else s.add(l.onColorFlushed((async e=>{await JA(a,l,e,c,r),d=!0,c=XA(t,c,l,o)})));return s.add(l.onDidChangeColor((e=>{JA(a,l,e,c,r)}))),s.add(t.onDidChangeModelContent((e=>{d?d=!1:(o.hide(),t.focus())}))),s}function XA(e,t,i,n){let o,s;if(i.presentation.textEdit){o=[i.presentation.textEdit],s=new tc(i.presentation.textEdit.range.startLineNumber,i.presentation.textEdit.range.startColumn,i.presentation.textEdit.range.endLineNumber,i.presentation.textEdit.range.endColumn);const t=e.getModel()._setTrackedRange(null,s,3);e.pushUndoStop(),e.executeEdits("colorpicker",o),s=e.getModel()._getTrackedRange(t)||s}else o=[{range:t,text:i.presentation.label,forceMoveMarkers:!1}],s=t.setEndPosition(t.endLineNumber,t.startColumn+i.presentation.label.length),e.pushUndoStop(),e.executeEdits("colorpicker",o);return i.presentation.additionalTextEdits&&(o=[...i.presentation.additionalTextEdits],e.executeEdits("colorpicker",o),n&&n.hide()),e.pushUndoStop(),s}async function JA(e,t,i,n,o){const s=await cA(e,{range:n,color:{red:i.rgba.r/255,green:i.rgba.g/255,blue:i.rgba.b/255,alpha:i.rgba.a}},o.provider,Rt.None);t.colorPresentations=s||[]}ZA=KA([jA(1,Tv)],ZA);var eR=i(3257),tR={};function iR(e,t){return!!e[t]}tR.styleTagTransform=Vr(),tR.setAttributes=Pr(),tR.insert=Rr().bind(null,"head"),tR.domAPI=Tr(),tR.insertStyleElement=Br(),Ir()(eR.Z,tR),eR.Z&&eR.Z.locals&&eR.Z.locals;class nR{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=iR(e.event,t.triggerModifier),this.hasSideBySideModifier=iR(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class oR{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=iR(e,t.triggerModifier)}}class sR{constructor(e,t,i,n){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=n}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function rR(e){return"altKey"===e?Ve?new sR(57,"metaKey",6,"altKey"):new sR(5,"ctrlKey",6,"altKey"):Ve?new sR(6,"altKey",57,"metaKey"):new sR(6,"altKey",5,"ctrlKey")}class aR extends T{constructor(e,t){var i;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new q),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new q),this.onExecute=this._onExecute.event,this._onCancel=this._register(new q),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=null!==(i=null==t?void 0:t.extractLineNumberFromMouseEvent)&&void 0!==i?i:e=>e.target.position?e.target.position.lineNumber:0,this._opts=rR(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration((e=>{if(e.hasChanged(77)){const e=rR(this._editor.getOption(77));if(this._opts.equals(e))return;this._opts=e,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}}))),this._register(this._editor.onMouseMove((e=>this._onEditorMouseMove(new nR(e,this._opts))))),this._register(this._editor.onMouseDown((e=>this._onEditorMouseDown(new nR(e,this._opts))))),this._register(this._editor.onMouseUp((e=>this._onEditorMouseUp(new nR(e,this._opts))))),this._register(this._editor.onKeyDown((e=>this._onEditorKeyDown(new oR(e,this._opts))))),this._register(this._editor.onKeyUp((e=>this._onEditorKeyUp(new oR(e,this._opts))))),this._register(this._editor.onMouseDrag((()=>this._resetHandler()))),this._register(this._editor.onDidChangeCursorSelection((e=>this._onDidChangeCursorSelection(e)))),this._register(this._editor.onDidChangeModel((e=>this._resetHandler()))),this._register(this._editor.onDidChangeModelContent((()=>this._resetHandler()))),this._register(this._editor.onDidScrollChange((e=>{(e.scrollTopChanged||e.scrollLeftChanged)&&this._resetHandler()})))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var lR=i(8881),hR={};hR.styleTagTransform=Vr(),hR.setAttributes=Pr(),hR.insert=Rr().bind(null,"head"),hR.domAPI=Tr(),hR.insertStyleElement=Br(),Ir()(lR.Z,hR),lR.Z&&lR.Z.locals&&lR.Z.locals;const dR=hh("markerDecorationsService");let cR=class{constructor(e,t){}dispose(){}};cR.ID="editor.contrib.markerDecorations",cR=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,dR)],cR),Gd(cR.ID,cR,0);var uR=i(7337),gR={};gR.styleTagTransform=Vr(),gR.setAttributes=Pr(),gR.insert=Rr().bind(null,"head"),gR.domAPI=Tr(),gR.insertStyleElement=Br(),Ir()(uR.Z,gR),uR.Z&&uR.Z.locals&&uR.Z.locals;class pR extends T{constructor(e,t){super(),this._onDidChange=this._register(new q),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null;const t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()};let i=!1,n=!1;const o=()=>{if(i&&!n)try{i=!1,n=!0,t()}finally{Ls(as(this._referenceDomElement),(()=>{n=!1,o()}))}};this._resizeObserver=new ResizeObserver((t=>{e=t&&t[0]&&t[0].contentRect?t[0].contentRect:null,i=!0,o()})),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,n=0;t?(i=t.width,n=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,n=this._referenceDomElement.clientHeight),i=Math.max(5,i),n=Math.max(5,n),this._width===i&&this._height===n||(this._width=i,this._height=n,e&&this._onDidChange.fire())}}class mR{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class fR{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(){this._createDomElements(),a.document.body.appendChild(this._container),this._readFromDomElements(),a.document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");Bx(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");Bx(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const n=document.createElement("div");Bx(n,this._bareFontInfo),n.style.fontStyle="italic",e.appendChild(n);const o=[];for(const e of this._requests){let s;0===e.type&&(s=t),2===e.type&&(s=i),1===e.type&&(s=n),s.appendChild(document.createElement("br"));const r=document.createElement("span");fR._render(r,e),s.appendChild(r),o.push(r)}this._container=e,this._testElements=o}static _render(e,t){if(" "===t.chr){let t=" ";for(let e=0;e<8;e++)t+=t;e.innerText=t}else{let i=t.chr;for(let e=0;e<8;e++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e<t;e++){const t=this._requests[e],i=this._testElements[e];t.fulfill(i.offsetWidth/256)}}}const _R=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new q,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(e){e=Math.min(Math.max(-5,e),20),this._zoomLevel!==e&&(this._zoomLevel=e,this._onDidChangeZoomLevel.fire(this._zoomLevel))}},vR=Ve?1.5:1.35;class bR{static createFromValidatedSettings(e,t,i){const n=e.get(49),o=e.get(53),s=e.get(52),r=e.get(51),a=e.get(54),l=e.get(66),h=e.get(63);return bR._create(n,o,s,r,a,l,h,t,i)}static _create(e,t,i,n,o,s,r,a,l){0===s?s=vR*i:s<8&&(s*=i),(s=Math.round(s))<8&&(s=8);const h=1+(l?0:.1*_R.getZoomLevel());return i*=h,s*=h,o===xk.TRANSLATE&&("normal"===t||"bold"===t?o=xk.OFF:(o=`'wght' ${parseInt(t,10)}`,t="normal")),new bR({pixelRatio:a,fontFamily:e,fontWeight:t,fontSize:i,fontFeatureSettings:n,fontVariationSettings:o,lineHeight:s,letterSpacing:r})}constructor(e){this._bareFontInfoBrand=void 0,this.pixelRatio=e.pixelRatio,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.fontFeatureSettings=e.fontFeatureSettings,this.fontVariationSettings=e.fontVariationSettings,this.lineHeight=0|e.lineHeight,this.letterSpacing=e.letterSpacing}getId(){return`${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`}getMassagedFontFamily(){const e=Vk.fontFamily,t=bR._wrapInQuotes(this.fontFamily);return e&&this.fontFamily!==e?`${t}, ${e}`:t}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}}class wR extends bR{constructor(e,t){super(e),this._editorStylingBrand=void 0,this.version=2,this.isTrusted=t,this.isMonospace=e.isMonospace,this.typicalHalfwidthCharacterWidth=e.typicalHalfwidthCharacterWidth,this.typicalFullwidthCharacterWidth=e.typicalFullwidthCharacterWidth,this.canUseHalfwidthRightwardsArrow=e.canUseHalfwidthRightwardsArrow,this.spaceWidth=e.spaceWidth,this.middotWidth=e.middotWidth,this.wsmiddotWidth=e.wsmiddotWidth,this.maxDigitWidth=e.maxDigitWidth}equals(e){return this.fontFamily===e.fontFamily&&this.fontWeight===e.fontWeight&&this.fontSize===e.fontSize&&this.fontFeatureSettings===e.fontFeatureSettings&&this.fontVariationSettings===e.fontVariationSettings&&this.lineHeight===e.lineHeight&&this.letterSpacing===e.letterSpacing&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.typicalFullwidthCharacterWidth===e.typicalFullwidthCharacterWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.maxDigitWidth===e.maxDigitWidth}}class CR{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map((e=>this._values[e]))}}const yR=new class extends T{constructor(){super(),this._onDidChange=this._register(new q),this.onDidChange=this._onDidChange.event,this._cache=new CR,this._evictUntrustedReadingsTimeout=-1}dispose(){-1!==this._evictUntrustedReadingsTimeout&&(clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache=new CR,this._onDidChange.fire()}_writeToCache(e,t){this._cache.put(e,t),t.isTrusted||-1!==this._evictUntrustedReadingsTimeout||(this._evictUntrustedReadingsTimeout=r.setTimeout((()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()}),5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(const i of e)i.isTrusted||(t=!0,this._cache.remove(i));t&&this._onDidChange.fire()}readFontInfo(e){if(!this._cache.has(e)){let t=this._actualReadFontInfo(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new wR({pixelRatio:oe.value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:t.isMonospace,typicalHalfwidthCharacterWidth:Math.max(t.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(t.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:t.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(t.spaceWidth,5),middotWidth:Math.max(t.middotWidth,5),wsmiddotWidth:Math.max(t.wsmiddotWidth,5),maxDigitWidth:Math.max(t.maxDigitWidth,5)},!1)),this._writeToCache(e,t)}return this._cache.get(e)}_createRequest(e,t,i,n){const o=new mR(e,t);return i.push(o),null==n||n.push(o),o}_actualReadFontInfo(e){const t=[],i=[],n=this._createRequest("n",0,t,i),o=this._createRequest("m",0,t,null),s=this._createRequest(" ",0,t,i),r=this._createRequest("0",0,t,i),a=this._createRequest("1",0,t,i),l=this._createRequest("2",0,t,i),h=this._createRequest("3",0,t,i),d=this._createRequest("4",0,t,i),c=this._createRequest("5",0,t,i),u=this._createRequest("6",0,t,i),g=this._createRequest("7",0,t,i),p=this._createRequest("8",0,t,i),m=this._createRequest("9",0,t,i),f=this._createRequest("→",0,t,i),_=this._createRequest("→",0,t,null),v=this._createRequest("·",0,t,i),b=this._createRequest(String.fromCharCode(11825),0,t,null),w="|/-_ilm%";for(let e=0,n=8;e<n;e++)this._createRequest(w.charAt(e),0,t,i),this._createRequest(w.charAt(e),1,t,i),this._createRequest(w.charAt(e),2,t,i);!function(e,t){new fR(e,t).read()}(e,t);const C=Math.max(r.width,a.width,l.width,h.width,d.width,c.width,u.width,g.width,p.width,m.width);let y=e.fontFeatureSettings===Lk.OFF;const S=i[0].width;for(let e=1,t=i.length;y&&e<t;e++){const t=S-i[e].width;if(t<-.001||t>.001){y=!1;break}}let k=!0;return y&&_.width!==S&&(k=!1),_.width>f.width&&(k=!1),new wR({pixelRatio:oe.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,fontVariationSettings:e.fontVariationSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:y,typicalHalfwidthCharacterWidth:n.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:k,spaceWidth:s.width,middotWidth:v.width,wsmiddotWidth:b.width,maxDigitWidth:C},!0)}};class SR{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=SR._read(e,this.key);this.migrate(t,(t=>SR._read(e,t)),((t,i)=>SR._write(e,t,i)))}static _read(e,t){if(void 0===e)return;const i=t.indexOf(".");if(i>=0){const n=t.substring(0,i);return this._read(e[n],t.substring(i+1))}return e[t]}static _write(e,t,i){const n=t.indexOf(".");if(n>=0){const o=t.substring(0,n);return e[o]=e[o]||{},void this._write(e[o],t.substring(n+1),i)}e[t]=i}}function kR(e,t){SR.items.push(new SR(e,t))}function LR(e,t){kR(e,((i,n,o)=>{if(void 0!==i)for(const[n,s]of t)if(i===n)return void o(e,s)}))}SR.items=[],LR("wordWrap",[[!0,"on"],[!1,"off"]]),LR("lineNumbers",[[!0,"on"],[!1,"off"]]),LR("cursorBlinking",[["visible","solid"]]),LR("renderWhitespace",[[!0,"boundary"],[!1,"none"]]),LR("renderLineHighlight",[[!0,"line"],[!1,"none"]]),LR("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]),LR("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]),LR("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),LR("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),LR("autoIndent",[[!1,"advanced"],[!0,"full"]]),LR("matchBrackets",[[!0,"always"],[!1,"never"]]),LR("renderFinalNewline",[[!0,"on"],[!1,"off"]]),LR("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]),LR("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]),LR("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]),kR("autoClosingBrackets",((e,t,i)=>{!1===e&&(i("autoClosingBrackets","never"),void 0===t("autoClosingQuotes")&&i("autoClosingQuotes","never"),void 0===t("autoSurround")&&i("autoSurround","never"))})),kR("renderIndentGuides",((e,t,i)=>{void 0!==e&&(i("renderIndentGuides",void 0),void 0===t("guides.indentation")&&i("guides.indentation",!!e))})),kR("highlightActiveIndentGuide",((e,t,i)=>{void 0!==e&&(i("highlightActiveIndentGuide",void 0),void 0===t("guides.highlightActiveIndentation")&&i("guides.highlightActiveIndentation",!!e))}));const xR={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};kR("suggest.filteredTypes",((e,t,i)=>{if(e&&"object"==typeof e){for(const n of Object.entries(xR))!1===e[n[0]]&&void 0===t(`suggest.${n[1]}`)&&i(`suggest.${n[1]}`,!1);i("suggest.filteredTypes",void 0)}})),kR("quickSuggestions",((e,t,i)=>{if("boolean"==typeof e){const t=e?"on":"off";i("quickSuggestions",{comments:t,strings:t,other:t})}})),kR("experimental.stickyScroll.enabled",((e,t,i)=>{"boolean"==typeof e&&(i("experimental.stickyScroll.enabled",void 0),void 0===t("stickyScroll.enabled")&&i("stickyScroll.enabled",e))})),kR("experimental.stickyScroll.maxLineCount",((e,t,i)=>{"number"==typeof e&&(i("experimental.stickyScroll.maxLineCount",void 0),void 0===t("stickyScroll.maxLineCount")&&i("stickyScroll.maxLineCount",e))})),kR("codeActionsOnSave",((e,t,i)=>{if(e&&"object"==typeof e){let t=!1;const n={};for(const i of Object.entries(e))"boolean"==typeof i[1]?(t=!0,n[i[0]]=i[1]?"explicit":"never"):n[i[0]]=i[1];t&&i("codeActionsOnSave",n)}})),kR("codeActionWidget.includeNearbyQuickfixes",((e,t,i)=>{"boolean"==typeof e&&(i("codeActionWidget.includeNearbyQuickfixes",void 0),void 0===t("codeActionWidget.includeNearbyQuickFixes")&&i("codeActionWidget.includeNearbyQuickFixes",e))}));const DR=new class{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new q,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}};let ER=class extends T{constructor(e,t,i,n){super(),this._accessibilityService=n,this._onDidChange=this._register(new q),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new q),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new ak,this.isSimpleWidget=e,this._containerObserver=this._register(new pR(i,t.dimension)),this._rawOptions=AR(t),this._validatedOptions=TR.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(_R.onDidChangeZoomLevel((()=>this._recomputeOptions()))),this._register(DR.onDidChangeTabFocus((()=>this._recomputeOptions()))),this._register(this._containerObserver.onDidChange((()=>this._recomputeOptions()))),this._register(yR.onDidChange((()=>this._recomputeOptions()))),this._register(oe.onDidChange((()=>this._recomputeOptions()))),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized((()=>this._recomputeOptions())))}_recomputeOptions(){const e=this._computeOptions(),t=TR.checkEquals(this.options,e);null!==t&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=bR.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),n={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:DR.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return TR.computeOptions(this._validatedOptions,n)}_readEnvConfiguration(){return{extraEditorClassName:NR(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:ae||re,pixelRatio:oe.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return yR.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=AR(e);TR.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=TR.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){const t=function(e){let t=0;for(;e;)e=Math.floor(e/10),t++;return t||1}(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};function NR(){let e="";return he||de||(e+="no-user-select "),he&&(e+="no-minimap-shadow ",e+="enable-user-select "),Ve&&(e+="mac "),e}ER=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(3,BS)],ER);class IR{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class MR{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}}class TR{static validateOptions(e){const t=new IR;for(const i of zk){const n="_never_"===i.name?void 0:e[i.name];t._write(i.id,i.validate(n))}return t}static computeOptions(e,t){const i=new MR;for(const n of zk)i._write(n.id,n.compute(t,i,e._read(n.id)));return i}static _deepEquals(e,t){if("object"!=typeof e||"object"!=typeof t||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return!(!Array.isArray(e)||!Array.isArray(t))&&Ic(e,t);if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!TR._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const o of zk){const s=!TR._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=s,s&&(n=!0)}return n?new rk(i):null}static applyUpdate(e,t){let i=!1;for(const n of zk)if(t.hasOwnProperty(n.name)){const o=n.applyUpdate(e[n.name],t[n.name]);e[n.name]=o.newValue,i=i||o.didChange}return i}}function AR(e){const t=cc(e);return function(e){SR.items.forEach((t=>t.apply(e)))}(t),t}class RR extends T{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,n=e.length;i<n;i++){const n=e[i];switch(n.type){case 0:this.onCompositionStart(n)&&(t=!0);break;case 1:this.onCompositionEnd(n)&&(t=!0);break;case 2:this.onConfigurationChanged(n)&&(t=!0);break;case 3:this.onCursorStateChanged(n)&&(t=!0);break;case 4:this.onDecorationsChanged(n)&&(t=!0);break;case 5:this.onFlushed(n)&&(t=!0);break;case 6:this.onFocusChanged(n)&&(t=!0);break;case 7:this.onLanguageConfigurationChanged(n)&&(t=!0);break;case 8:this.onLineMappingChanged(n)&&(t=!0);break;case 9:this.onLinesChanged(n)&&(t=!0);break;case 10:this.onLinesDeleted(n)&&(t=!0);break;case 11:this.onLinesInserted(n)&&(t=!0);break;case 12:this.onRevealRangeRequest(n)&&(t=!0);break;case 13:this.onScrollChanged(n)&&(t=!0);break;case 15:this.onTokensChanged(n)&&(t=!0);break;case 14:this.onThemeChanged(n)&&(t=!0);break;case 16:this.onTokensColorsChanged(n)&&(t=!0);break;case 17:this.onZonesChanged(n)&&(t=!0);break;default:console.info("View received unknown event: "),console.info(n)}}t&&(this._shouldRender=!0)}}class OR extends RR{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class PR{static write(e,t){e.setAttribute("data-mprt",String(t))}static read(e){const t=e.getAttribute("data-mprt");return null===t?0:parseInt(t,10)}static collect(e,t){const i=[];let n=0;for(;e&&e!==e.ownerDocument.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(i[n++]=this.read(e)),e=e.parentElement;const o=new Uint8Array(n);for(let e=0;e<n;e++)o[e]=i[n-e-1];return o}}class FR{constructor(e,t){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;const i=this._viewLayout.getCurrentViewport();this.scrollTop=i.top,this.scrollLeft=i.left,this.viewportWidth=i.width,this.viewportHeight=i.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e,t){return this._viewLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t){return this._viewLayout.getVerticalOffsetAfterLineNumber(e,t)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class BR extends FR{constructor(e,t,i){super(e,t),this._renderingContextBrand=void 0,this._viewLines=i}linesVisibleRangesForRange(e,t){return this._viewLines.linesVisibleRangesForRange(e,t)}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)}}class WR{constructor(e,t,i,n){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=n}}class VR{static from(e){const t=new Array(e.length);for(let i=0,n=e.length;i<n;i++){const n=e[i];t[i]=new VR(n.left,n.width)}return t}constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}toString(){return`[${this.left},${this.width}]`}}class zR{constructor(e,t){this._floatHorizontalRangeBrand=void 0,this.left=e,this.width=t}toString(){return`[${this.left},${this.width}]`}static compare(e,t){return e.left-t.left}}class HR{constructor(e,t){this.outsideRenderedLine=e,this.originalLeft=t,this.left=Math.round(this.originalLeft)}}class UR{constructor(e,t){this.outsideRenderedLine=e,this.ranges=t}}class KR{static _createRange(){return this._handyReadyRange||(this._handyReadyRange=document.createRange()),this._handyReadyRange}static _detachRange(e,t){e.selectNodeContents(t)}static _readClientRects(e,t,i,n,o){const s=this._createRange();try{return s.setStart(e,t),s.setEnd(i,n),s.getClientRects()}catch(e){return null}finally{this._detachRange(s,o)}}static _mergeAdjacentRanges(e){if(1===e.length)return e;e.sort(zR.compare);const t=[];let i=0,n=e[0];for(let o=1,s=e.length;o<s;o++){const s=e[o];n.left+n.width+.9>=s.left?n.width=Math.max(n.width,s.left+s.width-n.left):(t[i++]=n,n=s)}return t[i++]=n,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||0===e.length)return null;const n=[];for(let o=0,s=e.length;o<s;o++){const s=e[o];n[o]=new zR(Math.max(0,(s.left-t)/i),s.width/i)}return this._mergeAdjacentRanges(n)}static readHorizontalRanges(e,t,i,n,o,s){const r=e.children.length-1;if(0>r)return null;if((t=Math.min(r,Math.max(0,t)))===(n=Math.min(r,Math.max(0,n)))&&i===o&&0===i&&!e.children[t].firstChild){const i=e.children[t].getClientRects();return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(i,s.clientRectDeltaLeft,s.clientRectScale)}t!==n&&n>0&&0===o&&(n--,o=1073741824);let a=e.children[t].firstChild,l=e.children[n].firstChild;if(a&&l||(!a&&0===i&&t>0&&(a=e.children[t-1].firstChild,i=1073741824),!l&&0===o&&n>0&&(l=e.children[n-1].firstChild,o=1073741824)),!a||!l)return null;i=Math.min(a.textContent.length,Math.max(0,i)),o=Math.min(l.textContent.length,Math.max(0,o));const h=this._readClientRects(a,i,l,o,s.endNode);return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,s.clientRectDeltaLeft,s.clientRectScale)}}class jR{constructor(e,t,i,n){this.startColumn=e,this.endColumn=t,this.className=i,this.type=n,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(!jR._equals(e[n],t[n]))return!1;return!0}static extractWrapped(e,t,i){if(0===e.length)return e;const n=t+1,o=i+1,s=i-t,r=[];let a=0;for(const t of e)t.endColumn<=n||t.startColumn>=o||(r[a++]=new jR(Math.max(1,t.startColumn-n+1),Math.min(s+1,t.endColumn-n+1),t.className,t.type));return r}static filter(e,t,i,n){if(0===e.length)return[];const o=[];let s=0;for(let r=0,a=e.length;r<a;r++){const a=e[r],l=a.range;if(l.endLineNumber<t||l.startLineNumber>t)continue;if(l.isEmpty()&&(0===a.type||3===a.type))continue;const h=l.startLineNumber===t?l.startColumn:i,d=l.endLineNumber===t?l.endColumn:n;o[s++]=new jR(h,d,a.inlineClassName,a.type)}return o}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const i=jR._typeCompare(e.type,t.type);return 0!==i?i:e.className!==t.className?e.className<t.className?-1:1:0}}class qR{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.className=i,this.metadata=n}}class $R{constructor(){this.stopOffsets=[],this.classNames=[],this.metadata=[],this.count=0}static _metadata(e){let t=0;for(let i=0,n=e.length;i<n;i++)t|=e[i];return t}consumeLowerThan(e,t,i){for(;this.count>0&&this.stopOffsets[0]<e;){let e=0;for(;e+1<this.count&&this.stopOffsets[e]===this.stopOffsets[e+1];)e++;i.push(new qR(t,this.stopOffsets[e],this.classNames.join(" "),$R._metadata(this.metadata))),t=this.stopOffsets[e]+1,this.stopOffsets.splice(0,e+1),this.classNames.splice(0,e+1),this.metadata.splice(0,e+1),this.count-=e+1}return this.count>0&&t<e&&(i.push(new qR(t,e-1,this.classNames.join(" "),$R._metadata(this.metadata))),t=e),t}insert(e,t,i){if(0===this.count||this.stopOffsets[this.count-1]<=e)this.stopOffsets.push(e),this.classNames.push(t),this.metadata.push(i);else for(let n=0;n<this.count;n++)if(this.stopOffsets[n]>=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t),this.metadata.splice(n,0,i);break}this.count++}}class GR{static normalize(e,t){if(0===t.length)return[];const i=[],n=new $R;let o=0;for(let s=0,r=t.length;s<r;s++){const r=t[s];let a=r.startColumn,l=r.endColumn;const h=r.className,d=1===r.type?2:2===r.type?4:0;a>1&&In(e.charCodeAt(a-2))&&a--,l>1&&In(e.charCodeAt(l-2))&&l--;const c=a-1,u=l-2;o=n.consumeLowerThan(c,o,i),0===n.count&&(o=c),n.insert(u,h,d)}return n.consumeLowerThan(1073741824,o,i),i}}class ZR{constructor(e,t,i,n){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=n,this._linePartBrand=void 0}isWhitespace(){return!!(1&this.metadata)}isPseudoAfter(){return!!(4&this.metadata)}}class YR{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class QR{constructor(e,t,i,n,o,s,r,a,l,h,d,c,u,g,p,m,f,_,v){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=o,this.containsRTL=s,this.fauxIndentLength=r,this.lineTokens=a,this.lineDecorations=l.sort(jR.compare),this.tabSize=h,this.startVisibleColumn=d,this.spaceWidth=c,this.stopRenderingLineAfter=p,this.renderWhitespace="all"===m?4:"boundary"===m?1:"selection"===m?2:"trailing"===m?3:0,this.renderControlCharacters=f,this.fontLigatures=_,this.selectionsOnLine=v&&v.sort(((e,t)=>e.startOffset<t.startOffset?-1:1)),Math.abs(g-c)<Math.abs(u-c)?(this.renderSpaceWidth=g,this.renderSpaceCharCode=11825):(this.renderSpaceWidth=u,this.renderSpaceCharCode=183)}sameSelection(e){if(null===this.selectionsOnLine)return null===e;if(null===e)return!1;if(e.length!==this.selectionsOnLine.length)return!1;for(let t=0;t<this.selectionsOnLine.length;t++)if(!this.selectionsOnLine[t].equals(e[t]))return!1;return!0}equals(e){return this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineContent===e.lineContent&&this.continuesWithWrappedLine===e.continuesWithWrappedLine&&this.isBasicASCII===e.isBasicASCII&&this.containsRTL===e.containsRTL&&this.fauxIndentLength===e.fauxIndentLength&&this.tabSize===e.tabSize&&this.startVisibleColumn===e.startVisibleColumn&&this.spaceWidth===e.spaceWidth&&this.renderSpaceWidth===e.renderSpaceWidth&&this.renderSpaceCharCode===e.renderSpaceCharCode&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.fontLigatures===e.fontLigatures&&jR.equalsArr(this.lineDecorations,e.lineDecorations)&&this.lineTokens.equals(e.lineTokens)&&this.sameSelection(e.selectionsOnLine)}}class XR{constructor(e,t){this.partIndex=e,this.charIndex=t}}class JR{static getPartIndex(e){return(4294901760&e)>>>16}static getCharIndex(e){return(65535&e)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,n){const o=(t<<16|i<<0)>>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=n}getHorizontalOffset(e){return 0===this._horizontalOffset.length?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return 0===this.length?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),i=JR.getPartIndex(t),n=JR.getCharIndex(t);return new XR(i,n)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(0===this.length)return 0;const n=(e<<16|i<<0)>>>0;let o=0,s=this.length-1;for(;o+1<s;){const e=o+s>>>1,t=this._data[e];if(t===n)return e;t>n?s=e:o=e}if(o===s)return o;const r=this._data[o],a=this._data[s];if(r===n)return o;if(a===n)return s;const l=JR.getPartIndex(r),h=JR.getCharIndex(r);let d;return d=l!==JR.getPartIndex(a)?t:JR.getCharIndex(a),i-h<=d-i?o:s}}class eO{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function tO(e,t){if(0===e.lineContent.length){if(e.lineDecorations.length>0){t.appendString("<span>");let i=0,n=0,o=0;for(const s of e.lineDecorations)1!==s.type&&2!==s.type||(t.appendString('<span class="'),t.appendString(s.className),t.appendString('"></span>'),1===s.type&&(o|=1,i++),2===s.type&&(o|=2,n++));t.appendString("</span>");const s=new JR(1,i+n);return s.setColumnInfo(1,i,0,0),new eO(s,!1,o)}return t.appendString("<span><span></span></span>"),new eO(new JR(0,0),!1,0)}return function(e,t){const i=e.fontIsMonospace,n=e.canUseHalfwidthRightwardsArrow,o=e.containsForeignElements,s=e.lineContent,r=e.len,a=e.isOverflowing,l=e.overflowingCharCount,h=e.parts,d=e.fauxIndentLength,c=e.tabSize,u=e.startVisibleColumn,g=e.containsRTL,p=e.spaceWidth,m=e.renderSpaceCharCode,f=e.renderWhitespace,_=e.renderControlCharacters,v=new JR(r+1,h.length);let b=!1,w=0,C=u,y=0,S=0,k=0;g?t.appendString('<span dir="ltr">'):t.appendString("<span>");for(let e=0,a=h.length;e<a;e++){const a=h[e],l=a.endIndex,u=a.type,g=a.containsRTL,L=0!==f&&a.isWhitespace(),x=L&&!i&&("mtkw"===u||!o),D=w===l&&a.isPseudoAfter();if(y=0,t.appendString("<span "),g&&t.appendString('style="unicode-bidi:isolate" '),t.appendString('class="'),t.appendString(x?"mtkz":u),t.appendASCIICharCode(34),L){let i=0;{let e=w,t=C;for(;e<l;e++){const n=0|(9===s.charCodeAt(e)?c-t%c:1);i+=n,e>=d&&(t+=n)}}for(x&&(t.appendString(' style="width:'),t.appendString(String(p*i)),t.appendString('px"')),t.appendASCIICharCode(62);w<l;w++){let i,o;if(v.setColumnInfo(w+1,e-k,y,S),k=0,9===s.charCodeAt(w)){i=c-C%c|0,o=i,!n||o>1?t.appendCharCode(8594):t.appendCharCode(65515);for(let e=2;e<=o;e++)t.appendCharCode(160)}else i=2,o=1,t.appendCharCode(m),t.appendCharCode(8204);y+=i,S+=o,w>=d&&(C+=o)}}else for(t.appendASCIICharCode(62);w<l;w++){v.setColumnInfo(w+1,e-k,y,S),k=0;const i=s.charCodeAt(w);let n=1,o=1;switch(i){case 9:n=c-C%c,o=n;for(let e=1;e<=n;e++)t.appendCharCode(160);break;case 32:t.appendCharCode(160);break;case 60:t.appendString("&lt;");break;case 62:t.appendString("&gt;");break;case 38:t.appendString("&amp;");break;case 0:_?t.appendCharCode(9216):t.appendString("&#00;");break;case 65279:case 8232:case 8233:case 133:t.appendCharCode(65533);break;default:Kn(i)&&o++,_&&i<32?t.appendCharCode(9216+i):_&&127===i?t.appendCharCode(9249):_&&sO(i)?(t.appendString("[U+"),t.appendString(i.toString(16).toUpperCase().padStart(4,"0")),t.appendString("]"),n=8,o=n):t.appendCharCode(i)}y+=n,S+=o,w>=d&&(C+=o)}D?k++:k=0,w>=r&&!b&&a.isPseudoAfter()&&(b=!0,v.setColumnInfo(w+1,e,y,S)),t.appendString("</span>")}return b||v.setColumnInfo(r+1,h.length-1,y,S),a&&(t.appendString('<span class="mtkoverflow">'),t.appendString(me(0,"Show more ({0})",function(e){return e<1024?me(0,"{0} chars",e):e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}(l))),t.appendString("</span>")),t.appendString("</span>"),new eO(v,g,o)}(function(e){const t=e.lineContent;let i,n,o;-1!==e.stopRenderingLineAfter&&e.stopRenderingLineAfter<t.length?(i=!0,n=t.length-e.stopRenderingLineAfter,o=e.stopRenderingLineAfter):(i=!1,n=0,o=t.length);let s=function(e,t,i,n,o){const s=[];let r=0;n>0&&(s[r++]=new ZR(n,"",0,!1));let a=n;for(let l=0,h=i.getCount();l<h;l++){const h=i.getEndOffset(l);if(h<=n)continue;const d=i.getClassName(l);if(h>=o){const i=!!t&&Wn(e.substring(a,o));s[r++]=new ZR(o,d,0,i);break}const c=!!t&&Wn(e.substring(a,h));s[r++]=new ZR(h,d,0,c),a=h}return s}(t,e.containsRTL,e.lineTokens,e.fauxIndentLength,o);e.renderControlCharacters&&!e.isBasicASCII&&(s=function(e,t){const i=[];let n=new ZR(0,"",0,!1),o=0;for(const s of t){const t=s.endIndex;for(;o<t;o++)sO(e.charCodeAt(o))&&(o>n.endIndex&&(n=new ZR(o,s.type,s.metadata,s.containsRTL),i.push(n)),n=new ZR(o+1,"mtkcontrol",s.metadata,!1),i.push(n));o>n.endIndex&&(n=new ZR(t,s.type,s.metadata,s.containsRTL),i.push(n))}return i}(t,s)),(4===e.renderWhitespace||1===e.renderWhitespace||2===e.renderWhitespace&&e.selectionsOnLine||3===e.renderWhitespace&&!e.continuesWithWrappedLine)&&(s=function(e,t,i,n){const o=e.continuesWithWrappedLine,s=e.fauxIndentLength,r=e.tabSize,a=e.startVisibleColumn,l=e.useMonospaceOptimizations,h=e.selectionsOnLine,d=1===e.renderWhitespace,c=3===e.renderWhitespace,u=e.renderSpaceWidth!==e.spaceWidth,g=[];let p=0,m=0,f=n[m].type,_=n[m].containsRTL,v=n[m].endIndex;const b=n.length;let w,C=!1,y=fn(t);-1===y?(C=!0,y=i,w=i):w=vn(t);let S=!1,k=0,L=h&&h[k],x=a%r;for(let e=s;e<i;e++){const o=t.charCodeAt(e);let a;if(L&&e>=L.endOffset&&(k++,L=h&&h[k]),e<y||e>w)a=!0;else if(9===o)a=!0;else if(32===o)if(d)if(S)a=!0;else{const n=e+1<i?t.charCodeAt(e+1):0;a=32===n||9===n}else a=!0;else a=!1;if(a&&h&&(a=!!L&&L.startOffset<=e&&L.endOffset>e),a&&c&&(a=C||e>w),a&&_&&e>=y&&e<=w&&(a=!1),S){if(!a||!l&&x>=r){if(u)for(let t=(p>0?g[p-1].endIndex:s)+1;t<=e;t++)g[p++]=new ZR(t,"mtkw",1,!1);else g[p++]=new ZR(e,"mtkw",1,!1);x%=r}}else(e===v||a&&e>s)&&(g[p++]=new ZR(e,f,0,_),x%=r);for(9===o?x=r:Kn(o)?x+=2:x++,S=a;e===v&&(m++,m<b);)f=n[m].type,_=n[m].containsRTL,v=n[m].endIndex}let D=!1;if(S)if(o&&d){const e=i>0?t.charCodeAt(i-1):0,n=i>1?t.charCodeAt(i-2):0;32===e&&32!==n&&9!==n||(D=!0)}else D=!0;if(D)if(u)for(let e=(p>0?g[p-1].endIndex:s)+1;e<=i;e++)g[p++]=new ZR(e,"mtkw",1,!1);else g[p++]=new ZR(i,"mtkw",1,!1);else g[p++]=new ZR(i,f,0,_);return g}(e,t,o,s));let r=0;if(e.lineDecorations.length>0){for(let t=0,i=e.lineDecorations.length;t<i;t++){const i=e.lineDecorations[t];3===i.type||1===i.type?r|=1:2===i.type&&(r|=2)}s=function(e,t,i,n){n.sort(jR.compare);const o=GR.normalize(e,n),s=o.length;let r=0;const a=[];let l=0,h=0;for(let e=0,t=i.length;e<t;e++){const t=i[e],n=t.endIndex,d=t.type,c=t.metadata,u=t.containsRTL;for(;r<s&&o[r].startOffset<n;){const e=o[r];if(e.startOffset>h&&(h=e.startOffset,a[l++]=new ZR(h,d,c,u)),!(e.endOffset+1<=n)){h=n,a[l++]=new ZR(h,d+" "+e.className,c|e.metadata,u);break}h=e.endOffset+1,a[l++]=new ZR(h,d+" "+e.className,c|e.metadata,u),r++}n>h&&(h=n,a[l++]=new ZR(h,d,c,u))}const d=i[i.length-1].endIndex;if(r<s&&o[r].startOffset===d)for(;r<s&&o[r].startOffset===d;){const e=o[r];a[l++]=new ZR(h,e.className,e.metadata,!1),r++}return a}(t,0,s,e.lineDecorations)}return e.containsRTL||(s=function(e,t,i){let n=0;const o=[];let s=0;if(i)for(let i=0,r=t.length;i<r;i++){const r=t[i],a=r.endIndex;if(n+50<a){const t=r.type,i=r.metadata,l=r.containsRTL;let h=-1,d=n;for(let r=n;r<a;r++)32===e.charCodeAt(r)&&(h=r),-1!==h&&r-d>=50&&(o[s++]=new ZR(h+1,t,i,l),d=h+1,h=-1);d!==a&&(o[s++]=new ZR(a,t,i,l))}else o[s++]=r;n=a}else for(let e=0,i=t.length;e<i;e++){const i=t[e],r=i.endIndex,a=r-n;if(a>50){const e=i.type,t=i.metadata,l=i.containsRTL,h=Math.ceil(a/50);for(let i=1;i<h;i++){const r=n+50*i;o[s++]=new ZR(r,e,t,l)}o[s++]=new ZR(r,e,t,l)}else o[s++]=i;n=r}return o}(t,s,!e.isBasicASCII||e.fontLigatures)),new oO(e.useMonospaceOptimizations,e.canUseHalfwidthRightwardsArrow,t,o,i,n,s,r,e.fauxIndentLength,e.tabSize,e.startVisibleColumn,e.containsRTL,e.spaceWidth,e.renderSpaceCharCode,e.renderWhitespace,e.renderControlCharacters)}(e),t)}class iO{constructor(e,t,i,n){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=n}}function nO(e){const t=new Xu(1e4),i=tO(e,t);return new iO(i.characterMapping,t.build(),i.containsRTL,i.containsForeignElements)}class oO{constructor(e,t,i,n,o,s,r,a,l,h,d,c,u,g,p,m){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,this.isOverflowing=o,this.overflowingCharCount=s,this.parts=r,this.containsForeignElements=a,this.fauxIndentLength=l,this.tabSize=h,this.startVisibleColumn=d,this.containsRTL=c,this.spaceWidth=u,this.renderSpaceCharCode=g,this.renderWhitespace=p,this.renderControlCharacters=m}}function sO(e){return e<32?9!==e:127===e||e>=8234&&e<=8238||e>=8294&&e<=8297||e>=8206&&e<=8207||1564===e}const rO=!!He||!(ze||re||he);let aO=!0;class lO{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(50),o=i.get(38);this.renderWhitespace="off"===o?i.get(98):"none",this.renderControlCharacters=i.get(93),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(33),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(66),this.stopRenderingLineAfter=i.get(116),this.fontLigatures=i.get(51)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}class hO{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(!this._renderedViewLine)throw new Error("I have no rendered view line to set the dom node to...");this._renderedViewLine.domNode=Fx(e)}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return!(!Iv(this._options.themeType)&&"selection"!==this._options.renderWhitespace||(this._isMaybeInvalid=!0,0))}renderLine(e,t,i,n){if(!1===this._isMaybeInvalid)return!1;this._isMaybeInvalid=!1;const o=i.getViewLineRenderingData(e),s=this._options,r=jR.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let a=null;if(Iv(s.themeType)||"selection"===this._options.renderWhitespace){const t=i.selections;for(const i of t){if(i.endLineNumber<e||i.startLineNumber>e)continue;const t=i.startLineNumber===e?i.startColumn:o.minColumn,n=i.endLineNumber===e?i.endColumn:o.maxColumn;t<n&&(Iv(s.themeType)&&r.push(new jR(t,n,"inline-selected-text",0)),"selection"===this._options.renderWhitespace&&(a||(a=[]),a.push(new YR(t-1,n-1))))}}const l=new QR(s.useMonospaceOptimizations,s.canUseHalfwidthRightwardsArrow,o.content,o.continuesWithWrappedLine,o.isBasicASCII,o.containsRTL,o.minColumn-1,o.tokens,r,o.tabSize,o.startVisibleColumn,s.spaceWidth,s.middotWidth,s.wsmiddotWidth,s.stopRenderingLineAfter,s.renderWhitespace,s.renderControlCharacters,s.fontLigatures!==Lk.OFF,a);if(this._renderedViewLine&&this._renderedViewLine.input.equals(l))return!1;n.appendString('<div style="top:'),n.appendString(String(t)),n.appendString("px;height:"),n.appendString(String(this._options.lineHeight)),n.appendString('px;" class="'),n.appendString(hO.CLASS_NAME),n.appendString('">');const h=tO(l,n);n.appendString("</div>");let d=null;return aO&&rO&&o.isBasicASCII&&s.useMonospaceOptimizations&&0===h.containsForeignElements&&(d=new dO(this._renderedViewLine?this._renderedViewLine.domNode:null,l,h.characterMapping)),d||(d=gO(this._renderedViewLine?this._renderedViewLine.domNode:null,l,h.characterMapping,h.containsRTL,h.containsForeignElements)),this._renderedViewLine=d,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return!this._renderedViewLine||this._renderedViewLine.getWidthIsFast()}needsMonospaceFontCheck(){return!!this._renderedViewLine&&this._renderedViewLine instanceof dO}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof dO?this._renderedViewLine.monospaceAssumptionsAreValid():aO}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof dO&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,n){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const o=this._renderedViewLine.input.stopRenderingLineAfter;if(-1!==o&&t>o+1&&i>o+1)return new UR(!0,[new zR(this.getWidth(n),0)]);-1!==o&&t>o+1&&(t=o+1),-1!==o&&i>o+1&&(i=o+1);const s=this._renderedViewLine.getVisibleRangesForRange(e,t,i,n);return s&&s.length>0?new UR(!1,s):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}hO.CLASS_NAME="view-line";class dO{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const n=Math.floor(t.lineContent.length/300);if(n>0){this._keyColumnPixelOffsetCache=new Float32Array(n);for(let e=0;e<n;e++)this._keyColumnPixelOffsetCache[e]=-1}else this._keyColumnPixelOffsetCache=null;this._characterMapping=i,this._charWidth=t.spaceWidth}getWidth(e){if(!this.domNode||this.input.lineContent.length<300){const e=this._characterMapping.getHorizontalOffset(this._characterMapping.length);return Math.round(this._charWidth*e)}return-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,null==e||e.markDidDomLayout()),this._cachedWidth}getWidthIsFast(){return this.input.lineContent.length<300||-1!==this._cachedWidth}monospaceAssumptionsAreValid(){if(!this.domNode)return aO;if(this.input.lineContent.length<300){const e=this.getWidth(null),t=this.domNode.domNode.firstChild.offsetWidth;Math.abs(e-t)>=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),aO=!1)}return aO}toSlowRenderedLine(){return gO(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,n){const o=this._getColumnPixelOffset(e,t,n),s=this._getColumnPixelOffset(e,i,n);return[new zR(o,s-o)]}_getColumnPixelOffset(e,t,i){if(t<=300){const e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}const n=Math.floor((t-1)/300)-1,o=300*(n+1)+1;let s=-1;if(this._keyColumnPixelOffsetCache&&(s=this._keyColumnPixelOffsetCache[n],-1===s&&(s=this._actualReadPixelOffset(e,o,i),this._keyColumnPixelOffsetCache[n]=s)),-1===s){const e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}const r=this._characterMapping.getHorizontalOffset(o),a=this._characterMapping.getHorizontalOffset(t);return s+this._charWidth*(a-r)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const n=this._characterMapping.getDomPosition(t),o=KR.readHorizontalRanges(this._getReadingTarget(this.domNode),n.partIndex,n.charIndex,n.partIndex,n.charIndex,i);return o&&0!==o.length?o[0].left:-1}getColumnOfNodeOffset(e,t){return pO(this._characterMapping,e,t)}}class cO{constructor(e,t,i,n,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!n||0===this._characterMapping.length){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let e=0,t=this._characterMapping.length;e<=t;e++)this._pixelOffsetCache[e]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,null==e||e.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return-1!==this._cachedWidth}getVisibleRangesForRange(e,t,i,n){if(!this.domNode)return null;if(null!==this._pixelOffsetCache){const o=this._readPixelOffset(this.domNode,e,t,n);if(-1===o)return null;const s=this._readPixelOffset(this.domNode,e,i,n);return-1===s?null:[new zR(o,s-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,o){if(i===n){const n=this._readPixelOffset(e,t,i,o);return-1===n?null:[new zR(n,0)]}return this._readRawVisibleRangesForRange(e,i,n,o)}_readPixelOffset(e,t,i,n){if(0===this._characterMapping.length){if(0===this._containsForeignElements)return 0;if(2===this._containsForeignElements)return 0;if(1===this._containsForeignElements)return this.getWidth(n);const t=this._getReadingTarget(e);return t.firstChild?(n.markDidDomLayout(),t.firstChild.offsetWidth):0}if(null!==this._pixelOffsetCache){const o=this._pixelOffsetCache[i];if(-1!==o)return o;const s=this._actualReadPixelOffset(e,t,i,n);return this._pixelOffsetCache[i]=s,s}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(0===this._characterMapping.length){const t=KR.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,n);return t&&0!==t.length?t[0].left:-1}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&0===this._containsForeignElements)return this.getWidth(n);const o=this._characterMapping.getDomPosition(i),s=KR.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,n);if(!s||0===s.length)return-1;const r=s[0].left;if(this.input.isBasicASCII){const e=this._characterMapping.getHorizontalOffset(i),t=Math.round(this.input.spaceWidth*e);if(Math.abs(t-r)<=1)return t}return r}_readRawVisibleRangesForRange(e,t,i,n){if(1===t&&i===this._characterMapping.length)return[new zR(0,this.getWidth(n))];const o=this._characterMapping.getDomPosition(t),s=this._characterMapping.getDomPosition(i);return KR.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,s.partIndex,s.charIndex,n)}getColumnOfNodeOffset(e,t){return pO(this._characterMapping,e,t)}}class uO extends cO{_readVisibleRangesForRange(e,t,i,n,o){const s=super._readVisibleRangesForRange(e,t,i,n,o);if(!s||0===s.length||i===n||1===i&&n===this._characterMapping.length)return s;if(!this.input.containsRTL){const i=this._readPixelOffset(e,t,n,o);if(-1!==i){const e=s[s.length-1];e.left<i&&(e.width=i-e.left)}}return s}}const gO=ae?function(e,t,i,n,o){return new uO(e,t,i,n,o)}:function(e,t,i,n,o){return new cO(e,t,i,n,o)};function pO(e,t,i){const n=t.textContent.length;let o=-1;for(;t;)t=t.previousSibling,o++;return e.getColumn(new XR(o,i),n)}class mO{constructor(e=null){this.hitTarget=e,this.type=0}}class fO{constructor(e,t,i){this.position=e,this.spanNode=t,this.injectedText=i,this.type=1}}var _O;!function(e){e.createFromDOMInfo=function(e,t,i){const n=e.getPositionFromDOMInfo(t,i);return n?new fO(n,t,null):new mO(t)}}(_O||(_O={}));class vO{constructor(e,t){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=t}}class bO{static _deduceRage(e,t=null){return!t&&e?new tc(e.lineNumber,e.column,e.lineNumber,e.column):null!=t?t:null}static createUnknown(e,t,i){return{type:0,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createTextarea(e,t){return{type:1,element:e,mouseColumn:t,position:null,range:null}}static createMargin(e,t,i,n,o,s){return{type:e,element:t,mouseColumn:i,position:n,range:o,detail:s}}static createViewZone(e,t,i,n,o){return{type:e,element:t,mouseColumn:i,position:n,range:this._deduceRage(n),detail:o}}static createContentText(e,t,i,n,o){return{type:6,element:e,mouseColumn:t,position:i,range:this._deduceRage(i,n),detail:o}}static createContentEmpty(e,t,i,n){return{type:7,element:e,mouseColumn:t,position:i,range:this._deduceRage(i),detail:n}}static createContentWidget(e,t,i){return{type:9,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createScrollbar(e,t,i){return{type:11,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createOverlayWidget(e,t,i){return{type:12,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createOutsideEditor(e,t,i,n){return{type:13,element:null,mouseColumn:e,position:t,range:this._deduceRage(t),outsidePosition:i,outsideDistance:n}}static _typeToString(e){return 1===e?"TEXTAREA":2===e?"GUTTER_GLYPH_MARGIN":3===e?"GUTTER_LINE_NUMBERS":4===e?"GUTTER_LINE_DECORATIONS":5===e?"GUTTER_VIEW_ZONE":6===e?"CONTENT_TEXT":7===e?"CONTENT_EMPTY":8===e?"CONTENT_VIEW_ZONE":9===e?"CONTENT_WIDGET":10===e?"OVERVIEW_RULER":11===e?"SCROLLBAR":12===e?"OVERLAY_WIDGET":"UNKNOWN"}static toString(e){return this._typeToString(e.type)+": "+e.position+" - "+e.range+" - "+JSON.stringify(e.detail)}}class wO{static isTextArea(e){return 2===e.length&&3===e[0]&&6===e[1]}static isChildOfViewLines(e){return e.length>=4&&3===e[0]&&7===e[3]}static isStrictChildOfViewLines(e){return e.length>4&&3===e[0]&&7===e[3]}static isChildOfScrollableElement(e){return e.length>=2&&3===e[0]&&5===e[1]}static isChildOfMinimap(e){return e.length>=2&&3===e[0]&&8===e[1]}static isChildOfContentWidgets(e){return e.length>=4&&3===e[0]&&1===e[3]}static isChildOfOverflowGuard(e){return e.length>=1&&3===e[0]}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&2===e[0]}static isChildOfOverlayWidgets(e){return e.length>=2&&3===e[0]&&4===e[1]}}class CO{constructor(e,t,i){this.viewModel=e.viewModel;const n=e.configuration.options;this.layoutInfo=n.get(143),this.viewDomNode=t.viewDomNode,this.lineHeight=n.get(66),this.stickyTabStops=n.get(115),this.typicalHalfwidthCharacterWidth=n.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return CO.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const n=i.verticalOffset+i.height/2,o=e.viewModel.getLineCount();let s,r=null,a=null;return i.afterLineNumber!==o&&(a=new ch(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new ch(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),s=null===a?r:null===r?a:t<n?r:a,{viewZoneId:i.id,afterLineNumber:i.afterLineNumber,positionBefore:r,positionAfter:a,position:s}}return null}getFullLineRangeAtCoord(e){if(this._context.viewLayout.isAfterLines(e)){const e=this._context.viewModel.getLineCount(),t=this._context.viewModel.getLineMaxColumn(e);return{range:new tc(e,t,e,t),isAfterLines:!0}}const t=this._context.viewLayout.getLineNumberAtVerticalOffset(e),i=this._context.viewModel.getLineMaxColumn(t);return{range:new tc(t,1,t,i),isAfterLines:!1}}getLineNumberAtVerticalOffset(e){return this._context.viewLayout.getLineNumberAtVerticalOffset(e)}isAfterLines(e){return this._context.viewLayout.isAfterLines(e)}isInTopPadding(e){return this._context.viewLayout.isInTopPadding(e)}isInBottomPadding(e){return this._context.viewLayout.isInBottomPadding(e)}getVerticalOffsetForLineNumber(e){return this._context.viewLayout.getVerticalOffsetForLineNumber(e)}findAttribute(e,t){return CO._findAttribute(e,t,this._viewHelper.viewDomNode)}static _findAttribute(e,t,i){for(;e&&e!==e.ownerDocument.body;){if(e.hasAttribute&&e.hasAttribute(t))return e.getAttribute(t);if(e===i)return null;e=e.parentNode}return null}getLineWidth(e){return this._viewHelper.getLineWidth(e)}visibleRangeForPosition(e,t){return this._viewHelper.visibleRangeForPosition(e,t)}getPositionFromDOMInfo(e,t){return this._viewHelper.getPositionFromDOMInfo(e,t)}getCurrentScrollTop(){return this._context.viewLayout.getCurrentScrollTop()}getCurrentScrollLeft(){return this._context.viewLayout.getCurrentScrollLeft()}}class yO{constructor(e,t,i,n){this.editorPos=t,this.pos=i,this.relativePos=n,this.mouseVerticalOffset=Math.max(0,e.getCurrentScrollTop()+this.relativePos.y),this.mouseContentHorizontalOffset=e.getCurrentScrollLeft()+this.relativePos.x-e.layoutInfo.contentLeft,this.isInMarginArea=this.relativePos.x<e.layoutInfo.contentLeft&&this.relativePos.x>=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,xO._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class SO extends yO{constructor(e,t,i,n,o){super(e,t,i,n),this._ctx=e,o?(this.target=o,this.targetPath=PR.collect(o,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}\n\ttarget: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?lu.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return bO.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return bO.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,n){return bO.createMargin(e,this.target,this._getMouseColumn(t),t,i,n)}fulfillViewZone(e,t,i){return bO.createViewZone(e,this.target,this._getMouseColumn(t),t,i)}fulfillContentText(e,t,i){return bO.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return bO.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return bO.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return bO.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return bO.createOverlayWidget(this.target,this._getMouseColumn(),e)}withTarget(e){return new SO(this._ctx,this.editorPos,this.pos,this.relativePos,e)}}const kO={isAfterLines:!0};function LO(e){return{isAfterLines:!1,horizontalDistanceToText:e}}class xO{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=PR.collect(t,this._viewHelper.viewDomNode);return!(!wO.isChildOfContentWidgets(i)&&!wO.isChildOfOverflowingContentWidgets(i)&&!wO.isChildOfOverlayWidgets(i))}createMouseTarget(e,t,i,n,o){const s=new CO(this._context,this._viewHelper,e),r=new SO(s,t,i,n,o);try{const e=xO._createMouseTarget(s,r,!1);if(6===e.type&&s.stickyTabStops&&null!==e.position){const t=xO._snapToSoftTabBoundary(e.position,s.viewModel),i=tc.fromPositions(t,t).plusRange(e.range);return r.fulfillContentText(t,i,e.detail)}return e}catch(e){return r.fulfillUnknown()}}static _createMouseTarget(e,t,i){if(null===t.target){if(i)return t.fulfillUnknown();const n=xO._doHitTest(e,t);return 1===n.type?xO.createMouseTargetFromHitTestPosition(e,t,n.spanNode,n.position,n.injectedText):this._createMouseTarget(e,t.withTarget(n.hitTarget),!0)}const n=t;let o=null;return wO.isChildOfOverflowGuard(t.targetPath)||wO.isChildOfOverflowingContentWidgets(t.targetPath)||(o=o||t.fulfillUnknown()),o=o||xO._hitTestContentWidget(e,n),o=o||xO._hitTestOverlayWidget(e,n),o=o||xO._hitTestMinimap(e,n),o=o||xO._hitTestScrollbarSlider(e,n),o=o||xO._hitTestViewZone(e,n),o=o||xO._hitTestMargin(e,n),o=o||xO._hitTestViewCursor(e,n),o=o||xO._hitTestTextArea(e,n),o=o||xO._hitTestViewLines(e,n,i),o=o||xO._hitTestScrollbar(e,n),o||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(wO.isChildOfContentWidgets(t.targetPath)||wO.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(wO.isChildOfOverlayWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillOverlayWidget(i):t.fulfillUnknown()}return null}static _hitTestViewCursor(e,t){if(t.target){const i=e.lastRenderData.lastViewCursorsRenderData;for(const e of i)if(t.target===e.domNode)return t.fulfillContentText(e.position,null,{mightBeForeignElement:!1,injectedText:null})}if(t.isInContentArea){const i=e.lastRenderData.lastViewCursorsRenderData,n=t.mouseContentHorizontalOffset,o=t.mouseVerticalOffset;for(const s of i){if(n<s.contentLeft)continue;if(n>s.contentLeft+s.width)continue;const i=e.getVerticalOffsetForLineNumber(s.position.lineNumber);if(i<=o&&o<=i+s.height)return t.fulfillContentText(s.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const e=t.isInContentArea?8:5;return t.fulfillViewZone(e,i.position,i)}return null}static _hitTestTextArea(e,t){return wO.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),n=i.range.getStartPosition();let o=Math.abs(t.relativePos.x);const s={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};return o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth?t.fulfillMargin(2,n,i.range,s):(o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,n,i.range,s):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,n,i.range,s)))}return null}static _hitTestViewLines(e,t,i){if(!wO.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new ch(1,1),kO);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const i=e.viewModel.getLineCount(),n=e.viewModel.getLineMaxColumn(i);return t.fulfillContentEmpty(new ch(i,n),kO)}if(i){if(wO.isStrictChildOfViewLines(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(0===e.viewModel.getLineLength(i)){const n=e.getLineWidth(i),o=LO(t.mouseContentHorizontalOffset-n);return t.fulfillContentEmpty(new ch(i,1),o)}const n=e.getLineWidth(i);if(t.mouseContentHorizontalOffset>=n){const o=LO(t.mouseContentHorizontalOffset-n),s=new ch(i,e.viewModel.getLineMaxColumn(i));return t.fulfillContentEmpty(s,o)}}return t.fulfillUnknown()}const n=xO._doHitTest(e,t);return 1===n.type?xO.createMouseTargetFromHitTestPosition(e,t,n.spanNode,n.position,n.injectedText):this._createMouseTarget(e,t.withTarget(n.hitTarget),!0)}static _hitTestMinimap(e,t){if(wO.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new ch(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(wO.isChildOfScrollableElement(t.targetPath)&&t.target&&1===t.target.nodeType){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new ch(i,n))}}return null}static _hitTestScrollbar(e,t){if(wO.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new ch(i,n))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(143),n=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return xO._getMouseColumn(n,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n,o){const s=n.lineNumber,r=n.column,a=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>a){const e=LO(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(n,e)}const l=e.visibleRangeForPosition(s,r);if(!l)return t.fulfillUnknown(n);const h=l.left;if(Math.abs(t.mouseContentHorizontalOffset-h)<1)return t.fulfillContentText(n,null,{mightBeForeignElement:!!o,injectedText:o});const d=[];if(d.push({offset:l.left,column:r}),r>1){const t=e.visibleRangeForPosition(s,r-1);t&&d.push({offset:t.left,column:r-1})}if(r<e.viewModel.getLineMaxColumn(s)){const t=e.visibleRangeForPosition(s,r+1);t&&d.push({offset:t.left,column:r+1})}d.sort(((e,t)=>e.offset-t.offset));const c=t.pos.toClientCoordinates(as(e.viewDomNode)),u=i.getBoundingClientRect(),g=u.left<=c.clientX&&c.clientX<=u.right;let p=null;for(let e=1;e<d.length;e++){const i=d[e-1],o=d[e];if(i.offset<=t.mouseContentHorizontalOffset&&t.mouseContentHorizontalOffset<=o.offset){p=new tc(s,i.column,s,o.column);const e=Math.abs(i.offset-t.mouseContentHorizontalOffset),r=Math.abs(o.offset-t.mouseContentHorizontalOffset);n=new ch(s,e<r?i.column:o.column);break}}return t.fulfillContentText(n,p,{mightBeForeignElement:!g||!!o,injectedText:o})}static _doHitTestWithCaretRangeFromPoint(e,t){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.getVerticalOffsetForLineNumber(i),o=n+e.lineHeight;if(!(i===e.viewModel.getLineCount()&&t.mouseVerticalOffset>o)){const i=Math.floor((n+o)/2);let s=t.pos.y+(i-t.mouseVerticalOffset);s<=t.editorPos.y&&(s=t.editorPos.y+1),s>=t.editorPos.y+t.editorPos.height&&(s=t.editorPos.y+t.editorPos.height-1);const r=new fI(t.pos.x,s),a=this._actualDoHitTestWithCaretRangeFromPoint(e,r.toClientCoordinates(as(e.viewDomNode)));if(1===a.type)return a}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(as(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=Hs(e.viewDomNode);let n;if(n=i?void 0===i.caretRangeFromPoint?function(e,t,i){const n=document.createRange();let o=e.elementFromPoint(t,i);if(null!==o){for(;o&&o.firstChild&&o.firstChild.nodeType!==o.firstChild.TEXT_NODE&&o.lastChild&&o.lastChild.firstChild;)o=o.lastChild;const e=o.getBoundingClientRect(),i=as(o),s=`${i.getComputedStyle(o,null).getPropertyValue("font-style")} ${i.getComputedStyle(o,null).getPropertyValue("font-variant")} ${i.getComputedStyle(o,null).getPropertyValue("font-weight")} ${i.getComputedStyle(o,null).getPropertyValue("font-size")}/${i.getComputedStyle(o,null).getPropertyValue("line-height")} ${i.getComputedStyle(o,null).getPropertyValue("font-family")}`,r=o.innerText;let a,l=e.left,h=0;if(t>e.left+e.width)h=r.length;else{const e=DO.getInstance();for(let i=0;i<r.length+1;i++){if(a=e.getCharWidth(r.charAt(i),s)/2,l+=a,t<l){h=i;break}l+=a}}n.setStart(o.firstChild,h),n.setEnd(o.firstChild,h)}return n}(i,t.clientX,t.clientY):i.caretRangeFromPoint(t.clientX,t.clientY):e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!n||!n.startContainer)return new mO;const o=n.startContainer;if(o.nodeType===o.TEXT_NODE){const t=o.parentNode,i=t?t.parentNode:null,s=i?i.parentNode:null;return(s&&s.nodeType===s.ELEMENT_NODE?s.className:null)===hO.CLASS_NAME?_O.createFromDOMInfo(e,t,n.startOffset):new mO(o.parentNode)}if(o.nodeType===o.ELEMENT_NODE){const t=o.parentNode,i=t?t.parentNode:null;return(i&&i.nodeType===i.ELEMENT_NODE?i.className:null)===hO.CLASS_NAME?_O.createFromDOMInfo(e,o,o.textContent.length):new mO(o)}return new mO}static _doHitTestWithCaretPositionFromPoint(e,t){const i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const t=i.offsetNode.parentNode,n=t?t.parentNode:null,o=n?n.parentNode:null;return(o&&o.nodeType===o.ELEMENT_NODE?o.className:null)===hO.CLASS_NAME?_O.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new mO(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const t=i.offsetNode.parentNode,n=t&&t.nodeType===t.ELEMENT_NODE?t.className:null,o=t?t.parentNode:null,s=o&&o.nodeType===o.ELEMENT_NODE?o.className:null;if(n===hO.CLASS_NAME){const t=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(t)return _O.createFromDOMInfo(e,t,0)}else if(s===hO.CLASS_NAME)return _O.createFromDOMInfo(e,i.offsetNode,0)}return new mO(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:n}=t.model.getOptions(),o=Zy.atomicPosition(i,e.column-1,n,2);return-1!==o?new ch(e.lineNumber,o+1):e}static _doHitTest(e,t){let i=new mO;if("function"==typeof e.viewDomNode.ownerDocument.caretRangeFromPoint?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(as(e.viewDomNode)))),1===i.type){const t=e.viewModel.getInjectedTextAt(i.position),n=e.viewModel.normalizePosition(i.position,2);!t&&n.equals(i.position)||(i=new fO(n,i.spanNode,t))}return i}}class DO{static getInstance(){return DO._INSTANCE||(DO._INSTANCE=new DO),DO._INSTANCE}constructor(){this._cache={},this._canvas=document.createElement("canvas")}getCharWidth(e,t){const i=e+t;if(this._cache[i])return this._cache[i];const n=this._canvas.getContext("2d");n.font=t;const o=n.measureText(e).width;return this._cache[i]=o,o}}DO._INSTANCE=null;class EO extends RR{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new xO(this._context,i),this._mouseDownOperation=this._register(new NO(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,((e,t)=>this._createMouseTarget(e,t)),(e=>this._getMouseColumn(e)))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(143).height;const n=new SI(this.viewHelper.viewDomNode);this._register(n.onContextMenu(this.viewHelper.viewDomNode,(e=>this._onContextMenu(e,!0)))),this._register(n.onMouseMove(this.viewHelper.viewDomNode,(e=>{this._onMouseMove(e),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=bs(this.viewHelper.viewDomNode.ownerDocument,"mousemove",(e=>{this.viewHelper.viewDomNode.contains(e.target)||this._onMouseLeave(new yI(e,!1,this.viewHelper.viewDomNode))})))}))),this._register(n.onMouseUp(this.viewHelper.viewDomNode,(e=>this._onMouseUp(e)))),this._register(n.onMouseLeave(this.viewHelper.viewDomNode,(e=>this._onMouseLeave(e))));let o=0;this._register(n.onPointerDown(this.viewHelper.viewDomNode,((e,t)=>{o=t}))),this._register(bs(this.viewHelper.viewDomNode,or.POINTER_UP,(e=>{this._mouseDownOperation.onPointerUp()}))),this._register(n.onMouseDown(this.viewHelper.viewDomNode,(e=>this._onMouseDown(e,o)))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=LD.INSTANCE;let t=0,i=_R.getZoomLevel(),n=!1,o=0;function s(e){return Ve?(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey}this._register(bs(this.viewHelper.viewDomNode,or.MOUSE_WHEEL,(r=>{if(this.viewController.emitMouseWheel(r),!this._context.configuration.options.get(75))return;const a=new Tt(r);if(e.acceptStandardWheelEvent(a),e.isPhysicalMouseWheel()){if(s(r)){const e=_R.getZoomLevel(),t=a.deltaY>0?1:-1;_R.setZoomLevel(e+t),a.preventDefault(),a.stopPropagation()}}else Date.now()-t>50&&(i=_R.getZoomLevel(),n=s(r),o=0),t=Date.now(),o+=a.deltaY,n&&(_R.setZoomLevel(i+o/5),a.preventDefault(),a.stopPropagation())}),{capture:!0,passive:!1}))}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(143)){const e=this._context.configuration.options.get(143).height;this._height!==e&&(this._height=e,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const i=new _I(e,t).toPageCoordinates(as(this.viewHelper.viewDomNode)),n=wI(this.viewHelper.viewDomNode);if(i.y<n.y||i.y>n.y+n.height||i.x<n.x||i.x>n.x+n.width)return null;const o=CI(this.viewHelper.viewDomNode,n,i);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),n,i,o,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const t=Hs(this.viewHelper.viewDomNode);t&&(i=t.elementsFromPoint(e.posx,e.posy).find((e=>this.viewHelper.viewDomNode.contains(e))))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),this._mouseDownOperation.isActive()||e.timestamp<this.lastMouseLeaveTime||this.viewController.emitMouseMove({event:e,target:this._createMouseTarget(e,!0)})}_onMouseLeave(e){this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),this.lastMouseLeaveTime=(new Date).getTime(),this.viewController.emitMouseLeave({event:e,target:null})}_onMouseUp(e){this.viewController.emitMouseUp({event:e,target:this._createMouseTarget(e,!0)})}_onMouseDown(e,t){const i=this._createMouseTarget(e,!0),n=6===i.type||7===i.type,o=2===i.type||3===i.type||4===i.type,s=3===i.type,r=this._context.configuration.options.get(108),a=8===i.type||5===i.type,l=9===i.type;let h=e.leftButton||e.middleButton;Ve&&e.leftButton&&e.ctrlKey&&(h=!1);const d=()=>{e.preventDefault(),this.viewHelper.focusTextArea()};if(h&&(n||s&&r))d(),this._mouseDownOperation.start(i.type,e,t);else if(o)e.preventDefault();else if(a){const n=i.detail;h&&this.viewHelper.shouldSuppressMouseDownOnViewZone(n.viewZoneId)&&(d(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(d(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}}class NO extends T{constructor(e,t,i,n,o,s){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=n,this._createMouseTarget=o,this._getMouseColumn=s,this._mouseMoveMonitor=this._register(new LI(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new IO(this._context,this._viewHelper,this._mouseTargetFactory,((e,t,i)=>this._dispatchMouse(e,t,i)))),this._mouseState=new TO,this._currentSelection=new ic(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):13!==t.type||"above"!==t.outsidePosition&&"below"!==t.outsidePosition?(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,1)):this._topBottomDragScrolling.start(t,e))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(3===e),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const n=this._findMousePosition(t,!0);if(!n||!n.position)return;this._mouseState.trySetCount(t.detail,n.position),t.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(90)&&o.get(35)&&!o.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&6===n.type&&n.position&&this._currentSelection.containsPosition(n.position))return this._mouseState.isDragAndDrop=!0,this._isActive=!0,void this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,(e=>this._onMouseDownThenMove(e)),(e=>{const t=this._findMousePosition(this._lastMouseEvent,!1);nr(e)?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:t?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()}));this._mouseState.isDragAndDrop=!1,this._dispatchMouse(n,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,(e=>this._onMouseDownThenMove(e)),(()=>this._stop())))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,n=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posy<t.y){const i=t.y-e.posy,s=Math.max(n.getCurrentScrollTop()-i,0),r=CO.getZoneAtCoord(this._context,s);if(r){const e=this._helpPositionJumpOverViewZone(r);if(e)return bO.createOutsideEditor(o,e,"above",i)}const a=n.getLineNumberAtVerticalOffset(s);return bO.createOutsideEditor(o,new ch(a,1),"above",i)}if(e.posy>t.y+t.height){const s=e.posy-t.y-t.height,r=n.getCurrentScrollTop()+e.relativePos.y,a=CO.getZoneAtCoord(this._context,r);if(a){const e=this._helpPositionJumpOverViewZone(a);if(e)return bO.createOutsideEditor(o,e,"below",s)}const l=n.getLineNumberAtVerticalOffset(r);return bO.createOutsideEditor(o,new ch(l,i.getLineMaxColumn(l)),"below",s)}const s=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+e.relativePos.y);if(e.posx<t.x){const i=t.x-e.posx;return bO.createOutsideEditor(o,new ch(s,1),"left",i)}if(e.posx>t.x+t.width){const n=e.posx-t.x-t.width;return bO.createOutsideEditor(o,new ch(s,i.getLineMaxColumn(s)),"right",n)}return null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const n=this._createMouseTarget(e,t);if(!n.position)return null;if(8===n.type||5===n.type){const e=this._helpPositionJumpOverViewZone(n.detail);if(e)return bO.createViewZone(n.type,n.element,n.mouseColumn,e,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new ch(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,n=e.positionAfter;return i&&n?i.isBefore(t)?i:n:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:6===e.type&&null!==e.detail.injectedText})}}class IO extends T{constructor(e,t,i,n){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new MO(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class MO extends T{constructor(e,t,i,n,o,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._position=o,this._mouseEvent=s,this._lastTime=Date.now(),this._animationFrameDisposable=Ls(as(s.browserEvent),(()=>this._execute()))}dispose(){this._animationFrameDisposable.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}_getScrollSpeed(){const e=this._context.configuration.options.get(66),t=this._context.configuration.options.get(143).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(66),t=this._getScrollSpeed()*(this._tick()/1e3)*e,i="above"===this._position.outsidePosition?-t:t;this._context.viewModel.viewLayout.deltaScrollNow(0,i),this._viewHelper.renderNow();const n=this._context.viewLayout.getLinesViewportData(),o="above"===this._position.outsidePosition?n.startLineNumber:n.endLineNumber;let s;{const e=wI(this._viewHelper.viewDomNode),t=this._context.configuration.options.get(143).horizontalScrollbarHeight,i=new fI(this._mouseEvent.pos.x,e.y+e.height-t-.1),n=CI(this._viewHelper.viewDomNode,e,i);s=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),e,i,n,null)}s.position&&s.position.lineNumber===o||(s="above"===this._position.outsidePosition?bO.createOutsideEditor(this._position.mouseColumn,new ch(o,1),"above",this._position.outsideDistance):bO.createOutsideEditor(this._position.mouseColumn,new ch(o,this._context.viewModel.getLineMaxColumn(o)),"below",this._position.outsideDistance)),this._dispatchMouse(s,!0,2),this._animationFrameDisposable=Ls(as(s.element),(()=>this._execute()))}}class TO{get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=(new Date).getTime();i-this._lastSetMouseDownCountTime>TO.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}TO.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class AO extends EO{constructor(e,t,i){super(e,t,i),this._register(KL.addTarget(this.viewHelper.linesContentDomNode)),this._register(bs(this.viewHelper.linesContentDomNode,UL.Tap,(e=>this.onTap(e)))),this._register(bs(this.viewHelper.linesContentDomNode,UL.Change,(e=>this.onChange(e)))),this._register(bs(this.viewHelper.linesContentDomNode,UL.Contextmenu,(e=>this._onContextMenu(new yI(e,!1,this.viewHelper.viewDomNode),!1)))),this._lastPointerType="mouse",this._register(bs(this.viewHelper.linesContentDomNode,"pointerdown",(e=>{const t=e.pointerType;this._lastPointerType="mouse"!==t?"touch"===t?"touch":"pen":"mouse"})));const n=new kI(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,(e=>this._onMouseMove(e)))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,(e=>this._onMouseUp(e)))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,(e=>this._onMouseLeave(e)))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,((e,t)=>this._onMouseDown(e,t))))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new yI(e,!1,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:6===t.type&&null!==t.detail.injectedText})}onChange(e){"touch"===this._lastPointerType&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e,t){"touch"!==e.browserEvent.pointerType&&super._onMouseDown(e,t)}}class RO extends EO{constructor(e,t,i){super(e,t,i),this._register(KL.addTarget(this.viewHelper.linesContentDomNode)),this._register(bs(this.viewHelper.linesContentDomNode,UL.Tap,(e=>this.onTap(e)))),this._register(bs(this.viewHelper.linesContentDomNode,UL.Change,(e=>this.onChange(e)))),this._register(bs(this.viewHelper.linesContentDomNode,UL.Contextmenu,(e=>this._onContextMenu(new yI(e,!1,this.viewHelper.viewDomNode),!1))))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new yI(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const e=document.createEvent("CustomEvent");e.initEvent(zS.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(e),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class OO extends T{constructor(e,t,i){super(),je&&st?this.handler=this._register(new AO(e,t,i)):r.TouchEvent?this.handler=this._register(new RO(e,t,i)):this.handler=this._register(new EO(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}var PO=i(504),FO={};FO.styleTagTransform=Vr(),FO.setAttributes=Pr(),FO.insert=Rr().bind(null,"head"),FO.domAPI=Tr(),FO.insertStyleElement=Br(),Ir()(PO.Z,FO),PO.Z&&PO.Z.locals&&PO.Z.locals;var BO=i(6184),WO={};WO.styleTagTransform=Vr(),WO.setAttributes=Pr(),WO.insert=Rr().bind(null,"head"),WO.domAPI=Tr(),WO.insertStyleElement=Br(),Ir()(BO.Z,WO),BO.Z&&BO.Z.locals&&BO.Z.locals;class VO extends RR{}class zO extends VO{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new ch(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(66);const t=e.get(67);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(94);const i=e.get(143);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,i=!0),2!==this._renderLineNumbers&&3!==this._renderLineNumbers||(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new ch(e,1));if(1!==t.column)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(2===this._renderLineNumbers){const e=Math.abs(this._lastCursorModelPosition.lineNumber-i);return 0===e?'<span class="relative-current-line-number">'+i+"</span>":String(e)}return 3===this._renderLineNumbers?this._lastCursorModelPosition.lineNumber===i||i%10==0?String(i):"":String(i)}prepareRender(e){if(0===this._renderLineNumbers)return void(this._renderResult=null);const t=ze?this._lineHeight%2==0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o=this._context.viewModel.getLineCount(),s=[];for(let e=i;e<=n;e++){const n=e-i,r=this._getLineRenderLineNumber(e);if(!r){s[n]="";continue}let a="";if(e===o&&0===this._context.viewModel.getLineLength(e)){if("off"===this._renderFinalNewline){s[n]="";continue}"dimmed"===this._renderFinalNewline&&(a=" dimmed-line-number")}e===this._activeLineNumber&&(a=" active-line-number"),s[n]=`<div class="${zO.CLASS_NAME}${t}${a}" style="left:${this._lineNumbersLeft}px;width:${this._lineNumbersWidth}px;">${r}</div>`}this._renderResult=s}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}zO.CLASS_NAME="line-numbers",Fv(((e,t)=>{const i=e.getColor(Kv),n=e.getColor(rb);n?t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n}; }`):i&&t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i.transparent(.4)}; }`)}));var HO=i(1596),UO={};UO.styleTagTransform=Vr(),UO.setAttributes=Pr(),UO.insert=Rr().bind(null,"head"),UO.domAPI=Tr(),UO.insertStyleElement=Br(),Ir()(HO.Z,UO),HO.Z&&HO.Z.locals&&HO.Z.locals;class KO extends OR{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=Fx(document.createElement("div")),this._domNode.setClassName(KO.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=Fx(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(KO.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}}KO.CLASS_NAME="glyph-margin",KO.OUTER_CLASS_NAME="margin";var jO=i(7548),qO={};qO.styleTagTransform=Vr(),qO.setAttributes=Pr(),qO.insert=Rr().bind(null,"head"),qO.domAPI=Tr(),qO.insertStyleElement=Br(),Ir()(jO.Z,qO),jO.Z&&jO.Z.locals&&jO.Z.locals;const $O="monaco-mouse-cursor-text",GO=new class{constructor(){this._onDidChange=new q,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}};var ZO=function(e,t){return function(i,n){t(i,n,e)}};class YO{constructor(e,t,i,n,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=n,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new ch(this.modelLineNumber,this.distanceToModelLineStart+1),i=new ch(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(this._previousPresentation=e||{foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const QO=re;let XO=class extends OR{constructor(e,t,i,n,o){super(e),this._keybindingService=n,this._instantiationService=o,this._primaryCursorPosition=new ch(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const s=this._context.configuration.options,r=s.get(143);this._setAccessibilityOptions(s),this._contentLeft=r.contentLeft,this._contentWidth=r.contentWidth,this._contentHeight=r.height,this._fontInfo=s.get(50),this._lineHeight=s.get(66),this._emptySelectionClipboard=s.get(37),this._copyWithSyntaxHighlighting=s.get(25),this._visibleTextArea=null,this._selections=[new ic(1,1,1,1)],this._modelSelections=[new ic(1,1,1,1)],this._lastRenderPosition=null,this.textArea=Fx(document.createElement("textarea")),PR.write(this.textArea,6),this.textArea.setClassName(`inputarea ${$O}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:a}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=a*this._fontInfo.spaceWidth+"px",this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(s)),this.textArea.setAttribute("aria-required",s.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(s.get(123))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",me(0,"editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",s.get(90)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=Fx(document.createElement("div")),this.textAreaCover.setPosition("absolute");const l={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:e=>this._context.viewModel.getLineMaxColumn(e),getValueInRange:(e,t)=>this._context.viewModel.getValueInRange(e,t),getValueLengthInRange:(e,t)=>this._context.viewModel.getValueLengthInRange(e,t),modifyPosition:(e,t)=>this._context.viewModel.modifyPosition(e,t)},h={getDataToCopy:()=>{const e=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,We),t=this._context.viewModel.model.getEOL(),i=this._emptySelectionClipboard&&1===this._modelSelections.length&&this._modelSelections[0].isEmpty(),n=Array.isArray(e)?e:null,o=Array.isArray(e)?e.join(t):e;let s,r=null;if(US.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&o.length<65536){const e=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);e&&(s=e.html,r=e.mode)}return{isFromEmptySelection:i,multicursorText:n,text:o,html:s,mode:r}},getScreenReaderContent:()=>{if(1===this._accessibilitySupport){const e=this._selections[0];if(Ve&&e.isEmpty()){const t=e.getStartPosition();let i=this._getWordBeforePosition(t);if(0===i.length&&(i=this._getCharacterBeforePosition(t)),i.length>0)return new PS(i,i.length,i.length,tc.fromPositions(t),0)}const t=500;if(Ve&&!e.isEmpty()&&l.getValueLengthInRange(e,0)<t){const t=l.getValueInRange(e,0);return new PS(t,0,t.length,e,0)}if(he&&!e.isEmpty()){const e="vscode-placeholder";return new PS(e,0,e.length,null,void 0)}return PS.EMPTY}if(ce){const e=this._selections[0];if(e.isEmpty()){const t=e.getStartPosition(),[i,n]=this._getAndroidWordAtPosition(t);if(i.length>0)return new PS(i,n,n,tc.fromPositions(t),0)}return PS.EMPTY}return FS.fromEditorSelection(l,this._selections[0],this._accessibilityPageSize,0===this._accessibilitySupport)},deduceModelPosition:(e,t,i)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(e,t,i)},d=this._register(new GS(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(qS,h,d,Qe,{isAndroid:ce,isChrome:le,isFirefox:re,isSafari:he})),this._register(this._textAreaInput.onKeyDown((e=>{this._viewController.emitKeyDown(e)}))),this._register(this._textAreaInput.onKeyUp((e=>{this._viewController.emitKeyUp(e)}))),this._register(this._textAreaInput.onPaste((e=>{let t=!1,i=null,n=null;e.metadata&&(t=this._emptySelectionClipboard&&!!e.metadata.isFromEmptySelection,i=void 0!==e.metadata.multicursorText?e.metadata.multicursorText:null,n=e.metadata.mode),this._viewController.paste(e.text,t,i,n)}))),this._register(this._textAreaInput.onCut((()=>{this._viewController.cut()}))),this._register(this._textAreaInput.onType((e=>{e.replacePrevCharCnt||e.replaceNextCharCnt||e.positionDelta?this._viewController.compositionType(e.text,e.replacePrevCharCnt,e.replaceNextCharCnt,e.positionDelta):this._viewController.type(e.text)}))),this._register(this._textAreaInput.onSelectionChangeRequest((e=>{this._viewController.setSelection(e)}))),this._register(this._textAreaInput.onCompositionStart((e=>{const t=this.textArea.domNode,i=this._modelSelections[0],{distanceToModelLineStart:n,widthOfHiddenTextBefore:o}=(()=>{const e=t.value.substring(0,Math.min(t.selectionStart,t.selectionEnd)),n=e.lastIndexOf("\n"),o=e.substring(n+1),s=o.lastIndexOf("\t"),r=o.length-s-1,a=i.getStartPosition(),l=Math.min(a.column-1,r),h=a.column-1-l,d=o.substring(0,o.length-l),{tabSize:c}=this._context.viewModel.model.getOptions(),u=function(e,t,i,n){if(0===t.length)return 0;const o=e.createElement("div");o.style.position="absolute",o.style.top="-50000px",o.style.width="50000px";const s=e.createElement("span");Bx(s,i),s.style.whiteSpace="pre",s.style.tabSize=n*i.spaceWidth+"px",s.append(t),o.appendChild(s),e.body.appendChild(o);const r=s.offsetWidth;return e.body.removeChild(o),r}(this.textArea.domNode.ownerDocument,d,this._fontInfo,c);return{distanceToModelLineStart:h,widthOfHiddenTextBefore:u}})(),{distanceToModelLineEnd:s}=(()=>{const e=t.value.substring(Math.max(t.selectionStart,t.selectionEnd)),n=e.indexOf("\n"),o=-1===n?e:e.substring(0,n),s=o.indexOf("\t"),r=-1===s?o.length:o.length-s-1,a=i.getEndPosition(),l=Math.min(this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column,r);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column-l}})();this._context.viewModel.revealRange("keyboard",!0,tc.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new YO(this._context,i.startLineNumber,n,o,s),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${$O} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()}))),this._register(this._textAreaInput.onCompositionUpdate((e=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())}))),this._register(this._textAreaInput.onCompositionEnd((()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${$O}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()}))),this._register(this._textAreaInput.onFocus((()=>{this._context.viewModel.setHasFocus(!0)}))),this._register(this._textAreaInput.onBlur((()=>{this._context.viewModel.setHasFocus(!1)}))),this._register(GO.onDidChange((()=>{this._ensureReadOnlyAttribute()})))}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=Uw('`~!@#$%^&*()-=+[{]}\\|;:",.<>/?');let n=!0,o=e.column,s=!0,r=e.column,a=0;for(;a<50&&(n||s);){if(n&&o<=1&&(n=!1),n){const e=t.charCodeAt(o-2);0!==i.get(e)?n=!1:o--}if(s&&r>t.length&&(s=!1),s){const e=t.charCodeAt(r-1);0!==i.get(e)?s=!1:r++}a++}return[t.substring(o-1,r-1),e.column-o]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=Uw(this._context.configuration.options.get(129));let n=e.column,o=0;for(;n>1;){const s=t.charCodeAt(n-2);if(0!==i.get(s)||o>50)return t.substring(n-1,e.column-1);o++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const t=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!In(t.charCodeAt(0)))return t}return""}_getAriaLabel(e){var t,i,n;if(1===e.get(2)){const e=null===(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))||void 0===t?void 0:t.getAriaLabel(),o=null===(i=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))||void 0===i?void 0:i.getAriaLabel(),s=null===(n=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))||void 0===n?void 0:n.getAriaLabel(),r=me(0,"The editor is not accessible at this time.");return e?me(0,"{0} To enable screen reader optimized mode, use {1}",r,e):o?me(0,"{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",r,o):s?me(0,"{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",r,s):r}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);2===this._accessibilitySupport&&t===Uk.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const i=e.get(143).wrappingColumn;if(-1!==i&&1!==this._accessibilitySupport){const t=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(i*t.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=QO?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(50),this._lineHeight=t.get(66),this._emptySelectionClipboard=t.get(37),this._copyWithSyntaxHighlighting=t.get(25),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:n}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=n*this._fontInfo.spaceWidth+"px",this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("aria-required",t.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(123))),(e.hasChanged(34)||e.hasChanged(90))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeNativeTextAreaContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeNativeTextAreaContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!GO.enabled||e.get(34)&&e.get(90)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new ch(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),null===(t=this._visibleTextArea)||void 0===t||t.prepareRender(e)}render(e){this._textAreaInput.writeNativeTextAreaContent("render"),this._render()}_render(){var e;if(this._visibleTextArea){const e=this._visibleTextArea.visibleTextareaStart,t=this._visibleTextArea.visibleTextareaEnd,i=this._visibleTextArea.startPosition,n=this._visibleTextArea.endPosition;if(i&&n&&e&&t&&t.left>=this._scrollLeft&&e.left<=this._scrollLeft+this._contentWidth){const o=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,s=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let r=this._visibleTextArea.widthOfHiddenLineTextBefore,a=this._contentLeft+e.left-this._scrollLeft,l=t.left-e.left+1;if(a<this._contentLeft){const e=this._contentLeft-a;a+=e,r+=e,l-=e}l>this._contentWidth&&(l=this._contentWidth);const h=this._context.viewModel.getViewLineData(i.lineNumber),d=h.tokens.findTokenIndexAtOffset(i.column-1),c=d===h.tokens.findTokenIndexAtOffset(n.column-1),u=this._visibleTextArea.definePresentation(c?h.tokens.getPresentation(d):null);this.textArea.domNode.scrollTop=s*this._lineHeight,this.textArea.domNode.scrollLeft=r,this._doRender({lastRenderPosition:null,top:o,left:a,width:l,height:this._lineHeight,useCover:!1,color:(SC.getColorMap()||[])[u.foreground],italic:u.italic,bold:u.bold,underline:u.underline,strikethrough:u.strikethrough})}return}if(!this._primaryCursorVisibleRange)return void this._renderAtTopLeft();const t=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(t<this._contentLeft||t>this._contentLeft+this._contentWidth)return void this._renderAtTopLeft();const i=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(i<0||i>this._contentHeight)this._renderAtTopLeft();else if(Ve||2===this._accessibilitySupport){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const n=null!==(e=this._textAreaInput.textAreaState.newlineCountBeforeSelection)&&void 0!==e?e:this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=n*this._lineHeight}else this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:QO?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;for(;i=e.indexOf("\n",i+1),-1!==i;)t++;return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:QO?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;Bx(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?ru.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const n=this._context.configuration.options;n.get(57)?i.setClassName("monaco-editor-background textAreaCover "+KO.OUTER_CLASS_NAME):0!==n.get(67).renderType?i.setClassName("monaco-editor-background textAreaCover "+zO.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};XO=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([ZO(3,ML),ZO(4,lh)],XO);class JO{constructor(e,t,i,n){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=n}paste(e,t,i,n){this.commandDelegate.paste(e,t,i,n)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,n){this.commandDelegate.compositionType(e,t,i,n)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){kS.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new ch(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(77)){case"altKey":return e.altKey;case"ctrlKey":return e.ctrlKey;case"metaKey":return e.metaKey;default:return!1}}_hasNonMulticursorModifier(e){switch(this.configuration.options.get(77)){case"altKey":return e.ctrlKey||e.metaKey;case"ctrlKey":return e.altKey||e.metaKey;case"metaKey":return e.ctrlKey||e.altKey;default:return!1}}dispatchMouse(e){const t=this.configuration.options,i=ze&&t.get(106),n=t.get(22);e.middleButton&&!i?this._columnSelect(e.position,e.mouseColumn,e.inSelectionMode):e.startedOnLineNumbers?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelect(e.position,e.revealType):this._createCursor(e.position,!0):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount>=4?this._selectAll():3===e.mouseDownCount?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):2===e.mouseDownCount?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey||n?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){kS.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){kS.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),kS.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),kS.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){kS.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){kS.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){kS.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){kS.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){kS.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){kS.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){kS.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){kS.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){kS.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}class eP{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){var t;null===(t=this.onKeyDown)||void 0===t||t.call(this,e)}emitKeyUp(e){var t;null===(t=this.onKeyUp)||void 0===t||t.call(this,e)}emitContextMenu(e){var t;null===(t=this.onContextMenu)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;null===(t=this.onMouseMove)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;null===(t=this.onMouseLeave)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;null===(t=this.onMouseDown)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;null===(t=this.onMouseUp)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;null===(t=this.onMouseDrag)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;null===(t=this.onMouseDrop)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;null===(e=this.onMouseDropCanceled)||void 0===e||e.call(this)}emitMouseWheel(e){var t;null===(t=this.onMouseWheel)||void 0===t||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return eP.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i={...e};return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),5!==i.type&&8!==i.type||(i.detail=this.convertViewToModelViewZoneData(i.detail,t)),i}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new ch(e.afterLineNumber,1)).lineNumber}}}class tP{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new b("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(0===this.getCount())return null;const i=this.getStartLineNumber(),n=this.getEndLineNumber();if(t<i){const i=t-e+1;return this._rendLineNumberStart-=i,null}if(e>n)return null;let o=0,s=0;for(let r=i;r<=n;r++){const i=r-this._rendLineNumberStart;e<=r&&r<=t&&(0===s?(o=i,s=1):s++)}if(e<i){let n=0;n=t<i?t-e+1:i-e,this._rendLineNumberStart-=n}return this._lines.splice(o,s)}onLinesChanged(e,t){const i=e+t-1;if(0===this.getCount())return!1;const n=this.getStartLineNumber(),o=this.getEndLineNumber();let s=!1;for(let t=e;t<=i;t++)t>=n&&t<=o&&(this._lines[t-this._rendLineNumberStart].onContentChanged(),s=!0);return s}onLinesInserted(e,t){if(0===this.getCount())return null;const i=t-e+1,n=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const s=[];for(let e=0;e<i;e++)s[e]=this._createLine();const r=e-this._rendLineNumberStart,a=this._lines.slice(0,r),l=this._lines.slice(r,this._lines.length-i),h=this._lines.slice(this._lines.length-i,this._lines.length);return this._lines=a.concat(s).concat(l),h}onTokensChanged(e){if(0===this.getCount())return!1;const t=this.getStartLineNumber(),i=this.getEndLineNumber();let n=!1;for(let o=0,s=e.length;o<s;o++){const s=e[o];if(s.toLineNumber<t||s.fromLineNumber>i)continue;const r=Math.max(t,s.fromLineNumber),a=Math.min(i,s.toLineNumber);for(let e=r;e<=a;e++){const t=e-this._rendLineNumberStart;this._lines[t].onTokensChanged(),n=!0}}return n}}class iP{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new tP((()=>this._host.createVisibleLine()))}_createDomNode(){const e=Fx(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(143)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,i=t.length;e<i;e++){const i=t[e].getDomNode();i&&this.domNode.domNode.removeChild(i)}return!0}onLinesInserted(e){const t=this._linesCollection.onLinesInserted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,i=t.length;e<i;e++){const i=t[e].getDomNode();i&&this.domNode.domNode.removeChild(i)}return!0}onScrollChanged(e){return e.scrollTopChanged}onTokensChanged(e){return this._linesCollection.onTokensChanged(e.ranges)}onZonesChanged(e){return!0}getStartLineNumber(){return this._linesCollection.getStartLineNumber()}getEndLineNumber(){return this._linesCollection.getEndLineNumber()}getVisibleLine(e){return this._linesCollection.getLine(e)}renderLines(e){const t=this._linesCollection._get(),i=new nP(this.domNode.domNode,this._host,e),n={rendLineNumberStart:t.rendLineNumberStart,lines:t.lines,linesLength:t.lines.length},o=i.render(n,e.startLineNumber,e.endLineNumber,e.relativeVerticalOffset);this._linesCollection._set(o.rendLineNumberStart,o.lines)}}class nP{constructor(e,t,i){this.domNode=e,this.host=t,this.viewportData=i}render(e,t,i,n){const o={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(o.rendLineNumberStart+o.linesLength-1<t||i<o.rendLineNumberStart){o.rendLineNumberStart=t,o.linesLength=i-t+1,o.lines=[];for(let e=t;e<=i;e++)o.lines[e-t]=this.host.createVisibleLine();return this._finishRendering(o,!0,n),o}if(this._renderUntouchedLines(o,Math.max(t-o.rendLineNumberStart,0),Math.min(i-o.rendLineNumberStart,o.linesLength-1),n,t),o.rendLineNumberStart>t){const e=t,s=Math.min(i,o.rendLineNumberStart-1);e<=s&&(this._insertLinesBefore(o,e,s,n,t),o.linesLength+=s-e+1)}else if(o.rendLineNumberStart<t){const e=Math.min(o.linesLength,t-o.rendLineNumberStart);e>0&&(this._removeLinesBefore(o,e),o.linesLength-=e)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1<i){const e=o.rendLineNumberStart+o.linesLength,s=i;e<=s&&(this._insertLinesAfter(o,e,s,n,t),o.linesLength+=s-e+1)}else if(o.rendLineNumberStart+o.linesLength-1>i){const e=Math.max(0,i-o.rendLineNumberStart+1),t=o.linesLength-1-e+1;t>0&&(this._removeLinesAfter(o,t),o.linesLength-=t)}return this._finishRendering(o,!1,n),o}_renderUntouchedLines(e,t,i,n,o){const s=e.rendLineNumberStart,r=e.lines;for(let e=t;e<=i;e++){const t=s+e;r[e].layoutLine(t,n[t-o])}}_insertLinesBefore(e,t,i,n,o){const s=[];let r=0;for(let e=t;e<=i;e++)s[r++]=this.host.createVisibleLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i<t;i++){const t=e.lines[i].getDomNode();t&&this.domNode.removeChild(t)}e.lines.splice(0,t)}_insertLinesAfter(e,t,i,n,o){const s=[];let r=0;for(let e=t;e<=i;e++)s[r++]=this.host.createVisibleLine();e.lines=e.lines.concat(s)}_removeLinesAfter(e,t){const i=e.linesLength-t;for(let n=0;n<t;n++){const t=e.lines[i+n].getDomNode();t&&this.domNode.removeChild(t)}e.lines.splice(i,t)}_finishRenderingNewLines(e,t,i,n){nP._ttPolicy&&(i=nP._ttPolicy.createHTML(i));const o=this.domNode.lastChild;t||!o?this.domNode.innerHTML=i:o.insertAdjacentHTML("afterend",i);let s=this.domNode.lastChild;for(let t=e.linesLength-1;t>=0;t--){const i=e.lines[t];n[t]&&(i.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");nP._ttPolicy&&(t=nP._ttPolicy.createHTML(t)),n.innerHTML=t;for(let t=0;t<e.linesLength;t++){const o=e.lines[t];if(i[t]){const e=n.firstChild,t=o.getDomNode();t.parentNode.replaceChild(e,t),o.setDomNode(e)}}}_finishRendering(e,t,i){const n=nP._sb,o=e.linesLength,s=e.lines,r=e.rendLineNumberStart,a=[];{n.reset();let l=!1;for(let e=0;e<o;e++){const t=s[e];a[e]=!1,t.getDomNode()||t.renderLine(e+r,i[e],this.viewportData,n)&&(a[e]=!0,l=!0)}l&&this._finishRenderingNewLines(e,t,n.build(),a)}{n.reset();let t=!1;const l=[];for(let e=0;e<o;e++){const o=s[e];(l[e]=!1,a[e])||o.renderLine(e+r,i[e],this.viewportData,n)&&(l[e]=!0,t=!0)}t&&this._finishRenderingInvalidLines(e,n.build(),l)}}}nP._ttPolicy=Tx("editorViewLayer",{createHTML:e=>e}),nP._sb=new Xu(1e5);class oP extends OR{constructor(e){super(e),this._visibleLines=new iP(this),this.domNode=this._visibleLines.domNode;const t=this._context.configuration.options.get(50);Bx(this.domNode,t),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;e<t;e++)if(this._dynamicOverlays[e].shouldRender())return!0;return!1}dispose(){super.dispose();for(let e=0,t=this._dynamicOverlays.length;e<t;e++)this._dynamicOverlays[e].dispose();this._dynamicOverlays=[]}getDomNode(){return this.domNode}createVisibleLine(){return new sP(this._context.configuration,this._dynamicOverlays)}addDynamicOverlay(e){this._dynamicOverlays.push(e)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e);const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++)this._visibleLines.getVisibleLine(n).onConfigurationChanged(e);const n=this._context.configuration.options.get(50);return Bx(this.domNode,n),!0}onFlushed(e){return this._visibleLines.onFlushed(e)}onFocusChanged(e){return this._isFocused=e.isFocused,!0}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onScrollChanged(e){return this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._visibleLines.onZonesChanged(e)}prepareRender(e){const t=this._dynamicOverlays.filter((e=>e.shouldRender()));for(let i=0,n=t.length;i<n;i++){const n=t[i];n.prepareRender(e),n.onDidRender()}}render(e){this._viewOverlaysRender(e),this.domNode.toggleClassName("focused",this._isFocused)}_viewOverlaysRender(e){this._visibleLines.renderLines(e.viewportData)}}class sP{constructor(e,t){this._configuration=e,this._lineHeight=this._configuration.options.get(66),this._dynamicOverlays=t,this._domNode=null,this._renderedContent=null}getDomNode(){return this._domNode?this._domNode.domNode:null}setDomNode(e){this._domNode=Fx(e)}onContentChanged(){}onTokensChanged(){}onConfigurationChanged(e){this._lineHeight=this._configuration.options.get(66)}renderLine(e,t,i,n){let o="";for(let t=0,n=this._dynamicOverlays.length;t<n;t++)o+=this._dynamicOverlays[t].render(i.startLineNumber,e);return this._renderedContent!==o&&(this._renderedContent=o,n.appendString('<div style="position:absolute;top:'),n.appendString(String(t)),n.appendString("px;width:100%;height:"),n.appendString(String(this._lineHeight)),n.appendString('px;">'),n.appendString(o),n.appendString("</div>"),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class rP extends oP{constructor(e){super(e);const t=this._context.configuration.options.get(143);this._contentWidth=t.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const t=this._context.configuration.options.get(143);return this._contentWidth=t.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class aP extends oP{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),Bx(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;Bx(this.domNode,t.get(50));const i=t.get(143);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class lP extends OR{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=Fx(document.createElement("div")),PR.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=Fx(document.createElement("div")),PR.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesDeleted(e){return this._updateAnchorsViewPositions(),!0}onLinesInserted(e){return this._updateAnchorsViewPositions(),!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}_updateAnchorsViewPositions(){const e=Object.keys(this._widgets);for(const t of e)this._widgets[t].updateAnchorViewPosition()}addWidget(e){const t=new hP(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i,n,o){this._widgets[e.getId()].setPosition(t,i,n,o),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t];delete this._widgets[t];const i=e.domNode.domNode;i.parentNode.removeChild(i),i.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return!!this._widgets.hasOwnProperty(e)&&this._widgets[e].suppressMouseDown}onBeforeRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].render(e)}}class hP{constructor(e,t,i){this._primaryAnchor=new dP(null,null),this._secondaryAnchor=new dP(null,null),this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=Fx(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const n=this._context.configuration.options,o=n.get(143);this._fixedOverflowWidgets=n.get(42),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._lineHeight=n.get(66),this._affinity=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setDisplay("none"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const t=this._context.configuration.options;if(this._lineHeight=t.get(66),e.hasChanged(143)){const e=t.get(143);this._contentLeft=e.contentLeft,this._contentWidth=e.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,i){function n(e,t,i){if(!e)return new dP(null,null);const n=t.model.validatePosition(e);if(t.coordinatesConverter.modelPositionIsVisible(n)){const o=t.coordinatesConverter.convertModelPositionToViewPosition(n,null!=i?i:void 0);return new dP(e,o)}return new dP(e,null)}this._affinity=e,this._primaryAnchor=n(t,this._context.viewModel,this._affinity),this._secondaryAnchor=n(i,this._context.viewModel,this._affinity)}_getMaxWidth(){const e=this.domNode.domNode.ownerDocument,t=e.defaultView;return this.allowEditorOverflow?(null==t?void 0:t.innerWidth)||e.documentElement.offsetWidth||e.body.offsetWidth:this._contentWidth}setPosition(e,t,i,n){this._setPosition(n,e,t),this._preference=i,this._primaryAnchor.viewPosition&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,n){const o=e.top,s=o,r=e.top+e.height,a=o-i,l=s>=i,h=r,d=n.viewportHeight-r>=i;let c=e.left;return c+t>n.scrollLeft+n.viewportWidth&&(c=n.scrollLeft+n.viewportWidth-t),c<n.scrollLeft&&(c=n.scrollLeft),{fitsAbove:l,aboveTop:a,fitsBelow:d,belowTop:h,left:c}}_layoutHorizontalSegmentInPage(e,t,i,n){var o;const s=Math.max(15,t.left-n),r=Math.min(t.left+t.width+n,e.width-15),a=this._viewDomNode.domNode.ownerDocument.defaultView;let l=t.left+i-(null!==(o=null==a?void 0:a.scrollX)&&void 0!==o?o:0);if(l+n>r){const e=l-(r-n);l-=e,i-=e}if(l<s){const e=l-s;l-=e,i-=e}return[i,l]}_layoutBoxInPage(e,t,i,n){var o,s;const r=e.top-i,a=e.top+e.height,l=As(this._viewDomNode.domNode),h=this._viewDomNode.domNode.ownerDocument,d=h.defaultView,c=l.top+r-(null!==(o=null==d?void 0:d.scrollY)&&void 0!==o?o:0),u=l.top+a-(null!==(s=null==d?void 0:d.scrollY)&&void 0!==s?s:0),g=Ns(h.body),[p,m]=this._layoutHorizontalSegmentInPage(g,l,e.left-n.scrollLeft+this._contentLeft,t),f=c>=22,_=u+i<=g.height-22;return this._fixedOverflowWidgets?{fitsAbove:f,aboveTop:Math.max(c,22),fitsBelow:_,belowTop:u,left:m}:{fitsAbove:f,aboveTop:r,fitsBelow:_,belowTop:a,left:p}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new cP(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,i;return{primary:n(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),secondary:n((null===(t=this._secondaryAnchor.viewPosition)||void 0===t?void 0:t.lineNumber)===(null===(i=this._primaryAnchor.viewPosition)||void 0===i?void 0:i.lineNumber)?this._secondaryAnchor.viewPosition:null,this._affinity,this._lineHeight)};function n(t,i,n){if(!t)return null;const o=e.visibleRangeForPosition(t);if(!o)return null;const s=1===t.column&&3===i?0:o.left,r=e.getVerticalOffsetForLineNumber(t.lineNumber)-e.scrollTop;return new uP(r,s,n)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const n=this._context.configuration.options.get(50);let o=t.left;return o=o<e.left?Math.max(o,e.left-i+n.typicalFullwidthCharacterWidth):Math.min(o,e.left+i-n.typicalFullwidthCharacterWidth),new uP(e.top,o,e.height)}_prepareRenderWidget(e){if(!this._preference||0===this._preference.length)return null;const{primary:t,secondary:i}=this._getAnchorsCoordinates(e);if(!t)return null;if(-1===this._cachedDomNodeOffsetWidth||-1===this._cachedDomNodeOffsetHeight){let e=null;if("function"==typeof this._actual.beforeRender&&(e=gP(this._actual.beforeRender,this._actual)),e)this._cachedDomNodeOffsetWidth=e.width,this._cachedDomNodeOffsetHeight=e.height;else{const e=this.domNode.domNode.getBoundingClientRect();this._cachedDomNodeOffsetWidth=Math.round(e.width),this._cachedDomNodeOffsetHeight=Math.round(e.height)}}const n=this._reduceAnchorCoordinates(t,i,this._cachedDomNodeOffsetWidth);let o;o=this.allowEditorOverflow?this._layoutBoxInPage(n,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e):this._layoutBoxInViewport(n,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e);for(let e=1;e<=2;e++)for(const t of this._preference)if(1===t){if(!o)return null;if(2===e||o.fitsAbove)return{coordinate:new cP(o.aboveTop,o.left),position:1}}else{if(2!==t)return this.allowEditorOverflow?{coordinate:this._prepareRenderWidgetAtExactPositionOverflowing(new cP(n.top,n.left)),position:0}:{coordinate:new cP(n.top,n.left),position:0};if(!o)return null;if(2===e||o.fitsBelow)return{coordinate:new cP(o.belowTop,o.left),position:2}}return null}onBeforeRender(e){this._primaryAnchor.viewPosition&&this._preference&&(this._primaryAnchor.viewPosition.lineNumber<e.startLineNumber||this._primaryAnchor.viewPosition.lineNumber>e.endLineNumber||this.domNode.setMaxWidth(this._maxWidth))}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData)return this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),void("function"==typeof this._actual.afterRender&&gP(this._actual.afterRender,this._actual,null));this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),"function"==typeof this._actual.afterRender&&gP(this._actual.afterRender,this._actual,this._renderData.position)}}class dP{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class cP{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class uP{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function gP(e,t,...i){try{return e.call(t,...i)}catch(e){return null}}var pP=i(1260),mP={};mP.styleTagTransform=Vr(),mP.setAttributes=Pr(),mP.insert=Rr().bind(null,"head"),mP.domAPI=Tr(),mP.insertStyleElement=Br(),Ir()(pP.Z,mP),pP.Z&&pP.Z.locals&&pP.Z.locals;class fP extends VO{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(143);this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new ic(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=this._selections.map((e=>e.positionLineNumber));t.sort(((e,t)=>e-t)),Ic(this._cursorLineNumbers,t)||(this._cursorLineNumbers=t,e=!0);const i=this._selections.every((e=>e.isEmpty()));return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return!!this._renderLineHighlightOnlyWhenFocus&&(this._focused=e.isFocused,!0)}prepareRender(e){if(!this._shouldRenderThis())return void(this._renderData=null);const t=this._renderOne(e),i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o=this._cursorLineNumbers.length;let s=0;const r=[];for(let e=i;e<=n;e++){const n=e-i;for(;s<o&&this._cursorLineNumbers[s]<e;)s++;s<o&&this._cursorLineNumbers[s]===e?r[n]=t:r[n]=""}this._renderData=r}render(e,t){if(!this._renderData)return"";const i=t-e;return i>=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return("gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class _P extends fP{_renderOne(e){return`<div class="${"current-line"+(this._shouldRenderOther()?" current-line-both":"")}" style="width:${Math.max(e.scrollWidth,this._contentWidth)}px; height:${this._lineHeight}px;"></div>`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class vP extends fP{_renderOne(e){return`<div class="${"current-line"+(this._shouldRenderInMargin()?" current-line-margin":"")+(this._shouldRenderOther()?" current-line-margin-both":"")}" style="width:${this._contentLeft}px; height:${this._lineHeight}px;"></div>`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}Fv(((e,t)=>{const i=e.getColor(Wv);if(i&&(t.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${i}; border: none; }`)),!i||i.isTransparent()||e.defines(Vv)){const i=e.getColor(Vv);i&&(t.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${i}; }`),Iv(e.type)&&(t.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}}));var bP=i(1329),wP={};wP.styleTagTransform=Vr(),wP.setAttributes=Pr(),wP.insert=Rr().bind(null,"head"),wP.domAPI=Tr(),wP.insertStyleElement=Br(),Ir()(bP.Z,wP),bP.Z&&bP.Z.locals&&bP.Z.locals;class CP extends VO{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],n=0;for(let e=0,o=t.length;e<o;e++){const o=t[e];o.options.className&&(i[n++]=o)}i=i.sort(((e,t)=>{if(e.options.zIndex<t.options.zIndex)return-1;if(e.options.zIndex>t.options.zIndex)return 1;const i=e.options.className,n=t.options.className;return i<n?-1:i>n?1:tc.compareRangesUsingStarts(e.range,t.range)}));const o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,r=[];for(let e=o;e<=s;e++)r[e-o]="";this._renderWholeLineDecorations(e,i,r),this._renderNormalDecorations(e,i,r),this._renderResult=r}_renderWholeLineDecorations(e,t,i){const n=String(this._lineHeight),o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let e=0,r=t.length;e<r;e++){const r=t[e];if(!r.options.isWholeLine)continue;const a='<div class="cdr '+r.options.className+'" style="left:0;width:100%;height:'+n+'px;"></div>',l=Math.max(r.range.startLineNumber,o),h=Math.min(r.range.endLineNumber,s);for(let e=l;e<=h;e++)i[e-o]+=a}}_renderNormalDecorations(e,t,i){var n;const o=String(this._lineHeight),s=e.visibleRange.startLineNumber;let r=null,a=!1,l=null,h=!1;for(let d=0,c=t.length;d<c;d++){const c=t[d];if(c.options.isWholeLine)continue;const u=c.options.className,g=Boolean(c.options.showIfCollapsed);let p=c.range;g&&1===p.endColumn&&p.endLineNumber!==p.startLineNumber&&(p=new tc(p.startLineNumber,p.startColumn,p.endLineNumber-1,this._context.viewModel.getLineMaxColumn(p.endLineNumber-1))),r===u&&a===g&&tc.areIntersectingOrTouching(l,p)?l=tc.plusRange(l,p):(null!==r&&this._renderNormalDecoration(e,l,r,h,a,o,s,i),r=u,a=g,l=p,h=null!==(n=c.options.shouldFillLineOnLineBreak)&&void 0!==n&&n)}null!==r&&this._renderNormalDecoration(e,l,r,h,a,o,s,i)}_renderNormalDecoration(e,t,i,n,o,s,r,a){const l=e.linesVisibleRangesForRange(t,"findMatch"===i);if(l)for(let e=0,t=l.length;e<t;e++){const t=l[e];if(t.outsideRenderedLine)continue;const h=t.lineNumber-r;if(o&&1===t.ranges.length){const e=t.ranges[0];if(e.width<this._typicalHalfwidthCharacterWidth){const i=Math.round(e.left+e.width/2),n=Math.max(0,Math.round(i-this._typicalHalfwidthCharacterWidth/2));t.ranges[0]=new VR(n,this._typicalHalfwidthCharacterWidth)}}for(let e=0,o=t.ranges.length;e<o;e++){const r=n&&t.continuesOnNextLine&&1===o,l=t.ranges[e],d='<div class="cdr '+i+'" style="left:'+String(l.left)+(r?"px;width:100%;height:":"px;width:"+String(l.width)+"px;height:")+s+'px;"></div>';a[h]+=d}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class yP extends OR{constructor(e,t,i,n){super(e);const o=this._context.configuration.options,s=o.get(102),r=o.get(74),a=o.get(40),l=o.get(105),h={listenOnDomNode:i.domNode,className:"editor-scrollable "+Rv(e.theme.type),useShadows:!1,lazyRender:!0,vertical:s.vertical,horizontal:s.horizontal,verticalHasArrows:s.verticalHasArrows,horizontalHasArrows:s.horizontalHasArrows,verticalScrollbarSize:s.verticalScrollbarSize,verticalSliderSize:s.verticalSliderSize,horizontalScrollbarSize:s.horizontalScrollbarSize,horizontalSliderSize:s.horizontalSliderSize,handleMouseWheel:s.handleMouseWheel,alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel,arrowSize:s.arrowSize,mouseWheelScrollSensitivity:r,fastScrollSensitivity:a,scrollPredominantAxis:l,scrollByPage:s.scrollByPage};this.scrollbar=this._register(new ED(t.domNode,h,this._context.viewLayout.getScrollable())),PR.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=Fx(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const d=(e,t,i)=>{const n={};if(t){const t=e.scrollTop;t&&(n.scrollTop=this._context.viewLayout.getCurrentScrollTop()+t,e.scrollTop=0)}if(i){const t=e.scrollLeft;t&&(n.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+t,e.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(n,1)};this._register(bs(i.domNode,"scroll",(e=>d(i.domNode,!0,!0)))),this._register(bs(t.domNode,"scroll",(e=>d(t.domNode,!0,!1)))),this._register(bs(n.domNode,"scroll",(e=>d(n.domNode,!0,!1)))),this._register(bs(this.scrollbarDomNode.domNode,"scroll",(e=>d(this.scrollbarDomNode.domNode,!0,!1))))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(143);this.scrollbarDomNode.setLeft(t.contentLeft),"right"===e.get(72).side?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(102)||e.hasChanged(74)||e.hasChanged(40)){const e=this._context.configuration.options,t=e.get(102),i=e.get(74),n=e.get(40),o=e.get(105),s={vertical:t.vertical,horizontal:t.horizontal,verticalScrollbarSize:t.verticalScrollbarSize,horizontalScrollbarSize:t.horizontalScrollbarSize,scrollByPage:t.scrollByPage,handleMouseWheel:t.handleMouseWheel,mouseWheelScrollSensitivity:i,fastScrollSensitivity:n,scrollPredominantAxis:o};this.scrollbar.updateOptions(s)}return e.hasChanged(143)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+Rv(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}var SP=i(6848),kP={};kP.styleTagTransform=Vr(),kP.setAttributes=Pr(),kP.insert=Rr().bind(null,"head"),kP.domAPI=Tr(),kP.insertStyleElement=Br(),Ir()(SP.Z,kP),SP.Z&&SP.Z.locals&&SP.Z.locals;class LP extends VO{constructor(e){super(),this._context=e,this._primaryPosition=null;const t=this._context.configuration.options,i=t.get(144),n=t.get(50);this._lineHeight=t.get(66),this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(16),this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(144),n=t.get(50);return this._lineHeight=t.get(66),this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(16),!0}onCursorStateChanged(e){var t;const i=e.selections[0].getPosition();return!(null===(t=this._primaryPosition)||void 0===t?void 0:t.equals(i))&&(this._primaryPosition=i,!0)}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onLanguageConfigurationChanged(e){return!0}prepareRender(e){var t,i,n,o;if(!this._bracketPairGuideOptions.indentation&&!1===this._bracketPairGuideOptions.bracketPairs)return void(this._renderResult=null);const s=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=e.scrollWidth,l=this._lineHeight,h=this._primaryPosition,d=this.getGuidesByLine(s,Math.min(r+1,this._context.viewModel.getLineCount()),h),c=[];for(let h=s;h<=r;h++){const r=h-s,u=d[r];let g="";const p=null!==(i=null===(t=e.visibleRangeForPosition(new ch(h,1)))||void 0===t?void 0:t.left)&&void 0!==i?i:0;for(const t of u){const i=-1===t.column?p+(t.visibleColumn-1)*this._spaceWidth:e.visibleRangeForPosition(new ch(h,t.column)).left;if(i>a||this._maxIndentLeft>0&&i>this._maxIndentLeft)break;const s=t.horizontalLine?t.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",r=t.horizontalLine?(null!==(o=null===(n=e.visibleRangeForPosition(new ch(h,t.horizontalLine.endColumn)))||void 0===n?void 0:n.left)&&void 0!==o?o:i+this._spaceWidth)-i:this._spaceWidth;g+=`<div class="core-guide ${t.className} ${s}" style="left:${i}px;height:${l}px;width:${r}px"></div>`}c[r]=g}this._renderResult=c}getGuidesByLine(e,t,i){const n=!1!==this._bracketPairGuideOptions.bracketPairs?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:!0===this._bracketPairGuideOptions.bracketPairsHorizontal?Gb.Enabled:"active"===this._bracketPairGuideOptions.bracketPairsHorizontal?Gb.EnabledForActive:Gb.Disabled,includeInactive:!0===this._bracketPairGuideOptions.bracketPairs}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let s=0,r=0,a=0;if(!1!==this._bracketPairGuideOptions.highlightActiveIndentation&&i){const n=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);s=n.startLineNumber,r=n.endLineNumber,a=n.indent}const{indentSize:l}=this._context.viewModel.model.getOptions(),h=[];for(let i=e;i<=t;i++){const t=new Array;h.push(t);const d=n?n[i-e]:[],c=new eu(d),u=o?o[i-e]:0;for(let e=1;e<=u;e++){const n=(e-1)*l+1,o=("always"===this._bracketPairGuideOptions.highlightActiveIndentation||0===d.length)&&s<=i&&i<=r&&e===a;t.push(...c.takeWhile((e=>e.visibleColumn<n))||[]);const h=c.peek();h&&h.visibleColumn===n&&!h.horizontalLine||t.push(new Zb(n,-1,"core-guide-indent lvl-"+(e-1)%30+(o?" indent-active":""),null,-1,-1))}t.push(...c.takeWhile((e=>!0))||[])}return h}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function xP(e){if(!e||!e.isTransparent())return e}Fv(((e,t)=>{const i=[{bracketColor:mb,guideColor:yb,guideColorActive:Eb},{bracketColor:fb,guideColor:Sb,guideColorActive:Nb},{bracketColor:_b,guideColor:kb,guideColorActive:Ib},{bracketColor:vb,guideColor:Lb,guideColorActive:Mb},{bracketColor:bb,guideColor:xb,guideColorActive:Tb},{bracketColor:wb,guideColor:Db,guideColorActive:Ab}],n=new Xb,o=[{indentColor:$v,indentColorActive:Jv},{indentColor:Gv,indentColorActive:eb},{indentColor:Zv,indentColorActive:tb},{indentColor:Yv,indentColorActive:ib},{indentColor:Qv,indentColorActive:nb},{indentColor:Xv,indentColorActive:ob}],s=i.map((t=>{var i,n;const o=e.getColor(t.bracketColor),s=e.getColor(t.guideColor),r=e.getColor(t.guideColorActive),a=xP(null!==(i=xP(s))&&void 0!==i?i:null==o?void 0:o.transparent(.3)),l=xP(null!==(n=xP(r))&&void 0!==n?n:o);if(a&&l)return{guideColor:a,guideColorActive:l}})).filter(pl),r=o.map((t=>{const i=e.getColor(t.indentColor),n=e.getColor(t.indentColorActive),o=xP(i),s=xP(n);if(o&&s)return{indentColor:o,indentColorActive:s}})).filter(pl);if(s.length>0){for(let e=0;e<30;e++){const i=s[e%s.length];t.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(e).replace(/ /g,".")} { --guide-color: ${i.guideColor}; --guide-color-active: ${i.guideColorActive}; }`)}t.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),t.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),t.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),t.addRule(`.monaco-editor .vertical.${n.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),t.addRule(`.monaco-editor .horizontal-top.${n.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),t.addRule(`.monaco-editor .horizontal-bottom.${n.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(r.length>0){for(let e=0;e<30;e++){const i=r[e%r.length];t.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${e} { --indent-color: ${i.indentColor}; --indent-color-active: ${i.indentColorActive}; }`)}t.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),t.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}}));var DP=i(9565),EP={};EP.styleTagTransform=Vr(),EP.setAttributes=Pr(),EP.insert=Rr().bind(null,"head"),EP.domAPI=Tr(),EP.insertStyleElement=Br(),Ir()(DP.Z,EP),DP.Z&&DP.Z.locals&&DP.Z.locals;class NP{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}class IP{constructor(){this._currentVisibleRange=new tc(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class MP{constructor(e,t,i,n,o,s,r){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=n,this.startScrollTop=o,this.stopScrollTop=s,this.scrollType=r,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class TP{constructor(e,t,i,n,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=n,this.scrollType=o,this.type="selections";let s=t[0].startLineNumber,r=t[0].endLineNumber;for(let e=1,i=t.length;e<i;e++){const i=t[e];s=Math.min(s,i.startLineNumber),r=Math.max(r,i.endLineNumber)}this.minLineNumber=s,this.maxLineNumber=r}}class AP extends OR{constructor(e,t){super(e),this._linesContent=t,this._textRangeRestingSpot=document.createElement("div"),this._visibleLines=new iP(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration,n=this._context.configuration.options,o=n.get(50),s=n.get(144);this._lineHeight=n.get(66),this._typicalHalfwidthCharacterWidth=o.typicalHalfwidthCharacterWidth,this._isViewportWrapping=s.isViewportWrapping,this._revealHorizontalRightPadding=n.get(99),this._cursorSurroundingLines=n.get(29),this._cursorSurroundingLinesStyle=n.get(30),this._canUseLayerHinting=!n.get(32),this._viewLineOptions=new lO(i,this._context.theme.type),PR.write(this.domNode,7),this.domNode.setClassName(`view-lines ${$O}`),Bx(this.domNode,o),this._maxLineWidth=0,this._asyncUpdateLineWidths=new Zt((()=>{this._updateLineWidthsSlow()}),200),this._asyncCheckMonospaceFontAssumptions=new Zt((()=>{this._checkMonospaceFontAssumptions()}),2e3),this._lastRenderedData=new IP,this._horizontalRevealRequest=null,this._stickyScrollEnabled=n.get(114).enabled,this._maxNumberStickyLines=n.get(114).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new hO(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(144)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(50),n=t.get(144);return this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(99),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(114).enabled,this._maxNumberStickyLines=t.get(114).maxLineCount,Bx(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(143)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new lO(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const e=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let t=e;t<=i;t++)this._visibleLines.getVisibleLine(t).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let e=t;e<=i;e++)n=this._visibleLines.getVisibleLine(e).onSelectionChanged()||n;return n}onDecorationsChanged(e){{const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++)this._visibleLines.getVisibleLine(i).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(-1===t)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new MP(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new TP(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const n=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,n),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTop<t||e.scrollTop>i)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(null===i)return null;const n=this._getLineNumberFor(i);if(-1===n)return null;if(n<1||n>this._context.viewModel.getLineCount())return null;if(1===this._context.viewModel.getLineMaxColumn(n))return new ch(n,1);const o=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();if(n<o||n>s)return null;let r=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(e,t);const a=this._context.viewModel.getLineMinColumn(n);return r<a&&(r=a),new ch(n,r)}_getViewLineDomNode(e){for(;e&&1===e.nodeType;){if(e.className===hO.CLASS_NAME)return e;e=e.parentElement}return null}_getLineNumberFor(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++)if(e===this._visibleLines.getVisibleLine(n).getDomNode())return n;return-1}getLineWidth(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();if(e<t||e>i)return-1;const n=new NP(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(n);return this._updateLineWidthsSlowIfDomDidLayout(n),o}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=tc.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;const o=[];let s=0;const r=new NP(this.domNode.domNode,this._textRangeRestingSpot);let a=0;t&&(a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new ch(n.startLineNumber,1)).lineNumber);const l=this._visibleLines.getStartLineNumber(),h=this._visibleLines.getEndLineNumber();for(let e=n.startLineNumber;e<=n.endLineNumber;e++){if(e<l||e>h)continue;const d=e===n.startLineNumber?n.startColumn:1,c=e!==n.endLineNumber,u=c?this._context.viewModel.getLineMaxColumn(e):n.endColumn,g=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,d,u,r);if(g){if(t&&e<i){const t=a;a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new ch(e+1,1)).lineNumber,t!==a&&(g.ranges[g.ranges.length-1].width+=this._typicalHalfwidthCharacterWidth)}o[s++]=new WR(g.outsideRenderedLine,e,VR.from(g.ranges),c)}}return this._updateLineWidthsSlowIfDomDidLayout(r),0===s?null:o}_visibleRangesForLineRange(e,t,i){if(this.shouldRender())return null;if(e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber())return null;const n=new NP(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,n);return this._updateLineWidthsSlowIfDomDidLayout(n),o}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new HR(t.outsideRenderedLine,t.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=1,o=!0;for(let s=t;s<=i;s++){const t=this._visibleLines.getVisibleLine(s);!e||t.getWidthIsFast()?n=Math.max(n,t.getWidth(null)):o=!1}return o&&1===t&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++){const i=this._visibleLines.getVisibleLine(o);if(i.needsMonospaceFontCheck()){const n=i.getWidth(null);n>t&&(t=n,e=o)}}if(-1!==e&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let e=i;e<=n;e++)this._visibleLines.getVisibleLine(e).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const t=this._horizontalRevealRequest;if(e.startLineNumber<=t.minLineNumber&&t.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const e=this._computeScrollLeftToReveal(t);e&&(this._isViewportWrapping||this._ensureMaxLineWidth(e.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:e.scrollLeft},t.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),ze&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++)if(this._visibleLines.getVisibleLine(i).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth<t&&(this._maxLineWidth=t,this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth))}_computeScrollTopToRevealRange(e,t,i,n,o,s){const r=e.top,a=e.height,l=r+a;let h,d,c;if(o&&o.length>0){let e=o[0].startLineNumber,t=o[0].endLineNumber;for(let i=1,n=o.length;i<n;i++){const n=o[i];e=Math.min(e,n.startLineNumber),t=Math.max(t,n.endLineNumber)}h=!1,d=this._context.viewLayout.getVerticalOffsetForLineNumber(e),c=this._context.viewLayout.getVerticalOffsetForLineNumber(t)+this._lineHeight}else{if(!n)return-1;h=!0,d=this._context.viewLayout.getVerticalOffsetForLineNumber(n.startLineNumber),c=this._context.viewLayout.getVerticalOffsetForLineNumber(n.endLineNumber)+this._lineHeight}let u,g=0,p=0;if("mouse"!==t&&!i||"default"!==this._cursorSurroundingLinesStyle){const e=Math.min(a/this._lineHeight/2,this._cursorSurroundingLines);g=this._stickyScrollEnabled?Math.max(e,this._maxNumberStickyLines)*this._lineHeight:e*this._lineHeight,p=Math.max(0,e-1)*this._lineHeight}else i||(g=this._lineHeight);if(i||0!==s&&4!==s||(p+=this._lineHeight),d-=g,c+=p,c-d>a){if(!h)return-1;u=d}else if(5===s||6===s)if(6===s&&r<=d&&c<=l)u=r;else{const e=d-Math.max(5*this._lineHeight,.2*a),t=c-a;u=Math.max(t,e)}else if(1===s||2===s)if(2===s&&r<=d&&c<=l)u=r;else{const e=(d+c)/2;u=Math.max(0,e-a/2)}else u=this._computeMinimumScrolling(r,l,d,c,3===s,4===s);return u}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(143),n=t.left,o=n+t.width-i.verticalScrollbarWidth;let s=1073741824,r=0;if("range"===e.type){const t=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!t)return null;for(const e of t.ranges)s=Math.min(s,Math.round(e.left)),r=Math.max(r,Math.round(e.left+e.width))}else for(const t of e.selections){if(t.startLineNumber!==t.endLineNumber)return null;const e=this._visibleRangesForLineRange(t.startLineNumber,t.startColumn,t.endColumn);if(!e)return null;for(const t of e.ranges)s=Math.min(s,Math.round(t.left)),r=Math.max(r,Math.round(t.left+t.width))}return e.minimalReveal||(s=Math.max(0,s-AP.HORIZONTAL_EXTRA_PX),r+=this._revealHorizontalRightPadding),"selections"===e.type&&r-s>t.width?null:{scrollLeft:this._computeMinimumScrolling(n,o,s,r),maxHorizontalOffset:r}}_computeMinimumScrolling(e,t,i,n,o,s){o=!!o,s=!!s;const r=(t|=0)-(e|=0);return(n|=0)-(i|=0)<r?o?i:s?Math.max(0,n-r):i<e?i:n>t?Math.max(0,n-r):e:i}}AP.HORIZONTAL_EXTRA_PX=30;var RP=i(4444),OP={};OP.styleTagTransform=Vr(),OP.setAttributes=Pr(),OP.insert=Rr().bind(null,"head"),OP.domAPI=Tr(),OP.insertStyleElement=Br(),Ir()(RP.Z,OP),RP.Z&&RP.Z.locals&&RP.Z.locals;var PP=i(4827),FP={};FP.styleTagTransform=Vr(),FP.setAttributes=Pr(),FP.insert=Rr().bind(null,"head"),FP.domAPI=Tr(),FP.insertStyleElement=Br(),Ir()(PP.Z,FP),PP.Z&&PP.Z.locals&&PP.Z.locals;class BP{constructor(e,t,i,n){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i),this.zIndex=null!=n?n:0}}class WP{constructor(e,t){this.className=e,this.zIndex=t}}class VP{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class zP extends VO{_render(e,t,i){const n=[];for(let i=e;i<=t;i++)n[i-e]=new VP;if(0===i.length)return n;i.sort(((e,t)=>e.className===t.className?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.className<t.className?-1:1));let o=null,s=0;for(let r=0,a=i.length;r<a;r++){const a=i[r],l=a.className,h=a.zIndex;let d=Math.max(a.startLineNumber,e)-e;const c=Math.min(a.endLineNumber,t)-e;o===l?(d=Math.max(s+1,d),s=Math.max(s,c)):(o=l,s=c);for(let e=d;e<=s;e++)n[e].add(new WP(l,h))}return n}}class HP extends OR{constructor(e){super(e),this._widgets={},this._context=e;const t=this._context.configuration.options,i=t.get(143);this.domNode=Fx(document.createElement("div")),this.domNode.setClassName("glyph-margin-widgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this._lineHeight=t.get(66),this._glyphMargin=t.get(57),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._glyphMarginDecorationLaneCount=i.glyphMarginDecorationLaneCount,this._managedDomNodes=[],this._decorationGlyphsToRender=[]}dispose(){this._managedDomNodes=[],this._decorationGlyphsToRender=[],this._widgets={},super.dispose()}getWidgets(){return Object.values(this._widgets)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._lineHeight=t.get(66),this._glyphMargin=t.get(57),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._glyphMarginDecorationLaneCount=i.glyphMarginDecorationLaneCount,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}addWidget(e){const t=Fx(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:e.getPosition(),domNode:t,renderInfo:null},t.setPosition("absolute"),t.setDisplay("none"),t.setAttribute("widgetId",e.getId()),this.domNode.appendChild(t),this.setShouldRender()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return!(i.preference.lane===t.lane&&i.preference.zIndex===t.zIndex&&tc.equalsRange(i.preference.range,t.range)||(i.preference=t,this.setShouldRender(),0))}removeWidget(e){var t;const i=e.getId();if(this._widgets[i]){const e=this._widgets[i].domNode.domNode;delete this._widgets[i],null===(t=e.parentNode)||void 0===t||t.removeChild(e),this.setShouldRender()}}_collectDecorationBasedGlyphRenderRequest(e,t){var i,n,o;const s=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=e.getDecorationsInViewport();for(const e of a){const a=e.options.glyphMarginClassName;if(!a)continue;const l=Math.max(e.range.startLineNumber,s),h=Math.min(e.range.endLineNumber,r),d=Math.min(null!==(n=null===(i=e.options.glyphMargin)||void 0===i?void 0:i.position)&&void 0!==n?n:1,this._glyphMarginDecorationLaneCount),c=null!==(o=e.options.zIndex)&&void 0!==o?o:0;for(let e=l;e<=h;e++)t.push(new UP(e,d,c,a))}}_collectWidgetBasedGlyphRenderRequest(e,t){const i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber;for(const e of Object.values(this._widgets)){const o=e.preference.range,{startLineNumber:s,endLineNumber:r}=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(tc.lift(o));if(!s||!r||r<i||s>n)continue;const a=Math.max(s,i),l=Math.min(e.preference.lane,this._glyphMarginDecorationLaneCount);t.push(new KP(a,l,e.preference.zIndex,e))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort(((e,t)=>e.lineNumber===t.lineNumber?e.lane===t.lane?e.zIndex===t.zIndex?t.type===e.type?0===e.type&&0===t.type?e.className<t.className?-1:1:0:t.type-e.type:t.zIndex-e.zIndex:e.lane-t.lane:e.lineNumber-t.lineNumber)),t}prepareRender(e){if(!this._glyphMargin)return void(this._decorationGlyphsToRender=[]);for(const e of Object.values(this._widgets))e.renderInfo=null;const t=new eu(this._collectSortedGlyphRenderRequests(e)),i=[];for(;t.length>0;){const e=t.peek();if(!e)break;const n=t.takeWhile((t=>t.lineNumber===e.lineNumber&&t.lane===e.lane));if(!n||0===n.length)break;const o=n[0];if(0===o.type){const e=[];for(const t of n){if(t.zIndex!==o.zIndex||t.type!==o.type)break;0!==e.length&&e[e.length-1]===t.className||e.push(t.className)}i.push(o.accept(e.join(" ")))}else o.widget.renderInfo={lineNumber:o.lineNumber,lane:o.lane}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(const e of Object.values(this._widgets))e.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const e=this._managedDomNodes.pop();null==e||e.domNode.remove()}return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const i of Object.values(this._widgets))if(i.renderInfo){const n=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+(i.renderInfo.lane-1)*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(n),i.domNode.setLeft(o),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}else i.domNode.setDisplay("none");for(let i=0;i<this._decorationGlyphsToRender.length;i++){const n=this._decorationGlyphsToRender[i],o=e.viewportData.relativeVerticalOffset[n.lineNumber-e.viewportData.startLineNumber],s=this._glyphMarginLeft+(n.lane-1)*this._lineHeight;let r;i<this._managedDomNodes.length?r=this._managedDomNodes[i]:(r=Fx(document.createElement("div")),this._managedDomNodes.push(r),this.domNode.appendChild(r)),r.setClassName("cgmr codicon "+n.combinedClassName),r.setPosition("absolute"),r.setTop(o),r.setLeft(s),r.setWidth(t),r.setHeight(this._lineHeight)}for(;this._managedDomNodes.length>this._decorationGlyphsToRender.length;){const e=this._managedDomNodes.pop();null==e||e.domNode.remove()}}}class UP{constructor(e,t,i,n){this.lineNumber=e,this.lane=t,this.zIndex=i,this.className=n,this.type=0}accept(e){return new jP(this.lineNumber,this.lane,e)}}class KP{constructor(e,t,i,n){this.lineNumber=e,this.lane=t,this.zIndex=i,this.widget=n,this.type=1}}class jP{constructor(e,t,i){this.lineNumber=e,this.lane=t,this.combinedClassName=i}}class qP extends zP{constructor(e){super(),this._context=e;const t=this._context.configuration.options.get(143);this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options.get(143);return this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let e=0,o=t.length;e<o;e++){const o=t[e],s=o.options.linesDecorationsClassName,r=o.options.zIndex;s&&(i[n++]=new BP(o.range.startLineNumber,o.range.endLineNumber,s,r));const a=o.options.firstLineDecorationClassName;a&&(i[n++]=new BP(o.range.startLineNumber,o.range.startLineNumber,a,r))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o='" style="left:'+this._decorationsLeft.toString()+"px;width:"+this._decorationsWidth.toString()+'px;"></div>',s=[];for(let e=t;e<=i;e++){const i=e-t,r=n[i].getDecorations();let a="";for(const e of r)a+='<div class="cldr '+e.className+o;s[i]=a}this._renderResult=s}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}var $P=i(9364),GP={};GP.styleTagTransform=Vr(),GP.setAttributes=Pr(),GP.insert=Rr().bind(null,"head"),GP.domAPI=Tr(),GP.insertStyleElement=Br(),Ir()($P.Z,GP),$P.Z&&$P.Z.locals&&$P.Z.locals;class ZP extends zP{constructor(e){super(),this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let e=0,o=t.length;e<o;e++){const o=t[e],s=o.options.marginClassName,r=o.options.zIndex;s&&(i[n++]=new BP(o.range.startLineNumber,o.range.endLineNumber,s,r))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o=[];for(let e=t;e<=i;e++){const i=e-t,s=n[i].getDecorations();let r="";for(const e of s)r+='<div class="cmdr '+e.className+'" style=""></div>';o[i]=r}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}var YP=i(563),QP={};QP.styleTagTransform=Vr(),QP.setAttributes=Pr(),QP.insert=Rr().bind(null,"head"),QP.domAPI=Tr(),QP.insertStyleElement=Br(),Ir()(YP.Z,QP),YP.Z&&YP.Z.locals&&YP.Z.locals;class XP{constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=XP._clamp(e),this.g=XP._clamp(t),this.b=XP._clamp(i),this.a=XP._clamp(n)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:0|e}}XP.Empty=new XP(0,0,0,0);class JP extends T{static getInstance(){return this._INSTANCE||(this._INSTANCE=x(new JP)),this._INSTANCE}constructor(){super(),this._onDidChange=new q,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(SC.onDidChange((e=>{e.changedColorMap&&this._updateColorMap()})))}_updateColorMap(){const e=SC.getColorMap();if(!e)return this._colors=[XP.Empty],void(this._backgroundIsLight=!0);this._colors=[XP.Empty];for(let t=1;t<e.length;t++){const i=e[t].rgba;this._colors[t]=new XP(i.r,i.g,i.b,Math.round(255*i.a))}const t=e[2].getRelativeLuminance();this._backgroundIsLight=t>=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}JP._INSTANCE=null;class eF{constructor(e,t,i,n){this._viewportBrand=void 0,this.top=0|e,this.left=0|t,this.width=0|i,this.height=0|n}}class tF{constructor(e,t){this.tabSize=e,this.data=t}}class iF{constructor(e,t,i,n,o,s,r){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=n,this.startVisibleColumn=o,this.tokens=s,this.inlineDecorations=r}}class nF{constructor(e,t,i,n,o,s,r,a,l,h){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=n,this.isBasicASCII=nF.isBasicASCII(i,s),this.containsRTL=nF.containsRTL(i,this.isBasicASCII,o),this.tokens=r,this.inlineDecorations=a,this.tabSize=l,this.startVisibleColumn=h}static isBasicASCII(e,t){return!t||zn(e)}static containsRTL(e,t,i){return!(t||!i)&&Wn(e)}}class oF{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class sF{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=n}toInlineDecoration(e){return new oF(new tc(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class rF{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class aF{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.color<t.color?-1:e.color>t.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&Ic(e.data,t.data)}static equalsArr(e,t){return Ic(e,t,aF.equals)}}const lF=(()=>{const e=[];for(let t=32;t<=126;t++)e.push(t);return e.push(65533),e})();class hF{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=hF.soften(e,.8),this.charDataLight=hF.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=Bw(e[n]*t);return i}renderChar(e,t,i,n,o,s,r,a,l,h,d){const c=1*this.scale,u=2*this.scale,g=d?1:u;if(t+c>e.width||i+g>e.height)return void console.warn("bad render request outside image data");const p=h?this.charDataLight:this.charDataNormal,m=((e,t)=>(e-=32)<0||e>96?t<=2?(e+96)%96:95:e)(n,l),f=4*e.width,_=r.r,v=r.g,b=r.b,w=o.r-_,C=o.g-v,y=o.b-b,S=Math.max(s,a),k=e.data;let L=m*c*u,x=i*f+4*t;for(let e=0;e<g;e++){let e=x;for(let t=0;t<c;t++){const t=p[L++]/255*(s/255);k[e++]=_+w*t,k[e++]=v+C*t,k[e++]=b+y*t,k[e++]=S}x+=f}}blockRenderChar(e,t,i,n,o,s,r,a){const l=1*this.scale,h=2*this.scale,d=a?1:h;if(t+l>e.width||i+d>e.height)return void console.warn("bad render request outside image data");const c=4*e.width,u=o/255*.5,g=s.r,p=s.g,m=s.b,f=g+(n.r-g)*u,_=p+(n.g-p)*u,v=m+(n.b-m)*u,b=Math.max(o,r),w=e.data;let C=i*c+4*t;for(let e=0;e<d;e++){let e=C;for(let t=0;t<l;t++)w[e++]=f,w[e++]=_,w[e++]=v,w[e++]=b;C+=c}}}const dF={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15},cF=e=>{const t=new Uint8ClampedArray(e.length/2);for(let i=0;i<e.length;i+=2)t[i>>1]=dF[e[i]]<<4|15&dF[e[i+1]];return t},uF={1:w((()=>cF("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792"))),2:w((()=>cF("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126")))};class gF{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return i=uF[e]?new hF(uF[e](),e):gF.createFromSampleData(gF.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=960,t.style.width="960px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let n=0;for(const e of lF)i.fillText(String.fromCharCode(e),n,8),n+=10;return i.getImageData(0,0,960,16)}static createFromSampleData(e,t){if(61440!==e.length)throw new Error("Unexpected source in MinimapCharRenderer");const i=gF._downsample(e,t);return new hF(i,t)}static _downsampleChar(e,t,i,n,o){const s=1*o,r=2*o;let a=n,l=0;for(let n=0;n<r;n++){const o=n/r*16,h=(n+1)/r*16;for(let n=0;n<s;n++){const r=n/s*10,d=(n+1)/s*10;let c=0,u=0;for(let i=o;i<h;i++){const n=t+3840*Math.floor(i),o=1-(i-Math.floor(i));for(let t=r;t<d;t++){const i=1-(t-Math.floor(t)),s=n+4*Math.floor(t),r=i*o;u+=r,c+=e[s]*e[s+3]/255*r}}const g=c/u;l=Math.max(l,g),i[a++]=Bw(g)}}return l}static _downsample(e,t){const i=2*t*1*t,n=96*i,o=new Uint8ClampedArray(n);let s=0,r=0,a=0;for(let n=0;n<96;n++)a=Math.max(a,this._downsampleChar(e,r,o,s,t)),s+=i,r+=40;if(a>0){const e=255/a;for(let t=0;t<n;t++)o[t]*=e}return o}}class pF{constructor(e,t,i){const n=e.options,o=n.get(141),s=n.get(143),r=s.minimap,a=n.get(50),l=n.get(72);this.renderMinimap=r.renderMinimap,this.size=l.size,this.minimapHeightIsEditorHeight=r.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=n.get(104),this.paddingTop=n.get(83).top,this.paddingBottom=n.get(83).bottom,this.showSlider=l.showSlider,this.autohide=l.autohide,this.pixelRatio=o,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.lineHeight=n.get(66),this.minimapLeft=r.minimapLeft,this.minimapWidth=r.minimapWidth,this.minimapHeight=s.height,this.canvasInnerWidth=r.minimapCanvasInnerWidth,this.canvasInnerHeight=r.minimapCanvasInnerHeight,this.canvasOuterWidth=r.minimapCanvasOuterWidth,this.canvasOuterHeight=r.minimapCanvasOuterHeight,this.isSampling=r.minimapIsSampling,this.editorHeight=s.height,this.fontScale=r.minimapScale,this.minimapLineHeight=r.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.charRenderer=w((()=>gF.create(this.fontScale,a.fontFamily))),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=pF._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=pF._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(mv);return i?new XP(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(fv);return t?XP._clamp(Math.round(255*t.rgba.a)):255}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class mF{constructor(e,t,i,n,o,s,r,a,l){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=o,this.sliderHeight=s,this.topPaddingLineCount=r,this.startLineNumber=a,this.endLineNumber=l}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,n,o,s,r,a,l,h,d){const c=e.pixelRatio,u=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/u),p=e.lineHeight;if(e.minimapHeightIsEditorHeight){let t=a*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(t+=Math.max(0,o-e.lineHeight-e.paddingBottom));const i=Math.max(1,Math.floor(o*o/t)),n=Math.max(0,e.minimapHeight-i),s=n/(h-o),d=l*s,c=n>0,u=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),g=Math.floor(e.paddingTop/e.lineHeight);return new mF(l,h,c,s,d,i,g,1,Math.min(r,u))}let m;if(s&&i!==r){const e=i-t+1;m=Math.floor(e*u/c)}else{const e=o/p;m=Math.floor(e*u/c)}const f=Math.floor(e.paddingTop/p);let _,v=Math.floor(e.paddingBottom/p);if(e.scrollBeyondLastLine){const e=o/p;v=Math.max(v,e-1)}_=v>0?(f+r+v-o/p-1)*u/c:Math.max(0,(f+r)*u/c-m),_=Math.min(e.minimapHeight-m,_);const b=_/(h-o),w=l*b;if(g>=f+r+v)return new mF(l,h,_>0,b,w,m,f,1,r);{let i,o;i=t>1?t+f:Math.max(1,l/p);let s=Math.max(1,Math.floor(i-w*c/u));s<f?(o=f-s+1,s=1):(o=0,s=Math.max(1,s-f)),d&&d.scrollHeight===h&&(d.scrollTop>l&&(s=Math.min(s,d.startLineNumber),o=Math.max(o,d.topPaddingLineCount)),d.scrollTop<l&&(s=Math.max(s,d.startLineNumber),o=Math.min(o,d.topPaddingLineCount)));const a=Math.min(r,s-o+g-1),_=(l-n)/p;let v;return v=l>=e.paddingTop?(t-s+o+_)*u/c:l/e.paddingTop*(o+_)*u/c,new mF(l,h,!0,b,v,m,o,s,a)}}}class fF{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}fF.INVALID=new fF(-1);class _F{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new tP((()=>fF.INVALID)),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const t=this._renderedLines._get().lines;for(let e=0,i=t.length;e<i;e++)if(-1===t[e].dy)return!1;return!0}scrollEquals(e){return this.renderedLayout.startLineNumber===e.startLineNumber&&this.renderedLayout.endLineNumber===e.endLineNumber}_get(){const e=this._renderedLines._get();return{imageData:this._imageData,rendLineNumberStart:e.rendLineNumberStart,lines:e.lines}}onLinesChanged(e,t){return this._renderedLines.onLinesChanged(e,t)}onLinesDeleted(e,t){this._renderedLines.onLinesDeleted(e,t)}onLinesInserted(e,t){this._renderedLines.onLinesInserted(e,t)}onTokensChanged(e){return this._renderedLines.onTokensChanged(e)}}class vF{constructor(e,t,i,n){this._backgroundFillData=vF._createBackgroundFillData(t,i,n),this._buffers=[e.createImageData(t,i),e.createImageData(t,i)],this._lastUsedBuffer=0}getBuffer(){this._lastUsedBuffer=1-this._lastUsedBuffer;const e=this._buffers[this._lastUsedBuffer];return e.data.set(this._backgroundFillData),e}static _createBackgroundFillData(e,t,i){const n=i.r,o=i.g,s=i.b,r=i.a,a=new Uint8ClampedArray(e*t*4);let l=0;for(let i=0;i<t;i++)for(let t=0;t<e;t++)a[l]=n,a[l+1]=o,a[l+2]=s,a[l+3]=r,l+=4;return a}}class bF{static compute(e,t,i){if(0===e.renderMinimap||!e.isSampling)return[null,[]];const{minimapLineCount:n}=Ek.computeContainedMinimapLineCount({viewLineCount:t,scrollBeyondLastLine:e.scrollBeyondLastLine,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:e.editorHeight,lineHeight:e.lineHeight,pixelRatio:e.pixelRatio}),o=t/n,s=o/2;if(!i||0===i.minimapLines.length){const e=[];if(e[0]=1,n>1){for(let t=0,i=n-1;t<i;t++)e[t]=Math.round(t*o+s);e[n-1]=t}return[new bF(o,e),[]]}const r=i.minimapLines,a=r.length,l=[];let h=0,d=0,c=1,u=[],g=null;for(let e=0;e<n;e++){const i=Math.max(c,Math.round(e*o)),p=Math.max(i,Math.round((e+1)*o));for(;h<a&&r[h]<i;){if(u.length<10){const e=h+1+d;g&&"deleted"===g.type&&g._oldIndex===h-1?g.deleteToLineNumber++:(g={type:"deleted",_oldIndex:h,deleteFromLineNumber:e,deleteToLineNumber:e},u.push(g)),d--}h++}let m;if(h<a&&r[h]<=p)m=r[h],h++;else if(m=0===e?1:e+1===n?t:Math.round(e*o+s),u.length<10){const t=h+1+d;g&&"inserted"===g.type&&g._i===e-1?g.insertToLineNumber++:(g={type:"inserted",_i:e,insertFromLineNumber:t,insertToLineNumber:t},u.push(g)),d++}l[e]=m,c=m}if(u.length<10)for(;h<a;){const e=h+1+d;g&&"deleted"===g.type&&g._oldIndex===h-1?g.deleteToLineNumber++:(g={type:"deleted",_oldIndex:h,deleteFromLineNumber:e,deleteToLineNumber:e},u.push(g)),d--,h++}else u=[{type:"flush"}];return[new bF(o,l),u]}constructor(e,t){this.samplingRatio=e,this.minimapLines=t}modelLineToMinimapLine(e){return Math.min(this.minimapLines.length,Math.max(1,Math.round(e/this.samplingRatio)))}modelLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e)-1;for(;i>0&&this.minimapLines[i-1]>=e;)i--;let n=this.modelLineToMinimapLine(t)-1;for(;n+1<this.minimapLines.length&&this.minimapLines[n+1]<=t;)n++;if(i===n){const n=this.minimapLines[i];if(n<e||n>t)return null}return[i+1,n+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),n=this.modelLineToMinimapLine(t);return e!==t&&n===i&&(n===this.minimapLines.length?i>1&&i--:n++),[i,n]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,n=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]<e.fromLineNumber);o--)this.minimapLines[o]<=e.toLineNumber?(this.minimapLines[o]=Math.max(1,e.fromLineNumber-1),i=Math.min(i,o),n=Math.max(n,o)):this.minimapLines[o]-=t;return[i,n]}onLinesInserted(e){const t=e.toLineNumber-e.fromLineNumber+1;for(let i=this.minimapLines.length-1;i>=0&&!(this.minimapLines[i]<e.fromLineNumber);i--)this.minimapLines[i]+=t}}class wF extends OR{constructor(e){super(e),this.tokensColorTracker=JP.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new pF(this._context.configuration,this._context.theme,this.tokensColorTracker);const[t]=bF.compute(this.options,this._context.viewModel.getLineCount(),null);this._samplingState=t,this._shouldCheckSampling=!1,this._actual=new CF(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){const e=new pF(this._context.configuration,this._context.theme,this.tokensColorTracker);return!this.options.equals(e)&&(this.options=e,this._recreateLineSampling(),this._actual.onDidChangeOptions(),!0)}onConfigurationChanged(e){return this._onOptionsMaybeChanged()}onCursorStateChanged(e){return this._selections=e.selections,this._minimapSelections=null,this._actual.onSelectionChanged()}onDecorationsChanged(e){return!!e.affectsMinimap&&this._actual.onDecorationsChanged()}onFlushed(e){return this._samplingState&&(this._shouldCheckSampling=!0),this._actual.onFlushed()}onLinesChanged(e){if(this._samplingState){const t=this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber,e.fromLineNumber+e.count-1);return!!t&&this._actual.onLinesChanged(t[0],t[1]-t[0]+1)}return this._actual.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){if(this._samplingState){const[t,i]=this._samplingState.onLinesDeleted(e);return t<=i&&this._actual.onLinesChanged(t+1,i-t+1),this._shouldCheckSampling=!0,!0}return this._actual.onLinesDeleted(e.fromLineNumber,e.toLineNumber)}onLinesInserted(e){return this._samplingState?(this._samplingState.onLinesInserted(e),this._shouldCheckSampling=!0,!0):this._actual.onLinesInserted(e.fromLineNumber,e.toLineNumber)}onScrollChanged(e){return this._actual.onScrollChanged()}onThemeChanged(e){return this._actual.onThemeChanged(),this._onOptionsMaybeChanged(),!0}onTokensChanged(e){if(this._samplingState){const t=[];for(const i of e.ranges){const e=this._samplingState.modelLineRangeToMinimapLineRange(i.fromLineNumber,i.toLineNumber);e&&t.push({fromLineNumber:e[0],toLineNumber:e[1]})}return!!t.length&&this._actual.onTokensChanged(t)}return this._actual.onTokensChanged(e.ranges)}onTokensColorsChanged(e){return this._onOptionsMaybeChanged(),this._actual.onTokensColorsChanged()}onZonesChanged(e){return this._actual.onZonesChanged()}prepareRender(e){this._shouldCheckSampling&&(this._shouldCheckSampling=!1,this._recreateLineSampling())}render(e){let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber;this._samplingState&&(t=this._samplingState.modelLineToMinimapLine(t),i=this._samplingState.modelLineToMinimapLine(i));const n={viewportContainsWhitespaceGaps:e.viewportData.whitespaceViewportData.length>0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(n)}_recreateLineSampling(){this._minimapSelections=null;const e=Boolean(this._samplingState),[t,i]=bF.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const e of i)switch(e.type){case"deleted":this._actual.onLinesDeleted(e.deleteFromLineNumber,e.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(e.insertFromLineNumber,e.insertToLineNumber);break;case"flush":this._actual.onFlushed()}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){const n=[];for(let o=0,s=t-e+1;o<s;o++)i[o]?n[o]=this._context.viewModel.getViewLineData(this._samplingState.minimapLines[e+o-1]):n[o]=null;return n}return this._context.viewModel.getMinimapLinesRenderingData(e,t,i).data}getSelections(){if(null===this._minimapSelections)if(this._samplingState){this._minimapSelections=[];for(const e of this._selections){const[t,i]=this._samplingState.decorationLineRangeToMinimapLineRange(e.startLineNumber,e.endLineNumber);this._minimapSelections.push(new ic(t,e.startColumn,i,e.endColumn))}}else this._minimapSelections=this._selections;return this._minimapSelections}getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const n=this._samplingState.minimapLines[e-1],o=this._samplingState.minimapLines[t-1];i=new tc(n,1,o,this._context.viewModel.getLineMaxColumn(o))}else i=new tc(e,1,t,this._context.viewModel.getLineMaxColumn(t));const n=this._context.viewModel.getMinimapDecorationsInRange(i);if(this._samplingState){const e=[];for(const t of n){if(!t.options.minimap)continue;const i=t.range,n=this._samplingState.modelLineToMinimapLine(i.startLineNumber),o=this._samplingState.modelLineToMinimapLine(i.endLineNumber);e.push(new rF(new tc(n,i.startColumn,o,i.endColumn),t.options))}return e}return n}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new tc(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}}class CF extends T{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(cv),this._domNode=Fx(document.createElement("div")),PR.write(this._domNode,8),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=Fx(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=Fx(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=Fx(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=Fx(document.createElement("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=Fx(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=Cs(this._domNode.domNode,or.POINTER_DOWN,(e=>{if(e.preventDefault(),0===this._model.options.renderMinimap)return;if(!this._lastRenderData)return;if("proportional"!==this._model.options.size){if(0===e.button&&this._lastRenderData){const t=As(this._slider.domNode),i=t.top+t.height/2;this._startSliderDragging(e,i,this._lastRenderData.renderedLayout)}return}const t=this._model.options.minimapLineHeight,i=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*e.offsetY;let n=Math.floor(i/t)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;n=Math.min(n,this._model.getLineCount()),this._model.revealLineNumber(n)})),this._sliderPointerMoveMonitor=new lD,this._sliderPointerDownListener=Cs(this._slider.domNode,or.POINTER_DOWN,(e=>{e.preventDefault(),e.stopPropagation(),0===e.button&&this._lastRenderData&&this._startSliderDragging(e,e.pageY,this._lastRenderData.renderedLayout)})),this._gestureDisposable=KL.addTarget(this._domNode.domNode),this._sliderTouchStartListener=bs(this._domNode.domNode,UL.Start,(e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(e))}),{passive:!1}),this._sliderTouchMoveListener=bs(this._domNode.domNode,UL.Change,(e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(e)}),{passive:!1}),this._sliderTouchEndListener=Cs(this._domNode.domNode,UL.End,(e=>{e.preventDefault(),e.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)}))}_startSliderDragging(e,t,i){if(!(e.target&&e.target instanceof Element))return;const n=e.pageX;this._slider.toggleClassName("active",!0);const o=(e,o)=>{const s=As(this._domNode.domNode),r=Math.min(Math.abs(o-n),Math.abs(o-s.left),Math.abs(o-s.left-s.width));if(We&&r>140)return void this._model.setScrollTop(i.scrollTop);const a=e-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(a))};e.pageY!==t&&o(e.pageY,n),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>o(e.pageY,e.pageX)),(()=>{this._slider.toggleClassName("active",!1)}))}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return"always"===this._model.options.showSlider?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide&&e.push("autohide"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new vF(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return!!this._lastRenderData&&this._lastRenderData.onLinesChanged(e,t)}onLinesDeleted(e,t){var i;return null===(i=this._lastRenderData)||void 0===i||i.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var i;return null===(i=this._lastRenderData)||void 0===i||i.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(cv),this._renderDecorations=!0,!0}onTokensChanged(e){return!!this._lastRenderData&&this._lastRenderData.onTokensChanged(e)}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(0===this._model.options.renderMinimap)return this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),void this._sliderHorizontal.setHeight(0);e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const t=mF.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(t.sliderNeeded?"block":"none"),this._slider.setTop(t.sliderTop),this._slider.setHeight(t.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(t.sliderHeight),this.renderDecorations(t),this._lastRenderData=this.renderLines(t)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(tc.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort(((e,t)=>(e.options.zIndex||0)-(t.options.zIndex||0)));const{canvasInnerWidth:n,canvasInnerHeight:o}=this._model.options,s=this._model.options.minimapLineHeight,r=this._model.options.minimapCharWidth,a=this._model.getOptions().tabSize,l=this._decorationsCanvas.domNode.getContext("2d");l.clearRect(0,0,n,o);const h=new yF(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,h,e,s),this._renderDecorationsLineHighlights(l,i,h,e,s);const d=new yF(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,d,e,s,a,r,n),this._renderDecorationsHighlights(l,i,d,e,s,a,r,n)}}_renderSelectionLineHighlights(e,t,i,n,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let s=0,r=0;for(const a of t){const t=n.intersectWithViewport(a);if(!t)continue;const[l,h]=t;for(let e=l;e<=h;e++)i.set(e,!0);const d=n.getYForLineNumber(l,o),c=n.getYForLineNumber(h,o);r>=d||(r>s&&e.fillRect(8,s,e.canvas.width,r-s),s=d),r=c}r>s&&e.fillRect(8,s,e.canvas.width,r-s)}_renderDecorationsLineHighlights(e,t,i,n,o){const s=new Map;for(let r=t.length-1;r>=0;r--){const a=t[r],l=a.options.minimap;if(!l||l.position!==wc.Inline)continue;const h=n.intersectWithViewport(a.range);if(!h)continue;const[d,c]=h,u=l.getColor(this._theme.value);if(!u||u.isTransparent())continue;let g=s.get(u.toString());g||(g=u.transparent(.5).toString(),s.set(u.toString(),g)),e.fillStyle=g;for(let t=d;t<=c;t++){if(i.has(t))continue;i.set(t,!0);const s=n.getYForLineNumber(d,o);e.fillRect(8,s,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,n,o,s,r,a){if(this._selectionColor&&!this._selectionColor.isTransparent())for(const l of t){const t=n.intersectWithViewport(l);if(!t)continue;const[h,d]=t;for(let t=h;t<=d;t++)this.renderDecorationOnLine(e,i,l,this._selectionColor,n,t,o,o,s,r,a)}}_renderDecorationsHighlights(e,t,i,n,o,s,r,a){for(const l of t){const t=l.options.minimap;if(!t)continue;const h=n.intersectWithViewport(l.range);if(!h)continue;const[d,c]=h,u=t.getColor(this._theme.value);if(u&&!u.isTransparent())for(let h=d;h<=c;h++)switch(t.position){case wc.Inline:this.renderDecorationOnLine(e,i,l.range,u,n,h,o,o,s,r,a);continue;case wc.Gutter:{const t=n.getYForLineNumber(h,o),i=2;this.renderDecoration(e,u,i,t,2,o);continue}}}}renderDecorationOnLine(e,t,i,n,o,s,r,a,l,h,d){const c=o.getYForLineNumber(s,a);if(c+r<0||c>this._model.options.canvasInnerHeight)return;const{startLineNumber:u,endLineNumber:g}=i,p=u===s?i.startColumn:1,m=g===s?i.endColumn:this._model.getLineMaxColumn(s),f=this.getXOffsetForPosition(t,s,p,l,h,d),_=this.getXOffsetForPosition(t,s,m,l,h,d);this.renderDecoration(e,n,f,c,_-f,r)}getXOffsetForPosition(e,t,i,n,o,s){if(1===i)return 8;if((i-1)*o>=s)return s;let r=e.get(t);if(!r){const i=this._model.getLineContent(t);r=[8];let a=8;for(let e=1;e<i.length+1;e++){const t=i.charCodeAt(e-1),l=a+(9===t?n*o:Kn(t)?2*o:o);if(l>=s){r[e]=s;break}r[e]=l,a=l}e.set(t,r)}return i-1<r.length?r[i-1]:s}renderDecoration(e,t,i,n,o,s){e.fillStyle=t&&t.toString()||"",e.fillRect(i,n,o,s)}renderLines(e){const t=e.startLineNumber,i=e.endLineNumber,n=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const t=this._lastRenderData._get();return new _F(e,t.imageData,t.lines)}const o=this._getBuffer();if(!o)return null;const[s,r,a]=CF._renderUntouchedLines(o,e.topPaddingLineCount,t,i,n,this._lastRenderData),l=this._model.getMinimapLinesRenderingData(t,i,a),h=this._model.getOptions().tabSize,d=this._model.options.defaultBackgroundColor,c=this._model.options.backgroundColor,u=this._model.options.foregroundAlpha,g=this._model.tokensColorTracker,p=g.backgroundIsLight(),m=this._model.options.renderMinimap,f=this._model.options.charRenderer(),_=this._model.options.fontScale,v=this._model.options.minimapCharWidth,b=(1===m?2:3)*_,w=n>b?Math.floor((n-b)/2):0,C=c.a/255,y=new XP(Math.round((c.r-d.r)*C+d.r),Math.round((c.g-d.g)*C+d.g),Math.round((c.b-d.b)*C+d.b),255);let S=e.topPaddingLineCount*n;const k=[];for(let e=0,s=i-t+1;e<s;e++)a[e]&&CF._renderLine(o,y,c.a,p,m,v,g,u,f,S,w,h,l[e],_,n),k[e]=new fF(S),S+=n;const L=-1===s?0:s,x=(-1===r?o.height:r)-L;return this._canvas.domNode.getContext("2d").putImageData(o,0,0,0,L,o.width,x),new _F(e,o,k)}static _renderUntouchedLines(e,t,i,n,o,s){const r=[];if(!s){for(let e=0,t=n-i+1;e<t;e++)r[e]=!0;return[-1,-1,r]}const a=s._get(),l=a.imageData.data,h=a.rendLineNumberStart,d=a.lines,c=d.length,u=e.width,g=e.data,p=(n-i+1)*o*u*4;let m=-1,f=-1,_=-1,v=-1,b=-1,w=-1,C=t*o;for(let e=i;e<=n;e++){const t=e-i,n=e-h,s=n>=0&&n<c?d[n].dy:-1;if(-1===s){r[t]=!0,C+=o;continue}const a=s*u*4,y=(s+o)*u*4,S=C*u*4,k=(C+o)*u*4;v===a&&w===S?(v=y,w=k):(-1!==_&&(g.set(l.subarray(_,v),b),-1===m&&0===_&&_===b&&(m=v),-1===f&&v===p&&_===b&&(f=_)),_=a,v=y,b=S,w=k),r[t]=!1,C+=o}return-1!==_&&(g.set(l.subarray(_,v),b),-1===m&&0===_&&_===b&&(m=v),-1===f&&v===p&&_===b&&(f=_)),[-1===m?-1:m/(4*u),-1===f?-1:f/(4*u),r]}static _renderLine(e,t,i,n,o,s,r,a,l,h,d,c,u,g,p){const m=u.content,f=u.tokens,_=e.width-s,v=1===p;let b=8,w=0,C=0;for(let u=0,p=f.getCount();u<p;u++){const p=f.getEndOffset(u),y=f.getForeground(u),S=r.getColor(y);for(;w<p;w++){if(b>_)return;const r=m.charCodeAt(w);if(9===r){const e=c-(w+C)%c;C+=e-1,b+=e*s}else if(32===r)b+=s;else{const c=Kn(r)?2:1;for(let u=0;u<c;u++)if(2===o?l.blockRenderChar(e,b,h+d,S,a,t,i,v):l.renderChar(e,b,h+d,r,S,a,t,i,g,n,v),b+=s,b>_)return}}}}}class yF{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let e=0,t=this._endLineNumber-this._startLineNumber+1;e<t;e++)this._values[e]=i}has(e){return this.get(e)!==this._defaultValue}set(e,t){e<this._startLineNumber||e>this._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return e<this._startLineNumber||e>this._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}var SF=i(9822),kF={};kF.styleTagTransform=Vr(),kF.setAttributes=Pr(),kF.insert=Rr().bind(null,"head"),kF.domAPI=Tr(),kF.insertStyleElement=Br(),Ir()(SF.Z,kF),SF.Z&&SF.Z.locals&&SF.Z.locals;class LF extends OR{constructor(e){super(e);const t=this._context.configuration.options.get(143);this._widgets={},this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,this._domNode=Fx(document.createElement("div")),PR.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options.get(143);return this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,!0}addWidget(e){const t=Fx(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference===t?(this._updateMaxMinWidth(),!1):(i.preference=t,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.parentNode.removeChild(e),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e,t;let i=0;const n=Object.keys(this._widgets);for(let o=0,s=n.length;o<s;o++){const s=n[o],r=null===(t=(e=this._widgets[s].widget).getMinContentWidthInPx)||void 0===t?void 0:t.call(e);void 0!==r&&(i=Math.max(i,r))}this._context.viewLayout.setOverlayWidgetsMinWidth(i)}_renderWidget(e){const t=e.domNode;if(null!==e.preference)if(0===e.preference)t.setTop(0),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth);else if(1===e.preference){const e=t.domNode.clientHeight;t.setTop(this._editorHeight-e-2*this._horizontalScrollbarHeight),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth)}else 2===e.preference&&(t.setTop(0),t.domNode.style.right="50%");else t.setTop("")}prepareRender(e){}render(e){this._domNode.setWidth(this._editorWidth);const t=Object.keys(this._widgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];this._renderWidget(this._widgets[i])}}}class xF{constructor(e,t){const i=e.options;this.lineHeight=i.get(66),this.pixelRatio=i.get(141),this.overviewRulerLanes=i.get(82),this.renderBorder=i.get(81);const n=t.getColor(ab);this.borderColor=n?n.toString():null,this.hideCursor=i.get(59);const o=t.getColor(zv);this.cursorColor=o?o.transparent(.7).toString():null,this.themeType=t.type;const s=i.get(72),r=s.enabled,a=s.side,l=t.getColor(lb),h=SC.getDefaultBackground();this.backgroundColor=l||(r&&"right"===a?h:null);const d=i.get(143).overviewRuler;this.top=d.top,this.right=d.right,this.domWidth=d.width,this.domHeight=d.height,0===this.overviewRulerLanes?(this.canvasWidth=0,this.canvasHeight=0):(this.canvasWidth=this.domWidth*this.pixelRatio|0,this.canvasHeight=this.domHeight*this.pixelRatio|0);const[c,u]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=c,this.w=u}_initLanes(e,t,i){const n=t-e;if(i>=3){const t=Math.floor(n/3),i=Math.floor(n/3),o=n-t-i,s=e+t;return[[0,e,s,e,e+t+o,e,s,e],[0,t,o,t+o,i,t+o+i,o+i,t+o+i]]}if(2===i){const t=Math.floor(n/2),i=n-t;return[[0,e,e,e,e+t,e,e,e],[0,t,t,t,i,t+i,t+i,t+i]]}return[[0,e,e,e,e,e,e,e],[0,n,n,n,n,n,n,n]]}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&ru.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class DF extends OR{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=Fx(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=SC.onDidChange((e=>{e.changedColorMap&&this._updateSettings(!0)})),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new xF(this._context.configuration,this._context.theme);return!(this._settings&&this._settings.equals(t)||(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),0))}_markRenderingIsNeeded(){return this._actualShouldRender=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return!!this._updateSettings(!1)&&this._markRenderingIsNeeded()}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t<i;t++)this._cursorPositions[t]=e.selections[t].getPosition();return this._cursorPositions.sort(ch.compare),this._markRenderingIsMaybeNeeded()}onDecorationsChanged(e){return!!e.affectsOverviewRuler&&this._markRenderingIsMaybeNeeded()}onFlushed(e){return this._markRenderingIsNeeded()}onScrollChanged(e){return!!e.scrollHeightChanged&&this._markRenderingIsNeeded()}onZonesChanged(e){return this._markRenderingIsNeeded()}onThemeChanged(e){return!!this._updateSettings(!1)&&this._markRenderingIsNeeded()}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render(),this._actualShouldRender=0}_render(){const e=this._settings.backgroundColor;if(0===this._settings.overviewRulerLanes)return this._domNode.setBackgroundColor(e?ru.Format.CSS.formatHexA(e):""),void this._domNode.setDisplay("none");const t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(aF.compareByRenderingProps),1!==this._actualShouldRender||aF.equalsArr(this._renderedDecorations,t)||(this._actualShouldRender=2),1!==this._actualShouldRender||Ic(this._renderedCursorPositions,this._cursorPositions,((e,t)=>e.lineNumber===t.lineNumber))||(this._actualShouldRender=2),1===this._actualShouldRender)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,n=this._settings.canvasHeight,o=this._settings.lineHeight,s=this._context.viewLayout,r=n/this._context.viewLayout.getScrollHeight(),a=6*this._settings.pixelRatio|0,l=a/2|0,h=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(h.fillStyle=ru.Format.CSS.formatHexA(e),h.fillRect(0,0,i,n)):(h.clearRect(0,0,i,n),h.fillStyle=ru.Format.CSS.formatHexA(e),h.fillRect(0,0,i,n)):h.clearRect(0,0,i,n);const d=this._settings.x,c=this._settings.w;for(const e of t){const t=e.color,i=e.data;h.fillStyle=t;let u=0,g=0,p=0;for(let e=0,t=i.length/3;e<t;e++){const t=i[3*e],m=i[3*e+1],f=i[3*e+2];let _=s.getVerticalOffsetForLineNumber(m)*r|0,v=(s.getVerticalOffsetForLineNumber(f)+o)*r|0;if(v-_<a){let e=(_+v)/2|0;e<l?e=l:e+l>n&&(e=n-l),_=e-l,v=e+l}_>p+1||t!==u?(0!==e&&h.fillRect(d[u],g,c[u],p-g),u=t,g=_,p=v):v>p&&(p=v)}h.fillRect(d[u],g,c[u],p-g)}if(!this._settings.hideCursor&&this._settings.cursorColor){const e=2*this._settings.pixelRatio|0,t=e/2|0,i=this._settings.x[7],o=this._settings.w[7];h.fillStyle=this._settings.cursorColor;let a=-100,l=-100;for(let d=0,c=this._cursorPositions.length;d<c;d++){const c=this._cursorPositions[d];let u=s.getVerticalOffsetForLineNumber(c.lineNumber)*r|0;u<t?u=t:u+t>n&&(u=n-t);const g=u-t,p=g+e;g>l+1?(0!==d&&h.fillRect(i,a,o,l-a),a=g,l=p):p>l&&(l=p)}h.fillRect(i,a,o,l-a)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(h.beginPath(),h.lineWidth=1,h.strokeStyle=this._settings.borderColor,h.moveTo(0,0),h.lineTo(0,n),h.stroke(),h.moveTo(0,0),h.lineTo(i,0),h.stroke())}}class EF{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=0|e,this.to=0|t,this.colorId=0|i}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class NF{constructor(e,t,i,n){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=n,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.color<t.color?-1:1}setColorZone(e){this._colorZone=e}getColorZones(){return this._colorZone}}class IF{constructor(e){this._getVerticalOffsetForLine=e,this._zones=[],this._colorZonesInvalid=!1,this._lineHeight=0,this._domWidth=0,this._domHeight=0,this._outerHeight=0,this._pixelRatio=1,this._lastAssignedId=0,this._color2Id=Object.create(null),this._id2Color=[]}getId2Color(){return this._id2Color}setZones(e){this._zones=e,this._zones.sort(NF.compare)}setLineHeight(e){return this._lineHeight!==e&&(this._lineHeight=e,this._colorZonesInvalid=!0,!0)}setPixelRatio(e){this._pixelRatio=e,this._colorZonesInvalid=!0}getDOMWidth(){return this._domWidth}getCanvasWidth(){return this._domWidth*this._pixelRatio}setDOMWidth(e){return this._domWidth!==e&&(this._domWidth=e,this._colorZonesInvalid=!0,!0)}getDOMHeight(){return this._domHeight}getCanvasHeight(){return this._domHeight*this._pixelRatio}setDOMHeight(e){return this._domHeight!==e&&(this._domHeight=e,this._colorZonesInvalid=!0,!0)}getOuterHeight(){return this._outerHeight}setOuterHeight(e){return this._outerHeight!==e&&(this._outerHeight=e,this._colorZonesInvalid=!0,!0)}resolveColorZones(){const e=this._colorZonesInvalid,t=Math.floor(this._lineHeight),i=Math.floor(this.getCanvasHeight()),n=i/Math.floor(this._outerHeight),o=Math.floor(4*this._pixelRatio/2),s=[];for(let r=0,a=this._zones.length;r<a;r++){const a=this._zones[r];if(!e){const e=a.getColorZones();if(e){s.push(e);continue}}const l=this._getVerticalOffsetForLine(a.startLineNumber),h=0===a.heightInLines?this._getVerticalOffsetForLine(a.endLineNumber)+t:l+a.heightInLines*t,d=Math.floor(n*l),c=Math.floor(n*h);let u=Math.floor((d+c)/2),g=c-u;g<o&&(g=o),u-g<0&&(u=g),u+g>i&&(u=i-g);const p=a.color;let m=this._color2Id[p];m||(m=++this._lastAssignedId,this._color2Id[p]=m,this._id2Color[m]=p);const f=new EF(u-g,u+g,m);a.setColorZone(f),s.push(f)}return this._colorZonesInvalid=!1,s.sort(EF.compare),s}}class MF extends RR{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=Fx(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new IF((e=>this._context.viewLayout.getVerticalOffsetForLineNumber(e))),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(66)),this._zoneManager.setPixelRatio(i.get(141)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(66)&&(this._zoneManager.setLineHeight(t.get(66)),this._render()),e.hasChanged(141)&&(this._zoneManager.setPixelRatio(t.get(141)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(0===this._zoneManager.getOuterHeight())return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),n=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,n,e),!0}_renderOneLane(e,t,i,n){let o=0,s=0,r=0;for(const a of t){const t=a.colorId,l=a.from,h=a.to;t!==o?(e.fillRect(0,s,n,r-s),o=t,e.fillStyle=i[o],s=l,r=h):r>=l?r=Math.max(r,h):(e.fillRect(0,s,n,r-s),s=l,r=h)}e.fillRect(0,s,n,r-s)}}var TF=i(9443),AF={};AF.styleTagTransform=Vr(),AF.setAttributes=Pr(),AF.insert=Rr().bind(null,"head"),AF.domAPI=Tr(),AF.insertStyleElement=Br(),Ir()(TF.Z,AF),TF.Z&&TF.Z.locals&&TF.Z.locals;class RF extends OR{constructor(e){super(e),this.domNode=Fx(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e<t){const{tabSize:i}=this._context.viewModel.model.getOptions(),n=i;let o=t-e;for(;o>0;){const e=Fx(document.createElement("div"));e.setClassName("view-ruler"),e.setWidth(n),this.domNode.appendChild(e),this._renderedRulers.push(e),o--}return}let i=e-t;for(;i>0;){const e=this._renderedRulers.pop();this.domNode.removeChild(e),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t<i;t++){const i=this._renderedRulers[t],n=this._rulers[t];i.setBoxShadow(n.color?`1px 0 0 0 ${n.color} inset`:""),i.setHeight(Math.min(e.scrollHeight,1e6)),i.setLeft(n.column*this._typicalHalfwidthCharacterWidth)}}}var OF=i(9649),PF={};PF.styleTagTransform=Vr(),PF.setAttributes=Pr(),PF.insert=Rr().bind(null,"head"),PF.domAPI=Tr(),PF.insertStyleElement=Br(),Ir()(OF.Z,PF),OF.Z&&OF.Z.locals&&OF.Z.locals;class FF extends OR{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const t=this._context.configuration.options.get(102);this._useShadows=t.useShadows,this._domNode=Fx(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true")}dispose(){super.dispose()}_updateShouldShow(){const e=this._useShadows&&this._scrollTop>0;return this._shouldShow!==e&&(this._shouldShow=e,!0)}getDomNode(){return this._domNode}_updateWidth(){const e=this._context.configuration.options.get(143);0===e.minimap.renderMinimap||e.minimap.minimapWidth>0&&0===e.minimap.minimapLeft?this._width=e.width:this._width=e.width-e.verticalScrollbarWidth}onConfigurationChanged(e){const t=this._context.configuration.options.get(102);return this._useShadows=t.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}var BF=i(2595),WF={};WF.styleTagTransform=Vr(),WF.setAttributes=Pr(),WF.insert=Rr().bind(null,"head"),WF.domAPI=Tr(),WF.insertStyleElement=Br(),Ir()(BF.Z,WF),BF.Z&&BF.Z.locals&&BF.Z.locals;class VF{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class zF{constructor(e,t){this.lineNumber=e,this.ranges=t}}function HF(e){return new VF(e)}function UF(e){return new zF(e.lineNumber,e.ranges.map(HF))}class KF extends VO{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t<i;t++)if(e[t].ranges.length>1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const n=this._typicalHalfwidthCharacterWidth/4;let o=null,s=null;if(i&&i.length>0&&t.length>0){const n=t[0].lineNumber;if(n===e.startLineNumber)for(let e=0;!o&&e<i.length;e++)i[e].lineNumber===n&&(o=i[e].ranges[0]);const r=t[t.length-1].lineNumber;if(r===e.endLineNumber)for(let e=i.length-1;!s&&e>=0;e--)i[e].lineNumber===r&&(s=i[e].ranges[0]);o&&!o.startStyle&&(o=null),s&&!s.startStyle&&(s=null)}for(let e=0,i=t.length;e<i;e++){const r=t[e].ranges[0],a=r.left,l=r.left+r.width,h={top:0,bottom:0},d={top:0,bottom:0};if(e>0){const i=t[e-1].ranges[0].left,o=t[e-1].ranges[0].left+t[e-1].ranges[0].width;jF(a-i)<n?h.top=2:a>i&&(h.top=1),jF(l-o)<n?d.top=2:i<l&&l<o&&(d.top=1)}else o&&(h.top=o.startStyle.top,d.top=o.endStyle.top);if(e+1<i){const i=t[e+1].ranges[0].left,o=t[e+1].ranges[0].left+t[e+1].ranges[0].width;jF(a-i)<n?h.bottom=2:i<a&&a<o&&(h.bottom=1),jF(l-o)<n?d.bottom=2:l<o&&(d.bottom=1)}else s&&(h.bottom=s.startStyle.bottom,d.bottom=s.endStyle.bottom);r.startStyle=h,r.endStyle=d}}_getVisibleRangesWithStyle(e,t,i){const n=(t.linesVisibleRangesForRange(e,!0)||[]).map(UF);return!this._visibleRangesHaveGaps(n)&&this._roundedSelection&&this._enrichVisibleRangesWithStyle(t.visibleRange,n,i),n}_createSelectionPiece(e,t,i,n,o){return'<div class="cslr '+i+'" style="top:'+e.toString()+"px;left:"+n.toString()+"px;width:"+o.toString()+"px;height:"+t+'px;"></div>'}_actualRenderOneSelection(e,t,i,n){if(0===n.length)return;const o=!!n[0].ranges[0].startStyle,s=this._lineHeight.toString(),r=(this._lineHeight-1).toString(),a=n[0].lineNumber,l=n[n.length-1].lineNumber;for(let h=0,d=n.length;h<d;h++){const d=n[h],c=d.lineNumber,u=c-t,g=!i||c!==l&&c!==a?s:r,p=i&&c===a?1:0;let m="",f="";for(let e=0,t=d.ranges.length;e<t;e++){const t=d.ranges[e];if(o){const e=t.startStyle,i=t.endStyle;if(1===e.top||1===e.bottom){m+=this._createSelectionPiece(p,g,KF.SELECTION_CLASS_NAME,t.left-KF.ROUNDED_PIECE_WIDTH,KF.ROUNDED_PIECE_WIDTH);let i=KF.EDITOR_BACKGROUND_CLASS_NAME;1===e.top&&(i+=" "+KF.SELECTION_TOP_RIGHT),1===e.bottom&&(i+=" "+KF.SELECTION_BOTTOM_RIGHT),m+=this._createSelectionPiece(p,g,i,t.left-KF.ROUNDED_PIECE_WIDTH,KF.ROUNDED_PIECE_WIDTH)}if(1===i.top||1===i.bottom){m+=this._createSelectionPiece(p,g,KF.SELECTION_CLASS_NAME,t.left+t.width,KF.ROUNDED_PIECE_WIDTH);let e=KF.EDITOR_BACKGROUND_CLASS_NAME;1===i.top&&(e+=" "+KF.SELECTION_TOP_LEFT),1===i.bottom&&(e+=" "+KF.SELECTION_BOTTOM_LEFT),m+=this._createSelectionPiece(p,g,e,t.left+t.width,KF.ROUNDED_PIECE_WIDTH)}}let i=KF.SELECTION_CLASS_NAME;if(o){const e=t.startStyle,n=t.endStyle;0===e.top&&(i+=" "+KF.SELECTION_TOP_LEFT),0===e.bottom&&(i+=" "+KF.SELECTION_BOTTOM_LEFT),0===n.top&&(i+=" "+KF.SELECTION_TOP_RIGHT),0===n.bottom&&(i+=" "+KF.SELECTION_BOTTOM_RIGHT)}f+=this._createSelectionPiece(p,g,i,t.left,t.width)}e[u][0]+=m,e[u][1]+=f}}prepareRender(e){const t=[],i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber;for(let e=i;e<=n;e++)t[e-i]=["",""];const o=[];for(let n=0,s=this._selections.length;n<s;n++){const s=this._selections[n];if(s.isEmpty()){o[n]=null;continue}const r=this._getVisibleRangesWithStyle(s,e,this._previousFrameVisibleRangesWithStyle[n]);o[n]=r,this._actualRenderOneSelection(t,i,this._selections.length>1,r)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map((([e,t])=>e+t))}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function jF(e){return e<0?-e:e}KF.SELECTION_CLASS_NAME="selected-text",KF.SELECTION_TOP_LEFT="top-left-radius",KF.SELECTION_BOTTOM_LEFT="bottom-left-radius",KF.SELECTION_TOP_RIGHT="top-right-radius",KF.SELECTION_BOTTOM_RIGHT="bottom-right-radius",KF.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",KF.ROUNDED_PIECE_WIDTH=10,Fv(((e,t)=>{const i=e.getColor(Ff);i&&!i.isTransparent()&&t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${i}; }`)}));var qF=i(4057),$F={};$F.styleTagTransform=Vr(),$F.setAttributes=Pr(),$F.insert=Rr().bind(null,"head"),$F.domAPI=Tr(),$F.insertStyleElement=Br(),Ir()(qF.Z,$F),qF.Z&&qF.Z.locals&&qF.Z.locals;class GF{constructor(e,t,i,n,o,s,r){this.top=e,this.left=t,this.paddingLeft=i,this.width=n,this.height=o,this.textContent=s,this.textContentClassName=r}}class ZF{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(50);this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=Fx(document.createElement("div")),this._domNode.setClassName(`cursor ${$O}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Bx(this._domNode,i),this._domNode.setDisplay("none"),this._position=new ch(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),Bx(this._domNode,i),!0}onCursorPositionChanged(e,t){return this._domNode.domNode.style.transitionProperty=t?"none":"",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[n,o]=function(e,t){t>0&&Mn(e.charCodeAt(t))&&t--;const i=t+Pn(e,t);return[i-Fn(e,i),i]}(i,t-1);return[new ch(e,n+1),i.substring(n,o)]}_prepareRender(e){let t="",i="";const[n,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===Sk.Line||this._cursorStyle===Sk.LineThin){const s=e.visibleRangeForPosition(n);if(!s||s.outsideRenderedLine)return null;const r=as(this._domNode.domNode);let a;this._cursorStyle===Sk.Line?(a=vr(r,this._lineCursorWidth>0?this._lineCursorWidth:2),a>2&&(t=o,i=this._getTokenClassName(n))):a=vr(r,1);let l=s.left,h=0;a>=2&&l>=1&&(h=1,l-=h);const d=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta;return new GF(d,l,h,a,this._lineHeight,t,i)}const s=e.linesVisibleRangesForRange(new tc(n.lineNumber,n.column,n.lineNumber,n.column+o.length),!1);if(!s||0===s.length)return null;const r=s[0];if(r.outsideRenderedLine||0===r.ranges.length)return null;const a=r.ranges[0],l="\t"===o||a.width<1?this._typicalHalfwidthCharacterWidth:a.width;this._cursorStyle===Sk.Block&&(t=o,i=this._getTokenClassName(n));let h=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta,d=this._lineHeight;return this._cursorStyle!==Sk.Underline&&this._cursorStyle!==Sk.UnderlineThin||(h+=this._lineHeight-2,d=2),new GF(h,a.left,0,l,d,t,i)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${$O} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class YF extends OR{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new ZF(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=Fx(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new $t,this._cursorFlatBlinkInterval=new xs,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let t=0,i=this._secondaryCursors.length;t<i;t++)this._secondaryCursors[t].onConfigurationChanged(e);return!0}_onCursorPositionChanged(e,t,i){const n=this._secondaryCursors.length!==t.length||"explicit"===this._cursorSmoothCaretAnimation&&3!==i;if(this._primaryCursor.onCursorPositionChanged(e,n),this._updateBlinking(),this._secondaryCursors.length<t.length){const e=t.length-this._secondaryCursors.length;for(let t=0;t<e;t++){const e=new ZF(this._context);this._domNode.domNode.insertBefore(e.getDomNode().domNode,this._primaryCursor.getDomNode().domNode.nextSibling),this._secondaryCursors.push(e)}}else if(this._secondaryCursors.length>t.length){const e=this._secondaryCursors.length-t.length;for(let t=0;t<e;t++)this._domNode.removeChild(this._secondaryCursors[0].getDomNode()),this._secondaryCursors.splice(0,1)}for(let e=0;e<t.length;e++)this._secondaryCursors[e].onCursorPositionChanged(t[e],n)}onCursorStateChanged(e){const t=[];for(let i=0,n=e.selections.length;i<n;i++)t[i]=e.selections[i].getPosition();this._onCursorPositionChanged(t[0],t.slice(1),e.reason);const i=e.selections[0].isEmpty();return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,this._updateDomClassName()),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onFocusChanged(e){return this._editorHasFocus=e.isFocused,this._updateBlinking(),!1}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onTokensChanged(e){const t=t=>{for(let i=0,n=e.ranges.length;i<n;i++)if(e.ranges[i].fromLineNumber<=t.lineNumber&&t.lineNumber<=e.ranges[i].toLineNumber)return!0;return!1};if(t(this._primaryCursor.getPosition()))return!0;for(const e of this._secondaryCursors)if(t(e.getPosition()))return!0;return!1}onZonesChanged(e){return!0}_getCursorBlinking(){return this._isComposingInput?0:this._editorHasFocus?this._readOnly?5:this._cursorBlinking:0}_updateBlinking(){this._startCursorBlinkAnimation.cancel(),this._cursorFlatBlinkInterval.cancel();const e=this._getCursorBlinking(),t=0===e,i=5===e;t?this._hide():this._show(),this._blinkingEnabled=!1,this._updateDomClassName(),t||i||(1===e?this._cursorFlatBlinkInterval.cancelAndSet((()=>{this._isVisible?this._hide():this._show()}),YF.BLINK_INTERVAL,as(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet((()=>{this._blinkingEnabled=!0,this._updateDomClassName()}),YF.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case Sk.Line:e+=" cursor-line-style";break;case Sk.Block:e+=" cursor-block-style";break;case Sk.Underline:e+=" cursor-underline-style";break;case Sk.LineThin:e+=" cursor-line-thin-style";break;case Sk.BlockOutline:e+=" cursor-block-outline-style";break;case Sk.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return"on"!==this._cursorSmoothCaretAnimation&&"explicit"!==this._cursorSmoothCaretAnimation||(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].show();this._isVisible=!0}_hide(){this._primaryCursor.hide();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].hide();this._isVisible=!1}prepareRender(e){this._primaryCursor.prepareRender(e);for(let t=0,i=this._secondaryCursors.length;t<i;t++)this._secondaryCursors[t].prepareRender(e)}render(e){const t=[];let i=0;const n=this._primaryCursor.render(e);n&&(t[i++]=n);for(let n=0,o=this._secondaryCursors.length;n<o;n++){const o=this._secondaryCursors[n].render(e);o&&(t[i++]=o)}this._renderData=t}getLastRenderData(){return this._renderData}}YF.BLINK_INTERVAL=500,Fv(((e,t)=>{const i=e.getColor(zv);if(i){let n=e.getColor(Hv);n||(n=i.opposite()),t.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${i}; border-color: ${i}; color: ${n}; }`),Iv(e.type)&&t.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${n}; border-right: 1px solid ${n}; }`)}}));const QF=()=>{throw new Error("Invalid change accessor")};class XF extends OR{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._lineHeight=t.get(66),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=Fx(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=Fx(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const i of e)t.set(i.id,i);let i=!1;return this._context.viewModel.changeWhitespace((e=>{const n=Object.keys(this._zones);for(let o=0,s=n.length;o<s;o++){const s=n[o],r=this._zones[s],a=this._computeWhitespaceProps(r.delegate);r.isInHiddenArea=a.isInHiddenArea;const l=t.get(s);!l||l.afterLineNumber===a.afterViewLineNumber&&l.height===a.heightInPx||(e.changeOneWhitespace(s,a.afterViewLineNumber,a.heightInPx),this._safeCallOnComputedHeight(r.delegate,a.heightInPx),i=!0)}})),i}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._lineHeight=t.get(66),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,e.hasChanged(66)&&this._recomputeWhitespacesProps(),!0}onLineMappingChanged(e){return this._recomputeWhitespacesProps()}onLinesDeleted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}onLinesInserted(e){return!0}_getZoneOrdinal(e){var t,i;return null!==(i=null!==(t=e.ordinal)&&void 0!==t?t:e.afterColumn)&&void 0!==i?i:1e4}_computeWhitespaceProps(e){if(0===e.afterLineNumber)return{isInHiddenArea:!1,afterViewLineNumber:0,heightInPx:this._heightInPixels(e),minWidthInPx:this._minWidthInPixels(e)};let t,i;if(void 0!==e.afterColumn)t=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:e.afterColumn});else{const i=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:1}).lineNumber;t=new ch(i,this._context.viewModel.model.getLineMaxColumn(i))}i=t.column===this._context.viewModel.model.getLineMaxColumn(t.lineNumber)?this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber+1,column:1}):this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber,column:t.column+1});const n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t,e.afterColumnAffinity,!0),o=e.showInHiddenAreas||this._context.viewModel.coordinatesConverter.modelPositionIsVisible(i);return{isInHiddenArea:!o,afterViewLineNumber:n.lineNumber,heightInPx:o?this._heightInPixels(e):0,minWidthInPx:this._minWidthInPixels(e)}}changeViewZones(e){let t=!1;return this._context.viewModel.changeWhitespace((i=>{const n={addZone:e=>(t=!0,this._addZone(i,e)),removeZone:e=>{e&&(t=this._removeZone(i,e)||t)},layoutZone:e=>{e&&(t=this._layoutZone(i,e)||t)}};!function(e,t){try{return e(t)}catch(e){h(e)}}(e,n),n.addZone=QF,n.removeZone=QF,n.layoutZone=QF})),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),n={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:Fx(t.domNode),marginDomNode:t.marginDomNode?Fx(t.marginDomNode):null};return this._safeCallOnComputedHeight(n.delegate,i.heightInPx),n.domNode.setPosition("absolute"),n.domNode.domNode.style.width="100%",n.domNode.setDisplay("none"),n.domNode.setAttribute("monaco-view-zone",n.whitespaceId),this.domNode.appendChild(n.domNode),n.marginDomNode&&(n.marginDomNode.setPosition("absolute"),n.marginDomNode.domNode.style.width="100%",n.marginDomNode.setDisplay("none"),n.marginDomNode.setAttribute("monaco-view-zone",n.whitespaceId),this.marginDomNode.appendChild(n.marginDomNode)),this._zones[n.whitespaceId]=n,this.setShouldRender(),n.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],n=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=n.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,n.afterViewLineNumber,n.heightInPx),this._safeCallOnComputedHeight(i.delegate,n.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){if(this._zones.hasOwnProperty(e)){const t=this._zones[e];return Boolean(t.delegate.suppressMouseDown)}return!1}_heightInPixels(e){return"number"==typeof e.heightInPx?e.heightInPx:"number"==typeof e.heightInLines?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return"number"==typeof e.minWidthInPx?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if("function"==typeof e.onComputedHeight)try{e.onComputedHeight(t)}catch(e){h(e)}}_safeCallOnDomNodeTop(e,t){if("function"==typeof e.onDomNodeTop)try{e.onDomNodeTop(t)}catch(e){h(e)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(const e of t)this._zones[e.id].isInHiddenArea||(i[e.id]=e,n=!0);const o=Object.keys(this._zones);for(let t=0,n=o.length;t<n;t++){const n=o[t],s=this._zones[n];let r=0,a=0,l="none";i.hasOwnProperty(n)?(r=i[n].verticalOffset-e.bigNumbersDelta,a=i[n].height,l="block",s.isVisible||(s.domNode.setAttribute("monaco-visible-view-zone","true"),s.isVisible=!0),this._safeCallOnDomNodeTop(s.delegate,e.getScrolledTopFromAbsoluteTop(i[n].verticalOffset))):(s.isVisible&&(s.domNode.removeAttribute("monaco-visible-view-zone"),s.isVisible=!1),this._safeCallOnDomNodeTop(s.delegate,e.getScrolledTopFromAbsoluteTop(-1e6))),s.domNode.setTop(r),s.domNode.setHeight(a),s.domNode.setDisplay(l),s.marginDomNode&&(s.marginDomNode.setTop(r),s.marginDomNode.setHeight(a),s.marginDomNode.setDisplay(l))}n&&(this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth)),this.marginDomNode.setWidth(this._contentLeft))}}class JF{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class eB{constructor(e,t,i){this.configuration=e,this.theme=new JF(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}class tB{constructor(e,t,i,n){this.selections=e,this.startLineNumber=0|t.startLineNumber,this.endLineNumber=0|t.endLineNumber,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=0|t.bigNumbersDelta,this.whitespaceViewportData=i,this._model=n,this.visibleRange=new tc(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}var iB=i(9463),nB={};nB.styleTagTransform=Vr(),nB.setAttributes=Pr(),nB.insert=Rr().bind(null,"head"),nB.domAPI=Tr(),nB.insertStyleElement=Br(),Ir()(iB.Z,nB),iB.Z&&iB.Z.locals&&iB.Z.locals;class oB extends OR{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=Fx(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1;const t=this._context.configuration.options.get(143),i=t.contentWidth-t.verticalScrollbarWidth;this.contentWidth!==i&&(this.contentWidth=i,e=!0);const n=t.contentLeft;return this.contentLeft!==n&&(this.contentLeft=n,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){var t;let i=0;const n=e.getDecorationsInViewport();for(const o of n){if(!o.options.blockClassName)continue;let n,s,r=this.blocks[i];r||(r=this.blocks[i]=Fx(document.createElement("div")),this.domNode.appendChild(r)),o.options.blockIsAfterEnd?(n=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!1),s=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0)):(n=e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!0),s=o.range.isEmpty()&&!o.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0));const[a,l,h,d]=null!==(t=o.options.blockPadding)&&void 0!==t?t:[0,0,0,0];r.setClassName("blockDecorations-block "+o.options.blockClassName),r.setLeft(this.contentLeft-d),r.setWidth(this.contentWidth+d+l),r.setTop(n-e.scrollTop-a),r.setHeight(s-n+a+h),i++}for(let e=i;e<this.blocks.length;e++)this.blocks[e].domNode.remove();this.blocks.length=i}}var sB=i(9991),rB={};rB.styleTagTransform=Vr(),rB.setAttributes=Pr(),rB.insert=Rr().bind(null,"head"),rB.domAPI=Tr(),rB.insertStyleElement=Br(),Ir()(sB.Z,rB),sB.Z&&sB.Z.locals&&sB.Z.locals;class aB extends VO{constructor(e){super(),this._context=e,this._options=new lB(this._context.configuration),this._selection=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=new lB(this._context.configuration);return this._options.equals(t)?e.hasChanged(143):(this._options=t,!0)}onCursorStateChanged(e){return this._selection=e.selections,"selection"===this._options.renderWhitespace}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}prepareRender(e){if("none"===this._options.renderWhitespace)return void(this._renderResult=null);const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber-t+1,n=new Array(i);for(let e=0;e<i;e++)n[e]=!0;const o=this._context.viewModel.getMinimapLinesRenderingData(e.viewportData.startLineNumber,e.viewportData.endLineNumber,n);this._renderResult=[];for(let t=e.viewportData.startLineNumber;t<=e.viewportData.endLineNumber;t++){const i=t-e.viewportData.startLineNumber,n=o.data[i];let s=null;if("selection"===this._options.renderWhitespace){const e=this._selection;for(const i of e){if(i.endLineNumber<t||i.startLineNumber>t)continue;const e=i.startLineNumber===t?i.startColumn:n.minColumn,o=i.endLineNumber===t?i.endColumn:n.maxColumn;e<o&&(s||(s=[]),s.push(new YR(e-1,o-1)))}}this._renderResult[i]=this._applyRenderWhitespace(e,t,s,n)}}_applyRenderWhitespace(e,t,i,n){if("selection"===this._options.renderWhitespace&&!i)return"";if("trailing"===this._options.renderWhitespace&&n.continuesWithWrappedLine)return"";const o=this._context.theme.getColor(Uv),s=this._options.renderWithSVG,r=n.content,a=-1===this._options.stopRenderingLineAfter?r.length:Math.min(this._options.stopRenderingLineAfter,r.length),l=n.continuesWithWrappedLine,h=n.minColumn-1,d="boundary"===this._options.renderWhitespace,c="trailing"===this._options.renderWhitespace,u=this._options.lineHeight,g=this._options.middotWidth,p=this._options.wsmiddotWidth,m=this._options.spaceWidth,f=Math.abs(p-m)<Math.abs(g-m)?11825:183,_=this._options.canUseHalfwidthRightwardsArrow;let v,b="",w=!1,C=fn(r);-1===C?(w=!0,C=a,v=a):v=vn(r);let y=0,S=i&&i[y],k=0;for(let n=h;n<a;n++){const o=r.charCodeAt(n);if(S&&n>=S.endOffset&&(y++,S=i&&i[y]),9!==o&&32!==o)continue;if(c&&!w&&n<=v)continue;if(d&&n>=C&&n<=v&&32===o){const e=n-1>=0?r.charCodeAt(n-1):0,t=n+1<a?r.charCodeAt(n+1):0;if(32!==e&&32!==t)continue}if(d&&l&&n===a-1){const e=n-1>=0?r.charCodeAt(n-1):0;if(32===o&&32!==e&&9!==e)continue}if(i&&(!S||S.startOffset>n||S.endOffset<=n))continue;const h=e.visibleRangeForPosition(new ch(t,n+1));h&&(s?(k=Math.max(k,h.left),b+=9===o?this._renderArrow(u,m,h.left):`<circle cx="${(h.left+m/2).toFixed(2)}" cy="${(u/2).toFixed(2)}" r="${(m/7).toFixed(2)}" />`):b+=9===o?`<div class="mwh" style="left:${h.left}px;height:${u}px;">${_?String.fromCharCode(65515):String.fromCharCode(8594)}</div>`:`<div class="mwh" style="left:${h.left}px;height:${u}px;">${String.fromCharCode(f)}</div>`)}return s?(k=Math.round(k+m),`<svg style="position:absolute;width:${k}px;height:${u}px" viewBox="0 0 ${k} ${u}" xmlns="http://www.w3.org/2000/svg" fill="${o}">`+b+"</svg>"):b}_renderArrow(e,t,i){const n=e/2,o=i,s={x:0,y:t/7/2},r={x:.8*t,y:s.y},a={x:r.x-.2*r.x,y:r.y+.2*r.x},l={x:a.x+.1*r.x,y:a.y+.1*r.x},h={x:l.x+.35*r.x,y:l.y-.35*r.x};return`<path d="M ${[s,r,a,l,h,{x:h.x,y:-h.y},{x:l.x,y:-l.y},{x:a.x,y:-a.y},{x:r.x,y:-r.y},{x:s.x,y:-s.y}].map((e=>`${(o+e.x).toFixed(2)} ${(n+e.y).toFixed(2)}`)).join(" L ")}" />`}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class lB{constructor(e){const t=e.options,i=t.get(50),n=t.get(38);"off"===n?(this.renderWhitespace="none",this.renderWithSVG=!1):"svg"===n?(this.renderWhitespace=t.get(98),this.renderWithSVG=!0):(this.renderWhitespace=t.get(98),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(66),this.stopRenderingLineAfter=t.get(116)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}let hB=class extends RR{constructor(e,t,i,n,o,s,r){super(),this._instantiationService=r,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new ic(1,1,1,1)],this._renderAnimationFrame=null;const a=new JO(t,n,o,e);this._context=new eB(t,i,n),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(XO,this._context,a,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=Fx(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=Fx(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=Fx(document.createElement("div")),PR.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new yP(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new AP(this._context,this._linesContent),this._viewZones=new XF(this._context),this._viewParts.push(this._viewZones);const l=new DF(this._context);this._viewParts.push(l);const h=new FF(this._context);this._viewParts.push(h);const d=new rP(this._context);this._viewParts.push(d),d.addDynamicOverlay(new _P(this._context)),d.addDynamicOverlay(new KF(this._context)),d.addDynamicOverlay(new LP(this._context)),d.addDynamicOverlay(new CP(this._context)),d.addDynamicOverlay(new aB(this._context));const c=new aP(this._context);this._viewParts.push(c),c.addDynamicOverlay(new vP(this._context)),c.addDynamicOverlay(new ZP(this._context)),c.addDynamicOverlay(new qP(this._context)),c.addDynamicOverlay(new zO(this._context)),this._glyphMarginWidgets=new HP(this._context),this._viewParts.push(this._glyphMarginWidgets);const u=new KO(this._context);u.getDomNode().appendChild(this._viewZones.marginDomNode),u.getDomNode().appendChild(c.getDomNode()),u.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(u),this._contentWidgets=new lP(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new YF(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new LF(this._context),this._viewParts.push(this._overlayWidgets);const g=new RF(this._context);this._viewParts.push(g);const p=new oB(this._context);this._viewParts.push(p);const m=new wF(this._context);if(this._viewParts.push(m),l){const e=this._scrollbar.getOverviewRulerLayoutInfo();e.parent.insertBefore(l.getDomNode(),e.insertBefore)}this._linesContent.appendChild(d.getDomNode()),this._linesContent.appendChild(g.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(u.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(h.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(m.getDomNode()),this._overflowGuardContainer.appendChild(p.domNode),this.domNode.appendChild(this._overflowGuardContainer),s?s.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new OO(this._context,a,this._createPointerHandlerHelper()))}_computeGlyphMarginLaneCount(){const e=this._context.viewModel.model;let t=[];t=t.concat(e.getAllMarginDecorations().map((e=>{var t,i;const n=null!==(i=null===(t=e.options.glyphMargin)||void 0===t?void 0:t.position)&&void 0!==i?i:bc.Left;return{range:e.range,lane:n}}))),t=t.concat(this._glyphMarginWidgets.getWidgets().map((t=>({range:e.validateRange(t.preference.range),lane:t.preference.lane})))),t.sort(((e,t)=>tc.compareRangesUsingStarts(e.range,t.range)));let i=null,n=null;for(const e of t)if(e.lane===bc.Left&&(!i||tc.compareRangesUsingEnds(i,e.range)<0)&&(i=e.range),e.lane===bc.Right&&(!n||tc.compareRangesUsingEnds(n,e.range)<0)&&(n=e.range),i&&n){if(i.endLineNumber<n.startLineNumber){i=null;continue}if(n.endLineNumber<i.startLineNumber){n=null;continue}return 2}return 1}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new vO(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new ch(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const e=this._context.configuration.options.get(143);this.domNode.setWidth(e.width),this.domNode.setHeight(e.height),this._overflowGuardContainer.setWidth(e.width),this._overflowGuardContainer.setHeight(e.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(140)+" "+Rv(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){null!==this._renderAnimationFrame&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){if(this._store.isDisposed)throw new b;if(null===this._renderAnimationFrame){const e=this._createCoordinatedRendering();this._renderAnimationFrame=cB.INSTANCE.scheduleCoordinatedRendering({window:as(this.domNode.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new b;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new b;return e.renderText()},prepareRender:(t,i)=>{if(this._store.isDisposed)throw new b;return e.prepareRender(t,i)},render:(t,i)=>{if(this._store.isDisposed)throw new b;return e.render(t,i)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();dB((()=>e.prepareRenderText()));const t=dB((()=>e.renderText()));if(t){const[i,n]=t;dB((()=>e.prepareRender(i,n))),dB((()=>e.render(i,n)))}}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{this._shouldRecomputeGlyphMarginLanes&&(this._shouldRecomputeGlyphMarginLanes=!1,this._context.configuration.setGlyphMarginDecorationLaneCount(this._computeGlyphMarginLaneCount())),IS.onRenderStart()},renderText:()=>{if(!this.domNode.domNode.isConnected)return null;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&0===e.length)return null;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new tB(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),[e,new BR(this._context.viewLayout,i,this._viewLines)]},prepareRender:(e,t)=>{for(const i of e)i.prepareRender(t)},render:(e,t)=>{for(const i of e)i.render(t),i.onDidRender()}}}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new ch(n.lineNumber,n.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?eP.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new MF(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const e of this._viewParts)e.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){var t,i,n,o,s,r,a,l;this._contentWidgets.setWidgetPosition(e.widget,null!==(i=null===(t=e.position)||void 0===t?void 0:t.position)&&void 0!==i?i:null,null!==(o=null===(n=e.position)||void 0===n?void 0:n.secondaryPosition)&&void 0!==o?o:null,null!==(r=null===(s=e.position)||void 0===s?void 0:s.preference)&&void 0!==r?r:null,null!==(l=null===(a=e.position)||void 0===a?void 0:a.positionAffinity)&&void 0!==l?l:null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};function dB(e){try{return e()}catch(e){return h(e),null}}hB=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(6,lh)],hB);class cB{constructor(){this._coordinatedRenderings=[],this._animationFrameRunners=new Map}scheduleCoordinatedRendering(e){return this._coordinatedRenderings.push(e),this._scheduleRender(e.window),{dispose:()=>{const t=this._coordinatedRenderings.indexOf(e);if(-1!==t&&(this._coordinatedRenderings.splice(t,1),0===this._coordinatedRenderings.length)){for(const[e,t]of this._animationFrameRunners)t.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){if(!this._animationFrameRunners.has(e)){const t=()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()};this._animationFrameRunners.set(e,ks(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const t of e)dB((()=>t.prepareRenderText()));const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];t[i]=dB((()=>n.renderText()))}for(let i=0,n=e.length;i<n;i++){const n=e[i],o=t[i];if(!o)continue;const[s,r]=o;dB((()=>n.prepareRender(s,r)))}for(let i=0,n=e.length;i<n;i++){const n=e[i],o=t[i];if(!o)continue;const[s,r]=o;dB((()=>n.render(s,r)))}}}cB.INSTANCE=new cB;class uB{constructor(e,t,i,n,o,s,r){this.id=e,this.label=t,this.alias=i,this.metadata=n,this._precondition=o,this._run=s,this._contextKeyService=r}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}const gB={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};class pB{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new Vy(new tc(1,1,1,1),0,0,new ch(1,1),0),new Vy(new tc(1,1,1,1),0,0,new ch(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new Fy(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?ic.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):ic.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,n){return t.equals(i)?n:e.normalizePosition(t,2)}static _validateViewState(e,t){const i=t.position,n=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),s=e.normalizePosition(i,2),r=this._validatePositionWithCache(e,n,i,s),a=this._validatePositionWithCache(e,o,n,r);return i.equals(s)&&n.equals(r)&&o.equals(a)?t:new Vy(tc.fromPositions(r,a),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+n.column-r.column,s,t.leftoverVisibleColumns+i.column-s.column)}_setState(e,t,i){if(i&&(i=pB._validateViewState(e.viewModel,i)),t){const i=e.model.validateRange(t.selectionStart),n=t.selectionStart.equalsRange(i)?t.selectionStartLeftoverVisibleColumns:0,o=e.model.validatePosition(t.position),s=t.position.equals(o)?t.leftoverVisibleColumns:0;t=new Vy(i,t.selectionStartKind,n,o,s)}else{if(!i)return;const n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new Vy(n,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new Vy(n,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new ch(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new ch(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),s=new tc(n.lineNumber,n.column,o.lineNumber,o.column),r=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new Vy(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,r,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class mB{constructor(e){this.context=e,this.cursors=[new pB(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map((e=>e.readSelectionFromMarkers(this.context)))}getAll(){return this.cursors.map((e=>e.asCursorState()))}getViewPositions(){return this.cursors.map((e=>e.viewState.position))}getTopMostViewPosition(){return function(e,t){return _u(e,((e,i)=>-t(e,i)))}(this.cursors,Yc((e=>e.viewState.position),ch.compare)).viewState.position}getBottomMostViewPosition(){return function(e,t){if(0===e.length)return;let i=e[0];for(let n=1;n<e.length;n++){const o=e[n];t(o,i)>=0&&(i=o)}return i}(this.cursors,Yc((e=>e.viewState.position),ch.compare)).viewState.position}getSelections(){return this.cursors.map((e=>e.modelState.selection))}getViewSelections(){return this.cursors.map((e=>e.viewState.selection))}setSelections(e){this.setStates(Fy.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){null!==e&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,i=e.length;if(t<i){const e=i-t;for(let t=0;t<e;t++)this._addSecondaryCursor()}else if(t>i){const e=t-i;for(let t=0;t<e;t++)this._removeSecondaryCursor(this.cursors.length-2)}for(let t=0;t<i;t++)this.cursors[t+1].setState(this.context,e[t].modelState,e[t].viewState)}killSecondaryCursors(){this._setSecondaryStates([])}_addSecondaryCursor(){this.cursors.push(new pB(this.context)),this.lastAddedCursorIndex=this.cursors.length-1}getLastAddedCursorIndex(){return 1===this.cursors.length||0===this.lastAddedCursorIndex?0:this.lastAddedCursorIndex}_removeSecondaryCursor(e){this.lastAddedCursorIndex>=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(1===this.cursors.length)return;const e=this.cursors.slice(0),t=[];for(let i=0,n=e.length;i<n;i++)t.push({index:i,selection:e[i].modelState.selection});t.sort(Yc((e=>e.selection),tc.compareRangesUsingStarts));for(let i=0;i<t.length-1;i++){const n=t[i],o=t[i+1],s=n.selection,r=o.selection;if(!this.context.cursorConfig.multiCursorMergeOverlapping)continue;let a;if(a=r.isEmpty()||s.isEmpty()?r.getStartPosition().isBeforeOrEqual(s.getEndPosition()):r.getStartPosition().isBefore(s.getEndPosition()),a){const s=n.index<o.index?i:i+1,r=n.index<o.index?i+1:i,a=t[r].index,l=t[s].index,h=t[r].selection,d=t[s].selection;if(!h.equalsSelection(d)){const i=h.plusRange(d),n=h.selectionStartLineNumber===h.startLineNumber&&h.selectionStartColumn===h.startColumn,o=d.selectionStartLineNumber===d.startLineNumber&&d.selectionStartColumn===d.startColumn;let r,c;a===this.lastAddedCursorIndex?(r=n,this.lastAddedCursorIndex=l):r=o,c=r?new ic(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn):new ic(i.endLineNumber,i.endColumn,i.startLineNumber,i.startColumn),t[s].selection=c;const u=Fy.fromModelSelection(c);e[l].setState(this.context,u.modelState,u.viewState)}for(const e of t)e.index>a&&e.index--;e.splice(a,1),t.splice(r,1),this._removeSecondaryCursor(a-1),i--}}}}class fB{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}class _B{constructor(){this.type=0}}class vB{constructor(){this.type=1}}class bB{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class wB{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class CB{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0)}}class yB{constructor(){this.type=5}}class SB{constructor(e){this.type=6,this.isFocused=e}}class kB{constructor(){this.type=7}}class LB{constructor(){this.type=8}}class xB{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class DB{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class EB{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class NB{constructor(e,t,i,n,o,s,r){this.source=e,this.minimalReveal=t,this.range=i,this.selections=n,this.verticalType=o,this.revealHorizontal=s,this.scrollType=r,this.type=12}}class IB{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class MB{constructor(e){this.theme=e,this.type=14}}class TB{constructor(e){this.type=15,this.ranges=e}}class AB{constructor(){this.type=16}}class RB{constructor(){this.type=17}}class OB extends T{constructor(){super(),this._onEvent=this._register(new q),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t<i;t++){const i=this._outgoingEvents[t].kind===e.kind?this._outgoingEvents[t].attemptToMerge(e):null;if(i)return void(this._outgoingEvents[t]=i)}this._outgoingEvents.push(e)}_emitOutgoingEvents(){for(;this._outgoingEvents.length>0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t<i;t++)this._eventHandlers[t]===e&&console.warn("Detected duplicate listener in ViewEventDispatcher",e);this._eventHandlers.push(e)}removeViewEventHandler(e){for(let t=0;t<this._eventHandlers.length;t++)if(this._eventHandlers[t]===e){this._eventHandlers.splice(t,1);break}}beginEmitViewEvents(){return this._collectorCnt++,1===this._collectorCnt&&(this._collector=new PB),this._collector}endEmitViewEvents(){if(this._collectorCnt--,0===this._collectorCnt){const e=this._collector.outgoingEvents,t=this._collector.viewEvents;this._collector=null;for(const t of e)this._addOutgoingEvent(t);t.length>0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class PB{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class FB{constructor(e,t,i,n){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=n,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new FB(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class BB{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new BB(this.oldHasFocus,e.hasFocus)}}class WB{constructor(e,t,i,n,o,s,r,a){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=o,this.scrollLeft=s,this.scrollHeight=r,this.scrollTop=a,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!(this.scrollWidthChanged||this.scrollLeftChanged||this.scrollHeightChanged||this.scrollTopChanged)}attemptToMerge(e){return e.kind!==this.kind?null:new WB(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class VB{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class zB{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class HB{constructor(e,t,i,n,o,s,r){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=o,this.reason=s,this.reachedMaxCursorCount=r}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(!e[n].equalsSelection(t[n]))return!1;return!0}isNoOp(){return HB._selectionsAreEqual(this.oldSelections,this.selections)&&this.oldModelVersionId===this.modelVersionId}attemptToMerge(e){return e.kind!==this.kind?null:new HB(this.oldSelections,e.selections,this.oldModelVersionId,e.modelVersionId,e.source,e.reason,this.reachedMaxCursorCount||e.reachedMaxCursorCount)}}class UB{constructor(){this.kind=5}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class KB{constructor(e){this.event=e,this.kind=7}isNoOp(){return!1}attemptToMerge(e){return null}}class jB{constructor(e){this.event=e,this.kind=8}isNoOp(){return!1}attemptToMerge(e){return null}}class qB{constructor(e){this.event=e,this.kind=9}isNoOp(){return!1}attemptToMerge(e){return null}}class $B{constructor(e){this.event=e,this.kind=10}isNoOp(){return!1}attemptToMerge(e){return null}}class GB{constructor(e){this.event=e,this.kind=11}isNoOp(){return!1}attemptToMerge(e){return null}}class ZB{constructor(e){this.event=e,this.kind=12}isNoOp(){return!1}attemptToMerge(e){return null}}class YB extends T{constructor(e,t,i,n){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new fB(this._model,this._viewModel,this._coordinatesConverter,n),this._cursors=new mB(this.context),this._hasFocus=!1,this._isHandling=!1,this._compositionState=null,this._columnSelectData=null,this._autoClosedActions=[],this._prevEditOperationType=0}dispose(){this._cursors.dispose(),this._autoClosedActions=E(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new fB(this._model,this._viewModel,this._coordinatesConverter,e),this._cursors.updateContext(this.context)}onLineMappingChanged(e){this._knownModelVersionId===this._model.getVersionId()&&this.setStates(e,"viewModel",0,this.getCursorStates())}setHasFocus(e){this._hasFocus=e}_validateAutoClosedActions(){if(this._autoClosedActions.length>0){const e=this._cursors.getSelections();for(let t=0;t<this._autoClosedActions.length;t++){const i=this._autoClosedActions[t];i.isValid(e)||(i.dispose(),this._autoClosedActions.splice(t,1),t--)}}}getPrimaryCursorState(){return this._cursors.getPrimaryCursor()}getLastAddedCursorIndex(){return this._cursors.getLastAddedCursorIndex()}getCursorStates(){return this._cursors.getAll()}setStates(e,t,i,n){let o=!1;const s=this.context.cursorConfig.multiCursorLimit;null!==n&&n.length>s&&(n=n.slice(0,s),o=!0);const r=QB.from(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,r,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,i,n,o,s){const r=this._cursors.getViewPositions();let a=null,l=null;r.length>1?l=this._cursors.getViewSelections():a=tc.fromPositions(r[0],r[0]),e.emitViewEvent(new NB(t,i,a,l,n,o,s))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push({inSelectionMode:!n.isEmpty(),selectionStart:{lineNumber:n.selectionStartLineNumber,column:n.selectionStartColumn},position:{lineNumber:n.positionLineNumber,column:n.positionColumn}})}return e}restoreState(e,t){const i=[];for(let e=0,n=t.length;e<n;e++){const n=t[e];let o=1,s=1;n.position&&n.position.lineNumber&&(o=n.position.lineNumber),n.position&&n.position.column&&(s=n.position.column);let r=o,a=s;n.selectionStart&&n.selectionStart.lineNumber&&(r=n.selectionStart.lineNumber),n.selectionStart&&n.selectionStart.column&&(a=n.selectionStart.column),i.push({selectionStartLineNumber:r,selectionStartColumn:a,positionLineNumber:o,positionColumn:s})}this.setStates(e,"restoreState",0,Fy.fromModelSelections(i)),this.revealPrimary(e,"restoreState",!1,0,!0,1)}onModelContentChanged(e,t){if(t instanceof ty){if(this._isHandling)return;this._isHandling=!0;try{this.setStates(e,"modelChange",0,this.getCursorStates())}finally{this._isHandling=!1}}else{const i=t.rawContentChangedEvent;if(this._knownModelVersionId=i.versionId,this._isHandling)return;const n=i.containsEvent(1);if(this._prevEditOperationType=0,n)this._cursors.dispose(),this._cursors=new mB(this.context),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,"model",1,null,!1);else if(this._hasFocus&&i.resultingSelection&&i.resultingSelection.length>0){const t=Fy.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,t)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const t=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,Fy.fromModelSelections(t))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,n){this.setStates(e,t,n,Fy.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],n=[];for(let o=0,s=e.length;o<s;o++)i.push({range:e[o],options:{description:"auto-closed-character",inlineClassName:"auto-closed-character",stickiness:1}}),n.push({range:t[o],options:{description:"auto-closed-enclosing",stickiness:1}});const o=this._model.deltaDecorations([],i),s=this._model.deltaDecorations([],n);this._autoClosedActions.push(new XB(this._model,o,s))}_executeEditOperation(e){if(!e)return;e.shouldPushStackElementBefore&&this._model.pushStackElement();const t=JB.executeCommands(this._model,this._cursors.getSelections(),e.commands);if(t){this._interpretCommandResult(t);const i=[],n=[];for(let t=0;t<e.commands.length;t++){const o=e.commands[t];o instanceof mS&&o.enclosingRange&&o.closeCharacterRange&&(i.push(o.closeCharacterRange),n.push(o.enclosingRange))}i.length>0&&this._pushAutoClosedAction(i,n),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){e&&0!==e.length||(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,n,o){const s=QB.from(this._model,this);if(s.equals(n))return!1;const r=this._cursors.getSelections(),a=this._cursors.getViewSelections();if(e.emitViewEvent(new wB(a,r,i)),!n||n.cursorState.length!==s.cursorState.length||s.cursorState.some(((e,t)=>!e.modelState.equals(n.cursorState[t].modelState)))){const a=n?n.cursorState.map((e=>e.modelState.selection)):null,l=n?n.modelVersionId:0;e.emitOutgoingEvent(new HB(a,r,l,s.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n.text||n.text.indexOf("\n")>=0)return null;const o=n.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!o)return null;const s=o[1],r=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(s);if(!r||1!==r.length)return null;const a=r[0].open,l=n.text.length-o[2].length-1,h=n.text.lastIndexOf(a,l-1);if(-1===h)return null;t.push([h,l])}return t}executeEdits(e,t,i,n){let o=null;"snippet"===t&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);const s=[],r=[],a=this._model.pushEditOperations(this.getSelections(),i,(e=>{if(o)for(let t=0,i=o.length;t<i;t++){const[i,n]=o[t],a=e[t],l=a.range.startLineNumber,h=a.range.startColumn-1+i,d=a.range.startColumn-1+n;s.push(new tc(l,d+1,l,d+2)),r.push(new tc(l,h+1,l,d+2))}const t=n(e);return t&&(this._isHandling=!0),t}));a&&(this._isHandling=!1,this.setSelections(e,t,a,0)),s.length>0&&this._pushAutoClosedAction(s,r)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const o=QB.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(e){h(e)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,o,!1)&&this.revealPrimary(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return XB.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new tW(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit((()=>{"keyboard"===t&&this._executeEditOperation(pS.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))}),e,t)}type(e,t,i){this._executeEdit((()=>{if("keyboard"===i){const e=t.length;let i=0;for(;i<e;){const e=Pn(t,i),n=t.substr(i,e);this._executeEditOperation(pS.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),n)),i+=e}}else this._executeEditOperation(pS.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t))}),e,i)}compositionType(e,t,i,n,o,s){if(0!==t.length||0!==i||0!==n)this._executeEdit((()=>{this._executeEditOperation(pS.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,o))}),e,s);else if(0!==o){const t=this.getSelections().map((e=>{const t=e.getPosition();return new ic(t.lineNumber,t.column+o,t.lineNumber,t.column+o)}));this.setSelections(e,s,t,0)}}paste(e,t,i,n,o){this._executeEdit((()=>{this._executeEditOperation(pS.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))}),e,o,4)}cut(e,t){this._executeEdit((()=>{this._executeEditOperation(Xy.cut(this.context.cursorConfig,this._model,this.getSelections()))}),e,t)}executeCommand(e,t,i){this._executeEdit((()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new zy(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))}),e,i)}executeCommands(e,t,i){this._executeEdit((()=>{this._executeEditOperation(new zy(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))}),e,i)}}class QB{static from(e,t){return new QB(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e)return!1;if(this.modelVersionId!==e.modelVersionId)return!1;if(this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t<i;t++)if(!this.cursorState[t].equals(e.cursorState[t]))return!1;return!0}}class XB{static getAllAutoClosedCharacters(e){let t=[];for(const i of e)t=t.concat(i.getAutoClosedCharactersRanges());return t}constructor(e,t,i){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=i}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEnclosingDecorations=this._model.deltaDecorations(this._autoClosedEnclosingDecorations,[])}getAutoClosedCharactersRanges(){const e=[];for(let t=0;t<this._autoClosedCharactersDecorations.length;t++){const i=this._model.getDecorationRange(this._autoClosedCharactersDecorations[t]);i&&e.push(i)}return e}isValid(e){const t=[];for(let e=0;e<this._autoClosedEnclosingDecorations.length;e++){const i=this._model.getDecorationRange(this._autoClosedEnclosingDecorations[e]);if(i&&(t.push(i),i.startLineNumber!==i.endLineNumber))return!1}t.sort(tc.compareRangesUsingStarts),e.sort(tc.compareRangesUsingStarts);for(let i=0;i<e.length;i++){if(i>=t.length)return!1;if(!t[i].strictContainsRange(e[i]))return!1}return!0}}class JB{static executeCommands(e,t,i){const n={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(n,i);for(let e=0,t=n.trackedRanges.length;e<t;e++)n.model._setTrackedRange(n.trackedRanges[e],null,0);return o}static _innerExecuteCommands(e,t){if(this._arrayIsEmpty(t))return null;const i=this._getEditOperations(e,t);if(0===i.operations.length)return null;const n=i.operations,o=this._getLoserCursorMap(n);if(o.hasOwnProperty("0"))return console.warn("Ignoring commands"),null;const s=[];for(let e=0,t=n.length;e<t;e++)o.hasOwnProperty(n[e].identifier.major.toString())||s.push(n[e]);i.hadTrackedEditOperation&&s.length>0&&(s[0]._isTracked=!0);let r=e.model.pushEditOperations(e.selectionsBefore,s,(i=>{const n=[];for(let t=0;t<e.selectionsBefore.length;t++)n[t]=[];for(const e of i)e.identifier&&n[e.identifier.major].push(e);const o=(e,t)=>e.identifier.minor-t.identifier.minor,s=[];for(let i=0;i<e.selectionsBefore.length;i++)n[i].length>0?(n[i].sort(o),s[i]=t[i].computeCursorState(e.model,{getInverseEditOperations:()=>n[i],getTrackedSelection:t=>{const i=parseInt(t,10),n=e.model._getTrackedRange(e.trackedRanges[i]);return 0===e.trackedRangesDirection[i]?new ic(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn):new ic(n.endLineNumber,n.endColumn,n.startLineNumber,n.startColumn)}})):s[i]=e.selectionsBefore[i];return s}));r||(r=e.selectionsBefore);const a=[];for(const e in o)o.hasOwnProperty(e)&&a.push(parseInt(e,10));a.sort(((e,t)=>t-e));for(const e of a)r.splice(e,1);return r}static _arrayIsEmpty(e){for(let t=0,i=e.length;t<i;t++)if(e[t])return!1;return!0}static _getEditOperations(e,t){let i=[],n=!1;for(let o=0,s=t.length;o<s;o++){const s=t[o];if(s){const t=this._getEditOperationsFromCommand(e,o,s);i=i.concat(t.operations),n=n||t.hadTrackedEditOperation}}return{operations:i,hadTrackedEditOperation:n}}static _getEditOperationsFromCommand(e,t,i){const n=[];let o=0;const s=(e,s,r=!1)=>{tc.isEmpty(e)&&""===s||n.push({identifier:{major:t,minor:o++},range:e,text:s,forceMoveMarkers:r,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let r=!1;const a={addEditOperation:s,addTrackedEditOperation:(e,t,i)=>{r=!0,s(e,t,i)},trackSelection:(t,i)=>{const n=ic.liftSelection(t);let o;if(n.isEmpty())if("boolean"==typeof i)o=i?2:3;else{const t=e.model.getLineMaxColumn(n.startLineNumber);o=n.startColumn===t?2:3}else o=1;const s=e.trackedRanges.length,r=e.model._setTrackedRange(null,n,o);return e.trackedRanges[s]=r,e.trackedRangesDirection[s]=n.getDirection(),s.toString()}};try{i.getEditOperations(e.model,a)}catch(e){return h(e),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:r}}static _getLoserCursorMap(e){(e=e.slice(0)).sort(((e,t)=>-tc.compareRangesUsingEnds(e.range,t.range)));const t={};for(let i=1;i<e.length;i++){const n=e[i-1],o=e[i];if(tc.getStartPosition(n.range).isBefore(tc.getEndPosition(o.range))){let s;s=n.identifier.major>o.identifier.major?n.identifier.major:o.identifier.major,t[s.toString()]=!0;for(let t=0;t<e.length;t++)e[t].identifier.major===s&&(e.splice(t,1),t<i&&i--,t--);i>0&&i--}}return t}}class eW{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class tW{static _capture(e,t){const i=[];for(const n of t){if(n.startLineNumber!==n.endLineNumber)return null;i.push(new eW(e.getLineContent(n.startLineNumber),n.startColumn-1,n.endColumn-1))}return i}constructor(e,t){this._original=tW._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=tW._capture(e,t);if(!i)return null;if(this._original.length!==i.length)return null;const n=[];for(let e=0,t=this._original.length;e<t;e++)n.push(tW._deduceOutcome(this._original[e],i[e]));return n}static _deduceOutcome(e,t){const i=Math.min(e.startSelection,t.startSelection,En(e.text,t.text)),n=Math.min(e.text.length-e.endSelection,t.text.length-t.endSelection,Nn(e.text,t.text)),o=e.text.substring(i,e.text.length-n),s=t.text.substring(i,t.text.length-n);return new fS(o,e.startSelection-i,e.endSelection-i,s,t.startSelection-i,t.endSelection-i)}}class iW{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,i=this._changes,n=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,n)}}class nW{constructor(e,t,i,n,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=n,this.minWidth=o,this.prefixSum=0}}class oW{constructor(e,t,i,n){this._instanceId=Gn(++oW.INSTANCE_COUNT),this._pendingChanges=new iW,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=n}static findInsertionIndex(e,t,i){let n=0,o=e.length;for(;n<o;){const s=n+o>>>1;t===e[s].afterLineNumber?i<e[s].ordinal?o=s:n=s+1:t<e[s].afterLineNumber?o=s:n=s+1}return n}setLineHeight(e){this._checkPendingChanges(),this._lineHeight=e}setPadding(e,t){this._paddingTop=e,this._paddingBottom=t}onFlushed(e){this._checkPendingChanges(),this._lineCount=e}changeWhitespace(e){let t=!1;try{e({insertWhitespace:(e,i,n,o)=>{t=!0,e|=0,i|=0,n|=0,o|=0;const s=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new nW(s,e,i,n,o)),s},changeOneWhitespace:(e,i,n)=>{t=!0,i|=0,n|=0,this._pendingChanges.change({id:e,newAfterLineNumber:i,newHeight:n})},removeWhitespace:e=>{t=!0,this._pendingChanges.remove({id:e})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const t of e)this._insertWhitespace(t);for(const e of t)this._changeOneWhitespace(e.id,e.newAfterLineNumber,e.newHeight);for(const e of i){const t=this._findWhitespaceIndex(e.id);-1!==t&&this._removeWhitespace(t)}return}const n=new Set;for(const e of i)n.add(e.id);const o=new Map;for(const e of t)o.set(e.id,e);const s=e=>{const t=[];for(const i of e)if(!n.has(i.id)){if(o.has(i.id)){const e=o.get(i.id);i.afterLineNumber=e.newAfterLineNumber,i.height=e.newHeight}t.push(i)}return t},r=s(this._arr).concat(s(e));r.sort(((e,t)=>e.afterLineNumber===t.afterLineNumber?e.ordinal-t.ordinal:e.afterLineNumber-t.afterLineNumber)),this._arr=r,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=oW.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,n=t.length;i<n;i++)if(t[i].id===e)return i;return-1}_changeOneWhitespace(e,t,i){const n=this._findWhitespaceIndex(e);if(-1!==n&&(this._arr[n].height!==i&&(this._arr[n].height=i,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,n-1)),this._arr[n].afterLineNumber!==t)){const e=this._arr[n];this._removeWhitespace(n),e.afterLineNumber=t,this._insertWhitespace(e)}}_removeWhitespace(e){this._arr.splice(e,1),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,e-1)}onLinesDeleted(e,t){this._checkPendingChanges(),e|=0,t|=0,this._lineCount-=t-e+1;for(let i=0,n=this._arr.length;i<n;i++){const n=this._arr[i].afterLineNumber;e<=n&&n<=t?this._arr[i].afterLineNumber=e-1:n>t&&(this._arr[i].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e|=0,t|=0,this._lineCount+=t-e+1;for(let i=0,n=this._arr.length;i<n;i++)e<=this._arr[i].afterLineNumber&&(this._arr[i].afterLineNumber+=t-e+1)}getWhitespacesTotalHeight(){return this._checkPendingChanges(),0===this._arr.length?0:this.getWhitespacesAccumulatedHeight(this._arr.length-1)}getWhitespacesAccumulatedHeight(e){this._checkPendingChanges(),e|=0;let t=Math.max(0,this._prefixSumValidIndex+1);0===t&&(this._arr[0].prefixSum=this._arr[0].height,t++);for(let i=t;i<=e;i++)this._arr[i].prefixSum=this._arr[i-1].prefixSum+this._arr[i].height;return this._prefixSumValidIndex=Math.max(this._prefixSumValidIndex,e),this._arr[e].prefixSum}getLinesTotalHeight(){return this._checkPendingChanges(),this._lineHeight*this._lineCount+this.getWhitespacesTotalHeight()+this._paddingTop+this._paddingBottom}getWhitespaceAccumulatedHeightBeforeLineNumber(e){this._checkPendingChanges(),e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e);return-1===t?0:this.getWhitespacesAccumulatedHeight(t)}_findLastWhitespaceBeforeLineNumber(e){e|=0;const t=this._arr;let i=0,n=t.length-1;for(;i<=n;){const o=i+((n-i|0)/2|0)|0;if(t[o].afterLineNumber<e){if(o+1>=t.length||t[o+1].afterLineNumber>=e)return o;i=o+1|0}else n=o-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e)+1;return t<this._arr.length?t:-1}getFirstWhitespaceIndexAfterLineNumber(e){return this._checkPendingChanges(),e|=0,this._findFirstWhitespaceAfterLineNumber(e)}getVerticalOffsetForLineNumber(e,t=!1){let i;return this._checkPendingChanges(),i=(e|=0)>1?this._lineHeight*(e-1):0,i+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0))+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){return this._checkPendingChanges(),e|=0,this._lineHeight*e+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0))+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),-1===this._minWidth){let e=0;for(let t=0,i=this._arr.length;t<i;t++)e=Math.max(e,this._arr[t].minWidth);this._minWidth=e}return this._minWidth}isAfterLines(e){return this._checkPendingChanges(),e>this.getLinesTotalHeight()}isInTopPadding(e){return 0!==this._paddingTop&&(this._checkPendingChanges(),e<this._paddingTop)}isInBottomPadding(e){return 0!==this._paddingBottom&&(this._checkPendingChanges(),e>=this.getLinesTotalHeight()-this._paddingBottom)}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),(e|=0)<0)return 1;const t=0|this._lineCount,i=this._lineHeight;let n=1,o=t;for(;n<o;){const t=(n+o)/2|0,s=0|this.getVerticalOffsetForLineNumber(t);if(e>=s+i)n=t+1;else{if(e>=s)return t;o=t}}return n>t?t:n}getLinesViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;const i=this._lineHeight,n=0|this.getLineNumberAtOrAfterVerticalOffset(e),o=0|this.getVerticalOffsetForLineNumber(n);let s=0|this._lineCount,r=0|this.getFirstWhitespaceIndexAfterLineNumber(n);const a=0|this.getWhitespacesCount();let l,h;-1===r?(r=a,h=s+1,l=0):(h=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));let d=o,c=d;const u=5e5;let g=0;o>=u&&(g=Math.floor(o/u)*u,g=Math.floor(g/i)*i,c-=g);const p=[],m=e+(t-e)/2;let f=-1;for(let e=n;e<=s;e++){for(-1===f&&(d<=m&&m<d+i||d>m)&&(f=e),d+=i,p[e-n]=c,c+=i;h===e;)c+=l,d+=l,r++,r>=a?h=s+1:(h=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));if(d>=t){s=e;break}}-1===f&&(f=s);const _=0|this.getVerticalOffsetForLineNumber(s);let v=n,b=s;return v<b&&o<e&&v++,v<b&&_+i>t&&b--,{bigNumbersDelta:g,startLineNumber:n,endLineNumber:s,relativeVerticalOffset:p,centeredLineNumber:f,completelyVisibleStartLineNumber:v,completelyVisibleEndLineNumber:b}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e|=0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i,n;return i=t>=1?this._lineHeight*t:0,n=e>0?this.getWhitespacesAccumulatedHeight(e-1):0,i+n+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e|=0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;if(e>=this.getVerticalOffsetForWhitespaceIndex(i)+this.getHeightForWhitespaceIndex(i))return-1;for(;t<i;){const n=Math.floor((t+i)/2),o=this.getVerticalOffsetForWhitespaceIndex(n);if(e>=o+this.getHeightForWhitespaceIndex(n))t=n+1;else{if(e>=o)return n;i=n}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e|=0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0)return null;if(t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const n=this.getHeightForWhitespaceIndex(t);return{id:this.getIdForWhitespaceIndex(t),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(t),verticalOffset:i,height:n}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),n=this.getWhitespacesCount()-1;if(i<0)return[];const o=[];for(let e=i;e<=n;e++){const i=this.getVerticalOffsetForWhitespaceIndex(e),n=this.getHeightForWhitespaceIndex(e);if(i>=t)break;o.push({id:this.getIdForWhitespaceIndex(e),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(e),verticalOffset:i,height:n})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].height}}oW.INSTANCE_COUNT=0;class sW{constructor(e,t,i,n){(e|=0)<0&&(e=0),(t|=0)<0&&(t=0),(i|=0)<0&&(i=0),(n|=0)<0&&(n=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=n,this.scrollHeight=Math.max(i,n)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class rW extends T{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new q),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new sW(0,0,0,0),this._scrollable=this._register(new _D({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,n=t.contentHeight!==e.contentHeight;(i||n)&&this._onDidContentSizeChange.fire(new FB(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class aW extends T{constructor(e,t,i){super(),this._configuration=e;const n=this._configuration.options,o=n.get(143),s=n.get(83);this._linesLayout=new oW(t,n.get(66),s.top,s.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new rW(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new sW(o.contentWidth,0,o.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(113)?125:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(66)&&this._linesLayout.setLineHeight(t.get(66)),e.hasChanged(83)){const e=t.get(83);this._linesLayout.setPadding(e.top,e.bottom)}if(e.hasChanged(143)){const e=t.get(143),i=e.contentWidth,n=e.height,o=this._scrollable.getScrollDimensions(),s=o.contentWidth;this._scrollable.setScrollDimensions(new sW(i,o.contentWidth,n,this._getContentHeight(i,n,s)))}else this._updateHeight();e.hasChanged(113)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const i=this._configuration.options.get(102);return 2===i.horizontal||e>=t?0:i.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return n.get(104)?o+=Math.max(0,t-n.get(66)-n.get(83).bottom):n.get(102).ignoreHorizontalScrollbarInContentHeight||(o+=this._getHorizontalScrollbarHeight(e,i)),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new sW(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new eF(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new eF(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(144),n=e.get(50),o=e.get(143);if(i.isViewportWrapping){const i=e.get(72);return t>o.contentWidth+n.typicalHalfwidthCharacterWidth&&i.enabled&&"right"===i.side?t+o.verticalScrollbarWidth:t}{const i=e.get(103)*n.typicalHalfwidthCharacterWidth,s=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+i+o.verticalScrollbarWidth,s,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new sW(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t);return{scrollTop:t,scrollTopWithoutViewZones:t-this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i),scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){1===t?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class lW{constructor(e,t,i,n,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const n=e.range,o=e.options;let s;if(o.isWholeLine){const e=this._coordinatesConverter.convertModelPositionToViewPosition(new ch(n.startLineNumber,1),0,!1,!0),t=this._coordinatesConverter.convertModelPositionToViewPosition(new ch(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)),1);s=new tc(e.lineNumber,e.column,t.lineNumber,t.column)}else s=this._coordinatesConverter.convertModelRangeToViewRange(n,1);i=new rF(s,o),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=null!==this._cachedModelDecorationsResolver;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getInlineDecorationsOnLine(e,t=!1,i=!1){const n=new tc(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(n,t,i).inlineDecorations[0]}_getDecorationsInRange(e,t,i){const n=this._linesCollection.getDecorationsInRange(e,this.editorId,Nk(this.configuration.options),t,i),o=e.startLineNumber,s=e.endLineNumber,r=[];let a=0;const l=[];for(let e=o;e<=s;e++)l[e-o]=[];for(let e=0,t=n.length;e<t;e++){const t=n[e],i=t.options;if(!hW(this.model,t))continue;const h=this._getOrCreateViewModelDecoration(t),d=h.range;if(r[a++]=h,i.inlineClassName){const e=new oF(d,i.inlineClassName,i.inlineClassNameAffectsLetterSpacing?3:0),t=Math.max(o,d.startLineNumber),n=Math.min(s,d.endLineNumber);for(let i=t;i<=n;i++)l[i-o].push(e)}if(i.beforeContentClassName&&o<=d.startLineNumber&&d.startLineNumber<=s){const e=new oF(new tc(d.startLineNumber,d.startColumn,d.startLineNumber,d.startColumn),i.beforeContentClassName,1);l[d.startLineNumber-o].push(e)}if(i.afterContentClassName&&o<=d.endLineNumber&&d.endLineNumber<=s){const e=new oF(new tc(d.endLineNumber,d.endColumn,d.endLineNumber,d.endColumn),i.afterContentClassName,2);l[d.endLineNumber-o].push(e)}}return{decorations:r,inlineDecorations:l}}}function hW(e,t){return!(t.options.hideInCommentTokens&&dW(e,t)||t.options.hideInStringTokens&&cW(e,t))}function dW(e,t){return uW(e,t.range,(e=>1===e))}function cW(e,t){return uW(e,t.range,(e=>2===e))}function uW(e,t,i){for(let n=t.startLineNumber;n<=t.endLineNumber;n++){const o=e.tokenization.getLineTokens(n),s=n===t.startLineNumber,r=n===t.endLineNumber;let a=s?o.findTokenIndexAtOffset(t.startColumn-1):0;for(;a<o.getCount()&&!(r&&o.getStartOffset(a)>t.endColumn-1);){if(!i(o.getStandardTokenType(a)))return!1;a++}}return!0}function gW(e,t){return null===e?t?mW.INSTANCE:fW.INSTANCE:new pW(e,t)}class pW{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,i){this._assertVisible();const n=i>0?this._projectionData.breakOffsets[i-1]:0,o=this._projectionData.breakOffsets[i];let s;if(null!==this._projectionData.injectionOffsets){const i=this._projectionData.injectionOffsets.map(((e,t)=>new ZC(0,0,e+1,this._projectionData.injectionOptions[t],0)));s=ZC.applyInjectedText(e.getLineContent(t),i).substring(n,o)}else s=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:o+1});return i>0&&(s=vW(this._projectionData.wrappedTextIndentLength)+s),s}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){const n=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],n),n[0]}getViewLinesData(e,t,i,n,o,s,r){this._assertVisible();const a=this._projectionData,l=a.injectionOffsets,h=a.injectionOptions;let d,c=null;if(l){c=[];let e=0,t=0;for(let i=0;i<a.getOutputLineCount();i++){const n=new Array;c[i]=n;const o=i>0?a.breakOffsets[i-1]:0,s=a.breakOffsets[i];for(;t<l.length;){const r=h[t].content.length,d=l[t]+e,c=d+r;if(d>s)break;if(o<c){const e=h[t];if(e.inlineClassName){const t=i>0?a.wrappedTextIndentLength:0,r=t+Math.max(d-o,0),l=t+Math.min(c-o,s-o);r!==l&&n.push(new sF(r,l,e.inlineClassName,e.inlineClassNameAffectsLetterSpacing))}}if(!(c<=s))break;e+=r,t++}}}d=l?e.tokenization.getLineTokens(t).withInserted(l.map(((e,t)=>({offset:e,text:h[t].content,tokenMetadata:IC.defaultTokenMetadata})))):e.tokenization.getLineTokens(t);for(let e=i;e<i+n;e++){const t=o+e-i;s[t]?r[t]=this._getViewLineData(d,c?c[e]:null,e):r[t]=null}}_getViewLineData(e,t,i){this._assertVisible();const n=this._projectionData,o=i>0?n.wrappedTextIndentLength:0,s=i>0?n.breakOffsets[i-1]:0,r=n.breakOffsets[i],a=e.sliceAndInflate(s,r,o);let l=a.getLineContent();i>0&&(l=vW(n.wrappedTextIndentLength)+l);const h=this._projectionData.getMinOutputOffset(i)+1,d=l.length+1,c=i+1<this.getViewLineCount(),u=0===i?0:n.breakOffsetsVisibleColumn[i-1];return new iF(l,c,h,d,u,a,t)}getModelColumnOfViewPosition(e,t){return this._assertVisible(),this._projectionData.translateToInputOffset(e,t-1)+1}getViewPositionOfModelPosition(e,t,i=2){return this._assertVisible(),this._projectionData.translateToOutputPosition(t-1,i).toPosition(e)}getViewLineNumberOfModelPosition(e,t){return this._assertVisible(),e+this._projectionData.translateToOutputPosition(t-1).outputLineIndex}normalizePosition(e,t,i){const n=t.lineNumber-e;return this._projectionData.normalizeOutputPosition(e,t.column-1,i).toPosition(n)}getInjectedTextAt(e,t){return this._projectionData.getInjectedText(e,t-1)}_assertVisible(){if(!this._isVisible)throw new Error("Not supported")}}class mW{constructor(){}isVisible(){return!0}setVisible(e){return e?this:fW.INSTANCE}getProjectionData(){return null}getViewLineCount(){return 1}getViewLineContent(e,t,i){return e.getLineContent(t)}getViewLineLength(e,t,i){return e.getLineLength(t)}getViewLineMinColumn(e,t,i){return e.getLineMinColumn(t)}getViewLineMaxColumn(e,t,i){return e.getLineMaxColumn(t)}getViewLineData(e,t,i){const n=e.tokenization.getLineTokens(t),o=n.getLineContent();return new iF(o,!1,1,o.length+1,0,n.inflate(),null)}getViewLinesData(e,t,i,n,o,s,r){s[o]?r[o]=this.getViewLineData(e,t,0):r[o]=null}getModelColumnOfViewPosition(e,t){return t}getViewPositionOfModelPosition(e,t){return new ch(e,t)}getViewLineNumberOfModelPosition(e,t){return e}normalizePosition(e,t,i){return t}getInjectedTextAt(e,t){return null}}mW.INSTANCE=new mW;class fW{constructor(){}isVisible(){return!1}setVisible(e){return e?mW.INSTANCE:this}getProjectionData(){return null}getViewLineCount(){return 0}getViewLineContent(e,t,i){throw new Error("Not supported")}getViewLineLength(e,t,i){throw new Error("Not supported")}getViewLineMinColumn(e,t,i){throw new Error("Not supported")}getViewLineMaxColumn(e,t,i){throw new Error("Not supported")}getViewLineData(e,t,i){throw new Error("Not supported")}getViewLinesData(e,t,i,n,o,s,r){throw new Error("Not supported")}getModelColumnOfViewPosition(e,t){throw new Error("Not supported")}getViewPositionOfModelPosition(e,t){throw new Error("Not supported")}getViewLineNumberOfModelPosition(e,t){throw new Error("Not supported")}normalizePosition(e,t,i){throw new Error("Not supported")}getInjectedTextAt(e,t){throw new Error("Not supported")}}fW.INSTANCE=new fW;const _W=[""];function vW(e){if(e>=_W.length)for(let t=1;t<=e;t++)_W[t]=bW(t);return _W[e]}function bW(e){return new Array(e+1).join(" ")}class wW{constructor(e,t,i,n,o,s,r,a,l,h){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=n,this.fontInfo=o,this.tabSize=s,this.wrappingStrategy=r,this.wrappingColumn=a,this.wrappingIndent=l,this.wordBreak=h,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new SW(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),n=this.model.getInjectedTextDecorations(this._editorId),o=i.length,s=this.createLineBreaksComputer(),r=new eu(ZC.fromDecorations(n));for(let e=0;e<o;e++){const n=r.takeWhile((t=>t.lineNumber===e+1));s.addRequest(i[e],n,t?t[e]:null)}const a=s.finalize(),l=[],h=this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e))).sort(tc.compareRangesUsingStarts);let d=1,c=0,u=-1,g=u+1<h.length?c+1:o+2;for(let e=0;e<o;e++){const t=e+1;t===g&&(u++,d=h[u].startLineNumber,c=h[u].endLineNumber,g=u+1<h.length?c+1:o+2);const i=t>=d&&t<=c,n=gW(a[e],!i);l[e]=n.getViewLineCount(),this.modelLineProjections[e]=n}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new QI(l)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e)))}setHiddenAreas(e){const t=function(e){if(0===e.length)return[];const t=e.slice();t.sort(tc.compareRangesUsingStarts);const i=[];let n=t[0].startLineNumber,o=t[0].endLineNumber;for(let e=1,s=t.length;e<s;e++){const s=t[e];s.startLineNumber>o+1?(i.push(new tc(n,1,o,1)),n=s.startLineNumber,o=s.endLineNumber):s.endLineNumber>o&&(o=s.endLineNumber)}return i.push(new tc(n,1,o,1)),i}(e.map((e=>this.model.validateRange(e)))),i=this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e))).sort(tc.compareRangesUsingStarts);if(t.length===i.length){let e=!1;for(let n=0;n<t.length;n++)if(!t[n].equalsRange(i[n])){e=!0;break}if(!e)return!1}const n=t.map((e=>({range:e,options:Sy.EMPTY})));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,n);const o=t;let s=1,r=0,a=-1,l=a+1<o.length?r+1:this.modelLineProjections.length+2,h=!1;for(let e=0;e<this.modelLineProjections.length;e++){const t=e+1;t===l&&(a++,s=o[a].startLineNumber,r=o[a].endLineNumber,l=a+1<o.length?r+1:this.modelLineProjections.length+2);let i=!1;if(t>=s&&t<=r?this.modelLineProjections[e].isVisible()&&(this.modelLineProjections[e]=this.modelLineProjections[e].setVisible(!1),i=!0):(h=!0,this.modelLineProjections[e].isVisible()||(this.modelLineProjections[e]=this.modelLineProjections[e].setVisible(!0),i=!0)),i){const t=this.modelLineProjections[e].getViewLineCount();this.projectedModelLineLineCounts.setValue(e,t)}}return h||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return!(e<1||e>this.modelLineProjections.length)&&this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize!==e&&(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,n,o){const s=this.fontInfo.equals(e),r=this.wrappingStrategy===t,a=this.wrappingColumn===i,l=this.wrappingIndent===n,h=this.wordBreak===o;if(s&&r&&a&&l&&h)return!1;const d=s&&r&&!a&&l&&h;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=n,this.wordBreak=o;let c=null;if(d){c=[];for(let e=0,t=this.modelLineProjections.length;e<t;e++)c[e]=this.modelLineProjections[e].getProjectionData()}return this._constructLines(!1,c),!0}createLineBreaksComputer(){return("advanced"===this.wrappingStrategy?this._domLineBreaksComputerFactory:this._monospaceLineBreaksComputerFactory).createLineBreaksComputer(this.fontInfo,this.tabSize,this.wrappingColumn,this.wrappingIndent,this.wordBreak)}onModelFlushed(){this._constructLines(!0,null)}onModelLinesDeleted(e,t,i){if(!e||e<=this._validModelVersionId)return null;const n=1===t?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,o=this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections.splice(t-1,i-t+1),this.projectedModelLineLineCounts.removeValues(t-1,i-t+1),new DB(n,o)}onModelLinesInserted(e,t,i,n){if(!e||e<=this._validModelVersionId)return null;const o=t>2&&!this.modelLineProjections[t-2].isVisible(),s=1===t?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let r=0;const a=[],l=[];for(let e=0,t=n.length;e<t;e++){const t=gW(n[e],!o);a.push(t);const i=t.getViewLineCount();r+=i,l[e]=i}return this.modelLineProjections=this.modelLineProjections.slice(0,t-1).concat(a).concat(this.modelLineProjections.slice(t-1)),this.projectedModelLineLineCounts.insertValues(t-1,l),new EB(s,s+r-1)}onModelLineChanged(e,t,i){if(null!==e&&e<=this._validModelVersionId)return[!1,null,null,null];const n=t-1,o=this.modelLineProjections[n].getViewLineCount(),s=gW(i,this.modelLineProjections[n].isVisible());this.modelLineProjections[n]=s;const r=this.modelLineProjections[n].getViewLineCount();let a=!1,l=0,h=-1,d=0,c=-1,u=0,g=-1;return o>r?(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,h=l+r-1,u=h+1,g=u+(o-r)-1,a=!0):o<r?(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,h=l+o-1,d=h+1,c=d+(r-o)-1,a=!0):(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,h=l+r-1),this.projectedModelLineLineCounts.setValue(n,r),[a,l<=h?new xB(l,h-l+1):null,d<=c?new EB(d,c):null,u<=g?new DB(u,g):null]}acceptVersionId(e){this._validModelVersionId=e,1!==this.modelLineProjections.length||this.modelLineProjections[0].isVisible()||this.setHiddenAreas([])}getViewLineCount(){return this.projectedModelLineLineCounts.getTotalSum()}_toValidViewLineNumber(e){if(e<1)return 1;const t=this.getViewLineCount();return e>t?t:0|e}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),s=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),r=this.model.guides.getActiveIndentGuide(n.lineNumber,o.lineNumber,s.lineNumber),a=this.convertModelPositionToViewPosition(r.startLineNumber,1),l=this.convertModelPositionToViewPosition(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber));return{startLineNumber:a.lineNumber,endLineNumber:l.lineNumber,indent:r.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,n=t.remainder;return new CW(i+1,n)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new ch(e.modelLineNumber,n)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new ch(e.modelLineNumber,n)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),n=this.getViewLineInfo(t),o=new Array;let s=this.getModelStartPositionOfViewLine(i),r=new Array;for(let e=i.modelLineNumber;e<=n.modelLineNumber;e++){const t=this.modelLineProjections[e-1];if(t.isVisible()){const o=e===i.modelLineNumber?i.modelLineWrappedLineIdx:0,s=e===n.modelLineNumber?n.modelLineWrappedLineIdx+1:t.getViewLineCount();for(let t=o;t<s;t++)r.push(new CW(e,t))}if(!t.isVisible()&&s){const t=new ch(e-1,this.model.getLineMaxColumn(e-1)+1),i=tc.fromPositions(s,t);o.push(new yW(i,r)),r=[],s=null}else t.isVisible()&&!s&&(s=new ch(e,1))}if(s){const e=tc.fromPositions(s,this.getModelEndPositionOfViewLine(n));o.push(new yW(e,r))}return o}getViewLinesBracketGuides(e,t,i,n){const o=i?this.convertViewPositionToModelPosition(i.lineNumber,i.column):null,s=[];for(const i of this.getViewLineInfosGroupedByModelRanges(e,t)){const e=i.modelRange.startLineNumber,t=this.model.guides.getLinesBracketGuides(e,i.modelRange.endLineNumber,o,n);for(const n of i.viewLines){const i=t[n.modelLineNumber-e].map((e=>{if(-1!==e.forWrappedLinesAfterColumn&&this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesAfterColumn).lineNumber>=n.modelLineWrappedLineIdx)return;if(-1!==e.forWrappedLinesBeforeOrAtColumn&&this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesBeforeOrAtColumn).lineNumber<n.modelLineWrappedLineIdx)return;if(!e.horizontalLine)return e;let t=-1;if(-1!==e.column){const i=this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.column);if(i.lineNumber===n.modelLineWrappedLineIdx)t=i.column;else if(i.lineNumber<n.modelLineWrappedLineIdx)t=this.getMinColumnOfViewLine(n);else if(i.lineNumber>n.modelLineWrappedLineIdx)return}const i=this.convertModelPositionToViewPosition(n.modelLineNumber,e.horizontalLine.endColumn),o=this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.horizontalLine.endColumn);return o.lineNumber===n.modelLineWrappedLineIdx?new Zb(e.visibleColumn,t,e.className,new Yb(e.horizontalLine.top,i.column),-1,-1):o.lineNumber<n.modelLineWrappedLineIdx||-1!==e.visibleColumn?void 0:new Zb(e.visibleColumn,t,e.className,new Yb(e.horizontalLine.top,this.getMaxColumnOfViewLine(n)),-1,-1)}));s.push(i.filter((e=>!!e)))}}return s}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),n=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const s=[],r=[],a=i.lineNumber-1,l=n.lineNumber-1;let h=null;for(let e=a;e<=l;e++){const t=this.modelLineProjections[e];if(t.isVisible()){const n=t.getViewLineNumberOfModelPosition(0,e===a?i.column:1),o=t.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(e+1)),l=o-n+1;let d=0;l>1&&1===t.getViewLineMinColumn(this.model,e+1,o)&&(d=0===n?1:2),s.push(l),r.push(d),null===h&&(h=new ch(e+1,0))}else null!==h&&(o=o.concat(this.model.guides.getLinesIndentGuides(h.lineNumber,e)),h=null)}null!==h&&(o=o.concat(this.model.guides.getLinesIndentGuides(h.lineNumber,n.lineNumber)),h=null);const d=t-e+1,c=new Array(d);let u=0;for(let e=0,t=o.length;e<t;e++){let t=o[e];const i=Math.min(d-u,s[e]),n=r[e];let a;a=2===n?0:1===n?1:i;for(let e=0;e<i;e++)e===a&&(t=0),c[u++]=t}return c}getViewLineContent(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineContent(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineLength(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineLength(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMinColumn(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMinColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMaxColumn(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMaxColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineData(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineData(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLinesData(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const n=this.projectedModelLineLineCounts.getIndexOf(e-1);let o=e;const s=n.index,r=n.remainder,a=[];for(let n=s,l=this.model.getLineCount();n<l;n++){const l=this.modelLineProjections[n];if(!l.isVisible())continue;const h=n===s?r:0;let d=l.getViewLineCount()-h,c=!1;if(o+d>t&&(c=!0,d=t-o+1),l.getViewLinesData(this.model,n+1,h,d,o-e,i,a),o+=d,c)break}return a}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const n=this.projectedModelLineLineCounts.getIndexOf(e-1),o=n.index,s=n.remainder,r=this.modelLineProjections[o],a=r.getViewLineMinColumn(this.model,o+1,s),l=r.getViewLineMaxColumn(this.model,o+1,s);t<a&&(t=a),t>l&&(t=l);const h=r.getModelColumnOfViewPosition(s,t);return this.model.validatePosition(new ch(o+1,h)).equals(i)?new ch(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),n=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new tc(i.lineNumber,i.column,n.lineNumber,n.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),n=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new ch(i.modelLineNumber,n))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new tc(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,n=!1,o=!1){const s=this.model.validatePosition(new ch(e,t)),r=s.lineNumber,a=s.column;let l=r-1,h=!1;if(o)for(;l<this.modelLineProjections.length&&!this.modelLineProjections[l].isVisible();)l++,h=!0;else for(;l>0&&!this.modelLineProjections[l].isVisible();)l--,h=!0;if(0===l&&!this.modelLineProjections[l].isVisible())return new ch(n?0:1,1);const d=1+this.projectedModelLineLineCounts.getPrefixSum(l);let c;return c=h?o?this.modelLineProjections[l].getViewPositionOfModelPosition(d,1,i):this.modelLineProjections[l].getViewPositionOfModelPosition(d,this.model.getLineMaxColumn(l+1),i):this.modelLineProjections[r-1].getViewPositionOfModelPosition(d,a,i),c}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return tc.fromPositions(i)}{const t=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),i=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new tc(t.lineNumber,t.column,i.lineNumber,i.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const e=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(e,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(0===i&&!this.modelLineProjections[i].isVisible())return 1;const n=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(n,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,n,o){const s=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),r=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(r.lineNumber-s.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new tc(s.lineNumber,1,r.lineNumber,r.column),t,i,n,o);let a=[];const l=s.lineNumber-1,h=r.lineNumber-1;let d=null;for(let e=l;e<=h;e++)if(this.modelLineProjections[e].isVisible())null===d&&(d=new ch(e+1,e===l?s.column:1));else if(null!==d){const o=this.model.getLineMaxColumn(e);a=a.concat(this.model.getDecorationsInRange(new tc(d.lineNumber,d.column,e,o),t,i,n)),d=null}null!==d&&(a=a.concat(this.model.getDecorationsInRange(new tc(d.lineNumber,d.column,r.lineNumber,r.column),t,i,n)),d=null),a.sort(((e,t)=>{const i=tc.compareRangesUsingStarts(e.range,t.range);return 0===i?e.id<t.id?-1:e.id>t.id?1:0:i}));const c=[];let u=0,g=null;for(const e of a){const t=e.id;g!==t&&(g=t,c[u++]=e)}return c}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return 0===t.modelLineWrappedLineIdx?this.model.getLineIndentColumn(t.modelLineNumber):0}}class CW{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class yW{constructor(e,t){this.modelRange=e,this.viewLines=t}}class SW{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t,i,n){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,n)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}class kW{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new LW(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,n){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,n)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new DB(t,i)}onModelLinesInserted(e,t,i,n){return new EB(t,i)}onModelLineChanged(e,t,i){return[!1,new xB(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1,n=new Array(i);for(let e=0;e<i;e++)n[e]=0;return n}getViewLineContent(e){return this.model.getLineContent(e)}getViewLineLength(e){return this.model.getLineLength(e)}getViewLineMinColumn(e){return this.model.getLineMinColumn(e)}getViewLineMaxColumn(e){return this.model.getLineMaxColumn(e)}getViewLineData(e){const t=this.model.tokenization.getLineTokens(e),i=t.getLineContent();return new iF(i,!1,1,i.length+1,0,t.inflate(),null)}getViewLinesData(e,t,i){const n=this.model.getLineCount();e=Math.min(Math.max(1,e),n),t=Math.min(Math.max(1,t),n);const o=[];for(let n=e;n<=t;n++){const t=n-e;o[t]=i[t]?this.getViewLineData(n):null}return o}getDecorationsInRange(e,t,i,n,o){return this.model.getDecorationsInRange(e,t,i,n,o)}normalizePosition(e,t){return this.model.normalizePosition(e,t)}getLineIndentColumn(e){return this.model.getLineIndentColumn(e)}getInjectedTextAt(e){return null}}class LW{constructor(e){this._lines=e}_validPosition(e){return this._lines.model.validatePosition(e)}_validRange(e){return this._lines.model.validateRange(e)}convertViewPositionToModelPosition(e){return this._validPosition(e)}convertViewRangeToModelRange(e){return this._validRange(e)}validateViewPosition(e,t){return this._validPosition(t)}validateViewRange(e,t){return this._validRange(t)}convertModelPositionToViewPosition(e){return this._validPosition(e)}convertModelRangeToViewRange(e){return this._validRange(e)}modelPositionIsVisible(e){const t=this._lines.model.getLineCount();return!(e.lineNumber<1||e.lineNumber>t)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}class xW extends T{constructor(e,t,i,n,o,s,r,a,l){if(super(),this.languageConfigurationService=r,this._themeService=a,this._attachedView=l,this.hiddenAreasModel=new NW,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new OB,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new Py(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new Zt((()=>this._updateConfigurationViewLineCountNow()),0)),this._hasFocus=!1,this._viewportStart=DW.create(this.model),this.model.isTooLargeForTokenization())this._lines=new kW(this.model);else{const e=this._configuration.options,t=e.get(50),i=e.get(137),s=e.get(144),r=e.get(136),a=e.get(128);this._lines=new wW(this._editorId,this.model,n,o,t,this.model.getOptions().tabSize,i,s.wrappingColumn,r,a)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new YB(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new aW(this._configuration,this.getLineCount(),s)),this._register(this.viewLayout.onDidScroll((e=>{e.scrollTopChanged&&this._handleVisibleLinesChanged(),e.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new IB(e)),this._eventDispatcher.emitOutgoingEvent(new WB(e.oldScrollWidth,e.oldScrollLeft,e.oldScrollHeight,e.oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop))}))),this._register(this.viewLayout.onDidContentSizeChange((e=>{this._eventDispatcher.emitOutgoingEvent(e)}))),this._decorations=new lW(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast((e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}}))),this._register(JP.getInstance().onDidChange((()=>{this._eventDispatcher.emitSingleViewEvent(new AB)}))),this._register(this._themeService.onDidColorThemeChange((e=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new MB(e))}))),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new tc(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new SB(e)),this._eventDispatcher.emitOutgoingEvent(new BB(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new _B)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new vB)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new ch(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new MW(t,this._viewportStart.startLineDelta)}return new MW(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),n=this._configuration.options,o=n.get(50),s=n.get(137),r=n.get(144),a=n.get(136),l=n.get(128);this._lines.setWrappingSettings(o,s,r.wrappingColumn,a,l)&&(e.emitViewEvent(new yB),e.emitViewEvent(new LB),e.emitViewEvent(new CB(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(90)&&(this._decorations.reset(),e.emitViewEvent(new CB(null))),t.hasChanged(97)&&(this._decorations.reset(),e.emitViewEvent(new CB(null))),e.emitViewEvent(new bB(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),Py.shouldRecreate(t)&&(this.cursorConfig=new Py(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText((e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();let i=!1,n=!1;const o=e instanceof iy?e.rawContentChangedEvent.changes:e.changes,s=e instanceof iy?e.rawContentChangedEvent.versionId:null,r=this._lines.createLineBreaksComputer();for(const e of o)switch(e.changeType){case 4:for(let t=0;t<e.detail.length;t++){const i=e.detail[t];let n=e.injectedTexts[t];n&&(n=n.filter((e=>!e.ownerId||e.ownerId===this._editorId))),r.addRequest(i,n,null)}break;case 2:{let t=null;e.injectedText&&(t=e.injectedText.filter((e=>!e.ownerId||e.ownerId===this._editorId))),r.addRequest(e.detail,t,null);break}}const a=r.finalize(),l=new eu(a);for(const e of o)switch(e.changeType){case 1:this._lines.onModelFlushed(),t.emitViewEvent(new yB),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),i=!0;break;case 3:{const n=this._lines.onModelLinesDeleted(s,e.fromLineNumber,e.toLineNumber);null!==n&&(t.emitViewEvent(n),this.viewLayout.onLinesDeleted(n.fromLineNumber,n.toLineNumber)),i=!0;break}case 4:{const n=l.takeCount(e.detail.length),o=this._lines.onModelLinesInserted(s,e.fromLineNumber,e.toLineNumber,n);null!==o&&(t.emitViewEvent(o),this.viewLayout.onLinesInserted(o.fromLineNumber,o.toLineNumber)),i=!0;break}case 2:{const i=l.dequeue(),[o,r,a,h]=this._lines.onModelLineChanged(s,e.lineNumber,i);n=o,r&&t.emitViewEvent(r),a&&(t.emitViewEvent(a),this.viewLayout.onLinesInserted(a.fromLineNumber,a.toLineNumber)),h&&(t.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber));break}}null!==s&&this._lines.acceptVersionId(s),this.viewLayout.onHeightMaybeChanged(),!i&&n&&(t.emitViewEvent(new LB),t.emitViewEvent(new CB(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){const e=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(e){const t=this.coordinatesConverter.convertModelPositionToViewPosition(e.getStartPosition()),i=this.viewLayout.getVerticalOffsetForLineNumber(t.lineNumber);this.viewLayout.setScrollPosition({scrollTop:i+this._viewportStart.startLineDelta},1)}}try{const t=this._eventDispatcher.beginEmitViewEvents();e instanceof iy&&t.emitOutgoingEvent(new $B(e.contentChangedEvent)),this._cursor.onModelContentChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()}))),this._register(this.model.onDidChangeTokens((e=>{const t=[];for(let i=0,n=e.ranges.length;i<n;i++){const n=e.ranges[i],o=this.coordinatesConverter.convertModelPositionToViewPosition(new ch(n.fromLineNumber,1)).lineNumber,s=this.coordinatesConverter.convertModelPositionToViewPosition(new ch(n.toLineNumber,this.model.getLineMaxColumn(n.toLineNumber))).lineNumber;t[i]={fromLineNumber:o,toLineNumber:s}}this._eventDispatcher.emitSingleViewEvent(new TB(t)),this._eventDispatcher.emitOutgoingEvent(new ZB(e))}))),this._register(this.model.onDidChangeLanguageConfiguration((e=>{this._eventDispatcher.emitSingleViewEvent(new kB),this.cursorConfig=new Py(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new qB(e))}))),this._register(this.model.onDidChangeLanguage((e=>{this.cursorConfig=new Py(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new jB(e))}))),this._register(this.model.onDidChangeOptions((e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const e=this._eventDispatcher.beginEmitViewEvents();e.emitViewEvent(new yB),e.emitViewEvent(new LB),e.emitViewEvent(new CB(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new Py(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new GB(e))}))),this._register(this.model.onDidChangeDecorations((e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new CB(e)),this._eventDispatcher.emitOutgoingEvent(new KB(e))})))}setHiddenAreas(e,t){var i;this.hiddenAreasModel.setHiddenAreas(t,e);const n=this.hiddenAreasModel.getMergedRanges();if(n===this.previousHiddenAreas)return;this.previousHiddenAreas=n;const o=this._captureStableViewport();let s=!1;try{const e=this._eventDispatcher.beginEmitViewEvents();s=this._lines.setHiddenAreas(n),s&&(e.emitViewEvent(new yB),e.emitViewEvent(new LB),e.emitViewEvent(new CB(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged());const t=null===(i=o.viewportStartModelPosition)||void 0===i?void 0:i.lineNumber,r=t&&n.some((e=>e.startLineNumber<=t&&t<=e.endLineNumber));r||o.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),s&&this._eventDispatcher.emitOutgoingEvent(new zB)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(143),t=this._configuration.options.get(66),i=Math.max(20,Math.round(e.height/t)),n=this.viewLayout.getLinesViewportData(),o=Math.max(1,n.completelyVisibleStartLineNumber-i),s=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new tc(o,this.getLineMinColumn(o),s,this.getLineMaxColumn(s)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(0===i.length)return[t];const n=[];let o=0,s=t.startLineNumber,r=t.startColumn;const a=t.endLineNumber,l=t.endColumn;for(let e=0,t=i.length;e<t;e++){const t=i[e].startLineNumber,l=i[e].endLineNumber;l<s||t>a||(s<t&&(n[o++]=new tc(s,r,t-1,this.model.getLineMaxColumn(t-1))),s=l+1,r=1)}return(s<a||s===a&&r<l)&&(n[o++]=new tc(s,r,a,l)),n}getCompletelyVisibleViewRange(){const e=this.viewLayout.getLinesViewportData(),t=e.completelyVisibleStartLineNumber,i=e.completelyVisibleEndLineNumber;return new tc(t,this.getLineMinColumn(t),i,this.getLineMaxColumn(i))}getCompletelyVisibleViewRangeAtScrollTop(e){const t=this.viewLayout.getLinesViewportDataAtScrollTop(e),i=t.completelyVisibleStartLineNumber,n=t.completelyVisibleEndLineNumber;return new tc(i,this.getLineMinColumn(i),n,this.getLineMaxColumn(n))}saveState(){const e=this.viewLayout.saveState(),t=e.scrollTop,i=this.viewLayout.getLineNumberAtVerticalOffset(t),n=this.coordinatesConverter.convertViewPositionToModelPosition(new ch(i,this.getLineMinColumn(i))),o=this.viewLayout.getVerticalOffsetForLineNumber(i)-t;return{scrollLeft:e.scrollLeft,firstPosition:n,firstPositionDeltaTop:o}}reduceRestoreState(e){if(void 0===e.firstPosition)return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),n=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:n}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,n){return this._lines.getViewLinesBracketGuides(e,t,i,n)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=fn(this.getLineContent(e));return-1===t?0:t+1}getLineLastNonWhitespaceColumn(e){const t=vn(this.getLineContent(e));return-1===t?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewportViewLineRenderingData(e,t){const i=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,i)}getViewLineRenderingData(e){const t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){const i=this.model.mightContainRTL(),n=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),s=this._lines.getViewLineData(e);return s.inlineDecorations&&(t=[...t,...s.inlineDecorations.map((t=>t.toInlineDecoration(e)))]),new nF(s.minColumn,s.maxColumn,s.content,s.continuesWithWrappedLine,i,n,s.tokens,t,o,s.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const n=this._lines.getViewLinesData(e,t,i);return new tF(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,Nk(this._configuration.options)),i=new EW;for(const n of t){const t=n.options,o=t.overviewRuler;if(!o)continue;const s=o.position;if(0===s)continue;const r=o.getColor(e.value),a=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.startLineNumber,n.range.startColumn),l=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.endLineNumber,n.range.endColumn);i.accept(r,t.zIndex,a,l,s)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const e=t.options.overviewRuler;null==e||e.invalidateCachedColor();const i=t.options.minimap;null==i||i.invalidateCachedColor()}}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){const i=this.coordinatesConverter.convertViewPositionToModelPosition(e);return this.model.modifyPosition(i,t)}deduceModelPositionRelativeToViewPosition(e,t,i){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e);2===this.model.getEOL().length&&(t<0?t-=i:t+=i);const o=this.model.getOffsetAt(n)+t;return this.model.getPositionAt(o)}getPlainTextToCopy(e,t,i){const n=i?"\r\n":this.model.getEOL();(e=e.slice(0)).sort(tc.compareRangesUsingStarts);let o=!1,s=!1;for(const t of e)t.isEmpty()?o=!0:s=!0;if(!s){if(!t)return"";const i=e.map((e=>e.startLineNumber));let o="";for(let e=0;e<i.length;e++)e>0&&i[e-1]===i[e]||(o+=this.model.getLineContent(i[e])+n);return o}if(o&&t){const t=[];let n=0;for(const o of e){const e=o.startLineNumber;o.isEmpty()?e!==n&&t.push(this.model.getLineContent(e)):t.push(this.model.getValueInRange(o,i?2:0)),n=e}return 1===t.length?t[0]:t}const r=[];for(const t of e)t.isEmpty()||r.push(this.model.getValueInRange(t,i?2:0));return 1===r.length?r[0]:r}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===Hg)return null;if(1!==e.length)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const e=n.startLineNumber;n=new tc(e,this.model.getLineMinColumn(e),e,this.model.getLineMaxColumn(e))}const o=this._configuration.options.get(50),s=this._getColorMap();let r;return/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===Vk.fontFamily?r=Vk.fontFamily:(r=o.fontFamily,r=r.replace(/"/g,"'"),/[,']/.test(r)||/[+ ]/.test(r)&&(r=`'${r}'`),r=`${r}, ${Vk.fontFamily}`),{mode:i,html:`<div style="color: ${s[1]};background-color: ${s[2]};font-family: ${r};font-weight: ${o.fontWeight};font-size: ${o.fontSize}px;line-height: ${o.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(n,s)+"</div>"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn,r=this.getTabSize();let a="";for(let e=i;e<=o;e++){const l=this.model.tokenization.getLineTokens(e),h=l.getLineContent(),d=e===i?n-1:0,c=e===o?s-1:h.length;a+=""===h?"<br>":Vx(h,l.inflate(),t,d,c,r,We)}return a}_getColorMap(){const e=SC.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;i<n;i++)t[i]=ru.Format.CSS.formatHex(e[i]);return t}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,t,i){return this._withViewEventsCollector((n=>this._cursor.setStates(n,e,t,i)))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector((n=>this._cursor.setSelections(n,e,t,i)))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector((t=>this._cursor.restoreState(t,e)))}_executeCursorEdit(e){this._cursor.context.cursorConfig.readOnly?this._eventDispatcher.emitOutgoingEvent(new UB):this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit((n=>this._cursor.executeEdits(n,e,t,i)))}startComposition(){this._executeCursorEdit((e=>this._cursor.startComposition(e)))}endComposition(e){this._executeCursorEdit((t=>this._cursor.endComposition(t,e)))}type(e,t){this._executeCursorEdit((i=>this._cursor.type(i,e,t)))}compositionType(e,t,i,n,o){this._executeCursorEdit((s=>this._cursor.compositionType(s,e,t,i,n,o)))}paste(e,t,i,n){this._executeCursorEdit((o=>this._cursor.paste(o,e,t,i,n)))}cut(e){this._executeCursorEdit((t=>this._cursor.cut(t,e)))}executeCommand(e,t){this._executeCursorEdit((i=>this._cursor.executeCommand(i,e,t)))}executeCommands(e,t){this._executeCursorEdit((i=>this._cursor.executeCommands(i,e,t)))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector((n=>this._cursor.revealPrimary(n,e,i,0,t,0)))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new tc(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector((t=>t.emitViewEvent(new NB(e,!1,i,null,0,!0,0))))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new tc(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector((t=>t.emitViewEvent(new NB(e,!1,i,null,0,!0,0))))}revealRange(e,t,i,n,o){this._withViewEventsCollector((s=>s.emitViewEvent(new NB(e,!1,i,null,n,t,o))))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new RB),this._eventDispatcher.emitOutgoingEvent(new VB))}_withViewEventsCollector(e){try{return e(this._eventDispatcher.beginEmitViewEvents())}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}}class DW{static create(e){const t=e._setTrackedRange(null,new tc(1,1,1,1),1);return new DW(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,n,o){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=n,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new ch(t,e.getLineMinColumn(t))),n=e.model._setTrackedRange(this._modelTrackedRange,new tc(i.lineNumber,i.column,i.lineNumber,i.column),1),o=e.viewLayout.getVerticalOffsetForLineNumber(t),s=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=n,this._startLineDelta=s-o}invalidate(){this._isValid=!1}}class EW{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,o){const s=this._asMap[e];if(s){const e=s.data,t=e[e.length-3],r=e[e.length-1];if(t===o&&r+1>=i)return void(n>r&&(e[e.length-1]=n));e.push(o,i,n)}else{const s=new aF(e,t,[o,i,n]);this._asMap[e]=s,this.asArray.push(s)}}}class NW{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&IW(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce(((e,t)=>function(e,t){const i=[];let n=0,o=0;for(;n<e.length&&o<t.length;){const s=e[n],r=t[o];if(s.endLineNumber<r.startLineNumber-1)i.push(e[n++]);else if(r.endLineNumber<s.startLineNumber-1)i.push(t[o++]);else{const e=Math.min(s.startLineNumber,r.startLineNumber),t=Math.max(s.endLineNumber,r.endLineNumber);i.push(new tc(e,1,t,1)),n++,o++}}for(;n<e.length;)i.push(e[n++]);for(;o<t.length;)i.push(t[o++]);return i}(e,t)),[]);return IW(this.ranges,e)||(this.ranges=e),this.ranges}}function IW(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].equalsRange(t[i]))return!1;return!0}class MW{constructor(e,t){this.viewportStartModelPosition=e,this.startLineDelta=t}recoverViewportStart(e,t){if(!this.viewportStartModelPosition)return;const i=e.convertModelPositionToViewPosition(this.viewportStartModelPosition),n=t.getVerticalOffsetForLineNumber(i.lineNumber);t.setScrollPosition({scrollTop:n+this.startLineDelta},1)}}class TW{constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}get(e){return this._entries.get(e)}}class AW{constructor(e,t,i,n,o){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=n,this.wrappedTextIndentLength=o}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let i=this.breakOffsets[e]-t;return e>0&&(i+=this.wrappedTextIndentLength),i}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let i=0===e?t:this.breakOffsets[e-1]+t;if(null!==this.injectionOffsets)for(let e=0;e<this.injectionOffsets.length&&i>this.injectionOffsets[e];e++)i<this.injectionOffsets[e]+this.injectionOptions[e].content.length?i=this.injectionOffsets[e]:i-=this.injectionOptions[e].content.length;return i}translateToOutputPosition(e,t=2){let i=e;if(null!==this.injectionOffsets)for(let n=0;n<this.injectionOffsets.length&&!(e<this.injectionOffsets[n])&&(1===t||e!==this.injectionOffsets[n]);n++)i+=this.injectionOptions[n].content.length;return this.offsetInInputWithInjectionsToOutputPosition(i,t)}offsetInInputWithInjectionsToOutputPosition(e,t=2){let i=0,n=this.breakOffsets.length-1,o=0,s=0;for(;i<=n;){o=i+(n-i)/2|0;const r=this.breakOffsets[o];if(s=o>0?this.breakOffsets[o-1]:0,0===t)if(e<=s)n=o-1;else{if(!(e>r))break;i=o+1}else if(e<s)n=o-1;else{if(!(e>=r))break;i=o+1}}let r=e-s;return o>0&&(r+=this.wrappedTextIndentLength),new PW(o,r)}normalizeOutputPosition(e,t,i){if(null!==this.injectionOffsets){const n=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(n,i);if(o!==n)return this.offsetInInputWithInjectionsToOutputPosition(o,i)}if(0===i){if(e>0&&t===this.getMinOutputOffset(e))return new PW(e-1,this.getMaxOutputOffset(e-1))}else if(1===i&&e<this.getOutputLineCount()-1&&t===this.getMaxOutputOffset(e))return new PW(e+1,this.getMinOutputOffset(e+1));return new PW(e,t)}outputPositionToOffsetInInputWithInjections(e,t){return e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(2===t){if(e===i.offsetInInputWithInjections+i.length&&RW(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let e=i.offsetInInputWithInjections;if(OW(this.injectionOptions[i.injectedTextIndex].cursorStops))return e;let t=i.injectedTextIndex-1;for(;t>=0&&this.injectionOffsets[t]===this.injectionOffsets[i.injectedTextIndex]&&!RW(this.injectionOptions[t].cursorStops)&&(e-=this.injectionOptions[t].content.length,!OW(this.injectionOptions[t].cursorStops));)t--;return e}}if(1===t||4===t){let e=i.offsetInInputWithInjections+i.length,t=i.injectedTextIndex;for(;t+1<this.injectionOffsets.length&&this.injectionOffsets[t+1]===this.injectionOffsets[t];)e+=this.injectionOptions[t+1].content.length,t++;return e}if(0===t||3===t){let e=i.offsetInInputWithInjections,t=i.injectedTextIndex;for(;t-1>=0&&this.injectionOffsets[t-1]===this.injectionOffsets[t];)e-=this.injectionOptions[t-1].content.length,t--;return e}ud()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),n=this.getInjectedTextAtOffset(i);return n?{options:this.injectionOptions[n.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(null!==t){let n=0;for(let o=0;o<t.length;o++){const s=i[o].content.length,r=t[o]+n,a=t[o]+n+s;if(r>e)break;if(e<=a)return{injectedTextIndex:o,offsetInInputWithInjections:r,length:s};n+=s}}}}function RW(e){return null==e||e===Cc.Right||e===Cc.Both}function OW(e){return null==e||e===Cc.Left||e===Cc.Both}class PW{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new ch(e+this.outputLineIndex,this.outputOffset+1)}}class FW{static create(e){return new FW(e.get(132),e.get(131))}constructor(e,t){this.classifier=new BW(e,t)}createLineBreaksComputer(e,t,i,n,o){const s=[],r=[],a=[];return{addRequest:(e,t,i)=>{s.push(e),r.push(t),a.push(i)},finalize:()=>{const l=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,h=[];for(let e=0,d=s.length;e<d;e++){const d=r[e],c=a[e];!c||c.injectionOptions||d?h[e]=HW(this.classifier,s[e],d,t,i,l,n,o):h[e]=zW(this.classifier,c,s[e],t,i,l,n,o)}return WW.length=0,VW.length=0,h}}}}class BW extends Vw{constructor(e,t){super(0);for(let t=0;t<e.length;t++)this.set(e.charCodeAt(t),1);for(let e=0;e<t.length;e++)this.set(t.charCodeAt(e),2)}get(e){return e>=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let WW=[],VW=[];function zW(e,t,i,n,o,s,r,a){if(-1===o)return null;const l=i.length;if(l<=1)return null;const h="keepAll"===a,d=t.breakOffsets,c=t.breakOffsetsVisibleColumn,u=qW(i,n,o,s,r),g=o-u,p=WW,m=VW;let f=0,_=0,v=0,b=o;const w=d.length;let C=0;if(C>=0){let e=Math.abs(c[C]-b);for(;C+1<w;){const t=Math.abs(c[C+1]-b);if(t>=e)break;e=t,C++}}for(;C<w;){let t=C<0?0:d[C],o=C<0?0:c[C];_>t&&(t=_,o=v);let r=0,a=0,u=0,y=0;if(o<=b){let v=o,w=0===t?0:i.charCodeAt(t-1),C=0===t?0:e.get(w),S=!0;for(let o=t;o<l;o++){const t=o,l=i.charCodeAt(o);let d,c;if(In(l)?(o++,d=0,c=2):(d=e.get(l),c=UW(l,v,n,s)),t>_&&jW(0,C,l,d,h)&&(r=t,a=v),v+=c,v>b){t>_?(u=t,y=v-c):(u=o+1,y=v),v-a>g&&(r=0),S=!1;break}w=l,C=d}if(S){f>0&&(p[f]=d[d.length-1],m[f]=c[d.length-1],f++);break}}if(0===r){let l=o,d=i.charCodeAt(t),c=e.get(d),p=!1;for(let n=t-1;n>=_;n--){const t=n+1,o=i.charCodeAt(n);if(9===o){p=!0;break}let m,f;if(Mn(o)?(n--,m=0,f=2):(m=e.get(o),f=Kn(o)?s:1),l<=b){if(0===u&&(u=t,y=l),l<=b-g)break;if(jW(0,m,d,c,h)){r=t,a=l;break}}l-=f,d=o,c=m}if(0!==r){const e=g-(y-a);if(e<=n){const t=i.charCodeAt(u);let o;o=In(t)?2:UW(t,y,n,s),e-o<0&&(r=0)}}if(p){C--;continue}}if(0===r&&(r=u,a=y),r<=_){const e=i.charCodeAt(_);In(e)?(r=_+2,a=v+2):(r=_+1,a=v+UW(e,v,n,s))}for(_=r,p[f]=r,v=a,m[f]=a,f++,b=a+g;C<0||C<w&&c[C]<a;)C++;let S=Math.abs(c[C]-b);for(;C+1<w;){const e=Math.abs(c[C+1]-b);if(e>=S)break;S=e,C++}}return 0===f?null:(p.length=f,m.length=f,WW=t.breakOffsets,VW=t.breakOffsetsVisibleColumn,t.breakOffsets=p,t.breakOffsetsVisibleColumn=m,t.wrappedTextIndentLength=u,t)}function HW(e,t,i,n,o,s,r,a){const l=ZC.applyInjectedText(t,i);let h,d;if(i&&i.length>0?(h=i.map((e=>e.options)),d=i.map((e=>e.column-1))):(h=null,d=null),-1===o)return h?new AW(d,h,[l.length],[],0):null;const c=l.length;if(c<=1)return h?new AW(d,h,[l.length],[],0):null;const u="keepAll"===a,g=qW(l,n,o,s,r),p=o-g,m=[],f=[];let _=0,v=0,b=0,w=o,C=l.charCodeAt(0),y=e.get(C),S=UW(C,0,n,s),k=1;In(C)&&(S+=1,C=l.charCodeAt(1),y=e.get(C),k++);for(let t=k;t<c;t++){const i=t,o=l.charCodeAt(t);let r,a;In(o)?(t++,r=0,a=2):(r=e.get(o),a=UW(o,S,n,s)),jW(0,y,o,r,u)&&(v=i,b=S),S+=a,S>w&&((0===v||S-b>p)&&(v=i,b=S-a),m[_]=v,f[_]=b,_++,w=b+p,v=0),C=o,y=r}return 0!==_||i&&0!==i.length?(m[_]=c,f[_]=S,new AW(d,h,m,f,g)):null}function UW(e,t,i,n){return 9===e?i-t%i:Kn(e)||e<32?n:1}function KW(e,t){return t-e%t}function jW(e,t,i,n,o){return 32!==i&&(2===t&&2!==n||1!==t&&1===n||!o&&3===t&&2!==n||!o&&3===n&&1!==t)}function qW(e,t,i,n,o){let s=0;if(0!==o){const r=fn(e);if(-1!==r){for(let i=0;i<r;i++)s+=9===e.charCodeAt(i)?KW(s,t):1;const a=3===o?2:2===o?1:0;for(let e=0;e<a;e++)s+=KW(s,t);s+n>i&&(s=0)}}return s}const $W=Tx("domLineBreaksComputer",{createHTML:e=>e});class GW{static create(e){return new GW(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,i,n,o){const s=[],r=[];return{addRequest:(e,t,i)=>{s.push(e),r.push(t)},finalize:()=>function(e,t,i,n,o,s,r,a){var l;function h(e){const i=a[e];if(i){const n=ZC.applyInjectedText(t[e],i),o=i.map((e=>e.options)),s=i.map((e=>e.column-1));return new AW(s,o,[n.length],[],0)}return null}if(-1===o){const e=[];for(let i=0,n=t.length;i<n;i++)e[i]=h(i);return e}const d=Math.round(o*i.typicalHalfwidthCharacterWidth),c=3===s?2:2===s?1:0,u=Math.round(n*c),g=Math.ceil(i.spaceWidth*u),p=document.createElement("div");Bx(p,i);const m=new Xu(1e4),f=[],_=[],v=[],b=[],w=[];for(let e=0;e<t.length;e++){const o=ZC.applyInjectedText(t[e],a[e]);let r=0,l=0,h=d;if(0!==s)if(r=fn(o),-1===r)r=0;else{for(let e=0;e<r;e++)l+=9===o.charCodeAt(e)?n-l%n:1;const e=Math.ceil(i.spaceWidth*l);e+i.typicalFullwidthCharacterWidth>d?(r=0,l=0):h=d-e}const c=o.substr(r),u=ZW(c,l,n,h,m,g);f[e]=r,_[e]=l,v[e]=c,b[e]=u[0],w[e]=u[1]}const C=m.build(),y=null!==(l=null==$W?void 0:$W.createHTML(C))&&void 0!==l?l:C;p.innerHTML=y,p.style.position="absolute",p.style.top="10000","keepAll"===r?(p.style.wordBreak="keep-all",p.style.overflowWrap="anywhere"):(p.style.wordBreak="inherit",p.style.overflowWrap="break-word"),e.document.body.appendChild(p);const S=document.createRange(),k=Array.prototype.slice.call(p.children,0),L=[];for(let e=0;e<t.length;e++){const t=YW(S,k[e],v[e],b[e]);if(null===t){L[e]=h(e);continue}const i=f[e],n=_[e]+u,o=w[e],s=[];for(let e=0,i=t.length;e<i;e++)s[e]=o[t[e]];if(0!==i)for(let e=0,n=t.length;e<n;e++)t[e]+=i;let r,l;const d=a[e];d?(r=d.map((e=>e.options)),l=d.map((e=>e.column-1))):(r=null,l=null),L[e]=new AW(l,r,t,s,n)}return e.document.body.removeChild(p),L}(_l(this.targetWindow.deref()),s,e,t,i,n,o,r)}}}function ZW(e,t,i,n,o,s){if(0!==s){const e=String(s);o.appendString('<div style="text-indent: -'),o.appendString(e),o.appendString("px; padding-left: "),o.appendString(e),o.appendString("px; box-sizing: border-box; width:")}else o.appendString('<div style="width:');o.appendString(String(n)),o.appendString('px;">');const r=e.length;let a=t,l=0;const h=[],d=[];let c=0<r?e.charCodeAt(0):0;o.appendString("<span>");for(let t=0;t<r;t++){0!==t&&t%16384==0&&o.appendString("</span><span>"),h[t]=l,d[t]=a;const n=c;c=t+1<r?e.charCodeAt(t+1):0;let s=1,u=1;switch(n){case 9:s=i-a%i,u=s;for(let e=1;e<=s;e++)e<s?o.appendCharCode(160):o.appendASCIICharCode(32);break;case 32:32===c?o.appendCharCode(160):o.appendASCIICharCode(32);break;case 60:o.appendString("&lt;");break;case 62:o.appendString("&gt;");break;case 38:o.appendString("&amp;");break;case 0:o.appendString("&#00;");break;case 65279:case 8232:case 8233:case 133:o.appendCharCode(65533);break;default:Kn(n)&&u++,n<32?o.appendCharCode(9216+n):o.appendCharCode(n)}l+=s,a+=u}return o.appendString("</span>"),h[e.length]=l,d[e.length]=a,o.appendString("</div>"),[h,d]}function YW(e,t,i,n){if(i.length<=1)return null;const o=Array.prototype.slice.call(t.children,0),s=[];try{QW(e,o,n,0,null,i.length-1,null,s)}catch(e){return console.log(e),null}return 0===s.length?null:(s.push(i.length),s)}function QW(e,t,i,n,o,s,r,a){if(n===s)return;if(o=o||XW(e,t,i[n],i[n+1]),r=r||XW(e,t,i[s],i[s+1]),Math.abs(o[0].top-r[0].top)<=.1)return;if(n+1===s)return void a.push(s);const l=n+(s-n)/2|0,h=XW(e,t,i[l],i[l+1]);QW(e,t,i,n,o,l,h,a),QW(e,t,i,l,h,s,r,a)}function XW(e,t,i,n){return e.setStart(t[i/16384|0].firstChild,i%16384),e.setEnd(t[n/16384|0].firstChild,n%16384),e.getClientRects()}class JW extends T{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new P),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const e of t)this._pending.has(e.id)?h(new Error(`Cannot have two contributions with the same id ${e.id}`)):this._pending.set(e.id,e);this._instantiateSome(0),this._register(ys(as(this._editor.getDomNode()),(()=>{this._instantiateSome(1)}))),this._register(ys(as(this._editor.getDomNode()),(()=>{this._instantiateSome(2)}))),this._register(ys(as(this._editor.getDomNode()),(()=>{this._instantiateSome(3)}),5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)"function"==typeof i.saveViewState&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)"function"==typeof i.restoreViewState&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){var e;this._register(ys(as(null===(e=this._editor)||void 0===e?void 0:e.getDomNode()),(()=>{this._instantiateSome(1)}),50))}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const e of t)this._instantiateById(e.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const e=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,e),"function"==typeof e.restoreViewState&&0!==t.instantiation&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(e){h(e)}}}}var eV,tV=function(e,t){return function(i,n){t(i,n,e)}};let iV=0;class nV{constructor(e,t,i,n,o,s){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=o,this.attachedView=s}dispose(){E(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}let oV=eV=class extends T{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,i,n,o,s,r,a,l,d,c,u){var g;super(),this.languageConfigurationService=c,this._deliveryQueue=new $,this._contributions=this._register(new JW),this._onDidDispose=this._register(new q),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new q({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new q({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new q({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new q({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new q({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new q({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new q({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new q({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new q({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new q({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new rV(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new q({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new sV({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new sV({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new rV(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new rV(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new rV(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new rV(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new rV(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new rV(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new rV(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new rV(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new rV(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new rV(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new rV(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new rV(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new rV(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new rV(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new rV(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new rV(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new rV(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new q({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new q({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new q({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new q({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),o.willCreateCodeEditor();const p={...t};let m;this._domElement=e,this._overflowWidgetsDomNode=p.overflowWidgetsDomNode,delete p.overflowWidgetsDomNode,this._id=++iV,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,p,d)),this._register(this._configuration.onDidChange((e=>{this._onDidChangeConfiguration.fire(e);const t=this._configuration.options;if(e.hasChanged(143)){const e=t.get(143);this._onDidLayoutChange.fire(e)}}))),this._contextKeyService=this._register(r.createScoped(this._domElement)),this._notificationService=l,this._codeEditorService=o,this._commandService=s,this._themeService=a,this._register(new aV(this,this._contextKeyService)),this._register(new lV(this,this._contextKeyService,u)),this._instantiationService=n.createChild(new TW([sd,this._contextKeyService])),this._modelData=null,this._focusTracker=new hV(e),this._register(this._focusTracker.onChange((()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())}))),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={},m=Array.isArray(i.contributions)?i.contributions:Zd.getEditorContributions(),this._contributions.initialize(this,m,this._instantiationService);for(const e of Zd.getEditorActions()){if(this._actions.has(e.id)){h(new Error(`Cannot have two actions with the same id ${e.id}`));continue}const t=new uB(e.id,e.label,e.alias,e.metadata,null!==(g=e.precondition)&&void 0!==g?g:void 0,(()=>this._instantiationService.invokeFunction((t=>Promise.resolve(e.runEditorCommand(t,this,null))))),this._contextKeyService);this._actions.set(t.id,t)}const f=()=>!this._configuration.options.get(90)&&this._configuration.options.get(36).enabled;this._register(new Lr(this._domElement,{onDragOver:e=>{if(!f())return;const t=this.getTargetAtClientPoint(e.clientX,e.clientY);(null==t?void 0:t.position)&&this.showDropIndicatorAt(t.position)},onDrop:async e=>{if(!f())return;if(this.removeDropIndicator(),!e.dataTransfer)return;const t=this.getTargetAtClientPoint(e.clientX,e.clientY);(null==t?void 0:t.position)&&this._onDropIntoEditor.fire({position:t.position,event:e})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;null===(t=this._modelData)||void 0===t||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i){return new ER(e,t,this._domElement,i)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return gB.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?Jy.getWordAtPosition(this._modelData.model,this._configuration.options.get(129),e):null}getValue(e=null){if(!this._modelData)return"";const t=!(!e||!e.preserveBOM);let i=0;return e&&e.lineEnding&&"\n"===e.lineEnding?i=1:e&&e.lineEnding&&"\r\n"===e.lineEnding&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){const t=e;if(null===this._modelData&&null===t)return;if(this._modelData&&this._modelData.model===t)return;const i=this.hasTextFocus(),n=this._detachModel();this._attachModel(t),i&&this.hasModel()&&this.focus();const o={oldModelUrl:n?n.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(o),this._postDetachModelCleanup(n),this._contributions.onAfterModelAttached()}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,n){const o=e.model.validatePosition({lineNumber:t,column:i}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(s.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?eV._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?eV._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber,n)}getBottomForLineNumber(e,t=!1){return this._modelData?eV._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var i;null===(i=this._modelData)||void 0===i||i.viewModel.setHiddenAreas(e.map((e=>tc.lift(e))),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return lu.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!ch.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!tc.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),s=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,s,t,n)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if("number"!=typeof e)throw new Error("Invalid arguments");this._sendRevealRange(new tc(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,n){if(!ch.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new tc(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=ic.isISelection(e),n=tc.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){const i={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(i,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new ic(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,n){if("number"!=typeof e||"number"!=typeof t)throw new Error("Invalid arguments");this._sendRevealRange(new tc(e,1,t,1),i,!1,n)}revealRange(e,t=0,i=!1,n=!0){this._revealRange(e,i?1:0,n,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,n){if(!tc.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(tc.lift(e),t,i,n)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||0===e.length)throw new Error("Invalid arguments");for(let t=0,i=e.length;t<i;t++)if(!ic.isISelection(e[t]))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,e,i)}}getContentWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getContentWidth():-1}getScrollWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollWidth():-1}getScrollLeft(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollLeft():-1}getContentHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getContentHeight():-1}getScrollHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollHeight():-1}getScrollTop(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollTop():-1}setScrollLeft(e,t=1){if(this._modelData){if("number"!=typeof e)throw new Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollLeft:e},t)}}setScrollTop(e,t=1){if(this._modelData){if("number"!=typeof e)throw new Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollTop:e},t)}}setScrollPosition(e,t=1){this._modelData&&this._modelData.viewModel.viewLayout.setScrollPosition(e,t)}hasPendingScrollAnimation(){return!!this._modelData&&this._modelData.viewModel.viewLayout.hasPendingScrollAnimation()}saveViewState(){if(!this._modelData)return null;const e=this._contributions.saveViewState();return{cursorState:this._modelData.viewModel.saveCursorState(),viewState:this._modelData.viewModel.saveState(),contributionsState:e}}restoreViewState(e){if(!this._modelData||!this._modelData.hasRealView)return;const t=e;if(t&&t.cursorState&&t.viewState){const e=t.cursorState;Array.isArray(e)?e.length>0&&this._modelData.viewModel.restoreCursorState(e):this._modelData.viewModel.restoreCursorState([e]),this._contributions.restoreViewState(t.contributionsState||{});const i=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(i)}}handleInitialized(){var e;null===(e=this._getViewModel())||void 0===e||e.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter((e=>e.isSupported())),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){switch(i=i||{},t){case"compositionStart":return void this._startComposition();case"compositionEnd":return void this._endComposition(e);case"type":{const t=i;return void this._type(e,t.text||"")}case"replacePreviousChar":{const t=i;return void this._compositionType(e,t.text||"",t.replaceCharCnt||0,0,0)}case"compositionType":{const t=i;return void this._compositionType(e,t.text||"",t.replacePrevCharCnt||0,t.replaceNextCharCnt||0,t.positionDelta||0)}case"paste":{const t=i;return void this._paste(e,t.text||"",t.pasteOnNewLine||!1,t.multicursorText||null,t.mode||null)}case"cut":return void this._cut(e)}const n=this.getAction(t);n?Promise.resolve(n.run(i)).then(void 0,h):this._modelData&&(this._triggerEditorCommand(e,t,i)||this._triggerCommand(t,i))}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){this._modelData&&0!==t.length&&("keyboard"===e&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),"keyboard"===e&&this._onDidType.fire(t))}_compositionType(e,t,i,n,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,o,e)}_paste(e,t,i,n,o){if(!this._modelData||0===t.length)return;const s=this._modelData.viewModel,r=s.getSelection().getStartPosition();s.paste(t,i,n,e);const a=s.getSelection().getStartPosition();"keyboard"===e&&this._onDidPaste.fire({range:new tc(r.lineNumber,r.column,a.lineNumber,a.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=Zd.getEditorCommand(t);return!!n&&((i=i||{}).source=e,this._instantiationService.invokeFunction((e=>{Promise.resolve(n.runEditorCommand(e,this,i)).then(void 0,h)})),!0)}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!!this._modelData&&!this._configuration.options.get(90)&&(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!!this._modelData&&!this._configuration.options.get(90)&&(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData)return!1;if(this._configuration.options.get(90))return!1;let n;return n=i?Array.isArray(i)?()=>i:i:()=>null,this._modelData.viewModel.executeEdits(e,t,n),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new dV(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,Nk(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,Nk(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?0===e.length&&0===t.length?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){this._modelData&&0!==e.length&&this._modelData.model.changeDecorations((t=>{t.deltaDecorations(e,[])}))}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(143)}createOverviewRuler(e){return this._modelData&&this._modelData.hasRealView?this._modelData.view.createOverviewRuler(e):null}getContainerDomNode(){return this._domElement}getDomNode(){return this._modelData&&this._modelData.hasRealView?this._modelData.view.domNode.domNode:null}delegateVerticalScrollbarPointerDown(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e,t=!1){this._configuration.observeContainer(e),t||this.render()}focus(){this._modelData&&this._modelData.hasRealView&&this._modelData.view.focus()}hasTextFocus(){return!(!this._modelData||!this._modelData.hasRealView)&&this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id:"+e.getId()),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const e=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(e)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const e=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(e)}}addGlyphMarginWidget(e){const t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const e=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(e)}}changeViewZones(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getTargetAtClientPoint(e,t):null}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),i=this._configuration.options,n=i.get(143);return{top:eV._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),left:this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+n.glyphMarginWidth+n.lineNumbersWidth+n.decorationsWidth-this.getScrollLeft(),height:i.get(66)}}getOffsetForColumn(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getOffsetForColumn(e,t):-1}render(e=!1){this._modelData&&this._modelData.hasRealView&&this._modelData.view.render(!0,e)}setAriaOptions(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.setAriaOptions(e)}applyFontInfo(e){Bx(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e)return void(this._modelData=null);const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const i=e.onBeforeAttached(),n=new xW(this._id,this._configuration,e,GW.create(as(this._domElement)),FW.create(this._configuration.options),(e=>Ls(as(this._domElement),e)),this.languageConfigurationService,this._themeService,i);t.push(e.onWillDispose((()=>this.setModel(null)))),t.push(n.onEvent((t=>{switch(t.kind){case 0:this._onDidContentSizeChange.fire(t);break;case 1:this._editorTextFocus.setValue(t.hasFocus);break;case 2:this._onDidScrollChange.fire(t);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(t.reachedMaxCursorCount){const e=me(0,"The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",this.getOption(79));this._notificationService.prompt(lL.Warning,e,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:me(0,"Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const e=[];for(let i=0,n=t.selections.length;i<n;i++)e[i]=t.selections[i].getPosition();const i={position:e[0],secondaryPositions:e.slice(1),reason:t.reason,source:t.source};this._onDidChangeCursorPosition.fire(i);const n={selection:t.selections[0],secondarySelections:t.selections.slice(1),modelVersionId:t.modelVersionId,oldSelections:t.oldSelections,oldModelVersionId:t.oldModelVersionId,source:t.source,reason:t.reason};this._onDidChangeCursorSelection.fire(n);break}case 7:this._onDidChangeModelDecorations.fire(t.event);break;case 8:this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._onDidChangeModelLanguage.fire(t.event);break;case 9:this._onDidChangeModelLanguageConfiguration.fire(t.event);break;case 10:this._onDidChangeModelContent.fire(t.event);break;case 11:this._onDidChangeModelOptions.fire(t.event);break;case 12:this._onDidChangeModelTokens.fire(t.event)}})));const[o,s]=this._createView(n);if(s){this._domElement.appendChild(o.domNode.domNode);let t=Object.keys(this._contentWidgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];o.addContentWidget(this._contentWidgets[i])}t=Object.keys(this._overlayWidgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];o.addOverlayWidget(this._overlayWidgets[i])}t=Object.keys(this._glyphMarginWidgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];o.addGlyphMarginWidget(this._glyphMarginWidgets[i])}o.render(!1,!0),o.domNode.domNode.setAttribute("data-uri",e.uri.toString())}this._modelData=new nV(e,n,o,s,t,i)}_createView(e){let t;t=this.isSimpleWidget?{paste:(e,t,i,n)=>{this._paste("keyboard",e,t,i,n)},type:e=>{this._type("keyboard",e)},compositionType:(e,t,i,n)=>{this._compositionType("keyboard",e,t,i,n)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:{paste:(e,t,i,n)=>{const o={text:e,pasteOnNewLine:t,multicursorText:i,mode:n};this._commandService.executeCommand("paste",o)},type:e=>{const t={text:e};this._commandService.executeCommand("type",t)},compositionType:(e,t,i,n)=>{if(i||n){const o={text:e,replacePrevCharCnt:t,replaceNextCharCnt:i,positionDelta:n};this._commandService.executeCommand("compositionType",o)}else{const i={text:e,replaceCharCnt:t};this._commandService.executeCommand("replacePreviousChar",i)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new eP(e.coordinatesConverter);return i.onKeyDown=e=>this._onKeyDown.fire(e),i.onKeyUp=e=>this._onKeyUp.fire(e),i.onContextMenu=e=>this._onContextMenu.fire(e),i.onMouseMove=e=>this._onMouseMove.fire(e),i.onMouseLeave=e=>this._onMouseLeave.fire(e),i.onMouseDown=e=>this._onMouseDown.fire(e),i.onMouseUp=e=>this._onMouseUp.fire(e),i.onMouseDrag=e=>this._onMouseDrag.fire(e),i.onMouseDrop=e=>this._onMouseDrop.fire(e),i.onMouseDropCanceled=e=>this._onMouseDropCanceled.fire(e),i.onMouseWheel=e=>this._onMouseWheel.fire(e),[new hB(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){null==e||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return null!==this._modelData}showDropIndicatorAt(e){const t=[{range:new tc(e.lineNumber,e.column,e.lineNumber,e.column),options:eV.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};oV.dropIntoEditorDecorationOptions=Sy.register({description:"workbench-dnd-target",className:"dnd-target"}),oV=eV=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([tV(3,lh),tV(4,dh),tV(5,wh),tV(6,sd),tV(7,Tv),tV(8,hL),tV(9,BS),tV(10,Yg),tV(11,Jk)],oV);class sV extends T{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new q(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new q(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,2===this._value?this._onDidChangeToTrue.fire():1===this._value&&this._onDidChangeToFalse.fire())}}class rV extends q{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class aV extends T{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=nc.editorSimpleInput.bindTo(t),this._editorFocus=nc.focus.bindTo(t),this._textInputFocus=nc.textInputFocus.bindTo(t),this._editorTextFocus=nc.editorTextFocus.bindTo(t),this._tabMovesFocus=nc.tabMovesFocus.bindTo(t),this._editorReadonly=nc.readOnly.bindTo(t),this._inDiffEditor=nc.inDiffEditor.bindTo(t),this._editorColumnSelection=nc.columnSelection.bindTo(t),this._hasMultipleSelections=nc.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=nc.hasNonEmptySelection.bindTo(t),this._canUndo=nc.canUndo.bindTo(t),this._canRedo=nc.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration((()=>this._updateFromConfig()))),this._register(this._editor.onDidChangeCursorSelection((()=>this._updateFromSelection()))),this._register(this._editor.onDidFocusEditorWidget((()=>this._updateFromFocus()))),this._register(this._editor.onDidBlurEditorWidget((()=>this._updateFromFocus()))),this._register(this._editor.onDidFocusEditorText((()=>this._updateFromFocus()))),this._register(this._editor.onDidBlurEditorText((()=>this._updateFromFocus()))),this._register(this._editor.onDidChangeModel((()=>this._updateFromModel()))),this._register(this._editor.onDidChangeConfiguration((()=>this._updateFromModel()))),this._register(DR.onDidChangeTabFocus((e=>this._tabMovesFocus.set(e)))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(DR.getTabFocusMode()),this._editorReadonly.set(e.get(90)),this._inDiffEditor.set(e.get(61)),this._editorColumnSelection.set(e.get(22))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some((e=>!e.isEmpty())))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))}}class lV extends T{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=nc.languageId.bindTo(t),this._hasCompletionItemProvider=nc.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=nc.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=nc.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=nc.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=nc.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=nc.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=nc.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=nc.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=nc.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=nc.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=nc.hasReferenceProvider.bindTo(t),this._hasRenameProvider=nc.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=nc.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=nc.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=nc.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=nc.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=nc.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=nc.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=nc.isInWalkThroughSnippet.bindTo(t);const n=()=>this._update();this._register(e.onDidChangeModel(n)),this._register(e.onDidChangeModelLanguage(n)),this._register(i.completionProvider.onDidChange(n)),this._register(i.codeActionProvider.onDidChange(n)),this._register(i.codeLensProvider.onDidChange(n)),this._register(i.definitionProvider.onDidChange(n)),this._register(i.declarationProvider.onDidChange(n)),this._register(i.implementationProvider.onDidChange(n)),this._register(i.typeDefinitionProvider.onDidChange(n)),this._register(i.hoverProvider.onDidChange(n)),this._register(i.documentHighlightProvider.onDidChange(n)),this._register(i.documentSymbolProvider.onDidChange(n)),this._register(i.referenceProvider.onDidChange(n)),this._register(i.renameProvider.onDidChange(n)),this._register(i.documentFormattingEditProvider.onDidChange(n)),this._register(i.documentRangeFormattingEditProvider.onDidChange(n)),this._register(i.signatureHelpProvider.onDidChange(n)),this._register(i.inlayHintsProvider.onDidChange(n)),n()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents((()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInWalkThrough.reset()}))}_update(){const e=this._editor.getModel();e?this._contextKeyService.bufferChangeEvents((()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInWalkThrough.set(e.uri.scheme===jo.walkThroughSnippet)})):this.reset()}}class hV extends T{constructor(e){super(),this._onChange=this._register(new q),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(lr(e)),this._register(this._domFocusTracker.onDidFocus((()=>{this._hasFocus=!0,this._onChange.fire(void 0)}))),this._register(this._domFocusTracker.onDidBlur((()=>{this._hasFocus=!1,this._onChange.fire(void 0)})))}hasFocus(){return this._hasFocus}}class dV{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations((i=>{this._isChangingDecorations||e.call(t,i)}),i)}getRange(e){return this._editor.hasModel()?e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e]):null}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const n=e.getDecorationRange(i);n&&t.push(n)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){0!==this._decorationIds.length&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations((t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)}))}finally{this._isChangingDecorations=!1}return this._decorationIds}append(e){let t=[];try{this._isChangingDecorations=!0,this._editor.changeDecorations((i=>{t=i.deltaDecorations([],e),this._decorationIds=this._decorationIds.concat(t)}))}finally{this._isChangingDecorations=!1}return t}}const cV=encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 3' enable-background='new 0 0 6 3' height='3' width='6'><g fill='"),uV=encodeURIComponent("'><polygon points='5.5,0 2.5,3 1.1,3 4.1,0'/><polygon points='4,0 6,2 6,0.6 5.4,0'/><polygon points='0,2 1,3 2.4,3 0,0.6'/></g></svg>");function gV(e){return cV+encodeURIComponent(e.toString())+uV}const pV=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" height="3" width="12"><g fill="'),mV=encodeURIComponent('"><circle cx="1" cy="1" r="1"/><circle cx="5" cy="1" r="1"/><circle cx="9" cy="1" r="1"/></g></svg>');Fv(((e,t)=>{const i=e.getColor(pf);i&&t.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${gV(i)}") repeat-x bottom left; }`);const n=e.getColor(ff);n&&t.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${gV(n)}") repeat-x bottom left; }`);const o=e.getColor(vf);o&&t.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${gV(o)}") repeat-x bottom left; }`);const s=e.getColor(wf);s&&t.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${function(e){return pV+encodeURIComponent(e.toString())+mV}(s)}") no-repeat bottom left; }`);const r=e.getColor(hb);r&&t.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${r.rgba.a}; }`)}));var fV=function(e,t){return function(i,n){t(i,n,e)}};let _V=class extends oV{constructor(e,t,i,n,o,s,r,a,l,h,d,c,u){super(e,{...n.getRawOptions(),overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()},i,o,s,r,a,l,h,d,c,u),this._parentEditor=n,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration((e=>this._onParentConfigurationChanged(e))))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){mc(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};_V=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([fV(4,lh),fV(5,dh),fV(6,wh),fV(7,sd),fV(8,Tv),fV(9,hL),fV(10,BS),fV(11,Yg),fV(12,Jk)],_V);var vV=i(1629),bV={};bV.styleTagTransform=Vr(),bV.setAttributes=Pr(),bV.insert=Rr().bind(null,"head"),bV.domAPI=Tr(),bV.insertStyleElement=Br(),Ir()(vV.Z,bV),vV.Z&&vV.Z.locals&&vV.Z.locals;var wV,CV=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};!function(e){e.North="north",e.South="south",e.East="east",e.West="west"}(wV||(wV={}));const yV=new q,SV=new q;class kV{constructor(e){this.el=e,this.disposables=new M}get onPointerMove(){return this.disposables.add(new OS(as(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new OS(as(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}CV([HL],kV.prototype,"onPointerMove",null),CV([HL],kV.prototype,"onPointerUp",null);class LV{get onPointerMove(){return this.disposables.add(new OS(this.el,UL.Change)).event}get onPointerUp(){return this.disposables.add(new OS(this.el,UL.End)).event}constructor(e){this.el=e,this.disposables=new M}dispose(){this.disposables.dispose()}}CV([HL],LV.prototype,"onPointerMove",null),CV([HL],LV.prototype,"onPointerUp",null);class xV{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}CV([HL],xV.prototype,"onPointerMove",null),CV([HL],xV.prototype,"onPointerUp",null);const DV="pointer-events-disabled";class EV extends T{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",0===e),this.el.classList.toggle("minimum",1===e),this.el.classList.toggle("maximum",2===e),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=t=>{this.orthogonalStartDragHandleDisposables.clear(),0!==t&&(this._orthogonalStartDragHandle=hr(this.el,mr(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(I((()=>this._orthogonalStartDragHandle.remove()))),this.orthogonalStartDragHandleDisposables.add(new OS(this._orthogonalStartDragHandle,"mouseenter")).event((()=>EV.onMouseEnter(e)),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new OS(this._orthogonalStartDragHandle,"mouseleave")).event((()=>EV.onMouseLeave(e)),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=t=>{this.orthogonalEndDragHandleDisposables.clear(),0!==t&&(this._orthogonalEndDragHandle=hr(this.el,mr(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(I((()=>this._orthogonalEndDragHandle.remove()))),this.orthogonalEndDragHandleDisposables.add(new OS(this._orthogonalEndDragHandle,"mouseenter")).event((()=>EV.onMouseEnter(e)),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new OS(this._orthogonalEndDragHandle,"mouseleave")).event((()=>EV.onMouseLeave(e)),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){super(),this.hoverDelay=300,this.hoverDelayer=this._register(new Ht(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new q),this._onDidStart=this._register(new q),this._onDidChange=this._register(new q),this._onDidReset=this._register(new q),this._onDidEnd=this._register(new q),this.orthogonalStartSashDisposables=this._register(new M),this.orthogonalStartDragHandleDisposables=this._register(new M),this.orthogonalEndSashDisposables=this._register(new M),this.orthogonalEndDragHandleDisposables=this._register(new M),this.onDidStart=this._onDidStart.event,this.onDidChange=this._onDidChange.event,this.onDidReset=this._onDidReset.event,this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.el=hr(e,mr(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),Ve&&this.el.classList.add("mac");const n=this._register(new OS(this.el,"mousedown")).event;this._register(n((t=>this.onPointerStart(t,new kV(e))),this));const o=this._register(new OS(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const s=this._register(new OS(this.el,"mouseenter")).event;this._register(s((()=>EV.onMouseEnter(this))));const r=this._register(new OS(this.el,"mouseleave")).event;this._register(r((()=>EV.onMouseLeave(this)))),this._register(KL.addTarget(this.el));const a=this._register(new OS(this.el,UL.Start)).event;this._register(a((e=>this.onPointerStart(e,new LV(this.el))),this));const l=this._register(new OS(this.el,UL.Tap)).event;let h;this._register(l((e=>{if(h)return clearTimeout(h),h=void 0,void this.onPointerDoublePress(e);clearTimeout(h),h=setTimeout((()=>h=void 0),250)}),this)),"number"==typeof i.size?(this.size=i.size,0===i.orientation?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=4,this._register(yV.event((e=>{this.size=e,this.layout()})))),this._register(SV.event((e=>this.hoverDelay=e))),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,1===this.orientation?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",!1),this.layout()}onPointerStart(e,t){rr(e);let i=!1;if(!e.__orthogonalSashEvent){const n=this.getOrthogonalSash(e);n&&(i=!0,e.__orthogonalSashEvent=!0,n.onPointerStart(e,new xV(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new xV(t))),!this.state)return;const n=this.el.ownerDocument.getElementsByTagName("iframe");for(const e of n)e.classList.add(DV);const o=e.pageX,s=e.pageY,r=e.altKey,a={startX:o,currentX:o,startY:s,currentY:s,altKey:r};this.el.classList.add("active"),this._onDidStart.fire(a);const l=$s(this.el),h=()=>{let e="";e=i?"all-scroll":1===this.orientation?1===this.state?"s-resize":2===this.state?"n-resize":Ve?"row-resize":"ns-resize":1===this.state?"e-resize":2===this.state?"w-resize":Ve?"col-resize":"ew-resize",l.textContent=`* { cursor: ${e} !important; }`},d=new M;h(),i||this.onDidEnablementChange.event(h,null,d),t.onPointerMove((e=>{rr(e,!1);const t={startX:o,currentX:e.pageX,startY:s,currentY:e.pageY,altKey:r};this._onDidChange.fire(t)}),null,d),t.onPointerUp((e=>{rr(e,!1),this.el.removeChild(l),this.el.classList.remove("active"),this._onDidEnd.fire(),d.dispose();for(const e of n)e.classList.remove(DV)}),null,d),d.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger((()=>e.el.classList.add("hover")),e.hoverDelay).then(void 0,(()=>{})),!t&&e.linkedSash&&EV.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&EV.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){EV.onMouseLeave(this)}layout(){if(0===this.orientation){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){var t;const i=null!==(t=e.initialTarget)&&void 0!==t?t:e.target;if(i&&i instanceof HTMLElement)return i.classList.contains("orthogonal-drag-handle")?i.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash:void 0}dispose(){super.dispose(),this.el.remove()}}var NV=i(1564),IV={};IV.styleTagTransform=Vr(),IV.setAttributes=Pr(),IV.insert=Rr().bind(null,"head"),IV.domAPI=Tr(),IV.insertStyleElement=Br(),Ir()(NV.Z,IV),NV.Z&&NV.Z.locals&&NV.Z.locals;const MV=new ru(new nu(0,122,204)),TV={showArrow:!0,showFrame:!0,className:"",frameColor:MV,arrowColor:MV,keepEditorSelection:!1};class AV{constructor(e,t,i,n,o,s,r,a){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this.showInHiddenAreas=r,this.ordinal=a,this._onDomNodeTop=o,this._onComputedHeight=s}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class RV{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class OV{constructor(e){this._editor=e,this._ruleName=OV._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),er(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){er(this._ruleName),Js(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){1===e.column&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:tc.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}OV._IdGenerator=new sx(".arrow-decoration-");class PV{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new M,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=cc(t),mc(this.options,TV,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange((e=>{const t=this._getWidth(e);this.domNode.style.width=t+"px",this.domNode.style.left=this._getLeft(e)+"px",this._onWidth(t)})))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones((e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null})),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new OV(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&0===e.minimap.minimapLeft?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const t=e-this._decoratingElementsHeight();this.container.style.height=`${t}px`;const i=this.editor.getLayoutInfo();this._doLayout(t,this._getWidth(i))}null===(t=this._resizeSash)||void 0===t||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=tc.isIRange(e)?tc.lift(e):tc.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Sy.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones((e=>{this._viewZone&&e.removeZone(this._viewZone.id)})),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),null===(e=this._arrow)||void 0===e||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(66);let t=0;return this.options.showArrow&&(t+=2*Math.round(e/3)),this.options.showFrame&&(t+=2*Math.round(e/9)),t}_showImpl(e,t){const i=e.getStartPosition(),n=this.editor.getLayoutInfo(),o=this._getWidth(n);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(n)+"px";const s=document.createElement("div");s.style.overflow="hidden";const r=this.editor.getOption(66);if(!this.options.allowUnlimitedHeight){const e=Math.max(12,this.editor.getLayoutInfo().height/r*.8);t=Math.min(t,e)}let a=0,l=0;if(this._arrow&&this.options.showArrow&&(a=Math.round(r/3),this._arrow.height=a,this._arrow.show(i)),this.options.showFrame&&(l=Math.round(r/9)),this.editor.changeViewZones((e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new AV(s,i.lineNumber,i.column,t,(e=>this._onViewZoneTop(e)),(e=>this._onViewZoneHeight(e)),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=e.addZone(this._viewZone),this._overlayWidget=new RV("vs.editor.contrib.zoneWidget"+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)})),this.container&&this.options.showFrame){const e=this.options.frameWidth?this.options.frameWidth:l;this.container.style.borderTopWidth=e+"px",this.container.style.borderBottomWidth=e+"px"}const h=t*r-this._decoratingElementsHeight();this.container&&(this.container.style.top=a+"px",this.container.style.height=h+"px",this.container.style.overflow="hidden"),this._doLayout(h,o),this.options.keepEditorSelection||this.editor.setSelection(e);const d=this.editor.getModel();if(d){const t=d.validateRange(new tc(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(t,t.startLineNumber===d.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones((t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))}))}_initSash(){if(this._resizeSash)return;let e;this._resizeSash=this._disposables.add(new EV(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0),this._disposables.add(this._resizeSash.onDidStart((t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})}))),this._disposables.add(this._resizeSash.onDidEnd((()=>{e=void 0}))),this._disposables.add(this._resizeSash.onDidChange((t=>{if(e){const i=(t.currentY-e.startY)/this.editor.getOption(66),n=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+n;o>5&&o<35&&this._relayout(o)}})))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(null===this.domNode.style.height?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}var FV=i(5035),BV={};BV.styleTagTransform=Vr(),BV.setAttributes=Pr(),BV.insert=Rr().bind(null,"head"),BV.domAPI=Tr(),BV.insertStyleElement=Br(),Ir()(FV.Z,BV),FV.Z&&FV.Z.locals&&FV.Z.locals;class WV extends mh{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new q),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=hr(e,mr(".monaco-dropdown")),this._label=hr(this._element,mr(".dropdown-label"));let i=t.labelRenderer;i||(i=e=>(e.textContent=t.label||"",null));for(const e of[or.CLICK,or.MOUSE_DOWN,UL.Tap])this._register(bs(this.element,e,(e=>rr(e,!0))));for(const e of[or.MOUSE_DOWN,UL.Tap])this._register(bs(this._label,e,(e=>{ir(e)&&(e.detail>1||0!==e.button)||(this.visible?this.hide():this.show())})));this._register(bs(this._label,or.KEY_UP,(e=>{const t=new Dt(e);(t.equals(3)||t.equals(10))&&(rr(e,!0),this.visible?this.hide():this.show())})));const n=i(this._label);n&&this._register(n),this._register(KL.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class VV extends WV{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class zV extends EE{constructor(e,t,i,n=Object.create(null)){super(null,e,n),this.actionItem=null,this._onDidChangeVisibility=this._register(new q),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=n,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=Array.isArray(this.menuActionsOrProvider),i={contextMenuProvider:this.contextMenuProvider,labelRenderer:e=>{this.element=hr(e,mr("a.action-label"));let t=[];return"string"==typeof this.options.classNames?t=this.options.classNames.split(/\s+/g).filter((e=>!!e)):this.options.classNames&&(t=this.options.classNames),t.find((e=>"icon"===e))||t.push("codicon"),this.element.classList.add(...t),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this.element.title=this._action.label||"",this.element.ariaLabel=this._action.label||"",null},menuAsChild:this.options.menuAsChild,actions:t?this.menuActionsOrProvider:void 0,actionProvider:t?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new VV(e,i)),this._register(this.dropdownMenu.onDidChangeVisibility((e=>{var t;null===(t=this.element)||void 0===t||t.setAttribute("aria-expanded",`${e}`),this._onDidChangeVisibility.fire(e)}))),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const e=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return e.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),null!=e?e:void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;null===(e=this.dropdownMenu)||void 0===e||e.show()}updateEnabled(){var e,t;const i=!this.action.enabled;null===(e=this.actionItem)||void 0===e||e.classList.toggle("disabled",i),null===(t=this.element)||void 0===t||t.classList.toggle("disabled",i)}}var HV=i(1854),UV={};UV.styleTagTransform=Vr(),UV.setAttributes=Pr(),UV.insert=Rr().bind(null,"head"),UV.domAPI=Tr(),UV.insertStyleElement=Br(),Ir()(HV.Z,UV),HV.Z&&HV.Z.locals&&HV.Z.locals;var KV=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},jV=function(e,t){return function(i,n){t(i,n,e)}};function qV(e,t,i,n,o,s){$V(e.getActions(t),i,!1,"string"==typeof n?e=>e===n:n,o,s)}function $V(e,t,i,n=(e=>"navigation"===e),o=(()=>!1),s=!1){let r,a;Array.isArray(t)?(r=t,a=t):(r=t.primary,a=t.secondary);const l=new Set;for(const[t,o]of e){let e;n(t)?(e=r,e.length>0&&s&&e.push(new fh)):(e=a,e.length>0&&e.push(new fh));for(let n of o){i&&(n=n instanceof Dd&&n.alt?n.alt:n);const o=e.push(n);n instanceof _h&&l.add({group:t,action:n,index:o-1})}}for(const{group:e,action:t,index:i}of l){const s=n(e)?r:a,l=t.actions;o(t,e,s.length)&&s.splice(i,1,...l)}}let GV=class extends NE{constructor(e,t,i,n,o,s,r,a){super(void 0,e,{icon:!(!e.class&&!e.item.icon),label:!e.class&&!e.item.icon,draggable:null==t?void 0:t.draggable,keybinding:null==t?void 0:t.keybinding,hoverDelegate:null==t?void 0:t.hoverDelegate}),this._keybindingService=i,this._notificationService=n,this._contextKeyService=o,this._themeService=s,this._contextMenuService=r,this._accessibilityService=a,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new A),this._altKey=kr.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}async onClick(e){e.preventDefault(),e.stopPropagation();try{await this.actionRunner.run(this._commandAction,this._context)}catch(e){this._notificationService.error(e)}}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const i=()=>{var e;const i=!!(null===(e=this._menuItemAction.alt)||void 0===e?void 0:e.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);i!==this._wantsAltCommand&&(this._wantsAltCommand=i,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(bs(e,"mouseleave",(e=>{t=!1,i()}))),this._register(bs(e,"mouseenter",(e=>{t=!0,i()}))),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var e;const t=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),i=t&&t.getLabel(),n=this._commandAction.tooltip||this._commandAction.label;let o=i?me(0,"{0} ({1})",n,i):n;if(!this._wantsAltCommand&&(null===(e=this._menuItemAction.alt)||void 0===e?void 0:e.enabled)){const e=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,t=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),i=t&&t.getLabel(),n=i?me(0,"{0} ({1})",e,i):e;o=me(0,"{0}\n[{1}] {2}",o,OE.modifierLabels[Qe].altKey,n)}return o}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const n=this._commandAction.checked&&(o=e.toggled)&&void 0!==o.condition&&e.toggled.icon?e.toggled.icon:e.icon;var o;if(n)if(Ll.isThemeIcon(n)){const e=Ll.asClassNameArray(n);i.classList.add(...e),this._itemClassDispose.value=I((()=>{i.classList.remove(...e)}))}else i.style.backgroundImage=Mv(this._themeService.getColorTheme().type)?wr(n.dark):wr(n.light),i.classList.add("icon"),this._itemClassDispose.value=N(I((()=>{i.style.backgroundImage="",i.classList.remove("icon")})),this._themeService.onDidColorThemeChange((()=>{this.updateClass()})))}};GV=KV([jV(2,ML),jV(3,hL),jV(4,sd),jV(5,Tv),jV(6,qE),jV(7,BS)],GV);let ZV=class extends zV{constructor(e,t,i,n,o){var s,r,a;const l={...t,menuAsChild:null!==(s=null==t?void 0:t.menuAsChild)&&void 0!==s&&s,classNames:null!==(r=null==t?void 0:t.classNames)&&void 0!==r?r:Ll.isThemeIcon(e.item.icon)?Ll.asClassName(e.item.icon):void 0,keybindingProvider:null!==(a=null==t?void 0:t.keybindingProvider)&&void 0!==a?a:e=>i.lookupKeybinding(e.id)};super(e,{getActions:()=>e.actions},n,l),this._keybindingService=i,this._contextMenuService=n,this._themeService=o}render(e){super.render(e),fl(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!Ll.isThemeIcon(i)){this.element.classList.add("icon");const e=()=>{this.element&&(this.element.style.backgroundImage=Mv(this._themeService.getColorTheme().type)?wr(i.dark):wr(i.light))};e(),this._register(this._themeService.onDidColorThemeChange((()=>{e()})))}}};ZV=KV([jV(2,ML),jV(3,qE),jV(4,Tv)],ZV);let YV=class extends EE{constructor(e,t,i,n,o,s,r,a){var l,h,d;let c;super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=o,this._menuService=s,this._instaService=r,this._storageService=a,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;const u=(null==t?void 0:t.persistLastActionId)?a.get(this._storageKey,1):void 0;u&&(c=e.actions.find((e=>u===e.id))),c||(c=e.actions[0]),this._defaultAction=this._instaService.createInstance(GV,c,{keybinding:this._getDefaultActionKeybindingLabel(c)});const g={keybindingProvider:e=>this._keybindingService.lookupKeybinding(e.id),...t,menuAsChild:null===(l=null==t?void 0:t.menuAsChild)||void 0===l||l,classNames:null!==(h=null==t?void 0:t.classNames)&&void 0!==h?h:["codicon","codicon-chevron-down"],actionRunner:null!==(d=null==t?void 0:t.actionRunner)&&void 0!==d?d:new mh};this._dropdown=new zV(e,e.actions,this._contextMenuService,g),this._dropdown.actionRunner.onDidRun((e=>{e.action instanceof Dd&&this.update(e.action)}))}update(e){var t;(null===(t=this._options)||void 0===t?void 0:t.persistLastActionId)&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(GV,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends mh{async runAction(e,t){await e.run(void 0)}},this._container&&this._defaultAction.render(dr(this._container,mr(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let i;if(null===(t=this._options)||void 0===t?void 0:t.renderKeybindingWithDefaultActionLabel){const t=this._keybindingService.lookupKeybinding(e.id);t&&(i=`(${t.getLabel()})`)}return i}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=mr(".action-container");this._defaultAction.render(hr(this._container,t)),this._register(bs(t,or.KEY_DOWN,(e=>{const t=new Dt(e);t.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),t.stopPropagation())})));const i=mr(".dropdown-action-container");this._dropdown.render(hr(this._container,i)),this._register(bs(i,or.KEY_DOWN,(e=>{var t;const i=new Dt(e);i.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),null===(t=this._defaultAction.element)||void 0===t||t.focus(),i.stopPropagation())})))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};YV=KV([jV(2,ML),jV(3,hL),jV(4,qE),jV(5,Sd),jV(6,lh),jV(7,KN)],YV);let QV=class extends IE{constructor(e,t){super(null,e,e.actions.map((e=>({text:e.id===fh.ID?"─────────":e.label,isDisabled:!e.enabled}))),0,t,iN,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex((e=>e.checked))))}render(e){super.render(e),e.style.borderColor=wm(Qm)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};function XV(e,t,i){return t instanceof Dd?e.createInstance(GV,t,i):t instanceof xd?t.item.isSelection?e.createInstance(QV,t):t.item.rememberDefaultAction?e.createInstance(YV,t,{...i,persistLastActionId:!0}):e.createInstance(ZV,t,i):void 0}QV=KV([jV(1,jE)],QV);var JV=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},ez=function(e,t){return function(i,n){t(i,n,e)}};const tz=hh("IPeekViewService");var iz;wg(tz,class{constructor(){this._widgets=new Map}addExclusiveWidget(e,t){const i=this._widgets.get(e);i&&(i.listener.dispose(),i.widget.dispose()),this._widgets.set(e,{widget:t,listener:t.onDidClose((()=>{const i=this._widgets.get(e);i&&i.widget===t&&(i.listener.dispose(),this._widgets.delete(e))}))})}},1),function(e){e.inPeekEditor=new od("inReferenceSearchEditor",!0,me(0,"Whether the current code editor is embedded inside peek")),e.notInPeekEditor=e.inPeekEditor.toNegated()}(iz||(iz={}));let nz=class{constructor(e,t){e instanceof _V&&iz.inPeekEditor.bindTo(t)}dispose(){}};nz.ID="editor.contrib.referenceController",nz=JV([ez(1,sd)],nz),Gd(nz.ID,nz,0);const oz={headerBackgroundColor:ru.white,primaryHeadingColor:ru.fromHex("#333333"),secondaryHeadingColor:ru.fromHex("#6c6c6cb3")};let sz=class extends PV{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new q,this.onDidClose=this._onDidClose.event,mc(this.options,oz,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){const t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();const e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=mr(".head"),this._bodyElement=mr(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=mr(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Cs(this._titleElement,"click",(e=>this._onTitleClick(e)))),hr(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=mr("span.filename"),this._secondaryHeading=mr("span.dirname"),this._metaHeading=mr("span.meta"),hr(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=mr(".peekview-actions");hr(this._headElement,i);const n=this._getActionBarOptions();this._actionbarWidget=new ME(i,n),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new ph("peekview.close",me(0,"Close"),Ll.asClassName(Sl.close),!0,(()=>(this.dispose(),Promise.resolve()))),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:XV.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:_s(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,fr(this._metaHeading)):_r(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0)return void this.dispose();const i=Math.ceil(1.2*this.editor.getOption(66)),n=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(n,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};sz=JV([ez(2,lh)],sz);const rz=Sm("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:ru.black,hcLight:ru.white},me(0,"Background color of the peek view title area.")),az=Sm("peekViewTitleLabel.foreground",{dark:ru.white,light:ru.black,hcDark:ru.white,hcLight:yf},me(0,"Color of the peek view title.")),lz=Sm("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},me(0,"Color of the peek view title info.")),hz=Sm("peekView.border",{dark:vf,light:vf,hcDark:Em,hcLight:Em},me(0,"Color of the peek view borders and arrow.")),dz=Sm("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:ru.black,hcLight:ru.white},me(0,"Background color of the peek view result list.")),cz=(Sm("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:ru.white,hcLight:yf},me(0,"Foreground color for line nodes in the peek view result list.")),Sm("peekViewResult.fileForeground",{dark:ru.white,light:"#1E1E1E",hcDark:ru.white,hcLight:yf},me(0,"Foreground color for file nodes in the peek view result list.")),Sm("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},me(0,"Background color of the selected entry in the peek view result list.")),Sm("peekViewResult.selectionForeground",{dark:ru.white,light:"#6C6C6C",hcDark:ru.white,hcLight:yf},me(0,"Foreground color of the selected entry in the peek view result list.")),Sm("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:ru.black,hcLight:ru.white},me(0,"Background color of the peek view editor.")));function uz(e){return!(!e||"function"!=typeof e.getEditorType)&&e.getEditorType()===gB.ICodeEditor}function gz(e){return!(!e||"function"!=typeof e.getEditorType)&&e.getEditorType()===gB.IDiffEditor}function pz(e){return uz(e)?e:gz(e)?e.getModifiedEditor():function(e){return!!e&&"object"==typeof e&&"function"==typeof e.onDidChangeActiveEditor}(e)&&uz(e.activeCodeEditor)?e.activeCodeEditor:null}Sm("peekViewEditorGutter.background",{dark:cz,light:cz,hcDark:cz,hcLight:cz},me(0,"Background color of the gutter in the peek view editor.")),Sm("peekViewEditorStickyScroll.background",{dark:cz,light:cz,hcDark:cz,hcLight:cz},me(0,"Background color of sticky scroll in the peek view editor.")),Sm("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},me(0,"Match highlight color in the peek view result list.")),Sm("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},me(0,"Match highlight color in the peek view editor.")),Sm("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Nm,hcLight:Nm},me(0,"Match highlight border in the peek view editor."));class mz{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:T.None}}renderElement(e,t,i,n){var o;if(null===(o=i.disposable)||void 0===o||o.dispose(),!i.data)return;const s=this.modelProvider();if(s.isResolved(e))return this.renderer.renderElement(s.get(e),e,i.data,n);const r=new Pt,a=s.resolve(e,r.token);i.disposable={dispose:()=>r.cancel()},this.renderer.renderPlaceholder(e,i.data),a.then((t=>this.renderer.renderElement(t,e,i.data,n)))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class fz{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}class _z{constructor(e,t,i,n,o={}){const s=()=>this.model,r=n.map((e=>new mz(e,s)));this.list=new mE(e,t,i,r,function(e,t){return{...t,accessibilityProvider:t.accessibilityProvider&&new fz(e,t.accessibilityProvider)}}(s,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return z.map(this.list.onMouseDblClick,(({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i})))}get onPointer(){return z.map(this.list.onPointer,(({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i})))}get onDidChangeSelection(){return z.map(this.list.onDidChangeSelection,(({elements:e,indexes:t,browserEvent:i})=>({elements:e.map((e=>this._model.get(e))),indexes:t,browserEvent:i})))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,Hc(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map((e=>this.model.get(e)))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}var vz=i(2470),bz={};bz.styleTagTransform=Vr(),bz.setAttributes=Pr(),bz.insert=Rr().bind(null,"head"),bz.domAPI=Tr(),bz.insertStyleElement=Br(),Ir()(vz.Z,bz),vz.Z&&vz.Z.locals&&vz.Z.locals;const wz={separatorBorder:ru.transparent};class Cz{set size(e){this._size=e}get size(){return this._size}get visible(){return void 0===this._cachedVisibleSize}setVisible(e,t){var i,n;if(e!==this.visible){e?(this.size=iD(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize="number"==typeof t?t:this.size,this.size=0),this.container.classList.toggle("visible",e);try{null===(n=(i=this.view).setVisible)||void 0===n||n.call(i,e)}catch(e){console.error("Splitview: Failed to set visible view"),console.error(e)}}}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){var e;return null===(e=this.view.proportionalLayout)||void 0===e||e}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,n){this.container=e,this.view=t,this.disposable=n,this._cachedVisibleSize=void 0,"number"==typeof i?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e);try{this.view.layout(this.size,e,t)}catch(e){console.error("Splitview: Failed to layout view"),console.error(e)}}dispose(){this.disposable.dispose()}}class yz extends Cz{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class Sz extends Cz{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var kz,Lz;!function(e){e[e.Idle=0]="Idle",e[e.Busy=1]="Busy"}(kz||(kz={})),function(e){e.Distribute={type:"distribute"},e.Split=function(e){return{type:"split",index:e}},e.Auto=function(e){return{type:"auto",index:e}},e.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}}}(Lz||(Lz={}));class xz extends T{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){var i,n,o,s,r;super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=kz.Idle,this._onDidSashChange=this._register(new q),this._onDidSashReset=this._register(new q),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=null!==(i=t.orientation)&&void 0!==i?i:0,this.inverseAltBehavior=null!==(n=t.inverseAltBehavior)&&void 0!==n&&n,this.proportionalLayout=null===(o=t.proportionalLayout)||void 0===o||o,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(0===this.orientation?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=hr(this.el,mr(".sash-container")),this.viewContainer=mr(".split-view-container"),this.scrollable=this._register(new _D({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:e=>Ls(as(this.el),e)})),this.scrollableElement=this._register(new ED(this.viewContainer,{vertical:0===this.orientation?null!==(s=t.scrollbarVisibility)&&void 0!==s?s:1:2,horizontal:1===this.orientation?null!==(r=t.scrollbarVisibility)&&void 0!==r?r:1:2},this.scrollable));const a=this._register(new OS(this.viewContainer,"scroll")).event;this._register(a((e=>{const t=this.scrollableElement.getScrollPosition(),i=Math.abs(this.viewContainer.scrollLeft-t.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,n=Math.abs(this.viewContainer.scrollTop-t.scrollTop)<=1?void 0:this.viewContainer.scrollTop;void 0===i&&void 0===n||this.scrollableElement.setScrollPosition({scrollLeft:i,scrollTop:n})}))),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll((e=>{e.scrollTopChanged&&(this.viewContainer.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this.viewContainer.scrollLeft=e.scrollLeft)}))),hr(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||wz),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach(((e,t)=>{const i=gl(e.visible)||e.visible?e.size:{type:"invisible",cachedVisibleSize:e.size},n=e.view;this.doAddView(n,i,t,!0)})),this._contentSize=this.viewItems.reduce(((e,t)=>e+t.size),0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,n){this.doAddView(e,t,i,n)}layout(e,t){const i=Math.max(this.size,this._contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let t=0;for(let i=0;i<this.viewItems.length;i++){const n=this.viewItems[i],o=this.proportions[i];"number"==typeof o?t+=o:e-=n.size}for(let i=0;i<this.viewItems.length;i++){const n=this.viewItems[i],o=this.proportions[i];"number"==typeof o&&t>0&&(n.size=iD(Math.round(o*e/t),n.minimumSize,n.maximumSize))}}else{const t=Hc(this.viewItems.length),n=t.filter((e=>1===this.viewItems[e].priority)),o=t.filter((e=>2===this.viewItems[e].priority));this.resize(this.viewItems.length-1,e-i,void 0,n,o)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this.proportions=this.viewItems.map((e=>e.proportionalLayout&&e.visible?e.size/this._contentSize:void 0)))}onSashStart({sash:e,start:t,alt:i}){for(const e of this.viewItems)e.enabled=!1;const n=this.sashItems.findIndex((t=>t.sash===e)),o=N(bs(this.el.ownerDocument.body,"keydown",(e=>s(this.sashDragState.current,e.altKey))),bs(this.el.ownerDocument.body,"keyup",(()=>s(this.sashDragState.current,!1)))),s=(e,t)=>{const i=this.viewItems.map((e=>e.size));let s,r,a=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(t=!t),t)if(n===this.sashItems.length-1){const e=this.viewItems[n];a=(e.minimumSize-e.size)/2,l=(e.maximumSize-e.size)/2}else{const e=this.viewItems[n+1];a=(e.size-e.maximumSize)/2,l=(e.size-e.minimumSize)/2}if(!t){const e=Hc(n,-1),t=Hc(n+1,this.viewItems.length),o=e.reduce(((e,t)=>e+(this.viewItems[t].minimumSize-i[t])),0),a=e.reduce(((e,t)=>e+(this.viewItems[t].viewMaximumSize-i[t])),0),l=0===t.length?Number.POSITIVE_INFINITY:t.reduce(((e,t)=>e+(i[t]-this.viewItems[t].minimumSize)),0),h=0===t.length?Number.NEGATIVE_INFINITY:t.reduce(((e,t)=>e+(i[t]-this.viewItems[t].viewMaximumSize)),0),d=Math.max(o,h),c=Math.min(l,a),u=this.findFirstSnapIndex(e),g=this.findFirstSnapIndex(t);if("number"==typeof u){const e=this.viewItems[u],t=Math.floor(e.viewMinimumSize/2);s={index:u,limitDelta:e.visible?d-t:d+t,size:e.size}}if("number"==typeof g){const e=this.viewItems[g],t=Math.floor(e.viewMinimumSize/2);r={index:g,limitDelta:e.visible?c+t:c-t,size:e.size}}}this.sashDragState={start:e,current:e,index:n,sizes:i,minDelta:a,maxDelta:l,alt:t,snapBefore:s,snapAfter:r,disposable:o}};s(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:n,alt:o,minDelta:s,maxDelta:r,snapBefore:a,snapAfter:l}=this.sashDragState;this.sashDragState.current=e;const h=e-i,d=this.resize(t,h,n,void 0,void 0,s,r,a,l);if(o){const e=t===this.sashItems.length-1,i=this.viewItems.map((e=>e.size)),n=e?t:t+1,o=this.viewItems[n],s=o.size-o.maximumSize,r=o.size-o.minimumSize,a=e?t-1:t+1;this.resize(a,-d,i,void 0,void 0,s,r)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const e of this.viewItems)e.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=iD(t="number"==typeof t?t:e.size,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(!(e<0||e>=this.viewItems.length)){if(this.state!==kz.Idle)throw new Error("Cant modify splitview");this.state=kz.Busy;try{const i=Hc(this.viewItems.length).filter((t=>t!==e)),n=[...i.filter((e=>1===this.viewItems[e].priority)),e],o=i.filter((e=>2===this.viewItems[e].priority)),s=this.viewItems[e];t=iD(t=Math.round(t),s.minimumSize,Math.min(s.maximumSize,this.size)),s.size=t,this.relayout(n,o)}finally{this.state=kz.Idle}}}distributeViewSizes(){const e=[];let t=0;for(const i of this.viewItems)i.maximumSize-i.minimumSize>0&&(e.push(i),t+=i.size);const i=Math.floor(t/e.length);for(const t of e)t.size=iD(i,t.minimumSize,t.maximumSize);const n=Hc(this.viewItems.length),o=n.filter((e=>1===this.viewItems[e].priority)),s=n.filter((e=>2===this.viewItems[e].priority));this.relayout(o,s)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,n){if(this.state!==kz.Idle)throw new Error("Cant modify splitview");this.state=kz.Busy;try{const o=mr(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const s=e.onDidChange((e=>this.onViewChange(l,e))),r=N(s,I((()=>this.viewContainer.removeChild(o))));let a;"number"==typeof t?a=t:("auto"===t.type&&(t=this.areViewsDistributed()?{type:"distribute"}:{type:"split",index:t.index}),a="split"===t.type?this.getViewSize(t.index)/2:"invisible"===t.type?{cachedVisibleSize:t.cachedVisibleSize}:e.minimumSize);const l=0===this.orientation?new yz(o,e,a,r):new Sz(o,e,a,r);if(this.viewItems.splice(i,0,l),this.viewItems.length>1){const e={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},t=0===this.orientation?new EV(this.sashContainer,{getHorizontalSashTop:e=>this.getSashPosition(e),getHorizontalSashWidth:this.getSashOrthogonalSize},{...e,orientation:1}):new EV(this.sashContainer,{getVerticalSashLeft:e=>this.getSashPosition(e),getVerticalSashHeight:this.getSashOrthogonalSize},{...e,orientation:0}),n=0===this.orientation?e=>({sash:t,start:e.startY,current:e.currentY,alt:e.altKey}):e=>({sash:t,start:e.startX,current:e.currentX,alt:e.altKey}),o=z.map(t.onDidStart,n)(this.onSashStart,this),s=z.map(t.onDidChange,n)(this.onSashChange,this),r=z.map(t.onDidEnd,(()=>this.sashItems.findIndex((e=>e.sash===t)))),a=r(this.onSashEnd,this),l=t.onDidReset((()=>{const e=this.sashItems.findIndex((e=>e.sash===t)),i=Hc(e,-1),n=Hc(e+1,this.viewItems.length),o=this.findFirstSnapIndex(i),s=this.findFirstSnapIndex(n);("number"!=typeof o||this.viewItems[o].visible)&&("number"!=typeof s||this.viewItems[s].visible)&&this._onDidSashReset.fire(e)})),h=N(o,s,a,l,t),d={sash:t,disposable:h};this.sashItems.splice(i-1,0,d)}let h;o.appendChild(e.element),"number"!=typeof t&&"split"===t.type&&(h=[t.index]),n||this.relayout([i],h),n||"number"==typeof t||"distribute"!==t.type||this.distributeViewSizes()}finally{this.state=kz.Idle}}relayout(e,t){const i=this.viewItems.reduce(((e,t)=>e+t.size),0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map((e=>e.size)),n,o,s=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,a,l){if(e<0||e>=this.viewItems.length)return 0;const h=Hc(e,-1),d=Hc(e+1,this.viewItems.length);if(o)for(const e of o)Kc(h,e),Kc(d,e);if(n)for(const e of n)jc(h,e),jc(d,e);const c=h.map((e=>this.viewItems[e])),u=h.map((e=>i[e])),g=d.map((e=>this.viewItems[e])),p=d.map((e=>i[e])),m=h.reduce(((e,t)=>e+(this.viewItems[t].minimumSize-i[t])),0),f=h.reduce(((e,t)=>e+(this.viewItems[t].maximumSize-i[t])),0),_=0===d.length?Number.POSITIVE_INFINITY:d.reduce(((e,t)=>e+(i[t]-this.viewItems[t].minimumSize)),0),v=0===d.length?Number.NEGATIVE_INFINITY:d.reduce(((e,t)=>e+(i[t]-this.viewItems[t].maximumSize)),0),b=Math.max(m,v,s),w=Math.min(_,f,r);let C=!1;if(a){const e=this.viewItems[a.index],i=t>=a.limitDelta;C=i!==e.visible,e.setVisible(i,a.size)}if(!C&&l){const e=this.viewItems[l.index],i=t<l.limitDelta;C=i!==e.visible,e.setVisible(i,l.size)}if(C)return this.resize(e,t,i,n,o,s,r);for(let e=0,i=t=iD(t,b,w);e<c.length;e++){const t=c[e],n=iD(u[e]+i,t.minimumSize,t.maximumSize);i-=n-u[e],t.size=n}for(let e=0,i=t;e<g.length;e++){const t=g[e],n=iD(p[e]-i,t.minimumSize,t.maximumSize);i+=n-p[e],t.size=n}return t}distributeEmptySpace(e){const t=this.viewItems.reduce(((e,t)=>e+t.size),0);let i=this.size-t;const n=Hc(this.viewItems.length-1,-1),o=n.filter((e=>1===this.viewItems[e].priority)),s=n.filter((e=>2===this.viewItems[e].priority));for(const e of s)Kc(n,e);for(const e of o)jc(n,e);"number"==typeof e&&jc(n,e);for(let e=0;0!==i&&e<n.length;e++){const t=this.viewItems[n[e]],o=iD(t.size+i,t.minimumSize,t.maximumSize);i-=o-t.size,t.size=o}}layoutViews(){this._contentSize=this.viewItems.reduce(((e,t)=>e+t.size),0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach((e=>e.sash.layout())),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){0===this.orientation?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this._contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this._contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map((t=>e=t.size-t.minimumSize>0||e));e=!1;const i=this.viewItems.map((t=>e=t.maximumSize-t.size>0||e)),n=[...this.viewItems].reverse();e=!1;const o=n.map((t=>e=t.size-t.minimumSize>0||e)).reverse();e=!1;const s=n.map((t=>e=t.maximumSize-t.size>0||e)).reverse();let r=0;for(let e=0;e<this.sashItems.length;e++){const{sash:n}=this.sashItems[e];r+=this.viewItems[e].size;const a=!(t[e]&&s[e+1]),l=!(i[e]&&o[e+1]);if(a&&l){const i=Hc(e,-1),s=Hc(e+1,this.viewItems.length),a=this.findFirstSnapIndex(i),l=this.findFirstSnapIndex(s),h="number"==typeof a&&!this.viewItems[a].visible,d="number"==typeof l&&!this.viewItems[l].visible;h&&o[e]&&(r>0||this.startSnappingEnabled)?n.state=1:d&&t[e]&&(r<this._contentSize||this.endSnappingEnabled)?n.state=2:n.state=0}else n.state=a&&!l?1:!a&&l?2:3}}getSashPosition(e){let t=0;for(let i=0;i<this.sashItems.length;i++)if(t+=this.viewItems[i].size,this.sashItems[i].sash===e)return t;return 0}findFirstSnapIndex(e){for(const t of e){const e=this.viewItems[t];if(e.visible&&e.snap)return t}for(const t of e){const e=this.viewItems[t];if(e.visible&&e.maximumSize-e.minimumSize>0)return;if(!e.visible&&e.snap)return t}}areViewsDistributed(){let e,t;for(const i of this.viewItems)if(e=void 0===e?i.size:Math.min(e,i.size),t=void 0===t?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){var e;null===(e=this.sashDragState)||void 0===e||e.disposable.dispose(),E(this.viewItems),this.viewItems=[],this.sashItems.forEach((e=>e.disposable.dispose())),this.sashItems=[],super.dispose()}}var Dz=i(1728),Ez={};Ez.styleTagTransform=Vr(),Ez.setAttributes=Pr(),Ez.insert=Rr().bind(null,"head"),Ez.domAPI=Tr(),Ez.insertStyleElement=Br(),Ir()(Dz.Z,Ez),Dz.Z&&Dz.Z.locals&&Dz.Z.locals;class Nz{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=Nz.TemplateId,this.renderedTemplates=new Set;const n=new Map(t.map((e=>[e.templateId,e])));this.renderers=[];for(const t of e){const e=n.get(t.templateId);if(!e)throw new Error(`Table cell renderer for template id ${t.templateId} not found.`);this.renderers.push(e)}}renderTemplate(e){const t=hr(e,mr(".monaco-table-tr")),i=[],n=[];for(let e=0;e<this.columns.length;e++){const o=this.renderers[e],s=hr(t,mr(".monaco-table-td",{"data-col-index":e}));s.style.width=`${this.getColumnSize(e)}px`,i.push(s),n.push(o.renderTemplate(s))}const o={container:e,cellContainers:i,cellTemplateData:n};return this.renderedTemplates.add(o),o}renderElement(e,t,i,n){for(let o=0;o<this.columns.length;o++){const s=this.columns[o].project(e);this.renderers[o].renderElement(s,t,i.cellTemplateData[o],n)}}disposeElement(e,t,i,n){for(let o=0;o<this.columns.length;o++){const s=this.renderers[o];if(s.disposeElement){const r=this.columns[o].project(e);s.disposeElement(r,t,i.cellTemplateData[o],n)}}}disposeTemplate(e){for(let t=0;t<this.columns.length;t++)this.renderers[t].disposeTemplate(e.cellTemplateData[t]);_s(e.container),this.renderedTemplates.delete(e)}layoutColumn(e,t){for(const{cellContainers:i}of this.renderedTemplates)i[e].style.width=`${t}px`}}Nz.TemplateId="row";class Iz{get minimumSize(){var e;return null!==(e=this.column.minimumWidth)&&void 0!==e?e:120}get maximumSize(){var e;return null!==(e=this.column.maximumWidth)&&void 0!==e?e:Number.POSITIVE_INFINITY}get onDidChange(){var e;return null!==(e=this.column.onDidChangeWidthConstraints)&&void 0!==e?e:z.None}constructor(e,t){this.column=e,this.index=t,this._onDidLayout=new q,this.onDidLayout=this._onDidLayout.event,this.element=mr(".monaco-table-th",{"data-col-index":t,title:e.tooltip},e.label)}layout(e){this._onDidLayout.fire([this.index,e])}}class Mz{get onDidChangeFocus(){return this.list.onDidChangeFocus}get onDidChangeSelection(){return this.list.onDidChangeSelection}get onDidScroll(){return this.list.onDidScroll}get onMouseDblClick(){return this.list.onMouseDblClick}get onPointer(){return this.list.onPointer}get onDidFocus(){return this.list.onDidFocus}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get scrollHeight(){return this.list.scrollHeight}get renderHeight(){return this.list.renderHeight}get onDidDispose(){return this.list.onDidDispose}constructor(e,t,i,n,o,s){this.virtualDelegate=i,this.domId="table_id_"+ ++Mz.InstanceCount,this.disposables=new M,this.cachedWidth=0,this.cachedHeight=0,this.domNode=hr(t,mr(`.monaco-table.${this.domId}`));const r=n.map(((e,t)=>new Iz(e,t))),a={size:r.reduce(((e,t)=>e+t.column.weight),0),views:r.map((e=>({size:e.column.weight,view:e})))};this.splitview=this.disposables.add(new xz(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:a})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const l=new Nz(n,o,(e=>this.splitview.getViewSize(e)));var h;this.list=this.disposables.add(new mE(e,this.domNode,(h=i,{getHeight:e=>h.getHeight(e),getTemplateId:()=>Nz.TemplateId}),[l],s)),z.any(...r.map((e=>e.onDidLayout)))((([e,t])=>l.layoutColumn(e,t)),null,this.disposables),this.splitview.onDidSashReset((e=>{const t=n.reduce(((e,t)=>e+t.weight),0),i=n[e].weight/t*this.cachedWidth;this.splitview.resizeView(e,i)}),null,this.disposables),this.styleElement=$s(this.domNode),this.style(lE)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\ttop: ${this.virtualDelegate.headerRowHeight+1}px;\n\t\t\theight: calc(100% - ${this.virtualDelegate.headerRowHeight}px);\n\t\t}`),this.styleElement.textContent=t.join("\n"),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}Mz.InstanceCount=0;var Tz=i(6310),Az={};Az.styleTagTransform=Vr(),Az.setAttributes=Pr(),Az.insert=Rr().bind(null,"head"),Az.domAPI=Tr(),Az.insertStyleElement=Br(),Ir()(Tz.Z,Az),Tz.Z&&Tz.Z.locals&&Tz.Z.locals;class Rz extends hD{constructor(e){super(),this._onChange=this._register(new q),this.onChange=this._onChange.event,this._onKeyDown=this._register(new q),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...Ll.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this.domNode.title=this._opts.title,this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,(e=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),e.preventDefault())})),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,(e=>{if(10===e.keyCode||3===e.keyCode)return this.checked=!this._checked,this._onChange.fire(!0),e.preventDefault(),void e.stopPropagation();this._onKeyDown.fire(e)}))}get enabled(){return"true"!==this.domNode.getAttribute("aria-disabled")}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const Oz=me(0,"Match Case"),Pz=me(0,"Match Whole Word"),Fz=me(0,"Use Regular Expression");class Bz extends Rz{constructor(e){super({icon:Sl.caseSensitive,title:Oz+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Wz extends Rz{constructor(e){super({icon:Sl.wholeWord,title:Pz+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Vz extends Rz{constructor(e){super({icon:Sl.regex,title:Fz+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class zz{constructor(e,t=0,i=e.length,n=t-1){this.items=e,this.start=t,this.end=i,this.index=n}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class Hz{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return 0!==this._currentPosition()?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return null===this._navigator.current()}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new zz(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach((t=>e.push(t))),e}}var Uz=i(1188),Kz={};Kz.styleTagTransform=Vr(),Kz.setAttributes=Pr(),Kz.insert=Rr().bind(null,"head"),Kz.domAPI=Tr(),Kz.insertStyleElement=Br(),Ir()(Uz.Z,Kz),Uz.Z&&Uz.Z.locals&&Uz.Z.locals;const jz=mr;class qz extends hD{constructor(e,t,i){var n;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new q),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new q),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=null!==(n=this.options.tooltip)&&void 0!==n?n:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=hr(e,jz(".monaco-inputbox.idle"));const o=this.options.flexibleHeight?"textarea":"input",s=hr(this.element,jz(".ibwrapper"));if(this.input=hr(s,jz(o+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,(()=>this.element.classList.add("synthetic-focus"))),this.onblur(this.input,(()=>this.element.classList.remove("synthetic-focus"))),this.options.flexibleHeight){this.maxHeight="number"==typeof this.options.flexibleMaxHeight?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=hr(s,jz("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new DD(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),hr(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll((e=>this.input.scrollTop=e.scrollTop)));const t=this._register(new OS(e.ownerDocument,"selectionchange")),i=z.filter(t.event,(()=>{const t=e.ownerDocument.getSelection();return(null==t?void 0:t.anchorNode)===s}));this._register(i(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,(()=>this.onValueChange())),this.onblur(this.input,(()=>this.onBlur())),this.onfocus(this.input,(()=>this.onFocus())),this._register(this.ignoreGesture(this.input)),setTimeout((()=>this.updateMirror()),0),this.options.actions&&(this.actionbar=this._register(new ME(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.input.title=e}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return"number"==typeof this.cachedHeight?this.cachedHeight:Fs(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return Ks(this.input)}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if("number"!=typeof this.cachedContentHeight||"number"!=typeof this.cachedHeight||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){if("open"===this.state&&fc(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${yr(i.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),null==e?void 0:e.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=Rs(this.element)+"px";let i;this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:i=>{var n,o;if(!this.message)return null;e=hr(i,jz(".monaco-inputbox-container")),t();const s={inline:!0,className:"monaco-inputbox-message"},r=this.message.formatContent?QL(this.message.content,s):function(e,t={}){const i=XL(t);return i.textContent=e,i}(this.message.content,s);r.classList.add(this.classForType(this.message.type));const a=this.stylesForType(this.message.type);return r.style.backgroundColor=null!==(n=a.background)&&void 0!==n?n:"",r.style.color=null!==(o=a.foreground)&&void 0!==o?o:"",r.style.border=a.border?`1px solid ${a.border}`:"",hr(e,r),null},onHide:()=>{this.state="closed"},layout:t}),i=3===this.message.type?me(0,"Error: {0}",this.message.content):2===this.message.type?me(0,"Warning: {0}",this.message.content):me(0,"Info: {0}",this.message.content),Zr(i),this.state="open"}_hideMessage(){this.contextViewProvider&&("open"===this.state&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),"open"===this.state&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,t=10===e.charCodeAt(e.length-1)?" ":"";(e+t).replace(/\u000c/g,"")?this.mirror.textContent=e+t:this.mirror.innerText=" ",this.layout()}applyStyles(){var e,t,i;const n=this.options.inputBoxStyles,o=null!==(e=n.inputBackground)&&void 0!==e?e:"",s=null!==(t=n.inputForeground)&&void 0!==t?t:"",r=null!==(i=n.inputBorder)&&void 0!==i?i:"";this.element.style.backgroundColor=o,this.element.style.color=s,this.input.style.backgroundColor="inherit",this.input.style.color=s,this.element.style.border=`1px solid ${yr(r,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=Fs(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,n=t.selectionEnd,o=t.value;null!==i&&null!==n&&(this.value=o.substr(0,i)+e+o.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,null===(e=this.actionbar)||void 0===e||e.dispose(),super.dispose()}}class $z extends qz{constructor(e,t,i){const n=me(0," or {0} for history","⇅"),o=me(0," ({0} for history)","⇅");super(e,t,i),this._onDidFocus=this._register(new q),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new q),this.onDidBlur=this._onDidBlur.event,this.history=new Hz(i.history,100);const s=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(n)&&!this.placeholder.endsWith(o)&&this.history.getHistory().length){const e=this.placeholder.endsWith(")")?n:o,t=this.placeholder+e;i.showPlaceholderOnFocus&&!Ks(this.input)?this.placeholder=t:this.setPlaceHolder(t)}};this.observer=new MutationObserver(((e,t)=>{e.forEach((e=>{e.target.textContent||s()}))})),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,(()=>s())),this.onblur(this.input,(()=>{const e=e=>{if(this.placeholder.endsWith(e)){const t=this.placeholder.slice(0,this.placeholder.length-e.length);return i.showPlaceholderOnFocus?this.placeholder=t:this.setPlaceHolder(t),!0}return!1};e(o)||e(n)}))}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=null!=e?e:"",Yr(this.value?this.value:me(0,"Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,Yr(this.value))}setPlaceHolder(e){super.setPlaceHolder(e),this.setTooltip(e)}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}var Gz=i(6266),Zz={};Zz.styleTagTransform=Vr(),Zz.setAttributes=Pr(),Zz.insert=Rr().bind(null,"head"),Zz.domAPI=Tr(),Zz.insertStyleElement=Br(),Ir()(Gz.Z,Zz),Gz.Z&&Gz.Z.locals&&Gz.Z.locals;const Yz=me(0,"input");class Qz extends hD{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new A),this.additionalToggles=[],this._onDidOptionChange=this._register(new q),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new q),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new q),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new q),this._onKeyUp=this._register(new q),this._onCaseSensitiveKeyDown=this._register(new q),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new q),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||Yz,this.showCommonFindToggles=!!i.showCommonFindToggles;const n=i.appendCaseSensitiveLabel||"",o=i.appendWholeWordsLabel||"",s=i.appendRegexLabel||"",r=i.history||[],a=!!i.flexibleHeight,l=!!i.flexibleWidth,h=i.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new $z(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:r,showHistoryHint:i.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:h,inputBoxStyles:i.inputBoxStyles})),this.showCommonFindToggles){this.regex=this._register(new Vz({appendTitle:s,isChecked:!1,...i.toggleStyles})),this._register(this.regex.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.regex.onKeyDown((e=>{this._onRegexKeyDown.fire(e)}))),this.wholeWords=this._register(new Wz({appendTitle:o,isChecked:!1,...i.toggleStyles})),this._register(this.wholeWords.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this.caseSensitive=this._register(new Bz({appendTitle:n,isChecked:!1,...i.toggleStyles})),this._register(this.caseSensitive.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.caseSensitive.onKeyDown((e=>{this._onCaseSensitiveKeyDown.fire(e)})));const e=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,(t=>{if(t.equals(15)||t.equals(17)||t.equals(9)){const i=e.indexOf(this.domNode.ownerDocument.activeElement);if(i>=0){let n=-1;t.equals(17)?n=(i+1)%e.length:t.equals(15)&&(n=0===i?e.length-1:i-1),t.equals(9)?(e[i].blur(),this.inputBox.focus()):n>=0&&e[n].focus(),rr(t,!0)}}}))}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(null==i?void 0:i.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),null==e||e.appendChild(this.domNode),this._register(bs(this.inputBox.inputElement,"compositionstart",(e=>{this.imeSessionInProgress=!0}))),this._register(bs(this.inputBox.inputElement,"compositionend",(e=>{this.imeSessionInProgress=!1,this._onInput.fire()}))),this.onkeydown(this.inputBox.inputElement,(e=>this._onKeyDown.fire(e))),this.onkeyup(this.inputBox.inputElement,(e=>this._onKeyUp.fire(e))),this.oninput(this.inputBox.inputElement,(e=>this._onInput.fire())),this.onmousedown(this.inputBox.inputElement,(e=>this._onMouseDown.fire(e)))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,i;this.domNode.classList.remove("disabled"),this.inputBox.enable(),null===(e=this.regex)||void 0===e||e.enable(),null===(t=this.wholeWords)||void 0===t||t.enable(),null===(i=this.caseSensitive)||void 0===i||i.enable();for(const e of this.additionalToggles)e.enable()}disable(){var e,t,i;this.domNode.classList.add("disabled"),this.inputBox.disable(),null===(e=this.regex)||void 0===e||e.disable(),null===(t=this.wholeWords)||void 0===t||t.disable(),null===(i=this.caseSensitive)||void 0===i||i.disable();for(const e of this.additionalToggles)e.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const e of this.additionalToggles)e.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new M;for(const t of null!=e?e:[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()}))),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,i,n,o,s,r;this.inputBox.paddingRight=e?0:(null!==(i=null===(t=this.caseSensitive)||void 0===t?void 0:t.width())&&void 0!==i?i:0)+(null!==(o=null===(n=this.wholeWords)||void 0===n?void 0:n.width())&&void 0!==o?o:0)+(null!==(r=null===(s=this.regex)||void 0===s?void 0:s.width())&&void 0!==r?r:0)+this.additionalToggles.reduce(((e,t)=>e+t.width()),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e,t;return null!==(t=null===(e=this.caseSensitive)||void 0===e?void 0:e.checked)&&void 0!==t&&t}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,t;return null!==(t=null===(e=this.wholeWords)||void 0===e?void 0:e.checked)&&void 0!==t&&t}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,t;return null!==(t=null===(e=this.regex)||void 0===e?void 0:e.checked)&&void 0!==t&&t}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;null===(e=this.caseSensitive)||void 0===e||e.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}var Xz,Jz;!function(e){e[e.Expanded=0]="Expanded",e[e.Collapsed=1]="Collapsed",e[e.PreserveOrExpanded=2]="PreserveOrExpanded",e[e.PreserveOrCollapsed=3]="PreserveOrCollapsed"}(Xz||(Xz={})),function(e){e[e.Unknown=0]="Unknown",e[e.Twistie=1]="Twistie",e[e.Element=2]="Element",e[e.Filter=3]="Filter"}(Jz||(Jz={}));class eH extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class tH{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}function iH(e){return"object"==typeof e&&"visibility"in e&&"data"in e}function nH(e){switch(e){case!0:return 1;case!1:return 0;default:return e}}function oH(e){return"boolean"==typeof e.collapsible}class sH{constructor(e,t,i,n={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new X,this._onDidChangeCollapseState=new q,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new q,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new q,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new Ht(Ft),this.collapseByDefault=void 0!==n.collapseByDefault&&n.collapseByDefault,this.filter=n.filter,this.autoExpandSingleChildren=void 0!==n.autoExpandSingleChildren&&n.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=C.empty(),n={}){if(0===e.length)throw new eH(this.user,"Invalid tree location");n.diffIdentityProvider?this.spliceSmart(n.diffIdentityProvider,e,t,i,n):this.spliceSimple(e,t,i,n)}spliceSmart(e,t,i,n,o,s){var r;void 0===n&&(n=C.empty()),void 0===s&&(s=null!==(r=o.diffDepth)&&void 0!==r?r:0);const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,n,o);const l=[...n],h=t[t.length-1],d=new ZI({getElements:()=>a.lastDiffIds},{getElements:()=>[...a.children.slice(0,h),...l,...a.children.slice(h+i)].map((t=>e.getId(t.element).toString()))}).ComputeDiff(!1);if(d.quitEarly)return a.lastDiffIds=void 0,this.spliceSimple(t,i,l,o);const c=t.slice(0,-1),u=(t,i,n)=>{if(s>0)for(let r=0;r<n;r++)t--,i--,this.spliceSmart(e,[...c,t,0],Number.MAX_SAFE_INTEGER,l[i].children,o,s-1)};let g=Math.min(a.children.length,h+i),p=l.length;for(const e of d.changes.sort(((e,t)=>t.originalStart-e.originalStart)))u(g,p,g-(e.originalStart+e.originalLength)),g=e.originalStart,p=e.modifiedStart-h,this.spliceSimple([...c,g],e.originalLength,C.slice(l,p,p+e.modifiedLength),o);u(g,p,g)}spliceSimple(e,t,i=C.empty(),{onDidCreateNode:n,onDidDeleteNode:o,diffIdentityProvider:s}){const{parentNode:r,listIndex:a,revealed:l,visible:h}=this.getParentNodeWithListIndex(e),d=[],c=C.map(i,(e=>this.createTreeNode(e,r,r.visible?1:0,l,d,n))),u=e[e.length-1],g=r.children.length>0;let p=0;for(let e=u;e>=0&&e<r.children.length;e--){const t=r.children[e];if(t.visible){p=t.visibleChildIndex;break}}const m=[];let f=0,_=0;for(const e of c)m.push(e),_+=e.renderNodeCount,e.visible&&(e.visibleChildIndex=p+f++);const v=Gc(r.children,u,t,m);s?r.lastDiffIds?Gc(r.lastDiffIds,u,t,m.map((e=>s.getId(e.element).toString()))):r.lastDiffIds=r.children.map((e=>s.getId(e.element).toString())):r.lastDiffIds=void 0;let b=0;for(const e of v)e.visible&&b++;if(0!==b)for(let e=u+m.length;e<r.children.length;e++){const t=r.children[e];t.visible&&(t.visibleChildIndex-=b)}if(r.visibleChildrenCount+=f-b,l&&h){const e=v.reduce(((e,t)=>e+(t.visible?t.renderNodeCount:0)),0);this._updateAncestorsRenderNodeCount(r,_-e),this.list.splice(a,e,d)}if(v.length>0&&o){const e=t=>{o(t),t.children.forEach(e)};v.forEach(e)}this._onDidSplice.fire({insertedNodes:m,deletedNodes:v});const w=r.children.length>0;g!==w&&this.setCollapsible(e.slice(0,-1),w);let y=r;for(;y;){if(2===y.visibility){this.refilterDelayer.trigger((()=>this.refilter()));break}y=y.parent}}rerender(e){if(0===e.length)throw new eH(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:n}=this.getTreeNodeWithListIndex(e);t.visible&&n&&this.list.splice(i,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:n}=this.getTreeNodeWithListIndex(e);return i&&n?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);void 0===t&&(t=!i.collapsible);const n={collapsible:t};return this.eventBufferer.bufferEvents((()=>this._setCollapseState(e,n)))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const n=this.getTreeNode(e);void 0===t&&(t=!n.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents((()=>this._setCollapseState(e,o)))}_setCollapseState(e,t){const{node:i,listIndex:n,revealed:o}=this.getTreeNodeWithListIndex(e),s=this._setListNodeCollapseState(i,n,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&s&&!oH(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let n=-1;for(let e=0;e<i.children.length;e++)if(i.children[e].visible){if(n>-1){n=-1;break}n=e}n>-1&&this._setCollapseState([...e,n],t)}return s}_setListNodeCollapseState(e,t,i,n){const o=this._setNodeCollapseState(e,n,!1);if(!i||!e.visible||!o)return o;const s=e.renderNodeCount,r=this.updateNodeAfterCollapseChange(e),a=s-(-1===t?0:1);return this.list.splice(t+1,a,r.slice(1)),o}_setNodeCollapseState(e,t,i){let n;if(e===this.root?n=!1:(oH(t)?(n=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(n=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):n=!1,n&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!oH(t)&&t.recursive)for(const i of e.children)n=this._setNodeCollapseState(i,t,!0)||n;return n}expandTo(e){this.eventBufferer.bufferEvents((()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})}))}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t),this.refilterDelayer.cancel()}createTreeNode(e,t,i,n,o,s){const r={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:"boolean"==typeof e.collapsible?e.collapsible:void 0!==e.collapsed,collapsed:void 0===e.collapsed?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},a=this._filterNode(r,i);r.visibility=a,n&&o.push(r);const l=e.children||C.empty(),h=n&&0!==a&&!r.collapsed;let d=0,c=1;for(const e of l){const t=this.createTreeNode(e,r,a,h,o,s);r.children.push(t),c+=t.renderNodeCount,t.visible&&(t.visibleChildIndex=d++)}return r.collapsible=r.collapsible||r.children.length>0,r.visibleChildrenCount=d,r.visible=2===a?d>0:1===a,r.visible?r.collapsed||(r.renderNodeCount=c):(r.renderNodeCount=0,n&&o.pop()),null==s||s(r),r}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(!1===e.visible)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,n=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),0===o)return e.visible=!1,e.renderNodeCount=0,!1;n&&i.push(e)}const s=i.length;e.renderNodeCount=e===this.root?0:1;let r=!1;if(e.collapsed&&0===o)e.visibleChildrenCount=0;else{let t=0;for(const s of e.children)r=this._updateNodeAfterFilterChange(s,o,i,n&&!e.collapsed)||r,s.visible&&(s.visibleChildIndex=t++);e.visibleChildrenCount=t}return e!==this.root&&(e.visible=2===o?r:1===o,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-s):(e.renderNodeCount=0,n&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(0!==t)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):1;return"boolean"==typeof i?(e.filterData=void 0,i?1:0):iH(i)?(e.filterData=i.data,nH(i.visibility)):(e.filterData=void 0,nH(i))}hasTreeNode(e,t=this.root){if(!e||0===e.length)return!0;const[i,...n]=e;return!(i<0||i>t.children.length)&&this.hasTreeNode(n,t.children[i])}getTreeNode(e,t=this.root){if(!e||0===e.length)return t;const[i,...n]=e;if(i<0||i>t.children.length)throw new eH(this.user,"Invalid tree location");return this.getTreeNode(n,t.children[i])}getTreeNodeWithListIndex(e){if(0===e.length)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:n,visible:o}=this.getParentNodeWithListIndex(e),s=e[e.length-1];if(s<0||s>t.children.length)throw new eH(this.user,"Invalid tree location");const r=t.children[s];return{node:r,listIndex:i,revealed:n,visible:o&&r.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,o=!0){const[s,...r]=e;if(s<0||s>t.children.length)throw new eH(this.user,"Invalid tree location");for(let e=0;e<s;e++)i+=t.children[e].renderNodeCount;return n=n&&!t.collapsed,o=o&&t.visible,0===r.length?{parentNode:t,listIndex:i,revealed:n,visible:o}:this.getParentNodeWithListIndex(r,t.children[s],i+1,n,o)}getNode(e=[]){return this.getTreeNode(e)}getNodeLocation(e){const t=[];let i=e;for(;i.parent;)t.push(i.parent.children.indexOf(i)),i=i.parent;return t.reverse()}getParentNodeLocation(e){return 0===e.length?void 0:1===e.length?[]:function(e){if(0===e.length)throw new Error("Invalid tail call");return[e.slice(0,e.length-1),e[e.length-1]]}(e)[0]}getFirstElementChild(e){const t=this.getTreeNode(e);if(0!==t.children.length)return t.children[0].element}}var rH,aH,lH,hH=i(1766),dH={};dH.styleTagTransform=Vr(),dH.setAttributes=Pr(),dH.insert=Rr().bind(null,"head"),dH.domAPI=Tr(),dH.insertStyleElement=Br(),Ir()(hH.Z,dH),hH.Z&&hH.Z.locals&&hH.Z.locals;class cH extends FD{constructor(e){super(e.elements.map((e=>e.element))),this.data=e}}function uH(e){return e instanceof FD?new cH(e):e}class gH{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=T.None,this.disposables=new M}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map((e=>e.element)),t)}onDragStart(e,t){var i,n;null===(n=(i=this.dnd).onDragStart)||void 0===n||n.call(i,uH(e),t)}onDragOver(e,t,i,n,o=!0){const s=this.dnd.onDragOver(uH(e),t&&t.element,i,n),r=this.autoExpandNode!==t;if(r&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),void 0===t)return s;if(r&&"boolean"!=typeof s&&s.autoExpand&&(this.autoExpandDisposable=jt((()=>{const e=this.modelProvider(),i=e.getNodeLocation(t);e.isCollapsed(i)&&e.setCollapsed(i,!1),this.autoExpandNode=void 0}),500,this.disposables)),"boolean"==typeof s||!s.accept||void 0===s.bubble||s.feedback)return o?s:{accept:"boolean"==typeof s?s:s.accept,effect:"boolean"==typeof s?void 0:s.effect,feedback:[i]};if(1===s.bubble){const i=this.modelProvider(),o=i.getNodeLocation(t),s=i.getParentNodeLocation(o),r=i.getNode(s),a=s&&i.getListIndex(s);return this.onDragOver(e,r,a,n,!1)}const a=this.modelProvider(),l=a.getNodeLocation(t),h=a.getListIndex(l),d=a.getListRenderCount(l);return{...s,feedback:Hc(h,h+d)}}drop(e,t,i,n){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(uH(e),t&&t.element,i,n)}onDragEnd(e){var t,i;null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function pH(e,t){return t&&{...t,identityProvider:t.identityProvider&&{getId:e=>t.identityProvider.getId(e.element)},dnd:t.dnd&&new gH(e,t.dnd),multipleSelectionController:t.multipleSelectionController&&{isSelectionSingleChangeEvent:e=>t.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element}),isSelectionRangeChangeEvent:e=>t.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})},accessibilityProvider:t.accessibilityProvider&&{...t.accessibilityProvider,getSetSize(t){const i=e(),n=i.getNodeLocation(t),o=i.getParentNodeLocation(n);return i.getNode(o).visibleChildrenCount},getPosInSet:e=>e.visibleChildIndex+1,isChecked:t.accessibilityProvider&&t.accessibilityProvider.isChecked?e=>t.accessibilityProvider.isChecked(e.element):void 0,getRole:t.accessibilityProvider&&t.accessibilityProvider.getRole?e=>t.accessibilityProvider.getRole(e.element):()=>"treeitem",getAriaLabel:e=>t.accessibilityProvider.getAriaLabel(e.element),getWidgetAriaLabel:()=>t.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:t.accessibilityProvider&&t.accessibilityProvider.getWidgetRole?()=>t.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:t.accessibilityProvider&&t.accessibilityProvider.getAriaLevel?e=>t.accessibilityProvider.getAriaLevel(e.element):e=>e.depth,getActiveDescendantId:t.accessibilityProvider.getActiveDescendantId&&(e=>t.accessibilityProvider.getActiveDescendantId(e.element))},keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{...t.keyboardNavigationLabelProvider,getKeyboardNavigationLabel:e=>t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}}class mH{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){var i,n;null===(n=(i=this.delegate).setDynamicHeight)||void 0===n||n.call(i,e.element,t)}}!function(e){e.None="none",e.OnHover="onHover",e.Always="always"}(rH||(rH={}));class fH{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new M,this.onDidChange=z.forEach(e,(e=>this._elements=e),this.disposables)}dispose(){this.disposables.dispose()}}class _H{constructor(e,t,i,n,o,s={}){var r;this.renderer=e,this.modelProvider=t,this.activeNodes=n,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=_H.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=T.None,this.disposables=new M,this.templateId=e.templateId,this.updateOptions(s),z.map(i,(e=>e.node))(this.onDidChangeNodeTwistieState,this,this.disposables),null===(r=e.onDidChangeTwistieState)||void 0===r||r.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(void 0!==e.indent){const t=iD(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[e,t]of this.renderedNodes)this.renderTreeElement(e,t)}}if(void 0!==e.renderIndentGuides){const t=e.renderIndentGuides!==rH.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[e,t]of this.renderedNodes)this._renderIndentGuides(e,t);if(this.indentGuidesDisposable.dispose(),t){const e=new M;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,e),this.indentGuidesDisposable=e,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}void 0!==e.hideTwistiesOfChildlessElements&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=hr(e,mr(".monaco-tl-row")),i=hr(t,mr(".monaco-tl-indent")),n=hr(t,mr(".monaco-tl-twistie")),o=hr(t,mr(".monaco-tl-contents")),s=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:n,indentGuidesDisposable:T.None,templateData:s}}renderElement(e,t,i,n){this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,n)}disposeElement(e,t,i,n){var o,s;i.indentGuidesDisposable.dispose(),null===(s=(o=this.renderer).disposeElement)||void 0===s||s.call(o,e,t,i.templateData,n),"number"==typeof n&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){const i=_H.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${i}px`,t.indent.style.width=i+this.indent-16+"px",e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...Ll.asClassNameArray(Sl.treeItemExpanded));let n=!1;this.renderer.renderTwistie&&(n=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(n||t.twistie.classList.add(...Ll.asClassNameArray(Sl.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(_s(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new M,n=this.modelProvider();for(;;){const o=n.getNodeLocation(e),s=n.getParentNodeLocation(o);if(!s)break;const r=n.getNode(s),a=mr(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(r)&&a.classList.add("active"),0===t.indent.childElementCount?t.indent.appendChild(a):t.indent.insertBefore(a,t.indent.firstElementChild),this.renderedIndentGuides.add(r,a),i.add(I((()=>this.renderedIndentGuides.delete(r,a)))),e=r}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach((e=>{const n=i.getNodeLocation(e);try{const o=i.getParentNodeLocation(n);e.collapsible&&e.children.length>0&&!e.collapsed?t.add(e):o&&t.add(i.getNode(o))}catch(e){}})),this.activeIndentNodes.forEach((e=>{t.has(e)||this.renderedIndentGuides.forEach(e,(e=>e.classList.remove("active")))})),t.forEach((e=>{this.activeIndentNodes.has(e)||this.renderedIndentGuides.forEach(e,(e=>e.classList.add("active")))})),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),E(this.disposables)}}_H.DefaultIndent=8;class vH{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,i){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=i,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new M,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let i=1;if(this._filter){const n=this._filter.filter(e,t);if(i="boolean"==typeof n?n?1:0:iH(n)?nH(n.visibility):n,0===i)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:tl.Default,visibility:i};const n=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(n)?n:[n];for(const e of o){const t=e&&e.toString();if(void 0===t)return{data:tl.Default,visibility:i};let n;if(this.tree.findMatchType===lH.Contiguous){const e=t.toLowerCase().indexOf(this._lowercasePattern);if(e>-1){n=[Number.MAX_SAFE_INTEGER,0];for(let t=this._lowercasePattern.length;t>0;t--)n.push(e+t-1)}}else n=nl(this._pattern,this._lowercasePattern,0,t,t.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(n)return this._matchCount++,1===o.length?{data:n,visibility:i}:{data:{label:t,score:n},visibility:i}}return this.tree.findMode===aH.Filter?"number"==typeof this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:tl.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){E(this.disposables)}}!function(e){e[e.Highlight=0]="Highlight",e[e.Filter=1]="Filter"}(aH||(aH={})),function(e){e[e.Fuzzy=0]="Fuzzy",e[e.Contiguous=1]="Contiguous"}(lH||(lH={}));class bH{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,n,o,s={}){var r,a;this.tree=e,this.view=i,this.filter=n,this.contextViewProvider=o,this.options=s,this._pattern="",this.width=0,this._onDidChangeMode=new q,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new q,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new q,this._onDidChangeOpenState=new q,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new M,this.disposables=new M,this._mode=null!==(r=e.options.defaultFindMode)&&void 0!==r?r:aH.Highlight,this._matchType=null!==(a=e.options.defaultFindMatchType)&&void 0!==a?a:lH.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){void 0!==e.defaultFindMode&&(this.mode=e.defaultFindMode),void 0!==e.defaultFindMatchType&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){this.widget&&0!==this.pattern.length&&(this.tree.refilter(),this.render())}render(){var e,t,i,n;const o=this.filter.totalCount>0&&0===this.filter.matchCount;this.pattern&&o?null===(e=this.tree.options.showNotFoundMessage)||void 0===e||e?null===(t=this.widget)||void 0===t||t.showMessage({type:2,content:me(0,"No elements found.")}):null===(i=this.widget)||void 0===i||i.showMessage({type:2}):null===(n=this.widget)||void 0===n||n.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this._mode===aH.Filter||this.filter.totalCount>0&&this.filter.matchCount<=1||!tl.isDefault(e.filterData)}layout(e){var t;this.width=e,null===(t=this.widget)||void 0===t||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}}function wH(e,t){return e.position===t.position&&e.node.element===t.node.element&&e.startIndex===t.startIndex&&e.height===t.height&&e.endIndex===t.endIndex}class CH extends T{constructor(e=[]){super(),this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return Ic(this.stickyNodes,e.stickyNodes,wH)}addDisposable(e){this._register(e)}}class yH extends T{get firstVisibleNode(){const e=this.view.firstVisibleIndex;if(!(e<0||e>=this.view.length))return this.view.element(e)}constructor(e,t,i,n,o,s={}){super(),this.tree=e,this.model=t,this.view=i,this.treeDelegate=o,this.maxWidgetViewRatio=.4;const r=this.validateStickySettings(s);this.stickyScrollMaxItemCount=r.stickyScrollMaxItemCount,this._widget=this._register(new SH(i.getScrollableElement(),i,t,n,o)),this._register(i.onDidScroll((()=>this.update()))),this._register(i.onDidChangeContentHeight((()=>this.update()))),this._register(e.onDidChangeCollapseState((()=>this.update()))),this.update()}update(){const e=this.firstVisibleNode;if(!e||0===this.tree.scrollTop)return void this._widget.setState(void 0);const t=this.findStickyState(e);this._widget.setState(t)}findStickyState(e){const t=[],i=this.view.renderHeight*this.maxWidgetViewRatio;let n=e,o=0,s=this.getNextStickyNode(n,void 0,o);for(;s&&o+s.height<i&&(t.push(s),o+=s.height,!(t.length>=this.stickyScrollMaxItemCount))&&(n=this.getNextVisibleNode(n),n);)s=this.getNextStickyNode(n,s.node,o);return t.length?new CH(t):void 0}getNextVisibleNode(e){const t=this.getNodeIndex(e);if(-1!==t&&t!==this.view.length-1)return this.view.element(t+1)}getNextStickyNode(e,t,i){const n=this.getAncestorUnderPrevious(e,t);if(n){if(n===e){if(!this.nodeIsUncollapsedParent(e))return;if(this.nodeTopAlignsWithStickyNodesBottom(e,i))return}return this.createStickyScrollNode(n,i)}}nodeTopAlignsWithStickyNodesBottom(e,t){const i=this.getNodeIndex(e),n=this.view.getElementTop(i),o=t;return this.view.scrollTop===n-o}createStickyScrollNode(e,t){const i=this.treeDelegate.getHeight(e),{startIndex:n,endIndex:o}=this.getNodeRange(e);return{node:e,position:this.calculateStickyNodePosition(o,t),height:i,startIndex:n,endIndex:o}}getAncestorUnderPrevious(e,t=void 0){let i=e,n=this.getParentNode(i);for(;n;){if(n===t)return i;i=n,n=this.getParentNode(i)}if(void 0===t)return i}calculateStickyNodePosition(e,t){let i=this.view.getRelativeTop(e);if(null===i&&this.view.firstVisibleIndex===e&&e+1<this.view.length){const t=this.treeDelegate.getHeight(this.view.element(e)),n=this.view.getRelativeTop(e+1);i=n?n-t/this.view.renderHeight:null}if(null===i)return t;const n=this.view.element(e),o=this.treeDelegate.getHeight(n),s=i*this.view.renderHeight;return t>s&&t<=s+o?s:t}getParentNode(e){const t=this.model.getNodeLocation(e),i=this.model.getParentNodeLocation(t);return i?this.model.getNode(i):void 0}nodeIsUncollapsedParent(e){const t=this.model.getNodeLocation(e);return this.model.getListRenderCount(t)>1}getNodeIndex(e,t){return void 0===t&&(t=this.model.getNodeLocation(e)),this.model.getListIndex(t)}getNodeRange(e){const t=this.model.getNodeLocation(e),i=this.model.getListIndex(t);if(i<0)throw new Error("Node not found in tree");return{startIndex:i,endIndex:i+this.model.getListRenderCount(t)-1}}nodePositionTopBelowWidget(e){const t=[];let i=this.getParentNode(e);for(;i;)t.push(i),i=this.getParentNode(i);let n=0;for(let e=0;e<t.length&&e<this.stickyScrollMaxItemCount;e++)n+=this.treeDelegate.getHeight(t[e]);return n}updateOptions(e={}){const t=this.validateStickySettings(e);this.stickyScrollMaxItemCount!==t.stickyScrollMaxItemCount&&(this.stickyScrollMaxItemCount=t.stickyScrollMaxItemCount,this.update())}validateStickySettings(e){let t=5;return"number"==typeof e.stickyScrollMaxItemCount&&(t=Math.max(e.stickyScrollMaxItemCount,1)),{stickyScrollMaxItemCount:t}}}class SH{constructor(e,t,i,n,o){this.view=t,this.model=i,this.treeRenderers=n,this.treeDelegate=o,this._rootDomNode=document.createElement("div"),this._rootDomNode.classList.add("monaco-tree-sticky-container"),e.appendChild(this._rootDomNode)}setState(e){var t;const i=!!this._previousState&&this._previousState.count>0,n=!!e&&e.count>0;if(!i&&!n||i&&n&&this._previousState.equal(e))return;if(i!==n&&this.setVisible(n),null===(t=this._previousState)||void 0===t||t.dispose(),this._previousState=e,!n)return;for(let t=e.count-1;t>=0;t--){const i=e.stickyNodes[t],n=t?e.stickyNodes[t-1]:void 0,o=n?n.position+n.height:0,{element:s,disposable:r}=this.createElement(i,o);this._rootDomNode.appendChild(s),e.addDisposable(r)}const o=mr(".monaco-tree-sticky-container-shadow");this._rootDomNode.appendChild(o),e.addDisposable(I((()=>o.remove())));const s=e.stickyNodes[e.count-1];this._rootDomNode.style.height=`${s.position+s.height}px`}createElement(e,t){const i=this.model.getNodeLocation(e.node),n=this.model.getListIndex(i),o=document.createElement("div");o.style.top=`${e.position}px`,o.style.height=`${e.height}px`,o.style.lineHeight=`${e.height}px`,o.classList.add("monaco-tree-sticky-row"),o.classList.add("monaco-list-row"),o.setAttribute("data-index",`${n}`),o.setAttribute("data-parity",n%2==0?"even":"odd"),o.setAttribute("id",this.view.getElementID(n));const s=this.treeDelegate.getTemplateId(e.node),r=this.treeRenderers.find((e=>e.templateId===s));if(!r)throw new Error(`No renderer found for template id ${s}`);const a=new Proxy(e.node,{}),l=r.renderTemplate(o);r.renderElement(a,e.startIndex,l,e.height);const h=I((()=>{r.disposeElement(a,e.startIndex,l,e.height),r.disposeTemplate(l),o.remove()}));return{element:o,disposable:h}}setVisible(e){this._rootDomNode.style.display=e?"block":"none"}dispose(){var e;null===(e=this._previousState)||void 0===e||e.dispose(),this._rootDomNode.remove()}}function kH(e){let t=Jz.Unknown;return Ws(e.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?t=Jz.Twistie:Ws(e.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?t=Jz.Element:Ws(e.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(t=Jz.Filter),{browserEvent:e.browserEvent,element:e.element?e.element.element:null,target:t}}function LH(e,t){t(e),e.children.forEach((e=>LH(e,t)))}class xH{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new q,this.onDidChange=this._onDidChange.event}set(e,t){!(null==t?void 0:t.__forceEvent)&&Ic(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const e=this;this._onDidChange.fire({get elements(){return e.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map((e=>e.element))),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const e=this.createNodeSet(),i=t=>e.delete(t);return t.forEach((e=>LH(e,i))),void this.set([...e.values()])}const i=new Set,n=e=>i.add(this.identityProvider.getId(e.element).toString());t.forEach((e=>LH(e,n)));const o=new Map,s=e=>o.set(this.identityProvider.getId(e.element).toString(),e);e.forEach((e=>LH(e,s)));const r=[];for(const e of this.nodes){const t=this.identityProvider.getId(e.element).toString();if(i.has(t)){const e=o.get(t);e&&e.visible&&r.push(e)}else r.push(e)}if(this.nodes.length>0&&0===r.length){const e=this.getFirstViewElementWithTrait();e&&r.push(e)}this._set(r,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class DH extends rE{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if(XD(e.browserEvent.target)||ZD(e.browserEvent.target)||QD(e.browserEvent.target))return;if(e.browserEvent.isHandledByList)return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,n=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,o=function(e){return YD(e,"monaco-tree-sticky-row")}(e.browserEvent.target);let s=!1;if(s=!!o||("function"==typeof this.tree.expandOnlyOnTwistieClick?this.tree.expandOnlyOnTwistieClick(t.element):!!this.tree.expandOnlyOnTwistieClick),o)this.handleStickyScrollMouseEvent(e,t);else{if(s&&!n&&2!==e.browserEvent.detail)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&2===e.browserEvent.detail)return super.onViewPointer(e)}if(t.collapsible&&(!o||n)){const i=this.tree.getNodeLocation(t),o=e.browserEvent.altKey;if(this.tree.setFocus([i]),this.tree.toggleCollapsed(i,o),s&&n)return void(e.browserEvent.isHandledByList=!0)}o||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(function(e){return YD(e,"monaco-custom-toggle")}(e.browserEvent.target)||function(e){return YD(e,"action-item")}(e.browserEvent.target))return;const i=this.stickyScrollProvider();if(!i)throw new Error("Sticky scroll controller not found");const n=this.list.indexOf(t),o=this.list.getElementTop(n),s=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=o-s,this.list.setFocus([n]),this.list.setSelection([n])}onDoubleClick(e){!e.browserEvent.target.classList.contains("monaco-tl-twistie")&&this.tree.expandOnDoubleClick&&(e.browserEvent.isHandledByList||super.onDoubleClick(e))}}class EH extends mE{constructor(e,t,i,n,o,s,r,a){super(e,t,i,n,a),this.focusTrait=o,this.selectionTrait=s,this.anchorTrait=r}createMouseController(e){return new DH(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){if(super.splice(e,t,i),0===i.length)return;const n=[],o=[];let s;i.forEach(((t,i)=>{this.focusTrait.has(t)&&n.push(e+i),this.selectionTrait.has(t)&&o.push(e+i),this.anchorTrait.has(t)&&(s=e+i)})),n.length>0&&super.setFocus(Vc([...super.getFocus(),...n])),o.length>0&&super.setSelection(Vc([...super.getSelection(),...o])),"number"==typeof s&&super.setAnchor(s)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map((e=>this.element(e))),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map((e=>this.element(e))),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(void 0===e?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class NH{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return z.filter(z.map(this.view.onMouseDblClick,kH),(e=>e.target!==Jz.Filter))}get onPointer(){return z.map(this.view.onPointer,kH)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return z.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,t;return null!==(t=null===(e=this.findController)||void 0===e?void 0:e.mode)&&void 0!==t?t:aH.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,t;return null!==(t=null===(e=this.findController)||void 0===e?void 0:e.matchType)&&void 0!==t?t:lH.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return void 0===this._options.expandOnDoubleClick||this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return void 0===this._options.expandOnlyOnTwistieClick||this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,n,o={}){var s;this._user=e,this._options=o,this.eventBufferer=new X,this.onDidChangeFindOpenState=z.None,this.disposables=new M,this._onWillRefilter=new q,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new q,this.treeDelegate=new mH(i);const r=new J,a=new J,l=this.disposables.add(new fH(a.event)),h=new sa;this.renderers=n.map((e=>new _H(e,(()=>this.model),r.event,l,h,o)));for(const e of this.renderers)this.disposables.add(e);let d;o.keyboardNavigationLabelProvider&&(d=new vH(this,o.keyboardNavigationLabelProvider,o.filter),o={...o,filter:d},this.disposables.add(d)),this.focus=new xH((()=>this.view.getFocusedElements()[0]),o.identityProvider),this.selection=new xH((()=>this.view.getSelectedElements()[0]),o.identityProvider),this.anchor=new xH((()=>this.view.getAnchorElement()),o.identityProvider),this.view=new EH(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...pH((()=>this.model),o),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.model=this.createModel(e,this.view,o),r.input=this.model.onDidChangeCollapseState;const c=z.forEach(this.model.onDidSplice,(e=>{this.eventBufferer.bufferEvents((()=>{this.focus.onDidModelSplice(e),this.selection.onDidModelSplice(e)}))}),this.disposables);c((()=>null),null,this.disposables);const u=this.disposables.add(new q),g=this.disposables.add(new Ht(0));if(this.disposables.add(z.any(c,this.focus.onDidChange,this.selection.onDidChange)((()=>{g.trigger((()=>{const e=new Set;for(const t of this.focus.getNodes())e.add(t);for(const t of this.selection.getNodes())e.add(t);u.fire([...e.values()])}))}))),a.input=u.event,!1!==o.keyboardSupport){const e=z.chain(this.view.onKeyDown,(e=>e.filter((e=>!ZD(e.target))).map((e=>new Dt(e)))));z.chain(e,(e=>e.filter((e=>15===e.keyCode))))(this.onLeftArrow,this,this.disposables),z.chain(e,(e=>e.filter((e=>17===e.keyCode))))(this.onRightArrow,this,this.disposables),z.chain(e,(e=>e.filter((e=>10===e.keyCode))))(this.onSpace,this,this.disposables)}if((null===(s=o.findWidgetEnabled)||void 0===s||s)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const e=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new bH(this,this.model,this.view,d,o.contextViewProvider,e),this.focusNavigationFilter=e=>this.findController.shouldAllowFocus(e),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=z.None,this.onDidChangeFindMatchType=z.None;o.enableStickyScroll&&(this.stickyScrollController=new yH(this,this.model,this.view,this.renderers,this.treeDelegate,o)),this.styleElement=$s(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===rH.Always)}updateOptions(e={}){var t;this._options={...this._options,...e};for(const t of this.renderers)t.updateOptions(e);this.view.updateOptions(this._options),null===(t=this.findController)||void 0===t||t.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===rH.Always)}get options(){return this._options}updateStickyScroll(e){var t;!this.stickyScrollController&&this._options.enableStickyScroll?this.stickyScrollController=new yH(this,this.model,this.view,this.renderers,this.treeDelegate,this._options):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.stickyScrollController.dispose(),this.stickyScrollController=void 0),null===(t=this.stickyScrollController)||void 0===t||t.updateOptions(e)}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}domFocus(){this.view.domFocus()}layout(e,t){var i;this.view.layout(e,t),dl(t)&&(null===(i=this.findController)||void 0===i||i.layout(t))}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),e.listBackground&&(i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${e.listBackground}; }`),i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${e.listBackground}; }`)),this.styleElement.textContent=i.join("\n"),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const i=e.map((e=>this.model.getNode(e)));this.selection.set(i,t);const n=e.map((e=>this.model.getListIndex(e))).filter((e=>e>-1));this.view.setSelection(n,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const i=e.map((e=>this.model.getNode(e)));this.focus.set(i,t);const n=e.map((e=>this.model.getListIndex(e))).filter((e=>e>-1));this.view.setFocus(n,t,!0)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);if(-1!==i)if(this.stickyScrollController){const n=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,n)}else this.view.reveal(i,t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const e=this.model.getParentNodeLocation(n);if(!e)return;const t=this.model.getListIndex(e);this.view.reveal(t),this.view.setFocus([t])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some((e=>e.visible)))return;const[e]=this.view.getFocus(),t=e+1;this.view.reveal(t),this.view.setFocus([t])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,o)}dispose(){var e;E(this.disposables),null===(e=this.stickyScrollController)||void 0===e||e.dispose(),this.view.dispose()}}class IH{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new sH(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare:(e,t)=>i.sorter.compare(e.element,t.element)}),this.identityProvider=i.identityProvider}setChildren(e,t=C.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=C.empty(),i){const n=new Set,o=new Set;this.model.splice([...e,0],Number.MAX_VALUE,t,{...i,onDidCreateNode:e=>{var t;if(null===e.element)return;const s=e;if(n.add(s.element),this.nodes.set(s.element,s),this.identityProvider){const e=this.identityProvider.getId(s.element).toString();o.add(e),this.nodesByIdentity.set(e,s)}null===(t=i.onDidCreateNode)||void 0===t||t.call(i,s)},onDidDeleteNode:e=>{var t;if(null===e.element)return;const s=e;if(n.has(s.element)||this.nodes.delete(s.element),this.identityProvider){const e=this.identityProvider.getId(s.element).toString();o.has(e)||this.nodesByIdentity.delete(e)}null===(t=i.onDidDeleteNode)||void 0===t||t.call(i,s)}})}preserveCollapseState(e=C.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),C.map(e,(e=>{let t=this.nodes.get(e.element);if(!t&&this.identityProvider){const i=this.identityProvider.getId(e.element).toString();t=this.nodesByIdentity.get(i)}if(!t){let t;return t=void 0===e.collapsed?void 0:e.collapsed===Xz.Collapsed||e.collapsed===Xz.PreserveOrCollapsed||e.collapsed!==Xz.Expanded&&e.collapsed!==Xz.PreserveOrExpanded&&Boolean(e.collapsed),{...e,children:this.preserveCollapseState(e.children),collapsed:t}}const i="boolean"==typeof e.collapsible?e.collapsible:t.collapsible;let n;return n=void 0===e.collapsed||e.collapsed===Xz.PreserveOrCollapsed||e.collapsed===Xz.PreserveOrExpanded?t.collapsed:e.collapsed===Xz.Collapsed||e.collapsed!==Xz.Expanded&&Boolean(e.collapsed),{...e,collapsible:i,collapsed:n,children:this.preserveCollapseState(e.children)}}))}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getElementLocation(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(null===e)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new eH(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(null===e)throw new eH(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new eH(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),n=this.model.getParentNodeLocation(i);return this.model.getNode(n).element}getElementLocation(e){if(null===e)return[];const t=this.nodes.get(e);if(!t)throw new eH(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function MH(e){return{element:{elements:[e.element],incompressible:e.incompressible||!1},children:C.map(C.from(e.children),MH),collapsible:e.collapsible,collapsed:e.collapsed}}function TH(e){const t=[e.element],i=e.incompressible||!1;let n,o;for(;[o,n]=C.consume(C.from(e.children),2),1===o.length&&!o[0].incompressible;)e=o[0],t.push(e.element);return{element:{elements:t,incompressible:i},children:C.map(C.concat(o,n),TH),collapsible:e.collapsible,collapsed:e.collapsed}}function AH(e,t=0){let i;return i=t<e.element.elements.length-1?[AH(e,t+1)]:C.map(C.from(e.children),(e=>AH(e,0))),0===t&&e.element.incompressible?{element:e.element.elements[t],children:i,incompressible:!0,collapsible:e.collapsible,collapsed:e.collapsed}:{element:e.element.elements[t],children:i,collapsible:e.collapsible,collapsed:e.collapsed}}function RH(e){return AH(e,0)}function OH(e,t,i){return e.element===t?{...e,children:i}:{...e,children:C.map(C.from(e.children),(e=>OH(e,t,i)))}}class PH{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new IH(e,t,i),this.enabled=void 0===i.compressionEnabled||i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=C.empty(),i){const n=i.diffIdentityProvider&&(o=i.diffIdentityProvider,{getId:e=>e.elements.map((e=>o.getId(e).toString())).join("\0")});var o;if(null===e){const e=C.map(t,this.enabled?TH:MH);return void this._setChildren(null,e,{diffIdentityProvider:n,diffDepth:1/0})}const s=this.nodes.get(e);if(!s)throw new eH(this.user,"Unknown compressed tree node");const r=this.model.getNode(s),a=this.model.getParentNodeLocation(s),l=this.model.getNode(a),h=OH(RH(r),e,t),d=(this.enabled?TH:MH)(h),c=i.diffIdentityProvider?(e,t)=>i.diffIdentityProvider.getId(e)===i.diffIdentityProvider.getId(t):void 0;if(Ic(d.element.elements,r.element.elements,c))return void this._setChildren(s,d.children||C.empty(),{diffIdentityProvider:n,diffDepth:1});const u=l.children.map((e=>e===r?d:e));this._setChildren(l.element,u,{diffIdentityProvider:n,diffDepth:r.depth-l.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const t=this.model.getNode().children,i=C.map(t,RH),n=C.map(i,e?TH:MH);this._setChildren(null,n,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set;this.model.setChildren(e,t,{...i,onDidCreateNode:e=>{for(const t of e.element.elements)n.add(t),this.nodes.set(t,e.element)},onDidDeleteNode:e=>{for(const t of e.element.elements)n.has(t)||this.nodes.delete(t)}})}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(void 0===e)return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return null===t?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return null===i?null:i.elements[i.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getCompressedNode(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(null===e)return null;const t=this.nodes.get(e);if(!t)throw new eH(this.user,`Tree element not found: ${e}`);return t}}const FH=e=>e[e.length-1];class BH{get element(){return null===this.node.element?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map((e=>new BH(this.unwrapper,e)))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}}class WH{get onDidSplice(){return z.map(this.model.onDidSplice,(({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map((e=>this.nodeMapper.map(e))),deletedNodes:t.map((e=>this.nodeMapper.map(e)))})))}get onDidChangeCollapseState(){return z.map(this.model.onDidChangeCollapseState,(({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t})))}get onDidChangeRenderNodeCount(){return z.map(this.model.onDidChangeRenderNodeCount,(e=>this.nodeMapper.map(e)))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||FH;const n=e=>this.elementMapper(e.elements);this.nodeMapper=new tH((e=>new BH(n,e))),this.model=new PH(e,function(e,t){return{splice(i,n,o){t.splice(i,n,o.map((t=>e.map(t))))},updateElementHeight(e,i){t.updateElementHeight(e,i)}}}(this.nodeMapper,t),function(e,t){return{...t,identityProvider:t.identityProvider&&{getId:i=>t.identityProvider.getId(e(i))},sorter:t.sorter&&{compare:(e,i)=>t.sorter.compare(e.elements[0],i.elements[0])},filter:t.filter&&{filter:(i,n)=>t.filter.filter(e(i),n)}}}(n,i))}setChildren(e,t=C.empty(),i={}){this.model.setChildren(e,t,i)}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return null==t?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}class VH extends NH{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,n,o={}){super(e,t,i,n,o),this.user=e}setChildren(e,t=C.empty(),i){this.model.setChildren(e,t,i)}rerender(e){void 0!==e?this.model.rerender(e):this.view.rerender()}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new IH(e,t,i)}}class zH{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){const o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);1===o.element.elements.length?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,n)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,n))}disposeElement(e,t,i,n){var o,s,r,a;i.compressedTreeNode?null===(s=(o=this.renderer).disposeCompressedElements)||void 0===s||s.call(o,i.compressedTreeNode,t,i.data,n):null===(a=(r=this.renderer).disposeElement)||void 0===a||a.call(r,e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return!!this.renderer.renderTwistie&&this.renderer.renderTwistie(e,t)}}!function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);s>3&&r&&Object.defineProperty(t,i,r)}([HL],zH.prototype,"compressedTreeNodeProvider",null);class HH extends VH{constructor(e,t,i,n,o={}){const s=()=>this;super(e,t,i,n.map((e=>new zH(s,e))),function(e,t){return t&&{...t,keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(i){let n;try{n=e().getCompressedTreeNode(i)}catch(e){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i)}return 1===n.element.elements.length?t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i):t.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.element.elements)}}}}(s,o))}setChildren(e,t=C.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new WH(e,t,i)}updateOptions(e={}){super.updateOptions(e),void 0!==e.compressionEnabled&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}function UH(e){return{...e,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function KH(e,t){return!!t.parent&&(t.parent===e||KH(e,t.parent))}class jH{get element(){return this.node.element.element}get children(){return this.node.children.map((e=>new jH(e)))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class qH{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...Ll.asClassNameArray(Sl.treeItemLoading)),!0):(t.classList.remove(...Ll.asClassNameArray(Sl.treeItemLoading)),!1)}disposeElement(e,t,i,n){var o,s;null===(s=(o=this.renderer).disposeElement)||void 0===s||s.call(o,this.nodeMapper.map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function $H(e){return{browserEvent:e.browserEvent,elements:e.elements.map((e=>e.element))}}function GH(e){return{browserEvent:e.browserEvent,element:e.element&&e.element.element,target:e.target}}class ZH extends FD{constructor(e){super(e.elements.map((e=>e.element))),this.data=e}}function YH(e){return e instanceof FD?new ZH(e):e}class QH{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map((e=>e.element)),t)}onDragStart(e,t){var i,n;null===(n=(i=this.dnd).onDragStart)||void 0===n||n.call(i,YH(e),t)}onDragOver(e,t,i,n,o=!0){return this.dnd.onDragOver(YH(e),t&&t.element,i,n)}drop(e,t,i,n){this.dnd.drop(YH(e),t&&t.element,i,n)}onDragEnd(e){var t,i;null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}dispose(){this.dnd.dispose()}}function XH(e){return e&&{...e,collapseByDefault:!0,identityProvider:e.identityProvider&&{getId:t=>e.identityProvider.getId(t.element)},dnd:e.dnd&&new QH(e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent:t=>e.multipleSelectionController.isSelectionSingleChangeEvent({...t,element:t.element}),isSelectionRangeChangeEvent:t=>e.multipleSelectionController.isSelectionRangeChangeEvent({...t,element:t.element})},accessibilityProvider:e.accessibilityProvider&&{...e.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",isChecked:e.accessibilityProvider.isChecked?t=>{var i;return!!(null===(i=e.accessibilityProvider)||void 0===i?void 0:i.isChecked(t.element))}:void 0,getAriaLabel:t=>e.accessibilityProvider.getAriaLabel(t.element),getWidgetAriaLabel:()=>e.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider.getAriaLevel&&(t=>e.accessibilityProvider.getAriaLevel(t.element)),getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))},filter:e.filter&&{filter:(t,i)=>e.filter.filter(t.element,i)},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)},sorter:void 0,expandOnlyOnTwistieClick:void 0===e.expandOnlyOnTwistieClick?void 0:"function"!=typeof e.expandOnlyOnTwistieClick?e.expandOnlyOnTwistieClick:t=>e.expandOnlyOnTwistieClick(t.element),defaultFindVisibility:t=>t.hasChildren&&t.stale?1:"number"==typeof e.defaultFindVisibility?e.defaultFindVisibility:void 0===e.defaultFindVisibility?2:e.defaultFindVisibility(t.element)}}function JH(e,t){t(e),e.children.forEach((e=>JH(e,t)))}class eU{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return z.map(this.tree.onDidChangeFocus,$H)}get onDidChangeSelection(){return z.map(this.tree.onDidChangeSelection,$H)}get onMouseDblClick(){return z.map(this.tree.onMouseDblClick,GH)}get onPointer(){return z.map(this.tree.onPointer,GH)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,n,o,s={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new q,this._onDidChangeNodeSlowState=new q,this.nodeMapper=new tH((e=>new jH(e))),this.disposables=new M,this.identityProvider=s.identityProvider,this.autoExpandSingleChildren=void 0!==s.autoExpandSingleChildren&&s.autoExpandSingleChildren,this.sorter=s.sorter,this.getDefaultCollapseState=e=>s.collapseByDefault?s.collapseByDefault(e)?Xz.PreserveOrCollapsed:Xz.PreserveOrExpanded:void 0,this.tree=this.createTree(e,t,i,n,s),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.root=UH({element:void 0,parent:null,hasChildren:!0,defaultCollapseState:void 0}),this.identityProvider&&(this.root={...this.root,id:null}),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,i,n,o){const s=new mH(i),r=n.map((e=>new qH(e,this.nodeMapper,this._onDidChangeNodeSlowState.event))),a=XH(o)||{};return new VH(e,t,s,r,a)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}async setInput(e,t){this.refreshPromises.forEach((e=>e.cancel())),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};await this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&"number"==typeof t.scrollTop&&(this.scrollTop=t.scrollTop)}async _updateChildren(e=this.root.element,t=!0,i=!1,n,o){if(void 0===this.root.element)throw new eH(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await z.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(await this.refreshAndRenderNode(s,t,n,o),i)try{this.tree.rerender(s)}catch(e){}}rerender(e){if(void 0===e||e===this.root.element)return void this.tree.rerender();const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}async expand(e,t=!1){if(void 0===this.root.element)throw new eH(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await z.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i))return!1;if(i.refreshPromise&&(await this.root.refreshPromise,await z.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i))return!1;const n=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(await this.root.refreshPromise,await z.toPromise(this._onDidRender.event)),n}setSelection(e,t){const i=e.map((e=>this.getDataNode(e)));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map((e=>e.element))}setFocus(e,t){const i=e.map((e=>this.getDataNode(e)));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map((e=>e.element))}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new eH(this.user,`Data tree node not found: ${e}`);return t}async refreshAndRenderNode(e,t,i,n){await this.refreshNode(e,t,i),this.render(e,i,n)}async refreshNode(e,t,i){let n;return this.subTreeRefreshPromises.forEach(((o,s)=>{!n&&function(e,t){return e===t||KH(e,t)||KH(t,e)}(s,e)&&(n=o.then((()=>this.refreshNode(e,t,i))))})),n||(e!==this.root&&this.tree.getNode(e).collapsed?(e.hasChildren=!!this.dataSource.hasChildren(e.element),void(e.stale=!0)):this.doRefreshSubTree(e,t,i))}async doRefreshSubTree(e,t,i){let n;e.refreshPromise=new Promise((e=>n=e)),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally((()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)}));try{const n=await this.doRefreshNode(e,t,i);e.stale=!1,await ti.settled(n.map((e=>this.doRefreshSubTree(e,t,i))))}finally{n()}}async doRefreshNode(e,t,i){let n;if(e.hasChildren=!!this.dataSource.hasChildren(e.element),e.hasChildren){const t=this.doGetChildren(e);if(cl(t))n=Promise.resolve(t);else{const i=Kt(800);i.then((()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)}),(e=>null)),n=t.finally((()=>i.cancel()))}}else n=Promise.resolve(C.empty());try{const o=await n;return this.setChildren(e,o,t,i)}catch(t){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),g(t))return[];throw t}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const i=this.dataSource.getChildren(e.element);return cl(i)?this.processChildren(i):(t=Wt((async()=>this.processChildren(await i))),this.refreshPromises.set(e,t),t.finally((()=>{this.refreshPromises.delete(e)})))}_onDidChangeCollapseState({node:e,deep:t}){null!==e.element&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(h))}setChildren(e,t,i,n){const o=[...t];if(0===e.children.length&&0===o.length)return[];const s=new Map,r=new Map;for(const t of e.children)s.set(t.element,t),this.identityProvider&&r.set(t.id,{node:t,collapsed:this.tree.hasElement(t)&&this.tree.isCollapsed(t)});const a=[],l=o.map((t=>{const o=!!this.dataSource.hasChildren(t);if(!this.identityProvider){const i=UH({element:t,parent:e,hasChildren:o,defaultCollapseState:this.getDefaultCollapseState(t)});return o&&i.defaultCollapseState===Xz.PreserveOrExpanded&&a.push(i),i}const l=this.identityProvider.getId(t).toString(),h=r.get(l);if(h){const e=h.node;return s.delete(e.element),this.nodes.delete(e.element),this.nodes.set(t,e),e.element=t,e.hasChildren=o,i?h.collapsed?(e.children.forEach((e=>JH(e,(e=>this.nodes.delete(e.element))))),e.children.splice(0,e.children.length),e.stale=!0):a.push(e):o&&!h.collapsed&&a.push(e),e}const d=UH({element:t,parent:e,id:l,hasChildren:o,defaultCollapseState:this.getDefaultCollapseState(t)});return n&&n.viewState.focus&&n.viewState.focus.indexOf(l)>-1&&n.focus.push(d),n&&n.viewState.selection&&n.viewState.selection.indexOf(l)>-1&&n.selection.push(d),(n&&n.viewState.expanded&&n.viewState.expanded.indexOf(l)>-1||o&&d.defaultCollapseState===Xz.PreserveOrExpanded)&&a.push(d),d}));for(const e of s.values())JH(e,(e=>this.nodes.delete(e.element)));for(const e of l)this.nodes.set(e.element,e);return e.children.splice(0,e.children.length,...l),e!==this.root&&this.autoExpandSingleChildren&&1===l.length&&0===a.length&&(l[0].forceExpanded=!0,a.push(l[0])),a}render(e,t,i){const n=e.children.map((e=>this.asTreeElement(e,t))),o=i&&{...i,diffIdentityProvider:i.diffIdentityProvider&&{getId:e=>i.diffIdentityProvider.getId(e.element)}};this.tree.setChildren(e===this.root?null:e,n,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:e.forceExpanded?(i=!1,e.forceExpanded=!1):i=e.defaultCollapseState,{element:e,children:e.hasChildren?C.map(e.children,(e=>this.asTreeElement(e,t))):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class tU{get element(){return{elements:this.node.element.elements.map((e=>e.element)),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map((e=>new tU(e)))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class iU{constructor(e,t,i,n){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderCompressedElements(e,t,i,n){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...Ll.asClassNameArray(Sl.treeItemLoading)),!0):(t.classList.remove(...Ll.asClassNameArray(Sl.treeItemLoading)),!1)}disposeElement(e,t,i,n){var o,s;null===(s=(o=this.renderer).disposeElement)||void 0===s||s.call(o,this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){var o,s;null===(s=(o=this.renderer).disposeCompressedElements)||void 0===s||s.call(o,this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=E(this.disposables)}}class nU extends eU{constructor(e,t,i,n,o,s,r={}){super(e,t,i,o,s,r),this.compressionDelegate=n,this.compressibleNodeMapper=new tH((e=>new tU(e))),this.filter=r.filter}createTree(e,t,i,n,o){const s=new mH(i),r=n.map((e=>new iU(e,this.nodeMapper,(()=>this.compressibleNodeMapper),this._onDidChangeNodeSlowState.event))),a=function(e){const t=e&&XH(e);return t&&{...t,keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{...t.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map((e=>e.element)))}}}(o)||{};return new HH(e,t,s,r,a)}asTreeElement(e,t){return{incompressible:this.compressionDelegate.isIncompressible(e.element),...super.asTreeElement(e,t)}}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t){if(!this.identityProvider)return super.render(e,t);const i=e=>this.identityProvider.getId(e).toString(),n=e=>{const t=new Set;for(const n of e){const e=this.tree.getCompressedTreeNode(n===this.root?null:n);if(e.element)for(const n of e.element.elements)t.add(i(n.element))}return t},o=n(this.tree.getSelection()),s=n(this.tree.getFocus());super.render(e,t);const r=this.getSelection();let a=!1;const l=this.getFocus();let h=!1;const d=e=>{const t=e.element;if(t)for(let e=0;e<t.elements.length;e++){const n=i(t.elements[e].element),d=t.elements[t.elements.length-1].element;o.has(n)&&-1===r.indexOf(d)&&(r.push(d),a=!0),s.has(n)&&-1===l.indexOf(d)&&(l.push(d),h=!0)}e.children.forEach(d)};d(this.tree.getCompressedTreeNode(e===this.root?null:e)),a&&this.setSelection(r),h&&this.setFocus(l)}processChildren(e){return this.filter&&(e=C.filter(e,(e=>{const t="boolean"==typeof(i=this.filter.filter(e,1))?i?1:0:iH(i)?nH(i.visibility):nH(i);var i;if(2===t)throw new Error("Recursive tree visibility not supported in async data compressed trees");return 1===t}))),super.processChildren(e)}}class oU extends NH{constructor(e,t,i,n,o,s={}){super(e,t,i,n,s),this.user=e,this.dataSource=o,this.identityProvider=s.identityProvider}createModel(e,t,i){return new IH(e,t,i)}}new od("isMac",Ve,me(0,"Whether the operating system is macOS")),new od("isLinux",ze,me(0,"Whether the operating system is Linux"));const sU=new od("isWindows",We,me(0,"Whether the operating system is Windows")),rU=new od("isWeb",Ue,me(0,"Whether the platform is a web browser")),aU=(new od("isMacNative",Ve&&!Ue,me(0,"Whether the operating system is macOS on a non-browser platform")),new od("isIOS",je,me(0,"Whether the operating system is iOS")),new od("isMobile",qe,me(0,"Whether the platform is a mobile web browser")),new od("isDevelopment",!1,!0),new od("productQualityType","",me(0,"Quality type of VS Code")),"inputFocus");let lU;new od(aU,!1,me(0,"Whether keyboard focus is inside an input box"));const hU=globalThis.vscode;if(void 0!==hU&&void 0!==hU.context){const e=hU.context.configuration();if(!e)throw new Error("Sandbox: unable to resolve product configuration from preload script.");lU=e.product}else if(globalThis._VSCODE_PRODUCT_JSON&&globalThis._VSCODE_PACKAGE_JSON){if(lU=globalThis._VSCODE_PRODUCT_JSON,no.VSCODE_DEV&&Object.assign(lU,{nameShort:`${lU.nameShort} Dev`,nameLong:`${lU.nameLong} Dev`,dataFolderName:`${lU.dataFolderName}-dev`,serverDataFolderName:lU.serverDataFolderName?`${lU.serverDataFolderName}-dev`:void 0}),!lU.version){const e=globalThis._VSCODE_PACKAGE_JSON;Object.assign(lU,{version:e.version})}}else lU={},0===Object.keys(lU).length&&Object.assign(lU,{version:"1.82.0-dev",nameShort:"Code - OSS Dev",nameLong:"Code - OSS Dev",applicationName:"code-oss",dataFolderName:".vscode-oss",urlProtocol:"code-oss",reportIssueUrl:"https://github.com/microsoft/vscode/issues/new",licenseName:"MIT",licenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt",serverLicenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt"});const dU=lU;var cU=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},uU=function(e,t){return function(i,n){t(i,n,e)}};const gU=hh("listService"),pU=new od("listScrollAtBoundary","none"),mU=(Bh.or(pU.isEqualTo("top"),pU.isEqualTo("both")),Bh.or(pU.isEqualTo("bottom"),pU.isEqualTo("both")),new od("listFocus",!0)),fU=new od("listSupportsMultiselect",!0),_U=Bh.and(mU,Bh.not(aU)),vU=new od("listHasSelectionOrFocus",!1),bU=new od("listDoubleSelection",!1),wU=new od("listMultiSelection",!1),CU=new od("listSelectionNavigation",!1),yU=new od("listSupportsFind",!0),SU=new od("treeElementCanCollapse",!1),kU=new od("treeElementHasParent",!1),LU=new od("treeElementCanExpand",!1),xU=new od("treeElementHasChild",!1),DU=new od("treeFindOpen",!1),EU="listTypeNavigationMode",NU="listAutomaticKeyboardNavigation";function IU(e,t){const i=e.createScoped(t.getHTMLElement());return mU.bindTo(i),i}function MU(e,t){const i=pU.bindTo(e),n=()=>{const e=0===t.scrollTop,n=t.scrollHeight-t.renderHeight-t.scrollTop<1;e&&n?i.set("both"):e?i.set("top"):n?i.set("bottom"):i.set("none")};return n(),t.onDidScroll(n)}const TU="workbench.list.multiSelectModifier",AU="workbench.list.openMode",RU="workbench.list.horizontalScrolling",OU="workbench.list.defaultFindMode",PU="workbench.list.typeNavigationMode",FU="workbench.list.keyboardNavigation",BU="workbench.list.scrollByPage",WU="workbench.list.defaultFindMatchType",VU="workbench.tree.indent",zU="workbench.tree.renderIndentGuides",HU="workbench.list.smoothScrolling",UU="workbench.list.mouseWheelScrollSensitivity",KU="workbench.list.fastScrollSensitivity",jU="workbench.tree.expandMode",qU="workbench.tree.enableStickyScroll",$U="workbench.tree.stickyScrollMaxItemCount";function GU(e){return"alt"===e.getValue(TU)}class ZU extends T{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=GU(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration(TU)&&(this.useAltAsMultipleSelectionModifier=GU(this.configurationService))})))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:nE(e)}isSelectionRangeChangeEvent(e){return oE(e)}}function YU(e,t){var i;const n=e.get(ug),o=e.get(ML),s=new M;return[{...t,keyboardNavigationDelegate:{mightProducePrintableCharacter:e=>o.mightProducePrintableCharacter(e)},smoothScrolling:Boolean(n.getValue(HU)),mouseWheelScrollSensitivity:n.getValue(UU),fastScrollSensitivity:n.getValue(KU),multipleSelectionController:null!==(i=t.multipleSelectionController)&&void 0!==i?i:s.add(new ZU(n)),keyboardNavigationEventFilter:oK(o),scrollByPage:Boolean(n.getValue(BU))},s]}let QU=class extends mE{constructor(e,t,i,n,o,s,r,a,l){const h=void 0!==o.horizontalScrolling?o.horizontalScrolling:Boolean(a.getValue(RU)),[d,c]=l.invokeFunction(YU,o);super(e,t,i,n,{keyboardSupport:!1,...d,horizontalScrolling:h}),this.disposables.add(c),this.contextKeyService=IU(s,this),this.disposables.add(MU(this.contextKeyService,this)),this.listSupportsMultiSelect=fU.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==o.multipleSelectionSupport),CU.bindTo(this.contextKeyService).set(Boolean(o.selectionNavigation)),this.listHasSelectionOrFocus=vU.bindTo(this.contextKeyService),this.listDoubleSelection=bU.bindTo(this.contextKeyService),this.listMultiSelection=wU.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=GU(a),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection((()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)}))}))),this.disposables.add(this.onDidChangeFocus((()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)}))),this.disposables.add(a.onDidChangeConfiguration((e=>{e.affectsConfiguration(TU)&&(this._useAltAsMultipleSelectionModifier=GU(a));let t={};if(e.affectsConfiguration(RU)&&void 0===this.horizontalScrolling){const e=Boolean(a.getValue(RU));t={...t,horizontalScrolling:e}}if(e.affectsConfiguration(BU)){const e=Boolean(a.getValue(BU));t={...t,scrollByPage:e}}if(e.affectsConfiguration(HU)){const e=Boolean(a.getValue(HU));t={...t,smoothScrolling:e}}if(e.affectsConfiguration(UU)){const e=a.getValue(UU);t={...t,mouseWheelScrollSensitivity:e}}if(e.affectsConfiguration(KU)){const e=a.getValue(KU);t={...t,fastScrollSensitivity:e}}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new tK(this,{configurationService:a,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?tN(e):eN)}};QU=cU([uU(5,sd),uU(6,gU),uU(7,ug),uU(8,lh)],QU);let XU=class extends _z{constructor(e,t,i,n,o,s,r,a,l){const h=void 0!==o.horizontalScrolling?o.horizontalScrolling:Boolean(a.getValue(RU)),[d,c]=l.invokeFunction(YU,o);super(e,t,i,n,{keyboardSupport:!1,...d,horizontalScrolling:h}),this.disposables=new M,this.disposables.add(c),this.contextKeyService=IU(s,this),this.disposables.add(MU(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=fU.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==o.multipleSelectionSupport),CU.bindTo(this.contextKeyService).set(Boolean(o.selectionNavigation)),this._useAltAsMultipleSelectionModifier=GU(a),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(a.onDidChangeConfiguration((e=>{e.affectsConfiguration(TU)&&(this._useAltAsMultipleSelectionModifier=GU(a));let t={};if(e.affectsConfiguration(RU)&&void 0===this.horizontalScrolling){const e=Boolean(a.getValue(RU));t={...t,horizontalScrolling:e}}if(e.affectsConfiguration(BU)){const e=Boolean(a.getValue(BU));t={...t,scrollByPage:e}}if(e.affectsConfiguration(HU)){const e=Boolean(a.getValue(HU));t={...t,smoothScrolling:e}}if(e.affectsConfiguration(UU)){const e=a.getValue(UU);t={...t,mouseWheelScrollSensitivity:e}}if(e.affectsConfiguration(KU)){const e=a.getValue(KU);t={...t,fastScrollSensitivity:e}}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new tK(this,{configurationService:a,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?tN(e):eN)}dispose(){this.disposables.dispose(),super.dispose()}};XU=cU([uU(5,sd),uU(6,gU),uU(7,ug),uU(8,lh)],XU);let JU=class extends Mz{constructor(e,t,i,n,o,s,r,a,l,h){const d=void 0!==s.horizontalScrolling?s.horizontalScrolling:Boolean(l.getValue(RU)),[c,u]=h.invokeFunction(YU,s);super(e,t,i,n,o,{keyboardSupport:!1,...c,horizontalScrolling:d}),this.disposables.add(u),this.contextKeyService=IU(r,this),this.disposables.add(MU(this.contextKeyService,this)),this.listSupportsMultiSelect=fU.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==s.multipleSelectionSupport),CU.bindTo(this.contextKeyService).set(Boolean(s.selectionNavigation)),this.listHasSelectionOrFocus=vU.bindTo(this.contextKeyService),this.listDoubleSelection=bU.bindTo(this.contextKeyService),this.listMultiSelection=wU.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=GU(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection((()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)}))}))),this.disposables.add(this.onDidChangeFocus((()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)}))),this.disposables.add(l.onDidChangeConfiguration((e=>{e.affectsConfiguration(TU)&&(this._useAltAsMultipleSelectionModifier=GU(l));let t={};if(e.affectsConfiguration(RU)&&void 0===this.horizontalScrolling){const e=Boolean(l.getValue(RU));t={...t,horizontalScrolling:e}}if(e.affectsConfiguration(BU)){const e=Boolean(l.getValue(BU));t={...t,scrollByPage:e}}if(e.affectsConfiguration(HU)){const e=Boolean(l.getValue(HU));t={...t,smoothScrolling:e}}if(e.affectsConfiguration(UU)){const e=l.getValue(UU);t={...t,mouseWheelScrollSensitivity:e}}if(e.affectsConfiguration(KU)){const e=l.getValue(KU);t={...t,fastScrollSensitivity:e}}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new iK(this,{configurationService:l,...s}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?tN(e):eN)}dispose(){this.disposables.dispose(),super.dispose()}};JU=cU([uU(6,sd),uU(7,gU),uU(8,ug),uU(9,lh)],JU);class eK extends T{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new q),this.onDidOpen=this._onDidOpen.event,this._register(z.filter(this.widget.onDidChangeSelection,(e=>nr(e.browserEvent)))((e=>this.onSelectionFromKeyboard(e)))),this._register(this.widget.onPointer((e=>this.onPointer(e.element,e.browserEvent)))),this._register(this.widget.onMouseDblClick((e=>this.onMouseDblClick(e.element,e.browserEvent)))),"boolean"!=typeof(null==t?void 0:t.openOnSingleClick)&&(null==t?void 0:t.configurationService)?(this.openOnSingleClick="doubleClick"!==(null==t?void 0:t.configurationService.getValue(AU)),this._register(null==t?void 0:t.configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration(AU)&&(this.openOnSingleClick="doubleClick"!==(null==t?void 0:t.configurationService.getValue(AU)))})))):this.openOnSingleClick=null===(i=null==t?void 0:t.openOnSingleClick)||void 0===i||i}onSelectionFromKeyboard(e){if(1!==e.elements.length)return;const t=e.browserEvent,i="boolean"!=typeof t.preserveFocus||t.preserveFocus,n="boolean"==typeof t.pinned?t.pinned:!i;this._open(this.getSelectedElement(),i,n,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick)return;if(2===t.detail)return;const i=1===t.button,n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!0,i,n,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!1,!0,n,t)}_open(e,t,i,n,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:n,element:e,browserEvent:o})}}class tK extends eK{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class iK extends eK{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class nK extends eK{constructor(e,t){super(e,t)}getSelectedElement(){var e;return null!==(e=this.widget.getSelection()[0])&&void 0!==e?e:void 0}}function oK(e){let t=!1;return i=>{if(i.toKeyCodeChord().isModifierKey())return!1;if(t)return t=!1,!1;const n=e.softDispatch(i,i.target);return 1===n.kind?(t=!0,!1):(t=!1,0===n.kind)}}let sK=class extends VH{constructor(e,t,i,n,o,s,r,a,l){const{options:h,getTypeNavigationMode:d,disposable:c}=s.invokeFunction(uK,o);super(e,t,i,n,h),this.disposables.add(c),this.internals=new gK(this,o,d,o.overrideStyles,r,a,l),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};sK=cU([uU(5,lh),uU(6,sd),uU(7,gU),uU(8,ug)],sK);let rK=class extends HH{constructor(e,t,i,n,o,s,r,a,l){const{options:h,getTypeNavigationMode:d,disposable:c}=s.invokeFunction(uK,o);super(e,t,i,n,h),this.disposables.add(c),this.internals=new gK(this,o,d,o.overrideStyles,r,a,l),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};rK=cU([uU(5,lh),uU(6,sd),uU(7,gU),uU(8,ug)],rK);let aK=class extends oU{constructor(e,t,i,n,o,s,r,a,l,h){const{options:d,getTypeNavigationMode:c,disposable:u}=r.invokeFunction(uK,s);super(e,t,i,n,o,d),this.disposables.add(u),this.internals=new gK(this,s,c,s.overrideStyles,a,l,h),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),void 0!==e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};aK=cU([uU(6,lh),uU(7,sd),uU(8,gU),uU(9,ug)],aK);let lK=class extends eU{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,s,r,a,l,h){const{options:d,getTypeNavigationMode:c,disposable:u}=r.invokeFunction(uK,s);super(e,t,i,n,o,d),this.disposables.add(u),this.internals=new gK(this,s,c,s.overrideStyles,a,l,h),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};lK=cU([uU(6,lh),uU(7,sd),uU(8,gU),uU(9,ug)],lK);let hK=class extends nU{constructor(e,t,i,n,o,s,r,a,l,h,d){const{options:c,getTypeNavigationMode:u,disposable:g}=a.invokeFunction(uK,r);super(e,t,i,n,o,s,c),this.disposables.add(g),this.internals=new gK(this,r,u,r.overrideStyles,l,h,d),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};function dK(e){const t=e.getValue(OU);if("highlight"===t)return aH.Highlight;if("filter"===t)return aH.Filter;const i=e.getValue(FU);return"simple"===i||"highlight"===i?aH.Highlight:"filter"===i?aH.Filter:void 0}function cK(e){const t=e.getValue(WU);return"fuzzy"===t?lH.Fuzzy:"contiguous"===t?lH.Contiguous:void 0}function uK(e,t){var i;const n=e.get(ug),o=e.get(jE),s=e.get(sd),r=e.get(lh),a=void 0!==t.horizontalScrolling?t.horizontalScrolling:Boolean(n.getValue(RU)),[l,h]=r.invokeFunction(YU,t),d=t.paddingBottom,c=void 0!==t.renderIndentGuides?t.renderIndentGuides:n.getValue(zU);return{getTypeNavigationMode:()=>{const e=s.getContextKeyValue(EU);if("automatic"===e)return HD.Automatic;if("trigger"===e)return HD.Trigger;if(!1===s.getContextKeyValue(NU))return HD.Trigger;const t=n.getValue(PU);return"automatic"===t?HD.Automatic:"trigger"===t?HD.Trigger:void 0},disposable:h,options:{keyboardSupport:!1,...l,indent:"number"==typeof n.getValue(VU)?n.getValue(VU):void 0,renderIndentGuides:c,smoothScrolling:Boolean(n.getValue(HU)),defaultFindMode:dK(n),defaultFindMatchType:cK(n),horizontalScrolling:a,scrollByPage:Boolean(n.getValue(BU)),paddingBottom:d,hideTwistiesOfChildlessElements:t.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:null!==(i=t.expandOnlyOnTwistieClick)&&void 0!==i?i:"doubleClick"===n.getValue(jU),contextViewProvider:o,findWidgetStyles:XE,enableStickyScroll:Boolean(n.getValue(qU)),stickyScrollMaxItemCount:Number(n.getValue($U))}}}hK=cU([uU(7,lh),uU(8,sd),uU(9,gU),uU(10,ug)],hK);let gK=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,o,s,r){var a;this.tree=e,this.disposables=[],this.contextKeyService=IU(o,e),this.disposables.push(MU(this.contextKeyService,e)),this.listSupportsMultiSelect=fU.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==t.multipleSelectionSupport),CU.bindTo(this.contextKeyService).set(Boolean(t.selectionNavigation)),this.listSupportFindWidget=yU.bindTo(this.contextKeyService),this.listSupportFindWidget.set(null===(a=t.findWidgetEnabled)||void 0===a||a),this.hasSelectionOrFocus=vU.bindTo(this.contextKeyService),this.hasDoubleSelection=bU.bindTo(this.contextKeyService),this.hasMultiSelection=wU.bindTo(this.contextKeyService),this.treeElementCanCollapse=SU.bindTo(this.contextKeyService),this.treeElementHasParent=kU.bindTo(this.contextKeyService),this.treeElementCanExpand=LU.bindTo(this.contextKeyService),this.treeElementHasChild=xU.bindTo(this.contextKeyService),this.treeFindOpen=DU.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=GU(r),this.updateStyleOverrides(n);const l=()=>{const t=e.getFocus()[0];if(!t)return;const i=e.getNode(t);this.treeElementCanCollapse.set(i.collapsible&&!i.collapsed),this.treeElementHasParent.set(!!e.getParentElement(t)),this.treeElementCanExpand.set(i.collapsible&&i.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(t))},h=new Set;h.add(EU),h.add(NU),this.disposables.push(this.contextKeyService,s.register(e),e.onDidChangeSelection((()=>{const t=e.getSelection(),i=e.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.hasSelectionOrFocus.set(t.length>0||i.length>0),this.hasMultiSelection.set(t.length>1),this.hasDoubleSelection.set(2===t.length)}))})),e.onDidChangeFocus((()=>{const t=e.getSelection(),i=e.getFocus();this.hasSelectionOrFocus.set(t.length>0||i.length>0),l()})),e.onDidChangeCollapseState(l),e.onDidChangeModel(l),e.onDidChangeFindOpenState((e=>this.treeFindOpen.set(e))),r.onDidChangeConfiguration((n=>{let o={};if(n.affectsConfiguration(TU)&&(this._useAltAsMultipleSelectionModifier=GU(r)),n.affectsConfiguration(VU)){const e=r.getValue(VU);o={...o,indent:e}}if(n.affectsConfiguration(zU)&&void 0===t.renderIndentGuides){const e=r.getValue(zU);o={...o,renderIndentGuides:e}}if(n.affectsConfiguration(HU)){const e=Boolean(r.getValue(HU));o={...o,smoothScrolling:e}}if(n.affectsConfiguration(OU)||n.affectsConfiguration(FU)){const e=dK(r);o={...o,defaultFindMode:e}}if(n.affectsConfiguration(PU)||n.affectsConfiguration(FU)){const e=i();o={...o,typeNavigationMode:e}}if(n.affectsConfiguration(WU)){const e=cK(r);o={...o,defaultFindMatchType:e}}if(n.affectsConfiguration(RU)&&void 0===t.horizontalScrolling){const e=Boolean(r.getValue(RU));o={...o,horizontalScrolling:e}}if(n.affectsConfiguration(BU)){const e=Boolean(r.getValue(BU));o={...o,scrollByPage:e}}if(n.affectsConfiguration(jU)&&void 0===t.expandOnlyOnTwistieClick&&(o={...o,expandOnlyOnTwistieClick:"doubleClick"===r.getValue(jU)}),n.affectsConfiguration(qU)){const e=r.getValue(qU);o={...o,enableStickyScroll:e}}if(n.affectsConfiguration($U)){const e=Math.max(1,r.getValue($U));o={...o,stickyScrollMaxItemCount:e}}if(n.affectsConfiguration(UU)){const e=r.getValue(UU);o={...o,mouseWheelScrollSensitivity:e}}if(n.affectsConfiguration(KU)){const e=r.getValue(KU);o={...o,fastScrollSensitivity:e}}Object.keys(o).length>0&&e.updateOptions(o)})),this.contextKeyService.onDidChangeContext((t=>{t.affectsSome(h)&&e.updateOptions({typeNavigationMode:i()})}))),this.navigator=new nK(e,{configurationService:r,...t}),this.disposables.push(this.navigator)}updateOptions(e){void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?tN(e):eN)}dispose(){this.disposables=E(this.disposables)}};gK=cU([uU(4,sd),uU(5,gU),uU(6,ug)],gK),md.as(Lg).registerConfiguration({id:"workbench",order:7,title:me(0,"Workbench"),type:"object",properties:{[TU]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[me(0,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),me(0,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:me(0,"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[AU]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:me(0,"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[RU]:{type:"boolean",default:!1,description:me(0,"Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[BU]:{type:"boolean",default:!1,description:me(0,"Controls whether clicks in the scrollbar scroll page by page.")},[VU]:{type:"number",default:8,minimum:4,maximum:40,description:me(0,"Controls tree indentation in pixels.")},[zU]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:me(0,"Controls whether the tree should render indent guides.")},[HU]:{type:"boolean",default:!1,description:me(0,"Controls whether lists and trees have smooth scrolling.")},[UU]:{type:"number",default:1,markdownDescription:me(0,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[KU]:{type:"number",default:5,markdownDescription:me(0,"Scrolling speed multiplier when pressing `Alt`.")},[OU]:{type:"string",enum:["highlight","filter"],enumDescriptions:[me(0,"Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),me(0,"Filter elements when searching.")],default:"highlight",description:me(0,"Controls the default find mode for lists and trees in the workbench.")},[FU]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[me(0,"Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),me(0,"Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),me(0,"Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:me(0,"Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:me(0,"Please use 'workbench.list.defaultFindMode' and\t'workbench.list.typeNavigationMode' instead.")},[WU]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[me(0,"Use fuzzy matching when searching."),me(0,"Use contiguous matching when searching.")],default:"fuzzy",description:me(0,"Controls the type of matching used when searching lists and trees in the workbench.")},[jU]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:me(0,"Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[qU]:{type:"boolean",default:"string"==typeof dU.quality&&"stable"!==dU.quality,description:me(0,"Controls whether sticky scrolling is enabled in trees.")},[$U]:{type:"number",minimum:1,default:7,markdownDescription:me(0,"Controls the number of sticky elements displayed in the tree when `#workbench.tree.enableStickyScroll#` is enabled.")},[PU]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:me(0,"Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});class pK{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=rx.nextId()}get uri(){return this.link.uri}get range(){var e,t;return null!==(t=null!==(e=this._range)&&void 0!==e?e:this.link.targetSelectionRange)&&void 0!==t?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=null===(e=this.parent.getPreview(this))||void 0===e?void 0:e.preview(this.range);return t?me(0,"{0} in {1} on line {2} at column {3}",t.value,Kl(this.uri),this.range.startLineNumber,this.range.startColumn):me(0,"in {0} on line {1} at column {2}",Kl(this.uri),this.range.startLineNumber,this.range.startColumn)}}class mK{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:n,startColumn:o,endLineNumber:s,endColumn:r}=e,a=i.getWordUntilPosition({lineNumber:n,column:o-t}),l=new tc(n,a.startColumn,n,o),h=new tc(s,r,s,1073741824),d=i.getValueInRange(l).replace(/^\s+/,""),c=i.getValueInRange(e);return{value:d+c+i.getValueInRange(h).replace(/\s+$/,""),highlight:{start:d.length,end:d.length+c.length}}}}class fK{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new ta}dispose(){E(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return 1===e?me(0,"1 symbol in {0}, full path {1}",Kl(this.uri),this.uri.fsPath):me(0,"{0} symbols in {1}, full path {2}",e,Kl(this.uri),this.uri.fsPath)}async resolve(e){if(0!==this._previews.size)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=await e.createModelReference(t.uri);this._previews.set(t.uri,new mK(i))}catch(e){h(e)}return this}}class _K{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new q,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;let n;e.sort(_K._compareReferences);for(const t of e)if(n&&zl.isEqual(n.uri,t.uri,!0)||(n=new fK(this,t.uri),this.groups.push(n)),0===n.children.length||0!==_K._compareReferences(t,n.children[n.children.length-1])){const e=new pK(i===t,n,t,(e=>this._onDidChangeReferenceRange.fire(e)));this.references.push(e),n.children.push(e)}}dispose(){E(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new _K(this._links,this._title)}get title(){return this._title}get isEmpty(){return 0===this.groups.length}get ariaMessage(){return this.isEmpty?me(0,"No results found"):1===this.references.length?me(0,"Found 1 symbol in {0}",this.references[0].uri.fsPath):1===this.groups.length?me(0,"Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):me(0,"Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let n=i.children.indexOf(e);const o=i.children.length,s=i.parent.groups.length;return 1===s||t&&n+1<o||!t&&n>0?(n=t?(n+1)%o:(n+o-1)%o,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%s,i.parent.groups[n].children[0]):(n=(n+s-1)%s,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map(((i,n)=>({idx:n,prefixLen:En(i.uri.toString(),e.toString()),offsetDist:100*Math.abs(i.range.startLineNumber-t.lineNumber)+Math.abs(i.range.startColumn-t.column)}))).sort(((e,t)=>e.prefixLen>t.prefixLen?-1:e.prefixLen<t.prefixLen?1:e.offsetDist<t.offsetDist?-1:e.offsetDist>t.offsetDist?1:0))[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&tc.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return zl.compare(e.uri,t.uri)||tc.compareRangesUsingStarts(e.range,t.range)}}var vK=i(879),bK={};bK.styleTagTransform=Vr(),bK.setAttributes=Pr(),bK.insert=Rr().bind(null,"head"),bK.domAPI=Tr(),bK.insertStyleElement=Br(),Ir()(vK.Z,bK),vK.Z&&vK.Z.locals&&vK.Z.locals;var wK=i(477),CK={};CK.styleTagTransform=Vr(),CK.setAttributes=Pr(),CK.insert=Rr().bind(null,"head"),CK.domAPI=Tr(),CK.insertStyleElement=Br(),Ir()(wK.Z,CK),wK.Z&&wK.Z.locals&&wK.Z.locals;class yK{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=hr(e,mr(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){var e,t;this.element.textContent=ln(this.countFormat,this.count),this.element.title=ln(this.titleFormat,this.count),this.element.style.backgroundColor=null!==(e=this.styles.badgeBackground)&&void 0!==e?e:"",this.element.style.color=null!==(t=this.styles.badgeForeground)&&void 0!==t?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}class SK{constructor(e,t){var i;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=null!==(i=null==t?void 0:t.supportIcons)&&void 0!==i&&i,this.domNode=hr(e,mr("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",n){e||(e=""),n&&(e=SK.escapeNewLines(e,t)),this.didEverRender&&this.text===e&&this.title===i&&fc(this.highlights,t)||(this.text=e,this.title=i,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const i of this.highlights){if(i.end===i.start)continue;if(t<i.start){const n=this.text.substring(t,i.start);this.supportIcons?e.push(...nx(n)):e.push(n),t=i.start}const n=this.text.substring(t,i.end),o=mr("span.highlight",void 0,...this.supportIcons?nx(n):[n]);i.extraClasses&&o.classList.add(...i.extraClasses),e.push(o),t=i.end}if(t<this.text.length){const i=this.text.substring(t);this.supportIcons?e.push(...nx(i)):e.push(i)}cr(this.domNode,...e),this.title?this.domNode.title=this.title:this.domNode.removeAttribute("title"),this.didEverRender=!0}static escapeNewLines(e,t){let i=0,n=0;return e.replace(/\r\n|\r|\n/g,((e,o)=>{n="\r\n"===e?-1:0,o+=i;for(const e of t)e.end<=o||(e.start>=o&&(e.start+=n),e.end>=o&&(e.end+=n));return i+=n,"⏎"}))}}var kK=i(4269),LK={};LK.styleTagTransform=Vr(),LK.setAttributes=Pr(),LK.insert=Rr().bind(null,"head"),LK.domAPI=Tr(),LK.insertStyleElement=Br(),Ir()(kK.Z,LK),kK.Z&&kK.Z.locals&&kK.Z.locals;class xK{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class DK extends T{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new xK(hr(e,mr(".monaco-icon-label")))),this.labelContainer=hr(this.domNode.element,mr(".monaco-icon-label-container")),this.nameContainer=hr(this.labelContainer,mr("span.monaco-icon-name-container")),(null==t?void 0:t.supportHighlights)||(null==t?void 0:t.supportIcons)?this.nameNode=new NK(this.nameContainer,!!t.supportIcons):this.nameNode=new EK(this.nameContainer),this.hoverDelegate=null==t?void 0:t.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,i){var n;const o=["monaco-icon-label"],s=["monaco-icon-label-container"];let r="";if(i&&(i.extraClasses&&o.push(...i.extraClasses),i.italic&&o.push("italic"),i.strikethrough&&o.push("strikethrough"),i.disabledCommand&&s.push("disabled"),i.title&&("string"==typeof i.title?r+=i.title:r+=e)),this.domNode.className=o.join(" "),this.domNode.element.setAttribute("aria-label",r),this.labelContainer.className=s.join(" "),this.setupHover((null==i?void 0:i.descriptionTitle)?this.labelContainer:this.element,null==i?void 0:i.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const e=this.getOrCreateDescriptionNode();e instanceof SK?(e.set(t||"",i?i.descriptionMatches:void 0,void 0,null==i?void 0:i.labelEscapeNewLines),this.setupHover(e.element,null==i?void 0:i.descriptionTitle)):(e.textContent=t&&(null==i?void 0:i.labelEscapeNewLines)?SK.escapeNewLines(t,[]):t||"",this.setupHover(e.element,(null==i?void 0:i.descriptionTitle)||""),e.empty=!t)}((null==i?void 0:i.suffix)||this.suffixNode)&&(this.getOrCreateSuffixNode().textContent=null!==(n=null==i?void 0:i.suffix)&&void 0!==n?n:"")}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),t)if(this.hoverDelegate){const i=eD(this.hoverDelegate,e,t);i&&this.customHovers.set(e,i)}else!function(e,t){al(t)?e.title=Il(t):(null==t?void 0:t.markdownNotSupportedFallback)?e.title=t.markdownNotSupportedFallback:e.removeAttribute("title")}(e,t);else e.removeAttribute("title")}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const i=this._register(new xK((e=this.nameContainer,t=mr("span.monaco-icon-suffix-container"),e.after(t),t)));this.suffixNode=this._register(new xK(hr(i.element,mr("span.label-suffix"))))}var e,t;return this.suffixNode}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new xK(hr(this.labelContainer,mr("span.monaco-icon-description-container"))));(null===(e=this.creationOptions)||void 0===e?void 0:e.supportDescriptionHighlights)?this.descriptionNode=new SK(hr(t.element,mr("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new xK(hr(t.element,mr("span.label-description"))))}return this.descriptionNode}}class EK{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!fc(this.options,t))if(this.label=e,this.options=t,"string"==typeof e)this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=hr(this.container,mr("a.label-name",{id:null==t?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i<e.length;i++){const n=e[i],o=(null==t?void 0:t.domId)&&`${null==t?void 0:t.domId}_${i}`;hr(this.container,mr("a.label-name",{id:o,"data-icon-label-count":e.length,"data-icon-label-index":i,role:"treeitem"},n)),i<e.length-1&&hr(this.container,mr("span.label-separator",void 0,(null==t?void 0:t.separator)||"/"))}}}}class NK{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!fc(this.options,t))if(this.label=e,this.options=t,"string"==typeof e)this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=new SK(hr(this.container,mr("a.label-name",{id:null==t?void 0:t.domId})),{supportIcons:this.supportIcons})),this.singleLabel.set(e,null==t?void 0:t.matches,void 0,null==t?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=(null==t?void 0:t.separator)||"/",n=function(e,t,i){if(!i)return;let n=0;return e.map((e=>{const o={start:n,end:n+e.length},s=i.map((e=>CD.intersect(o,e))).filter((e=>!CD.isEmpty(e))).map((({start:e,end:t})=>({start:e-n,end:t-n})));return n=o.end+t.length,s}))}(e,i,null==t?void 0:t.matches);for(let o=0;o<e.length;o++){const s=e[o],r=n?n[o]:void 0,a=mr("a.label-name",{id:(null==t?void 0:t.domId)&&`${null==t?void 0:t.domId}_${o}`,"data-icon-label-count":e.length,"data-icon-label-index":o,role:"treeitem"});new SK(hr(this.container,a),{supportIcons:this.supportIcons}).set(s,r,void 0,null==t?void 0:t.labelEscapeNewLines),o<e.length-1&&hr(a,mr("span.label-separator",void 0,i))}}}}const IK=hh("labelService");var MK,TK=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},AK=function(e,t){return function(i,n){t(i,n,e)}};let RK=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof _K||e instanceof fK}getChildren(e){if(e instanceof _K)return e.groups;if(e instanceof fK)return e.resolve(this._resolverService).then((e=>e.children));throw new Error("bad tree")}};RK=TK([AK(0,gh)],RK);class OK{getHeight(){return 23}getTemplateId(e){return e instanceof fK?WK.id:zK.id}}let PK=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof pK){const i=null===(t=e.parent.getPreview(e))||void 0===t?void 0:t.preview(e.range);if(i)return i.value}return Kl(e.uri)}};PK=TK([AK(0,ML)],PK);class FK{getId(e){return e instanceof pK?e.id:e.uri}}let BK=class extends T{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new DK(i,{supportHighlights:!0})),this.badge=new yK(hr(i,mr(".count")),{},JE),e.appendChild(i)}set(e,t){const i=ql(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const n=e.children.length;this.badge.setCount(n),n>1?this.badge.setTitleFormat(me(0,"{0} references",n)):this.badge.setTitleFormat(me(0,"{0} reference",n))}};BK=TK([AK(1,IK)],BK);let WK=MK=class{constructor(e){this._instantiationService=e,this.templateId=MK.id}renderTemplate(e){return this._instantiationService.createInstance(BK,e)}renderElement(e,t,i){i.set(e.element,za(e.filterData))}disposeTemplate(e){e.dispose()}};WK.id="FileReferencesRenderer",WK=MK=TK([AK(0,lh)],WK);class VK{constructor(e){this.label=new SK(e)}set(e,t){var i;const n=null===(i=e.parent.getPreview(e))||void 0===i?void 0:i.preview(e.range);if(n&&n.value){const{value:e,highlight:i}=n;t&&!tl.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(e,za(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(e,[i]))}else this.label.set(`${Kl(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`)}}class zK{constructor(){this.templateId=zK.id}renderTemplate(e){return new VK(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}zK.id="OneReferenceRenderer";class HK{getWidgetAriaLabel(){return me(0,"References")}getAriaLabel(e){return e.ariaMessage}}var UK=function(e,t){return function(i,n){t(i,n,e)}};class KK{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new M,this._callOnModelChange=new M,this._callOnDispose.add(this._editor.onDidChangeModel((()=>this._onModelChanged()))),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e)for(const t of this._model.references)if(t.uri.toString()===e.uri.toString())return void this._addDecorations(t.parent)}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations((()=>this._onDecorationChanged())));const t=[],i=[];for(let n=0,o=e.children.length;n<o;n++){const o=e.children[n];this._decorationIgnoreSet.has(o.id)||o.uri.toString()===this._editor.getModel().uri.toString()&&(t.push({range:o.range,options:KK.DecorationOptions}),i.push(n))}this._editor.changeDecorations((n=>{const o=n.deltaDecorations([],t);for(let t=0;t<o.length;t++)this._decorations.set(o[t],e.children[i[t]])}))}_onDecorationChanged(){const e=[],t=this._editor.getModel();if(t){for(const[i,n]of this._decorations){const o=t.getDecorationRange(i);if(!o)continue;let s=!1;tc.equalsRange(o,n.range)||((tc.spansMultipleLines(o)||n.range.endColumn-n.range.startColumn!=o.endColumn-o.startColumn)&&(s=!0),s?(this._decorationIgnoreSet.add(n.id),e.push(i)):n.range=o)}for(let t=0,i=e.length;t<i;t++)this._decorations.delete(e[t]);this._editor.removeDecorations(e)}}removeDecorations(){this._editor.removeDecorations([...this._decorations.keys()]),this._decorations.clear()}}KK.DecorationOptions=Sy.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"});class jK{constructor(){this.ratio=.7,this.heightInLines=18}static fromJSON(e){let t,i;try{const n=JSON.parse(e);t=n.ratio,i=n.heightInLines}catch(e){}return{ratio:t||.7,heightInLines:i||18}}}class qK extends lK{}let $K=class extends sz{constructor(e,t,i,n,o,s,r,a,l,h,d,c){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},s),this._defaultTreeKeyboardSupport=t,this.layoutData=i,this._textModelResolverService=o,this._instantiationService=s,this._peekViewService=r,this._uriLabel=a,this._undoRedoService=l,this._keybindingService=h,this._languageService=d,this._languageConfigurationService=c,this._disposeOnNewModel=new M,this._callOnDispose=new M,this._onDidSelectReference=new q,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new Ms(0,0),this._applyTheme(n.getColorTheme()),this._callOnDispose.add(n.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}dispose(){this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),E(this._preview),E(this._previewNotAvailableMessage),E(this._tree),E(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const t=e.getColor(hz)||ru.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(rz)||ru.transparent,primaryHeadingColor:e.getColor(az),secondaryHeadingColor:e.getColor(lz)})}show(e){super.show(e,this.layoutData.heightInLines||18)}focusOnReferenceTree(){this._tree.domFocus()}focusOnPreviewEditor(){this._preview.focus()}isPreviewEditorFocused(){return this._preview.hasTextFocus()}_onTitleClick(e){this._preview&&this._preview.getModel()&&this._onDidSelectReference.fire({element:this._getFocusedReference(),kind:e.ctrlKey||e.metaKey||e.altKey?"side":"open",source:"title"})}_fillBody(e){this.setCssClass("reference-zone-widget"),this._messageContainer=hr(e,mr("div.messages")),_r(this._messageContainer),this._splitView=new xz(e,{orientation:1}),this._previewContainer=hr(e,mr("div.preview.inline")),this._preview=this._instantiationService.createInstance(_V,this._previewContainer,{scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!0},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1}},{},this.editor),_r(this._previewContainer),this._previewNotAvailableMessage=new gy(me(0,"no preview available"),Hg,gy.DEFAULT_CREATION_OPTIONS,null,this._undoRedoService,this._languageService,this._languageConfigurationService),this._treeContainer=hr(e,mr("div.ref-tree.inline"));const t={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new HK,keyboardNavigationLabelProvider:this._instantiationService.createInstance(PK),identityProvider:new FK,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:dz}};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(Cs(this._treeContainer,"keydown",(e=>{e.equals(9)&&(this._keybindingService.dispatchEvent(e,e.target),e.stopPropagation())}),!0)),this._tree=this._instantiationService.createInstance(qK,"ReferencesWidget",this._treeContainer,new OK,[this._instantiationService.createInstance(WK),this._instantiationService.createInstance(zK)],this._instantiationService.createInstance(RK),t),this._splitView.addView({onDidChange:z.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:e=>{this._preview.layout({height:this._dim.height,width:e})}},Lz.Distribute),this._splitView.addView({onDidChange:z.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:e=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${e}px`,this._tree.layout(this._dim.height,e)}},Lz.Distribute),this._disposables.add(this._splitView.onDidSashChange((()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)}),void 0));const i=(e,t)=>{e instanceof pK&&("show"===t&&this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:t,source:"tree"}))};this._tree.onDidOpen((e=>{e.sideBySide?i(e.element,"side"):e.editorOptions.pinned?i(e.element,"goto"):i(e.element,"show")})),_r(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Ms(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then((()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))}))}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=me(0,"No results"),fr(this._messageContainer),Promise.resolve(void 0)):(_r(this._messageContainer),this._decorationsManager=new KK(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange((e=>this._tree.rerender(e)))),this._disposeOnNewModel.add(this._preview.onMouseDown((e=>{const{event:t,target:i}=e;if(2!==t.detail)return;const n=this._getFocusedReference();n&&this._onDidSelectReference.fire({element:{uri:n.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})}))),this.container.classList.add("results-loaded"),fr(this._treeContainer),fr(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(1===this._model.groups.length?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();return e instanceof pK?e:e instanceof fK&&e.children.length>0?e.children[0]:void 0}async revealReference(e){await this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}async _revealReference(e,t){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==jo.inMemory?this.setTitle(Ul(e.uri),this._uriLabel.getUriLabel(ql(e.uri))):this.setTitle(me(0,"References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent||(t&&this._tree.reveal(e.parent),await this._tree.expand(e.parent)),this._tree.reveal(e);const n=await i;if(!this._model)return void n.dispose();E(this._previewModelReference);const o=n.object;if(o){const t=this._preview.getModel()===o.textEditorModel?0:1,i=tc.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(o.textEditorModel),this._preview.setSelection(i),this._preview.revealRangeInCenter(i,t)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}};$K=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([UK(3,Tv),UK(4,gh),UK(5,lh),UK(6,tz),UK(7,IK),UK(8,ny),UK(9,ML),UK(10,yu),UK(11,Yg)],$K);var GK,ZK=function(e,t){return function(i,n){t(i,n,e)}};const YK=new od("referenceSearchVisible",!1,me(0,"Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let QK=GK=class{static get(e){return e.getContribution(GK.ID)}constructor(e,t,i,n,o,s,r,a){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=o,this._instantiationService=s,this._storageService=r,this._configurationService=a,this._disposables=new M,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=YK.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),null===(e=this._widget)||void 0===e||e.dispose(),null===(t=this._model)||void 0===t||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let n;if(this._widget&&(n=this._widget.position),this.closeWidget(),n&&e.containsPosition(n))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage((()=>{this.closeWidget()}))),this._disposables.add(this._editor.onDidChangeModel((()=>{this._ignoreModelChangeEvent||this.closeWidget()})));const o="peekViewLayout",s=jK.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance($K,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(me(0,"Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose((()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()}))),this._disposables.add(this._widget.onDidSelectReference((e=>{const{element:t,kind:n}=e;if(t)switch(n){case"open":"editor"===e.source&&this._configurationService.getValue("editor.stablePeek")||this.openReference(t,!1,!1);break;case"side":this.openReference(t,!0,!1);break;case"goto":i?this._gotoReference(t,!0):this.openReference(t,!1,!0)}})));const r=++this._requestIdPool;t.then((t=>{var i;if(r===this._requestIdPool&&this._widget)return null===(i=this._model)||void 0===i||i.dispose(),this._model=t,this._widget.setModel(this._model).then((()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(me(0,"{0} ({1})",this._model.title,this._model.references.length));const t=this._editor.getModel().uri,i=new ch(e.startLineNumber,e.startColumn),n=this._model.nearestReference(t,i);if(n)return this._widget.setSelection(n).then((()=>{this._widget&&"editor"===this._editor.getOption(86)&&this._widget.focusOnPreviewEditor()}))}}));t.dispose()}),(e=>{this._notificationService.error(e)}))}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(e){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const n=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();await this._widget.setSelection(n),await this._gotoReference(n,!1),o?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()}async revealReference(e){this._editor.hasModel()&&this._model&&this._widget&&await this._widget.revealReference(e)}closeWidget(e=!0){var t,i;null===(t=this._widget)||void 0===t||t.dispose(),null===(i=this._model)||void 0===i||i.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){var i;null===(i=this._widget)||void 0===i||i.hide(),this._ignoreModelChangeEvent=!0;const n=tc.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:n,selectionSource:"code.jump",pinned:t}},this._editor).then((e=>{var t;if(this._ignoreModelChangeEvent=!1,e&&this._widget)if(this._editor===e)this._widget.show(n),this._widget.focusOnReferenceTree();else{const i=GK.get(e),o=this._model.clone();this.closeWidget(),e.focus(),null==i||i.toggleWidget(n,Wt((e=>Promise.resolve(o))),null!==(t=this._peekMode)&&void 0!==t&&t)}else this.closeWidget()}),(e=>{this._ignoreModelChangeEvent=!1,h(e)}))}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:o}=e;this._editorService.openCodeEditor({resource:n,options:{selection:o,selectionSource:"code.jump",pinned:i}},this._editor,t)}};function XK(e,t){const i=function(e){const t=e.get(dh).getFocusedCodeEditor();return t instanceof _V?t.getParentEditor():t}(e);if(!i)return;const n=QK.get(i);n&&t(n)}QK.ID="editor.contrib.referencesController",QK=GK=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([ZK(2,sd),ZK(3,dh),ZK(4,hL),ZK(5,lh),ZK(6,KN),ZK(7,ug)],QK),_d.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:vt(2089,60),when:Bh.or(YK,iz.inPeekEditor),handler(e){XK(e,(e=>{e.changeFocusBetweenPreviewAndReferences()}))}}),_d.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:Bh.or(YK,iz.inPeekEditor),handler(e){XK(e,(e=>{e.goToNextOrPreviousReference(!0)}))}}),_d.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:Bh.or(YK,iz.inPeekEditor),handler(e){XK(e,(e=>{e.goToNextOrPreviousReference(!1)}))}}),Ch.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference"),Ch.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference"),Ch.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch"),Ch.registerCommand("closeReferenceSearch",(e=>XK(e,(e=>e.closeWidget())))),_d.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:Bh.and(iz.inPeekEditor,Bh.not("config.editor.stablePeek"))}),_d.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:Bh.and(YK,Bh.not("config.editor.stablePeek"))}),_d.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:Bh.and(YK,_U,SU.negate(),LU.negate()),handler(e){var t;const i=null===(t=e.get(gU).lastFocusedList)||void 0===t?void 0:t.getFocus();Array.isArray(i)&&i[0]instanceof pK&&XK(e,(e=>e.revealReference(i[0])))}}),_d.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:Bh.and(YK,_U,SU.negate(),LU.negate()),handler(e){var t;const i=null===(t=e.get(gU).lastFocusedList)||void 0===t?void 0:t.getFocus();Array.isArray(i)&&i[0]instanceof pK&&XK(e,(e=>e.openReference(i[0],!0,!0)))}}),Ch.registerCommand("openReference",(e=>{var t;const i=null===(t=e.get(gU).lastFocusedList)||void 0===t?void 0:t.getFocus();Array.isArray(i)&&i[0]instanceof pK&&XK(e,(e=>e.openReference(i[0],!1,!0)))}));var JK=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},ej=function(e,t){return function(i,n){t(i,n,e)}};const tj=new od("hasSymbols",!1,me(0,"Whether there are symbol locations that can be navigated via keyboard-only.")),ij=hh("ISymbolNavigationService");let nj=class{constructor(e,t,i,n){this._editorService=t,this._notificationService=i,this._keybindingService=n,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=tj.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),null===(e=this._currentState)||void 0===e||e.dispose(),null===(t=this._currentMessage)||void 0===t||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1)return void this.reset();this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new oj(this._editorService),n=i.onDidChange((e=>{if(this._ignoreEditorChange)return;const i=this._editorService.getActiveCodeEditor();if(!i)return;const n=i.getModel(),o=i.getPosition();if(!n||!o)return;let s=!1,r=!1;for(const e of t.references)if(Hl(e.uri,n.uri))s=!0,r=r||tc.containsPosition(e.range,o);else if(s)break;s&&r||this.reset()}));this._currentState=N(i,n)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:tc.collapseToStart(t.range),selectionRevealType:3}},e).finally((()=>{this._ignoreEditorChange=!1}))}_showMessage(){var e;null===(e=this._currentMessage)||void 0===e||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),i=t?me(0,"Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):me(0,"Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};nj=JK([ej(0,sd),ej(1,dh),ej(2,hL),ej(3,ML)],nj),wg(ij,nj,1),jd(new class extends Vd{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:tj,kbOpts:{weight:100,primary:70}})}runEditorCommand(e,t){return e.get(ij).revealNext(t)}}),_d.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:tj,primary:9,handler(e){e.get(ij).reset()}});let oj=class{constructor(e){this._listener=new Map,this._disposables=new M,this._onDidChange=new q,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),E(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,N(e.onDidChangeCursorPosition((t=>this._onDidChange.fire({editor:e}))),e.onDidChangeModelContent((t=>this._onDidChange.fire({editor:e})))))}_onDidRemoveEditor(e){var t;null===(t=this._listener.get(e))||void 0===t||t.dispose(),this._listener.delete(e)}};async function sj(e,t,i,n){const o=i.ordered(e).map((i=>Promise.resolve(n(i,e,t)).then(void 0,(e=>{d(e)}))));return Pc((await Promise.all(o)).flat())}function rj(e,t,i,n){return sj(t,i,e,((e,t,i)=>e.provideDefinition(t,i,n)))}function aj(e,t,i,n){return sj(t,i,e,((e,t,i)=>e.provideDeclaration(t,i,n)))}function lj(e,t,i,n){return sj(t,i,e,((e,t,i)=>e.provideImplementation(t,i,n)))}function hj(e,t,i,n){return sj(t,i,e,((e,t,i)=>e.provideTypeDefinition(t,i,n)))}function dj(e,t,i,n,o){return sj(t,i,e,(async(e,t,i)=>{const s=await e.provideReferences(t,i,{includeDeclaration:!0},o);if(!n||!s||2!==s.length)return s;const r=await e.provideReferences(t,i,{includeDeclaration:!1},o);return r&&1===r.length?r:s}))}async function cj(e){const t=await e(),i=new _K(t,""),n=i.references.map((e=>e.link));return i.dispose(),n}var uj,gj,pj,mj,fj,_j,vj,bj;oj=JK([ej(0,dh)],oj),Kd("_executeDefinitionProvider",((e,t,i)=>{const n=rj(e.get(Jk).definitionProvider,t,i,Rt.None);return cj((()=>n))})),Kd("_executeTypeDefinitionProvider",((e,t,i)=>{const n=hj(e.get(Jk).typeDefinitionProvider,t,i,Rt.None);return cj((()=>n))})),Kd("_executeDeclarationProvider",((e,t,i)=>{const n=aj(e.get(Jk).declarationProvider,t,i,Rt.None);return cj((()=>n))})),Kd("_executeReferenceProvider",((e,t,i)=>{const n=dj(e.get(Jk).referenceProvider,t,i,!1,Rt.None);return cj((()=>n))})),Kd("_executeImplementationProvider",((e,t,i)=>{const n=lj(e.get(Jk).implementationProvider,t,i,Rt.None);return cj((()=>n))})),Ld.appendMenuItem(yd.EditorContext,{submenu:yd.EditorContextPeek,title:me(0,"Peek"),group:"navigation",order:100});class wj{static is(e){return!(!e||"object"!=typeof e)&&(e instanceof wj||!(!ch.isIPosition(e.position)||!e.model))}constructor(e,t){this.model=e,this.position=t}}class Cj extends Ud{static all(){return Cj._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of C.wrap(t.menu))i.id!==yd.EditorContext&&i.id!==yd.EditorContextPeek||(i.when=Bh.and(e.precondition,i.when));return t}constructor(e,t){super(Cj._patchConfig(t)),this.configuration=e,Cj._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,n){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(hL),s=e.get(dh),r=e.get(uL),a=e.get(ij),l=e.get(Jk),h=e.get(lh),d=t.getModel(),c=t.getPosition(),u=wj.is(i)?i:new wj(d,c),g=new oL(t,5),p=Vt(this._getLocationModel(l,u.model,u.position,g.token),g.token).then((async e=>{var o;if(!e||g.token.isCancellationRequested)return;let r;if(Zr(e.ariaMessage),e.referenceAt(d.uri,c)){const e=this._getAlternativeCommand(t);!Cj._activeAlternativeCommands.has(e)&&Cj._allSymbolNavigationCommands.has(e)&&(r=Cj._allSymbolNavigationCommands.get(e))}const l=e.references.length;if(0===l){if(!this.configuration.muteMessage){const e=d.getWordAtPosition(c);null===(o=Yx.get(t))||void 0===o||o.showMessage(this._getNoResultFoundMessage(e),c)}}else{if(1!==l||!r)return this._onResult(s,a,t,e,n);Cj._activeAlternativeCommands.add(this.desc.id),h.invokeFunction((e=>r.runEditorCommand(e,t,i,n).finally((()=>{Cj._activeAlternativeCommands.delete(this.desc.id)}))))}}),(e=>{o.error(e)})).finally((()=>{g.dispose()}));return r.showWhile(p,250),p}async _onResult(e,t,i,n,o){const s=this._getGoToPreference(i);if(i instanceof _V||!(this.configuration.openInPeek||"peek"===s&&n.references.length>1)){const r=n.firstReference(),a=n.references.length>1&&"gotoAndPeek"===s,l=await this._openReference(i,e,r,this.configuration.openToSide,!a);a&&l?this._openInPeek(l,n,o):n.dispose(),"goto"===s&&t.put(r)}else this._openInPeek(i,n,o)}async _openReference(e,t,i,n,o){let s;var r;if((r=i)&&Ro.isUri(r.uri)&&tc.isIRange(r.range)&&(tc.isIRange(r.originSelectionRange)||tc.isIRange(r.targetSelectionRange))&&(s=i.targetSelectionRange),s||(s=i.range),!s)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:tc.collapseToStart(s),selectionRevealType:3,selectionSource:"code.jump"}},e,n);if(a){if(o){const e=a.getModel(),t=a.createDecorationsCollection([{range:s,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout((()=>{a.getModel()===e&&t.clear()}),350)}return a}}_openInPeek(e,t,i){const n=QK.get(e);n&&e.hasModel()?n.toggleWidget(null!=i?i:e.getSelection(),Wt((e=>Promise.resolve(t))),this.configuration.openInPeek):t.dispose()}}Cj._allSymbolNavigationCommands=new Map,Cj._activeAlternativeCommands=new Set;class yj extends Cj{async _getLocationModel(e,t,i,n){return new _K(await rj(e.definitionProvider,t,i,n),me(0,"Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?me(0,"No definition found for '{0}'",e.word):me(0,"No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}Nd(((uj=class extends yj{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:uj.id,title:{value:me(0,"Go to Definition"),original:"Go to Definition",mnemonicTitle:me(0,"Go to &&Definition")},precondition:Bh.and(nc.hasDefinitionProvider,nc.isInWalkThroughSnippet.toNegated()),keybinding:[{when:nc.editorTextFocus,primary:70,weight:100},{when:Bh.and(nc.editorTextFocus,rU),primary:2118,weight:100}],menu:[{id:yd.EditorContext,group:"navigation",order:1.1},{id:yd.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),Ch.registerCommandAlias("editor.action.goToDeclaration",uj.id)}}).id="editor.action.revealDefinition",uj)),Nd(((gj=class extends yj{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:gj.id,title:{value:me(0,"Open Definition to the Side"),original:"Open Definition to the Side"},precondition:Bh.and(nc.hasDefinitionProvider,nc.isInWalkThroughSnippet.toNegated()),keybinding:[{when:nc.editorTextFocus,primary:vt(2089,70),weight:100},{when:Bh.and(nc.editorTextFocus,rU),primary:vt(2089,2118),weight:100}]}),Ch.registerCommandAlias("editor.action.openDeclarationToTheSide",gj.id)}}).id="editor.action.revealDefinitionAside",gj)),Nd(((pj=class extends yj{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:pj.id,title:{value:me(0,"Peek Definition"),original:"Peek Definition"},precondition:Bh.and(nc.hasDefinitionProvider,iz.notInPeekEditor,nc.isInWalkThroughSnippet.toNegated()),keybinding:{when:nc.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:yd.EditorContextPeek,group:"peek",order:2}}),Ch.registerCommandAlias("editor.action.previewDeclaration",pj.id)}}).id="editor.action.peekDefinition",pj));class Sj extends Cj{async _getLocationModel(e,t,i,n){return new _K(await aj(e.declarationProvider,t,i,n),me(0,"Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?me(0,"No declaration found for '{0}'",e.word):me(0,"No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}Nd(((mj=class extends Sj{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:mj.id,title:{value:me(0,"Go to Declaration"),original:"Go to Declaration",mnemonicTitle:me(0,"Go to &&Declaration")},precondition:Bh.and(nc.hasDeclarationProvider,nc.isInWalkThroughSnippet.toNegated()),menu:[{id:yd.EditorContext,group:"navigation",order:1.3},{id:yd.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?me(0,"No declaration found for '{0}'",e.word):me(0,"No declaration found")}}).id="editor.action.revealDeclaration",mj)),Nd(class extends Sj{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:me(0,"Peek Declaration"),original:"Peek Declaration"},precondition:Bh.and(nc.hasDeclarationProvider,iz.notInPeekEditor,nc.isInWalkThroughSnippet.toNegated()),menu:{id:yd.EditorContextPeek,group:"peek",order:3}})}});class kj extends Cj{async _getLocationModel(e,t,i,n){return new _K(await hj(e.typeDefinitionProvider,t,i,n),me(0,"Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?me(0,"No type definition found for '{0}'",e.word):me(0,"No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}Nd(((fj=class extends kj{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:fj.ID,title:{value:me(0,"Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:me(0,"Go to &&Type Definition")},precondition:Bh.and(nc.hasTypeDefinitionProvider,nc.isInWalkThroughSnippet.toNegated()),keybinding:{when:nc.editorTextFocus,primary:0,weight:100},menu:[{id:yd.EditorContext,group:"navigation",order:1.4},{id:yd.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}}).ID="editor.action.goToTypeDefinition",fj)),Nd(((_j=class extends kj{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:_j.ID,title:{value:me(0,"Peek Type Definition"),original:"Peek Type Definition"},precondition:Bh.and(nc.hasTypeDefinitionProvider,iz.notInPeekEditor,nc.isInWalkThroughSnippet.toNegated()),menu:{id:yd.EditorContextPeek,group:"peek",order:4}})}}).ID="editor.action.peekTypeDefinition",_j));class Lj extends Cj{async _getLocationModel(e,t,i,n){return new _K(await lj(e.implementationProvider,t,i,n),me(0,"Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?me(0,"No implementation found for '{0}'",e.word):me(0,"No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}Nd(((vj=class extends Lj{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:vj.ID,title:{value:me(0,"Go to Implementations"),original:"Go to Implementations",mnemonicTitle:me(0,"Go to &&Implementations")},precondition:Bh.and(nc.hasImplementationProvider,nc.isInWalkThroughSnippet.toNegated()),keybinding:{when:nc.editorTextFocus,primary:2118,weight:100},menu:[{id:yd.EditorContext,group:"navigation",order:1.45},{id:yd.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}}).ID="editor.action.goToImplementation",vj)),Nd(((bj=class extends Lj{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:bj.ID,title:{value:me(0,"Peek Implementations"),original:"Peek Implementations"},precondition:Bh.and(nc.hasImplementationProvider,iz.notInPeekEditor,nc.isInWalkThroughSnippet.toNegated()),keybinding:{when:nc.editorTextFocus,primary:3142,weight:100},menu:{id:yd.EditorContextPeek,group:"peek",order:5}})}}).ID="editor.action.peekImplementation",bj));class xj extends Cj{_getNoResultFoundMessage(e){return e?me(0,"No references found for '{0}'",e.word):me(0,"No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}Nd(class extends xj{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:me(0,"Go to References"),original:"Go to References",mnemonicTitle:me(0,"Go to &&References")},precondition:Bh.and(nc.hasReferenceProvider,iz.notInPeekEditor,nc.isInWalkThroughSnippet.toNegated()),keybinding:{when:nc.editorTextFocus,primary:1094,weight:100},menu:[{id:yd.EditorContext,group:"navigation",order:1.45},{id:yd.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,n){return new _K(await dj(e.referenceProvider,t,i,!0,n),me(0,"References"))}}),Nd(class extends xj{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:me(0,"Peek References"),original:"Peek References"},precondition:Bh.and(nc.hasReferenceProvider,iz.notInPeekEditor,nc.isInWalkThroughSnippet.toNegated()),menu:{id:yd.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,n){return new _K(await dj(e.referenceProvider,t,i,!1,n),me(0,"References"))}});class Dj extends Cj{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:{value:me(0,"Go to Any Symbol"),original:"Go to Any Symbol"},precondition:Bh.and(iz.notInPeekEditor,nc.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,n){return new _K(this._references,me(0,"Locations"))}_getNoResultFoundMessage(e){return e&&me(0,"No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return null!==(t=this._gotoMultipleBehaviour)&&void 0!==t?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}Ch.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:Ro},{name:"position",description:"The position at which to start",constraint:ch.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:async(e,t,i,n,o,s,r)=>{fl(Ro.isUri(t)),fl(ch.isIPosition(i)),fl(Array.isArray(n)),fl(void 0===o||"string"==typeof o),fl(void 0===r||"boolean"==typeof r);const a=e.get(dh),l=await a.openCodeEditor({resource:t},a.getFocusedCodeEditor());if(uz(l))return l.setPosition(i),l.revealPositionInCenterIfOutsideViewport(i,0),l.invokeWithinContext((e=>{const t=new class extends Dj{_getNoResultFoundMessage(e){return s||super._getNoResultFoundMessage(e)}}({muteMessage:!Boolean(s),openInPeek:Boolean(r),openToSide:!1},n,o);e.get(lh).invokeFunction(t.run.bind(t),l)}))}}),Ch.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:Ro},{name:"position",description:"The position at which to start",constraint:ch.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:async(e,t,i,n,o)=>{e.get(wh).executeCommand("editor.action.goToLocations",t,i,n,o,void 0,!0)}}),Ch.registerCommand({id:"editor.action.findReferences",handler:(e,t,i)=>{fl(Ro.isUri(t)),fl(ch.isIPosition(i));const n=e.get(Jk),o=e.get(dh);return o.openCodeEditor({resource:t},o.getFocusedCodeEditor()).then((e=>{if(!uz(e)||!e.hasModel())return;const t=QK.get(e);if(!t)return;const o=Wt((t=>dj(n.referenceProvider,e.getModel(),ch.lift(i),!1,t).then((e=>new _K(e,me(0,"References")))))),s=new tc(i.lineNumber,i.column,i.lineNumber,i.column);return Promise.resolve(t.toggleWidget(s,o,!1))}))}}),Ch.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var Ej,Nj=function(e,t){return function(i,n){t(i,n,e)}};let Ij=Ej=class{constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new M,this.toUnhookForKeyboard=new M,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new aR(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown((([e,t])=>{this.startFindDefinitionFromMouse(e,null!=t?t:void 0)}))),this.toUnhook.add(o.onExecute((e=>{this.isEnabled(e)&&this.gotoDefinition(e.target.position,e.hasSideBySideModifier).catch((e=>{h(e)})).finally((()=>{this.removeLinkDecorations()}))}))),this.toUnhook.add(o.onCancel((()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null})))}static get(e){return e.getContribution(Ej.ID)}async startFindDefinitionFromCursor(e){await this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition((()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()}))),this.toUnhookForKeyboard.add(this.editor.onKeyDown((e=>{e&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())})))}startFindDefinitionFromMouse(e,t){if(9===e.target.type&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t))return this.currentWordAtPosition=null,void this.removeLinkDecorations();const i=e.target.position;this.startFindDefinition(i)}async startFindDefinition(e){var t;this.toUnhookForKeyboard.clear();const i=e?null===(t=this.editor.getModel())||void 0===t?void 0:t.getWordAtPosition(e):null;if(!i)return this.currentWordAtPosition=null,void this.removeLinkDecorations();if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return;this.currentWordAtPosition=i;const n=new nL(this.editor,15);let o;this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Wt((t=>this.findDefinition(e,t)));try{o=await this.previousPromise}catch(e){return void h(e)}if(!o||!o.length||!n.validate(this.editor))return void this.removeLinkDecorations();const s=o[0].originSelectionRange?tc.lift(o[0].originSelectionRange):new tc(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(o.length>1){let e=s;for(const{originSelectionRange:t}of o)t&&(e=tc.plusRange(e,t));this.addDecoration(e,(new eh).appendText(me(0,"Click to show {0} definitions.",o.length)))}else{const e=o[0];if(!e.uri)return;this.textModelResolverService.createModelReference(e.uri).then((t=>{if(!t.object||!t.object.textEditorModel)return void t.dispose();const{object:{textEditorModel:i}}=t,{startLineNumber:n}=e.range;if(n<1||n>i.getLineCount())return void t.dispose();const o=this.getPreviewValue(i,n,e),r=this.languageService.guessLanguageIdByFilepathOrFirstLine(i.uri);this.addDecoration(s,o?(new eh).appendCodeblock(r||"",o):void 0),t.dispose()}))}}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=Ej.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let n=e.getLineFirstNonWhitespaceColumn(t);for(let o=t+1;o<i.endLineNumber;o++){const t=e.getLineFirstNonWhitespaceColumn(o);n=Math.min(n,t)}return e.getValueInRange(i).replace(new RegExp(`^\\s{${n-1}}`,"gm"),"").trim()}getPreviewRangeBasedOnIndentation(e,t){const i=e.getLineFirstNonWhitespaceColumn(t),n=Math.min(e.getLineCount(),t+Ej.MAX_SOURCE_PREVIEW_LINES);let o=t+1;for(;o<n&&i!==e.getLineFirstNonWhitespaceColumn(o);o++);return new tc(t,1,o+1,1)}addDecoration(e,t){const i={range:e,options:{description:"goto-definition-link",inlineClassName:"goto-definition-link",hoverMessage:t}};this.linkDecorations.set([i])}removeLinkDecorations(){this.linkDecorations.clear()}isEnabled(e,t){var i;return this.editor.hasModel()&&e.isLeftClick&&e.isNoneOrSingleMouseDown&&6===e.target.type&&!((null===(i=e.target.detail.injectedText)||void 0===i?void 0:i.options)instanceof yy)&&(e.hasTriggerModifier||!!t&&t.keyCodeIsTriggerKey)&&this.languageFeaturesService.definitionProvider.has(this.editor.getModel())}findDefinition(e,t){const i=this.editor.getModel();return i?rj(this.languageFeaturesService.definitionProvider,i,e,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext((e=>{const i=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(e);return new yj({openToSide:t,openInPeek:i,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(e)}))}isInPeekEditor(e){const t=e.get(sd);return iz.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};Ij.ID="editor.contrib.gotodefinitionatposition",Ij.MAX_SOURCE_PREVIEW_LINES=8,Ij=Ej=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Nj(1,gh),Nj(2,yu),Nj(3,Jk)],Ij),Gd(Ij.ID,Ij,2);var Mj=i(3039),Tj={};Tj.styleTagTransform=Vr(),Tj.setAttributes=Pr(),Tj.insert=Rr().bind(null,"head"),Tj.domAPI=Tr(),Tj.insertStyleElement=Br(),Ir()(Mj.Z,Tj),Mj.Z&&Mj.Z.locals&&Mj.Z.locals;const Aj=mr;class Rj extends T{constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new ND(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class Oj extends T{static render(e,t,i){return new Oj(e,t,i)}constructor(e,t,i){super(),this.actionContainer=hr(e,Aj("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=hr(this.actionContainer,Aj("a.action")),this.action.setAttribute("role","button"),t.iconClass&&hr(this.action,Aj(`span.icon.${t.iconClass}`)),hr(this.action,Aj("span")).textContent=i?`${t.label} (${i})`:t.label,this._register(bs(this.actionContainer,or.CLICK,(e=>{e.stopPropagation(),e.preventDefault(),t.run(this.actionContainer)}))),this._register(bs(this.actionContainer,or.KEY_DOWN,(e=>{const i=new Dt(e);(i.equals(3)||i.equals(10))&&(e.stopPropagation(),e.preventDefault(),t.run(this.actionContainer))}))),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}class Pj{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}}class Fj extends T{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new q),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new Zt((()=>this._triggerAsyncComputation()),0)),this._secondWaitScheduler=this._register(new Zt((()=>this._triggerSyncComputation()),0)),this._loadingMessageScheduler=this._register(new Zt((()=>this._triggerLoadingMessage()),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),super.dispose()}get _hoverTime(){return this._editor.getOption(60).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t=!0){this._state=e,t&&this._fireResult()}_triggerAsyncComputation(){this._setState(2),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=function(e){const t=new Pt,i=e(t.token);return new ni(t,(async e=>{const n=t.token.onCancellationRequested((()=>{n.dispose(),t.dispose(),e.reject(new p)}));try{for await(const n of i){if(t.token.isCancellationRequested)return;e.emitOne(n)}n.dispose(),t.dispose()}catch(i){n.dispose(),t.dispose(),e.reject(i)}}))}((e=>this._computer.computeAsync(e))),(async()=>{try{for await(const e of this._asyncIterable)e&&(this._result.push(e),this._fireResult());this._asyncIterableDone=!0,3!==this._state&&4!==this._state||this._setState(0)}catch(e){h(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?0:3)}_triggerLoadingMessage(){3===this._state&&this._setState(4)}_fireResult(){if(1===this._state||2===this._state)return;const e=0===this._state,t=4===this._state;this._onResult.fire(new Pj(this._result.slice(0),e,t))}start(e){if(0===e)0===this._state&&(this._setState(1),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation()}}cancel(){this._firstWaitScheduler.cancel(),this._secondWaitScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._setState(0,!1)}}class Bj{constructor(e,t,i,n){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=n,this.type=1}equals(e){return 1===e.type&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return 1===e.type&&t.lineNumber===this.range.startLineNumber}}class Wj{constructor(e,t,i,n,o,s){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=n,this.initialMousePosY=o,this.supportsMarkerHover=s,this.type=2}equals(e){return 2===e.type&&this.owner===e.owner}canAdoptVisibleHover(e,t){return 2===e.type&&this.owner===e.owner}}const Vj=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class zj{constructor(){let e;this._onDidWillResize=new q,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new q,this.onDidResize=this._onDidResize.event,this._sashListener=new M,this._size=new Ms(0,0),this._minSize=new Ms(0,0),this._maxSize=new Ms(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new EV(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new EV(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new EV(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:wV.North}),this._southSash=new EV(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:wV.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let t=0,i=0;this._sashListener.add(z.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)((()=>{void 0===e&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)}))),this._sashListener.add(z.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)((()=>{void 0!==e&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))}))),this._sashListener.add(this._eastSash.onDidChange((n=>{e&&(i=n.currentX-n.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))}))),this._sashListener.add(this._westSash.onDidChange((n=>{e&&(i=-(n.currentX-n.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))}))),this._sashListener.add(this._northSash.onDidChange((n=>{e&&(t=-(n.currentY-n.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))}))),this._sashListener.add(this._southSash.onDidChange((n=>{e&&(t=n.currentY-n.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))}))),this._sashListener.add(z.any(this._eastSash.onDidReset,this._westSash.onDidReset)((e=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))),this._sashListener.add(z.any(this._northSash.onDidReset,this._southSash.onDidReset)((e=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))})))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,n){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=n?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:n}=this._minSize,{height:o,width:s}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(n,Math.min(s,t));const r=new Ms(t,e);Ms.equals(r,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=r,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}class Hj extends T{constructor(e,t=new Ms(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new zj),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Ms.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize((e=>{this._resize(new Ms(e.dimension.width,e.dimension.height)),e.done&&(this._isResizing=!1)}))),this._register(this._resizableNode.onDidWillResize((()=>{this._isResizing=!0})))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return(null===(e=this._contentPosition)||void 0===e?void 0:e.position)?ch.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(t&&i)return As(t).top+i.top-30}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=As(t),o=Ns(t.ownerDocument.body),s=n.top+i.top+i.height;return o.height-s-24}_findPositionPreference(e,t){var i,n;const o=Math.min(null!==(i=this._availableVerticalSpaceBelow(t))&&void 0!==i?i:1/0,e),s=Math.min(null!==(n=this._availableVerticalSpaceAbove(t))&&void 0!==n?n:1/0,e),r=Math.min(Math.max(s,o),e),a=Math.min(e,r);let l;return l=this._editor.getOption(60).above?a<=s?1:2:a<=o?2:1,1===l?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),l}_resize(e){this._resizableNode.layout(e.height,e.width)}}var Uj,Kj,jj=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},qj=function(e,t){return function(i,n){t(i,n,e)}};const $j=mr;let Gj=Uj=class extends T{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(Xj,this._editor)),this._participants=[];for(const e of Vj.getAll())this._participants.push(this._instantiationService.createInstance(e,this._editor));this._participants.sort(((e,t)=>e.hoverOrdinal-t.hoverOrdinal)),this._computer=new eq(this._editor,this._participants),this._hoverOperation=this._register(new Fj(this._editor,this._computer)),this._register(this._hoverOperation.onResult((e=>{if(!this._computer.anchor)return;const t=e.hasLoadingMessage?this._addLoadingMessage(e.value):e.value;this._withResult(new Zj(this._computer.anchor,t,e.isComplete))}))),this._register(Cs(this._widget.getDomNode(),"keydown",(e=>{e.equals(9)&&this.hide()}))),this._register(SC.onDidChange((()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)})))}get widget(){return this._widget}maybeShowAt(e){if(this._widget.isResizing)return!0;const t=[];for(const i of this._participants)if(i.suggestHoverAnchor){const n=i.suggestHoverAnchor(e);n&&t.push(n)}const i=e.target;if(6===i.type&&t.push(new Bj(0,i.range,e.event.posx,e.event.posy)),7===i.type){const n=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&"number"==typeof i.detail.horizontalDistanceToText&&i.detail.horizontalDistanceToText<n&&t.push(new Bj(0,i.range,e.event.posx,e.event.posy))}return 0===t.length?this._startShowingOrUpdateHover(null,0,0,!1,e):(t.sort(((e,t)=>t.priority-e.priority)),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,n){this._startShowingOrUpdateHover(new Bj(0,e,void 0,void 0),t,i,n,null)}_startShowingOrUpdateHover(e,t,i,n,o){return this._widget.position&&this._currentResult?this._editor.getOption(60).sticky&&o&&this._widget.isMouseGettingCloser(o.event.posx,o.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,n,!0),!0):e?!(!e||!this._currentResult.anchor.equals(e))||(e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0)):(this._setCurrentResult(null),!1):!!e&&(this._startHoverOperationIfNecessary(e,t,i,n,!1),!0)}_startHoverOperationIfNecessary(e,t,i,n,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=n,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&0===e.messages.length&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}containsNode(e){return!!e&&this._widget.getDomNode().contains(e)}_addLoadingMessage(e){if(this._computer.anchor)for(const t of this._participants)if(t.createLoadingMessage){const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}return e}_withResult(e){if(this._widget.position&&this._currentResult&&this._currentResult.isComplete){if(!e.isComplete)return;if(this._computer.insistOnKeepingHoverVisible&&0===e.messages.length)return}this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:i,showAtSecondaryPosition:n,highlightRange:o}=Uj.computeHoverRanges(this._editor,e.range,t),s=new M,r=s.add(new Jj(this._keybindingService)),a=document.createDocumentFragment();let l=null;const h={fragment:a,statusBar:r,setColorPicker:e=>l=e,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:e=>this._widget.setMinimumDimensions(e),hide:()=>this.hide()};for(const e of this._participants){const i=t.filter((t=>t.owner===e));i.length>0&&s.add(e.renderHoverParts(h,i))}const d=t.some((e=>e.isBeforeContent));if(r.hasContent&&a.appendChild(r.hoverElement),a.hasChildNodes()){if(o){const e=this._editor.createDecorationsCollection();e.set([{range:o,options:Uj._DECORATION_OPTIONS}]),s.add(I((()=>{e.clear()})))}this._widget.showAt(a,new Qj(l,i,n,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,d,e.initialMousePosX,e.initialMousePosY,s))}else s.dispose()}static computeHoverRanges(e,t,i){let n=1;if(e.hasModel()){const i=e._getViewModel(),o=i.coordinatesConverter,s=o.convertModelRangeToViewRange(t),r=new ch(s.startLineNumber,i.getLineMinColumn(s.startLineNumber));n=o.convertViewPositionToModelPosition(r).column}const o=t.startLineNumber;let s=t.startColumn,r=i[0].range,a=null;for(const e of i)r=tc.plusRange(r,e.range),e.range.startLineNumber===o&&e.range.endLineNumber===o&&(s=Math.max(Math.min(s,e.range.startColumn),n)),e.forceShowAtRange&&(a=e.range);return{showAtPosition:a?a.getStartPosition():new ch(o,t.startColumn),showAtSecondaryPosition:a?a.getStartPosition():new ch(o,s),highlightRange:r}}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}};Gj._DECORATION_OPTIONS=Sy.register({description:"content-hover-highlight",className:"hoverHighlight"}),Gj=Uj=jj([qj(1,lh),qj(2,ML)],Gj);class Zj{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){const t=this.messages.filter((t=>t.isValidForHoverAnchor(e)));return t.length===this.messages.length?this:new Yj(this,this.anchor,t,this.isComplete)}}class Yj extends Zj{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}}class Qj{constructor(e,t,i,n,o,s,r,a,l,h){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=i,this.preferAbove=n,this.stoleFocus=o,this.source=s,this.isBeforeContent=r,this.initialMousePosX=a,this.initialMousePosY=l,this.disposables=h,this.closestMouseDistance=void 0}}let Xj=Kj=class extends Hj{get isColorPickerVisible(){var e;return Boolean(null===(e=this._visibleData)||void 0===e?void 0:e.colorPicker)}get isVisibleFromKeyboard(){var e;return 1===(null===(e=this._visibleData)||void 0===e?void 0:e.source)}get isVisible(){var e;return null!==(e=this._hoverVisibleKey.get())&&void 0!==e&&e}get isFocused(){var e;return null!==(e=this._hoverFocusedKey.get())&&void 0!==e&&e}constructor(e,t,i,n,o){const s=e.getOption(66)+8,r=new Ms(150,s);super(e,r),this._configurationService=i,this._accessibilityService=n,this._keybindingService=o,this._hover=this._register(new Rj),this._minimumSize=r,this._hoverVisibleKey=nc.hoverVisible.bindTo(t),this._hoverFocusedKey=nc.hoverFocused.bindTo(t),hr(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange((()=>{this.isVisible&&this._updateMaxDimensions()}))),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(50)&&this._updateFont()})));const a=this._register(lr(this._resizableNode.domNode));this._register(a.onDidFocus((()=>{this._hoverFocusedKey.set(!0)}))),this._register(a.onDidBlur((()=>{this._hoverFocusedKey.set(!1)}))),this._setHoverData(void 0),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),null===(e=this._visibleData)||void 0===e||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return Kj.ID}static _applyDimensions(e,t,i){const n="number"==typeof t?`${t}px`:t,o="number"==typeof i?`${i}px`:i;e.style.width=n,e.style.height=o}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return Kj._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return Kj._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const n="number"==typeof t?`${t}px`:t,o="number"==typeof i?`${i}px`:i;e.style.maxWidth=n,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){Kj._applyMaxDimensions(this._hover.contentsDomNode,e,t),Kj._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth","number"==typeof e?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,i-10))}_updateResizableNodeMaxDimensions(){var e,t;const i=null!==(e=this._findMaximumRenderingWidth())&&void 0!==e?e:1/0,n=null!==(t=this._findMaximumRenderingHeight())&&void 0!==t?t:1/0;this._resizableNode.maxSize=new Ms(i,n),this._setHoverWidgetMaxDimensions(i,n)}_resize(e){var t,i;Kj._lastDimensions=new Ms(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),null===(i=null===(t=this._visibleData)||void 0===t?void 0:t.colorPicker)||void 0===i||i.layout()}_findAvailableSpaceVertically(){var e;const t=null===(e=this._visibleData)||void 0===e?void 0:e.showAtPosition;if(t)return 1===this._positionPreference?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=6;return Array.from(this._hover.contentsDomNode.children).forEach((e=>{t+=e.clientHeight})),this._hasHorizontalScrollbar()&&(t+=10),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some((e=>e.scrollWidth>e.clientWidth));return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=void 0===this._contentWidth?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth<t?Ns(this._hover.containerDomNode.ownerDocument.body).width-14:this._hover.containerDomNode.clientWidth+2}isMouseGettingCloser(e,t){if(!this._visibleData)return!1;if(void 0===this._visibleData.initialMousePosX||void 0===this._visibleData.initialMousePosY)return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const i=As(this.getDomNode());void 0===this._visibleData.closestMouseDistance&&(this._visibleData.closestMouseDistance=tq(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const n=tq(e,t,i.left,i.top,i.width,i.height);return!(n>this._visibleData.closestMouseDistance+4||(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,n),0))}_setHoverData(e){var t;null===(t=this._visibleData)||void 0===t||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=""+t/e,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach((e=>this._editor.applyFontInfo(e)))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,Kj._lastDimensions.height),t=Math.max(.66*this._editor.getLayoutInfo().width,500,Kj._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[null!==(e=this._positionPreference)&&void 0!==e?e:1]}:null}showAt(e,t){var i,n,o,s;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const r=Fs(this._hover.containerDomNode),a=t.showAtPosition;this._positionPreference=null!==(i=this._findPositionPreference(r,a))&&void 0!==i?i:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),null===(n=t.colorPicker)||void 0===n||n.layout();const l=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&(h=!0===this._configurationService.getValue("accessibility.verbosity.hover")&&this._accessibilityService.isScreenReaderOptimized(),d=null!==(s=null===(o=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))||void 0===o?void 0:o.getAriaLabel())&&void 0!==s?s:"",h&&d?me(0,"Inspect this in the accessible view with {0}.",d):h?me(0,"Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):"");var h,d;l&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+l)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new Ms(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}_adjustHoverHeightForScrollbar(e){var t;const i=this._hover.containerDomNode,n=this._hover.contentsDomNode,o=null!==(t=this._findMaximumRenderingHeight())&&void 0!==t?t:1/0;this._setContainerDomNodeDimensions(Rs(i),Math.min(o,e)),this._setContentsDomNodeDimensions(Rs(n),Math.min(o,e-10))}setMinimumDimensions(e){this._minimumSize=new Ms(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=void 0===this._contentWidth?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Ms(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let i=Fs(t),n=Rs(t);if(this._resizableNode.layout(i,n),this._setHoverWidgetDimensions(n,i),i=Fs(t),n=Rs(t),this._contentWidth=n,this._updateMinimumWidth(),this._resizableNode.layout(i,n),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(i)),null===(e=this._visibleData)||void 0===e?void 0:e.showAtPosition){const e=Fs(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(e,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-30})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+30})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};Xj.ID="editor.contrib.resizableContentHoverWidget",Xj._lastDimensions=new Ms(0,0),Xj=Kj=jj([qj(1,sd),qj(2,ug),qj(3,BS),qj(4,ML)],Xj);let Jj=class extends T{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=$j("div.hover-row.status-bar"),this.actionsElement=hr(this.hoverElement,$j("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(Oj.render(this.actionsElement,e,i))}append(e){const t=hr(this.actionsElement,e);return this._hasContent=!0,t}};Jj=jj([qj(0,ML)],Jj);class eq{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(1!==t.type&&!t.supportsMarkerHover)return[];const i=e.getModel(),n=t.range.startLineNumber;if(n>i.getLineCount())return[];const o=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter((e=>{if(e.options.isWholeLine)return!0;const i=e.range.startLineNumber===n?e.range.startColumn:1,s=e.range.endLineNumber===n?e.range.endColumn:o;if(e.options.showIfCollapsed){if(i>t.range.startColumn+1||t.range.endColumn-1>s)return!1}else if(i>t.range.startColumn||t.range.endColumn>s)return!1;return!0}))}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return ii.EMPTY;const i=eq._getLineDecorations(this._editor,t);return ii.merge(this._participants.map((n=>n.computeAsync?n.computeAsync(t,i,e):ii.EMPTY)))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=eq._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Pc(t)}}function tq(e,t,i,n,o,s){const r=i+o/2,a=n+s/2,l=Math.max(Math.abs(e-r)-o/2,0),h=Math.max(Math.abs(t-a)-s/2,0);return Math.sqrt(l*l+h*h)}const iq=mr;class nq extends T{constructor(e,t,i){super(),this._renderDisposeables=this._register(new M),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new Rj),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new jx({editor:this._editor},t,i)),this._computer=new oq(this._editor),this._hoverOperation=this._register(new Fj(this._editor,this._computer)),this._register(this._hoverOperation.onResult((e=>{this._withResult(e.value)}))),this._register(this._editor.onDidChangeModelDecorations((()=>this._onModelDecorationsChanged()))),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(50)&&this._updateFont()}))),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return nq.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach((e=>this._editor.applyFontInfo(e)))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e){this._computer.lineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._hoverOperation.start(0))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const i=document.createDocumentFragment();for(const e of t){const t=iq("div.hover-row.markdown-hover"),n=hr(t,iq("div.hover-contents")),o=this._renderDisposeables.add(this._markdownRenderer.render(e.value));n.appendChild(o.element),i.appendChild(t)}this._updateContents(i),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(e),n=this._editor.getScrollTop(),o=this._editor.getOption(66),s=i-n-(this._hover.containerDomNode.clientHeight-o)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(s),0)}px`}}nq.ID="editor.contrib.modesGlyphHoverWidget";class oq{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=e=>({value:e}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(const n of t){if(!n.options.glyphMarginClassName)continue;const t=n.options.glyphMarginHoverMessage;t&&!th(t)&&i.push(...$c(t).map(e))}return i}}class sq{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}function rq(e,t,i,n){const o=e.ordered(t).map(((e,o)=>async function(e,t,i,n,o){try{const s=await Promise.resolve(e.provideHover(i,n,o));if(s&&function(e){const t=void 0!==e.range,i=void 0!==e.contents&&e.contents&&e.contents.length>0;return t&&i}(s))return new sq(e,s,t)}catch(e){d(e)}}(e,o,t,i,n)));return ii.fromPromises(o).coalesce()}Kd("_executeHoverProvider",((e,t,i)=>function(e,t,i,n){return rq(e,t,i,n).map((e=>e.hover)).toPromise()}(e.get(Jk).hoverProvider,t,i,Rt.None)));var aq=function(e,t){return function(i,n){t(i,n,e)}};const lq=mr;class hq{constructor(e,t,i,n,o){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=n,this.ordinal=o}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let dq=class{constructor(e,t,i,n,o){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=n,this._languageFeaturesService=o,this.hoverOrdinal=3}createLoadingMessage(e){return new hq(this,e.range,[(new eh).appendText(me(0,"Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||1!==e.type)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,o=i.getLineMaxColumn(n),s=[];let r=1e3;const a=i.getLineLength(n),l=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),h=this._editor.getOption(116),d=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:l});let c=!1;h>=0&&a>h&&e.range.startColumn>=h&&(c=!0,s.push(new hq(this,e.range,[{value:me(0,"Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,r++))),!c&&"number"==typeof d&&a>=d&&s.push(new hq(this,e.range,[{value:me(0,"Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,r++));let u=!1;for(const i of t){const t=i.range.startLineNumber===n?i.range.startColumn:1,a=i.range.endLineNumber===n?i.range.endColumn:o,l=i.options.hoverMessage;if(!l||th(l))continue;i.options.beforeContentClassName&&(u=!0);const h=new tc(e.range.startLineNumber,t,e.range.startLineNumber,a);s.push(new hq(this,h,$c(l),u,r++))}return s}computeAsync(e,t,i){if(!this._editor.hasModel()||1!==e.type)return ii.EMPTY;const n=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(n))return ii.EMPTY;const o=new ch(e.range.startLineNumber,e.range.startColumn);return rq(this._languageFeaturesService.hoverProvider,n,o,i).filter((e=>!th(e.hover.contents))).map((t=>{const i=t.hover.range?tc.lift(t.hover.range):e.range;return new hq(this,i,t.hover.contents,!1,t.ordinal)}))}renderHoverParts(e,t){return cq(e,t,this._editor,this._languageService,this._openerService)}};function cq(e,t,i,n,o){t.sort(((e,t)=>e.ordinal-t.ordinal));const s=new M;for(const r of t)for(const t of r.contents){if(th(t))continue;const r=lq("div.hover-row.markdown-hover"),a=hr(r,lq("div.hover-contents")),l=s.add(new jx({editor:i},n,o));s.add(l.onDidRenderAsync((()=>{a.className="hover-contents code-hover-contents",e.onContentsChanged()})));const h=s.add(l.render(t));a.appendChild(h.element),e.fragment.appendChild(r)}return s}dq=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([aq(1,yu),aq(2,Hx),aq(3,ug),aq(4,Jk)],dq);var uq=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},gq=function(e,t){return function(i,n){t(i,n,e)}};class pq{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let mq=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new q,this.onDidChange=this._onDidChange.event,this._dispoables=new M,this._markers=[],this._nextIdx=-1,Ro.isUri(e)?this._resourceFilter=t=>t.toString()===e.toString():e&&(this._resourceFilter=e);const n=this._configService.getValue("problems.sortOrder"),o=(e,t)=>{let i=bn(e.resource.toString(),t.resource.toString());return 0===i&&(i="position"===n?tc.compareRangesUsingStarts(e,t)||yN.compare(e.severity,t.severity):yN.compare(e.severity,t.severity)||tc.compareRangesUsingStarts(e,t)),i},s=()=>{this._markers=this._markerService.read({resource:Ro.isUri(e)?e:void 0,severities:yN.Error|yN.Warning|yN.Info}),"function"==typeof e&&(this._markers=this._markers.filter((e=>this._resourceFilter(e.resource)))),this._markers.sort(o)};s(),this._dispoables.add(t.onMarkerChanged((e=>{this._resourceFilter&&!e.some((e=>this._resourceFilter(e)))||(s(),this._nextIdx=-1,this._onDidChange.fire())})))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e||!(!this._resourceFilter||!e)&&this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new pq(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=!1,o=this._markers.findIndex((t=>t.resource.toString()===e.uri.toString()));o<0&&(o=Mc(this._markers,{resource:e.uri},((e,t)=>bn(e.resource.toString(),t.resource.toString()))),o<0&&(o=~o));for(let i=o;i<this._markers.length;i++){let o=tc.lift(this._markers[i]);if(o.isEmpty()){const t=e.getWordAtPosition(o.getStartPosition());t&&(o=new tc(o.startLineNumber,t.startColumn,o.startLineNumber,t.endColumn))}if(t&&(o.containsPosition(t)||t.isBeforeOrEqual(o.getStartPosition()))){this._nextIdx=i,n=!0;break}if(this._markers[i].resource.toString()!==e.uri.toString())break}n||(this._nextIdx=i?0:this._markers.length-1),this._nextIdx<0&&(this._nextIdx=this._markers.length-1)}resetIndex(){this._nextIdx=-1}move(e,t,i){if(0===this._markers.length)return!1;const n=this._nextIdx;return-1===this._nextIdx?this._initIdx(t,i,e):e?this._nextIdx=(this._nextIdx+1)%this._markers.length:e||(this._nextIdx=(this._nextIdx-1+this._markers.length)%this._markers.length),n!==this._nextIdx}find(e,t){let i=this._markers.findIndex((t=>t.resource.toString()===e.toString()));if(!(i<0))for(;i<this._markers.length;i++)if(tc.containsPosition(this._markers[i],t))return new pq(this._markers[i],i+1,this._markers.length)}};mq=uq([gq(1,kN),gq(2,ug)],mq);const fq=hh("IMarkerNavigationService");let _q=class{constructor(e,t){this._markerService=e,this._configService=t,this._provider=new B}getMarkerList(e){for(const t of this._provider){const i=t.getMarkerList(e);if(i)return i}return new mq(e,this._markerService,this._configService)}};_q=uq([gq(0,kN),gq(1,ug)],_q),wg(fq,_q,1);var vq=i(5351),bq={};bq.styleTagTransform=Vr(),bq.setAttributes=Pr(),bq.insert=Rr().bind(null,"head"),bq.domAPI=Tr(),bq.insertStyleElement=Br(),Ir()(vq.Z,bq),vq.Z&&vq.Z.locals&&vq.Z.locals;var wq,Cq=i(1050),yq={};yq.styleTagTransform=Vr(),yq.setAttributes=Pr(),yq.insert=Rr().bind(null,"head"),yq.domAPI=Tr(),yq.insertStyleElement=Br(),Ir()(Cq.Z,yq),Cq.Z&&Cq.Z.locals&&Cq.Z.locals,function(e){e.className=function(e){switch(e){case aL.Ignore:return"severity-ignore "+Ll.asClassName(Sl.info);case aL.Info:return Ll.asClassName(Sl.info);case aL.Warning:return Ll.asClassName(Sl.warning);case aL.Error:return Ll.asClassName(Sl.error);default:return""}}}(wq||(wq={}));var Sq,kq=function(e,t){return function(i,n){t(i,n,e)}};class Lq{constructor(e,t,i,n,o){this._openerService=n,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new M,this._editor=t;const s=document.createElement("div");s.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),s.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),s.appendChild(this._relatedBlock),this._disposables.add(Cs(this._relatedBlock,"click",(e=>{e.preventDefault();const t=this._relatedDiagnostics.get(e.target);t&&i(t)}))),this._scrollable=new DD(s,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll((e=>{s.style.left=`-${e.scrollLeft}px`,s.style.top=`-${e.scrollTop}px`}))),this._disposables.add(this._scrollable)}dispose(){E(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:o}=e;let s=((null==t?void 0:t.length)||0)+2;o&&(s+="string"==typeof o?o.length:o.value.length);const r=mn(i);this._lines=r.length,this._longestLineLength=0;for(const e of r)this._longestLineLength=Math.max(e.length+s,this._longestLineLength);_s(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let a=this._messageBlock;for(const e of r)a=document.createElement("div"),a.innerText=e,""===e&&(a.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(a);if(t||o){const e=document.createElement("span");if(e.classList.add("details"),a.appendChild(e),t){const i=document.createElement("span");i.innerText=t,i.classList.add("source"),e.appendChild(i)}if(o)if("string"==typeof o){const t=document.createElement("span");t.innerText=`(${o})`,t.classList.add("code"),e.appendChild(t)}else this._codeLink=mr("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=e=>{this._openerService.open(o.target,{allowCommands:!0}),e.preventDefault(),e.stopPropagation()},hr(this._codeLink,mr("span")).innerText=o.value,e.appendChild(this._codeLink)}if(_s(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Wc(n)){const e=this._relatedBlock.appendChild(document.createElement("div"));e.style.paddingTop=`${Math.floor(.66*this._editor.getOption(66))}px`,this._lines+=1;for(const t of n){const i=document.createElement("div"),n=document.createElement("a");n.classList.add("filename"),n.innerText=`${this._labelService.getUriBasenameLabel(t.resource)}(${t.startLineNumber}, ${t.startColumn}): `,n.title=this._labelService.getUriLabel(t.resource),this._relatedDiagnostics.set(n,t);const o=document.createElement("span");o.innerText=t.message,i.appendChild(n),i.appendChild(o),this._lines+=1,e.appendChild(i)}}const l=this._editor.getOption(50),h=Math.ceil(l.typicalFullwidthCharacterWidth*this._longestLineLength*.75),d=l.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:h,scrollHeight:d})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case yN.Error:t=me(0,"Error");break;case yN.Warning:t=me(0,"Warning");break;case yN.Info:t=me(0,"Info");break;case yN.Hint:t=me(0,"Hint")}let i=me(0,"{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const n=this._editor.getModel();return n&&e.startLineNumber<=n.getLineCount()&&e.startLineNumber>=1&&(i=`${n.getLineContent(e.startLineNumber)}, ${i}`),i}}let xq=Sq=class extends sz{constructor(e,t,i,n,o,s,r){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=s,this._labelService=r,this._callOnDispose=new M,this._onDidSelectRelatedInformation=new q,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=yN.Warning,this._backgroundColor=ru.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(Pq);let t=Iq,i=Mq;this._severity===yN.Warning?(t=Tq,i=Aq):this._severity===yN.Info&&(t=Rq,i=Oq);const n=e.getColor(t),o=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:o,primaryHeadingColor:e.getColor(az),secondaryHeadingColor:e.getColor(lz)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun((e=>this.editor.focus())));const t=[],i=this._menuService.createMenu(Sq.TitleMenu,this._contextKeyService);qV(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=hr(e,mr(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new Lq(this._container,this.editor,(e=>this._onDidSelectRelatedInformation.fire(e)),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const n=tc.lift(e),o=this.editor.getPosition(),s=o&&n.containsPosition(o)?o:n.getStartPosition();super.show(s,this.computeRequiredHeight());const r=this.editor.getModel();if(r){const e=me(0,i>1?"{0} of {1} problems":"{0} of {1} problem",t,i);this.setTitle(Kl(r.uri),e)}this._icon.className=`codicon ${wq.className(yN.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(s,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};xq.TitleMenu=new yd("gotoErrorTitleMenu"),xq=Sq=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([kq(1,Tv),kq(2,Hx),kq(3,Sd),kq(4,lh),kq(5,sd),kq(6,IK)],xq);const Dq=Sv(pf,mf),Eq=Sv(ff,_f),Nq=Sv(vf,bf),Iq=Sm("editorMarkerNavigationError.background",{dark:Dq,light:Dq,hcDark:Em,hcLight:Em},me(0,"Editor marker navigation widget error color.")),Mq=Sm("editorMarkerNavigationError.headerBackground",{dark:yv(Iq,.1),light:yv(Iq,.1),hcDark:null,hcLight:null},me(0,"Editor marker navigation widget error heading background.")),Tq=Sm("editorMarkerNavigationWarning.background",{dark:Eq,light:Eq,hcDark:Em,hcLight:Em},me(0,"Editor marker navigation widget warning color.")),Aq=Sm("editorMarkerNavigationWarning.headerBackground",{dark:yv(Tq,.1),light:yv(Tq,.1),hcDark:"#0C141F",hcLight:yv(Tq,.2)},me(0,"Editor marker navigation widget warning heading background.")),Rq=Sm("editorMarkerNavigationInfo.background",{dark:Nq,light:Nq,hcDark:Em,hcLight:Em},me(0,"Editor marker navigation widget info color.")),Oq=Sm("editorMarkerNavigationInfo.headerBackground",{dark:yv(Rq,.1),light:yv(Rq,.1),hcDark:null,hcLight:null},me(0,"Editor marker navigation widget info heading background.")),Pq=Sm("editorMarkerNavigation.background",{dark:Cf,light:Cf,hcDark:Cf,hcLight:Cf},me(0,"Editor marker navigation widget background."));var Fq,Bq=function(e,t){return function(i,n){t(i,n,e)}};let Wq=Fq=class{static get(e){return e.getContribution(Fq.ID)}constructor(e,t,i,n,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=o,this._sessionDispoables=new M,this._editor=e,this._widgetVisible=Uq.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(xq,this._editor),this._widget.onDidClose((()=>this.close()),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition((e=>{var t,i,n;(null===(t=this._model)||void 0===t?void 0:t.selected)&&tc.containsPosition(null===(i=this._model)||void 0===i?void 0:i.selected.marker,e.position)||null===(n=this._model)||void 0===n||n.resetIndex()}))),this._sessionDispoables.add(this._model.onDidChange((()=>{if(!this._widget||!this._widget.position||!this._model)return;const e=this._model.find(this._editor.getModel().uri,this._widget.position);e?this._widget.updateMarker(e.marker):this._widget.showStale()}))),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation((e=>{this._editorService.openCodeEditor({resource:e.resource,options:{pinned:!0,revealIfOpened:!0,selection:tc.lift(e).collapseToStart()}},this._editor),this.close(!1)}))),this._sessionDispoables.add(this._editor.onDidChangeModel((()=>this._cleanUp()))),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new ch(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}async nagivate(e,t){var i,n;if(this._editor.hasModel()){const o=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(o.move(e,this._editor.getModel(),this._editor.getPosition()),!o.selected)return;if(o.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=await this._editorService.openCodeEditor({resource:o.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:o.selected.marker}},this._editor);s&&(null===(i=Fq.get(s))||void 0===i||i.close(),null===(n=Fq.get(s))||void 0===n||n.nagivate(e,t))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}}};Wq.ID="editor.contrib.markerController",Wq=Fq=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Bq(1,fq),Bq(2,sd),Bq(3,dh),Bq(4,lh)],Wq);class Vq extends zd{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){var i;t.hasModel()&&(null===(i=Wq.get(t))||void 0===i||i.nagivate(this._next,this._multiFile))}}class zq extends Vq{constructor(){super(!0,!1,{id:zq.ID,label:zq.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:nc.focus,primary:578,weight:100},menuOpts:{menuId:xq.TitleMenu,title:zq.LABEL,icon:EA("marker-navigation-next",Sl.arrowDown,me(0,"Icon for goto next marker.")),group:"navigation",order:1}})}}zq.ID="editor.action.marker.next",zq.LABEL=me(0,"Go to Next Problem (Error, Warning, Info)");class Hq extends Vq{constructor(){super(!1,!1,{id:Hq.ID,label:Hq.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:nc.focus,primary:1602,weight:100},menuOpts:{menuId:xq.TitleMenu,title:Hq.LABEL,icon:EA("marker-navigation-previous",Sl.arrowUp,me(0,"Icon for goto previous marker.")),group:"navigation",order:2}})}}Hq.ID="editor.action.marker.prev",Hq.LABEL=me(0,"Go to Previous Problem (Error, Warning, Info)"),Gd(Wq.ID,Wq,4),qd(zq),qd(Hq),qd(class extends Vq{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:me(0,"Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:nc.focus,primary:66,weight:100},menuOpts:{menuId:yd.MenubarGoMenu,title:me(0,"Next &&Problem"),group:"6_problem_nav",order:1}})}}),qd(class extends Vq{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:me(0,"Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:nc.focus,primary:1090,weight:100},menuOpts:{menuId:yd.MenubarGoMenu,title:me(0,"Previous &&Problem"),group:"6_problem_nav",order:2}})}});const Uq=new od("markersNavigationVisible",!1);jd(new(Vd.bindToContribution(Wq.get))({id:"closeMarkersNavigation",precondition:Uq,handler:e=>e.close(),kbOpts:{weight:150,kbExpr:nc.focus,primary:9,secondary:[1033]}}));var Kq=function(e,t){return function(i,n){t(i,n,e)}};const jq=mr;class qq{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const $q={type:1,filter:{include:gL.QuickFix},triggerAction:pL.QuickFixHover};let Gq,Zq,Yq,Qq=class{constructor(e,t,i,n){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=n,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||1!==e.type&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,o=i.getLineMaxColumn(n),s=[];for(const r of t){const t=r.range.startLineNumber===n?r.range.startColumn:1,a=r.range.endLineNumber===n?r.range.endColumn:o,l=this._markerDecorationsService.getMarker(i.uri,r);if(!l)continue;const h=new tc(e.range.startLineNumber,t,e.range.startLineNumber,a);s.push(new qq(this,h,l))}return s}renderHoverParts(e,t){if(!t.length)return T.None;const i=new M;t.forEach((t=>e.fragment.appendChild(this.renderMarkerHover(t,i))));const n=1===t.length?t[0]:t.sort(((e,t)=>yN.compare(e.marker.severity,t.marker.severity)))[0];return this.renderMarkerStatusbar(e,n,i),i}renderMarkerHover(e,t){const i=jq("div.hover-row"),n=hr(i,jq("div.marker.hover-contents")),{source:o,message:s,code:r,relatedInformation:a}=e.marker;this._editor.applyFontInfo(n);const l=hr(n,jq("span"));if(l.style.whiteSpace="pre-wrap",l.innerText=s,o||r)if(r&&"string"!=typeof r){const e=jq("span");o&&(hr(e,jq("span")).innerText=o);const i=hr(e,jq("a.code-link"));i.setAttribute("href",r.target.toString()),t.add(bs(i,"click",(e=>{this._openerService.open(r.target,{allowCommands:!0}),e.preventDefault(),e.stopPropagation()}))),hr(i,jq("span")).innerText=r.value;const s=hr(n,e);s.style.opacity="0.6",s.style.paddingLeft="6px"}else{const e=hr(n,jq("span"));e.style.opacity="0.6",e.style.paddingLeft="6px",e.innerText=o&&r?`${o}(${r})`:o||`(${r})`}if(Wc(a))for(const{message:e,resource:i,startLineNumber:o,startColumn:s}of a){const r=hr(n,jq("div"));r.style.marginTop="8px";const a=hr(r,jq("a"));a.innerText=`${Kl(i)}(${o}, ${s}): `,a.style.cursor="pointer",t.add(bs(a,"click",(e=>{e.stopPropagation(),e.preventDefault(),this._openerService&&this._openerService.open(i,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:o,startColumn:s}}}).catch(h)})));const l=hr(r,jq("span"));l.innerText=e,this._editor.applyFontInfo(l)}return i}renderMarkerStatusbar(e,t,i){if(t.marker.severity!==yN.Error&&t.marker.severity!==yN.Warning&&t.marker.severity!==yN.Info||e.statusBar.addAction({label:me(0,"View Problem"),commandId:zq.ID,run:()=>{var i;e.hide(),null===(i=Wq.get(this._editor))||void 0===i||i.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const n=e.statusBar.append(jq("div"));this.recentMarkerCodeActionsInfo&&(SN.makeKey(this.recentMarkerCodeActionsInfo.marker)===SN.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=me(0,"No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?T.None:i.add(jt((()=>n.textContent=me(0,"Checking for quick fixes...")),200));n.textContent||(n.textContent=String.fromCharCode(160));const s=this.getCodeActions(t.marker);i.add(I((()=>s.cancel()))),s.then((s=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:s.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions)return s.dispose(),void(n.textContent=me(0,"No quick fixes available"));n.style.display="none";let r=!1;i.add(I((()=>{r||s.dispose()}))),e.statusBar.addAction({label:me(0,"Quick Fix..."),commandId:bL,run:t=>{r=!0;const i=TN.get(this._editor),n=As(t);e.hide(),null==i||i.showCodeActions($q,s,{x:n.left,y:n.top,width:n.width,height:n.height})}})}),h)}}getCodeActions(e){return Wt((t=>DL(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new tc(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),$q,cL.None,t)))}};Qq=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Kq(1,dR),Kq(2,Hx),Kq(3,Jk)],Qq);class Xq{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const i=void 0===t?void 0:e,n=void 0===t?e:t;return Zq({owner:i,debugName:()=>{const e=h$(n);if(void 0!==e)return e;const t=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(n.toString());return t?`${this.debugName}.${t[2]}`:i?void 0:`${this.debugName} (mapped)`}},(e=>n(this.read(e),e)))}recomputeInitiallyAndOnChange(e,t){return e.add(Gq(this,t)),this}}class Jq extends Xq{constructor(){super(...arguments),this.observers=new Set}addObserver(e){const t=this.observers.size;this.observers.add(e),0===t&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&0===this.observers.size&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemoved(){}}function e$(e,t){const i=new n$(e,t);try{e(i)}finally{i.finish()}}function t$(e){if(Yq)e(Yq);else{const t=new n$(e,void 0);Yq=t;try{e(t)}finally{t.finish(),Yq=void 0}}}function i$(e,t,i){e?t(e):e$(t,i)}class n${constructor(e,t){var i;this._fn=e,this._getDebugName=t,this.updatingObservers=[],null===(i=void 0)||void 0===i||i.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():h$(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){var e;const t=this.updatingObservers;for(let e=0;e<t.length;e++){const{observer:i,observable:n}=t[e];i.endUpdate(n)}this.updatingObservers=null,null===(e=void 0)||void 0===e||e.handleEndTransaction()}}const o$=new Map,s$=new WeakMap;function r$(e,t,i,n,o){var s;const r=s$.get(e);if(r)return r;const a=function(e,t,i,n,o){const s=s$.get(e);if(s)return s;const r=n?function(e){var t;const i=l$.get(e);if(i)return i;const n=function(e){const t=e.constructor;return t?t.name:"Object"}(e);let o=null!==(t=a$.get(n))&&void 0!==t?t:0;o++,a$.set(n,o);const s=1===o?n:`${n}#${o}`;return l$.set(e,s),s}(n)+".":"";let a;if(void 0!==t){if("function"!=typeof t)return r+t;if(a=t(),void 0!==a)return r+a}if(void 0!==i&&(a=h$(i),void 0!==a))return r+a;if(void 0!==n)for(const e in n)if(n[e]===o)return r+e}(e,t,i,n,o);if(a){let t=null!==(s=o$.get(a))&&void 0!==s?s:0;t++,o$.set(a,t);const i=1===t?a:`${a}#${t}`;return s$.set(e,i),i}}const a$=new Map,l$=new WeakMap;function h$(e){const t=e.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(t),n=i?i[1]:void 0;return null==n?void 0:n.trim()}function d$(e,t){return"string"==typeof e?new c$(void 0,e,t):new c$(e,void 0,t)}class c$ extends Jq{get debugName(){var e;return null!==(e=r$(this,this._debugName,void 0,this._owner,this))&&void 0!==e?e:"ObservableValue"}constructor(e,t,i){super(),this._owner=e,this._debugName=t,this._value=i}get(){return this._value}set(e,t,i){var n;if(this._value===e)return;let o;t||(t=o=new n$((()=>{}),(()=>`Setting ${this.debugName}`)));try{const o=this._value;this._setValue(e),null===(n=void 0)||void 0===n||n.handleObservableChanged(this,{oldValue:o,newValue:e,change:i,didChange:!0,hadValue:!0});for(const e of this.observers)t.updateObserver(e,this),e.handleChange(this,i)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function u$(e,t){return"string"==typeof e?new g$(void 0,e,t):new g$(e,void 0,t)}class g$ extends c${_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;null===(e=this._value)||void 0===e||e.dispose()}}const p$=(e,t)=>e===t;function m$(e,t){return void 0!==t?new b$(e,void 0,t,void 0,void 0,void 0,p$):new b$(void 0,void 0,e,void 0,void 0,void 0,p$)}function f$(e,t){var i;return new b$(e.owner,e.debugName,t,void 0,void 0,void 0,null!==(i=e.equalityComparer)&&void 0!==i?i:p$)}function _$(e,t){let i,n;void 0===t?(i=e,n=void 0):(n=e,i=t);const o=new M;return new b$(n,(()=>{var e;return null!==(e=h$(i))&&void 0!==e?e:"(anonymous)"}),(e=>(o.clear(),i(e,o))),void 0,void 0,(()=>o.dispose()),p$)}function v$(e,t){let i,n;void 0===t?(i=e,n=void 0):(n=e,i=t);const o=new M;return new b$(n,(()=>{var e;return null!==(e=h$(i))&&void 0!==e?e:"(anonymous)"}),(e=>{o.clear();const t=i(e);return t&&o.add(t),t}),void 0,void 0,(()=>o.dispose()),p$)}!function(e){Zq=e}(f$);class b$ extends Jq{get debugName(){var e;return null!==(e=r$(this,this._debugName,this._computeFn,this._owner,this))&&void 0!==e?e:"(anonymous)"}constructor(e,t,i,n,o,s=void 0,r){var a,l;super(),this._owner=e,this._debugName=t,this._computeFn=i,this.createChangeSummary=n,this._handleChange=o,this._handleLastObserverRemoved=s,this._equalityComparator=r,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=null===(a=this.createChangeSummary)||void 0===a?void 0:a.call(this),null===(l=void 0)||void 0===l||l.handleDerivedCreated(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear(),null===(e=this._handleLastObserverRemoved)||void 0===e||e.call(this)}get(){var e;if(0===this.observers.size){const t=this._computeFn(this,null===(e=this.createChangeSummary)||void 0===e?void 0:e.call(this));return this.onLastObserverRemoved(),t}do{if(1===this.state)for(const e of this.dependencies)if(e.reportChanges(),2===this.state)break;1===this.state&&(this.state=3),this._recomputeIfNeeded()}while(3!==this.state);return this.value}_recomputeIfNeeded(){var e,t;if(3===this.state)return;const i=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=i;const n=0!==this.state,o=this.value;this.state=3;const s=this.changeSummary;this.changeSummary=null===(e=this.createChangeSummary)||void 0===e?void 0:e.call(this);try{this.value=this._computeFn(this,s)}finally{for(const e of this.dependenciesToBeRemoved)e.removeObserver(this);this.dependenciesToBeRemoved.clear()}const r=n&&!this._equalityComparator(o,this.value);if(null===(t=void 0)||void 0===t||t.handleDerivedRecomputed(this,{oldValue:o,newValue:this.value,change:void 0,didChange:r,hadValue:n}),r)for(const e of this.observers)e.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=1===this.updateCount;if(3===this.state&&(this.state=1,!t))for(const e of this.observers)e.handlePossibleChange(this);if(t)for(const e of this.observers)e.beginUpdate(this)}endUpdate(e){if(this.updateCount--,0===this.updateCount){const e=[...this.observers];for(const t of e)t.endUpdate(this)}if(this.updateCount<0)throw new b}handlePossibleChange(e){if(3===this.state&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=1;for(const e of this.observers)e.handlePossibleChange(this)}}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){const i=!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:t=>t===e},this.changeSummary),n=3===this.state;if(i&&(1===this.state||n)&&(this.state=2,n))for(const e of this.observers)e.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){const t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}function w$(e){return new k$(void 0,e,void 0,void 0)}function C$(e,t){return new k$(e.debugName,t,void 0,void 0)}function y$(e,t){return new k$(e.debugName,t,e.createEmptyChangeSummary,e.handleChange)}function S$(e){const t=new M,i=C$({debugName:()=>h$(e)||"(anonymous)"},(i=>{t.clear(),e(i,t)}));return I((()=>{i.dispose(),t.dispose()}))}class k${get debugName(){if("string"==typeof this._debugName)return this._debugName;if("function"==typeof this._debugName){const e=this._debugName();if(void 0!==e)return e}const e=h$(this._runFn);return void 0!==e?e:"(anonymous)"}constructor(e,t,i,n){var o,s;this._debugName=e,this._runFn=t,this.createChangeSummary=i,this._handleChange=n,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=null===(o=this.createChangeSummary)||void 0===o?void 0:o.call(this),null===(s=void 0)||void 0===s||s.handleAutorunCreated(this),this._runIfNeeded(),S(this)}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear(),k(this)}_runIfNeeded(){var e,t,i;if(3===this.state)return;const n=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=n,this.state=3;const o=this.disposed;try{if(!o){null===(e=void 0)||void 0===e||e.handleAutorunTriggered(this);const i=this.changeSummary;this.changeSummary=null===(t=this.createChangeSummary)||void 0===t?void 0:t.call(this),this._runFn(this,i)}}finally{o||null===(i=void 0)||void 0===i||i.handleAutorunFinished(this);for(const e of this.dependenciesToBeRemoved)e.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){3===this.state&&(this.state=1),this.updateCount++}endUpdate(){if(1===this.updateCount)do{if(1===this.state){this.state=3;for(const e of this.dependencies)if(e.reportChanges(),2===this.state)break}this._runIfNeeded()}while(3!==this.state);this.updateCount--,gd((()=>this.updateCount>=0))}handlePossibleChange(e){3===this.state&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=1)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:t=>t===e},this.changeSummary))&&(this.state=2)}readObservable(e){if(this.disposed)return e.get();e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}}function L$(e){return new x$(e)}!function(e){e.Observer=k$}(w$||(w$={}));class x$ extends Xq{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}function D$(e,t){return new E$(e,t)}class E$ extends Jq{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=e=>{var t;const i=this._getValue(e),n=this.value,o=!this.hasValue||n!==i;let s=!1;o&&(this.value=i,this.hasValue&&(s=!0,i$(E$.globalTransaction,(e=>{var t;null===(t=void 0)||void 0===t||t.handleFromEventObservableTriggered(this,{oldValue:n,newValue:i,change:void 0,didChange:o,hadValue:this.hasValue});for(const t of this.observers)e.updateObserver(t,this),t.handleChange(this,void 0)}),(()=>{const e=this.getDebugName();return"Event fired"+(e?`: ${e}`:"")}))),this.hasValue=!0),s||null===(t=void 0)||void 0===t||t.handleFromEventObservableTriggered(this,{oldValue:n,newValue:i,change:void 0,didChange:o,hadValue:this.hasValue})}}getDebugName(){return h$(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}}function N$(e,t){return new I$(e,t)}!function(e){e.Observer=E$,e.batchEventsGlobally=function(e,t){let i=!1;void 0===E$.globalTransaction&&(E$.globalTransaction=e,i=!0);try{t()}finally{i&&(E$.globalTransaction=void 0)}}}(D$||(D$={}));class I$ extends Jq{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{e$((e=>{for(const t of this.observers)e.updateObserver(t,this),t.handleChange(this,void 0)}),(()=>this.debugName))}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function M$(e){return"string"==typeof e?new T$(e):new T$(void 0,e)}class T$ extends Jq{get debugName(){var e;return null!==(e=r$(this,this._debugName,void 0,this._owner,this))&&void 0!==e?e:"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(e)for(const i of this.observers)e.updateObserver(i,this),i.handleChange(this,t);else e$((e=>{this.trigger(e,t)}),(()=>`Trigger signal ${this.debugName}`))}get(){}}function A$(e,t){const i=new R$(!0,t);return e.addObserver(i),t?t(e.get()):e.reportChanges(),I((()=>{e.removeObserver(i)}))}!function(e){Gq=e}(A$);class R${constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter--,0===this._counter&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges())}handlePossibleChange(e){}handleChange(e,t){}}var O$=i(8300),P$={};P$.styleTagTransform=Vr(),P$.setAttributes=Pr(),P$.insert=Rr().bind(null,"head"),P$.domAPI=Tr(),P$.insertStyleElement=Br(),Ir()(O$.Z,P$),O$.Z&&O$.Z.locals&&O$.Z.locals;const F$="editor.action.inlineSuggest.commit",B$="editor.action.inlineSuggest.showPrevious",W$="editor.action.inlineSuggest.showNext";var V$=i(6651),z$={};z$.styleTagTransform=Vr(),z$.setAttributes=Pr(),z$.insert=Rr().bind(null,"head"),z$.domAPI=Tr(),z$.insertStyleElement=Br(),Ir()(V$.Z,z$),V$.Z&&V$.Z.locals&&V$.Z.locals;class H$ extends T{constructor(e,t,i={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new Q),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new M),this.options=i,this.lookupKeybindings="function"==typeof this.options.getKeyBinding,this.toggleMenuAction=this._register(new U$((()=>{var e;return null===(e=this.toggleMenuActionViewItem)||void 0===e?void 0:e.show()}),i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new ME(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,actionViewItemProvider:(e,n)=>{var o;if(e.id===U$.ID)return this.toggleMenuActionViewItem=new zV(e,e.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Ll.asClassNameArray(null!==(o=i.moreIcon)&&void 0!==o?o:Sl.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const t=i.actionViewItemProvider(e,n);if(t)return t}if(e instanceof _h){const i=new zV(e,e.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:e.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry});return i.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(i),this.disposables.add(this._onDidChangeDropdownVisibility.add(i.onDidChangeVisibility)),i}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach((e=>{this.actionBar.push(e,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(e)})}))}getKeybindingLabel(e){var t,i,n;const o=this.lookupKeybindings?null===(i=(t=this.options).getKeyBinding)||void 0===i?void 0:i.call(t,e):void 0;return null!==(n=null==o?void 0:o.getLabel())&&void 0!==n?n:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class U$ extends ph{constructor(e,t){t=t||me(0,"More Actions..."),super(U$.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}U$.ID="toolbar.toggle.more";var K$=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},j$=function(e,t){return function(i,n){t(i,n,e)}};let q$=class extends H${constructor(e,t,i,n,o,s,r){super(e,o,{getKeyBinding:e=>{var t;return null!==(t=s.lookupKeybinding(e.id))&&void 0!==t?t:void 0},...t,allowContextMenu:!0,skipTelemetry:"string"==typeof(null==t?void 0:t.telemetrySource)}),this._options=t,this._menuService=i,this._contextKeyService=n,this._contextMenuService=o,this._sessionDisposables=this._store.add(new M);const a=null==t?void 0:t.telemetrySource;a&&this._store.add(this.actionBar.onDidRun((e=>r.publicLog2("workbenchActionExecuted",{id:e.action.id,from:a}))))}setActions(e,t=[],i){var n,o,s;this._sessionDisposables.clear();const r=e.slice(),a=t.slice(),l=[];let h=0;const d=[];let c=!1;if(-1!==(null===(n=this._options)||void 0===n?void 0:n.hiddenItemStrategy))for(let e=0;e<r.length;e++){const t=r[e];(t instanceof Dd||t instanceof xd)&&t.hideActions&&(l.push(t.hideActions.toggle),t.hideActions.toggle.checked&&h++,t.hideActions.isHidden&&(c=!0,r[e]=void 0,0!==(null===(o=this._options)||void 0===o?void 0:o.hiddenItemStrategy)&&(d[e]=t)))}if(void 0!==(null===(s=this._options)||void 0===s?void 0:s.overflowBehavior)){const e=function(e,t){const i=new Set;for(const n of t)e.has(n)&&i.add(n);return i}(new Set(this._options.overflowBehavior.exempted),C.map(r,(e=>null==e?void 0:e.id))),t=this._options.overflowBehavior.maxItems-e.size;let i=0;for(let n=0;n<r.length;n++){const o=r[n];o&&(i++,e.has(o.id)||i>=t&&(r[n]=void 0,d[n]=o))}}Fc(r),Fc(d),super.setActions(r,fh.join(d,a)),l.length>0&&this._sessionDisposables.add(bs(this.getElement(),"contextmenu",(e=>{var t,n,o,s,r;const a=new Mt(as(this.getElement()),e),d=this.getItemAction(a.target);if(!d)return;a.preventDefault(),a.stopPropagation();let u,g=!1;if(1===h&&0===(null===(t=this._options)||void 0===t?void 0:t.hiddenItemStrategy)){g=!0;for(let e=0;e<l.length;e++)if(l[e].checked){l[e]=bh({id:d.id,label:d.label,checked:!0,enabled:!1,run(){}});break}}if(!g&&(d instanceof Dd||d instanceof xd)){if(!d.hideActions)return;u=d.hideActions.hide}else u=bh({id:"label",label:me(0,"Hide"),enabled:!1,run(){}});const p=fh.join([u],l);(null===(n=this._options)||void 0===n?void 0:n.resetMenu)&&!i&&(i=[this._options.resetMenu]),c&&i&&(p.push(new fh),p.push(bh({id:"resetThisMenu",label:me(0,"Reset Menu"),run:()=>this._menuService.resetHiddenStates(i)}))),this._contextMenuService.showContextMenu({getAnchor:()=>a,getActions:()=>p,menuId:null===(o=this._options)||void 0===o?void 0:o.contextMenu,menuActionOptions:{renderShortTitle:!0,...null===(s=this._options)||void 0===s?void 0:s.menuOptions},skipTelemetry:"string"==typeof(null===(r=this._options)||void 0===r?void 0:r.telemetrySource),contextKeyService:this._contextKeyService})})))}};q$=K$([j$(2,Sd),j$(3,sd),j$(4,qE),j$(5,ML),j$(6,Id)],q$);let $$=class extends q${constructor(e,t,i,n,o,s,r,a){super(e,{resetMenu:t,...i},n,o,s,r,a),this._onDidChangeMenuItems=this._store.add(new q);const l=this._store.add(n.createMenu(t,o,{emitEventsForSubmenuChanges:!0})),h=()=>{var t,n,o;const s=[],r=[];qV(l,null==i?void 0:i.menuOptions,{primary:s,secondary:r},null===(t=null==i?void 0:i.toolbarOptions)||void 0===t?void 0:t.primaryGroup,null===(n=null==i?void 0:i.toolbarOptions)||void 0===n?void 0:n.shouldInlineSubmenu,null===(o=null==i?void 0:i.toolbarOptions)||void 0===o?void 0:o.useSeparatorsInPrimaryActions),e.classList.toggle("has-no-actions",0===s.length&&0===r.length),super.setActions(s,r)};this._store.add(l.onDidChange((()=>{h(),this._onDidChangeMenuItems.fire(this)}))),h()}setActions(){throw new b("This toolbar is populated from a menu.")}};$$=K$([j$(3,Sd),j$(4,sd),j$(5,qE),j$(6,ML),j$(7,Id)],$$);var G$,Z$=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Y$=function(e,t){return function(i,n){t(i,n,e)}};let Q$=class extends T{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=D$(this.editor.onDidChangeConfiguration,(()=>"always"===this.editor.getOption(62).showToolbar)),this.sessionPosition=void 0,this.position=m$(this,(e=>{var t,i,n;const o=null===(t=this.model.read(e))||void 0===t?void 0:t.ghostText.read(e);if(!this.alwaysShowToolbar.read(e)||!o||0===o.parts.length)return this.sessionPosition=void 0,null;const s=o.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==o.lineNumber&&(this.sessionPosition=void 0);const r=new ch(o.lineNumber,Math.min(s,null!==(n=null===(i=this.sessionPosition)||void 0===i?void 0:i.column)&&void 0!==n?n:Number.MAX_SAFE_INTEGER));return this.sessionPosition=r,r})),this._register(S$(((t,i)=>{const n=this.model.read(t);if(!n||!this.alwaysShowToolbar.read(t))return;const o=i.add(this.instantiationService.createInstance(eG,this.editor,!0,this.position,n.selectedInlineCompletionIndex,n.inlineCompletionsCount,n.selectedInlineCompletion.map((e=>{var t;return null!==(t=null==e?void 0:e.inlineCompletion.source.inlineCompletions.commands)&&void 0!==t?t:[]}))));e.addContentWidget(o),i.add(I((()=>e.removeContentWidget(o)))),i.add(w$((e=>{this.position.read(e)&&n.lastTriggerKind.read(e)!==gC.Explicit&&n.triggerExplicitly()})))})))}};Q$=Z$([Y$(2,lh)],Q$);const X$=EA("inline-suggestion-hints-next",Sl.chevronRight,me(0,"Icon for show next parameter hint.")),J$=EA("inline-suggestion-hints-previous",Sl.chevronLeft,me(0,"Icon for show previous parameter hint."));let eG=G$=class extends T{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const n=new ph(e,t,i,!0,(()=>this._commandService.executeCommand(e))),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let s=t;return o&&(s=me(0,"{0} ({1})",t,o.getLabel())),n.tooltip=s,n}constructor(e,t,i,n,o,s,r,a,l,h,d){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=n,this._suggestionCount=o,this._extraCommands=s,this._commandService=r,this.keybindingService=l,this._contextKeyService=h,this._menuService=d,this.id="InlineSuggestionHintsContentWidget"+G$.id++,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Dr("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[Dr("div@toolBar")]),this.previousAction=this.createCommandAction(B$,me(0,"Previous"),Ll.asClassName(J$)),this.availableSuggestionCountAction=new ph("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(W$,me(0,"Next"),Ll.asClassName(X$)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(yd.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Zt((()=>{this.availableSuggestionCountAction.label=""}),100)),this.disableButtonsDebounced=this._register(new Zt((()=>{this.previousAction.enabled=this.nextAction.enabled=!1}),100)),this.lastCommands=[],this.toolBar=this._register(a.createInstance(nG,this.nodes.toolBar,yd.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:e=>e.startsWith("primary")},actionViewItemProvider:(e,t)=>{if(e instanceof Dd)return a.createInstance(iG,e,void 0);if(e===this.availableSuggestionCountAction){const t=new tG(void 0,e,{label:!0,icon:!1});return t.setClass("availableSuggestionCount"),t}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility((e=>{G$._dropDownVisible=e}))),this._register(w$((e=>{this._position.read(e),this.editor.layoutContentWidget(this)}))),this._register(w$((e=>{const t=this._suggestionCount.read(e),i=this._currentSuggestionIdx.read(e);void 0!==t?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${i+1}/${t}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),void 0!==t&&t>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()}))),this._register(w$((e=>{const t=this._extraCommands.read(e);if(Ic(this.lastCommands,t))return;this.lastCommands=t;const i=t.map((e=>({class:void 0,id:e.id,enabled:!0,tooltip:e.tooltip||"",label:e.title,run:t=>this._commandService.executeCommand(e.id)})));for(const[e,t]of this.inlineCompletionsActionsMenus.getActions())for(const e of t)e instanceof Dd&&i.push(e);i.length>0&&i.unshift(new fh),this.toolBar.setAdditionalSecondaryActions(i)})))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};eG._dropDownVisible=!1,eG.id=0,eG=G$=Z$([Y$(6,wh),Y$(7,lh),Y$(8,ML),Y$(9,sd),Y$(10,Sd)],eG);class tG extends NE{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}class iG extends GV{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Dr("div.keybinding").root;new KE(t,Qe,{disableTitle:!0,...UE}).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}}let nG=class extends q${constructor(e,t,i,n,o,s,r,a){super(e,{resetMenu:t,...i},n,o,s,r,a),this.menuId=t,this.options2=i,this.menuService=n,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange((()=>this.updateToolbar()))),this.updateToolbar()}updateToolbar(){var e,t,i,n,o,s,r;const a=[],l=[];qV(this.menu,null===(e=this.options2)||void 0===e?void 0:e.menuOptions,{primary:a,secondary:l},null===(i=null===(t=this.options2)||void 0===t?void 0:t.toolbarOptions)||void 0===i?void 0:i.primaryGroup,null===(o=null===(n=this.options2)||void 0===n?void 0:n.toolbarOptions)||void 0===o?void 0:o.shouldInlineSubmenu,null===(r=null===(s=this.options2)||void 0===s?void 0:s.toolbarOptions)||void 0===r?void 0:r.useSeparatorsInPrimaryActions),l.push(...this.additionalActions),a.unshift(...this.prependedPrimaryActions),this.setActions(a,l)}setPrependedPrimaryActions(e){Ic(this.prependedPrimaryActions,e,((e,t)=>e===t))||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Ic(this.additionalActions,e,((e,t)=>e===t))||(this.additionalActions=e,this.updateToolbar())}};nG=Z$([Y$(3,Sd),Y$(4,sd),Y$(5,qE),Y$(6,ML),Y$(7,Id)],nG);var oG=i(1738),sG={};sG.styleTagTransform=Vr(),sG.setAttributes=Pr(),sG.insert=Rr().bind(null,"head"),sG.domAPI=Tr(),sG.insertStyleElement=Br(),Ir()(oG.Z,sG),oG.Z&&oG.Z.locals&&oG.Z.locals;var rG,aG=function(e,t){return function(i,n){t(i,n,e)}};let lG=rG=class extends T{static get(e){return e.getContribution(rG.ID)}constructor(e,t,i,n,o){super(),this._editor=e,this._instantiationService=t,this._openerService=i,this._languageService=n,this._keybindingService=o,this._toUnhook=new M,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new Zt((()=>this._reactToEditorMouseMove(this._mouseMoveEvent)),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(60)&&(this._unhookEvents(),this._hookEvents())})))}_hookEvents(){const e=this._editor.getOption(60);this._isHoverEnabled=e.enabled,this._isHoverSticky=e.sticky,this._hidingDelay=e.hidingDelay,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown((e=>this._onEditorMouseDown(e)))),this._toUnhook.add(this._editor.onMouseUp((e=>this._onEditorMouseUp(e)))),this._toUnhook.add(this._editor.onMouseMove((e=>this._onEditorMouseMove(e)))),this._toUnhook.add(this._editor.onKeyDown((e=>this._onKeyDown(e))))):(this._toUnhook.add(this._editor.onMouseMove((e=>this._onEditorMouseMove(e)))),this._toUnhook.add(this._editor.onKeyDown((e=>this._onKeyDown(e))))),this._toUnhook.add(this._editor.onMouseLeave((e=>this._onEditorMouseLeave(e)))),this._toUnhook.add(this._editor.onDidChangeModel((()=>{this._cancelScheduler(),this._hideWidgets()}))),this._toUnhook.add(this._editor.onDidChangeModelContent((()=>this._cancelScheduler()))),this._toUnhook.add(this._editor.onDidScrollChange((e=>this._onEditorScrollChanged(e))))}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._isMouseDown=!0;const i=e.target;9!==i.type||i.detail!==Xj.ID?12===i.type&&i.detail===nq.ID||(12!==i.type&&(this._hoverClicked=!1),(null===(t=this._contentWidget)||void 0===t?void 0:t.widget.isResizing)||this._hideWidgets()):this._hoverClicked=!0}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseLeave(e){var t,i;this._cancelScheduler();const n=e.event.browserEvent.relatedTarget;(null===(t=this._contentWidget)||void 0===t?void 0:t.widget.isResizing)||(null===(i=this._contentWidget)||void 0===i?void 0:i.containsNode(n))||this._hideWidgets()}_isMouseOverWidget(e){var t,i,n,o,s;const r=e.target;return!((!this._isHoverSticky||9!==r.type||r.detail!==Xj.ID)&&(!this._isHoverSticky||!(null===(t=this._contentWidget)||void 0===t?void 0:t.containsNode(null===(i=e.event.browserEvent.view)||void 0===i?void 0:i.document.activeElement))||(null===(o=null===(n=e.event.browserEvent.view)||void 0===n?void 0:n.getSelection())||void 0===o?void 0:o.isCollapsed))&&(this._isHoverSticky||9!==r.type||r.detail!==Xj.ID||!(null===(s=this._contentWidget)||void 0===s?void 0:s.isColorPickerVisible))&&(!this._isHoverSticky||12!==r.type||r.detail!==nq.ID))}_onEditorMouseMove(e){var t,i,n,o;this._mouseMoveEvent=e,(null===(t=this._contentWidget)||void 0===t?void 0:t.isFocused)||(null===(i=this._contentWidget)||void 0===i?void 0:i.isResizing)||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&(null===(n=this._contentWidget)||void 0===n?void 0:n.isVisibleFromKeyboard)||(this._isMouseOverWidget(e)?this._reactToEditorMouseMoveRunner.cancel():(null===(o=this._contentWidget)||void 0===o?void 0:o.isVisible)&&this._isHoverSticky&&this._hidingDelay>0?this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay):this._reactToEditorMouseMove(e))}_reactToEditorMouseMove(e){var t,i,n;if(!e)return;const o=e.target,s=null===(t=o.element)||void 0===t?void 0:t.classList.contains("colorpicker-color-decoration"),r=this._editor.getOption(146);if(s&&("click"===r&&!this._hoverActivatedByColorDecoratorClick||"hover"===r&&!this._isHoverEnabled||"clickAndHover"===r&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!(s||this._isHoverEnabled||this._hoverActivatedByColorDecoratorClick))this._hideWidgets();else if(this._getOrCreateContentWidget().maybeShowAt(e))null===(i=this._glyphWidget)||void 0===i||i.hide();else{if(2===o.type&&o.position)return null===(n=this._contentWidget)||void 0===n||n.hide(),this._glyphWidget||(this._glyphWidget=new nq(this._editor,this._languageService,this._openerService)),void this._glyphWidget.startShowingAt(o.position.lineNumber);this._hideWidgets()}}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const i=this._keybindingService.softDispatch(e,this._editor.getDomNode()),n=1===i.kind||2===i.kind&&"editor.action.showHover"===i.commandId&&(null===(t=this._contentWidget)||void 0===t?void 0:t.isVisible);5===e.keyCode||6===e.keyCode||57===e.keyCode||4===e.keyCode||n||this._hideWidgets()}_hideWidgets(){var e,t,i;this._isMouseDown&&this._hoverClicked&&(null===(e=this._contentWidget)||void 0===e?void 0:e.isColorPickerVisible)||eG.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,null===(t=this._glyphWidget)||void 0===t||t.hide(),null===(i=this._contentWidget)||void 0===i||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(Gj,this._editor)),this._contentWidget}showContentHover(e,t,i,n,o=!1){this._hoverActivatedByColorDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,n)}focus(){var e;null===(e=this._contentWidget)||void 0===e||e.focus()}scrollUp(){var e;null===(e=this._contentWidget)||void 0===e||e.scrollUp()}scrollDown(){var e;null===(e=this._contentWidget)||void 0===e||e.scrollDown()}scrollLeft(){var e;null===(e=this._contentWidget)||void 0===e||e.scrollLeft()}scrollRight(){var e;null===(e=this._contentWidget)||void 0===e||e.scrollRight()}pageUp(){var e;null===(e=this._contentWidget)||void 0===e||e.pageUp()}pageDown(){var e;null===(e=this._contentWidget)||void 0===e||e.pageDown()}goToTop(){var e;null===(e=this._contentWidget)||void 0===e||e.goToTop()}goToBottom(){var e;null===(e=this._contentWidget)||void 0===e||e.goToBottom()}get isColorPickerVisible(){var e;return null===(e=this._contentWidget)||void 0===e?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return null===(e=this._contentWidget)||void 0===e?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookEvents(),this._toUnhook.dispose(),null===(e=this._glyphWidget)||void 0===e||e.dispose(),null===(t=this._contentWidget)||void 0===t||t.dispose()}};var hG;lG.ID="editor.contrib.hover",lG=rG=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([aG(1,lh),aG(2,Hx),aG(3,yu),aG(4,ML)],lG),function(e){e.NoAutoFocus="noAutoFocus",e.FocusIfVisible="focusIfVisible",e.AutoFocusImmediately="autoFocusImmediately"}(hG||(hG={})),Gd(lG.ID,lG,2),qd(class extends zd{constructor(){super({id:"editor.action.showHover",label:me(0,"Show or Focus Hover"),metadata:{description:"Show or Focus Hover",args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[hG.NoAutoFocus,hG.FocusIfVisible,hG.AutoFocusImmediately],enumDescriptions:[me(0,"The hover will not automatically take focus."),me(0,"The hover will take focus only if it is already visible."),me(0,"The hover will automatically take focus when it appears.")],default:hG.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:nc.editorTextFocus,primary:vt(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const n=lG.get(t);if(!n)return;const o=null==i?void 0:i.focus;let s=hG.FocusIfVisible;o in hG?s=o:"boolean"==typeof o&&o&&(s=hG.AutoFocusImmediately);const r=e=>{const i=t.getPosition(),o=new tc(i.lineNumber,i.column,i.lineNumber,i.column);n.showContentHover(o,1,1,e)},a=2===t.getOption(2);n.isHoverVisible?s!==hG.NoAutoFocus?n.focus():r(a):r(a||s===hG.AutoFocusImmediately)}}),qd(class extends zd{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:me(0,"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const i=lG.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const o=new tc(n.lineNumber,n.column,n.lineNumber,n.column),s=Ij.get(t);s&&s.startFindDefinitionFromCursor(n).then((()=>{i.showContentHover(o,1,1,!0)}))}}),qd(class extends zd{constructor(){super({id:"editor.action.scrollUpHover",label:me(0,"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:nc.hoverFocused,kbOpts:{kbExpr:nc.hoverFocused,primary:16,weight:100}})}run(e,t){const i=lG.get(t);i&&i.scrollUp()}}),qd(class extends zd{constructor(){super({id:"editor.action.scrollDownHover",label:me(0,"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:nc.hoverFocused,kbOpts:{kbExpr:nc.hoverFocused,primary:18,weight:100}})}run(e,t){const i=lG.get(t);i&&i.scrollDown()}}),qd(class extends zd{constructor(){super({id:"editor.action.scrollLeftHover",label:me(0,"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:nc.hoverFocused,kbOpts:{kbExpr:nc.hoverFocused,primary:15,weight:100}})}run(e,t){const i=lG.get(t);i&&i.scrollLeft()}}),qd(class extends zd{constructor(){super({id:"editor.action.scrollRightHover",label:me(0,"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:nc.hoverFocused,kbOpts:{kbExpr:nc.hoverFocused,primary:17,weight:100}})}run(e,t){const i=lG.get(t);i&&i.scrollRight()}}),qd(class extends zd{constructor(){super({id:"editor.action.pageUpHover",label:me(0,"Page Up Hover"),alias:"Page Up Hover",precondition:nc.hoverFocused,kbOpts:{kbExpr:nc.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=lG.get(t);i&&i.pageUp()}}),qd(class extends zd{constructor(){super({id:"editor.action.pageDownHover",label:me(0,"Page Down Hover"),alias:"Page Down Hover",precondition:nc.hoverFocused,kbOpts:{kbExpr:nc.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=lG.get(t);i&&i.pageDown()}}),qd(class extends zd{constructor(){super({id:"editor.action.goToTopHover",label:me(0,"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:nc.hoverFocused,kbOpts:{kbExpr:nc.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=lG.get(t);i&&i.goToTop()}}),qd(class extends zd{constructor(){super({id:"editor.action.goToBottomHover",label:me(0,"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:nc.hoverFocused,kbOpts:{kbExpr:nc.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=lG.get(t);i&&i.goToBottom()}}),Vj.register(dq),Vj.register(Qq),Fv(((e,t)=>{const i=e.getColor($f);i&&(t.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${i.transparent(.5)}; }`),t.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${i.transparent(.5)}; }`),t.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${i.transparent(.5)}; }`))}));class dG extends T{constructor(e){super(),this._editor=e,this._register(e.onMouseDown((e=>this.onMouseDown(e))))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(146);if("click"!==t&&"clickAndHover"!==t)return;const i=e.target;if(6!==i.type)return;if(!i.detail.injectedText)return;if(i.detail.injectedText.options.attachedData!==bA)return;if(!i.range)return;const n=this._editor.getContribution(lG.ID);if(n&&!n.isColorPickerVisible){const e=new tc(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);n.showContentHover(e,1,0,!1,!0)}}}dG.ID="editor.contrib.colorContribution",Gd(dG.ID,dG,2),Vj.register($A);var cG,uG,gG=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},pG=function(e,t){return function(i,n){t(i,n,e)}};let mG=cG=class extends T{constructor(e,t,i,n,o,s,r){super(),this._editor=e,this._modelService=i,this._keybindingService=n,this._instantiationService=o,this._languageFeatureService=s,this._languageConfigurationService=r,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=nc.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=nc.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||null===(e=this._standaloneColorPickerWidget)||void 0===e||e.focus():this._standaloneColorPickerWidget=new fG(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),null===(e=this._standaloneColorPickerWidget)||void 0===e||e.hide(),this._editor.focus()}insertColor(){var e;null===(e=this._standaloneColorPickerWidget)||void 0===e||e.updateEditor(),this.hide()}static get(e){return e.getContribution(cG.ID)}};mG.ID="editor.contrib.standaloneColorPickerController",mG=cG=gG([pG(1,sd),pG(2,uh),pG(3,ML),pG(4,lh),pG(5,Jk),pG(6,Yg)],mG),Gd(mG.ID,mG,1);let fG=uG=class extends T{constructor(e,t,i,n,o,s,r,a){var l;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=o,this._keybindingService=s,this._languageFeaturesService=r,this._languageConfigurationService=a,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new q),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=n.createInstance(ZA,this._editor),this._position=null===(l=this._editor._getViewModel())||void 0===l?void 0:l.getPrimaryCursorState().modelState.position;const h=this._editor.getSelection(),d=h?{startLineNumber:h.startLineNumber,startColumn:h.startColumn,endLineNumber:h.endLineNumber,endColumn:h.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},c=this._register(lr(this._body));this._register(c.onDidBlur((e=>{this.hide()}))),this._register(c.onDidFocus((e=>{this.focus()}))),this._register(this._editor.onDidChangeCursorPosition((()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()}))),this._register(this._editor.onMouseMove((e=>{var t;const i=null===(t=e.target.element)||void 0===t?void 0:t.classList;i&&i.contains("colorpicker-color-decoration")&&this.hide()}))),this._register(this.onResult((e=>{this._render(e.value,e.foundInEditor)}))),this._start(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return uG.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(60).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}async _start(e){const t=await this._computeAsync(e);t&&this._onResult.fire(new _G(t.result,t.foundInEditor))}async _computeAsync(e){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=await this._standaloneColorPickerParticipant.createColorHover(t,new lA(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){const i=document.createDocumentFragment();let n;const o={fragment:i,statusBar:this._register(new Jj(this._keybindingService)),setColorPicker:e=>n=e,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(o,[e])),void 0===n)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(.66*this._editor.getLayoutInfo().width,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),n.layout();const s=n.body,r=s.saturationBox.domNode.clientWidth,a=s.domNode.clientWidth-r-22-8,l=n.body.enterButton;null==l||l.onClicked((()=>{this.updateEditor(),this.hide()}));const h=n.header;h.pickedColorNode.style.width=r+8+"px",h.originalColorNode.style.width=a+"px";const d=n.header.closeButton;null==d||d.onClicked((()=>{this.hide()})),t&&(l&&(l.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};fG.ID="editor.contrib.standaloneColorPickerWidget",fG=uG=gG([pG(3,lh),pG(4,uh),pG(5,ML),pG(6,Jk),pG(7,Yg)],fG);class _G{constructor(e,t){this.value=e,this.foundInEditor=t}}qd(class extends zd{constructor(){super({id:"editor.action.hideColorPicker",label:me(0,"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:nc.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var i;null===(i=mG.get(t))||void 0===i||i.hide()}}),qd(class extends zd{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:me(0,"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:nc.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var i;null===(i=mG.get(t))||void 0===i||i.insertColor()}}),Nd(class extends Ud{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:me(0,"Show or Focus Standalone Color Picker"),mnemonicTitle:me(0,"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:yd.CommandPalette}]})}runEditorCommand(e,t){var i;null===(i=mG.get(t))||void 0===i||i.showOrFocus()}});class vG{static insert(e,t){return{range:new tc(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}class bG{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const n=t.length;if(i+n>e.length)return!1;for(let o=0;o<n;o++){const n=e.charCodeAt(i+o),s=t.charCodeAt(o);if(n!==s&&!(n>=65&&n<=90&&n+32===s||s>=65&&s<=90&&s+32===n))return!1}return!0}_createOperationsForBlockComment(e,t,i,n,o,s){const r=e.startLineNumber,a=e.startColumn,l=e.endLineNumber,h=e.endColumn,d=o.getLineContent(r),c=o.getLineContent(l);let u,g=d.lastIndexOf(t,a-1+t.length),p=c.indexOf(i,h-1-i.length);if(-1!==g&&-1!==p)if(r===l)d.substring(g+t.length,p).indexOf(i)>=0&&(g=-1,p=-1);else{const e=d.substring(g+t.length),n=c.substring(0,p);(e.indexOf(i)>=0||n.indexOf(i)>=0)&&(g=-1,p=-1)}-1!==g&&-1!==p?(n&&g+t.length<d.length&&32===d.charCodeAt(g+t.length)&&(t+=" "),n&&p>0&&32===c.charCodeAt(p-1)&&(i=" "+i,p-=1),u=bG._createRemoveBlockCommentOperations(new tc(r,g+t.length+1,l,p+1),t,i)):(u=bG._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=1===u.length?i:null);for(const e of u)s.addTrackedEditOperation(e.range,e.text)}static _createRemoveBlockCommentOperations(e,t,i){const n=[];return tc.isEmpty(e)?n.push(vG.delete(new tc(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(vG.delete(new tc(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(vG.delete(new tc(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){const o=[];return tc.isEmpty(e)?o.push(vG.replace(new tc(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(vG.insert(new ch(e.startLineNumber,e.startColumn),t+(n?" ":""))),o.push(vG.insert(new ch(e.endLineNumber,e.endColumn),(n?" ":"")+i))),o}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,n),s=this.languageConfigurationService.getLanguageConfiguration(o).comments;s&&s.blockCommentStartToken&&s.blockCommentEndToken&&this._createOperationsForBlockComment(this._selection,s.blockCommentStartToken,s.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(2===i.length){const e=i[0],t=i[1];return new ic(e.range.endLineNumber,e.range.endColumn,t.range.startLineNumber,t.range.startColumn)}{const e=i[0].range,t=this._usedEndToken?-this._usedEndToken.length-1:0;return new ic(e.endLineNumber,e.endColumn+t,e.endLineNumber,e.endColumn+t)}}}class wG{constructor(e,t,i,n,o,s,r){this.languageConfigurationService=e,this._selection=t,this._tabSize=i,this._type=n,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=s,this._ignoreFirstLine=r||!1}static _gatherPreflightCommentStrings(e,t,i,n){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),s=n.getLanguageConfiguration(o).comments,r=s?s.lineCommentToken:null;if(!r)return null;const a=[];for(let e=0,n=i-t+1;e<n;e++)a[e]={ignore:!1,commentStr:r,commentStrOffset:0,commentStrLength:r.length};return a}static _analyzeLines(e,t,i,n,o,s,r,a){let l,h=!0;l=0===e||1!==e;for(let a=0,d=n.length;a<d;a++){const d=n[a],c=o+a;if(c===o&&r){d.ignore=!0;continue}const u=i.getLineContent(c),g=fn(u);if(-1!==g){if(h=!1,d.ignore=!1,d.commentStrOffset=g,l&&!bG._haystackHasNeedleAtOffset(u,d.commentStr,g)&&(0===e?l=!1:1===e||(d.ignore=!0)),l&&t){const e=g+d.commentStrLength;e<u.length&&32===u.charCodeAt(e)&&(d.commentStrLength+=1)}}else d.ignore=s,d.commentStrOffset=u.length}if(0===e&&h){l=!1;for(let e=0,t=n.length;e<t;e++)n[e].ignore=!1}return{supported:!0,shouldRemoveComments:l,lines:n}}static _gatherPreflightData(e,t,i,n,o,s,r,a){const l=wG._gatherPreflightCommentStrings(i,n,o,a);return null===l?{supported:!1}:wG._analyzeLines(e,t,i,l,n,s,r,a)}_executeLineComments(e,t,i,n){let o;i.shouldRemoveComments?o=wG._createRemoveLineCommentsOperations(i.lines,n.startLineNumber):(wG._normalizeInsertionPoint(e,i.lines,n.startLineNumber,this._tabSize),o=this._createAddLineCommentsOperations(i.lines,n.startLineNumber));const s=new ch(n.positionLineNumber,n.positionColumn);for(let i=0,n=o.length;i<n;i++)t.addEditOperation(o[i].range,o[i].text),tc.isEmpty(o[i].range)&&tc.getStartPosition(o[i].range).equals(s)&&e.getLineContent(s.lineNumber).length+1===s.column&&(this._deltaColumn=(o[i].text||"").length);this._selectionId=t.trackSelection(n)}_attemptRemoveBlockComment(e,t,i,n){let o=t.startLineNumber,s=t.endLineNumber;const r=n.length+Math.max(e.getLineFirstNonWhitespaceColumn(t.startLineNumber),t.startColumn);let a=e.getLineContent(o).lastIndexOf(i,r-1),l=e.getLineContent(s).indexOf(n,t.endColumn-1-i.length);return-1!==a&&-1===l&&(l=e.getLineContent(o).indexOf(n,a+i.length),s=o),-1===a&&-1!==l&&(a=e.getLineContent(s).lastIndexOf(i,l),o=s),!t.isEmpty()||-1!==a&&-1!==l||(a=e.getLineContent(o).indexOf(i),-1!==a&&(l=e.getLineContent(o).indexOf(n,a+i.length))),-1!==a&&32===e.getLineContent(o).charCodeAt(a+i.length)&&(i+=" "),-1!==l&&32===e.getLineContent(s).charCodeAt(l-1)&&(n=" "+n,l-=1),-1!==a&&-1!==l?bG._createRemoveBlockCommentOperations(new tc(o,a+i.length+1,s,l+1),i,n):null}_executeBlockComment(e,t,i){e.tokenization.tokenizeIfCheap(i.startLineNumber);const n=e.getLanguageIdAtPosition(i.startLineNumber,1),o=this.languageConfigurationService.getLanguageConfiguration(n).comments;if(!o||!o.blockCommentStartToken||!o.blockCommentEndToken)return;const s=o.blockCommentStartToken,r=o.blockCommentEndToken;let a=this._attemptRemoveBlockComment(e,i,s,r);if(!a){if(i.isEmpty()){const t=e.getLineContent(i.startLineNumber);let n=fn(t);-1===n&&(n=t.length),a=bG._createAddBlockCommentOperations(new tc(i.startLineNumber,n+1,i.startLineNumber,t.length+1),s,r,this._insertSpace)}else a=bG._createAddBlockCommentOperations(new tc(i.startLineNumber,e.getLineFirstNonWhitespaceColumn(i.startLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),s,r,this._insertSpace);1===a.length&&(this._deltaColumn=s.length+1)}this._selectionId=t.trackSelection(i);for(const e of a)t.addEditOperation(e.range,e.text)}getEditOperations(e,t){let i=this._selection;if(this._moveEndPositionDown=!1,i.startLineNumber===i.endLineNumber&&this._ignoreFirstLine)return t.addEditOperation(new tc(i.startLineNumber,e.getLineMaxColumn(i.startLineNumber),i.startLineNumber+1,1),i.startLineNumber===e.getLineCount()?"":"\n"),void(this._selectionId=t.trackSelection(i));i.startLineNumber<i.endLineNumber&&1===i.endColumn&&(this._moveEndPositionDown=!0,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const n=wG._gatherPreflightData(this._type,this._insertSpace,e,i.startLineNumber,i.endLineNumber,this._ignoreEmptyLines,this._ignoreFirstLine,this.languageConfigurationService);return n.supported?this._executeLineComments(e,t,n,i):this._executeBlockComment(e,t,i)}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),new ic(i.selectionStartLineNumber,i.selectionStartColumn+this._deltaColumn,i.positionLineNumber,i.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){const i=[];for(let n=0,o=e.length;n<o;n++){const o=e[n];o.ignore||i.push(vG.delete(new tc(t+n,o.commentStrOffset+1,t+n,o.commentStrOffset+o.commentStrLength+1)))}return i}_createAddLineCommentsOperations(e,t){const i=[],n=this._insertSpace?" ":"";for(let o=0,s=e.length;o<s;o++){const s=e[o];s.ignore||i.push(vG.insert(new ch(t+o,s.commentStrOffset+1),s.commentStr+n))}return i}static nextVisibleColumn(e,t,i,n){return i?e+(t-e%t):e+n}static _normalizeInsertionPoint(e,t,i,n){let o,s,r=1073741824;for(let o=0,s=t.length;o<s;o++){if(t[o].ignore)continue;const s=e.getLineContent(i+o);let a=0;for(let e=0,i=t[o].commentStrOffset;a<r&&e<i;e++)a=wG.nextVisibleColumn(a,n,9===s.charCodeAt(e),1);a<r&&(r=a)}r=Math.floor(r/n)*n;for(let a=0,l=t.length;a<l;a++){if(t[a].ignore)continue;const l=e.getLineContent(i+a);let h=0;for(o=0,s=t[a].commentStrOffset;h<r&&o<s;o++)h=wG.nextVisibleColumn(h,n,9===l.charCodeAt(o),1);t[a].commentStrOffset=h>r?o-1:o}}}class CG extends zd{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(Yg);if(!t.hasModel())return;const n=[],o=t.getModel().getOptions(),s=t.getOption(23),r=t.getSelections().map(((e,t)=>({selection:e,index:t,ignoreFirstLine:!1})));r.sort(((e,t)=>tc.compareRangesUsingStarts(e.selection,t.selection)));let a=r[0];for(let e=1;e<r.length;e++){const t=r[e];a.selection.endLineNumber===t.selection.startLineNumber&&(a.index<t.index?t.ignoreFirstLine=!0:(a.ignoreFirstLine=!0,a=t))}for(const e of r)n.push(new wG(i,e.selection,o.tabSize,this._type,s.insertSpace,s.ignoreEmptyLines,e.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}qd(class extends CG{constructor(){super(0,{id:"editor.action.commentLine",label:me(0,"Toggle Line Comment"),alias:"Toggle Line Comment",precondition:nc.writable,kbOpts:{kbExpr:nc.editorTextFocus,primary:2138,weight:100},menuOpts:{menuId:yd.MenubarEditMenu,group:"5_insert",title:me(0,"&&Toggle Line Comment"),order:1}})}}),qd(class extends CG{constructor(){super(1,{id:"editor.action.addCommentLine",label:me(0,"Add Line Comment"),alias:"Add Line Comment",precondition:nc.writable,kbOpts:{kbExpr:nc.editorTextFocus,primary:vt(2089,2081),weight:100}})}}),qd(class extends CG{constructor(){super(2,{id:"editor.action.removeCommentLine",label:me(0,"Remove Line Comment"),alias:"Remove Line Comment",precondition:nc.writable,kbOpts:{kbExpr:nc.editorTextFocus,primary:vt(2089,2099),weight:100}})}}),qd(class extends zd{constructor(){super({id:"editor.action.blockComment",label:me(0,"Toggle Block Comment"),alias:"Toggle Block Comment",precondition:nc.writable,kbOpts:{kbExpr:nc.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:yd.MenubarEditMenu,group:"5_insert",title:me(0,"Toggle &&Block Comment"),order:2}})}run(e,t){const i=e.get(Yg);if(!t.hasModel())return;const n=t.getOption(23),o=[],s=t.getSelections();for(const e of s)o.push(new bG(e,n.insertSpace,i));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}});class yG{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(e){return e.charCodeAt(0)-this._value.charCodeAt(this._pos)}value(){return this._value[this._pos]}}class SG{constructor(e=!0){this._caseSensitive=e}reset(e){return this._value=e,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let e=!0;for(;this._to<this._value.length;this._to++)if(46===this._value.charCodeAt(this._to)){if(!e)break;this._from++}else e=!1;return this}cmp(e){return this._caseSensitive?wn(e,this._value,0,e.length,this._from,this._to):yn(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class kG{constructor(e=!0,t=!0){this._splitOnBackslash=e,this._caseSensitive=t}reset(e){this._from=0,this._to=0,this._value=e,this._valueLen=e.length;for(let t=e.length-1;t>=0;t--,this._valueLen--){const e=this._value.charCodeAt(t);if(!(47===e||this._splitOnBackslash&&92===e))break}return this.next()}hasNext(){return this._to<this._valueLen}next(){this._from=this._to;let e=!0;for(;this._to<this._valueLen;this._to++){const t=this._value.charCodeAt(this._to);if(47===t||this._splitOnBackslash&&92===t){if(!e)break;this._from++}else e=!1}return this}cmp(e){return this._caseSensitive?wn(e,this._value,0,e.length,this._from,this._to):yn(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class LG{constructor(e,t){this._ignorePathCasing=e,this._ignoreQueryAndFragment=t,this._states=[],this._stateIdx=0}reset(e){return this._value=e,this._states=[],this._value.scheme&&this._states.push(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new kG(!1,!this._ignorePathCasing(e)),this._pathIterator.reset(e.path),this._pathIterator.value()&&this._states.push(3)),this._ignoreQueryAndFragment(e)||(this._value.query&&this._states.push(4),this._value.fragment&&this._states.push(5)),this._stateIdx=0,this}next(){return 3===this._states[this._stateIdx]&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return 3===this._states[this._stateIdx]&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(e){if(1===this._states[this._stateIdx])return Cn(e,this._value.scheme);if(2===this._states[this._stateIdx])return Cn(e,this._value.authority);if(3===this._states[this._stateIdx])return this._pathIterator.cmp(e);if(4===this._states[this._stateIdx])return bn(e,this._value.query);if(5===this._states[this._stateIdx])return bn(e,this._value.fragment);throw new Error}value(){if(1===this._states[this._stateIdx])return this._value.scheme;if(2===this._states[this._stateIdx])return this._value.authority;if(3===this._states[this._stateIdx])return this._pathIterator.value();if(4===this._states[this._stateIdx])return this._value.query;if(5===this._states[this._stateIdx])return this._value.fragment;throw new Error}}class xG{constructor(){this.height=1}rotateLeft(){const e=this.right;return this.right=e.left,e.left=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){const e=this.left;return this.left=e.right,e.right=this,this.updateHeight(),e.updateHeight(),e}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){var e,t;return null!==(t=null===(e=this.left)||void 0===e?void 0:e.height)&&void 0!==t?t:0}get heightRight(){var e,t;return null!==(t=null===(e=this.right)||void 0===e?void 0:e.height)&&void 0!==t?t:0}}class DG{static forUris(e=(()=>!1),t=(()=>!1)){return new DG(new LG(e,t))}static forStrings(){return new DG(new yG)}static forConfigKeys(){return new DG(new SG)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let n;this._root||(this._root=new xG,this._root.segment=i.value());const o=[];for(n=this._root;;){const e=i.cmp(n.segment);if(e>0)n.left||(n.left=new xG,n.left.segment=i.value()),o.push([-1,n]),n=n.left;else if(e<0)n.right||(n.right=new xG,n.right.segment=i.value()),o.push([1,n]),n=n.right;else{if(!i.hasNext())break;i.next(),n.mid||(n.mid=new xG,n.mid.segment=i.value()),o.push([0,n]),n=n.mid}}const s=n.value;n.value=t,n.key=e;for(let e=o.length-1;e>=0;e--){const t=o[e][1];t.updateHeight();const i=t.balanceFactor();if(i<-1||i>1){const i=o[e][0],n=o[e+1][0];if(1===i&&1===n)o[e][1]=t.rotateLeft();else if(-1===i&&-1===n)o[e][1]=t.rotateRight();else if(1===i&&-1===n)t.right=o[e+1][1]=o[e+1][1].rotateRight(),o[e][1]=t.rotateLeft();else{if(-1!==i||1!==n)throw new Error;t.left=o[e+1][1]=o[e+1][1].rotateLeft(),o[e][1]=t.rotateRight()}if(e>0)switch(o[e-1][0]){case-1:o[e-1][1].left=o[e][1];break;case 1:o[e-1][1].right=o[e][1];break;case 0:o[e-1][1].mid=o[e][1]}else this._root=o[0][1]}}return s}get(e){var t;return null===(t=this._getNode(e))||void 0===t?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const e=t.cmp(i.segment);if(e>0)i=i.left;else if(e<0)i=i.right;else{if(!t.hasNext())break;t.next(),i=i.mid}}return i}has(e){const t=this._getNode(e);return!(void 0===(null==t?void 0:t.value)&&void 0===(null==t?void 0:t.mid))}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var i;const n=this._iter.reset(e),o=[];let s=this._root;for(;s;){const e=n.cmp(s.segment);if(e>0)o.push([-1,s]),s=s.left;else if(e<0)o.push([1,s]),s=s.right;else{if(!n.hasNext())break;n.next(),o.push([0,s]),s=s.mid}}if(s){if(t?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){const e=this._min(s.right);if(e.key){const{key:t,value:i,segment:n}=e;this._delete(e.key,!1),s.key=t,s.value=i,s.segment=n}}else{const e=null!==(i=s.left)&&void 0!==i?i:s.right;if(o.length>0){const[t,i]=o[o.length-1];switch(t){case-1:i.left=e;break;case 0:i.mid=e;break;case 1:i.right=e}}else this._root=e}for(let e=o.length-1;e>=0;e--){const t=o[e][1];t.updateHeight();const i=t.balanceFactor();if(i>1?(t.right.balanceFactor()>=0||(t.right=t.right.rotateRight()),o[e][1]=t.rotateLeft()):i<-1&&(t.left.balanceFactor()<=0||(t.left=t.left.rotateLeft()),o[e][1]=t.rotateRight()),e>0)switch(o[e-1][0]){case-1:o[e-1][1].left=o[e][1];break;case 1:o[e-1][1].right=o[e][1];break;case 0:o[e-1][1].mid=o[e][1]}else this._root=o[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i,n=this._root;for(;n;){const e=t.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else{if(!t.hasNext())break;t.next(),i=n.value||i,n=n.mid}}return n&&n.value||i}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let n=this._root;for(;n;){const e=i.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else{if(!i.hasNext())return n.mid?this._entries(n.mid):t?n.value:void 0;i.next(),n=n.mid}}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value&&t.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const EG=hh("contextService");function NG(e){const t=e;return"string"==typeof(null==t?void 0:t.id)&&Ro.isUri(t.uri)}const IG={id:"empty-window"};class MG{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const TG=(me(0,"Code Workspace"),"4064f6ec-cb38-4ad0-af64-ee6467e63c82");var AG,RG=function(e,t){return function(i,n){t(i,n,e)}};let OG=AG=class{static get(e){return e.getContribution(AG.ID)}constructor(e,t,i,n,o,s,r,a){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=n,this._keybindingService=o,this._menuService=s,this._configurationService=r,this._workspaceContextService=a,this._toDispose=new M,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu((e=>this._onContextMenu(e)))),this._toDispose.add(this._editor.onMouseWheel((e=>{if(this._contextMenuIsBeingShownCount>0){const t=this._contextViewService.getContextViewElement(),i=e.srcElement;i.shadowRoot&&Hs(t)===i.shadowRoot||this._contextViewService.hideContextView()}}))),this._toDispose.add(this._editor.onKeyDown((e=>{this._editor.getOption(24)&&58===e.keyCode&&(e.preventDefault(),e.stopPropagation(),this.showContextMenu())})))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(24))return this._editor.focus(),void(e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position));if(12===e.target.type)return;if(6===e.target.type&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),11===e.target.type)return this._showScrollbarContextMenu(e.event);if(6!==e.target.type&&7!==e.target.type&&1!==e.target.type)return;if(this._editor.focus(),e.target.position){let t=!1;for(const i of this._editor.getSelections())if(i.containsPosition(e.target.position)){t=!0;break}t||this._editor.setPosition(e.target.position)}let t=null;1!==e.target.type&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(24))return;if(!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?yd.SimpleEditorContext:yd.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],n=this._menuService.createMenu(t,this._contextKeyService),o=n.getActions({arg:e.uri});n.dispose();for(const t of o){const[,n]=t;let o=0;for(const t of n)if(t instanceof xd){const n=this._getMenuActions(e,t.item.submenu);n.length>0&&(i.push(new _h(t.id,t.label,n)),o++)}else i.push(t),o++;o&&i.push(new fh)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let n=t;if(!n){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const e=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),t=As(this._editor.getDomNode()),i=t.left+e.left,o=t.top+e.top+e.height;n={x:i,y:o}}const o=this._editor.getOption(126)&&!je;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:o?this._editor.getDomNode():void 0,getAnchor:()=>n,getActions:()=>e,getActionViewItem:e=>{const t=this._keybindingFor(e);if(t)return new NE(e,e,{label:!0,keybinding:t.getLabel(),isMenu:!0});const i=e;return"function"==typeof i.getActionViewItem?i.getActionViewItem():new NE(e,e,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:e=>this._keybindingFor(e),onHide:e=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel())return;if(this._workspaceContextService.getWorkspace().id===TG)return;const t=this._editor.getOption(72);let i=0;const n=e=>({id:"menu-action-"+ ++i,label:e.label,tooltip:"",class:void 0,enabled:void 0===e.enabled||e.enabled,checked:e.checked,run:e.run}),o=(e,t,o,s,r)=>{if(!t)return n({label:e,enabled:t,run:()=>{}});const a=e=>()=>{this._configurationService.updateValue(o,e)},l=[];for(const e of r)l.push(n({label:e.label,checked:s===e.value,run:a(e.value)}));return((e,t)=>new _h("menu-action-"+ ++i,e,t,void 0))(e,l)},s=[];s.push(n({label:me(0,"Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),s.push(new fh),s.push(n({label:me(0,"Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),s.push(o(me(0,"Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:me(0,"Proportional"),value:"proportional"},{label:me(0,"Fill"),value:"fill"},{label:me(0,"Fit"),value:"fit"}])),s.push(o(me(0,"Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:me(0,"Mouse Over"),value:"mouseover"},{label:me(0,"Always"),value:"always"}]));const r=this._editor.getOption(126)&&!je;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:r?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>s,onHide:e=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};OG.ID="editor.contrib.contextmenu",OG=AG=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([RG(1,qE),RG(2,jE),RG(3,sd),RG(4,ML),RG(5,Sd),RG(6,ug),RG(7,EG)],OG),Gd(OG.ID,OG,2),qd(class extends zd{constructor(){super({id:"editor.action.showContextMenu",label:me(0,"Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:nc.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;null===(i=OG.get(t))||void 0===i||i.showContextMenu()}});class PG{constructor(e){this.selections=e}equals(e){const t=this.selections.length;if(t!==e.selections.length)return!1;for(let i=0;i<t;i++)if(!this.selections[i].equalsSelection(e.selections[i]))return!1;return!0}}class FG{constructor(e,t,i){this.cursorState=e,this.scrollTop=t,this.scrollLeft=i}}class BG extends T{static get(e){return e.getContribution(BG.ID)}constructor(e){super(),this._editor=e,this._isCursorUndoRedo=!1,this._undoStack=[],this._redoStack=[],this._register(e.onDidChangeModel((e=>{this._undoStack=[],this._redoStack=[]}))),this._register(e.onDidChangeModelContent((e=>{this._undoStack=[],this._redoStack=[]}))),this._register(e.onDidChangeCursorSelection((t=>{if(this._isCursorUndoRedo)return;if(!t.oldSelections)return;if(t.oldModelVersionId!==t.modelVersionId)return;const i=new PG(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new FG(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())})))}cursorUndo(){this._editor.hasModel()&&0!==this._undoStack.length&&(this._redoStack.push(new FG(new PG(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){this._editor.hasModel()&&0!==this._redoStack.length&&(this._undoStack.push(new FG(new PG(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}}BG.ID="editor.contrib.cursorUndoRedoController",Gd(BG.ID,BG,0),qd(class extends zd{constructor(){super({id:"cursorUndo",label:me(0,"Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:nc.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var n;null===(n=BG.get(t))||void 0===n||n.cursorUndo()}}),qd(class extends zd{constructor(){super({id:"cursorRedo",label:me(0,"Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){var n;null===(n=BG.get(t))||void 0===n||n.cursorRedo()}});var WG=i(3050),VG={};function zG(){return no&&!!no.VSCODE_DEV}function HG(e){if(zG()){const t=function(){UG||(UG=new Set);const e=globalThis;return e.$hotReload_applyNewExports||(e.$hotReload_applyNewExports=e=>{for(const t of UG){const i=t(e);if(i)return i}}),UG}();return t.add(e),{dispose(){t.delete(e)}}}return{dispose(){}}}let UG;function KG(e,t){const i=new M,n=e.createDecorationsCollection();return i.add(C$({debugName:()=>`Apply decorations from ${t.debugName}`},(e=>{const i=t.read(e);n.set(i)}))),i.add({dispose:()=>{n.clear()}}),i}function jG(e,t){return e.appendChild(t),I((()=>{e.removeChild(t)}))}VG.styleTagTransform=Vr(),VG.setAttributes=Pr(),VG.insert=Rr().bind(null,"head"),VG.domAPI=Tr(),VG.insertStyleElement=Br(),Ir()(WG.Z,VG),WG.Z&&WG.Z.locals&&WG.Z.locals,zG()&&HG((({oldExports:e,newSrc:t})=>{if(-1!==t.indexOf("/* hot-reload:patch-prototype-methods */"))return t=>{var i,n;for(const o in t){const s=t[o];if(console.log(`[hot-reload] Patching prototype methods of '${o}'`,{exportedItem:s}),"function"==typeof s&&s.prototype){const r=e[o];if(r){for(const e of Object.getOwnPropertyNames(s.prototype)){const t=Object.getOwnPropertyDescriptor(s.prototype,e),a=Object.getOwnPropertyDescriptor(r.prototype,e);(null===(i=null==t?void 0:t.value)||void 0===i?void 0:i.toString())!==(null===(n=null==a?void 0:a.value)||void 0===n?void 0:n.toString())&&console.log(`[hot-reload] Patching prototype method '${o}.${e}'`),Object.defineProperty(r.prototype,e,t)}t[o]=r}}}return!0}}));class qG extends T{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new pR(e,t)),this._width=d$(this,this.elementSizeObserver.getWidth()),this._height=d$(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange((e=>e$((e=>{this._width.set(this.elementSizeObserver.getWidth(),e),this._height.set(this.elementSizeObserver.getHeight(),e)})))))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function $G(e,t,i){let n=t.get(),o=n,s=n;const r=d$("animatedValue",n);let a,l=-1;function h(){const t=Date.now()-l;var i,d,c;s=Math.floor((d=o,c=n-o,(i=t)===300?d+c:c*(1-Math.pow(2,-10*i/300))+d)),t<300?a=e.requestAnimationFrame(h):s=n,r.set(s,void 0)}return i.add(y$({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(e,i)=>(e.didChange(t)&&(i.animate=i.animate||e.change),!0)},((i,r)=>{void 0!==a&&(e.cancelAnimationFrame(a),a=void 0),o=s,n=t.read(i),l=Date.now()-(r.animate?0:300),h()}))),r}class GG extends T{constructor(e,t,i){super(),this._register(new YG(e,i)),this._register(QG(i,{height:t.actualHeight,top:t.actualTop}))}}class ZG{get afterLineNumber(){return this._afterLineNumber.get()}constructor(e,t){this._afterLineNumber=e,this.heightInPx=t,this.domNode=document.createElement("div"),this._actualTop=d$(this,void 0),this._actualHeight=d$(this,void 0),this.actualTop=this._actualTop,this.actualHeight=this._actualHeight,this.showInHiddenAreas=!0,this.onChange=this._afterLineNumber,this.onDomNodeTop=e=>{this._actualTop.set(e,void 0)},this.onComputedHeight=e=>{this._actualHeight.set(e,void 0)}}}class YG{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId="managedOverlayWidget-"+YG._counter++,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}function QG(e,t){return w$((i=>{for(let[n,o]of Object.entries(t))o&&"object"==typeof o&&"read"in o&&(o=o.read(i)),"number"==typeof o&&(o=`${o}px`),n=n.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),e.style[n]=o}))}function XG(e,t){return function(e,t){zG()&&N$("reload",(t=>HG((({oldExports:i})=>{if([...Object.values(i)].some((t=>e.includes(t))))return e=>(t(void 0),!0)})))).read(t)}([e],t),e}function JG(e,t,i,n){const o=new M,s=[];return o.add(S$(((o,r)=>{const a=t.read(o),l=new Map,h=new Map;i&&i(!0),e.changeViewZones((e=>{for(const t of s)e.removeZone(t),null==n||n.delete(t);s.length=0;for(const t of a){const i=e.addZone(t);t.setZoneId&&t.setZoneId(i),s.push(i),null==n||n.add(i),l.set(t,i)}})),i&&i(!1),r.add(y$({createEmptyChangeSummary:()=>({zoneIds:[]}),handleChange(e,t){const i=h.get(e.changedObservable);return void 0!==i&&t.zoneIds.push(i),!0}},((t,n)=>{for(const e of a)e.onChange&&(h.set(e.onChange,l.get(e)),e.onChange.read(t));i&&i(!0),e.changeViewZones((e=>{for(const t of n.zoneIds)e.layoutZone(t)})),i&&i(!1)})))}))),o.add({dispose(){i&&i(!0),e.changeViewZones((e=>{for(const t of s)e.removeZone(t)})),null==n||n.clear(),i&&i(!1)}}),o}YG._counter=0;class eZ extends Pt{dispose(){super.dispose(!0)}}function tZ(e,t){const i=uu(t,(t=>t.original.startLineNumber<=e.lineNumber));if(!i)return tc.fromPositions(e);if(i.original.endLineNumberExclusive<=e.lineNumber){const t=e.lineNumber-i.original.endLineNumberExclusive+i.modified.endLineNumberExclusive;return tc.fromPositions(new ch(t,e.column))}if(!i.innerChanges)return tc.fromPositions(new ch(i.modified.startLineNumber,1));const n=uu(i.innerChanges,(t=>t.originalRange.getStartPosition().isBeforeOrEqual(e)));if(!n){const t=e.lineNumber-i.original.startLineNumber+i.modified.startLineNumber;return tc.fromPositions(new ch(t,e.column))}if(n.originalRange.containsPosition(e))return n.modifiedRange;{const t=(r=n.originalRange.getEndPosition(),a=e,r.lineNumber===a.lineNumber?new cp(0,a.column-r.column):new cp(a.lineNumber-r.lineNumber,a.column-1));return tc.fromPositions((o=n.modifiedRange.getEndPosition(),0===(s=t).lineCount?new ch(o.lineNumber,o.column+s.columnCount):new ch(o.lineNumber+s.lineCount,s.columnCount+1)))}var o,s,r,a}function iZ(e,t,i){const n=e.bindTo(t);return C$({debugName:()=>`Update ${e.key}`},(e=>{n.set(i(e))}))}const nZ=hh("audioCue");class oZ{static register(e){return new oZ(e.fileName)}constructor(e){this.fileName=e}}oZ.error=oZ.register({fileName:"error.mp3"}),oZ.warning=oZ.register({fileName:"warning.mp3"}),oZ.foldedArea=oZ.register({fileName:"foldedAreas.mp3"}),oZ.break=oZ.register({fileName:"break.mp3"}),oZ.quickFixes=oZ.register({fileName:"quickFixes.mp3"}),oZ.taskCompleted=oZ.register({fileName:"taskCompleted.mp3"}),oZ.taskFailed=oZ.register({fileName:"taskFailed.mp3"}),oZ.terminalBell=oZ.register({fileName:"terminalBell.mp3"}),oZ.diffLineInserted=oZ.register({fileName:"diffLineInserted.mp3"}),oZ.diffLineDeleted=oZ.register({fileName:"diffLineDeleted.mp3"}),oZ.diffLineModified=oZ.register({fileName:"diffLineModified.mp3"}),oZ.chatRequestSent=oZ.register({fileName:"chatRequestSent.mp3"}),oZ.chatResponsePending=oZ.register({fileName:"chatResponsePending.mp3"}),oZ.chatResponseReceived1=oZ.register({fileName:"chatResponseReceived1.mp3"}),oZ.chatResponseReceived2=oZ.register({fileName:"chatResponseReceived2.mp3"}),oZ.chatResponseReceived3=oZ.register({fileName:"chatResponseReceived3.mp3"}),oZ.chatResponseReceived4=oZ.register({fileName:"chatResponseReceived4.mp3"}),oZ.clear=oZ.register({fileName:"clear.mp3"}),oZ.save=oZ.register({fileName:"save.mp3"}),oZ.format=oZ.register({fileName:"format.mp3"});class sZ{constructor(e){this.randomOneOf=e}}class rZ{static register(e){const t=new sZ("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new rZ(t,e.name,e.settingsKey);return rZ._audioCues.add(i),i}constructor(e,t,i){this.sound=e,this.name=t,this.settingsKey=i}}rZ._audioCues=new Set,rZ.error=rZ.register({name:me(0,"Error on Line"),sound:oZ.error,settingsKey:"audioCues.lineHasError"}),rZ.warning=rZ.register({name:me(0,"Warning on Line"),sound:oZ.warning,settingsKey:"audioCues.lineHasWarning"}),rZ.foldedArea=rZ.register({name:me(0,"Folded Area on Line"),sound:oZ.foldedArea,settingsKey:"audioCues.lineHasFoldedArea"}),rZ.break=rZ.register({name:me(0,"Breakpoint on Line"),sound:oZ.break,settingsKey:"audioCues.lineHasBreakpoint"}),rZ.inlineSuggestion=rZ.register({name:me(0,"Inline Suggestion on Line"),sound:oZ.quickFixes,settingsKey:"audioCues.lineHasInlineSuggestion"}),rZ.terminalQuickFix=rZ.register({name:me(0,"Terminal Quick Fix"),sound:oZ.quickFixes,settingsKey:"audioCues.terminalQuickFix"}),rZ.onDebugBreak=rZ.register({name:me(0,"Debugger Stopped on Breakpoint"),sound:oZ.break,settingsKey:"audioCues.onDebugBreak"}),rZ.noInlayHints=rZ.register({name:me(0,"No Inlay Hints on Line"),sound:oZ.error,settingsKey:"audioCues.noInlayHints"}),rZ.taskCompleted=rZ.register({name:me(0,"Task Completed"),sound:oZ.taskCompleted,settingsKey:"audioCues.taskCompleted"}),rZ.taskFailed=rZ.register({name:me(0,"Task Failed"),sound:oZ.taskFailed,settingsKey:"audioCues.taskFailed"}),rZ.terminalCommandFailed=rZ.register({name:me(0,"Terminal Command Failed"),sound:oZ.error,settingsKey:"audioCues.terminalCommandFailed"}),rZ.terminalBell=rZ.register({name:me(0,"Terminal Bell"),sound:oZ.terminalBell,settingsKey:"audioCues.terminalBell"}),rZ.notebookCellCompleted=rZ.register({name:me(0,"Notebook Cell Completed"),sound:oZ.taskCompleted,settingsKey:"audioCues.notebookCellCompleted"}),rZ.notebookCellFailed=rZ.register({name:me(0,"Notebook Cell Failed"),sound:oZ.taskFailed,settingsKey:"audioCues.notebookCellFailed"}),rZ.diffLineInserted=rZ.register({name:me(0,"Diff Line Inserted"),sound:oZ.diffLineInserted,settingsKey:"audioCues.diffLineInserted"}),rZ.diffLineDeleted=rZ.register({name:me(0,"Diff Line Deleted"),sound:oZ.diffLineDeleted,settingsKey:"audioCues.diffLineDeleted"}),rZ.diffLineModified=rZ.register({name:me(0,"Diff Line Modified"),sound:oZ.diffLineModified,settingsKey:"audioCues.diffLineModified"}),rZ.chatRequestSent=rZ.register({name:me(0,"Chat Request Sent"),sound:oZ.chatRequestSent,settingsKey:"audioCues.chatRequestSent"}),rZ.chatResponseReceived=rZ.register({name:me(0,"Chat Response Received"),settingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[oZ.chatResponseReceived1,oZ.chatResponseReceived2,oZ.chatResponseReceived3,oZ.chatResponseReceived4]}}),rZ.chatResponsePending=rZ.register({name:me(0,"Chat Response Pending"),sound:oZ.chatResponsePending,settingsKey:"audioCues.chatResponsePending"}),rZ.clear=rZ.register({name:me(0,"Clear"),sound:oZ.clear,settingsKey:"audioCues.clear"}),rZ.save=rZ.register({name:me(0,"Save"),sound:oZ.save,settingsKey:"audioCues.save"}),rZ.format=rZ.register({name:me(0,"Format"),sound:oZ.format,settingsKey:"audioCues.format"});var aZ=i(5325),lZ={};lZ.styleTagTransform=Vr(),lZ.setAttributes=Pr(),lZ.insert=Rr().bind(null,"head"),lZ.domAPI=Tr(),lZ.insertStyleElement=Br(),Ir()(aZ.Z,lZ),aZ.Z&&aZ.Z.locals&&aZ.Z.locals;var hZ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},dZ=function(e,t){return function(i,n){t(i,n,e)}};const cZ=EA("diff-review-insert",Sl.add,me(0,"Icon for 'Insert' in accessible diff viewer.")),uZ=EA("diff-review-remove",Sl.remove,me(0,"Icon for 'Remove' in accessible diff viewer.")),gZ=EA("diff-review-close",Sl.close,me(0,"Icon for 'Close' in accessible diff viewer."));let pZ=class extends T{constructor(e,t,i,n,o,s,r,a,l){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=n,this._width=o,this._height=s,this._diffs=r,this._editors=a,this._instantiationService=l,this._state=_$(this,((e,t)=>{const i=this._visible.read(e);if(this._parentNode.style.visibility=i?"visible":"hidden",!i)return null;const n=t.add(this._instantiationService.createInstance(mZ,this._diffs,this._editors,this._setVisible,this._canClose));return{model:n,view:t.add(this._instantiationService.createInstance(SZ,this._parentNode,n,this._width,this._height,this._editors))}})).recomputeInitiallyAndOnChange(this._store)}next(){e$((e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)}))}prev(){e$((e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)}))}close(){e$((e=>{this._setVisible(!1,e)}))}};pZ._ttPolicy=Tx("diffReview",{createHTML:e=>e}),pZ=hZ([dZ(8,lh)],pZ);let mZ=class extends T{constructor(e,t,i,n,o){super(),this._diffs=e,this._editors=t,this._setVisible=i,this.canClose=n,this._audioCueService=o,this._groups=d$(this,[]),this._currentGroupIdx=d$(this,0),this._currentElementIdx=d$(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map(((e,t)=>this._groups.read(t)[e])),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map(((e,t)=>{var i;return null===(i=this.currentGroup.read(t))||void 0===i?void 0:i.lines[e]})),this._register(w$((e=>{const t=this._diffs.read(e);if(!t)return void this._groups.set([],void 0);const i=function(e,t,i){const n=[];for(const o of Rc(e,((e,t)=>t.modified.startLineNumber-e.modified.endLineNumberExclusive<2*fZ))){const e=[];e.push(new bZ);const s=new bu(Math.max(1,o[0].original.startLineNumber-fZ),Math.min(o[o.length-1].original.endLineNumberExclusive+fZ,t+1)),r=new bu(Math.max(1,o[0].modified.startLineNumber-fZ),Math.min(o[o.length-1].modified.endLineNumberExclusive+fZ,i+1));Oc(o,((t,i)=>{const n=new bu(t?t.original.endLineNumberExclusive:s.startLineNumber,i?i.original.startLineNumber:s.endLineNumberExclusive),o=new bu(t?t.modified.endLineNumberExclusive:r.startLineNumber,i?i.modified.startLineNumber:r.endLineNumberExclusive);n.forEach((t=>{e.push(new yZ(t,o.startLineNumber+(t-n.startLineNumber)))})),i&&(i.original.forEach((t=>{e.push(new wZ(i,t))})),i.modified.forEach((t=>{e.push(new CZ(i,t))})))}));const a=o[0].modified.join(o[o.length-1].modified),l=o[0].original.join(o[o.length-1].original);n.push(new vZ(new JM(a,l),e))}return n}(t,this._editors.original.getModel().getLineCount(),this._editors.modified.getModel().getLineCount());e$((e=>{const t=this._editors.modified.getPosition();if(t){const n=i.findIndex((e=>(null==t?void 0:t.lineNumber)<e.range.modified.endLineNumberExclusive));-1!==n&&this._currentGroupIdx.set(n,e)}this._groups.set(i,e)}))}))),this._register(w$((e=>{const t=this.currentElement.read(e);(null==t?void 0:t.type)===_Z.Deleted?this._audioCueService.playAudioCue(rZ.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(null==t?void 0:t.type)===_Z.Added&&this._audioCueService.playAudioCue(rZ.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})}))),this._register(w$((e=>{var t;const i=this.currentElement.read(e);if(i&&i.type!==_Z.Header){const e=null!==(t=i.modifiedLineNumber)&&void 0!==t?t:i.diff.modified.startLineNumber;this._editors.modified.setSelection(tc.fromPositions(new ch(e,1)))}})))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||i$(t,(t=>{this._currentGroupIdx.set(du.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),t),this._currentElementIdx.set(0,t)}))}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||e$((i=>{this._currentElementIdx.set(du.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)}))}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const i=t.lines.indexOf(e);-1!==i&&e$((e=>{this._currentElementIdx.set(i,e)}))}revealCurrentElementInEditor(){this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===_Z.Deleted?(this._editors.original.setSelection(tc.fromPositions(new ch(e.originalLineNumber,1))),this._editors.original.revealLine(e.originalLineNumber),this._editors.original.focus()):(e.type!==_Z.Header&&(this._editors.modified.setSelection(tc.fromPositions(new ch(e.modifiedLineNumber,1))),this._editors.modified.revealLine(e.modifiedLineNumber)),this._editors.modified.focus()))}close(){this._setVisible(!1,void 0),this._editors.modified.focus()}};mZ=hZ([dZ(4,nZ)],mZ);const fZ=3;var _Z;!function(e){e[e.Header=0]="Header",e[e.Unchanged=1]="Unchanged",e[e.Deleted=2]="Deleted",e[e.Added=3]="Added"}(_Z||(_Z={}));class vZ{constructor(e,t){this.range=e,this.lines=t}}class bZ{constructor(){this.type=_Z.Header}}class wZ{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=_Z.Deleted,this.modifiedLineNumber=void 0}}class CZ{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=_Z.Added,this.originalLineNumber=void 0}}class yZ{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=_Z.Unchanged}}let SZ=class extends T{constructor(e,t,i,n,o,s){super(),this._element=e,this._model=t,this._width=i,this._height=n,this._editors=o,this._languageService=s,this.domNode=this._element,this.domNode.className="diff-review monaco-editor-background";const r=document.createElement("div");r.className="diff-review-actions",this._actionBar=this._register(new ME(r)),this._register(w$((e=>{this._actionBar.clear(),this._model.canClose.read(e)&&this._actionBar.push(new ph("diffreview.close",me(0,"Close"),"close-diff-review "+Ll.asClassName(gZ),!0,(async()=>t.close())),{label:!1,icon:!0})}))),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new ND(this._content,{})),cr(this.domNode,this._scrollbar.getDomNode(),r),this._register(I((()=>{cr(this.domNode)}))),this._register(QG(this.domNode,{width:this._width,height:this._height})),this._register(QG(this._content,{width:this._width,height:this._height})),this._register(S$(((e,t)=>{this._model.currentGroup.read(e),this._render(t)}))),this._register(Cs(this.domNode,"keydown",(e=>{(e.equals(18)||e.equals(2066)||e.equals(530))&&(e.preventDefault(),this._model.goToNextLine()),(e.equals(16)||e.equals(2064)||e.equals(528))&&(e.preventDefault(),this._model.goToPreviousLine()),(e.equals(9)||e.equals(2057)||e.equals(521)||e.equals(1033))&&(e.preventDefault(),this._model.close()),(e.equals(10)||e.equals(3))&&(e.preventDefault(),this._model.revealCurrentElementInEditor())})))}_render(e){const t=this._editors.original.getOptions(),i=this._editors.modified.getOptions(),n=document.createElement("div");n.className="diff-review-table",n.setAttribute("role","list"),n.setAttribute("aria-label",me(0,"Accessible Diff Viewer. Use arrow up and down to navigate.")),Bx(n,i.get(50)),cr(this._content,n);const o=this._editors.original.getModel(),s=this._editors.modified.getModel();if(!o||!s)return;const r=o.getOptions(),a=s.getOptions(),l=i.get(66),h=this._model.currentGroup.get();for(const d of(null==h?void 0:h.lines)||[]){if(!h)break;let c;if(d.type===_Z.Header){const e=document.createElement("div");e.className="diff-review-row",e.setAttribute("role","listitem");const t=h.range,i=this._model.currentGroupIndex.get(),n=this._model.groups.get().length,o=e=>0===e?me(0,"no lines changed"):1===e?me(0,"1 line changed"):me(0,"{0} lines changed",e),s=o(t.original.length),r=o(t.modified.length);e.setAttribute("aria-label",me(0,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",i+1,n,t.original.startLineNumber,s,t.modified.startLineNumber,r));const a=document.createElement("div");a.className="diff-review-cell diff-review-summary",a.appendChild(document.createTextNode(`${i+1}/${n}: @@ -${t.original.startLineNumber},${t.original.length} +${t.modified.startLineNumber},${t.modified.length} @@`)),e.appendChild(a),c=e}else c=this._createRow(d,l,this._width.get(),t,o,r,i,s,a);n.appendChild(c);const u=m$((e=>this._model.currentElement.read(e)===d));e.add(w$((e=>{const t=u.read(e);c.tabIndex=t?0:-1,t&&c.focus()}))),e.add(bs(c,"focus",(()=>{this._model.goToLine(d)})))}this._scrollbar.scanDomNode()}_createRow(e,t,i,n,o,s,r,a,l){const h=n.get(143),d=h.glyphMarginWidth+h.lineNumbersWidth,c=r.get(143),u=10+c.glyphMarginWidth+c.lineNumbersWidth;let g="diff-review-row",p="",m=null;switch(e.type){case _Z.Added:g="diff-review-row line-insert",p=" char-insert",m=cZ;break;case _Z.Deleted:g="diff-review-row line-delete",p=" char-delete",m=uZ}const f=document.createElement("div");f.style.minWidth=i+"px",f.className=g,f.setAttribute("role","listitem"),f.ariaLevel="";const _=document.createElement("div");_.className="diff-review-cell",_.style.height=`${t}px`,f.appendChild(_);const v=document.createElement("span");v.style.width=d+"px",v.style.minWidth=d+"px",v.className="diff-review-line-number"+p,void 0!==e.originalLineNumber?v.appendChild(document.createTextNode(String(e.originalLineNumber))):v.innerText=" ",_.appendChild(v);const b=document.createElement("span");b.style.width=u+"px",b.style.minWidth=u+"px",b.style.paddingRight="10px",b.className="diff-review-line-number"+p,void 0!==e.modifiedLineNumber?b.appendChild(document.createTextNode(String(e.modifiedLineNumber))):b.innerText=" ",_.appendChild(b);const w=document.createElement("span");if(w.className="diff-review-spacer",m){const e=document.createElement("span");e.className=Ll.asClassName(m),e.innerText="  ",w.appendChild(e)}else w.innerText="  ";let C;if(_.appendChild(w),void 0!==e.modifiedLineNumber){let t=this._getLineHtml(a,r,l.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);pZ._ttPolicy&&(t=pZ._ttPolicy.createHTML(t)),_.insertAdjacentHTML("beforeend",t),C=a.getLineContent(e.modifiedLineNumber)}else{let t=this._getLineHtml(o,n,s.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);pZ._ttPolicy&&(t=pZ._ttPolicy.createHTML(t)),_.insertAdjacentHTML("beforeend",t),C=o.getLineContent(e.originalLineNumber)}0===C.length&&(C=me(0,"blank"));let y="";switch(e.type){case _Z.Unchanged:y=e.originalLineNumber===e.modifiedLineNumber?me(0,"{0} unchanged line {1}",C,e.originalLineNumber):me(0,"{0} original line {1} modified line {2}",C,e.originalLineNumber,e.modifiedLineNumber);break;case _Z.Added:y=me(0,"+ {0} modified line {1}",C,e.modifiedLineNumber);break;case _Z.Deleted:y=me(0,"- {0} original line {1}",C,e.originalLineNumber)}return f.setAttribute("aria-label",y),f}_getLineHtml(e,t,i,n,o){const s=e.getLineContent(n),r=t.get(50),a=IC.createEmpty(s,o),l=nF.isBasicASCII(s,e.mightContainNonBasicASCII()),h=nF.containsRTL(s,l,e.mightContainRTL());return nO(new QR(r.isMonospace&&!t.get(33),r.canUseHalfwidthRightwardsArrow,s,!1,l,h,0,a,[],i,0,r.spaceWidth,r.middotWidth,r.wsmiddotWidth,t.get(116),t.get(98),t.get(93),t.get(51)!==Lk.OFF,null)).html}};SZ=hZ([dZ(5,yu)],SZ);const kZ=EA("diff-insert",Sl.add,me(0,"Line decoration for inserts in the diff editor.")),LZ=EA("diff-remove",Sl.remove,me(0,"Line decoration for removals in the diff editor.")),xZ=Sy.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Ll.asClassName(kZ),marginClassName:"gutter-insert"}),DZ=Sy.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Ll.asClassName(LZ),marginClassName:"gutter-delete"}),EZ=Sy.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),NZ=Sy.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),IZ=Sy.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),MZ=Sy.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),TZ=Sy.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),AZ=Sy.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),RZ=Sy.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),OZ=Sy.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});class PZ extends T{constructor(e,t,i,n,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=n,this._editors=o,this._originalScrollTop=D$(this._editors.original.onDidScrollChange,(()=>this._editors.original.getScrollTop())),this._modifiedScrollTop=D$(this._editors.modified.onDidScrollChange,(()=>this._editors.modified.getScrollTop())),this._viewZonesChanged=N$("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=d$(this,0),this._modifiedViewZonesChangedSignal=N$("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=N$("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=_$(this,((e,t)=>{var i;this._element.replaceChildren();const n=this._diffModel.read(e),o=null===(i=null==n?void 0:n.diff.read(e))||void 0===i?void 0:i.movedTexts;if(!o||0===o.length)return void this.width.set(0,void 0);this._viewZonesChanged.read(e);const s=this._originalEditorLayoutInfo.read(e),r=this._modifiedEditorLayoutInfo.read(e);if(!s||!r)return void this.width.set(0,void 0);this._modifiedViewZonesChangedSignal.read(e),this._originalViewZonesChangedSignal.read(e);const a=o.map((t=>{function i(e,t){return(t.getTopForLineNumber(e.startLineNumber,!0)+t.getTopForLineNumber(e.endLineNumberExclusive,!0))/2}const n=i(t.lineRangeMapping.original,this._editors.original),o=this._originalScrollTop.read(e),s=i(t.lineRangeMapping.modified,this._editors.modified),r=n-o,a=s-this._modifiedScrollTop.read(e),l=Math.min(n,s),h=Math.max(n,s);return{range:new du(l,h),from:r,to:a,fromWithoutScroll:n,toWithoutScroll:s,move:t}}));a.sort(function(...e){return(t,i)=>{for(const n of e){const e=n(t,i);if(!yc.isNeitherLessOrGreaterThan(e))return e}return yc.neitherLessOrGreaterThan}}(Yc((e=>e.fromWithoutScroll>e.toWithoutScroll),Xc),Yc((e=>e.fromWithoutScroll>e.toWithoutScroll?e.fromWithoutScroll:-e.toWithoutScroll),Qc)));const l=FZ.compute(a.map((e=>e.range))),h=s.verticalScrollbarWidth,d=10*(l.getTrackCount()-1)+20,c=h+d+(r.contentLeft-PZ.movedCodeBlockPadding);let u=0;for(const e of a){const i=h+10+10*l.getTrack(u),o=15,s=15,a=c,d=r.glyphMarginWidth+r.lineNumbersWidth,g=18,p=document.createElementNS("http://www.w3.org/2000/svg","rect");p.classList.add("arrow-rectangle"),p.setAttribute("x",""+(a-d)),p.setAttribute("y",""+(e.to-g/2)),p.setAttribute("width",`${d}`),p.setAttribute("height",`${g}`),this._element.appendChild(p);const m=document.createElementNS("http://www.w3.org/2000/svg","g"),f=document.createElementNS("http://www.w3.org/2000/svg","path");f.setAttribute("d",`M 0 ${e.from} L ${i} ${e.from} L ${i} ${e.to} L ${a-s} ${e.to}`),f.setAttribute("fill","none"),m.appendChild(f);const _=document.createElementNS("http://www.w3.org/2000/svg","polygon");_.classList.add("arrow"),t.add(w$((t=>{f.classList.toggle("currentMove",e.move===n.activeMovedText.read(t)),_.classList.toggle("currentMove",e.move===n.activeMovedText.read(t))}))),_.setAttribute("points",`${a-s},${e.to-o/2} ${a},${e.to} ${a-s},${e.to+o/2}`),m.appendChild(_),this._element.appendChild(m),u++}this.width.set(d,void 0)})),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(I((()=>this._element.remove()))),this._register(w$((e=>{const t=this._originalEditorLayoutInfo.read(e),i=this._modifiedEditorLayoutInfo.read(e);t&&i&&(this._element.style.left=t.width-t.verticalScrollbarWidth+"px",this._element.style.height=`${t.height}px`,this._element.style.width=`${t.verticalScrollbarWidth+t.contentLeft-PZ.movedCodeBlockPadding+this.width.read(e)}px`)}))),this._register(A$(this._state));const s=m$((e=>{const t=this._diffModel.read(e),i=null==t?void 0:t.diff.read(e);return i?i.movedTexts.map((e=>({move:e,original:new ZG(L$(e.lineRangeMapping.original.startLineNumber-1),18),modified:new ZG(L$(e.lineRangeMapping.modified.startLineNumber-1),18)}))):[]}));this._register(JG(this._editors.original,s.map((e=>e.map((e=>e.original)))))),this._register(JG(this._editors.modified,s.map((e=>e.map((e=>e.modified)))))),this._register(S$(((e,t)=>{const i=s.read(e);for(const e of i)t.add(new BZ(this._editors.original,e.original,e.move,"original",this._diffModel.get())),t.add(new BZ(this._editors.modified,e.modified,e.move,"modified",this._diffModel.get()))})));const r=D$(this._editors.original.onDidChangeCursorPosition,(()=>this._editors.original.getPosition())),a=D$(this._editors.modified.onDidChangeCursorPosition,(()=>this._editors.modified.getPosition())),l=N$("original.onDidFocusEditorWidget",(e=>this._editors.original.onDidFocusEditorWidget((()=>setTimeout((()=>e(void 0)),0))))),h=N$("modified.onDidFocusEditorWidget",(e=>this._editors.modified.onDidFocusEditorWidget((()=>setTimeout((()=>e(void 0)),0)))));let d="modified";this._register(y$({createEmptyChangeSummary:()=>{},handleChange:(e,t)=>(e.didChange(l)&&(d="original"),e.didChange(h)&&(d="modified"),!0)},(e=>{l.read(e),h.read(e);const t=this._diffModel.read(e);if(!t)return;const i=t.diff.read(e);let n;if(i&&"original"===d){const t=r.read(e);t&&(n=i.movedTexts.find((e=>e.lineRangeMapping.original.contains(t.lineNumber))))}if(i&&"modified"===d){const t=a.read(e);t&&(n=i.movedTexts.find((e=>e.lineRangeMapping.modified.contains(t.lineNumber))))}n!==t.movedTextToCompare.get()&&t.movedTextToCompare.set(void 0,void 0),t.setActiveMovedText(n)})))}}PZ.movedCodeBlockPadding=4;class FZ{static compute(e){const t=[],i=[];for(const n of e){let e=t.findIndex((e=>!e.intersectsStrict(n)));if(-1===e){const i=6;t.length>=i?e=vu(t,Yc((e=>e.intersectWithRangeLength(n)),Qc)):(e=t.length,t.push(new cu))}t[e].addRange(n),i.push(e)}return new FZ(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class BZ extends GG{constructor(e,t,i,n,o){const s=Dr("div.diff-hidden-lines-widget");super(e,t,s.root),this._editor=e,this._move=i,this._kind=n,this._diffModel=o,this._nodes=Dr("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Dr("div.text-content@textContent"),Dr("div.action-bar@actionBar")]),s.root.appendChild(this._nodes.root);const r=D$(this._editor.onDidLayoutChange,(()=>this._editor.getLayoutInfo()));let a;this._register(QG(this._nodes.root,{paddingRight:r.map((e=>e.verticalScrollbarWidth))})),a=i.changes.length>0?"original"===this._kind?me(0,"Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):me(0,"Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):"original"===this._kind?me(0,"Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):me(0,"Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const l=this._register(new ME(this._nodes.actionBar,{highlightToggledItems:!0})),h=new ph("",a,"",!1);l.push(h,{icon:!1,label:!0});const d=new ph("","Compare",Ll.asClassName(Sl.compareChanges),!0,(()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)}));this._register(w$((e=>{const t=this._diffModel.movedTextToCompare.read(e)===i;d.checked=t}))),l.push(d,{icon:!1,label:!0})}}class WZ extends T{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=m$(this,(e=>{var t;const i=null===(t=this._diffModel.read(e))||void 0===t?void 0:t.diff.read(e);if(!i)return null;const n=this._diffModel.read(e).movedTextToCompare.read(e),o=this._options.renderIndicators.read(e),s=this._options.showEmptyDecorations.read(e),r=[],a=[];if(!n)for(const e of i.mappings)if(e.lineRangeMapping.original.isEmpty||r.push({range:e.lineRangeMapping.original.toInclusiveRange(),options:o?DZ:NZ}),e.lineRangeMapping.modified.isEmpty||a.push({range:e.lineRangeMapping.modified.toInclusiveRange(),options:o?xZ:EZ}),e.lineRangeMapping.modified.isEmpty||e.lineRangeMapping.original.isEmpty)e.lineRangeMapping.original.isEmpty||r.push({range:e.lineRangeMapping.original.toInclusiveRange(),options:RZ}),e.lineRangeMapping.modified.isEmpty||a.push({range:e.lineRangeMapping.modified.toInclusiveRange(),options:MZ});else for(const t of e.lineRangeMapping.innerChanges||[])e.lineRangeMapping.original.contains(t.originalRange.startLineNumber)&&r.push({range:t.originalRange,options:t.originalRange.isEmpty()&&s?OZ:AZ}),e.lineRangeMapping.modified.contains(t.modifiedRange.startLineNumber)&&a.push({range:t.modifiedRange,options:t.modifiedRange.isEmpty()&&s?TZ:IZ});if(n)for(const e of n.changes){const t=e.original.toInclusiveRange();t&&r.push({range:t,options:o?DZ:NZ});const i=e.modified.toInclusiveRange();i&&a.push({range:i,options:o?xZ:EZ});for(const t of e.innerChanges||[])r.push({range:t.originalRange,options:AZ}),a.push({range:t.modifiedRange,options:IZ})}const l=this._diffModel.read(e).activeMovedText.read(e);for(const e of i.movedTexts)r.push({range:e.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(e===l?" currentMove":""),blockPadding:[PZ.movedCodeBlockPadding,0,PZ.movedCodeBlockPadding,PZ.movedCodeBlockPadding]}}),a.push({range:e.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(e===l?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:r,modifiedDecorations:a}})),this._register(new VZ(e,t,i,n)),this._register(KG(this._editors.original,this._decorations.map((e=>(null==e?void 0:e.originalDecorations)||[])))),this._register(KG(this._editors.modified,this._decorations.map((e=>(null==e?void 0:e.modifiedDecorations)||[]))))}}class VZ extends T{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=n;const o=[],s=m$(this,(e=>{const t=this._diffModel.read(e),i=null==t?void 0:t.diff.read(e);if(!i)return o;const n=this._editors.modifiedSelections.read(e);if(n.every((e=>e.isEmpty())))return o;const s=new wu(n.map((e=>bu.fromRangeInclusive(e)))),r=i.mappings.filter((e=>e.lineRangeMapping.innerChanges&&s.intersects(e.lineRangeMapping.modified))).map((e=>({mapping:e,rangeMappings:e.lineRangeMapping.innerChanges.filter((e=>n.some((t=>tc.areIntersecting(e.modifiedRange,t)))))})));return 0===r.length||r.every((e=>0===e.rangeMappings.length))?o:r}));this._register(S$(((e,t)=>{const i=this._diffModel.read(e),n=null==i?void 0:i.diff.read(e);if(!i||!n)return;if(this._diffModel.read(e).movedTextToCompare.read(e))return;if(!this._options.shouldRenderRevertArrows.read(e))return;const o=[],r=s.read(e),a=new Set(r.map((e=>e.mapping)));if(r.length>0){const t=this._editors.modifiedSelections.read(e),i=new zZ(t[t.length-1].positionLineNumber,this._widget,r.flatMap((e=>e.rangeMappings)),!0);this._editors.modified.addGlyphMarginWidget(i),o.push(i)}for(const e of n.mappings)if(!a.has(e)&&!e.lineRangeMapping.modified.isEmpty&&e.lineRangeMapping.innerChanges){const t=new zZ(e.lineRangeMapping.modified.startLineNumber,this._widget,e.lineRangeMapping.innerChanges,!1);this._editors.modified.addGlyphMarginWidget(t),o.push(t)}t.add(I((()=>{for(const e of o)this._editors.modified.removeGlyphMarginWidget(e)})))})))}}class zZ{getId(){return this._id}constructor(e,t,i,n){this._lineNumber=e,this._widget=t,this._diffs=i,this._selection=n,this._id="revertButton"+zZ.counter++,this._domNode=Dr("div.revertButton",{title:this._selection?me(0,"Revert Selected Changes"):me(0,"Revert Change")},[ox(Sl.arrowRight)]).root,this._domNode.onmousedown=e=>{2!==e.button&&(e.stopPropagation(),e.preventDefault())},this._domNode.onmouseup=e=>{e.stopPropagation(),e.preventDefault()},this._domNode.onclick=e=>{this._widget.revertRangeMappings(this._diffs),e.stopPropagation(),e.preventDefault()}}getDomNode(){return this._domNode}getPosition(){return{lane:bc.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}}zZ.counter=0;class HZ extends T{constructor(e,t,i,n){super(),this._options=e,this._domNode=t,this._dimensions=i,this._sashes=n,this._sashRatio=d$(this,void 0),this.sashLeft=m$(this,(e=>{var t;const i=null!==(t=this._sashRatio.read(e))&&void 0!==t?t:this._options.splitViewDefaultRatio.read(e);return this._computeSashLeft(i,e)})),this._sash=this._register(new EV(this._domNode,{getVerticalSashTop:e=>0,getVerticalSashLeft:e=>this.sashLeft.get(),getVerticalSashHeight:e=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart((()=>{this._startSashPosition=this.sashLeft.get()}))),this._register(this._sash.onDidChange((e=>{const t=this._dimensions.width.get(),i=this._computeSashLeft((this._startSashPosition+(e.currentX-e.startX))/t,void 0);this._sashRatio.set(i/t,void 0)}))),this._register(this._sash.onDidEnd((()=>this._sash.layout()))),this._register(this._sash.onDidReset((()=>this._sashRatio.set(void 0,void 0)))),this._register(w$((e=>{const t=this._sashes.read(e);t&&(this._sash.orthogonalEndSash=t.bottom)}))),this._register(w$((e=>{const t=this._options.enableSplitViewResizing.read(e);this._sash.state=t?3:0,this.sashLeft.read(e),this._dimensions.height.read(e),this._sash.layout()})))}_computeSashLeft(e,t){const i=this._dimensions.width.read(t),n=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):n,s=100;return i<=200?n:o<s?s:o>i-s?i-s:o}}class UZ{remove(){var e;null===(e=this.parent)||void 0===e||e.children.delete(this.id)}static findId(e,t){let i;"string"==typeof e?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,void 0!==t.children.get(i)&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let n=i;for(let e=0;void 0!==t.children.get(n);e++)n=`${i}_${e}`;return n}static empty(e){return 0===e.children.size}}class KZ extends UZ{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class jZ extends UZ{constructor(e,t,i,n){super(),this.id=e,this.parent=t,this.label=i,this.order=n,this.children=new Map}}class qZ extends UZ{static create(e,t,i){const n=new Pt(i),o=new qZ(t.uri),s=e.ordered(t),r=s.map(((e,i)=>{var s;const r=UZ.findId(`provider_${i}`,o),a=new jZ(r,o,null!==(s=e.displayName)&&void 0!==s?s:"Unknown Outline Provider",i);return Promise.resolve(e.provideDocumentSymbols(t,n.token)).then((e=>{for(const t of e||[])qZ._makeOutlineElement(t,a);return a}),(e=>(d(e),a))).then((e=>{UZ.empty(e)?e.remove():o._groups.set(r,e)}))})),a=e.onDidChange((()=>{Ic(e.ordered(t),s)||n.cancel()}));return Promise.all(r).then((()=>n.token.isCancellationRequested&&!i.isCancellationRequested?qZ.create(e,t,i):o._compact())).finally((()=>{n.dispose(),a.dispose()}))}static _makeOutlineElement(e,t){const i=UZ.findId(e,t),n=new KZ(i,t,e);if(e.children)for(const t of e.children)qZ._makeOutlineElement(t,n);t.children.set(n.id,n)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,i]of this._groups)0===i.children.size?this._groups.delete(t):e+=1;if(1!==e)this.children=this._groups;else{const e=C.first(this._groups.values());for(const[,t]of e.children)t.parent=this,this.children.set(t.id,t)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof KZ?e.push(t.symbol):e.push(...C.map(t.children.values(),(e=>e.symbol)));return e.sort(((e,t)=>tc.compareRangesUsingStarts(e.range,t.range)))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return qZ._flattenDocumentSymbols(t,e,""),t.sort(((e,t)=>ch.compare(tc.getStartPosition(e.range),tc.getStartPosition(t.range))||ch.compare(tc.getEndPosition(t.range),tc.getEndPosition(e.range))))}static _flattenDocumentSymbols(e,t,i){for(const n of t)e.push({kind:n.kind,tags:n.tags,name:n.name,detail:n.detail,containerName:n.containerName||i,range:n.range,selectionRange:n.selectionRange,children:void 0}),n.children&&qZ._flattenDocumentSymbols(e,n.children,n.name)}}var $Z=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},GZ=function(e,t){return function(i,n){t(i,n,e)}};let ZZ=class extends T{get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._languageFeaturesService=n,this._modifiedOutlineSource=v$(this,(e=>{const t=this._editors.modifiedModel.read(e);return t?new QZ(this._languageFeaturesService,t):void 0})),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition((e=>{if(3===e.reason){const e=this._diffModel.get();e$((t=>{for(const i of this._editors.original.getSelections()||[])null==e||e.ensureOriginalLineIsVisible(i.getStartPosition().lineNumber,t),null==e||e.ensureOriginalLineIsVisible(i.getEndPosition().lineNumber,t)}))}}))),this._register(this._editors.modified.onDidChangeCursorPosition((e=>{if(3===e.reason){const e=this._diffModel.get();e$((t=>{for(const i of this._editors.modified.getSelections()||[])null==e||e.ensureModifiedLineIsVisible(i.getStartPosition().lineNumber,t),null==e||e.ensureModifiedLineIsVisible(i.getEndPosition().lineNumber,t)}))}})));const o=this._diffModel.map(((e,t)=>{var i,n;return 0===(null===(i=null==e?void 0:e.diff.read(t))||void 0===i?void 0:i.mappings.length)?[]:null!==(n=null==e?void 0:e.unchangedRegions.read(t))&&void 0!==n?n:[]}));this.viewZones=_$(this,((e,t)=>{const i=this._modifiedOutlineSource.read(e);if(!i)return{origViewZones:[],modViewZones:[]};const n=[],s=[],r=this._options.renderSideBySide.read(e),a=o.read(e);for(const o of a)if(!o.shouldHideControls(e)){{const e=m$(this,(e=>o.getHiddenOriginalRange(e).startLineNumber-1)),s=new ZG(e,24);n.push(s),t.add(new YZ(this._editors.original,s,o,o.originalUnchangedRange,!r,i,(e=>this._diffModel.get().ensureModifiedLineIsVisible(e,void 0)),this._options))}{const e=m$(this,(e=>o.getHiddenModifiedRange(e).startLineNumber-1)),n=new ZG(e,24);s.push(n),t.add(new YZ(this._editors.modified,n,o,o.modifiedUnchangedRange,!1,i,(e=>this._diffModel.get().ensureModifiedLineIsVisible(e,void 0)),this._options))}}return{origViewZones:n,modViewZones:s}}));const s={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},r={description:"Fold Unchanged",glyphMarginHoverMessage:new eh(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(me(0,"Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Ll.asClassName(Sl.fold),zIndex:10001};this._register(KG(this._editors.original,m$(this,(e=>{const t=o.read(e),i=t.map((e=>({range:e.originalUnchangedRange.toInclusiveRange(),options:s})));for(const n of t)n.shouldHideControls(e)&&i.push({range:tc.fromPositions(new ch(n.originalLineNumber,1)),options:r});return i})))),this._register(KG(this._editors.modified,m$(this,(e=>{const t=o.read(e),i=t.map((e=>({range:e.modifiedUnchangedRange.toInclusiveRange(),options:s})));for(const n of t)n.shouldHideControls(e)&&i.push({range:bu.ofLength(n.modifiedLineNumber,1).toInclusiveRange(),options:r});return i})))),this._register(w$((e=>{const t=o.read(e);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(t.map((t=>t.getHiddenOriginalRange(e).toInclusiveRange())).filter(pl)),this._editors.modified.setHiddenAreas(t.map((t=>t.getHiddenModifiedRange(e).toInclusiveRange())).filter(pl))}finally{this._isUpdatingHiddenAreas=!1}}))),this._register(this._editors.modified.onMouseUp((e=>{var t;if(!e.event.rightButton&&e.target.position&&(null===(t=e.target.element)||void 0===t?void 0:t.className.includes("fold-unchanged"))){const t=e.target.position.lineNumber,i=this._diffModel.get();if(!i)return;const n=i.unchangedRegions.get().find((e=>e.modifiedUnchangedRange.includes(t)));if(!n)return;n.collapseAll(void 0),e.event.stopPropagation(),e.event.preventDefault()}}))),this._register(this._editors.original.onMouseUp((e=>{var t;if(!e.event.rightButton&&e.target.position&&(null===(t=e.target.element)||void 0===t?void 0:t.className.includes("fold-unchanged"))){const t=e.target.position.lineNumber,i=this._diffModel.get();if(!i)return;const n=i.unchangedRegions.get().find((e=>e.originalUnchangedRange.includes(t)));if(!n)return;n.collapseAll(void 0),e.event.stopPropagation(),e.event.preventDefault()}})))}};ZZ=$Z([GZ(3,Jk)],ZZ);class YZ extends GG{constructor(e,t,i,n,o,s,r,a){const l=Dr("div.diff-hidden-lines-widget");super(e,t,l.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=n,this._hide=o,this._modifiedOutlineSource=s,this._revealModifiedHiddenLine=r,this._options=a,this._nodes=Dr("div.diff-hidden-lines",[Dr("div.top@top",{title:me(0,"Click or drag to show more above")}),Dr("div.center@content",{style:{display:"flex"}},[Dr("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[mr("a",{title:me(0,"Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...nx("$(unfold)"))]),Dr("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Dr("div.bottom@bottom",{title:me(0,"Click or drag to show more below"),role:"button"})]),l.root.appendChild(this._nodes.root);const h=D$(this._editor.onDidLayoutChange,(()=>this._editor.getLayoutInfo()));this._hide?cr(this._nodes.first):this._register(QG(this._nodes.first,{width:h.map((e=>e.contentLeft))})),this._register(w$((e=>{const t=this._unchangedRegion.visibleLineCountTop.read(e)+this._unchangedRegion.visibleLineCountBottom.read(e)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!t),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(e)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(e)>0),this._nodes.top.classList.toggle("canMoveBottom",!t);const i=this._unchangedRegion.isDragged.read(e),n=this._editor.getDomNode();n&&(n.classList.toggle("draggingUnchangedRegion",!!i),"top"===i?(n.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(e)>0),n.classList.toggle("canMoveBottom",!t)):"bottom"===i?(n.classList.toggle("canMoveTop",!t),n.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(e)>0)):(n.classList.toggle("canMoveTop",!1),n.classList.toggle("canMoveBottom",!1)))})));const d=this._editor;this._register(bs(this._nodes.top,"mousedown",(e=>{if(0!==e.button)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),e.preventDefault();const t=e.clientY;let i=!1;const n=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const o=as(this._nodes.top),s=bs(o,"mousemove",(e=>{const o=e.clientY-t;i=i||Math.abs(o)>2;const s=Math.round(o/d.getOption(66)),r=Math.max(0,Math.min(n+s,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(r,void 0)})),r=bs(o,"mouseup",(e=>{i||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),s.dispose(),r.dispose()}))}))),this._register(bs(this._nodes.bottom,"mousedown",(e=>{if(0!==e.button)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),e.preventDefault();const t=e.clientY;let i=!1;const n=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const o=as(this._nodes.bottom),s=bs(o,"mousemove",(e=>{const o=e.clientY-t;i=i||Math.abs(o)>2;const s=Math.round(o/d.getOption(66)),r=Math.max(0,Math.min(n-s,this._unchangedRegion.getMaxVisibleLineCountBottom())),a=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(r,void 0);const l=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(l-a))})),r=bs(o,"mouseup",(e=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!i){const e=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const t=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(t-e))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),s.dispose(),r.dispose()}))}))),this._register(w$((e=>{const t=[];if(!this._hide){const n=me(0,"{0} hidden lines",i.getHiddenModifiedRange(e).length),o=mr("span",{title:me(0,"Double click to unfold")},n);o.addEventListener("dblclick",(e=>{0===e.button&&(e.preventDefault(),this._unchangedRegion.showAll(void 0))})),t.push(o);const s=this._unchangedRegion.getHiddenModifiedRange(e),r=this._modifiedOutlineSource.getBreadcrumbItems(s,e);if(r.length>0){t.push(mr("span",void 0,"  |  "));for(let e=0;e<r.length;e++){const i=r[e],n=Dr("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[ox(vC.toIcon(i.kind))," ",i.name,...e===r.length-1?[]:[ox(Sl.chevronRight)]]).root;t.push(n),n.onclick=()=>{this._revealModifiedHiddenLine(i.startLineNumber)}}}}cr(this._nodes.others,...t)})))}}let QZ=class extends T{constructor(e,t){super(),this._languageFeaturesService=e,this._textModel=t,this._currentModel=d$(this,void 0);const i=N$("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),n=N$("_textModel.onDidChangeContent",z.debounce((e=>this._textModel.onDidChangeContent(e)),(()=>{}),100));this._register(S$((async(e,t)=>{i.read(e),n.read(e);const o=t.add(new eZ),s=await qZ.create(this._languageFeaturesService.documentSymbolProvider,this._textModel,o.token);t.isDisposed||this._currentModel.set(s,void 0)})))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const n=i.asListOfDocumentSymbols().filter((t=>e.contains(t.range.startLineNumber)&&!e.contains(t.range.endLineNumber)));return n.sort(Jc(Yc((e=>e.range.endLineNumber-e.range.startLineNumber),Qc))),n.map((e=>({name:e.name,kind:e.kind,startLineNumber:e.range.startLineNumber})))}};QZ=$Z([GZ(0,Jk)],QZ);const XZ=hh("editorWorkerService");var JZ,eY=function(e,t){return function(i,n){t(i,n,e)}};let tY=JZ=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new q,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;null===(e=this.diffAlgorithmOnDidChangeSubscription)||void 0===e||e.dispose()}async computeDiff(e,t,i,n){var o,s;if("string"!=typeof this.diffAlgorithm)return this.diffAlgorithm.computeDiff(e,t,i,n);if(1===e.getLineCount()&&1===e.getLineMaxColumn(1))return 1===t.getLineCount()&&1===t.getLineMaxColumn(1)?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new eT(new bu(1,2),new bu(1,t.getLineCount()+1),[new tT(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const r=JSON.stringify([e.uri.toString(),t.uri.toString()]),a=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),l=JZ.diffCache.get(r);if(l&&l.context===a)return l.result;const h=V.create(),d=await this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),c=h.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:c,timedOut:null===(o=null==d?void 0:d.quitEarly)||void 0===o||o,detectedMoves:i.computeMoves?null!==(s=null==d?void 0:d.moves.length)&&void 0!==s?s:0:-1}),n.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!d)throw new Error("no diff result available");return JZ.diffCache.size>10&&JZ.diffCache.delete(JZ.diffCache.keys().next().value),JZ.diffCache.set(r,{result:d,context:a}),d}setOptions(e){var t;let i=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&(null===(t=this.diffAlgorithmOnDidChangeSubscription)||void 0===t||t.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,"string"!=typeof e.diffAlgorithm&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange((()=>this.onDidChangeEventEmitter.fire()))),i=!0),i&&this.onDidChangeEventEmitter.fire()}};tY.diffCache=new Map,tY=JZ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([eY(1,XZ),eY(2,Id)],tY);const iY=hh("diffProviderFactoryService");let nY=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(tY,e)}};nY=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,lh)],nY),wg(iY,nY,1);let oY=class extends T{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i){super(),this.model=e,this._options=t,this._diffProviderFactoryService=i,this._isDiffUpToDate=d$(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=d$(this,void 0),this.diff=this._diff,this._unchangedRegions=d$(this,{regions:[],originalDecorationIds:[],modifiedDecorationIds:[]}),this.unchangedRegions=m$(this,(e=>this._options.hideUnchangedRegions.read(e)?this._unchangedRegions.read(e).regions:(e$((e=>{for(const t of this._unchangedRegions.get().regions)t.collapseAll(e)})),[]))),this.movedTextToCompare=d$(this,void 0),this._activeMovedText=d$(this,void 0),this._hoveredMovedText=d$(this,void 0),this.activeMovedText=m$(this,(e=>{var t,i;return null!==(i=null!==(t=this.movedTextToCompare.read(e))&&void 0!==t?t:this._hoveredMovedText.read(e))&&void 0!==i?i:this._activeMovedText.read(e)})),this._cancellationTokenSource=new Pt,this._diffProvider=m$(this,(e=>{const t=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(e)});return{diffProvider:t,onChangeSignal:N$("onDidChange",t.onDidChange)}})),this._register(I((()=>this._cancellationTokenSource.cancel())));const n=M$("contentChangedSignal"),o=this._register(new Zt((()=>n.trigger(void 0)),200)),s=(t,i,n)=>{const o=aY.fromDiffs(t.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(n),this._options.hideUnchangedRegionsContextLineCount.read(n)),s=this._unchangedRegions.get(),r=s.originalDecorationIds.map((t=>e.original.getDecorationRange(t))).map((e=>e?bu.fromRange(e):void 0)),a=s.modifiedDecorationIds.map((t=>e.modified.getDecorationRange(t))).map((e=>e?bu.fromRange(e):void 0)),l=e.original.deltaDecorations(s.originalDecorationIds,o.map((e=>({range:e.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})))),h=e.modified.deltaDecorations(s.modifiedDecorationIds,o.map((e=>({range:e.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))));for(const e of o)for(let t=0;t<s.regions.length;t++)if(r[t]&&e.originalUnchangedRange.intersectsStrict(r[t])&&a[t]&&e.modifiedUnchangedRange.intersectsStrict(a[t])){e.setHiddenModifiedRange(s.regions[t].getHiddenModifiedRange(void 0),i);break}this._unchangedRegions.set({regions:o,originalDecorationIds:l,modifiedDecorationIds:h},i)};this._register(e.modified.onDidChangeContent((t=>{if(this._diff.get()){xp.fromModelContentChanges(t.changes);const i=(this._lastDiff,e.original,void e.modified);i&&(this._lastDiff=i,e$((e=>{this._diff.set(sY.fromDiffResult(this._lastDiff),e),s(i,e);const t=this.movedTextToCompare.get();this.movedTextToCompare.set(t?this._lastDiff.moves.find((e=>e.lineRangeMapping.modified.intersect(t.lineRangeMapping.modified))):void 0,e)})))}this._isDiffUpToDate.set(!1,void 0),o.schedule()}))),this._register(e.original.onDidChangeContent((t=>{if(this._diff.get()){xp.fromModelContentChanges(t.changes);const i=(this._lastDiff,e.original,void e.modified);i&&(this._lastDiff=i,e$((e=>{this._diff.set(sY.fromDiffResult(this._lastDiff),e),s(i,e);const t=this.movedTextToCompare.get();this.movedTextToCompare.set(t?this._lastDiff.moves.find((e=>e.lineRangeMapping.modified.intersect(t.lineRangeMapping.modified))):void 0,e)})))}this._isDiffUpToDate.set(!1,void 0),o.schedule()}))),this._register(S$((async(t,i)=>{var r,a;this._options.hideUnchangedRegionsMinimumLineCount.read(t),this._options.hideUnchangedRegionsContextLineCount.read(t),o.cancel(),n.read(t);const l=this._diffProvider.read(t);l.onChangeSignal.read(t),XG(PT,t),XG(MT,t),this._isDiffUpToDate.set(!1,void 0);let h=[];i.add(e.original.onDidChangeContent((e=>{const t=xp.fromModelContentChanges(e.changes);h=rm(h,t)})));let d=[];i.add(e.modified.onDidChangeContent((e=>{const t=xp.fromModelContentChanges(e.changes);d=rm(d,t)})));let c=await l.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(t),maxComputationTimeMs:this._options.maxComputationTimeMs.read(t),computeMoves:this._options.showMoves.read(t)},this._cancellationTokenSource.token);var u,g,p;this._cancellationTokenSource.token.isCancellationRequested||(u=c,g=e.original,p=e.modified,c={changes:u.changes.map((e=>new eT(e.original,e.modified,e.innerChanges?e.innerChanges.map((e=>function(e,t,i){let n=e.originalRange,o=e.modifiedRange;return(1!==n.endColumn||1!==o.endColumn)&&n.endColumn===t.getLineMaxColumn(n.endLineNumber)&&o.endColumn===i.getLineMaxColumn(o.endLineNumber)&&n.endLineNumber<t.getLineCount()&&o.endLineNumber<i.getLineCount()&&(n=n.setEndPosition(n.endLineNumber+1,1),o=o.setEndPosition(o.endLineNumber+1,1)),new tT(n,o)}(e,g,p))):void 0))),moves:u.moves,identical:u.identical,quitEarly:u.quitEarly},c=null!==(e.original,r=void e.modified)&&void 0!==r?r:c,c=null!==(e.original,a=void e.modified)&&void 0!==a?a:c,e$((e=>{s(c,e),this._lastDiff=c;const t=sY.fromDiffResult(c);this._diff.set(t,e),this._isDiffUpToDate.set(!0,e);const i=this.movedTextToCompare.get();this.movedTextToCompare.set(i?this._lastDiff.moves.find((e=>e.lineRangeMapping.modified.intersect(i.lineRangeMapping.modified))):void 0,e)})))})))}ensureModifiedLineIsVisible(e,t){var i;if(0===(null===(i=this.diff.get())||void 0===i?void 0:i.mappings.length))return;const n=this._unchangedRegions.get().regions;for(const i of n)if(i.getHiddenModifiedRange(void 0).contains(e))return void i.showModifiedLine(e,t)}ensureOriginalLineIsVisible(e,t){var i;if(0===(null===(i=this.diff.get())||void 0===i?void 0:i.mappings.length))return;const n=this._unchangedRegions.get().regions;for(const i of n)if(i.getHiddenOriginalRange(void 0).contains(e))return void i.showOriginalLine(e,t)}async waitForDiff(){var e;await(e=this.isDiffUpToDate,e=>e,new Promise((t=>{let i=!1,n=!1;const o=e.map((e=>({isFinished:e,state:e}))),s=w$((e=>{const{isFinished:r,state:a}=o.read(e);r&&(i?s.dispose():n=!0,t(a))}));i=!0,n&&s.dispose()})))}serializeState(){return{collapsedRegions:this._unchangedRegions.get().regions.map((e=>({range:e.getHiddenModifiedRange(void 0).serialize()})))}}restoreSerializedState(e){const t=e.collapsedRegions.map((e=>bu.deserialize(e.range))),i=this._unchangedRegions.get();e$((e=>{for(const n of i.regions)for(const i of t)if(n.modifiedUnchangedRange.intersect(i)){n.setHiddenModifiedRange(i,e);break}}))}};oY=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(2,iY)],oY);class sY{static fromDiffResult(e){return new sY(e.changes.map((e=>new rY(e))),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,n){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=n}}class rY{constructor(e){this.lineRangeMapping=e}}class aY{static fromDiffs(e,t,i,n,o){const s=eT.inverse(e,t,i),r=[];for(const e of s){let s=e.original.startLineNumber,a=e.modified.startLineNumber,l=e.original.length;const h=1===s&&1===a,d=s+l===t+1&&a+l===i+1;(h||d)&&l>=o+n?(h&&!d&&(l-=o),d&&!h&&(s+=o,a+=o,l-=o),r.push(new aY(s,a,l,0,0))):l>=2*o+n&&(s+=o,a+=o,l-=2*o,r.push(new aY(s,a,l,0,0)))}return r}get originalUnchangedRange(){return bu.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return bu.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,n,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=d$(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=d$(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=m$(this,(e=>this.visibleLineCountTop.read(e)+this.visibleLineCountBottom.read(e)===this.lineCount&&!this.isDragged.read(e))),this.isDragged=d$(this,void 0),this._visibleLineCountTop.set(n,void 0),this._visibleLineCountBottom.set(o,void 0)}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return bu.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return bu.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const i=e.startLineNumber-this.modifiedLineNumber,n=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,n,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){const i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t){const i=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),n=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;i<n?this._visibleLineCountTop.set(this._visibleLineCountTop.get()+i,t):this._visibleLineCountBottom.set(this._visibleLineCountBottom.get()+n,t)}showOriginalLine(e,t){const i=e-this.originalLineNumber,n=this.originalLineNumber+this.lineCount-e;i<n?this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+n-i,this.getMaxVisibleLineCountTop()),t):this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+i-n,this.getMaxVisibleLineCountBottom()),t)}collapseAll(e){this._visibleLineCountTop.set(0,e),this._visibleLineCountBottom.set(0,e)}setState(e,t,i){e=Math.max(Math.min(e,this.lineCount),0),t=Math.max(Math.min(t,this.lineCount-e),0),this._visibleLineCountTop.set(e,i),this._visibleLineCountBottom.set(t,i)}}class lY extends T{get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}constructor(e,t,i,n,o,s,r,a,l){super(),this._getViewZoneId=e,this._marginDomNode=t,this._modifiedEditor=i,this._diff=n,this._editor=o,this._viewLineCounts=s,this._originalTextModel=r,this._contextMenuService=a,this._clipboardService=l,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=Ll.asClassName(Sl.lightBulb)+" lightbulb-glyph",this._diffActions.style.position="absolute";const h=this._modifiedEditor.getOption(66);this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${h}px`,this._diffActions.style.lineHeight=`${h}px`,this._marginDomNode.appendChild(this._diffActions);let d=0;const c=i.getOption(126)&&!je,u=(e,t)=>{var o;this._contextMenuService.showContextMenu({domForShadowRoot:c&&null!==(o=i.getDomNode())&&void 0!==o?o:void 0,getAnchor:()=>({x:e,y:t}),getActions:()=>{const e=[],t=n.modified.isEmpty;return e.push(new ph("diff.clipboard.copyDeletedContent",t?n.original.length>1?me(0,"Copy deleted lines"):me(0,"Copy deleted line"):n.original.length>1?me(0,"Copy changed lines"):me(0,"Copy changed line"),void 0,!0,(async()=>{const e=this._originalTextModel.getValueInRange(n.original.toExclusiveRange());await this._clipboardService.writeText(e)}))),n.original.length>1&&e.push(new ph("diff.clipboard.copyDeletedLineContent",me(0,t?"Copy deleted line ({0})":"Copy changed line ({0})",n.original.startLineNumber+d),void 0,!0,(async()=>{let e=this._originalTextModel.getLineContent(n.original.startLineNumber+d);""===e&&(e=0===this._originalTextModel.getEndOfLineSequence()?"\n":"\r\n"),await this._clipboardService.writeText(e)}))),i.getOption(90)||e.push(new ph("diff.inline.revertChange",me(0,"Revert this change"),void 0,!0,(async()=>{this._editor.revert(this._diff)}))),e},autoSelectFirstItem:!0})};this._register(Cs(this._diffActions,"mousedown",(e=>{if(!e.leftButton)return;const{top:t,height:i}=As(this._diffActions),n=Math.floor(h/3);e.preventDefault(),u(e.posx,t+i+n)}))),this._register(i.onMouseMove((e=>{8!==e.target.type&&5!==e.target.type||e.target.detail.viewZoneId!==this._getViewZoneId()?this.visibility=!1:(d=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,h),this.visibility=!0)}))),this._register(i.onMouseDown((e=>{!e.event.leftButton||8!==e.target.type&&5!==e.target.type||e.target.detail.viewZoneId===this._getViewZoneId()&&(e.event.preventDefault(),d=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,h),u(e.event.posx,e.event.posy+h))})))}_updateLightBulbPosition(e,t,i){const{top:n}=As(e),o=t-n,s=Math.floor(o/i),r=s*i;if(this._diffActions.style.top=`${r}px`,this._viewLineCounts){let e=0;for(let t=0;t<this._viewLineCounts.length;t++)if(e+=this._viewLineCounts[t],s<e)return t}return s}}const hY=Tx("diffEditorWidget",{createHTML:e=>e});function dY(e,t,i,n){Bx(n,t.fontInfo);const o=i.length>0,s=new Xu(1e4);let r=0,a=0;const l=[];for(let n=0;n<e.lineTokens.length;n++){const h=n+1,d=e.lineTokens[n],c=e.lineBreakData[n],u=jR.filter(i,h,1,Number.MAX_SAFE_INTEGER);if(c){let i=0;for(const n of c.breakOffsets){const l=d.sliceAndInflate(i,n,0);r=Math.max(r,gY(a,l,jR.extractWrapped(u,i,n),o,e.mightContainNonBasicASCII,e.mightContainRTL,t,s)),a++,i=n}l.push(c.breakOffsets.length)}else l.push(1),r=Math.max(r,gY(a,d,u,o,e.mightContainNonBasicASCII,e.mightContainRTL,t,s)),a++}r+=t.scrollBeyondLastColumn;const h=s.build(),d=hY?hY.createHTML(h):h;return n.innerHTML=d,{heightInLines:a,minWidthInPx:r*t.typicalHalfwidthCharacterWidth,viewLineCounts:l}}class cY{constructor(e,t,i,n){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=n}}class uY{static fromEditor(e){var t;const i=e.getOptions(),n=i.get(50),o=i.get(143);return new uY((null===(t=e.getModel())||void 0===t?void 0:t.getOptions().tabSize)||0,n,i.get(33),n.typicalHalfwidthCharacterWidth,i.get(103),i.get(66),o.decorationsWidth,i.get(116),i.get(98),i.get(93),i.get(51))}constructor(e,t,i,n,o,s,r,a,l,h,d){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=n,this.scrollBeyondLastColumn=o,this.lineHeight=s,this.lineDecorationsWidth=r,this.stopRenderingLineAfter=a,this.renderWhitespace=l,this.renderControlCharacters=h,this.fontLigatures=d}}function gY(e,t,i,n,o,s,r,a){a.appendString('<div class="view-line'),n||a.appendString(" char-delete"),a.appendString('" style="top:'),a.appendString(String(e*r.lineHeight)),a.appendString('px;width:1000000px;">');const l=t.getLineContent(),h=nF.isBasicASCII(l,o),d=nF.containsRTL(l,h,s),c=tO(new QR(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,h,d,0,t,i,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==Lk.OFF,null),a);return a.appendString("</div>"),c.characterMapping.getHorizontalOffset(c.characterMapping.length)}var pY=function(e,t){return function(i,n){t(i,n,e)}};let mY=class extends T{constructor(e,t,i,n,o,s,r,a,l,h){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=n,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=s,this._origViewZonesToIgnore=r,this._modViewZonesToIgnore=a,this._clipboardService=l,this._contextMenuService=h,this._originalTopPadding=d$(this,0),this._originalScrollOffset=d$(this,0),this._originalScrollOffsetAnimated=$G(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=d$(this,0),this._modifiedScrollOffset=d$(this,0),this._modifiedScrollOffsetAnimated=$G(this._targetWindow,this._modifiedScrollOffset,this._store);const d=d$("invalidateAlignmentsState",0),c=this._register(new Zt((()=>{d.set(d.get()+1,void 0)}),0));this._register(this._editors.original.onDidChangeViewZones((e=>{this._canIgnoreViewZoneUpdateEvent()||c.schedule()}))),this._register(this._editors.modified.onDidChangeViewZones((e=>{this._canIgnoreViewZoneUpdateEvent()||c.schedule()}))),this._register(this._editors.original.onDidChangeConfiguration((e=>{(e.hasChanged(144)||e.hasChanged(66))&&c.schedule()}))),this._register(this._editors.modified.onDidChangeConfiguration((e=>{(e.hasChanged(144)||e.hasChanged(66))&&c.schedule()})));const u=this._diffModel.map((e=>e?D$(e.model.original.onDidChangeTokens,(()=>2===e.model.original.tokenization.backgroundTokenizationState)):void 0)).map(((e,t)=>null==e?void 0:e.read(t))),g=m$((e=>{const t=this._diffModel.read(e),i=null==t?void 0:t.diff.read(e);if(!t||!i)return null;d.read(e);const n=this._options.renderSideBySide.read(e);return fY(this._editors.original,this._editors.modified,i.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,n)})),p=m$((e=>{var t;const i=null===(t=this._diffModel.read(e))||void 0===t?void 0:t.movedTextToCompare.read(e);if(!i)return null;d.read(e);const n=i.changes.map((e=>new rY(e)));return fY(this._editors.original,this._editors.modified,n,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)}));function m(){const e=document.createElement("div");return e.className="diagonal-fill",e}const f=this._register(new M);this.viewZones=_$(this,((e,t)=>{var i,n,s,r,a,l,h,d;f.clear();const c=g.read(e)||[],_=[],v=[],b=this._modifiedTopPadding.read(e);b>0&&v.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:b,showInHiddenAreas:!0,suppressMouseDown:!0});const w=this._originalTopPadding.read(e);w>0&&_.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:w,showInHiddenAreas:!0,suppressMouseDown:!0});const C=this._options.renderSideBySide.read(e),y=C||null===(i=this._editors.modified._getViewModel())||void 0===i?void 0:i.createLineBreaksComputer();if(y)for(const I of c)if(I.diff)for(let M=I.originalRange.startLineNumber;M<I.originalRange.endLineNumberExclusive;M++)null==y||y.addRequest(this._editors.original.getModel().getLineContent(M),null,null);const S=null!==(n=null==y?void 0:y.finalize())&&void 0!==n?n:[];let k=0;const L=this._editors.modified.getOption(66),x=null===(s=this._diffModel.read(e))||void 0===s?void 0:s.movedTextToCompare.read(e),D=null!==(a=null===(r=this._editors.original.getModel())||void 0===r?void 0:r.mightContainNonBasicASCII())&&void 0!==a&&a,E=null!==(h=null===(l=this._editors.original.getModel())||void 0===l?void 0:l.mightContainRTL())&&void 0!==h&&h,N=uY.fromEditor(this._editors.modified);for(const T of c)if(T.diff&&!C){if(!T.originalRange.isEmpty){u.read(e);const R=document.createElement("div");R.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const O=new cY(T.originalRange.mapToLineArray((e=>this._editors.original.getModel().tokenization.getLineTokens(e))),T.originalRange.mapToLineArray((e=>S[k++])),D,E),P=[];for(const V of T.diff.innerChanges||[])P.push(new oF(V.originalRange.delta(-(T.diff.original.startLineNumber-1)),AZ.className,0));const F=dY(O,N,P,R),B=document.createElement("div");if(B.className="inline-deleted-margin-view-zone",Bx(B,N.fontInfo),this._options.renderIndicators.read(e))for(let z=0;z<F.heightInLines;z++){const H=document.createElement("div");H.className=`delete-sign ${Ll.asClassName(LZ)}`,H.setAttribute("style",`position:absolute;top:${z*L}px;width:${N.lineDecorationsWidth}px;height:${L}px;right:0;`),B.appendChild(H)}let W;f.add(new lY((()=>_l(W)),B,this._editors.modified,T.diff,this._diffEditorWidget,F.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let U=0;U<F.viewLineCounts.length;U++){const K=F.viewLineCounts[U];K>1&&_.push({afterLineNumber:T.originalRange.startLineNumber+U,domNode:m(),heightInPx:(K-1)*L,showInHiddenAreas:!0,suppressMouseDown:!0})}v.push({afterLineNumber:T.modifiedRange.startLineNumber-1,domNode:R,heightInPx:F.heightInLines*L,minWidthInPx:F.minWidthInPx,marginDomNode:B,setZoneId(e){W=e},showInHiddenAreas:!0,suppressMouseDown:!0})}const A=document.createElement("div");A.className="gutter-delete",_.push({afterLineNumber:T.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:T.modifiedHeightInPx,marginDomNode:A,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const j=T.modifiedHeightInPx-T.originalHeightInPx;if(j>0){if(null==x?void 0:x.lineRangeMapping.original.delta(-1).deltaLength(2).contains(T.originalRange.endLineNumberExclusive-1))continue;_.push({afterLineNumber:T.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:j,showInHiddenAreas:!0,suppressMouseDown:!0})}else{if(null==x?void 0:x.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(T.modifiedRange.endLineNumberExclusive-1))continue;function q(){const e=document.createElement("div");return e.className="arrow-revert-change "+Ll.asClassName(Sl.arrowRight),t.add(bs(e,"mousedown",(e=>e.stopPropagation()))),t.add(bs(e,"click",(e=>{e.stopPropagation(),o.revert(T.diff)}))),mr("div",{},e)}let $;T.diff&&T.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(e)&&($=q()),v.push({afterLineNumber:T.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-j,marginDomNode:$,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const G of null!==(d=p.read(e))&&void 0!==d?d:[]){if(!(null==x?void 0:x.lineRangeMapping.original.intersect(G.originalRange))||!(null==x?void 0:x.lineRangeMapping.modified.intersect(G.modifiedRange)))continue;const Z=G.modifiedHeightInPx-G.originalHeightInPx;Z>0?_.push({afterLineNumber:G.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:Z,showInHiddenAreas:!0,suppressMouseDown:!0}):v.push({afterLineNumber:G.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-Z,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:_,mod:v}}));let _=!1;this._register(this._editors.original.onDidScrollChange((e=>{e.scrollLeftChanged&&!_&&(_=!0,this._editors.modified.setScrollLeft(e.scrollLeft),_=!1)}))),this._register(this._editors.modified.onDidScrollChange((e=>{e.scrollLeftChanged&&!_&&(_=!0,this._editors.original.setScrollLeft(e.scrollLeft),_=!1)}))),this._originalScrollTop=D$(this._editors.original.onDidScrollChange,(()=>this._editors.original.getScrollTop())),this._modifiedScrollTop=D$(this._editors.modified.onDidScrollChange,(()=>this._editors.modified.getScrollTop())),this._register(w$((e=>{const t=this._originalScrollTop.read(e)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(e))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(e));t!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(t,1)}))),this._register(w$((e=>{const t=this._modifiedScrollTop.read(e)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(e))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(e));t!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(t,1)}))),this._register(w$((e=>{var t;const i=null===(t=this._diffModel.read(e))||void 0===t?void 0:t.movedTextToCompare.read(e);let n=0;if(i){const e=this._editors.original.getTopForLineNumber(i.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();n=this._editors.modified.getTopForLineNumber(i.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-e}n>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(n,void 0)):n<0?(this._modifiedTopPadding.set(-n,void 0),this._originalTopPadding.set(0,void 0)):setTimeout((()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)}),400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.get()-n,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+n,void 0,!0)})))}};function fY(e,t,i,n,o,s){const r=new eu(_Y(e,n)),a=new eu(_Y(t,o)),l=e.getOption(66),h=t.getOption(66),d=[];let c=0,u=0;function g(e,t){for(;;){let i=r.peek(),n=a.peek();if(i&&i.lineNumber>=e&&(i=void 0),n&&n.lineNumber>=t&&(n=void 0),!i&&!n)break;const o=i?i.lineNumber-c:Number.MAX_VALUE,s=n?n.lineNumber-u:Number.MAX_VALUE;o<s?(r.dequeue(),n={lineNumber:i.lineNumber-c+u,heightInPx:0}):o>s?(a.dequeue(),i={lineNumber:n.lineNumber-u+c,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:bu.ofLength(i.lineNumber,1),modifiedRange:bu.ofLength(n.lineNumber,1),originalHeightInPx:l+i.heightInPx,modifiedHeightInPx:h+n.heightInPx,diff:void 0})}}for(const p of i){const m=p.lineRangeMapping;g(m.original.startLineNumber,m.modified.startLineNumber);let f=!0,_=m.modified.startLineNumber,v=m.original.startLineNumber;function b(e,t){var i,n,o,s;if(e<v||t<_)return;if(f)f=!1;else if(e===v||t===_)return;const c=new bu(v,e),u=new bu(_,t);if(c.isEmpty&&u.isEmpty)return;const g=null!==(n=null===(i=r.takeWhile((t=>t.lineNumber<e)))||void 0===i?void 0:i.reduce(((e,t)=>e+t.heightInPx),0))&&void 0!==n?n:0,m=null!==(s=null===(o=a.takeWhile((e=>e.lineNumber<t)))||void 0===o?void 0:o.reduce(((e,t)=>e+t.heightInPx),0))&&void 0!==s?s:0;d.push({originalRange:c,modifiedRange:u,originalHeightInPx:c.length*l+g,modifiedHeightInPx:u.length*h+m,diff:p.lineRangeMapping}),v=e,_=t}if(s)for(const w of m.innerChanges||[])w.originalRange.startColumn>1&&w.modifiedRange.startColumn>1&&b(w.originalRange.startLineNumber,w.modifiedRange.startLineNumber),w.originalRange.endColumn<e.getModel().getLineMaxColumn(w.originalRange.endLineNumber)&&b(w.originalRange.endLineNumber,w.modifiedRange.endLineNumber);b(m.original.endLineNumberExclusive,m.modified.endLineNumberExclusive),c=m.original.endLineNumberExclusive,u=m.modified.endLineNumberExclusive}return g(Number.MAX_VALUE,Number.MAX_VALUE),d}function _Y(e,t){const i=[],n=[],o=-1!==e.getOption(144).wrappingColumn,s=e._getViewModel().coordinatesConverter,r=e.getOption(66);if(o)for(let t=1;t<=e.getModel().getLineCount();t++){const e=s.getModelLineViewLineCount(t);e>1&&n.push({lineNumber:t,heightInPx:r*(e-1)})}for(const n of e.getWhitespaces()){if(t.has(n.id))continue;const e=0===n.afterLineNumber?0:s.convertViewPositionToModelPosition(new ch(n.afterLineNumber,1)).lineNumber;i.push({lineNumber:e,heightInPx:n.height})}return function(e,t,i,n){if(0===e.length)return t;if(0===t.length)return e;const o=[];let s=0,r=0;for(;s<e.length&&r<t.length;){const n=e[s],h=t[r],d=i(n),c=i(h);d<c?(o.push(n),s++):d>c?(o.push(h),r++):(o.push((l=h,{lineNumber:(a=n).lineNumber,heightInPx:a.heightInPx+l.heightInPx})),s++,r++)}for(var a,l;s<e.length;)o.push(e[s]),s++;for(;r<t.length;)o.push(t[r]),r++;return o}(i,n,(e=>e.lineNumber))}mY=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([pY(8,ZS),pY(9,qE)],mY);var vY;let bY=vY=class extends T{constructor(e,t,i,n,o,s,r){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=n,this._rootHeight=o,this._modifiedEditorLayoutInfo=s,this._themeService=r,this.width=vY.ENTIRE_DIFF_OVERVIEW_WIDTH;const a=D$(this._themeService.onDidColorThemeChange,(()=>this._themeService.getColorTheme())),l=m$((e=>{const t=a.read(e);return{insertColor:t.getColor(s_)||(t.getColor(n_)||t_).transparent(2),removeColor:t.getColor(r_)||(t.getColor(o_)||i_).transparent(2)}})),h=Fx(document.createElement("div"));h.setClassName("diffViewport"),h.setPosition("absolute");const d=Dr("div.diffOverview",{style:{position:"absolute",top:"0px",width:vY.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(jG(d,h.domNode)),this._register(Cs(d,or.POINTER_DOWN,(e=>{this._editors.modified.delegateVerticalScrollbarPointerDown(e)}))),this._register(bs(d,or.MOUSE_WHEEL,(e=>{this._editors.modified.delegateScrollFromMouseWheelEvent(e)}),{passive:!1})),this._register(jG(this._rootElement,d)),this._register(S$(((e,t)=>{const i=this._diffModel.read(e),n=this._editors.original.createOverviewRuler("original diffOverviewRuler");n&&(t.add(n),t.add(jG(d,n.getDomNode())));const o=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(o&&(t.add(o),t.add(jG(d,o.getDomNode()))),!n||!o)return;const s=N$("viewZoneChanged",this._editors.original.onDidChangeViewZones),r=N$("viewZoneChanged",this._editors.modified.onDidChangeViewZones),a=N$("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),c=N$("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);t.add(w$((e=>{var t;s.read(e),r.read(e),a.read(e),c.read(e);const h=l.read(e),d=null===(t=null==i?void 0:i.diff.read(e))||void 0===t?void 0:t.mappings;function u(e,t,i){const n=i._getViewModel();return n?e.filter((e=>e.length>0)).map((e=>{const i=n.coordinatesConverter.convertModelPositionToViewPosition(new ch(e.startLineNumber,1)),o=n.coordinatesConverter.convertModelPositionToViewPosition(new ch(e.endLineNumberExclusive,1)),s=o.lineNumber-i.lineNumber;return new NF(i.lineNumber,o.lineNumber,s,t.toString())})):[]}const g=u((d||[]).map((e=>e.lineRangeMapping.original)),h.removeColor,this._editors.original),p=u((d||[]).map((e=>e.lineRangeMapping.modified)),h.insertColor,this._editors.modified);null==n||n.setZones(g),null==o||o.setZones(p)}))),t.add(w$((e=>{const t=this._rootHeight.read(e),i=this._rootWidth.read(e),s=this._modifiedEditorLayoutInfo.read(e);if(s){const i=vY.ENTIRE_DIFF_OVERVIEW_WIDTH-2*vY.ONE_OVERVIEW_WIDTH;n.setLayout({top:0,height:t,right:i+vY.ONE_OVERVIEW_WIDTH,width:vY.ONE_OVERVIEW_WIDTH}),o.setLayout({top:0,height:t,right:0,width:vY.ONE_OVERVIEW_WIDTH});const r=this._editors.modifiedScrollTop.read(e),a=this._editors.modifiedScrollHeight.read(e),l=this._editors.modified.getOption(102),d=new gD(l.verticalHasArrows?l.arrowSize:0,l.verticalScrollbarSize,0,s.height,a,r);h.setTop(d.getSliderPosition()),h.setHeight(d.getSliderSize())}else h.setTop(0),h.setHeight(0);d.style.height=t+"px",d.style.left=i-vY.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",h.setWidth(vY.ENTIRE_DIFF_OVERVIEW_WIDTH)})))})))}};bY.ONE_OVERVIEW_WIDTH=15,bY.ENTIRE_DIFF_OVERVIEW_WIDTH=2*vY.ONE_OVERVIEW_WIDTH,bY=vY=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(6,Tv)],bY),Sm("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},me(0,"The border color for text that got moved in the diff editor.")),Sm("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},me(0,"The active border color for text that got moved in the diff editor.")),Sm("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},me(0,"The color of the shadow around unchanged region widgets."));class wY extends T{constructor(){super(...arguments),this._id=++wY.idCounter,this._onDidDispose=this._register(new q),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,n=!0){this._targetEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}wY.idCounter=0;var CY=function(e,t){return function(i,n){t(i,n,e)}};let yY=class extends T{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,n,o,s,r){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._createInnerEditor=o,this._instantiationService=s,this._keybindingService=r,this._onDidContentSizeChange=this._register(new q),this.original=this._register(this._createLeftHandSideEditor(i.editorOptions.get(),n.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(i.editorOptions.get(),n.modifiedEditor||{})),this.modifiedModel=D$(this.modified.onDidChangeModel,(()=>this.modified.getModel())),this.modifiedScrollTop=D$(this.modified.onDidScrollChange,(()=>this.modified.getScrollTop())),this.modifiedScrollHeight=D$(this.modified.onDidScrollChange,(()=>this.modified.getScrollHeight())),this.modifiedSelections=D$(this.modified.onDidChangeCursorSelection,(()=>{var e;return null!==(e=this.modified.getSelections())&&void 0!==e?e:[]})),this.modifiedCursor=D$(this.modified.onDidChangeCursorPosition,(()=>{var e;return null!==(e=this.modified.getPosition())&&void 0!==e?e:new ch(1,1)})),this._register(y$({createEmptyChangeSummary:()=>({}),handleChange:(e,t)=>(e.didChange(i.editorOptions)&&Object.assign(t,e.change.changedOptions),!0)},((e,t)=>{i.editorOptions.read(e),this._options.renderSideBySide.read(e),this.modified.updateOptions(this._adjustOptionsForRightHandSide(e,t)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(e,t))})))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t);return n.setContextValue("isInDiffLeftEditor",!0),n}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t);return n.setContextValue("isInDiffRightEditor",!0),n}_constructInnerEditor(e,t,i,n){const o=this._createInnerEditor(e,t,i,n);return this._register(o.onDidContentSizeChange((e=>{const t=this.original.getContentWidth()+this.modified.getContentWidth()+bY.ENTIRE_DIFF_OVERVIEW_WIDTH,i=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:i,contentWidth:t,contentHeightChanged:e.contentHeightChanged,contentWidthChanged:e.contentWidthChanged})}))),o}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),i.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=Uk.revealHorizontalRightPadding.defaultValue+bY.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t={...e,dimension:{height:0,width:0}};return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar={...t.scrollbar||{}},t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap={...t.minimap||{}},t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){var t;e||(e="");const i=me(0," use {0} to open the accessibility help.",null===(t=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))||void 0===t?void 0:t.getAriaLabel());return this._options.accessibilityVerbose.get()?e+i:e?e.replaceAll(i,""):""}};yY=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([CY(5,lh),CY(6,ML)],yY);class SY{get editorOptions(){return this._options}constructor(e){this._diffEditorWidth=d$(this,0),this.couldShowInlineViewBecauseOfSize=m$(this,(e=>this._options.read(e).renderSideBySide&&this._diffEditorWidth.read(e)<=this._options.read(e).renderSideBySideInlineBreakpoint)),this.renderOverviewRuler=m$(this,(e=>this._options.read(e).renderOverviewRuler)),this.renderSideBySide=m$(this,(e=>this._options.read(e).renderSideBySide&&!(this._options.read(e).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(e)))),this.readOnly=m$(this,(e=>this._options.read(e).readOnly)),this.shouldRenderRevertArrows=m$(this,(e=>!!this._options.read(e).renderMarginRevertIcon&&!!this.renderSideBySide.read(e)&&!this.readOnly.read(e))),this.renderIndicators=m$(this,(e=>this._options.read(e).renderIndicators)),this.enableSplitViewResizing=m$(this,(e=>this._options.read(e).enableSplitViewResizing)),this.splitViewDefaultRatio=m$(this,(e=>this._options.read(e).splitViewDefaultRatio)),this.ignoreTrimWhitespace=m$(this,(e=>this._options.read(e).ignoreTrimWhitespace)),this.maxComputationTimeMs=m$(this,(e=>this._options.read(e).maxComputationTime)),this.showMoves=m$(this,(e=>this._options.read(e).experimental.showMoves&&this.renderSideBySide.read(e))),this.isInEmbeddedEditor=m$(this,(e=>this._options.read(e).isInEmbeddedEditor)),this.diffWordWrap=m$(this,(e=>this._options.read(e).diffWordWrap)),this.originalEditable=m$(this,(e=>this._options.read(e).originalEditable)),this.diffCodeLens=m$(this,(e=>this._options.read(e).diffCodeLens)),this.accessibilityVerbose=m$(this,(e=>this._options.read(e).accessibilityVerbose)),this.diffAlgorithm=m$(this,(e=>this._options.read(e).diffAlgorithm)),this.showEmptyDecorations=m$(this,(e=>this._options.read(e).experimental.showEmptyDecorations)),this.onlyShowAccessibleDiffViewer=m$(this,(e=>this._options.read(e).onlyShowAccessibleDiffViewer)),this.hideUnchangedRegions=m$(this,(e=>this._options.read(e).hideUnchangedRegions.enabled)),this.hideUnchangedRegionsRevealLineCount=m$(this,(e=>this._options.read(e).hideUnchangedRegions.revealLineCount)),this.hideUnchangedRegionsContextLineCount=m$(this,(e=>this._options.read(e).hideUnchangedRegions.contextLineCount)),this.hideUnchangedRegionsMinimumLineCount=m$(this,(e=>this._options.read(e).hideUnchangedRegions.minimumLineCount));const t={...e,...kY(e,sk)};this._options=d$(this,t)}updateOptions(e){const t=kY(e,this._options.get()),i={...this._options.get(),...e,...t};this._options.set(i,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}}function kY(e,t){var i,n,o,s,r,a,l,h;return{enableSplitViewResizing:gk(e.enableSplitViewResizing,t.enableSplitViewResizing),splitViewDefaultRatio:_k(e.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:gk(e.renderSideBySide,t.renderSideBySide),renderMarginRevertIcon:gk(e.renderMarginRevertIcon,t.renderMarginRevertIcon),maxComputationTime:mk(e.maxComputationTime,t.maxComputationTime,0,1073741824),maxFileSize:mk(e.maxFileSize,t.maxFileSize,0,1073741824),ignoreTrimWhitespace:gk(e.ignoreTrimWhitespace,t.ignoreTrimWhitespace),renderIndicators:gk(e.renderIndicators,t.renderIndicators),originalEditable:gk(e.originalEditable,t.originalEditable),diffCodeLens:gk(e.diffCodeLens,t.diffCodeLens),renderOverviewRuler:gk(e.renderOverviewRuler,t.renderOverviewRuler),diffWordWrap:wk(e.diffWordWrap,t.diffWordWrap,["off","on","inherit"]),diffAlgorithm:wk(e.diffAlgorithm,t.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:gk(e.accessibilityVerbose,t.accessibilityVerbose),experimental:{showMoves:gk(null===(i=e.experimental)||void 0===i?void 0:i.showMoves,t.experimental.showMoves),showEmptyDecorations:gk(null===(n=e.experimental)||void 0===n?void 0:n.showEmptyDecorations,t.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:gk(null!==(s=null===(o=e.hideUnchangedRegions)||void 0===o?void 0:o.enabled)&&void 0!==s?s:null===(r=e.experimental)||void 0===r?void 0:r.collapseUnchangedRegions,t.hideUnchangedRegions.enabled),contextLineCount:mk(null===(a=e.hideUnchangedRegions)||void 0===a?void 0:a.contextLineCount,t.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:mk(null===(l=e.hideUnchangedRegions)||void 0===l?void 0:l.minimumLineCount,t.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:mk(null===(h=e.hideUnchangedRegions)||void 0===h?void 0:h.revealLineCount,t.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:gk(e.isInEmbeddedEditor,t.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:gk(e.onlyShowAccessibleDiffViewer,t.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:mk(e.renderSideBySideInlineBreakpoint,t.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:gk(e.useInlineViewWhenSpaceIsLimited,t.useInlineViewWhenSpaceIsLimited)}}var LY=function(e,t){return function(i,n){t(i,n,e)}};let xY=class extends wY{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,i,n,o,s,r,a){var l;super(),this._domElement=e,this._parentContextKeyService=n,this._parentInstantiationService=o,this._audioCueService=r,this._editorProgressService=a,this.elements=Dr("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Dr("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[mr("span",{},"No Changes")]),Dr("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Dr("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Dr("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=d$(this,void 0),this._shouldDisposeDiffModel=!1,this.onDidChangeModel=z.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new TW([sd,this._contextKeyService])),this._boundarySashes=d$(this,void 0),this._accessibleDiffViewerShouldBeVisible=d$(this,!1),this._accessibleDiffViewerVisible=m$(this,(e=>!!this._options.onlyShowAccessibleDiffViewer.read(e)||this._accessibleDiffViewerShouldBeVisible.read(e))),this._movedBlocksLinesPart=d$(this,void 0),this._layoutInfo=m$(this,(e=>{var t,i,n,o,s;const r=this._rootSizeObserver.width.read(e),a=this._rootSizeObserver.height.read(e),l=null===(t=this._sash.read(e))||void 0===t?void 0:t.sashLeft.read(e),h=null!=l?l:Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),d=r-h-(null!==(n=null===(i=this._overviewRulerPart.read(e))||void 0===i?void 0:i.width)&&void 0!==n?n:0),c=h-(null!==(s=null===(o=this._movedBlocksLinesPart.read(e))||void 0===o?void 0:o.width.read(e))&&void 0!==s?s:0);return this.elements.original.style.width=c+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=d+"px",this.elements.modified.style.left=h+"px",this._editors.original.layout({width:c,height:a},!0),this._editors.modified.layout({width:d,height:a},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}})),this._diffValue=this._diffModel.map(((e,t)=>null==e?void 0:e.diff.read(t))),this.onDidUpdateDiff=z.fromObservableLight(this._diffValue),s.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(I((()=>this._domElement.removeChild(this.elements.root)))),this._rootSizeObserver=this._register(new qG(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(null!==(l=t.automaticLayout)&&void 0!==l&&l),this._options=new SY(t),this._register(w$((e=>{this._options.setWidth(this._rootSizeObserver.width.read(e))}))),this._contextKeyService.createKey(nc.isEmbeddedDiffEditor.key,!1),this._register(iZ(nc.isEmbeddedDiffEditor,this._contextKeyService,(e=>this._options.isInEmbeddedEditor.read(e)))),this._register(iZ(nc.comparingMovedCode,this._contextKeyService,(e=>{var t;return!!(null===(t=this._diffModel.read(e))||void 0===t?void 0:t.movedTextToCompare.read(e))}))),this._register(iZ(nc.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,(e=>this._options.couldShowInlineViewBecauseOfSize.read(e)))),this._register(iZ(nc.hasChanges,this._contextKeyService,(e=>{var t,i,n;return(null!==(n=null===(i=null===(t=this._diffModel.read(e))||void 0===t?void 0:t.diff.read(e))||void 0===i?void 0:i.mappings.length)&&void 0!==n?n:0)>0}))),this._editors=this._register(this._instantiationService.createInstance(yY,this.elements.original,this.elements.modified,this._options,i,((e,t,i,n)=>this._createInnerEditor(e,t,i,n)))),this._overviewRulerPart=v$(this,(e=>this._options.renderOverviewRuler.read(e)?this._instantiationService.createInstance(XG(bY,e),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map((e=>e.modifiedEditor))):void 0)).recomputeInitiallyAndOnChange(this._store),this._sash=v$(this,(e=>{const t=this._options.renderSideBySide.read(e);return this.elements.root.classList.toggle("side-by-side",t),t?new HZ(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map(((e,t)=>{var i,n;return e-(null!==(n=null===(i=this._overviewRulerPart.read(t))||void 0===i?void 0:i.width)&&void 0!==n?n:0)}))},this._boundarySashes):void 0})).recomputeInitiallyAndOnChange(this._store);const h=v$(this,(e=>this._instantiationService.createInstance(XG(ZZ,e),this._editors,this._diffModel,this._options))).recomputeInitiallyAndOnChange(this._store);v$(this,(e=>this._instantiationService.createInstance(XG(WZ,e),this._editors,this._diffModel,this._options,this))).recomputeInitiallyAndOnChange(this._store);const d=new Set,c=new Set;let u=!1;const g=v$(this,(e=>this._instantiationService.createInstance(XG(mY,e),as(this._domElement),this._editors,this._diffModel,this._options,this,(()=>u||h.get().isUpdatingHiddenAreas),d,c))).recomputeInitiallyAndOnChange(this._store),p=m$(this,(e=>{const t=g.read(e).viewZones.read(e).orig,i=h.read(e).viewZones.read(e).origViewZones;return t.concat(i)})),m=m$(this,(e=>{const t=g.read(e).viewZones.read(e).mod,i=h.read(e).viewZones.read(e).modViewZones;return t.concat(i)}));let f;this._register(JG(this._editors.original,p,(e=>{u=e}),d)),this._register(JG(this._editors.modified,m,(e=>{u=e,u?f=PN.capture(this._editors.modified):(null==f||f.restore(this._editors.modified),f=void 0)}),c)),this._accessibleDiffViewer=v$(this,(e=>this._instantiationService.createInstance(XG(pZ,e),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,((e,t)=>this._accessibleDiffViewerShouldBeVisible.set(e,t)),this._options.onlyShowAccessibleDiffViewer.map((e=>!e)),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map(((e,t)=>{var i;return null===(i=null==e?void 0:e.diff.read(t))||void 0===i?void 0:i.mappings.map((e=>e.lineRangeMapping))})),this._editors))).recomputeInitiallyAndOnChange(this._store);const _=this._accessibleDiffViewerVisible.map((e=>e?"hidden":"visible"));this._register(QG(this.elements.modified,{visibility:_})),this._register(QG(this.elements.original,{visibility:_})),this._createDiffEditorContributions(),s.addDiffEditor(this),this._register(A$(this._layoutInfo)),v$(this,(e=>new(XG(PZ,e))(this.elements.root,this._diffModel,this._layoutInfo.map((e=>e.originalEditor)),this._layoutInfo.map((e=>e.modifiedEditor)),this._editors))).recomputeInitiallyAndOnChange(this._store,(e=>{this._movedBlocksLinesPart.set(e,void 0)})),this._register(QG(this.elements.overlay,{width:this._layoutInfo.map(((e,t)=>e.originalEditor.width+(this._options.renderSideBySide.read(t)?0:e.modifiedEditor.width))),visibility:m$((e=>{var t,i;return this._options.hideUnchangedRegions.read(e)&&0===(null===(i=null===(t=this._diffModel.read(e))||void 0===t?void 0:t.diff.read(e))||void 0===i?void 0:i.mappings.length)?"visible":"hidden"}))})),this._register(z.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,(e=>{var t,i;if(3===(null==e?void 0:e.reason)){const n=null===(i=null===(t=this._diffModel.get())||void 0===t?void 0:t.diff.get())||void 0===i?void 0:i.mappings.find((t=>t.lineRangeMapping.modified.contains(e.position.lineNumber)));(null==n?void 0:n.lineRangeMapping.modified.isEmpty)?this._audioCueService.playAudioCue(rZ.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):(null==n?void 0:n.lineRangeMapping.original.isEmpty)?this._audioCueService.playAudioCue(rZ.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):n&&this._audioCueService.playAudioCue(rZ.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}})));const v=this._diffModel.map(this,((e,t)=>{if(e)return void 0===e.diff.read(t)&&!e.isDiffUpToDate.read(t)}));this._register(S$(((e,t)=>{if(!0===v.read(e)){const e=this._editorProgressService.show(!0,1e3);t.add(I((()=>e.done())))}}))),this._register(I((()=>{var e;this._shouldDisposeDiffModel&&(null===(e=this._diffModel.get())||void 0===e||e.dispose())})))}_createInnerEditor(e,t,i,n){return e.createInstance(oV,t,i,n)}_createDiffEditorContributions(){const e=Zd.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(e){h(e)}}get _targetEditor(){return this._editors.modified}getEditorType(){return gB.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var e;return{original:this._editors.original.saveViewState(),modified:this._editors.modified.saveViewState(),modelState:null===(e=this._diffModel.get())||void 0===e?void 0:e.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const i=e;this._editors.original.restoreViewState(i.original),this._editors.modified.restoreViewState(i.modified),i.modelState&&(null===(t=this._diffModel.get())||void 0===t||t.restoreSerializedState(i.modelState))}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(oY,e,this._options)}getModel(){var e,t;return null!==(t=null===(e=this._diffModel.get())||void 0===e?void 0:e.model)&&void 0!==t?t:null}setModel(e,t){!e&&this._diffModel.get()&&this._accessibleDiffViewer.get().close();const i=e?"model"in e?{model:e,shouldDispose:!1}:{model:this.createViewModel(e),shouldDispose:!0}:void 0;this._diffModel.get()!==(null==i?void 0:i.model)&&i$(t,(e=>{var t;D$.batchEventsGlobally(e,(()=>{this._editors.original.setModel(i?i.model.model.original:null),this._editors.modified.setModel(i?i.model.model.modified:null)}));const n=this._diffModel.get(),o=this._shouldDisposeDiffModel;this._shouldDisposeDiffModel=null!==(t=null==i?void 0:i.shouldDispose)&&void 0!==t&&t,this._diffModel.set(null==i?void 0:i.model,e),o&&(null==n||n.dispose())}))}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var e;const t=null===(e=this._diffModel.get())||void 0===e?void 0:e.diff.get();return t?function(e){return e.mappings.map((e=>{const t=e.lineRangeMapping;let i,n,o,s,r=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,n=0,r=void 0):(i=t.original.startLineNumber,n=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,s=0,r=void 0):(o=t.modified.startLineNumber,s=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:n,modifiedStartLineNumber:o,modifiedEndLineNumber:s,charChanges:null==r?void 0:r.map((e=>({originalStartLineNumber:e.originalRange.startLineNumber,originalStartColumn:e.originalRange.startColumn,originalEndLineNumber:e.originalRange.endLineNumber,originalEndColumn:e.originalRange.endColumn,modifiedStartLineNumber:e.modifiedRange.startLineNumber,modifiedStartColumn:e.modifiedRange.startColumn,modifiedEndLineNumber:e.modifiedRange.endLineNumber,modifiedEndColumn:e.modifiedRange.endColumn})))}}))}(t):null}revert(e){var t;if(e.innerChanges)return void this.revertRangeMappings(e.innerChanges);const i=null===(t=this._diffModel.get())||void 0===t?void 0:t.model;i&&this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:i.original.getValueInRange(e.original.toExclusiveRange())}])}revertRangeMappings(e){const t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;const i=e.map((e=>({range:e.modifiedRange,text:t.model.original.getValueInRange(e.originalRange)})));this._editors.modified.executeEdits("diffEditor",i)}_goTo(e){this._editors.modified.setPosition(new ch(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){var t,i,n,o;const s=null===(i=null===(t=this._diffModel.get())||void 0===t?void 0:t.diff.get())||void 0===i?void 0:i.mappings;if(!s||0===s.length)return;const r=this._editors.modified.getPosition().lineNumber;let a;a="next"===e?null!==(n=s.find((e=>e.lineRangeMapping.modified.startLineNumber>r)))&&void 0!==n?n:s[0]:null!==(o=uu(s,(e=>e.lineRangeMapping.modified.startLineNumber<r)))&&void 0!==o?o:s[s.length-1],this._goTo(a),a.lineRangeMapping.modified.isEmpty?this._audioCueService.playAudioCue(rZ.diffLineDeleted,{source:"diffEditor.goToDiff"}):a.lineRangeMapping.original.isEmpty?this._audioCueService.playAudioCue(rZ.diffLineInserted,{source:"diffEditor.goToDiff"}):a&&this._audioCueService.playAudioCue(rZ.diffLineModified,{source:"diffEditor.goToDiff"})}revealFirstDiff(){const e=this._diffModel.get();e&&this.waitForDiff().then((()=>{var t;const i=null===(t=e.diff.get())||void 0===t?void 0:t.mappings;i&&0!==i.length&&this._goTo(i[0])}))}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){var e,t;const i=this._editors.modified.hasWidgetFocus(),n=i?this._editors.modified:this._editors.original,o=i?this._editors.original:this._editors.modified;let s;const r=n.getSelection();if(r){const n=null===(t=null===(e=this._diffModel.get())||void 0===e?void 0:e.diff.get())||void 0===t?void 0:t.mappings.map((e=>i?e.lineRangeMapping.flip():e.lineRangeMapping));if(n){const e=tZ(r.getStartPosition(),n),t=tZ(r.getEndPosition(),n);s=tc.plusRange(e,t)}}return{destination:o,destinationSelection:s}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var e;const t=null===(e=this._diffModel.get())||void 0===e?void 0:e.unchangedRegions.get();t&&e$((e=>{for(const i of t)i.collapseAll(e)}))}showAllUnchangedRegions(){var e;const t=null===(e=this._diffModel.get())||void 0===e?void 0:e.unchangedRegions.get();t&&e$((e=>{for(const i of t)i.showAll(e)}))}};xY=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([LY(3,sd),LY(4,lh),LY(5,dh),LY(6,nZ),LY(7,uL)],xY),Nd(class extends Ed{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:me(0,"Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:Sl.map,toggled:Bh.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:Bh.has("isInDiffEditor"),menu:{when:Bh.has("isInDiffEditor"),id:yd.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(ug),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}});class DY extends Ed{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:me(0,"Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:Bh.has("isInDiffEditor")})}run(e,...t){const i=e.get(ug),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}Nd(DY);class EY extends Ed{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:{value:me(0,"Toggle Use Inline View When Space Is Limited"),original:"Toggle Use Inline View When Space Is Limited"},precondition:Bh.has("isInDiffEditor")})}run(e,...t){const i=e.get(ug),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}Nd(EY),Ld.appendMenuItem(yd.EditorTitle,{command:{id:(new EY).desc.id,title:me(0,"Use Inline View When Space Is Limited"),toggled:Bh.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:Bh.has("isInDiffEditor")},order:11,group:"1_diff",when:Bh.and(nc.diffEditorRenderSideBySideInlineBreakpointReached,Bh.has("isInDiffEditor"))}),Ld.appendMenuItem(yd.EditorTitle,{command:{id:(new DY).desc.id,title:me(0,"Show Moved Code Blocks"),icon:Sl.move,toggled:Uh.create("config.diffEditor.experimental.showMoves",!0),precondition:Bh.has("isInDiffEditor")},order:10,group:"1_diff",when:Bh.has("isInDiffEditor")});const NY={value:me(0,"Diff Editor"),original:"Diff Editor"};Nd(class extends Ud{constructor(){super({id:"diffEditor.switchSide",title:{value:me(0,"Switch Side"),original:"Switch Side"},icon:Sl.arrowSwap,precondition:Bh.has("isInDiffEditor"),f1:!0,category:NY})}runEditorCommand(e,t,i){const n=AY(e);if(n instanceof xY){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}),Nd(class extends Ud{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:me(0,"Exit Compare Move"),original:"Exit Compare Move"},icon:Sl.close,precondition:nc.comparingMovedCode,f1:!1,category:NY,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=AY(e);n instanceof xY&&n.exitCompareMove()}}),Nd(class extends Ud{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:me(0,"Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:Sl.fold,precondition:Bh.has("isInDiffEditor"),f1:!0,category:NY})}runEditorCommand(e,t,...i){const n=AY(e);n instanceof xY&&n.collapseAllUnchangedRegions()}}),Nd(class extends Ud{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:me(0,"Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:Sl.unfold,precondition:Bh.has("isInDiffEditor"),f1:!0,category:NY})}runEditorCommand(e,t,...i){const n=AY(e);n instanceof xY&&n.showAllUnchangedRegions()}});const IY={value:me(0,"Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class MY extends Ed{constructor(){super({id:MY.id,title:{value:me(0,"Go to Next Difference"),original:"Go to Next Difference"},category:IY,precondition:Bh.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=AY(e);null==t||t.accessibleDiffViewerNext()}}MY.id="editor.action.accessibleDiffViewer.next",Ld.appendMenuItem(yd.EditorTitle,{command:{id:MY.id,title:me(0,"Open Accessible Diff Viewer"),precondition:Bh.has("isInDiffEditor")},order:10,group:"2_diff",when:Bh.and(nc.accessibleDiffViewerVisible.negate(),Bh.has("isInDiffEditor"))});class TY extends Ed{constructor(){super({id:TY.id,title:{value:me(0,"Go to Previous Difference"),original:"Go to Previous Difference"},category:IY,precondition:Bh.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=AY(e);null==t||t.accessibleDiffViewerPrev()}}function AY(e){var t;const i=e.get(dh),n=i.listDiffEditors(),o=null!==(t=i.getFocusedCodeEditor())&&void 0!==t?t:i.getActiveCodeEditor();if(!o)return null;for(let e=0,t=n.length;e<t;e++){const t=n[e];if(t.getModifiedEditor().getId()===o.getId()||t.getOriginalEditor().getId()===o.getId())return t}const s=Us();if(s)for(const e of n)if(RY(e.getContainerDomNode(),s))return e;return null}function RY(e,t){let i=t;for(;i;){if(i===e)return!0;i=i.parentElement}return!1}TY.id="editor.action.accessibleDiffViewer.prev",Ch.registerCommandAlias("editor.action.diffReview.next",MY.id),Nd(MY),Ch.registerCommandAlias("editor.action.diffReview.prev",TY.id),Nd(TY);var OY=i(7070),PY={};PY.styleTagTransform=Vr(),PY.setAttributes=Pr(),PY.insert=Rr().bind(null,"head"),PY.domAPI=Tr(),PY.insertStyleElement=Br(),Ir()(OY.Z,PY),OY.Z&&OY.Z.locals&&OY.Z.locals;class FY{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){const i=e.getValueInRange(this.selection);this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new tc(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),!this.selection.containsPosition(this.targetPosition)||this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition))?this.copy?this.targetSelection=new ic(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn):this.targetPosition.lineNumber>this.selection.endLineNumber?this.targetSelection=new ic(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn):this.targetPosition.lineNumber<this.selection.endLineNumber?this.targetSelection=new ic(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber+this.selection.endLineNumber-this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn):this.selection.endColumn<=this.targetPosition.column?this.targetSelection=new ic(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,(this.selection.startLineNumber,this.selection.endLineNumber,this.targetPosition.column-this.selection.endColumn+this.selection.startColumn),this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column:this.selection.endColumn):this.targetSelection=new ic(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column+this.selection.endColumn-this.selection.startColumn):this.targetSelection=this.selection}computeCursorState(e,t){return this.targetSelection}}function BY(e){return Ve?e.altKey:e.ctrlKey}class WY extends T{constructor(e){super(),this._editor=e,this._dndDecorationIds=this._editor.createDecorationsCollection(),this._register(this._editor.onMouseDown((e=>this._onEditorMouseDown(e)))),this._register(this._editor.onMouseUp((e=>this._onEditorMouseUp(e)))),this._register(this._editor.onMouseDrag((e=>this._onEditorMouseDrag(e)))),this._register(this._editor.onMouseDrop((e=>this._onEditorMouseDrop(e)))),this._register(this._editor.onMouseDropCanceled((()=>this._onEditorMouseDropCanceled()))),this._register(this._editor.onKeyDown((e=>this.onEditorKeyDown(e)))),this._register(this._editor.onKeyUp((e=>this.onEditorKeyUp(e)))),this._register(this._editor.onDidBlurEditorWidget((()=>this.onEditorBlur()))),this._register(this._editor.onDidBlurEditorText((()=>this.onEditorBlur()))),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){this._editor.getOption(35)&&!this._editor.getOption(22)&&(BY(e)&&(this._modifierPressed=!0),this._mouseDown&&BY(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){this._editor.getOption(35)&&!this._editor.getOption(22)&&(BY(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===WY.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(null===this._dragSelection){const e=(this._editor.getSelections()||[]).filter((e=>t.position&&e.containsPosition(t.position)));if(1!==e.length)return;this._dragSelection=e[0]}BY(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){const t=new ch(e.target.position.lineNumber,e.target.position.column);if(null===this._dragSelection){let i=null;if(e.event.shiftKey){const e=this._editor.getSelection();if(e){const{selectionStartLineNumber:n,selectionStartColumn:o}=e;i=[new ic(n,o,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map((e=>e.containsPosition(t)?new ic(t.lineNumber,t.column,t.lineNumber,t.column):e));this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(BY(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(WY.ID,new FY(this._dragSelection,t,BY(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){this._dndDecorationIds.set([{range:new tc(e.lineNumber,e.column,e.lineNumber,e.column),options:WY._DECORATION_OPTIONS}]),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return 6===e.type||7===e.type}_hitMargin(e){return 2===e.type||3===e.type||4===e.type}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}}WY.ID="editor.contrib.dragAndDrop",WY.TRIGGER_KEY_VALUE=Ve?6:5,WY._DECORATION_OPTIONS=Sy.register({description:"dnd-target",className:"dnd-target"}),Gd(WY.ID,WY,2);var VY=function(e,t){return function(i,n){t(i,n,e)}};class zY{remove(){var e;null===(e=this.parent)||void 0===e||e.children.delete(this.id)}static findId(e,t){let i;"string"==typeof e?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,void 0!==t.children.get(i)&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let n=i;for(let e=0;void 0!==t.children.get(n);e++)n=`${i}_${e}`;return n}static empty(e){return 0===e.children.size}}class HY extends zY{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class UY extends zY{constructor(e,t,i,n){super(),this.id=e,this.parent=t,this.label=i,this.order=n,this.children=new Map}}class KY extends zY{static create(e,t,i){const n=new Pt(i),o=new KY(t.uri),s=e.ordered(t),r=s.map(((e,i)=>{var s;const r=zY.findId(`provider_${i}`,o),a=new UY(r,o,null!==(s=e.displayName)&&void 0!==s?s:"Unknown Outline Provider",i);return Promise.resolve(e.provideDocumentSymbols(t,n.token)).then((e=>{for(const t of e||[])KY._makeOutlineElement(t,a);return a}),(e=>(d(e),a))).then((e=>{zY.empty(e)?e.remove():o._groups.set(r,e)}))})),a=e.onDidChange((()=>{Ic(e.ordered(t),s)||n.cancel()}));return Promise.all(r).then((()=>n.token.isCancellationRequested&&!i.isCancellationRequested?KY.create(e,t,i):o._compact())).finally((()=>{n.dispose(),a.dispose(),n.dispose()}))}static _makeOutlineElement(e,t){const i=zY.findId(e,t),n=new HY(i,t,e);if(e.children)for(const t of e.children)KY._makeOutlineElement(t,n);t.children.set(n.id,n)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,i]of this._groups)0===i.children.size?this._groups.delete(t):e+=1;if(1!==e)this.children=this._groups;else{const e=C.first(this._groups.values());for(const[,t]of e.children)t.parent=this,this.children.set(t.id,t)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof HY?e.push(t.symbol):e.push(...C.map(t.children.values(),(e=>e.symbol)));return e.sort(((e,t)=>tc.compareRangesUsingStarts(e.range,t.range)))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return KY._flattenDocumentSymbols(t,e,""),t.sort(((e,t)=>ch.compare(tc.getStartPosition(e.range),tc.getStartPosition(t.range))||ch.compare(tc.getEndPosition(t.range),tc.getEndPosition(e.range))))}static _flattenDocumentSymbols(e,t,i){for(const n of t)e.push({kind:n.kind,tags:n.tags,name:n.name,detail:n.detail,containerName:n.containerName||i,range:n.range,selectionRange:n.selectionRange,children:void 0}),n.children&&KY._flattenDocumentSymbols(e,n.children,n.name)}}const jY=hh("IOutlineModelService");let qY=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new M,this._cache=new na(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved((e=>{this._cache.delete(e.id)})))}dispose(){this._disposables.dispose()}async getOrCreate(e,t){const i=this._languageFeaturesService.documentSymbolProvider,n=i.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!Ic(o.provider,n)){const t=new Pt;o={versionId:e.getVersionId(),provider:n,promiseCnt:0,source:t,promise:KY.create(i,e,t.token),model:void 0},this._cache.set(e.id,o);const s=Date.now();o.promise.then((t=>{o.model=t,this._debounceInformation.update(e,Date.now()-s)})).catch((t=>{this._cache.delete(e.id)}))}if(o.model)return o.model;o.promiseCnt+=1;const s=t.onCancellationRequested((()=>{0==--o.promiseCnt&&(o.source.cancel(),this._cache.delete(e.id))}));try{return await o.promise}finally{s.dispose()}}};qY=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([VY(0,Jk),VY(1,hI),VY(2,uh)],qY),wg(jY,qY,1),Ch.registerCommand("_executeDocumentSymbolProvider",(async function(e,...t){const[i]=t;fl(Ro.isUri(i));const n=e.get(jY),o=e.get(gh),s=await o.createModelReference(i);try{return(await n.getOrCreate(s.object.textEditorModel,Rt.None)).getTopLevelSymbols()}finally{s.dispose()}}));const $Y=function(){if("object"==typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID.bind(crypto);let e;e="object"==typeof crypto&&"function"==typeof crypto.getRandomValues?crypto.getRandomValues.bind(crypto):function(e){for(let t=0;t<e.length;t++)e[t]=Math.floor(256*Math.random());return e};const t=new Uint8Array(16),i=[];for(let e=0;e<256;e++)i.push(e.toString(16).padStart(2,"0"));return function(){e(t),t[6]=15&t[6]|64,t[8]=63&t[8]|128;let n=0,o="";return o+=i[t[n++]],o+=i[t[n++]],o+=i[t[n++]],o+=i[t[n++]],o+="-",o+=i[t[n++]],o+=i[t[n++]],o+="-",o+=i[t[n++]],o+=i[t[n++]],o+="-",o+=i[t[n++]],o+=i[t[n++]],o+="-",o+=i[t[n++]],o+=i[t[n++]],o+=i[t[n++]],o+=i[t[n++]],o+=i[t[n++]],o+=i[t[n++]],o}}();function GY(e){return{asString:async()=>e,asFile:()=>{},value:"string"==typeof e?e:void 0}}class ZY{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return C.some(this,(([e,t])=>t.asFile()))&&t.push("files"),XY(YY(e),t)}get(e){var t;return null===(t=this._entries.get(this.toKey(e)))||void 0===t?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return YY(e)}}function YY(e){return e.toLowerCase()}function QY(e,t){return XY(YY(e),t.map(YY))}function XY(e,t){if("*/*"===e)return t.length>0;if(t.includes(e))return!0;const i=e.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!i)return!1;const[n,o,s]=i;return"*"===s&&t.some((e=>e.startsWith(o+"/")))}const JY=Object.freeze({create:e=>Vc(e.map((e=>e.toString()))).join("\r\n"),split:e=>e.split("\r\n"),parse:e=>JY.split(e).filter((e=>!e.startsWith("#")))});md.add("workbench.contributions.dragAndDrop",new class{});class eQ{constructor(){}static getInstance(){return eQ.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}function tQ(e){const t=new ZY;for(const i of e.items){const e=i.type;if("string"===i.kind){const n=new Promise((e=>i.getAsString(e)));t.append(e,GY(n))}else if("file"===i.kind){const n=i.getAsFile();n&&t.append(e,iQ(n))}}return t}function iQ(e){const t=e.path?Ro.parse(e.path):void 0;return function(e,t,i){const n={id:$Y(),name:e,uri:t,data:i};return{asString:async()=>"",asFile:()=>n,value:void 0}}(e.name,t,(async()=>new Uint8Array(await e.arrayBuffer())))}eQ.INSTANCE=new eQ;const nQ=Object.freeze(["CodeEditors","CodeFiles",Xx.RESOURCES,Xx.INTERNAL_URI_LIST]);function oQ(e,t=!1){const i=tQ(e),n=i.get(Xx.INTERNAL_URI_LIST);if(n)i.replace(yg.uriList,n);else if(t||!i.has(yg.uriList)){const t=[];for(const i of e.items){const e=i.getAsFile();if(e){const i=e.path;try{i?t.push(Ro.file(i).toString()):t.push(Ro.parse(e.name,!0).toString())}catch(e){}}}t.length&&i.replace(yg.uriList,GY(JY.create(t)))}for(const e of nQ)i.delete(e);return i}function sQ(e){var t;function i(e,t){return"providerId"in e&&e.providerId===t.providerId||"mimeType"in e&&e.mimeType===t.handledMimeType}const n=new Map;for(const o of e)for(const s of null!==(t=o.yieldTo)&&void 0!==t?t:[])for(const t of e)if(t!==o&&i(s,t)){let e=n.get(o);e||(e=[],n.set(o,e)),e.push(t)}if(!n.size)return Array.from(e);const o=new Set,s=[];return function e(t){if(!t.length)return[];const i=t[0];if(s.includes(i))return console.warn(`Yield to cycle detected for ${i.providerId}`),t;if(o.has(i))return e(t.slice(1));let r=[];const a=n.get(i);return a&&(s.push(i),r=e(a),s.pop()),o.add(i),[...r,i,...e(t.slice(1))]}(Array.from(e))}var rQ=i(6668),aQ={};aQ.styleTagTransform=Vr(),aQ.setAttributes=Pr(),aQ.insert=Rr().bind(null,"head"),aQ.domAPI=Tr(),aQ.insertStyleElement=Br(),Ir()(rQ.Z,aQ),rQ.Z&&rQ.Z.locals&&rQ.Z.locals;const lQ=Sy.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:" ",inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class hQ extends T{constructor(e,t,i,n,o){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=mr(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=mr("span.icon");this.domNode.append(t),t.classList.add(...Ll.asClassNameArray(Sl.loading),"codicon-modifier-spin");const i=()=>{const e=this.editor.getOption(66);this.domNode.style.height=`${e}px`,this.domNode.style.width=`${Math.ceil(.8*e)}px`};i(),this._register(this.editor.onDidChangeConfiguration((e=>{(e.hasChanged(52)||e.hasChanged(66))&&i()}))),this._register(bs(this.domNode,or.CLICK,(e=>{this.delegate.cancel()})))}getId(){return hQ.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}}hQ.baseId="editor.widget.inlineProgressWidget";let dQ=class extends T{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new A),this._currentWidget=new A,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}async showWhile(e,t,i){const n=this._operationIdPool++;this._currentOperation=n,this.clear(),this._showPromise.value=jt((()=>{const n=tc.fromPositions(e);this._currentDecorations.set([{range:n,options:lQ}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(hQ,this.id,this._editor,n,t,i))}),this._showDelay);try{return await i}finally{this._currentOperation===n&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};dQ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(2,lh)],dQ);var cQ=i(2013),uQ={};uQ.styleTagTransform=Vr(),uQ.setAttributes=Pr(),uQ.insert=Rr().bind(null,"head"),uQ.domAPI=Tr(),uQ.insertStyleElement=Br(),Ir()(cQ.Z,uQ),cQ.Z&&cQ.Z.locals&&cQ.Z.locals,ru.white.toString(),ru.white.toString();class gQ extends T{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new q),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,n=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=n||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),e.appendChild(this._element),this._register(KL.addTarget(this._element)),[or.CLICK,UL.Tap].forEach((e=>{this._register(bs(this._element,e,(e=>{this.enabled?this._onDidClick.fire(e):rr(e)})))})),this._register(bs(this._element,or.KEY_DOWN,(e=>{const t=new Dt(e);let i=!1;this.enabled&&(t.equals(3)||t.equals(10))?(this._onDidClick.fire(e),i=!0):t.equals(9)&&(this._element.blur(),i=!0),i&&rr(t,!0)}))),this._register(bs(this._element,or.MOUSE_OVER,(e=>{this._element.classList.contains("disabled")||this.updateBackground(!0)}))),this._register(bs(this._element,or.MOUSE_OUT,(e=>{this.updateBackground(!1)}))),this.focusTracker=this._register(lr(this._element)),this._register(this.focusTracker.onDidFocus((()=>{this.enabled&&this.updateBackground(!0)}))),this._register(this.focusTracker.onDidBlur((()=>{this.enabled&&this.updateBackground(!1)})))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let i of nx(e))if("string"==typeof i){if(i=i.trim(),""===i)continue;const e=document.createElement("span");e.textContent=i,t.push(e)}else t.push(i);return t}updateBackground(e){let t;t=this.options.secondary?e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){var t,i,n;if(this._label===e)return;if(ih(this._label)&&ih(e)&&((i=this._label)===(n=e)||i&&n&&i.value===n.value&&i.isTrusted===n.isTrusted&&i.supportThemeIcons===n.supportThemeIcons&&i.supportHtml===n.supportHtml&&(i.baseUri===n.baseUri||i.baseUri&&n.baseUri&&Hl(Ro.from(i.baseUri),Ro.from(n.baseUri)))))return;this._element.classList.add("monaco-text-button");const o=this.options.supportShortLabel?this._labelElement:this._element;if(ih(e)){const i=gx(e,{inline:!0});i.dispose();const n=null===(t=i.element.querySelector("p"))||void 0===t?void 0:t.innerHTML;if(n){const e=Ji(n,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});o.innerHTML=e}else cr(o)}else this.options.supportIcons?cr(o,...this.getContentElements(e)):o.textContent=e;"string"==typeof this.options.title?this._element.title=this.options.title:this.options.title&&(this._element.title=function(e){return"string"==typeof e?e:function(e){var t;let i=null!==(t=e.value)&&void 0!==t?t:"";i.length>1e5&&(i=`${i.substr(0,1e5)}…`);const n=lx.parse(i,{renderer:bx.value}).replace(/&(#\d+|[a-zA-Z]+);/g,(e=>{var t;return null!==(t=vx.get(e))&&void 0!==t?t:e}));return fx({isTrusted:!1},n).toString()}(e)}(e)),this._label=e}get label(){return this._label}set icon(e){this._element.classList.add(...Ll.asClassNameArray(e))}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}}var pQ=i(3399),mQ={};mQ.styleTagTransform=Vr(),mQ.setAttributes=Pr(),mQ.insert=Rr().bind(null,"head"),mQ.domAPI=Tr(),mQ.insertStyleElement=Br(),Ir()(pQ.Z,mQ),pQ.Z&&pQ.Z.locals&&pQ.Z.locals;var fQ,_Q=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},vQ=function(e,t){return function(i,n){t(i,n,e)}};let bQ=fQ=class extends T{constructor(e,t,i,n,o,s,r,a,l,h){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=o,this.edits=s,this.onSelectNewEdit=r,this._contextMenuService=a,this._keybindingService=h,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(l),this.visibleContext.set(!0),this._register(I((()=>this.visibleContext.reset()))),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(I((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition((e=>{o.containsPosition(e.position)||this.dispose()}))),this._register(z.runAndSubscribe(h.onDidUpdateKeybindings,(()=>{this._updateButtonTitle()})))}_updateButtonTitle(){var e;const t=null===(e=this._keybindingService.lookupKeybinding(this.showCommand.id))||void 0===e?void 0:e.getLabel();this.button.element.title=this.showCommand.label+(t?` (${t})`:"")}create(){this.domNode=mr(".post-edit-widget"),this.button=this._register(new gQ(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(bs(this.domNode,or.CLICK,(()=>this.showSelector())))}getId(){return fQ.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=As(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map(((e,t)=>bh({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}})))})}};bQ.baseId="editor.widget.postEditWidget",bQ=fQ=_Q([vQ(7,qE),vQ(8,sd),vQ(9,ML)],bQ);let wQ=class extends T{constructor(e,t,i,n,o,s){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=o,this._bulkEditService=s,this._currentWidget=this._register(new A),this._register(z.any(t.onDidChangeModel,t.onDidChangeModelContent)((()=>this.clear())))}async applyEditAndShowIfNeeded(e,t,i,n){var o,s;const r=this._editor.getModel();if(!r||!e.length)return;const a=t.allEdits[t.activeEditIndex];if(!a)return;let l=[];l=("string"==typeof a.insertText?""===a.insertText:""===a.insertText.snippet)?[]:e.map((e=>new Qk(r.uri,"string"==typeof a.insertText?{range:e,text:a.insertText,insertAsSnippet:!1}:{range:e,text:a.insertText.snippet,insertAsSnippet:!0})));const h={edits:[...l,...null!==(s=null===(o=a.additionalEdit)||void 0===o?void 0:o.edits)&&void 0!==s?s:[]]},d=e[0],c=r.deltaDecorations([],[{range:d,options:{description:"paste-line-suffix",stickiness:0}}]);let u,g;try{u=await this._bulkEditService.apply(h,{editor:this._editor,token:n}),g=r.getDecorationRange(c[0])}finally{r.deltaDecorations(c,[])}i&&u.isApplied&&t.allEdits.length>1&&this.show(null!=g?g:d,t,(async o=>{const s=this._editor.getModel();s&&(await s.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:o,allEdits:t.allEdits},i,n))}))}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(bQ,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;null===(e=this._currentWidget.value)||void 0===e||e.showSelector()}};wQ=_Q([vQ(4,lh),vQ(5,Zk)],wQ);var CQ,yQ=function(e,t){return function(i,n){t(i,n,e)}};const SQ="editor.changePasteType",kQ=new od("pasteWidgetVisible",!1,me(0,"Whether the paste widget is showing")),LQ="application/vnd.code.copyMetadata";let xQ=CQ=class extends T{static get(e){return e.getContribution(CQ.ID)}constructor(e,t,i,n,o,s,r){super(),this._bulkEditService=i,this._clipboardService=n,this._languageFeaturesService=o,this._quickInputService=s,this._progressService=r,this._editor=e;const a=e.getContainerDomNode();this._register(bs(a,"copy",(e=>this.handleCopy(e)))),this._register(bs(a,"cut",(e=>this.handleCopy(e)))),this._register(bs(a,"paste",(e=>this.handlePaste(e)),!0)),this._pasteProgressManager=this._register(new dQ("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(wQ,"pasteIntoEditor",e,kQ,{id:SQ,label:me(0,"Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},js().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(84).enabled&&!this._editor.getOption(90)}handleCopy(e){var t,i;if(!this._editor.hasTextFocus())return;if(Ue&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled())return;const n=this._editor.getModel(),o=this._editor.getSelections();if(!n||!(null==o?void 0:o.length))return;const s=this._editor.getOption(37);let r=o;const a=1===o.length&&o[0].isEmpty();if(a){if(!s)return;r=[new tc(r[0].startLineNumber,1,r[0].startLineNumber,1+n.getLineLength(r[0].startLineNumber))]}const l=null===(t=this._editor._getViewModel())||void 0===t?void 0:t.getPlainTextToCopy(o,s,We),h={multicursorText:Array.isArray(l)?l:null,pasteOnNewLine:a,mode:null},d=this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter((e=>!!e.prepareDocumentPaste));if(!d.length)return void this.setCopyMetadata(e.clipboardData,{defaultPastePayload:h});const c=tQ(e.clipboardData),u=d.flatMap((e=>{var t;return null!==(t=e.copyMimeTypes)&&void 0!==t?t:[]})),g=$Y();this.setCopyMetadata(e.clipboardData,{id:g,providerCopyMimeTypes:u,defaultPastePayload:h});const p=Wt((async e=>{const t=Pc(await Promise.all(d.map((async t=>{try{return await t.prepareDocumentPaste(n,r,c,e)}catch(e){return void console.error(e)}}))));t.reverse();for(const e of t)for(const[t,i]of e)c.replace(t,i);return c}));null===(i=this._currentCopyOperation)||void 0===i||i.dataTransferPromise.cancel(),this._currentCopyOperation={handle:g,dataTransferPromise:p}}async handlePaste(e){var t,i;if(!e.clipboardData||!this._editor.hasTextFocus())return;null===(t=this._currentPasteOperation)||void 0===t||t.cancel(),this._currentPasteOperation=void 0;const n=this._editor.getModel(),o=this._editor.getSelections();if(!(null==o?void 0:o.length)||!n)return;if(!this.isPasteAsEnabled())return;const s=this.fetchCopyMetadata(e),r=oQ(e.clipboardData);r.delete(LQ);const a=[...e.clipboardData.types,...null!==(i=null==s?void 0:s.providerCopyMimeTypes)&&void 0!==i?i:[],yg.uriList],l=this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter((e=>{var t;return null===(t=e.pasteMimeTypes)||void 0===t?void 0:t.some((e=>QY(e,a)))}));l.length&&(e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,l,o,r,s):this.doPasteInline(l,o,r,s))}doPasteInline(e,t,i,n){const o=Wt((async s=>{const r=this._editor;if(!r.hasModel())return;const a=r.getModel(),l=new oL(r,3,void 0,s);try{if(await this.mergeInDataFromCopy(i,n,l.token),l.token.isCancellationRequested)return;const o=e.filter((e=>DQ(e,i)));if(!o.length||1===o.length&&"text"===o[0].id)return void await this.applyDefaultPasteHandler(i,n,l.token);const s=await this.getPasteEdits(o,i,a,t,l.token);if(l.token.isCancellationRequested)return;if(1===s.length&&"text"===s[0].providerId)return void await this.applyDefaultPasteHandler(i,n,l.token);if(s.length){const e="afterPaste"===r.getOption(84).showPasteSelector;return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:s},e,l.token)}await this.applyDefaultPasteHandler(i,n,l.token)}finally{l.dispose(),this._currentPasteOperation===o&&(this._currentPasteOperation=void 0)}}));this._pasteProgressManager.showWhile(t[0].getEndPosition(),me(0,"Running paste handlers. Click to cancel"),o),this._currentPasteOperation=o}showPasteAsPick(e,t,i,n,o){const s=Wt((async r=>{const a=this._editor;if(!a.hasModel())return;const l=a.getModel(),h=new oL(a,3,void 0,r);try{if(await this.mergeInDataFromCopy(n,o,h.token),h.token.isCancellationRequested)return;let s=t.filter((e=>DQ(e,n)));e&&(s=s.filter((t=>t.id===e)));const r=await this.getPasteEdits(s,n,l,i,h.token);if(h.token.isCancellationRequested)return;if(!r.length)return;let a;if(e)a=r.at(0);else{const e=await this._quickInputService.pick(r.map((e=>({label:e.label,description:e.providerId,detail:e.detail,edit:e}))),{placeHolder:me(0,"Select Paste Action")});a=null==e?void 0:e.edit}if(!a)return;const d=function(e,t,i){var n,o;return{edits:[...t.map((t=>new Qk(e,"string"==typeof i.insertText?{range:t,text:i.insertText,insertAsSnippet:!1}:{range:t,text:i.insertText.snippet,insertAsSnippet:!0}))),...null!==(o=null===(n=i.additionalEdit)||void 0===n?void 0:n.edits)&&void 0!==o?o:[]]}}(l.uri,i,a);await this._bulkEditService.apply(d,{editor:this._editor})}finally{h.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}}));this._progressService.withProgress({location:10,title:me(0,"Running paste handlers")},(()=>s))}setCopyMetadata(e,t){e.setData(LQ,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;const i=e.clipboardData.getData(LQ);if(i)try{return JSON.parse(i)}catch(e){return}const[n,o]=$S.getTextData(e.clipboardData);return o?{defaultPastePayload:{mode:o.mode,multicursorText:null!==(t=o.multicursorText)&&void 0!==t?t:null,pasteOnNewLine:!!o.isFromEmptySelection}}:void 0}async mergeInDataFromCopy(e,t,i){var n;if((null==t?void 0:t.id)&&(null===(n=this._currentCopyOperation)||void 0===n?void 0:n.handle)===t.id){const t=await this._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[i,n]of t)e.replace(i,n)}if(!e.has(yg.uriList)){const t=await this._clipboardService.readResources();if(i.isCancellationRequested)return;t.length&&e.append(yg.uriList,GY(JY.create(t)))}}async getPasteEdits(e,t,i,n,o){const s=await Vt(Promise.all(e.map((async e=>{var s;try{const r=await(null===(s=e.provideDocumentPasteEdits)||void 0===s?void 0:s.call(e,i,n,t,o));if(r)return{...r,providerId:e.id}}catch(e){console.error(e)}}))),o);return sQ(Pc(null!=s?s:[]))}async applyDefaultPasteHandler(e,t,i){var n,o,s;const r=null!==(n=e.get(yg.text))&&void 0!==n?n:e.get("text");if(!r)return;const a=await r.asString();if(i.isCancellationRequested)return;const l={text:a,pasteOnNewLine:null!==(o=null==t?void 0:t.defaultPastePayload.pasteOnNewLine)&&void 0!==o&&o,multicursorText:null!==(s=null==t?void 0:t.defaultPastePayload.multicursorText)&&void 0!==s?s:null,mode:null};this._editor.trigger("keyboard","paste",l)}};function DQ(e,t){var i;return Boolean(null===(i=e.pasteMimeTypes)||void 0===i?void 0:i.some((e=>t.matches(e))))}xQ.ID="editor.contrib.copyPasteActionController",xQ=CQ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([yQ(1,lh),yQ(2,Zk),yQ(3,ZS),yQ(4,Jk),yQ(5,rI),yQ(6,dL)],xQ);var EQ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},NQ=function(e,t){return function(i,n){t(i,n,e)}};const IQ=me(0,"Built-in");class MQ{async provideDocumentPasteEdits(e,t,i,n){const o=await this.getEdit(i,n);return o?{insertText:o.insertText,label:o.label,detail:o.detail,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}:void 0}async provideDocumentOnDropEdits(e,t,i,n){const o=await this.getEdit(i,n);return o?{insertText:o.insertText,label:o.label,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}:void 0}}class TQ extends MQ{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[yg.text],this.pasteMimeTypes=[yg.text]}async getEdit(e,t){const i=e.get(yg.text);if(!i)return;if(e.has(yg.uriList))return;const n=await i.asString();return{handledMimeType:yg.text,label:me(0,"Insert Plain Text"),detail:IQ,insertText:n}}}class AQ extends MQ{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[yg.uriList],this.pasteMimeTypes=[yg.uriList]}async getEdit(e,t){const i=await OQ(e);if(!i.length||t.isCancellationRequested)return;let n=0;const o=i.map((({uri:e,originalText:t})=>e.scheme===jo.file?e.fsPath:(n++,t))).join(" ");let s;return s=n>0?i.length>1?me(0,"Insert Uris"):me(0,"Insert Uri"):i.length>1?me(0,"Insert Paths"):me(0,"Insert Path"),{handledMimeType:yg.uriList,insertText:o,label:s,detail:IQ}}}let RQ=class extends MQ{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[yg.uriList],this.pasteMimeTypes=[yg.uriList]}async getEdit(e,t){const i=await OQ(e);if(!i.length||t.isCancellationRequested)return;const n=Pc(i.map((({uri:e})=>{const t=this._workspaceContextService.getWorkspaceFolder(e);return t?Zl(t.uri,e):void 0})));return n.length?{handledMimeType:yg.uriList,insertText:n.join(" "),label:i.length>1?me(0,"Insert Relative Paths"):me(0,"Insert Relative Path"),detail:IQ}:void 0}};async function OQ(e){const t=e.get(yg.uriList);if(!t)return[];const i=await t.asString(),n=[];for(const e of JY.parse(i))try{n.push({uri:Ro.parse(e),originalText:e})}catch(e){}return n}RQ=EQ([NQ(0,EG)],RQ);let PQ=class extends T{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new TQ)),this._register(e.documentOnDropEditProvider.register("*",new AQ)),this._register(e.documentOnDropEditProvider.register("*",new RQ(t)))}};PQ=EQ([NQ(0,Jk),NQ(1,EG)],PQ);let FQ=class extends T{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new TQ)),this._register(e.documentPasteEditProvider.register("*",new AQ)),this._register(e.documentPasteEditProvider.register("*",new RQ(t)))}};FQ=EQ([NQ(0,Jk),NQ(1,EG)],FQ),Gd(xQ.ID,xQ,0),sA(FQ),jd(new class extends Vd{constructor(){super({id:SQ,precondition:kQ,kbOpts:{weight:100,primary:2137}})}runEditorCommand(e,t,i){var n;return null===(n=xQ.get(t))||void 0===n?void 0:n.changePasteType()}}),qd(class extends zd{constructor(){super({id:"editor.action.pasteAs",label:me(0,"Paste As..."),alias:"Paste As...",precondition:void 0,metadata:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:me(0,"The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(e,t,i){var n;const o="string"==typeof(null==i?void 0:i.id)?i.id:void 0;return null===(n=xQ.get(t))||void 0===n?void 0:n.pasteAs(o)}});class BQ{constructor(e){this.identifier=e}}const WQ=hh("treeViewsDndService");wg(WQ,class{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}},1);var VQ,zQ=function(e,t){return function(i,n){t(i,n,e)}};const HQ="editor.experimental.dropIntoEditor.defaultProvider",UQ="editor.changeDropType",KQ=new od("dropWidgetVisible",!1,me(0,"Whether the drop widget is showing"));let jQ=VQ=class extends T{static get(e){return e.getContribution(VQ.ID)}constructor(e,t,i,n,o){super(),this._configService=i,this._languageFeaturesService=n,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=eQ.getInstance(),this._dropProgressManager=this._register(t.createInstance(dQ,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(wQ,"dropIntoEditor",e,KQ,{id:UQ,label:me(0,"Show drop options...")})),this._register(e.onDropIntoEditor((t=>this.onDropIntoEditor(e,t.position,t.event))))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,i){var n;if(!i.dataTransfer||!e.hasModel())return;null===(n=this._currentOperation)||void 0===n||n.cancel(),e.focus(),e.setPosition(t);const o=Wt((async n=>{const s=new oL(e,1,void 0,n);try{const o=await this.extractDataTransferData(i);if(0===o.size||s.token.isCancellationRequested)return;const r=e.getModel();if(!r)return;const a=this._languageFeaturesService.documentOnDropEditProvider.ordered(r).filter((e=>!e.dropMimeTypes||e.dropMimeTypes.some((e=>o.matches(e))))),l=await this.getDropEdits(a,r,t,o,s);if(s.token.isCancellationRequested)return;if(l.length){const i=this.getInitialActiveEditIndex(r,l),o="afterDrop"===e.getOption(36).showDropSelector;await this._postDropWidgetManager.applyEditAndShowIfNeeded([tc.fromPositions(t)],{activeEditIndex:i,allEdits:l},o,n)}}finally{s.dispose(),this._currentOperation===o&&(this._currentOperation=void 0)}}));this._dropProgressManager.showWhile(t,me(0,"Running drop handlers. Click to cancel"),o),this._currentOperation=o}async getDropEdits(e,t,i,n,o){const s=await Vt(Promise.all(e.map((async e=>{try{const s=await e.provideDocumentOnDropEdits(t,i,n,o.token);if(s)return{...s,providerId:e.id}}catch(e){console.error(e)}}))),o.token);return sQ(Pc(null!=s?s:[]))}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(HQ,{resource:e.uri});for(const[e,n]of Object.entries(i)){const i=t.findIndex((t=>n===t.providerId&&t.handledMimeType&&QY(e,[t.handledMimeType])));if(i>=0)return i}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new ZY;const t=oQ(e.dataTransfer);if(this.treeItemsTransfer.hasData(BQ.prototype)){const e=this.treeItemsTransfer.getData(BQ.prototype);if(Array.isArray(e))for(const i of e){const e=await this._treeViewsDragAndDropService.removeDragOperationTransfer(i.identifier);if(e)for(const[i,n]of e)t.replace(i,n)}}return t}};jQ.ID="editor.contrib.dropIntoEditorController",jQ=VQ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([zQ(1,lh),zQ(2,ug),zQ(3,Jk),zQ(4,WQ)],jQ),Gd(jQ.ID,jQ,2),jd(new class extends Vd{constructor(){super({id:UQ,precondition:KQ,kbOpts:{weight:100,primary:2137}})}runEditorCommand(e,t,i){var n;null===(n=jQ.get(t))||void 0===n||n.changeDropType()}}),sA(PQ),md.as(Lg).registerConfiguration({...Kk,properties:{[HQ]:{type:"object",scope:5,description:me(0,"Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}});class qQ{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map((e=>this._editor.getModel().getDecorationRange(e))).filter((e=>!!e));if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e<this._decorations.length?this._decorations[e]:null;return t?this._editor.getModel().getDecorationRange(t):null}getCurrentMatchesPosition(e){const t=this._editor.getModel().getDecorationsInRange(e);for(const e of t){const t=e.options;if(t===qQ._FIND_MATCH_DECORATION||t===qQ._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(e.id)}return 0}setCurrentFindMatch(e){let t=null,i=0;if(e)for(let n=0,o=this._decorations.length;n<o;n++){const o=this._editor.getModel().getDecorationRange(this._decorations[n]);if(e.equalsRange(o)){t=this._decorations[n],i=n+1;break}}return null===this._highlightedDecorationId&&null===t||this._editor.changeDecorations((e=>{if(null!==this._highlightedDecorationId&&(e.changeDecorationOptions(this._highlightedDecorationId,qQ._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),null!==t&&(this._highlightedDecorationId=t,e.changeDecorationOptions(this._highlightedDecorationId,qQ._CURRENT_FIND_MATCH_DECORATION)),null!==this._rangeHighlightDecorationId&&(e.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),null!==t){let i=this._editor.getModel().getDecorationRange(t);if(i.startLineNumber!==i.endLineNumber&&1===i.endColumn){const e=i.endLineNumber-1,t=this._editor.getModel().getLineMaxColumn(e);i=new tc(i.startLineNumber,i.startColumn,e,t)}this._rangeHighlightDecorationId=e.addDecoration(i,qQ._RANGE_HIGHLIGHT_DECORATION)}})),i}set(e,t){this._editor.changeDecorations((i=>{let n=qQ._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){n=qQ._FIND_MATCH_NO_OVERVIEW_DECORATION;const t=this._editor.getModel().getLineCount(),i=this._editor.getLayoutInfo().height/t,s=Math.max(2,Math.ceil(3/i));let r=e[0].range.startLineNumber,a=e[0].range.endLineNumber;for(let t=1,i=e.length;t<i;t++){const i=e[t].range;a+s>=i.startLineNumber?i.endLineNumber>a&&(a=i.endLineNumber):(o.push({range:new tc(r,1,a,1),options:qQ._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),r=i.startLineNumber,a=i.endLineNumber)}o.push({range:new tc(r,1,a,1),options:qQ._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const s=new Array(e.length);for(let t=0,i=e.length;t<i;t++)s[t]={range:e[t].range,options:n};this._decorations=i.deltaDecorations(this._decorations,s),this._overviewRulerApproximateDecorations=i.deltaDecorations(this._overviewRulerApproximateDecorations,o),this._rangeHighlightDecorationId&&(i.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),this._findScopeDecorationIds.length&&(this._findScopeDecorationIds.forEach((e=>i.removeDecoration(e))),this._findScopeDecorationIds=[]),(null==t?void 0:t.length)&&(this._findScopeDecorationIds=t.map((e=>i.addDecoration(e,qQ._FIND_SCOPE_DECORATION))))}))}matchBeforePosition(e){if(0===this._decorations.length)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],n=this._editor.getModel().getDecorationRange(i);if(n&&!(n.endLineNumber>e.lineNumber)){if(n.endLineNumber<e.lineNumber)return n;if(!(n.endColumn>e.column))return n}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(0===this._decorations.length)return null;for(let t=0,i=this._decorations.length;t<i;t++){const i=this._decorations[t],n=this._editor.getModel().getDecorationRange(i);if(n&&!(n.startLineNumber<e.lineNumber)){if(n.startLineNumber>e.lineNumber)return n;if(!(n.startColumn<e.column))return n}}return this._editor.getModel().getDecorationRange(this._decorations[0])}_allDecorations(){let e=[];return e=e.concat(this._decorations),e=e.concat(this._overviewRulerApproximateDecorations),this._findScopeDecorationIds.length&&e.push(...this._findScopeDecorationIds),this._rangeHighlightDecorationId&&e.push(this._rangeHighlightDecorationId),e}}qQ._CURRENT_FIND_MATCH_DECORATION=Sy.register({description:"current-find-match",stickiness:1,zIndex:13,className:"currentFindMatch",showIfCollapsed:!0,overviewRuler:{color:Av(av),position:vc.Center},minimap:{color:Av(hv),position:wc.Inline}}),qQ._FIND_MATCH_DECORATION=Sy.register({description:"find-match",stickiness:1,zIndex:10,className:"findMatch",showIfCollapsed:!0,overviewRuler:{color:Av(av),position:vc.Center},minimap:{color:Av(hv),position:wc.Inline}}),qQ._FIND_MATCH_NO_OVERVIEW_DECORATION=Sy.register({description:"find-match-no-overview",stickiness:1,className:"findMatch",showIfCollapsed:!0}),qQ._FIND_MATCH_ONLY_OVERVIEW_DECORATION=Sy.register({description:"find-match-only-overview",stickiness:1,overviewRuler:{color:Av(av),position:vc.Center}}),qQ._RANGE_HIGHLIGHT_DECORATION=Sy.register({description:"find-range-highlight",stickiness:1,className:"rangeHighlight",isWholeLine:!0}),qQ._FIND_SCOPE_DECORATION=Sy.register({description:"find-scope",className:"findScope",isWholeLine:!0});class $Q{constructor(e,t,i){this._editorSelection=e,this._ranges=t,this._replaceStrings=i,this._trackedEditorSelectionId=null}getEditOperations(e,t){if(this._ranges.length>0){const e=[];for(let t=0;t<this._ranges.length;t++)e.push({range:this._ranges[t],text:this._replaceStrings[t]});e.sort(((e,t)=>tc.compareRangesUsingStarts(e.range,t.range)));const i=[];let n=e[0];for(let t=1;t<e.length;t++)n.range.endLineNumber===e[t].range.startLineNumber&&n.range.endColumn===e[t].range.startColumn?(n.range=n.range.plusRange(e[t].range),n.text=n.text+e[t].text):(i.push(n),n=e[t]);i.push(n);for(const e of i)t.addEditOperation(e.range,e.text)}this._trackedEditorSelectionId=t.trackSelection(this._editorSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._trackedEditorSelectionId)}}function GQ(e,t){if(e&&""!==e[0]){const i=ZQ(e,t,"-"),n=ZQ(e,t,"_");return i&&!n?YQ(e,t,"-"):!i&&n?YQ(e,t,"_"):e[0].toUpperCase()===e[0]?t.toUpperCase():e[0].toLowerCase()===e[0]?t.toLowerCase():function(e,t=!1){return!!e&&(t&&(e=e.replace(/\\./g,"")),e.toLowerCase()!==e)}(e[0][0])&&t.length>0?t[0].toUpperCase()+t.substr(1):e[0][0].toUpperCase()!==e[0][0]&&t.length>0?t[0].toLowerCase()+t.substr(1):t}return t}function ZQ(e,t,i){return-1!==e[0].indexOf(i)&&-1!==t.indexOf(i)&&e[0].split(i).length===t.split(i).length}function YQ(e,t,i){const n=t.split(i),o=e[0].split(i);let s="";return n.forEach(((e,t)=>{s+=GQ([o[t]],e)+i})),s.slice(0,-1)}class QQ{constructor(e){this.staticValue=e,this.kind=0}}class XQ{constructor(e){this.pieces=e,this.kind=1}}class JQ{static fromStaticValue(e){return new JQ([eX.staticValue(e)])}get hasReplacementPatterns(){return 1===this._state.kind}constructor(e){e&&0!==e.length?1===e.length&&null!==e[0].staticValue?this._state=new QQ(e[0].staticValue):this._state=new XQ(e):this._state=new QQ("")}buildReplaceString(e,t){if(0===this._state.kind)return t?GQ(e,this._state.staticValue):this._state.staticValue;let i="";for(let t=0,n=this._state.pieces.length;t<n;t++){const n=this._state.pieces[t];if(null!==n.staticValue){i+=n.staticValue;continue}let o=JQ._substitute(n.matchIndex,e);if(null!==n.caseOps&&n.caseOps.length>0){const e=[],t=n.caseOps.length;let i=0;for(let s=0,r=o.length;s<r;s++){if(i>=t){e.push(o.slice(s));break}switch(n.caseOps[i]){case"U":e.push(o[s].toUpperCase());break;case"u":e.push(o[s].toUpperCase()),i++;break;case"L":e.push(o[s].toLowerCase());break;case"l":e.push(o[s].toLowerCase()),i++;break;default:e.push(o[s])}}o=e.join("")}i+=o}return i}static _substitute(e,t){if(null===t)return"";if(0===e)return t[0];let i="";for(;e>0;){if(e<t.length)return(t[e]||"")+i;i=String(e%10)+i,e=Math.floor(e/10)}return"$"+i}}class eX{static staticValue(e){return new eX(e,-1,null)}static caseOps(e,t){return new eX(null,e,t)}constructor(e,t,i){this.staticValue=e,this.matchIndex=t,i&&0!==i.length?this.caseOps=i.slice(0):this.caseOps=null}}class tX{constructor(e){this._source=e,this._lastCharIndex=0,this._result=[],this._resultLen=0,this._currentStaticPiece=""}emitUnchanged(e){this._emitStatic(this._source.substring(this._lastCharIndex,e)),this._lastCharIndex=e}emitStatic(e,t){this._emitStatic(e),this._lastCharIndex=t}_emitStatic(e){0!==e.length&&(this._currentStaticPiece+=e)}emitMatchIndex(e,t,i){0!==this._currentStaticPiece.length&&(this._result[this._resultLen++]=eX.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),this._result[this._resultLen++]=eX.caseOps(e,i),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),0!==this._currentStaticPiece.length&&(this._result[this._resultLen++]=eX.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),new JQ(this._result)}}const iX=new od("findWidgetVisible",!1),nX=(iX.toNegated(),new od("findInputFocussed",!1)),oX=new od("replaceInputFocussed",!1),sX={primary:545,mac:{primary:2593}},rX={primary:565,mac:{primary:2613}},aX={primary:560,mac:{primary:2608}},lX={primary:554,mac:{primary:2602}},hX={primary:558,mac:{primary:2606}},dX="editor.action.nextMatchFindAction",cX="editor.action.previousMatchFindAction",uX="closeFindWidget",gX="toggleFindCaseSensitive",pX="toggleFindWholeWord",mX="toggleFindRegex",fX="toggleFindInSelection",_X="togglePreserveCase",vX="editor.action.replaceOne",bX="editor.action.replaceAll",wX=19999;class CX{constructor(e,t){this._toDispose=new M,this._editor=e,this._state=t,this._isDisposed=!1,this._startSearchingTimer=new $t,this._decorations=new qQ(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new Zt((()=>this.research(!1)),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition((e=>{3!==e.reason&&5!==e.reason&&6!==e.reason||this._decorations.setStartPosition(this._editor.getPosition())}))),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent((e=>{this._ignoreModelContentChanged||(e.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())}))),this._toDispose.add(this._state.onFindReplaceStateChange((e=>this._onStateChanged(e)))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,E(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){!this._isDisposed&&this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet((()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)}),240)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;void 0!==t?null!==t&&(i=Array.isArray(t)?t:[t]):i=this._decorations.getFindScopes(),null!==i&&(i=i.map((e=>{if(e.startLineNumber!==e.endLineNumber){let t=e.endLineNumber;return 1===e.endColumn&&(t-=1),new tc(e.startLineNumber,1,t,this._editor.getModel().getLineMaxColumn(t))}return e})));const n=this._findMatches(i,!1,wX);this._decorations.set(n,i);const o=this._editor.getSelection();let s=this._decorations.getCurrentMatchesPosition(o);if(0===s&&n.length>0){const e=mu(n.map((e=>e.range)),(e=>tc.compareRangesUsingStarts(e,o)>=0));s=e>0?e-1+1:s}this._state.changeMatchInfo(s,this._decorations.getCount(),void 0),e&&this._editor.getOption(41).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const o=this._editor.getModel();return t||1===n?(1===i?i=o.getLineCount():i--,n=o.getLineMaxColumn(i)):n--,new ch(i,n)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const t=this._decorations.matchAfterPosition(e);return void(t&&this._setCurrentFindMatch(t))}if(this._decorations.getCount()<wX){let t=this._decorations.matchBeforePosition(e);return t&&t.isEmpty()&&t.getStartPosition().equals(e)&&(e=this._prevSearchPosition(e),t=this._decorations.matchBeforePosition(e)),void(t&&this._setCurrentFindMatch(t))}if(this._cannotFind())return;const i=this._decorations.getFindScope(),n=CX._getSearchRange(this._editor.getModel(),i);n.getEndPosition().isBefore(e)&&(e=n.getEndPosition()),e.isBefore(n.getStartPosition())&&(e=n.getEndPosition());const{lineNumber:o,column:s}=e,r=this._editor.getModel();let a=new ch(o,s),l=r.findPreviousMatch(this._state.searchString,a,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,!1);return l&&l.range.isEmpty()&&l.range.getStartPosition().equals(a)&&(a=this._prevSearchPosition(a),l=r.findPreviousMatch(this._state.searchString,a,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,!1)),l?t||n.containsRange(l.range)?void this._setCurrentFindMatch(l.range):this._moveToPrevMatch(l.range.getStartPosition(),!0):void 0}moveToPrevMatch(){this._moveToPrevMatch(this._editor.getSelection().getStartPosition())}_nextSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const o=this._editor.getModel();return t||n===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,n=1):n++,new ch(i,n)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const t=this._decorations.matchBeforePosition(e);return void(t&&this._setCurrentFindMatch(t))}if(this._decorations.getCount()<wX){let t=this._decorations.matchAfterPosition(e);return t&&t.isEmpty()&&t.getStartPosition().equals(e)&&(e=this._nextSearchPosition(e),t=this._decorations.matchAfterPosition(e)),void(t&&this._setCurrentFindMatch(t))}const t=this._getNextMatch(e,!1,!0);t&&this._setCurrentFindMatch(t.range)}_getNextMatch(e,t,i,n=!1){if(this._cannotFind())return null;const o=this._decorations.getFindScope(),s=CX._getSearchRange(this._editor.getModel(),o);s.getEndPosition().isBefore(e)&&(e=s.getStartPosition()),e.isBefore(s.getStartPosition())&&(e=s.getStartPosition());const{lineNumber:r,column:a}=e,l=this._editor.getModel();let h=new ch(r,a),d=l.findNextMatch(this._state.searchString,h,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,t);return i&&d&&d.range.isEmpty()&&d.range.getStartPosition().equals(h)&&(h=this._nextSearchPosition(h),d=l.findNextMatch(this._state.searchString,h,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,t)),d?n||s.containsRange(d.range)?d:this._getNextMatch(d.range.getEndPosition(),t,i,!0):null}moveToNextMatch(){this._moveToNextMatch(this._editor.getSelection().getEndPosition())}_moveToMatch(e){const t=this._decorations.getDecorationRangeAt(e);t&&this._setCurrentFindMatch(t)}moveToMatch(e){this._moveToMatch(e)}_getReplacePattern(){return this._state.isRegex?function(e){if(!e||0===e.length)return new JQ(null);const t=[],i=new tX(e);for(let n=0,o=e.length;n<o;n++){const s=e.charCodeAt(n);if(92!==s){if(36===s){if(n++,n>=o)break;const s=e.charCodeAt(n);if(36===s){i.emitUnchanged(n-1),i.emitStatic("$",n+1);continue}if(48===s||38===s){i.emitUnchanged(n-1),i.emitMatchIndex(0,n+1,t),t.length=0;continue}if(49<=s&&s<=57){let r=s-48;if(n+1<o){const o=e.charCodeAt(n+1);if(48<=o&&o<=57){n++,r=10*r+(o-48),i.emitUnchanged(n-2),i.emitMatchIndex(r,n+1,t),t.length=0;continue}}i.emitUnchanged(n-1),i.emitMatchIndex(r,n+1,t),t.length=0;continue}}}else{if(n++,n>=o)break;const s=e.charCodeAt(n);switch(s){case 92:i.emitUnchanged(n-1),i.emitStatic("\\",n+1);break;case 110:i.emitUnchanged(n-1),i.emitStatic("\n",n+1);break;case 116:i.emitUnchanged(n-1),i.emitStatic("\t",n+1);break;case 117:case 85:case 108:case 76:i.emitUnchanged(n-1),i.emitStatic("",n+1),t.push(String.fromCharCode(s))}}}return i.finalize()}(this._state.replaceString):JQ.fromStaticValue(this._state.replaceString)}replace(){if(!this._hasMatches())return;const e=this._getReplacePattern(),t=this._editor.getSelection(),i=this._getNextMatch(t.getStartPosition(),!0,!1);if(i)if(t.equalsRange(i.range)){const n=e.buildReplaceString(i.matches,this._state.preserveCase),o=new Ky(t,n);this._executeEditorCommand("replace",o),this._decorations.setStartPosition(new ch(t.startLineNumber,t.startColumn+n.length)),this.research(!0)}else this._decorations.setStartPosition(this._editor.getPosition()),this._setCurrentFindMatch(i.range)}_findMatches(e,t,i){const n=(e||[null]).map((e=>CX._getSearchRange(this._editor.getModel(),e)));return this._editor.getModel().findMatches(this._state.searchString,n,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();null===e&&this._state.matchesCount>=wX?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const e=new Kw(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null).parseSearchRequest();if(!e)return;let t=e.regex;if(!t.multiline){let e="mu";t.ignoreCase&&(e+="i"),t.global&&(e+="g"),t=new RegExp(t.source,e)}const i=this._editor.getModel(),n=i.getValue(1),o=i.getFullModelRange(),s=this._getReplacePattern();let r;const a=this._state.preserveCase;r=s.hasReplacementPatterns||a?n.replace(t,(function(){return s.buildReplaceString(arguments,a)})):n.replace(t,s.buildReplaceString(null,a));const l=new Gy(o,r,this._editor.getSelection());this._executeEditorCommand("replaceAll",l)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),n=[];for(let e=0,o=i.length;e<o;e++)n[e]=t.buildReplaceString(i[e].matches,this._state.preserveCase);const o=new $Q(this._editor.getSelection(),i.map((e=>e.range)),n);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let t=this._findMatches(e,!1,1073741824).map((e=>new ic(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn)));const i=this._editor.getSelection();for(let e=0,n=t.length;e<n;e++)if(t[e].equalsRange(i)){t=[i].concat(t.slice(0,e)).concat(t.slice(e+1));break}this._editor.setSelections(t)}_executeEditorCommand(e,t){try{this._ignoreModelContentChanged=!0,this._editor.pushUndoStop(),this._editor.executeCommand(e,t),this._editor.pushUndoStop()}finally{this._ignoreModelContentChanged=!1}}}var yX=i(8875),SX={};SX.styleTagTransform=Vr(),SX.setAttributes=Pr(),SX.insert=Rr().bind(null,"head"),SX.domAPI=Tr(),SX.insertStyleElement=Br(),Ir()(yX.Z,SX),yX.Z&&yX.Z.locals&&yX.Z.locals;class kX extends hD{constructor(e,t,i){super(),this._hideSoon=this._register(new Zt((()=>this._hide()),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const n={inputActiveOptionBorder:wm(Pm),inputActiveOptionForeground:wm(Bm),inputActiveOptionBackground:wm(Fm)};this.caseSensitive=this._register(new Bz({appendTitle:this._keybindingLabelFor(gX),isChecked:this._state.matchCase,...n})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange((()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)}))),this.wholeWords=this._register(new Wz({appendTitle:this._keybindingLabelFor(pX),isChecked:this._state.wholeWord,...n})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange((()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)}))),this.regex=this._register(new Vz({appendTitle:this._keybindingLabelFor(mX),isChecked:this._state.isRegex,...n})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange((()=>{this._state.change({isRegex:this.regex.checked},!1)}))),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange((e=>{let t=!1;e.isRegex&&(this.regex.checked=this._state.isRegex,t=!0),e.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,t=!0),e.matchCase&&(this.caseSensitive.checked=this._state.matchCase,t=!0),!this._state.isRevealed&&t&&this._revealTemporarily()}))),this._register(bs(this._domNode,or.MOUSE_LEAVE,(e=>this._onMouseLeave()))),this._register(bs(this._domNode,"mouseover",(e=>this._onMouseOver())))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return kX.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseLeave(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}}function LX(e,t){return 1===e||2!==e&&t}kX.ID="editor.contrib.findOptionsWidget";class xX extends T{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return LX(this._isRegexOverride,this._isRegex)}get wholeWord(){return LX(this._wholeWordOverride,this._wholeWord)}get matchCase(){return LX(this._matchCaseOverride,this._matchCase)}get preserveCase(){return LX(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}constructor(){super(),this._onFindReplaceStateChange=this._register(new q),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,t,i){const n={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;0===t&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,n.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,n.matchesCount=!0,o=!0),void 0!==i&&(tc.equalsRange(this._currentMatch,i)||(this._currentMatch=i,n.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(n)}change(e,t,i=!0){var n;const o={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let s=!1;const r=this.isRegex,a=this.wholeWord,l=this.matchCase,h=this.preserveCase;void 0!==e.searchString&&this._searchString!==e.searchString&&(this._searchString=e.searchString,o.searchString=!0,s=!0),void 0!==e.replaceString&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,o.replaceString=!0,s=!0),void 0!==e.isRevealed&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,o.isRevealed=!0,s=!0),void 0!==e.isReplaceRevealed&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,o.isReplaceRevealed=!0,s=!0),void 0!==e.isRegex&&(this._isRegex=e.isRegex),void 0!==e.wholeWord&&(this._wholeWord=e.wholeWord),void 0!==e.matchCase&&(this._matchCase=e.matchCase),void 0!==e.preserveCase&&(this._preserveCase=e.preserveCase),void 0!==e.searchScope&&((null===(n=e.searchScope)||void 0===n?void 0:n.every((e=>{var t;return null===(t=this._searchScope)||void 0===t?void 0:t.some((t=>!tc.equalsRange(t,e)))})))||(this._searchScope=e.searchScope,o.searchScope=!0,s=!0)),void 0!==e.loop&&this._loop!==e.loop&&(this._loop=e.loop,o.loop=!0,s=!0),void 0!==e.isSearching&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,o.isSearching=!0,s=!0),void 0!==e.filters&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,o.filters=!0,s=!0),this._isRegexOverride=void 0!==e.isRegexOverride?e.isRegexOverride:0,this._wholeWordOverride=void 0!==e.wholeWordOverride?e.wholeWordOverride:0,this._matchCaseOverride=void 0!==e.matchCaseOverride?e.matchCaseOverride:0,this._preserveCaseOverride=void 0!==e.preserveCaseOverride?e.preserveCaseOverride:0,r!==this.isRegex&&(s=!0,o.isRegex=!0),a!==this.wholeWord&&(s=!0,o.wholeWord=!0),l!==this.matchCase&&(s=!0,o.matchCase=!0),h!==this.preserveCase&&(s=!0,o.preserveCase=!0),s&&this._onFindReplaceStateChange.fire(o)}canNavigateBack(){return this.canNavigateInLoop()||1!==this.matchesPosition}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition<this.matchesCount}canNavigateInLoop(){return this._loop||this.matchesCount>=wX}}var DX=i(6950),EX={};EX.styleTagTransform=Vr(),EX.setAttributes=Pr(),EX.insert=Rr().bind(null,"head"),EX.domAPI=Tr(),EX.insertStyleElement=Br(),Ir()(DX.Z,EX),DX.Z&&DX.Z.locals&&DX.Z.locals;const NX=me(0,"input"),IX=me(0,"Preserve Case");class MX extends Rz{constructor(e){super({icon:Sl.preserveCase,title:IX+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class TX extends hD{constructor(e,t,i,n){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new q),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new q),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new q),this._onInput=this._register(new q),this._onKeyUp=this._register(new q),this._onPreserveCaseKeyDown=this._register(new q),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||NX;const o=n.appendPreserveCaseLabel||"",s=n.history||[],r=!!n.flexibleHeight,a=!!n.flexibleWidth,l=n.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new $z(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:s,showHistoryHint:n.showHistoryHint,flexibleHeight:r,flexibleWidth:a,flexibleMaxHeight:l,inputBoxStyles:n.inputBoxStyles})),this.preserveCase=this._register(new MX({appendTitle:o,isChecked:!1,...n.toggleStyles})),this._register(this.preserveCase.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.preserveCase.onKeyDown((e=>{this._onPreserveCaseKeyDown.fire(e)}))),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const h=[this.preserveCase.domNode];this.onkeydown(this.domNode,(e=>{if(e.equals(15)||e.equals(17)||e.equals(9)){const t=h.indexOf(this.domNode.ownerDocument.activeElement);if(t>=0){let i=-1;e.equals(17)?i=(t+1)%h.length:e.equals(15)&&(i=0===t?h.length-1:t-1),e.equals(9)?(h[t].blur(),this.inputBox.focus()):i>=0&&h[i].focus(),rr(e,!0)}}}));const d=document.createElement("div");d.className="controls",d.style.display=this._showOptionButtons?"block":"none",d.appendChild(this.preserveCase.domNode),this.domNode.appendChild(d),null==e||e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,(e=>this._onKeyDown.fire(e))),this.onkeyup(this.inputBox.inputElement,(e=>this._onKeyUp.fire(e))),this.oninput(this.inputBox.inputElement,(e=>this._onInput.fire())),this.onmousedown(this.inputBox.inputElement,(e=>this._onMouseDown.fire(e)))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){var e;null===(e=this.inputBox)||void 0===e||e.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var AX=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},RX=function(e,t){return function(i,n){t(i,n,e)}};const OX=new od("suggestWidgetVisible",!1,me(0,"Whether suggestion are visible")),PX="historyNavigationWidgetFocus",FX="historyNavigationForwardsEnabled",BX="historyNavigationBackwardsEnabled";let WX;const VX=[];function zX(e,t){if(VX.includes(t))throw new Error("Cannot register the same widget multiple times");VX.push(t);const i=new M,n=new od(PX,!1).bindTo(e),o=new od(FX,!0).bindTo(e),s=new od(BX,!0).bindTo(e),r=()=>{n.set(!0),WX=t},a=()=>{n.set(!1),WX===t&&(WX=void 0)};return Ks(t.element)&&r(),i.add(t.onDidFocus((()=>r()))),i.add(t.onDidBlur((()=>a()))),i.add(I((()=>{VX.splice(VX.indexOf(t),1),a()}))),{historyNavigationForwardsEnablement:o,historyNavigationBackwardsEnablement:s,dispose(){i.dispose()}}}let HX=class extends Qz{constructor(e,t,i,n){super(e,t,i);const o=this._register(n.createScoped(this.inputBox.element));this._register(zX(o,this.inputBox))}};HX=AX([RX(3,sd)],HX);let UX=class extends TX{constructor(e,t,i,n,o=!1){super(e,t,o,i);const s=this._register(n.createScoped(this.inputBox.element));this._register(zX(s,this.inputBox))}};function KX(e){var t,i;return"Up"===(null===(t=e.lookupKeybinding("history.showPrevious"))||void 0===t?void 0:t.getElectronAccelerator())&&"Down"===(null===(i=e.lookupKeybinding("history.showNext"))||void 0===i?void 0:i.getElectronAccelerator())}UX=AX([RX(3,sd)],UX),_d.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:Bh.and(Bh.has(PX),Bh.equals(BX,!0),Bh.not("isComposing"),OX.isEqualTo(!1)),primary:16,secondary:[528],handler:e=>{null==WX||WX.showPreviousValue()}}),_d.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:Bh.and(Bh.has(PX),Bh.equals(FX,!0),Bh.not("isComposing"),OX.isEqualTo(!1)),primary:18,secondary:[530],handler:e=>{null==WX||WX.showNextValue()}});const jX=EA("find-selection",Sl.selection,me(0,"Icon for 'Find in Selection' in the editor find widget.")),qX=EA("find-collapsed",Sl.chevronRight,me(0,"Icon to indicate that the editor find widget is collapsed.")),$X=EA("find-expanded",Sl.chevronDown,me(0,"Icon to indicate that the editor find widget is expanded.")),GX=EA("find-replace",Sl.replace,me(0,"Icon for 'Replace' in the editor find widget.")),ZX=EA("find-replace-all",Sl.replaceAll,me(0,"Icon for 'Replace All' in the editor find widget.")),YX=EA("find-previous-match",Sl.arrowUp,me(0,"Icon for 'Find Previous' in the editor find widget.")),QX=EA("find-next-match",Sl.arrowDown,me(0,"Icon for 'Find Next' in the editor find widget.")),XX=me(0,"Find / Replace"),JX=me(0,"Find"),eJ=me(0,"Find"),tJ=me(0,"Previous Match"),iJ=me(0,"Next Match"),nJ=me(0,"Find in Selection"),oJ=me(0,"Close"),sJ=me(0,"Replace"),rJ=me(0,"Replace"),aJ=me(0,"Replace"),lJ=me(0,"Replace All"),hJ=me(0,"Toggle Replace"),dJ=me(0,"Only the first {0} results are highlighted, but all find operations work on the entire text.",wX),cJ=me(0,"{0} of {1}"),uJ=me(0,"No results"),gJ=419;let pJ=69;const mJ="ctrlEnterReplaceAll.windows.donotask",fJ=Ve?256:2048;class _J{constructor(e){this.afterLineNumber=e,this.heightInPx=33,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function vJ(e,t,i){const n=!!t.match(/\n/);i&&n&&i.selectionStart>0&&e.stopPropagation()}function bJ(e,t,i){const n=!!t.match(/\n/);i&&n&&i.selectionEnd<i.value.length&&e.stopPropagation()}class wJ extends hD{constructor(e,t,i,n,o,s,r,a,l){super(),this._cachedHeight=null,this._revealTimeouts=[],this._codeEditor=e,this._controller=t,this._state=i,this._contextViewProvider=n,this._keybindingService=o,this._contextKeyService=s,this._storageService=a,this._notificationService=l,this._ctrlEnterReplaceAllWarningPrompted=!!a.getBoolean(mJ,0),this._isVisible=!1,this._isReplaceVisible=!1,this._ignoreChangeEvent=!1,this._updateHistoryDelayer=new Ht(500),this._register(I((()=>this._updateHistoryDelayer.cancel()))),this._register(this._state.onFindReplaceStateChange((e=>this._onStateChanged(e)))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration((e=>{if(e.hasChanged(90)&&(this._codeEditor.getOption(90)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),e.hasChanged(143)&&this._tryUpdateWidgetWidth(),e.hasChanged(2)&&this.updateAccessibilitySupport(),e.hasChanged(41)){const e=this._codeEditor.getOption(41).loop;this._state.change({loop:e},!1);const t=this._codeEditor.getOption(41).addExtraSpaceOnTop;t&&!this._viewZone&&(this._viewZone=new _J(0),this._showViewZone()),!t&&this._viewZone&&this._removeViewZone()}}))),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection((()=>{this._isVisible&&this._updateToggleSelectionFindButton()}))),this._register(this._codeEditor.onDidFocusEditorWidget((async()=>{if(this._isVisible){const e=await this._controller.getGlobalBufferTerm();e&&e!==this._state.searchString&&(this._state.change({searchString:e},!1),this._findInput.select())}}))),this._findInputFocused=nX.bindTo(s),this._findFocusTracker=this._register(lr(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus((()=>{this._findInputFocused.set(!0),this._updateSearchScope()}))),this._register(this._findFocusTracker.onDidBlur((()=>{this._findInputFocused.set(!1)}))),this._replaceInputFocused=oX.bindTo(s),this._replaceFocusTracker=this._register(lr(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus((()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()}))),this._register(this._replaceFocusTracker.onDidBlur((()=>{this._replaceInputFocused.set(!1)}))),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(41).addExtraSpaceOnTop&&(this._viewZone=new _J(0)),this._register(this._codeEditor.onDidChangeModel((()=>{this._isVisible&&(this._viewZoneId=void 0)}))),this._register(this._codeEditor.onDidScrollChange((e=>{e.scrollTopChanged?this._layoutViewZone():setTimeout((()=>{this._layoutViewZone()}),0)})))}getId(){return wJ.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?this._codeEditor.getOption(90)||this._isReplaceVisible||(this._isReplaceVisible=!0,this._replaceInput.width=Rs(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){const e=this._state.searchString.length>0&&0===this._state.matchesCount;this._domNode.classList.toggle("no-results",e),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,h)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){let e;if(this._matchesCount.style.minWidth=pJ+"px",this._state.matchesCount>=wX?this._matchesCount.title=dJ:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild),this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=wX&&(t+="+");let i=String(this._state.matchesPosition);"0"===i&&(i="?"),e=ln(cJ,i,t)}else e=uJ;this._matchesCount.appendChild(document.createTextNode(e)),Zr(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),pJ=Math.max(pJ,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===uJ)return""===i?me(0,"{0} found",e):me(0,"{0} found for '{1}'",e,i);if(t){const n=me(0,"{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1?`${o.getLineContent(t.startLineNumber)}, ${n}`:n}return me(0,"{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=!!e&&(e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn),i=this._toggleSelectionFind.checked;this._isVisible&&(i||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);const e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);const i=!this._codeEditor.getOption(90);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach((e=>{clearTimeout(e)})),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(41).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const t=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=t;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout((()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")}),0)),this._revealTimeouts.push(setTimeout((()=>{this._findInput.validate()}),200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(41).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const n=As(i),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),s=n.left+(o?o.left:0),r=o?o.top:0;if(this._viewZone&&r<this._viewZone.heightInPx){e.endLineNumber>e.startLineNumber&&(t=!1);const i=Ts(this._domNode).left;s>i&&(t=!1);const o=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());n.left+(o?o.left:0)>i&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach((e=>{clearTimeout(e)})),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(41).addExtraSpaceOnTop)return void this._removeViewZone();if(!this._isVisible)return;const t=this._viewZone;void 0===this._viewZoneId&&t&&this._codeEditor.changeViewZones((i=>{t.heightInPx=this._getHeight(),this._viewZoneId=i.addZone(t),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+t.heightInPx)}))}_showViewZone(e=!0){if(!this._isVisible)return;if(!this._codeEditor.getOption(41).addExtraSpaceOnTop)return;void 0===this._viewZone&&(this._viewZone=new _J(0));const t=this._viewZone;this._codeEditor.changeViewZones((i=>{if(void 0!==this._viewZoneId){const n=this._getHeight();if(n===t.heightInPx)return;const o=n-t.heightInPx;return t.heightInPx=n,i.layoutZone(this._viewZoneId),void(e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o))}{let n=this._getHeight();if(n-=this._codeEditor.getOption(83).top,n<=0)return;t.heightInPx=n,this._viewZoneId=i.addZone(t),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+n)}}))}_removeViewZone(){this._codeEditor.changeViewZones((e=>{void 0!==this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))}))}_tryUpdateWidgetWidth(){if(!this._isVisible)return;if(!this._domNode.isConnected)return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0)return void this._domNode.classList.add("hiddenEditor");this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const t=e.width,i=e.minimap.minimapWidth;let n=!1,o=!1,s=!1;if(this._resized&&Rs(this._domNode)>gJ)return this._domNode.style.maxWidth=t-28-i-15+"px",void(this._replaceInput.width=Rs(this._findInput.domNode));if(447+i>=t&&(o=!0),447+i-pJ>=t&&(s=!0),447+i-pJ>=t+50&&(n=!0),this._domNode.classList.toggle("collapsed-find-widget",n),this._domNode.classList.toggle("narrow-find-widget",s),this._domNode.classList.toggle("reduced-find-widget",o),s||n||(this._domNode.style.maxWidth=t-28-i-15+"px"),this._findInput.layout({collapsedFindWidget:n,narrowFindWidget:s,reducedFindWidget:o}),this._resized){const e=this._findInput.inputBox.element.clientWidth;e>0&&(this._replaceInput.width=e)}else this._isReplaceVisible&&(this._replaceInput.width=Rs(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return(null===this._cachedHeight||this._cachedHeight!==e)&&(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const e=this._codeEditor.getSelections();e.map((e=>{1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(e.endLineNumber-1)));const t=this._state.currentMatch;return e.startLineNumber===e.endLineNumber||tc.equalsRange(e,t)?null:e})).filter((e=>!!e)),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){return e.equals(3|fJ)?(this._keybindingService.dispatchEvent(e,e.target)||this._findInput.inputBox.insertAtCursor("\n"),void e.preventDefault()):e.equals(2)?(this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):e.equals(16)?vJ(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea")):e.equals(18)?bJ(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea")):void 0}_onReplaceInputKeyDown(e){return e.equals(3|fJ)?(this._keybindingService.dispatchEvent(e,e.target)||(We&&He&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(me(0,"Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.")),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(mJ,!0,0,0)),this._replaceInput.inputBox.insertAtCursor("\n")),void e.preventDefault()):e.equals(2)?(this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(1026)?(this._findInput.focus(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):e.equals(16)?vJ(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea")):e.equals(18)?bJ(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea")):void 0}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new HX(null,this._contextViewProvider,{width:221,label:JX,placeholder:eJ,appendCaseSensitiveLabel:this._keybindingLabelFor(gX),appendWholeWordsLabel:this._keybindingLabelFor(pX),appendRegexLabel:this._keybindingLabelFor(mX),validation:e=>{if(0===e.length||!this._findInput.getRegex())return null;try{return new RegExp(e,"gu"),null}catch(e){return{content:e.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>KX(this._keybindingService),inputBoxStyles:QE,toggleStyles:YE},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown((e=>this._onFindInputKeyDown(e)))),this._register(this._findInput.inputBox.onDidChange((()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)}))),this._register(this._findInput.onDidOptionChange((()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)}))),this._register(this._findInput.onCaseSensitiveKeyDown((e=>{e.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),e.preventDefault())}))),this._register(this._findInput.onRegexKeyDown((e=>{e.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),e.preventDefault())}))),this._register(this._findInput.inputBox.onDidHeightChange((e=>{this._tryUpdateHeight()&&this._showViewZone()}))),ze&&this._register(this._findInput.onMouseDown((e=>this._onFindInputMouseDown(e)))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new CJ({label:tJ+this._keybindingLabelFor(cX),icon:YX,onTrigger:()=>{_l(this._codeEditor.getAction(cX)).run().then(void 0,h)}})),this._nextBtn=this._register(new CJ({label:iJ+this._keybindingLabelFor(dX),icon:QX,onTrigger:()=>{_l(this._codeEditor.getAction(dX)).run().then(void 0,h)}}));const e=document.createElement("div");e.className="find-part",e.appendChild(this._findInput.domNode);const t=document.createElement("div");t.className="find-actions",e.appendChild(t),t.appendChild(this._matchesCount),t.appendChild(this._prevBtn.domNode),t.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new Rz({icon:jX,title:nJ+this._keybindingLabelFor(fX),isChecked:!1,inputActiveOptionBackground:wm(Fm),inputActiveOptionBorder:wm(Pm),inputActiveOptionForeground:wm(Bm)})),this._register(this._toggleSelectionFind.onChange((()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){const e=this._codeEditor.getSelections();e.map((e=>(1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(e.endLineNumber-1))),e.isEmpty()?null:e))).filter((e=>!!e)),e.length&&this._state.change({searchScope:e},!0)}}else this._state.change({searchScope:null},!0)}))),t.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new CJ({label:oJ+this._keybindingLabelFor(uX),icon:AA,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:e=>{e.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),e.preventDefault())}})),this._replaceInput=this._register(new UX(null,void 0,{label:sJ,placeholder:rJ,appendPreserveCaseLabel:this._keybindingLabelFor(_X),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>KX(this._keybindingService),inputBoxStyles:QE,toggleStyles:YE},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown((e=>this._onReplaceInputKeyDown(e)))),this._register(this._replaceInput.inputBox.onDidChange((()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)}))),this._register(this._replaceInput.inputBox.onDidHeightChange((e=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()}))),this._register(this._replaceInput.onDidOptionChange((()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)}))),this._register(this._replaceInput.onPreserveCaseKeyDown((e=>{e.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),e.preventDefault())}))),this._replaceBtn=this._register(new CJ({label:aJ+this._keybindingLabelFor(vX),icon:GX,onTrigger:()=>{this._controller.replace()},onKeyDown:e=>{e.equals(1026)&&(this._closeBtn.focus(),e.preventDefault())}})),this._replaceAllBtn=this._register(new CJ({label:lJ+this._keybindingLabelFor(bX),icon:ZX,onTrigger:()=>{this._controller.replaceAll()}}));const i=document.createElement("div");i.className="replace-part",i.appendChild(this._replaceInput.domNode);const n=document.createElement("div");n.className="replace-actions",i.appendChild(n),n.appendChild(this._replaceBtn.domNode),n.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new CJ({label:hJ,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=Rs(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}})),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=XX,this._domNode.role="dialog",this._domNode.style.width="419px",this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(e),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(i),this._resizeSash=new EV(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let o=gJ;this._register(this._resizeSash.onDidStart((()=>{o=Rs(this._domNode)}))),this._register(this._resizeSash.onDidChange((e=>{this._resized=!0;const t=o+e.startX-e.currentX;t<gJ||t>(parseFloat(Es(this._domNode).maxWidth)||0)||(this._domNode.style.width=`${t}px`,this._isReplaceVisible&&(this._replaceInput.width=Rs(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())}))),this._register(this._resizeSash.onDidReset((()=>{const e=Rs(this._domNode);if(e<gJ)return;let t=gJ;if(!this._resized||e===gJ){const e=this._codeEditor.getLayoutInfo();t=e.width-28-e.minimap.minimapWidth-15,this._resized=!0}this._domNode.style.width=`${t}px`,this._isReplaceVisible&&(this._replaceInput.width=Rs(this._findInput.domNode)),this._findInput.inputBox.layout()})))}updateAccessibilitySupport(){const e=this._codeEditor.getOption(2);this._findInput.setFocusInputOnOptionClick(2!==e)}}wJ.ID="editor.contrib.findWidget";class CJ extends hD{constructor(e){super(),this._opts=e;let t="button";this._opts.className&&(t=t+" "+this._opts.className),this._opts.icon&&(t=t+" "+Ll.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.title=this._opts.label,this._domNode.tabIndex=0,this._domNode.className=t,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this.onclick(this._domNode,(e=>{this._opts.onTrigger(),e.preventDefault()})),this.onkeydown(this._domNode,(e=>{var t,i;if(e.equals(10)||e.equals(3))return this._opts.onTrigger(),void e.preventDefault();null===(i=(t=this._opts).onKeyDown)||void 0===i||i.call(t,e)}))}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...Ll.asClassNameArray(qX)),this._domNode.classList.add(...Ll.asClassNameArray($X))):(this._domNode.classList.remove(...Ll.asClassNameArray($X)),this._domNode.classList.add(...Ll.asClassNameArray(qX)))}}Fv(((e,t)=>{const i=(e,i)=>{i&&t.addRule(`.monaco-editor ${e} { background-color: ${i}; }`)};i(".findMatch",e.getColor(zf)),i(".currentFindMatch",e.getColor(Vf)),i(".findScope",e.getColor(Hf)),i(".find-widget",e.getColor(Sf));const n=e.getColor(Mm);n&&t.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${n}; }`);const o=e.getColor(Tm);o&&t.addRule(`.monaco-editor .find-widget { border-left: 1px solid ${o}; border-right: 1px solid ${o}; border-bottom: 1px solid ${o}; }`);const s=e.getColor(Kf);s&&t.addRule(`.monaco-editor .findMatch { border: 1px ${Iv(e.type)?"dotted":"solid"} ${s}; box-sizing: border-box; }`);const r=e.getColor(Uf);r&&t.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${r}; padding: 1px; box-sizing: border-box; }`);const a=e.getColor(jf);a&&t.addRule(`.monaco-editor .findScope { border: 1px ${Iv(e.type)?"dashed":"solid"} ${a}; }`);const l=e.getColor(Em);l&&t.addRule(`.monaco-editor .find-widget { border: 1px solid ${l}; }`);const h=e.getColor(kf);h&&t.addRule(`.monaco-editor .find-widget { color: ${h}; }`);const d=e.getColor(Lm);d&&t.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${d}; }`);const c=e.getColor(xf);if(c)t.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${c}; }`);else{const i=e.getColor(Lf);i&&t.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${i}; }`)}const u=e.getColor(G_);u&&t.addRule(`\n\t\t.monaco-editor .find-widget .button:not(.disabled):hover,\n\t\t.monaco-editor .find-widget .codicon-find-selection:hover {\n\t\t\tbackground-color: ${u} !important;\n\t\t}\n\t`);const g=e.getColor(Dm);g&&t.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${g}; }`)}));var yJ,SJ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},kJ=function(e,t){return function(i,n){t(i,n,e)}};function LJ(e,t="single",i=!1){if(!e.hasModel())return null;const n=e.getSelection();if("single"===t&&n.startLineNumber===n.endLineNumber||"multiple"===t)if(n.isEmpty()){const t=e.getConfiguredWordAtPosition(n.getStartPosition());if(t&&!1===i)return t.word}else if(e.getModel().getValueLengthInRange(n)<524288)return e.getModel().getValueInRange(n);return null}let xJ=yJ=class extends T{get editor(){return this._editor}static get(e){return e.getContribution(yJ.ID)}constructor(e,t,i,n,o){super(),this._editor=e,this._findWidgetVisible=iX.bindTo(t),this._contextKeyService=t,this._storageService=i,this._clipboardService=n,this._notificationService=o,this._updateHistoryDelayer=new Ht(500),this._state=this._register(new xX),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange((e=>this._onStateChanged(e)))),this._model=null,this._register(this._editor.onDidChangeModel((()=>{const e=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),e&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(41).loop})})))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!nX.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){const e=this._editor.getSelections();e.map((e=>(1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._editor.getModel().getLineMaxColumn(e.endLineNumber-1))),e.isEmpty()?null:e))).filter((e=>!!e)),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=dn(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}async _start(e,t){if(this.disposeModel(),!this._editor.hasModel())return;const i={...t,isRevealed:!0};if("single"===e.seedSearchStringFromSelection){const t=LJ(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);t&&(this._state.isRegex?i.searchString=dn(t):i.searchString=t)}else if("multiple"===e.seedSearchStringFromSelection&&!e.updateSearchScope){const t=LJ(this._editor,e.seedSearchStringFromSelection);t&&(i.searchString=t)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const e=await this.getGlobalBufferTerm();if(!this._editor.hasModel())return;e&&(i.searchString=e)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const e=this._editor.getSelections();e.some((e=>!e.isEmpty()))&&(i.searchScope=e)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new CX(this._editor,this._state))}start(e,t){return this._start(e,t)}moveToNextMatch(){return!!this._model&&(this._model.moveToNextMatch(),!0)}moveToPrevMatch(){return!!this._model&&(this._model.moveToPrevMatch(),!0)}goToMatch(e){return!!this._model&&(this._model.moveToMatch(e),!0)}replace(){return!!this._model&&(this._model.replace(),!0)}replaceAll(){var e;return!!this._model&&((null===(e=this._editor.getModel())||void 0===e?void 0:e.isTooLargeForHeapOperation())?(this._notificationService.warn(me(0,"The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0))}selectAllMatches(){return!!this._model&&(this._model.selectAllMatches(),this._editor.focus(),!0)}async getGlobalBufferTerm(){return this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""}setGlobalBufferTerm(e){this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};xJ.ID="editor.contrib.findController",xJ=yJ=SJ([kJ(1,sd),kJ(2,KN),kJ(3,ZS),kJ(4,hL)],xJ);let DJ=class extends xJ{constructor(e,t,i,n,o,s,r,a){super(e,i,r,a,s),this._contextViewService=t,this._keybindingService=n,this._themeService=o,this._widget=null,this._findOptionsWidget=null}async _start(e,t){this._widget||this._createFindWidget();const i=this._editor.getSelection();let n=!1;switch(this._editor.getOption(41).autoFindInSelection){case"always":n=!0;break;case"never":n=!1;break;case"multiline":n=!!i&&i.startLineNumber!==i.endLineNumber}e.updateSearchScope=e.updateSearchScope||n,await super._start(e,t),this._widget&&(2===e.shouldFocus?this._widget.focusReplaceInput():1===e.shouldFocus&&this._widget.focusFindInput())}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new wJ(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new kX(this._editor,this._state,this._keybindingService))}};DJ=SJ([kJ(1,jE),kJ(2,sd),kJ(3,ML),kJ(4,Tv),kJ(5,hL),kJ(6,KN),kJ(7,ZS)],DJ),$d(new Hd({id:"actions.find",label:me(0,"Find"),alias:"Find",precondition:Bh.or(nc.focus,Bh.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:yd.MenubarEditMenu,group:"3_find",title:me(0,"&&Find"),order:1}})).addImplementation(0,((e,t,i)=>{const n=xJ.get(t);return!!n&&n.start({forceRevealReplace:!1,seedSearchStringFromSelection:"never"!==t.getOption(41).seedSearchStringFromSelection?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(41).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:t.getOption(41).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop})}));const EJ={description:"Open a new In-Editor Find Widget.",args:[{name:"Open a new In-Editor Find Widget args",schema:{properties:{searchString:{type:"string"},replaceString:{type:"string"},regex:{type:"boolean"},regexOverride:{type:"number",description:me(0,'Overrides "Use Regular Expression" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},wholeWord:{type:"boolean"},wholeWordOverride:{type:"number",description:me(0,'Overrides "Match Whole Word" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},matchCase:{type:"boolean"},matchCaseOverride:{type:"number",description:me(0,'Overrides "Math Case" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},preserveCase:{type:"boolean"},preserveCaseOverride:{type:"number",description:me(0,'Overrides "Preserve Case" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},findInSelection:{type:"boolean"}}}}]};class NJ extends zd{async run(e,t){const i=xJ.get(t);i&&!this._run(i)&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:0===i.getState().searchString.length&&"never"!==t.getOption(41).seedSearchStringFromSelection?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(41).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(i))}}class IJ extends zd{async run(e,t){const i=xJ.get(t);if(!i)return;const n=LJ(t,"single",!1);n&&i.setSearchString(n),this._run(i)||(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(i))}}$d(new Hd({id:"editor.action.startFindReplaceAction",label:me(0,"Replace"),alias:"Replace",precondition:Bh.or(nc.focus,Bh.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:yd.MenubarEditMenu,group:"3_find",title:me(0,"&&Replace"),order:2}})).addImplementation(0,((e,t,i)=>{if(!t.hasModel()||t.getOption(90))return!1;const n=xJ.get(t);if(!n)return!1;const o=t.getSelection(),s=n.isFindInputFocused(),r=!o.isEmpty()&&o.startLineNumber===o.endLineNumber&&"never"!==t.getOption(41).seedSearchStringFromSelection&&!s,a=s||r?2:1;return n.start({forceRevealReplace:!0,seedSearchStringFromSelection:r?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(41).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:"never"!==t.getOption(41).seedSearchStringFromSelection,shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop})})),Gd(xJ.ID,DJ,0),qd(class extends zd{constructor(){super({id:"editor.actions.findWithArgs",label:me(0,"Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},metadata:EJ})}async run(e,t,i){const n=xJ.get(t);if(n){const e=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:void 0!==i.replaceString,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};await n.start({forceRevealReplace:!1,seedSearchStringFromSelection:0===n.getState().searchString.length&&"never"!==t.getOption(41).seedSearchStringFromSelection?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(41).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(null==i?void 0:i.findInSelection)||!1,loop:t.getOption(41).loop},e),n.setGlobalBufferTerm(n.getState().searchString)}}}),qd(class extends zd{constructor(){super({id:"actions.findWithSelection",label:me(0,"Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}async run(e,t){const i=xJ.get(t);i&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),i.setGlobalBufferTerm(i.getState().searchString))}}),qd(class extends NJ{constructor(){super({id:dX,label:me(0,"Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:nc.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:Bh.and(nc.focus,nX),primary:3,weight:100}]})}_run(e){return!!e.moveToNextMatch()&&(e.editor.pushUndoStop(),!0)}}),qd(class extends NJ{constructor(){super({id:cX,label:me(0,"Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:nc.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:Bh.and(nc.focus,nX),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}),qd(class extends zd{constructor(){super({id:"editor.action.goToMatchFindAction",label:me(0,"Go to Match..."),alias:"Go to Match...",precondition:iX}),this._highlightDecorations=[]}run(e,t,i){const n=xJ.get(t);if(!n)return;const o=n.getState().matchesCount;if(o<1)return void e.get(hL).notify({severity:lL.Warning,message:me(0,"No matches. Try searching for something else.")});const s=e.get(rI).createInputBox();s.placeholder=me(0,"Type a number to go to a specific match (between 1 and {0})",o);const r=e=>{const t=parseInt(e);if(isNaN(t))return;const i=n.getState().matchesCount;return t>0&&t<=i?t-1:t<0&&t>=-i?i+t:void 0},a=e=>{const i=r(e);if("number"==typeof i){s.validationMessage=void 0,n.goToMatch(i);const e=n.getState().currentMatch;e&&this.addDecorations(t,e)}else s.validationMessage=me(0,"Please type a number between 1 and {0}",n.getState().matchesCount),this.clearDecorations(t)};s.onDidChangeValue((e=>{a(e)})),s.onDidAccept((()=>{const e=r(s.value);"number"==typeof e?(n.goToMatch(e),s.hide()):s.validationMessage=me(0,"Please type a number between 1 and {0}",n.getState().matchesCount)})),s.onDidHide((()=>{this.clearDecorations(t),s.dispose()})),s.show()}clearDecorations(e){e.changeDecorations((e=>{this._highlightDecorations=e.deltaDecorations(this._highlightDecorations,[])}))}addDecorations(e,t){e.changeDecorations((e=>{this._highlightDecorations=e.deltaDecorations(this._highlightDecorations,[{range:t,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:Av(cb),position:vc.Full}}}])}))}}),qd(class extends IJ{constructor(){super({id:"editor.action.nextSelectionMatchFindAction",label:me(0,"Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:nc.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}),qd(class extends IJ{constructor(){super({id:"editor.action.previousSelectionMatchFindAction",label:me(0,"Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:nc.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}});const MJ=Vd.bindToContribution(xJ.get);jd(new MJ({id:uX,precondition:iX,handler:e=>e.closeFindWidget(),kbOpts:{weight:105,kbExpr:Bh.and(nc.focus,Bh.not("isComposing")),primary:9,secondary:[1033]}})),jd(new MJ({id:gX,precondition:void 0,handler:e=>e.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:nc.focus,primary:sX.primary,mac:sX.mac,win:sX.win,linux:sX.linux}})),jd(new MJ({id:pX,precondition:void 0,handler:e=>e.toggleWholeWords(),kbOpts:{weight:105,kbExpr:nc.focus,primary:rX.primary,mac:rX.mac,win:rX.win,linux:rX.linux}})),jd(new MJ({id:mX,precondition:void 0,handler:e=>e.toggleRegex(),kbOpts:{weight:105,kbExpr:nc.focus,primary:aX.primary,mac:aX.mac,win:aX.win,linux:aX.linux}})),jd(new MJ({id:fX,precondition:void 0,handler:e=>e.toggleSearchScope(),kbOpts:{weight:105,kbExpr:nc.focus,primary:lX.primary,mac:lX.mac,win:lX.win,linux:lX.linux}})),jd(new MJ({id:_X,precondition:void 0,handler:e=>e.togglePreserveCase(),kbOpts:{weight:105,kbExpr:nc.focus,primary:hX.primary,mac:hX.mac,win:hX.win,linux:hX.linux}})),jd(new MJ({id:vX,precondition:iX,handler:e=>e.replace(),kbOpts:{weight:105,kbExpr:nc.focus,primary:3094}})),jd(new MJ({id:vX,precondition:iX,handler:e=>e.replace(),kbOpts:{weight:105,kbExpr:Bh.and(nc.focus,oX),primary:3}})),jd(new MJ({id:bX,precondition:iX,handler:e=>e.replaceAll(),kbOpts:{weight:105,kbExpr:nc.focus,primary:2563}})),jd(new MJ({id:bX,precondition:iX,handler:e=>e.replaceAll(),kbOpts:{weight:105,kbExpr:Bh.and(nc.focus,oX),primary:void 0,mac:{primary:2051}}})),jd(new MJ({id:"editor.action.selectAllMatches",precondition:iX,handler:e=>e.selectAllMatches(),kbOpts:{weight:105,kbExpr:nc.focus,primary:515}}));var TJ=i(3388),AJ={};AJ.styleTagTransform=Vr(),AJ.setAttributes=Pr(),AJ.insert=Rr().bind(null,"head"),AJ.domAPI=Tr(),AJ.insertStyleElement=Br(),Ir()(TJ.Z,AJ),TJ.Z&&TJ.Z.locals&&TJ.Z.locals;const RJ={0:" ",1:"u",2:"r"},OJ=16777215,PJ=4278190080;class FJ{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return 0!=(this._states[t]&1<<i)}set(e,t){const i=e/32|0,n=e%32,o=this._states[i];this._states[i]=t?o|1<<n:o&~(1<<n)}}class BJ{constructor(e,t,i){if(e.length!==t.length||e.length>65535)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new FJ(e.length),this._userDefinedStates=new FJ(e.length),this._recoveredStates=new FJ(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(t,i)=>{const n=e[e.length-1];return this.getStartLineNumber(n)<=t&&this.getEndLineNumber(n)>=i};for(let i=0,n=this._startIndexes.length;i<n;i++){const n=this._startIndexes[i],o=this._endIndexes[i];if(n>OJ||o>OJ)throw new Error("startLineNumber or endLineNumber must not exceed "+OJ);for(;e.length>0&&!t(n,o);)e.pop();const s=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=n+((255&s)<<24),this._endIndexes[i]=o+((65280&s)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&OJ}getEndLineNumber(e){return this._endIndexes[e]&OJ}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,t){1===t?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):2===t?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let n=0;n<this._types.length;n++)this._types[n]===e&&(this.setCollapsed(n,t),i=!0);return i}toRegion(e){return new WJ(this,e)}getParentIndex(e){this.ensureParentIndices();const t=((this._startIndexes[e]&PJ)>>>24)+((this._endIndexes[e]&PJ)>>>16);return 65535===t?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(0===i)return-1;for(;t<i;){const n=Math.floor((t+i)/2);e<this.getStartLineNumber(n)?i=n:t=n+1}return t-1}findRange(e){let t=this.findIndex(e);if(t>=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);-1!==t;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;t<this.length;t++)e[t]=`[${RJ[this.getSource(t)]}${this.isCollapsed(t)?"+":"-"}] ${this.getStartLineNumber(t)}/${this.getEndLineNumber(t)}`;return e.join(", ")}toFoldRange(e){return{startLineNumber:this._startIndexes[e]&OJ,endLineNumber:this._endIndexes[e]&OJ,type:this._types?this._types[e]:void 0,isCollapsed:this.isCollapsed(e),source:this.getSource(e)}}static fromFoldRanges(e){const t=e.length,i=new Uint32Array(t),n=new Uint32Array(t);let o=[],s=!1;for(let r=0;r<t;r++){const t=e[r];i[r]=t.startLineNumber,n[r]=t.endLineNumber,o.push(t.type),t.type&&(s=!0)}s||(o=void 0);const r=new BJ(i,n,o);for(let i=0;i<t;i++)e[i].isCollapsed&&r.setCollapsed(i,!0),r.setSource(i,e[i].source);return r}static sanitizeAndMerge(e,t,i){i=null!=i?i:Number.MAX_VALUE;const n=(e,t)=>Array.isArray(e)?i=>i<t?e[i]:void 0:i=>i<t?e.toFoldRange(i):void 0,o=n(e,e.length),s=n(t,t.length);let r=0,a=0,l=o(0),h=s(0);const d=[];let c,u=0;const g=[];for(;l||h;){let e;if(h&&(!l||l.startLineNumber>=h.startLineNumber))l&&l.startLineNumber===h.startLineNumber?(1===h.source?e=h:(e=l,e.isCollapsed=h.isCollapsed&&l.endLineNumber===h.endLineNumber,e.source=0),l=o(++r)):(e=h,h.isCollapsed&&0===h.source&&(e.source=2)),h=s(++a);else{let t=a,i=h;for(;;){if(!i||i.startLineNumber>l.endLineNumber){e=l;break}if(1===i.source&&i.endLineNumber>l.endLineNumber)break;i=s(++t)}l=o(++r)}if(e){for(;c&&c.endLineNumber<e.startLineNumber;)c=d.pop();e.endLineNumber>e.startLineNumber&&e.startLineNumber>u&&e.endLineNumber<=i&&(!c||c.endLineNumber>=e.endLineNumber)&&(g.push(e),u=e.startLineNumber,c&&d.push(c),c=e)}}return g}}class WJ{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class VJ{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new q,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new BJ(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort(((e,t)=>e.regionIndex-t.regionIndex));const t={};this._decorationProvider.changeDecorations((i=>{let n=0,o=-1,s=-1;const r=e=>{for(;n<e;){const e=this._regions.getEndLineNumber(n),t=this._regions.isCollapsed(n);if(e<=o){const o=0!==this.regions.getSource(n);i.changeDecorationOptions(this._editorDecorationIds[n],this._decorationProvider.getDecorationOption(t,e<=s,o))}t&&e>s&&(s=e),n++}};for(const i of e){const e=i.regionIndex,n=this._editorDecorationIds[e];if(n&&!t[n]){t[n]=!0,r(e);const i=!this._regions.isCollapsed(e);this._regions.setCollapsed(e,i),o=Math.max(o,this._regions.getEndLineNumber(e))}}r(this._regions.length)})),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=t=>{for(const i of e)if(!(i.startLineNumber>t.endLineNumber||t.startLineNumber>i.endLineNumber))return!0;return!1};for(let e=0;e<this._regions.length;e++){const n=this._regions.toFoldRange(e);0!==n.source&&i(n)||t.push(n)}this.updatePost(BJ.fromFoldRanges(t))}update(e,t=[]){const i=this._currentFoldedOrManualRanges(t),n=BJ.sanitizeAndMerge(e,i,this._textModel.getLineCount());this.updatePost(BJ.fromFoldRanges(n))}updatePost(e){const t=[];let i=-1;for(let n=0,o=e.length;n<o;n++){const o=e.getStartLineNumber(n),s=e.getEndLineNumber(n),r=e.isCollapsed(n),a=0!==e.getSource(n),l={startLineNumber:o,startColumn:this._textModel.getLineMaxColumn(o),endLineNumber:s,endColumn:this._textModel.getLineMaxColumn(s)+1};t.push({range:l,options:this._decorationProvider.getDecorationOption(r,s<=i,a)}),r&&s>i&&(i=s)}this._decorationProvider.changeDecorations((e=>this._editorDecorationIds=e.deltaDecorations(this._editorDecorationIds,t))),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(t,i)=>{for(const n of e)if(t<n&&n<=i)return!0;return!1},i=[];for(let e=0,n=this._regions.length;e<n;e++){let n=this.regions.isCollapsed(e);const o=this.regions.getSource(e);if(n||0!==o){const s=this._regions.toFoldRange(e),r=this._textModel.getDecorationRange(this._editorDecorationIds[e]);r&&(n&&t(r.startLineNumber,r.endLineNumber)&&(n=!1),i.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,type:s.type,isCollapsed:n,source:o}))}}return i}getMemento(){const e=this._currentFoldedOrManualRanges(),t=[],i=this._textModel.getLineCount();for(let n=0,o=e.length;n<o;n++){const o=e[n];if(o.startLineNumber>=o.endLineNumber||o.startLineNumber<1||o.endLineNumber>i)continue;const s=this._getLinesChecksum(o.startLineNumber+1,o.endLineNumber);t.push({startLineNumber:o.startLineNumber,endLineNumber:o.endLineNumber,isCollapsed:o.isCollapsed,source:o.source,checksum:s})}return t.length>0?t:void 0}applyMemento(e){var t,i;if(!Array.isArray(e))return;const n=[],o=this._textModel.getLineCount();for(const s of e){if(s.startLineNumber>=s.endLineNumber||s.startLineNumber<1||s.endLineNumber>o)continue;const e=this._getLinesChecksum(s.startLineNumber+1,s.endLineNumber);s.checksum&&e!==s.checksum||n.push({startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,type:void 0,isCollapsed:null===(t=s.isCollapsed)||void 0===t||t,source:null!==(i=s.source)&&void 0!==i?i:0})}const s=BJ.sanitizeAndMerge(this._regions,n,o);this.updatePost(BJ.fromFoldRanges(s))}_getLinesChecksum(e,t){return Xo(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let n=this._regions.findRange(e),o=1;for(;n>=0;){const e=this._regions.toRegion(n);t&&!t(e,o)||i.push(e),o++,n=e.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],n=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&2===t.length){const e=[];for(let s=n,r=this._regions.length;s<r;s++){const n=this._regions.toRegion(s);if(!(this._regions.getStartLineNumber(s)<o))break;for(;e.length>0&&!n.containedBy(e[e.length-1]);)e.pop();e.push(n),t(n,e.length)&&i.push(n)}}else for(let e=n,s=this._regions.length;e<s;e++){const n=this._regions.toRegion(e);if(!(this._regions.getStartLineNumber(e)<o))break;t&&!t(n)||i.push(n)}return i}}function zJ(e,t,i){const n=[];for(const o of i){const i=e.getRegionAtLine(o);if(i){const o=!i.isCollapsed;if(n.push(i),t>1){const s=e.getRegionsInside(i,((e,i)=>e.isCollapsed!==o&&i<t));n.push(...s)}}}e.toggleCollapseState(n)}function HJ(e,t,i=Number.MAX_VALUE,n){const o=[];if(n&&n.length>0)for(const s of n){const n=e.getRegionAtLine(s);if(n&&(n.isCollapsed!==t&&o.push(n),i>1)){const s=e.getRegionsInside(n,((e,n)=>e.isCollapsed!==t&&n<i));o.push(...s)}}else{const n=e.getRegionsInside(null,((e,n)=>e.isCollapsed!==t&&n<i));o.push(...n)}e.toggleCollapseState(o)}function UJ(e,t,i,n){const o=[];for(const s of n){const n=e.getAllRegionsAtLine(s,((e,n)=>e.isCollapsed!==t&&n<=i));o.push(...n)}e.toggleCollapseState(o)}function KJ(e,t,i){const n=[];for(const t of i){const i=e.getAllRegionsAtLine(t,void 0);i.length>0&&n.push(i[0])}const o=e.getRegionsInside(null,(e=>n.every((t=>!t.containedBy(e)&&!e.containedBy(t)))&&e.isCollapsed!==t));e.toggleCollapseState(o)}function jJ(e,t,i){const n=e.textModel,o=e.regions,s=[];for(let e=o.length-1;e>=0;e--)if(i!==o.isCollapsed(e)){const i=o.getStartLineNumber(e);t.test(n.getLineContent(i))&&s.push(o.toRegion(e))}e.toggleCollapseState(s)}function qJ(e,t,i){const n=e.regions,o=[];for(let e=n.length-1;e>=0;e--)i!==n.isCollapsed(e)&&t===n.getType(e)&&o.push(n.toRegion(e));e.toggleCollapseState(o)}class $J{get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}constructor(e){this._updateEventEmitter=new q,this._hasLineChanges=!1,this._foldingModel=e,this._foldingModelListener=e.onDidChange((e=>this.updateHiddenRanges())),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some((e=>e.range.endLineNumber!==e.range.startLineNumber||0!==au(e.text)[0])))}updateHiddenRanges(){let e=!1;const t=[];let i=0,n=0,o=Number.MAX_VALUE,s=-1;const r=this._foldingModel.regions;for(;i<r.length;i++){if(!r.isCollapsed(i))continue;const a=r.getStartLineNumber(i)+1,l=r.getEndLineNumber(i);o<=a&&l<=s||(!e&&n<this._hiddenRanges.length&&this._hiddenRanges[n].startLineNumber===a&&this._hiddenRanges[n].endLineNumber===l?(t.push(this._hiddenRanges[n]),n++):(e=!0,t.push(new tc(a,1,l,1))),o=a,s=l)}(this._hasLineChanges||e||n<this._hiddenRanges.length)&&this.applyHiddenRanges(t)}applyHiddenRanges(e){this._hiddenRanges=e,this._hasLineChanges=!1,this._updateEventEmitter.fire(e)}hasRanges(){return this._hiddenRanges.length>0}isHidden(e){return null!==GJ(this._hiddenRanges,e)}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let n=null;const o=e=>(n&&function(e,t){return e>=t.startLineNumber&&e<=t.endLineNumber}(e,n)||(n=GJ(this._hiddenRanges,e)),n?n.startLineNumber-1:null);for(let n=0,s=e.length;n<s;n++){let s=e[n];const r=o(s.startLineNumber);r&&(s=s.setStartPosition(r,i.getLineMaxColumn(r)),t=!0);const a=o(s.endLineNumber);a&&(s=s.setEndPosition(a,i.getLineMaxColumn(a)),t=!0),e[n]=s}return t}dispose(){this.hiddenRanges.length>0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function GJ(e,t){const i=mu(e,(e=>t<e.startLineNumber))-1;return i>=0&&e[i].endLineNumber>=t?e[i]:null}class ZJ{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id="indent"}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,n=t&&t.markers;return Promise.resolve(function(e,t,i,n=QJ){const o=e.getOptions().tabSize,s=new YJ(n);let r;i&&(r=new RegExp(`(${i.start.source})|(?:${i.end.source})`));const a=[],l=e.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let i=e.getLineCount();i>0;i--){const n=e.getLineContent(i),l=$b(n,o);let h,d=a[a.length-1];if(-1!==l){if(r&&(h=n.match(r))){if(!h[1]){a.push({indent:-2,endAbove:i,line:i});continue}{let e=a.length-1;for(;e>0&&-2!==a[e].indent;)e--;if(e>0){a.length=e+1,d=a[e],s.insertFirst(i,d.line,l),d.line=i,d.indent=l,d.endAbove=i;continue}}}if(d.indent>l){do{a.pop(),d=a[a.length-1]}while(d.indent>l);const e=d.endAbove-1;e-i>=1&&s.insertFirst(i,e,l)}d.indent===l?d.endAbove=i:a.push({indent:l,endAbove:i,line:i})}else t&&(d.endAbove=i)}return s.toIndentRanges(e)}(this.editorModel,i,n,this.foldingRangesLimit))}}class YJ{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>OJ||t>OJ)return;const n=this._length;this._startIndexes[n]=e,this._endIndexes[n]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const e=new Uint32Array(this._length),t=new Uint32Array(this._length);for(let i=this._length-1,n=0;i>=0;i--,n++)e[n]=this._startIndexes[i],t[n]=this._endIndexes[i];return new BJ(e,t)}{this._foldingRangesLimit.update(this._length,t);let i=0,n=this._indentOccurrences.length;for(let e=0;e<this._indentOccurrences.length;e++){const o=this._indentOccurrences[e];if(o){if(o+i>t){n=e;break}i+=o}}const o=e.getOptions().tabSize,s=new Uint32Array(t),r=new Uint32Array(t);for(let a=this._length-1,l=0;a>=0;a--){const h=this._startIndexes[a],d=$b(e.getLineContent(h),o);(d<n||d===n&&i++<t)&&(s[l]=h,r[l]=this._endIndexes[a],l++)}return new BJ(s,r)}}}const QJ={limit:5e3,update:()=>{}},XJ=Sm("editor.foldBackground",{light:yv(Pf,.3),dark:yv(Pf,.3),hcDark:null,hcLight:null},me(0,"Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);Sm("editorGutter.foldingControlForeground",{dark:xm,light:xm,hcDark:xm,hcLight:xm},me(0,"Color of the folding control in the editor gutter."));const JJ=EA("folding-expanded",Sl.chevronDown,me(0,"Icon for expanded ranges in the editor glyph margin.")),e0=EA("folding-collapsed",Sl.chevronRight,me(0,"Icon for collapsed ranges in the editor glyph margin.")),t0=EA("folding-manual-collapsed",e0,me(0,"Icon for manually collapsed ranges in the editor glyph margin.")),i0=EA("folding-manual-expanded",JJ,me(0,"Icon for manually expanded ranges in the editor glyph margin.")),n0={color:Av(XJ),position:wc.Inline};class o0{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?o0.HIDDEN_RANGE_DECORATION:"never"===this.showFoldingControls?e?this.showFoldingHighlights?o0.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:o0.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:o0.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?o0.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:o0.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?o0.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:o0.COLLAPSED_VISUAL_DECORATION:"mouseover"===this.showFoldingControls?i?o0.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:o0.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?o0.MANUALLY_EXPANDED_VISUAL_DECORATION:o0.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}o0.COLLAPSED_VISUAL_DECORATION=Sy.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Ll.asClassName(e0)}),o0.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Sy.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:n0,isWholeLine:!0,firstLineDecorationClassName:Ll.asClassName(e0)}),o0.MANUALLY_COLLAPSED_VISUAL_DECORATION=Sy.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Ll.asClassName(t0)}),o0.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Sy.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:n0,isWholeLine:!0,firstLineDecorationClassName:Ll.asClassName(t0)}),o0.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Sy.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0}),o0.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Sy.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:n0,isWholeLine:!0}),o0.EXPANDED_VISUAL_DECORATION=Sy.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Ll.asClassName(JJ)}),o0.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Sy.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Ll.asClassName(JJ)}),o0.MANUALLY_EXPANDED_VISUAL_DECORATION=Sy.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Ll.asClassName(i0)}),o0.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Sy.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Ll.asClassName(i0)}),o0.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Sy.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0}),o0.HIDDEN_RANGE_DECORATION=Sy.register({description:"folding-hidden-range-decoration",stickiness:1});const s0={};class r0{constructor(e,t,i,n,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=n,this.fallbackRangeProvider=o,this.id="syntax",this.disposables=new M,o&&this.disposables.add(o);for(const e of t)"function"==typeof e.onDidChange&&this.disposables.add(e.onDidChange(i))}compute(e){return function(e,t,i){let n=null;const o=e.map(((e,o)=>Promise.resolve(e.provideFoldingRanges(t,s0,i)).then((e=>{if(!i.isCancellationRequested&&Array.isArray(e)){Array.isArray(n)||(n=[]);const i=t.getLineCount();for(const t of e)t.start>0&&t.end>t.start&&t.end<=i&&n.push({start:t.start,end:t.end,rank:o,kind:t.kind})}}),d)));return Promise.all(o).then((e=>n))}(this.providers,this.editorModel,e).then((t=>{var i,n;return t?function(e,t){const i=e.sort(((e,t)=>{let i=e.start-t.start;return 0===i&&(i=e.rank-t.rank),i})),n=new a0(t);let o;const s=[];for(const e of i)if(o){if(e.start>o.start)if(e.end<=o.end)s.push(o),o=e,n.add(e.start,e.end,e.kind&&e.kind.value,s.length);else{if(e.start>o.end){do{o=s.pop()}while(o&&e.start>o.end);o&&s.push(o),o=e}n.add(e.start,e.end,e.kind&&e.kind.value,s.length)}}else o=e,n.add(e.start,e.end,e.kind&&e.kind.value,s.length);return n.toIndentRanges()}(t,this.foldingRangesLimit):null!==(n=null===(i=this.fallbackRangeProvider)||void 0===i?void 0:i.compute(e))&&void 0!==n?n:null}))}dispose(){this.disposables.dispose()}}class a0{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,n){if(e>OJ||t>OJ)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=n,this._types[o]=i,this._length++,n<30&&(this._nestingLevelCounts[n]=(this._nestingLevelCounts[n]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const e=new Uint32Array(this._length),t=new Uint32Array(this._length);for(let i=0;i<this._length;i++)e[i]=this._startIndexes[i],t[i]=this._endIndexes[i];return new BJ(e,t,this._types)}{this._foldingRangesLimit.update(this._length,e);let t=0,i=this._nestingLevelCounts.length;for(let n=0;n<this._nestingLevelCounts.length;n++){const o=this._nestingLevelCounts[n];if(o){if(o+t>e){i=n;break}t+=o}}const n=new Uint32Array(e),o=new Uint32Array(e),s=[];for(let r=0,a=0;r<this._length;r++){const l=this._nestingLevels[r];(l<i||l===i&&t++<e)&&(n[a]=this._startIndexes[r],o[a]=this._endIndexes[r],s[a]=this._types[r],a++)}return new BJ(n,o,s)}}}var l0,h0=function(e,t){return function(i,n){t(i,n,e)}};const d0=new od("foldingEnabled",!1);let c0=l0=class extends T{static get(e){return e.getContribution(l0.ID)}static getFoldingRangeProviders(e,t){var i,n;const o=e.foldingRangeProvider.ordered(t);return null!==(n=null===(i=l0._foldingRangeSelector)||void 0===i?void 0:i.call(l0,o,t))&&void 0!==n?n:o}constructor(e,t,i,n,o,s){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=s,this.localToDispose=this._register(new M),this.editor=e,this._foldingLimitReporter=new u0(e);const r=this.editor.getOptions();this._isEnabled=r.get(43),this._useFoldingProviders="indentation"!==r.get(44),this._unfoldOnClickAfterEndOfLine=r.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=r.get(46),this.updateDebounceInfo=o.for(s.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new o0(e),this.foldingDecorationProvider.showFoldingControls=r.get(109),this.foldingDecorationProvider.showFoldingHighlights=r.get(45),this.foldingEnabled=d0.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel((()=>this.onModelChanged()))),this._register(this.editor.onDidChangeConfiguration((e=>{if(e.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),e.hasChanged(47)&&this.onModelChanged(),e.hasChanged(109)||e.hasChanged(45)){const e=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=e.get(109),this.foldingDecorationProvider.showFoldingHighlights=e.get(45),this.triggerFoldingModelChanged()}e.hasChanged(44)&&(this._useFoldingProviders="indentation"!==this.editor.getOptions().get(44),this.onFoldingStrategyChanged()),e.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),e.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))}))),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(t&&this._isEnabled&&!t.isTooLargeForTokenization()&&this.hiddenRangeModel&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();this._isEnabled&&e&&!e.isTooLargeForTokenization()&&(this._currentModelHasFoldedImports=!1,this.foldingModel=new VJ(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new $J(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange((e=>this.onHiddenRangesChanges(e)))),this.updateScheduler=new Ht(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new Zt((()=>this.revealCursor()),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange((()=>this.onFoldingStrategyChanged()))),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration((()=>this.onFoldingStrategyChanged()))),this.localToDispose.add(this.editor.onDidChangeModelContent((e=>this.onDidChangeModelContent(e)))),this.localToDispose.add(this.editor.onDidChangeCursorPosition((()=>this.onCursorPositionChanged()))),this.localToDispose.add(this.editor.onMouseDown((e=>this.onEditorMouseDown(e)))),this.localToDispose.add(this.editor.onMouseUp((e=>this.onEditorMouseUp(e)))),this.localToDispose.add({dispose:()=>{var e,t;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),null===(e=this.updateScheduler)||void 0===e||e.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,null===(t=this.rangeProvider)||void 0===t||t.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;null===(e=this.rangeProvider)||void 0===e||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new ZJ(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=l0.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new r0(e,i,(()=>this.triggerFoldingModelChanged()),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;null===(t=this.hiddenRangeModel)||void 0===t||t.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger((()=>{const e=this.foldingModel;if(!e)return null;const t=new V,i=this.getRangeProvider(e.textModel),n=this.foldingRegionPromise=Wt((e=>i.compute(e)));return n.then((i=>{if(i&&n===this.foldingRegionPromise){let n;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const e=i.setCollapsedAllOfType(CC.Imports.value,!0);e&&(n=PN.capture(this.editor),this._currentModelHasFoldedImports=e)}const o=this.editor.getSelections(),s=o?o.map((e=>e.startLineNumber)):[];e.update(i,s),null==n||n.restore(this.editor);const r=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=r)}return e}))})).then(void 0,(e=>(h(e),null))))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const e=this.editor.getSelections();e&&this.hiddenRangeModel.adjustSelections(e)&&this.editor.setSelections(e)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then((e=>{if(e){const t=this.editor.getSelections();if(t&&t.length>0){const i=[];for(const n of t){const t=n.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(t)&&i.push(...e.getAllRegionsAtLine(t,(e=>e.isCollapsed&&t>e.startLineNumber)))}i.length&&(e.toggleCollapseState(i),this.reveal(t[0].getPosition()))}}})).then(void 0,h)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range)return;if(!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const t=e.target.detail,n=e.target.element.offsetLeft;if(t.offsetX-n<4)return;i=!0;break}case 7:if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return;case 6:if(this.hiddenRangeModel.hasRanges()){const e=this.editor.getModel();if(e&&t.startColumn===e.getLineMaxColumn(t.startLineNumber))break}return;default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,n=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(n){if(4!==e.target.type)return}else{const e=this.editor.getModel();if(!e||o.startColumn!==e.getLineMaxColumn(i))return}const s=t.getRegionAtLine(i);if(s&&s.startLineNumber===i){const o=s.isCollapsed;if(n||o){let n=[];if(e.event.altKey){const e=e=>!e.containedBy(s)&&!s.containedBy(e),i=t.getRegionsInside(null,e);for(const e of i)e.isCollapsed&&n.push(e);0===n.length&&(n=i)}else{const i=e.event.middleButton||e.event.shiftKey;if(i)for(const e of t.getRegionsInside(s))e.isCollapsed===o&&n.push(e);!o&&i&&0!==n.length||n.push(s)}t.toggleCollapseState(n),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};c0.ID="editor.contrib.folding",c0=l0=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([h0(1,sd),h0(2,Yg),h0(3,hL),h0(4,hI),h0(5,Jk)],c0);class u0{constructor(e){this.editor=e,this._onDidChange=new q,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,t){e===this._computed&&t===this._limited||(this._computed=e,this._limited=t,this._onDidChange.fire())}}class g0 extends zd{runEditorCommand(e,t,i){const n=e.get(Yg),o=c0.get(t);if(!o)return;const s=o.getFoldingModel();return s?(this.reportTelemetry(e,t),s.then((e=>{if(e){this.invoke(o,e,t,i,n);const s=t.getSelection();s&&o.reveal(s.getStartPosition())}}))):void 0}getSelectedLines(e){const t=e.getSelections();return t?t.map((e=>e.startLineNumber)):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map((e=>e+1)):this.getSelectedLines(t)}run(e,t){}}function p0(e){if(!gl(e)){if(!ll(e))return!1;const t=e;if(!gl(t.levels)&&!dl(t.levels))return!1;if(!gl(t.direction)&&!al(t.direction))return!1;if(!(gl(t.selectionLines)||Array.isArray(t.selectionLines)&&t.selectionLines.every(dl)))return!1}return!0}class m0 extends g0{getFoldingLevel(){return parseInt(this.id.substr(m0.ID_PREFIX.length))}invoke(e,t,i){!function(e,t,i,n){const o=e.getRegionsInside(null,((e,i)=>i===t&&true!==e.isCollapsed&&!n.some((t=>e.containsLine(t)))));e.toggleCollapseState(o)}(t,this.getFoldingLevel(),0,this.getSelectedLines(i))}}m0.ID_PREFIX="editor.foldLevel",m0.ID=e=>m0.ID_PREFIX+e,Gd(c0.ID,c0,0),qd(class extends g0{constructor(){super({id:"editor.unfold",label:me(0,"Unfold"),alias:"Unfold",precondition:d0,kbOpts:{kbExpr:nc.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},metadata:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t\t* 'levels': Number of levels to unfold. If not set, defaults to 1.\n\t\t\t\t\t\t* 'direction': If 'up', unfold given number of levels up otherwise unfolds down.\n\t\t\t\t\t\t* 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used.\n\t\t\t\t\t\t",constraint:p0,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const o=n&&n.levels||1,s=this.getLineNumbers(n,i);n&&"up"===n.direction?UJ(t,!1,o,s):HJ(t,!1,o,s)}}),qd(class extends g0{constructor(){super({id:"editor.unfoldRecursively",label:me(0,"Unfold Recursively"),alias:"Unfold Recursively",precondition:d0,kbOpts:{kbExpr:nc.editorTextFocus,primary:vt(2089,2142),weight:100}})}invoke(e,t,i,n){HJ(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}),qd(class extends g0{constructor(){super({id:"editor.fold",label:me(0,"Fold"),alias:"Fold",precondition:d0,kbOpts:{kbExpr:nc.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},metadata:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t\t\t* 'levels': Number of levels to fold.\n\t\t\t\t\t\t\t* 'direction': If 'up', folds given number of levels up otherwise folds down.\n\t\t\t\t\t\t\t* 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used.\n\t\t\t\t\t\t\tIf no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead.\n\t\t\t\t\t\t",constraint:p0,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const o=this.getLineNumbers(n,i),s=n&&n.levels,r=n&&n.direction;"number"!=typeof s&&"string"!=typeof r?function(e,t,i){const n=[];for(const t of i){const i=e.getAllRegionsAtLine(t,(e=>true!==e.isCollapsed));i.length>0&&n.push(i[0])}e.toggleCollapseState(n)}(t,0,o):"up"===r?UJ(t,!0,s||1,o):HJ(t,!0,s||1,o)}}),qd(class extends g0{constructor(){super({id:"editor.foldRecursively",label:me(0,"Fold Recursively"),alias:"Fold Recursively",precondition:d0,kbOpts:{kbExpr:nc.editorTextFocus,primary:vt(2089,2140),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);HJ(t,!0,Number.MAX_VALUE,n)}}),qd(class extends g0{constructor(){super({id:"editor.foldAll",label:me(0,"Fold All"),alias:"Fold All",precondition:d0,kbOpts:{kbExpr:nc.editorTextFocus,primary:vt(2089,2069),weight:100}})}invoke(e,t,i){HJ(t,!0)}}),qd(class extends g0{constructor(){super({id:"editor.unfoldAll",label:me(0,"Unfold All"),alias:"Unfold All",precondition:d0,kbOpts:{kbExpr:nc.editorTextFocus,primary:vt(2089,2088),weight:100}})}invoke(e,t,i){HJ(t,!1)}}),qd(class extends g0{constructor(){super({id:"editor.foldAllBlockComments",label:me(0,"Fold All Block Comments"),alias:"Fold All Block Comments",precondition:d0,kbOpts:{kbExpr:nc.editorTextFocus,primary:vt(2089,2138),weight:100}})}invoke(e,t,i,n,o){if(t.regions.hasTypes())qJ(t,CC.Comment.value,!0);else{const e=i.getModel();if(!e)return;const n=o.getLanguageConfiguration(e.getLanguageId()).comments;n&&n.blockCommentStartToken&&jJ(t,new RegExp("^\\s*"+dn(n.blockCommentStartToken)),!0)}}}),qd(class extends g0{constructor(){super({id:"editor.foldAllMarkerRegions",label:me(0,"Fold All Regions"),alias:"Fold All Regions",precondition:d0,kbOpts:{kbExpr:nc.editorTextFocus,primary:vt(2089,2077),weight:100}})}invoke(e,t,i,n,o){if(t.regions.hasTypes())qJ(t,CC.Region.value,!0);else{const e=i.getModel();if(!e)return;const n=o.getLanguageConfiguration(e.getLanguageId()).foldingRules;n&&n.markers&&n.markers.start&&jJ(t,new RegExp(n.markers.start),!0)}}}),qd(class extends g0{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:me(0,"Unfold All Regions"),alias:"Unfold All Regions",precondition:d0,kbOpts:{kbExpr:nc.editorTextFocus,primary:vt(2089,2078),weight:100}})}invoke(e,t,i,n,o){if(t.regions.hasTypes())qJ(t,CC.Region.value,!1);else{const e=i.getModel();if(!e)return;const n=o.getLanguageConfiguration(e.getLanguageId()).foldingRules;n&&n.markers&&n.markers.start&&jJ(t,new RegExp(n.markers.start),!1)}}}),qd(class extends g0{constructor(){super({id:"editor.foldAllExcept",label:me(0,"Fold All Except Selected"),alias:"Fold All Except Selected",precondition:d0,kbOpts:{kbExpr:nc.editorTextFocus,primary:vt(2089,2136),weight:100}})}invoke(e,t,i){KJ(t,!0,this.getSelectedLines(i))}}),qd(class extends g0{constructor(){super({id:"editor.unfoldAllExcept",label:me(0,"Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:d0,kbOpts:{kbExpr:nc.editorTextFocus,primary:vt(2089,2134),weight:100}})}invoke(e,t,i){KJ(t,!1,this.getSelectedLines(i))}}),qd(class extends g0{constructor(){super({id:"editor.toggleFold",label:me(0,"Toggle Fold"),alias:"Toggle Fold",precondition:d0,kbOpts:{kbExpr:nc.editorTextFocus,primary:vt(2089,2090),weight:100}})}invoke(e,t,i){zJ(t,1,this.getSelectedLines(i))}}),qd(class extends g0{constructor(){super({id:"editor.gotoParentFold",label:me(0,"Go to Parent Fold"),alias:"Go to Parent Fold",precondition:d0,kbOpts:{kbExpr:nc.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const e=function(e,t){let i=null;const n=t.getRegionAtLine(e);if(null!==n&&(i=n.startLineNumber,e===i)){const e=n.parentIndex;i=-1!==e?t.regions.getStartLineNumber(e):null}return i}(n[0],t);null!==e&&i.setSelection({startLineNumber:e,startColumn:1,endLineNumber:e,endColumn:1})}}}),qd(class extends g0{constructor(){super({id:"editor.gotoPreviousFold",label:me(0,"Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:d0,kbOpts:{kbExpr:nc.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const e=function(e,t){let i=t.getRegionAtLine(e);if(null!==i&&i.startLineNumber===e){if(e!==i.startLineNumber)return i.startLineNumber;{const e=i.parentIndex;let n=0;for(-1!==e&&(n=t.regions.getStartLineNumber(i.parentIndex));null!==i;){if(!(i.regionIndex>0))return null;if(i=t.regions.toRegion(i.regionIndex-1),i.startLineNumber<=n)return null;if(i.parentIndex===e)return i.startLineNumber}}}else if(t.regions.length>0)for(i=t.regions.toRegion(t.regions.length-1);null!==i;){if(i.startLineNumber<e)return i.startLineNumber;i=i.regionIndex>0?t.regions.toRegion(i.regionIndex-1):null}return null}(n[0],t);null!==e&&i.setSelection({startLineNumber:e,startColumn:1,endLineNumber:e,endColumn:1})}}}),qd(class extends g0{constructor(){super({id:"editor.gotoNextFold",label:me(0,"Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:d0,kbOpts:{kbExpr:nc.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const e=function(e,t){let i=t.getRegionAtLine(e);if(null!==i&&i.startLineNumber===e){const e=i.parentIndex;let n=0;if(-1!==e)n=t.regions.getEndLineNumber(i.parentIndex);else{if(0===t.regions.length)return null;n=t.regions.getEndLineNumber(t.regions.length-1)}for(;null!==i;){if(!(i.regionIndex<t.regions.length))return null;if(i=t.regions.toRegion(i.regionIndex+1),i.startLineNumber>=n)return null;if(i.parentIndex===e)return i.startLineNumber}}else if(t.regions.length>0)for(i=t.regions.toRegion(0);null!==i;){if(i.startLineNumber>e)return i.startLineNumber;i=i.regionIndex<t.regions.length?t.regions.toRegion(i.regionIndex+1):null}return null}(n[0],t);null!==e&&i.setSelection({startLineNumber:e,startColumn:1,endLineNumber:e,endColumn:1})}}}),qd(class extends g0{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:me(0,"Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:d0,kbOpts:{kbExpr:nc.editorTextFocus,primary:vt(2089,2135),weight:100}})}invoke(e,t,i){var n;const o=[],s=i.getSelections();if(s){for(const e of s){let t=e.endLineNumber;1===e.endColumn&&--t,t>e.startLineNumber&&(o.push({startLineNumber:e.startLineNumber,endLineNumber:t,type:void 0,isCollapsed:!0,source:1}),i.setSelection({startLineNumber:e.startLineNumber,startColumn:1,endLineNumber:e.startLineNumber,endColumn:1}))}if(o.length>0){o.sort(((e,t)=>e.startLineNumber-t.startLineNumber));const e=BJ.sanitizeAndMerge(t.regions,o,null===(n=i.getModel())||void 0===n?void 0:n.getLineCount());t.updatePost(BJ.fromFoldRanges(e))}}}}),qd(class extends g0{constructor(){super({id:"editor.removeManualFoldingRanges",label:me(0,"Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:d0,kbOpts:{kbExpr:nc.editorTextFocus,primary:vt(2089,2137),weight:100}})}invoke(e,t,i){const n=i.getSelections();if(n){const i=[];for(const e of n){const{startLineNumber:t,endLineNumber:n}=e;i.push(n>=t?{startLineNumber:t,endLineNumber:n}:{endLineNumber:n,startLineNumber:t})}t.removeManualRanges(i),e.triggerFoldingModelChanged()}}});for(let e=1;e<=7;e++)f0=new m0({id:m0.ID(e),label:me(0,"Fold Level {0}",e),alias:`Fold Level ${e}`,precondition:d0,kbOpts:{kbExpr:nc.editorTextFocus,primary:vt(2089,2048|21+e),weight:100}}),Yd.INSTANCE.registerEditorAction(f0);var f0;Ch.registerCommand("_executeFoldingRangeProvider",(async function(e,...t){const[i]=t;if(!(i instanceof Ro))throw m();const n=e.get(Jk),o=e.get(uh).getModel(i);if(!o)throw m();const s=e.get(ug);if(!s.getValue("editor.folding",{resource:i}))return[];const r=e.get(Yg),a=s.getValue("editor.foldingStrategy",{resource:i}),l={get limit(){return s.getValue("editor.foldingMaximumRegions",{resource:i})},update:(e,t)=>{}},h=new ZJ(o,r,l);let d=h;if("indentation"!==a){const e=c0.getFoldingRangeProviders(n,o);e.length&&(d=new r0(o,e,(()=>{}),l,h))}const c=await d.compute(Rt.None),u=[];try{if(c)for(let e=0;e<c.length;e++){const t=c.getType(e);u.push({start:c.getStartLineNumber(e),end:c.getEndLineNumber(e),kind:t?CC.fromValue(t):void 0})}return u}finally{d.dispose()}})),qd(class extends zd{constructor(){super({id:"editor.action.fontZoomIn",label:me(0,"Editor Font Zoom In"),alias:"Editor Font Zoom In",precondition:void 0})}run(e,t){_R.setZoomLevel(_R.getZoomLevel()+1)}}),qd(class extends zd{constructor(){super({id:"editor.action.fontZoomOut",label:me(0,"Editor Font Zoom Out"),alias:"Editor Font Zoom Out",precondition:void 0})}run(e,t){_R.setZoomLevel(_R.getZoomLevel()-1)}}),qd(class extends zd{constructor(){super({id:"editor.action.fontZoomReset",label:me(0,"Editor Font Zoom Reset"),alias:"Editor Font Zoom Reset",precondition:void 0})}run(e,t){_R.setZoomLevel(0)}});class _0{static _handleEolEdits(e,t){let i;const n=[];for(const e of t)"number"==typeof e.eol&&(i=e.eol),e.range&&"string"==typeof e.text&&n.push(e);return"number"==typeof i&&e.hasModel()&&e.getModel().pushEOL(i),n}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),n=i.validateRange(t.range);return i.getFullModelRange().equalsRange(n)}static execute(e,t,i){i&&e.pushUndoStop();const n=PN.capture(e),o=_0._handleEolEdits(e,t);1===o.length&&_0._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map((e=>vG.replace(tc.lift(e.range),e.text)))):e.executeEdits("formatEditsCommand",o.map((e=>vG.replaceMove(tc.lift(e.range),e.text)))),i&&e.pushUndoStop(),n.restoreRelativeVerticalPositionOfCursor(e)}}class v0{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return"string"==typeof e?e.toLowerCase():e._lower}}class b0{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(v0.toKey(e))}has(e){return this._set.has(v0.toKey(e))}}function w0(e,t,i){const n=[],o=new b0,s=e.ordered(i);for(const e of s)n.push(e),e.extensionId&&o.add(e.extensionId);const r=t.ordered(i);for(const e of r){if(e.extensionId){if(o.has(e.extensionId))continue;o.add(e.extensionId)}n.push({displayName:e.displayName,extensionId:e.extensionId,provideDocumentFormattingEdits:(t,i,n)=>e.provideDocumentRangeFormattingEdits(t,t.getFullModelRange(),i,n)})}return n}class C0{static setFormatterSelector(e){return{dispose:C0._selectors.unshift(e)}}static async select(e,t,i){if(0===e.length)return;const n=C.first(C0._selectors);return n?await n(e,t,i):void 0}}async function y0(e,t,i,n,o,s,r){const a=e.get(lh),{documentRangeFormattingEditProvider:l}=e.get(Jk),h=uz(t)?t.getModel():t,d=l.ordered(h),c=await C0.select(d,h,n);c&&(o.report(c),await a.invokeFunction(S0,c,t,i,s,r))}async function S0(e,t,i,n,o,s){var r,a;const l=e.get(XZ),h=e.get(Md),d=e.get(VS);let c,u;uz(i)?(c=i.getModel(),u=new oL(i,5,void 0,o)):(c=i,u=new sL(i,o));const g=[];let p=0;for(const e of $c(n).sort(tc.compareRangesUsingStarts))p>0&&tc.areIntersectingOrTouching(g[p-1],e)?g[p-1]=tc.fromPositions(g[p-1].getStartPosition(),e.getEndPosition()):p=g.push(e);const m=async e=>{var i,n;h.trace("[format][provideDocumentRangeFormattingEdits] (request)",null===(i=t.extensionId)||void 0===i?void 0:i.value,e);const o=await t.provideDocumentRangeFormattingEdits(c,e,c.getFormattingOptions(),u.token)||[];return h.trace("[format][provideDocumentRangeFormattingEdits] (response)",null===(n=t.extensionId)||void 0===n?void 0:n.value,o),o},f=(e,t)=>{if(!e.length||!t.length)return!1;const i=e.reduce(((e,t)=>tc.plusRange(e,t.range)),e[0].range);if(!t.some((e=>tc.intersectRanges(i,e.range))))return!1;for(const i of e)for(const e of t)if(tc.intersectRanges(i.range,e.range))return!0;return!1},_=[],v=[];try{if("function"==typeof t.provideDocumentRangesFormattingEdits){h.trace("[format][provideDocumentRangeFormattingEdits] (request)",null===(r=t.extensionId)||void 0===r?void 0:r.value,g);const e=await t.provideDocumentRangesFormattingEdits(c,g,c.getFormattingOptions(),u.token)||[];h.trace("[format][provideDocumentRangeFormattingEdits] (response)",null===(a=t.extensionId)||void 0===a?void 0:a.value,e),v.push(e)}else{for(const e of g){if(u.token.isCancellationRequested)return!0;v.push(await m(e))}for(let e=0;e<g.length;++e)for(let t=e+1;t<g.length;++t){if(u.token.isCancellationRequested)return!0;if(f(v[e],v[t])){const i=tc.plusRange(g[e],g[t]),n=await m(i);g.splice(t,1),g.splice(e,1),g.push(i),v.splice(t,1),v.splice(e,1),v.push(n),e=0,t=0}}}for(const e of v){if(u.token.isCancellationRequested)return!0;const t=await l.computeMoreMinimalEdits(c.uri,e);t&&_.push(...t)}}finally{u.dispose()}if(0===_.length)return!1;if(uz(i))_0.execute(i,_,!0),i.revealPositionInCenterIfOutsideViewport(i.getPosition(),1);else{const[{range:e}]=_,t=new ic(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn);c.pushEditOperations([t],_.map((e=>({text:e.text,range:tc.lift(e.range),forceMoveMarkers:!0}))),(e=>{for(const{range:i}of e)if(tc.areIntersectingOrTouching(i,t))return[new ic(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn)];return null}))}return d.notify("format",s),!0}async function k0(e,t,i,n,o,s){const r=e.get(lh),a=e.get(Jk),l=uz(t)?t.getModel():t,h=w0(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),d=await C0.select(h,l,i);d&&(n.report(d),await r.invokeFunction(L0,d,t,i,o,s))}async function L0(e,t,i,n,o,s){const r=e.get(XZ),a=e.get(VS);let l,h,d;uz(i)?(l=i.getModel(),h=new oL(i,5,void 0,o)):(l=i,h=new sL(i,o));try{const e=await t.provideDocumentFormattingEdits(l,l.getFormattingOptions(),h.token);if(d=await r.computeMoreMinimalEdits(l.uri,e),h.token.isCancellationRequested)return!0}finally{h.dispose()}if(!d||0===d.length)return!1;if(uz(i))_0.execute(i,d,2!==n),2!==n&&i.revealPositionInCenterIfOutsideViewport(i.getPosition(),1);else{const[{range:e}]=d,t=new ic(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn);l.pushEditOperations([t],d.map((e=>({text:e.text,range:tc.lift(e.range),forceMoveMarkers:!0}))),(e=>{for(const{range:i}of e)if(tc.areIntersectingOrTouching(i,t))return[new ic(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn)];return null}))}return a.notify("format",s),!0}function x0(e,t,i,n,o,s,r){const a=t.onTypeFormattingEditProvider.ordered(i);return 0===a.length||a[0].autoFormatTriggerCharacters.indexOf(o)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(i,n,o,s,r)).catch(d).then((t=>e.computeMoreMinimalEdits(i.uri,t)))}C0._selectors=new B,Ch.registerCommand("_executeFormatRangeProvider",(async function(e,...t){const[i,n,o]=t;fl(Ro.isUri(i)),fl(tc.isIRange(n));const s=e.get(gh),r=e.get(XZ),a=e.get(Jk),l=await s.createModelReference(i);try{return async function(e,t,i,n,o,s){const r=t.documentRangeFormattingEditProvider.ordered(i);for(const t of r){const r=await Promise.resolve(t.provideDocumentRangeFormattingEdits(i,n,o,s)).catch(d);if(Wc(r))return await e.computeMoreMinimalEdits(i.uri,r)}}(r,a,l.object.textEditorModel,tc.lift(n),o,Rt.None)}finally{l.dispose()}})),Ch.registerCommand("_executeFormatDocumentProvider",(async function(e,...t){const[i,n]=t;fl(Ro.isUri(i));const o=e.get(gh),s=e.get(XZ),r=e.get(Jk),a=await o.createModelReference(i);try{return async function(e,t,i,n,o){const s=w0(t.documentFormattingEditProvider,t.documentRangeFormattingEditProvider,i);for(const t of s){const s=await Promise.resolve(t.provideDocumentFormattingEdits(i,n,o)).catch(d);if(Wc(s))return await e.computeMoreMinimalEdits(i.uri,s)}}(s,r,a.object.textEditorModel,n,Rt.None)}finally{a.dispose()}})),Ch.registerCommand("_executeFormatOnTypeProvider",(async function(e,...t){const[i,n,o,s]=t;fl(Ro.isUri(i)),fl(ch.isIPosition(n)),fl("string"==typeof o);const r=e.get(gh),a=e.get(XZ),l=e.get(Jk),h=await r.createModelReference(i);try{return x0(a,l,h.object.textEditorModel,ch.lift(n),o,s,Rt.None)}finally{h.dispose()}}));var D0=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},E0=function(e,t){return function(i,n){t(i,n,e)}};let N0=class{constructor(e,t,i,n){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._accessibleNotificationService=n,this._disposables=new M,this._sessionDisposables=new M,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel((()=>this._update()))),this._disposables.add(e.onDidChangeModelLanguage((()=>this._update()))),this._disposables.add(e.onDidChangeConfiguration((e=>{e.hasChanged(56)&&this._update()}))),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(56))return;if(!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const i=new zw;for(const e of t.autoFormatTriggerCharacters)i.add(e.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType((e=>{const t=e.charCodeAt(e.length-1);i.has(t)&&this._trigger(String.fromCharCode(t))})))}_trigger(e){if(!this._editor.hasModel())return;if(this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),i=this._editor.getPosition(),n=new Pt,o=this._editor.onDidChangeModelContent((e=>{if(e.isFlush)return n.cancel(),void o.dispose();for(let t=0,s=e.changes.length;t<s;t++)if(e.changes[t].range.endLineNumber<=i.lineNumber)return n.cancel(),void o.dispose()}));x0(this._workerService,this._languageFeaturesService,t,i,e,t.getFormattingOptions(),n.token).then((e=>{n.token.isCancellationRequested||Wc(e)&&(this._accessibleNotificationService.notify("format",!1),_0.execute(this._editor,e,!0))})).finally((()=>{o.dispose()}))}};N0.ID="editor.contrib.autoFormat",N0=D0([E0(1,Jk),E0(2,XZ),E0(3,VS)],N0);let I0=class{constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new M,this._callOnModel=new M,this._callOnDispose.add(e.onDidChangeConfiguration((()=>this._update()))),this._callOnDispose.add(e.onDidChangeModel((()=>this._update()))),this._callOnDispose.add(e.onDidChangeModelLanguage((()=>this._update()))),this._callOnDispose.add(t.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(55)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste((({range:e})=>this._trigger(e))))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(y0,this.editor,e,2,cL.None,Rt.None,!1).catch(h))}};I0.ID="editor.contrib.formatOnPaste",I0=D0([E0(1,Jk),E0(2,lh)],I0),Gd(N0.ID,N0,2),Gd(I0.ID,I0,2),qd(class extends zd{constructor(){super({id:"editor.action.formatDocument",label:me(0,"Format Document"),alias:"Format Document",precondition:Bh.and(nc.notInCompositeEditor,nc.writable,nc.hasDocumentFormattingProvider),kbOpts:{kbExpr:nc.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t){if(t.hasModel()){const i=e.get(lh),n=e.get(uL);await n.showWhile(i.invokeFunction(k0,t,1,cL.None,Rt.None,!0),250)}}}),qd(class extends zd{constructor(){super({id:"editor.action.formatSelection",label:me(0,"Format Selection"),alias:"Format Selection",precondition:Bh.and(nc.writable,nc.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:nc.editorTextFocus,primary:vt(2089,2084),weight:100},contextMenuOpts:{when:nc.hasNonEmptySelection,group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(lh),n=t.getModel(),o=t.getSelections().map((e=>e.isEmpty()?new tc(e.startLineNumber,1,e.startLineNumber,n.getLineMaxColumn(e.startLineNumber)):e)),s=e.get(uL);await s.showWhile(i.invokeFunction(y0,t,o,1,cL.None,Rt.None,!0),250)}}),Ch.registerCommand("editor.action.format",(async e=>{const t=e.get(dh).getFocusedCodeEditor();if(!t||!t.hasModel())return;const i=e.get(wh);t.getSelection().isEmpty()?await i.executeCommand("editor.action.formatDocument"):await i.executeCommand("editor.action.formatSelection")}));class M0{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t){var i;const n=new M;e.canAcceptInBackground=!!(null===(i=this.options)||void 0===i?void 0:i.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=n.add(new A);return o.value=this.doProvide(e,t),n.add(this.onDidActiveTextEditorControlChange((()=>{o.value=void 0,o.value=this.doProvide(e,t)}))),n}doProvide(e,t){var i;const n=new M,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const s={editor:o},r=pz(o);if(r){let e=null!==(i=o.saveViewState())&&void 0!==i?i:void 0;n.add(r.onDidChangeCursorPosition((()=>{var t;e=null!==(t=o.saveViewState())&&void 0!==t?t:void 0}))),s.restoreViewState=()=>{e&&o===this.activeTextEditorControl&&o.restoreViewState(e)},n.add(w(t.onCancellationRequested)((()=>{var e;return null===(e=s.restoreViewState)||void 0===e?void 0:e.call(s)})))}n.add(I((()=>this.clearDecorations(o)))),n.add(this.provideWithTextEditor(s,e,t))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Yr(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return gz(e)?null===(t=e.getModel())||void 0===t?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations((e=>{const i=[];this.rangeHighlightDecorationId&&(i.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),i.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const n=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:Av(cb),position:vc.Full}}}],[o,s]=e.deltaDecorations(i,n);this.rangeHighlightDecorationId={rangeHighlightId:o,overviewRulerDecorationId:s}}))}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations((e=>{e.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])})),this.rangeHighlightDecorationId=void 0)}}class T0 extends M0{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=me(0,"Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,T.None}provideWithTextEditor(e,t,i){const n=e.editor,o=new M;o.add(t.onDidAccept((i=>{const[o]=t.selectedItems;if(o){if(!this.isValidLineNumber(n,o.lineNumber))return;this.gotoLocation(e,{range:this.toRange(o.lineNumber,o.column),keyMods:t.keyMods,preserveFocus:i.inBackground}),i.inBackground||t.hide()}})));const s=()=>{const e=this.parsePosition(n,t.value.trim().substr(T0.PREFIX.length)),i=this.getPickLabel(n,e.lineNumber,e.column);if(t.items=[{lineNumber:e.lineNumber,column:e.column,label:i}],t.ariaLabel=i,!this.isValidLineNumber(n,e.lineNumber))return void this.clearDecorations(n);const o=this.toRange(e.lineNumber,e.column);n.revealRangeInCenter(o,0),this.addDecorations(n,o)};s(),o.add(t.onDidChangeValue((()=>s())));const r=pz(n);return r&&2===r.getOptions().get(67).renderType&&(r.updateOptions({lineNumbers:"on"}),o.add(I((()=>r.updateOptions({lineNumbers:"relative"}))))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map((e=>parseInt(e,10))).filter((e=>!isNaN(e))),n=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:n+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?me(0,"Go to line {0} and character {1}.",t,i):me(0,"Go to line {0}.",t);const n=e.getPosition()||{lineNumber:1,column:1},o=this.lineCount(e);return o>1?me(0,"Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",n.lineNumber,n.column,o):me(0,"Current Line: {0}, Character: {1}. Type a line number to navigate to.",n.lineNumber,n.column)}isValidLineNumber(e,t){return!(!t||"number"!=typeof t)&&t>0&&t<=this.lineCount(e)}isValidColumn(e,t,i){if(!i||"number"!=typeof i)return!1;const n=this.getModel(e);if(!n)return!1;const o={lineNumber:t,column:i};return n.validatePosition(o).equals(o)}lineCount(e){var t,i;return null!==(i=null===(t=this.getModel(e))||void 0===t?void 0:t.getLineCount())&&void 0!==i?i:0}}var A0;T0.PREFIX=":",function(e){e[e.PRESERVE=0]="PRESERVE",e[e.LAST=1]="LAST"}(A0||(A0={}));const R0="workbench.contributions.quickaccess";var O0,P0,F0,B0,W0,V0,z0,H0;md.add(R0,new class{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return 0===e.prefix.length?this.defaultProvider=e:this.providers.push(e),this.providers.sort(((e,t)=>t.prefix.length-e.prefix.length)),I((()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)}))}getQuickAccessProviders(){return Pc([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){const t=e&&this.providers.find((t=>e.startsWith(t.prefix)))||void 0;return t||this.defaultProvider}}),function(e){e.inspectTokensAction=me(0,"Developer: Inspect Tokens")}(O0||(O0={})),function(e){e.gotoLineActionLabel=me(0,"Go to Line/Column...")}(P0||(P0={})),function(e){e.helpQuickAccessActionLabel=me(0,"Show all Quick Access Providers")}(F0||(F0={})),function(e){e.quickCommandActionLabel=me(0,"Command Palette"),e.quickCommandHelp=me(0,"Show And Run Commands")}(B0||(B0={})),function(e){e.quickOutlineActionLabel=me(0,"Go to Symbol..."),e.quickOutlineByCategoryActionLabel=me(0,"Go to Symbol by Category...")}(W0||(W0={})),function(e){e.editorViewAccessibleLabel=me(0,"Editor content"),e.accessibilityHelpMessage=me(0,"Press Alt+F1 for Accessibility Options.")}(V0||(V0={})),function(e){e.toggleHighContrast=me(0,"Toggle High Contrast Theme")}(z0||(z0={})),function(e){e.bulkEditServiceSummary=me(0,"Made {0} edits in {1} files")}(H0||(H0={}));let U0=class extends T0{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=z.None}get activeTextEditorControl(){var e;return null!==(e=this.editorService.getFocusedCodeEditor())&&void 0!==e?e:void 0}};U0=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,dh)],U0);class K0 extends zd{constructor(){super({id:K0.ID,label:P0.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:nc.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(rI).quickAccess.show(U0.PREFIX)}}K0.ID="editor.action.gotoLine",qd(K0),md.as(R0).registerQuickAccessProvider({ctor:U0,prefix:U0.PREFIX,helpEntries:[{description:P0.gotoLineActionLabel,commandId:K0.ID}]});var j0=i(1556),q0={};q0.styleTagTransform=Vr(),q0.setAttributes=Pr(),q0.insert=Rr().bind(null,"head"),q0.domAPI=Tr(),q0.insertStyleElement=Br(),Ir()(j0.Z,q0),j0.Z&&j0.Z.locals&&j0.Z.locals;class $0 extends T{constructor(e){super(),this.editor=e,this.widget=null,je&&(this._register(e.onDidChangeConfiguration((()=>this.update()))),this.update())}update(){const e=!this.editor.getOption(90);!this.widget&&e?this.widget=new G0(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}$0.ID="editor.contrib.iPadShowKeyboard";class G0 extends T{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(bs(this._domNode,"touchstart",(e=>{this.editor.focus()}))),this._register(bs(this._domNode,"focus",(e=>{this.editor.focus()}))),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return G0.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}G0.ID="editor.contrib.ShowKeyboardWidget",Gd($0.ID,$0,3);class Z0{constructor(e,t,i){this._editRange=e,this._originalSelection=t,this._text=i}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new ic(i.endLineNumber,Math.min(this._originalSelection.positionColumn,i.endColumn),i.endLineNumber,Math.min(this._originalSelection.positionColumn,i.endColumn)):new ic(i.endLineNumber,i.endColumn-this._text.length,i.endLineNumber,i.endColumn)}}var Y0=i(6921),Q0={};Q0.styleTagTransform=Vr(),Q0.setAttributes=Pr(),Q0.insert=Rr().bind(null,"head"),Q0.domAPI=Tr(),Q0.insertStyleElement=Br(),Ir()(Y0.Z,Q0),Y0.Z&&Y0.Z.locals&&Y0.Z.locals;var X0;let J0=X0=class{static get(e){return e.getContribution(X0.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var i;null===(i=this.currentRequest)||void 0===i||i.cancel();const n=this.editor.getSelection(),o=this.editor.getModel();if(!o||!n)return;let s=n;if(s.startLineNumber!==s.endLineNumber)return;const r=new nL(this.editor,5),a=o.uri;return this.editorWorkerService.canNavigateValueSet(a)?(this.currentRequest=Wt((e=>this.editorWorkerService.navigateValueSet(a,s,t))),this.currentRequest.then((t=>{var i;if(!t||!t.range||!t.value)return;if(!r.validate(this.editor))return;const n=tc.lift(t.range);let o=t.range;const a=t.value.length-(s.endColumn-s.startColumn);o={startLineNumber:o.startLineNumber,startColumn:o.startColumn,endLineNumber:o.endLineNumber,endColumn:o.startColumn+t.value.length},a>1&&(s=new ic(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn+a-1));const l=new Z0(n,s,t.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,l),this.editor.pushUndoStop(),this.decorations.set([{range:o,options:X0.DECORATION}]),null===(i=this.decorationRemover)||void 0===i||i.cancel(),this.decorationRemover=Kt(350),this.decorationRemover.then((()=>this.decorations.clear())).catch(h)})).catch(h)):Promise.resolve(void 0)}};function e1(e,t){let i=0;for(let n=0;n<e.length;n++)"\t"===e.charAt(n)?i+=t:i++;return i}function t1(e,t,i){e=e<0?0:e;let n="";if(!i){const i=Math.floor(e/t);e%=t;for(let e=0;e<i;e++)n+="\t"}for(let t=0;t<e;t++)n+=" ";return n}J0.ID="editor.contrib.inPlaceReplaceController",J0.DECORATION=Sy.register({description:"in-place-replace",className:"valueSetReplacement"}),J0=X0=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,XZ)],J0),Gd(J0.ID,J0,4),qd(class extends zd{constructor(){super({id:"editor.action.inPlaceReplace.up",label:me(0,"Replace with Previous Value"),alias:"Replace with Previous Value",precondition:nc.writable,kbOpts:{kbExpr:nc.editorTextFocus,primary:3159,weight:100}})}run(e,t){const i=J0.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}),qd(class extends zd{constructor(){super({id:"editor.action.inPlaceReplace.down",label:me(0,"Replace with Next Value"),alias:"Replace with Next Value",precondition:nc.writable,kbOpts:{kbExpr:nc.editorTextFocus,primary:3161,weight:100}})}run(e,t){const i=J0.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}});function i1(e,t,i,n,o){if(1===e.getLineCount()&&1===e.getLineMaxColumn(1))return[];const s=t.getLanguageConfiguration(e.getLanguageId()).indentationRules;if(!s)return[];for(n=Math.min(n,e.getLineCount());i<=n&&s.unIndentedLinePattern;){const t=e.getLineContent(i);if(!s.unIndentedLinePattern.test(t))break;i++}if(i>n-1)return[];const{tabSize:r,indentSize:a,insertSpaces:l}=e.getOptions(),h=(e,t)=>(t=t||1,lS.shiftIndent(e,e.length+t,r,a,l)),d=(e,t)=>(t=t||1,lS.unshiftIndent(e,e.length+t,r,a,l)),c=[];let u;const g=e.getLineContent(i);let p=g;if(null!=o){u=o;const e=_n(g);p=u+g.substring(e.length),s.decreaseIndentPattern&&s.decreaseIndentPattern.test(p)&&(u=d(u),p=u+g.substring(e.length)),g!==p&&c.push(vG.replaceMove(new ic(i,1,i,e.length+1),hu(u,a,l)))}else u=_n(g);let m=u;s.increaseIndentPattern&&s.increaseIndentPattern.test(p)?(m=h(m),u=h(u)):s.indentNextLinePattern&&s.indentNextLinePattern.test(p)&&(m=h(m));for(let t=++i;t<=n;t++){const i=e.getLineContent(t),n=_n(i),o=m+i.substring(n.length);s.decreaseIndentPattern&&s.decreaseIndentPattern.test(o)&&(m=d(m),u=d(u)),n!==m&&c.push(vG.replaceMove(new ic(t,1,t,n.length+1),hu(m,a,l))),s.unIndentedLinePattern&&s.unIndentedLinePattern.test(i)||(s.increaseIndentPattern&&s.increaseIndentPattern.test(o)?(u=h(u),m=u):m=s.indentNextLinePattern&&s.indentNextLinePattern.test(o)?h(m):u)}return c}class n1 extends zd{constructor(){super({id:n1.ID,label:me(0,"Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:nc.writable})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),o=t.getSelection();if(!o)return;const s=new g1(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}}n1.ID="editor.action.indentationToSpaces";class o1 extends zd{constructor(){super({id:o1.ID,label:me(0,"Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:nc.writable})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),o=t.getSelection();if(!o)return;const s=new p1(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}}o1.ID="editor.action.indentationToTabs";class s1 extends zd{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(rI),n=e.get(uh),o=t.getModel();if(!o)return;const s=n.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),r=o.getOptions(),a=[1,2,3,4,5,6,7,8].map((e=>({id:e.toString(),label:e.toString(),description:e===s.tabSize&&e===r.tabSize?me(0,"Configured Tab Size"):e===s.tabSize?me(0,"Default Tab Size"):e===r.tabSize?me(0,"Current Tab Size"):void 0}))),l=Math.min(o.getOptions().tabSize-1,7);setTimeout((()=>{i.pick(a,{placeHolder:me(0,"Select Tab Size for Current File"),activeItem:a[l]}).then((e=>{if(e&&o&&!o.isDisposed()){const t=parseInt(e.label,10);this.displaySizeOnly?o.updateOptions({tabSize:t}):o.updateOptions({tabSize:t,indentSize:t,insertSpaces:this.insertSpaces})}}))}),50)}}class r1 extends s1{constructor(){super(!1,!1,{id:r1.ID,label:me(0,"Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}r1.ID="editor.action.indentUsingTabs";class a1 extends s1{constructor(){super(!0,!1,{id:a1.ID,label:me(0,"Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}a1.ID="editor.action.indentUsingSpaces";class l1 extends s1{constructor(){super(!0,!0,{id:l1.ID,label:me(0,"Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0})}}l1.ID="editor.action.changeTabDisplaySize";class h1 extends zd{constructor(){super({id:h1.ID,label:me(0,"Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const i=e.get(uh),n=t.getModel();if(!n)return;const o=i.getCreationOptions(n.getLanguageId(),n.uri,n.isForSimpleWidget);n.detectIndentation(o.insertSpaces,o.tabSize)}}h1.ID="editor.action.detectIndentation";class d1{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const t of e)t.range&&"string"==typeof t.text&&this._edits.push(t)}getEditOperations(e,t){for(const e of this._edits)t.addEditOperation(tc.lift(e.range),e.text);let i=!1;Array.isArray(this._edits)&&1===this._edits.length&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}let c1=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new M,this.callOnModel=new M,this.callOnDispose.add(e.onDidChangeConfiguration((()=>this.update()))),this.callOnDispose.add(e.onDidChangeModel((()=>this.update()))),this.callOnDispose.add(e.onDidChangeModelLanguage((()=>this.update())))}update(){this.callOnModel.clear(),this.editor.getOption(12)<4||this.editor.getOption(55)||this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste((({range:e})=>{this.trigger(e)})))}trigger(e){const t=this.editor.getSelections();if(null===t||t.length>1)return;const i=this.editor.getModel();if(!i)return;if(!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const n=this.editor.getOption(12),{tabSize:o,indentSize:s,insertSpaces:r}=i.getOptions(),a=[],l={shiftIndent:e=>lS.shiftIndent(e,e.length+1,o,s,r),unshiftIndent:e=>lS.unshiftIndent(e,e.length+1,o,s,r)};let h=e.startLineNumber;for(;h<=e.endLineNumber&&this.shouldIgnoreLine(i,h);)h++;if(h>e.endLineNumber)return;let d=i.getLineContent(h);if(!/\S/.test(d.substring(0,e.startColumn-1))){const e=uS(n,i,i.getLanguageId(),h,l,this._languageConfigurationService);if(null!==e){const t=_n(d),n=e1(e,o);if(n!==e1(t,o)){const e=t1(n,o,r);a.push({range:new tc(h,1,h,t.length+1),text:e}),d=e+d.substr(t.length)}else{const e=gS(i,h,this._languageConfigurationService);if(0===e||8===e)return}}}const c=h;for(;h<e.endLineNumber&&!/\S/.test(i.getLineContent(h+1));)h++;if(h!==e.endLineNumber){const t=uS(n,{tokenization:{getLineTokens:e=>i.tokenization.getLineTokens(e),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(e,t)=>i.getLanguageIdAtPosition(e,t)},getLineContent:e=>e===c?d:i.getLineContent(e)},i.getLanguageId(),h+1,l,this._languageConfigurationService);if(null!==t){const n=e1(t,o),s=e1(_n(i.getLineContent(h+1)),o);if(n!==s){const t=n-s;for(let n=h+1;n<=e.endLineNumber;n++){const e=_n(i.getLineContent(n)),s=t1(e1(e,o)+t,o,r);s!==e&&a.push({range:new tc(n,1,n,e.length+1),text:s})}}}}if(a.length>0){this.editor.pushUndoStop();const e=new d1(a,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",e),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const i=e.getLineFirstNonWhitespaceColumn(t);if(0===i)return!0;const n=e.tokenization.getLineTokens(t);if(n.getCount()>0){const e=n.findTokenIndexAtOffset(i);if(e>=0&&1===n.getStandardTokenType(e))return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}};function u1(e,t,i,n){if(1===e.getLineCount()&&1===e.getLineMaxColumn(1))return;let o="";for(let e=0;e<i;e++)o+=" ";const s=new RegExp(o,"gi");for(let i=1,r=e.getLineCount();i<=r;i++){let r=e.getLineFirstNonWhitespaceColumn(i);if(0===r&&(r=e.getLineMaxColumn(i)),1===r)continue;const a=new tc(i,1,i,r),l=e.getValueInRange(a),h=n?l.replace(/\t/gi,o):l.replace(s,"\t");t.addEditOperation(a,h)}}c1.ID="editor.contrib.autoIndentOnPaste",c1=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,Yg)],c1);class g1{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),u1(e,t,this.tabSize,!0)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}class p1{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),u1(e,t,this.tabSize,!1)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}Gd(c1.ID,c1,2),qd(n1),qd(o1),qd(r1),qd(a1),qd(l1),qd(h1),qd(class extends zd{constructor(){super({id:"editor.action.reindentlines",label:me(0,"Reindent Lines"),alias:"Reindent Lines",precondition:nc.writable})}run(e,t){const i=e.get(Yg),n=t.getModel();if(!n)return;const o=i1(n,i,1,n.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}),qd(class extends zd{constructor(){super({id:"editor.action.reindentselectedlines",label:me(0,"Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:nc.writable})}run(e,t){const i=e.get(Yg),n=t.getModel();if(!n)return;const o=t.getSelections();if(null===o)return;const s=[];for(const e of o){let t=e.startLineNumber,o=e.endLineNumber;if(t!==o&&1===e.endColumn&&o--,1===t){if(t===o)continue}else t--;const r=i1(n,i,t,o);s.push(...r)}s.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop())}});class m1{constructor(e,t){this.range=e,this.direction=t}}class f1{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new f1(this.hint,e.anchor,this.provider);return t._isResolved=this._isResolved,t._currentResolve=this._currentResolve,t}async resolve(e){if("function"==typeof this.provider.resolveInlayHint){if(this._currentResolve){if(await this._currentResolve,e.isCancellationRequested)return;return this.resolve(e)}this._isResolved||(this._currentResolve=this._doResolve(e).finally((()=>this._currentResolve=void 0))),await this._currentResolve}}async _doResolve(e){var t,i;try{const n=await Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=null!==(t=null==n?void 0:n.tooltip)&&void 0!==t?t:this.hint.tooltip,this.hint.label=null!==(i=null==n?void 0:n.label)&&void 0!==i?i:this.hint.label,this._isResolved=!0}catch(e){d(e),this._isResolved=!1}}}class _1{static async create(e,t,i,n){const o=[],s=e.ordered(t).reverse().map((e=>i.map((async i=>{try{const s=await e.provideInlayHints(t,i,n);(null==s?void 0:s.hints.length)&&o.push([s,e])}catch(e){d(e)}}))));if(await Promise.all(s.flat()),n.isCancellationRequested||t.isDisposed())throw new p;return new _1(i,o,t)}constructor(e,t,i){this._disposables=new M,this.ranges=e,this.provider=new Set;const n=[];for(const[e,o]of t){this._disposables.add(e),this.provider.add(o);for(const t of e.hints){const e=i.validatePosition(t.position);let s="before";const r=_1._getRangeAtPosition(i,e);let a;r.getStartPosition().isBefore(e)?(a=tc.fromPositions(r.getStartPosition(),e),s="after"):(a=tc.fromPositions(e,r.getEndPosition()),s="before"),n.push(new f1(t,new m1(a,s),o))}}this.items=n.sort(((e,t)=>ch.compare(e.hint.position,t.hint.position)))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,n=e.getWordAtPosition(t);if(n)return new tc(i,n.startColumn,i,n.endColumn);e.tokenization.tokenizeIfCheap(i);const o=e.tokenization.getLineTokens(i),s=t.column-1,r=o.findTokenIndexAtOffset(s);let a=o.getStartOffset(r),l=o.getEndOffset(r);return l-a==1&&(a===s&&r>1?(a=o.getStartOffset(r-1),l=o.getEndOffset(r-1)):l===s&&r<o.getCount()-1&&(a=o.getStartOffset(r+1),l=o.getEndOffset(r+1))),new tc(i,a+1,i,l+1)}}async function v1(e,t,i,n){var o;const s=e.get(gh),r=e.get(qE),a=e.get(wh),l=e.get(lh),h=e.get(hL);if(await n.item.resolve(Rt.None),!n.part.location)return;const d=n.part.location,c=[],u=new Set(Ld.getMenuItems(yd.EditorContext).map((e=>Cd(e)?e.command.id:$Y())));for(const e of Cj.all())u.has(e.desc.id)&&c.push(new ph(e.desc.id,Dd.label(e.desc,{renderShortTitle:!0}),void 0,!0,(async()=>{const i=await s.createModelReference(d.uri);try{const o=new wj(i.object.textEditorModel,tc.getStartPosition(d.range)),s=n.item.anchor.range;await l.invokeFunction(e.runEditorCommand.bind(e),t,o,s)}finally{i.dispose()}})));if(n.part.command){const{command:e}=n.part;c.push(new fh),c.push(new ph(e.id,e.title,void 0,!0,(async()=>{var t;try{await a.executeCommand(e.id,...null!==(t=e.arguments)&&void 0!==t?t:[])}catch(e){h.notify({severity:lL.Error,source:n.item.provider.displayName,message:e})}})))}const g=t.getOption(126);r.showContextMenu({domForShadowRoot:g&&null!==(o=t.getDomNode())&&void 0!==o?o:void 0,getAnchor:()=>{const e=As(i);return{x:e.left,y:e.top+e.height+8}},getActions:()=>c,onHide:()=>{t.focus()},autoSelectFirstItem:!0})}async function b1(e,t,i,n){const o=e.get(gh),s=await o.createModelReference(n.uri);await i.invokeWithinContext((async e=>{const o=t.hasSideBySideModifier,r=e.get(sd),a=iz.inPeekEditor.getValue(r),l=!o&&i.getOption(87)&&!a;return new yj({openToSide:o,openInPeek:l,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(e,new wj(s.object.textEditorModel,tc.getStartPosition(n.range)),tc.lift(n.range))})),s.dispose()}var w1,C1=function(e,t){return function(i,n){t(i,n,e)}};class y1{constructor(){this._entries=new na(50)}get(e){const t=y1._key(e);return this._entries.get(t)}set(e,t){const i=y1._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const S1=hh("IInlayHintsCache");wg(S1,y1,1);class k1{constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return"string"==typeof e?{label:e}:e[this.index]}}class L1{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}let x1=w1=class{static get(e){var t;return null!==(t=e.getContribution(w1.ID))&&void 0!==t?t:void 0}constructor(e,t,i,n,o,s,r){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=n,this._commandService=o,this._notificationService=s,this._instaService=r,this._disposables=new M,this._sessionDisposables=new M,this._decorationsMetadata=new Map,this._ruleFactory=new xI(this._editor),this._activeRenderMode=0,this._debounceInfo=i.for(t.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(t.inlayHintsProvider.onDidChange((()=>this._update()))),this._disposables.add(e.onDidChangeModel((()=>this._update()))),this._disposables.add(e.onDidChangeModelLanguage((()=>this._update()))),this._disposables.add(e.onDidChangeConfiguration((e=>{e.hasChanged(139)&&this._update()}))),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(139);if("off"===e.enabled)return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;const i=this._inlayHintsCache.get(t);let n;i&&this._updateHintsDecorators([t.getFullModelRange()],i),this._sessionDisposables.add(I((()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)})));const o=new Set,s=new Zt((async()=>{const e=Date.now();null==n||n.dispose(!0),n=new Pt;const i=t.onWillDispose((()=>null==n?void 0:n.cancel()));try{const i=n.token,r=await _1.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),i);if(s.delay=this._debounceInfo.update(t,Date.now()-e),i.isCancellationRequested)return void r.dispose();for(const e of r.provider)"function"!=typeof e.onDidChangeInlayHints||o.has(e)||(o.add(e),this._sessionDisposables.add(e.onDidChangeInlayHints((()=>{s.isScheduled()||s.schedule()}))));this._sessionDisposables.add(r),this._updateHintsDecorators(r.ranges,r.items),this._cacheHintsForFastRestore(t)}catch(e){h(e)}finally{n.dispose(),i.dispose()}}),this._debounceInfo.get(t));if(this._sessionDisposables.add(s),this._sessionDisposables.add(I((()=>null==n?void 0:n.dispose(!0)))),s.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange((e=>{!e.scrollTopChanged&&s.isScheduled()||s.schedule()}))),this._sessionDisposables.add(this._editor.onDidChangeModelContent((e=>{const t=Math.max(s.delay,1250);s.schedule(t)}))),"on"===e.enabled)this._activeRenderMode=0;else{let t,i;"onUnlessPressed"===e.enabled?(t=0,i=1):(t=1,i=0),this._activeRenderMode=t,this._sessionDisposables.add(kr.getInstance().event((e=>{if(!this._editor.hasModel())return;const n=e.altKey&&e.ctrlKey&&!e.shiftKey&&!e.metaKey?i:t;if(n!==this._activeRenderMode){this._activeRenderMode=n;const e=this._editor.getModel(),t=this._copyInlayHintsWithCurrentAnchor(e);this._updateHintsDecorators([e.getFullModelRange()],t),s.schedule(0)}})))}this._sessionDisposables.add(this._installDblClickGesture((()=>s.schedule(0)))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new M,t=e.add(new aR(this._editor)),i=new M;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown((e=>{const[t]=e,n=this._getInlayHintLabelPart(t),o=this._editor.getModel();if(!n||!o)return void i.clear();const s=new Pt;i.add(I((()=>s.dispose(!0)))),n.item.resolve(s.token),this._activeInlayHintPart=n.part.command||n.part.location?new L1(n,t.hasTriggerModifier):void 0;const r=o.validatePosition(n.item.hint.position).lineNumber,a=new tc(r,1,r,o.getLineMaxColumn(r)),l=this._getInlineHintsForRange(a);this._updateHintsDecorators([a],l),i.add(I((()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([a],l)})))}))),e.add(t.onCancel((()=>i.clear()))),e.add(t.onExecute((async e=>{const t=this._getInlayHintLabelPart(e);if(t){const i=t.part;i.location?this._instaService.invokeFunction(b1,e,this._editor,i.location):bC.is(i.command)&&await this._invokeCommand(i.command,t.item)}}))),e}_getInlineHintsForRange(e){const t=new Set;for(const i of this._decorationsMetadata.values())e.containsRange(i.item.anchor.range)&&t.add(i.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp((async t=>{if(2!==t.event.detail)return;const i=this._getInlayHintLabelPart(t);if(i&&(t.event.preventDefault(),await i.item.resolve(Rt.None),Wc(i.item.hint.textEdits))){const t=i.item.hint.textEdits.map((e=>vG.replace(tc.lift(e.range),e.text)));this._editor.executeEdits("inlayHint.default",t),e()}}))}_installContextMenu(){return this._editor.onContextMenu((async e=>{if(!(e.event.target instanceof HTMLElement))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(v1,this._editor,e.event.target,t)}))}_getInlayHintLabelPart(e){var t;if(6!==e.target.type)return;const i=null===(t=e.target.detail.injectedText)||void 0===t?void 0:t.options;return i instanceof yy&&(null==i?void 0:i.attachedData)instanceof k1?i.attachedData:void 0}async _invokeCommand(e,t){var i;try{await this._commandService.executeCommand(e.id,...null!==(i=e.arguments)&&void 0!==i?i:[])}catch(e){this._notificationService.notify({severity:lL.Error,source:t.provider.displayName,message:e})}}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[i,n]of this._decorationsMetadata){if(t.has(n.item))continue;const o=e.getDecorationRange(i);if(o){const e=new m1(o,n.item.anchor.direction),i=n.item.with({anchor:e});t.set(n.item,i)}}return Array.from(t.values())}_getHintsRanges(){const e=this._editor.getModel(),t=this._editor.getVisibleRangesPlusViewportAboveBelow(),i=[];for(const n of t.sort(tc.compareRangesUsingStarts)){const t=e.validateRange(new tc(n.startLineNumber-30,n.startColumn,n.endLineNumber+30,n.endColumn));0!==i.length&&tc.areIntersectingOrTouching(i[i.length-1],t)?i[i.length-1]=tc.plusRange(i[i.length-1],t):i.push(t)}return i}_updateHintsDecorators(e,t){var i,n;const o=[],s=(e,t,i,n,s)=>{const r={content:i,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:t.className,cursorStops:n,attachedData:s};o.push({item:e,classNameRef:t,decoration:{range:e.anchor.range,options:{description:"InlayHint",showIfCollapsed:e.anchor.range.isEmpty(),collapseOnReplaceEdit:!e.anchor.range.isEmpty(),stickiness:0,[e.anchor.direction]:0===this._activeRenderMode?r:void 0}}})},r=(e,t)=>{const i=this._ruleFactory.createClassNameRef({width:(a/3|0)+"px",display:"inline-block"});s(e,i," ",t?Cc.Right:Cc.None)},{fontSize:a,fontFamily:l,padding:h,isUniform:d}=this._getLayoutInfo(),c="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(c,l);for(const e of t){e.hint.paddingLeft&&r(e,!1);const t="string"==typeof e.hint.label?[{label:e.hint.label}]:e.hint.label;for(let n=0;n<t.length;n++){const o=t[n],r=0===n,l=n===t.length-1,u={fontSize:`${a}px`,fontFamily:`var(${c}), ${Vk.fontFamily}`,verticalAlign:d?"baseline":"middle",unicodeBidi:"isolate"};Wc(e.hint.textEdits)&&(u.cursor="default"),this._fillInColors(u,e.hint),(o.command||o.location)&&(null===(i=this._activeInlayHintPart)||void 0===i?void 0:i.part.item)===e&&this._activeInlayHintPart.part.index===n&&(u.textDecoration="underline",this._activeInlayHintPart.hasTriggerModifier&&(u.color=Av(Gf),u.cursor="pointer")),h&&(r&&l?(u.padding=`1px ${0|Math.max(1,a/4)}px`,u.borderRadius=(a/4|0)+"px"):r?(u.padding=`1px 0 1px ${0|Math.max(1,a/4)}px`,u.borderRadius=`${a/4|0}px 0 0 ${a/4|0}px`):l?(u.padding=`1px ${0|Math.max(1,a/4)}px 1px 0`,u.borderRadius=`0 ${a/4|0}px ${a/4|0}px 0`):u.padding="1px 0 1px 0"),s(e,this._ruleFactory.createClassNameRef(u),o.label.replace(/[ \t]/g," "),l&&!e.hint.paddingRight?Cc.Right:Cc.None,new k1(e,n))}if(e.hint.paddingRight&&r(e,!0),o.length>w1._MAX_DECORATORS)break}const u=[];for(const t of e)for(const{id:e}of null!==(n=this._editor.getDecorationsInRange(t))&&void 0!==n?n:[]){const t=this._decorationsMetadata.get(e);t&&(u.push(e),t.classNameRef.dispose(),this._decorationsMetadata.delete(e))}const g=PN.capture(this._editor);this._editor.changeDecorations((e=>{const t=e.deltaDecorations(u,o.map((e=>e.decoration)));for(let e=0;e<t.length;e++){const i=o[e];this._decorationsMetadata.set(t[e],i)}})),g.restore(this._editor)}_fillInColors(e,t){t.kind===wC.Parameter?(e.backgroundColor=Av(e_),e.color=Av(Jf)):t.kind===wC.Type?(e.backgroundColor=Av(Xf),e.color=Av(Qf)):(e.backgroundColor=Av(Yf),e.color=Av(Zf))}_getLayoutInfo(){const e=this._editor.getOption(139),t=e.padding,i=this._editor.getOption(52),n=this._editor.getOption(49);let o=e.fontSize;(!o||o<5||o>i)&&(o=i);const s=e.fontFamily||n;return{fontSize:o,fontFamily:s,padding:t,isUniform:!t&&s===n&&o===i}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};x1.ID="editor.contrib.InlayHints",x1._MAX_DECORATORS=1500,x1=w1=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([C1(1,Jk),C1(2,hI),C1(3,S1),C1(4,wh),C1(5,hL),C1(6,lh)],x1),Ch.registerCommand("_executeInlayHintProvider",(async(e,...t)=>{const[i,n]=t;fl(Ro.isUri(i)),fl(tc.isIRange(n));const{inlayHintsProvider:o}=e.get(Jk),s=await e.get(gh).createModelReference(i);try{const e=await _1.create(o,s.object.textEditorModel,[tc.lift(n)],Rt.None),t=e.items.map((e=>e.hint));return setTimeout((()=>e.dispose()),0),t}finally{s.dispose()}}));var D1=function(e,t){return function(i,n){t(i,n,e)}};class E1 extends Wj{constructor(e,t,i,n){super(10,t,e.item.anchor.range,i,n,!0),this.part=e}}let N1=class extends dq{constructor(e,t,i,n,o,s){super(e,t,i,n,s),this._resolverService=o,this.hoverOrdinal=6}suggestHoverAnchor(e){var t;if(!x1.get(this._editor))return null;if(6!==e.target.type)return null;const i=null===(t=e.target.detail.injectedText)||void 0===t?void 0:t.options;return i instanceof yy&&i.attachedData instanceof k1?new E1(i.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i){return e instanceof E1?new ii((async t=>{const{part:n}=e;if(await n.item.resolve(i),i.isCancellationRequested)return;let o,s;if("string"==typeof n.item.hint.tooltip?o=(new eh).appendText(n.item.hint.tooltip):n.item.hint.tooltip&&(o=n.item.hint.tooltip),o&&t.emitOne(new hq(this,e.range,[o],!1,0)),Wc(n.item.hint.textEdits)&&t.emitOne(new hq(this,e.range,[(new eh).appendText(me(0,"Double-click to insert"))],!1,10001)),"string"==typeof n.part.tooltip?s=(new eh).appendText(n.part.tooltip):n.part.tooltip&&(s=n.part.tooltip),s&&t.emitOne(new hq(this,e.range,[s],!1,1)),n.part.location||n.part.command){let i;const o=me(0,"altKey"===this._editor.getOption(77)?Ve?"cmd + click":"ctrl + click":Ve?"option + click":"alt + click");n.part.location&&n.part.command?i=(new eh).appendText(me(0,"Go to Definition ({0}), right click for more",o)):n.part.location?i=(new eh).appendText(me(0,"Go to Definition ({0})",o)):n.part.command&&(i=new eh(`[${me(0,"Execute Command")}](${r=n.part.command,Ro.from({scheme:jo.command,path:r.id,query:r.arguments&&encodeURIComponent(JSON.stringify(r.arguments))}).toString()} "${n.part.command.title}") (${o})`,{isTrusted:!0})),i&&t.emitOne(new hq(this,e.range,[i],!1,1e4))}var r;const a=await this._resolveInlayHintLabelPartHover(n,i);for await(const e of a)t.emitOne(e)})):ii.EMPTY}async _resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return ii.EMPTY;const{uri:i,range:n}=e.part.location,o=await this._resolverService.createModelReference(i);try{const i=o.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(i)?rq(this._languageFeaturesService.hoverProvider,i,new ch(n.startLineNumber,n.startColumn),t).filter((e=>!th(e.hover.contents))).map((t=>new hq(this,e.item.anchor.range,t.hover.contents,!1,2+t.ordinal))):ii.EMPTY}finally{o.dispose()}}};N1=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([D1(1,yu),D1(2,Hx),D1(3,ug),D1(4,gh),D1(5,Jk)],N1),Gd(x1.ID,x1,1),Vj.register(N1);class I1 extends T{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=I1.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=I1.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=I1.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=I1.suppressSuggestions.bindTo(this.contextKeyService),this._register(w$((e=>{const t=this.model.read(e),i=null==t?void 0:t.state.read(e),n=!!(null==i?void 0:i.inlineCompletion)&&void 0!==(null==i?void 0:i.ghostText)&&!(null==i?void 0:i.ghostText.isEmpty());this.inlineCompletionVisible.set(n),(null==i?void 0:i.ghostText)&&(null==i?void 0:i.inlineCompletion)&&this.suppressSuggestions.set(i.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)}))),this._register(w$((e=>{const t=this.model.read(e);let i=!1,n=!0;const o=null==t?void 0:t.ghostText.read(e);if((null==t?void 0:t.selectedSuggestItem)&&o&&o.parts.length>0){const{column:e,lines:s}=o.parts[0],r=s[0];if(e<=t.textModel.getLineIndentColumn(o.lineNumber)){let e=fn(r);-1===e&&(e=r.length-1),i=e>0;const o=t.textModel.getOptions().tabSize;n=lu.visibleColumnFromColumn(r,e+1,o)<o}}this.inlineCompletionSuggestsIndentation.set(i),this.inlineCompletionSuggestsIndentationLessThanTabSize.set(n)})))}}I1.inlineSuggestionVisible=new od("inlineSuggestionVisible",!1,me(0,"Whether an inline suggestion is visible")),I1.inlineSuggestionHasIndentation=new od("inlineSuggestionHasIndentation",!1,me(0,"Whether the inline suggestion starts with whitespace")),I1.inlineSuggestionHasIndentationLessThanTabSize=new od("inlineSuggestionHasIndentationLessThanTabSize",!0,me(0,"Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab")),I1.suppressSuggestions=new od("inlineSuggestionSuppressSuggestions",void 0,me(0,"Whether suggestions should be suppressed for the current suggestion"));var M1=i(7682),T1={};T1.styleTagTransform=Vr(),T1.setAttributes=Pr(),T1.insert=Rr().bind(null,"head"),T1.domAPI=Tr(),T1.insertStyleElement=Br(),Ir()(M1.Z,T1),M1.Z&&M1.Z.locals&&M1.Z.locals;class A1{constructor(e){this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;t<e.length;t++)"\n"===e.charAt(t)&&this.lineStartOffsetByLineIdx.push(t+1)}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}}const R1=[];class O1{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new b(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new tc(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function P1(e,t){return new ch(e.lineNumber+t.lineNumber-1,1===t.lineNumber?e.column+t.column-1:t.column)}function F1(e){let t=1,i=1;for(const n of e)"\n"===n?(t++,i=1):i++;return new ch(t,i)}class B1{constructor(e,t){this.lineNumber=e,this.parts=t}equals(e){return this.lineNumber===e.lineNumber&&this.parts.length===e.parts.length&&this.parts.every(((t,i)=>t.equals(e.parts[i])))}renderForScreenReader(e){if(0===this.parts.length)return"";const t=this.parts[this.parts.length-1],i=function(e,t){const i=new A1(e),n=t.map((e=>{const t=tc.lift(e.range);return{startOffset:i.getOffset(t.getStartPosition()),endOffset:i.getOffset(t.getEndPosition()),text:e.text}}));n.sort(((e,t)=>t.startOffset-e.startOffset));for(const t of n)e=e.substring(0,t.startOffset)+t.text+e.substring(t.endOffset);return e}(e.substr(0,t.column-1),this.parts.map((e=>({range:{startLineNumber:1,endLineNumber:1,startColumn:e.column,endColumn:e.column},text:e.lines.join("\n")}))));return i.substring(this.parts[0].column-1)}isEmpty(){return this.parts.every((e=>0===e.lines.length))}get lineCount(){return 1+this.parts.reduce(((e,t)=>e+t.lines.length-1),0)}}class W1{constructor(e,t,i){this.column=e,this.lines=t,this.preview=i}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every(((t,i)=>t===e.lines[i]))}}class V1{constructor(e,t,i,n=0){this.lineNumber=e,this.columnRange=t,this.newLines=i,this.additionalReservedLineCount=n,this.parts=[new W1(this.columnRange.endColumnExclusive,this.newLines,!1)]}renderForScreenReader(e){return this.newLines.join("\n")}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every((e=>0===e.lines.length))}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every(((t,i)=>t===e.newLines[i]))&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function z1(e,t){return e===t||!(!e||!t)&&(e instanceof B1&&t instanceof B1||e instanceof V1&&t instanceof V1)&&e.equals(t)}const H1="ghost-text";let U1=class extends T{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=d$(this,!1),this.currentTextModel=D$(this.editor.onDidChangeModel,(()=>this.editor.getModel())),this.uiState=m$(this,(e=>{if(this.isDisposed.read(e))return;const t=this.currentTextModel.read(e);if(t!==this.model.targetTextModel.read(e))return;const i=this.model.ghostText.read(e);if(!i)return;const n=i instanceof V1?i.columnRange:void 0,o=[],s=[];function r(e,t){if(s.length>0){const i=s[s.length-1];t&&i.decorations.push(new jR(i.content.length+1,i.content.length+1+e[0].length,t,0)),i.content+=e[0],e=e.slice(1)}for(const i of e)s.push({content:i,decorations:t?[new jR(1,i.length+1,t,0)]:[]})}const a=t.getLineContent(i.lineNumber);let l,h=0;for(const e of i.parts){let t=e.lines;void 0===l?(o.push({column:e.column,text:t[0],preview:e.preview}),t=t.slice(1)):r([a.substring(h,e.column-1)],void 0),t.length>0&&(r(t,H1),void 0===l&&e.column<=a.length&&(l=e.column)),h=e.column-1}void 0!==l&&r([a.substring(h)],void 0);const d=void 0!==l?new O1(l,a.length+1):void 0;return{replacedRange:n,inlineTexts:o,additionalLines:s,hiddenRange:d,lineNumber:i.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(e),targetTextModel:t}})),this.decorations=m$(this,(e=>{const t=this.uiState.read(e);if(!t)return[];const i=[];t.replacedRange&&i.push({range:t.replacedRange.toRange(t.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),t.hiddenRange&&i.push({range:t.hiddenRange.toRange(t.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const e of t.inlineTexts)i.push({range:tc.fromPositions(new ch(t.lineNumber,e.column)),options:{description:H1,after:{content:e.text,inlineClassName:e.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:Cc.Left},showIfCollapsed:!0}});return i})),this.additionalLinesWidget=this._register(new K1(this.editor,this.languageService.languageIdCodec,m$((e=>{const t=this.uiState.read(e);return t?{lineNumber:t.lineNumber,additionalLines:t.additionalLines,minReservedLineCount:t.additionalReservedLineCount,targetTextModel:t.targetTextModel}:void 0})))),this._register(I((()=>{this.isDisposed.set(!0,void 0)}))),this._register(function(e,t){const i=new M,n=e.createDecorationsCollection();return i.add(C$({debugName:()=>`Apply decorations from ${t.debugName}`},(e=>{const i=t.read(e);n.set(i)}))),i.add({dispose:()=>{n.clear()}}),i}(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};U1=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(2,yu)],U1);class K1 extends T{get viewZoneId(){return this._viewZoneId}constructor(e,t,i){super(),this.editor=e,this.languageIdCodec=t,this.lines=i,this._viewZoneId=void 0,this.editorOptionsChanged=N$("editorOptionChanged",z.filter(this.editor.onDidChangeConfiguration,(e=>e.hasChanged(33)||e.hasChanged(116)||e.hasChanged(98)||e.hasChanged(93)||e.hasChanged(51)||e.hasChanged(50)||e.hasChanged(66)))),this._register(w$((e=>{const t=this.lines.read(e);this.editorOptionsChanged.read(e),t?this.updateLines(t.lineNumber,t.additionalLines,t.minReservedLineCount):this.clear()})))}dispose(){super.dispose(),this.clear()}clear(){this.editor.changeViewZones((e=>{this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0)}))}updateLines(e,t,i){const n=this.editor.getModel();if(!n)return;const{tabSize:o}=n.getOptions();this.editor.changeViewZones((n=>{this._viewZoneId&&(n.removeZone(this._viewZoneId),this._viewZoneId=void 0);const s=Math.max(t.length,i);if(s>0){const i=document.createElement("div");!function(e,t,i,n,o){const s=n.get(33),r=n.get(116),a=n.get(93),l=n.get(51),h=n.get(50),d=n.get(66),c=new Xu(1e4);c.appendString('<div class="suggest-preview-text">');for(let e=0,n=i.length;e<n;e++){const n=i[e],u=n.content;c.appendString('<div class="view-line'),c.appendString('" style="top:'),c.appendString(String(e*d)),c.appendString('px;width:1000000px;">');const g=zn(u),p=Wn(u),m=IC.createEmpty(u,o);tO(new QR(h.isMonospace&&!s,h.canUseHalfwidthRightwardsArrow,u,!1,g,p,0,m,n.decorations,t,0,h.spaceWidth,h.middotWidth,h.wsmiddotWidth,r,"none",a,l!==Lk.OFF,null),c),c.appendString("</div>")}c.appendString("</div>"),Bx(e,h);const u=c.build(),g=j1?j1.createHTML(u):u;e.innerHTML=g}(i,o,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=n.addZone({afterLineNumber:e,heightInLines:s,domNode:i,afterColumnAffinity:1})}}))}}const j1=Tx("editorGhostText",{createHTML:e=>e});class q1{constructor(e){this.lines=e,this.tokenization={getLineTokens:e=>this.lines[e-1]}}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}class $1{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return 95===e||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t,i=0,n=this.value.charCodeAt(e);if(t=$1._table[n],"number"==typeof t)return this.pos+=1,{type:t,pos:e,len:1};if($1.isDigitCharacter(n)){t=8;do{i+=1,n=this.value.charCodeAt(e+i)}while($1.isDigitCharacter(n));return this.pos+=i,{type:t,pos:e,len:i}}if($1.isVariableCharacter(n)){t=9;do{n=this.value.charCodeAt(e+ ++i)}while($1.isVariableCharacter(n)||$1.isDigitCharacter(n));return this.pos+=i,{type:t,pos:e,len:i}}t=10;do{i+=1,n=this.value.charCodeAt(e+i)}while(!isNaN(n)&&void 0===$1._table[n]&&!$1.isDigitCharacter(n)&&!$1.isVariableCharacter(n));return this.pos+=i,{type:t,pos:e,len:i}}}$1._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};class G1{constructor(){this._children=[]}appendChild(e){return e instanceof Z1&&this._children[this._children.length-1]instanceof Z1?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),o=i.children.slice(0);o.splice(n,1,...t),i._children=o,function e(t,i){for(const n of t)n.parent=i,e(n.children,n)}(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof n2)return e;e=e.parent}}toString(){return this.children.reduce(((e,t)=>e+t.toString()),"")}len(){return 0}}class Z1 extends G1{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new Z1(this.value)}}class Y1 extends G1{}class Q1 extends Y1{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return 0===this.index}get choice(){return 1===this._children.length&&this._children[0]instanceof X1?this._children[0]:void 0}clone(){const e=new Q1(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map((e=>e.clone())),e}}class X1 extends G1{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Z1&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new X1;return this.options.forEach(e.appendChild,e),e}}class J1 extends G1{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,(function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))}));return!i&&this._children.some((e=>e instanceof e2&&Boolean(e.elseValue)))&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof e2){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new J1;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map((e=>e.clone())),e}}class e2 extends G1{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return"upcase"===this.shorthandName?e?e.toLocaleUpperCase():"":"downcase"===this.shorthandName?e?e.toLocaleLowerCase():"":"capitalize"===this.shorthandName?e?e[0].toLocaleUpperCase()+e.substr(1):"":"pascalcase"===this.shorthandName?e?this._toPascalCase(e):"":"camelcase"===this.shorthandName?e?this._toCamelCase(e):"":Boolean(e)&&"string"==typeof this.ifValue?this.ifValue:Boolean(e)||"string"!=typeof this.elseValue?e||"":this.elseValue}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((e=>e.charAt(0).toUpperCase()+e.substr(1))).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(((e,t)=>0===t?e.charAt(0).toLowerCase()+e.substr(1):e.charAt(0).toUpperCase()+e.substr(1))).join(""):e}clone(){return new e2(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class t2 extends Y1{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),void 0!==t&&(this._children=[new Z1(t)],!0)}clone(){const e=new t2(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map((e=>e.clone())),e}}function i2(e,t){const i=[...e];for(;i.length>0;){const e=i.shift();if(!t(e))break;i.unshift(...e.children)}}class n2 extends G1{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk((function(i){return i instanceof Q1&&(e.push(i),t=!t||t.index<i.index?i:t),!0})),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let t=0,i=!1;return this.walk((n=>n===e?(i=!0,!1):(t+=n.len(),!0))),i?t:-1}fullLen(e){let t=0;return i2([e],(e=>(t+=e.len(),!0))),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof Q1&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk((t=>(t instanceof t2&&t.resolve(e)&&(this._placeholders=void 0),!0))),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){const e=new n2;return this._children=this.children.map((e=>e.clone())),e}walk(e){i2(this.children,e)}}class o2{constructor(){this._scanner=new $1,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new n2;return this.parseFragment(e,n),this.ensureFinalTabstop(n,null!=i&&i,null!=t&&t),n}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const n=new Map,o=[];t.walk((e=>(e instanceof Q1&&(e.isFinalTabstop?n.set(0,void 0):!n.has(e.index)&&e.children.length>0?n.set(e.index,e.children):o.push(e)),!0)));const s=(e,i)=>{const o=n.get(e.index);if(!o)return;const r=new Q1(e.index);r.transform=e.transform;for(const e of o){const t=e.clone();r.appendChild(t),t instanceof Q1&&n.has(t.index)&&!i.has(t.index)&&(i.add(t.index),s(t,i),i.delete(t.index))}t.replace(e,[r])},r=new Set;for(const e of o)s(e,r);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find((e=>0===e.index))||e.appendChild(new Q1(0)))}_accept(e,t){if(void 0===e||this._token.type===e){const e=!t||this._scanner.tokenText(this._token);return this._token=this._scanner.next(),e}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(14===this._token.type)return!1;if(5===this._token.type){const e=this._scanner.next();if(0!==e.type&&4!==e.type&&5!==e.type)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return!!(t=this._accept(5,!0))&&(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new Z1(t)),!0)}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Q1(Number(t)):new t2(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const n=new Q1(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new Z1("${"+t+":")),n.children.forEach(e.appendChild,e),!0}else{if(!(n.index>0&&this._accept(7)))return this._accept(6)?this._parseTransform(n)?(e.appendChild(n),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(n),!0):this._backTo(i);{const t=new X1;for(;;){if(this._parseChoiceElement(t)){if(this._accept(2))continue;if(this._accept(7)&&(n.appendChild(t),this._accept(4)))return e.appendChild(n),!0}return this._backTo(i),!1}}}}_parseChoiceElement(e){const t=this._token,i=[];for(;2!==this._token.type&&7!==this._token.type;){let e;if(e=(e=this._accept(5,!0))?this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||e:this._accept(void 0,!0),!e)return this._backTo(t),!1;i.push(e)}return 0===i.length?(this._backTo(t),!1):(e.appendChild(new Z1(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const n=new t2(t);if(!this._accept(1))return this._accept(6)?this._parseTransform(n)?(e.appendChild(n),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(n),!0):this._backTo(i);for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new Z1("${"+t+":")),n.children.forEach(e.appendChild,e),!0}}_parseTransform(e){const t=new J1;let i="",n="";for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(6,!0)||e,i+=e;else{if(14===this._token.type)return!1;i+=this._accept(void 0,!0)}}for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(5,!0)||this._accept(6,!0)||e,t.appendChild(new Z1(e));else if(!this._parseFormatString(t)&&!this._parseAnything(t))return!1}for(;!this._accept(4);){if(14===this._token.type)return!1;n+=this._accept(void 0,!0)}try{t.regexp=new RegExp(i,n)}catch(e){return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const n=this._accept(8,!0);if(!n)return this._backTo(t),!1;if(!i)return e.appendChild(new e2(Number(n))),!0;if(this._accept(4))return e.appendChild(new e2(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1;if(this._accept(6)){const i=this._accept(9,!0);return i&&this._accept(4)?(e.appendChild(new e2(Number(n),i)),!0):(this._backTo(t),!1)}if(this._accept(11)){const t=this._until(4);if(t)return e.appendChild(new e2(Number(n),void 0,t,void 0)),!0}else if(this._accept(12)){const t=this._until(4);if(t)return e.appendChild(new e2(Number(n),void 0,void 0,t)),!0}else if(this._accept(13)){const t=this._until(1);if(t){const i=this._until(4);if(i)return e.appendChild(new e2(Number(n),void 0,t,i)),!0}}else{const t=this._until(4);if(t)return e.appendChild(new e2(Number(n),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return 14!==this._token.type&&(e.appendChild(new Z1(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}}async function s2(e,t,i,n,o=Rt.None,s){const r=function(e,t){const i=t.getWordAtPosition(e),n=t.getLineMaxColumn(e.lineNumber);return i?new tc(e.lineNumber,i.startColumn,e.lineNumber,n):tc.fromPositions(e,e.with(void 0,n))}(t,i),a=e.all(i),l=new sa;for(const e of a)e.groupId&&l.add(e.groupId,e);function h(e){if(!e.yieldsToGroupIds)return[];const t=[];for(const i of e.yieldsToGroupIds||[]){const e=l.get(i);for(const i of e)t.push(i)}return t}const c=new Map,u=new Set;function g(e,t){if(t=[...t,e],u.has(e))return t;u.add(e);try{const i=h(e);for(const e of i){const i=g(e,t);if(i)return i}}finally{u.delete(e)}}function p(e){const s=c.get(e);if(s)return s;const r=g(e,[]);r&&d(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${r.map((e=>e.toString?e.toString():""+e)).join(" -> ")}`));const a=new ei;return c.set(e,a.p),(async()=>{if(!r){const t=h(e);for(const e of t){const t=await p(e);if(t&&t.items.length>0)return}}try{return await e.provideInlineCompletions(i,t,n,o)}catch(e){return void d(e)}})().then((e=>a.complete(e)),(e=>a.error(e))),a.p}const m=await Promise.all(a.map((async e=>({provider:e,completions:await p(e)})))),f=new Map,_=[];for(const e of m){const t=e.completions;if(!t)continue;const n=new a2(t,e.provider);_.push(n);for(const e of t.items){const t=l2.from(e,n,r,i,s);f.set(t.hash(),t)}}return new r2(Array.from(f.values()),new Set(f.keys()),_)}class r2{constructor(e,t,i){this.completions=e,this.hashs=t,this.providerResults=i}has(e){return this.hashs.has(e.hash())}dispose(){for(const e of this.providerResults)e.removeRef()}}class a2{constructor(e,t){this.inlineCompletions=e,this.provider=t,this.refCount=1}addRef(){this.refCount++}removeRef(){this.refCount--,0===this.refCount&&this.provider.freeInlineCompletions(this.inlineCompletions)}}class l2{static from(e,t,i,n,o){let s,r,a=e.range?tc.lift(e.range):i;if("string"==typeof e.insertText){if(s=e.insertText,o&&e.completeBracketPairs){s=h2(s,a.getStartPosition(),n,o);const t=s.length-e.insertText.length;0!==t&&(a=new tc(a.startLineNumber,a.startColumn,a.endLineNumber,a.endColumn+t))}r=void 0}else if("snippet"in e.insertText){const t=e.insertText.snippet.length;if(o&&e.completeBracketPairs){e.insertText.snippet=h2(e.insertText.snippet,a.getStartPosition(),n,o);const i=e.insertText.snippet.length-t;0!==i&&(a=new tc(a.startLineNumber,a.startColumn,a.endLineNumber,a.endColumn+i))}const i=(new o2).parse(e.insertText.snippet);1===i.children.length&&i.children[0]instanceof Z1?(s=i.children[0].value,r=void 0):(s=i.toString(),r={snippet:e.insertText.snippet,range:a})}else ud(e.insertText);return new l2(s,e.command,a,s,r,e.additionalTextEdits||R1,e,t)}constructor(e,t,i,n,o,s,r,a){this.filterText=e,this.command=t,this.range=i,this.insertText=n,this.snippetInfo=o,this.additionalTextEdits=s,this.sourceInlineCompletion=r,this.source=a,n=(e=e.replace(/\r\n|\r/g,"\n")).replace(/\r\n|\r/g,"\n")}withRange(e){return new l2(this.filterText,this.command,e,this.insertText,this.snippetInfo,this.additionalTextEdits,this.sourceInlineCompletion,this.source)}hash(){return JSON.stringify({insertText:this.insertText,range:this.range.toString()})}}function h2(e,t,i,n){const o=i.getLineContent(t.lineNumber).substring(0,t.column-1)+e,s=i.tokenization.tokenizeLineWithEdit(t,o.length-(t.column-1),e),r=null==s?void 0:s.sliceAndInflate(t.column-1,o.length,0);if(!r)return e;const a=function(e,t){const i=new Tp,n=new Qp(i,(e=>t.getLanguageConfiguration(e))),o=om(new $p(new q1([e]),n),[],void 0,!0);let s="";const r=e.getLineContent();return function e(t,i){if(2===t.kind)if(e(t.openingBracket,i),i=_p(i,t.openingBracket.length),t.child&&(e(t.child,i),i=_p(i,t.child.length)),t.closingBracket)e(t.closingBracket,i),i=_p(i,t.closingBracket.length);else{const e=n.getSingleLanguageBracketTokens(t.openingBracket.languageId).findClosingTokenText(t.openingBracket.bracketIds);s+=e}else if(3===t.kind);else if(0===t.kind||1===t.kind)s+=r.substring(i,_p(i,t.length));else if(4===t.kind)for(const n of t.children)e(n,i),i=_p(i,n.length)}(o,up),s}(r,n);return a}class d2{constructor(e,t){this.range=e,this.text=t}removeCommonPrefix(e,t){const i=t?this.range.intersectRanges(t):this.range;if(!i)return this;const n=e.getValueInRange(i,1),o=En(n,this.text),s=P1(this.range.getStartPosition(),F1(n.substring(0,o))),r=this.text.substring(o),a=tc.fromPositions(s,this.range.getEndPosition());return new d2(a,r)}augments(e){return this.text.startsWith(e.text)&&(t=this.range,(i=e.range).getStartPosition().equals(t.getStartPosition())&&i.getEndPosition().isBeforeOrEqual(t.getEndPosition()));var t,i}computeGhostText(e,t,i,n=0){let o=this.removeCommonPrefix(e);if(o.range.endLineNumber!==o.range.startLineNumber)return;const s=e.getLineContent(o.range.startLineNumber),r=_n(s).length;if(o.range.startColumn-1<=r){const e=_n(o.text).length,t=s.substring(o.range.startColumn-1,r),[i,n]=[o.range.getStartPosition(),o.range.getEndPosition()],a=i.column+t.length<=n.column?i.delta(0,t.length):n,l=tc.fromPositions(a,n),h=o.text.startsWith(t)?o.text.substring(t.length):o.text.substring(e);o=new d2(l,h)}const a=e.getValueInRange(o.range),l=function(e,t){if((null==c2?void 0:c2.originalValue)===e&&(null==c2?void 0:c2.newValue)===t)return null==c2?void 0:c2.changes;{let i=g2(e,t,!0);if(i){const n=u2(i);if(n>0){const o=g2(e,t,!1);o&&u2(o)<n&&(i=o)}}return c2={originalValue:e,newValue:t,changes:i},i}}(a,o.text);if(!l)return;const h=o.range.startLineNumber,d=new Array;if("prefix"===t){const e=l.filter((e=>0===e.originalLength));if(e.length>1||1===e.length&&e[0].originalStart!==a.length)return}const c=o.text.length-n;for(const e of l){const n=o.range.startColumn+e.originalStart+e.originalLength;if("subwordSmart"===t&&i&&i.lineNumber===o.range.startLineNumber&&n<i.column)return;if(e.originalLength>0)return;if(0===e.modifiedLength)continue;const s=e.modifiedStart+e.modifiedLength,r=Math.max(e.modifiedStart,Math.min(s,c)),a=o.text.substring(e.modifiedStart,r),l=o.text.substring(r,Math.max(e.modifiedStart,s));if(a.length>0){const e=mn(a);d.push(new W1(n,e,!1))}if(l.length>0){const e=mn(l);d.push(new W1(n,e,!0))}}return new B1(h,d)}}let c2;function u2(e){let t=0;for(const i of e)t+=i.originalLength;return t}function g2(e,t,i){if(e.length>5e3||t.length>5e3)return;function n(e){let t=0;for(let i=0,n=e.length;i<n;i++){const n=e.charCodeAt(i);n>t&&(t=n)}return t}const o=Math.max(n(e),n(t));function s(e){if(e<0)throw new Error("unexpected");return o+e+1}function r(e){let t=0,n=0;const o=new Int32Array(e.length);for(let r=0,a=e.length;r<a;r++)if(i&&"("===e[r]){const e=100*n+t;o[r]=s(2*e),t++}else if(i&&")"===e[r]){t=Math.max(t-1,0);const e=100*n+t;o[r]=s(2*e+1),0===t&&n++}else o[r]=e.charCodeAt(r);return o}const a=r(e),l=r(t);return new ZI({getElements:()=>a},{getElements:()=>l}).ComputeDiff(!1).changes}var p2=function(e,t){return function(i,n){t(i,n,e)}};let m2=class extends T{constructor(e,t,i,n,o){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=n,this.languageConfigurationService=o,this._updateOperation=this._register(new A),this.inlineCompletions=u$("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=u$("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent((()=>{this._updateOperation.clear()})))}fetch(e,t,i){var n,o;const s=new f2(e,t,this.textModel.getVersionId()),r=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(null===(n=this._updateOperation.value)||void 0===n?void 0:n.request.satisfies(s))return this._updateOperation.value.promise;if(null===(o=r.get())||void 0===o?void 0:o.request.satisfies(s))return Promise.resolve(!0);const a=!!this._updateOperation.value;this._updateOperation.clear();const l=new Pt,h=(async()=>{var n;if((a||t.triggerKind===gC.Automatic)&&await(n=this._debounceValue.get(this.textModel),new Promise((e=>{let t;setTimeout((()=>{t&&t.dispose(),e()}),n)}))),l.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const o=new Date,h=await s2(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,l.token,this.languageConfigurationService);if(l.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const d=new Date;this._debounceValue.update(this.textModel,d.getTime()-o.getTime());const c=new v2(h,s,this.textModel,this.versionId);if(i){const t=i.toInlineCompletion(void 0);i.canBeReused(this.textModel,e)&&!h.has(t)&&c.prepend(i.inlineCompletion,t.range,!0)}return this._updateOperation.clear(),e$((e=>{r.set(c,e)})),!0})(),d=new _2(s,l,h);return this._updateOperation.value=d,h}clear(e){this._updateOperation.clear(),this.inlineCompletions.set(void 0,e),this.suggestWidgetInlineCompletions.set(void 0,e)}clearSuggestWidgetInlineCompletions(e){var t;(null===(t=this._updateOperation.value)||void 0===t?void 0:t.request.context.selectedSuggestionInfo)&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};m2=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([p2(3,Jk),p2(4,Yg)],m2);class f2{constructor(e,t,i){this.position=e,this.context=t,this.versionId=i}satisfies(e){return this.position.equals(e.position)&&(t=this.context.selectedSuggestionInfo,i=e.context.selectedSuggestionInfo,t&&i?((e,t)=>e.equals(t))(t,i):t===i)&&(e.context.triggerKind===gC.Automatic||this.context.triggerKind===gC.Explicit)&&this.versionId===e.versionId;var t,i}}class _2{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class v2{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,i,n){this.inlineCompletionProviderResult=e,this.request=t,this.textModel=i,this.versionId=n,this._refCount=1,this._prependedInlineCompletionItems=[],this._rangeVersionIdValue=0,this._rangeVersionId=m$(this,(e=>{this.versionId.read(e);let t=!1;for(const e of this._inlineCompletions)t=t||e._updateRange(this.textModel);return t&&this._rangeVersionIdValue++,this._rangeVersionIdValue}));const o=i.deltaDecorations([],e.completions.map((e=>({range:e.range,options:{description:"inline-completion-tracking-range"}}))));this._inlineCompletions=e.completions.map(((e,t)=>new b2(e,o[t],this._rangeVersionId)))}clone(){return this._refCount++,this}dispose(){if(this._refCount--,0===this._refCount){setTimeout((()=>{this.textModel.isDisposed()||this.textModel.deltaDecorations(this._inlineCompletions.map((e=>e.decorationId)),[])}),0),this.inlineCompletionProviderResult.dispose();for(const e of this._prependedInlineCompletionItems)e.source.removeRef()}}prepend(e,t,i){i&&e.source.addRef();const n=this.textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new b2(e,n,this._rangeVersionId,t)),this._prependedInlineCompletionItems.push(e)}}class b2{get forwardStable(){var e;return null!==(e=this.inlineCompletion.source.inlineCompletions.enableForwardStability)&&void 0!==e&&e}constructor(e,t,i,n){this.inlineCompletion=e,this.decorationId=t,this.rangeVersion=i,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._isValid=!0,this._updatedRange=null!=n?n:e.range}toInlineCompletion(e){return this.inlineCompletion.withRange(this._getUpdatedRange(e))}toSingleTextEdit(e){return new d2(this._getUpdatedRange(e),this.inlineCompletion.insertText)}isVisible(e,t,i){const n=this._toFilterTextReplacement(i).removeCommonPrefix(e);if(!this._isValid||!this.inlineCompletion.range.getStartPosition().equals(this._getUpdatedRange(i).getStartPosition())||t.lineNumber!==n.range.startLineNumber)return!1;const o=e.getValueInRange(n.range,1),s=n.text,r=Math.max(0,t.column-n.range.startColumn);let a=s.substring(0,r),l=s.substring(r),h=o.substring(0,r),d=o.substring(r);const c=e.getLineIndentColumn(n.range.startLineNumber);return n.range.startColumn<=c&&(h=h.trimStart(),0===h.length&&(d=d.trimStart()),a=a.trimStart(),0===a.length&&(l=l.trimStart())),a.startsWith(h)&&!!_a(d,l)}canBeReused(e,t){return this._isValid&&this._getUpdatedRange(void 0).containsPosition(t)&&this.isVisible(e,t,void 0)&&!this._isSmallerThanOriginal(void 0)}_toFilterTextReplacement(e){return new d2(this._getUpdatedRange(e),this.inlineCompletion.filterText)}_isSmallerThanOriginal(e){return w2(this._getUpdatedRange(e)).isBefore(w2(this.inlineCompletion.range))}_getUpdatedRange(e){return this.rangeVersion.read(e),this._updatedRange}_updateRange(e){const t=e.getDecorationRange(this.decorationId);return t?!this._updatedRange.equalsRange(t)&&(this._updatedRange=t,!0):(this._isValid=!1,!0)}}function w2(e){return e.startLineNumber===e.endLineNumber?new ch(1,1+e.endColumn-e.startColumn):new ch(1+e.endLineNumber-e.startLineNumber,e.endColumn)}const C2={Visible:OX,HasFocusedSuggestion:new od("suggestWidgetHasFocusedSuggestion",!1,me(0,"Whether any suggestion is focused")),DetailsVisible:new od("suggestWidgetDetailsVisible",!1,me(0,"Whether suggestion details are visible")),MultipleSuggestions:new od("suggestWidgetMultipleSuggestions",!1,me(0,"Whether there are multiple suggestions to pick from")),MakesTextEdit:new od("suggestionMakesTextEdit",!0,me(0,"Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new od("acceptSuggestionOnEnter",!0,me(0,"Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new od("suggestionHasInsertAndReplaceRange",!1,me(0,"Whether the current suggestion has insert and replace behaviour")),InsertMode:new od("suggestionInsertMode",void 0,{type:"string",description:me(0,"Whether the default behaviour is to insert or replace")}),CanResolve:new od("suggestionCanResolve",!1,me(0,"Whether the current suggestion supports to resolve further details"))},y2=new yd("suggestWidgetStatusBar");class S2{constructor(e,t,i,n){var o;this.position=e,this.completion=t,this.container=i,this.provider=n,this.isInvalid=!1,this.score=tl.Default,this.distance=0,this.textLabel="string"==typeof t.label?t.label:null===(o=t.label)||void 0===o?void 0:o.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,tc.isIRange(t.range)?(this.editStart=new ch(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new ch(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new ch(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||tc.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new ch(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new ch(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new ch(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||tc.spansMultipleLines(t.range.insert)||tc.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),"function"!=typeof n.resolveCompletionItem&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return void 0!==this._resolveDuration}get resolveDuration(){return void 0!==this._resolveDuration?this._resolveDuration:-1}async resolve(e){if(!this._resolveCache){const t=e.onCancellationRequested((()=>{this._resolveCache=void 0,this._resolveDuration=void 0})),i=new V(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then((e=>{Object.assign(this.completion,e),this._resolveDuration=i.elapsed()}),(e=>{g(e)&&(this._resolveCache=void 0,this._resolveDuration=void 0)})).finally((()=>{t.dispose()}))}return this._resolveCache}}class k2{constructor(e=2,t=new Set,i=new Set,n=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=n,this.showDeprecated=o}}k2.default=new k2;class L2{constructor(e,t,i,n){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=n}}async function x2(e,t,i,n=k2.default,o={triggerKind:0},s=Rt.None){const r=new V;i=i.clone();const a=t.getWordAtPosition(i),l=a?new tc(i.lineNumber,a.startColumn,i.lineNumber,a.endColumn):tc.fromPositions(i),h={replace:l,insert:l.setEndPosition(i.lineNumber,i.column)},c=[],u=new M,g=[];let m=!1;const f=(e,t,o)=>{var s,r,a;let l=!1;if(!t)return l;for(const o of t.suggestions)if(!n.kindFilter.has(o.kind)){if(!n.showDeprecated&&(null===(s=null==o?void 0:o.tags)||void 0===s?void 0:s.includes(1)))continue;o.range||(o.range=h),o.sortText||(o.sortText="string"==typeof o.label?o.label:o.label.label),!m&&o.insertTextRules&&4&o.insertTextRules&&(m=o2.guessNeedsClipboard(o.insertText)),c.push(new S2(i,o,t,e)),l=!0}return D(t)&&u.add(t),g.push({providerName:null!==(r=e._debugDisplayName)&&void 0!==r?r:"unknown_provider",elapsedProvider:null!==(a=t.duration)&&void 0!==a?a:-1,elapsedOverall:o.elapsed()}),l},_=(async()=>{})();for(const r of e.orderedGroups(t)){let e=!1;if(await Promise.all(r.map((async r=>{if(n.providerItemsToReuse.has(r)){const t=n.providerItemsToReuse.get(r);return t.forEach((e=>c.push(e))),void(e=e||t.length>0)}if(!(n.providerFilter.size>0)||n.providerFilter.has(r))try{const n=new V,a=await r.provideCompletionItems(t,i,o,s);e=f(r,a,n)||e}catch(e){d(e)}}))),e||s.isCancellationRequested)break}return await _,s.isCancellationRequested?(u.dispose(),Promise.reject(new p)):new L2(c.sort((v=n.snippetSortOrder,E2.get(v))),m,{entries:g,elapsed:r.elapsed()},u);var v}function D2(e,t){if(e.sortTextLow&&t.sortTextLow){if(e.sortTextLow<t.sortTextLow)return-1;if(e.sortTextLow>t.sortTextLow)return 1}return e.textLabel<t.textLabel?-1:e.textLabel>t.textLabel?1:e.completion.kind-t.completion.kind}const E2=new Map;E2.set(0,(function(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return-1;if(27===t.completion.kind)return 1}return D2(e,t)})),E2.set(2,(function(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return 1;if(27===t.completion.kind)return-1}return D2(e,t)})),E2.set(1,D2),Ch.registerCommand("_executeCompletionItemProvider",(async(e,...t)=>{const[i,n,o,s]=t;fl(Ro.isUri(i)),fl(ch.isIPosition(n)),fl("string"==typeof o||!o),fl("number"==typeof s||!s);const{completionProvider:r}=e.get(Jk),a=await e.get(gh).createModelReference(i);try{const e={incomplete:!1,suggestions:[]},t=[],i=a.object.textEditorModel.validatePosition(n),l=await x2(r,a.object.textEditorModel,i,void 0,{triggerCharacter:null!=o?o:void 0,triggerKind:o?1:0});for(const i of l.items)t.length<(null!=s?s:0)&&t.push(i.resolve(Rt.None)),e.incomplete=e.incomplete||i.container.incomplete,e.suggestions.push(i.completion);try{return await Promise.all(t),e}finally{setTimeout((()=>l.disposable.dispose()),100)}}finally{a.dispose()}}));class N2{static isAllOff(e){return"off"===e.other&&"off"===e.comments&&"off"===e.strings}static isAllOn(e){return"on"===e.other&&"on"===e.comments&&"on"===e.strings}static valueFor(e,t){switch(t){case 1:return e.comments;case 2:return e.strings;default:return e.other}}}var I2=i(5756),M2={};function T2(e,t=We){return function(e,t=We){return!!t&&Bl(e.charCodeAt(0))&&58===e.charCodeAt(1)}(e,t)?e.charAt(0).toUpperCase()+e.slice(1):e}M2.styleTagTransform=Vr(),M2.setAttributes=Pr(),M2.insert=Rr().bind(null,"head"),M2.domAPI=Tr(),M2.insertStyleElement=Br(),Ir()(I2.Z,M2),I2.Z&&I2.Z.locals&&I2.Z.locals,Object.create(null);Object.freeze({CURRENT_YEAR:!0,CURRENT_YEAR_SHORT:!0,CURRENT_MONTH:!0,CURRENT_DATE:!0,CURRENT_HOUR:!0,CURRENT_MINUTE:!0,CURRENT_SECOND:!0,CURRENT_DAY_NAME:!0,CURRENT_DAY_NAME_SHORT:!0,CURRENT_MONTH_NAME:!0,CURRENT_MONTH_NAME_SHORT:!0,CURRENT_SECONDS_UNIX:!0,CURRENT_TIMEZONE_OFFSET:!0,SELECTION:!0,CLIPBOARD:!0,TM_SELECTED_TEXT:!0,TM_CURRENT_LINE:!0,TM_CURRENT_WORD:!0,TM_LINE_INDEX:!0,TM_LINE_NUMBER:!0,TM_FILENAME:!0,TM_FILENAME_BASE:!0,TM_DIRECTORY:!0,TM_FILEPATH:!0,CURSOR_INDEX:!0,CURSOR_NUMBER:!0,RELATIVE_FILEPATH:!0,BLOCK_COMMENT_START:!0,BLOCK_COMMENT_END:!0,LINE_COMMENT:!0,WORKSPACE_NAME:!0,WORKSPACE_FOLDER:!0,RANDOM:!0,RANDOM_HEX:!0,UUID:!0});class A2{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(void 0!==i)return i}}}class R2{constructor(e,t,i,n){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=n}resolve(e){const{name:t}=e;if("SELECTION"===t||"TM_SELECTED_TEXT"===t){let t=this._model.getValueInRange(this._selection)||void 0,i=this._selection.startLineNumber!==this._selection.endLineNumber;if(!t&&this._overtypingCapturer){const e=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);e&&(t=e.value,i=e.multiline)}if(t&&i&&e.snippet){const i=_n(this._model.getLineContent(this._selection.startLineNumber),0,this._selection.startColumn-1);let n=i;e.snippet.walk((t=>t!==e&&(t instanceof Z1&&(n=_n(mn(t.value).pop())),!0)));const o=En(n,i);t=t.replace(/(\r\n|\r|\n)(.*)/g,((e,t,i)=>`${t}${n.substr(o)}${i}`))}return t}if("TM_CURRENT_LINE"===t)return this._model.getLineContent(this._selection.positionLineNumber);if("TM_CURRENT_WORD"===t){const e=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return e&&e.word||void 0}return"TM_LINE_INDEX"===t?String(this._selection.positionLineNumber-1):"TM_LINE_NUMBER"===t?String(this._selection.positionLineNumber):"CURSOR_INDEX"===t?String(this._selectionIdx):"CURSOR_NUMBER"===t?String(this._selectionIdx+1):void 0}}class O2{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if("TM_FILENAME"===t)return Lo(this._model.uri.fsPath);if("TM_FILENAME_BASE"===t){const e=Lo(this._model.uri.fsPath),t=e.lastIndexOf(".");return t<=0?e:e.slice(0,t)}return"TM_DIRECTORY"===t?"."===ko(this._model.uri.fsPath)?"":this._labelService.getUriLabel(ql(this._model.uri)):"TM_FILEPATH"===t?this._labelService.getUriLabel(this._model.uri):"RELATIVE_FILEPATH"===t?this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0}):void 0}}class P2{constructor(e,t,i,n){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=n}resolve(e){if("CLIPBOARD"!==e.name)return;const t=this._readClipboardText();if(t){if(this._spread){const e=t.split(/\r\n|\n|\r/).filter((e=>!rn(e)));if(e.length===this._selectionCount)return e[this._selectionIdx]}return t}}}let F2=class{constructor(e,t,i){this._model=e,this._selection=t,this._languageConfigurationService=i}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),n=this._languageConfigurationService.getLanguageConfiguration(i).comments;if(n)return"LINE_COMMENT"===t?n.lineCommentToken||void 0:"BLOCK_COMMENT_START"===t?n.blockCommentStartToken||void 0:"BLOCK_COMMENT_END"===t&&n.blockCommentEndToken||void 0}};F2=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(2,Yg)],F2);class B2{constructor(){this._date=new Date}resolve(e){const{name:t}=e;if("CURRENT_YEAR"===t)return String(this._date.getFullYear());if("CURRENT_YEAR_SHORT"===t)return String(this._date.getFullYear()).slice(-2);if("CURRENT_MONTH"===t)return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if("CURRENT_DATE"===t)return String(this._date.getDate().valueOf()).padStart(2,"0");if("CURRENT_HOUR"===t)return String(this._date.getHours().valueOf()).padStart(2,"0");if("CURRENT_MINUTE"===t)return String(this._date.getMinutes().valueOf()).padStart(2,"0");if("CURRENT_SECOND"===t)return String(this._date.getSeconds().valueOf()).padStart(2,"0");if("CURRENT_DAY_NAME"===t)return B2.dayNames[this._date.getDay()];if("CURRENT_DAY_NAME_SHORT"===t)return B2.dayNamesShort[this._date.getDay()];if("CURRENT_MONTH_NAME"===t)return B2.monthNames[this._date.getMonth()];if("CURRENT_MONTH_NAME_SHORT"===t)return B2.monthNamesShort[this._date.getMonth()];if("CURRENT_SECONDS_UNIX"===t)return String(Math.floor(this._date.getTime()/1e3));if("CURRENT_TIMEZONE_OFFSET"===t){const e=this._date.getTimezoneOffset(),t=e>0?"-":"+",i=Math.trunc(Math.abs(e/60)),n=i<10?"0"+i:i,o=Math.abs(e)-60*i;return t+n+":"+(o<10?"0"+o:o)}}}B2.dayNames=[me(0,"Sunday"),me(0,"Monday"),me(0,"Tuesday"),me(0,"Wednesday"),me(0,"Thursday"),me(0,"Friday"),me(0,"Saturday")],B2.dayNamesShort=[me(0,"Sun"),me(0,"Mon"),me(0,"Tue"),me(0,"Wed"),me(0,"Thu"),me(0,"Fri"),me(0,"Sat")],B2.monthNames=[me(0,"January"),me(0,"February"),me(0,"March"),me(0,"April"),me(0,"May"),me(0,"June"),me(0,"July"),me(0,"August"),me(0,"September"),me(0,"October"),me(0,"November"),me(0,"December")],B2.monthNamesShort=[me(0,"Jan"),me(0,"Feb"),me(0,"Mar"),me(0,"Apr"),me(0,"May"),me(0,"Jun"),me(0,"Jul"),me(0,"Aug"),me(0,"Sep"),me(0,"Oct"),me(0,"Nov"),me(0,"Dec")];class W2{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=function(e,t){if("string"==typeof e||void 0===e)return"string"==typeof e?{id:Lo(e)}:IG;const i=e;return i.configuration?{id:i.id,configPath:i.configuration}:1===i.folders.length?{id:i.id,uri:i.folders[0].uri}:{id:i.id}}(this._workspaceService.getWorkspace());return"string"!=typeof(null==(i=t)?void 0:i.id)||NG(i)||function(e){const t=e;return"string"==typeof(null==t?void 0:t.id)&&Ro.isUri(t.configPath)}(i)?"WORKSPACE_NAME"===e.name?this._resolveWorkspaceName(t):"WORKSPACE_FOLDER"===e.name?this._resoveWorkspacePath(t):void 0:void 0;var i}_resolveWorkspaceName(e){if(NG(e))return Lo(e.uri.path);let t=Lo(e.configPath.path);return t.endsWith("code-workspace")&&(t=t.substr(0,t.length-14-1)),t}_resoveWorkspacePath(e){if(NG(e))return T2(e.uri.fsPath);const t=Lo(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?T2(i):"/"}}class V2{resolve(e){const{name:t}=e;return"RANDOM"===t?Math.random().toString().slice(-6):"RANDOM_HEX"===t?Math.random().toString(16).slice(-6):"UUID"===t?$Y():void 0}}var z2;class H2{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=Ac(t.placeholders,Q1.compareByIndex),this._placeholderGroupsIdx=-1}initialize(e){this._offset=e.newPosition}dispose(){this._placeholderDecorations&&this._editor.removeDecorations([...this._placeholderDecorations.values()]),this._placeholderGroups.length=0}_initDecorations(){if(-1===this._offset)throw new Error("Snippet not initialized!");if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations((t=>{for(const i of this._snippet.placeholders){const n=this._snippet.offset(i),o=this._snippet.fullLen(i),s=tc.fromPositions(e.getPositionAt(this._offset+n),e.getPositionAt(this._offset+n+o)),r=i.isFinalTabstop?H2._decor.inactiveFinal:H2._decor.inactive,a=t.addDecoration(s,r);this._placeholderDecorations.set(i,a)}}))}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const e=[];for(const t of this._placeholderGroups[this._placeholderGroupsIdx])if(t.transform){const i=this._placeholderDecorations.get(t),n=this._editor.getModel().getDecorationRange(i),o=this._editor.getModel().getValueInRange(n),s=t.transform.resolve(o).split(/\r\n|\r|\n/);for(let e=1;e<s.length;e++)s[e]=this._editor.getModel().normalizeIndentation(this._snippetLineLeadingWhitespace+s[e]);e.push(vG.replace(n,s.join(this._editor.getModel().getEOL())))}e.length>0&&this._editor.executeEdits("snippet.placeholderTransform",e)}let t=!1;!0===e&&this._placeholderGroupsIdx<this._placeholderGroups.length-1?(this._placeholderGroupsIdx+=1,t=!0):!1===e&&this._placeholderGroupsIdx>0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations((e=>{const i=new Set,n=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx]){const s=this._placeholderDecorations.get(o),r=this._editor.getModel().getDecorationRange(s);n.push(new ic(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(o),e.changeDecorationOptions(s,o.isFinalTabstop?H2._decor.activeFinal:H2._decor.active),i.add(o);for(const t of this._snippet.enclosingPlaceholders(o)){const n=this._placeholderDecorations.get(t);e.changeDecorationOptions(n,t.isFinalTabstop?H2._decor.activeFinal:H2._decor.active),i.add(t)}}for(const[t,n]of this._placeholderDecorations)i.has(t)||e.changeDecorationOptions(n,t.isFinalTabstop?H2._decor.inactiveFinal:H2._decor.inactive);return n}));return t?this.move(e):null!=i?i:[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof Q1){const e=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(e).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||0===this._placeholderGroups.length}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(0===this._snippet.placeholders.length)return!0;if(1===this._snippet.placeholders.length){const[e]=this._snippet.placeholders;if(e.isFinalTabstop&&this._snippet.rightMostDescendant===e)return!0}return!1}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let i;for(const n of t){if(n.isFinalTabstop)break;i||(i=[],e.set(n.index,i));const t=this._placeholderDecorations.get(n),o=this._editor.getModel().getDecorationRange(t);if(!o){e.delete(n.index);break}i.push(o)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!(null==e?void 0:e.choice))return;const t=this._placeholderDecorations.get(e);if(!t)return;const i=this._editor.getModel().getDecorationRange(t);return i?{range:i,choice:e.choice}:void 0}get hasChoice(){let e=!1;return this._snippet.walk((t=>(e=t instanceof X1,!e))),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations((i=>{for(const n of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(-1!==o._offset),console.assert(!o._placeholderDecorations);const s=o._snippet.placeholderInfo.last.index;for(const e of o._snippet.placeholderInfo.all)e.isFinalTabstop?e.index=n.index+(s+1)/this._nestingLevel:e.index=n.index+e.index/this._nestingLevel;this._snippet.replace(n,o._snippet.children);const r=this._placeholderDecorations.get(n);i.removeDecoration(r),this._placeholderDecorations.delete(n);for(const e of o._snippet.placeholders){const n=o._snippet.offset(e),s=o._snippet.fullLen(e),r=tc.fromPositions(t.getPositionAt(o._offset+n),t.getPositionAt(o._offset+n+s)),a=i.addDecoration(r,H2._decor.inactive);this._placeholderDecorations.set(e,a)}}this._placeholderGroups=Ac(this._snippet.placeholders,Q1.compareByIndex)}))}}H2._decor={active:Sy.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:Sy.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:Sy.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:Sy.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const U2={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let K2=z2=class{static adjustWhitespace(e,t,i,n,o){const s=_n(e.getLineContent(t.lineNumber),0,t.column-1);let r;return n.walk((t=>{if(!(t instanceof Z1)||t.parent instanceof X1)return!0;if(o&&!o.has(t))return!0;const a=t.value.split(/\r\n|\r|\n/);if(i){const i=n.offset(t);if(0===i)a[0]=e.normalizeIndentation(a[0]);else{r=null!=r?r:n.toString();const t=r.charCodeAt(i-1);10!==t&&13!==t||(a[0]=e.normalizeIndentation(s+a[0]))}for(let t=1;t<a.length;t++)a[t]=e.normalizeIndentation(s+a[t])}const l=a.join(e.getEOL());return l!==t.value&&(t.parent.replace(t,[new Z1(l)]),r=void 0),!0})),s}static adjustSelection(e,t,i,n){if(0!==i||0!==n){const{positionLineNumber:o,positionColumn:s}=t,r=s-i,a=s+n,l=e.validateRange({startLineNumber:o,startColumn:r,endLineNumber:o,endColumn:a});t=ic.createWithDirection(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn,t.getDirection())}return t}static createEditsAndSnippetsFromSelections(e,t,i,n,o,s,r,a,l){const h=[],d=[];if(!e.hasModel())return{edits:h,snippets:d};const c=e.getModel(),u=e.invokeWithinContext((e=>e.get(EG))),g=e.invokeWithinContext((e=>new O2(e.get(IK),c))),p=()=>r,m=c.getValueInRange(z2.adjustSelection(c,e.getSelection(),i,0)),f=c.getValueInRange(z2.adjustSelection(c,e.getSelection(),0,n)),_=c.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),v=e.getSelections().map(((e,t)=>({selection:e,idx:t}))).sort(((e,t)=>tc.compareRangesUsingStarts(e.selection,t.selection)));for(const{selection:r,idx:b}of v){let w=z2.adjustSelection(c,r,i,0),C=z2.adjustSelection(c,r,0,n);m!==c.getValueInRange(w)&&(w=r),f!==c.getValueInRange(C)&&(C=r);const y=r.setStartPosition(w.startLineNumber,w.startColumn).setEndPosition(C.endLineNumber,C.endColumn),S=(new o2).parse(t,!0,o),k=y.getStartPosition(),L=z2.adjustWhitespace(c,k,s||b>0&&_!==c.getLineFirstNonWhitespaceColumn(r.positionLineNumber),S);S.resolveVariables(new A2([g,new P2(p,b,v.length,"spread"===e.getOption(78)),new R2(c,r,b,a),new F2(c,r,l),new B2,new W2(u),new V2])),h[b]=vG.replace(y,S.toString()),h[b].identifier={major:b,minor:0},h[b]._isTracked=!0,d[b]=new H2(e,S,L)}return{edits:h,snippets:d}}static createEditsAndSnippetsFromEdits(e,t,i,n,o,s,r){if(!e.hasModel()||0===t.length)return{edits:[],snippets:[]};const a=[],l=e.getModel(),h=new o2,d=new n2,c=new A2([e.invokeWithinContext((e=>new O2(e.get(IK),l))),new P2((()=>o),0,e.getSelections().length,"spread"===e.getOption(78)),new R2(l,e.getSelection(),0,s),new F2(l,e.getSelection(),r),new B2,new W2(e.invokeWithinContext((e=>e.get(EG)))),new V2]);t=t.sort(((e,t)=>tc.compareRangesUsingStarts(e.range,t.range)));let u=0;for(let e=0;e<t.length;e++){const{range:i,template:n}=t[e];if(e>0){const n=t[e-1].range,o=tc.fromPositions(n.getEndPosition(),i.getStartPosition()),s=new Z1(l.getValueInRange(o));d.appendChild(s),u+=s.value.length}const o=h.parseFragment(n,d);z2.adjustWhitespace(l,i.getStartPosition(),!0,d,new Set(o)),d.resolveVariables(c);const s=d.toString(),r=s.slice(u);u=s.length;const g=vG.replace(i,r);g.identifier={major:e,minor:0},g._isTracked=!0,a.push(g)}return h.ensureFinalTabstop(d,i,!0),{edits:a,snippets:[new H2(e,d,"")]}}constructor(e,t,i=U2,n){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=n,this._templateMerges=[],this._snippets=[]}dispose(){E(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}="string"==typeof this._template?z2.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):z2.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=t,this._editor.executeEdits("snippet",e,(e=>{const i=e.filter((e=>!!e.identifier));for(let e=0;e<t.length;e++)t[e].initialize(i[e].textChange);return this._snippets[0].hasPlaceholder?this._move(!0):i.map((e=>ic.fromPositions(e.range.getEndPosition())))})),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=U2){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:n}=z2.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,(e=>{const t=e.filter((e=>!!e.identifier));for(let e=0;e<n.length;e++)n[e].initialize(t[e].textChange);const i=n[0].isTrivialSnippet;if(!i){for(const e of this._snippets)e.merge(n);console.assert(0===n.length)}return this._snippets[0].hasPlaceholder&&!i?this._move(void 0):t.map((e=>ic.fromPositions(e.range.getEndPosition())))}))}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const i of this._snippets){const n=i.move(e);t.push(...n)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get hasChoice(){return this._snippets[0].hasChoice}get activeChoice(){return this._snippets[0].activeChoice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length<this._snippets.length)return!1;const t=new Map;for(const i of this._snippets){const n=i.computePossibleSelections();if(0===t.size)for(const[i,o]of n){o.sort(tc.compareRangesUsingStarts);for(const n of e)if(o[0].containsRange(n)){t.set(i,[]);break}}if(0===t.size)return!1;t.forEach(((e,t)=>{e.push(...n.get(t))}))}e.sort(tc.compareRangesUsingStarts);for(const[i,n]of t)if(n.length===e.length){n.sort(tc.compareRangesUsingStarts);for(let o=0;o<n.length;o++)n[o].containsRange(e[o])||t.delete(i)}else t.delete(i);return t.size>0}};K2=z2=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(3,Yg)],K2);var j2,q2=function(e,t){return function(i,n){t(i,n,e)}};const $2={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let G2=j2=class{static get(e){return e.getContribution(j2.ID)}constructor(e,t,i,n,o){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=o,this._snippetListener=new M,this._modelVersionId=-1,this._inSnippet=j2.InSnippetMode.bindTo(n),this._hasNextTabstop=j2.HasNextTabstop.bindTo(n),this._hasPrevTabstop=j2.HasPrevTabstop.bindTo(n)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),null===(e=this._session)||void 0===e||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,void 0===t?$2:{...$2,...t})}catch(t){this.cancel(),this._logService.error(t),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"<no_session>")}}_doInsert(e,t){var i;if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&"string"!=typeof e&&this.cancel(),this._session?(fl("string"==typeof e),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new K2(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),null===(i=this._session)||void 0===i?void 0:i.hasChoice){const e={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(e,t)=>{if(!this._session||e!==this._editor.getModel()||!ch.equals(this._editor.getPosition(),t))return;const{activeChoice:i}=this._session;if(!i||0===i.choice.options.length)return;const n=e.getValueInRange(i.range),o=Boolean(i.choice.options.find((e=>e.value===n))),s=[];for(let e=0;e<i.choice.options.length;e++){const t=i.choice.options[e];s.push({kind:13,label:t.value,insertText:t.value,sortText:"a".repeat(e+1),range:i.range,filterText:o?`${n}_${t.value}`:void 0,command:{id:"jumpToNextSnippetPlaceholder",title:me(0,"Go to next placeholder...")}})}return{suggestions:s}}},t=this._editor.getModel();let i,n=!1;const o=()=>{null==i||i.dispose(),n=!1},s=()=>{n||(i=this._languageFeaturesService.completionProvider.register({language:t.getLanguageId(),pattern:t.uri.fsPath,scheme:t.uri.scheme,exclusive:!0},e),this._snippetListener.add(i),n=!0)};this._choiceCompletions={provider:e,enable:s,disable:o}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent((e=>e.isFlush&&this.cancel()))),this._snippetListener.add(this._editor.onDidChangeModel((()=>this.cancel()))),this._snippetListener.add(this._editor.onDidChangeCursorSelection((()=>this._updateState())))}}_updateState(){if(this._session&&this._editor.hasModel()){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){var e;if(!this._session||!this._editor.hasModel())return void(this._currentChoice=void 0);const{activeChoice:t}=this._session;if(!t||!this._choiceCompletions)return null===(e=this._choiceCompletions)||void 0===e||e.disable(),void(this._currentChoice=void 0);this._currentChoice!==t.choice&&(this._currentChoice=t.choice,this._choiceCompletions.enable(),queueMicrotask((()=>{!function(e,t){var i;null===(i=e.getContribution("editor.contrib.suggestController"))||void 0===i||i.triggerSuggest((new Set).add(t),void 0,!0)}(this._editor,this._choiceCompletions.provider)})))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,null===(t=this._session)||void 0===t||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){var e;null===(e=this._session)||void 0===e||e.prev(),this._updateState()}next(){var e;null===(e=this._session)||void 0===e||e.next(),this._updateState()}isInSnippet(){return Boolean(this._inSnippet.get())}};G2.ID="snippetController2",G2.InSnippetMode=new od("inSnippetMode",!1,me(0,"Whether the editor in current in snippet mode")),G2.HasNextTabstop=new od("hasNextTabstop",!1,me(0,"Whether there is a next tab stop when in snippet mode")),G2.HasPrevTabstop=new od("hasPrevTabstop",!1,me(0,"Whether there is a previous tab stop when in snippet mode")),G2=j2=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([q2(1,Md),q2(2,Jk),q2(3,sd),q2(4,Yg)],G2),Gd(G2.ID,G2,4);const Z2=Vd.bindToContribution(G2.get);jd(new Z2({id:"jumpToNextSnippetPlaceholder",precondition:Bh.and(G2.InSnippetMode,G2.HasNextTabstop),handler:e=>e.next(),kbOpts:{weight:130,kbExpr:nc.editorTextFocus,primary:2}})),jd(new Z2({id:"jumpToPrevSnippetPlaceholder",precondition:Bh.and(G2.InSnippetMode,G2.HasPrevTabstop),handler:e=>e.prev(),kbOpts:{weight:130,kbExpr:nc.editorTextFocus,primary:1026}})),jd(new Z2({id:"leaveSnippet",precondition:G2.InSnippetMode,handler:e=>e.cancel(!0),kbOpts:{weight:130,kbExpr:nc.editorTextFocus,primary:9,secondary:[1033]}})),jd(new Z2({id:"acceptSnippet",precondition:G2.InSnippetMode,handler:e=>e.finish()}));var Y2,Q2=function(e,t){return function(i,n){t(i,n,e)}};!function(e){e[e.Undo=0]="Undo",e[e.Redo=1]="Redo",e[e.AcceptWord=2]="AcceptWord",e[e.Other=3]="Other"}(Y2||(Y2={}));let X2=class extends T{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,n,o,s,r,a,l,h,d,c){let u;super(),this.textModel=e,this.selectedSuggestItem=t,this.cursorPosition=i,this.textModelVersionId=n,this._debounceValue=o,this._suggestPreviewEnabled=s,this._suggestPreviewMode=r,this._inlineSuggestMode=a,this._enabled=l,this._instantiationService=h,this._commandService=d,this._languageConfigurationService=c,this._source=this._register(this._instantiationService.createInstance(m2,this.textModel,this.textModelVersionId,this._debounceValue)),this._isActive=d$(this,!1),this._forceUpdateSignal=M$("forceUpdate"),this._selectedInlineCompletionId=d$(this,void 0),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([Y2.Redo,Y2.Undo,Y2.AcceptWord]),this._fetchInlineCompletions=function(e,t){var i;return new b$(e.owner,e.debugName,t,e.createEmptyChangeSummary,e.handleChange,void 0,null!==(i=e.equalityComparer)&&void 0!==i?i:p$)}({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:gC.Automatic}),handleChange:(e,t)=>(e.didChange(this.textModelVersionId)&&this._preserveCurrentCompletionReasons.has(e.change)?t.preserveCurrentCompletion=!0:e.didChange(this._forceUpdateSignal)&&(t.inlineCompletionTriggerKind=e.change),!0)},((e,t)=>{if(this._forceUpdateSignal.read(e),!(this._enabled.read(e)&&this.selectedSuggestItem.read(e)||this._isActive.read(e)))return void this._source.cancelUpdate();this.textModelVersionId.read(e);const i=this.selectedInlineCompletion.get(),n=t.preserveCurrentCompletion||(null==i?void 0:i.forwardStable)?i:void 0,o=this._source.suggestWidgetInlineCompletions.get(),s=this.selectedSuggestItem.read(e);if(o&&!s){const e=this._source.inlineCompletions.get();e$((t=>{(!e||o.request.versionId>e.request.versionId)&&this._source.inlineCompletions.set(o.clone(),t),this._source.clearSuggestWidgetInlineCompletions(t)}))}const r=this.cursorPosition.read(e),a={triggerKind:t.inlineCompletionTriggerKind,selectedSuggestionInfo:null==s?void 0:s.toSelectedSuggestionInfo()};return this._source.fetch(r,a,n)})),this._filteredInlineCompletionItems=m$(this,(e=>{const t=this._source.inlineCompletions.read(e);if(!t)return[];const i=this.cursorPosition.read(e),n=t.inlineCompletions.filter((t=>t.isVisible(this.textModel,i,e)));return n})),this.selectedInlineCompletionIndex=m$(this,(e=>{const t=this._selectedInlineCompletionId.read(e),i=this._filteredInlineCompletionItems.read(e),n=void 0===this._selectedInlineCompletionId?-1:i.findIndex((e=>e.semanticId===t));return-1===n?(this._selectedInlineCompletionId.set(void 0,void 0),0):n})),this.selectedInlineCompletion=m$(this,(e=>this._filteredInlineCompletionItems.read(e)[this.selectedInlineCompletionIndex.read(e)])),this.lastTriggerKind=this._source.inlineCompletions.map(this,(e=>null==e?void 0:e.request.context.triggerKind)),this.inlineCompletionsCount=m$(this,(e=>this.lastTriggerKind.read(e)===gC.Explicit?this._filteredInlineCompletionItems.read(e).length:void 0)),this.state=f$({owner:this,equalityComparer:(e,t)=>e&&t?z1(e.ghostText,t.ghostText)&&e.inlineCompletion===t.inlineCompletion&&e.suggestItem===t.suggestItem:e===t},(e=>{var t;const i=this.textModel,n=this.selectedSuggestItem.read(e);if(n){const o=n.toSingleTextEdit().removeCommonPrefix(i),s=this._computeAugmentedCompletion(o,e);if(!this._suggestPreviewEnabled.read(e)&&!s)return;const r=null!==(t=null==s?void 0:s.edit)&&void 0!==t?t:o,a=s?s.edit.text.length-o.text.length:0,l=this._suggestPreviewMode.read(e),h=this.cursorPosition.read(e),d=r.computeGhostText(i,l,h,a);return{ghostText:null!=d?d:new B1(r.range.endLineNumber,[]),inlineCompletion:null==s?void 0:s.completion,suggestItem:n}}{if(!this._isActive.read(e))return;const t=this.selectedInlineCompletion.read(e);if(!t)return;const n=t.toSingleTextEdit(e),o=this._inlineSuggestMode.read(e),s=this.cursorPosition.read(e),r=n.computeGhostText(i,o,s);return r?{ghostText:r,inlineCompletion:t,suggestItem:void 0}:void 0}})),this.ghostText=f$({owner:this,equalityComparer:z1},(e=>{const t=this.state.read(e);if(t)return t.ghostText})),this._register(A$(this._fetchInlineCompletions)),this._register(w$((e=>{var t,i;const n=this.state.read(e),o=null==n?void 0:n.inlineCompletion;if((null==o?void 0:o.semanticId)!==(null==u?void 0:u.semanticId)&&(u=o,o)){const e=o.inlineCompletion,n=e.source;null===(i=(t=n.provider).handleItemDidShow)||void 0===i||i.call(t,n.inlineCompletions,e.sourceInlineCompletion,e.insertText)}})))}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineCompletions.get()}async triggerExplicitly(e){i$(e,(e=>{this._isActive.set(!0,e),this._forceUpdateSignal.trigger(e,gC.Explicit)})),await this._fetchInlineCompletions.get()}stop(e){i$(e,(e=>{this._isActive.set(!1,e),this._source.clear(e)}))}_computeAugmentedCompletion(e,t){const i=this.textModel,n=this._source.suggestWidgetInlineCompletions.read(t);return function(e,t){for(const i of e){const e=t(i);if(void 0!==e)return e}}(n?n.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(pl),(n=>{let o=n.toSingleTextEdit(t);return o=o.removeCommonPrefix(i,tc.fromPositions(o.range.getStartPosition(),e.range.getEndPosition())),o.augments(e)?{edit:o,completion:n}:void 0}))}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}async accept(e){var t;if(e.getModel()!==this.textModel)throw new b;const i=this.state.get();if(!i||i.ghostText.isEmpty()||!i.inlineCompletion)return;const n=i.inlineCompletion.toInlineCompletion(void 0);e.pushUndoStop(),n.snippetInfo?(e.executeEdits("inlineSuggestion.accept",[vG.replaceMove(n.range,""),...n.additionalTextEdits]),e.setPosition(n.snippetInfo.range.getStartPosition()),null===(t=G2.get(e))||void 0===t||t.insert(n.snippetInfo.snippet,{undoStopBefore:!1})):e.executeEdits("inlineSuggestion.accept",[vG.replaceMove(n.range,n.insertText),...n.additionalTextEdits]),n.command&&n.source.addRef(),e$((e=>{this._source.clear(e),this._isActive.set(!1,e)})),n.command&&(await this._commandService.executeCommand(n.command.id,...n.command.arguments||[]).then(void 0,d),n.source.removeRef())}async acceptNextWord(e){await this._acceptNext(e,((e,t)=>{const i=this.textModel.getLanguageIdAtPosition(e.lineNumber,e.column),n=this._languageConfigurationService.getLanguageConfiguration(i),o=new RegExp(n.wordDefinition.source,n.wordDefinition.flags.replace("g","")),s=t.match(o);let r=0;r=s&&void 0!==s.index?0===s.index?s[0].length:s.index:t.length;const a=/\s+/g.exec(t);return a&&void 0!==a.index&&a.index+a[0].length<r&&(r=a.index+a[0].length),r}))}async acceptNextLine(e){await this._acceptNext(e,((e,t)=>{const i=t.match(/\n/);return i&&void 0!==i.index?i.index+1:t.length}))}async _acceptNext(e,t){if(e.getModel()!==this.textModel)throw new b;const i=this.state.get();if(!i||i.ghostText.isEmpty()||!i.inlineCompletion)return;const n=i.ghostText,o=i.inlineCompletion.toInlineCompletion(void 0);if(o.snippetInfo||o.filterText!==o.insertText)return void await this.accept(e);const s=n.parts[0],r=new ch(n.lineNumber,s.column),a=s.lines.join("\n"),l=t(r,a);if(l===a.length&&1===n.parts.length)return void this.accept(e);const h=a.substring(0,l);o.source.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[vG.replace(tc.fromPositions(r),h)]);const t=F1(h);e.setPosition(P1(r,t))}finally{this._isAcceptingPartially=!1}if(o.source.provider.handlePartialAccept){const t=tc.fromPositions(o.range.getStartPosition(),P1(r,F1(h))),i=e.getModel().getValueInRange(t,1);o.source.provider.handlePartialAccept(o.source.inlineCompletions,o.sourceInlineCompletion,i.length)}}finally{o.source.removeRef()}}handleSuggestAccepted(e){var t,i;const n=e.toSingleTextEdit().removeCommonPrefix(this.textModel),o=this._computeAugmentedCompletion(n,void 0);if(!o)return;const s=o.completion.inlineCompletion;null===(i=(t=s.source.provider).handlePartialAccept)||void 0===i||i.call(t,s.source.inlineCompletions,s.sourceInlineCompletion,n.text.length)}};X2=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Q2(9,lh),Q2(10,wh),Q2(11,Yg)],X2);var J2,e4=function(e,t){return function(i,n){t(i,n,e)}};class t4{constructor(e){this.name=e}select(e,t,i){if(0===i.length)return 0;const n=i[0].score[0];for(let e=0;e<i.length;e++){const{score:t,completion:o}=i[e];if(t[0]!==n)break;if(o.preselect)return e}return 0}}class i4 extends t4{constructor(){super("first")}memorize(e,t,i){}toJSON(){}fromJSON(){}}let n4=J2=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new M,this._persistSoon=new Zt((()=>this._saveState()),500),this._disposables.add(e.onWillSaveState((e=>{e.reason===jN.SHUTDOWN&&this._saveState()})))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){var i;const n=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if((null===(i=this._strategy)||void 0===i?void 0:i.name)!==n){this._saveState();const e=J2._strategyCtors.get(n)||i4;this._strategy=new e;try{const e=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,t=this._storageService.get(`${J2._storagePrefix}/${n}`,e);t&&this._strategy.fromJSON(JSON.parse(t))}catch(e){}}return this._strategy}_saveState(){if(this._strategy){const e=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,t=JSON.stringify(this._strategy);this._storageService.store(`${J2._storagePrefix}/${this._strategy.name}`,t,e,1)}}};n4._strategyCtors=new Map([["recentlyUsedByPrefix",class extends t4{constructor(){super("recentlyUsedByPrefix"),this._trie=DG.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${n}`;this._trie.set(o,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:n}=e.getWordUntilPosition(t);if(!n)return super.select(e,t,i);const o=`${e.getLanguageId()}/${n}`;let s=this._trie.get(o);if(s||(s=this._trie.findSubstr(o)),s)for(let e=0;e<i.length;e++){const{kind:t,insertText:n}=i[e].completion;if(t===s.type&&n===s.insertText)return e}return super.select(e,t,i)}toJSON(){const e=[];return this._trie.forEach(((t,i)=>e.push([i,t]))),e.sort(((e,t)=>-(e[1].touch-t[1].touch))).forEach(((e,t)=>e[1].touch=t)),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type="number"==typeof i.type?i.type:uC.fromString(i.type),this._trie.set(t,i)}}}],["recentlyUsed",class extends t4{constructor(){super("recentlyUsed"),this._cache=new na(300,.66),this._seq=0}memorize(e,t,i){const n=`${e.getLanguageId()}/${i.textLabel}`;this._cache.set(n,{touch:this._seq++,type:i.completion.kind,insertText:i.completion.insertText})}select(e,t,i){if(0===i.length)return 0;const n=e.getLineContent(t.lineNumber).substr(t.column-10,t.column-1);if(/\s$/.test(n))return super.select(e,t,i);const o=i[0].score[0];let s=-1,r=-1;for(let t=0;t<i.length&&i[t].score[0]===o;t++){const n=`${e.getLanguageId()}/${i[t].textLabel}`,o=this._cache.peek(n);if(o&&o.touch>r&&o.type===i[t].completion.kind&&o.insertText===i[t].completion.insertText&&(r=o.touch,s=t),i[t].completion.preselect)return t}return-1!==s?s:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();for(const[t,i]of e)i.touch=0,i.type="number"==typeof i.type?i.type:uC.fromString(i.type),this._cache.set(t,i);this._seq=this._cache.size}}],["first",i4]]),n4._storagePrefix="suggest/memories",n4=J2=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([e4(0,KN),e4(1,ug)],n4);const o4=hh("ISuggestMemories");wg(o4,n4,1);var s4;let r4=s4=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=s4.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration((e=>e.hasChanged(122)&&this._update())),this._update()}dispose(){var e;this._configListener.dispose(),null===(e=this._selectionListener)||void 0===e||e.dispose(),this._ckAtEnd.reset()}_update(){const e="on"===this._editor.getOption(122);if(this._enabled!==e)if(this._enabled=e,this._enabled){const e=()=>{if(!this._editor.hasModel())return void this._ckAtEnd.set(!1);const e=this._editor.getModel(),t=this._editor.getSelection(),i=e.getWordAtPosition(t.getStartPosition());i?this._ckAtEnd.set(i.endColumn===t.getStartPosition().column):this._ckAtEnd.set(!1)};this._selectionListener=this._editor.onDidChangeCursorSelection(e),e()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};r4.AtEnd=new od("atEndOfWord",!1),r4=s4=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,sd)],r4);var a4;let l4=a4=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=a4.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),null===(e=this._listener)||void 0===e||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){0!==e.items.length&&a4._moveIndex(!0,e,t)!==t?(this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition((()=>{this._ignore||this.reset()})),this._ckOtherSuggestions.set(!0)):this.reset()}static _moveIndex(e,t,i){let n=i;for(let o=t.items.length;o>0&&(n=(n+t.items.length+(e?1:-1))%t.items.length,n!==i)&&t.items[n].completion.additionalTextEdits;o--);return n}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=a4._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};l4.OtherSuggestions=new od("hasOtherSuggestions",!1),l4=a4=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,sd)],l4);class h4{constructor(e,t,i,n){this._disposables=new M,this._disposables.add(i.onDidSuggest((e=>{0===e.completionModel.items.length&&this.reset()}))),this._disposables.add(i.onDidCancel((e=>{this.reset()}))),this._disposables.add(t.onDidShow((()=>this._onItem(t.getFocusedItem())))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType((o=>{if(this._active&&!t.isFrozen()&&0!==i.state){const t=o.charCodeAt(o.length-1);this._active.acceptCharacters.has(t)&&e.getOption(0)&&n(this._active.item)}})))}_onItem(e){if(!e||!Wc(e.item.completion.commitCharacters))return void this.reset();if(this._active&&this._active.item.item===e.item)return;const t=new zw;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}class d4{async provideSelectionRanges(e,t){const i=[];for(const n of t){const t=[];i.push(t);const o=new Map;await new Promise((t=>d4._bracketsRightYield(t,0,e,n,o))),await new Promise((i=>d4._bracketsLeftYield(i,0,e,n,o,t)))}return i}static _bracketsRightYield(e,t,i,n,o){const s=new Map,r=Date.now();for(;;){if(t>=d4._maxRounds){e();break}if(!n){e();break}const a=i.bracketPairs.findNextBracket(n);if(!a){e();break}if(Date.now()-r>d4._maxDuration){setTimeout((()=>d4._bracketsRightYield(e,t+1,i,n,o)));break}if(a.bracketInfo.isOpeningBracket){const e=a.bracketInfo.bracketText,t=s.has(e)?s.get(e):0;s.set(e,t+1)}else{const e=a.bracketInfo.getOpeningBrackets()[0].bracketText;let t=s.has(e)?s.get(e):0;if(t-=1,s.set(e,Math.max(0,t)),t<0){let t=o.get(e);t||(t=new B,o.set(e,t)),t.push(a.range)}}n=a.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,n,o,s){const r=new Map,a=Date.now();for(;;){if(t>=d4._maxRounds&&0===o.size){e();break}if(!n){e();break}const l=i.bracketPairs.findPrevBracket(n);if(!l){e();break}if(Date.now()-a>d4._maxDuration){setTimeout((()=>d4._bracketsLeftYield(e,t+1,i,n,o,s)));break}if(l.bracketInfo.isOpeningBracket){const e=l.bracketInfo.bracketText;let t=r.has(e)?r.get(e):0;if(t-=1,r.set(e,Math.max(0,t)),t<0){const t=o.get(e);if(t){const n=t.shift();0===t.size&&o.delete(e);const r=tc.fromPositions(l.range.getEndPosition(),n.getStartPosition()),a=tc.fromPositions(l.range.getStartPosition(),n.getEndPosition());s.push({range:r}),s.push({range:a}),d4._addBracketLeading(i,a,s)}}}else{const e=l.bracketInfo.getOpeningBrackets()[0].bracketText,t=r.has(e)?r.get(e):0;r.set(e,t+1)}n=l.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const n=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(n);0!==o&&o!==t.startColumn&&(i.push({range:tc.fromPositions(new ch(n,o),t.getEndPosition())}),i.push({range:tc.fromPositions(new ch(n,1),t.getEndPosition())}));const s=n-1;if(s>0){const n=e.getLineFirstNonWhitespaceColumn(s);n===t.startColumn&&n!==e.getLineLastNonWhitespaceColumn(s)&&(i.push({range:tc.fromPositions(new ch(s,n),t.getEndPosition())}),i.push({range:tc.fromPositions(new ch(s,1),t.getEndPosition())}))}}}d4._maxDuration=30,d4._maxRounds=2;class c4{static async create(e,t){if(!t.getOption(117).localityBonus)return c4.None;if(!t.hasModel())return c4.None;const i=t.getModel(),n=t.getPosition();if(!e.canComputeWordRanges(i.uri))return c4.None;const[o]=await(new d4).provideSelectionRanges(i,[n]);if(0===o.length)return c4.None;const s=await e.computeWordRanges(i.uri,o[0].range);if(!s)return c4.None;const r=i.getWordUntilPosition(n);return delete s[r.word],new class extends c4{distance(e,i){if(!n.equals(t.getPosition()))return 0;if(17===i.kind)return 2<<20;const r="string"==typeof i.label?i.label:i.label.label,a=s[r];if(Bc(a))return 2<<20;const l=Mc(a,tc.fromPositions(e),tc.compareRangesUsingStarts),h=l>=0?a[l]:a[Math.max(0,~l-1)];let d=o.length;for(const e of o){if(!tc.containsRange(e.range,h))break;d-=1}return d}}}}c4.None=new class extends c4{distance(){return 0}};class u4{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}}class g4{constructor(e,t,i,n,o,s,r=il.default,a=void 0){this.clipboardText=a,this._snippetCompareFn=g4._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=n,this._options=o,this._refilterKind=1,this._lineContext=i,this._fuzzyScoreOptions=r,"top"===s?this._snippetCompareFn=g4._compareCompletionItemsSnippetsUp:"bottom"===s&&(this._snippetCompareFn=g4._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){this._lineContext.leadingLineContent===e.leadingLineContent&&this._lineContext.characterCountDelta===e.characterCountDelta||(this._refilterKind=this._lineContext.characterCountDelta<e.characterCountDelta&&this._filteredItems?2:1,this._lineContext=e)}get items(){return this._ensureCachedState(),this._filteredItems}getItemsByProvider(){return this._ensureCachedState(),this._itemsByProvider}getIncompleteProvider(){this._ensureCachedState();const e=new Set;for(const[t,i]of this.getItemsByProvider())i.length>0&&i[0].container.incomplete&&e.add(t);return e}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){0!==this._refilterKind&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let n="",o="";const s=1===this._refilterKind?this._items:this._filteredItems,r=[],a=!this._options.filterGraceful||s.length>2e3?nl:sl;for(let l=0;l<s.length;l++){const h=s[l];if(h.isInvalid)continue;const d=this._itemsByProvider.get(h.provider);d?d.push(h):this._itemsByProvider.set(h.provider,[h]);const c=h.position.column-h.editStart.column,u=c+i-(h.position.column-this._column);if(n.length!==u&&(n=0===u?"":t.slice(-u),o=n.toLowerCase()),h.word=n,0===u)h.score=tl.Default;else{let e=0;for(;e<c;){const t=n.charCodeAt(e);if(32!==t&&9!==t)break;e+=1}if(e>=u)h.score=tl.Default;else if("string"==typeof h.completion.filterText){const t=a(n,o,e,h.completion.filterText,h.filterTextLow,0,this._fuzzyScoreOptions);if(!t)continue;0===Cn(h.completion.filterText,h.textLabel)?h.score=t:(h.score=Va(n,o,e,h.textLabel,h.labelLow,0),h.score[0]=t[0])}else{const t=a(n,o,e,h.textLabel,h.labelLow,0,this._fuzzyScoreOptions);if(!t)continue;h.score=t}}h.idx=l,h.distance=this._wordDistance.distance(h.position,h.completion),r.push(h),e.push(h.textLabel.length)}this._filteredItems=r.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?Tc(e.length-.85,e,((e,t)=>e-t)):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]<t.score[0]?1:e.distance<t.distance?-1:e.distance>t.distance?1:e.idx<t.idx?-1:e.idx>t.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return 1;if(27===t.completion.kind)return-1}return g4._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return-1;if(27===t.completion.kind)return 1}return g4._compareCompletionItems(e,t)}}var p4,m4=function(e,t){return function(i,n){t(i,n,e)}};class f4{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenization.tokenizeIfCheap(i.lineNumber);const n=t.getWordAtPosition(i);return!(!n||n.endColumn!==i.column&&n.startColumn+1!==i.column||!isNaN(Number(n.word)))}constructor(e,t,i){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.triggerOptions=i}}let _4=p4=class{constructor(e,t,i,n,o,s,r,a,l){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=n,this._logService=o,this._contextKeyService=s,this._configurationService=r,this._languageFeaturesService=a,this._envService=l,this._toDispose=new M,this._triggerCharacterListener=new M,this._triggerQuickSuggest=new $t,this._triggerState=void 0,this._completionDisposables=new M,this._onDidCancel=new q,this._onDidTrigger=new q,this._onDidSuggest=new q,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new ic(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel((()=>{this._updateTriggerCharacters(),this.cancel()}))),this._toDispose.add(this._editor.onDidChangeModelLanguage((()=>{this._updateTriggerCharacters(),this.cancel()}))),this._toDispose.add(this._editor.onDidChangeConfiguration((()=>{this._updateTriggerCharacters()}))),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange((()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()})));let h=!1;this._toDispose.add(this._editor.onDidCompositionStart((()=>{h=!0}))),this._toDispose.add(this._editor.onDidCompositionEnd((()=>{h=!1,this._onCompositionEnd()}))),this._toDispose.add(this._editor.onDidChangeCursorSelection((e=>{h||this._onCursorChange(e)}))),this._toDispose.add(this._editor.onDidChangeModelContent((()=>{h||void 0===this._triggerState||this._refilterCompletionItems()}))),this._updateTriggerCharacters()}dispose(){E(this._triggerCharacterListener),E([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(90)||!this._editor.hasModel()||!this._editor.getOption(120))return;const e=new Map;for(const t of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const i of t.triggerCharacters||[]){let n=e.get(i);n||(n=new Set,n.add(undefined),e.set(i,n)),n.add(t)}const t=t=>{var i;if(!function(e,t,i){if(!Boolean(t.getContextKeyValue("inlineSuggestionVisible")))return!0;const n=t.getContextKeyValue(I1.suppressSuggestions.key);return void 0!==n?!n:!e.getOption(62).suppressSuggestions}(this._editor,this._contextKeyService,this._configurationService))return;if(f4.shouldAutoTrigger(this._editor))return;if(!t){const e=this._editor.getPosition();t=this._editor.getModel().getLineContent(e.lineNumber).substr(0,e.column-1)}let n="";Mn(t.charCodeAt(t.length-1))?In(t.charCodeAt(t.length-2))&&(n=t.substr(t.length-2)):n=t.charAt(t.length-1);const o=e.get(n);if(o){const e=new Map;if(this._completionModel)for(const[t,i]of this._completionModel.getItemsByProvider())o.has(t)||e.set(t,i);this.trigger({auto:!0,triggerKind:1,triggerCharacter:n,retrigger:Boolean(this._completionModel),clipboardText:null===(i=this._completionModel)||void 0===i?void 0:i.clipboardText,completionOptions:{providerFilter:o,providerItemsToReuse:e}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd((()=>t())))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(e=!1){var t;void 0!==this._triggerState&&(this._triggerQuickSuggest.cancel(),null===(t=this._requestToken)||void 0===t||t.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){void 0!==this._triggerState&&(this._editor.hasModel()&&this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.trigger({auto:this._triggerState.auto,retrigger:!0}):this.cancel())}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||0!==e.reason&&3!==e.reason||"keyboard"!==e.source&&"deleteLeft"!==e.source?this.cancel():void 0===this._triggerState&&0===e.reason?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():void 0!==this._triggerState&&3===e.reason&&this._refilterCompletionItems()}_onCompositionEnd(){void 0===this._triggerState?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){var e;N2.isAllOff(this._editor.getOption(88))||this._editor.getOption(117).snippetsPreventQuickSuggestions&&(null===(e=G2.get(this._editor))||void 0===e?void 0:e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet((()=>{if(void 0!==this._triggerState)return;if(!f4.shouldAutoTrigger(this._editor))return;if(!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=this._editor.getOption(88);if(!N2.isAllOff(i)){if(!N2.isAllOn(i)){e.tokenization.tokenizeIfCheap(t.lineNumber);const n=e.tokenization.getLineTokens(t.lineNumber),o=n.getStandardTokenType(n.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if("on"!==N2.valueFor(i,o))return}(function(e,t,i){if(!Boolean(t.getContextKeyValue(I1.inlineSuggestionVisible.key)))return!0;const n=t.getContextKeyValue(I1.suppressSuggestions.key);return void 0!==n?!n:!e.getOption(62).suppressSuggestions})(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(e)&&this.trigger({auto:!0})}}),this._editor.getOption(89)))}_refilterCompletionItems(){fl(this._editor.hasModel()),fl(void 0!==this._triggerState);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new f4(e,t,{...this._triggerState,refilter:!0});this._onNewContext(i)}trigger(e){var t,i,n,o,s,r;if(!this._editor.hasModel())return;const a=this._editor.getModel(),l=new f4(a,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:null!==(t=e.shy)&&void 0!==t&&t,position:this._editor.getPosition()}),this._context=l;let d={triggerKind:null!==(i=e.triggerKind)&&void 0!==i?i:0};e.triggerCharacter&&(d={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new Pt;let c=1;switch(this._editor.getOption(111)){case"top":c=0;break;case"bottom":c=2}const{itemKind:u,showDeprecated:g}=p4._createSuggestFilter(this._editor),p=new k2(c,null!==(o=null===(n=e.completionOptions)||void 0===n?void 0:n.kindFilter)&&void 0!==o?o:u,null===(s=e.completionOptions)||void 0===s?void 0:s.providerFilter,null===(r=e.completionOptions)||void 0===r?void 0:r.providerItemsToReuse,g),m=c4.create(this._editorWorkerService,this._editor),f=x2(this._languageFeaturesService.completionProvider,a,this._editor.getPosition(),p,d,this._requestToken.token);Promise.all([f,m]).then((async([t,i])=>{var n;if(null===(n=this._requestToken)||void 0===n||n.dispose(),!this._editor.hasModel())return;let o=null==e?void 0:e.clipboardText;if(!o&&t.needsClipboard&&(o=await this._clipboardService.readText()),void 0===this._triggerState)return;const s=this._editor.getModel(),r=new f4(s,this._editor.getPosition(),e),a={...il.default,firstMatchCanBeWeak:!this._editor.getOption(117).matchOnWordStartOnly};if(this._completionModel=new g4(t.items,this._context.column,{leadingLineContent:r.leadingLineContent,characterCountDelta:r.column-this._context.column},i,this._editor.getOption(117),this._editor.getOption(111),a,o),this._completionDisposables.add(t.disposable),this._onNewContext(r),this._reportDurationsTelemetry(t.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const e of t.items)e.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${e.provider._debugDisplayName}`,e.completion)})).catch(h)}_reportDurationsTelemetry(e){this._telemetryGate++%230==0&&setTimeout((()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)}))}static _createSuggestFilter(e){const t=new Set;"none"===e.getOption(111)&&t.add(27);const i=e.getOption(117);return i.showMethods||t.add(0),i.showFunctions||t.add(1),i.showConstructors||t.add(2),i.showFields||t.add(3),i.showVariables||t.add(4),i.showClasses||t.add(5),i.showStructs||t.add(6),i.showInterfaces||t.add(7),i.showModules||t.add(8),i.showProperties||t.add(9),i.showEvents||t.add(10),i.showOperators||t.add(11),i.showUnits||t.add(12),i.showValues||t.add(13),i.showConstants||t.add(14),i.showEnums||t.add(15),i.showEnumMembers||t.add(16),i.showKeywords||t.add(17),i.showWords||t.add(18),i.showColors||t.add(19),i.showFiles||t.add(20),i.showReferences||t.add(21),i.showColors||t.add(22),i.showFolders||t.add(23),i.showTypeParameters||t.add(24),i.showSnippets||t.add(27),i.showUsers||t.add(25),i.showIssues||t.add(26),{itemKind:t,showDeprecated:i.showDeprecated}}_onNewContext(e){if(this._context)if(e.lineNumber===this._context.lineNumber)if(_n(e.leadingLineContent)===_n(this._context.leadingLineContent)){if(e.column<this._context.column)e.leadingWord.word?this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0}):this.cancel();else if(this._completionModel)if(0!==e.leadingWord.word.length&&e.leadingWord.startColumn>this._context.leadingWord.startColumn){if(f4.shouldAutoTrigger(this._editor)&&this._context){const e=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:e}})}}else if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&0!==e.leadingWord.word.length){const e=new Map,t=new Set;for(const[i,n]of this._completionModel.getItemsByProvider())n.length>0&&n[0].container.incomplete?t.add(i):e.set(i,n);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:t,providerItemsToReuse:e}})}else{const t=this._completionModel.lineContext;let i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},0===this._completionModel.items.length){const n=f4.shouldAutoTrigger(this._editor);if(!this._context)return void this.cancel();if(n&&this._context.leadingWord.endColumn<e.leadingWord.startColumn)return void this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0});if(this._context.triggerOptions.auto)return void this.cancel();if(this._completionModel.lineContext=t,i=this._completionModel.items.length>0,i&&0===e.leadingWord.word.length)return void this.cancel()}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:i})}}else this.cancel();else this.cancel()}};_4=p4=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([m4(1,XZ),m4(2,ZS),m4(3,Id),m4(4,Md),m4(5,sd),m4(6,ug),m4(7,Jk),m4(8,aI)],_4);class v4{constructor(e,t){this._disposables=new M,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType((()=>{if(this._locked||!e.hasModel())return;const t=e.getSelections(),i=t.length;let n=!1;for(let e=0;e<i;e++)if(!t[e].isEmpty()){n=!0;break}if(!n)return void(0!==this._lastOvertyped.length&&(this._lastOvertyped.length=0));this._lastOvertyped=[];const o=e.getModel();for(let e=0;e<i;e++){const i=t[e];if(o.getValueLengthInRange(i)>v4._maxSelectionLength)return;this._lastOvertyped[e]={value:o.getValueInRange(i),multiline:i.startLineNumber!==i.endLineNumber}}}))),this._disposables.add(t.onDidTrigger((e=>{this._locked=!0}))),this._disposables.add(t.onDidCancel((e=>{this._locked=!1})))}getLastOvertypedInfo(e){if(e>=0&&e<this._lastOvertyped.length)return this._lastOvertyped[e]}dispose(){this._disposables.dispose()}}v4._maxSelectionLength=51200;var b4=i(5224),w4={};w4.styleTagTransform=Vr(),w4.setAttributes=Pr(),w4.insert=Rr().bind(null,"head"),w4.domAPI=Tr(),w4.insertStyleElement=Br(),Ir()(b4.Z,w4),b4.Z&&b4.Z.locals&&b4.Z.locals;var C4=function(e,t){return function(i,n){t(i,n,e)}};class y4 extends GV{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=me(0,"{0} ({1})",this._action.label,y4.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return null===(t=e.getLabel())||void 0===t?void 0:t.replace(/\benter\b/gi,"⏎")}}let S4=class{constructor(e,t,i,n,o){this._menuId=t,this._menuService=n,this._contextKeyService=o,this._menuDisposables=new M,this.element=hr(e,mr(".suggest-status-bar"));const s=e=>e instanceof Dd?i.createInstance(y4,e,void 0):void 0;this._leftActions=new ME(this.element,{actionViewItemProvider:s}),this._rightActions=new ME(this.element,{actionViewItemProvider:s}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(this._menuId,this._contextKeyService),t=()=>{const t=[],i=[];for(const[n,o]of e.getActions())"left"===n?t.push(...o):i.push(...o);this._leftActions.clear(),this._leftActions.push(t),this._rightActions.clear(),this._rightActions.push(i)};this._menuDisposables.add(e.onDidChange((()=>t()))),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};S4=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([C4(2,lh),C4(3,Sd),C4(4,sd)],S4);function k4(e){return!!e&&Boolean(e.completion.documentation||e.completion.detail&&e.completion.detail!==e.completion.label)}let L4=class{constructor(e,t){this._editor=e,this._onDidClose=new q,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new q,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new M,this._renderDisposeable=new M,this._borderWidth=1,this._size=new Ms(330,0),this.domNode=mr(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(jx,{editor:e}),this._body=mr(".body"),this._scrollbar=new ND(this._body,{alwaysConsumeMouseWheel:!0}),hr(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=hr(this._body,mr(".header")),this._close=hr(this._header,mr("span"+Ll.asCSSSelector(Sl.close))),this._close.title=me(0,"Close"),this._type=hr(this._header,mr("p.type")),this._docs=hr(this._body,mr("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(50)&&this._configureFont()})))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(50),i=t.getMassagedFontFamily(),n=e.get(118)||t.fontSize,o=e.get(119)||t.lineHeight,s=t.fontWeight,r=`${n}px`,a=`${o}px`;this.domNode.style.fontSize=r,this.domNode.style.lineHeight=""+o/n,this.domNode.style.fontWeight=s,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=a,this._close.style.width=a}getLayoutInfo(){const e=this._editor.getOption(119)||this._editor.getOption(50).lineHeight,t=this._borderWidth;return{lineHeight:e,borderWidth:t,borderHeight:2*t,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=me(0,"Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,2*this.getLayoutInfo().lineHeight),this._onDidChangeContents.fire(this)}renderItem(e,t){var i,n;this._renderDisposeable.clear();let{detail:o,documentation:s}=e.completion;if(t){let t="";t+=`score: ${e.score[0]}\n`,t+=`prefix: ${null!==(i=e.word)&&void 0!==i?i:"(no prefix)"}\n`,t+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel}\n`,t+=`distance: ${e.distance} (localityBonus-setting)\n`,t+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"}\n`,t+=`commit_chars: ${null===(n=e.completion.commitCharacters)||void 0===n?void 0:n.join("")}\n`,s=(new eh).appendCodeblock("empty",t),o=`Provider: ${e.provider._debugDisplayName}`}if(t||k4(e)){if(this.domNode.classList.remove("no-docs","no-type"),o){const e=o.length>1e5?`${o.substr(0,1e5)}…`:o;this._type.textContent=e,this._type.title=e,fr(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gim.test(e))}else _s(this._type),this._type.title="",_r(this._type),this.domNode.classList.add("no-type");if(_s(this._docs),"string"==typeof s)this._docs.classList.remove("markdown-docs"),this._docs.textContent=s;else if(s){this._docs.classList.add("markdown-docs"),_s(this._docs);const e=this._markdownRenderer.render(s);this._docs.appendChild(e.element),this._renderDisposeable.add(e),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync((()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)})))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=e=>{e.preventDefault(),e.stopPropagation()},this._close.onclick=e=>{e.preventDefault(),e.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}else this.clearContents()}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get size(){return this._size}layout(e,t){const i=new Ms(e,t);Ms.equals(i,this._size)||(this._size=i,function(e,t,i){"number"==typeof t&&(e.style.width=`${t}px`),"number"==typeof i&&(e.style.height=`${i}px`)}(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}};L4=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,lh)],L4);class x4{constructor(e,t){let i,n;this.widget=e,this._editor=t,this._disposables=new M,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new zj,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let o=0,s=0;this._disposables.add(this._resizable.onDidWillResize((()=>{i=this._topLeft,n=this._resizable.size}))),this._disposables.add(this._resizable.onDidResize((e=>{if(i&&n){this.widget.layout(e.dimension.width,e.dimension.height);let t=!1;e.west&&(s=n.width-e.dimension.width,t=!0),e.north&&(o=n.height-e.dimension.height,t=!0),t&&this._applyTopLeft({top:i.top+o,left:i.left+s})}e.done&&(i=void 0,n=void 0,o=0,s=0,this._userSize=e.dimension)}))),this._disposables.add(this.widget.onDidChangeContents((()=>{var e;this._anchorBox&&this._placeAtAnchor(this._anchorBox,null!==(e=this._userSize)&&void 0!==e?e:this.widget.size,this._preferAlignAtTop)})))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return null}show(){this._added||(this._editor.addOverlayWidget(this),this.getDomNode().style.position="fixed",this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){var i;const n=e.getBoundingClientRect();this._anchorBox=n,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,null!==(i=this._userSize)&&void 0!==i?i:this.widget.size,t)}_placeAtAnchor(e,t,i){var n;const o=Ns(this.getDomNode().ownerDocument.body),s=this.widget.getLayoutInfo(),r=new Ms(220,2*s.lineHeight),a=e.top,l=function(){const i=o.width-(e.left+e.width+s.borderWidth+s.horizontalPadding),n=-s.borderWidth+e.left+e.width,l=new Ms(i,o.height-e.top-s.borderHeight-s.verticalPadding),h=l.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:a,left:n,fit:i-t.width,maxSizeTop:l,maxSizeBottom:h,minSize:r.with(Math.min(i,r.width))}}(),h=[l,function(){const i=e.left-s.borderWidth-s.horizontalPadding,n=Math.max(s.horizontalPadding,e.left-t.width-s.borderWidth),l=new Ms(i,o.height-e.top-s.borderHeight-s.verticalPadding),h=l.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:a,left:n,fit:i-t.width,maxSizeTop:l,maxSizeBottom:h,minSize:r.with(Math.min(i,r.width))}}(),function(){const i=e.left,n=-s.borderWidth+e.top+e.height,a=new Ms(e.width-s.borderHeight,o.height-e.top-e.height-s.verticalPadding);return{top:n,left:i,fit:a.height-t.height,maxSizeBottom:a,maxSizeTop:a,minSize:r.with(a.width)}}()],d=null!==(n=h.find((e=>e.fit>=0)))&&void 0!==n?n:h.sort(((e,t)=>t.fit-e.fit))[0],c=e.top+e.height-s.borderHeight;let u,g=t.height;const p=Math.max(d.maxSizeTop.height,d.maxSizeBottom.height);let m;g>p&&(g=p),i?g<=d.maxSizeTop.height?(u=!0,m=d.maxSizeTop):(u=!1,m=d.maxSizeBottom):g<=d.maxSizeBottom.height?(u=!1,m=d.maxSizeBottom):(u=!0,m=d.maxSizeTop),this._applyTopLeft({left:d.left,top:u?d.top:c-g}),this.getDomNode().style.position="fixed",this._resizable.enableSashes(!u,d===l,u,d!==l),this._resizable.minSize=d.minSize,this._resizable.maxSize=m,this._resizable.layout(g,Math.min(m.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this.getDomNode().style.left=`${this._topLeft.left}px`,this.getDomNode().style.top=`${this._topLeft.top}px`}}var D4;!function(e){e[e.FILE=0]="FILE",e[e.FOLDER=1]="FOLDER",e[e.ROOT_FOLDER=2]="ROOT_FOLDER"}(D4||(D4={}));const E4=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function N4(e,t,i,n){const o=n===D4.ROOT_FOLDER?["rootfolder-icon"]:n===D4.FOLDER?["folder-icon"]:["file-icon"];if(i){let s;if(i.scheme===jo.data)s=Jl.parseMetaData(i).get(Jl.META_DATA_LABEL);else{const e=i.path.match(E4);e?(s=I4(e[2].toLowerCase()),e[1]&&o.push(`${I4(e[1].toLowerCase())}-name-dir-icon`)):s=I4(i.authority.toLowerCase())}if(n===D4.ROOT_FOLDER)o.push(`${s}-root-name-folder-icon`);else if(n===D4.FOLDER)o.push(`${s}-name-folder-icon`);else{if(s){if(o.push(`${s}-name-file-icon`),o.push("name-file-icon"),s.length<=255){const e=s.split(".");for(let t=1;t<e.length;t++)o.push(`${e.slice(t).join(".")}-ext-file-icon`)}o.push("ext-file-icon")}const n=function(e,t,i){if(!i)return null;let n=null;if(i.scheme===jo.data){const e=Jl.parseMetaData(i).get(Jl.META_DATA_MIME);e&&(n=t.getLanguageIdByMimeType(e))}else{const t=e.getModel(i);t&&(n=t.getLanguageId())}return n&&n!==Hg?n:t.guessLanguageIdByFilepathOrFirstLine(i)}(e,t,i);n&&o.push(`${I4(n)}-lang-file-icon`)}}return o}function I4(e){return e.replace(/[\11\12\14\15\40]/g,"/")}var M4,T4=function(e,t){return function(i,n){t(i,n,e)}};function A4(e){return`suggest-aria-id:${e}`}const R4=EA("suggest-more-info",Sl.chevronRight,me(0,"Icon for more information in the suggest widget.")),O4=new((M4=class{extract(e,t){if(e.textLabel.match(M4._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(M4._regexStrict))return t[0]=e.completion.detail,!0;if("string"==typeof e.completion.documentation){const i=M4._regexRelaxed.exec(e.completion.documentation);if(i&&(0===i.index||i.index+i[0].length===e.completion.documentation.length))return t[0]=i[0],!0}return!1}})._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/,M4._regexStrict=new RegExp(`^${M4._regexRelaxed.source}$`,"i"),M4);let P4=class{constructor(e,t,i,n){this._editor=e,this._modelService=t,this._languageService=i,this._themeService=n,this._onDidToggleDetails=new q,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new M,i=e;i.classList.add("show-file-icons");const n=hr(e,mr(".icon")),o=hr(n,mr("span.colorspan")),s=hr(e,mr(".contents")),r=hr(s,mr(".main")),a=hr(r,mr(".icon-label.codicon")),l=hr(r,mr("span.left")),h=hr(r,mr("span.right")),d=new DK(l,{supportHighlights:!0,supportIcons:!0});t.add(d);const c=hr(l,mr("span.signature-label")),u=hr(l,mr("span.qualifier-label")),g=hr(h,mr("span.details-label")),p=hr(h,mr("span.readMore"+Ll.asCSSSelector(R4)));p.title=me(0,"Read More");const m=()=>{const e=this._editor.getOptions(),t=e.get(50),o=t.getMassagedFontFamily(),s=t.fontFeatureSettings,a=e.get(118)||t.fontSize,l=e.get(119)||t.lineHeight,h=t.fontWeight,d=`${a}px`,c=`${l}px`,u=`${t.letterSpacing}px`;i.style.fontSize=d,i.style.fontWeight=h,i.style.letterSpacing=u,r.style.fontFamily=o,r.style.fontFeatureSettings=s,r.style.lineHeight=c,n.style.height=c,n.style.width=c,p.style.height=c,p.style.width=c};return m(),t.add(this._editor.onDidChangeConfiguration((e=>{(e.hasChanged(50)||e.hasChanged(118)||e.hasChanged(119))&&m()}))),{root:i,left:l,right:h,icon:n,colorspan:o,iconLabel:d,iconContainer:a,parametersLabel:c,qualifierLabel:u,detailsLabel:g,readMore:p,disposables:t}}renderElement(e,t,i){const{completion:n}=e;i.root.id=A4(t),i.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:za(e.score)},s=[];if(19===n.kind&&O4.extract(e,s))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=s[0];else if(20===n.kind&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const t=N4(this._modelService,this._languageService,Ro.from({scheme:"fake",path:e.textLabel}),D4.FILE),s=N4(this._modelService,this._languageService,Ro.from({scheme:"fake",path:n.detail}),D4.FILE);o.extraClasses=t.length>s.length?t:s}else 23===n.kind&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",o.extraClasses=[N4(this._modelService,this._languageService,Ro.from({scheme:"fake",path:e.textLabel}),D4.FOLDER),N4(this._modelService,this._languageService,Ro.from({scheme:"fake",path:n.detail}),D4.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...Ll.asClassNameArray(uC.toIcon(n.kind))));n.tags&&n.tags.indexOf(1)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,o),"string"==typeof n.label?(i.parametersLabel.textContent="",i.detailsLabel.textContent=F4(n.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=F4(n.label.detail||""),i.detailsLabel.textContent=F4(n.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(117).showInlineDetails?fr(i.detailsLabel):_r(i.detailsLabel),k4(e)?(i.right.classList.add("can-expand-details"),fr(i.readMore),i.readMore.onmousedown=e=>{e.stopPropagation(),e.preventDefault()},i.readMore.onclick=e=>{e.stopPropagation(),e.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),_r(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};function F4(e){return e.replace(/\r\n|\r|\n/g,"")}P4=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([T4(1,uh),T4(2,yu),T4(3,Tv)],P4);var B4,W4=function(e,t){return function(i,n){t(i,n,e)}};Sm("editorSuggestWidget.background",{dark:Sf,light:Sf,hcDark:Sf,hcLight:Sf},me(0,"Background color of the suggest widget.")),Sm("editorSuggestWidget.border",{dark:Lf,light:Lf,hcDark:Lf,hcLight:Lf},me(0,"Border color of the suggest widget."));const V4=Sm("editorSuggestWidget.foreground",{dark:yf,light:yf,hcDark:yf,hcLight:yf},me(0,"Foreground color of the suggest widget."));Sm("editorSuggestWidget.selectedForeground",{dark:B_,light:B_,hcDark:B_,hcLight:B_},me(0,"Foreground color of the selected entry in the suggest widget.")),Sm("editorSuggestWidget.selectedIconForeground",{dark:W_,light:W_,hcDark:W_,hcLight:W_},me(0,"Icon foreground color of the selected entry in the suggest widget."));const z4=Sm("editorSuggestWidget.selectedBackground",{dark:V_,light:V_,hcDark:V_,hcLight:V_},me(0,"Background color of the selected entry in the suggest widget."));Sm("editorSuggestWidget.highlightForeground",{dark:y_,light:y_,hcDark:y_,hcLight:y_},me(0,"Color of the match highlights in the suggest widget.")),Sm("editorSuggestWidget.focusHighlightForeground",{dark:S_,light:S_,hcDark:S_,hcLight:S_},me(0,"Color of the match highlights in the suggest widget when an item is focused.")),Sm("editorSuggestWidgetStatus.foreground",{dark:yv(V4,.5),light:yv(V4,.5),hcDark:yv(V4,.5),hcLight:yv(V4,.5)},me(0,"Foreground color of the suggest widget status."));class H4{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof _V}`}restore(){var e;const t=null!==(e=this._service.get(this._key,0))&&void 0!==e?e:"";try{const e=JSON.parse(t);if(Ms.is(e))return Ms.lift(e)}catch(e){}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let U4=B4=class{constructor(e,t,i,n,o){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new A,this._pendingShowDetails=new A,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new $t,this._disposables=new M,this._onDidSelect=new G,this._onDidFocus=new G,this._onDidHide=new q,this._onDidShow=new q,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new q,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new zj,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new K4(this,e),this._persistedSize=new H4(t,e);class s{constructor(e,t,i=!1,n=!1){this.persistedSize=e,this.currentSize=t,this.persistHeight=i,this.persistWidth=n}}let r;this._disposables.add(this.element.onDidWillResize((()=>{this._contentWidget.lockPreference(),r=new s(this._persistedSize.restore(),this.element.size)}))),this._disposables.add(this.element.onDidResize((e=>{var t,i,n,o;if(this._resize(e.dimension.width,e.dimension.height),r&&(r.persistHeight=r.persistHeight||!!e.north||!!e.south,r.persistWidth=r.persistWidth||!!e.east||!!e.west),e.done){if(r){const{itemHeight:e,defaultSize:s}=this.getLayoutInfo(),a=Math.round(e/2);let{width:l,height:h}=this.element.size;(!r.persistHeight||Math.abs(r.currentSize.height-h)<=a)&&(h=null!==(i=null===(t=r.persistedSize)||void 0===t?void 0:t.height)&&void 0!==i?i:s.height),(!r.persistWidth||Math.abs(r.currentSize.width-l)<=a)&&(l=null!==(o=null===(n=r.persistedSize)||void 0===n?void 0:n.width)&&void 0!==o?o:s.width),this._persistedSize.store(new Ms(l,h))}this._contentWidget.unlockPreference(),r=void 0}}))),this._messageElement=hr(this.element.domNode,mr(".message")),this._listElement=hr(this.element.domNode,mr(".tree"));const a=this._disposables.add(o.createInstance(L4,this.editor));a.onDidClose(this.toggleDetails,this,this._disposables),this._details=new x4(a,this.editor);const l=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(117).showIcons);l();const h=o.createInstance(P4,this.editor);this._disposables.add(h),this._disposables.add(h.onDidToggleDetails((()=>this.toggleDetails()))),this._list=new mE("SuggestWidget",this._listElement,{getHeight:e=>this.getLayoutInfo().itemHeight,getTemplateId:e=>"suggestion"},[h],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>me(0,"Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:e=>{let t=e.textLabel;if("string"!=typeof e.completion.label){const{detail:i,description:n}=e.completion.label;i&&n?t=me(0,"{0} {1}, {2}",t,i,n):i?t=me(0,"{0} {1}",t,i):n&&(t=me(0,"{0}, {1}",t,n))}if(!e.isResolved||!this._isDetailsVisible())return t;const{documentation:i,detail:n}=e.completion;return me(0,"{0}, docs: {1}",t,ln("{0}{1}",n||"",i?"string"==typeof i?i:i.value:""))}}}),this._list.style(tN({listInactiveFocusBackground:z4,listInactiveFocusOutline:Nm})),this._status=o.createInstance(S4,this.element.domNode,y2);const d=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(117).showStatusBar);d(),this._disposables.add(n.onDidColorThemeChange((e=>this._onThemeChange(e)))),this._onThemeChange(n.getColorTheme()),this._disposables.add(this._list.onMouseDown((e=>this._onListMouseDownOrTap(e)))),this._disposables.add(this._list.onTap((e=>this._onListMouseDownOrTap(e)))),this._disposables.add(this._list.onDidChangeSelection((e=>this._onListSelection(e)))),this._disposables.add(this._list.onDidChangeFocus((e=>this._onListFocus(e)))),this._disposables.add(this.editor.onDidChangeCursorSelection((()=>this._onCursorSelectionChanged()))),this._disposables.add(this.editor.onDidChangeConfiguration((e=>{e.hasChanged(117)&&(d(),l())}))),this._ctxSuggestWidgetVisible=C2.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=C2.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=C2.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=C2.HasFocusedSuggestion.bindTo(i),this._disposables.add(Cs(this._details.widget.domNode,"keydown",(e=>{this._onDetailsKeydown.fire(e)}))),this._disposables.add(this.editor.onMouseDown((e=>this._onEditorMouseDown(e))))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),null===(e=this._loadingTimeout)||void 0===e||e.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){0!==this._state&&this._contentWidget.layout()}_onListMouseDownOrTap(e){void 0!==e.element&&void 0!==e.index&&(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=Iv(e.type)?2:1}_onListFocus(e){var t;if(this._ignoreFocusEvents)return;if(!e.elements.length)return this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),void this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const i=e.elements[0],n=e.indexes[0];i!==this._focusedItem&&(null===(t=this._currentSuggestionDetails)||void 0===t||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=i,this._list.reveal(n),this._currentSuggestionDetails=Wt((async e=>{const t=jt((()=>{this._isDetailsVisible()&&this.showDetails(!0)}),250),n=e.onCancellationRequested((()=>t.dispose()));try{return await i.resolve(e)}finally{t.dispose(),n.dispose()}})),this._currentSuggestionDetails.then((()=>{n>=this._list.length||i!==this._list.element(n)||(this._ignoreFocusEvents=!0,this._list.splice(n,1,[i]),this._list.setFocus([n]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:A4(n)}))})).catch(h)),this._onDidFocus.fire({item:i,index:n,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",4===e),this.element.domNode.classList.remove("message"),e){case 0:_r(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._ctxSuggestWidgetHasFocusedSuggestion.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=B4.LOADING_MESSAGE,_r(this._listElement,this._status.element),fr(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Yr(B4.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=B4.NO_SUGGESTIONS_MESSAGE,_r(this._listElement,this._status.element),fr(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Yr(B4.NO_SUGGESTIONS_MESSAGE);break;case 3:case 4:_r(this._messageElement),fr(this._listElement,this._status.element),this._show();break;case 5:_r(this._messageElement),fr(this._listElement,this._status.element),this._details.show(),this._show()}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet((()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)}),100)}showTriggered(e,t){0===this._state&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=jt((()=>this._setState(1)),t)))}showSuggestions(e,t,i,n,o){var s,r;if(this._contentWidget.setPosition(this.editor.getPosition()),null===(s=this._loadingTimeout)||void 0===s||s.dispose(),null===(r=this._currentSuggestionDetails)||void 0===r||r.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&2!==this._state&&0!==this._state)return void this._setState(4);const a=this._completionModel.items.length,l=0===a;if(this._ctxSuggestWidgetMultipleSuggestions.set(a>1),l)return this._setState(n?0:2),void(this._completionModel=void 0);this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?4:3),this._list.reveal(t,0),this._list.setFocus(o?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=ks(as(this.element.domNode),(()=>{this._pendingLayout.clear(),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")}))}focusSelected(){this._list.length>0&&this._list.setFocus([0])}selectNextPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(0!==this._state&&2!==this._state&&1!==this._state&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){5===this._state?(this._setState(3),this._details.widget.domNode.classList.remove("focused")):3===this._state&&this._isDetailsVisible()&&(this._setState(5),this._details.widget.domNode.classList.add("focused"))}toggleDetails(){this._isDetailsVisible()?(this._pendingShowDetails.clear(),this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):!k4(this._list.getFocusedElements()[0])&&!this._explainMode||3!==this._state&&5!==this._state&&4!==this._state||(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._pendingShowDetails.value=ks(as(this.element.domNode),(()=>{this._pendingShowDetails.clear(),this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._positionDetails(),this.editor.focus(),this.element.domNode.classList.add("shows-details")}))}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var e;this._pendingLayout.clear(),this._pendingShowDetails.clear(),null===(e=this._loadingTimeout)||void 0===e||e.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const t=this._persistedSize.restore(),i=Math.ceil(4.3*this.getLayoutInfo().itemHeight);t&&t.height<i&&this._persistedSize.store(t.with(void 0,i))}isFrozen(){return 4===this._state}_afterRender(e){null!==e?2!==this._state&&1!==this._state&&(this._isDetailsVisible()&&this._details.show(),this._positionDetails()):this._isDetailsVisible()&&this._details.hide()}_layout(e){var t,i,n;if(!this.editor.hasModel())return;if(!this.editor.getDomNode())return;const o=Ns(this.element.domNode.ownerDocument.body),s=this.getLayoutInfo();e||(e=s.defaultSize);let r=e.height,a=e.width;if(this._status.element.style.height=`${s.itemHeight}px`,2===this._state||1===this._state)r=s.itemHeight+s.borderHeight,a=s.defaultSize.width/2,this.element.enableSashes(!1,!1,!1,!1),this.element.minSize=this.element.maxSize=new Ms(a,r),this._contentWidget.setPreference(2);else{const l=o.width-s.borderHeight-2*s.horizontalPadding;a>l&&(a=l);const h=this._completionModel?this._completionModel.stats.pLabelLen*s.typicalHalfwidthCharacterWidth:a,d=s.statusBarHeight+this._list.contentHeight+s.borderHeight,c=s.itemHeight+s.statusBarHeight,u=As(this.editor.getDomNode()),g=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),p=u.top+g.top+g.height,m=Math.min(o.height-p-s.verticalPadding,d),f=u.top+g.top-s.verticalPadding,_=Math.min(f,d);let v=Math.min(Math.max(_,m)+s.borderHeight,d);r===(null===(t=this._cappedHeight)||void 0===t?void 0:t.capped)&&(r=this._cappedHeight.wanted),r<c&&(r=c),r>v&&(r=v);const b=150;r>m||this._forceRenderingAbove&&f>b?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),v=_):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),v=m),this.element.preferredSize=new Ms(h,s.defaultSize.height),this.element.maxSize=new Ms(l,v),this.element.minSize=new Ms(220,c),this._cappedHeight=r===d?{wanted:null!==(n=null===(i=this._cappedHeight)||void 0===i?void 0:i.wanted)&&void 0!==n?n:e.height,capped:r}:void 0}this._resize(a,r)}_resize(e,t){const{width:i,height:n}=this.element.maxSize;e=Math.min(i,e),t=Math.min(n,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height=t-o+"px",this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){var e;this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,2===(null===(e=this._contentWidget.getPosition())||void 0===e?void 0:e.preference[0]))}getLayoutInfo(){const e=this.editor.getOption(50),t=iD(this.editor.getOption(119)||e.lineHeight,8,1e3),i=this.editor.getOption(117).showStatusBar&&2!==this._state&&1!==this._state?t:0,n=this._details.widget.borderWidth,o=2*n;return{itemHeight:t,statusBarHeight:i,borderWidth:n,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Ms(430,i+12*t+o)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}};U4.LOADING_MESSAGE=me(0,"Loading..."),U4.NO_SUGGESTIONS_MESSAGE=me(0,"No suggestions."),U4=B4=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([W4(1,KN),W4(2,sd),W4(3,Tv),W4(4,lh)],U4);class K4{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return!this._hidden&&this._position&&this._preference?{position:this._position,preference:[this._preference]}:null}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:n}=this._widget.getLayoutInfo();return new Ms(t+2*i+n,e+2*i)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var j4,q4=function(e,t){return function(i,n){t(i,n,e)}};class $4{constructor(e,t){if(this._model=e,this._position=t,e.getLineMaxColumn(t.lineNumber)!==t.column){const i=e.getOffsetAt(t),n=e.getPositionAt(i+1);this._marker=e.deltaDecorations([],[{range:tc.fromPositions(t,n),options:{description:"suggest-line-suffix",stickiness:1}}])}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.deltaDecorations(this._marker,[])}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker[0]);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}return this._model.getLineMaxColumn(e.lineNumber)-e.column}}let G4=j4=class{static get(e){return e.getContribution(j4.ID)}constructor(e,t,i,n,o,s,r){this._memoryService=t,this._commandService=i,this._contextKeyService=n,this._instantiationService=o,this._logService=s,this._telemetryService=r,this._lineSuffix=new A,this._toDispose=new M,this._selectors=new Z4((e=>e.priority)),this._onWillInsertSuggestItem=new q,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=o.createInstance(_4,this.editor),this._selectors.register({priority:0,select:(e,t,i)=>this._memoryService.select(e,t,i)});const a=C2.InsertMode.bindTo(n);a.set(e.getOption(117).insertMode),this._toDispose.add(this.model.onDidTrigger((()=>a.set(e.getOption(117).insertMode)))),this.widget=this._toDispose.add(new Ss(as(e.getDomNode()),(()=>{const e=this._instantiationService.createInstance(U4,this.editor);this._toDispose.add(e),this._toDispose.add(e.onDidSelect((e=>this._insertSuggestion(e,0)),this));const t=new h4(this.editor,e,this.model,(e=>this._insertSuggestion(e,2)));this._toDispose.add(t);const i=C2.MakesTextEdit.bindTo(this._contextKeyService),n=C2.HasInsertAndReplaceRange.bindTo(this._contextKeyService),o=C2.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(I((()=>{i.reset(),n.reset(),o.reset()}))),this._toDispose.add(e.onDidFocus((({item:e})=>{const t=this.editor.getPosition(),s=e.editStart.column,r=t.column;let a=!0;"smart"!==this.editor.getOption(1)||2!==this.model.state||e.completion.additionalTextEdits||4&e.completion.insertTextRules||r-s!==e.completion.insertText.length||(a=this.editor.getModel().getValueInRange({startLineNumber:t.lineNumber,startColumn:s,endLineNumber:t.lineNumber,endColumn:r})!==e.completion.insertText),i.set(a),n.set(!ch.equals(e.editInsertEnd,e.editReplaceEnd)),o.set(Boolean(e.provider.resolveCompletionItem)||Boolean(e.completion.documentation)||e.completion.detail!==e.completion.label)}))),this._toDispose.add(e.onDetailsKeyDown((e=>{e.toKeyCodeChord().equals(new Ct(!0,!1,!1,!1,33))||Ve&&e.toKeyCodeChord().equals(new Ct(!1,!1,!1,!0,33))?e.stopPropagation():e.toKeyCodeChord().isModifierKey()||this.editor.focus()}))),e}))),this._overtypingCapturer=this._toDispose.add(new Ss(as(e.getDomNode()),(()=>this._toDispose.add(new v4(this.editor,this.model))))),this._alternatives=this._toDispose.add(new Ss(as(e.getDomNode()),(()=>this._toDispose.add(new l4(this.editor,this._contextKeyService))))),this._toDispose.add(o.createInstance(r4,e)),this._toDispose.add(this.model.onDidTrigger((e=>{this.widget.value.showTriggered(e.auto,e.shy?250:50),this._lineSuffix.value=new $4(this.editor.getModel(),e.position)}))),this._toDispose.add(this.model.onDidSuggest((e=>{if(e.triggerOptions.shy)return;let t=-1;for(const i of this._selectors.itemsOrderedByPriorityDesc)if(t=i.select(this.editor.getModel(),this.editor.getPosition(),e.completionModel.items),-1!==t)break;-1===t&&(t=0);let i=!1;if(e.triggerOptions.auto){const t=this.editor.getOption(117);"never"===t.selectionMode||"always"===t.selectionMode?i="never"===t.selectionMode:"whenTriggerCharacter"===t.selectionMode?i=1!==e.triggerOptions.triggerKind:"whenQuickSuggestion"===t.selectionMode&&(i=1===e.triggerOptions.triggerKind&&!e.triggerOptions.refilter)}this.widget.value.showSuggestions(e.completionModel,t,e.isFrozen,e.triggerOptions.auto,i)}))),this._toDispose.add(this.model.onDidCancel((e=>{e.retrigger||this.widget.value.hideWidget()}))),this._toDispose.add(this.editor.onDidBlurEditorWidget((()=>{this.model.cancel(),this.model.clear()})));const l=C2.AcceptSuggestionsOnEnter.bindTo(n),h=()=>{const e=this.editor.getOption(1);l.set("on"===e||"smart"===e)};this._toDispose.add(this.editor.onDidChangeConfiguration((()=>h()))),h()}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose(),this._onWillInsertSuggestItem.dispose()}_insertSuggestion(e,t){if(!e||!e.item)return this._alternatives.value.reset(),this.model.cancel(),void this.model.clear();if(!this.editor.hasModel())return;const i=G2.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const n=this.editor.getModel(),o=n.getAlternativeVersionId(),{item:s}=e,r=[],a=new Pt;1&t||this.editor.pushUndoStop();const l=this.getOverwriteInfo(s,Boolean(8&t));this._memoryService.memorize(n,this.editor.getPosition(),s);const c=s.isResolved;let u=-1,g=-1;if(Array.isArray(s.completion.additionalTextEdits)){this.model.cancel();const e=PN.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",s.completion.additionalTextEdits.map((e=>vG.replaceMove(tc.lift(e.range),e.text)))),e.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!c){const e=new V;let i;const o=n.onDidChangeContent((e=>{if(e.isFlush)return a.cancel(),void o.dispose();for(const t of e.changes){const e=tc.getEndPosition(t.range);i&&!ch.isBefore(e,i)||(i=e)}})),l=t;t|=2;let h=!1;const d=this.editor.onWillType((()=>{d.dispose(),h=!0,2&l||this.editor.pushUndoStop()}));r.push(s.resolve(a.token).then((()=>{if(!s.completion.additionalTextEdits||a.token.isCancellationRequested)return;if(i&&s.completion.additionalTextEdits.some((e=>ch.isBefore(i,tc.getStartPosition(e.range)))))return!1;h&&this.editor.pushUndoStop();const e=PN.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",s.completion.additionalTextEdits.map((e=>vG.replaceMove(tc.lift(e.range),e.text)))),e.restoreRelativeVerticalPositionOfCursor(this.editor),!h&&2&l||this.editor.pushUndoStop(),!0})).then((t=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",e.elapsed(),t),g=!0===t?1:!1===t?0:-2})).finally((()=>{o.dispose(),d.dispose()})))}let{insertText:p}=s.completion;if(4&s.completion.insertTextRules||(p=o2.escape(p)),this.model.cancel(),i.insert(p,{overwriteBefore:l.overwriteBefore,overwriteAfter:l.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(1&s.completion.insertTextRules),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),2&t||this.editor.pushUndoStop(),s.completion.command)if(s.completion.command.id===Y4.id)this.model.trigger({auto:!0,retrigger:!0});else{const e=new V;r.push(this._commandService.executeCommand(s.completion.command.id,...s.completion.command.arguments?[...s.completion.command.arguments]:[]).catch((e=>{s.completion.extensionId?d(e):h(e)})).finally((()=>{u=e.elapsed()})))}4&t&&this._alternatives.value.set(e,(e=>{for(a.cancel();n.canUndo();){o!==n.getAlternativeVersionId()&&n.undo(),this._insertSuggestion(e,3|(8&t?8:0));break}})),this._alertCompletionItem(s),Promise.all(r).finally((()=>{this._reportSuggestionAcceptedTelemetry(s,n,c,u,g),this.model.clear(),a.dispose()}))}_reportSuggestionAcceptedTelemetry(e,t,i,n,o){var s,r,a;0!==Math.floor(100*Math.random())&&this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:null!==(r=null===(s=e.extensionId)||void 0===s?void 0:s.value)&&void 0!==r?r:"unknown",providerId:null!==(a=e.provider._debugDisplayName)&&void 0!==a?a:"unknown",kind:e.completion.kind,basenameHash:Xo(Kl(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:jl(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:n,additionalEditsAsync:o})}getOverwriteInfo(e,t){fl(this.editor.hasModel());let i="replace"===this.editor.getOption(117).insertMode;t&&(i=!i);const n=e.position.column-e.editStart.column,o=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column;return{overwriteBefore:n+(this.editor.getPosition().column-e.position.column),overwriteAfter:o+(this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0)}}_alertCompletionItem(e){Wc(e.completion.additionalTextEdits)&&Zr(me(0,"Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length))}triggerSuggest(e,t,i){this.editor.hasModel()&&(this.model.trigger({auto:null!=t&&t,completionOptions:{providerFilter:e,kindFilter:i?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},n=e=>{if(4&e.completion.insertTextRules||e.completion.additionalTextEdits)return!0;const t=this.editor.getPosition(),i=e.editStart.column,n=t.column;return n-i!==e.completion.insertText.length||this.editor.getModel().getValueInRange({startLineNumber:t.lineNumber,startColumn:i,endLineNumber:t.lineNumber,endColumn:n})!==e.completion.insertText};z.once(this.model.onDidTrigger)((e=>{const t=[];z.any(this.model.onDidTrigger,this.model.onDidCancel)((()=>{E(t),i()}),void 0,t),this.model.onDidSuggest((({completionModel:e})=>{if(E(t),0===e.items.length)return void i();const o=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),e.items),s=e.items[o];n(s)?(this.editor.pushUndoStop(),this._insertSuggestion({index:o,item:s,model:e},7)):i()}),void 0,t)})),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let n=0;e&&(n|=4),t&&(n|=8),this._insertSuggestion(i,n)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}focusSuggestion(){this.widget.value.focusSelected()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.value.forceRenderingAbove()}stopForceRenderingAbove(){this.widget.isInitialized&&this.widget.value.stopForceRenderingAbove()}registerSelector(e){return this._selectors.register(e)}};G4.ID="editor.contrib.suggestController",G4=j4=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([q4(1,o4),q4(2,wh),q4(3,sd),q4(4,lh),q4(5,Md),q4(6,Id)],G4);class Z4{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(-1!==this._items.indexOf(e))throw new Error("Value is already registered");return this._items.push(e),this._items.sort(((e,t)=>this.prioritySelector(t)-this.prioritySelector(e))),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class Y4 extends zd{constructor(){super({id:Y4.id,label:me(0,"Trigger Suggest"),alias:"Trigger Suggest",precondition:Bh.and(nc.writable,nc.hasCompletionItemProvider,C2.Visible.toNegated()),kbOpts:{kbExpr:nc.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,i){const n=G4.get(t);if(!n)return;let o;i&&"object"==typeof i&&!0===i.auto&&(o=!0),n.triggerSuggest(void 0,o,void 0)}}Y4.id="editor.action.triggerSuggest",Gd(G4.ID,G4,2),qd(Y4);const Q4=190,X4=Vd.bindToContribution(G4.get);jd(new X4({id:"acceptSelectedSuggestion",precondition:Bh.and(C2.Visible,C2.HasFocusedSuggestion),handler(e){e.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:Bh.and(C2.Visible,nc.textInputFocus),weight:Q4},{primary:3,kbExpr:Bh.and(C2.Visible,nc.textInputFocus,C2.AcceptSuggestionsOnEnter,C2.MakesTextEdit),weight:Q4}],menuOpts:[{menuId:y2,title:me(0,"Insert"),group:"left",order:1,when:C2.HasInsertAndReplaceRange.toNegated()},{menuId:y2,title:me(0,"Insert"),group:"left",order:1,when:Bh.and(C2.HasInsertAndReplaceRange,C2.InsertMode.isEqualTo("insert"))},{menuId:y2,title:me(0,"Replace"),group:"left",order:1,when:Bh.and(C2.HasInsertAndReplaceRange,C2.InsertMode.isEqualTo("replace"))}]})),jd(new X4({id:"acceptAlternativeSelectedSuggestion",precondition:Bh.and(C2.Visible,nc.textInputFocus,C2.HasFocusedSuggestion),kbOpts:{weight:Q4,kbExpr:nc.textInputFocus,primary:1027,secondary:[1026]},handler(e){e.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:y2,group:"left",order:2,when:Bh.and(C2.HasInsertAndReplaceRange,C2.InsertMode.isEqualTo("insert")),title:me(0,"Replace")},{menuId:y2,group:"left",order:2,when:Bh.and(C2.HasInsertAndReplaceRange,C2.InsertMode.isEqualTo("replace")),title:me(0,"Insert")}]})),Ch.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion"),jd(new X4({id:"hideSuggestWidget",precondition:C2.Visible,handler:e=>e.cancelSuggestWidget(),kbOpts:{weight:Q4,kbExpr:nc.textInputFocus,primary:9,secondary:[1033]}})),jd(new X4({id:"selectNextSuggestion",precondition:Bh.and(C2.Visible,Bh.or(C2.MultipleSuggestions,C2.HasFocusedSuggestion.negate())),handler:e=>e.selectNextSuggestion(),kbOpts:{weight:Q4,kbExpr:nc.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})),jd(new X4({id:"selectNextPageSuggestion",precondition:Bh.and(C2.Visible,Bh.or(C2.MultipleSuggestions,C2.HasFocusedSuggestion.negate())),handler:e=>e.selectNextPageSuggestion(),kbOpts:{weight:Q4,kbExpr:nc.textInputFocus,primary:12,secondary:[2060]}})),jd(new X4({id:"selectLastSuggestion",precondition:Bh.and(C2.Visible,Bh.or(C2.MultipleSuggestions,C2.HasFocusedSuggestion.negate())),handler:e=>e.selectLastSuggestion()})),jd(new X4({id:"selectPrevSuggestion",precondition:Bh.and(C2.Visible,Bh.or(C2.MultipleSuggestions,C2.HasFocusedSuggestion.negate())),handler:e=>e.selectPrevSuggestion(),kbOpts:{weight:Q4,kbExpr:nc.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})),jd(new X4({id:"selectPrevPageSuggestion",precondition:Bh.and(C2.Visible,Bh.or(C2.MultipleSuggestions,C2.HasFocusedSuggestion.negate())),handler:e=>e.selectPrevPageSuggestion(),kbOpts:{weight:Q4,kbExpr:nc.textInputFocus,primary:11,secondary:[2059]}})),jd(new X4({id:"selectFirstSuggestion",precondition:Bh.and(C2.Visible,Bh.or(C2.MultipleSuggestions,C2.HasFocusedSuggestion.negate())),handler:e=>e.selectFirstSuggestion()})),jd(new X4({id:"focusSuggestion",precondition:Bh.and(C2.Visible,C2.HasFocusedSuggestion.negate()),handler:e=>e.focusSuggestion(),kbOpts:{weight:Q4,kbExpr:nc.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}})),jd(new X4({id:"focusAndAcceptSuggestion",precondition:Bh.and(C2.Visible,C2.HasFocusedSuggestion.negate()),handler:e=>{e.focusSuggestion(),e.acceptSelectedSuggestion(!0,!1)}})),jd(new X4({id:"toggleSuggestionDetails",precondition:Bh.and(C2.Visible,C2.HasFocusedSuggestion),handler:e=>e.toggleSuggestionDetails(),kbOpts:{weight:Q4,kbExpr:nc.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:y2,group:"right",order:1,when:Bh.and(C2.DetailsVisible,C2.CanResolve),title:me(0,"show less")},{menuId:y2,group:"right",order:1,when:Bh.and(C2.DetailsVisible.toNegated(),C2.CanResolve),title:me(0,"show more")}]})),jd(new X4({id:"toggleExplainMode",precondition:C2.Visible,handler:e=>e.toggleExplainMode(),kbOpts:{weight:100,primary:2138}})),jd(new X4({id:"toggleSuggestionFocus",precondition:C2.Visible,handler:e=>e.toggleSuggestionFocus(),kbOpts:{weight:Q4,kbExpr:nc.textInputFocus,primary:2570,mac:{primary:778}}})),jd(new X4({id:"insertBestCompletion",precondition:Bh.and(nc.textInputFocus,Bh.equals("config.editor.tabCompletion","on"),r4.AtEnd,C2.Visible.toNegated(),l4.OtherSuggestions.toNegated(),G2.InSnippetMode.toNegated()),handler:(e,t)=>{e.triggerSuggestAndAcceptBest(ll(t)?{fallback:"tab",...t}:{fallback:"tab"})},kbOpts:{weight:Q4,primary:2}})),jd(new X4({id:"insertNextSuggestion",precondition:Bh.and(nc.textInputFocus,Bh.equals("config.editor.tabCompletion","on"),l4.OtherSuggestions,C2.Visible.toNegated(),G2.InSnippetMode.toNegated()),handler:e=>e.acceptNextSuggestion(),kbOpts:{weight:Q4,kbExpr:nc.textInputFocus,primary:2}})),jd(new X4({id:"insertPrevSuggestion",precondition:Bh.and(nc.textInputFocus,Bh.equals("config.editor.tabCompletion","on"),l4.OtherSuggestions,C2.Visible.toNegated(),G2.InSnippetMode.toNegated()),handler:e=>e.acceptPrevSuggestion(),kbOpts:{weight:Q4,kbExpr:nc.textInputFocus,primary:1026}})),qd(class extends zd{constructor(){super({id:"editor.action.resetSuggestSize",label:me(0,"Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(e,t){var i;null===(i=G4.get(t))||void 0===i||i.resetWidgetSize()}});class J4 extends T{get selectedItem(){return this._selectedItem}constructor(e,t,i,n){super(),this.editor=e,this.suggestControllerPreselector=t,this.checkModelVersion=i,this.onWillAccept=n,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._selectedItem=d$(this,void 0),this._register(e.onKeyDown((e=>{e.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))}))),this._register(e.onKeyUp((e=>{e.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))})));const o=G4.get(this.editor);if(o){this._register(o.registerSelector({priority:100,select:(e,t,i)=>{var n;e$((e=>this.checkModelVersion(e)));const s=this.editor.getModel();if(!s)return-1;const r=null===(n=this.suggestControllerPreselector())||void 0===n?void 0:n.removeCommonPrefix(s);if(!r)return-1;const a=ch.lift(t),l=_u(i.map(((e,t)=>{const i=e5.fromSuggestion(o,s,a,e,this.isShiftKeyPressed).toSingleTextEdit().removeCommonPrefix(s);return{index:t,valid:r.augments(i),prefixLength:i.text.length,suggestItem:e}})).filter((e=>e&&e.valid&&e.prefixLength>0)),Yc((e=>e.prefixLength),Qc));return l?l.index:-1}}));let e=!1;const t=()=>{e||(e=!0,this._register(o.widget.value.onDidShow((()=>{this.isSuggestWidgetVisible=!0,this.update(!0)}))),this._register(o.widget.value.onDidHide((()=>{this.isSuggestWidgetVisible=!1,this.update(!1)}))),this._register(o.widget.value.onDidFocus((()=>{this.isSuggestWidgetVisible=!0,this.update(!0)}))))};this._register(z.once(o.model.onDidTrigger)((e=>{t()}))),this._register(o.onWillInsertSuggestItem((e=>{const t=this.editor.getPosition(),i=this.editor.getModel();if(!t||!i)return;const n=e5.fromSuggestion(o,i,t,e.item,this.isShiftKeyPressed);this.onWillAccept(n)})))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();var i,n;this._isActive===e&&((i=this._currentSuggestItemInfo)===(n=t)||i&&n&&i.equals(n))||(this._isActive=e,this._currentSuggestItemInfo=t,e$((e=>{this.checkModelVersion(e),this._selectedItem.set(this._isActive?this._currentSuggestItemInfo:void 0,e)})))}getSuggestItemInfo(){const e=G4.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),n=this.editor.getModel();return t&&i&&n?e5.fromSuggestion(e,n,i,t.item,this.isShiftKeyPressed):void 0}stopForceRenderingAbove(){const e=G4.get(this.editor);null==e||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=G4.get(this.editor);null==e||e.forceRenderingAbove()}}class e5{static fromSuggestion(e,t,i,n,o){let{insertText:s}=n.completion,r=!1;if(4&n.completion.insertTextRules){const e=(new o2).parse(s);e.children.length<100&&K2.adjustWhitespace(t,i,!0,e),s=e.toString(),r=!0}const a=e.getOverwriteInfo(n,o);return new e5(tc.fromPositions(i.delta(0,-a.overwriteBefore),i.delta(0,Math.max(a.overwriteAfter,0))),s,n.completion.kind,r)}constructor(e,t,i,n){this.range=e,this.insertText=t,this.completionItemKind=i,this.isSnippetText=n}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new fC(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new d2(this.range,this.insertText)}}var t5,i5=function(e,t){return function(i,n){t(i,n,e)}};let n5=t5=class extends T{static get(e){return e.getContribution(t5.ID)}constructor(e,t,i,n,o,s,r,a,l){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._configurationService=n,this._commandService=o,this._debounceService=s,this._languageFeaturesService=r,this._audioCueService=a,this._keybindingService=l,this.model=u$("inlineCompletionModel",void 0),this._textModelVersionId=d$(this,-1),this._cursorPosition=d$(this,new ch(1,1)),this._suggestWidgetAdaptor=this._register(new J4(this.editor,(()=>{var e,t;return null===(t=null===(e=this.model.get())||void 0===e?void 0:e.selectedInlineCompletion.get())||void 0===t?void 0:t.toSingleTextEdit(void 0)}),(e=>this.updateObservables(e,Y2.Other)),(e=>{e$((t=>{var i;this.updateObservables(t,Y2.Other),null===(i=this.model.get())||void 0===i||i.handleSuggestAccepted(e)}))}))),this._enabled=D$(this.editor.onDidChangeConfiguration,(()=>this.editor.getOption(62).enabled)),this._ghostTextWidget=this._register(this._instantiationService.createInstance(U1,this.editor,{ghostText:this.model.map(((e,t)=>null==e?void 0:e.ghostText.read(t))),minReservedLineCount:L$(0),targetTextModel:this.model.map((e=>null==e?void 0:e.textModel))})),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._playAudioCueSignal=M$(this),this._isReadonly=D$(this.editor.onDidChangeConfiguration,(()=>this.editor.getOption(90))),this._textModel=D$(this.editor.onDidChangeModel,(()=>this.editor.getModel())),this._textModelIfWritable=m$((e=>this._isReadonly.read(e)?void 0:this._textModel.read(e))),this._register(new I1(this._contextKeyService,this.model)),this._register(w$((i=>{const n=this._textModelIfWritable.read(i);e$((i=>{if(this.model.set(void 0,i),this.updateObservables(i,Y2.Other),n){const o=t.createInstance(X2,n,this._suggestWidgetAdaptor.selectedItem,this._cursorPosition,this._textModelVersionId,this._debounceValue,D$(e.onDidChangeConfiguration,(()=>e.getOption(117).preview)),D$(e.onDidChangeConfiguration,(()=>e.getOption(117).previewMode)),D$(e.onDidChangeConfiguration,(()=>e.getOption(62).mode)),this._enabled);this.model.set(o,i)}}))})));const h=e=>{var t;return e.isUndoing?Y2.Undo:e.isRedoing?Y2.Redo:(null===(t=this.model.get())||void 0===t?void 0:t.isAcceptingPartially)?Y2.AcceptWord:Y2.Other};let d;this._register(e.onDidChangeModelContent((e=>e$((t=>this.updateObservables(t,h(e))))))),this._register(e.onDidChangeCursorPosition((e=>e$((t=>{var i;this.updateObservables(t,Y2.Other),3!==e.reason&&"api"!==e.source||null===(i=this.model.get())||void 0===i||i.stop(t)}))))),this._register(e.onDidType((()=>e$((e=>{var t;this.updateObservables(e,Y2.Other),this._enabled.get()&&(null===(t=this.model.get())||void 0===t||t.trigger(e))}))))),this._register(this._commandService.onDidExecuteCommand((t=>{new Set([NS.Tab.id,NS.DeleteLeft.id,NS.DeleteRight.id,F$,"acceptSelectedSuggestion"]).has(t.commandId)&&e.hasTextFocus()&&this._enabled.get()&&e$((e=>{var t;null===(t=this.model.get())||void 0===t||t.trigger(e)}))}))),this._register(this.editor.onDidBlurEditorWidget((()=>{this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(62).keepOnBlur||eG.dropDownVisible||e$((e=>{var t;null===(t=this.model.get())||void 0===t||t.stop(e)}))}))),this._register(w$((e=>{var t;const i=null===(t=this.model.read(e))||void 0===t?void 0:t.state.read(e);(null==i?void 0:i.suggestItem)?i.ghostText.lineCount>=2&&this._suggestWidgetAdaptor.forceRenderingAbove():this._suggestWidgetAdaptor.stopForceRenderingAbove()}))),this._register(I((()=>{this._suggestWidgetAdaptor.stopForceRenderingAbove()}))),this._register(y$({handleChange:(e,t)=>(e.didChange(this._playAudioCueSignal)&&(d=void 0),!0)},(async e=>{this._playAudioCueSignal.read(e);const t=this.model.read(e),i=null==t?void 0:t.state.read(e);if(t&&i&&i.inlineCompletion){if(i.inlineCompletion.semanticId!==d){d=i.inlineCompletion.semanticId;const e=t.textModel.getLineContent(i.ghostText.lineNumber);this._audioCueService.playAudioCue(rZ.inlineSuggestion).then((()=>{this.editor.getOption(8)&&this.provideScreenReaderUpdate(i.ghostText.renderForScreenReader(e))}))}}else d=void 0}))),this._register(new Q$(this.editor,this.model,this._instantiationService)),this._register(this._configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})}))),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})}playAudioCue(e){this._playAudioCueSignal.trigger(e)}provideScreenReaderUpdate(e){const t=this._contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let n;!t&&i&&this.editor.getOption(147)&&(n=me(0,"Inspect this in the accessible view ({0})",i.getAriaLabel())),Zr(n?e+", "+n:e)}updateObservables(e,t){var i,n;const o=this.editor.getModel();this._textModelVersionId.set(null!==(i=null==o?void 0:o.getVersionId())&&void 0!==i?i:-1,e,t),this._cursorPosition.set(null!==(n=this.editor.getPosition())&&void 0!==n?n:new ch(1,1),e)}shouldShowHoverAt(e){var t;const i=null===(t=this.model.get())||void 0===t?void 0:t.ghostText.get();return!!i&&i.parts.some((t=>e.containsPosition(new ch(i.lineNumber,t.column))))}shouldShowHoverAtViewZone(e){return this._ghostTextWidget.ownsViewZone(e)}};n5.ID="editor.contrib.inlineCompletionsController",n5=t5=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([i5(1,lh),i5(2,sd),i5(3,ug),i5(4,wh),i5(5,hI),i5(6,Jk),i5(7,nZ),i5(8,ML)],n5);class o5 extends zd{constructor(){super({id:o5.ID,label:me(0,"Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:Bh.and(nc.writable,I1.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}async run(e,t){var i;const n=n5.get(t);null===(i=null==n?void 0:n.model.get())||void 0===i||i.next()}}o5.ID=W$;class s5 extends zd{constructor(){super({id:s5.ID,label:me(0,"Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:Bh.and(nc.writable,I1.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}async run(e,t){var i;const n=n5.get(t);null===(i=null==n?void 0:n.model.get())||void 0===i||i.previous()}}s5.ID=B$;class r5 extends zd{constructor(){super({id:r5.ID,label:me(0,"Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:I1.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}async run(e,t){const i=n5.get(t);e$((e=>{var t;null===(t=null==i?void 0:i.model.get())||void 0===t||t.stop(e)}))}}r5.ID="editor.action.inlineSuggest.hide";class a5 extends Ed{constructor(){super({id:a5.ID,title:me(0,"Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:yd.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:Bh.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e,t){const i=e.get(ug),n="always"===i.getValue("editor.inlineSuggest.showToolbar")?"onHover":"always";i.updateValue("editor.inlineSuggest.showToolbar",n)}}a5.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";var l5=function(e,t){return function(i,n){t(i,n,e)}};class h5{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let d5=class{constructor(e,t,i,n,o,s){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=n,this._instantiationService=o,this._telemetryService=s,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=n5.get(this._editor);if(!t)return null;const i=e.target;if(8===i.type){const n=i.detail;if(t.shouldShowHoverAtViewZone(n.viewZoneId))return new Wj(1e3,this,tc.fromPositions(this._editor.getModel().validatePosition(n.positionBefore||n.position)),e.event.posx,e.event.posy,!1)}return 7===i.type&&t.shouldShowHoverAt(i.range)||6===i.type&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new Wj(1e3,this,i.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if("onHover"!==this._editor.getOption(62).showToolbar)return[];const i=n5.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new h5(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new M,n=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(8)&&this.renderScreenReaderText(e,n,i);const o=n.controller.model.get(),s=this._instantiationService.createInstance(eG,this._editor,!1,L$(null),o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.selectedInlineCompletion.map((e=>{var t;return null!==(t=null==e?void 0:e.inlineCompletion.source.inlineCompletions.commands)&&void 0!==t?t:[]})));return e.fragment.appendChild(s.getDomNode()),o.triggerExplicitly(),i.add(s),i}renderScreenReaderText(e,t,i){const n=mr,o=n("div.hover-row.markdown-hover"),s=hr(o,n("div.hover-contents",{"aria-live":"assertive"})),r=i.add(new jx({editor:this._editor},this._languageService,this._openerService));i.add(w$((n=>{var o;const a=null===(o=t.controller.model.read(n))||void 0===o?void 0:o.ghostText.read(n);if(a){const t=this._editor.getModel().getLineContent(a.lineNumber);(t=>{i.add(r.onDidRenderAsync((()=>{s.className="hover-contents code-hover-contents",e.onContentsChanged()})));const n=me(0,"Suggestion:"),o=i.add(r.render((new eh).appendText(n).appendCodeblock("text",t)));s.replaceChildren(o.element)})(a.renderForScreenReader(t))}else cr(s)}))),e.fragment.appendChild(o)}};d5=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([l5(1,yu),l5(2,Hx),l5(3,BS),l5(4,lh),l5(5,Id)],d5),Gd(n5.ID,n5,3),qd(class extends zd{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:me(0,"Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:nc.writable})}async run(e,t){const i=n5.get(t);await async function(e,t){const i=new n$(e,void 0);try{await e(i)}finally{i.finish()}}((async e=>{var t;await(null===(t=null==i?void 0:i.model.get())||void 0===t?void 0:t.triggerExplicitly(e)),null==i||i.playAudioCue(e)}))}}),qd(o5),qd(s5),qd(class extends zd{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:me(0,"Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:Bh.and(nc.writable,I1.inlineSuggestionVisible),kbOpts:{weight:101,primary:2065,kbExpr:Bh.and(nc.writable,I1.inlineSuggestionVisible)},menuOpts:[{menuId:yd.InlineSuggestionToolbar,title:me(0,"Accept Word"),group:"primary",order:2}]})}async run(e,t){var i;const n=n5.get(t);await(null===(i=null==n?void 0:n.model.get())||void 0===i?void 0:i.acceptNextWord(n.editor))}}),qd(class extends zd{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:me(0,"Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:Bh.and(nc.writable,I1.inlineSuggestionVisible),kbOpts:{weight:101},menuOpts:[{menuId:yd.InlineSuggestionToolbar,title:me(0,"Accept Line"),group:"secondary",order:2}]})}async run(e,t){var i;const n=n5.get(t);await(null===(i=null==n?void 0:n.model.get())||void 0===i?void 0:i.acceptNextLine(n.editor))}}),qd(class extends zd{constructor(){super({id:F$,label:me(0,"Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:I1.inlineSuggestionVisible,menuOpts:[{menuId:yd.InlineSuggestionToolbar,title:me(0,"Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:Bh.and(I1.inlineSuggestionVisible,nc.tabMovesFocus.toNegated(),I1.inlineSuggestionHasIndentationLessThanTabSize,C2.Visible.toNegated(),nc.hoverFocused.toNegated())}})}async run(e,t){var i;const n=n5.get(t);n&&(null===(i=n.model.get())||void 0===i||i.accept(n.editor),n.editor.focus())}}),qd(r5),Nd(a5),Vj.register(d5);var c5=i(5189),u5={};u5.styleTagTransform=Vr(),u5.setAttributes=Pr(),u5.insert=Rr().bind(null,"head"),u5.domAPI=Tr(),u5.insertStyleElement=Br(),Ir()(c5.Z,u5),c5.Z&&c5.Z.locals&&c5.Z.locals;const g5=hh("themeService");var p5,m5=function(e,t){return function(i,n){t(i,n,e)}};let f5=p5=class extends T{static get(e){return e.getContribution(p5.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel((e=>this.stop()))),this._register(this._editor.onDidChangeModelLanguage((e=>this.stop()))),this._register(SC.onDidChange((e=>this.stop()))),this._register(this._editor.onKeyUp((e=>9===e.keyCode&&this.stop())))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new _5(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};f5.ID="editor.contrib.inspectTokens",f5=p5=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([m5(1,g5),m5(2,yu)],f5);class _5 extends T{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=function(e,t){const i=SC.get(t);if(i)return i;const n=e.encodeLanguageId(t);return{getInitialState:()=>kC,tokenize:(e,i,n)=>LC(t,n),tokenizeEncoded:(e,t,i)=>xC(n,i)}}(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition((e=>this._compute(this._editor.getPosition())))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return _5._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let n=t.tokens1.length-1;n>=0;n--){const o=t.tokens1[n];if(e.column-1>=o.offset){i=n;break}}let n=0;for(let i=t.tokens2.length>>>1;i>=0;i--)if(e.column-1>=t.tokens2[i<<1]){n=i;break}const o=this._model.getLineContent(e.lineNumber);let s="";if(i<t.tokens1.length){const e=t.tokens1[i].offset,n=i+1<t.tokens1.length?t.tokens1[i+1].offset:o.length;s=o.substring(e,n)}cr(this._domNode,mr("h2.tm-token",void 0,function(e){let t="";for(let i=0,n=e.length;i<n;i++){const n=e.charCodeAt(i);switch(n){case 9:t+="→";break;case 32:t+="·";break;default:t+=String.fromCharCode(n)}}return t}(s),mr("span.tm-token-length",void 0,`${s.length} ${1===s.length?"char":"chars"}`))),hr(this._domNode,mr("hr.tokens-inspect-separator",{style:"clear:both"}));const r=1+(n<<1)<t.tokens2.length?this._decodeMetadata(t.tokens2[1+(n<<1)]):null;hr(this._domNode,mr("table.tm-metadata-table",void 0,mr("tbody",void 0,mr("tr",void 0,mr("td.tm-metadata-key",void 0,"language"),mr("td.tm-metadata-value",void 0,`${r?r.languageId:"-?-"}`)),mr("tr",void 0,mr("td.tm-metadata-key",void 0,"token type"),mr("td.tm-metadata-value",void 0,`${r?this._tokenTypeToString(r.tokenType):"-?-"}`)),mr("tr",void 0,mr("td.tm-metadata-key",void 0,"font style"),mr("td.tm-metadata-value",void 0,`${r?this._fontStyleToString(r.fontStyle):"-?-"}`)),mr("tr",void 0,mr("td.tm-metadata-key",void 0,"foreground"),mr("td.tm-metadata-value",void 0,`${r?ru.Format.CSS.formatHex(r.foreground):"-?-"}`)),mr("tr",void 0,mr("td.tm-metadata-key",void 0,"background"),mr("td.tm-metadata-value",void 0,`${r?ru.Format.CSS.formatHex(r.background):"-?-"}`))))),hr(this._domNode,mr("hr.tokens-inspect-separator")),i<t.tokens1.length&&hr(this._domNode,mr("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const t=SC.getColorMap(),i=jp.getLanguageId(e),n=jp.getTokenType(e),o=jp.getFontStyle(e),s=jp.getForeground(e),r=jp.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(i),tokenType:n,fontStyle:o,foreground:t[s],background:t[r]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return 1&e&&(t+="italic "),2&e&&(t+="bold "),4&e&&(t+="underline "),8&e&&(t+="strikethrough "),0===t.length&&(t="---"),t}_getTokensAtLine(e){const t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),n=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:i.tokens,tokens2:n.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}}_5._ID="editor.contrib.inspectTokensWidget",Gd(f5.ID,f5,4),qd(class extends zd{constructor(){super({id:"editor.action.inspectTokens",label:O0.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=f5.get(t);null==i||i.launch()}}),qd(class extends zd{constructor(){super({id:"expandLineSelection",label:me(0,"Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:nc.textInputFocus,primary:2090}})}run(e,t,i){if(i=i||{},!t.hasModel())return;const n=t._getViewModel();n.model.pushStackElement(),n.setCursorStates(i.source,3,iS.expandLineSelection(n,n.getCursorStates())),n.revealPrimaryCursor(i.source,!0)}});class v5{constructor(e,t){this._selection=e,this._cursors=t,this._selectionId=null}getEditOperations(e,t){const i=function(e,t){t.sort(((e,t)=>e.lineNumber===t.lineNumber?e.column-t.column:e.lineNumber-t.lineNumber));for(let e=t.length-2;e>=0;e--)t[e].lineNumber===t[e+1].lineNumber&&t.splice(e,1);const i=[];let n=0,o=0;const s=t.length;for(let r=1,a=e.getLineCount();r<=a;r++){const a=e.getLineContent(r),l=a.length+1;let h=0;if(o<s&&t[o].lineNumber===r&&(h=t[o].column,o++,h===l))continue;if(0===a.length)continue;const d=vn(a);let c=0;if(-1===d)c=1;else{if(d===a.length-1)continue;c=d+2}c=Math.max(h,c),i[n++]=vG.delete(new tc(r,c,r,l))}return i}(e,this._cursors);for(let e=0,n=i.length;e<n;e++){const n=i[e];t.addEditOperation(n.range,n.text)}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}class b5{constructor(e,t,i){this._selection=e,this._isCopyingDown=t,this._noop=i||!1,this._selectionDirection=0,this._selectionId=null,this._startLineNumberDelta=0,this._endLineNumberDelta=0}getEditOperations(e,t){let i=this._selection;this._startLineNumberDelta=0,this._endLineNumberDelta=0,i.startLineNumber<i.endLineNumber&&1===i.endColumn&&(this._endLineNumberDelta=1,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const n=[];for(let t=i.startLineNumber;t<=i.endLineNumber;t++)n.push(e.getLineContent(t));const o=n.join("\n");""===o&&this._isCopyingDown&&(this._startLineNumberDelta++,this._endLineNumberDelta++),this._noop?t.addEditOperation(new tc(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber+1,1),i.endLineNumber===e.getLineCount()?"":"\n"):this._isCopyingDown?t.addEditOperation(new tc(i.startLineNumber,1,i.startLineNumber,1),o+"\n"):t.addEditOperation(new tc(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),"\n"+o),this._selectionId=t.trackSelection(i),this._selectionDirection=this._selection.getDirection()}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);if(0!==this._startLineNumberDelta||0!==this._endLineNumberDelta){let e=i.startLineNumber,t=i.startColumn,n=i.endLineNumber,o=i.endColumn;0!==this._startLineNumberDelta&&(e+=this._startLineNumberDelta,t=1),0!==this._endLineNumberDelta&&(n+=this._endLineNumberDelta,o=1),i=ic.createWithDirection(e,t,n,o,this._selectionDirection)}return i}}let w5=class{constructor(e,t,i,n){this._languageConfigurationService=n,this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const i=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===i)return void(this._selectionId=t.trackSelection(this._selection));if(!this._isMovingDown&&1===this._selection.startLineNumber)return void(this._selectionId=t.trackSelection(this._selection));this._moveEndPositionDown=!1;let n=this._selection;n.startLineNumber<n.endLineNumber&&1===n.endColumn&&(this._moveEndPositionDown=!0,n=n.setEndPosition(n.endLineNumber-1,e.getLineMaxColumn(n.endLineNumber-1)));const{tabSize:o,indentSize:s,insertSpaces:r}=e.getOptions(),a=this.buildIndentConverter(o,s,r),l={tokenization:{getLineTokens:t=>e.tokenization.getLineTokens(t),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(t,i)=>e.getLanguageIdAtPosition(t,i)},getLineContent:null};if(n.startLineNumber===n.endLineNumber&&1===e.getLineMaxColumn(n.startLineNumber)){const i=n.startLineNumber,o=this._isMovingDown?i+1:i-1;1===e.getLineMaxColumn(o)?t.addEditOperation(new tc(1,1,1,1),null):(t.addEditOperation(new tc(i,1,i,1),e.getLineContent(o)),t.addEditOperation(new tc(o,1,o,e.getLineMaxColumn(o)),null)),n=new ic(o,1,o,1)}else{let i,s;if(this._isMovingDown){i=n.endLineNumber+1,s=e.getLineContent(i),t.addEditOperation(new tc(i-1,e.getLineMaxColumn(i-1),i,e.getLineMaxColumn(i)),null);let h=s;if(this.shouldAutoIndent(e,n)){const d=this.matchEnterRule(e,a,o,i,n.startLineNumber-1);if(null!==d){const t=t1(d+e1(_n(e.getLineContent(i)),o),o,r);h=t+this.trimStart(s)}else{l.getLineContent=t=>t===n.startLineNumber?e.getLineContent(i):e.getLineContent(t);const t=uS(this._autoIndent,l,e.getLanguageIdAtPosition(i,1),n.startLineNumber,a,this._languageConfigurationService);if(null!==t){const n=_n(e.getLineContent(i)),a=e1(t,o);if(a!==e1(n,o)){const e=t1(a,o,r);h=e+this.trimStart(s)}}}t.addEditOperation(new tc(n.startLineNumber,1,n.startLineNumber,1),h+"\n");const c=this.matchEnterRuleMovingDown(e,a,o,n.startLineNumber,i,h);if(null!==c)0!==c&&this.getIndentEditsOfMovingBlock(e,t,n,o,r,c);else{l.getLineContent=t=>t===n.startLineNumber?h:t>=n.startLineNumber+1&&t<=n.endLineNumber+1?e.getLineContent(t-1):e.getLineContent(t);const s=uS(this._autoIndent,l,e.getLanguageIdAtPosition(i,1),n.startLineNumber+1,a,this._languageConfigurationService);if(null!==s){const i=_n(e.getLineContent(n.startLineNumber)),a=e1(s,o),l=e1(i,o);if(a!==l){const i=a-l;this.getIndentEditsOfMovingBlock(e,t,n,o,r,i)}}}}else t.addEditOperation(new tc(n.startLineNumber,1,n.startLineNumber,1),h+"\n")}else if(i=n.startLineNumber-1,s=e.getLineContent(i),t.addEditOperation(new tc(i,1,i+1,1),null),t.addEditOperation(new tc(n.endLineNumber,e.getLineMaxColumn(n.endLineNumber),n.endLineNumber,e.getLineMaxColumn(n.endLineNumber)),"\n"+s),this.shouldAutoIndent(e,n)){l.getLineContent=t=>t===i?e.getLineContent(n.startLineNumber):e.getLineContent(t);const s=this.matchEnterRule(e,a,o,n.startLineNumber,n.startLineNumber-2);if(null!==s)0!==s&&this.getIndentEditsOfMovingBlock(e,t,n,o,r,s);else{const s=uS(this._autoIndent,l,e.getLanguageIdAtPosition(n.startLineNumber,1),i,a,this._languageConfigurationService);if(null!==s){const i=_n(e.getLineContent(n.startLineNumber)),a=e1(s,o),l=e1(i,o);if(a!==l){const i=a-l;this.getIndentEditsOfMovingBlock(e,t,n,o,r,i)}}}}}this._selectionId=t.trackSelection(n)}buildIndentConverter(e,t,i){return{shiftIndent:n=>lS.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>lS.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,o){if(o){let s=o.indentation;o.indentAction===Nu.None||o.indentAction===Nu.Indent?s=o.indentation+o.appendText:o.indentAction===Nu.IndentOutdent?s=o.indentation:o.indentAction===Nu.Outdent&&(s=t.unshiftIndent(o.indentation)+o.appendText);const r=e.getLineContent(n);if(this.trimStart(r).indexOf(this.trimStart(s))>=0){const o=_n(e.getLineContent(n));let r=_n(s);const a=gS(e,n,this._languageConfigurationService);return null!==a&&2&a&&(r=t.unshiftIndent(r)),e1(r,i)-e1(o,i)}}return null}matchEnterRuleMovingDown(e,t,i,n,o,s){if(vn(s)>=0){const s=e.getLineMaxColumn(o),r=oS(this._autoIndent,e,new tc(o,s,o,s),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,r)}{let o=n-1;for(;o>=1&&!(vn(e.getLineContent(o))>=0);)o--;if(o<1||n>e.getLineCount())return null;const s=e.getLineMaxColumn(o),r=oS(this._autoIndent,e,new tc(o,s,o,s),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,r)}}matchEnterRule(e,t,i,n,o,s){let r=o;for(;r>=1;){let t;if(t=r===o&&void 0!==s?s:e.getLineContent(r),vn(t)>=0)break;r--}if(r<1||n>e.getLineCount())return null;const a=e.getLineMaxColumn(r),l=oS(this._autoIndent,e,new tc(r,a,r,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4)return!1;if(!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const i=e.getLanguageIdAtPosition(t.startLineNumber,1);return i===e.getLanguageIdAtPosition(t.endLineNumber,1)&&null!==this._languageConfigurationService.getLanguageConfiguration(i).indentRulesSupport}getIndentEditsOfMovingBlock(e,t,i,n,o,s){for(let r=i.startLineNumber;r<=i.endLineNumber;r++){const a=_n(e.getLineContent(r)),l=t1(e1(a,n)+s,n,o);l!==a&&(t.addEditOperation(new tc(r,1,r,a.length+1),l),r===i.endLineNumber&&i.endColumn<=a.length+1&&""===l&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber<i.endLineNumber&&(i=i.setEndPosition(i.endLineNumber,2)),i}};w5=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(3,Yg)],w5);class C5{static getCollator(){return C5._COLLATOR||(C5._COLLATOR=new Intl.Collator),C5._COLLATOR}constructor(e,t){this.selection=e,this.descending=t,this.selectionId=null}getEditOperations(e,t){const i=function(e,t,i){const n=y5(e,t,i);return n?vG.replace(new tc(n.startLineNumber,1,n.endLineNumber,e.getLineMaxColumn(n.endLineNumber)),n.after.join("\n")):null}(e,this.selection,this.descending);i&&t.addEditOperation(i.range,i.text),this.selectionId=t.trackSelection(this.selection)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}static canRun(e,t,i){if(null===e)return!1;const n=y5(e,t,i);if(!n)return!1;for(let e=0,t=n.before.length;e<t;e++)if(n.before[e]!==n.after[e])return!0;return!1}}function y5(e,t,i){const n=t.startLineNumber;let o=t.endLineNumber;if(1===t.endColumn&&o--,n>=o)return null;const s=[];for(let t=n;t<=o;t++)s.push(e.getLineContent(t));let r=s.slice(0);return r.sort(C5.getCollator().compare),!0===i&&(r=r.reverse()),{startLineNumber:n,endLineNumber:o,before:s,after:r}}C5._COLLATOR=null;class S5 extends zd{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map(((e,t)=>({selection:e,index:t,ignore:!1})));i.sort(((e,t)=>tc.compareRangesUsingStarts(e.selection,t.selection)));let n=i[0];for(let e=1;e<i.length;e++){const t=i[e];n.selection.endLineNumber===t.selection.startLineNumber&&(n.index<t.index?t.ignore=!0:(n.ignore=!0,n=t))}const o=[];for(const e of i)o.push(new b5(e.selection,this.down,e.ignore));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class k5 extends zd{constructor(e,t){super(t),this.down=e}run(e,t){const i=e.get(Yg),n=[],o=t.getSelections()||[],s=t.getOption(12);for(const e of o)n.push(new w5(e,this.down,s,i));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class L5 extends zd{constructor(e,t){super(t),this.descending=e}run(e,t){const i=t.getSelections()||[];for(const e of i)if(!C5.canRun(t.getModel(),e,this.descending))return;const n=[];for(let e=0,t=i.length;e<t;e++)n[e]=new C5(i[e],this.descending);t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class x5 extends zd{constructor(){super({id:x5.ID,label:me(0,"Trim Trailing Whitespace"),alias:"Trim Trailing Whitespace",precondition:nc.writable,kbOpts:{kbExpr:nc.editorTextFocus,primary:vt(2089,2102),weight:100}})}run(e,t,i){let n=[];"auto-save"===i.reason&&(n=(t.getSelections()||[]).map((e=>new ch(e.positionLineNumber,e.positionColumn))));const o=t.getSelection();if(null===o)return;const s=new v5(o,n);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop()}}x5.ID="editor.action.trimTrailingWhitespace";class D5 extends zd{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),n=this._getRangesToDelete(t),o=[];for(let e=0,t=n.length-1;e<t;e++){const t=n[e],i=n[e+1];null===tc.intersectRanges(t,i)?o.push(t):n[e+1]=tc.plusRange(t,i)}o.push(n[n.length-1]);const s=this._getEndCursorState(i,o),r=o.map((e=>vG.replace(e,"")));t.pushUndoStop(),t.executeEdits(this.id,r,s),t.pushUndoStop()}}class E5 extends zd{run(e,t){const i=t.getSelections();if(null===i)return;const n=t.getModel();if(null===n)return;const o=t.getOption(129),s=[];for(const e of i)if(e.isEmpty()){const i=e.getStartPosition(),r=t.getConfiguredWordAtPosition(i);if(!r)continue;const a=new tc(i.lineNumber,r.startColumn,i.lineNumber,r.endColumn),l=n.getValueInRange(a);s.push(vG.replace(a,this._modifyText(l,o)))}else{const t=n.getValueInRange(e);s.push(vG.replace(e,this._modifyText(t,o)))}t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop()}}class N5{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch(e){}}return this._actual}isSupported(){return null!==this.get()}}class I5 extends E5{constructor(){super({id:"editor.action.transformToTitlecase",label:me(0,"Transform to Title Case"),alias:"Transform to Title Case",precondition:nc.writable})}_modifyText(e,t){const i=I5.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,(e=>e.toLocaleUpperCase())):e}}I5.titleBoundary=new N5("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class M5 extends E5{constructor(){super({id:"editor.action.transformToSnakecase",label:me(0,"Transform to Snake Case"),alias:"Transform to Snake Case",precondition:nc.writable})}_modifyText(e,t){const i=M5.caseBoundary.get(),n=M5.singleLetters.get();return i&&n?e.replace(i,"$1_$2").replace(n,"$1_$2$3").toLocaleLowerCase():e}}M5.caseBoundary=new N5("(\\p{Ll})(\\p{Lu})","gmu"),M5.singleLetters=new N5("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");class T5 extends E5{constructor(){super({id:"editor.action.transformToCamelcase",label:me(0,"Transform to Camel Case"),alias:"Transform to Camel Case",precondition:nc.writable})}_modifyText(e,t){const i=T5.wordBoundary.get();if(!i)return e;const n=e.split(i);return n.shift()+n.map((e=>e.substring(0,1).toLocaleUpperCase()+e.substring(1))).join("")}}T5.wordBoundary=new N5("[_\\s-]","gm");class A5 extends E5{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every((e=>e.isSupported()))}constructor(){super({id:"editor.action.transformToKebabcase",label:me(0,"Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:nc.writable})}_modifyText(e,t){const i=A5.caseBoundary.get(),n=A5.singleLetters.get(),o=A5.underscoreBoundary.get();return i&&n&&o?e.replace(o,"$1-$3").replace(i,"$1-$2").replace(n,"$1-$2").toLocaleLowerCase():e}}A5.caseBoundary=new N5("(\\p{Ll})(\\p{Lu})","gmu"),A5.singleLetters=new N5("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu"),A5.underscoreBoundary=new N5("(\\S)(_)(\\S)","gm"),qd(class extends S5{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:me(0,"Copy Line Up"),alias:"Copy Line Up",precondition:nc.writable,kbOpts:{kbExpr:nc.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:yd.MenubarSelectionMenu,group:"2_line",title:me(0,"&&Copy Line Up"),order:1}})}}),qd(class extends S5{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:me(0,"Copy Line Down"),alias:"Copy Line Down",precondition:nc.writable,kbOpts:{kbExpr:nc.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:yd.MenubarSelectionMenu,group:"2_line",title:me(0,"Co&&py Line Down"),order:2}})}}),qd(class extends zd{constructor(){super({id:"editor.action.duplicateSelection",label:me(0,"Duplicate Selection"),alias:"Duplicate Selection",precondition:nc.writable,menuOpts:{menuId:yd.MenubarSelectionMenu,group:"2_line",title:me(0,"&&Duplicate Selection"),order:5}})}run(e,t,i){if(!t.hasModel())return;const n=[],o=t.getSelections(),s=t.getModel();for(const e of o)if(e.isEmpty())n.push(new b5(e,!0));else{const t=new ic(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn);n.push(new jy(t,s.getValueInRange(e)))}t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}),qd(class extends k5{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:me(0,"Move Line Up"),alias:"Move Line Up",precondition:nc.writable,kbOpts:{kbExpr:nc.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:yd.MenubarSelectionMenu,group:"2_line",title:me(0,"Mo&&ve Line Up"),order:3}})}}),qd(class extends k5{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:me(0,"Move Line Down"),alias:"Move Line Down",precondition:nc.writable,kbOpts:{kbExpr:nc.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:yd.MenubarSelectionMenu,group:"2_line",title:me(0,"Move &&Line Down"),order:4}})}}),qd(class extends L5{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:me(0,"Sort Lines Ascending"),alias:"Sort Lines Ascending",precondition:nc.writable})}}),qd(class extends L5{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:me(0,"Sort Lines Descending"),alias:"Sort Lines Descending",precondition:nc.writable})}}),qd(class extends zd{constructor(){super({id:"editor.action.removeDuplicateLines",label:me(0,"Delete Duplicate Lines"),alias:"Delete Duplicate Lines",precondition:nc.writable})}run(e,t){if(!t.hasModel())return;const i=t.getModel();if(1===i.getLineCount()&&1===i.getLineMaxColumn(1))return;const n=[],o=[];let s=0;for(const e of t.getSelections()){const t=new Set,r=[];for(let n=e.startLineNumber;n<=e.endLineNumber;n++){const e=i.getLineContent(n);t.has(e)||(r.push(e),t.add(e))}const a=new ic(e.startLineNumber,1,e.endLineNumber,i.getLineMaxColumn(e.endLineNumber)),l=e.startLineNumber-s,h=new ic(l,1,l+r.length-1,r[r.length-1].length);n.push(vG.replace(a,r.join("\n"))),o.push(h),s+=e.endLineNumber-e.startLineNumber+1-r.length}t.pushUndoStop(),t.executeEdits(this.id,n,o),t.pushUndoStop()}}),qd(x5),qd(class extends zd{constructor(){super({id:"editor.action.deleteLines",label:me(0,"Delete Line"),alias:"Delete Line",precondition:nc.writable,kbOpts:{kbExpr:nc.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),n=t.getModel();if(1===n.getLineCount()&&1===n.getLineMaxColumn(1))return;let o=0;const s=[],r=[];for(let e=0,t=i.length;e<t;e++){const t=i[e];let a=t.startLineNumber,l=t.endLineNumber,h=1,d=n.getLineMaxColumn(l);l<n.getLineCount()?(l+=1,d=1):a>1&&(a-=1,h=n.getLineMaxColumn(a)),s.push(vG.replace(new ic(a,h,l,d),"")),r.push(new ic(a-o,t.positionColumn,a-o,t.positionColumn)),o+=t.endLineNumber-t.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,s,r),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map((e=>{let t=e.endLineNumber;return e.startLineNumber<e.endLineNumber&&1===e.endColumn&&(t-=1),{startLineNumber:e.startLineNumber,selectionStartColumn:e.selectionStartColumn,endLineNumber:t,positionColumn:e.positionColumn}}));t.sort(((e,t)=>e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber));const i=[];let n=t[0];for(let e=1;e<t.length;e++)n.endLineNumber+1>=t[e].startLineNumber?n.endLineNumber=t[e].endLineNumber:(i.push(n),n=t[e]);return i.push(n),i}}),qd(class extends zd{constructor(){super({id:"editor.action.indentLines",label:me(0,"Indent Line"),alias:"Indent Line",precondition:nc.writable,kbOpts:{kbExpr:nc.editorTextFocus,primary:2142,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,pS.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}),qd(class extends zd{constructor(){super({id:"editor.action.outdentLines",label:me(0,"Outdent Line"),alias:"Outdent Line",precondition:nc.writable,kbOpts:{kbExpr:nc.editorTextFocus,primary:2140,weight:100}})}run(e,t){NS.Outdent.runEditorCommand(e,t,null)}}),qd(class extends zd{constructor(){super({id:"editor.action.insertLineBefore",label:me(0,"Insert Line Above"),alias:"Insert Line Above",precondition:nc.writable,kbOpts:{kbExpr:nc.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,pS.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}),qd(class extends zd{constructor(){super({id:"editor.action.insertLineAfter",label:me(0,"Insert Line Below"),alias:"Insert Line Below",precondition:nc.writable,kbOpts:{kbExpr:nc.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,pS.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}),qd(class extends D5{constructor(){super({id:"deleteAllLeft",label:me(0,"Delete All Left"),alias:"Delete All Left",precondition:nc.writable,kbOpts:{kbExpr:nc.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let i=null;const n=[];let o=0;return t.forEach((t=>{let s;if(1===t.endColumn&&o>0){const e=t.startLineNumber-o;s=new ic(e,t.startColumn,e,t.startColumn)}else s=new ic(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn);o+=t.endLineNumber-t.startLineNumber,t.intersectRanges(e)?i=s:n.push(s)})),i&&n.unshift(i),n}_getRangesToDelete(e){const t=e.getSelections();if(null===t)return[];let i=t;const n=e.getModel();return null===n?[]:(i.sort(tc.compareRangesUsingStarts),i=i.map((e=>{if(e.isEmpty()){if(1===e.startColumn){const t=Math.max(1,e.startLineNumber-1),i=1===e.startLineNumber?1:n.getLineLength(t)+1;return new tc(t,i,e.startLineNumber,1)}return new tc(e.startLineNumber,1,e.startLineNumber,e.startColumn)}return new tc(e.startLineNumber,1,e.endLineNumber,e.endColumn)})),i)}}),qd(class extends D5{constructor(){super({id:"deleteAllRight",label:me(0,"Delete All Right"),alias:"Delete All Right",precondition:nc.writable,kbOpts:{kbExpr:nc.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let i=null;const n=[];for(let o=0,s=t.length,r=0;o<s;o++){const s=t[o],a=new ic(s.startLineNumber-r,s.startColumn,s.startLineNumber-r,s.startColumn);s.intersectRanges(e)?i=a:n.push(a)}return i&&n.unshift(i),n}_getRangesToDelete(e){const t=e.getModel();if(null===t)return[];const i=e.getSelections();if(null===i)return[];const n=i.map((e=>{if(e.isEmpty()){const i=t.getLineMaxColumn(e.startLineNumber);return e.startColumn===i?new tc(e.startLineNumber,e.startColumn,e.startLineNumber+1,1):new tc(e.startLineNumber,e.startColumn,e.startLineNumber,i)}return e}));return n.sort(tc.compareRangesUsingStarts),n}}),qd(class extends zd{constructor(){super({id:"editor.action.joinLines",label:me(0,"Join Lines"),alias:"Join Lines",precondition:nc.writable,kbOpts:{kbExpr:nc.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){const i=t.getSelections();if(null===i)return;let n=t.getSelection();if(null===n)return;i.sort(tc.compareRangesUsingStarts);const o=[],s=i.reduce(((e,t)=>e.isEmpty()?e.endLineNumber===t.startLineNumber?(n.equalsSelection(e)&&(n=t),t):t.startLineNumber>e.endLineNumber+1?(o.push(e),t):new ic(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn):t.startLineNumber>e.endLineNumber?(o.push(e),t):new ic(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn)));o.push(s);const r=t.getModel();if(null===r)return;const a=[],l=[];let h=n,d=0;for(let e=0,t=o.length;e<t;e++){const t=o[e],i=t.startLineNumber,s=1;let c,u,g=0;const p=r.getLineLength(t.endLineNumber)-t.endColumn;if(t.isEmpty()||t.startLineNumber===t.endLineNumber){const e=t.getStartPosition();e.lineNumber<r.getLineCount()?(c=i+1,u=r.getLineMaxColumn(c)):(c=e.lineNumber,u=r.getLineMaxColumn(e.lineNumber))}else c=t.endLineNumber,u=r.getLineMaxColumn(c);let m=r.getLineContent(i);for(let e=i+1;e<=c;e++){const t=r.getLineContent(e),i=r.getLineFirstNonWhitespaceColumn(e);if(i>=1){let e=!0;""===m&&(e=!1),!e||" "!==m.charAt(m.length-1)&&"\t"!==m.charAt(m.length-1)||(e=!1,m=m.replace(/[\s\uFEFF\xA0]+$/g," "));const n=t.substr(i-1);m+=(e?" ":"")+n,g=e?n.length+1:n.length}else g=0}const f=new tc(i,s,c,u);if(!f.isEmpty()){let e;t.isEmpty()?(a.push(vG.replace(f,m)),e=new ic(f.startLineNumber-d,m.length-g+1,i-d,m.length-g+1)):t.startLineNumber===t.endLineNumber?(a.push(vG.replace(f,m)),e=new ic(t.startLineNumber-d,t.startColumn,t.endLineNumber-d,t.endColumn)):(a.push(vG.replace(f,m)),e=new ic(t.startLineNumber-d,t.startColumn,t.startLineNumber-d,m.length-p)),null!==tc.intersectRanges(f,n)?h=e:l.push(e)}d+=f.endLineNumber-f.startLineNumber}l.unshift(h),t.pushUndoStop(),t.executeEdits(this.id,a,l),t.pushUndoStop()}}),qd(class extends zd{constructor(){super({id:"editor.action.transpose",label:me(0,"Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:nc.writable})}run(e,t){const i=t.getSelections();if(null===i)return;const n=t.getModel();if(null===n)return;const o=[];for(let e=0,t=i.length;e<t;e++){const t=i[e];if(!t.isEmpty())continue;const s=t.getStartPosition(),r=n.getLineMaxColumn(s.lineNumber);if(s.column>=r){if(s.lineNumber===n.getLineCount())continue;const e=new tc(s.lineNumber,Math.max(1,s.column-1),s.lineNumber+1,1),t=n.getValueInRange(e).split("").reverse().join("");o.push(new Ky(new ic(s.lineNumber,Math.max(1,s.column-1),s.lineNumber+1,1),t))}else{const e=new tc(s.lineNumber,Math.max(1,s.column-1),s.lineNumber,s.column+1),t=n.getValueInRange(e).split("").reverse().join("");o.push(new Gy(e,t,new ic(s.lineNumber,s.column+1,s.lineNumber,s.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}),qd(class extends E5{constructor(){super({id:"editor.action.transformToUppercase",label:me(0,"Transform to Uppercase"),alias:"Transform to Uppercase",precondition:nc.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}),qd(class extends E5{constructor(){super({id:"editor.action.transformToLowercase",label:me(0,"Transform to Lowercase"),alias:"Transform to Lowercase",precondition:nc.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}),M5.caseBoundary.isSupported()&&M5.singleLetters.isSupported()&&qd(M5),T5.wordBoundary.isSupported()&&qd(T5),I5.titleBoundary.isSupported()&&qd(I5),A5.isSupported()&&qd(A5);var R5=i(5040),O5={};O5.styleTagTransform=Vr(),O5.setAttributes=Pr(),O5.insert=Rr().bind(null,"head"),O5.domAPI=Tr(),O5.insertStyleElement=Br(),Ir()(R5.Z,O5),R5.Z&&R5.Z.locals&&R5.Z.locals;var P5,F5=function(e,t){return function(i,n){t(i,n,e)}};const B5=new od("LinkedEditingInputVisible",!1);let W5=P5=class extends T{static get(e){return e.getContribution(P5.ID)}constructor(e,t,i,n,o){super(),this.languageConfigurationService=n,this._syncRangesToken=0,this._localToDispose=this._register(new M),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=B5.bindTo(t),this._debounceInformation=o.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new M),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequest=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel((()=>this.reinitialize(!0)))),this._register(this._editor.onDidChangeConfiguration((e=>{(e.hasChanged(69)||e.hasChanged(92))&&this.reinitialize(!1)}))),this._register(this._providers.onDidChange((()=>this.reinitialize(!1)))),this._register(this._editor.onDidChangeModelLanguage((()=>this.reinitialize(!0)))),this.reinitialize(!0)}reinitialize(e){const t=this._editor.getModel(),i=null!==t&&(this._editor.getOption(69)||this._editor.getOption(92))&&this._providers.has(t);if(i===this._enabled&&!e)return;if(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||null===t)return;this._localToDispose.add(z.runAndSubscribe(t.onDidChangeLanguageConfiguration,(()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()})));const n=new Ht(this._debounceInformation.get(t)),o=()=>{var e;this._rangeUpdateTriggerPromise=n.trigger((()=>this.updateRanges()),null!==(e=this._debounceDuration)&&void 0!==e?e:this._debounceInformation.get(t))},s=new Ht(0),r=e=>{this._rangeSyncTriggerPromise=s.trigger((()=>this._syncRanges(e)))};this._localToDispose.add(this._editor.onDidChangeCursorPosition((()=>{o()}))),this._localToDispose.add(this._editor.onDidChangeModelContent((e=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const t=this._currentDecorations.getRange(0);if(t&&e.changes.every((e=>t.intersectRanges(e.range))))return void r(this._syncRangesToken)}o()}))),this._localToDispose.add({dispose:()=>{n.dispose(),s.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||0===this._currentDecorations.length)return;const t=this._editor.getModel(),i=this._currentDecorations.getRange(0);if(!i||i.startLineNumber!==i.endLineNumber)return this.clearRanges();const n=t.getValueInRange(i);if(this._currentWordPattern){const e=n.match(this._currentWordPattern);if((e?e[0].length:0)!==n.length)return this.clearRanges()}const o=[];for(let e=1,i=this._currentDecorations.length;e<i;e++){const i=this._currentDecorations.getRange(e);if(i)if(i.startLineNumber!==i.endLineNumber)o.push({range:i,text:n});else{let e=t.getValueInRange(i),s=n,r=i.startColumn,a=i.endColumn;const l=En(e,s);r+=l,e=e.substr(l),s=s.substr(l);const h=Nn(e,s);a-=h,e=e.substr(0,e.length-h),s=s.substr(0,s.length-h),r===a&&0===s.length||o.push({range:new tc(i.startLineNumber,r,i.endLineNumber,a),text:s})}}if(0!==o.length)try{this._editor.popUndoStop(),this._ignoreChangeEvent=!0;const e=this._editor._getViewModel().getPrevEditOperationType();this._editor.executeEdits("linkedEditing",o),this._editor._getViewModel().setPrevEditOperationType(e)}finally{this._ignoreChangeEvent=!1}}dispose(){this.clearRanges(),super.dispose()}clearRanges(){this._visibleContextKey.set(!1),this._currentDecorations.clear(),this._currentRequest&&(this._currentRequest.cancel(),this._currentRequest=null,this._currentRequestPosition=null)}async updateRanges(e=!1){if(!this._editor.hasModel())return void this.clearRanges();const t=this._editor.getPosition();if(!this._enabled&&!e||this._editor.getSelections().length>1)return void this.clearRanges();const i=this._editor.getModel(),n=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===n){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const e=this._currentDecorations.getRange(0);if(e&&e.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=n;const o=Wt((async e=>{try{const s=new V(!1),r=await V5(this._providers,i,t,e);if(this._debounceInformation.update(i,s.elapsed()),o!==this._currentRequest)return;if(this._currentRequest=null,n!==i.getVersionId())return;let a=[];(null==r?void 0:r.ranges)&&(a=r.ranges),this._currentWordPattern=(null==r?void 0:r.wordPattern)||this._languageWordPattern;let l=!1;for(let e=0,i=a.length;e<i;e++)if(tc.containsPosition(a[e],t)){if(l=!0,0!==e){const t=a[e];a.splice(e,1),a.unshift(t)}break}if(!l)return void this.clearRanges();const h=a.map((e=>({range:e,options:P5.DECORATION})));this._visibleContextKey.set(!0),this._currentDecorations.set(h),this._syncRangesToken++}catch(e){g(e)||h(e),this._currentRequest!==o&&this._currentRequest||this.clearRanges()}}));return this._currentRequest=o,o}};function V5(e,t,i,n){return qt(e.ordered(t).map((e=>async()=>{try{return await e.provideLinkedEditingRanges(t,i,n)}catch(e){return void d(e)}})),(e=>!!e&&Wc(null==e?void 0:e.ranges)))}W5.ID="editor.contrib.linkedEditing",W5.DECORATION=Sy.register({description:"linked-editing",stickiness:0,className:"linked-editing-decoration"}),W5=P5=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([F5(1,sd),F5(2,Jk),F5(3,Yg),F5(4,hI)],W5),jd(new(Vd.bindToContribution(W5.get))({id:"cancelLinkedEditingInput",precondition:B5,handler:e=>e.clearRanges(),kbOpts:{kbExpr:nc.editorTextFocus,weight:199,primary:9,secondary:[1033]}})),Sm("editor.linkedEditingBackground",{dark:ru.fromHex("#f00").transparent(.3),light:ru.fromHex("#f00").transparent(.3),hcDark:ru.fromHex("#f00").transparent(.3),hcLight:ru.white},me(0,"Background color when the editor auto renames on type.")),Kd("_executeLinkedEditingProvider",((e,t,i)=>{const{linkedEditingRangeProvider:n}=e.get(Jk);return V5(n,t,i,Rt.None)})),Gd(W5.ID,W5,1),qd(class extends zd{constructor(){super({id:"editor.action.linkedEditing",label:me(0,"Start Linked Editing"),alias:"Start Linked Editing",precondition:Bh.and(nc.writable,nc.hasRenameProvider),kbOpts:{kbExpr:nc.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(dh),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return Ro.isUri(n)&&ch.isIPosition(o)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then((e=>{e&&(e.setPosition(o),e.invokeWithinContext((t=>(this.reportTelemetry(t,e),this.run(t,e)))))}),h):super.runCommand(e,t)}run(e,t){const i=W5.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}});var z5=i(8477),H5={};H5.styleTagTransform=Vr(),H5.setAttributes=Pr(),H5.insert=Rr().bind(null,"head"),H5.domAPI=Tr(),H5.insertStyleElement=Br(),Ir()(z5.Z,H5),z5.Z&&z5.Z.locals&&z5.Z.locals;class U5{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}async resolve(e){return this._link.url?this._link.url:"function"==typeof this._provider.resolveLink?Promise.resolve(this._provider.resolveLink(this._link,e)).then((t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing"))))):Promise.reject(new Error("missing"))}}class K5{constructor(e){this._disposables=new M;let t=[];for(const[i,n]of e){const e=i.links.map((e=>new U5(e,n)));t=K5._union(t,e),D(i)&&this._disposables.add(i)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const i=[];let n,o,s,r;for(n=0,s=0,o=e.length,r=t.length;n<o&&s<r;){const o=e[n],r=t[s];tc.areIntersectingOrTouching(o.range,r.range)?n++:tc.compareRangesUsingStarts(o.range,r.range)<0?(i.push(o),n++):(i.push(r),s++)}for(;n<o;n++)i.push(e[n]);for(;s<r;s++)i.push(t[s]);return i}}function j5(e,t,i){const n=[],o=e.ordered(t).reverse().map(((e,o)=>Promise.resolve(e.provideLinks(t,i)).then((t=>{t&&(n[o]=[t,e])}),d)));return Promise.all(o).then((()=>{const e=new K5(Pc(n));return i.isCancellationRequested?(e.dispose(),new K5([])):e}))}Ch.registerCommand("_executeLinkProvider",(async(e,...t)=>{let[i,n]=t;fl(i instanceof Ro),"number"!=typeof n&&(n=0);const{linkProvider:o}=e.get(Jk),s=e.get(uh).getModel(i);if(!s)return[];const r=await j5(o,s,Rt.None);if(!r)return[];for(let e=0;e<Math.min(n,r.links.length);e++)await r.links[e].resolve(Rt.None);const a=r.links.slice(0);return r.dispose(),a}));var q5,$5=function(e,t){return function(i,n){t(i,n,e)}};let G5=q5=class extends T{static get(e){return e.getContribution(q5.ID)}constructor(e,t,i,n,o){super(),this.editor=e,this.openerService=t,this.notificationService=i,this.languageFeaturesService=n,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=o.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new Zt((()=>this.computeLinksNow()),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const s=this._register(new aR(e));this._register(s.onMouseMoveOrRelevantKeyDown((([e,t])=>{this._onEditorMouseMove(e,t)}))),this._register(s.onExecute((e=>{this.onEditorMouseUp(e)}))),this._register(s.onCancel((e=>{this.cleanUpActiveLinkDecoration()}))),this._register(e.onDidChangeConfiguration((e=>{e.hasChanged(70)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))}))),this._register(e.onDidChangeModelContent((e=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))}))),this._register(e.onDidChangeModel((e=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)}))),this._register(e.onDidChangeModelLanguage((e=>{this.stop(),this.computeLinks.schedule(0)}))),this._register(this.providers.onDidChange((e=>{this.stop(),this.computeLinks.schedule(0)}))),this.computeLinks.schedule(0)}async computeLinksNow(){if(!this.editor.hasModel()||!this.editor.getOption(70))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=Wt((t=>j5(this.providers,e,t)));try{const t=new V(!1);if(this.activeLinksList=await this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(e){h(e)}finally{this.computePromise=null}}}updateDecorations(e){const t="altKey"===this.editor.getOption(77),i=[],n=Object.keys(this.currentOccurrences);for(const e of n){const t=this.currentOccurrences[e];i.push(t.decorationId)}const o=[];if(e)for(const i of e)o.push(Q5.decoration(i,t));this.editor.changeDecorations((t=>{const n=t.deltaDecorations(i,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let t=0,i=n.length;t<i;t++){const i=new Q5(e[t],n[t]);this.currentOccurrences[i.decorationId]=i}}))}_onEditorMouseMove(e,t){const i="altKey"===this.editor.getOption(77);if(this.isEnabled(e,t)){this.cleanUpActiveLinkDecoration();const t=this.getLinkOccurrence(e.target.position);t&&this.editor.changeDecorations((e=>{t.activate(e,i),this.activeLinkDecorationId=t.decorationId}))}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e="altKey"===this.editor.getOption(77);if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations((i=>{t.deactivate(i,e)})),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,i=!1){if(!this.openerService)return;const{link:n}=e;n.resolve(Rt.None).then((e=>{if("string"==typeof e&&this.editor.hasModel()){const t=this.editor.getModel().uri;if(t.scheme===jo.file&&e.startsWith(`${jo.file}:`)){const i=Ro.parse(e);if(i.scheme===jo.file){const n=Wl(i);let o=null;n.startsWith("/./")?o=`.${n.substr(1)}`:n.startsWith("//./")&&(o=`.${n.substr(2)}`),o&&(e=$l(t,o))}}}return this.openerService.open(e,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})}),(e=>{const t=e instanceof Error?e.message:e;"invalid"===t?this.notificationService.warn(me(0,"Failed to open this link because it is not well-formed: {0}",n.url.toString())):"missing"===t?this.notificationService.warn(me(0,"Failed to open this link because its target is missing.")):h(e)}))}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const e of t){const t=this.currentOccurrences[e.id];if(t)return t}return null}isEnabled(e,t){return Boolean(6===e.target.type&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){var e;this.computeLinks.cancel(),this.activeLinksList&&(null===(e=this.activeLinksList)||void 0===e||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}};G5.ID="editor.linkDetector",G5=q5=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([$5(1,Hx),$5(2,hL),$5(3,Jk),$5(4,hI)],G5);const Z5=Sy.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),Y5=Sy.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"});class Q5{static decoration(e,t){return{range:e.range,options:Q5._getOptions(e,t,!1)}}static _getOptions(e,t,i){const n={...i?Y5:Z5};return n.hoverMessage=function(e,t){const i=e.url&&/^command:/i.test(e.url.toString()),n=e.tooltip?e.tooltip:me(0,i?"Execute command":"Follow link"),o=me(0,t?Ve?"cmd + click":"ctrl + click":Ve?"option + click":"alt + click");if(e.url){let t="";if(/^command:/i.test(e.url.toString())){const i=e.url.toString().match(/^command:([^?#]+)/);i&&(t=me(0,"Execute command {0}",i[1]))}return new eh("",!0).appendLink(e.url.toString(!0).replace(/ /g,"%20"),n,t).appendMarkdown(` (${o})`)}return(new eh).appendText(`${n} (${o})`)}(e,t),n}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,Q5._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,Q5._getOptions(this.link,t,!1))}}Gd(G5.ID,G5,1),qd(class extends zd{constructor(){super({id:"editor.action.openLink",label:me(0,"Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const i=G5.get(t);if(!i)return;if(!t.hasModel())return;const n=t.getSelections();for(const e of n){const t=i.getLinkOccurrence(e.getEndPosition());t&&i.openLinkOccurrence(t,!1)}}});class X5 extends T{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown((e=>{const t=this._editor.getOption(116);t>=0&&6===e.target.type&&e.target.position.column>=t&&this._editor.updateOptions({stopRenderingLineAfter:-1})})))}}X5.ID="editor.contrib.longLinesHelper",Gd(X5.ID,X5,2);var J5=i(9620),e3={};e3.styleTagTransform=Vr(),e3.setAttributes=Pr(),e3.insert=Rr().bind(null,"head"),e3.domAPI=Tr(),e3.insertStyleElement=Br(),Ir()(J5.Z,e3),J5.Z&&J5.Z.locals&&J5.Z.locals;const t3=Sm("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},me(0,"Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0);Sm("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},me(0,"Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0),Sm("editor.wordHighlightTextBackground",{light:t3,dark:t3,hcDark:t3,hcLight:t3},me(0,"Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const i3=Sm("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Nm,hcLight:Nm},me(0,"Border color of a symbol during read-access, like reading a variable."));Sm("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Nm,hcLight:Nm},me(0,"Border color of a symbol during write-access, like writing to a variable.")),Sm("editor.wordHighlightTextBorder",{light:i3,dark:i3,hcDark:i3,hcLight:i3},me(0,"Border color of a textual occurrence for a symbol."));const n3=Sm("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},me(0,"Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),o3=Sm("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},me(0,"Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),s3=Sm("editorOverviewRuler.wordHighlightTextForeground",{dark:lv,light:lv,hcDark:lv,hcLight:lv},me(0,"Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0),r3=Sy.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:Av(o3),position:vc.Center},minimap:{color:Av(dv),position:wc.Inline}}),a3=Sy.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:Av(s3),position:vc.Center},minimap:{color:Av(dv),position:wc.Inline}}),l3=Sy.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:Av(lv),position:vc.Center},minimap:{color:Av(dv),position:wc.Inline}}),h3=Sy.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),d3=Sy.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:Av(n3),position:vc.Center},minimap:{color:Av(dv),position:wc.Inline}});function c3(e){return e?h3:l3}Fv(((e,t)=>{const i=e.getColor(Wf);i&&t.addRule(`.monaco-editor .selectionHighlight { background-color: ${i.transparent(.5)}; }`)}));var u3;function g3(e,t){const i=t.filter((t=>!e.find((e=>e.equals(t)))));if(i.length>=1){const e=i.map((e=>`line ${e.viewState.position.lineNumber} column ${e.viewState.position.column}`)).join(", ");Yr(1===i.length?me(0,"Cursor added: {0}",e):me(0,"Cursors added: {0}",e))}}class p3{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class m3{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new m3(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let n,o,s=!1;const r=e.getSelections();1===r.length&&r[0].isEmpty()?(s=!0,n=!0,o=!0):(n=i.wholeWord,o=i.matchCase);const a=e.getSelection();let l,h=null;if(a.isEmpty()){const t=e.getConfiguredWordAtPosition(a.getStartPosition());if(!t)return null;l=t.word,h=new ic(a.startLineNumber,t.startColumn,a.startLineNumber,t.endColumn)}else l=e.getModel().getValueInRange(a).replace(/\r\n/g,"\n");return new m3(e,t,s,l,n,o,h)}constructor(e,t,i,n,o,s,r){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,this.wholeWord=o,this.matchCase=s,this.currentMatch=r}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new p3(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new p3(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const e=this.currentMatch;return this.currentMatch=null,e}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return i?new ic(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new p3(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new p3(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const e=this.currentMatch;return this.currentMatch=null,e}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return i?new ic(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1,1073741824)}}class f3 extends T{static get(e){return e.getContribution(f3.ID)}constructor(e){super(),this._sessionDispose=this._register(new M),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=m3.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection((e=>{this._ignoreSelectionChange||this._endSession()}))),this._sessionDispose.add(this._editor.onDidBlurEditorText((()=>{this._endSession()}))),this._sessionDispose.add(e.getState().onFindReplaceStateChange((e=>{(e.matchCase||e.wholeWord)&&this._endSession()})))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new ic(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const i=e.getState().matchCase;if(!w3(this._editor.getModel(),t,i)){const e=this._editor.getModel(),i=[];for(let n=0,o=t.length;n<o;n++)i[n]=this._expandEmptyToWord(e,t[n]);return void this._editor.setSelections(i)}}}this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToNextFindMatch())}}addSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToPreviousFindMatch())}moveSelectionToNextFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToNextFindMatch())}moveSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToPreviousFindMatch())}selectAll(e){if(!this._editor.hasModel())return;let t=null;const i=e.getState();if(i.isRevealed&&i.searchString.length>0&&i.isRegex){const e=this._editor.getModel();t=i.searchScope?e.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(129):null,!1,1073741824):e.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(129):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const e=this._editor.getSelection();for(let i=0,n=t.length;i<n;i++){const n=t[i];if(n.range.intersectRanges(e)){t[i]=t[0],t[0]=n;break}}this._setSelections(t.map((e=>new ic(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn))))}}}f3.ID="editor.contrib.multiCursorController";class _3 extends zd{run(e,t){const i=f3.get(t);if(!i)return;const n=t._getViewModel();if(n){const o=n.getCursorStates(),s=xJ.get(t);if(s)this._run(i,s);else{const n=e.get(lh).createInstance(xJ,t);this._run(i,n),n.dispose()}g3(o,n.getCursorStates())}}}class v3{constructor(e,t,i,n,o){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=n,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,o&&this._model===o._model&&this._searchText===o._searchText&&this._matchCase===o._matchCase&&this._wordSeparators===o._wordSeparators&&this._modelVersionId===o._modelVersionId&&(this._cachedFindMatches=o._cachedFindMatches)}findMatches(){return null===this._cachedFindMatches&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map((e=>e.range)),this._cachedFindMatches.sort(tc.compareRangesUsingStarts)),this._cachedFindMatches}}let b3=u3=class extends T{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(107),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new Zt((()=>this._update()),300)),this.state=null,this._register(e.onDidChangeConfiguration((t=>{this._isEnabled=e.getOption(107)}))),this._register(e.onDidChangeCursorSelection((e=>{this._isEnabled&&(e.selection.isEmpty()?3===e.reason?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())}))),this._register(e.onDidChangeModel((e=>{this._setState(null)}))),this._register(e.onDidChangeModelContent((e=>{this._isEnabled&&this.updateSoon.schedule()})));const i=xJ.get(e);i&&this._register(i.getState().onFindReplaceStateChange((e=>{this._update()}))),this.updateSoon.schedule()}_update(){this._setState(u3._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,i){if(!t)return null;if(!i.hasModel())return null;const n=i.getSelection();if(n.startLineNumber!==n.endLineNumber)return null;const o=f3.get(i);if(!o)return null;const s=xJ.get(i);if(!s)return null;let r=o.getSession(s);if(!r){const e=i.getSelections();if(e.length>1){const t=s.getState().matchCase;if(!w3(i.getModel(),e,t))return null}r=m3.create(i,s)}if(!r)return null;if(r.currentMatch)return null;if(/^[ \t]+$/.test(r.searchText))return null;if(r.searchText.length>200)return null;const a=s.getState(),l=a.matchCase;if(a.isRevealed){let e=a.searchString;l||(e=e.toLowerCase());let t=r.searchText;if(l||(t=t.toLowerCase()),e===t&&r.matchCase===a.matchCase&&r.wholeWord===a.wholeWord&&!a.isRegex)return null}return new v3(i.getModel(),r.searchText,r.matchCase,r.wholeWord?i.getOption(129):null,e)}_setState(e){if(this.state=e,!this.state)return void this._decorations.clear();if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=this.state.findMatches(),n=this.editor.getSelections();n.sort(tc.compareRangesUsingStarts);const o=[];for(let e=0,t=0,s=i.length,r=n.length;e<s;){const s=i[e];if(t>=r)o.push(s),e++;else{const i=tc.compareRangesUsingStarts(s,n[t]);i<0?(!n[t].isEmpty()&&tc.areIntersecting(s,n[t])||o.push(s),e++):(i>0||e++,t++)}}const s="off"!==this.editor.getOption(80),r=this._languageFeaturesService.documentHighlightProvider.has(t)&&s,a=o.map((e=>({range:e,options:c3(r)})));this._decorations.set(a)}dispose(){this._setState(null),super.dispose()}};function w3(e,t,i){const n=C3(e,t[0],!i);for(let o=1,s=t.length;o<s;o++){const s=t[o];if(s.isEmpty())return!1;if(n!==C3(e,s,!i))return!1}return!0}function C3(e,t,i){const n=e.getValueInRange(t);return i?n.toLowerCase():n}b3.ID="editor.contrib.selectionHighlighter",b3=u3=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,Jk)],b3),Gd(f3.ID,f3,4),Gd(b3.ID,b3,1),qd(class extends zd{constructor(){super({id:"editor.action.insertCursorAbove",label:me(0,"Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:nc.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:yd.MenubarSelectionMenu,group:"3_multi",title:me(0,"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&!1===i.logicalLine&&(n=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const s=o.getCursorStates();o.setCursorStates(i.source,3,iS.addCursorUp(o,s,n)),o.revealTopMostCursor(i.source),g3(s,o.getCursorStates())}}),qd(class extends zd{constructor(){super({id:"editor.action.insertCursorBelow",label:me(0,"Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:nc.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:yd.MenubarSelectionMenu,group:"3_multi",title:me(0,"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&!1===i.logicalLine&&(n=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const s=o.getCursorStates();o.setCursorStates(i.source,3,iS.addCursorDown(o,s,n)),o.revealBottomMostCursor(i.source),g3(s,o.getCursorStates())}}),qd(class extends zd{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:me(0,"Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:nc.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:yd.MenubarSelectionMenu,group:"3_multi",title:me(0,"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let n=e.startLineNumber;n<e.endLineNumber;n++){const e=t.getLineMaxColumn(n);i.push(new ic(n,e,n,e))}e.endColumn>1&&i.push(new ic(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=t.getSelections(),o=t._getViewModel(),s=o.getCursorStates(),r=[];n.forEach((e=>this.getCursorsForSelection(e,i,r))),r.length>0&&t.setSelections(r),g3(s,o.getCursorStates())}}),qd(class extends _3{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:me(0,"Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:nc.focus,primary:2082,weight:100},menuOpts:{menuId:yd.MenubarSelectionMenu,group:"3_multi",title:me(0,"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}),qd(class extends _3{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:me(0,"Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:yd.MenubarSelectionMenu,group:"3_multi",title:me(0,"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}),qd(class extends _3{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:me(0,"Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:nc.focus,primary:vt(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}),qd(class extends _3{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:me(0,"Move Last Selection To Previous Find Match"),alias:"Move Last Selection To Previous Find Match",precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}),qd(class extends _3{constructor(){super({id:"editor.action.selectHighlights",label:me(0,"Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:nc.focus,primary:3114,weight:100},menuOpts:{menuId:yd.MenubarSelectionMenu,group:"3_multi",title:me(0,"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}),qd(class extends _3{constructor(){super({id:"editor.action.changeAll",label:me(0,"Change All Occurrences"),alias:"Change All Occurrences",precondition:Bh.and(nc.writable,nc.editorTextFocus),kbOpts:{kbExpr:nc.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}),qd(class extends zd{constructor(){super({id:"editor.action.addCursorsToBottom",label:me(0,"Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),n=t.getModel().getLineCount(),o=[];for(let e=i[0].startLineNumber;e<=n;e++)o.push(new ic(e,i[0].startColumn,e,i[0].endColumn));const s=t._getViewModel(),r=s.getCursorStates();o.length>0&&t.setSelections(o),g3(r,s.getCursorStates())}}),qd(class extends zd{constructor(){super({id:"editor.action.addCursorsToTop",label:me(0,"Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),n=[];for(let e=i[0].startLineNumber;e>=1;e--)n.push(new ic(e,i[0].startColumn,e,i[0].endColumn));const o=t._getViewModel(),s=o.getCursorStates();n.length>0&&t.setSelections(n),g3(s,o.getCursorStates())}}),qd(class extends zd{constructor(){super({id:"editor.action.focusNextCursor",label:me(0,"Focus Next Cursor"),metadata:{description:me(0,"Focuses the next cursor"),args:[]},alias:"Focus Next Cursor",precondition:void 0})}run(e,t,i){if(!t.hasModel())return;const n=t._getViewModel();if(n.cursorConfig.readOnly)return;n.model.pushStackElement();const o=Array.from(n.getCursorStates()),s=o.shift();s&&(o.push(s),n.setCursorStates(i.source,3,o),n.revealPrimaryCursor(i.source,!0),g3(o,n.getCursorStates()))}}),qd(class extends zd{constructor(){super({id:"editor.action.focusPreviousCursor",label:me(0,"Focus Previous Cursor"),metadata:{description:me(0,"Focuses the previous cursor"),args:[]},alias:"Focus Previous Cursor",precondition:void 0})}run(e,t,i){if(!t.hasModel())return;const n=t._getViewModel();if(n.cursorConfig.readOnly)return;n.model.pushStackElement();const o=Array.from(n.getCursorStates()),s=o.pop();s&&(o.unshift(s),n.setCursorStates(i.source,3,o),n.revealPrimaryCursor(i.source,!0),g3(o,n.getCursorStates()))}});const y3={Visible:new od("parameterHintsVisible",!1),MultipleSignatures:new od("parameterHintsMultipleSignatures",!1)};async function S3(e,t,i,n,o){const s=e.ordered(t);for(const e of s)try{const s=await e.provideSignatureHelp(t,i,o,n);if(s)return s}catch(e){d(e)}}var k3;Ch.registerCommand("_executeSignatureHelpProvider",(async(e,...t)=>{const[i,n,o]=t;fl(Ro.isUri(i)),fl(ch.isIPosition(n)),fl("string"==typeof o||!o);const s=e.get(Jk),r=await e.get(gh).createModelReference(i);try{const e=await S3(s.signatureHelpProvider,r.object.textEditorModel,ch.lift(n),{triggerKind:pC.Invoke,isRetrigger:!1,triggerCharacter:o},Rt.None);if(!e)return;return setTimeout((()=>e.dispose()),0),e.value}finally{r.dispose()}})),function(e){e.Default={type:0},e.Pending=class{constructor(e,t){this.request=e,this.previouslyActiveHints=t,this.type=2}},e.Active=class{constructor(e){this.hints=e,this.type=1}}}(k3||(k3={}));class L3 extends T{constructor(e,t,i=L3.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new q),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=k3.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new A),this.triggerChars=new zw,this.retriggerChars=new zw,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Ht(i),this._register(this.editor.onDidBlurEditorWidget((()=>this.cancel()))),this._register(this.editor.onDidChangeConfiguration((()=>this.onEditorConfigurationChange()))),this._register(this.editor.onDidChangeModel((e=>this.onModelChanged()))),this._register(this.editor.onDidChangeModelLanguage((e=>this.onModelChanged()))),this._register(this.editor.onDidChangeCursorSelection((e=>this.onCursorChange(e)))),this._register(this.editor.onDidChangeModelContent((e=>this.onModelContentChange()))),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType((e=>this.onDidType(e)))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){2===this._state.type&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=k3.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!this.providers.has(i))return;const n=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger((()=>this.doTrigger(n)),t).catch(h)}next(){if(1!==this.state.type)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e==e-1,n=this.editor.getOption(85).cycle;!(e<2||i)||n?this.updateActiveSignature(i&&n?0:t+1):this.cancel()}previous(){if(1!==this.state.type)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=0===t,n=this.editor.getOption(85).cycle;!(e<2||i)||n?this.updateActiveSignature(i&&n?e-1:t-1):this.cancel()}updateActiveSignature(e){1===this.state.type&&(this.state=new k3.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){const t=1===this.state.type||2===this.state.type,i=this.getLastActiveHints();if(this.cancel(!0),0===this._pendingTriggers.length)return!1;const n=this._pendingTriggers.reduce(x3);this._pendingTriggers=[];const o={triggerKind:n.triggerKind,triggerCharacter:n.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const s=this.editor.getModel(),r=this.editor.getPosition();this.state=new k3.Pending(Wt((e=>S3(this.providers,s,r,o,e))),i);try{const t=await this.state.request;return e!==this.triggerId?(null==t||t.dispose(),!1):t&&t.value.signatures&&0!==t.value.signatures.length?(this.state=new k3.Active(t.value),this._lastSignatureHelpResult.value=t,this._onChangedHints.fire(this.state.hints),!0):(null==t||t.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1)}catch(t){return e===this.triggerId&&(this.state=k3.Default),h(t),!1}}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return 1===this.state.type||2===this.state.type||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const e of t.signatureHelpTriggerCharacters||[])if(e.length){const t=e.charCodeAt(0);this.triggerChars.add(t),this.retriggerChars.add(t)}for(const e of t.signatureHelpRetriggerCharacters||[])e.length&&this.retriggerChars.add(e.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:pC.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){"mouse"===e.source?this.cancel():this.isTriggered&&this.trigger({triggerKind:pC.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:pC.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(85).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}function x3(e,t){switch(t.triggerKind){case pC.Invoke:return t;case pC.ContentChange:return e;case pC.TriggerCharacter:default:return t}}L3.DEFAULT_DELAY=120;var D3=i(1386),E3={};E3.styleTagTransform=Vr(),E3.setAttributes=Pr(),E3.insert=Rr().bind(null,"head"),E3.domAPI=Tr(),E3.insertStyleElement=Br(),Ir()(D3.Z,E3),D3.Z&&D3.Z.locals&&D3.Z.locals;var N3,I3=function(e,t){return function(i,n){t(i,n,e)}};const M3=mr,T3=EA("parameter-hints-next",Sl.chevronDown,me(0,"Icon for show next parameter hint.")),A3=EA("parameter-hints-previous",Sl.chevronUp,me(0,"Icon for show previous parameter hint."));let R3=N3=class extends T{constructor(e,t,i,n,o){super(),this.editor=e,this.model=t,this.renderDisposeables=this._register(new M),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new jx({editor:e},o,n)),this.keyVisible=y3.Visible.bindTo(i),this.keyMultipleSignatures=y3.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=M3(".editor-widget.parameter-hints-widget"),t=hr(e,M3(".phwrapper"));t.tabIndex=-1;const i=hr(t,M3(".controls")),n=hr(i,M3(".button"+Ll.asCSSSelector(A3))),o=hr(i,M3(".overloads")),s=hr(i,M3(".button"+Ll.asCSSSelector(T3)));this._register(bs(n,"click",(e=>{rr(e),this.previous()}))),this._register(bs(s,"click",(e=>{rr(e),this.next()})));const r=M3(".body"),a=new ND(r,{alwaysConsumeMouseWheel:!0});this._register(a),t.appendChild(a.getDomNode());const l=hr(r,M3(".signature")),h=hr(r,M3(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:l,overloads:o,docs:h,scrollbar:a},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection((e=>{this.visible&&this.editor.layoutContentWidget(this)})));const d=()=>{if(!this.domNodes)return;const e=this.editor.getOption(50);this.domNodes.element.style.fontSize=`${e.fontSize}px`,this.domNodes.element.style.lineHeight=""+e.lineHeight/e.fontSize};d(),this._register(z.chain(this.editor.onDidChangeConfiguration.bind(this.editor),(e=>e.filter((e=>e.hasChanged(50)))))(d)),this._register(this.editor.onDidLayoutChange((e=>this.updateMaxHeight()))),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout((()=>{var e;null===(e=this.domNodes)||void 0===e||e.element.classList.add("visible")}),100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,null===(e=this.domNodes)||void 0===e||e.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){var t;if(this.renderDisposeables.clear(),!this.domNodes)return;const i=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",i),this.keyMultipleSignatures.set(i),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const n=e.signatures[e.activeSignature];if(!n)return;const o=hr(this.domNodes.signature,M3(".code")),s=this.editor.getOption(50);o.style.fontSize=`${s.fontSize}px`,o.style.fontFamily=s.fontFamily;const r=n.parameters.length>0,a=null!==(t=n.activeParameter)&&void 0!==t?t:e.activeParameter;r?this.renderParameters(o,n,a):hr(o,M3("span")).textContent=n.label;const l=n.parameters[a];if(null==l?void 0:l.documentation){const e=M3("span.documentation");if("string"==typeof l.documentation)e.textContent=l.documentation;else{const t=this.renderMarkdownDocs(l.documentation);e.appendChild(t.element)}hr(this.domNodes.docs,M3("p",{},e))}if(void 0===n.documentation);else if("string"==typeof n.documentation)hr(this.domNodes.docs,M3("p",{},n.documentation));else{const e=this.renderMarkdownDocs(n.documentation);hr(this.domNodes.docs,e.element)}const h=this.hasDocs(n,l);if(this.domNodes.signature.classList.toggle("has-docs",h),this.domNodes.docs.classList.toggle("empty",!h),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,l){let e="";const t=n.parameters[a];e=Array.isArray(t.label)?n.label.substring(t.label[0],t.label[1]):t.label,t.documentation&&(e+="string"==typeof t.documentation?`, ${t.documentation}`:`, ${t.documentation.value}`),n.documentation&&(e+="string"==typeof n.documentation?`, ${n.documentation}`:`, ${n.documentation.value}`),this.announcedLabel!==e&&(Zr(me(0,"{0}, hint",e)),this.announcedLabel=e)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var e;null===(e=this.domNodes)||void 0===e||e.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&"string"==typeof t.documentation&&_l(t.documentation).length>0||t&&"object"==typeof t.documentation&&_l(t.documentation).value.length>0||e.documentation&&"string"==typeof e.documentation&&_l(e.documentation).length>0||e.documentation&&"object"==typeof e.documentation&&_l(e.documentation.value).length>0)}renderParameters(e,t,i){const[n,o]=this.getParameterLabelOffsets(t,i),s=document.createElement("span");s.textContent=t.label.substring(0,n);const r=document.createElement("span");r.textContent=t.label.substring(n,o),r.className="parameter active";const a=document.createElement("span");a.textContent=t.label.substring(o),hr(e,s,r,a)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const t=new RegExp(`(\\W|^)${dn(i.label)}(?=\\W|$)`,"g");t.test(e.label);const n=t.lastIndex-i.label.length;return n>=0?[n,t.lastIndex]:[0,0]}return[0,0]}return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return N3.ID}updateMaxHeight(){if(!this.domNodes)return;const e=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=e;const t=this.domNodes.element.getElementsByClassName("phwrapper");t.length&&(t[0].style.maxHeight=e)}};R3.ID="editor.widget.parameterHintsWidget",R3=N3=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([I3(2,sd),I3(3,Hx),I3(4,yu)],R3),Sm("editorHoverWidget.highlightForeground",{dark:y_,light:y_,hcDark:y_,hcLight:y_},me(0,"Foreground color of the active item in the parameter hint."));var O3,P3=function(e,t){return function(i,n){t(i,n,e)}};let F3=O3=class extends T{static get(e){return e.getContribution(O3.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new L3(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints((e=>{var t;e?(this.widget.value.show(),this.widget.value.render(e)):null===(t=this.widget.rawValue)||void 0===t||t.hide()}))),this.widget=new on((()=>this._register(t.createInstance(R3,this.editor,this.model))))}cancel(){this.model.cancel()}previous(){var e;null===(e=this.widget.rawValue)||void 0===e||e.previous()}next(){var e;null===(e=this.widget.rawValue)||void 0===e||e.next()}trigger(e){this.model.trigger(e,0)}};F3.ID="editor.controller.parameterHints",F3=O3=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([P3(1,lh),P3(2,Jk)],F3),Gd(F3.ID,F3,2),qd(class extends zd{constructor(){super({id:"editor.action.triggerParameterHints",label:me(0,"Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:nc.hasSignatureHelpProvider,kbOpts:{kbExpr:nc.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=F3.get(t);null==i||i.trigger({triggerKind:pC.Invoke})}});const B3=Vd.bindToContribution(F3.get);function W3(e,t){return t&&(e.stack||e.stacktrace)?me(0,"{0}: {1}",z3(e),V3(e.stack)||V3(e.stacktrace)):z3(e)}function V3(e){return Array.isArray(e)?e.join("\n"):e}function z3(e){return"ERR_UNC_HOST_NOT_ALLOWED"===e.code?`${e.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:"string"==typeof e.code&&"number"==typeof e.errno&&"string"==typeof e.syscall?me(0,"A system error occurred ({0})",e.message):e.message||me(0,"An unknown error occurred. Please consult the log for more details.")}function H3(e=null,t=!1){if(!e)return me(0,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(e)){const i=Pc(e),n=H3(i[0],t);return i.length>1?me(0,"{0} ({1} errors in total)",n,i.length):n}if(al(e))return e;if(e.detail){const i=e.detail;if(i.error)return W3(i.error,t);if(i.exception)return W3(i.exception,t)}return e.stack?W3(e,t):e.message?e.message:me(0,"An unknown error occurred. Please consult the log for more details.")}jd(new B3({id:"closeParameterHints",precondition:y3.Visible,handler:e=>e.cancel(),kbOpts:{weight:175,kbExpr:nc.focus,primary:9,secondary:[1033]}})),jd(new B3({id:"showPrevParameterHint",precondition:Bh.and(y3.Visible,y3.MultipleSignatures),handler:e=>e.previous(),kbOpts:{weight:175,kbExpr:nc.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}})),jd(new B3({id:"showNextParameterHint",precondition:Bh.and(y3.Visible,y3.MultipleSignatures),handler:e=>e.next(),kbOpts:{weight:175,kbExpr:nc.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));class U3{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,o=[];for(const[e,s]of this.documents){if(t.isCancellationRequested)return[];for(const t of s.chunks){const s=this.computeSimilarityScore(t,i,n);s>0&&o.push({key:e,score:s})}}return o}static termFrequencies(e){return function(e){var t;const i=new Map;for(const n of e)i.set(n,(null!==(t=i.get(n))&&void 0!==t?t:0)+1);return i}(U3.splitTerms(e))}static*splitTerms(e){const t=e=>e.toLowerCase();for(const[i]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(i);const e=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(e.length>1)for(const i of e)i.length>2&&/\p{Letter}{3,}/gu.test(i)&&(yield t(i))}}updateDocuments(e){var t;for(const{key:t}of e)this.deleteDocument(t);for(const i of e){const e=[];for(const n of i.textChunks){const i=U3.termFrequencies(n);for(const e of i.keys())this.chunkOccurrences.set(e,(null!==(t=this.chunkOccurrences.get(e))&&void 0!==t?t:0)+1);e.push({text:n,tf:i})}this.chunkCount+=e.length,this.documents.set(i.key,{chunks:e})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const e of t.chunks)for(const t of e.tf.keys()){const e=this.chunkOccurrences.get(t);if("number"==typeof e){const i=e-1;i<=0?this.chunkOccurrences.delete(t):this.chunkOccurrences.set(t,i)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[o,s]of Object.entries(t)){const t=e.tf.get(o);if(!t)continue;let r=i.get(o);"number"!=typeof r&&(r=this.computeIdf(o),i.set(o,r)),n+=t*r*s}return n}computeEmbedding(e){const t=U3.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){var t;const i=null!==(t=this.chunkOccurrences.get(e))&&void 0!==t?t:0;return i>0?Math.log((this.chunkCount+1)/i):0}computeTfidf(e){const t=Object.create(null);for(const[i,n]of e){const e=this.computeIdf(i);e>0&&(t[i]=n*e)}return t}}const K3=hh("dialogService");var j3;function q3(e){const t=e;return Array.isArray(t.items)}function $3(e){const t=e;return!!t.picks&&t.additionalPicks instanceof Promise}!function(e){e[e.NO_ACTION=0]="NO_ACTION",e[e.CLOSE_PICKER=1]="CLOSE_PICKER",e[e.REFRESH_PICKER=2]="REFRESH_PICKER",e[e.REMOVE_ITEM=3]="REMOVE_ITEM"}(j3||(j3={}));class G3 extends T{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var n;const o=new M;let s;e.canAcceptInBackground=!!(null===(n=this.options)||void 0===n?void 0:n.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const r=o.add(new A),a=async()=>{const n=r.value=new M;null==s||s.dispose(!0),e.busy=!1,s=new Pt(t);const o=s.token,a=e.value.substr(this.prefix.length).trim(),l=this._getPicks(a,n,o,i),h=(t,i)=>{var n;let o,s;if(q3(t)?(o=t.items,s=t.active):o=t,0===o.length){if(i)return!1;(a.length>0||e.hideInput)&&(null===(n=this.options)||void 0===n?void 0:n.noResultsPick)&&(o=vl(this.options.noResultsPick)?[this.options.noResultsPick(a)]:[this.options.noResultsPick])}return e.items=o,s&&(e.activeItems=[s]),!0},d=async t=>{let i=!1,n=!1;await Promise.all([(async()=>{"number"==typeof t.mergeDelay&&(await Kt(t.mergeDelay),o.isCancellationRequested)||n||(i=h(t.picks,!0))})(),(async()=>{e.busy=!0;try{const n=await t.additionalPicks;if(o.isCancellationRequested)return;let s,r,a,l;if(q3(t.picks)?(s=t.picks.items,r=t.picks.active):s=t.picks,q3(n)?(a=n.items,l=n.active):a=n,a.length>0||!i){let t;if(!r&&!l){const i=e.activeItems[0];i&&-1!==s.indexOf(i)&&(t=i)}h({items:[...s,...a],active:r||l||t})}}finally{o.isCancellationRequested||(e.busy=!1),n=!0}})()])};if(null===l);else if($3(l))await d(l);else if(l instanceof Promise){e.busy=!0;try{const e=await l;if(o.isCancellationRequested)return;$3(e)?await d(e):h(e)}finally{o.isCancellationRequested||(e.busy=!1)}}else h(l)};return o.add(e.onDidChangeValue((()=>a()))),a(),o.add(e.onDidAccept((t=>{const[i]=e.selectedItems;"function"==typeof(null==i?void 0:i.accept)&&(t.inBackground||e.hide(),i.accept(e.keyMods,t))}))),o.add(e.onDidTriggerItemButton((async({button:i,item:n})=>{var o,s;if("function"==typeof n.trigger){const r=null!==(s=null===(o=n.buttons)||void 0===o?void 0:o.indexOf(i))&&void 0!==s?s:-1;if(r>=0){const i=n.trigger(r,e.keyMods),o="number"==typeof i?i:await i;if(t.isCancellationRequested)return;switch(o){case j3.NO_ACTION:break;case j3.CLOSE_PICKER:e.hide();break;case j3.REFRESH_PICKER:a();break;case j3.REMOVE_ITEM:{const t=e.items.indexOf(n);if(-1!==t){const i=e.items.slice(),n=i.splice(t,1),o=e.activeItems.filter((e=>e!==n[0])),s=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=i,o&&(e.activeItems=o),e.keepScrollPosition=s}break}}}}}))),o}}var Z3,Y3,Q3=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},X3=function(e,t){return function(i,n){t(i,n,e)}};let J3=Z3=class extends G3{constructor(e,t,i,n,o,s){super(Z3.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=n,this.telemetryService=o,this.dialogService=s,this.commandsHistory=this._register(this.instantiationService.createInstance(e6)),this.options=e}async _getPicks(e,t,i,n){var o,s,r,a;const l=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const h=w((()=>{const t=new U3;return t.updateDocuments(l.map((e=>({key:e.commandId,textChunks:[this.getTfIdfChunk(e)]})))),function(e){var t,i;const n=e.slice(0);n.sort(((e,t)=>t.score-e.score));const o=null!==(i=null===(t=n[0])||void 0===t?void 0:t.score)&&void 0!==i?i:0;if(o>0)for(const e of n)e.score/=o;return n}(t.calculateScores(e,i)).filter((e=>e.score>Z3.TFIDF_THRESHOLD)).slice(0,Z3.TFIDF_MAX_RESULTS)})),d=[];for(const t of l){const n=null!==(o=Z3.WORD_FILTER(e,t.label))&&void 0!==o?o:void 0,r=t.commandAlias&&null!==(s=Z3.WORD_FILTER(e,t.commandAlias))&&void 0!==s?s:void 0;if(n||r)t.highlights={label:n,detail:this.options.showAlias?r:void 0},d.push(t);else if(e===t.commandId)d.push(t);else if(e.length>=3){const e=h();if(i.isCancellationRequested)return[];const n=e.find((e=>e.key===t.commandId));n&&(t.tfIdfScore=n.score,d.push(t))}}const c=new Map;for(const e of d){const t=c.get(e.label);t?(e.description=e.commandId,t.description=t.commandId):c.set(e.label,e)}d.sort(((e,t)=>{if(e.tfIdfScore&&t.tfIdfScore)return e.tfIdfScore===t.tfIdfScore?e.label.localeCompare(t.label):t.tfIdfScore-e.tfIdfScore;if(e.tfIdfScore)return 1;if(t.tfIdfScore)return-1;const i=this.commandsHistory.peek(e.commandId),n=this.commandsHistory.peek(t.commandId);if(i&&n)return i>n?-1:1;if(i)return-1;if(n)return 1;if(this.options.suggestedCommandIds){const i=this.options.suggestedCommandIds.has(e.commandId),n=this.options.suggestedCommandIds.has(t.commandId);if(i&&n)return 0;if(i)return-1;if(n)return 1}return e.label.localeCompare(t.label)}));const u=[];let g=!1,p=!0,m=!!this.options.suggestedCommandIds;for(let e=0;e<d.length;e++){const t=d[e];0===e&&this.commandsHistory.peek(t.commandId)&&(u.push({type:"separator",label:me(0,"recently used")}),g=!0),p&&void 0!==t.tfIdfScore&&(u.push({type:"separator",label:me(0,"similar commands")}),p=!1),m&&void 0===t.tfIdfScore&&!this.commandsHistory.peek(t.commandId)&&(null===(r=this.options.suggestedCommandIds)||void 0===r?void 0:r.has(t.commandId))&&(u.push({type:"separator",label:me(0,"commonly used")}),g=!0,m=!1),!g||void 0!==t.tfIdfScore||this.commandsHistory.peek(t.commandId)||(null===(a=this.options.suggestedCommandIds)||void 0===a?void 0:a.has(t.commandId))||(u.push({type:"separator",label:me(0,"other commands")}),g=!1),u.push(this.toCommandPick(t,n))}return this.hasAdditionalCommandPicks(e,i)?{picks:u,additionalPicks:(async()=>{var t;const o=await this.getAdditionalCommandPicks(l,d,e,i);if(i.isCancellationRequested)return[];const s=o.map((e=>this.toCommandPick(e,n)));return p&&"separator"!==(null===(t=s[0])||void 0===t?void 0:t.type)&&s.unshift({type:"separator",label:me(0,"similar commands")}),s})()}:u}toCommandPick(e,t){if("separator"===e.type)return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?me(0,"{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:n,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{var i,n;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:null!==(i=null==t?void 0:t.from)&&void 0!==i?i:"quick open"});try{(null===(n=e.args)||void 0===n?void 0:n.length)?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(t){g(t)||this.dialogService.error(me(0,"Command '{0}' resulted in an error",e.label),H3(t))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let n=e;return t&&t!==e&&(n+=` - ${t}`),i&&i.value!==e&&(n+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),n}};J3.PREFIX=">",J3.TFIDF_THRESHOLD=.5,J3.TFIDF_MAX_RESULTS=5,J3.WORD_FILTER=ga(pa,(function(e,t,i=!1){if(!t||0===t.length)return null;let n=null,o=0;for(e=e.toLowerCase(),t=t.toLowerCase();o<t.length&&(n=Aa(e,t,0,o,i),null===n);)o=Ra(t,o+1);return n}),fa),J3=Z3=Q3([X3(1,lh),X3(2,ML),X3(3,wh),X3(4,Id),X3(5,K3)],J3);let e6=Y3=class extends T{constructor(e,t){super(),this.storageService=e,this.configurationService=t,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration((e=>this.updateConfiguration(e)))),this._register(this.storageService.onWillSaveState((e=>{e.reason===jN.SHUTDOWN&&this.saveState()})))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Y3.getConfiguredCommandHistoryLength(this.configurationService),Y3.cache&&Y3.cache.limit!==this.configuredCommandsHistoryLength&&(Y3.cache.limit=this.configuredCommandsHistoryLength,Y3.hasChanges=!0))}load(){const e=this.storageService.get(Y3.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(e){}const i=Y3.cache=new na(this.configuredCommandsHistoryLength,1);if(t){let e;e=t.usesLRU?t.entries:t.entries.sort(((e,t)=>e.value-t.value)),e.forEach((e=>i.set(e.key,e.value)))}Y3.counter=this.storageService.getNumber(Y3.PREF_KEY_COUNTER,0,Y3.counter)}push(e){Y3.cache&&(Y3.cache.set(e,Y3.counter++),Y3.hasChanges=!0)}peek(e){var t;return null===(t=Y3.cache)||void 0===t?void 0:t.peek(e)}saveState(){if(!Y3.cache)return;if(!Y3.hasChanges)return;const e={usesLRU:!0,entries:[]};Y3.cache.forEach(((t,i)=>e.entries.push({key:i,value:t}))),this.storageService.store(Y3.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(Y3.PREF_KEY_COUNTER,Y3.counter,0,0),Y3.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var t,i;const n=null===(i=null===(t=e.getValue().workbench)||void 0===t?void 0:t.commandPalette)||void 0===i?void 0:i.history;return"number"==typeof n?n:Y3.DEFAULT_COMMANDS_HISTORY_LENGTH}};e6.DEFAULT_COMMANDS_HISTORY_LENGTH=50,e6.PREF_KEY_CACHE="commandPalette.mru.cache",e6.PREF_KEY_COUNTER="commandPalette.mru.counter",e6.counter=1,e6.hasChanges=!1,e6=Y3=Q3([X3(0,KN),X3(1,ug)],e6);class t6 extends J3{constructor(e,t,i,n,o,s){super(e,t,i,n,o,s)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions())t.push({commandId:i.id,commandAlias:i.alias,label:Il(i.label)||i.id});return t}}var i6=function(e,t){return function(i,n){t(i,n,e)}};let n6=class extends t6{get activeTextEditorControl(){var e;return null!==(e=this.codeEditorService.getFocusedCodeEditor())&&void 0!==e?e:void 0}constructor(e,t,i,n,o,s){super({showAlias:!1},e,i,n,o,s),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};n6=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([i6(0,lh),i6(1,dh),i6(2,ML),i6(3,wh),i6(4,Id),i6(5,K3)],n6);class o6 extends zd{constructor(){super({id:o6.ID,label:B0.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:nc.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(rI).quickAccess.show(n6.PREFIX)}}o6.ID="editor.action.quickCommand",qd(o6),md.as(R0).registerQuickAccessProvider({ctor:n6,prefix:n6.PREFIX,helpEntries:[{description:B0.quickCommandHelp,commandId:o6.ID}]});var s6,r6=function(e,t){return function(i,n){t(i,n,e)}};let a6=s6=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=md.as(R0)}provide(e){const t=new M;return t.add(e.onDidAccept((()=>{const[t]=e.selectedItems;t&&this.quickInputService.quickAccess.show(t.prefix,{preserveValue:!0})}))),t.add(e.onDidChangeValue((e=>{const t=this.registry.getQuickAccessProvider(e.substr(s6.PREFIX.length));t&&t.prefix&&t.prefix!==s6.PREFIX&&this.quickInputService.quickAccess.show(t.prefix,{preserveValue:!0})}))),e.items=this.getQuickAccessProviders().filter((e=>e.prefix!==s6.PREFIX)),t}getQuickAccessProviders(){const e=this.registry.getQuickAccessProviders().sort(((e,t)=>e.prefix.localeCompare(t.prefix))).flatMap((e=>this.createPicks(e)));return e}createPicks(e){return e.helpEntries.map((t=>{const i=t.prefix||e.prefix,n=i||"…";return{prefix:i,label:n,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:me(0,"{0}, {1}",n,t.description),description:t.description}}))}};a6.PREFIX="?",a6=s6=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([r6(0,rI),r6(1,ML)],a6),md.as(R0).registerQuickAccessProvider({ctor:a6,prefix:"",helpEntries:[{description:F0.helpQuickAccessActionLabel}]});const l6=[void 0,[]];function h6(e,t,i=0,n=0){const o=t;return o.values&&o.values.length>1?function(e,t,i,n){let o=0;const s=[];for(const r of t){const[t,a]=d6(e,r,i,n);if("number"!=typeof t)return l6;o+=t,s.push(...a)}return[o,c6(s)]}(e,o.values,i,n):d6(e,t,i,n)}function d6(e,t,i,n){const o=nl(t.original,t.originalLowercase,i,e,e.toLowerCase(),n,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return o?[o[0],za(o)]:l6}function c6(e){const t=e.sort(((e,t)=>e.start-t.start)),i=[];let n;for(const e of t)!n||(s=e,(o=n).end<s.start||s.end<o.start)?(n=e,i.push(e)):(n.start=Math.min(n.start,e.start),n.end=Math.max(n.end,e.end));var o,s;return i}function u6(e){return e.startsWith('"')&&e.endsWith('"')}Object.freeze({score:0});const g6=" ";function p6(e){"string"!=typeof e&&(e="");const t=e.toLowerCase(),{pathNormalized:i,normalized:n,normalizedLowercase:o}=m6(e),s=i.indexOf(Do)>=0,r=u6(e);let a;const l=e.split(g6);if(l.length>1)for(const e of l){const t=u6(e),{pathNormalized:i,normalized:n,normalizedLowercase:o}=m6(e);n&&(a||(a=[]),a.push({original:e,originalLowercase:e.toLowerCase(),pathNormalized:i,normalized:n,normalizedLowercase:o,expectContiguousMatch:t}))}return{original:e,originalLowercase:t,pathNormalized:i,normalized:n,normalizedLowercase:o,values:a,containsPathSeparator:s,expectContiguousMatch:r}}function m6(e){let t;t=We?e.replace(/\//g,Do):e.replace(/\\/g,Do);const i=(n=t,n.replace(/\*/g,"")).replace(/\s|"/g,"");var n;return{pathNormalized:t,normalized:i,normalizedLowercase:i.toLowerCase()}}function f6(e){return Array.isArray(e)?p6(e.map((e=>e.original)).join(g6)):p6(e.original)}var _6,v6=function(e,t){return function(i,n){t(i,n,e)}};let b6=_6=class extends M0{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,me(0,"To go to a symbol, first open a text editor with symbol information.")),T.None}provideWithTextEditor(e,t,i){const n=e.editor,o=this.getModel(n);return o?this._languageFeaturesService.documentSymbolProvider.has(o)?this.doProvideWithEditorSymbols(e,o,t,i):this.doProvideWithoutEditorSymbols(e,o,t,i):T.None}doProvideWithoutEditorSymbols(e,t,i,n){const o=new M;return this.provideLabelPick(i,me(0,"The active text editor does not provide symbol information.")),(async()=>{await this.waitForLanguageSymbolRegistry(t,o)&&!n.isCancellationRequested&&o.add(this.doProvideWithEditorSymbols(e,t,i,n))})(),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new ei,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange((()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))})));return t.add(I((()=>i.complete(!1)))),i.p}doProvideWithEditorSymbols(e,t,i,n){var o;const s=e.editor,r=new M;r.add(i.onDidAccept((t=>{const[n]=i.selectedItems;n&&n.range&&(this.gotoLocation(e,{range:n.range.selection,keyMods:i.keyMods,preserveFocus:t.inBackground}),t.inBackground||i.hide())}))),r.add(i.onDidTriggerItemButton((({item:t})=>{t&&t.range&&(this.gotoLocation(e,{range:t.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())})));const a=this.getDocumentSymbols(t,n);let l;const h=async e=>{null==l||l.dispose(!0),i.busy=!1,l=new Pt(n),i.busy=!0;try{const t=p6(i.value.substr(_6.PREFIX.length).trim()),o=await this.doGetSymbolPicks(a,t,void 0,l.token);if(n.isCancellationRequested)return;if(o.length>0){if(i.items=o,e&&0===t.original.length){const t=uu(o,(t=>Boolean("separator"!==t.type&&t.range&&tc.containsPosition(t.range.decoration,e))));t&&(i.activeItems=[t])}}else t.original.length>0?this.provideLabelPick(i,me(0,"No matching editor symbols")):this.provideLabelPick(i,me(0,"No editor symbols"))}finally{n.isCancellationRequested||(i.busy=!1)}};return r.add(i.onDidChangeValue((()=>h(void 0)))),h(null===(o=s.getSelection())||void 0===o?void 0:o.getPosition()),r.add(i.onDidChangeActive((()=>{const[e]=i.activeItems;e&&e.range&&(s.revealRangeInCenter(e.range.selection,0),this.addDecorations(s,e.range.decoration))}))),r}async doGetSymbolPicks(e,t,i,n){var o,s;const r=await e;if(n.isCancellationRequested)return[];const a=0===t.original.indexOf(_6.SCOPE_PREFIX),l=a?1:0;let h,d,c;t.values&&t.values.length>1?(h=f6(t.values[0]),d=f6(t.values.slice(1))):h=t;const u=null===(s=null===(o=this.options)||void 0===o?void 0:o.openSideBySideDirection)||void 0===s?void 0:s.call(o);u&&(c=[{iconClass:"right"===u?Ll.asClassName(Sl.splitHorizontal):Ll.asClassName(Sl.splitVertical),tooltip:me(0,"right"===u?"Open to the Side":"Open to the Bottom")}]);const g=[];for(let v=0;v<r.length;v++){const b=r[v],w=cn(b.name),C=`$(${vC.toIcon(b.kind).id}) ${w}`,y=C.length-w.length;let S,k,L,x,D=b.containerName;if((null==i?void 0:i.extraContainerLabel)&&(D=D?`${i.extraContainerLabel} • ${D}`:i.extraContainerLabel),t.original.length>l){let N=!1;if(h!==t&&([S,k]=h6(C,{...t,values:void 0},l,y),"number"==typeof S&&(N=!0)),"number"!=typeof S&&([S,k]=h6(C,h,l,y),"number"!=typeof S))continue;if(!N&&d){if(D&&d.original.length>0&&([L,x]=h6(D,d)),"number"!=typeof L)continue;"number"==typeof S&&(S+=L)}}const E=b.tags&&b.tags.indexOf(1)>=0;g.push({index:v,kind:b.kind,score:S,label:C,ariaLabel:(p=b.name,m=b.kind,me(0,"{0} ({1})",p,_C[m])),description:D,highlights:E?void 0:{label:k,description:x},range:{selection:tc.collapseToStart(b.selectionRange),decoration:b.range},strikethrough:E,buttons:c})}var p,m;const f=g.sort(((e,t)=>a?this.compareByKindAndScore(e,t):this.compareByScore(e,t)));let _=[];if(a){let I,M,T=0;function A(){M&&"number"==typeof I&&T>0&&(M.label=ln(C6[I]||w6,T))}for(const R of f)I!==R.kind?(A(),I=R.kind,T=1,M={type:"separator"},_.push(M)):T++,_.push(R);A()}else f.length>0&&(_=[{label:me(0,"symbols ({0})",g.length),type:"separator"},...f]);return _}compareByScore(e,t){if("number"!=typeof e.score&&"number"==typeof t.score)return 1;if("number"==typeof e.score&&"number"!=typeof t.score)return-1;if("number"==typeof e.score&&"number"==typeof t.score){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){const i=C6[e.kind]||w6,n=C6[t.kind]||w6,o=i.localeCompare(n);return 0===o?this.compareByScore(e,t):o}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}};b6.PREFIX="@",b6.SCOPE_PREFIX=":",b6.PREFIX_BY_CATEGORY=`${_6.PREFIX}${_6.SCOPE_PREFIX}`,b6=_6=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([v6(0,Jk),v6(1,jY)],b6);const w6=me(0,"properties ({0})"),C6={5:me(0,"methods ({0})"),11:me(0,"functions ({0})"),8:me(0,"constructors ({0})"),12:me(0,"variables ({0})"),4:me(0,"classes ({0})"),22:me(0,"structs ({0})"),23:me(0,"events ({0})"),24:me(0,"operators ({0})"),10:me(0,"interfaces ({0})"),2:me(0,"namespaces ({0})"),3:me(0,"packages ({0})"),25:me(0,"type parameters ({0})"),1:me(0,"modules ({0})"),6:me(0,"properties ({0})"),9:me(0,"enumerations ({0})"),21:me(0,"enumeration members ({0})"),14:me(0,"strings ({0})"),0:me(0,"files ({0})"),17:me(0,"arrays ({0})"),15:me(0,"numbers ({0})"),16:me(0,"booleans ({0})"),18:me(0,"objects ({0})"),19:me(0,"keys ({0})"),7:me(0,"fields ({0})"),13:me(0,"constants ({0})")};var y6=function(e,t){return function(i,n){t(i,n,e)}};let S6=class extends b6{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=z.None}get activeTextEditorControl(){var e;return null!==(e=this.editorService.getFocusedCodeEditor())&&void 0!==e?e:void 0}};S6=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([y6(0,dh),y6(1,Jk),y6(2,jY)],S6);class k6 extends zd{constructor(){super({id:k6.ID,label:W0.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:nc.hasDocumentSymbolProvider,kbOpts:{kbExpr:nc.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(rI).quickAccess.show(b6.PREFIX,{itemActivation:sI.NONE})}}k6.ID="editor.action.quickOutline",qd(k6),md.as(R0).registerQuickAccessProvider({ctor:S6,prefix:b6.PREFIX,helpEntries:[{description:W0.quickOutlineActionLabel,prefix:b6.PREFIX,commandId:k6.ID},{description:W0.quickOutlineByCategoryActionLabel,prefix:b6.PREFIX_BY_CATEGORY}]});class L6 extends T{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit((()=>this._onDidAttemptReadOnlyEdit())))}_onDidAttemptReadOnlyEdit(){const e=Yx.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(91);t||(t=this.editor.isSimpleWidget?new eh(me(0,"Cannot edit in read-only input")):new eh(me(0,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}L6.ID="editor.contrib.readOnlyMessageController",Gd(L6.ID,L6,2);var x6=function(e,t){return function(i,n){t(i,n,e)}};let D6=class extends QK{constructor(e,t,i,n,o,s,r){super(!0,e,t,i,n,o,s,r)}};D6=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([x6(1,sd),x6(2,dh),x6(3,hL),x6(4,lh),x6(5,KN),x6(6,ug)],D6),Gd(QK.ID,D6,4);var E6=i(8342),N6={};N6.styleTagTransform=Vr(),N6.setAttributes=Pr(),N6.insert=Rr().bind(null,"head"),N6.domAPI=Tr(),N6.insertStyleElement=Br(),Ir()(E6.Z,N6),E6.Z&&E6.Z.locals&&E6.Z.locals;var I6=function(e,t){return function(i,n){t(i,n,e)}};const M6=new od("renameInputVisible",!1,me(0,"Whether the rename input widget is visible"));let T6=class{constructor(e,t,i,n,o){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=n,this._disposables=new M,this.allowEditorOverflow=!0,this._visibleContextKey=M6.bindTo(o),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(50)&&this._updateFont()}))),this._disposables.add(i.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._input=document.createElement("input"),this._input.className="rename-input",this._input.type="text",this._input.setAttribute("aria-label",me(0,"Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._input),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){var t,i,n,o;if(!this._input||!this._domNode)return;const s=e.getColor(Mm),r=e.getColor(Tm);this._domNode.style.backgroundColor=String(null!==(t=e.getColor(Sf))&&void 0!==t?t:""),this._domNode.style.boxShadow=s?` 0 0 8px 2px ${s}`:"",this._domNode.style.border=r?`1px solid ${r}`:"",this._domNode.style.color=String(null!==(i=e.getColor(Rm))&&void 0!==i?i:""),this._input.style.backgroundColor=String(null!==(n=e.getColor(Am))&&void 0!==n?n:"");const a=e.getColor(Om);this._input.style.borderWidth=a?"1px":"0px",this._input.style.borderStyle=a?"solid":"none",this._input.style.borderColor=null!==(o=null==a?void 0:a.toString())&&void 0!==o?o:"none"}_updateFont(){if(!this._input||!this._label)return;const e=this._editor.getOption(50);this._input.style.fontFamily=e.fontFamily,this._input.style.fontWeight=e.fontWeight,this._input.style.fontSize=`${e.fontSize}px`,this._label.style.fontSize=.8*e.fontSize+"px"}getPosition(){return this._visible?{position:this._position,preference:[2,1]}:null}beforeRender(){var e,t;const[i,n]=this._acceptKeybindings;return this._label.innerText=me(0,"{0} to Rename, {1} to Preview",null===(e=this._keybindingService.lookupKeybinding(i))||void 0===e?void 0:e.getLabel(),null===(t=this._keybindingService.lookupKeybinding(n))||void 0===t?void 0:t.getLabel()),null}afterRender(e){e||this.cancelInput(!0)}acceptInput(e){var t;null===(t=this._currentAcceptInput)||void 0===t||t.call(this,e)}cancelInput(e){var t;null===(t=this._currentCancelInput)||void 0===t||t.call(this,e)}getInput(e,t,i,n,o,s){this._domNode.classList.toggle("preview",o),this._position=new ch(e.startLineNumber,e.startColumn),this._input.value=t,this._input.setAttribute("selectionStart",i.toString()),this._input.setAttribute("selectionEnd",n.toString()),this._input.size=Math.max(1.1*(e.endColumn-e.startColumn),20);const r=new M;return new Promise((e=>{this._currentCancelInput=t=>(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,e(t),!0),this._currentAcceptInput=i=>{0!==this._input.value.trim().length&&this._input.value!==t?(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,e({newName:this._input.value,wantsPreview:o&&i})):this.cancelInput(!0)},r.add(s.onCancellationRequested((()=>this.cancelInput(!0)))),r.add(this._editor.onDidBlurEditorWidget((()=>{var e;return this.cancelInput(!(null===(e=this._domNode)||void 0===e?void 0:e.ownerDocument.hasFocus()))}))),this._show()})).finally((()=>{r.dispose(),this._hide()}))}_show(){this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout((()=>{this._input.focus(),this._input.setSelectionRange(parseInt(this._input.getAttribute("selectionStart")),parseInt(this._input.getAttribute("selectionEnd")))}),100)}_hide(){this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}};T6=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([I6(2,Tv),I6(3,ML),I6(4,sd)],T6);var A6,R6=function(e,t){return function(i,n){t(i,n,e)}};class O6{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}async resolveRenameLocation(e){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx<this._providers.length;this._providerRenameIdx++){const i=this._providers[this._providerRenameIdx];if(!i.resolveRenameLocation)break;const n=await i.resolveRenameLocation(this.model,this.position,e);if(n){if(!n.rejectReason)return n;t.push(n.rejectReason)}}this._providerRenameIdx=0;const i=this.model.getWordAtPosition(this.position);return i?{range:new tc(this.position.lineNumber,i.startColumn,this.position.lineNumber,i.endColumn),text:i.word,rejectReason:t.length>0?t.join("\n"):void 0}:{range:tc.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join("\n"):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,i,n){const o=this._providers[t];if(!o)return{edits:[],rejectReason:i.join("\n")};const s=await o.provideRenameEdits(this.model,this.position,e,n);return s?s.rejectReason?this._provideRenameEdits(e,t+1,i.concat(s.rejectReason),n):s:this._provideRenameEdits(e,t+1,i.concat(me(0,"No result.")),n)}}let P6=A6=class{static get(e){return e.getContribution(A6.ID)}constructor(e,t,i,n,o,s,r,a){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=o,this._logService=s,this._configService=r,this._languageFeaturesService=a,this._disposableStore=new M,this._cts=new Pt,this._renameInputField=this._disposableStore.add(this._instaService.createInstance(T6,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var e,t;if(this._cts.dispose(!0),this._cts=new Pt,!this.editor.hasModel())return;const i=this.editor.getPosition(),n=new O6(this.editor.getModel(),i,this._languageFeaturesService.renameProvider);if(!n.hasProvider())return;const o=new oL(this.editor,5,void 0,this._cts.token);let s;try{const e=n.resolveRenameLocation(o.token);this._progressService.showWhile(e,250),s=await e}catch(t){return void(null===(e=Yx.get(this.editor))||void 0===e||e.showMessage(t||me(0,"An unknown error occurred while resolving rename location"),i))}finally{o.dispose()}if(!s)return;if(s.rejectReason)return void(null===(t=Yx.get(this.editor))||void 0===t||t.showMessage(s.rejectReason,i));if(o.token.isCancellationRequested)return;const r=new oL(this.editor,5,s.range,this._cts.token),a=this.editor.getSelection();let l=0,h=s.text.length;tc.isEmpty(a)||tc.spansMultipleLines(a)||!tc.containsRange(s.range,a)||(l=Math.max(0,a.startColumn-s.range.startColumn),h=Math.min(s.range.endColumn,a.endColumn)-s.range.startColumn);const d=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),c=await this._renameInputField.getInput(s.range,s.text,l,h,d,r.token);if("boolean"==typeof c)return c&&this.editor.focus(),void r.dispose();this.editor.focus();const u=Vt(n.provideRenameEdits(c.newName,r.token),r.token).then((async e=>{e&&this.editor.hasModel()&&(e.rejectReason?this._notificationService.info(e.rejectReason):(this.editor.setSelection(tc.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply(e,{editor:this.editor,showPreview:c.wantsPreview,label:me(0,"Renaming '{0}' to '{1}'",null==s?void 0:s.text,c.newName),code:"undoredo.rename",quotableLabel:me(0,"Renaming {0} to {1}",null==s?void 0:s.text,c.newName),respectAutoSaveConfig:!0}).then((e=>{e.ariaSummary&&Zr(me(0,"Successfully renamed '{0}' to '{1}'. Summary: {2}",s.text,c.newName,e.ariaSummary))})).catch((e=>{this._notificationService.error(me(0,"Rename failed to apply edits")),this._logService.error(e)}))))}),(e=>{this._notificationService.error(me(0,"Rename failed to compute edits")),this._logService.error(e)})).finally((()=>{r.dispose()}));return this._progressService.showWhile(u,250),u}acceptRenameInput(e){this._renameInputField.acceptInput(e)}cancelRenameInput(){this._renameInputField.cancelInput(!0)}};P6.ID="editor.contrib.renameController",P6=A6=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([R6(1,lh),R6(2,hL),R6(3,Zk),R6(4,uL),R6(5,Md),R6(6,$T),R6(7,Jk)],P6),Gd(P6.ID,P6,4),qd(class extends zd{constructor(){super({id:"editor.action.rename",label:me(0,"Rename Symbol"),alias:"Rename Symbol",precondition:Bh.and(nc.writable,nc.hasRenameProvider),kbOpts:{kbExpr:nc.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(dh),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return Ro.isUri(n)&&ch.isIPosition(o)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then((e=>{e&&(e.setPosition(o),e.invokeWithinContext((t=>(this.reportTelemetry(t,e),this.run(t,e)))))}),h):super.runCommand(e,t)}run(e,t){const i=P6.get(t);return i?i.run():Promise.resolve()}});const F6=Vd.bindToContribution(P6.get);jd(new F6({id:"acceptRenameInput",precondition:M6,handler:e=>e.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:Bh.and(nc.focus,Bh.not("isComposing")),primary:3}})),jd(new F6({id:"acceptRenameInputWithPreview",precondition:Bh.and(M6,Bh.has("config.editor.rename.enablePreview")),handler:e=>e.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:Bh.and(nc.focus,Bh.not("isComposing")),primary:1027}})),jd(new F6({id:"cancelRenameInput",precondition:M6,handler:e=>e.cancelRenameInput(),kbOpts:{weight:199,kbExpr:nc.focus,primary:9,secondary:[1033]}})),Kd("_executeDocumentRenameProvider",(function(e,t,i,...n){const[o]=n;fl("string"==typeof o);const{renameProvider:s}=e.get(Jk);return async function(e,t,i,n){const o=new O6(t,i,e),s=await o.resolveRenameLocation(Rt.None);return(null==s?void 0:s.rejectReason)?{edits:[],rejectReason:s.rejectReason}:o.provideRenameEdits(n,Rt.None)}(s,t,i,o)})),Kd("_executePrepareRename",(async function(e,t,i){const{renameProvider:n}=e.get(Jk),o=new O6(t,i,n),s=await o.resolveRenameLocation(Rt.None);if(null==s?void 0:s.rejectReason)throw new Error(s.rejectReason);return s})),md.as(Lg).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:me(0,"Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});class B6{static create(e,t){return new B6(e,new W6(t))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}constructor(e,t){this._startLineNumber=e,this._tokens=t,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}toString(){return this._tokens.toString(this._startLineNumber)}_updateEndLineNumber(){this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}isEmpty(){return this._tokens.isEmpty()}getLineTokens(e){return this._startLineNumber<=e&&e<=this._endLineNumber?this._tokens.getLineTokens(e-this._startLineNumber):null}getRange(){const e=this._tokens.getRange();return e?new tc(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn):e}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,i,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber,[n,o,s]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new B6(this._startLineNumber,n),new B6(this._startLineNumber+s,o)]}applyEdit(e,t){const[i,n,o]=au(t);this.acceptEdit(e,i,n,o,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,i,n,o){this._acceptDeleteRange(e),this._acceptInsertText(new ch(e.startLineNumber,e.startColumn),t,i,n,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;if(i<0){const e=i-t;return void(this._startLineNumber-=e)}const n=this._tokens.getMaxDeltaLine();if(!(t>=n+1)){if(t<0&&i>=n+1)return this._startLineNumber=0,void this._tokens.clear();if(t<0){const n=-t;this._startLineNumber-=n,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,n,o){if(0===t&&0===i)return;const s=e.lineNumber-this._startLineNumber;s<0?this._startLineNumber+=t:s>=this._tokens.getMaxDeltaLine()+1||this._tokens.acceptInsertText(s,e.column-1,t,i,n,o)}}class W6{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;i<this._tokenCount;i++)t.push(`(${this._getDeltaLine(i)+e},${this._getStartCharacter(i)}-${this._getEndCharacter(i)})`);return`[${t.join(",")}]`}getMaxDeltaLine(){const e=this._getTokenCount();return 0===e?-1:this._getDeltaLine(e-1)}getRange(){const e=this._getTokenCount();if(0===e)return null;const t=this._getStartCharacter(0),i=this._getDeltaLine(e-1),n=this._getEndCharacter(e-1);return new tc(0,t+1,i,n+1)}_getTokenCount(){return this._tokenCount}_getDeltaLine(e){return this._tokens[4*e]}_getStartCharacter(e){return this._tokens[4*e+1]}_getEndCharacter(e){return this._tokens[4*e+2]}isEmpty(){return 0===this._getTokenCount()}getLineTokens(e){let t=0,i=this._getTokenCount()-1;for(;t<i;){const n=t+Math.floor((i-t)/2),o=this._getDeltaLine(n);if(o<e)t=n+1;else{if(!(o>e)){let o=n;for(;o>t&&this._getDeltaLine(o-1)===e;)o--;let s=n;for(;s<i&&this._getDeltaLine(s+1)===e;)s++;return new V6(this._tokens.subarray(4*o,4*s+4))}i=n-1}}return this._getDeltaLine(t)===e?new V6(this._tokens.subarray(4*t,4*t+4)):null}clear(){this._tokenCount=0}removeTokens(e,t,i,n){const o=this._tokens,s=this._tokenCount;let r=0,a=!1,l=0;for(let h=0;h<s;h++){const s=4*h,d=o[s],c=o[s+1],u=o[s+2],g=o[s+3];if((d>e||d===e&&u>=t)&&(d<i||d===i&&c<=n))a=!0;else{if(0===r&&(l=d),a){const e=4*r;o[e]=d-l,o[e+1]=c,o[e+2]=u,o[e+3]=g}r++}}return this._tokenCount=r,l}split(e,t,i,n){const o=this._tokens,s=this._tokenCount,r=[],a=[];let l=r,h=0,d=0;for(let r=0;r<s;r++){const s=4*r,c=o[s],u=o[s+1],g=o[s+2],p=o[s+3];if(c>e||c===e&&g>=t){if(c<i||c===i&&u<=n)continue;l!==a&&(l=a,h=0,d=c)}l[h++]=c-d,l[h++]=u,l[h++]=g,l[h++]=p}return[new W6(new Uint32Array(r)),new W6(new Uint32Array(a)),d]}acceptDeleteRange(e,t,i,n,o){const s=this._tokens,r=this._tokenCount,a=n-t;let l=0,h=!1;for(let d=0;d<r;d++){const c=4*d;let u=s[c],g=s[c+1],p=s[c+2];const m=s[c+3];if(u<t||u===t&&p<=i){l++;continue}if(u===t&&g<i)u===n&&p>o?p-=o-i:p=i;else if(u===t&&g===i){if(!(u===n&&p>o)){h=!0;continue}p-=o-i}else if(u<n||u===n&&g<o){if(!(u===n&&p>o)){h=!0;continue}u=t,g=i,p=g+(p-o)}else if(u>n){if(0===a&&!h){l=r;break}u-=a}else{if(!(u===n&&g>=o))throw new Error("Not possible!");e&&0===u&&(g+=e,p+=e),u-=a,g-=o-i,p-=o-i}const f=4*l;s[f]=u,s[f+1]=g,s[f+2]=p,s[f+3]=m,l++}this._tokenCount=l}acceptInsertText(e,t,i,n,o,s){const r=0===i&&1===n&&(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122),a=this._tokens,l=this._tokenCount;for(let s=0;s<l;s++){const l=4*s;let h=a[l],d=a[l+1],c=a[l+2];if(!(h<e||h===e&&c<t)){if(h===e&&c===t){if(!r)continue;c+=1}else if(h===e&&d<t&&t<c)0===i?c+=n:c=t;else{if(h===e&&d===t&&r)continue;if(h===e)if(h+=i,0===i)d+=n,c+=n;else{const e=c-d;d=o+(d-t),c=d+e}else h+=i}a[l]=h,a[l+1]=d,a[l+2]=c}}}}class V6{constructor(e){this._tokens=e}getCount(){return this._tokens.length/4}getStartCharacter(e){return this._tokens[4*e+1]}getEndCharacter(e){return this._tokens[4*e+2]}getMetadata(e){return this._tokens[4*e+3]}}var z6=function(e,t){return function(i,n){t(i,n,e)}};let H6=class{constructor(e,t,i,n){this._legend=e,this._themeService=t,this._languageService=i,this._logService=n,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new j6}getMetadata(e,t,i){const n=this._languageService.languageIdCodec.encodeLanguageId(i),o=this._hashTable.get(e,t,n);let s;if(o)s=o.metadata,this._logService.getLevel()===Td.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${jp.getForeground(s)}, fontStyle ${jp.getFontStyle(s).toString(2)}`);else{let o=this._legend.tokenTypes[e];const r=[];if(o){let e=t;for(let t=0;e>0&&t<this._legend.tokenModifiers.length;t++)1&e&&r.push(this._legend.tokenModifiers[t]),e>>=1;e>0&&this._logService.getLevel()===Td.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),r.push("not-in-legend"));const n=this._themeService.getColorTheme().getTokenStyleMetadata(o,r,i);void 0===n?s=2147483647:(s=0,void 0!==n.italic&&(s|=1|(n.italic?1:0)<<11),void 0!==n.bold&&(s|=2|(n.bold?2:0)<<11),void 0!==n.underline&&(s|=4|(n.underline?4:0)<<11),void 0!==n.strikethrough&&(s|=8|(n.strikethrough?8:0)<<11),n.foreground&&(s|=16|n.foreground<<15),0===s&&(s=2147483647))}else this._logService.getLevel()===Td.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),s=2147483647,o="not-in-legend";this._hashTable.add(e,t,n,s),this._logService.getLevel()===Td.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${o}) / ${t} (${r.join(" ")}): foreground ${jp.getForeground(s)}, fontStyle ${jp.getFontStyle(s).toString(2)}`)}return s}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,console.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,n,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,console.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${n} is outside the previous data (length ${o}).`))}};function U6(e,t,i){const n=e.data,o=e.data.length/5|0,s=Math.max(Math.ceil(o/1024),400),r=[];let a=0,l=1,h=0;for(;a<o;){const e=a;let d=Math.min(e+s,o);if(d<o){let t=d;for(;t-1>e&&0===n[5*t];)t--;if(t-1===e){let e=d;for(;e+1<o&&0===n[5*e];)e++;d=e}else d=t}let c=new Uint32Array(4*(d-e)),u=0,g=0,p=0,m=0;for(;a<d;){const e=5*a,o=n[e],s=n[e+1],r=l+o|0,d=0===o?h+s|0:s,f=d+n[e+2]|0,_=n[e+3],v=n[e+4];if(f<=d)t.warnInvalidLengthSemanticTokens(r,d+1);else if(p===r&&m>d)t.warnOverlappingSemanticTokens(r,d+1);else{const e=t.getMetadata(_,v,i);2147483647!==e&&(0===g&&(g=r),c[u]=r-g,c[u+1]=d,c[u+2]=f,c[u+3]=e,u+=4,p=r,m=f)}l=r,h=d,a++}u!==c.length&&(c=c.subarray(0,u));const f=B6.create(g,c);r.push(f)}return r}H6=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([z6(1,Tv),z6(2,yu),z6(3,Md)],H6);class K6{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}}class j6{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=j6._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<j6._SIZES.length?2/3*this._currentLength:0),this._elements=[],j6._nullOutEntries(this._elements,this._currentLength)}static _nullOutEntries(e,t){for(let i=0;i<t;i++)e[i]=null}_hash2(e,t){return(e<<5)-e+t|0}_hashFunc(e,t,i){return this._hash2(this._hash2(e,t),i)%this._currentLength}get(e,t,i){const n=this._hashFunc(e,t,i);let o=this._elements[n];for(;o;){if(o.tokenTypeIndex===e&&o.tokenModifierSet===t&&o.languageId===i)return o;o=o.next}return null}add(e,t,i,n){if(this._elementsCount++,0!==this._growCount&&this._elementsCount>=this._growCount){const e=this._elements;this._currentLengthIndex++,this._currentLength=j6._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<j6._SIZES.length?2/3*this._currentLength:0),this._elements=[],j6._nullOutEntries(this._elements,this._currentLength);for(const t of e){let e=t;for(;e;){const t=e.next;e.next=null,this._add(e),e=t}}}this._add(new K6(e,t,i,n))}_add(e){const t=this._hashFunc(e.tokenTypeIndex,e.tokenModifierSet,e.languageId);e.next=this._elements[t],this._elements[t]=e}}function q6(e){const t=new Uint32Array(function(e){let t=0;if(t+=2,"full"===e.type)t+=1+e.data.length;else{t+=1,t+=3*e.deltas.length;for(const i of e.deltas)i.data&&(t+=i.data.length)}return t}(e));let i=0;if(t[i++]=e.id,"full"===e.type)t[i++]=1,t[i++]=e.data.length,t.set(e.data,i),i+=e.data.length;else{t[i++]=2,t[i++]=e.deltas.length;for(const n of e.deltas)t[i++]=n.start,t[i++]=n.deleteCount,n.data?(t[i++]=n.data.length,t.set(n.data,i),i+=n.data.length):t[i++]=0}return function(e){const t=new Uint8Array(e.buffer,e.byteOffset,4*e.length);return et()||function(e){for(let t=0,i=e.length;t<i;t+=4){const i=e[t+0],n=e[t+1],o=e[t+2],s=e[t+3];e[t+0]=s,e[t+1]=o,e[t+2]=n,e[t+3]=i}}(t),Uu.wrap(t)}(t)}function $6(e){return e&&!!e.data}function G6(e){return e&&Array.isArray(e.edits)}j6._SIZES=[3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143];class Z6{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function Y6(e,t){return e.has(t)}async function Q6(e,t,i,n,o){const s=function(e,t){const i=e.orderedGroups(t);return i.length>0?i[0]:[]}(e,t),r=await Promise.all(s.map((async e=>{let s,r=null;try{s=await e.provideDocumentSemanticTokens(t,e===i?n:null,o)}catch(e){r=e,s=null}return s&&($6(s)||G6(s))||(s=null),new Z6(e,s,r)})));for(const e of r){if(e.error)throw e.error;if(e.tokens)return e}return r.length>0?r[0]:null}class X6{constructor(e,t){this.provider=e,this.tokens=t}}function J6(e,t){const i=e.orderedGroups(t);return i.length>0?i[0]:[]}async function e9(e,t,i,n){const o=J6(e,t),s=await Promise.all(o.map((async e=>{let o;try{o=await e.provideDocumentRangeSemanticTokens(t,i,n)}catch(e){d(e),o=null}return o&&$6(o)||(o=null),new X6(e,o)})));for(const e of s)if(e.tokens)return e;return s.length>0?s[0]:null}Ch.registerCommand("_provideDocumentSemanticTokensLegend",(async(e,...t)=>{const[i]=t;fl(i instanceof Ro);const n=e.get(uh).getModel(i);if(!n)return;const{documentSemanticTokensProvider:o}=e.get(Jk),s=function(e,t){const i=e.orderedGroups(t);return i.length>0?i[0]:null}(o,n);return s?s[0].getLegend():e.get(wh).executeCommand("_provideDocumentRangeSemanticTokensLegend",i)})),Ch.registerCommand("_provideDocumentSemanticTokens",(async(e,...t)=>{const[i]=t;fl(i instanceof Ro);const n=e.get(uh).getModel(i);if(!n)return;const{documentSemanticTokensProvider:o}=e.get(Jk);if(!Y6(o,n))return e.get(wh).executeCommand("_provideDocumentRangeSemanticTokens",i,n.getFullModelRange());const s=await Q6(o,n,null,null,Rt.None);if(!s)return;const{provider:r,tokens:a}=s;if(!a||!$6(a))return;const l=q6({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),l})),Ch.registerCommand("_provideDocumentRangeSemanticTokensLegend",(async(e,...t)=>{const[i,n]=t;fl(i instanceof Ro);const o=e.get(uh).getModel(i);if(!o)return;const{documentRangeSemanticTokensProvider:s}=e.get(Jk),r=J6(s,o);if(0===r.length)return;if(1===r.length)return r[0].getLegend();if(!n||!tc.isIRange(n))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=await e9(s,o,tc.lift(n),Rt.None);return a?a.provider.getLegend():void 0})),Ch.registerCommand("_provideDocumentRangeSemanticTokens",(async(e,...t)=>{const[i,n]=t;fl(i instanceof Ro),fl(tc.isIRange(n));const o=e.get(uh).getModel(i);if(!o)return;const{documentRangeSemanticTokensProvider:s}=e.get(Jk),r=await e9(s,o,tc.lift(n),Rt.None);return r&&r.tokens?q6({id:0,type:"full",data:r.tokens.data}):void 0}));const t9=hh("semanticTokensStylingService"),i9="editor.semanticHighlighting";function n9(e,t,i){var n;const o=null===(n=i.getValue(i9,{overrideIdentifier:e.getLanguageId(),resource:e.uri}))||void 0===n?void 0:n.enabled;return"boolean"==typeof o?o:t.getColorTheme().semanticHighlighting}var o9,s9=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},r9=function(e,t){return function(i,n){t(i,n,e)}};let a9=class extends T{constructor(e,t,i,n,o,s){super(),this._watchers=Object.create(null);const r=t=>{this._watchers[t.uri.toString()]=new l9(t,e,i,o,s)},a=(e,t)=>{t.dispose(),delete this._watchers[e.uri.toString()]},l=()=>{for(const e of t.getModels()){const t=this._watchers[e.uri.toString()];n9(e,i,n)?t||r(e):t&&a(e,t)}};this._register(t.onModelAdded((e=>{n9(e,i,n)&&r(e)}))),this._register(t.onModelRemoved((e=>{const t=this._watchers[e.uri.toString()];t&&a(e,t)}))),this._register(n.onDidChangeConfiguration((e=>{e.affectsConfiguration(i9)&&l()}))),this._register(i.onDidColorThemeChange(l))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};a9=s9([r9(0,t9),r9(1,uh),r9(2,Tv),r9(3,ug),r9(4,hI),r9(5,Jk)],a9);let l9=o9=class extends T{constructor(e,t,i,n,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:o9.REQUEST_MIN_DELAY,max:o9.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new Zt((()=>this._fetchDocumentSemanticTokensNow()),o9.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent((()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._register(this._model.onDidChangeAttached((()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._register(this._model.onDidChangeLanguage((()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)})));const s=()=>{E(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const t of this._provider.all(e))"function"==typeof t.onDidChange&&this._documentProvidersChangeListeners.push(t.onDidChange((()=>{this._currentDocumentRequestCancellationTokenSource?this._providersChangedDuringRequest=!0:this._fetchDocumentSemanticTokens.schedule(0)})))};s(),this._register(this._provider.onDidChange((()=>{s(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._register(i.onDidColorThemeChange((e=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),E(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!Y6(this._provider,this._model))return void(this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1));if(!this._model.isAttachedToEditor())return;const e=new Pt,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=Q6(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],s=this._model.onDidChangeContent((e=>{o.push(e)})),r=new V(!1);n.then((e=>{if(this._debounceInformation.update(this._model,r.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),e){const{provider:t,tokens:i}=e,n=this._semanticTokensStylingService.getStyling(t);this._setDocumentSemanticTokens(t,i||null,n,o)}else this._setDocumentSemanticTokens(null,null,null,o)}),(e=>{e&&(g(e)||"string"==typeof e.message&&-1!==e.message.indexOf("busy"))||h(e),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))}))}static _copy(e,t,i,n,o){o=Math.min(o,i.length-n,e.length-t);for(let s=0;s<o;s++)i[n+s]=e[t+s]}_setDocumentSemanticTokens(e,t,i,n){const o=this._currentDocumentResponse,s=()=>{(n.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed)e&&t&&e.releaseDocumentSemanticTokens(t.resultId);else if(e&&i){if(!t)return this._model.tokenization.setSemanticTokens(null,!0),void s();if(G6(t)){if(!o)return void this._model.tokenization.setSemanticTokens(null,!0);if(0===t.edits.length)t={resultId:t.resultId,data:o.data};else{let e=0;for(const i of t.edits)e+=(i.data?i.data.length:0)-i.deleteCount;const n=o.data,s=new Uint32Array(n.length+e);let r=n.length,a=s.length;for(let e=t.edits.length-1;e>=0;e--){const l=t.edits[e];if(l.start>n.length)return i.warnInvalidEditStart(o.resultId,t.resultId,e,l.start,n.length),void this._model.tokenization.setSemanticTokens(null,!0);const h=r-(l.start+l.deleteCount);h>0&&(o9._copy(n,r-h,s,a-h,h),a-=h),l.data&&(o9._copy(l.data,0,s,a-l.data.length,l.data.length),a-=l.data.length),r=l.start}r>0&&o9._copy(n,0,s,0,r),t={resultId:t.resultId,data:s}}}if($6(t)){this._currentDocumentResponse=new h9(e,t.resultId,t.data);const o=U6(t,i,this._model.getLanguageId());if(n.length>0)for(const e of n)for(const t of o)for(const i of e.changes)t.applyEdit(i.range,i.text);this._model.tokenization.setSemanticTokens(o,!0)}else this._model.tokenization.setSemanticTokens(null,!0);s()}else this._model.tokenization.setSemanticTokens(null,!1)}};l9.REQUEST_MIN_DELAY=300,l9.REQUEST_MAX_DELAY=2e3,l9=o9=s9([r9(1,t9),r9(2,Tv),r9(3,hI),r9(4,Jk)],l9);class h9{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}sA(a9);var d9=function(e,t){return function(i,n){t(i,n,e)}};let c9=class extends T{constructor(e,t,i,n,o,s){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=s.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new Zt((()=>this._tokenizeViewportNow()),100)),this._outstandingRequests=[];const r=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange((()=>{r()}))),this._register(this._editor.onDidChangeModel((()=>{this._cancelAll(),r()}))),this._register(this._editor.onDidChangeModelContent((e=>{this._cancelAll(),r()}))),this._register(this._provider.onDidChange((()=>{this._cancelAll(),r()}))),this._register(this._configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration(i9)&&(this._cancelAll(),r())}))),this._register(this._themeService.onDidColorThemeChange((()=>{this._cancelAll(),r()}))),r()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;t<i;t++)if(this._outstandingRequests[t]===e)return void this._outstandingRequests.splice(t,1)}_tokenizeViewportNow(){if(!this._editor.hasModel())return;const e=this._editor.getModel();if(e.tokenization.hasCompleteSemanticTokens())return;if(!n9(e,this._themeService,this._configurationService))return void(e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1));if(!function(e,t){return e.has(t)}(this._provider,e))return void(e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1));const t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map((t=>this._requestRange(e,t))))}_requestRange(e,t){const i=e.getVersionId(),n=Wt((i=>Promise.resolve(e9(this._provider,e,t,i)))),o=new V(!1);return n.then((n=>{if(this._debounceInformation.update(e,o.elapsed()),!n||!n.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:s,tokens:r}=n,a=this._semanticTokensStylingService.getStyling(s);e.tokenization.setPartialSemanticTokens(t,U6(r,a,e.getLanguageId()))})).then((()=>this._removeOutstandingRequest(n)),(()=>this._removeOutstandingRequest(n))),n}};c9.ID="editor.contrib.viewportSemanticTokens",c9=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([d9(1,t9),d9(2,Tv),d9(3,ug),d9(4,hI),d9(5,Jk)],c9),Gd(c9.ID,c9,1);class u9{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const t=[];i.push(t),this.selectSubwords&&this._addInWordRanges(t,e,n),this._addWordRanges(t,e,n),this._addWhitespaceLine(t,e,n),t.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:o,startColumn:s}=n,r=i.column-s;let a=r,l=r,h=0;for(;a>=0;a--){const e=o.charCodeAt(a);if(a!==r&&(95===e||45===e))break;if(kn(e)&&Ln(h))break;h=e}for(a+=1;l<o.length;l++){const e=o.charCodeAt(l);if(Ln(e)&&kn(h))break;if(95===e||45===e)break;h=e}a<l&&e.push({range:new tc(i.lineNumber,s+a,i.lineNumber,s+l)})}_addWordRanges(e,t,i){const n=t.getWordAtPosition(i);n&&e.push({range:new tc(i.lineNumber,n.startColumn,i.lineNumber,n.endColumn)})}_addWhitespaceLine(e,t,i){t.getLineLength(i.lineNumber)>0&&0===t.getLineFirstNonWhitespaceColumn(i.lineNumber)&&0===t.getLineLastNonWhitespaceColumn(i.lineNumber)&&e.push({range:new tc(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var g9;class p9{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new p9(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}let m9=g9=class{static get(e){return e.getContribution(g9.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;null===(e=this._selectionListener)||void 0===e||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await _9(this._languageFeaturesService.selectionRangeProvider,i,t.map((e=>e.getPosition())),this._editor.getOption(112),Rt.None).then((e=>{var i;if(Wc(e)&&e.length===t.length&&this._editor.hasModel()&&Ic(this._editor.getSelections(),t,((e,t)=>e.equalsSelection(t)))){for(let i=0;i<e.length;i++)e[i]=e[i].filter((e=>e.containsPosition(t[i].getStartPosition())&&e.containsPosition(t[i].getEndPosition()))),e[i].unshift(t[i]);this._state=e.map((e=>new p9(0,e))),null===(i=this._selectionListener)||void 0===i||i.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition((()=>{var e;this._ignoreSelection||(null===(e=this._selectionListener)||void 0===e||e.dispose(),this._state=void 0)}))}})),!this._state)return;this._state=this._state.map((t=>t.mov(e)));const n=this._state.map((e=>ic.fromPositions(e.ranges[e.index].getStartPosition(),e.ranges[e.index].getEndPosition())));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}};m9.ID="editor.contrib.smartSelectController",m9=g9=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,Jk)],m9);class f9 extends zd{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=m9.get(t);i&&await i.run(this._forward)}}async function _9(e,t,i,n,o){const s=e.all(t).concat(new u9(n.selectSubwords));1===s.length&&s.unshift(new d4);const r=[],a=[];for(const e of s)r.push(Promise.resolve(e.provideSelectionRanges(t,i,o)).then((e=>{if(Wc(e)&&e.length===i.length)for(let t=0;t<i.length;t++){a[t]||(a[t]=[]);for(const n of e[t])tc.isIRange(n.range)&&tc.containsPosition(n.range,i[t])&&a[t].push(tc.lift(n.range))}}),d));return await Promise.all(r),a.map((e=>{if(0===e.length)return[];e.sort(((e,t)=>ch.isBefore(e.getStartPosition(),t.getStartPosition())?1:ch.isBefore(t.getStartPosition(),e.getStartPosition())||ch.isBefore(e.getEndPosition(),t.getEndPosition())?-1:ch.isBefore(t.getEndPosition(),e.getEndPosition())?1:0));const i=[];let o;for(const t of e)(!o||tc.containsRange(t,o)&&!tc.equalsRange(t,o))&&(i.push(t),o=t);if(!n.selectLeadingAndTrailingWhitespace)return i;const s=[i[0]];for(let e=1;e<i.length;e++){const n=i[e-1],o=i[e];if(o.startLineNumber!==n.startLineNumber||o.endLineNumber!==n.endLineNumber){const e=new tc(n.startLineNumber,t.getLineFirstNonWhitespaceColumn(n.startLineNumber),n.endLineNumber,t.getLineLastNonWhitespaceColumn(n.endLineNumber));e.containsRange(n)&&!e.equalsRange(n)&&o.containsRange(e)&&!o.equalsRange(e)&&s.push(e);const i=new tc(n.startLineNumber,1,n.endLineNumber,t.getLineMaxColumn(n.endLineNumber));i.containsRange(n)&&!i.equalsRange(e)&&o.containsRange(i)&&!o.equalsRange(i)&&s.push(i)}s.push(o)}return s}))}Ch.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand"),Gd(m9.ID,m9,4),qd(class extends f9{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:me(0,"Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:nc.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:yd.MenubarSelectionMenu,group:"1_basic",title:me(0,"&&Expand Selection"),order:2}})}}),qd(class extends f9{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:me(0,"Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:nc.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:yd.MenubarSelectionMenu,group:"1_basic",title:me(0,"&&Shrink Selection"),order:3}})}}),Ch.registerCommand("_executeSelectionRangeProvider",(async function(e,...t){const[i,n]=t;fl(Ro.isUri(i));const o=e.get(Jk).selectionRangeProvider,s=await e.get(gh).createModelReference(i);try{return _9(o,s.object.textEditorModel,n,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},Rt.None)}finally{s.dispose()}}));const v9=Object.freeze({View:{value:me(0,"View"),original:"View"},Help:{value:me(0,"Help"),original:"Help"},Test:{value:me(0,"Test"),original:"Test"},File:{value:me(0,"File"),original:"File"},Preferences:{value:me(0,"Preferences"),original:"Preferences"},Developer:{value:me(0,"Developer"),original:"Developer"}});var b9=i(6098),w9={};w9.styleTagTransform=Vr(),w9.setAttributes=Pr(),w9.insert=Rr().bind(null,"head"),w9.domAPI=Tr(),w9.insertStyleElement=Br(),Ir()(b9.Z,w9),b9.Z&&b9.Z.locals&&b9.Z.locals;class C9{constructor(e,t,i,n=null){this.startLineNumbers=e,this.endLineNumbers=t,this.lastLineRelativePosition=i,this.showEndForLine=n}equals(e){return!!e&&this.lastLineRelativePosition===e.lastLineRelativePosition&&this.showEndForLine===e.showEndForLine&&Ic(this.startLineNumbers,e.startLineNumbers)&&Ic(this.endLineNumbers,e.endLineNumbers)}}const y9=Tx("stickyScrollViewLayer",{createHTML:e=>e}),S9="data-sticky-line-index",k9="data-sticky-is-line",L9="data-sticky-is-folding-icon";class x9 extends T{constructor(e){super(),this._editor=e,this._foldingIconStore=new M,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._lineHeight=this._editor.getOption(66),this._stickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof _V),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(114).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(114)&&t(),e.hasChanged(66)&&(this._lineHeight=this._editor.getOption(66))}))),this._register(this._editor.onDidScrollChange((e=>{e.scrollLeftChanged&&t(),e.scrollWidthChanged&&this._updateWidgetWidth()}))),this._register(this._editor.onDidChangeModel((()=>{t(),this._updateWidgetWidth()}))),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange((e=>{this._updateWidgetWidth()}))),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getStickyLineForLine(e){return this._stickyLines.find((t=>t.lineNumber===e))}getCurrentLines(){return this._lineNumbers}setState(e,t,i=1/0){if((!this._previousState&&!e||this._previousState&&this._previousState.equals(e))&&i===1/0)return;this._previousState=e;const n=this._stickyLines;if(this._clearStickyWidget(),e&&this._editor._getViewModel()){if(e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const t=[...e.startLineNumbers];null!==e.showEndForLine&&(t[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=t}else this._lastLineRelativePosition=0,this._lineNumbers=[];this._renderRootNode(n,t,i)}}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",this._editor.getScrollWidth()-e.verticalScrollbarWidth+"px"),this._rootDomNode.style.width=e.width-e.verticalScrollbarWidth+"px"}_clearStickyWidget(){this._stickyLines=[],this._foldingIconStore.clear(),_s(this._lineNumbersDomNode),_s(this._linesDomNode),this._rootDomNode.style.display="none"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._stickyLines){const i=t.foldingIcon;i&&i.setVisible(!!e||i.isCollapsed)}}async _renderRootNode(e,t,i=1/0){const n=this._editor.getLayoutInfo();for(const[o,s]of this._lineNumbers.entries()){const r=e[o],a=s>=i||(null==r?void 0:r.lineNumber)!==s?this._renderChildNode(o,s,t,n):this._updateTopAndZIndexOfStickyLine(r);a&&(this._linesDomNode.appendChild(a.lineDomNode),this._lineNumbersDomNode.appendChild(a.lineNumberDomNode),this._stickyLines.push(a))}t&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));const o=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;0!==o?(this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${o}px`,this._linesDomNodeScrollable.style.height=`${o}px`,this._rootDomNode.style.height=`${o}px`,this._rootDomNode.style.marginLeft="0px",this._updateMinContentWidth(),this._editor.layoutOverlayWidget(this)):this._clearStickyWidget()}_setFoldingHoverListeners(){"mouseover"===this._editor.getOption(109)&&(this._foldingIconStore.add(bs(this._lineNumbersDomNode,or.MOUSE_ENTER,(e=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)}))),this._foldingIconStore.add(bs(this._lineNumbersDomNode,or.MOUSE_LEAVE,(()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)}))))}_renderChildNode(e,t,i,n){const o=this._editor._getViewModel();if(!o)return;const s=o.coordinatesConverter.convertModelPositionToViewPosition(new ch(t,1)).lineNumber,r=o.getViewLineRenderingData(s),a=this._editor.getOption(67);let l;try{l=jR.filter(r.inlineDecorations,s,r.minColumn,r.maxColumn)}catch(e){l=[]}const h=new QR(!0,!0,r.content,r.continuesWithWrappedLine,r.isBasicASCII,r.containsRTL,0,r.tokens,l,r.tabSize,r.startVisibleColumn,1,1,1,500,"none",!0,!0,null),d=new Xu(2e3),c=tO(h,d);let u;u=y9?y9.createHTML(d.build()):d.build();const g=document.createElement("span");g.setAttribute(S9,String(e)),g.setAttribute(k9,""),g.setAttribute("role","listitem"),g.tabIndex=0,g.className="sticky-line-content",g.classList.add(`stickyLine${t}`),g.style.lineHeight=`${this._lineHeight}px`,g.innerHTML=u;const p=document.createElement("span");p.setAttribute(S9,String(e)),p.setAttribute("data-sticky-is-line-number",""),p.className="sticky-line-number",p.style.lineHeight=`${this._lineHeight}px`;const m=n.contentLeft;p.style.width=`${m}px`;const f=document.createElement("span");1===a.renderType||3===a.renderType&&t%10==0?f.innerText=t.toString():2===a.renderType&&(f.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),f.className="sticky-line-number-inner",f.style.lineHeight=`${this._lineHeight}px`,f.style.width=`${n.lineNumbersWidth}px`,f.style.paddingLeft=`${n.lineNumbersLeft}px`,p.appendChild(f);const _=this._renderFoldingIconForLine(i,t);_&&p.appendChild(_.domNode),this._editor.applyFontInfo(g),this._editor.applyFontInfo(f),p.style.lineHeight=`${this._lineHeight}px`,g.style.lineHeight=`${this._lineHeight}px`,p.style.height=`${this._lineHeight}px`,g.style.height=`${this._lineHeight}px`;const v=new D9(e,t,g,p,_,c.characterMapping);return this._updateTopAndZIndexOfStickyLine(v)}_updateTopAndZIndexOfStickyLine(e){var t;const i=e.index,n=e.lineDomNode,o=e.lineNumberDomNode,s=i===this._lineNumbers.length-1;n.style.zIndex=s?"0":"1",o.style.zIndex=s?"0":"1";const r=`${i*this._lineHeight+this._lastLineRelativePosition+((null===(t=e.foldingIcon)||void 0===t?void 0:t.isCollapsed)?1:0)}px`,a=i*this._lineHeight+"px";return n.style.top=s?r:a,o.style.top=s?r:a,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(109);if(!e||"never"===i)return;const n=e.regions,o=n.findRange(t),s=n.getStartLineNumber(o);if(t!==s)return;const r=n.isCollapsed(o),a=new E9(r,s,n.getEndLineNumber(o),this._lineHeight);return a.setVisible(!!this._isOnGlyphMargin||r||"always"===i),a.domNode.setAttribute(L9,""),a}_updateMinContentWidth(){this._minContentWidthInPx=0;for(const e of this._stickyLines)e.lineDomNode.scrollWidth>this._minContentWidthInPx&&(this._minContentWidthInPx=e.lineDomNode.scrollWidth);this._minContentWidthInPx+=this._editor.getLayoutInfo().verticalScrollbarWidth}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:null}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e<this._stickyLines.length&&this._stickyLines[e].lineDomNode.focus()}getEditorPositionFromNode(e){if(!e||e.children.length>0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=pO(t.characterMapping,e,0);return new ch(t.lineNumber,i)}getLineNumberFromChildDomNode(e){var t,i;return null!==(i=null===(t=this._getRenderedStickyLineFromChildDomNode(e))||void 0===t?void 0:t.lineNumber)&&void 0!==i?i:null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return null===t||t<0||t>=this._stickyLines.length?null:this._stickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,S9);return t?parseInt(t,10):null}isInStickyLine(e){return void 0!==this._getAttributeValue(e,k9)}isInFoldingIconDomNode(e){return void 0!==this._getAttributeValue(e,L9)}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(null!==i)return i;e=e.parentElement}}}class D9{constructor(e,t,i,n,o,s){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=n,this.foldingIcon=o,this.characterMapping=s}}class E9{constructor(e,t,i,n){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=n,this.domNode=document.createElement("div"),this.domNode.style.width=`${n}px`,this.domNode.style.height=`${n}px`,this.domNode.className=Ll.asClassName(e?e0:JJ)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class N9{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class I9{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class M9{constructor(e,t,i,n){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=n}}var T9,A9,R9=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},O9=function(e,t){return function(i,n){t(i,n,e)}};!function(e){e.OUTLINE_MODEL="outlineModel",e.FOLDING_PROVIDER_MODEL="foldingProviderModel",e.INDENTATION_MODEL="indentationModel"}(T9||(T9={})),function(e){e[e.VALID=0]="VALID",e[e.INVALID=1]="INVALID",e[e.CANCELED=2]="CANCELED"}(A9||(A9={}));let P9=class extends T{constructor(e,t,i,n){super(),this._editor=e,this._languageConfigurationService=t,this._languageFeaturesService=i,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Ht(300)),this._updateOperation=this._register(new M);const o=new B9(i),s=new z9(this._editor,i),r=new V9(this._editor,t);switch(n){case T9.OUTLINE_MODEL:this._modelProviders.push(o),this._modelProviders.push(s),this._modelProviders.push(r);break;case T9.FOLDING_PROVIDER_MODEL:this._modelProviders.push(s),this._modelProviders.push(r);break;case T9.INDENTATION_MODEL:this._modelProviders.push(r)}}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e,t,i){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger((async()=>{for(const n of this._modelProviders){const{statusPromise:o,modelPromise:s}=n.computeStickyModel(e,t,i);this._modelPromise=s;const r=await o;if(this._modelPromise!==s)return null;switch(r){case A9.CANCELED:return this._updateOperation.clear(),null;case A9.VALID:return n.stickyModel}}return null})).catch((e=>(h(e),null)))}};P9=R9([O9(1,Yg),O9(2,Jk)],P9);class F9{constructor(){this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,A9.INVALID}computeStickyModel(e,t,i){if(i.isCancellationRequested||!this.isProviderValid(e))return{statusPromise:this._invalid(),modelPromise:null};const n=Wt((i=>this.createModelFromProvider(e,t,i)));return{statusPromise:n.then((n=>this.isModelValid(n)?i.isCancellationRequested?A9.CANCELED:(this._stickyModel=this.createStickyModel(e,t,i,n),A9.VALID):this._invalid())).then(void 0,(e=>(h(e),A9.CANCELED))),modelPromise:n}}isModelValid(e){return!0}isProviderValid(e){return!0}}let B9=class extends F9{constructor(e){super(),this._languageFeaturesService=e}createModelFromProvider(e,t,i){return KY.create(this._languageFeaturesService.documentSymbolProvider,e,i)}createStickyModel(e,t,i,n){var o;const{stickyOutlineElement:s,providerID:r}=this._stickyModelFromOutlineModel(n,null===(o=this._stickyModel)||void 0===o?void 0:o.outlineProviderId);return new M9(e.uri,t,s,r)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(C.first(e.children.values())instanceof UY){const n=C.find(e.children.values(),(e=>e.id===t));if(n)i=n.children;else{let n,o="",s=-1;for(const[t,i]of e.children.entries()){const e=this._findSumOfRangesOfGroup(i);e>s&&(n=i,s=e,o=i.id)}t=o,i=n.children}}else i=e.children;const n=[],o=Array.from(i.values()).sort(((e,t)=>{const i=new N9(e.symbol.range.startLineNumber,e.symbol.range.endLineNumber),n=new N9(t.symbol.range.startLineNumber,t.symbol.range.endLineNumber);return this._comparator(i,n)}));for(const e of o)n.push(this._stickyModelFromOutlineElement(e,e.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new I9(void 0,n,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const n of e.children.values())if(n.symbol.selectionRange.startLineNumber!==n.symbol.range.endLineNumber)if(n.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(n,n.symbol.selectionRange.startLineNumber));else for(const e of n.children.values())i.push(this._stickyModelFromOutlineElement(e,n.symbol.selectionRange.startLineNumber));i.sort(((e,t)=>this._comparator(e.range,t.range)));const n=new N9(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new I9(n,i,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof HY?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};B9=R9([O9(0,Jk)],B9);class W9 extends F9{constructor(e){super(),this._foldingLimitReporter=new u0(e)}createStickyModel(e,t,i,n){const o=this._fromFoldingRegions(n);return new M9(e.uri,t,o,void 0)}isModelValid(e){return null!==e}_fromFoldingRegions(e){const t=e.length,i=[],n=new I9(void 0,[],void 0);for(let o=0;o<t;o++){const t=e.getParentIndex(o);let s;s=-1!==t?i[t]:n;const r=new I9(new N9(e.getStartLineNumber(o),e.getEndLineNumber(o)+1),[],s);s.children.push(r),i.push(r)}return n}}let V9=class extends W9{constructor(e,t){super(e),this._languageConfigurationService=t}createModelFromProvider(e,t,i){return new ZJ(e,this._languageConfigurationService,this._foldingLimitReporter).compute(i)}};V9=R9([O9(1,Yg)],V9);let z9=class extends W9{constructor(e,t){super(e),this._languageFeaturesService=t}isProviderValid(e){return c0.getFoldingRangeProviders(this._languageFeaturesService,e).length>0}createModelFromProvider(e,t,i){const n=c0.getFoldingRangeProviders(this._languageFeaturesService,e);return new r0(e,n,(()=>this.createModelFromProvider(e,t,i)),this._foldingLimitReporter,void 0).compute(i)}};z9=R9([O9(1,Jk)],z9);var H9=function(e,t){return function(i,n){t(i,n,e)}};class U9{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}let K9=class extends T{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new q),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._options=null,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new M),this._updateSoon=this._register(new Zt((()=>this.update()),50)),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(114)&&this.readConfiguration()}))),this.readConfiguration()}readConfiguration(){this._stickyModelProvider=null,this._sessionStore.clear(),this._options=this._editor.getOption(114),this._options.enabled&&(this._stickyModelProvider=this._sessionStore.add(new P9(this._editor,this._languageConfigurationService,this._languageFeaturesService,this._options.defaultModel)),this._sessionStore.add(this._editor.onDidChangeModel((()=>{this._model=null,this._onDidChangeStickyScroll.fire(),this.update()}))),this._sessionStore.add(this._editor.onDidChangeHiddenAreas((()=>this.update()))),this._sessionStore.add(this._editor.onDidChangeModelContent((()=>this._updateSoon.schedule()))),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange((()=>this.update()))),this.update())}getVersionId(){var e;return null===(e=this._model)||void 0===e?void 0:e.version}async update(){var e;null===(e=this._cts)||void 0===e||e.dispose(!0),this._cts=new Pt,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization())return void(this._model=null);const t=this._editor.getModel(),i=t.getVersionId(),n=await this._stickyModelProvider.update(t,i,e);e.isCancellationRequested||(this._model=n)}updateIndex(e){return-1===e?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,n,o){if(0===t.children.length)return;let s=o;const r=[];for(let e=0;e<t.children.length;e++){const i=t.children[e];i.range&&r.push(i.range.startLineNumber)}const a=this.updateIndex(Mc(r,e.startLineNumber,((e,t)=>e-t))),l=this.updateIndex(Mc(r,e.startLineNumber+n,((e,t)=>e-t)));for(let r=a;r<=l;r++){const a=t.children[r];if(!a)return;if(a.range){const t=a.range.startLineNumber,o=a.range.endLineNumber;e.startLineNumber<=o+1&&t-1<=e.endLineNumber&&t!==s&&(s=t,i.push(new U9(t,o-1,n+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,a,i,n+1,t))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,a,i,n,o)}}getCandidateStickyLinesIntersecting(e){var t,i;if(!(null===(t=this._model)||void 0===t?void 0:t.element))return[];let n=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,n,0,-1);const o=null===(i=this._editor._getViewModel())||void 0===i?void 0:i.getHiddenAreas();if(o)for(const e of o)n=n.filter((t=>!(t.startLineNumber>=e.startLineNumber&&t.endLineNumber<=e.endLineNumber+1)));return n}};K9=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([H9(1,Jk),H9(2,Yg)],K9);var j9,q9=function(e,t){return function(i,n){t(i,n,e)}};let $9=j9=class extends T{constructor(e,t,i,n,o,s,r){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=n,this._contextKeyService=r,this._sessionStore=new M,this._foldingModel=null,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._showEndForLine=null,this._stickyScrollWidget=new x9(this._editor),this._stickyLineCandidateProvider=new K9(this._editor,i,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new C9([],[],0),this._readConfiguration();const a=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration((e=>{(e.hasChanged(114)||e.hasChanged(72)||e.hasChanged(66)||e.hasChanged(109))&&this._readConfiguration()}))),this._register(bs(a,or.CONTEXT_MENU,(async e=>{this._onContextMenu(as(a),e)}))),this._stickyScrollFocusedContextKey=nc.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=nc.stickyScrollVisible.bindTo(this._contextKeyService);const l=this._register(lr(a));this._register(l.onDidBlur((e=>{!1===this._positionRevealed&&0===a.clientHeight?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()}))),this._register(l.onDidFocus((e=>{this.focus()}))),this._registerMouseListeners(),this._register(bs(a,or.MOUSE_DOWN,(e=>{this._onMouseDown=!0})))}static get(e){return e.getContribution(j9.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),null===(e=this._focusDisposableStore)||void 0===e||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown)return this._onMouseDown=!1,void this._editor.focus();!0!==this._stickyScrollFocusedContextKey.get()&&(this._focused=!0,this._focusDisposableStore=new M,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex<this._stickyScrollWidget.lineNumberCount-1&&this._focusNav(!0)}focusPrevious(){this._focusedStickyElementIndex>0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,(()=>this._editor.revealPosition(e)))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,(()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0)))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(tc.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new M),t=this._register(new aR(this._editor,{extractLineNumberFromMouseEvent:e=>{const t=this._stickyScrollWidget.getEditorPositionFromNode(e.target.element);return t?t.lineNumber:0}})),i=e=>{if(!this._editor.hasModel())return null;if(12!==e.target.type||e.target.detail!==this._stickyScrollWidget.getId())return null;const t=e.target.element;if(!t||t.innerText!==t.innerHTML)return null;const i=this._stickyScrollWidget.getEditorPositionFromNode(t);return i?{range:new tc(i.lineNumber,i.column,i.lineNumber,i.column+t.innerText.length),textElement:t}:null},n=this._stickyScrollWidget.getDomNode();this._register(Cs(n,or.CLICK,(e=>{if(e.ctrlKey||e.altKey||e.metaKey)return;if(!e.leftButton)return;if(e.shiftKey){const t=this._stickyScrollWidget.getLineIndexFromChildDomNode(e.target);if(null===t)return;const i=new ch(this._endLineNumbers[t],1);return void this._revealLineInCenterIfOutsideViewport(i)}if(this._stickyScrollWidget.isInFoldingIconDomNode(e.target)){const t=this._stickyScrollWidget.getLineNumberFromChildDomNode(e.target);return void this._toggleFoldingRegionForLine(t)}if(!this._stickyScrollWidget.isInStickyLine(e.target))return;let t=this._stickyScrollWidget.getEditorPositionFromNode(e.target);if(!t){const i=this._stickyScrollWidget.getLineNumberFromChildDomNode(e.target);if(null===i)return;t=new ch(i,1)}this._revealPosition(t)}))),this._register(Cs(n,or.MOUSE_MOVE,(e=>{if(e.shiftKey){const t=this._stickyScrollWidget.getLineIndexFromChildDomNode(e.target);if(null===t||null!==this._showEndForLine&&this._showEndForLine===t)return;return this._showEndForLine=t,void this._renderStickyScroll()}null!==this._showEndForLine&&(this._showEndForLine=null,this._renderStickyScroll())}))),this._register(bs(n,or.MOUSE_LEAVE,(e=>{null!==this._showEndForLine&&(this._showEndForLine=null,this._renderStickyScroll())}))),this._register(t.onMouseMoveOrRelevantKeyDown((([t,n])=>{const o=i(t);if(!o||!t.hasTriggerModifier||!this._editor.hasModel())return void e.clear();const{range:s,textElement:r}=o;if(s.equalsRange(this._stickyRangeProjectedOnEditor)){if("underline"===r.style.textDecoration)return}else this._stickyRangeProjectedOnEditor=s,e.clear();const a=new Pt;let l;e.add(I((()=>a.dispose(!0)))),rj(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new ch(s.startLineNumber,s.startColumn+1),a.token).then((t=>{if(!a.token.isCancellationRequested)if(0!==t.length){this._candidateDefinitionsLength=t.length;const i=r;l!==i?(e.clear(),l=i,l.style.textDecoration="underline",e.add(I((()=>{l.style.textDecoration="none"})))):l||(l=i,l.style.textDecoration="underline",e.add(I((()=>{l.style.textDecoration="none"}))))}else e.clear()}))}))),this._register(t.onCancel((()=>{e.clear()}))),this._register(t.onExecute((async e=>{if(12!==e.target.type||e.target.detail!==this._stickyScrollWidget.getId())return;const t=this._stickyScrollWidget.getEditorPositionFromNode(e.target.element);t&&(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:t.lineNumber,column:1})),this._instaService.invokeFunction(b1,e,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor}))})))}_onContextMenu(e,t){const i=new Mt(e,t);this._contextMenuService.showContextMenu({menuId:yd.StickyScrollContext,getAnchor:()=>i})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||null===e)return;const t=this._stickyScrollWidget.getStickyLineForLine(e),i=null==t?void 0:t.foldingIcon;if(!i)return;zJ(this._foldingModel,Number.MAX_VALUE,[e]),i.isCollapsed=!i.isCollapsed;const n=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(66)*t.index+1;this._editor.setScrollTop(n),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(114);if(!1===e.enabled)return this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),void(this._enabled=!1);e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange((e=>{e.scrollTopChanged&&(this._showEndForLine=null,this._renderStickyScroll())}))),this._sessionStore.add(this._editor.onDidLayoutChange((()=>this._onDidResize()))),this._sessionStore.add(this._editor.onDidChangeModelTokens((e=>this._onTokensChange(e)))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll((()=>{this._showEndForLine=null,this._renderStickyScroll()}))),this._enabled=!0),2===this._editor.getOption(67).renderType&&this._sessionStore.add(this._editor.onDidChangeCursorPosition((()=>{this._showEndForLine=null,this._renderStickyScroll(-1)})))}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const t of e.ranges)if(i>=t.fromLineNumber&&i<=t.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(-1)}_onDidResize(){const e=this._editor.getLayoutInfo().height/this._editor.getOption(66);this._maxStickyLines=Math.round(.25*e)}async _renderStickyScroll(e=1/0){var t,i;const n=this._editor.getModel();if(!n||n.isTooLargeForTokenization())return this._foldingModel=null,void this._stickyScrollWidget.setState(void 0,null,e);const o=this._stickyLineCandidateProvider.getVersionId();if(void 0===o||o===n.getVersionId())if(this._foldingModel=null!==(i=await(null===(t=c0.get(this._editor))||void 0===t?void 0:t.getFoldingModel()))&&void 0!==i?i:null,this._widgetState=this.findScrollWidgetState(),this._stickyScrollVisibleContextKey.set(!(0===this._widgetState.startLineNumbers.length)),this._focused)if(-1===this._focusedStickyElementIndex)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,-1!==this._focusedStickyElementIndex&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const t=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),0===this._stickyScrollWidget.lineNumberCount?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(t)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}else this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}findScrollWidgetState(){const e=this._editor.getOption(66),t=Math.min(this._maxStickyLines,this._editor.getOption(114).maxLineCount),i=this._editor.getScrollTop();let n=0;const o=[],s=[],r=this._editor.getVisibleRanges();if(0!==r.length){const a=new N9(r[0].startLineNumber,r[r.length-1].endLineNumber),l=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(a);for(const r of l){const a=r.startLineNumber,l=r.endLineNumber,h=r.nestingDepth;if(l-a>0){const r=(h-1)*e,d=h*e,c=this._editor.getBottomForLineNumber(a)-i,u=this._editor.getTopForLineNumber(l)-i,g=this._editor.getBottomForLineNumber(l)-i;if(r>u&&r<=g){o.push(a),s.push(l+1),n=g-d;break}if(d>c&&d<=g&&(o.push(a),s.push(l+1)),o.length===t)break}}}return this._endLineNumbers=s,new C9(o,s,n,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};$9.ID="store.contrib.stickyScrollController",$9=j9=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([q9(1,qE),q9(2,Jk),q9(3,lh),q9(4,Yg),q9(5,hI),q9(6,sd)],$9);const G9=100;Gd($9.ID,$9,1),Nd(class extends Ed{constructor(){super({id:"editor.action.toggleStickyScroll",title:{value:me(0,"Toggle Sticky Scroll"),mnemonicTitle:me(0,"&&Toggle Sticky Scroll"),original:"Toggle Sticky Scroll"},category:v9.View,toggled:{condition:Bh.equals("config.editor.stickyScroll.enabled",!0),title:me(0,"Sticky Scroll"),mnemonicTitle:me(0,"&&Sticky Scroll")},menu:[{id:yd.CommandPalette},{id:yd.MenubarAppearanceMenu,group:"4_editor",order:3},{id:yd.StickyScrollContext}]})}async run(e){const t=e.get(ug),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)}}),Nd(class extends Ud{constructor(){super({id:"editor.action.focusStickyScroll",title:{value:me(0,"Focus Sticky Scroll"),mnemonicTitle:me(0,"&&Focus Sticky Scroll"),original:"Focus Sticky Scroll"},precondition:Bh.and(Bh.has("config.editor.stickyScroll.enabled"),nc.stickyScrollVisible),menu:[{id:yd.CommandPalette}]})}runEditorCommand(e,t){var i;null===(i=$9.get(t))||void 0===i||i.focus()}}),Nd(class extends Ud{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:{value:me(0,"Select previous sticky scroll line"),original:"Select previous sticky scroll line"},precondition:nc.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:G9,primary:16}})}runEditorCommand(e,t){var i;null===(i=$9.get(t))||void 0===i||i.focusPrevious()}}),Nd(class extends Ud{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:{value:me(0,"Select next sticky scroll line"),original:"Select next sticky scroll line"},precondition:nc.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:G9,primary:18}})}runEditorCommand(e,t){var i;null===(i=$9.get(t))||void 0===i||i.focusNext()}}),Nd(class extends Ud{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:{value:me(0,"Go to focused sticky scroll line"),original:"Go to focused sticky scroll line"},precondition:nc.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:G9,primary:3}})}runEditorCommand(e,t){var i;null===(i=$9.get(t))||void 0===i||i.goToFocused()}}),Nd(class extends Ud{constructor(){super({id:"editor.action.selectEditor",title:{value:me(0,"Select Editor"),original:"Select Editor"},precondition:nc.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:G9,primary:9}})}runEditorCommand(e,t){var i;null===(i=$9.get(t))||void 0===i||i.selectEditor()}});var Z9,Y9=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Q9=function(e,t){return function(i,n){t(i,n,e)}};class X9{constructor(e,t,i,n,o,s){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=o,this.completion=s}}let J9=class extends R{constructor(e,t,i,n,o,s){super(o.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,this._suggestMemoryService=s}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn<i.endColumn&&0===this.completionModel.getIncompleteProvider().size}get items(){var e;const t=[],{items:i}=this.completionModel,n=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},i),o=C.slice(i,n),s=C.slice(i,0,n);let r=5;for(const i of C.concat(o,s)){if(i.score===tl.Default)continue;const n=new tc(i.editStart.lineNumber,i.editStart.column,i.editInsertEnd.lineNumber,i.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),o=i.completion.insertTextRules&&4&i.completion.insertTextRules?{snippet:i.completion.insertText}:i.completion.insertText;t.push(new X9(n,o,null!==(e=i.filterTextLow)&&void 0!==e?e:i.labelLow,i.completion.additionalTextEdits,i.completion.command,i)),r-- >=0&&i.resolve(Rt.None)}return t}};J9=Y9([Q9(5,o4)],J9);let e7=class{constructor(e,t,i,n){this._getEditorOption=e,this._languageFeatureService=t,this._clipboardService=i,this._suggestMemoryService=n}async provideInlineCompletions(e,t,i,n){var o;if(i.selectedSuggestionInfo)return;const s=this._getEditorOption(88,e);if(N2.isAllOff(s))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const r=e.tokenization.getLineTokens(t.lineNumber),a=r.getStandardTokenType(r.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if("inline"!==N2.valueFor(s,a))return;let l,h,d=e.getWordAtPosition(t);if((null==d?void 0:d.word)||(l=this._getTriggerCharacterInfo(e,t)),!(null==d?void 0:d.word)&&!l)return;if(d||(d=e.getWordUntilPosition(t)),d.endColumn!==t.column)return;const c=e.getValueInRange(new tc(t.lineNumber,1,t.lineNumber,t.column));if(!l&&(null===(o=this._lastResult)||void 0===o?void 0:o.canBeReused(e,t.lineNumber,d))){const e=new u4(c,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=e,this._lastResult.acquire(),h=this._lastResult}else{const i=await x2(this._languageFeatureService.completionProvider,e,t,new k2(void 0,void 0,null==l?void 0:l.providers),l&&{triggerKind:1,triggerCharacter:l.ch},n);let o;i.needsClipboard&&(o=await this._clipboardService.readText());const s=new g4(i.items,t.column,new u4(c,0),c4.None,this._getEditorOption(117,e),this._getEditorOption(111,e),{boostFullMatch:!1,firstMatchCanBeWeak:!1},o);h=new J9(e,t.lineNumber,d,s,i,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve(Rt.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var i;const n=e.getValueInRange(tc.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),o=new Set;for(const t of this._languageFeatureService.completionProvider.all(e))(null===(i=t.triggerCharacters)||void 0===i?void 0:i.includes(n))&&o.add(t);if(0!==o.size)return{providers:o,ch:n}}};e7=Y9([Q9(1,Jk),Q9(2,ZS),Q9(3,o4)],e7);let t7=Z9=class{constructor(e,t,i,n){if(1==++Z9._counter){const o=n.createInstance(e7,((t,n)=>{var o;return(null!==(o=i.listCodeEditors().find((e=>e.getModel()===n)))&&void 0!==o?o:e).getOption(t)}));Z9._disposable=t.inlineCompletionsProvider.register("*",o)}}dispose(){var e;0==--Z9._counter&&(null===(e=Z9._disposable)||void 0===e||e.dispose(),Z9._disposable=void 0)}};t7._counter=0,t7=Z9=Y9([Q9(1,Jk),Q9(2,dh),Q9(3,lh)],t7),Gd("suggest.inlineCompletionsProvider",t7,0);class i7{constructor(e,t,i,n,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=o}}const n7=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;class o7{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=new Map}getId(e){if(null===e)return 0;const t=e.match(n7);if(!t)throw new Error("Illegal value for token color: "+e);e=t[1].toUpperCase();let i=this._color2id.get(e);return i||(i=++this._lastColorId,this._color2id.set(e,i),this._id2color[i]=ru.fromHex("#"+e),i)}getColorMap(){return this._id2color.slice(0)}}class s7{static createFromRawTokenTheme(e,t){return this.createFromParsedTokenTheme(function(e){if(!e||!Array.isArray(e))return[];const t=[];let i=0;for(let n=0,o=e.length;n<o;n++){const o=e[n];let s=-1;if("string"==typeof o.fontStyle){s=0;const e=o.fontStyle.split(" ");for(let t=0,i=e.length;t<i;t++)switch(e[t]){case"italic":s|=1;break;case"bold":s|=2;break;case"underline":s|=4;break;case"strikethrough":s|=8}}let r=null;"string"==typeof o.foreground&&(r=o.foreground);let a=null;"string"==typeof o.background&&(a=o.background),t[i++]=new i7(o.token||"",n,s,r,a)}return t}(e),t)}static createFromParsedTokenTheme(e,t){return function(e,t){e.sort(((e,t)=>{const i=function(e,t){return e<t?-1:e>t?1:0}(e.token,t.token);return 0!==i?i:e.index-t.index}));let i=0,n="000000",o="ffffff";for(;e.length>=1&&""===e[0].token;){const t=e.shift();-1!==t.fontStyle&&(i=t.fontStyle),null!==t.foreground&&(n=t.foreground),null!==t.background&&(o=t.background)}const s=new o7;for(const e of t)s.getId(e);const r=s.getId(n),a=s.getId(o),l=new a7(i,r,a),h=new l7(l);for(let t=0,i=e.length;t<i;t++){const i=e[t];h.insert(i.token,i.fontStyle,s.getId(i.foreground),s.getId(i.background))}return new s7(s,h)}(e,t)}constructor(e,t){this._colorMap=e,this._root=t,this._cache=new Map}getColorMap(){return this._colorMap.getColorMap()}_match(e){return this._root.match(e)}match(e,t){let i=this._cache.get(t);if(void 0===i){const e=this._match(t),n=function(e){const t=e.match(r7);if(!t)return 0;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}(t);i=(e.metadata|n<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const r7=/\b(comment|string|regex|regexp)\b/;class a7{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new a7(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){-1!==e&&(this._fontStyle=e),0!==t&&(this._foreground=t),0!==i&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class l7{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(""===e)return this._mainRule;const t=e.indexOf(".");let i,n;-1===t?(i=e,n=""):(i=e.substring(0,t),n=e.substring(t+1));const o=this._children.get(i);return void 0!==o?o.match(n):this._mainRule}insert(e,t,i,n){if(""===e)return void this._mainRule.acceptOverwrite(t,i,n);const o=e.indexOf(".");let s,r;-1===o?(s=e,r=""):(s=e.substring(0,o),r=e.substring(o+1));let a=this._children.get(s);void 0===a&&(a=new l7(this._mainRule.clone()),this._children.set(s,a)),a.insert(r,t,i,n)}}const h7={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"098658"},{token:"attribute.value.unit",foreground:"098658"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[Cf]:"#FFFFFE",[yf]:"#000000",[Bf]:"#E5EBF1",[$v]:"#D3D3D3",[Jv]:"#939393",[Wf]:"#ADD6FF4D"}},d7={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[Cf]:"#1E1E1E",[yf]:"#D4D4D4",[Bf]:"#3A3D41",[$v]:"#404040",[Jv]:"#707070",[Wf]:"#ADD6FF26"}},c7={base:"hc-black",inherit:!1,rules:[{token:"",foreground:"FFFFFF",background:"000000"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"1AEBFF"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"FFFFFF"},{token:"regexp",foreground:"C0C0C0"},{token:"annotation",foreground:"569CD6"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"FFFF00"},{token:"delimiter.html",foreground:"FFFF00"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta",foreground:"D4D4D4"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"569CD6"},{token:"metatag.content.html",foreground:"1AEBFF"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key",foreground:"9CDCFE"},{token:"string.value",foreground:"CE9178"},{token:"attribute.name",foreground:"569CD6"},{token:"attribute.value",foreground:"3FF23F"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[Cf]:"#000000",[yf]:"#FFFFFF",[$v]:"#FFFFFF",[Jv]:"#FFFFFF"}},u7={base:"hc-light",inherit:!1,rules:[{token:"",foreground:"292929",background:"FFFFFF"},{token:"invalid",foreground:"B5200D"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"264F70"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"B5200D"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"264F78"},{token:"attribute.value",foreground:"0451A5"},{token:"string",foreground:"A31515"},{token:"string.sql",foreground:"B5200D"},{token:"keyword",foreground:"0000FF"},{token:"keyword.flow",foreground:"AF00DB"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[Cf]:"#FFFFFF",[yf]:"#292929",[$v]:"#292929",[Jv]:"#292929"}};class g7{getIcon(e){const t=NA();let i=e.defaults;for(;Ll.isThemeIcon(i);){const e=t.getIcon(i.id);if(!e)return;i=e.defaults}return i}}const p7="vs",m7="vs-dark",f7="hc-black",_7="hc-light",v7=md.as(Cm),b7=md.as(Ov);class w7{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(C7(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,ru.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=y7(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,ru.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){return this.getColors().get(e)||(!1!==t?this.getDefault(e):void 0)}getDefault(e){let t=this.defaultColors[e];return t||(t=v7.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case p7:return Nv.LIGHT;case f7:return Nv.HIGH_CONTRAST_DARK;case _7:return Nv.HIGH_CONTRAST_LIGHT;default:return Nv.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const i=y7(this.themeData.base);e=i.rules,i.encodedTokensColors&&(t=i.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const t={token:""};i&&(t.foreground=i),n&&(t.background=n),e.push(t)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=s7.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const n=this.tokenTheme._match([e].concat(t).join(".")).metadata,o=jp.getForeground(n),s=jp.getFontStyle(n);return{foreground:o,italic:Boolean(1&s),bold:Boolean(2&s),underline:Boolean(4&s),strikethrough:Boolean(8&s)}}}function C7(e){return e===p7||e===m7||e===f7||e===_7}function y7(e){switch(e){case p7:return h7;case m7:return d7;case f7:return c7;case _7:return u7}}function S7(e){const t=y7(e);return new w7(e,t)}qd(class extends zd{constructor(){super({id:"editor.action.toggleHighContrast",label:z0.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(g5),n=i.getColorTheme();Iv(n.type)?(i.setTheme(this._originalThemeName||(Mv(n.type)?m7:p7)),this._originalThemeName=null):(i.setTheme(Mv(n.type)?f7:_7),this._originalThemeName=n.themeName)}});class k7 extends Ed{constructor(){super({id:k7.ID,title:{value:me(0,"Toggle Tab Key Moves Focus"),original:"Toggle Tab Key Moves Focus"},precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},f1:!0})}run(){const e=!DR.getTabFocusMode();DR.setTabFocusMode(e),Zr(me(0,e?"Pressing Tab will now move focus to the next focusable element":"Pressing Tab will now insert the tab character"))}}k7.ID="editor.action.toggleTabFocusMode",Nd(k7),qd(class extends zd{constructor(){super({id:"editor.action.forceRetokenize",label:me(0,"Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const n=new V;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}});var L7=i(8679),x7={};x7.styleTagTransform=Vr(),x7.setAttributes=Pr(),x7.insert=Rr().bind(null,"head"),x7.domAPI=Tr(),x7.insertStyleElement=Br(),Ir()(L7.Z,x7),L7.Z&&L7.Z.locals&&L7.Z.locals;var D7=i(8367),E7={};E7.styleTagTransform=Vr(),E7.setAttributes=Pr(),E7.insert=Rr().bind(null,"head"),E7.domAPI=Tr(),E7.insertStyleElement=Br(),Ir()(D7.Z,E7),D7.Z&&D7.Z.locals&&D7.Z.locals;var N7=i(7150),I7={};I7.styleTagTransform=Vr(),I7.setAttributes=Pr(),I7.insert=Rr().bind(null,"head"),I7.domAPI=Tr(),I7.insertStyleElement=Br(),Ir()(N7.Z,I7),N7.Z&&N7.Z.locals&&N7.Z.locals;let M7=class extends T{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,i={},n){var o;super(),this._link=t,this._enabled=!0,this.el=hr(e,mr("a.monaco-link",{tabIndex:null!==(o=t.tabIndex)&&void 0!==o?o:0,href:t.href,title:t.title},t.label)),this.el.setAttribute("role","button");const s=this._register(new OS(this.el,"click")),r=this._register(new OS(this.el,"keypress")),a=z.chain(r.event,(e=>e.map((e=>new Dt(e))).filter((e=>3===e.keyCode)))),l=this._register(new OS(this.el,UL.Tap)).event;this._register(KL.addTarget(this.el));const h=z.any(s.event,a,l);this._register(h((e=>{this.enabled&&(rr(e,!0),(null==i?void 0:i.opener)?i.opener(this._link.href):n.open(this._link.href,{allowCommands:!0}))}))),this.enabled=!0}};M7=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(3,Hx)],M7);var T7=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},A7=function(e,t){return function(i,n){t(i,n,e)}};let R7=class extends T{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(O7))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{var t;this.hide(),null===(t=e.onClose)||void 0===t||t.call(e)}}),this._editor.setBanner(this.banner.element,26)}};R7=T7([A7(1,lh)],R7);let O7=class extends T{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(jx,{}),this.element=mr("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){return e.ariaLabel?e.ariaLabel:"string"==typeof e.message?e.message:void 0}getBannerMessage(e){if("string"==typeof e){const t=mr("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){_s(this.element)}show(e){_s(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=hr(this.element,mr("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(mr(`div${Ll.asCSSSelector(e.icon)}`));const n=hr(this.element,mr("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=hr(this.element,mr("div.message-actions-container")),e.actions)for(const t of e.actions)this._register(this.instantiationService.createInstance(M7,this.messageActionsContainer,{...t,tabIndex:-1},{}));const o=hr(this.element,mr("div.action-container"));this.actionBar=this._register(new ME(o)),this.actionBar.push(this._register(new ph("banner.close","Close Banner",Ll.asClassName(AA),!0,(()=>{"function"==typeof e.onClose&&e.onClose()}))),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};O7=T7([A7(0,lh)],O7);const P7=hh("workspaceTrustManagementService");var F7=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},B7=function(e,t){return function(i,n){t(i,n,e)}};const W7=EA("extensions-warning-message",Sl.warning,me(0,"Icon shown with a warning message in the extensions editor."));let V7=class extends T{constructor(e,t,i,n){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=e=>{if(e&&e.hasMore){if(this._bannerClosed)return;const t=Math.max(e.ambiguousCharacterCount,e.nonBasicAsciiCharacterCount,e.invisibleCharacterCount);let i;if(e.nonBasicAsciiCharacterCount>=t)i={message:me(0,"This document contains many non-basic ASCII unicode characters"),command:new X7};else if(e.ambiguousCharacterCount>=t)i={message:me(0,"This document contains many ambiguous unicode characters"),command:new Y7};else{if(!(e.invisibleCharacterCount>=t))throw new Error("Unreachable");i={message:me(0,"This document contains many invisible unicode characters"),command:new Q7}}this._bannerController.show({id:"unicodeHighlightBanner",message:i.message,icon:W7,actions:[{label:i.command.shortLabel,href:`command:${i.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(R7,e)),this._register(this._editor.onDidChangeModel((()=>{this._bannerClosed=!1,this._updateHighlighter()}))),this._options=e.getOption(124),this._register(i.onDidChangeTrust((e=>{this._updateHighlighter()}))),this._register(e.onDidChangeConfiguration((t=>{t.hasChanged(124)&&(this._options=e.getOption(124),this._updateHighlighter())}))),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=function(e,t){return{nonBasicASCII:t.nonBasicASCII===Mk?!e:t.nonBasicASCII,ambiguousCharacters:t.ambiguousCharacters,invisibleCharacters:t.invisibleCharacters,includeComments:t.includeComments===Mk?!e:t.includeComments,includeStrings:t.includeStrings===Mk?!e:t.includeStrings,allowedCharacters:t.allowedCharacters,allowedLocales:t.allowedLocales}}(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every((e=>!1===e)))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map((e=>e.codePointAt(0))),allowedLocales:Object.keys(e.allowedLocales).map((e=>"_os"===e?(new Intl.NumberFormat).resolvedOptions().locale:"_vscode"===e?Ge:e))};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new z7(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new H7(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};V7.ID="editor.contrib.unicodeHighlighter",V7=F7([B7(1,XZ),B7(2,P7),B7(3,lh)],V7);let z7=class extends T{constructor(e,t,i,n){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Zt((()=>this._update()),250)),this._register(this._editor.onDidChangeModelContent((()=>{this._updateSoon.schedule()}))),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII())return void this._decorations.clear();const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then((t=>{if(this._model.isDisposed())return;if(this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const e of t.ranges)i.push({range:e,options:$7.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)}))}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();return hW(t,e)?{reason:q7(t.getValueInRange(e.range),this._options),inComment:dW(t,e),inString:cW(t,e)}:null}};z7=F7([B7(3,XZ)],z7);class H7 extends T{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Zt((()=>this._update()),250)),this._register(this._editor.onDidLayoutChange((()=>{this._updateSoon.schedule()}))),this._register(this._editor.onDidScrollChange((()=>{this._updateSoon.schedule()}))),this._register(this._editor.onDidChangeHiddenAreas((()=>{this._updateSoon.schedule()}))),this._register(this._editor.onDidChangeModelContent((()=>{this._updateSoon.schedule()}))),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII())return void this._decorations.clear();const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const t of e){const e=GM.computeUnicodeHighlights(this._model,this._options,t);for(const t of e.ranges)i.ranges.push(t);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||e.hasMore}if(!i.hasMore)for(const e of i.ranges)t.push({range:e,options:$7.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return hW(t,e)?{reason:q7(i,this._options),inComment:dW(t,e),inString:cW(t,e)}:null}}let U7=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||1!==e.type)return[];const i=this._editor.getModel(),n=this._editor.getContribution(V7.ID);if(!n)return[];const o=[],s=new Set;let r=300;for(const e of t){const t=n.getDecorationInfo(e);if(!t)continue;const a=i.getValueInRange(e.range).codePointAt(0),l=j7(a);let h;switch(t.reason.kind){case 0:h=zn(t.reason.confusableWith)?me(0,"The character {0} could be confused with the ASCII character {1}, which is more common in source code.",l,j7(t.reason.confusableWith.codePointAt(0))):me(0,"The character {0} could be confused with the character {1}, which is more common in source code.",l,j7(t.reason.confusableWith.codePointAt(0)));break;case 1:h=me(0,"The character {0} is invisible.",l);break;case 2:h=me(0,"The character {0} is not a basic ASCII character.",l)}if(s.has(h))continue;s.add(h);const d={codePoint:a,reason:t.reason,inComment:t.inComment,inString:t.inString},c=me(0,"Adjust settings"),u=`command:${J7.ID}?${encodeURIComponent(JSON.stringify(d))}`,g=new eh("",!0).appendMarkdown(h).appendText(" ").appendLink(u,c);o.push(new hq(this,e.range,[g],!1,r++))}return o}renderHoverParts(e,t){return cq(e,t,this._editor,this._languageService,this._openerService)}};function K7(e){return`U+${e.toString(16).padStart(4,"0")}`}function j7(e){let t=`\`${K7(e)}\``;return Jn.isInvisibleCharacter(e)||(t+=` "${function(e){return 96===e?"`` ` ``":"`"+String.fromCodePoint(e)+"`"}(e)}"`),t}function q7(e,t){return GM.computeUnicodeHighlightReason(e,t)}U7=F7([B7(1,yu),B7(2,Hx)],U7);class $7{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let n=this.map.get(i);return n||(n=Sy.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}}$7.instance=new $7;class G7 extends zd{constructor(){super({id:Y7.ID,label:me(0,"Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=me(0,"Disable Highlight In Comments")}async run(e,t,i){const n=null==e?void 0:e.get(ug);n&&this.runAction(n)}async runAction(e){await e.updateValue(Pk,!1,2)}}class Z7 extends zd{constructor(){super({id:Y7.ID,label:me(0,"Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=me(0,"Disable Highlight In Strings")}async run(e,t,i){const n=null==e?void 0:e.get(ug);n&&this.runAction(n)}async runAction(e){await e.updateValue(Fk,!1,2)}}class Y7 extends zd{constructor(){super({id:Y7.ID,label:me(0,"Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=me(0,"Disable Ambiguous Highlight")}async run(e,t,i){const n=null==e?void 0:e.get(ug);n&&this.runAction(n)}async runAction(e){await e.updateValue(Ok,!1,2)}}Y7.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class Q7 extends zd{constructor(){super({id:Q7.ID,label:me(0,"Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=me(0,"Disable Invisible Highlight")}async run(e,t,i){const n=null==e?void 0:e.get(ug);n&&this.runAction(n)}async runAction(e){await e.updateValue(Ak,!1,2)}}Q7.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class X7 extends zd{constructor(){super({id:X7.ID,label:me(0,"Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=me(0,"Disable Non ASCII Highlight")}async run(e,t,i){const n=null==e?void 0:e.get(ug);n&&this.runAction(n)}async runAction(e){await e.updateValue(Rk,!1,2)}}X7.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class J7 extends zd{constructor(){super({id:J7.ID,label:me(0,"Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,i){const{codePoint:n,reason:o,inString:s,inComment:r}=i,a=String.fromCodePoint(n),l=e.get(rI),h=e.get(ug),d=[];if(0===o.kind)for(const e of o.notAmbiguousInLocales)d.push({label:me(0,'Allow unicode characters that are more common in the language "{0}".',e),run:async()=>{e8(h,[e])}});if(d.push({label:function(e){return Jn.isInvisibleCharacter(e)?me(0,"Exclude {0} (invisible character) from being highlighted",K7(e)):me(0,"Exclude {0} from being highlighted",`${K7(e)} "${a}"`)}(n),run:()=>async function(e,t){const i=e.getValue(Tk);let n;n="object"==typeof i&&i?i:{};for(const e of t)n[String.fromCodePoint(e)]=!0;await e.updateValue(Tk,n,2)}(h,[n])}),r){const e=new G7;d.push({label:e.label,run:async()=>e.runAction(h)})}else if(s){const e=new Z7;d.push({label:e.label,run:async()=>e.runAction(h)})}if(0===o.kind){const e=new Y7;d.push({label:e.label,run:async()=>e.runAction(h)})}else if(1===o.kind){const e=new Q7;d.push({label:e.label,run:async()=>e.runAction(h)})}else if(2===o.kind){const e=new X7;d.push({label:e.label,run:async()=>e.runAction(h)})}else!function(e){throw new Error(`Unexpected value: ${e}`)}(o);const c=await l.pick(d,{title:me(0,"Configure Unicode Highlight Options")});c&&await c.run()}}async function e8(e,t){var i;const n=null===(i=e.inspect(Bk).user)||void 0===i?void 0:i.value;let o;o="object"==typeof n&&n?Object.assign({},n):{};for(const e of t)o[e]=!0;await e.updateValue(Bk,o,2)}J7.ID="editor.action.unicodeHighlight.showExcludeOptions",qd(Y7),qd(Q7),qd(X7),qd(J7),Gd(V7.ID,V7,1),Vj.register(U7);var t8=function(e,t){return function(i,n){t(i,n,e)}};const i8="ignoreUnusualLineTerminators";let n8=class extends T{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(125),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(125)&&(this._config=this._editor.getOption(125),this._checkForUnusualLineTerminators())}))),this._register(this._editor.onDidChangeModel((()=>{this._checkForUnusualLineTerminators()}))),this._register(this._editor.onDidChangeModelContent((e=>{e.isUndoing||this._checkForUnusualLineTerminators()}))),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if("off"===this._config)return;if(!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators())return;const t=function(e,t){return e.getModelProperty(t.uri,i8)}(this._codeEditorService,e);if(!0===t)return;if(this._editor.getOption(90))return;if("auto"===this._config)return void e.removeUnusualLineTerminators(this._editor.getSelections());if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:me(0,"Unusual Line Terminators"),message:me(0,"Detected unusual line terminators"),detail:me(0,"The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",Kl(e.uri)),primaryButton:me(0,"&&Remove Unusual Line Terminators"),cancelButton:me(0,"Ignore")})}finally{this._isPresentingDialog=!1}i.confirmed?e.removeUnusualLineTerminators(this._editor.getSelections()):function(e,t,i){e.setModelProperty(t.uri,i8,!0)}(this._codeEditorService,e)}};n8.ID="editor.contrib.unusualLineTerminatorsDetector",n8=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([t8(1,K3),t8(2,dh)],n8),Gd(n8.ID,n8,1);const o8="**",s8="/",r8="[/\\\\]",a8="[^/\\\\]",l8=/\//g;function h8(e,t){switch(e){case 0:return"";case 1:return`${a8}*?`;default:return`(?:${r8}|${a8}+${r8}${t?`|${r8}${a8}+`:""})*?`}}function d8(e,t){if(!e)return[];const i=[];let n=!1,o=!1,s="";for(const r of e){switch(r){case t:if(!n&&!o){i.push(s),s="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1}s+=r}return s&&i.push(s),i}function c8(e){if(!e)return"";let t="";const i=d8(e,s8);if(i.every((e=>e===o8)))t=".*";else{let e=!1;i.forEach(((n,o)=>{if(n===o8){if(e)return;t+=h8(2,o===i.length-1)}else{let e=!1,s="",r=!1,a="";for(const i of n)if("}"!==i&&e)s+=i;else if(!r||"]"===i&&a)switch(i){case"{":e=!0;continue;case"[":r=!0;continue;case"}":{const i=`(?:${d8(s,",").map((e=>c8(e))).join("|")})`;t+=i,e=!1,s="";break}case"]":t+="["+a+"]",r=!1,a="";break;case"?":t+=a8;continue;case"*":t+=h8(1);continue;default:t+=dn(i)}else{let e;e="-"===i?i:"^"!==i&&"!"!==i||a?i===s8?"":dn(i):"^",a+=e}o<i.length-1&&(i[o+1]!==o8||o+2<i.length)&&(t+=r8)}e=n===o8}))}return t}const u8=/^\*\*\/\*\.[\w\.-]+$/,g8=/^\*\*\/([\w\.-]+)\/?$/,p8=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,m8=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,f8=/^\*\*((\/[\w\.-]+)+)\/?$/,_8=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,v8=new na(1e4),b8=function(){return!1},w8=function(){return null};function C8(e,t){if(!e)return w8;let i;i="string"!=typeof e?e.pattern:e,i=i.trim();const n=`${i}_${!!t.trimForExclusions}`;let o,s=v8.get(n);return s||(s=u8.test(i)?function(e,t){return function(i,n){return"string"==typeof i&&i.endsWith(e)?t:null}}(i.substr(4),i):(o=g8.exec(y8(i,t)))?function(e,t){const i=`/${e}`,n=`\\${e}`,o=function(o,s){return"string"!=typeof o?null:s?s===e?t:null:o===e||o.endsWith(i)||o.endsWith(n)?t:null},s=[e];return o.basenames=s,o.patterns=[t],o.allBasenames=s,o}(o[1],i):(t.trimForExclusions?m8:p8).test(i)?function(e,t){const i=L8(e.slice(1,-1).split(",").map((e=>C8(e,t))).filter((e=>e!==w8)),e),n=i.length;if(!n)return w8;if(1===n)return i[0];const o=function(t,n){for(let o=0,s=i.length;o<s;o++)if(i[o](t,n))return e;return null},s=i.find((e=>!!e.allBasenames));s&&(o.allBasenames=s.allBasenames);const r=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);return r.length&&(o.allPaths=r),o}(i,t):(o=f8.exec(y8(i,t)))?S8(o[1].substr(1),i,!0):(o=_8.exec(y8(i,t)))?S8(o[1],i,!1):function(e){try{const t=new RegExp(`^${c8(e)}$`);return function(i){return t.lastIndex=0,"string"==typeof i&&t.test(i)?e:null}}catch(e){return w8}}(i),v8.set(n,s)),function(e,t){if("string"==typeof t)return e;const i=function(i,n){return Fl(i,t.base,!ze)?e(un(i.substr(t.base.length),Do),n):null};return i.allBasenames=e.allBasenames,i.allPaths=e.allPaths,i.basenames=e.basenames,i.patterns=e.patterns,i}(s,e)}function y8(e,t){return t.trimForExclusions&&e.endsWith("/**")?e.substr(0,e.length-2):e}function S8(e,t,i){const n=Do===wo.sep,o=n?e:e.replace(l8,Do),s=Do+o,r=wo.sep+e;let a;return a=i?function(i,a){return"string"!=typeof i||i!==o&&!i.endsWith(s)&&(n||i!==e&&!i.endsWith(r))?null:t}:function(i,s){return"string"!=typeof i||i!==o&&(n||i!==e)?null:t},a.allPaths=[(i?"*/":"./")+e],a}function k8(e,t={}){if(!e)return b8;if("string"==typeof e||function(e){const t=e;return!!t&&("string"==typeof t.base&&"string"==typeof t.pattern)}(e)){const i=C8(e,t);if(i===w8)return b8;const n=function(e,t){return!!i(e,t)};return i.allBasenames&&(n.allBasenames=i.allBasenames),i.allPaths&&(n.allPaths=i.allPaths),n}return function(e,t){const i=L8(Object.getOwnPropertyNames(e).map((i=>function(e,t,i){if(!1===t)return w8;const n=C8(e,i);if(n===w8)return w8;if("boolean"==typeof t)return n;if(t){const i=t.when;if("string"==typeof i){const t=(t,o,s,r)=>{if(!r||!n(t,o))return null;const a=r(i.replace("$(basename)",(()=>s)));return Bt(a)?a.then((t=>t?e:null)):a?e:null};return t.requiresSiblings=!0,t}}return n}(i,e[i],t))).filter((e=>e!==w8))),n=i.length;if(!n)return w8;if(!i.some((e=>!!e.requiresSiblings))){if(1===n)return i[0];const e=function(e,t){let n;for(let o=0,s=i.length;o<s;o++){const s=i[o](e,t);if("string"==typeof s)return s;Bt(s)&&(n||(n=[]),n.push(s))}return n?(async()=>{for(const e of n){const t=await e;if("string"==typeof t)return t}return null})():null},t=i.find((e=>!!e.allBasenames));t&&(e.allBasenames=t.allBasenames);const o=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);return o.length&&(e.allPaths=o),e}const o=function(e,t,n){let o,s;for(let r=0,a=i.length;r<a;r++){const a=i[r];a.requiresSiblings&&n&&(t||(t=Lo(e)),o||(o=t.substr(0,t.length-xo(e).length)));const l=a(e,t,o,n);if("string"==typeof l)return l;Bt(l)&&(s||(s=[]),s.push(l))}return s?(async()=>{for(const e of s){const t=await e;if("string"==typeof t)return t}return null})():null},s=i.find((e=>!!e.allBasenames));s&&(o.allBasenames=s.allBasenames);const r=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);return r.length&&(o.allPaths=r),o}(e,t)}function L8(e,t){const i=e.filter((e=>!!e.basenames));if(i.length<2)return e;const n=i.reduce(((e,t)=>{const i=t.basenames;return i?e.concat(i):e}),[]);let o;if(t){o=[];for(let e=0,i=n.length;e<i;e++)o.push(t)}else o=i.reduce(((e,t)=>{const i=t.patterns;return i?e.concat(i):e}),[]);const s=function(e,t){if("string"!=typeof e)return null;if(!t){let i;for(i=e.length;i>0;i--){const t=e.charCodeAt(i-1);if(47===t||92===t)break}t=e.substr(i)}const i=n.indexOf(t);return-1!==i?o[i]:null};s.basenames=n,s.patterns=o,s.allBasenames=n;const r=e.filter((e=>!e.basenames));return r.push(s),r}function x8(e,t,i,n,o,s){if(Array.isArray(e)){let r=0;for(const a of e){const e=x8(a,t,i,n,o,s);if(10===e)return e;e>r&&(r=e)}return r}if("string"==typeof e)return n?"*"===e?5:e===i?10:0:0;if(e){const{language:l,pattern:h,scheme:d,hasAccessToAllModels:c,notebookType:u}=e;if(!n&&!c)return 0;u&&o&&(t=o);let g=0;if(d)if(d===t.scheme)g=10;else{if("*"!==d)return 0;g=5}if(l)if(l===i)g=10;else{if("*"!==l)return 0;g=Math.max(g,5)}if(u)if(u===s)g=10;else{if("*"!==u||void 0===s)return 0;g=Math.max(g,5)}if(h){let e;if(e="string"==typeof h?h:{...h,base:Co(h.base)},e!==t.fsPath&&(r=e,a=t.fsPath,!r||"string"!=typeof a||!k8(r)(a,void 0,undefined)))return 0;g=10}return g}return 0;var r,a}var D8,E8,N8=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},I8=function(e,t){return function(i,n){t(i,n,e)}};const M8=new od("hasWordHighlights",!1);function T8(e,t,i,n){return qt(e.ordered(t).map((e=>()=>Promise.resolve(e.provideDocumentHighlights(t,i,n)).then(void 0,d))),Wc).then((e=>{if(e){const i=new ta;return i.set(t.uri,e),i}return new ta}))}class A8{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=Wt((e=>this._compute(this._model,this._selection,this._wordSeparators,e)))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new tc(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const n=t.startLineNumber,o=t.startColumn,s=t.endColumn,r=this._getCurrentWordRange(e,t);let a=Boolean(this._wordRange&&this._wordRange.equalsRange(r));for(let e=0,t=i.length;!a&&e<t;e++){const t=i.getRange(e);t&&t.startLineNumber===n&&t.startColumn<=o&&t.endColumn>=s&&(a=!0)}return a}cancel(){this.result.cancel()}}class R8 extends A8{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return T8(this._providers,e,t.getPosition(),n).then((e=>e||new ta))}}class O8 extends A8{constructor(e,t,i,n,o){super(e,t,i),this._providers=n,this._otherModels=o}_compute(e,t,i,n){return function(e,t,i,n,o,s){return qt(e.ordered(t).map((e=>()=>{const n=s.filter((t=>x8(e.selector,t.uri,t.getLanguageId(),!0,void 0,void 0)>0));return Promise.resolve(e.provideMultiDocumentHighlights(t,i,n,o)).then(void 0,d)})),(e=>e instanceof ta&&e.size>0))}(this._providers,e,t.getPosition(),0,n,this._otherModels).then((e=>e||new ta))}}class P8 extends A8{constructor(e,t,i,n,o){super(e,t,n),this._otherModels=o,this._selectionIsEmpty=t.isEmpty(),this._word=i}_compute(e,t,i,n){return Kt(250,n).then((()=>{const n=new ta;let o;if(o=this._word?this._word:e.getWordAtPosition(t.getPosition()),!o)return new ta;const s=[e,...this._otherModels];for(const e of s){if(e.isDisposed())continue;const t=e.findMatches(o.word,!0,!1,!0,i,!1).map((e=>({range:e.range,kind:mC.Text})));t&&n.set(e.uri,t)}return n}))}isValid(e,t,i){const n=t.isEmpty();return this._selectionIsEmpty===n&&super.isValid(e,t,i)}}Kd("_executeDocumentHighlights",(async(e,t,i)=>{const n=e.get(Jk),o=await T8(n.documentHighlightProvider,t,i,Rt.None);return null==o?void 0:o.get(t.uri)}));let F8=D8=class{constructor(e,t,i,n,o){this.toUnhook=new M,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new ta,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=o,this._hasWordHighlights=M8.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(80),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition((e=>{this._ignorePositionChangeEvent||"off"!==this.occurrencesHighlight&&this._onPositionChanged(e)}))),this.toUnhook.add(e.onDidChangeModelContent((e=>{this._stopAll()}))),this.toUnhook.add(e.onDidChangeModel((e=>{!e.newModelUrl&&e.oldModelUrl?this._stopSingular():D8.query&&this._run()}))),this.toUnhook.add(e.onDidChangeConfiguration((e=>{const t=this.editor.getOption(80);this.occurrencesHighlight!==t&&(this.occurrencesHighlight=t,this._stopAll())}))),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,D8.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){"off"!==this.occurrencesHighlight&&this._run()}_getSortedHighlights(){return this.decorations.getRanges().sort(tc.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),t=e.findIndex((e=>e.containsPosition(this.editor.getPosition()))),i=(t+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const t=this._getWord();t&&Zr(`${this.editor.getModel().getLineContent(n.startLineNumber)}, ${i+1} of ${e.length} for '${t.word}'`)}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),t=e.findIndex((e=>e.containsPosition(this.editor.getPosition()))),i=(t-1+e.length)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const t=this._getWord();t&&Zr(`${this.editor.getModel().getLineContent(n.startLineNumber)}, ${i+1} of ${e.length} for '${t.word}'`)}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=D8.storedDecorations.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),D8.storedDecorations.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(){const e=this.codeEditorService.listCodeEditors();for(const t of e){if(!t.hasModel())continue;const e=D8.storedDecorations.get(t.getModel().uri);if(!e)continue;t.removeDecorations(e),D8.storedDecorations.delete(t.getModel().uri);const i=B8.get(t);(null==i?void 0:i.wordHighlighter)&&i.wordHighlighter.decorations.length>0&&(i.wordHighlighter.decorations.clear(),i.wordHighlighter._hasWordHighlights.set(!1))}}_stopSingular(){var e,t,i,n;this._removeSingleDecorations(),this.editor.hasWidgetFocus()&&((null===(e=this.editor.getModel())||void 0===e?void 0:e.uri.scheme)!==jo.vscodeNotebookCell&&(null===(i=null===(t=D8.query)||void 0===t?void 0:t.modelInfo)||void 0===i?void 0:i.model.uri.scheme)!==jo.vscodeNotebookCell?(D8.query=null,this._run()):(null===(n=D8.query)||void 0===n?void 0:n.modelInfo)&&(D8.query.modelInfo=null)),-1!==this.renderDecorationsTimer&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),null!==this.workerRequest&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(){this._removeAllDecorations(),-1!==this.renderDecorationsTimer&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),null!==this.workerRequest&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){var t;"off"===this.occurrencesHighlight||3!==e.reason&&(null===(t=this.editor.getModel())||void 0===t?void 0:t.uri.scheme)!==jo.vscodeNotebookCell?this._stopAll():this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===jo.vscodeNotebookCell){const t=[],i=this.codeEditorService.listCodeEditors();for(const n of i){const i=n.getModel();i&&i!==e&&i.uri.scheme===jo.vscodeNotebookCell&&t.push(i)}return t}const t=[],i=this.codeEditorService.listCodeEditors();for(const n of i){if(!gz(n))continue;const i=n.getModel();i&&e===i.modified&&t.push(i.modified)}if(t.length)return t;if("singleFile"===this.occurrencesHighlight)return[];for(const n of i){const i=n.getModel();i&&i!==e&&t.push(i)}return t}_run(){var e,t;let i;if(this.editor.hasWidgetFocus()){const e=this.editor.getSelection();if(!e||e.startLineNumber!==e.endLineNumber)return void this._stopAll();const t=e.startColumn,n=e.endColumn,o=this._getWord();if(!o||o.startColumn>t||o.endColumn<n)return D8.query=null,void this._stopAll();i=this.workerRequest&&this.workerRequest.isValid(this.model,e,this.decorations),D8.query={modelInfo:{model:this.model,selection:e},word:o}}else if(null===D8.query)return;if(this.lastCursorPositionChangeTime=(new Date).getTime(),i)this.workerRequestCompleted&&-1!==this.renderDecorationsTimer&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else{this._stopAll();const i=++this.workerRequestTokenId;this.workerRequestCompleted=!1;const n=this.getOtherModelsToHighlight(this.editor.getModel()),o=!((D8.query.modelInfo||!D8.query.word)&&(null===(e=D8.query.modelInfo)||void 0===e?void 0:e.model.uri)===this.model.uri);D8.query.modelInfo&&D8.query.modelInfo.model.uri===this.model.uri?this.workerRequest=this.computeWithModel(D8.query.modelInfo.model,D8.query.modelInfo.selection,D8.query.word,n):this.workerRequest=this.computeWithModel(this.model,this.editor.getSelection(),o?D8.query.word:null,n),null===(t=this.workerRequest)||void 0===t||t.result.then((e=>{i===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=e||[],this._beginRenderDecorations())}),h)}}computeWithModel(e,t,i,n){return n.length?function(e,t,i,n,o,s){return e.has(t)?new O8(t,i,o,e,s):new P8(t,i,n,o,s)}(this.multiDocumentProviders,e,t,i,this.editor.getOption(129),n):function(e,t,i,n,o){return e.has(t)?new R8(t,i,o,e):new P8(t,i,n,o,[])}(this.providers,e,t,i,this.editor.getOption(129))}_beginRenderDecorations(){const e=(new Date).getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout((()=>{this.renderDecorations()}),t-e)}renderDecorations(){var e,t,i;this.renderDecorationsTimer=-1;const n=this.codeEditorService.listCodeEditors();for(const s of n){const n=B8.get(s);if(!n)continue;const r=[],a=null===(e=s.getModel())||void 0===e?void 0:e.uri;if(a&&this.workerRequestValue.has(a)){const e=D8.storedDecorations.get(a),l=this.workerRequestValue.get(a);if(l)for(const e of l)r.push({range:e.range,options:(o=e.kind,o===mC.Write?r3:o===mC.Text?a3:d3)});let h=[];s.changeDecorations((t=>{h=t.deltaDecorations(null!=e?e:[],r)})),D8.storedDecorations=D8.storedDecorations.set(a,h),r.length>0&&(null===(t=n.wordHighlighter)||void 0===t||t.decorations.set(r),null===(i=n.wordHighlighter)||void 0===i||i._hasWordHighlights.set(!0))}}var o}dispose(){this._stopSingular(),this.toUnhook.dispose()}};F8.storedDecorations=new ta,F8.query=null,F8=D8=N8([I8(4,dh)],F8);let B8=E8=class extends T{static get(e){return e.getContribution(E8.ID)}constructor(e,t,i,n){super(),this._wordHighlighter=null;const o=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new F8(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,n))};this._register(e.onDidChangeModel((e=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),o()}))),o()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!(!this._wordHighlighter||!this._wordHighlighter.hasDecorations())}moveNext(){var e;null===(e=this._wordHighlighter)||void 0===e||e.moveNext()}moveBack(){var e;null===(e=this._wordHighlighter)||void 0===e||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}};B8.ID="editor.contrib.wordHighlighter",B8=E8=N8([I8(1,sd),I8(2,Jk),I8(3,dh)],B8);class W8 extends zd{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=B8.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}Gd(B8.ID,B8,0),qd(class extends W8{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:me(0,"Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:M8,kbOpts:{kbExpr:nc.editorTextFocus,primary:65,weight:100}})}}),qd(class extends W8{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:me(0,"Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:M8,kbOpts:{kbExpr:nc.editorTextFocus,primary:1089,weight:100}})}}),qd(class extends zd{constructor(){super({id:"editor.action.wordHighlight.trigger",label:me(0,"Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:M8.toNegated(),kbOpts:{kbExpr:nc.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=B8.get(t);n&&n.restoreViewState(!0)}});class V8 extends Vd{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=Uw(t.getOption(129)),o=t.getModel(),s=t.getSelections().map((e=>{const t=new ch(e.positionLineNumber,e.positionColumn),i=this._move(n,o,t,this._wordNavigationType);return this._moveTo(e,i,this._inSelectionMode)}));if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,s.map((e=>Fy.fromModelSelection(e)))),1===s.length){const e=new ch(s[0].positionLineNumber,s[0].positionColumn);t.revealPosition(e,0)}}_moveTo(e,t,i){return i?new ic(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new ic(t.lineNumber,t.column,t.lineNumber,t.column)}}class z8 extends V8{_move(e,t,i,n){return Jy.moveWordLeft(e,t,i,n)}}class H8 extends V8{_move(e,t,i,n){return Jy.moveWordRight(e,t,i,n)}}class U8 extends Vd{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e.get(Yg);if(!t.hasModel())return;const o=Uw(t.getOption(129)),s=t.getModel(),r=t.getSelections(),a=t.getOption(6),l=t.getOption(11),h=n.getLanguageConfiguration(s.getLanguageId()).getAutoClosingPairs(),d=t._getViewModel(),c=r.map((e=>{const i=this._delete({wordSeparators:o,model:s,selection:e,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:a,autoClosingQuotes:l,autoClosingPairs:h,autoClosedCharacters:d.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Ky(i,"")}));t.pushUndoStop(),t.executeCommands(this.id,c),t.pushUndoStop()}}class K8 extends U8{_delete(e,t){return Jy.deleteWordLeft(e,t)||new tc(1,1,1,1)}}class j8 extends U8{_delete(e,t){const i=Jy.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new tc(n,o,n,o)}}jd(new class extends z8{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}),jd(new class extends z8{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}),jd(new class extends z8{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:Bh.and(nc.textInputFocus,null===(e=Bh.and(WS,sU))||void 0===e?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}),jd(new class extends z8{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}),jd(new class extends z8{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}),jd(new class extends z8{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:Bh.and(nc.textInputFocus,null===(e=Bh.and(WS,sU))||void 0===e?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}),jd(new class extends H8{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}),jd(new class extends H8{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:Bh.and(nc.textInputFocus,null===(e=Bh.and(WS,sU))||void 0===e?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}),jd(new class extends H8{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}),jd(new class extends H8{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}),jd(new class extends H8{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:Bh.and(nc.textInputFocus,null===(e=Bh.and(WS,sU))||void 0===e?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}),jd(new class extends H8{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}),jd(new class extends z8{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n){return super._move(Uw(Uk.wordSeparators.defaultValue),t,i,n)}}),jd(new class extends z8{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n){return super._move(Uw(Uk.wordSeparators.defaultValue),t,i,n)}}),jd(new class extends H8{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n){return super._move(Uw(Uk.wordSeparators.defaultValue),t,i,n)}}),jd(new class extends H8{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n){return super._move(Uw(Uk.wordSeparators.defaultValue),t,i,n)}}),jd(new class extends K8{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:nc.writable})}}),jd(new class extends K8{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:nc.writable})}}),jd(new class extends K8{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:nc.writable,kbOpts:{kbExpr:nc.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}),jd(new class extends j8{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:nc.writable})}}),jd(new class extends j8{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:nc.writable})}}),jd(new class extends j8{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:nc.writable,kbOpts:{kbExpr:nc.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}),qd(class extends zd{constructor(){super({id:"deleteInsideWord",precondition:nc.writable,label:me(0,"Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const n=Uw(t.getOption(129)),o=t.getModel(),s=t.getSelections().map((e=>{const t=Jy.deleteInsideWord(n,o,e);return new Ky(t,"")}));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}});class q8 extends V8{_move(e,t,i,n){return eS.moveWordPartLeft(e,t,i)}}Ch.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft"),Ch.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class $8 extends V8{_move(e,t,i,n){return eS.moveWordPartRight(e,t,i)}}jd(new class extends U8{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:nc.writable,kbOpts:{kbExpr:nc.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){return eS.deleteWordPartLeft(e)||new tc(1,1,1,1)}}),jd(new class extends U8{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:nc.writable,kbOpts:{kbExpr:nc.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=eS.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new tc(n,o,n,o)}}),jd(new class extends q8{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:nc.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}),jd(new class extends q8{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:nc.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}),jd(new class extends $8{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:nc.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}),jd(new class extends $8{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:nc.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}});var G8=i(643),Z8={};Z8.styleTagTransform=Vr(),Z8.setAttributes=Pr(),Z8.insert=Rr().bind(null,"head"),Z8.domAPI=Tr(),Z8.insertStyleElement=Br(),Ir()(G8.Z,Z8),G8.Z&&G8.Z.locals&&G8.Z.locals;class Y8 extends nA{constructor(e,t,i){super(e,i.keepIdleModels||!1,i.label,t),this._foreignModuleId=i.moduleId,this._foreignModuleCreateData=i.createData||null,this._foreignModuleHost=i.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||"function"!=typeof this._foreignModuleHost[e])return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(e){return Promise.reject(e)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then((e=>{const t=this._foreignModuleHost?_c(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then((t=>{this._foreignModuleCreateData=null;const i=(t,i)=>e.fmr(t,i),n=(e,t)=>function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)},o={};for(const e of t)o[e]=n(e,i);return o}))}))),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then((e=>this.getProxy()))}}function Q8(e){return"string"==typeof e}function X8(e){return!Q8(e)}function J8(e){return!e}function eee(e,t){return e.ignoreCase&&t?t.toLowerCase():t}function tee(e){return e.replace(/[&<>'"_]/g,"-")}function iee(e,t){return new Error(`${e.languageId}: ${t}`)}function nee(e,t,i,n,o){let s=null;return t.replace(/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g,(function(t,r,a,l,h,d,c,u,g){return J8(a)?J8(l)?!J8(h)&&h<n.length?eee(e,n[h]):!J8(c)&&e&&"string"==typeof e[c]?e[c]:(null===s&&(s=o.split("."),s.unshift(o)),!J8(d)&&d<s.length?eee(e,s[d]):""):eee(e,i):"$"}))}function oee(e,t){let i=t;for(;i&&i.length>0;){const t=e.tokenizer[i];if(t)return t;const n=i.lastIndexOf(".");i=n<0?null:i.substr(0,n)}return null}var see;class ree{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(null!==e&&e.depth>=this._maxCacheDepth)return new aee(e,t);let i=aee.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new aee(e,t),this._entries[i]=n,n)}}ree._INSTANCE=new ree(5);class aee{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;null!==e;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;null!==e&&null!==t;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return null===e&&null===t}equals(e){return aee._equals(this,e)}push(e){return ree.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return ree.create(this.parent,e)}}class lee{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new lee(this.languageId,this.state)}}class hee{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(null!==t)return new dee(e,t);if(null!==e&&e.depth>=this._maxCacheDepth)return new dee(e,t);const i=aee.getStackElementId(e);let n=this._entries[i];return n||(n=new dee(e,null),this._entries[i]=n,n)}}hee._INSTANCE=new hee(5);class dee{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:hee.create(this.stack,this.embeddedLanguageData)}equals(e){return e instanceof dee&&!!this.stack.equals(e.stack)&&(null===this.embeddedLanguageData&&null===e.embeddedLanguageData||null!==this.embeddedLanguageData&&null!==e.embeddedLanguageData&&this.embeddedLanguageData.equals(e.embeddedLanguageData))}}class cee{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new hC(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,n){const o=i.languageId,s=i.state,r=SC.get(o);if(!r)return this.enterLanguage(o),this.emit(n,""),s;const a=r.tokenize(e,t,s);if(0!==n)for(const e of a.tokens)this._tokens.push(new hC(e.offset+n,e.type,e.language));else this._tokens=this._tokens.concat(a.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,a.endState}finalize(e){return new dC(this._tokens,e)}}class uee{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=1024|this._theme.match(this._currentLanguageId,t);this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const n=null!==e?e.length:0,o=t.length,s=null!==i?i.length:0;if(0===n&&0===o&&0===s)return new Uint32Array(0);if(0===n&&0===o)return i;if(0===o&&0===s)return e;const r=new Uint32Array(n+o+s);null!==e&&r.set(e);for(let e=0;e<o;e++)r[n+e]=t[e];return null!==i&&r.set(i,n+o),r}nestedLanguageTokenize(e,t,i,n){const o=i.languageId,s=i.state,r=SC.get(o);if(!r)return this.enterLanguage(o),this.emit(n,""),s;const a=r.tokenizeEncoded(e,t,s);if(0!==n)for(let e=0,t=a.tokens.length;e<t;e+=2)a.tokens[e]+=n;return this._prependTokens=uee._merge(this._prependTokens,this._tokens,a.tokens),this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0,a.endState}finalize(e){return new cC(uee._merge(this._prependTokens,this._tokens,null),e)}}let gee=see=class extends T{constructor(e,t,i,n,o){super(),this._configurationService=o,this._languageService=e,this._standaloneThemeService=t,this._languageId=i,this._lexer=n,this._embeddedLanguages=Object.create(null),this.embeddedLoaded=Promise.resolve(void 0);let s=!1;this._register(SC.onDidChange((e=>{if(s)return;let t=!1;for(let i=0,n=e.changedLanguages.length;i<n;i++){const n=e.changedLanguages[i];if(this._embeddedLanguages[n]){t=!0;break}}t&&(s=!0,SC.handleChange([this._languageId]),s=!1)}))),this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}),this._register(this._configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))})))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const i=SC.get(t);if(i){if(i instanceof see){const t=i.getLoadStatus();!1===t.loaded&&e.push(t.promise)}}else SC.isResolved(t)||e.push(SC.getOrCreate(t))}return 0===e.length?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then((e=>{}))}}getInitialState(){const e=ree.create(null,this._lexer.start);return hee.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return LC(this._languageId,i);const n=new cee,o=this._tokenize(e,t,i,n);return n.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return xC(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const n=new uee(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,i,n);return n.finalize(o)}_tokenize(e,t,i,n){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,n):this._myTokenize(e,t,i,0,n)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=oee(this._lexer,t.stack.state),!i))throw iee(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,o=!1;for(const t of i){if(!X8(t.action)||"@pop"!==t.action.nextEmbedded)continue;o=!0;let i=t.regex;const s=t.regex.source;if("^(?:"===s.substr(0,4)&&")"===s.substr(s.length-1,1)){const e=(i.ignoreCase?"i":"")+(i.unicode?"u":"");i=new RegExp(s.substr(4,s.length-5),e)}const r=e.search(i);-1===r||0!==r&&t.matchOnlyAtLineStart||(-1===n||r<n)&&(n=r)}if(!o)throw iee(this._lexer,'no rule containing nextEmbedded: "@pop" in tokenizer embedded state: '+t.stack.state);return n}_nestedTokenize(e,t,i,n,o){const s=this._findLeavingNestedLanguageOffset(e,i);if(-1===s){const s=o.nestedLanguageTokenize(e,t,i.embeddedLanguageData,n);return hee.create(i.stack,new lee(i.embeddedLanguageData.languageId,s))}const r=e.substring(0,s);r.length>0&&o.nestedLanguageTokenize(r,!1,i.embeddedLanguageData,n);const a=e.substring(s);return this._myTokenize(a,t,i,n+s,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n,o){o.enterLanguage(this._languageId);const s=e.length,r=t&&this._lexer.includeLF?e+"\n":e,a=r.length;let l=i.embeddedLanguageData,h=i.stack,d=0,c=null,u=!0;for(;u||d<a;){const i=d,m=h.depth,f=c?c.groups.length:0,_=h.state;let v=null,b=null,w=null,C=null,y=null;if(c){v=c.matches;const e=c.groups.shift();b=e.matched,w=e.action,C=c.rule,0===c.groups.length&&(c=null)}else{if(!u&&d>=a)break;u=!1;let e=this._lexer.tokenizer[_];if(!e&&(e=oee(this._lexer,_),!e))throw iee(this._lexer,"tokenizer state is not defined: "+_);const t=r.substr(d);for(const i of e)if((0===d||!i.matchOnlyAtLineStart)&&(v=t.match(i.regex),v)){b=v[0],w=i.action;break}}if(v||(v=[""],b=""),w||(d<a&&(v=[r.charAt(d)],b=v[0]),w=this._lexer.defaultToken),null===b)break;for(d+=b.length;!function(e){return Array.isArray(e)}(w)&&X8(w)&&w.test;)w=w.test(b,v,_,d===a);let S=null;if("string"==typeof w||Array.isArray(w))S=w;else if(w.group)S=w.group;else if(null!==w.token&&void 0!==w.token){if(S=w.tokenSubst?nee(this._lexer,w.token,b,v,_):w.token,w.nextEmbedded)if("@pop"===w.nextEmbedded){if(!l)throw iee(this._lexer,"cannot pop embedded language if not inside one");l=null}else{if(l)throw iee(this._lexer,"cannot enter embedded language from within an embedded language");y=nee(this._lexer,w.nextEmbedded,b,v,_)}if(w.goBack&&(d=Math.max(0,d-w.goBack)),w.switchTo&&"string"==typeof w.switchTo){let e=nee(this._lexer,w.switchTo,b,v,_);if("@"===e[0]&&(e=e.substr(1)),!oee(this._lexer,e))throw iee(this._lexer,"trying to switch to a state '"+e+"' that is undefined in rule: "+this._safeRuleName(C));h=h.switchTo(e)}else{if(w.transform&&"function"==typeof w.transform)throw iee(this._lexer,"action.transform not supported");if(w.next)if("@push"===w.next){if(h.depth>=this._lexer.maxStack)throw iee(this._lexer,"maximum tokenizer stack size reached: ["+h.state+","+h.parent.state+",...]");h=h.push(_)}else if("@pop"===w.next){if(h.depth<=1)throw iee(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(C));h=h.pop()}else if("@popall"===w.next)h=h.popall();else{let e=nee(this._lexer,w.next,b,v,_);if("@"===e[0]&&(e=e.substr(1)),!oee(this._lexer,e))throw iee(this._lexer,"trying to set a next state '"+e+"' that is undefined in rule: "+this._safeRuleName(C));h=h.push(e)}}w.log&&"string"==typeof w.log&&(g=this._lexer,p=this._lexer.languageId+": "+nee(this._lexer,w.log,b,v,_),console.log(`${g.languageId}: ${p}`))}if(null===S)throw iee(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(C));const k=i=>{const s=this._languageService.getLanguageIdByLanguageName(i)||this._languageService.getLanguageIdByMimeType(i)||i,r=this._getNestedEmbeddedLanguageData(s);if(d<a){const i=e.substr(d);return this._nestedTokenize(i,t,hee.create(h,r),n+d,o)}return hee.create(h,r)};if(Array.isArray(S)){if(c&&c.groups.length>0)throw iee(this._lexer,"groups cannot be nested: "+this._safeRuleName(C));if(v.length!==S.length+1)throw iee(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(C));let e=0;for(let t=1;t<v.length;t++)e+=v[t].length;if(e!==b.length)throw iee(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(C));c={rule:C,matches:v,groups:[]};for(let e=0;e<S.length;e++)c.groups[e]={action:S[e],matched:v[e+1]};d-=b.length}else{{if("@rematch"===S&&(d-=b.length,b="",v=null,S="",null!==y))return k(y);if(0===b.length){if(0===a||m!==h.depth||_!==h.state||(c?c.groups.length:0)!==f)continue;throw iee(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(C))}let e=null;if(Q8(S)&&0===S.indexOf("@brackets")){const t=S.substr(9),i=pee(this._lexer,b);if(!i)throw iee(this._lexer,"@brackets token returned but no bracket defined as: "+b);e=tee(i.token+t)}else e=tee(""===S?"":S+this._lexer.tokenPostfix);i<s&&o.emit(i+n,e)}if(null!==y)return k(y)}}var g,p;return hee.create(h,l)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new lee(e,kC);e!==this._languageId&&(this._languageService.requestBasicLanguageFeatures(e),SC.getOrCreate(e),this._embeddedLanguages[e]=!0);const t=SC.get(e);return new lee(e,t?t.getInitialState():kC)}};function pee(e,t){if(!t)return null;t=eee(e,t);const i=e.brackets;for(const e of i){if(e.open===t)return{token:e.token,bracketType:1};if(e.close===t)return{token:e.token,bracketType:-1}}return null}gee=see=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(4,ug)],gee);const mee=Tx("standaloneColorizer",{createHTML:e=>e});class fee{static colorizeElement(e,t,i,n){const o=(n=n||{}).theme||"vs",s=n.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!s)return console.error("Mode not detected"),Promise.resolve();const r=t.getLanguageIdByMimeType(s)||s;e.setTheme(o);const a=i.firstChild?i.firstChild.nodeValue:"";return i.className+=" "+o,this.colorize(t,a||"",r,n).then((e=>{var t;const n=null!==(t=null==mee?void 0:mee.createHTML(e))&&void 0!==t?t:e;i.innerHTML=n}),(e=>console.error(e)))}static async colorize(e,t,i,n){const o=e.languageIdCodec;let s=4;n&&"number"==typeof n.tabSize&&(s=n.tabSize),$n(t)&&(t=t.substr(1));const r=mn(t);if(!e.isRegisteredLanguageId(i))return _ee(r,s,o);const a=await SC.getOrCreate(i);return a?function(e,t,i,n){return new Promise(((o,s)=>{const r=()=>{const a=function(e,t,i,n){let o=[],s=i.getInitialState();for(let r=0,a=e.length;r<a;r++){const a=e[r],l=i.tokenizeEncoded(a,!0,s);IC.convertToEndOffset(l.tokens,a.length);const h=new IC(l.tokens,a,n),d=nF.isBasicASCII(a,!0),c=nF.containsRTL(a,d,!0),u=nO(new QR(!1,!0,a,!1,d,c,0,h.inflate(),[],t,0,0,0,0,-1,"none",!1,!1,null));o=o.concat(u.html),o.push("<br/>"),s=l.endState}return o.join("")}(e,t,i,n);if(i instanceof gee){const e=i.getLoadStatus();if(!1===e.loaded)return void e.promise.then(r,s)}o(a)};r()}))}(r,s,a,o):_ee(r,s,o)}static colorizeLine(e,t,i,n,o=4){const s=nF.isBasicASCII(e,t),r=nF.containsRTL(e,s,i);return nO(new QR(!1,!0,e,!1,s,r,0,n,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){const n=e.getLineContent(t);e.tokenization.forceTokenization(t);const o=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),o,i)}}function _ee(e,t,i){let n=[];const o=new Uint32Array(2);o[0]=0,o[1]=33587200;for(let s=0,r=e.length;s<r;s++){const r=e[s];o[0]=r.length;const a=new IC(o,r,i),l=nF.isBasicASCII(r,!0),h=nF.containsRTL(r,l,!0),d=nO(new QR(!1,!0,r,!1,l,h,0,a,[],t,0,0,0,0,-1,"none",!1,!1,null));n=n.concat(d.html),n.push("<br/>")}return n.join("")}let vee=class extends T{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new q),this._onCodeEditorAdd=this._register(new q),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new q),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new q),this._onDiffEditorAdd=this._register(new q),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new q),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new B,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map((e=>this._codeEditors[e]))}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map((e=>this._diffEditors[e]))}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach((t=>t.removeDecorationsByType(e)))))}setModelProperty(e,t,i){const n=e.toString();let o;this._modelProperties.has(n)?o=this._modelProperties.get(n):(o=new Map,this._modelProperties.set(n,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}async openCodeEditor(e,t,i){for(const n of this._codeEditorOpenHandlers){const o=await n(e,t,i);if(null!==o)return o}return null}registerCodeEditorOpenHandler(e){return I(this._codeEditorOpenHandlers.unshift(e))}};vee=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,Tv)],vee);var bee=function(e,t){return function(i,n){t(i,n,e)}};let wee=class extends vee{constructor(e,t){super(t),this._register(this.onCodeEditorAdd((()=>this._checkContextKey()))),this._register(this.onCodeEditorRemove((()=>this._checkContextKey()))),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler((async(e,t,i)=>t?this.doOpenEditor(t,e):null)))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const i=t.resource.scheme;if(i===jo.http||i===jo.https)return br(t.resource.toString()),e}return null}const i=t.options?t.options.selection:null;if(i)if("number"==typeof i.endLineNumber&&"number"==typeof i.endColumn)e.setSelection(i),e.revealRangeInCenter(i,1);else{const t={lineNumber:i.startLineNumber,column:i.startColumn};e.setPosition(t),e.revealPositionInCenter(t,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};wee=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([bee(0,sd),bee(1,Tv)],wee),wg(dh,wee,0);const Cee=hh("layoutService");var yee=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},See=function(e,t){return function(i,n){t(i,n,e)}};let kee=class{get mainContainer(){var e,t;return null!==(t=null===(e=zc(this._codeEditorService.listCodeEditors()))||void 0===e?void 0:e.getContainerDomNode())&&void 0!==t?t:r.document.body}get activeContainer(){var e,t;const i=null!==(e=this._codeEditorService.getFocusedCodeEditor())&&void 0!==e?e:this._codeEditorService.getActiveCodeEditor();return null!==(t=null==i?void 0:i.getContainerDomNode())&&void 0!==t?t:this.mainContainer}get mainContainerDimension(){return Ns(this.mainContainer)}get activeContainerDimension(){return Ns(this.activeContainer)}get containers(){return Pc(this._codeEditorService.listCodeEditors().map((e=>e.getContainerDomNode())))}getContainer(){return this.activeContainer}focus(){var e;null===(e=this._codeEditorService.getFocusedCodeEditor())||void 0===e||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=z.None,this.onDidLayoutActiveContainer=z.None,this.onDidLayoutContainer=z.None,this.onDidChangeActiveContainer=z.None,this.onDidAddContainer=z.None,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};kee=yee([See(0,dh)],kee);let Lee=class extends kee{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};Lee=yee([See(1,dh)],Lee),wg(Cee,kee,1);var xee=function(e,t){return function(i,n){t(i,n,e)}};function Dee(e){return e.scheme===jo.file?e.fsPath:e.path}let Eee=0;class Nee{constructor(e,t,i,n,o,s,r){this.id=++Eee,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=n,this.groupOrder=o,this.sourceId=s,this.sourceOrder=r,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class Iee{constructor(e,t){this.resourceLabel=e,this.reason=t}}class Mee{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,i]of this.elements)(0===i.reason?e:t).push(i.resourceLabel);const i=[];return e.length>0&&i.push(me(0,"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(me(0,"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join("\n")}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class Tee{constructor(e,t,i,n,o,s,r){this.id=++Eee,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=o,this.sourceId=s,this.sourceOrder=r,this.removedResources=null,this.invalidatedResources=null}canSplit(){return"function"==typeof this.actual.split}removeResource(e,t,i){this.removedResources||(this.removedResources=new Mee),this.removedResources.has(t)||this.removedResources.set(t,new Iee(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),0===this.invalidatedResources.size&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new Mee),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new Iee(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class Aee{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t<this._past.length;t++)e.push(` * [UNDO] ${this._past[t]}`);for(let t=this._future.length-1;t>=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join("\n")}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){1===e.type?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let e=0,i=this._past.length;e<i;e++)t.push(this._past[e].id);for(let e=this._future.length-1;e>=0;e--)t.push(this._future[e].id);return new oy(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,o=-1;for(let s=0,r=this._past.length;s<r;s++,n++){const r=this._past[s];i&&(n>=t||r.id!==e.elements[n])&&(i=!1,o=0),i||1!==r.type||r.removeResource(this.resourceLabel,this.strResource,0)}let s=-1;for(let o=this._future.length-1;o>=0;o--,n++){const r=this._future[o];i&&(n>=t||r.id!==e.elements[n])&&(i=!1,s=o),i||1!==r.type||r.removeResource(this.resourceLabel,this.strResource,0)}-1!==o&&(this._past=this._past.slice(0,o)),-1!==s&&(this._future=this._future.slice(s+1)),this.versionId++}getElements(){const e=[],t=[];for(const t of this._past)e.push(t.actual);for(const e of this._future)t.push(e.actual);return{past:e,future:t}}getClosestPastElement(){return 0===this._past.length?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return 0===this._future.length?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class Ree{constructor(e){this.editStacks=e,this._versionIds=[];for(let e=0,t=this.editStacks.length;e<t;e++)this._versionIds[e]=this.editStacks[e].versionId}isValid(){for(let e=0,t=this.editStacks.length;e<t;e++)if(this._versionIds[e]!==this.editStacks[e].versionId)return!1;return!0}}const Oee=new Aee("","");Oee.locked=!0;let Pee=class{constructor(e,t){this._dialogService=e,this._notificationService=t,this._editStacks=new Map,this._uriComparisonKeyComputers=[]}getUriComparisonKey(e){for(const t of this._uriComparisonKeyComputers)if(t[0]===e.scheme)return t[1].getComparisonKey(e);return e.toString()}_print(e){console.log("------------------------------------"),console.log(`AFTER ${e}: `);const t=[];for(const e of this._editStacks)t.push(e[1].toString());console.log(t.join("\n"))}pushElement(e,t=sy.None,i=ry.None){if(0===e.type){const n=Dee(e.resource),o=this.getUriComparisonKey(e.resource);this._pushElement(new Nee(e,n,o,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const n=new Set,o=[],s=[];for(const t of e.resources){const e=Dee(t),i=this.getUriComparisonKey(t);n.has(i)||(n.add(i),o.push(e),s.push(i))}1===o.length?this._pushElement(new Nee(e,o[0],s[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new Tee(e,o,s,t.id,t.nextOrder(),i.id,i.nextOrder()))}}_pushElement(e){for(let t=0,i=e.strResources.length;t<i;t++){const i=e.resourceLabels[t],n=e.strResources[t];let o;this._editStacks.has(n)?o=this._editStacks.get(n):(o=new Aee(i,n),this._editStacks.set(n,o)),o.pushElement(e)}}getLastElement(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const e=this._editStacks.get(t);if(e.hasFutureElements())return null;const i=e.getClosestPastElement();return i?i.actual:null}return null}_splitPastWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const e of i){const t=Dee(e.resource),i=this.getUriComparisonKey(e.resource),o=new Nee(e,t,i,0,0,0,0);n.set(o.strResource,o)}for(const i of e.strResources)t&&t.has(i)||this._editStacks.get(i).splitPastWorkspaceElement(e,n)}_splitFutureWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const e of i){const t=Dee(e.resource),i=this.getUriComparisonKey(e.resource),o=new Nee(e,t,i,0,0,0,0);n.set(o.strResource,o)}for(const i of e.strResources)t&&t.has(i)||this._editStacks.get(i).splitFutureWorkspaceElement(e,n)}removeElements(e){const t="string"==typeof e?e:this.getUriComparisonKey(e);this._editStacks.has(t)&&(this._editStacks.get(t).dispose(),this._editStacks.delete(t))}setElementsValidFlag(e,t,i){const n=this.getUriComparisonKey(e);this._editStacks.has(n)&&this._editStacks.get(n).setElementsValidFlag(t,i)}createSnapshot(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).createSnapshot(e):new oy(e,[])}restoreSnapshot(e){const t=this.getUriComparisonKey(e.resource);if(this._editStacks.has(t)){const i=this._editStacks.get(t);i.restoreSnapshot(e),i.hasPastElements()||i.hasFutureElements()||(i.dispose(),this._editStacks.delete(t))}}getElements(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).getElements():{past:[],future:[]}}_findClosestUndoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestPastElement();s&&s.sourceId===e&&(!t||s.sourceOrder>t.sourceOrder)&&(t=s,i=n)}return[t,i]}canUndo(e){if(e instanceof ry){const[,t]=this._findClosestUndoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);return!!this._editStacks.has(t)&&this._editStacks.get(t).hasPastElements()}_onError(e,t){h(e);for(const e of t.strResources)this.removeElements(e);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,n,o){const s=this._acquireLocks(i);let r;try{r=t()}catch(t){return s(),n.dispose(),this._onError(t,e)}return r?r.then((()=>(s(),n.dispose(),o())),(t=>(s(),n.dispose(),this._onError(t,e)))):(s(),n.dispose(),o())}async _invokeWorkspacePrepare(e){if(void 0===e.actual.prepareUndoRedo)return T.None;const t=e.actual.prepareUndoRedo();return void 0===t?T.None:t}_invokeResourcePrepare(e,t){if(1!==e.actual.type||void 0===e.actual.prepareUndoRedo)return t(T.None);const i=e.actual.prepareUndoRedo();return i?D(i)?t(i):i.then((e=>t(e))):t(T.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||Oee);return new Ree(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new Fee(this._undo(e,0,!0));for(const e of t.strResources)this.removeElements(e);return this._notificationService.warn(n),new Fee}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,me(0,"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,me(0,"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const e of i.editStacks)e.getClosestPastElement()!==t&&o.push(e.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,me(0,"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const e of i.editStacks)e.locked&&s.push(e.resourceLabel);return s.length>0?this._tryToSplitAndUndo(e,t,null,me(0,"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,me(0,"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const n=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,n,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,n,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const i=t.getSecondClosestPastElement();if(i&&i.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(e,t,i,n){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let o;!function(e){e[e.All=0]="All",e[e.This=1]="This",e[e.Cancel=2]="Cancel"}(o||(o={}));const{result:s}=await this._dialogService.prompt({type:aL.Info,message:me(0,"Would you like to undo '{0}' across all files?",t.label),buttons:[{label:me(0,"&&Undo in {0} Files",i.editStacks.length),run:()=>o.All},{label:me(0,"Undo this &&File"),run:()=>o.This}],cancelButton:{run:()=>o.Cancel}});if(s===o.Cancel)return;if(s===o.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const r=this._checkWorkspaceUndo(e,t,i,!1);if(r)return r.returnValue;n=!0}let o;try{o=await this._invokeWorkspacePrepare(t)}catch(e){return this._onError(e,t)}const s=this._checkWorkspaceUndo(e,t,i,!0);if(s)return o.dispose(),s.returnValue;for(const e of i.editStacks)e.moveBackward(t);return this._safeInvokeWithLocks(t,(()=>t.actual.undo()),i,o,(()=>this._continueUndoInGroup(t.groupId,n)))}_resourceUndo(e,t,i){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,(n=>(e.moveBackward(t),this._safeInvokeWithLocks(t,(()=>t.actual.undo()),new Ree([e]),n,(()=>this._continueUndoInGroup(t.groupId,i))))));{const e=me(0,"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e)}}else e.flushAllElements()}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestPastElement();s&&s.groupId===e&&(!t||s.groupOrder>t.groupOrder)&&(t=s,i=n)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);return i?this._undo(i,0,t):void 0}undo(e){if(e instanceof ry){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return"string"==typeof e?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const n=this._editStacks.get(e),o=n.getClosestPastElement();if(o){if(o.groupId){const[e,n]=this._findClosestUndoElementInGroup(o.groupId);if(o!==e&&n)return this._undo(n,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return 1===o.type?this._workspaceUndo(e,o,i):this._resourceUndo(n,o,i)}finally{}}}async _confirmAndContinueUndo(e,t,i){if((await this._dialogService.confirm({message:me(0,"Would you like to undo '{0}'?",i.label),primaryButton:me(0,"&&Yes"),cancelButton:me(0,"No")})).confirmed)return this._undo(e,t,!0)}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.sourceId===e&&(!t||s.sourceOrder<t.sourceOrder)&&(t=s,i=n)}return[t,i]}canRedo(e){if(e instanceof ry){const[,t]=this._findClosestRedoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);return!!this._editStacks.has(t)&&this._editStacks.get(t).hasFutureElements()}_tryToSplitAndRedo(e,t,i,n){if(t.canSplit())return this._splitFutureWorkspaceElement(t,i),this._notificationService.warn(n),new Fee(this._redo(e));for(const e of t.strResources)this.removeElements(e);return this._notificationService.warn(n),new Fee}_checkWorkspaceRedo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndRedo(e,t,t.removedResources,me(0,"Could not redo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndRedo(e,t,t.invalidatedResources,me(0,"Could not redo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const e of i.editStacks)e.getClosestFutureElement()!==t&&o.push(e.resourceLabel);if(o.length>0)return this._tryToSplitAndRedo(e,t,null,me(0,"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const e of i.editStacks)e.locked&&s.push(e.resourceLabel);return s.length>0?this._tryToSplitAndRedo(e,t,null,me(0,"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,me(0,"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),n=this._checkWorkspaceRedo(e,t,i,!1);return n?n.returnValue:this._executeWorkspaceRedo(e,t,i)}async _executeWorkspaceRedo(e,t,i){let n;try{n=await this._invokeWorkspacePrepare(t)}catch(e){return this._onError(e,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return n.dispose(),o.returnValue;for(const e of i.editStacks)e.moveForward(t);return this._safeInvokeWithLocks(t,(()=>t.actual.redo()),i,n,(()=>this._continueRedoInGroup(t.groupId)))}_resourceRedo(e,t){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,(i=>(e.moveForward(t),this._safeInvokeWithLocks(t,(()=>t.actual.redo()),new Ree([e]),i,(()=>this._continueRedoInGroup(t.groupId))))));{const e=me(0,"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e)}}else e.flushAllElements()}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.groupId===e&&(!t||s.groupOrder<t.groupOrder)&&(t=s,i=n)}return[t,i]}_continueRedoInGroup(e){if(!e)return;const[,t]=this._findClosestRedoElementInGroup(e);return t?this._redo(t):void 0}redo(e){if(e instanceof ry){const[,t]=this._findClosestRedoElementWithSource(e.id);return t?this._redo(t):void 0}return"string"==typeof e?this._redo(e):this._redo(this.getUriComparisonKey(e))}_redo(e){if(!this._editStacks.has(e))return;const t=this._editStacks.get(e),i=t.getClosestFutureElement();if(i){if(i.groupId){const[e,t]=this._findClosestRedoElementInGroup(i.groupId);if(i!==e&&t)return this._redo(t)}try{return 1===i.type?this._workspaceRedo(e,i):this._resourceRedo(t,i)}finally{}}}};Pee=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([xee(0,K3),xee(1,hL)],Pee);class Fee{constructor(e){this.returnValue=e}}wg(ny,Pee,1);var Bee=function(e,t){return function(i,n){t(i,n,e)}};let Wee=class extends T{constructor(e,t,i){super(),this._themeService=e,this._logService=t,this._languageService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange((()=>{this._caches=new WeakMap})))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new H6(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};function Vee(e){return"string"!=typeof e&&(Array.isArray(e)?e.every(Vee):!!e.exclusive)}Wee=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Bee(0,Tv),Bee(1,Md),Bee(2,yu)],Wee),wg(t9,Wee,1);class zee{constructor(e,t,i,n){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=n}equals(e){var t,i;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&(null===(t=this.notebookUri)||void 0===t?void 0:t.toString())===(null===(i=e.notebookUri)||void 0===i?void 0:i.toString())}}class Hee{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new q,this.onDidChange=this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),I((()=>{if(i){const e=this._entries.indexOf(i);e>=0&&(this._entries.splice(e,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}}))}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const e of this._entries)e._score>0&&t.push(e.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,(e=>t.push(e.provider))),t}orderedGroups(e){const t=[];let i,n;return this._orderedForEach(e,(e=>{i&&n===e._score?i.push(e.provider):(n=e._score,i=[e.provider],t.push(i))})),t}_orderedForEach(e,t){this._updateScores(e);for(const e of this._entries)e._score>0&&t(e)}_updateScores(e){var t,i;const n=null===(t=this._notebookInfoResolver)||void 0===t?void 0:t.call(this,e.uri),o=n?new zee(e.uri,e.getLanguageId(),n.uri,n.type):new zee(e.uri,e.getLanguageId(),void 0,void 0);if(!(null===(i=this._lastCandidate)||void 0===i?void 0:i.equals(o))){this._lastCandidate=o;for(const t of this._entries)if(t._score=x8(t.selector,o.uri,o.languageId,Ec(e),o.notebookUri,o.notebookType),Vee(t.selector)&&t._score>0){for(const e of this._entries)e._score=0;t._score=1e3;break}this._entries.sort(Hee._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._score<t._score?1:e._score>t._score?-1:Uee(e.selector)&&!Uee(t.selector)?1:!Uee(e.selector)&&Uee(t.selector)?-1:e._time<t._time?1:e._time>t._time?-1:0}}function Uee(e){return"string"!=typeof e&&(Array.isArray(e)?e.some(Uee):Boolean(e.isBuiltin))}function Kee(e){return Object.isFrozen(e)?e:function(e){if(!e||"object"!=typeof e)return e;const t=[e];for(;t.length>0;){const e=t.shift();Object.freeze(e);for(const i in e)if(uc.call(e,i)){const n=e[i];"object"!=typeof n||Object.isFrozen(n)||hl(n)||t.push(n)}}return e}(e)}wg(Jk,class{constructor(){this.referenceProvider=new Hee(this._score.bind(this)),this.renameProvider=new Hee(this._score.bind(this)),this.codeActionProvider=new Hee(this._score.bind(this)),this.definitionProvider=new Hee(this._score.bind(this)),this.typeDefinitionProvider=new Hee(this._score.bind(this)),this.declarationProvider=new Hee(this._score.bind(this)),this.implementationProvider=new Hee(this._score.bind(this)),this.documentSymbolProvider=new Hee(this._score.bind(this)),this.inlayHintsProvider=new Hee(this._score.bind(this)),this.colorProvider=new Hee(this._score.bind(this)),this.codeLensProvider=new Hee(this._score.bind(this)),this.documentFormattingEditProvider=new Hee(this._score.bind(this)),this.documentRangeFormattingEditProvider=new Hee(this._score.bind(this)),this.onTypeFormattingEditProvider=new Hee(this._score.bind(this)),this.signatureHelpProvider=new Hee(this._score.bind(this)),this.hoverProvider=new Hee(this._score.bind(this)),this.documentHighlightProvider=new Hee(this._score.bind(this)),this.multiDocumentHighlightProvider=new Hee(this._score.bind(this)),this.selectionRangeProvider=new Hee(this._score.bind(this)),this.foldingRangeProvider=new Hee(this._score.bind(this)),this.linkProvider=new Hee(this._score.bind(this)),this.inlineCompletionsProvider=new Hee(this._score.bind(this)),this.completionProvider=new Hee(this._score.bind(this)),this.linkedEditingRangeProvider=new Hee(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new Hee(this._score.bind(this)),this.documentSemanticTokensProvider=new Hee(this._score.bind(this)),this.documentOnDropEditProvider=new Hee(this._score.bind(this)),this.documentPasteEditProvider=new Hee(this._score.bind(this))}_score(e){var t;return null===(t=this._notebookTypeResolver)||void 0===t?void 0:t.call(this,e)}},1);class jee{constructor(e={},t=[],i=[],n){this._contents=e,this._keys=t,this._overrides=i,this.raw=n,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(null===(e=this.raw)||void 0===e?void 0:e.length){const e=this.raw.map((e=>{if(e instanceof jee)return e;const t=new qee("");return t.parseRaw(e),t.configurationModel}));this._rawConfiguration=e.reduce(((e,t)=>t===e?t:e.merge(t)),e[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return 0===this._keys.length&&0===Object.keys(this._contents).length&&0===this._overrides.length}getValue(e){return e?_g(this.contents,e):this.contents}inspect(e,t){const i=this.rawConfiguration.getValue(e);return{value:i,override:t?this.rawConfiguration.getOverrideValue(e,t):void 0,merged:t?this.rawConfiguration.override(t).getValue(e):i}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?_g(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var t,i;const n=cc(this.contents),o=cc(this.overrides),s=[...this.keys],r=(null===(t=this.raw)||void 0===t?void 0:t.length)?[...this.raw]:[this];for(const t of e)if(r.push(...(null===(i=t.raw)||void 0===i?void 0:i.length)?t.raw:[t]),!t.isEmpty()){this.mergeContents(n,t.contents);for(const e of t.overrides){const[t]=o.filter((t=>Ic(t.identifiers,e.identifiers)));t?(this.mergeContents(t.contents,e.contents),t.keys.push(...e.keys),t.keys=Vc(t.keys)):o.push(cc(e))}for(const e of t.keys)-1===s.indexOf(e)&&s.push(e)}return new jee(n,s,o,r.every((e=>e instanceof jee))?void 0:r)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||"object"!=typeof t||!Object.keys(t).length)return this;const i={};for(const e of Vc([...Object.keys(this.contents),...Object.keys(t)])){let n=this.contents[e];const o=t[e];o&&("object"==typeof n&&"object"==typeof o?(n=cc(n),this.mergeContents(n,o)):n=o),i[e]=n}return new jee(i,this.keys,this.overrides)}mergeContents(e,t){for(const i of Object.keys(t))i in e&&ll(e[i])&&ll(t[i])?this.mergeContents(e[i],t[i]):e[i]=cc(t[i])}getContentsForOverrideIdentifer(e){let t=null,i=null;const n=e=>{e&&(i?this.mergeContents(i,e):i=cc(e))};for(const i of this.overrides)1===i.identifiers.length&&i.identifiers[0]===e?t=i.contents:i.identifiers.includes(e)&&n(i.contents);return n(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);-1!==t&&(this.keys.splice(t,1),mg(this.contents,e),Fg.test(e)&&this.overrides.splice(this.overrides.findIndex((t=>Ic(t.identifiers,Bg(e)))),1))}updateValue(e,t,i){pg(this.contents,e,t,(e=>console.error(e))),(i=i||-1===this.keys.indexOf(e))&&this.keys.push(e),Fg.test(e)&&this.overrides.push({identifiers:Bg(e),keys:Object.keys(this.contents[e]),contents:gg(this.contents[e],(e=>console.error(e)))})}}class qee{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new jee}parseRaw(e,t){this._raw=e;const{contents:i,keys:n,overrides:o,restricted:s,hasExcludedProperties:r}=this.doParseRaw(e,t);this._configurationModel=new jee(i,n,o,r?[e]:void 0),this._restrictedConfigurations=s||[]}doParseRaw(e,t){const i=md.as(Lg).getConfigurationProperties(),n=this.filter(e,i,!0,t);return{contents:gg(e=n.raw,(e=>console.error(`Conflict in settings file ${this._name}: ${e}`))),keys:Object.keys(e),overrides:this.toOverrides(e,(e=>console.error(`Conflict in settings file ${this._name}: ${e}`))),restricted:n.restricted,hasExcludedProperties:n.hasExcludedProperties}}filter(e,t,i,n){var o,s,r;let a=!1;if(!(null==n?void 0:n.scopes)&&!(null==n?void 0:n.skipRestricted)&&!(null===(o=null==n?void 0:n.exclude)||void 0===o?void 0:o.length))return{raw:e,restricted:[],hasExcludedProperties:a};const l={},h=[];for(const o in e)if(Fg.test(o)&&i){const i=this.filter(e[o],t,!1,n);l[o]=i.raw,a=a||i.hasExcludedProperties,h.push(...i.restricted)}else{const i=t[o],d=i?void 0!==i.scope?i.scope:3:void 0;(null==i?void 0:i.restricted)&&h.push(o),(null===(s=n.exclude)||void 0===s?void 0:s.includes(o))||!(null===(r=n.include)||void 0===r?void 0:r.includes(o))&&(void 0!==d&&void 0!==n.scopes&&!n.scopes.includes(d)||n.skipRestricted&&(null==i?void 0:i.restricted))?a=!0:l[o]=e[o]}return{raw:l,restricted:h,hasExcludedProperties:a}}toOverrides(e,t){const i=[];for(const n of Object.keys(e))if(Fg.test(n)){const o={};for(const t in e[n])o[t]=e[n][t];i.push({identifiers:Bg(n),keys:Object.keys(o),contents:gg(o,t)})}return i}}class $ee{constructor(e,t,i,n,o,s,r,a,l,h,d,c,u){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=n,this.defaultConfiguration=o,this.policyConfiguration=s,this.applicationConfiguration=r,this.userConfiguration=a,this.localUserConfiguration=l,this.remoteUserConfiguration=h,this.workspaceConfiguration=d,this.folderConfigurationModel=c,this.memoryConfigurationModel=u}inspect(e,t,i){const n=e.inspect(t,i);return{get value(){return Kee(n.value)},get override(){return Kee(n.override)},get merged(){return Kee(n.merged)}}}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.inspect(this.userConfiguration,this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return void 0!==this.userInspectValue.value||void 0!==this.userInspectValue.override?{value:this.userInspectValue.value,override:this.userInspectValue.override}:void 0}}class Gee{constructor(e,t,i,n,o=new jee,s=new jee,r=new ta,a=new jee,l=new ta){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=n,this._remoteUserConfiguration=o,this._workspaceConfiguration=s,this._folderConfigurations=r,this._memoryConfiguration=a,this._memoryConfigurationByResource=l,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new ta,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let n;i.resource?(n=this._memoryConfigurationByResource.get(i.resource),n||(n=new jee,this._memoryConfigurationByResource.set(i.resource,n))):n=this._memoryConfiguration,void 0===t?n.removeValue(e):n.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const n=this.getConsolidatedConfigurationModel(e,t,i),o=this.getFolderConfigurationModelForResource(t.resource,i),s=t.resource&&this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration,r=new Set;for(const t of n.overrides)for(const i of t.identifiers)void 0!==n.getOverrideValue(e,i)&&r.add(i);return new $ee(e,t,n.getValue(e),r.size?[...r]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,o||void 0,s)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let n=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(n=n.override(t.overrideIdentifier)),this._policyConfiguration.isEmpty()||void 0===this._policyConfiguration.getValue(e)||(n=n.merge(this._policyConfiguration)),n}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const n=t.getFolder(e);n&&(i=this.getFolderConsolidatedConfiguration(n.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),n=this._folderConfigurations.get(e);n?(t=i.merge(n),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce(((e,t)=>{const{contents:i,overrides:n,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n,keys:o}]),e}),[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),i=this.parseConfigurationModel(e.policy),n=this.parseConfigurationModel(e.application),o=this.parseConfigurationModel(e.user),s=this.parseConfigurationModel(e.workspace),r=e.folders.reduce(((e,t)=>(e.set(Ro.revive(t[0]),this.parseConfigurationModel(t[1])),e)),new ta);return new Gee(t,i,n,o,new jee,s,r,new jee,new ta)}static parseConfigurationModel(e){return new jee(e.contents,e.keys,e.overrides)}}class Zee{constructor(e,t,i,n){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,this._marker="\n",this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const t of e.keys)this.affectedKeys.add(t);for(const[,t]of e.overrides)for(const e of t)this.affectedKeys.add(e);this._affectsConfigStr=this._marker;for(const e of this.affectedKeys)this._affectsConfigStr+=e+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=Gee.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var i;const n=this._marker+e,o=this._affectsConfigStr.indexOf(n);if(o<0)return!1;const s=o+n.length;if(s>=this._affectsConfigStr.length)return!1;const r=this._affectsConfigStr.charCodeAt(s);return(r===this._markerCode1||r===this._markerCode2)&&(!t||!fc(this.previousConfiguration?this.previousConfiguration.getValue(e,t,null===(i=this.previous)||void 0===i?void 0:i.workspace):void 0,this.currentConfiguraiton.getValue(e,t,this.currentWorkspace)))}}const Yee={kind:0},Qee={kind:1};class Xee{constructor(e,t,i){var n;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const t of e){const e=t.command;e&&"-"!==e.charAt(0)&&this._defaultBoundCommands.set(e,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=Xee.handleRemovals([].concat(e).concat(t));for(let e=0,t=this._keybindings.length;e<t;e++){const t=this._keybindings[e];if(0===t.chords.length)continue;const i=null===(n=t.when)||void 0===n?void 0:n.substituteConstants();i&&0===i.type||this._addKeyPress(t.chords[0],t)}}static _isTargetedForRemoval(e,t,i){if(t)for(let i=0;i<t.length;i++)if(t[i]!==e.chords[i])return!1;if(i&&1!==i.type){if(!e.when)return!1;if(!function(e,t){const i=e?e.substituteConstants():void 0,n=t?t.substituteConstants():void 0;return!i&&!n||!(!i||!n)&&i.equals(n)}(i,e.when))return!1}return!0}static handleRemovals(e){const t=new Map;for(let i=0,n=e.length;i<n;i++){const n=e[i];if(n.command&&"-"===n.command.charAt(0)){const e=n.command.substring(1);t.has(e)?t.get(e).push(n):t.set(e,[n])}}if(0===t.size)return e;const i=[];for(let n=0,o=e.length;n<o;n++){const o=e[n];if(!o.command||0===o.command.length){i.push(o);continue}if("-"===o.command.charAt(0))continue;const s=t.get(o.command);if(!s||!o.isDefault){i.push(o);continue}let r=!1;for(const e of s){const t=e.when;if(this._isTargetedForRemoval(o,e.chords,t)){r=!0;break}}r||i.push(o)}return i}_addKeyPress(e,t){const i=this._map.get(e);if(void 0===i)return this._map.set(e,[t]),void this._addToLookupMap(t);for(let e=i.length-1;e>=0;e--){const n=i[e];if(n.command===t.command)continue;let o=!0;for(let e=1;e<n.chords.length&&e<t.chords.length;e++)if(n.chords[e]!==t.chords[e]){o=!1;break}o&&Xee.whenIsEntirelyIncluded(n.when,t.when)&&this._removeFromLookupMap(n)}i.push(t),this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);void 0===t?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(void 0!==t)for(let i=0,n=t.length;i<n;i++)if(t[i]===e)return void t.splice(i,1)}static whenIsEntirelyIncluded(e,t){return!t||1===t.type||!(!e||1===e.type)&&ld(e,t)}getKeybindings(){return this._keybindings}lookupPrimaryKeybinding(e,t){const i=this._lookupMap.get(e);if(void 0===i||0===i.length)return null;if(1===i.length)return i[0];for(let e=i.length-1;e>=0;e--){const n=i[e];if(t.contextMatchesRules(n.when))return n}return i[i.length-1]}resolve(e,t,i){const n=[...t,i];this._log(`| Resolving ${n}`);const o=this._map.get(n[0]);if(void 0===o)return this._log("\\ No keybinding entries."),Yee;let s=null;if(n.length<2)s=o;else{s=[];for(let e=0,t=o.length;e<t;e++){const t=o[e];if(n.length>t.chords.length)continue;let i=!0;for(let e=1;e<n.length;e++)if(t.chords[e]!==n[e]){i=!1;break}i&&s.push(t)}}const r=this._findCommand(e,s);return r?n.length<r.chords.length?(this._log(`\\ From ${s.length} keybinding entries, awaiting ${r.chords.length-n.length} more chord(s), when: ${Jee(r.when)}, source: ${ete(r)}.`),Qee):(this._log(`\\ From ${s.length} keybinding entries, matched ${r.command}, when: ${Jee(r.when)}, source: ${ete(r)}.`),{kind:2,commandId:r.command,commandArgs:r.commandArgs,isBubble:r.bubble}):(this._log(`\\ From ${s.length} keybinding entries, no when clauses matched the context.`),Yee)}_findCommand(e,t){for(let i=t.length-1;i>=0;i--){const n=t[i];if(Xee._contextMatchesRules(e,n.when))return n}return null}static _contextMatchesRules(e,t){return!t||t.evaluate(e)}}function Jee(e){return e?`${e.serialize()}`:"no when condition"}function ete(e){return e.extensionId?e.isBuiltinExtension?`built-in extension ${e.extensionId}`:`user extension ${e.extensionId}`:e.isDefault?"built-in":"user"}const tte=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class ite extends T{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:z.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,n,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=o,this._onDidUpdateKeybindings=this._register(new q),this._currentChords=[],this._currentChordChecker=new Gt,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=nte.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new $t,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),Yee;const[n]=i.getDispatchChords();if(null===n)return this._log("\\ Keyboard event cannot be dispatched"),Yee;const o=this._contextKeyService.getContext(t),s=this._currentChords.map((({keypress:e})=>e));return this._getResolver().resolve(o,s,n)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet((()=>{this._documentHasFocus()?Date.now()-e>5e3&&this._leaveChordMode():this._leaveChordMode()}),500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw f("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(me(0,"({0}) was pressed. Waiting for second key of chord...",t));break;default:{const e=this._currentChords.map((({label:e})=>e)).join(", ");this._currentChordStatusMessage=this._notificationService.status(me(0,"({0}) was pressed. Waiting for next key of chord...",e))}}this._scheduleLeaveChordMode(),GO.enabled&&GO.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],GO.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[n]=i.getSingleModifierDispatchChords();if(n)return this._ignoreSingleModifiers.has(n)?(this._log(`+ Ignoring single modifier ${n} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=nte.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=nte.EMPTY,null===this._currentSingleModifier?(this._log(`+ Storing single modifier for possible chord ${n}.`),this._currentSingleModifier=n,this._currentSingleModifierClearTimeout.cancelAndSet((()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null}),300),!1):n===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${n} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new nte(o),null!==this._currentSingleModifier&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){var n;let o=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let s=null,r=null;if(i){const[t]=e.getSingleModifierDispatchChords();s=t,r=t?[t]:[]}else[s]=e.getDispatchChords(),r=this._currentChords.map((({keypress:e})=>e));if(null===s)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),o;const a=this._contextKeyService.getContext(t),l=e.getLabel(),h=this._getResolver().resolve(a,r,s);switch(h.kind){case 0:if(this._logService.trace("KeybindingService#dispatch",l,"[ No matching keybinding ]"),this.inChordMode){const e=this._currentChords.map((({label:e})=>e)).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${e}, ${l}".`),this._notificationService.status(me(0,"The key combination ({0}, {1}) is not a command.",e,l),{hideAfter:1e4}),this._leaveChordMode(),o=!0}return o;case 1:return this._logService.trace("KeybindingService#dispatch",l,"[ Several keybindings match - more chords needed ]"),o=!0,this._expectAnotherChord(s,l),this._log(1===this._currentChords.length?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),o;case 2:if(this._logService.trace("KeybindingService#dispatch",l,`[ Will dispatch command ${h.commandId} ]`),null===h.commandId||""===h.commandId){if(this.inChordMode){const e=this._currentChords.map((({label:e})=>e)).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${e}, ${l}".`),this._notificationService.status(me(0,"The key combination ({0}, {1}) is not a command.",e,l),{hideAfter:1e4}),this._leaveChordMode(),o=!0}}else this.inChordMode&&this._leaveChordMode(),h.isBubble||(o=!0),this._log(`+ Invoking command ${h.commandId}.`),void 0===h.commandArgs?this._commandService.executeCommand(h.commandId).then(void 0,(e=>this._notificationService.warn(e))):this._commandService.executeCommand(h.commandId,h.commandArgs).then(void 0,(e=>this._notificationService.warn(e))),tte.test(h.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:h.commandId,from:"keybinding",detail:null!==(n=e.getUserSettingsLabel())&&void 0!==n?n:void 0});return o}}mightProducePrintableCharacter(e){return!e.ctrlKey&&!e.metaKey&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30)}}class nte{constructor(e){this._ctrlKey=!!e&&e.ctrlKey,this._shiftKey=!!e&&e.shiftKey,this._altKey=!!e&&e.altKey,this._metaKey=!!e&&e.metaKey}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}nte.EMPTY=new nte(null);class ote{constructor(e,t,i,n,o,s,r){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?ste(e.getDispatchChords()):[],e&&0===this.chords.length&&(this.chords=ste(e.getSingleModifierDispatchChords())),this.bubble=!!t&&94===t.charCodeAt(0),this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=n,this.isDefault=o,this.extensionId=s,this.isBuiltinExtension=r}}function ste(e){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n)return[];t.push(n)}return t}class rte extends kt{constructor(e,t){if(super(),0===t.length)throw m("chords");this._os=e,this._chords=t}getLabel(){return OE.toLabel(this._os,this._chords,(e=>this._getLabel(e)))}getAriaLabel(){return PE.toLabel(this._os,this._chords,(e=>this._getAriaLabel(e)))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:FE.toLabel(this._os,this._chords,(e=>this._getElectronAccelerator(e)))}getUserSettingsLabel(){return BE.toLabel(this._os,this._chords,(e=>this._getUserSettingsLabel(e)))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map((e=>this._getChord(e)))}_getChord(e){return new St(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map((e=>this._getChordDispatch(e)))}getSingleModifierDispatchChords(){return this._chords.map((e=>this._getSingleModifierChordDispatch(e)))}}class ate extends rte{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(2===this._os)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return _t.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":_t.toString(e.keyCode)}_getElectronAccelerator(e){return _t.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=_t.toUserSettingsUS(e.keyCode);return t?t.toLowerCase():t}_getChordDispatch(e){return ate.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=_t.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return 5!==e.keyCode||e.shiftKey||e.altKey||e.metaKey?4!==e.keyCode||e.ctrlKey||e.altKey||e.metaKey?6!==e.keyCode||e.ctrlKey||e.shiftKey||e.metaKey?57!==e.keyCode||e.ctrlKey||e.shiftKey||e.altKey?null:"meta":"alt":"shift":"ctrl"}static _scanCodeToKeyCode(e){const t=mt[e];if(-1!==t)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof Ct)return e;const t=this._scanCodeToKeyCode(e.scanCode);return 0===t?null:new Ct(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=ste(e.chords.map((e=>this._toKeyCodeChord(e))));return i.length>0?[new ate(i,t)]:[]}}var lte,hte=i(6328),dte={};function cte(e,t,i){const n=i.mode===lte.ALIGN?i.offset:i.offset+i.size,o=i.mode===lte.ALIGN?i.offset+i.size:i.offset;return 0===i.position?t<=e-n?n:t<=o?o-t:Math.max(e-t,0):t<=o?o-t:t<=e-n?n:0}dte.styleTagTransform=Vr(),dte.setAttributes=Pr(),dte.insert=Rr().bind(null,"head"),dte.domAPI=Tr(),dte.insertStyleElement=Br(),Ir()(hte.Z,dte),hte.Z&&hte.Z.locals&&hte.Z.locals,function(e){e[e.AVOID=0]="AVOID",e[e.ALIGN=1]="ALIGN"}(lte||(lte={}));class ute extends T{constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=T.None,this.toDisposeOnSetContainer=T.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=mr(".context-view"),_r(this.view),this.setContainer(e,t),this._register(I((()=>this.setContainer(null,1))))}setContainer(e,t){var i;this.useFixedPosition=1!==t;const n=this.useShadowDOM;if(this.useShadowDOM=3===t,(e!==this.container||n===this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,null===(i=this.shadowRootHostElement)||void 0===i||i.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=mr(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=gte,this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(mr("slot"))}else this.container.appendChild(this.view);const t=new M;ute.BUBBLE_UP_EVENTS.forEach((e=>{t.add(Cs(this.container,e,(e=>{this.onDOMEvent(e,!1)})))})),ute.BUBBLE_DOWN_EVENTS.forEach((e=>{t.add(Cs(this.container,e,(e=>{this.onDOMEvent(e,!0)}),!0))})),this.toDisposeOnSetContainer=t}}show(e){var t,i;this.isVisible()&&this.hide(),_s(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2575",this.view.style.position=this.useFixedPosition?"fixed":"absolute",fr(this.view),this.toDisposeOnClean=e.render(this.view)||T.None,this.delegate=e,this.doLayout(),null===(i=(t=this.delegate).focus)||void 0===i||i.call(t)}getViewElement(){return this.view}layout(){this.isVisible()&&(!1!==this.delegate.canRelayout||je&&st?(this.delegate.layout&&this.delegate.layout(),this.doLayout()):this.hide())}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(e instanceof HTMLElement){const i=As(e),n=function(e){let t=e,i=1;do{const e=Es(t).zoom;null!=e&&"1"!==e&&(i*=e),t=t.parentElement}while(null!==t&&t!==t.ownerDocument.documentElement);return i}(e);t={top:i.top*n,left:i.left*n,width:i.width*n,height:i.height*n}}else t=function(e){const t=e;return!!t&&"number"==typeof t.x&&"number"==typeof t.y}(e)?{top:e.y,left:e.x,width:e.width||1,height:e.height||2}:{top:e.posy,left:e.posx,width:2,height:2};const i=Rs(this.view),n=Fs(this.view),o=this.delegate.anchorPosition||0,s=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0;let l,h;const d=function(){var e,t;return null!==(t=null===(e=js().defaultView)||void 0===e?void 0:e.window)&&void 0!==t?t:r}();if(0===a){const e={offset:t.top-d.pageYOffset,size:t.height,position:0===o?0:1},r={offset:t.left,size:t.width,position:0===s?0:1,mode:lte.ALIGN};l=cte(d.innerHeight,n,e)+d.pageYOffset,CD.intersects({start:l,end:l+n},{start:e.offset,end:e.offset+e.size})&&(r.mode=lte.AVOID),h=cte(d.innerWidth,i,r)}else{const e={offset:t.left,size:t.width,position:0===s?0:1},r={offset:t.top,size:t.height,position:0===o?0:1,mode:lte.ALIGN};h=cte(d.innerWidth,i,e),CD.intersects({start:h,end:h+i},{start:e.offset,end:e.offset+e.size})&&(r.mode=lte.AVOID),l=cte(d.innerHeight,n,r)+d.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(0===o?"bottom":"top"),this.view.classList.add(0===s?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const c=As(this.container);this.view.style.top=l-(this.useFixedPosition?As(this.view).top:c.top)+"px",this.view.style.left=h-(this.useFixedPosition?As(this.view).left:c.left)+"px",this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,(null==t?void 0:t.onHide)&&t.onHide(e),this.toDisposeOnClean.dispose(),_r(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,as(e).document.activeElement):t&&!Bs(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}ute.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],ute.BUBBLE_DOWN_EVENTS=["click"];const gte='\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t.codicon[class*=\'codicon-\'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }\n\n\t:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }\n';let pte=class extends T{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=T.None,this.contextView=this._register(new ute(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer((()=>this.layout())))}showContextView(e,t,i){let n;n=t?t===this.layoutService.getContainer(as(t))?1:i?3:2:1,this.contextView.setContainer(null!=t?t:this.layoutService.activeContainer,n),this.contextView.show(e);const o=I((()=>{this.currentViewDisposable===o&&this.hideContextView()}));return this.currentViewDisposable=o,o}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}dispose(){super.dispose(),this.currentViewDisposable.dispose(),this.currentViewDisposable=T.None}};pte=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,Cee)],pte);let mte=[],fte=[],_te=[];function vte(e,t=!1){!function(e,t,i){const n=function(e,t){return{id:e.id,mime:e.mime,filename:e.filename,extension:e.extension,filepattern:e.filepattern,firstline:e.firstline,userConfigured:false,filenameLowercase:e.filename?e.filename.toLowerCase():void 0,extensionLowercase:e.extension?e.extension.toLowerCase():void 0,filepatternLowercase:e.filepattern?k8(e.filepattern.toLowerCase()):void 0,filepatternOnPath:!!e.filepattern&&e.filepattern.indexOf(wo.sep)>=0}}(e);mte.push(n),n.userConfigured?_te.push(n):fte.push(n),i&&!n.userConfigured&&mte.forEach((e=>{e.mime===n.mime||e.userConfigured||(n.extension&&e.extension===n.extension&&console.warn(`Overwriting extension <<${n.extension}>> to now point to mime <<${n.mime}>>`),n.filename&&e.filename===n.filename&&console.warn(`Overwriting filename <<${n.filename}>> to now point to mime <<${n.mime}>>`),n.filepattern&&e.filepattern===n.filepattern&&console.warn(`Overwriting filepattern <<${n.filepattern}>> to now point to mime <<${n.mime}>>`),n.firstline&&e.firstline===n.firstline&&console.warn(`Overwriting firstline <<${n.firstline}>> to now point to mime <<${n.mime}>>`))}))}(e,0,t)}function bte(e,t,i){var n;let o,s,r;for(let a=i.length-1;a>=0;a--){const l=i[a];if(t===l.filenameLowercase){o=l;break}if(l.filepattern&&(!s||l.filepattern.length>s.filepattern.length)){const i=l.filepatternOnPath?e:t;(null===(n=l.filepatternLowercase)||void 0===n?void 0:n.call(l,i))&&(s=l)}l.extension&&(!r||l.extension.length>r.extension.length)&&t.endsWith(l.extensionLowercase)&&(r=l)}return o||s||r||void 0}const wte=Object.prototype.hasOwnProperty,Cte="vs.editor.nullLanguage";class yte{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(Cte,0),this._register(Hg,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||Cte}}class Ste extends T{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new q),this.onDidChange=this._onDidChange.event,Ste.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new yte,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(zg.onDidChangeLanguages((e=>{this._initializeFromRegistry()}))))}dispose(){Ste.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},mte=mte.filter((e=>e.userConfigured)),fte=[];const e=[].concat(zg.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach((e=>{const t=this._languages[e];t.name&&(this._nameMap[t.name]=t.identifier),t.aliases.forEach((e=>{this._lowercaseNameMap[e.toLowerCase()]=t.identifier})),t.mimetypes.forEach((e=>{this._mimeTypesMap[e]=t.identifier}))})),md.as(Lg).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;wte.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let n=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),n=t.mimetypes[0]),n||(n=`text/x-${i}`,e.mimetypes.push(n)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const e of t.extensions)vte({id:i,mime:n,extension:e},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const o of t.filenames)vte({id:i,mime:n,filename:o},this._warnOnOverwrite),e.filenames.push(o);if(Array.isArray(t.filenamePatterns))for(const e of t.filenamePatterns)vte({id:i,mime:n,filepattern:e},this._warnOnOverwrite);if("string"==typeof t.firstLine&&t.firstLine.length>0){let e=t.firstLine;"^"!==e.charAt(0)&&(e="^"+e);try{const t=new RegExp(e);"^"!==(o=t).source&&"^$"!==o.source&&"$"!==o.source&&"^\\s*$"!==o.source&&o.exec("")&&0===o.lastIndex||vte({id:i,mime:n,firstline:t},this._warnOnOverwrite)}catch(i){console.warn(`[${t.id}]: Invalid regular expression \`${e}\`: `,i)}}var o;e.aliases.push(i);let s=null;if(void 0!==t.aliases&&Array.isArray(t.aliases)&&(s=0===t.aliases.length?[null]:t.aliases),null!==s)for(const t of s)t&&0!==t.length&&e.aliases.push(t);const r=null!==s&&s.length>0;if(r&&null===s[0]);else{const t=(r?s[0]:null)||i;!r&&e.name||(e.name=t)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return!!e&&wte.call(this._languages,e)}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return wte.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&wte.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return e||t?function(e,t){return function(e,t){let i;if(e)switch(e.scheme){case jo.file:i=e.fsPath;break;case jo.data:i=Jl.parseMetaData(e).get(Jl.META_DATA_LABEL);break;case jo.vscodeNotebookCell:i=void 0;break;default:i=e.path}if(!i)return[{id:"unknown",mime:yg.unknown}];i=i.toLowerCase();const n=Lo(i),o=bte(i,n,_te);if(o)return[o,{id:Hg,mime:yg.text}];const s=bte(i,n,fte);if(s)return[s,{id:Hg,mime:yg.text}];if(t){const e=function(e){if($n(e)&&(e=e.substr(1)),e.length>0)for(let t=mte.length-1;t>=0;t--){const i=mte[t];if(!i.firstline)continue;const n=e.match(i.firstline);if(n&&n.length>0)return i}}(t);if(e)return[e,{id:Hg,mime:yg.text}]}return[{id:"unknown",mime:yg.unknown}]}(e,t).map((e=>e.id))}(e,t):[]}}Ste.instanceCount=0;class kte extends T{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new q),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new q),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new q({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,kte.instanceCount++,this._registry=this._register(new Ste(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange((()=>this._onDidChange.fire())))}dispose(){kte.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){return zc(this._registry.guessLanguageIdByFilepathOrFirstLine(e,t),null)}createById(e){return new Lte(this.onDidChange,(()=>this._createAndGetLanguageIdentifier(e)))}createByFilepathOrFirstLine(e,t){return new Lte(this.onDidChange,(()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)}))}_createAndGetLanguageIdentifier(e){return e&&this.isRegisteredLanguageId(e)||(e=Hg),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),SC.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}kte.instanceCount=0;class Lte{constructor(e,t){this._onDidChangeLanguages=e,this._selector=t,this._listener=null,this._emitter=null,this.languageId=this._selector()}_dispose(){this._listener&&(this._listener.dispose(),this._listener=null),this._emitter&&(this._emitter.dispose(),this._emitter=null)}get onDidChange(){return this._listener||(this._listener=this._onDidChangeLanguages((()=>this._evaluate()))),this._emitter||(this._emitter=new q({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const t=this._selector();t!==this.languageId&&(this.languageId=t,null===(e=this._emitter)||void 0===e||e.fire(this.languageId))}}const xte=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,Dte=/(&amp;)?(&amp;)([^\s&])/g;var Ete;!function(e){e[e.Right=0]="Right",e[e.Left=1]="Left"}(Ete||(Ete={}));class Nte extends ME{constructor(e,t,i,n){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:1,actionViewItemProvider:e=>this.doGetActionViewItem(e,i,s),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...Ve||ze?[10]:[]],keyDown:!0}}),this.menuStyles=n,this.menuElement=o,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,n),this._register(KL.addTarget(o)),this._register(bs(o,or.KEY_DOWN,(e=>{new Dt(e).equals(2)&&e.preventDefault()}))),i.enableMnemonics&&this._register(bs(o,or.KEY_DOWN,(e=>{const t=e.key.toLocaleLowerCase();if(this.mnemonics.has(t)){rr(e,!0);const i=this.mnemonics.get(t);if(1===i.length&&(i[0]instanceof Mte&&i[0].container&&this.focusItemByElement(i[0].container),i[0].onClick(e)),i.length>1){const e=i.shift();e&&e.container&&(this.focusItemByElement(e.container),i.push(e)),this.mnemonics.set(t,i)}}}))),ze&&this._register(bs(o,or.KEY_DOWN,(e=>{const t=new Dt(e);t.equals(14)||t.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),rr(e,!0)):(t.equals(13)||t.equals(12))&&(this.focusedItem=0,this.focusPrevious(),rr(e,!0))}))),this._register(bs(this.domNode,or.MOUSE_OUT,(e=>{Bs(e.relatedTarget,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),e.stopPropagation())}))),this._register(bs(this.actionsList,or.MOUSE_OVER,(e=>{let t=e.target;if(t&&Bs(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}}))),this._register(KL.addTarget(this.actionsList)),this._register(bs(this.actionsList,UL.Tap,(e=>{let t=e.initialTarget;if(t&&Bs(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}})));const s={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new ND(o,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const r=this.scrollableElement.getDomNode();r.style.position="",this.styleScrollElement(r,n),this._register(bs(o,UL.Change,(e=>{rr(e,!0);const t=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:t-e.translationY})}))),this._register(bs(r,or.MOUSE_UP,(e=>{e.preventDefault()})));const a=as(e);o.style.maxHeight=`${Math.max(10,a.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((e=>{var t;return!(null===(t=i.submenuIds)||void 0===t?void 0:t.has(e.id))||(console.warn(`Found submenu cycle: ${e.id}`),!1)})),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter((e=>!(e instanceof Tte))).forEach(((e,t,i)=>{e.updatePositionInSet(t+1,i.length)}))}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(zs(e)?this.styleSheet=$s(e):(Nte.globalStyleSheet||(Nte.globalStyleSheet=$s()),this.styleSheet=Nte.globalStyleSheet)),this.styleSheet.textContent=function(e,t){let i=`\n.monaco-menu {\n\tfont-size: 13px;\n\tborder-radius: 5px;\n\tmin-width: 160px;\n}\n\n${Ate(Sl.menuSelection)}\n${Ate(Sl.menuSubmenu)}\n\n.monaco-menu .monaco-action-bar {\n\ttext-align: right;\n\toverflow: hidden;\n\twhite-space: nowrap;\n}\n\n.monaco-menu .monaco-action-bar .actions-container {\n\tdisplay: flex;\n\tmargin: 0 auto;\n\tpadding: 0;\n\twidth: 100%;\n\tjustify-content: flex-end;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar.reverse .actions-container {\n\tflex-direction: row-reverse;\n}\n\n.monaco-menu .monaco-action-bar .action-item {\n\tcursor: pointer;\n\tdisplay: inline-block;\n\ttransition: transform 50ms ease;\n\tposition: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled {\n\tcursor: default;\n}\n\n.monaco-menu .monaco-action-bar.animated .action-item.active {\n\ttransform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */\n}\n\n.monaco-menu .monaco-action-bar .action-item .icon,\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar .action-label {\n\tfont-size: 11px;\n\tmargin-right: 4px;\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label,\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {\n\tcolor: var(--vscode-disabledForeground);\n}\n\n/* Vertical actions */\n\n.monaco-menu .monaco-action-bar.vertical {\n\ttext-align: left;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tdisplay: block;\n\tborder-bottom: 1px solid var(--vscode-menu-separatorBackground);\n\tpadding-top: 1px;\n\tpadding: 30px;\n}\n\n.monaco-menu .secondary-actions .monaco-action-bar .action-label {\n\tmargin-left: 6px;\n}\n\n/* Action Items */\n.monaco-menu .monaco-action-bar .action-item.select-container {\n\toverflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n\tflex: 1;\n\tmax-width: 170px;\n\tmin-width: 60px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-right: 10px;\n}\n\n.monaco-menu .monaco-action-bar.vertical {\n\tmargin-left: 0;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tpadding: 0;\n\ttransform: none;\n\tdisplay: flex;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.active {\n\ttransform: none;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\tflex: 1 1 auto;\n\tdisplay: flex;\n\theight: 2em;\n\talign-items: center;\n\tposition: relative;\n\tmargin: 0 4px;\n\tborder-radius: 4px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding {\n\topacity: unset;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label {\n\tflex: 1 1 auto;\n\ttext-decoration: none;\n\tpadding: 0 1em;\n\tbackground: none;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .keybinding,\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tdisplay: inline-block;\n\tflex: 2 1 auto;\n\tpadding: 0 1em;\n\ttext-align: right;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {\n\tfont-size: 16px !important;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {\n\tmargin-left: auto;\n\tmargin-right: -20px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {\n\topacity: 0.4;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n\tmargin: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tposition: static;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {\n\tposition: absolute;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\twidth: 100%;\n\theight: 0px !important;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {\n\tpadding: 0.7em 1em 0.1em 1em;\n\tfont-weight: bold;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:hover {\n\tcolor: inherit;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tposition: absolute;\n\tvisibility: hidden;\n\twidth: 1em;\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {\n\tvisibility: visible;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/* Context Menu */\n\n.context-view.monaco-menu-container {\n\toutline: 0;\n\tborder: none;\n\tanimation: fadeIn 0.083s linear;\n\t-webkit-app-region: no-drag;\n}\n\n.context-view.monaco-menu-container :focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {\n\toutline: 0;\n}\n\n.hc-black .context-view.monaco-menu-container,\n.hc-light .context-view.monaco-menu-container,\n:host-context(.hc-black) .context-view.monaco-menu-container,\n:host-context(.hc-light) .context-view.monaco-menu-container {\n\tbox-shadow: none;\n}\n\n.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused {\n\tbackground: none;\n}\n\n/* Vertical Action Bar Styles */\n\n.monaco-menu .monaco-action-bar.vertical {\n\tpadding: 4px 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\theight: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),\n.monaco-menu .monaco-action-bar.vertical .keybinding {\n\tfont-size: inherit;\n\tpadding: 0 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tfont-size: inherit;\n\twidth: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tfont-size: inherit;\n\tmargin: 5px 0 !important;\n\tpadding: 0;\n\tborder-radius: 0;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tmargin-left: 0;\n\tmargin-right: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tfont-size: 60%;\n\tpadding: 0 1.8em;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator,\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n\tmask-size: 10px 10px;\n\t-webkit-mask-size: 10px 10px;\n}\n\n.monaco-menu .action-item {\n\tcursor: default;\n}`;if(t){i+="\n\t\t\t/* Arrows */\n\t\t\t.monaco-scrollable-element > .scrollbar > .scra {\n\t\t\t\tcursor: pointer;\n\t\t\t\tfont-size: 11px !important;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .visible {\n\t\t\t\topacity: 1;\n\n\t\t\t\t/* Background rule added for IE9 - to allow clicks on dom node */\n\t\t\t\tbackground:rgba(0,0,0,0);\n\n\t\t\t\ttransition: opacity 100ms linear;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible {\n\t\t\t\topacity: 0;\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible.fade {\n\t\t\t\ttransition: opacity 800ms linear;\n\t\t\t}\n\n\t\t\t/* Scrollable Content Inset Shadow */\n\t\t\t.monaco-scrollable-element > .shadow {\n\t\t\t\tposition: absolute;\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 3px;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 3px;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 100%;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top-left-corner {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t";const t=e.scrollbarShadow;t&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\t\tbox-shadow: ${t} 0 6px 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 0 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.top.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 6px 6px -6px inset;\n\t\t\t\t}\n\t\t\t`);const n=e.scrollbarSliderBackground;n&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider {\n\t\t\t\t\tbackground: ${n};\n\t\t\t\t}\n\t\t\t`);const o=e.scrollbarSliderHoverBackground;o&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider:hover {\n\t\t\t\t\tbackground: ${o};\n\t\t\t\t}\n\t\t\t`);const s=e.scrollbarSliderActiveBackground;s&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider.active {\n\t\t\t\t\tbackground: ${s};\n\t\t\t\t}\n\t\t\t`)}return i}(t,zs(e))}styleScrollElement(e,t){var i,n;const o=null!==(i=t.foregroundColor)&&void 0!==i?i:"",s=null!==(n=t.backgroundColor)&&void 0!==n?n:"",r=t.borderColor?`1px solid ${t.borderColor}`:"",a=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=r,e.style.borderRadius="5px",e.style.color=o,e.style.backgroundColor=s,e.style.boxShadow=a}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t<this.actionsList.children.length;t++)if(e===this.actionsList.children[t]){this.focusedItem=t;break}}updateFocus(e){super.updateFocus(e,!0,!0),void 0!==this.focusedItem&&this.scrollableElement.setScrollPosition({scrollTop:Math.round(this.menuElement.scrollTop)})}doGetActionViewItem(e,t,i){if(e instanceof fh)return new Tte(t.context,e,{icon:!0},this.menuStyles);if(e instanceof _h){const n=new Mte(e,e.actions,i,{...t,submenuIds:new Set([...t.submenuIds||[],e.id])},this.menuStyles);if(t.enableMnemonics){const e=n.getMnemonic();if(e&&n.isEnabled()){let t=[];this.mnemonics.has(e)&&(t=this.mnemonics.get(e)),t.push(n),this.mnemonics.set(e,t)}}return n}{const i={enableMnemonics:t.enableMnemonics,useEventAsContext:t.useEventAsContext};if(t.getKeyBinding){const n=t.getKeyBinding(e);if(n){const e=n.getLabel();e&&(i.keybinding=e)}}const n=new Ite(t.context,e,i,this.menuStyles);if(t.enableMnemonics){const e=n.getMnemonic();if(e&&n.isEnabled()){let t=[];this.mnemonics.has(e)&&(t=this.mnemonics.get(e)),t.push(n),this.mnemonics.set(e,t)}}return n}}}class Ite extends EE{constructor(e,t,i,n){if(i.isMenu=!0,super(t,t,i),this.menuStyle=n,this.options=i,this.options.icon=void 0!==i.icon&&i.icon,this.options.label=void 0===i.label||i.label,this.cssClass="",this.options.label&&i.enableMnemonics){const e=this.action.label;if(e){const t=xte.exec(e);t&&(this.mnemonic=(t[1]?t[1]:t[3]).toLocaleLowerCase())}}this.runOnceToEnableMouseUp=new Zt((()=>{this.element&&(this._register(bs(this.element,or.MOUSE_UP,(e=>{if(rr(e,!0),re){if(new Mt(as(this.element),e).rightButton)return;this.onClick(e)}else setTimeout((()=>{this.onClick(e)}),0)}))),this._register(bs(this.element,or.CONTEXT_MENU,(e=>{rr(e,!0)}))))}),100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=hr(this.element,mr("a.action-menu-item")),this._action.id===fh.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=hr(this.item,mr("span.menu-item-check"+Ll.asCSSSelector(Sl.menuSelection))),this.check.setAttribute("role","none"),this.label=hr(this.item,mr("span.action-label")),this.options.label&&this.options.keybinding&&(hr(this.item,mr("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),null===(e=this.item)||void 0===e||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(this.label&&this.options.label){_s(this.label);let t=Il(this.action.label);if(t){const i=function(e){const t=xte,i=t.exec(e);if(!i)return e;const n=!i[1];return e.replace(t,n?"$2$3":"").trim()}(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const n=xte.exec(t);if(n){t=hn(t),Dte.lastIndex=0;let i=Dte.exec(t);for(;i&&i[1];)i=Dte.exec(t);const o=e=>e.replace(/&amp;&amp;/g,"&amp;");i?this.label.append(un(o(t.substr(0,i.index))," "),mr("u",{"aria-hidden":"true"},i[3]),gn(o(t.substr(i.index+i[0].length))," ")):this.label.innerText=o(t).trim(),null===(e=this.item)||void 0===e||e.setAttribute("aria-keyshortcuts",(n[1]?n[1]:n[3]).toLocaleLowerCase())}else this.label.innerText=t.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),void 0!==e?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,n=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=null!=t?t:"",this.item.style.backgroundColor=null!=i?i:"",this.item.style.outline=n,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=null!=t?t:"")}}class Mte extends Ite{constructor(e,t,i,n,o){super(e,e,n,o),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new M),this.mouseOver=!1,this.expandDirection=n&&void 0!==n.expandDirection?n.expandDirection:Ete.Right,this.showScheduler=new Zt((()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))}),250),this.hideScheduler=new Zt((()=>{this.element&&!Bs(Us(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))}),750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=hr(this.item,mr("span.submenu-indicator"+Ll.asCSSSelector(Sl.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(bs(this.element,or.KEY_UP,(e=>{const t=new Dt(e);(t.equals(17)||t.equals(3))&&(rr(e,!0),this.createSubmenu(!0))}))),this._register(bs(this.element,or.KEY_DOWN,(e=>{const t=new Dt(e);Us()===this.item&&(t.equals(17)||t.equals(3))&&rr(e,!0)}))),this._register(bs(this.element,or.MOUSE_OVER,(e=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())}))),this._register(bs(this.element,or.MOUSE_LEAVE,(e=>{this.mouseOver=!1}))),this._register(bs(this.element,or.FOCUS_OUT,(e=>{this.element&&!Bs(Us(),this.element)&&this.hideScheduler.schedule()}))),this._register(this.parentData.parent.onScroll((()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))}))))}updateEnabled(){}onClick(e){rr(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch(e){}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,n){const o={top:0,left:0};return o.left=cte(e.width,t.width,{position:n===Ete.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left<i.left+i.width&&(i.left+10+t.width<=e.width&&(o.left=i.left+10),i.top+=10,i.height=0),o.top=cte(e.height,t.height,{position:0,offset:i.top,size:0}),o.top+t.height===i.top&&o.top+i.height+t.height<=e.height&&(o.top+=i.height),o}createSubmenu(e=!0){if(this.element)if(this.parentData.submenu)this.parentData.submenu.focus(!1);else{this.updateAriaExpanded("true"),this.submenuContainer=hr(this.element,mr("div.monaco-submenu")),this.submenuContainer.classList.add("menubar-menu-items-holder","context-view");const t=as(this.parentData.parent.domNode).getComputedStyle(this.parentData.parent.domNode),i=parseFloat(t.paddingTop||"0")||0;this.submenuContainer.style.zIndex="1",this.submenuContainer.style.position="fixed",this.submenuContainer.style.top="0",this.submenuContainer.style.left="0",this.parentData.submenu=new Nte(this.submenuContainer,this.submenuActions.length?this.submenuActions:[new vh],this.submenuOptions,this.menuStyle);const n=this.element.getBoundingClientRect(),o={top:n.top-i,left:n.left,height:n.height+2*i,width:n.width},s=this.submenuContainer.getBoundingClientRect(),r=as(this.element),{top:a,left:l}=this.calculateSubmenuMenuLayout(new Ms(r.innerWidth,r.innerHeight),Ms.lift(s),o,this.expandDirection);this.submenuContainer.style.left=l-s.left+"px",this.submenuContainer.style.top=a-s.top+"px",this.submenuDisposables.add(bs(this.submenuContainer,or.KEY_UP,(e=>{new Dt(e).equals(15)&&(rr(e,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))}))),this.submenuDisposables.add(bs(this.submenuContainer,or.KEY_DOWN,(e=>{new Dt(e).equals(15)&&rr(e,!0)}))),this.submenuDisposables.add(this.parentData.submenu.onDidCancel((()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)}))),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&(null===(t=this.item)||void 0===t||t.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();const e=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=null!=e?e:"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class Tte extends NE{constructor(e,t,i,n){super(e,t,i),this.menuStyles=n}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function Ate(e){const t=yl()[e.id];return`.codicon-${e.id}:before { content: '\\${t.toString(16)}'; }`}class Rte{constructor(e,t,i,n){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;let i;this.focusToReturn=Us();const n=e.domForShadowRoot instanceof HTMLElement?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:n=>{var o;this.lastContainer=n;const s=e.getMenuClassName?e.getMenuClassName():"";s&&(n.className+=" "+s),this.options.blockMouse&&(this.block=n.appendChild(mr(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",null===(o=this.blockDisposable)||void 0===o||o.dispose(),this.blockDisposable=bs(this.block,or.MOUSE_DOWN,(e=>e.stopPropagation())));const r=new M,a=e.actionRunner||new mh;a.onWillRun((t=>this.onActionRun(t,!e.skipTelemetry)),this,r),a.onDidRun(this.onDidActionRun,this,r),i=new Nte(n,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:a,getKeyBinding:e.getKeyBinding?e.getKeyBinding:e=>this.keybindingService.lookupKeybinding(e.id)},sN),i.onDidCancel((()=>this.contextViewService.hideContextView(!0)),null,r),i.onDidBlur((()=>this.contextViewService.hideContextView(!0)),null,r);const l=as(n);return r.add(bs(l,or.BLUR,(()=>this.contextViewService.hideContextView(!0)))),r.add(bs(l,or.MOUSE_DOWN,(e=>{if(e.defaultPrevented)return;const t=new Mt(l,e);let i=t.target;if(!t.rightButton){for(;i;){if(i===n)return;i=i.parentElement}this.contextViewService.hideContextView(!0)}}))),N(r,i)},focus:()=>{null==i||i.focus(!!e.autoSelectFirstItem)},onHide:t=>{var i,n,o;null===(i=e.onHide)||void 0===i||i.call(e,!!t),this.block&&(this.block.remove(),this.block=null),null===(n=this.blockDisposable)||void 0===n||n.dispose(),this.blockDisposable=null,this.lastContainer&&(Us()===this.lastContainer||Bs(Us(),this.lastContainer))&&(null===(o=this.focusToReturn)||void 0===o||o.focus()),this.lastContainer=null}},n,!!n)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!g(e.error)&&this.notificationService.error(e.error)}}var Ote=function(e,t){return function(i,n){t(i,n,e)}};let Pte=class extends T{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new Rte(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,o,s){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=o,this.contextKeyService=s,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new q),this._onDidHideContextMenu=this._store.add(new q)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=Fte.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{var i;null===(i=e.onHide)||void 0===i||i.call(e,t),this._onDidHideContextMenu.fire()}}),kr.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};var Fte,Bte;Pte=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Ote(0,Id),Ote(1,hL),Ote(2,jE),Ote(3,ML),Ote(4,Sd),Ote(5,sd)],Pte),function(e){e.transform=function(e,t,i){if(!((n=e)&&n.menuId instanceof yd))return e;var n;const{menuId:o,menuActionOptions:s,contextKeyService:r}=e;return{...e,getActions:()=>{const n=[];if(o){const e=t.createMenu(o,null!=r?r:i);!function(e,t,i,n){const o=e.getActions(t),s=kr.getInstance();$V(o,i,s.keyStatus.altKey||(We||ze)&&s.keyStatus.shiftKey,(e=>"navigation"===e))}(e,s,n),e.dispose()}return e.getActions?fh.join(e.getActions(),n):n}}}}(Fte||(Fte={})),function(e){e[e.API=0]="API",e[e.USER=1]="USER"}(Bte||(Bte={}));var Wte=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Vte=function(e,t){return function(i,n){t(i,n,e)}};let zte=class{constructor(e){this._commandService=e}async open(e,t){if(!qo(e,jo.command))return!1;if(!(null==t?void 0:t.allowCommands))return!0;if("string"==typeof e&&(e=Ro.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path))return!0;let i=[];try{i=hx(decodeURIComponent(e.query))}catch(t){try{i=hx(e.query)}catch(e){}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};zte=Wte([Vte(0,wh)],zte);let Hte=class{constructor(e){this._editorService=e}async open(e,t){"string"==typeof e&&(e=Ro.parse(e));const{selection:i,uri:n}=function(e){let t;const i=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(e.fragment);return i&&(t={startLineNumber:parseInt(i[1]),startColumn:i[2]?parseInt(i[2]):1,endLineNumber:i[4]?parseInt(i[4]):void 0,endColumn:i[4]?i[5]?parseInt(i[5]):1:void 0},e=e.with({fragment:""})),{selection:t,uri:e}}(e);return(e=n).scheme===jo.file&&(e=Gl(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:(null==t?void 0:t.fromUserGesture)?Bte.USER:Bte.API,...null==t?void 0:t.editorOptions}},this._editorService.getFocusedCodeEditor(),null==t?void 0:t.openToSide),!0}};Hte=Wte([Vte(0,dh)],Hte);let Ute=class{constructor(e,t){this._openers=new B,this._validators=new B,this._resolvers=new B,this._resolvedUriTargets=new ta((e=>e.with({path:null,fragment:null,query:null}).toString())),this._externalOpeners=new B,this._defaultExternalOpener={openExternal:async e=>($o(e,jo.http,jo.https)?br(e):r.location.href=e,!0)},this._openers.push({open:async(e,t)=>!(!(null==t?void 0:t.openExternal)&&!$o(e,jo.mailto,jo.http,jo.https,jo.vsls)||(await this._doOpenExternal(e,t),0))}),this._openers.push(new zte(t)),this._openers.push(new Hte(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}async open(e,t){var i;const n="string"==typeof e?Ro.parse(e):e,o=null!==(i=this._resolvedUriTargets.get(n))&&void 0!==i?i:e;for(const e of this._validators)if(!await e.shouldOpen(o,t))return!1;for(const i of this._openers)if(await i.open(e,t))return!0;return!1}async resolveExternalUri(e,t){for(const i of this._resolvers)try{const n=await i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}catch(e){}throw new Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){const i="string"==typeof e?Ro.parse(e):e;let n,o;try{n=(await this.resolveExternalUri(i,t)).resolved}catch(e){n=i}if(o="string"==typeof e&&i.toString()===n.toString()?e:encodeURI(n.toString(!0)),null==t?void 0:t.allowContributedOpeners){const e="string"==typeof(null==t?void 0:t.allowContributedOpeners)?null==t?void 0:t.allowContributedOpeners:void 0;for(const t of this._externalOpeners)if(await t.openExternal(o,{sourceUri:i,preferredOpenerId:e},Rt.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},Rt.None)}dispose(){this._validators.clear()}};Ute=Wte([Vte(0,dh),Vte(1,wh)],Ute);var Kte=function(e,t){return function(i,n){t(i,n,e)}};let jte=class extends T{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new q),this._markerDecorations=new ta,e.getModels().forEach((e=>this._onModelAdded(e))),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach((e=>e.dispose())),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach((e=>{const t=this._markerDecorations.get(e);t&&this._updateDecorations(t)}))}_onModelAdded(e){const t=new qte(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const i=this._markerDecorations.get(e.uri);i&&(i.dispose(),this._markerDecorations.delete(e.uri)),e.uri.scheme!==jo.inMemory&&e.uri.scheme!==jo.internal&&e.uri.scheme!==jo.vscode||null===(t=this._markerService)||void 0===t||t.read({resource:e.uri}).map((e=>e.owner)).forEach((t=>this._markerService.remove(t,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};jte=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Kte(0,uh),Kte(1,kN)],jte);class qte extends T{constructor(e){super(),this.model=e,this._map=new oa,this._register(I((()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()})))}update(e){const{added:t,removed:i}=function(e,t){const i=[],n=[];for(const n of e)t.has(n)||i.push(n);for(const i of t)e.has(i)||n.push(i);return{removed:i,added:n}}(new Set(this._map.keys()),new Set(e));if(0===t.length&&0===i.length)return!1;const n=i.map((e=>this._map.get(e))),o=t.map((e=>({range:this._createDecorationRange(this.model,e),options:this._createDecorationOption(e)}))),s=this.model.deltaDecorations(n,o);for(const e of i)this._map.delete(e);for(let e=0;e<s.length;e++)this._map.set(t[e],s[e]);return!0}getMarker(e){return this._map.getKey(e.id)}_createDecorationRange(e,t){let i=tc.lift(t);if(t.severity!==yN.Hint||this._hasMarkerTag(t,1)||this._hasMarkerTag(t,2)||(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),i=e.validateRange(i),i.isEmpty()){const t=e.getLineLastNonWhitespaceColumn(i.startLineNumber)||e.getLineMaxColumn(i.startLineNumber);if(1===t||i.endColumn>=t)return i;const n=e.getWordAtPosition(i.getStartPosition());n&&(i=new tc(i.startLineNumber,n.startColumn,i.endLineNumber,n.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&1===t.startColumn&&i.startLineNumber===i.endLineNumber){const n=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);n<i.endColumn&&(i=new tc(i.startLineNumber,n,i.endLineNumber,i.endColumn),t.startColumn=n)}return i}_createDecorationOption(e){let t,i,n,o,s;switch(e.severity){case yN.Hint:t=this._hasMarkerTag(e,2)?void 0:this._hasMarkerTag(e,1)?"squiggly-unnecessary":"squiggly-hint",n=0;break;case yN.Info:t="squiggly-info",i=Av(pb),n=10,s={color:Av(uv),position:wc.Inline};break;case yN.Warning:t="squiggly-warning",i=Av(gb),n=20,s={color:Av(gv),position:wc.Inline};break;case yN.Error:default:t="squiggly-error",i=Av(ub),n=30,s={color:Av(pv),position:wc.Inline}}return e.tags&&(-1!==e.tags.indexOf(1)&&(o="squiggly-inline-unnecessary"),-1!==e.tags.indexOf(2)&&(o="squiggly-inline-deprecated")),{description:"marker-decoration",stickiness:1,className:t,showIfCollapsed:!0,overviewRuler:{color:i,position:vc.Right},minimap:s,zIndex:n,inlineClassName:o}}_hasMarkerTag(e,t){return!!e.tags&&e.tags.indexOf(t)>=0}}var $te,Gte=function(e,t){return function(i,n){t(i,n,e)}};function Zte(e){return e.toString()}class Yte{constructor(e,t,i){this.model=e,this._modelEventListeners=new M,this.model=e,this._modelEventListeners.add(e.onWillDispose((()=>t(e)))),this._modelEventListeners.add(e.onDidChangeLanguage((t=>i(e,t))))}dispose(){this._modelEventListeners.dispose()}}const Qte=ze||Ve?1:2;class Xte{constructor(e,t,i,n,o,s,r,a){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=o,this.sha1=s,this.versionId=r,this.alternativeVersionId=a}}let Jte=$te=class extends T{constructor(e,t,i,n,o){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._languageService=n,this._languageConfigurationService=o,this._onModelAdded=this._register(new q),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new q),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new q),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration((e=>this._updateModelOptions(e)))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var i;let n=Cu.tabSize;if(e.editor&&void 0!==e.editor.tabSize){const t=parseInt(e.editor.tabSize,10);isNaN(t)||(n=t),n<1&&(n=1)}let o="tabSize";if(e.editor&&void 0!==e.editor.indentSize&&"tabSize"!==e.editor.indentSize){const t=parseInt(e.editor.indentSize,10);isNaN(t)||(o=Math.max(t,1))}let s=Cu.insertSpaces;e.editor&&void 0!==e.editor.insertSpaces&&(s="false"!==e.editor.insertSpaces&&Boolean(e.editor.insertSpaces));let r=Qte;const a=e.eol;"\r\n"===a?r=2:"\n"===a&&(r=1);let l=Cu.trimAutoWhitespace;e.editor&&void 0!==e.editor.trimAutoWhitespace&&(l="false"!==e.editor.trimAutoWhitespace&&Boolean(e.editor.trimAutoWhitespace));let h=Cu.detectIndentation;e.editor&&void 0!==e.editor.detectIndentation&&(h="false"!==e.editor.detectIndentation&&Boolean(e.editor.detectIndentation));let d=Cu.largeFileOptimizations;e.editor&&void 0!==e.editor.largeFileOptimizations&&(d="false"!==e.editor.largeFileOptimizations&&Boolean(e.editor.largeFileOptimizations));let c=Cu.bracketPairColorizationOptions;return(null===(i=e.editor)||void 0===i?void 0:i.bracketPairColorization)&&"object"==typeof e.editor.bracketPairColorization&&(c={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:n,indentSize:o,insertSpaces:s,detectIndentation:h,defaultEOL:r,trimAutoWhitespace:l,largeFileOptimizations:d,bracketPairColorizationOptions:c}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&"string"==typeof i&&"auto"!==i?i:3===Qe||2===Qe?"\n":"\r\n"}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return"boolean"!=typeof e||e}getCreationOptions(e,t,i){const n="string"==typeof e?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[n+t];if(!o){const e=this._configurationService.getValue("editor",{overrideIdentifier:n,resource:t}),s=this._getEOL(t,n);o=$te._readModelOptions({editor:e,eol:s},i),this._modelCreationOptionsByLanguageAndResource[n+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,o=i.length;n<o;n++){const o=i[n],s=this._models[o],r=s.model.getLanguageId(),a=s.model.uri;if(e&&!e.affectsConfiguration("editor",{overrideIdentifier:r,resource:a})&&!e.affectsConfiguration("files.eol",{overrideIdentifier:r,resource:a}))continue;const l=t[r+a],h=this.getCreationOptions(r,a,s.model.isForSimpleWidget);$te._setModelOptionsForModel(s.model,h,l)}}static _setModelOptionsForModel(e,t,i){i&&i.defaultEOL!==t.defaultEOL&&1===e.getLineCount()&&e.setEOL(1===t.defaultEOL?0:1),i&&i.detectIndentation===t.detectIndentation&&i.insertSpaces===t.insertSpaces&&i.tabSize===t.tabSize&&i.indentSize===t.indentSize&&i.trimAutoWhitespace===t.trimAutoWhitespace&&fc(i.bracketPairColorizationOptions,t.bracketPairColorizationOptions)||(t.detectIndentation?(e.detectIndentation(t.insertSpaces,t.tabSize),e.updateOptions({trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions})):e.updateOptions({insertSpaces:t.insertSpaces,tabSize:t.tabSize,indentSize:t.indentSize,trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions}))}_insertDisposedModel(e){this._disposedModels.set(Zte(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(Zte(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(Zte(e)),t}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){const t=[];for(this._disposedModels.forEach((e=>{e.sharesUndoRedoStack||t.push(e)})),t.sort(((e,t)=>e.time-t.time));t.length>0&&this._disposedModelsHeapSize>e;){const e=t.shift();this._removeDisposedModel(e.uri),null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){const o=this.getCreationOptions(t,i,n),s=new gy(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(Zte(i))){const e=this._removeDisposedModel(i),t=this._undoRedoService.getElements(i),n=this._getSHA1Computer(),o=!!n.canComputeSHA1(s)&&n.computeSHA1(s)===e.sha1;if(o||e.sharesUndoRedoStack){for(const e of t.past)Kb(e)&&e.matchesResource(i)&&e.setModel(s);for(const e of t.future)Kb(e)&&e.matchesResource(i)&&e.setModel(s);this._undoRedoService.setElementsValidFlag(i,!0,(e=>Kb(e)&&e.matchesResource(i))),o&&(s._overwriteVersionId(e.versionId),s._overwriteAlternativeVersionId(e.alternativeVersionId),s._overwriteInitialUndoRedoSnapshot(e.initialUndoRedoSnapshot))}else null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}const r=Zte(s.uri);if(this._models[r])throw new Error("ModelService: Cannot add model because it already exists!");const a=new Yte(s,(e=>this._onWillDispose(e)),((e,t)=>this._onDidChangeLanguage(e,t)));return this._models[r]=a,a}createModel(e,t,i,n=!1){let o;return o=t?this._createModelData(e,t,i,n):this._createModelData(e,Hg,i,n),this._onModelAdded.fire(o.model),o.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push(this._models[n].model)}return e}getModel(e){const t=Zte(e),i=this._models[t];return i?i.model:null}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===jo.file||e.scheme===jo.vscodeRemote||e.scheme===jo.vscodeUserData||e.scheme===jo.vscodeNotebookCell||"fake-fs"===e.scheme}_onWillDispose(e){const t=Zte(e.uri),i=this._models[t],n=this._undoRedoService.getUriComparisonKey(e.uri)!==e.uri.toString();let o=!1,s=0;if(n||this._shouldRestoreUndoStack()&&this._schemaShouldMaintainUndoRedoElements(e.uri)){const t=this._undoRedoService.getElements(e.uri);if(t.past.length>0||t.future.length>0){for(const i of t.past)Kb(i)&&i.matchesResource(e.uri)&&(o=!0,s+=i.heapSize(e.uri),i.setModel(e.uri));for(const i of t.future)Kb(i)&&i.matchesResource(e.uri)&&(o=!0,s+=i.heapSize(e.uri),i.setModel(e.uri))}}const r=$te.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,a=this._getSHA1Computer();if(o)if(n||!(s>r)&&a.canComputeSHA1(e))this._ensureDisposedModelsHeapSize(r-s),this._undoRedoService.setElementsValidFlag(e.uri,!1,(t=>Kb(t)&&t.matchesResource(e.uri))),this._insertDisposedModel(new Xte(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),n,s,a.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else{const e=i.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}else if(!n){const e=i.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,n=e.getLanguageId(),o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),s=this.getCreationOptions(n,e.uri,e.isForSimpleWidget);$te._setModelOptionsForModel(e,s,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new eie}};Jte.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20971520,Jte=$te=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Gte(0,ug),Gte(1,GT),Gte(2,ny),Gte(3,yu),Gte(4,Yg)],Jte);class eie{canComputeSHA1(e){return e.getValueLength()<=eie.MAX_MODEL_SIZE}computeSHA1(e){const t=new ss,i=e.createSnapshot();let n;for(;n=i.read();)t.update(n);return t.digest()}}eie.MAX_MODEL_SIZE=10485760;var tie=i(3198),iie={};iie.styleTagTransform=Vr(),iie.setAttributes=Pr(),iie.insert=Rr().bind(null,"head"),iie.domAPI=Tr(),iie.insertStyleElement=Br(),Ir()(tie.Z,iie),tie.Z&&tie.Z.locals&&tie.Z.locals;var nie=function(e,t){return function(i,n){t(i,n,e)}};let oie=class extends T{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=md.as(R0),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){var n;const[o,s]=this.getOrInstantiateProvider(e),r=this.visibleQuickAccess,a=null==r?void 0:r.descriptor;if(r&&s&&a===s)return e===s.prefix||(null==i?void 0:i.preserveValue)||(r.picker.value=e),void this.adjustValueSelection(r.picker,s,i);if(s&&!(null==i?void 0:i.preserveValue)){let t;if(r&&a&&a!==s){const e=r.value.substr(a.prefix.length);e&&(t=`${s.prefix}${e}`)}if(!t){const e=null==o?void 0:o.defaultFilterValue;e===A0.LAST?t=this.lastAcceptedPickerValues.get(s):"string"==typeof e&&(t=`${s.prefix}${e}`)}"string"==typeof t&&(e=t)}const l=new M,h=l.add(this.quickInputService.createQuickPick());let d;h.value=e,this.adjustValueSelection(h,s,i),h.placeholder=null==s?void 0:s.placeholder,h.quickNavigate=null==i?void 0:i.quickNavigateConfiguration,h.hideInput=!!h.quickNavigate&&!r,("number"==typeof(null==i?void 0:i.itemActivation)||(null==i?void 0:i.quickNavigateConfiguration))&&(h.itemActivation=null!==(n=null==i?void 0:i.itemActivation)&&void 0!==n?n:sI.SECOND),h.contextKey=null==s?void 0:s.contextKey,h.filterValue=e=>e.substring(s?s.prefix.length:0),t&&(d=new ei,l.add(z.once(h.onWillAccept)((e=>{e.veto(),h.hide()})))),l.add(this.registerPickerListeners(h,o,s,e,null==i?void 0:i.providerOptions));const c=l.add(new Pt);return o&&l.add(o.provide(h,c.token,null==i?void 0:i.providerOptions)),z.once(h.onDidHide)((()=>{0===h.selectedItems.length&&c.cancel(),l.dispose(),null==d||d.complete(h.selectedItems.slice(0))})),h.show(),t?null==d?void 0:d.p:void 0}adjustValueSelection(e,t,i){var n;let o;o=(null==i?void 0:i.preserveValue)?[e.value.length,e.value.length]:[null!==(n=null==t?void 0:t.prefix.length)&&void 0!==n?n:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,i,n,o){const s=new M,r=this.visibleQuickAccess={picker:e,descriptor:i,value:n};return s.add(I((()=>{r===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)}))),s.add(e.onDidChangeValue((e=>{const[i]=this.getOrInstantiateProvider(e);i!==t?this.show(e,{preserveValue:!0,providerOptions:o}):r.value=e}))),i&&s.add(e.onDidAccept((()=>{this.lastAcceptedPickerValues.set(i,e.value)}))),s}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let i=this.mapProviderToDescriptor.get(t);return i||(i=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,i)),[i,t]}};oie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([nie(0,rI),nie(1,lh)],oie);var sie=i(4185),rie={};rie.styleTagTransform=Vr(),rie.setAttributes=Pr(),rie.insert=Rr().bind(null,"head"),rie.domAPI=Tr(),rie.insertStyleElement=Br(),Ir()(sie.Z,rie),sie.Z&&sie.Z.locals&&sie.Z.locals;const aie="done",lie="active",hie="infinite",die="infinite-long-running",cie="discrete";class uie extends T{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new Zt((()=>fr(this.element)),0)),this.longRunningScheduler=this._register(new Zt((()=>this.infiniteLongRunning()),uie.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=(null==t?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(lie,hie,die,cie),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(aie),this.element.classList.contains(hie)?(this.bit.style.opacity="0",e?setTimeout((()=>this.off()),200):this.off()):(this.bit.style.width="inherit",e?setTimeout((()=>this.off()),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(cie,aie,die),this.element.classList.add(lie,hie),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(die)}getContainer(){return this.element}}uie.LONG_RUNNING_INFINITE_THRESHOLD=1e4;var gie=i(1961),pie={};pie.styleTagTransform=Vr(),pie.setAttributes=Pr(),pie.insert=Rr().bind(null,"head"),pie.domAPI=Tr(),pie.insertStyleElement=Br(),Ir()(gie.Z,pie),gie.Z&&gie.Z.locals&&gie.Z.locals;const mie=mr;class fie extends T{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=e=>Cs(this.findInput.inputBox.inputElement,or.KEY_DOWN,e),this.onMouseDown=e=>Cs(this.findInput.inputBox.inputElement,or.MOUSE_DOWN,e),this.onDidChange=e=>this.findInput.onDidChange(e),this.container=hr(this.parent,mie(".quick-input-box")),this.findInput=this._register(new Qz(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const n=this.findInput.inputBox.inputElement;n.role="combobox",n.ariaHasPopup="menu",n.ariaAutoComplete="list",n.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return"password"===this.findInput.inputBox.inputElement.type}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}showDecoration(e){e===aL.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===aL.Info?1:e===aL.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===aL.Info?1:e===aL.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}const _ie=new on((()=>{const e=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:e,collatorIsNumeric:e.resolvedOptions().numeric}}));new on((()=>({collator:new Intl.Collator(void 0,{numeric:!0})}))),new on((()=>({collator:new Intl.Collator(void 0,{numeric:!0,sensitivity:"accent"})})));class vie{constructor(e){this.nodes=e}toString(){return this.nodes.map((e=>"string"==typeof e?e:e.label)).join("")}}!function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);s>3&&r&&Object.defineProperty(t,i,r)}([HL],vie.prototype,"toString",null);const bie=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi,wie={},Cie=new sx("quick-input-button-icon-");function yie(e){if(!e)return;let t;const i=e.dark.toString();return wie[i]?t=wie[i]:(t=Cie.nextId(),Js(`.${t}, .hc-light .${t}`,`background-image: ${wr(e.light||e.dark)}`),Js(`.vs-dark .${t}, .hc-black .${t}`,`background-image: ${wr(e.dark)}`),wie[i]=t),t}var Sie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};const kie=mr;class Lie{constructor(e,t,i,n,o,s,r){var a,l,h;this._checked=!1,this._hidden=!1,this.hasCheckbox=n,this.index=i,this.fireButtonTriggered=o,this.fireSeparatorButtonTriggered=s,this._onChecked=r,this.onChecked=n?z.map(z.filter(this._onChecked.event,(e=>e.listElement===this)),(e=>e.checked)):z.None,"separator"===e.type?this._separator=e:(this.item=e,t&&"separator"===t.type&&!t.buttons&&(this._separator=t),this.saneDescription=this.item.description,this.saneDetail=this.item.detail,this._labelHighlights=null===(a=this.item.highlights)||void 0===a?void 0:a.label,this._descriptionHighlights=null===(l=this.item.highlights)||void 0===l?void 0:l.description,this._detailHighlights=null===(h=this.item.highlights)||void 0===h?void 0:h.detail,this.saneTooltip=this.item.tooltip),this._init=new on((()=>{var t;const i=null!==(t=e.label)&&void 0!==t?t:"",n=Tl(i).text.trim(),o=e.ariaLabel||[i,this.saneDescription,this.saneDetail].map((e=>{return(t=e)?t.replace(/\$\((.*?)\)/g,((e,t)=>` ${t} `)).trim():"";var t})).filter((e=>!!e)).join(", ");return{saneLabel:i,saneSortLabel:n,saneAriaLabel:o}}))}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({listElement:this,checked:e}))}get separator(){return this._separator}set separator(e){this._separator=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class xie{constructor(e){this.themeService=e}get templateId(){return xie.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=hr(e,kie(".quick-input-list-entry"));const i=hr(t.entry,kie("label.quick-input-list-label"));t.toDisposeTemplate.push(Cs(i,or.CLICK,(e=>{t.checkbox.offsetParent||e.preventDefault()}))),t.checkbox=hr(i,kie("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(Cs(t.checkbox,or.CHANGE,(e=>{t.element.checked=t.checkbox.checked})));const n=hr(i,kie(".quick-input-list-rows")),o=hr(n,kie(".quick-input-list-row")),s=hr(n,kie(".quick-input-list-row"));t.label=new DK(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.label),t.icon=dr(t.label.element,kie(".quick-input-list-icon"));const r=hr(o,kie(".quick-input-list-entry-keybinding"));t.keybinding=new KE(r,Qe);const a=hr(s,kie(".quick-input-list-label-meta"));return t.detail=new DK(a,{supportHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.detail),t.separator=hr(t.entry,kie(".quick-input-list-separator")),t.actionBar=new ME(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,i){var n,o,s,r;i.element=e,e.element=null!==(n=i.entry)&&void 0!==n?n:void 0;const a=e.item?e.item:e.separator;i.checkbox.checked=e.checked,i.toDisposeElement.push(e.onChecked((e=>i.checkbox.checked=e)));const{labelHighlights:l,descriptionHighlights:h,detailHighlights:d}=e;if(null===(o=e.item)||void 0===o?void 0:o.iconPath){const t=Mv(this.themeService.getColorTheme().type)?e.item.iconPath.dark:null!==(s=e.item.iconPath.light)&&void 0!==s?s:e.item.iconPath.dark,n=Ro.revive(t);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=wr(n)}else i.icon.style.backgroundImage="",i.icon.className=(null===(r=e.item)||void 0===r?void 0:r.iconClass)?`quick-input-list-icon ${e.item.iconClass}`:"";const c={matches:l||[],descriptionTitle:e.saneDescription,descriptionMatches:h||[],labelEscapeNewLines:!0};"separator"!==a.type?(c.extraClasses=a.iconClasses,c.italic=a.italic,c.strikethrough=a.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item")):i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(e.saneLabel,e.saneDescription,c),i.keybinding.set("separator"===a.type?void 0:a.keybinding),e.saneDetail?(i.detail.element.style.display="",i.detail.setLabel(e.saneDetail,void 0,{matches:d,title:e.saneDetail,labelEscapeNewLines:!0})):i.detail.element.style.display="none",e.item&&e.separator&&e.separator.label?(i.separator.textContent=e.separator.label,i.separator.style.display=""):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!e.separator);const u=a.buttons;u&&u.length?(i.actionBar.push(u.map(((t,i)=>{let n=t.iconClass||(t.iconPath?yie(t.iconPath):void 0);return t.alwaysVisible&&(n=n?`${n} always-visible`:"always-visible"),{id:`id-${i}`,class:n,enabled:!0,label:"",tooltip:t.tooltip||"",run:()=>{"separator"!==a.type?e.fireButtonTriggered({button:t,item:a}):e.fireSeparatorButtonTriggered({button:t,separator:a})}}})),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){i.toDisposeElement=E(i.toDisposeElement),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=E(e.toDisposeElement),e.toDisposeTemplate=E(e.toDisposeTemplate)}}xie.ID="listelement";class Die{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return xie.ID}}var Eie;!function(e){e[e.First=1]="First",e[e.Second=2]="Second",e[e.Last=3]="Last",e[e.Next=4]="Next",e[e.Previous=5]="Previous",e[e.NextPage=6]="NextPage",e[e.PreviousPage=7]="PreviousPage"}(Eie||(Eie={}));class Nie{constructor(e,t,i,n){this.parent=e,this.options=i,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnLabelMode="fuzzy",this.sortByLabel=!0,this._onChangedAllVisibleChecked=new q,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new q,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new q,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new q,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new q,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new q,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new q,this.onKeyDown=this._onKeyDown.event,this._onLeave=new q,this.onLeave=this._onLeave.event,this._listElementChecked=new q,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=hr(this.parent,kie(".quick-input-list"));const o=new Die,s=new Mie;if(this.list=i.createList("QuickInput",this.container,o,[new xie(n)],{identityProvider:{getId:e=>{var t,i,n,o,s,r,a,l;return null!==(l=null!==(r=null!==(o=null!==(i=null===(t=e.item)||void 0===t?void 0:t.id)&&void 0!==i?i:null===(n=e.item)||void 0===n?void 0:n.label)&&void 0!==o?o:null===(s=e.separator)||void 0===s?void 0:s.id)&&void 0!==r?r:null===(a=e.separator)||void 0===a?void 0:a.label)&&void 0!==l?l:""}},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:s}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown((e=>{const t=new Dt(e);switch(t.keyCode){case 10:this.toggleCheckbox();break;case 31:(Ve?e.metaKey:e.ctrlKey)&&this.list.setFocus(Hc(this.list.length));break;case 16:{const e=this.list.getFocus();1===e.length&&0===e[0]&&this._onLeave.fire();break}case 18:{const e=this.list.getFocus();1===e.length&&e[0]===this.list.length-1&&this._onLeave.fire();break}}this._onKeyDown.fire(t)}))),this.disposables.push(this.list.onMouseDown((e=>{2!==e.browserEvent.button&&e.browserEvent.preventDefault()}))),this.disposables.push(bs(this.container,or.CLICK,(e=>{(e.x||e.y)&&this._onLeave.fire()}))),this.disposables.push(this.list.onMouseMiddleClick((e=>{this._onLeave.fire()}))),this.disposables.push(this.list.onContextMenu((e=>{"number"==typeof e.index&&(e.browserEvent.preventDefault(),this.list.setSelection([e.index]))}))),i.hoverDelegate){const e=new Ut(i.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver((async t=>{var i;if(t.browserEvent.target instanceof HTMLAnchorElement)e.cancel();else if(t.browserEvent.relatedTarget instanceof HTMLAnchorElement||!Bs(t.browserEvent.relatedTarget,null===(i=t.element)||void 0===i?void 0:i.element))try{await e.trigger((async()=>{t.element&&this.showHover(t.element)}))}catch(t){if(!g(t))throw t}}))),this.disposables.push(this.list.onMouseOut((t=>{var i;Bs(t.browserEvent.relatedTarget,null===(i=t.element)||void 0===i?void 0:i.element)||e.cancel()}))),this.disposables.push(e)}this.disposables.push(this._listElementChecked.event((e=>this.fireCheckedEvents()))),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onSeparatorButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return z.map(this.list.onDidChangeFocus,(e=>e.elements.map((e=>e.item))))}get onDidChangeSelection(){return z.map(this.list.onDidChangeSelection,(e=>({items:e.elements.map((e=>e.item)),event:e.browserEvent})))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get ariaLabel(){return this.list.getHTMLElement().ariaLabel}set ariaLabel(e){this.list.getHTMLElement().ariaLabel=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n.hidden){if(!n.checked)return!1;t=!0}}return t}getCheckedCount(){let e=0;const t=this.elements;for(let i=0,n=t.length;i<n;i++)t[i].checked&&e++;return e}getVisibleCount(){let e=0;const t=this.elements;for(let i=0,n=t.length;i<n;i++)t[i].hidden||e++;return e}setAllVisibleChecked(e){try{this._fireCheckedEvents=!1,this.elements.forEach((t=>{t.hidden||(t.checked=e)}))}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=E(this.elementDisposables);const t=e=>this.fireButtonTriggered(e),i=e=>this.fireSeparatorButtonTriggered(e);this.inputElements=e;const n=new Map,o=this.parent.classList.contains("show-checkboxes");this.elements=e.reduce(((s,r,a)=>{var l;const h=a>0?e[a-1]:void 0;if("separator"===r.type&&!r.buttons)return s;const d=new Lie(r,h,a,o,t,i,this._listElementChecked),c=s.length;return s.push(d),n.set(null!==(l=d.item)&&void 0!==l?l:d.separator,c),s}),[]),this.elementsToIndexes=n,this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map((e=>e.item))}setFocusedElements(e){if(this.list.setFocus(e.filter((e=>this.elementsToIndexes.has(e))).map((e=>this.elementsToIndexes.get(e)))),e.length>0){const e=this.list.getFocus()[0];"number"==typeof e&&this.list.reveal(e)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter((e=>this.elementsToIndexes.has(e))).map((e=>this.elementsToIndexes.get(e))))}getCheckedElements(){return this.elements.filter((e=>e.checked)).map((e=>e.item)).filter((e=>!!e))}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i);for(const e of this.elements)e.checked=t.has(e.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===Eie.Second&&this.list.length<2&&(e=Eie.First),e){case Eie.First:this.list.scrollTop=0,this.list.focusFirst(void 0,(e=>!!e.item));break;case Eie.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,(e=>!!e.item));break;case Eie.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,(e=>!!e.item));break;case Eie.Next:{this.list.focusNext(void 0,!0,void 0,(e=>!!e.item));const e=this.list.getFocus()[0];0!==e&&!this.elements[e-1].item&&this.list.firstVisibleIndex>e-1&&this.list.reveal(e-1);break}case Eie.Previous:{this.list.focusPrevious(void 0,!0,void 0,(e=>!!e.item));const e=this.list.getFocus()[0];0!==e&&!this.elements[e-1].item&&this.list.firstVisibleIndex>e-1&&this.list.reveal(e-1);break}case Eie.NextPage:this.list.focusNextPage(void 0,(e=>!!e.item));break;case Eie.PreviousPage:this.list.focusPreviousPage(void 0,(e=>!!e.item))}const t=this.list.getFocus()[0];"number"==typeof t&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}showHover(e){var t,i,n;void 0!==this.options.hoverDelegate&&(this._lastHover&&!this._lastHover.isDisposed&&(null===(i=(t=this.options.hoverDelegate).onDidHideHover)||void 0===i||i.call(t),null===(n=this._lastHover)||void 0===n||n.dispose()),e.element&&e.saneTooltip&&(this._lastHover=this.options.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:e=>{this.options.linkOpenerDelegate(e)},appearance:{showPointer:!0},container:this.container,position:{hoverPosition:1}},!1)))}layout(e){this.list.getHTMLElement().style.maxHeight=e?44*Math.floor(e/44)+6+"px":"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;const t=e;if((e=e.trim())&&(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail)){let i;this.elements.forEach((n=>{var o,s,r,a;let l;l="fuzzy"===this.matchOnLabelMode?this.matchOnLabel&&null!==(o=Al(e,Tl(n.saneLabel)))&&void 0!==o?o:void 0:this.matchOnLabel&&null!==(s=function(e,t){const{text:i,iconOffsets:n}=t;if(!n||0===n.length)return Iie(e,i);const o=un(i," "),s=i.length-o.length,r=Iie(e,o);if(r)for(const e of r){const t=n[e.start+s]+s;e.start+=t,e.end+=t}return r}(t,Tl(n.saneLabel)))&&void 0!==s?s:void 0;const h=this.matchOnDescription&&null!==(r=Al(e,Tl(n.saneDescription||"")))&&void 0!==r?r:void 0,d=this.matchOnDetail&&null!==(a=Al(e,Tl(n.saneDetail||"")))&&void 0!==a?a:void 0;if(l||h||d?(n.labelHighlights=l,n.descriptionHighlights=h,n.detailHighlights=d,n.hidden=!1):(n.labelHighlights=void 0,n.descriptionHighlights=void 0,n.detailHighlights=void 0,n.hidden=!n.item||!n.item.alwaysShow),n.item?n.separator=void 0:n.separator&&(n.hidden=!0),!this.sortByLabel){const e=n.index&&this.inputElements[n.index-1];i=e&&"separator"===e.type?e:i,i&&!n.hidden&&(n.separator=i,i=void 0)}}))}else this.elements.forEach((e=>{e.labelHighlights=void 0,e.descriptionHighlights=void 0,e.detailHighlights=void 0,e.hidden=!1;const t=e.index&&this.inputElements[e.index-1];e.item&&(e.separator=t&&"separator"===t.type&&!t.buttons?t:void 0)}));const i=this.elements.filter((e=>!e.hidden));if(this.sortByLabel&&e){const t=e.toLowerCase();i.sort(((e,i)=>function(e,t,i){const n=e.labelHighlights||[],o=t.labelHighlights||[];return n.length&&!o.length?-1:!n.length&&o.length?1:0===n.length&&0===o.length?0:function(e,t,i){const n=e.toLowerCase(),o=t.toLowerCase(),s=function(e,t,i){const n=e.toLowerCase(),o=t.toLowerCase(),s=n.startsWith(i),r=o.startsWith(i);if(s!==r)return s?-1:1;if(s&&r){if(n.length<o.length)return-1;if(n.length>o.length)return 1}return 0}(e,t,i);if(s)return s;const r=n.endsWith(i);if(r!==o.endsWith(i))return r?-1:1;const a=function(e,t,i=!1){const n=e||"",o=t||"",s=_ie.value.collator.compare(n,o);return _ie.value.collatorIsNumeric&&0===s&&n!==o?n<o?-1:1:s}(n,o);return 0!==a?a:n.localeCompare(o)}(e.saneSortLabel,t.saneSortLabel,i)}(e,i,t)))}return this.elementsToIndexes=i.reduce(((e,t,i)=>{var n;return e.set(null!==(n=t.item)&&void 0!==n?n:t.separator,i),e}),new Map),this.list.splice(0,this.list.length,i),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(i.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const i of e)i.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return"none"!==this.container.style.display}dispose(){this.elementDisposables=E(this.elementDisposables),this.disposables=E(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}fireSeparatorButtonTriggered(e){this._onSeparatorButtonTriggered.fire(e)}style(e){this.list.style(e)}toggleHover(){const e=this.list.getFocusedElements()[0];if(!(null==e?void 0:e.saneTooltip))return;if(this._lastHover&&!this._lastHover.isDisposed)return void this._lastHover.dispose();const t=this.list.getFocusedElements()[0];if(!t)return;this.showHover(t);const i=new M;i.add(this.list.onDidChangeFocus((e=>{e.indexes.length&&this.showHover(e.elements[0])}))),this._lastHover&&i.add(this._lastHover),this._toggleHover=i,this.elementDisposables.push(this._toggleHover)}}function Iie(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1!==i?[{start:i,end:i+e.length}]:null}Sie([HL],Nie.prototype,"onDidChangeFocus",null),Sie([HL],Nie.prototype,"onDidChangeSelection",null);class Mie{getWidgetAriaLabel(){return me(0,"Quick Input")}getAriaLabel(e){var t;return(null===(t=e.separator)||void 0===t?void 0:t.label)?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}const Tie={iconClass:Ll.asClassName(Sl.quickInputBack),tooltip:me(0,"Back"),handle:-1};class Aie extends T{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=Aie.noPromptMessage,this._severity=aL.Ignore,this.onDidTriggerButtonEmitter=this._register(new q),this.onDidHideEmitter=this._register(new q),this.onDisposeEmitter=this._register(new q),this.visibleDisposables=this._register(new M),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!je;this._ignoreFocusOut=e&&!je,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=null!=e?e:[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton((e=>{-1!==this.buttons.indexOf(e)&&this.onDidTriggerButtonEmitter.fire(e)}))),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=oI.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const i=this.getTitle();i&&this.ui.title.textContent!==i?this.ui.title.textContent=i:i||"&nbsp;"===this.ui.title.innerHTML||(this.ui.title.innerText=" ");const n=this.getDescription();if(this.ui.description1.textContent!==n&&(this.ui.description1.textContent=n),this.ui.description2.textContent!==n&&(this.ui.description2.textContent=n),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?cr(this.ui.widget,this._widget):cr(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new $t,this.busyDelay.setIfNotSet((()=>{this.visible&&this.ui.progressBar.infinite()}),800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const e=this.buttons.filter((e=>e===Tie));this.ui.leftActionBar.push(e.map(((e,t)=>{const i=new ph(`id-${t}`,"",e.iconClass||yie(e.iconPath),!0,(async()=>{this.onDidTriggerButtonEmitter.fire(e)}));return i.tooltip=e.tooltip||"",i})),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const t=this.buttons.filter((e=>e!==Tie));this.ui.rightActionBar.push(t.map(((e,t)=>{const i=new ph(`id-${t}`,"",e.iconClass||yie(e.iconPath),!0,(async()=>{this.onDidTriggerButtonEmitter.fire(e)}));return i.tooltip=e.tooltip||"",i})),{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const i=null!==(t=null===(e=this.toggles)||void 0===e?void 0:e.filter((e=>e instanceof Rz)))&&void 0!==t?t:[];this.ui.inputBox.toggles=i}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const o=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==o&&(this._lastValidationMessage=o,cr(this.ui.message),function(e,t,i){cr(t);const n=function(e){const t=[];let i,n=0;for(;i=bie.exec(e);){i.index-n>0&&t.push(e.substring(n,i.index));const[,o,s,,r]=i;r?t.push({label:o,href:s,title:r}):t.push({label:o,href:s}),n=i.index+i[0].length}return n<e.length&&t.push(e.substring(n)),new vie(t)}(e);let o=0;for(const e of n.nodes)if("string"==typeof e)t.append(...nx(e));else{let n=e.title;!n&&e.href.startsWith("command:")?n=me(0,"Click to execute command '{0}'",e.href.substring(8)):n||(n=e.href);const s=mr("a",{href:e.href,title:n,tabIndex:o++},e.label);s.style.textDecoration="underline";const r=t=>{sr(t)&&rr(t,!0),i.callback(e.href)},a=i.disposables.add(new OS(s,or.CLICK)).event,l=i.disposables.add(new OS(s,or.KEY_DOWN)).event,h=z.chain(l,(e=>e.filter((e=>{const t=new Dt(e);return t.equals(10)||t.equals(3)}))));i.disposables.add(KL.addTarget(s));const d=i.disposables.add(new OS(s,UL.Tap)).event;z.any(a,d,h)(r,null,i.disposables),t.appendChild(s)}}(o,this.ui.message,{callback:e=>{this.ui.linkOpenerDelegate(e)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?me(0,"{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==aL.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}Aie.noPromptMessage=me(0,"Press 'Enter' to confirm your input or 'Escape' to cancel");class Rie extends Aie{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new q),this.onWillAcceptEmitter=this._register(new q),this.onDidAcceptEmitter=this._register(new q),this.onDidCustomEmitter=this._register(new q),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._autoFocusOnList=!0,this._keepScrollPosition=!1,this._itemActivation=sI.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new q),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new q),this.onDidTriggerItemButtonEmitter=this._register(new q),this.onDidTriggerSeparatorButtonEmitter=this._register(new q),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?nI:this.ui.keyMods}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(Eie.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange((e=>{this.doSetValue(e,!0)}))),this.visibleDisposables.add(this.ui.inputBox.onMouseDown((e=>{this.autoFocusOnList||this.ui.list.clearFocus()}))),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown((e=>{switch(e.keyCode){case 18:this.ui.list.focus(Eie.Next),this.canSelectMany&&this.ui.list.domFocus(),rr(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(Eie.Previous):this.ui.list.focus(Eie.Last),this.canSelectMany&&this.ui.list.domFocus(),rr(e,!0);break;case 12:this.ui.list.focus(Eie.NextPage),this.canSelectMany&&this.ui.list.domFocus(),rr(e,!0);break;case 11:this.ui.list.focus(Eie.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),rr(e,!0);break;case 17:if(!this._canAcceptInBackground)return;if(!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(Eie.First),rr(e,!0));break;case 13:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(Eie.Last),rr(e,!0))}}))),this.visibleDisposables.add(this.ui.onDidAccept((()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)}))),this.visibleDisposables.add(this.ui.onDidCustom((()=>{this.onDidCustomEmitter.fire()}))),this.visibleDisposables.add(this.ui.list.onDidChangeFocus((e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Ic(e,this._activeItems,((e,t)=>e===t))||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))}))),this.visibleDisposables.add(this.ui.list.onDidChangeSelection((({items:e,event:t})=>{this.canSelectMany?e.length&&this.ui.list.setSelectedElements([]):this.selectedItemsToConfirm!==this._selectedItems&&Ic(e,this._selectedItems,((e,t)=>e===t))||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(ir(t)&&1===t.button))}))),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements((e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&Ic(e,this._selectedItems,((e,t)=>e===t))||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))}))),this.visibleDisposables.add(this.ui.list.onButtonTriggered((e=>this.onDidTriggerItemButtonEmitter.fire(e)))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered((e=>this.onDidTriggerSeparatorButtonEmitter.fire(e)))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return bs(this.ui.container,or.KEY_UP,(e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Dt(e),i=t.keyCode;this._quickNavigate.keybindings.some((e=>{const n=e.getChords();return!(n.length>1||(n[0].shiftKey&&4===i?t.ctrlKey||t.altKey||t.metaKey:!(n[0].altKey&&6===i||n[0].ctrlKey&&5===i||n[0].metaKey&&57===i)))}))&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)}))}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:"default"===this.ok?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let n=this.ariaLabel;if(!n&&i.inputBox&&(n=this.placeholder||Rie.DEFAULT_ARIA_LABEL,this.title&&(n+=` - ${this.title}`)),this.ui.list.ariaLabel!==n&&(this.ui.list.ariaLabel=null!=n?n:null),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case sI.NONE:this._itemActivation=sI.FIRST;break;case sI.SECOND:this.ui.list.focus(Eie.Second),this._itemActivation=sI.FIRST;break;case sI.LAST:this.ui.list.focus(Eie.Last),this._itemActivation=sI.FIRST;break;default:this.trySelectFirst()}this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(Eie.First)),this.keepScrollPosition&&(this.scrollTop=e)}}Rie.DEFAULT_ARIA_LABEL=me(0,"Type to narrow down results.");class Oie extends Aie{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new q),this.onDidAcceptEmitter=this._register(new q),this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange((e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))}))),this.visibleDisposables.add(this.ui.onDidAccept((()=>this.onDidAcceptEmitter.fire()))),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}}const Pie=mr;class Fie extends T{constructor(e,t,i){super(),this.options=e,this.themeService=t,this.layoutService=i,this.enabled=!0,this.onDidAcceptEmitter=this._register(new q),this.onDidCustomEmitter=this._register(new q),this.onDidTriggerButtonEmitter=this._register(new q),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new q),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new q),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this._register(z.runAndSubscribe(ps,(({window:e,disposables:t})=>this.registerKeyModsListeners(e,t)),{window:r,disposables:this._store})),this._register(ms((e=>{this.ui&&as(this.ui.container)===e&&this.reparentUI(this.layoutService.mainContainer)})))}registerKeyModsListeners(e,t){const i=e=>{this.keyMods.ctrlCmd=e.ctrlKey||e.metaKey,this.keyMods.alt=e.altKey};for(const n of[or.KEY_DOWN,or.KEY_UP,or.MOUSE_DOWN])t.add(bs(e,n,i,!0))}getUI(e){if(this.ui)return e&&this.parentElement.ownerDocument!==this.layoutService.activeContainer.ownerDocument&&this.reparentUI(this.layoutService.activeContainer),this.ui;const t=hr(this.parentElement,Pie(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const i=$s(t),n=hr(t,Pie(".quick-input-titlebar")),o=this.options.hoverDelegate?{hoverDelegate:this.options.hoverDelegate}:void 0,s=this._register(new ME(n,o));s.domNode.classList.add("quick-input-left-action-bar");const r=hr(n,Pie(".quick-input-title")),a=this._register(new ME(n,o));a.domNode.classList.add("quick-input-right-action-bar");const l=hr(t,Pie(".quick-input-header")),h=hr(l,Pie("input.quick-input-check-all"));h.type="checkbox",h.setAttribute("aria-label",me(0,"Toggle all checkboxes")),this._register(Cs(h,or.CHANGE,(e=>{const t=h.checked;D.setAllVisibleChecked(t)}))),this._register(bs(h,or.CLICK,(e=>{(e.x||e.y)&&g.setFocus()})));const d=hr(l,Pie(".quick-input-description")),c=hr(l,Pie(".quick-input-and-message")),u=hr(c,Pie(".quick-input-filter")),g=this._register(new fie(u,this.styles.inputBox,this.styles.toggle));g.setAttribute("aria-describedby",`${this.idPrefix}message`);const p=hr(u,Pie(".quick-input-visible-count"));p.setAttribute("aria-live","polite"),p.setAttribute("aria-atomic","true");const m=new yK(p,{countFormat:me(0,"{0} Results")},this.styles.countBadge),f=hr(u,Pie(".quick-input-count"));f.setAttribute("aria-live","polite");const _=new yK(f,{countFormat:me(0,"{0} Selected")},this.styles.countBadge),v=hr(l,Pie(".quick-input-action")),b=this._register(new gQ(v,this.styles.button));b.label=me(0,"OK"),this._register(b.onDidClick((e=>{this.onDidAcceptEmitter.fire()})));const w=hr(l,Pie(".quick-input-action")),C=this._register(new gQ(w,this.styles.button));C.label=me(0,"Custom"),this._register(C.onDidClick((e=>{this.onDidCustomEmitter.fire()})));const y=hr(c,Pie(`#${this.idPrefix}message.quick-input-message`)),S=this._register(new uie(t,this.styles.progressBar));S.getContainer().classList.add("quick-input-progress");const k=hr(t,Pie(".quick-input-html-widget"));k.tabIndex=-1;const L=hr(t,Pie(".quick-input-description")),x=this.idPrefix+"list",D=this._register(new Nie(t,x,this.options,this.themeService));g.setAttribute("aria-controls",x),this._register(D.onDidChangeFocus((()=>{var e;g.setAttribute("aria-activedescendant",null!==(e=D.getActiveDescendant())&&void 0!==e?e:"")}))),this._register(D.onChangedAllVisibleChecked((e=>{h.checked=e}))),this._register(D.onChangedVisibleCount((e=>{m.setCount(e)}))),this._register(D.onChangedCheckedCount((e=>{_.setCount(e)}))),this._register(D.onLeave((()=>{setTimeout((()=>{g.setFocus(),this.controller instanceof Rie&&this.controller.canSelectMany&&D.clearFocus()}),0)})));const E=lr(t);return this._register(E),this._register(bs(t,or.FOCUS,(e=>{Bs(e.relatedTarget,t)||(this.previousFocusElement=e.relatedTarget instanceof HTMLElement?e.relatedTarget:void 0)}),!0)),this._register(E.onDidBlur((()=>{this.getUI().ignoreFocusOut||this.options.ignoreFocusOut()||this.hide(oI.Blur),this.previousFocusElement=void 0}))),this._register(bs(t,or.FOCUS,(e=>{g.setFocus()}))),this._register(Cs(t,or.KEY_DOWN,(e=>{if(!Bs(e.target,k))switch(e.keyCode){case 3:rr(e,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:rr(e,!0),this.hide(oI.Gesture);break;case 2:if(!e.altKey&&!e.ctrlKey&&!e.metaKey){const i=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(t.classList.contains("show-checkboxes")?i.push("input"):i.push("input[type=text]"),this.getUI().list.isDisplayed()&&i.push(".monaco-list"),this.getUI().message&&i.push(".quick-input-message a"),this.getUI().widget){if(Bs(e.target,this.getUI().widget))break;i.push(".quick-input-html-widget")}const n=t.querySelectorAll(i.join(", "));e.shiftKey&&e.target===n[0]?(rr(e,!0),D.clearFocus()):!e.shiftKey&&Bs(e.target,n[n.length-1])&&(rr(e,!0),n[0].focus())}break;case 10:e.ctrlKey&&(rr(e,!0),this.getUI().list.toggleHover())}}))),this.ui={container:t,styleSheet:i,leftActionBar:s,titleBar:n,title:r,description1:L,description2:d,widget:k,rightActionBar:a,checkAll:h,inputContainer:c,filterContainer:u,inputBox:g,visibleCountContainer:p,visibleCount:m,countContainer:f,count:_,okContainer:v,ok:b,message:y,customButtonContainer:w,customButton:C,list:D,progressBar:S,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:e=>this.show(e),hide:()=>this.hide(),setVisibilities:e=>this.setVisibilities(e),setEnabled:e=>this.setEnabled(e),setContextKey:e=>this.options.setContextKey(e),linkOpenerDelegate:e=>this.options.linkOpenerDelegate(e)},this.updateStyles(),this.ui}reparentUI(e){this.ui&&(this.parentElement=e,hr(this.parentElement,this.ui.container))}pick(e,t={},i=Rt.None){return new Promise(((n,o)=>{let s=e=>{var i;s=n,null===(i=t.onKeyMods)||void 0===i||i.call(t,r.keyMods),n(e)};if(i.isCancellationRequested)return void s(void 0);const r=this.createQuickPick();let a;const l=[r,r.onDidAccept((()=>{if(r.canSelectMany)s(r.selectedItems.slice()),r.hide();else{const e=r.activeItems[0];e&&(s(e),r.hide())}})),r.onDidChangeActive((e=>{const i=e[0];i&&t.onDidFocus&&t.onDidFocus(i)})),r.onDidChangeSelection((e=>{if(!r.canSelectMany){const t=e[0];t&&(s(t),r.hide())}})),r.onDidTriggerItemButton((e=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...e,removeItem:()=>{const t=r.items.indexOf(e.item);if(-1!==t){const e=r.items.slice(),i=e.splice(t,1),n=r.activeItems.filter((e=>e!==i[0])),o=r.keepScrollPosition;r.keepScrollPosition=!0,r.items=e,n&&(r.activeItems=n),r.keepScrollPosition=o}}}))),r.onDidTriggerSeparatorButton((e=>{var i;return null===(i=t.onDidTriggerSeparatorButton)||void 0===i?void 0:i.call(t,e)})),r.onDidChangeValue((e=>{!a||e||1===r.activeItems.length&&r.activeItems[0]===a||(r.activeItems=[a])})),i.onCancellationRequested((()=>{r.hide()})),r.onDidHide((()=>{E(l),s(void 0)}))];r.title=t.title,r.canSelectMany=!!t.canPickMany,r.placeholder=t.placeHolder,r.ignoreFocusOut=!!t.ignoreFocusLost,r.matchOnDescription=!!t.matchOnDescription,r.matchOnDetail=!!t.matchOnDetail,r.matchOnLabel=void 0===t.matchOnLabel||t.matchOnLabel,r.autoFocusOnList=void 0===t.autoFocusOnList||t.autoFocusOnList,r.quickNavigate=t.quickNavigate,r.hideInput=!!t.hideInput,r.contextKey=t.contextKey,r.busy=!0,Promise.all([e,t.activeItem]).then((([e,t])=>{a=t,r.busy=!1,r.items=e,r.canSelectMany&&(r.selectedItems=e.filter((e=>"separator"!==e.type&&e.picked))),a&&(r.activeItems=[a])})),r.show(),Promise.resolve(e).then(void 0,(e=>{o(e),r.hide()}))}))}createQuickPick(){const e=this.getUI(!0);return new Rie(e)}createInputBox(){const e=this.getUI(!0);return new Oie(e)}show(e){const t=this.getUI(!0);this.onShowEmitter.fire();const i=this.controller;this.controller=e,null==i||i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",cr(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(aL.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),cr(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const n=this.options.backKeybindingLabel();Tie.tooltip=n?me(0,"Back ({0})",n):me(0,"Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}isVisible(){return!!this.ui&&"none"!==this.ui.container.style.display}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=!e.description||e.inputBox||e.checkAll?"none":"",t.checkAll.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t,i;const n=this.controller;if(!n)return;const o=null===(t=this.ui)||void 0===t?void 0:t.container,s=o&&!Bs((r=o).ownerDocument.activeElement,r);var r;if(this.controller=null,this.onHideEmitter.fire(),o&&(o.style.display="none"),!s){let e=this.previousFocusElement;for(;e&&!e.offsetParent;)e=null!==(i=e.parentElement)&&void 0!==i?i:void 0;(null==e?void 0:e.offsetParent)?(e.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}n.didHide(e)}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isVisible()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(.62*this.dimension.width,Fie.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&.4*this.dimension.height)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:n,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=null!=e?e:"",this.ui.container.style.backgroundColor=null!=t?t:"",this.ui.container.style.color=null!=i?i:"",this.ui.container.style.border=n?`1px solid ${n}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list);const s=[];this.styles.pickerGroup.pickerGroupBorder&&s.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(s.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&s.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&s.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&s.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&s.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&s.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),s.push("}"));const r=s.join("\n");r!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=r)}}}Fie.MAX_WIDTH=600;var Bie=function(e,t){return function(i,n){t(i,n,e)}};let Wie=class extends Bv{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(oie))),this._quickAccess}constructor(e,t,i,n){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=n,this._onShow=this._register(new q),this._onHide=this._register(new q),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:e=>this.setContextKey(e),linkOpenerDelegate:e=>{this.instantiationService.invokeFunction((t=>{t.get(Hx).open(e,{allowCommands:!0,fromUserGesture:!0})}))},returnFocus:()=>e.focus(),createList:(e,t,i,n,o)=>this.instantiationService.createInstance(QU,e,t,i,n,o),styles:this.computeStyles()},n=this._register(new Fie({...i,...t},this.themeService,this.layoutService));return n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer((t=>n.layout(t,e.activeContainerOffset.quickPickTop)))),this._register(e.onDidChangeActiveContainer((()=>{n.isVisible()||n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)}))),this._register(n.onShow((()=>{this.resetContextKeys(),this._onShow.fire()}))),this._register(n.onHide((()=>{this.resetContextKeys(),this._onHide.fire()}))),n}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new od(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),t&&t.get()||(this.resetContextKeys(),null==t||t.set(!0))}resetContextKeys(){this.contexts.forEach((e=>{e.get()&&e.reset()}))}pick(e,t={},i=Rt.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:wm(Df),quickInputForeground:wm(Ef),quickInputTitleBackground:wm(Nf),widgetBorder:wm(Tm),widgetShadow:wm(Mm)},inputBox:QE,toggle:YE,countBadge:JE,button:GE,progressBar:ZE,keybindingLabel:$E,list:tN({listBackground:Df,listFocusBackground:V_,listFocusForeground:B_,listInactiveFocusForeground:B_,listInactiveSelectionIconForeground:W_,listInactiveFocusBackground:V_,listFocusOutline:Nm,listInactiveFocusOutline:Nm}),pickerGroup:{pickerGroupBorder:wm(Mf),pickerGroupForeground:wm(If)}}}};Wie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Bie(0,lh),Bie(1,sd),Bie(2,Tv),Bie(3,Cee)],Wie);var Vie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},zie=function(e,t){return function(i,n){t(i,n,e)}};let Hie=class extends Wie{constructor(e,t,i,n,o){super(t,i,n,new Lee(e.getContainerDomNode(),o)),this.host=void 0;const s=Kie.get(e);if(s){const t=s.widget;this.host={_serviceBrand:void 0,get mainContainer(){return t.getDomNode()},getContainer:()=>t.getDomNode(),get containers(){return[t.getDomNode()]},get activeContainer(){return t.getDomNode()},get mainContainerDimension(){return e.getLayoutInfo()},get activeContainerDimension(){return e.getLayoutInfo()},get onDidLayoutMainContainer(){return e.onDidLayoutChange},get onDidLayoutActiveContainer(){return e.onDidLayoutChange},get onDidLayoutContainer(){return z.map(e.onDidLayoutChange,(e=>({container:t.getDomNode(),dimension:e})))},get onDidChangeActiveContainer(){return z.None},get onDidAddContainer(){return z.None},get mainContainerOffset(){return{top:0,quickPickTop:0}},get activeContainerOffset(){return{top:0,quickPickTop:0}},focus:()=>e.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}};Hie=Vie([zie(1,lh),zie(2,sd),zie(3,Tv),zie(4,dh)],Hie);let Uie=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(Hie,e);this.mapEditorToService.set(e,t),w(e.onDidDispose)((()=>{i.dispose(),this.mapEditorToService.delete(e)}))}return t}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},i=Rt.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};Uie=Vie([zie(0,lh),zie(1,dh)],Uie);class Kie{static get(e){return e.getContribution(Kie.ID)}constructor(e){this.editor=e,this.widget=new jie(this.editor)}dispose(){this.widget.dispose()}}Kie.ID="editor.controller.quickInput";class jie{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return jie.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}jie.ID="editor.contrib.quickInputWidget",Gd(Kie.ID,Kie,4);var qie=function(e,t){return function(i,n){t(i,n,e)}};let $ie=class extends T{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new q,this._onDidChangeReducedMotion=new q,this._accessibilityModeEnabledContext=WS.bindTo(this._contextKeyService);const n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire()),e.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())}))),n(),this._register(this.onDidChangeScreenReaderOptimized((()=>n())));const o=r.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(o)}initReducedMotionListeners(e){this._register(bs(e,"change",(()=>{this._systemMotionReduced=e.matches,"auto"===this._configMotionReduced&&this._onDidChangeReducedMotion.fire()})));const t=()=>{const e=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("reduce-motion",e),this._layoutService.mainContainer.classList.toggle("enable-motion",!e)};t(),this._register(this.onDidChangeReducedMotion((()=>t())))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return"on"===e||"auto"===e&&2===this._accessibilitySupport}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return"on"===e||"auto"===e&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};$ie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([qie(0,sd),qie(1,Cee),qie(2,ug)],$ie);var Gie,Zie,Yie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Qie=function(e,t){return function(i,n){t(i,n,e)}};let Xie=class{constructor(e,t){this._commandService=e,this._hiddenStates=new Jie(t)}createMenu(e,t,i){return new tne(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};Xie=Yie([Qie(0,wh),Qie(1,KN)],Xie);let Jie=Gie=class{constructor(e){this._storageService=e,this._disposables=new M,this._onDidChange=new q,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(Gie._key,0,"{}");this._data=JSON.parse(t)}catch(e){this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,Gie._key,this._disposables)((()=>{if(!this._ignoreChangeEvent)try{const t=e.get(Gie._key,0,"{}");this._data=JSON.parse(t)}catch(e){console.log("FAILED to read storage after UPDATE",e)}this._onDidChange.fire()})))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){var i;return null!==(i=this._hiddenByDefaultCache.get(`${e.id}/${t}`))&&void 0!==i&&i}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){var i,n;const o=this._isHiddenByDefault(e,t),s=null!==(n=null===(i=this._data[e.id])||void 0===i?void 0:i.includes(t))&&void 0!==n&&n;return o?!s:s}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const n=this._data[e.id];if(i)n?n.indexOf(t)<0&&n.push(t):this._data[e.id]=[t];else if(n){const i=n.indexOf(t);i>=0&&function(e,t){const i=e.length-1;t<i&&(e[t]=e[i]),e.pop()}(n,i),0===n.length&&delete this._data[e.id]}this._persist()}reset(e){if(void 0===e)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(Gie._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};Jie._key="menu.hiddenCommands",Jie=Gie=Yie([Qie(0,KN)],Jie);let ene=Zie=class{constructor(e,t,i,n,o){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=i,this._commandService=n,this._contextKeyService=o,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=Ld.getMenuItems(this._id);let t;e.sort(Zie._compareMenuItems);for(const i of e){const e=i.group||"";t&&t[0]===e||(t=[e,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeys(i)}}_collectContextKeys(e){if(Zie._fillInKbExprKeys(e.when,this._structureContextKeys),Cd(e)){if(e.command.precondition&&Zie._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;Zie._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&Ld.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[n,o]=i,s=[];for(const t of o)if(this._contextKeyService.contextMatchesRules(t.when)){const i=Cd(t);i&&this._hiddenStates.setDefaultState(this._id,t.command.id,!!t.isHiddenByDefault);const n=ine(this._id,i?t.command:t,this._hiddenStates);if(i)s.push(new Dd(t.command,t.alt,e,n,this._contextKeyService,this._commandService));else{const i=new Zie(t.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(e),o=fh.join(...i.map((e=>e[1])));o.length>0&&s.push(new xd(t,n,o))}}s.length>0&&t.push([n,s])}return t}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}static _compareMenuItems(e,t){const i=e.group,n=t.group;if(i!==n){if(!i)return 1;if(!n)return-1;if("navigation"===i)return-1;if("navigation"===n)return 1;const e=i.localeCompare(n);if(0!==e)return e}const o=e.order||0,s=t.order||0;return o<s?-1:o>s?1:Zie._compareTitles(Cd(e)?e.command.title:e.title,Cd(t)?t.command.title:t.title)}static _compareTitles(e,t){const i="string"==typeof e?e:e.original,n="string"==typeof t?t:t.original;return i.localeCompare(n)}};ene=Zie=Yie([Qie(3,wh),Qie(4,sd)],ene);let tne=class{constructor(e,t,i,n,o){this._disposables=new M,this._menuInfo=new ene(e,t,i.emitEventsForSubmenuChanges,n,o);const s=new Zt((()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})}),i.eventDebounceDelay);this._disposables.add(s),this._disposables.add(Ld.onDidChangeMenu((t=>{t.has(e)&&s.schedule()})));const r=this._disposables.add(new M);this._onDidChange=new Z({onWillAddFirstListener:()=>{r.add(o.onDidChangeContext((e=>{const t=e.affectsSome(this._menuInfo.structureContextKeys),i=e.affectsSome(this._menuInfo.preconditionContextKeys),n=e.affectsSome(this._menuInfo.toggledContextKeys);(t||i||n)&&this._onDidChange.fire({menu:this,isStructuralChange:t,isEnablementChange:i,isToggleChange:n})}))),r.add(t.onDidChange((e=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})})))},onDidRemoveLastListener:r.clear.bind(r),delay:i.eventDebounceDelay,merge:e=>{let t=!1,i=!1,n=!1;for(const o of e)if(t=t||o.isStructuralChange,i=i||o.isEnablementChange,n=n||o.isToggleChange,t&&i&&n)break;return{menu:this,isStructuralChange:t,isEnablementChange:i,isToggleChange:n}}}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};function ine(e,t,i){const n=void 0!==t.submenu?t.submenu.id:t.id,o="string"==typeof t.title?t.title:t.title.value,s=bh({id:`hide/${e.id}/${n}`,label:me(0,"Hide '{0}'",o),run(){i.updateHidden(e,n,!0)}}),r=bh({id:`toggle/${e.id}/${n}`,label:o,get checked(){return!i.isHidden(e,n)},run(){i.updateHidden(e,n,!!this.checked)}});return{hide:s,toggle:r,get isHidden(){return!r.checked}}}tne=Yie([Qie(3,wh),Qie(4,sd)],tne);var nne=function(e,t){return function(i,n){t(i,n,e)}};let one=class extends T{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],(he||de)&&this.installWebKitWriteTextWorkaround()}installWebKitWriteTextWorkaround(){const e=()=>{const e=new ei;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=e,navigator.clipboard.write([new ClipboardItem({"text/plain":e.p})]).catch((async t=>{t instanceof Error&&"NotAllowedError"===t.name&&e.isRejected||this.logService.error(t)}))};this._register(z.runAndSubscribe(this.layoutService.onDidAddContainer,(({container:t,disposables:i})=>{i.add(bs(t,"click",e)),i.add(bs(t,"keydown",e))}),{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(t)return void this.mapTextToType.set(t,e);if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return await navigator.clipboard.writeText(e)}catch(e){console.error(e)}const i=js(),n=i.activeElement,o=i.body.appendChild(mr("textarea",{"aria-hidden":!0}));o.style.height="1px",o.style.width="1px",o.style.position="absolute",o.value=e,o.focus(),o.select(),i.execCommand("copy"),n instanceof HTMLElement&&n.focus(),i.body.removeChild(o)}async readText(e){if(e)return this.mapTextToType.get(e)||"";try{return await navigator.clipboard.readText()}catch(e){return console.error(e),""}}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}async writeResources(e){this.resources=e}async readResources(){return this.resources}};one=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([nne(0,Cee),nne(1,Md)],one);const sne="data-keybinding-context";class rne{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return{...this._value}}setValue(e,t){return this._value[e]!==t&&(this._value[e]=t,!0)}removeValue(e){return e in this._value&&(delete this._value[e],!0)}getValue(e){const t=this._value[e];return void 0===t&&this._parent?this._parent.getValue(e):t}}class ane extends rne{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}ane.INSTANCE=new ane;class lne extends rne{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=DG.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration((e=>{if(7===e.source){const e=Array.from(this._values,(([e])=>e));this._values.clear(),i.fire(new cne(e))}else{const t=[];for(const i of e.affectedKeys){const e=`config.${i}`,n=this._values.findSuperstr(e);void 0!==n&&(t.push(...C.map(n,(([e])=>e))),this._values.deleteSuperstr(e)),this._values.has(e)&&(t.push(e),this._values.delete(e))}i.fire(new cne(t))}}))}dispose(){this._listener.dispose()}getValue(e){if(0!==e.indexOf(lne._keyPrefix))return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(lne._keyPrefix.length),i=this._configurationService.getValue(t);let n;switch(typeof i){case"number":case"boolean":case"string":n=i;break;default:n=Array.isArray(i)?JSON.stringify(i):i}return this._values.set(e,n),n}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}lne._keyPrefix="config.";class hne{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){void 0===this._defaultValue?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class dne{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class cne{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every((t=>e.has(t)))}}class une{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every((t=>t.allKeysContainedIn(e)))}}class gne extends T{constructor(e){super(),this._onDidChangeContext=this._register(new G({merge:e=>new une(e)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new hne(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new mne(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return!e||e.evaluate(t)}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new dne(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new dne(e))}getContext(e){return this._isDisposed?ane.INSTANCE:this.getContextValuesContainer(function(e){for(;e;){if(e.hasAttribute(sne)){const t=e.getAttribute(sne);return t?parseInt(t,10):NaN}e=e.parentElement}return 0}(e))}dispose(){super.dispose(),this._isDisposed=!0}}let pne=class extends gne{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new lne(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?ane.INSTANCE:this._contexts.get(e)||ane.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new rne(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};pne=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,ug)],pne);class mne extends gne{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new A),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(sne)){let e="";this._domNode.classList&&(e=Array.from(this._domNode.classList.values()).join(", ")),console.error("Element already has context attribute"+(e?": "+e:""))}this._domNode.setAttribute(sne,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext((e=>{var t;t=this._parent.getContextValuesContainer(this._myContextId).value,e.allKeysContainedIn(new Set(Object.keys(t)))||this._onDidChangeContext.fire(e)}))}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(sne),super.dispose())}getContextValuesContainer(e){return this._isDisposed?ane.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}Ch.registerCommand("_setContext",(function(e,t,i){e.get(sd).createKey(String(t),function(e){return gc(e,(e=>"object"==typeof e&&1===e.$mid?Ro.revive(e).toString():e instanceof Ro?e.toString():void 0))}(i))})),Ch.registerCommand({id:"getContextKeyInfo",handler:()=>[...od.all()].sort(((e,t)=>e.key.localeCompare(t.key))),metadata:{description:me(0,"A command that returns information about context keys"),args:[]}}),Ch.registerCommand("_generateContextKeyInfo",(function(){const e=[],t=new Set;for(const i of od.all())t.has(i.key)||(t.add(i.key),e.push(i));e.sort(((e,t)=>e.key.localeCompare(t.key))),console.log(JSON.stringify(e,void 0,2))}));class fne{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}}class _ne{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())0===t.outgoing.size&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),n=this.lookupOrInsertNode(t);i.outgoing.set(n.key,n),n.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const e of this._nodes.values())e.outgoing.delete(t),e.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new fne(t,e),this._nodes.set(t,i)),i}isEmpty(){return 0===this._nodes.size}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t}\n\t(-> incoming)[${[...i.incoming.keys()].join(", ")}]\n\t(outgoing ->)[${[...i.outgoing.keys()].join(",")}]\n`);return e.join("\n")}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(const[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const e=this._findCycle(n,t);if(e)return e;t.delete(i)}}}class vne extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=null!==(t=e.findCycleSlow())&&void 0!==t?t:`UNABLE to detect cycle, dumping graph: \n${e.toString()}`}}class bne{constructor(e=new TW,t=!1,i,n=!1){var o;this._services=e,this._strict=t,this._parent=i,this._enableTracing=n,this._activeInstantiations=new Set,this._services.set(lh,this),this._globalGraph=n?null!==(o=null==i?void 0:i._globalGraph)&&void 0!==o?o:new _ne((e=>e)):void 0}createChild(e){return new bne(e,this._strict,this,this._enableTracing)}invokeFunction(e,...t){const i=wne.traceInvocation(this._enableTracing,e);let n=!1;try{return e({get:e=>{if(n)throw f("service accessor is only valid during the invocation of its target method");const t=this._getOrCreateServiceInstance(e,i);if(!t)throw new Error(`[invokeFunction] unknown service '${e}'`);return t}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){let i,n;return e instanceof vg?(i=wne.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=wne.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=sh.getServiceDependencies(e).sort(((e,t)=>e.index-t.index)),o=[];for(const t of n){const n=this._getOrCreateServiceInstance(t.id,i);n||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`,!1),o.push(n)}const s=n.length>0?n[0].index:t.length;if(t.length!==s){console.trace(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);const i=s-t.length;t=i>0?t.concat(new Array(i)):t.slice(0,s)}return Reflect.construct(e,t.concat(o))}_setServiceInstance(e,t){if(this._services.get(e)instanceof vg)this._services.set(e,t);else{if(!this._parent)throw new Error("illegalState - setting UNKNOWN service instance");this._parent._setServiceInstance(e,t)}}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof vg?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){var n;const o=new _ne((e=>e.id.toString()));let s=0;const r=[{id:e,desc:t,_trace:i}];for(;r.length;){const t=r.pop();if(o.lookupOrInsertNode(t),s++>1e3)throw new vne(o);for(const i of sh.getServiceDependencies(t.desc.ctor)){const s=this._getServiceInstanceOrDescriptor(i.id);if(s||this._throwIfStrict(`[createInstance] ${e} depends on ${i.id} which is NOT registered.`,!0),null===(n=this._globalGraph)||void 0===n||n.insertEdge(String(t.id),String(i.id)),s instanceof vg){const e={id:i.id,desc:s,_trace:t._trace.branch(i.id,!0)};o.insertEdge(t,e),r.push(e)}}}for(;;){const e=o.roots();if(0===e.length){if(!o.isEmpty())throw new vne(o);break}for(const{data:t}of e){if(this._getServiceInstanceOrDescriptor(t.id)instanceof vg){const e=this._createServiceInstanceWithOwner(t.id,t.desc.ctor,t.desc.staticArguments,t.desc.supportsDelayedInstantiation,t._trace);this._setServiceInstance(t.id,e)}o.removeNode(t)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,o){if(this._services.get(e)instanceof vg)return this._createServiceInstance(e,t,i,n,o);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],n,o){if(n){const n=new bne(void 0,this._strict,this,this._enableTracing);n._globalGraphImplicitDependency=String(e);const s=new Map,r=new Jt((()=>{const e=n._createInstance(t,i,o);for(const[t,i]of s){const n=e[t];if("function"==typeof n)for(const t of i)n.apply(e,t)}return s.clear(),e}));return new Proxy(Object.create(null),{get(e,t){if(!r.isInitialized&&"string"==typeof t&&(t.startsWith("onDid")||t.startsWith("onWill"))){let e=s.get(t);return e||(e=new B,s.set(t,e)),(t,i,n)=>I(e.push([t,i,n]))}if(t in e)return e[t];const i=r.value;let n=i[t];return"function"!=typeof n||(n=n.bind(i),e[t]=n),n},set:(e,t,i)=>(r.value[t]=i,!0),getPrototypeOf:e=>t.prototype})}return this._createInstance(t,i,o)}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class wne{static traceInvocation(e,t){return e?new wne(2,t.name||(new Error).stack.split("\n").slice(3,4).join("\n")):wne._None}static traceCreation(e,t){return e?new wne(1,t.name):wne._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new wne(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;wne._totals+=e;let t=!1;const i=[`${1===this.type?"CREATE":"CALL"} ${this.name}`,`${function e(i,n){const o=[],s=new Array(i+1).join("\t");for(const[r,a,l]of n._dep)if(a&&l){t=!0,o.push(`${s}CREATES -> ${r}`);const n=e(i+1,l);n&&o.push(n)}else o.push(`${s}uses -> ${r}`);return o.join("\n")}(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${wne._totals.toFixed(2)}ms)`];(e>2||t)&&wne.all.add(i.join("\n"))}}wne.all=new Set,wne._None=new class extends wne{constructor(){super(0,null)}stop(){}branch(){return this}},wne._totals=0;const Cne=new Set([jo.inMemory,jo.vscodeSourceControl,jo.walkThrough,jo.walkThroughSnippet]);class yne{constructor(){this._byResource=new ta,this._byOwner=new Map}set(e,t,i){let n=this._byResource.get(e);n||(n=new Map,this._byResource.set(e,n)),n.set(t,i);let o=this._byOwner.get(t);o||(o=new ta,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){const i=this._byResource.get(e);return null==i?void 0:i.get(t)}delete(e,t){let i=!1,n=!1;const o=this._byResource.get(e);o&&(i=o.delete(t));const s=this._byOwner.get(t);if(s&&(n=s.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){var t,i,n,o;return"string"==typeof e?null!==(i=null===(t=this._byOwner.get(e))||void 0===t?void 0:t.values())&&void 0!==i?i:C.empty():Ro.isUri(e)?null!==(o=null===(n=this._byResource.get(e))||void 0===n?void 0:n.values())&&void 0!==o?o:C.empty():C.map(C.concat(...this._byOwner.values()),(e=>e[1]))}}class Sne{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new ta,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const e=this._data.get(t);e&&this._substract(e);const i=this._resourceStats(t);this._add(i),this._data.set(t,i)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(Cne.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===yN.Error?t.errors+=1:i===yN.Warning?t.warnings+=1:i===yN.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class kne{constructor(){this._onMarkerChanged=new Z({delay:0,merge:kne._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new yne,this._stats=new Sne(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(Bc(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const n=[];for(const o of i){const i=kne._toMarker(e,t,o);i&&n.push(i)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:o,message:s,source:r,startLineNumber:a,startColumn:l,endLineNumber:h,endColumn:d,relatedInformation:c,tags:u}=i;if(s)return a=a>0?a:1,l=l>0?l:1,h=h>=a?h:a,d=d>0?d:l,{resource:t,owner:e,code:n,severity:o,message:s,source:r,startLineNumber:a,startColumn:l,endLineNumber:h,endColumn:d,relatedInformation:c,tags:u}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const t of n){const n=C.first(t);n&&(i.push(n.resource),this._data.delete(n.resource,e))}if(Wc(t)){const n=new ta;for(const{resource:o,marker:s}of t){const t=kne._toMarker(e,o,s);if(!t)continue;const r=n.get(o);r?r.push(t):(n.set(o,[t]),i.push(o))}for(const[t,i]of n)this._data.set(t,e,i)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const e=this._data.get(i,t);if(e){const t=[];for(const i of e)if(kne._accept(i,n)){const e=t.push(i);if(o>0&&e===o)break}return t}return[]}if(t||i){const e=this._data.values(null!=i?i:t),s=[];for(const t of e)for(const e of t)if(kne._accept(e,n)){const t=s.push(e);if(o>0&&t===o)return s}return s}{const e=[];for(const t of this._data.values())for(const i of t)if(kne._accept(i,n)){const t=e.push(i);if(o>0&&t===o)return e}return e}}static _accept(e,t){return void 0===t||(t&e.severity)===e.severity}static _merge(e){const t=new ta;for(const i of e)for(const e of i)t.set(e,!0);return Array.from(t.keys())}}class Lne extends T{constructor(){super(...arguments),this._configurationModel=new jee}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new jee;const e=md.as(Lg).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const n of e){const e=i[n],o=t[n];void 0!==e?this._configurationModel.addValue(n,e):o?this._configurationModel.addValue(n,o.default):this._configurationModel.removeValue(n)}}}class xne extends T{constructor(e,t=[]){super(),this.logger=new Pd([e,...t]),this._register(e.onDidChangeLogLevel((e=>this.setLevel(e))))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}}var Dne=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Ene=function(e,t){return function(i,n){t(i,n,e)}};class Nne{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new q}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let Ine=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new O(new Nne(t))):Promise.reject(new Error("Model not found"))}};Ine=Dne([Ene(0,uh)],Ine);class Mne{show(){return Mne.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}}Mne.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class Tne{info(e){return this.notify({severity:aL.Info,message:e})}warn(e){return this.notify({severity:aL.Warning,message:e})}error(e){return this.notify({severity:aL.Error,message:e})}notify(e){switch(e.severity){case aL.Error:console.error(e.message);break;case aL.Warning:console.warn(e.message);break;default:console.log(e.message)}return Tne.NO_OP}prompt(e,t,i,n){return Tne.NO_OP}status(e,t){return T.None}}Tne.NO_OP=new class{};let Ane=class{constructor(e){this._onWillExecuteCommand=new q,this._onDidExecuteCommand=new q,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=Ch.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(e){return Promise.reject(e)}}};Ane=Dne([Ene(0,lh)],Ane);let Rne=class extends ite{constructor(e,t,i,n,o,s){super(e,t,i,n,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const r=e=>{const t=new M;t.add(bs(e,or.KEY_DOWN,(e=>{const t=new Dt(e);this._dispatch(t,t.target)&&(t.preventDefault(),t.stopPropagation())}))),t.add(bs(e,or.KEY_UP,(e=>{const t=new Dt(e);this._singleModifierDispatch(t,t.target)&&t.preventDefault()}))),this._domNodeListeners.push(new One(e,t))},a=e=>{for(let t=0;t<this._domNodeListeners.length;t++){const i=this._domNodeListeners[t];i.domNode===e&&(this._domNodeListeners.splice(t,1),i.dispose())}},l=e=>{e.getOption(61)||r(e.getContainerDomNode())};this._register(s.onCodeEditorAdd(l)),this._register(s.onCodeEditorRemove((e=>{e.getOption(61)||a(e.getContainerDomNode())}))),s.listCodeEditors().forEach(l);const h=e=>{r(e.getContainerDomNode())};this._register(s.onDiffEditorAdd(h)),this._register(s.onDiffEditorRemove((e=>{a(e.getContainerDomNode())}))),s.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,n){return N(Ch.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map((e=>{var t;return{keybinding:bt(e.keybinding,Qe),command:null!==(t=e.command)&&void 0!==t?t:null,commandArgs:e.commandArgs,when:e.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),I((()=>{for(let e=0;e<this._dynamicKeybindings.length;e++)if(this._dynamicKeybindings[e]===t[0])return this._dynamicKeybindings.splice(e,t.length),void this.updateResolver()}))}updateResolver(){this._cachedResolver=null,this._onDidUpdateKeybindings.fire()}_getResolver(){if(!this._cachedResolver){const e=this._toNormalizedKeybindingItems(_d.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new Xee(e,t,(e=>this._log(e)))}return this._cachedResolver}_documentHasFocus(){return r.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const o of e){const e=o.when||void 0,s=o.keybinding;if(s){const r=ate.resolveKeybinding(s,Qe);for(const s of r)i[n++]=new ote(s,o.command,o.commandArgs,e,t,null,!1)}else i[n++]=new ote(void 0,o.command,o.commandArgs,e,t,null,!1)}return i}resolveKeyboardEvent(e){const t=new Ct(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new ate([t],Qe)}};Rne=Dne([Ene(0,sd),Ene(1,wh),Ene(2,Id),Ene(3,hL),Ene(4,Md),Ene(5,dh)],Rne);class One extends T{constructor(e,t){super(),this.domNode=e,this._register(t)}}function Pne(e){return e&&"object"==typeof e&&(!e.overrideIdentifier||"string"==typeof e.overrideIdentifier)&&(!e.resource||e.resource instanceof Ro)}class Fne{constructor(){this._onDidChangeConfiguration=new q,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new Lne;this._configuration=new Gee(e.reload(),new jee,new jee,new jee),e.dispose()}getValue(e,t){const i="string"==typeof e?e:void 0,n=Pne(e)?e:Pne(t)?t:{};return this._configuration.getValue(i,n,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const t of e){const[e,n]=t;this.getValue(e)!==n&&(this._configuration.updateValue(e,n),i.push(e))}if(i.length>0){const e=new Zee({keys:i,overrides:[]},t,this._configuration);e.source=8,e.sourceConfig=null,this._onDidChangeConfiguration.fire(e)}return Promise.resolve()}updateValue(e,t,i,n){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let Bne=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new q,this.configurationService.onDidChangeConfiguration((e=>{this._onDidChangeConfiguration.fire({affectedKeys:e.affectedKeys,affectsConfiguration:(t,i)=>e.affectsConfiguration(i)})}))}getValue(e,t,i){const n=ch.isIPosition(t)?t:null,o=n?"string"==typeof i?i:void 0:"string"==typeof t?t:void 0,s=e?this.getLanguage(e,n):void 0;return void 0===o?this.configurationService.getValue({resource:e,overrideIdentifier:s}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:s})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};Bne=Dne([Ene(0,ug),Ene(1,uh),Ene(2,yu)],Bne);let Wne=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&"string"==typeof i&&"auto"!==i?i:ze||Ve?"\n":"\r\n"}};Wne=Dne([Ene(0,ug)],Wne);class Vne{constructor(){const e=Ro.from({scheme:Vne.SCHEME,authority:"model",path:"/"});this.workspace={id:TG,folders:[new MG({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===Vne.SCHEME?this.workspace.folders[0]:null}}function zne(e,t,i){if(!t)return;if(!(e instanceof Fne))return;const n=[];Object.keys(t).forEach((e=>{(function(e){return Gk()[`editor.${e}`]||!1})(e)&&n.push([`editor.${e}`,t[e]]),i&&function(e){return Gk()[`diffEditor.${e}`]||!1}(e)&&n.push([`diffEditor.${e}`,t[e]])})),n.length>0&&e.updateValues(n)}Vne.SCHEME="inmemory";let Hne=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const i=Array.isArray(e)?e:Yk.convert(e),n=new Map;for(const e of i){if(!(e instanceof Qk))throw new Error("bad edit - only text edits are supported");const t=this._modelService.getModel(e.resource);if(!t)throw new Error("bad edit - model not found");if("number"==typeof e.versionId&&t.getVersionId()!==e.versionId)throw new Error("bad state - model changed in the meantime");let i=n.get(t);i||(i=[],n.set(t,i)),i.push(vG.replaceMove(tc.lift(e.textEdit.range),e.textEdit.text))}let o=0,s=0;for(const[e,t]of n)e.pushStackElement(),e.pushEditOperations([],t,(()=>[])),e.pushStackElement(),s+=1,o+=t.length;return{ariaSummary:ln(H0.bulkEditServiceSummary,o,s),isApplied:o>0}}};Hne=Dne([Ene(0,uh)],Hne);let Une=class extends pte{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const e=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();e&&(t=e.getContainerDomNode())}return super.showContextView(e,t,i)}};Une=Dne([Ene(0,Cee),Ene(1,dh)],Une);let Kne=class extends Pte{constructor(e,t,i,n,o,s){super(e,t,i,n,o,s),this.configure({blockMouse:!1})}};var jne;Kne=Dne([Ene(0,Id),Ene(1,hL),Ene(2,jE),Ene(3,ML),Ene(4,Sd),Ene(5,sd)],Kne),wg(ug,Fne,0),wg($T,Bne,0),wg(GT,Wne,0),wg(EG,Vne,0),wg(IK,class{getUriLabel(e,t){return"file"===e.scheme?e.fsPath:e.path}getUriBasenameLabel(e){return Kl(e)}},0),wg(Id,class{publicLog2(){}},0),wg(K3,class{async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}doConfirm(e,t){let i=e;return t&&(i=i+"\n\n"+t),r.confirm(i)}async prompt(e){var t,i;let n;if(this.doConfirm(e.message,e.detail)){const o=[...null!==(t=e.buttons)&&void 0!==t?t:[]];e.cancelButton&&"string"!=typeof e.cancelButton&&"boolean"!=typeof e.cancelButton&&o.push(e.cancelButton),n=await(null===(i=o[0])||void 0===i?void 0:i.run({checkboxChecked:!1}))}return{result:n}}async error(e,t){await this.prompt({type:aL.Error,message:e,detail:t})}},0),wg(aI,class{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}},0),wg(hL,Tne,0),wg(kN,kne,0),wg(yu,class extends kte{constructor(){super()}},0),wg(g5,class extends T{constructor(){super(),this._onColorThemeChange=this._register(new q),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new q),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new g7,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(p7,S7(p7)),this._knownThemes.set(m7,S7(m7)),this._knownThemes.set(f7,S7(f7)),this._knownThemes.set(_7,S7(_7));const e=this._register(function(e){const t=new M,i=t.add(new q),n=NA();return t.add(n.onDidChange((()=>i.fire()))),e&&t.add(e.onDidProductIconThemeChange((()=>i.fire()))),{dispose:()=>t.dispose(),onDidChange:i.event,getCSS(){const t=e?e.getProductIconTheme():new g7,i={},o=e=>{const n=t.getIcon(e);if(!n)return;const o=n.font;return o?(i[o.id]=o.definition,`.codicon-${e.id}:before { content: '${n.fontCharacter}'; font-family: ${Cr(o.id)}; }`):`.codicon-${e.id}:before { content: '${n.fontCharacter}'; }`},s=[];for(const e of n.getIcons()){const t=o(e);t&&s.push(t)}for(const e in i){const t=i[e],n=t.weight?`font-weight: ${t.weight};`:"",o=t.style?`font-style: ${t.style};`:"",r=t.src.map((e=>`${wr(e.location)} format('${e.format}')`)).join(", ");s.push(`@font-face { src: ${r}; font-family: ${Cr(e)};${n}${o} font-display: block; }`)}return s.join("\n")}}}(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(p7),this._onOSSchemeChanged(),this._register(e.onDidChange((()=>{this._codiconCSS=e.getCSS(),this._updateCSS()}))),ne("(forced-colors: active)",(()=>{this._onOSSchemeChanged()}))}registerEditorContainer(e){return zs(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=$s(void 0,(e=>{e.className="monaco-colors",e.textContent=this._allCSS})),this._styleElements.push(this._globalStyleElement)),T.None}_registerShadowDomContainer(e){const t=$s(e,(e=>{e.className="monaco-colors",e.textContent=this._allCSS}));return this._styleElements.push(t),{dispose:()=>{for(let e=0;e<this._styleElements.length;e++)if(this._styleElements[e]===t)return void this._styleElements.splice(e,1)}}}defineTheme(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!C7(t.base)&&!C7(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new w7(e,t)),C7(e)&&this._knownThemes.forEach((t=>{t.base===e&&t.notifyBaseUpdated()})),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;t=this._knownThemes.has(e)?this._knownThemes.get(e):this._knownThemes.get(p7),this._updateActualTheme(t)}_updateActualTheme(e){e&&this._theme!==e&&(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=r.matchMedia("(forced-colors: active)").matches;if(e!==Iv(this._theme.type)){let t;t=Mv(this._theme.type)?e?f7:m7:e?_7:p7,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:i=>{t[i]||(e.push(i),t[i]=!0)}};b7.getThemingParticipants().forEach((e=>e(this._theme,i,this._environment)));const n=[];for(const e of v7.getColors()){const t=this._theme.getColor(e.id,!0);t&&n.push(`${bm(e.id)}: ${t.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${n.join("\n")} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(function(e){const t=[];for(let i=1,n=e.length;i<n;i++){const n=e[i];t[i]=`.mtk${i} { color: ${n}; }`}return t.push(".mtki { font-style: italic; }"),t.push(".mtkb { font-weight: bold; }"),t.push(".mtku { text-decoration: underline; text-underline-position: under; }"),t.push(".mtks { text-decoration: line-through; }"),t.push(".mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }"),t.join("\n")}(o)),this._themeCSS=e.join("\n"),this._updateCSS(),SC.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._styleElements.forEach((e=>e.textContent=this._allCSS))}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}},0),wg(Md,class extends xne{constructor(){super(new Od)}},0),wg(uh,Jte,0),wg(dR,jte,0),wg(sd,pne,0),wg(dL,class{withProgress(e,t,i){return t({report:()=>{}})}},0),wg(uL,Mne,0),wg(KN,class extends qN{constructor(){super(),this.applicationStorage=this._register(new zN(new HN,{hint:WN.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new zN(new HN,{hint:WN.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new zN(new HN,{hint:WN.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage((e=>this.emitDidChangeValue(1,e)))),this._register(this.profileStorage.onDidChangeStorage((e=>this.emitDidChangeValue(0,e)))),this._register(this.applicationStorage.onDidChangeStorage((e=>this.emitDidChangeValue(-1,e))))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}},0),wg(XZ,QT,0),wg(Zk,Hne,0),wg(P7,class{constructor(){this._neverEmitter=new q,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}},0),wg(gh,Ine,0),wg(BS,$ie,0),wg(gU,class{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new M,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,i;e!==this._lastFocusedWidget&&(null===(t=this._lastFocusedWidget)||void 0===t||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,null===(i=this._lastFocusedWidget)||void 0===i||i.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new aE($s(),"").style(eN)),this.lists.some((t=>t.widget===e)))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),Ks(e.getHTMLElement())&&this.setLastFocusedList(e),N(e.onDidFocus((()=>this.setLastFocusedList(e))),I((()=>this.lists.splice(this.lists.indexOf(i),1))),e.onDidDispose((()=>{this.lists=this.lists.filter((e=>e!==i)),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)})))}dispose(){this.disposables.dispose()}},0),wg(wh,Ane,0),wg(ML,Rne,0),wg(rI,Uie,0),wg(jE,Une,0),wg(Hx,Ute,0),wg(ZS,one,0),wg(qE,Kne,0),wg(Sd,Xie,0),wg(nZ,class{async playAudioCue(e,t){}},0),wg(VS,class{notify(e,t){}},0),function(e){const t=new TW;for(const[e,i]of Cg())t.set(e,i);const i=new bne(t,!0);t.set(lh,i),e.get=function(e){n||s({});const o=t.get(e);if(!o)throw new Error("Missing service "+e);return o instanceof vg?i.invokeFunction((t=>t.get(e))):o};let n=!1;const o=new q;function s(e){if(n)return i;n=!0;for(const[e,i]of Cg())t.get(e)||t.set(e,i);for(const i in e)if(e.hasOwnProperty(i)){const n=hh(i);t.get(n)instanceof vg&&t.set(n,e[i])}const s=rA();for(const e of s)try{i.createInstance(e)}catch(e){h(e)}return o.fire(),i}e.initialize=s,e.withServices=function(e){if(n)return e();const t=new M,i=t.add(o.event((()=>{i.dispose(),t.add(e())})));return t}}(jne||(jne={}));var qne=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},$ne=function(e,t){return function(i,n){t(i,n,e)}};let Gne=0,Zne=!1;let Yne=class extends oV{constructor(e,t,i,n,o,s,a,l,h,d,c,u){const g={...t};g.ariaLabel=g.ariaLabel||V0.editorViewAccessibleLabel,g.ariaLabel=g.ariaLabel+";"+V0.accessibilityHelpMessage,super(e,g,{},i,n,o,s,l,h,d,c,u),this._standaloneKeybindingService=a instanceof Rne?a:null,function(e){if(!e){if(Zne)return;Zne=!0}!function(e){Kr=document.createElement("div"),Kr.className="monaco-aria-container";const t=()=>{const e=document.createElement("div");return e.className="monaco-alert",e.setAttribute("role","alert"),e.setAttribute("aria-atomic","true"),Kr.appendChild(e),e};jr=t(),qr=t();const i=()=>{const e=document.createElement("div");return e.className="monaco-status",e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),Kr.appendChild(e),e};$r=i(),Gr=i(),e.appendChild(Kr)}(e||r.document.body)}(g.ariaContainerElement)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const n="DYNAMIC_"+ ++Gne,o=Bh.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,o),n}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),T.None;const t=e.id,i=e.label,n=Bh.and(Bh.equals("editorId",this.getId()),Bh.deserialize(e.precondition)),o=e.keybindings,s=Bh.and(n,Bh.deserialize(e.keybindingContext)),r=e.contextMenuGroupId||null,a=e.contextMenuOrder||0,l=(t,...i)=>Promise.resolve(e.run(this,...i)),h=new M,d=this.getId()+":"+t;if(h.add(Ch.registerCommand(d,l)),r){const e={command:{id:d,title:i},when:n,group:r,order:a};h.add(Ld.appendMenuItem(yd.EditorContext,e))}if(Array.isArray(o))for(const e of o)h.add(this._standaloneKeybindingService.addDynamicKeybinding(d,e,l,s));const c=new uB(d,i,i,void 0,n,((...t)=>Promise.resolve(e.run(this,...t))),this._contextKeyService);return this._actions.set(t,c),h.add(I((()=>{this._actions.delete(t)}))),h}_triggerCommand(e,t){if(this._codeEditorService instanceof wee)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};Yne=qne([$ne(2,lh),$ne(3,dh),$ne(4,wh),$ne(5,sd),$ne(6,ML),$ne(7,Tv),$ne(8,hL),$ne(9,BS),$ne(10,Yg),$ne(11,Jk)],Yne);let Qne=class extends Yne{constructor(e,t,i,n,o,s,r,a,l,h,d,c,u,g,p){const m={...t};zne(h,m,!1);const f=a.registerEditorContainer(e);"string"==typeof m.theme&&a.setTheme(m.theme),void 0!==m.autoDetectHighContrast&&a.setAutoDetectHighContrast(Boolean(m.autoDetectHighContrast));const _=m.model;let v;if(delete m.model,super(e,m,i,n,o,s,r,a,l,d,g,p),this._configurationService=h,this._standaloneThemeService=a,this._register(f),void 0===_){const e=u.getLanguageIdByMimeType(m.language)||m.language||Hg;v=Jne(c,u,m.value||"",e,void 0),this._ownsModel=!0}else v=_,this._ownsModel=!1;if(this._attachModel(v),v){const e={oldModelUrl:null,newModelUrl:v.uri};this._onDidChangeModel.fire(e)}}dispose(){super.dispose()}updateOptions(e){zne(this._configurationService,e,!1),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};Qne=qne([$ne(2,lh),$ne(3,dh),$ne(4,wh),$ne(5,sd),$ne(6,ML),$ne(7,g5),$ne(8,hL),$ne(9,ug),$ne(10,BS),$ne(11,uh),$ne(12,yu),$ne(13,Yg),$ne(14,Jk)],Qne);let Xne=class extends xY{constructor(e,t,i,n,o,s,r,a,l,h,d,c){const u={...t};zne(a,u,!0);const g=s.registerEditorContainer(e);"string"==typeof u.theme&&s.setTheme(u.theme),void 0!==u.autoDetectHighContrast&&s.setAutoDetectHighContrast(Boolean(u.autoDetectHighContrast)),super(e,u,{},n,i,o,c,h),this._configurationService=a,this._standaloneThemeService=s,this._register(g)}dispose(){super.dispose()}updateOptions(e){zne(this._configurationService,e,!0),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(Yne,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};function Jne(e,t,i,n,o){if(i=i||"",!n){const n=i.indexOf("\n");let s=i;return-1!==n&&(s=i.substring(0,n)),eoe(e,i,t.createByFilepathOrFirstLine(o||null,s),o)}return eoe(e,i,t.createById(n),o)}function eoe(e,t,i,n){return e.createModel(t,i,n)}Xne=qne([$ne(2,lh),$ne(3,sd),$ne(4,dh),$ne(5,g5),$ne(6,hL),$ne(7,ug),$ne(8,qE),$ne(9,uL),$ne(10,ZS),$ne(11,nZ)],Xne);var toe=i(6508),ioe={};ioe.styleTagTransform=Vr(),ioe.setAttributes=Pr(),ioe.insert=Rr().bind(null,"head"),ioe.domAPI=Tr(),ioe.insertStyleElement=Br(),Ir()(toe.Z,ioe),toe.Z&&toe.Z.locals&&toe.Z.locals;class noe extends mh{constructor(e){super(),this._getContext=e}runAction(e,t){return super.runAction(e,this._getContext())}}class ooe{constructor(e){this.viewModel=e}getId(){return this.viewModel}}let soe=class extends T{constructor(e,t,i,n){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=d$(this,void 0),this._collapsed=m$(this,(e=>{var t;return null===(t=this._viewModel.read(e))||void 0===t?void 0:t.collapsed.read(e)})),this._contentHeight=d$(this,500),this.height=m$(this,(e=>(this._collapsed.read(e)?0:this._contentHeight.read(e))+this._outerEditorHeight)),this._modifiedContentWidth=d$(this,0),this._modifiedWidth=d$(this,0),this._originalContentWidth=d$(this,0),this._originalWidth=d$(this,0),this.maxScroll=m$(this,(e=>{const t=this._modifiedContentWidth.read(e)-this._modifiedWidth.read(e),i=this._originalContentWidth.read(e)-this._originalWidth.read(e);return t>i?{maxScroll:t,width:this._modifiedWidth.read(e)}:{maxScroll:i,width:this._originalWidth.read(e)}})),this._elements=Dr("div.multiDiffEntry",[Dr("div.content",{style:{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden"}},[Dr("div.header@header",[Dr("div.collapse-button@collapseButton"),Dr("div.title.show-file-icons@title",[]),Dr("div.actions@actions")]),Dr("div.editorParent",{style:{flex:"1",display:"flex",flexDirection:"column"}},[Dr("div.editorContainer@editor",{style:{flex:"1"}})])])]),this.editor=this._register(this._instantiationService.createInstance(xY,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=roe(this.editor.getModifiedEditor()),this.isOriginalFocused=roe(this.editor.getOriginalEditor()),this.isFocused=m$(this,(e=>this.isModifedFocused.read(e)||this.isOriginalFocused.read(e))),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.title)):void 0,this._dataStore=new M,this._headerHeight=this._elements.header.clientHeight;const o=new gQ(this._elements.collapseButton,{});this._register(w$((e=>{o.element.className="",o.icon=this._collapsed.read(e)?Sl.chevronRight:Sl.chevronDown}))),this._register(o.onDidClick((()=>{var e;null===(e=this._viewModel.get())||void 0===e||e.collapsed.set(!this._collapsed.get(),void 0)}))),this._register(w$((e=>{this._elements.editor.style.display=this._collapsed.read(e)?"none":"block"}))),this.editor.getModifiedEditor().onDidLayoutChange((e=>{const t=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(t,void 0)})),this.editor.getOriginalEditor().onDidLayoutChange((e=>{const t=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(t,void 0)})),this._register(this.editor.onDidContentSizeChange((e=>{t$((t=>{this._contentHeight.set(e.contentHeight,t),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),t),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),t)}))}))),this._register(w$((e=>{const t=this.isFocused.read(e);this._elements.root.classList.toggle("focused",t)}))),this._container.appendChild(this._elements.root),this._outerEditorHeight=38,this._register(this._instantiationService.createInstance($$,this._elements.actions,yd.MultiDiffEditorFileToolbar,{actionRunner:this._register(new noe((()=>{var e,t;return null===(t=null===(e=this._viewModel.get())||void 0===e?void 0:e.diffEditorViewModel)||void 0===t?void 0:t.model.modified.uri}))),menuOptions:{shouldForwardArgs:!0}}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){function t(e){return{...e,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0}}const i=e.viewModel.entry.value;i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange((()=>{var e;this.editor.updateOptions(t(null!==(e=i.options)&&void 0!==e?e:{}))}))),t$((n=>{var o,s;null===(o=this._resourceLabel)||void 0===o||o.setUri(e.viewModel.diffEditorViewModel.model.modified.uri),this._dataStore.clear(),this._viewModel.set(e.viewModel,n),this.editor.setModel(e.viewModel.diffEditorViewModel,n),this.editor.updateOptions(t(null!==(s=i.options)&&void 0!==s?s:{}))}))}render(e,t,i,n){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";const o=Math.max(0,Math.min(e.length-this._headerHeight,n.start-e.start));this._elements.header.style.transform=`translateY(${o}px)`,t$((i=>{this.editor.layout({width:t,height:e.length-this._outerEditorHeight})})),this.editor.getOriginalEditor().setScrollTop(i),this._elements.header.classList.toggle("shadow",o>0||i>0)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};function roe(e){return D$((t=>{const i=new M;return i.add(e.onDidFocusEditorWidget((()=>t(!0)))),i.add(e.onDidBlurEditorWidget((()=>t(!1)))),i}),(()=>e.hasWidgetFocus()))}soe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(3,lh)],soe);class aoe{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){var t;let i;if(0===this._unused.size)i=this._create(e),this._itemData.set(i,e);else{const n=[...this._unused.values()];i=null!==(t=n.find((t=>this._itemData.get(t).getId()===e.getId())))&&void 0!==t?t:n[0],this._unused.delete(i),this._itemData.set(i,e),i.setData(e)}return this._used.add(i),{object:i,dispose:()=>{this._used.delete(i),this._unused.size>5?i.dispose():this._unused.add(i)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}var loe=function(e,t){return function(i,n){t(i,n,e)}};let hoe=class extends T{constructor(e,t,i,n,o,s){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=n,this._parentContextKeyService=o,this._parentInstantiationService=s,this._elements=Dr("div",{style:{overflowY:"hidden"}},[Dr("div@content",{style:{overflow:"hidden"}}),Dr("div.monaco-editor@overflowWidgetsDomNode",{})]),this._sizeObserver=this._register(new qG(this._element,void 0)),this._objectPool=this._register(new aoe((e=>{const t=this._instantiationService.createInstance(soe,this._elements.content,this._elements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return t.setData(e),t}))),this._scrollable=this._register(new _D({forceIntegerValues:!1,scheduleAtNextAnimationFrame:e=>Ls(as(this._element),e),smoothScrollDuration:100})),this._scrollableElement=this._register(new ED(this._elements.root,{vertical:1,horizontal:1,className:"monaco-component",useShadows:!1},this._scrollable)),this.scrollTop=D$(this._scrollableElement.onScroll,(()=>this._scrollableElement.getScrollPosition().scrollTop)),this.scrollLeft=D$(this._scrollableElement.onScroll,(()=>this._scrollableElement.getScrollPosition().scrollLeft)),this._viewItems=_$(this,((e,t)=>{const i=this._viewModel.read(e);return i?i.items.read(e).map((e=>t.add(new doe(e,this._objectPool,this.scrollLeft)))):[]})),this._totalHeight=this._viewItems.map(this,((e,t)=>e.reduce(((e,i)=>e+i.contentHeight.read(t)),0))),this.activeDiffItem=m$(this,(e=>this._viewItems.read(e).find((t=>{var i;return null===(i=t.template.read(e))||void 0===i?void 0:i.isFocused.read(e)})))),this.lastActiveDiffItem=function(e){let t;return m$((i=>(t=e(i,t),t)))}(((e,t)=>{var i;return null!==(i=this.activeDiffItem.read(e))&&void 0!==i?i:t})),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._parentInstantiationService.createChild(new TW([sd,this._contextKeyService])),this._contextKeyService.createKey(nc.inMultiDiffEditor.key,!0);const r=this._parentContextKeyService.createKey(nc.multiDiffEditorAllCollapsed.key,!1);this._register(w$((e=>{const t=this._viewModel.read(e);if(t){const i=t.items.read(e).every((t=>t.collapsed.read(e)));r.set(i)}}))),this._register(w$((e=>{const t=this.lastActiveDiffItem.read(e);e$((i=>{var n;null===(n=this._viewModel.read(e))||void 0===n||n.activeDiffItem.set(null==t?void 0:t.viewModel,i)}))}))),this._register(w$((e=>{const t=this._dimension.read(e);this._sizeObserver.observe(t)}))),this._elements.content.style.position="relative",this._register(w$((e=>{const t=this._sizeObserver.height.read(e);this._elements.root.style.height=`${t}px`;const i=this._totalHeight.read(e);this._elements.content.style.height=`${i}px`;const n=this._sizeObserver.width.read(e);let o=n;const s=_u(this._viewItems.read(e),(t=>t.maxScroll.read(e).maxScroll));s&&(o=n+s.maxScroll.read(e).maxScroll),this._scrollableElement.setScrollDimensions({width:n,height:t,scrollHeight:i,scrollWidth:o})}))),e.replaceChildren(this._scrollableElement.getDomNode()),this._register(I((()=>{e.replaceChildren()}))),this._register(this._register(w$((e=>{t$((t=>{this.render(e)}))}))))}render(e){const t=this.scrollTop.read(e);let i=0,n=0,o=0;const s=this._sizeObserver.height.read(e),r=du.ofStartAndLength(t,s),a=this._sizeObserver.width.read(e);for(const l of this._viewItems.read(e)){const h=l.contentHeight.read(e),d=Math.min(h,s),c=du.ofStartAndLength(n,d),u=du.ofStartAndLength(o,h);if(u.isBefore(r))i-=h-d,l.hide();else if(u.isAfter(r))l.hide();else{const e=Math.max(0,Math.min(r.start-u.start,h-d));i-=e;const n=du.ofStartAndLength(t+i,s);l.render(c,e,a,n)}n+=d,o+=h}this._elements.content.style.transform=`translateY(${-(t+i)}px)`}};hoe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([loe(4,sd),loe(5,lh)],hoe);class doe extends T{constructor(e,t,i){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._lastTemplateData=d$(this,{contentHeight:500,maxScroll:{maxScroll:0,width:0}}),this._templateRef=this._register(u$(this,void 0)),this.contentHeight=m$(this,(e=>{var t,i,n;return null!==(n=null===(i=null===(t=this._templateRef.read(e))||void 0===t?void 0:t.object.height)||void 0===i?void 0:i.read(e))&&void 0!==n?n:this._lastTemplateData.read(e).contentHeight})),this.maxScroll=m$(this,(e=>{var t,i;return null!==(i=null===(t=this._templateRef.read(e))||void 0===t?void 0:t.object.maxScroll.read(e))&&void 0!==i?i:this._lastTemplateData.read(e).maxScroll})),this.template=m$(this,(e=>{var t;return null===(t=this._templateRef.read(e))||void 0===t?void 0:t.object})),this._isHidden=d$(this,!1),this._register(w$((e=>{var t;const i=this._scrollLeft.read(e);null===(t=this._templateRef.read(e))||void 0===t||t.object.setScrollLeft(i)}))),this._register(w$((e=>{const t=this._templateRef.read(e);t&&this._isHidden.read(e)&&(t.object.isFocused.read(e)||e$((e=>{this._lastTemplateData.set({contentHeight:t.object.height.get(),maxScroll:{maxScroll:0,width:0}},e),t.object.hide(),this._templateRef.set(void 0,e)})))})))}dispose(){this.hide(),super.dispose()}toString(){return`VirtualViewItem(${this.viewModel.entry.value.title})`}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,n){this._isHidden.set(!1,void 0);let o=this._templateRef.get();o||(o=this._objectPool.getUnusedObj(new ooe(this.viewModel)),this._templateRef.set(o,void 0)),o.object.render(e,i,t,n)}}Sm("multiDiffEditor.headerBackground",{dark:"#808080",light:"#b4b4b4",hcDark:"#808080",hcLight:"#b4b4b4"},me(0,"The background color of the diff editor's header"));let coe=class extends T{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=d$(this,void 0),this._viewModel=d$(this,void 0),this._widgetImpl=_$(this,((e,t)=>(XG(soe,e),t.add(this._instantiationService.createInstance(XG(hoe,e),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory))))),this._register(A$(this._widgetImpl))}};function uoe(e){const t=jne.get(ML);return t instanceof Rne?t.addDynamicKeybindings(e.map((e=>({keybinding:e.keybinding,command:e.command,commandArgs:e.commandArgs,when:Bh.deserialize(e.when)})))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),T.None)}function goe(e,t){return"boolean"==typeof e?e:t}function poe(e,t){return"string"==typeof e?e:t}function moe(e,t=!1){t&&(e=e.map((function(e){return e.toLowerCase()})));const i=function(e){const t={};for(const i of e)t[i]=!0;return t}(e);return t?function(e){return void 0!==i[e.toLowerCase()]&&i.hasOwnProperty(e.toLowerCase())}:function(e){return void 0!==i[e]&&i.hasOwnProperty(e)}}function foe(e,t){t=t.replace(/@@/g,"");let i,n=0;do{i=!1,t=t.replace(/@(\w+)/g,(function(n,o){i=!0;let s="";if("string"==typeof e[o])s=e[o];else{if(!(e[o]&&e[o]instanceof RegExp))throw void 0===e[o]?iee(e,"language definition does not contain attribute '"+o+"', used at: "+t):iee(e,"attribute reference '"+o+"' must be a string, used at: "+t);s=e[o].source}return J8(s)?"":"(?:"+s+")"})),n++}while(i&&n<5);t=t.replace(/\x01/g,"@");const o=(e.ignoreCase?"i":"")+(e.unicode?"u":"");return new RegExp(t,o)}function _oe(e,t,i,n){let o=-1,s=i,r=i.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);r&&(r[3]&&(o=parseInt(r[3]),r[2]&&(o+=100)),s=r[4]);let a,l="~",h=s;if(s&&0!==s.length?/^\w*$/.test(h)?l="==":(r=s.match(/^(@|!@|~|!~|==|!=)(.*)$/),r&&(l=r[1],h=r[2])):(l="!=",h=""),"~"!==l&&"!~"!==l||!/^(\w|\|)*$/.test(h))if("@"===l||"!@"===l){const i=e[h];if(!i)throw iee(e,"the @ match target '"+h+"' is not defined, in rule: "+t);if(!function(e,t){if(!t)return!1;if(!Array.isArray(t))return!1;for(const e of t)if("string"!=typeof e)return!1;return!0}(0,i))throw iee(e,"the @ match target '"+h+"' must be an array of strings, in rule: "+t);const n=moe(i,e.ignoreCase);a=function(e){return"@"===l?n(e):!n(e)}}else if("~"===l||"!~"===l)if(h.indexOf("$")<0){const t=foe(e,"^"+h+"$");a=function(e){return"~"===l?t.test(e):!t.test(e)}}else a=function(t,i,n,o){return foe(e,"^"+nee(e,h,i,n,o)+"$").test(t)};else if(h.indexOf("$")<0){const t=eee(e,h);a=function(e){return"=="===l?e===t:e!==t}}else{const t=eee(e,h);a=function(i,n,o,s,r){const a=nee(e,t,n,o,s);return"=="===l?i===a:i!==a}}else{const t=moe(h.split("|"),e.ignoreCase);a=function(e){return"~"===l?t(e):!t(e)}}return-1===o?{name:i,value:n,test:function(e,t,i,n){return a(e,e,t,i,n)}}:{name:i,value:n,test:function(e,t,i,n){const s=function(e,t,i,n){if(n<0)return e;if(n<t.length)return t[n];if(n>=100){n-=100;const e=i.split(".");if(e.unshift(i),n<e.length)return e[n]}return null}(e,t,i,o);return a(s||"",e,t,i,n)}}}function voe(e,t,i){if(i){if("string"==typeof i)return i;if(i.token||""===i.token){if("string"!=typeof i.token)throw iee(e,"a 'token' attribute must be of type string, in rule: "+t);{const n={token:i.token};if(i.token.indexOf("$")>=0&&(n.tokenSubst=!0),"string"==typeof i.bracket)if("@open"===i.bracket)n.bracket=1;else{if("@close"!==i.bracket)throw iee(e,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+t);n.bracket=-1}if(i.next){if("string"!=typeof i.next)throw iee(e,"the next state must be a string value in rule: "+t);{let o=i.next;if(!/^(@pop|@push|@popall)$/.test(o)&&("@"===o[0]&&(o=o.substr(1)),o.indexOf("$")<0&&!function(e,t){let i=t;for(;i&&i.length>0;){if(e.stateNames[i])return!0;const t=i.lastIndexOf(".");i=t<0?null:i.substr(0,t)}return!1}(e,nee(e,o,"",[],""))))throw iee(e,"the next state '"+i.next+"' is not defined in rule: "+t);n.next=o}}return"number"==typeof i.goBack&&(n.goBack=i.goBack),"string"==typeof i.switchTo&&(n.switchTo=i.switchTo),"string"==typeof i.log&&(n.log=i.log),"string"==typeof i.nextEmbedded&&(n.nextEmbedded=i.nextEmbedded,e.usesEmbedded=!0),n}}if(Array.isArray(i)){const n=[];for(let o=0,s=i.length;o<s;o++)n[o]=voe(e,t,i[o]);return{group:n}}if(i.cases){const n=[];for(const o in i.cases)if(i.cases.hasOwnProperty(o)){const s=voe(e,t,i.cases[o]);"@default"===o||"@"===o||""===o?n.push({test:void 0,value:s,name:o}):"@eos"===o?n.push({test:function(e,t,i,n){return n},value:s,name:o}):n.push(_oe(e,t,o,s))}const o=e.defaultToken;return{test:function(e,t,i,s){for(const o of n)if(!o.test||o.test(e,t,i,s))return o.value;return o}}}throw iee(e,"an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: "+t)}return{token:""}}coe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(2,lh)],coe);class boe{constructor(e){this.regex=new RegExp(""),this.action={token:""},this.matchOnlyAtLineStart=!1,this.name="",this.name=e}setRegex(e,t){let i;if("string"==typeof t)i=t;else{if(!(t instanceof RegExp))throw iee(e,"rules must start with a match string or regular expression: "+this.name);i=t.source}this.matchOnlyAtLineStart=i.length>0&&"^"===i[0],this.name=this.name+": "+i,this.regex=foe(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=voe(e,this.name,t)}}function woe(e,t){if(!t||"object"!=typeof t)throw new Error("Monarch: expecting a language definition object");const i={};i.languageId=e,i.includeLF=goe(t.includeLF,!1),i.noThrow=!1,i.maxStack=100,i.start="string"==typeof t.start?t.start:null,i.ignoreCase=goe(t.ignoreCase,!1),i.unicode=goe(t.unicode,!1),i.tokenPostfix=poe(t.tokenPostfix,"."+i.languageId),i.defaultToken=poe(t.defaultToken,"source"),i.usesEmbedded=!1;const n=t;function o(e,s,r){for(const a of r){let r=a.include;if(r){if("string"!=typeof r)throw iee(i,"an 'include' attribute must be a string at: "+e);if("@"===r[0]&&(r=r.substr(1)),!t.tokenizer[r])throw iee(i,"include target '"+r+"' is not defined at: "+e);o(e+"."+r,s,t.tokenizer[r])}else{const t=new boe(e);if(Array.isArray(a)&&a.length>=1&&a.length<=3)if(t.setRegex(n,a[0]),a.length>=3)if("string"==typeof a[1])t.setAction(n,{token:a[1],next:a[2]});else{if("object"!=typeof a[1])throw iee(i,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+e);{const e=a[1];e.next=a[2],t.setAction(n,e)}}else t.setAction(n,a[1]);else{if(!a.regex)throw iee(i,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+e);a.name&&"string"==typeof a.name&&(t.name=a.name),a.matchOnlyAtStart&&(t.matchOnlyAtLineStart=goe(a.matchOnlyAtLineStart,!1)),t.setRegex(n,a.regex),t.setAction(n,a.action)}s.push(t)}}}if(n.languageId=e,n.includeLF=i.includeLF,n.ignoreCase=i.ignoreCase,n.unicode=i.unicode,n.noThrow=i.noThrow,n.usesEmbedded=i.usesEmbedded,n.stateNames=t.tokenizer,n.defaultToken=i.defaultToken,!t.tokenizer||"object"!=typeof t.tokenizer)throw iee(i,"a language definition must define the 'tokenizer' attribute as an object");i.tokenizer=[];for(const e in t.tokenizer)if(t.tokenizer.hasOwnProperty(e)){i.start||(i.start=e);const n=t.tokenizer[e];i.tokenizer[e]=new Array,o("tokenizer."+e,i.tokenizer[e],n)}if(i.usesEmbedded=n.usesEmbedded,t.brackets){if(!Array.isArray(t.brackets))throw iee(i,"the 'brackets' attribute must be defined as an array")}else t.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const s=[];for(const e of t.brackets){let t=e;if(t&&Array.isArray(t)&&3===t.length&&(t={token:t[2],open:t[0],close:t[1]}),t.open===t.close)throw iee(i,"open and close brackets in a 'brackets' attribute must be different: "+t.open+"\n hint: use the 'bracket' attribute if matching on equal brackets is required.");if("string"!=typeof t.open||"string"!=typeof t.token||"string"!=typeof t.close)throw iee(i,"every element in the 'brackets' array must be a '{open,close,token}' object or array");s.push({token:t.token+i.tokenPostfix,open:eee(i,t.open),close:eee(i,t.close)})}return i.brackets=s,i.noThrow=!0,i}class Coe{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if("function"==typeof this._actual.tokenize)return yoe.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new cC(n.tokens,n.endState)}}class yoe{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let o=0,s=e.length;o<s;o++){const s=e[o];let r=s.startIndex;0===o?r=0:r<n&&(r=n),i[o]=new hC(r,s.scopes,t),n=r}return i}static adaptTokenize(e,t,i,n){const o=t.tokenize(i,n),s=yoe._toClassicTokens(o.tokens,e);let r;return r=o.endState.equals(n)?n:o.endState,new dC(s,r)}tokenize(e,t,i){return yoe.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,o=[];let s=0,r=0;for(let e=0,a=t.length;e<a;e++){const a=t[e],l=1024|n.match(i,a.scopes);if(s>0&&o[s-1]===l)continue;let h=a.startIndex;0===e?h=0:h<r&&(h=r),o[s++]=h,o[s++]=l,r=h}const a=new Uint32Array(s);for(let e=0;e<s;e++)a[e]=o[e];return a}tokenizeEncoded(e,t,i){const n=this._actual.tokenize(e,i),o=this._toBinaryTokens(this._languageService.languageIdCodec,n.tokens);let s;return s=n.endState.equals(i)?i:n.endState,new cC(o,s)}}function Soe(e){return e&&"function"==typeof e.then}function koe(e,t){return function(e){return"tokenizeEncoded"in e}(t)?new Coe(e,t):new yoe(e,t,jne.get(yu),jne.get(g5))}function Loe(e,t){const i=new yC((async()=>{const i=await Promise.resolve(t.create());return i?function(e){return"function"==typeof e.getInitialState}(i)?koe(e,i):new gee(jne.get(yu),jne.get(g5),e,woe(e,i),jne.get(ug)):null}));return SC.registerFactory(e,i)}Uk.wrappingIndent.defaultValue=0,Uk.glyphMargin.defaultValue=!1,Uk.autoIndent.defaultValue=3,Uk.overviewRulerLanes.defaultValue=2,C0.setFormatterSelector(((e,t,i)=>Promise.resolve(e[0])));const xoe=$M();xoe.editor={create:function(e,t,i){return jne.initialize(i||{}).createInstance(Qne,e,t)},getEditors:function(){return jne.get(dh).listCodeEditors()},getDiffEditors:function(){return jne.get(dh).listDiffEditors()},onDidCreateEditor:function(e){return jne.get(dh).onCodeEditorAdd((t=>{e(t)}))},onDidCreateDiffEditor:function(e){return jne.get(dh).onDiffEditorAdd((t=>{e(t)}))},createDiffEditor:function(e,t,i){return jne.initialize(i||{}).createInstance(Xne,e,t)},addCommand:function(e){if("string"!=typeof e.id||"function"!=typeof e.run)throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return Ch.registerCommand(e.id,e.run)},addEditorAction:function(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const t=Bh.deserialize(e.precondition),i=new M;if(i.add(Ch.registerCommand(e.id,((i,...n)=>Vd.runEditorCommand(i,n,t,((t,i,n)=>Promise.resolve(e.run(i,...n))))))),e.contextMenuGroupId){const n={command:{id:e.id,title:e.label},when:t,group:e.contextMenuGroupId,order:e.contextMenuOrder||0};i.add(Ld.appendMenuItem(yd.EditorContext,n))}if(Array.isArray(e.keybindings)){const n=jne.get(ML);if(n instanceof Rne){const o=Bh.and(t,Bh.deserialize(e.keybindingContext));i.add(n.addDynamicKeybindings(e.keybindings.map((t=>({keybinding:t,command:e.id,when:o})))))}else console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService")}return i},addKeybindingRule:function(e){return uoe([e])},addKeybindingRules:uoe,createModel:function(e,t,i){const n=jne.get(yu),o=n.getLanguageIdByMimeType(t)||t;return Jne(jne.get(uh),n,e,o,i)},setModelLanguage:function(e,t){const i=jne.get(yu),n=i.getLanguageIdByMimeType(t)||t||Hg;e.setLanguage(i.createById(n))},setModelMarkers:function(e,t,i){e&&jne.get(kN).changeOne(t,e.uri,i)},getModelMarkers:function(e){return jne.get(kN).read(e)},removeAllMarkers:function(e){jne.get(kN).changeAll(e,[])},onDidChangeMarkers:function(e){return jne.get(kN).onMarkerChanged(e)},getModels:function(){return jne.get(uh).getModels()},getModel:function(e){return jne.get(uh).getModel(e)},onDidCreateModel:function(e){return jne.get(uh).onModelAdded(e)},onWillDisposeModel:function(e){return jne.get(uh).onModelRemoved(e)},onDidChangeModelLanguage:function(e){return jne.get(uh).onModelLanguageChanged((t=>{e({model:t.model,oldLanguage:t.oldLanguageId})}))},createWebWorker:function(e){return function(e,t,i){return new Y8(e,t,i)}(jne.get(uh),jne.get(Yg),e)},colorizeElement:function(e,t){const i=jne.get(yu),n=jne.get(g5);return fee.colorizeElement(n,i,e,t).then((()=>{n.registerEditorContainer(e)}))},colorize:function(e,t,i){const n=jne.get(yu);return jne.get(g5).registerEditorContainer(r.document.body),fee.colorize(n,e,t,i)},colorizeModelLine:function(e,t,i=4){return jne.get(g5).registerEditorContainer(r.document.body),fee.colorizeModelLine(e,t,i)},tokenize:function(e,t){SC.getOrCreate(t);const i=function(e){return SC.get(e)||{getInitialState:()=>kC,tokenize:(t,i,n)=>LC(e,n)}}(t),n=mn(e),o=[];let s=i.getInitialState();for(let e=0,t=n.length;e<t;e++){const t=n[e],r=i.tokenize(t,!0,s);o[e]=r.tokens,s=r.endState}return o},defineTheme:function(e,t){jne.get(g5).defineTheme(e,t)},setTheme:function(e){jne.get(g5).setTheme(e)},remeasureFonts:function(){yR.clearAllFontInfos()},registerCommand:function(e,t){return Ch.registerCommand({id:e,handler:t})},registerLinkOpener:function(e){return jne.get(Hx).registerOpener({open:async t=>("string"==typeof t&&(t=Ro.parse(t)),e.open(t))})},registerEditorOpener:function(e){return jne.get(dh).registerCodeEditorOpenHandler((async(t,i,n)=>{var o;if(!i)return null;const s=null===(o=t.options)||void 0===o?void 0:o.selection;let r;return s&&"number"==typeof s.endLineNumber&&"number"==typeof s.endColumn?r=s:s&&(r={lineNumber:s.startLineNumber,column:s.startColumn}),await e.openCodeEditor(i,t.resource,r)?i:null}))},AccessibilitySupport:rM,ContentWidgetPositionPreference:uM,CursorChangeReason:gM,DefaultEndOfLine:pM,EditorAutoIndentStrategy:fM,EditorOption:_M,EndOfLinePreference:vM,EndOfLineSequence:bM,MinimapPosition:EM,MouseTargetType:NM,OverlayWidgetPositionPreference:IM,OverviewRulerLane:MM,GlyphMarginLane:wM,RenderLineNumbersType:AM,RenderMinimap:RM,ScrollbarVisibility:PM,ScrollType:OM,TextEditorCursorBlinkingStyle:HM,TextEditorCursorStyle:UM,TrackedRangeStickiness:KM,WrappingIndent:jM,InjectedTextCursorStops:yM,PositionAffinity:TM,ShowAiIconMode:BM,ConfigurationChangedEvent:rk,BareFontInfo:bR,FontInfo:wR,TextModelResolvedOptions:Sc,FindMatch:kc,ApplyUpdateResult:hk,EditorZoom:_R,createMultiFileDiffEditor:function(e,t){const i=jne.initialize(t||{});return new coe(e,{},i)},EditorType:gB,EditorOptions:Uk},xoe.languages={register:function(e){zg.registerLanguage(e)},getLanguages:function(){let e=[];return e=e.concat(zg.getLanguages()),e},onLanguage:function(e,t){return jne.withServices((()=>{const i=jne.get(yu).onDidRequestRichLanguageFeatures((n=>{n===e&&(i.dispose(),t())}));return i}))},onLanguageEncountered:function(e,t){return jne.withServices((()=>{const i=jne.get(yu).onDidRequestBasicLanguageFeatures((n=>{n===e&&(i.dispose(),t())}));return i}))},getEncodedLanguageId:function(e){return jne.get(yu).languageIdCodec.encodeLanguageId(e)},setLanguageConfiguration:function(e,t){if(!jne.get(yu).isRegisteredLanguageId(e))throw new Error(`Cannot set configuration for unknown language ${e}`);return jne.get(Yg).register(e,t,100)},setColorMap:function(e){const t=jne.get(g5);if(e){const i=[null];for(let t=1,n=e.length;t<n;t++)i[t]=ru.fromHex(e[t]);t.setColorMapOverride(i)}else t.setColorMapOverride(null)},registerTokensProviderFactory:Loe,setTokensProvider:function(e,t){if(!jne.get(yu).isRegisteredLanguageId(e))throw new Error(`Cannot set tokens provider for unknown language ${e}`);return Soe(t)?Loe(e,{create:()=>t}):SC.register(e,koe(e,t))},setMonarchTokensProvider:function(e,t){return Soe(t)?Loe(e,{create:()=>t}):SC.register(e,(t=>new gee(jne.get(yu),jne.get(g5),e,woe(e,t),jne.get(ug)))(t))},registerReferenceProvider:function(e,t){return jne.get(Jk).referenceProvider.register(e,t)},registerRenameProvider:function(e,t){return jne.get(Jk).renameProvider.register(e,t)},registerCompletionItemProvider:function(e,t){return jne.get(Jk).completionProvider.register(e,t)},registerSignatureHelpProvider:function(e,t){return jne.get(Jk).signatureHelpProvider.register(e,t)},registerHoverProvider:function(e,t){return jne.get(Jk).hoverProvider.register(e,{provideHover:(e,i,n)=>{const o=e.getWordAtPosition(i);return Promise.resolve(t.provideHover(e,i,n)).then((e=>{if(e)return!e.range&&o&&(e.range=new tc(i.lineNumber,o.startColumn,i.lineNumber,o.endColumn)),e.range||(e.range=new tc(i.lineNumber,i.column,i.lineNumber,i.column)),e}))}})},registerDocumentSymbolProvider:function(e,t){return jne.get(Jk).documentSymbolProvider.register(e,t)},registerDocumentHighlightProvider:function(e,t){return jne.get(Jk).documentHighlightProvider.register(e,t)},registerLinkedEditingRangeProvider:function(e,t){return jne.get(Jk).linkedEditingRangeProvider.register(e,t)},registerDefinitionProvider:function(e,t){return jne.get(Jk).definitionProvider.register(e,t)},registerImplementationProvider:function(e,t){return jne.get(Jk).implementationProvider.register(e,t)},registerTypeDefinitionProvider:function(e,t){return jne.get(Jk).typeDefinitionProvider.register(e,t)},registerCodeLensProvider:function(e,t){return jne.get(Jk).codeLensProvider.register(e,t)},registerCodeActionProvider:function(e,t,i){return jne.get(Jk).codeActionProvider.register(e,{providedCodeActionKinds:null==i?void 0:i.providedCodeActionKinds,documentation:null==i?void 0:i.documentation,provideCodeActions:(e,i,n,o)=>{const s=jne.get(kN).read({resource:e.uri}).filter((e=>tc.areIntersectingOrTouching(e,i)));return t.provideCodeActions(e,i,{markers:s,only:n.only,trigger:n.trigger},o)},resolveCodeAction:t.resolveCodeAction})},registerDocumentFormattingEditProvider:function(e,t){return jne.get(Jk).documentFormattingEditProvider.register(e,t)},registerDocumentRangeFormattingEditProvider:function(e,t){return jne.get(Jk).documentRangeFormattingEditProvider.register(e,t)},registerOnTypeFormattingEditProvider:function(e,t){return jne.get(Jk).onTypeFormattingEditProvider.register(e,t)},registerLinkProvider:function(e,t){return jne.get(Jk).linkProvider.register(e,t)},registerColorProvider:function(e,t){return jne.get(Jk).colorProvider.register(e,t)},registerFoldingRangeProvider:function(e,t){return jne.get(Jk).foldingRangeProvider.register(e,t)},registerDeclarationProvider:function(e,t){return jne.get(Jk).declarationProvider.register(e,t)},registerSelectionRangeProvider:function(e,t){return jne.get(Jk).selectionRangeProvider.register(e,t)},registerDocumentSemanticTokensProvider:function(e,t){return jne.get(Jk).documentSemanticTokensProvider.register(e,t)},registerDocumentRangeSemanticTokensProvider:function(e,t){return jne.get(Jk).documentRangeSemanticTokensProvider.register(e,t)},registerInlineCompletionsProvider:function(e,t){return jne.get(Jk).inlineCompletionsProvider.register(e,t)},registerInlayHintsProvider:function(e,t){return jne.get(Jk).inlayHintsProvider.register(e,t)},DocumentHighlightKind:mM,CompletionItemKind:hM,CompletionItemTag:dM,CompletionItemInsertTextRule:lM,SymbolKind:VM,SymbolTag:zM,IndentAction:CM,CompletionTriggerKind:cM,SignatureHelpTriggerKind:WM,InlayHintKind:SM,InlineCompletionTriggerKind:kM,CodeActionTriggerType:aM,FoldingRangeKind:CC,SelectedSuggestionInfo:fC},xoe.CancellationTokenSource,xoe.Emitter,xoe.KeyCode,xoe.KeyMod,xoe.Position,xoe.Range,xoe.Selection,xoe.SelectionDirection,xoe.MarkerSeverity,xoe.MarkerTag,xoe.Uri,xoe.Token;const Doe=xoe.editor,Eoe=xoe.languages,Noe=globalThis.MonacoEnvironment;var Ioe;((null==Noe?void 0:Noe.globalAPI)||"function"==typeof define&&i.amdO)&&(globalThis.monaco=xoe),void 0!==globalThis.require&&"function"==typeof globalThis.require.config&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]}),self.MonacoEnvironment=(Ioe={editorWorkerService:"editor.worker.js"},{globalAPI:!1,getWorkerUrl:function(e,t){var n=i.p,o=(n?n.replace(/\/$/,"")+"/":"")+Ioe[t];if(/^((http:)|(https:)|(file:)|(\/\/))/.test(o)){var s=String(window.location),r=s.substr(0,s.length-window.location.hash.length-window.location.search.length-window.location.pathname.length);if(o.substring(0,r.length)!==r){/^(\/\/)/.test(o)&&(o=window.location.protocol+o);var a=new Blob(["/*"+t+'*/importScripts("'+o+'");'],{type:"application/javascript"});return URL.createObjectURL(a)}}return o}});let Moe="undefined"!=typeof document&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function Toe(e,t,...i){return function(e,t){let i;return i=0===t.length?e:e.replace(/\{(\d+)\}/g,((e,i)=>{const n=i[0],o=t[n];let s=e;return"string"==typeof o?s=o:"number"!=typeof o&&"boolean"!=typeof o&&null!=o||(s=String(o)),s})),Moe&&(i="["+i.replace(/[aouei]/g,"$&$&")+"]"),i}(t,i)}var Aoe;const Roe="en";let Ooe,Poe,Foe=!1,Boe=!1,Woe=!1,Voe=!1,zoe=!1,Hoe=!1,Uoe=!1,Koe=!1,joe=!1,qoe=!1,$oe=null,Goe=null;const Zoe="object"==typeof self?self:"object"==typeof i.g?i.g:{};let Yoe;void 0!==Zoe.vscode&&void 0!==Zoe.vscode.process?Yoe=Zoe.vscode.process:"undefined"!=typeof process&&(Yoe=process);const Qoe="string"==typeof(null===(Aoe=null==Yoe?void 0:Yoe.versions)||void 0===Aoe?void 0:Aoe.electron),Xoe=Qoe&&"renderer"===(null==Yoe?void 0:Yoe.type);if("object"!=typeof navigator||Xoe)if("object"==typeof Yoe){Foe="win32"===Yoe.platform,Boe="darwin"===Yoe.platform,Woe="linux"===Yoe.platform,Voe=Woe&&!!Yoe.env.SNAP&&!!Yoe.env.SNAP_REVISION,Uoe=Qoe,joe=!!Yoe.env.CI||!!Yoe.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Ooe=Roe,$oe=Roe;const e=Yoe.env.VSCODE_NLS_CONFIG;if(e)try{const t=JSON.parse(e),i=t.availableLanguages["*"];Ooe=t.locale,$oe=i||Roe,Goe=t._translationsConfigFile}catch(e){}zoe=!0}else console.error("Unable to resolve platform.");else Poe=navigator.userAgent,Foe=Poe.indexOf("Windows")>=0,Boe=Poe.indexOf("Macintosh")>=0,Koe=(Poe.indexOf("Macintosh")>=0||Poe.indexOf("iPad")>=0||Poe.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Woe=Poe.indexOf("Linux")>=0,qoe=(null==Poe?void 0:Poe.indexOf("Mobi"))>=0,Hoe=!0,Ooe=void Toe(0,"_")||Roe,$oe=Ooe;let Joe=0;Boe?Joe=1:Foe?Joe=3:Woe&&(Joe=2);const ese=Foe,tse=Boe,ise=Woe,nse=zoe,ose=Hoe,sse=Hoe&&"function"==typeof Zoe.importScripts,rse=Koe,ase=qoe,lse=Poe,hse="function"==typeof Zoe.postMessage&&!Zoe.importScripts,dse=(()=>{if(hse){const e=[];Zoe.addEventListener("message",(t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,n=e.length;i<n;i++){const n=e[i];if(n.id===t.data.vscodeScheduleAsyncWork)return e.splice(i,1),void n.callback()}}));let t=0;return i=>{const n=++t;e.push({id:n,callback:i}),Zoe.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})(),cse=Boe||Koe?2:Foe?1:3;let use=!0,gse=!1;function pse(){if(!gse){gse=!0;const e=new Uint8Array(2);e[0]=1,e[1]=2;const t=new Uint16Array(e.buffer);use=513===t[0]}return use}const mse=!!(lse&&lse.indexOf("Chrome")>=0),fse=!!(lse&&lse.indexOf("Firefox")>=0),_se=!!(!mse&&lse&&lse.indexOf("Safari")>=0),vse=!!(lse&&lse.indexOf("Edg/")>=0);var bse;lse&&lse.indexOf("Android"),function(e){function t(e){return e&&"object"==typeof e&&"function"==typeof e[Symbol.iterator]}e.is=t;const i=Object.freeze([]);function*n(e){yield e}e.empty=function(){return i},e.single=n,e.wrap=function(e){return t(e)?e:n(e)},e.from=function(e){return e||i},e.isEmpty=function(e){return!e||!0===e[Symbol.iterator]().next().done},e.first=function(e){return e[Symbol.iterator]().next().value},e.some=function(e,t){for(const i of e)if(t(i))return!0;return!1},e.find=function(e,t){for(const i of e)if(t(i))return i},e.filter=function*(e,t){for(const i of e)t(i)&&(yield i)},e.map=function*(e,t){let i=0;for(const n of e)yield t(n,i++)},e.concat=function*(...e){for(const t of e)for(const e of t)yield e},e.reduce=function(e,t,i){let n=i;for(const i of e)n=t(n,i);return n},e.slice=function*(e,t,i=e.length){for(t<0&&(t+=e.length),i<0?i+=e.length:i>e.length&&(i=e.length);t<i;t++)yield e[t]},e.consume=function(t,i=Number.POSITIVE_INFINITY){const n=[];if(0===i)return[n,t];const o=t[Symbol.iterator]();for(let t=0;t<i;t++){const t=o.next();if(t.done)return[n,e.empty()];n.push(t.value)}return[n,{[Symbol.iterator]:()=>o}]}}(bse||(bse={}));class wse{constructor(e){this.element=e,this.next=wse.Undefined,this.prev=wse.Undefined}}wse.Undefined=new wse(void 0);class Cse{constructor(){this._first=wse.Undefined,this._last=wse.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===wse.Undefined}clear(){let e=this._first;for(;e!==wse.Undefined;){const t=e.next;e.prev=wse.Undefined,e.next=wse.Undefined,e=t}this._first=wse.Undefined,this._last=wse.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new wse(e);if(this._first===wse.Undefined)this._first=i,this._last=i;else if(t){const e=this._last;this._last=i,i.prev=e,e.next=i}else{const e=this._first;this._first=i,i.next=e,e.prev=i}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(i))}}shift(){if(this._first!==wse.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==wse.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==wse.Undefined&&e.next!==wse.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===wse.Undefined&&e.next===wse.Undefined?(this._first=wse.Undefined,this._last=wse.Undefined):e.next===wse.Undefined?(this._last=this._last.prev,this._last.next=wse.Undefined):e.prev===wse.Undefined&&(this._first=this._first.next,this._first.prev=wse.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==wse.Undefined;)yield e.element,e=e.next}}const yse="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?",Sse=function(e=""){let t="(-?\\d*\\.\\d\\w*)|([^";for(const i of yse)e.indexOf(i)>=0||(t+="\\"+i);return t+="\\s]+)",new RegExp(t,"g")}();function kse(e){let t=Sse;if(e&&e instanceof RegExp)if(e.global)t=e;else{let i="g";e.ignoreCase&&(i+="i"),e.multiline&&(i+="m"),e.unicode&&(i+="u"),t=new RegExp(e.source,i)}return t.lastIndex=0,t}const Lse=new Cse;function xse(e,t,i,n,o){if(o||(o=bse.first(Lse)),i.length>o.maxLen){let s=e-o.maxLen/2;return s<0?s=0:n+=s,xse(e,t,i=i.substring(s,e+o.maxLen/2),n,o)}const s=Date.now(),r=e-1-n;let a=-1,l=null;for(let e=1;!(Date.now()-s>=o.timeBudget);e++){const n=r-o.windowSize*e;t.lastIndex=Math.max(0,n);const s=Dse(t,i,r,a);if(!s&&l)break;if(l=s,n<=0)break;a=n}if(l){const e={word:l[0],startColumn:n+1+l.index,endColumn:n+1+l.index+l[0].length};return t.lastIndex=0,e}return null}function Dse(e,t,i,n){let o;for(;o=e.exec(t);){const t=o.index||0;if(t<=i&&e.lastIndex>=i)return o;if(n>0&&t>n)return null}return null}function Ese(e,t=0){return e[e.length-(1+t)]}function Nse(e,t,i=((e,t)=>e===t)){if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(let n=0,o=e.length;n<o;n++)if(!i(e[n],t[n]))return!1;return!0}function Ise(e){return Array.isArray(e)&&e.length>0}function Mse(e,t=(e=>e)){const i=new Set;return e.filter((e=>{const n=t(e);return!i.has(n)&&(i.add(n),!0)}))}function Tse(e,t){return e.length>0?e[0]:t}function Ase(e,t){let i="number"==typeof t?e:0;"number"==typeof t?i=e:(i=0,t=e);const n=[];if(i<=t)for(let e=i;e<t;e++)n.push(e);else for(let e=i;e>t;e--)n.push(e);return n}function Rse(e,t,i){const n=e.slice(0,t),o=e.slice(t);return n.concat(i,o)}function Ose(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.unshift(t))}function Pse(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.push(t))}function Fse(e,t){for(const i of t)e.push(i)}function Bse(e,t,i,n){const o=Wse(e,t),s=e.splice(o,i);return function(e,t,i){const n=Wse(e,t),o=e.length,s=i.length;e.length=o+s;for(let t=o-1;t>=n;t--)e[t+s]=e[t];for(let t=0;t<s;t++)e[t+n]=i[t]}(e,o,n),s}function Wse(e,t){return t<0?Math.max(t+e.length,0):Math.min(t,e.length)}var Vse;function zse(e,t){return(i,n)=>t(e(i),e(n))}Lse.unshift({maxLen:1e3,windowSize:15,timeBudget:150}),function(e){e.isLessThan=function(e){return e<0},e.isGreaterThan=function(e){return e>0},e.isNeitherLessOrGreaterThan=function(e){return 0===e},e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0}(Vse||(Vse={}));class Hse{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;const i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(0!==this.length)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class Use{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate((t=>(e.push(t),!0))),e}filter(e){return new Use((t=>this.iterate((i=>!e(i)||t(i)))))}map(e){return new Use((t=>this.iterate((i=>t(e(i))))))}findLast(e){let t;return this.iterate((i=>(e(i)&&(t=i),!0))),t}findLastMaxBy(e){let t,i=!0;return this.iterate((n=>((i||Vse.isGreaterThan(e(n,t)))&&(i=!1,t=n),!0))),t}}function Kse(e){return"string"==typeof e}function jse(e){return!("object"!=typeof e||null===e||Array.isArray(e)||e instanceof RegExp||e instanceof Date)}function qse(e){const t=Object.getPrototypeOf(Uint8Array);return"object"==typeof e&&e instanceof t}function $se(e){return"number"==typeof e&&!isNaN(e)}function Gse(e){return!!e&&"function"==typeof e[Symbol.iterator]}function Zse(e){return!0===e||!1===e}function Yse(e){return void 0===e}function Qse(e){return!Xse(e)}function Xse(e){return Yse(e)||null===e}function Jse(e,t){if(!e)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function ere(e){return"function"==typeof e}function tre(e,t){if(Kse(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(ere(t)){try{if(e instanceof t)return}catch(e){}if(!Xse(e)&&e.constructor===t)return;if(1===t.length&&!0===t.call(void 0,e))return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function ire(e){return null===e?void 0:e}function nre(e){if(!e||"object"!=typeof e)return e;if(e instanceof RegExp)return e;const t=Array.isArray(e)?[]:{};return Object.entries(e).forEach((([e,i])=>{t[e]=i&&"object"==typeof i?nre(i):i})),t}Use.empty=new Use((e=>{}));const ore=Object.prototype.hasOwnProperty;function sre(e,t){return rre(e,t,new Set)}function rre(e,t,i){if(Xse(e))return e;const n=t(e);if(void 0!==n)return n;if(Array.isArray(e)){const n=[];for(const o of e)n.push(rre(o,t,i));return n}if(jse(e)){if(i.has(e))throw new Error("Cannot clone recursive data-structure");i.add(e);const n={};for(const o in e)ore.call(e,o)&&(n[o]=rre(e[o],t,i));return i.delete(e),n}return e}function are(e,t,i=!0){return jse(e)?(jse(t)&&Object.keys(t).forEach((n=>{n in e?i&&(jse(e[n])&&jse(t[n])?are(e[n],t[n],i):e[n]=t[n]):e[n]=t[n]})),e):t}function lre(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;let i,n;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(!lre(e[i],t[i]))return!1}else{const o=[];for(n in e)o.push(n);o.sort();const s=[];for(n in t)s.push(n);if(s.sort(),!lre(o,s))return!1;for(i=0;i<o.length;i++)if(!lre(e[o[i]],t[o[i]]))return!1}return!0}function hre(e){const t=[];for(const i of function(e){let t=[],i=Object.getPrototypeOf(e);for(;Object.prototype!==i;)t=t.concat(Object.getOwnPropertyNames(i)),i=Object.getPrototypeOf(i);return t}(e))"function"==typeof e[i]&&t.push(i);return t}const dre={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};class cre{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class ure{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class gre{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return mre(e,t)}compute(e,t,i){return i}}class pre{constructor(e,t){this.newValue=e,this.didChange=t}}function mre(e,t){if("object"!=typeof e||"object"!=typeof t||!e||!t)return new pre(t,e!==t);if(Array.isArray(e)||Array.isArray(t)){const i=Array.isArray(e)&&Array.isArray(t)&&Nse(e,t);return new pre(t,!i)}let i=!1;for(const n in t)if(t.hasOwnProperty(n)){const o=mre(e[n],t[n]);o.didChange&&(e[n]=o.newValue,i=!0)}return new pre(e,i)}class fre{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return mre(e,t)}validate(e){return this.defaultValue}}class _re{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return mre(e,t)}validate(e){return void 0===e?this.defaultValue:e}compute(e,t,i){return i}}function vre(e,t){return void 0===e?t:"false"!==e&&Boolean(e)}class bre extends _re{constructor(e,t,i,n=void 0){void 0!==n&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return vre(e,this.defaultValue)}}function wre(e,t,i,n){if(void 0===e)return t;let o=parseInt(e,10);return isNaN(o)?t:(o=Math.max(i,o),o=Math.min(n,o),0|o)}class Cre extends _re{static clampedInt(e,t,i,n){return wre(e,t,i,n)}constructor(e,t,i,n,o,s=void 0){void 0!==s&&(s.type="integer",s.default=i,s.minimum=n,s.maximum=o),super(e,t,i,s),this.minimum=n,this.maximum=o}validate(e){return Cre.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}class yre extends _re{static clamp(e,t,i){return e<t?t:e>i?i:e}static float(e,t){if("number"==typeof e)return e;if(void 0===e)return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,n,o){void 0!==o&&(o.type="number",o.default=i),super(e,t,i,o),this.validationFn=n}validate(e){return this.validationFn(yre.float(e,this.defaultValue))}}class Sre extends _re{static string(e,t){return"string"!=typeof e?t:e}constructor(e,t,i,n=void 0){void 0!==n&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return Sre.string(e,this.defaultValue)}}function kre(e,t,i){return"string"!=typeof e||-1===i.indexOf(e)?t:e}class Lre extends _re{constructor(e,t,i,n,o=void 0){void 0!==o&&(o.type="string",o.enum=n,o.default=i),super(e,t,i,o),this._allowedValues=n}validate(e){return kre(e,this.defaultValue,this._allowedValues)}}class xre extends gre{constructor(e,t,i,n,o,s,r=void 0){void 0!==r&&(r.type="string",r.enum=o,r.default=n),super(e,t,i,r),this._allowedValues=o,this._convert=s}validate(e){return"string"!=typeof e||-1===this._allowedValues.indexOf(e)?this.defaultValue:this._convert(e)}}var Dre;!function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"}(Dre||(Dre={}));class Ere extends gre{constructor(){super(48,"fontLigatures",Ere.OFF,{anyOf:[{type:"boolean",description:Toe(0,"Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:Toe(0,"Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:Toe(0,"Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return void 0===e?this.defaultValue:"string"==typeof e?"false"===e?Ere.OFF:"true"===e?Ere.ON:e:Boolean(e)?Ere.ON:Ere.OFF}}Ere.OFF='"liga" off, "calt" off',Ere.ON='"liga" on, "calt" on';class Nre extends gre{constructor(){super(51,"fontVariations",Nre.OFF,{anyOf:[{type:"boolean",description:Toe(0,"Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:Toe(0,"Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:Toe(0,"Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return void 0===e?this.defaultValue:"string"==typeof e?"false"===e?Nre.OFF:"true"===e?Nre.TRANSLATE:e:Boolean(e)?Nre.TRANSLATE:Nre.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}Nre.OFF="normal",Nre.TRANSLATE="translate";class Ire extends gre{constructor(){super(50,"fontWeight",Pre.fontWeight,{anyOf:[{type:"number",minimum:Ire.MINIMUM_VALUE,maximum:Ire.MAXIMUM_VALUE,errorMessage:Toe(0,'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:Ire.SUGGESTION_VALUES}],default:Pre.fontWeight,description:Toe(0,'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return"normal"===e||"bold"===e?e:String(Cre.clampedInt(e,Pre.fontWeight,Ire.MINIMUM_VALUE,Ire.MAXIMUM_VALUE))}}Ire.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],Ire.MINIMUM_VALUE=1,Ire.MAXIMUM_VALUE=1e3;class Mre extends fre{constructor(){super(138)}compute(e,t,i){return Mre.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let n=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(n=Math.max(n,t-1));const o=(i+e.viewLineCount+n)/(e.pixelRatio*e.height);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:n,desiredRatio:o,minimapLineCount:Math.floor(e.viewLineCount/o)}}static _computeMinimapLayout(e,t){const i=e.outerWidth,n=e.outerHeight,o=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(o*n),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:n};const s=t.stableMinimapLayoutInput,r=s&&e.outerHeight===s.outerHeight&&e.lineHeight===s.lineHeight&&e.typicalHalfwidthCharacterWidth===s.typicalHalfwidthCharacterWidth&&e.pixelRatio===s.pixelRatio&&e.scrollBeyondLastLine===s.scrollBeyondLastLine&&e.paddingTop===s.paddingTop&&e.paddingBottom===s.paddingBottom&&e.minimap.enabled===s.minimap.enabled&&e.minimap.side===s.minimap.side&&e.minimap.size===s.minimap.size&&e.minimap.showSlider===s.minimap.showSlider&&e.minimap.renderCharacters===s.minimap.renderCharacters&&e.minimap.maxColumn===s.minimap.maxColumn&&e.minimap.scale===s.minimap.scale&&e.verticalScrollbarWidth===s.verticalScrollbarWidth&&e.isViewportWrapping===s.isViewportWrapping,a=e.lineHeight,l=e.typicalHalfwidthCharacterWidth,h=e.scrollBeyondLastLine,d=e.minimap.renderCharacters;let c=o>=2?Math.round(2*e.minimap.scale):e.minimap.scale;const u=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,m=e.verticalScrollbarWidth,f=e.viewLineCount,_=e.remainingWidth,v=e.isViewportWrapping,b=d?2:3;let w=Math.floor(o*n);const C=w/o;let y=!1,S=!1,k=b*c,L=c/o,x=1;if("fill"===g||"fit"===g){const{typicalViewportLineCount:i,extraLinesBeforeFirstLine:s,extraLinesBeyondLastLine:l,desiredRatio:d,minimapLineCount:u}=Mre.computeContainedMinimapLineCount({viewLineCount:f,scrollBeyondLastLine:h,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:n,lineHeight:a,pixelRatio:o});if(f/u>1)y=!0,S=!0,c=1,k=1,L=c/o;else{let n=!1,h=c+1;if("fit"===g){const e=Math.ceil((s+f+l)*k);v&&r&&_<=t.stableFitRemainingWidth?(n=!0,h=t.stableFitMaxMinimapScale):n=e>w}if("fill"===g||n){y=!0;const n=c;k=Math.min(a*o,Math.max(1,Math.floor(1/d))),v&&r&&_<=t.stableFitRemainingWidth&&(h=t.stableFitMaxMinimapScale),c=Math.min(h,Math.max(1,Math.floor(k/b))),c>n&&(x=Math.min(2,c/n)),L=c/o/x,w=Math.ceil(Math.max(i,s+f+l)*k),v?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=_,t.stableFitMaxMinimapScale=c):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const D=Math.floor(u*L),E=Math.min(D,Math.max(0,Math.floor((_-m-2)*L/(l+L)))+8);let N=Math.floor(o*E);const I=N/o;return N=Math.floor(N*x),{renderMinimap:d?1:2,minimapLeft:"left"===p?0:i-E-m,minimapWidth:E,minimapHeightIsEditorHeight:y,minimapIsSampling:S,minimapScale:c,minimapLineHeight:k,minimapCanvasInnerWidth:N,minimapCanvasInnerHeight:w,minimapCanvasOuterWidth:I,minimapCanvasOuterHeight:C}}static computeLayout(e,t){const i=0|t.outerWidth,n=0|t.outerHeight,o=0|t.lineHeight,s=0|t.lineNumbersDigitCount,r=t.typicalHalfwidthCharacterWidth,a=t.maxDigitWidth,l=t.pixelRatio,h=t.viewLineCount,d=e.get(130),c="inherit"===d?e.get(129):d,u="inherit"===c?e.get(125):c,g=e.get(128),p=t.isDominatedByLongLines,m=e.get(54),f=0!==e.get(64).renderType,_=e.get(65),v=e.get(99),b=e.get(80),w=e.get(69),C=e.get(97),y=C.verticalScrollbarSize,S=C.verticalHasArrows,k=C.arrowSize,L=C.horizontalScrollbarSize,x=e.get(40),D="never"!==e.get(104);let E=e.get(62);x&&D&&(E+=16);let N=0;if(f){const e=Math.max(s,_);N=Math.round(e*a)}let I=0;m&&(I=o);let M=0,T=M+I,A=T+N,R=A+E;const O=i-I-N-E;let P=!1,F=!1,B=-1;"inherit"===c&&p?(P=!0,F=!0):"on"===u||"bounded"===u?F=!0:"wordWrapColumn"===u&&(B=g);const W=Mre._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:o,typicalHalfwidthCharacterWidth:r,pixelRatio:l,scrollBeyondLastLine:v,paddingTop:b.top,paddingBottom:b.bottom,minimap:w,verticalScrollbarWidth:y,viewLineCount:h,remainingWidth:O,isViewportWrapping:F},t.memory||new ure);0!==W.renderMinimap&&0===W.minimapLeft&&(M+=W.minimapWidth,T+=W.minimapWidth,A+=W.minimapWidth,R+=W.minimapWidth);const V=O-W.minimapWidth,z=Math.max(1,Math.floor((V-y-2)/r)),H=S?k:0;return F&&(B=Math.max(1,z),"bounded"===u&&(B=Math.min(B,g))),{width:i,height:n,glyphMarginLeft:M,glyphMarginWidth:I,lineNumbersLeft:T,lineNumbersWidth:N,decorationsLeft:A,decorationsWidth:E,contentLeft:R,contentWidth:V,minimap:W,viewportColumn:z,isWordWrapMinified:P,isViewportWrapping:F,wrappingColumn:B,verticalScrollbarWidth:y,horizontalScrollbarHeight:L,overviewRuler:{top:H,width:y,height:n-2*H,right:0}}}}function Tre(e){const t=e.get(92);return"editable"===t?e.get(86):"on"!==t}function Are(e,t){if("string"!=typeof e)return t;switch(e){case"hidden":return 2;case"visible":return 3;default:return 1}}const Rre="inUntrustedWorkspace";function Ore(e,t,i){const n=i.indexOf(e);return-1===n?t:i[n]}const Pre={fontFamily:tse?"Menlo, Monaco, 'Courier New', monospace":ise?"'Droid Sans Mono', 'monospace', monospace":"Consolas, 'Courier New', monospace",fontWeight:"normal",fontSize:tse?12:14,lineHeight:0,letterSpacing:0},Fre=[];function Bre(e){return Fre[e.id]=e,e}const Wre={acceptSuggestionOnCommitCharacter:Bre(new bre(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:Toe(0,"Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:Bre(new Lre(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",Toe(0,"Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:Toe(0,"Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:Bre(new class extends gre{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[Toe(0,"Use platform APIs to detect when a Screen Reader is attached"),Toe(0,"Optimize for usage with a Screen Reader"),Toe(0,"Assume a screen reader is not attached")],default:"auto",tags:["accessibility"],description:Toe(0,"Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return 0===i?e.accessibilitySupport:i}}),accessibilityPageSize:Bre(new Cre(3,"accessibilityPageSize",10,1,1073741824,{description:Toe(0,"Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),ariaLabel:Bre(new Sre(4,"ariaLabel",Toe(0,"Editor content"))),autoClosingBrackets:Bre(new Lre(5,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",Toe(0,"Use language configurations to determine when to autoclose brackets."),Toe(0,"Autoclose brackets only when the cursor is to the left of whitespace."),""],description:Toe(0,"Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingDelete:Bre(new Lre(6,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",Toe(0,"Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:Toe(0,"Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:Bre(new Lre(7,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",Toe(0,"Type over closing quotes or brackets only if they were automatically inserted."),""],description:Toe(0,"Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:Bre(new Lre(8,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",Toe(0,"Use language configurations to determine when to autoclose quotes."),Toe(0,"Autoclose quotes only when the cursor is to the left of whitespace."),""],description:Toe(0,"Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:Bre(new xre(9,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],(function(e){switch(e){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}),{enumDescriptions:[Toe(0,"The editor will not insert indentation automatically."),Toe(0,"The editor will keep the current line's indentation."),Toe(0,"The editor will keep the current line's indentation and honor language defined brackets."),Toe(0,"The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),Toe(0,"The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:Toe(0,"Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:Bre(new bre(10,"automaticLayout",!1)),autoSurround:Bre(new Lre(11,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[Toe(0,"Use language configurations to determine when to automatically surround selections."),Toe(0,"Surround with quotes but not brackets."),Toe(0,"Surround with brackets but not quotes."),""],description:Toe(0,"Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:Bre(new class extends gre{constructor(){const e={enabled:dre.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:dre.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(12,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:Toe(0,"Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:Toe(0,"Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:vre(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:vre(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}),bracketPairGuides:Bre(new class extends gre{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(13,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[Toe(0,"Enables bracket pair guides."),Toe(0,"Enables bracket pair guides only for the active bracket pair."),Toe(0,"Disables bracket pair guides.")],default:e.bracketPairs,description:Toe(0,"Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[Toe(0,"Enables horizontal guides as addition to vertical bracket pair guides."),Toe(0,"Enables horizontal guides only for the active bracket pair."),Toe(0,"Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:Toe(0,"Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:Toe(0,"Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:Toe(0,"Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[Toe(0,"Highlights the active indent guide."),Toe(0,"Highlights the active indent guide even if bracket guides are highlighted."),Toe(0,"Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:Toe(0,"Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{bracketPairs:Ore(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:Ore(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:vre(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:vre(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:Ore(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}),stickyTabStops:Bre(new bre(110,"stickyTabStops",!1,{description:Toe(0,"Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:Bre(new bre(14,"codeLens",!0,{description:Toe(0,"Controls whether the editor shows CodeLens.")})),codeLensFontFamily:Bre(new Sre(15,"codeLensFontFamily","",{description:Toe(0,"Controls the font family for CodeLens.")})),codeLensFontSize:Bre(new Cre(16,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:Toe(0,"Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:Bre(new bre(17,"colorDecorators",!0,{description:Toe(0,"Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorsLimit:Bre(new Cre(18,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:Toe(0,"Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:Bre(new bre(19,"columnSelection",!1,{description:Toe(0,"Enable that the selection with the mouse and keys is doing column selection.")})),comments:Bre(new class extends gre{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(20,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:Toe(0,"Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:Toe(0,"Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertSpace:vre(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:vre(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}),contextmenu:Bre(new bre(21,"contextmenu",!0)),copyWithSyntaxHighlighting:Bre(new bre(22,"copyWithSyntaxHighlighting",!0,{description:Toe(0,"Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:Bre(new xre(23,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],(function(e){switch(e){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}),{description:Toe(0,"Control the cursor animation style.")})),cursorSmoothCaretAnimation:Bre(new Lre(24,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[Toe(0,"Smooth caret animation is disabled."),Toe(0,"Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),Toe(0,"Smooth caret animation is always enabled.")],description:Toe(0,"Controls whether the smooth caret animation should be enabled.")})),cursorStyle:Bre(new xre(25,"cursorStyle",Dre.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],(function(e){switch(e){case"line":return Dre.Line;case"block":return Dre.Block;case"underline":return Dre.Underline;case"line-thin":return Dre.LineThin;case"block-outline":return Dre.BlockOutline;case"underline-thin":return Dre.UnderlineThin}}),{description:Toe(0,"Controls the cursor style.")})),cursorSurroundingLines:Bre(new Cre(26,"cursorSurroundingLines",0,0,1073741824,{description:Toe(0,"Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:Bre(new Lre(27,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[Toe(0,"`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),Toe(0,"`cursorSurroundingLines` is enforced always.")],description:Toe(0,"Controls when `cursorSurroundingLines` should be enforced.")})),cursorWidth:Bre(new Cre(28,"cursorWidth",0,0,1073741824,{markdownDescription:Toe(0,"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:Bre(new bre(29,"disableLayerHinting",!1)),disableMonospaceOptimizations:Bre(new bre(30,"disableMonospaceOptimizations",!1)),domReadOnly:Bre(new bre(31,"domReadOnly",!1)),dragAndDrop:Bre(new bre(32,"dragAndDrop",!0,{description:Toe(0,"Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:Bre(new class extends bre{constructor(){super(34,"emptySelectionClipboard",!0,{description:Toe(0,"Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}),dropIntoEditor:Bre(new class extends gre{constructor(){const e={enabled:!0};super(33,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:Toe(0,"Controls whether you can drag and drop a file into a text editor by holding down `shift` (instead of opening the file in an editor).")}})}validate(e){return e&&"object"==typeof e?{enabled:vre(e.enabled,this.defaultValue.enabled)}:this.defaultValue}}),stickyScroll:Bre(new class extends gre{constructor(){const e={enabled:!1,maxLineCount:5};super(109,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:Toe(0,"Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:10,description:Toe(0,"Defines the maximum number of sticky lines to show.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:vre(t.enabled,this.defaultValue.enabled),maxLineCount:Cre.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10)}}}),experimentalWhitespaceRendering:Bre(new Lre(35,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[Toe(0,"Use a new rendering method with svgs."),Toe(0,"Use a new rendering method with font characters."),Toe(0,"Use the stable rendering method.")],description:Toe(0,"Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:Bre(new Sre(36,"extraEditorClassName","")),fastScrollSensitivity:Bre(new yre(37,"fastScrollSensitivity",5,(e=>e<=0?5:e),{markdownDescription:Toe(0,"Scrolling speed multiplier when pressing `Alt`.")})),find:Bre(new class extends gre{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(38,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:Toe(0,"Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[Toe(0,"Never seed search string from the editor selection."),Toe(0,"Always seed search string from the editor selection, including word at cursor position."),Toe(0,"Only seed search string from the editor selection.")],description:Toe(0,"Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[Toe(0,"Never turn on Find in Selection automatically (default)."),Toe(0,"Always turn on Find in Selection automatically."),Toe(0,"Turn on Find in Selection automatically when multiple lines of content are selected.")],description:Toe(0,"Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:Toe(0,"Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:tse},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:Toe(0,"Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:Toe(0,"Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{cursorMoveOnType:vre(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:"boolean"==typeof e.seedSearchStringFromSelection?e.seedSearchStringFromSelection?"always":"never":kre(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:"boolean"==typeof e.autoFindInSelection?e.autoFindInSelection?"always":"never":kre(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:vre(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:vre(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:vre(t.loop,this.defaultValue.loop)}}}),fixedOverflowWidgets:Bre(new bre(39,"fixedOverflowWidgets",!1)),folding:Bre(new bre(40,"folding",!0,{description:Toe(0,"Controls whether the editor has code folding enabled.")})),foldingStrategy:Bre(new Lre(41,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[Toe(0,"Use a language-specific folding strategy if available, else the indentation-based one."),Toe(0,"Use the indentation-based folding strategy.")],description:Toe(0,"Controls the strategy for computing folding ranges.")})),foldingHighlight:Bre(new bre(42,"foldingHighlight",!0,{description:Toe(0,"Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:Bre(new bre(43,"foldingImportsByDefault",!1,{description:Toe(0,"Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:Bre(new Cre(44,"foldingMaximumRegions",5e3,10,65e3,{description:Toe(0,"The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:Bre(new bre(45,"unfoldOnClickAfterEndOfLine",!1,{description:Toe(0,"Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:Bre(new Sre(46,"fontFamily",Pre.fontFamily,{description:Toe(0,"Controls the font family.")})),fontInfo:Bre(new class extends fre{constructor(){super(47)}compute(e,t,i){return e.fontInfo}}),fontLigatures2:Bre(new Ere),fontSize:Bre(new class extends _re{constructor(){super(49,"fontSize",Pre.fontSize,{type:"number",minimum:6,maximum:100,default:Pre.fontSize,description:Toe(0,"Controls the font size in pixels.")})}validate(e){const t=yre.float(e,this.defaultValue);return 0===t?Pre.fontSize:yre.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}),fontWeight:Bre(new Ire),fontVariations:Bre(new Nre),formatOnPaste:Bre(new bre(52,"formatOnPaste",!1,{description:Toe(0,"Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:Bre(new bre(53,"formatOnType",!1,{description:Toe(0,"Controls whether the editor should automatically format the line after typing.")})),glyphMargin:Bre(new bre(54,"glyphMargin",!0,{description:Toe(0,"Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:Bre(new class extends gre{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[Toe(0,"Show Peek view of the results (default)"),Toe(0,"Go to the primary result and show a Peek view"),Toe(0,"Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(55,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:Toe(0,"This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":Object.assign({description:Toe(0,"Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:Toe(0,"Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleDeclarations":Object.assign({description:Toe(0,"Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:Toe(0,"Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:Toe(0,"Controls the behavior the 'Go to References'-command when multiple target locations exist.")},t),"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:Toe(0,"Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:Toe(0,"Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:Toe(0,"Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:Toe(0,"Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:Toe(0,"Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,n,o,s;if(!e||"object"!=typeof e)return this.defaultValue;const r=e;return{multiple:kre(r.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:null!==(t=r.multipleDefinitions)&&void 0!==t?t:kre(r.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:null!==(i=r.multipleTypeDefinitions)&&void 0!==i?i:kre(r.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:null!==(n=r.multipleDeclarations)&&void 0!==n?n:kre(r.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:null!==(o=r.multipleImplementations)&&void 0!==o?o:kre(r.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:null!==(s=r.multipleReferences)&&void 0!==s?s:kre(r.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Sre.string(r.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Sre.string(r.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Sre.string(r.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Sre.string(r.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Sre.string(r.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}),hideCursorInOverviewRuler:Bre(new bre(56,"hideCursorInOverviewRuler",!1,{description:Toe(0,"Controls whether the cursor should be hidden in the overview ruler.")})),hover:Bre(new class extends gre{constructor(){const e={enabled:!0,delay:300,sticky:!0,above:!0};super(57,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:Toe(0,"Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:Toe(0,"Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:Toe(0,"Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.above":{type:"boolean",default:e.above,description:Toe(0,"Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:vre(t.enabled,this.defaultValue.enabled),delay:Cre.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:vre(t.sticky,this.defaultValue.sticky),above:vre(t.above,this.defaultValue.above)}}}),inDiffEditor:Bre(new bre(58,"inDiffEditor",!1)),letterSpacing:Bre(new yre(60,"letterSpacing",Pre.letterSpacing,(e=>yre.clamp(e,-5,20)),{description:Toe(0,"Controls the letter spacing in pixels.")})),lightbulb:Bre(new class extends gre{constructor(){const e={enabled:!0};super(61,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:Toe(0,"Enables the Code Action lightbulb in the editor.")}})}validate(e){return e&&"object"==typeof e?{enabled:vre(e.enabled,this.defaultValue.enabled)}:this.defaultValue}}),lineDecorationsWidth:Bre(new class extends gre{constructor(){super(62,"lineDecorationsWidth",10)}validate(e){return"string"==typeof e&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):Cre.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?Cre.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}),lineHeight:Bre(new class extends yre{constructor(){super(63,"lineHeight",Pre.lineHeight,(e=>yre.clamp(e,0,150)),{markdownDescription:Toe(0,"Controls the line height. \n - Use 0 to automatically compute the line height from the font size.\n - Values between 0 and 8 will be used as a multiplier with the font size.\n - Values greater than or equal to 8 will be used as effective values.")})}compute(e,t,i){return e.fontInfo.lineHeight}}),lineNumbers:Bre(new class extends gre{constructor(){super(64,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[Toe(0,"Line numbers are not rendered."),Toe(0,"Line numbers are rendered as absolute number."),Toe(0,"Line numbers are rendered as distance in lines to cursor position."),Toe(0,"Line numbers are rendered every 10 lines.")],default:"on",description:Toe(0,"Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return void 0!==e&&("function"==typeof e?(t=4,i=e):t="interval"===e?3:"relative"===e?2:"on"===e?1:0),{renderType:t,renderFn:i}}}),lineNumbersMinChars:Bre(new Cre(65,"lineNumbersMinChars",5,1,300)),linkedEditing:Bre(new bre(66,"linkedEditing",!1,{description:Toe(0,"Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:Bre(new bre(67,"links",!0,{description:Toe(0,"Controls whether the editor should detect links and make them clickable.")})),matchBrackets:Bre(new Lre(68,"matchBrackets","always",["always","near","never"],{description:Toe(0,"Highlight matching brackets.")})),minimap:Bre(new class extends gre{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(69,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:Toe(0,"Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:Toe(0,"Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[Toe(0,"The minimap has the same size as the editor contents (and might scroll)."),Toe(0,"The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),Toe(0,"The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:Toe(0,"Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:Toe(0,"Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:Toe(0,"Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:Toe(0,"Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:Toe(0,"Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:Toe(0,"Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:vre(t.enabled,this.defaultValue.enabled),autohide:vre(t.autohide,this.defaultValue.autohide),size:kre(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:kre(t.side,this.defaultValue.side,["right","left"]),showSlider:kre(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:vre(t.renderCharacters,this.defaultValue.renderCharacters),scale:Cre.clampedInt(t.scale,1,1,3),maxColumn:Cre.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}),mouseStyle:Bre(new Lre(70,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:Bre(new yre(71,"mouseWheelScrollSensitivity",1,(e=>0===e?1:e),{markdownDescription:Toe(0,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:Bre(new bre(72,"mouseWheelZoom",!1,{markdownDescription:Toe(0,"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:Bre(new bre(73,"multiCursorMergeOverlapping",!0,{description:Toe(0,"Merge multiple cursors when they are overlapping.")})),multiCursorModifier:Bre(new xre(74,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],(function(e){return"ctrlCmd"===e?tse?"metaKey":"ctrlKey":"altKey"}),{markdownEnumDescriptions:[Toe(0,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),Toe(0,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:Toe(0,"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:Bre(new Lre(75,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[Toe(0,"Each cursor pastes a single line of the text."),Toe(0,"Each cursor pastes the full text.")],markdownDescription:Toe(0,"Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:Bre(new Cre(76,"multiCursorLimit",1e4,1,1e5,{markdownDescription:Toe(0,"Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:Bre(new bre(77,"occurrencesHighlight",!0,{description:Toe(0,"Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:Bre(new bre(78,"overviewRulerBorder",!0,{description:Toe(0,"Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:Bre(new Cre(79,"overviewRulerLanes",3,0,3)),padding:Bre(new class extends gre{constructor(){super(80,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:Toe(0,"Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:Toe(0,"Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{top:Cre.clampedInt(t.top,0,0,1e3),bottom:Cre.clampedInt(t.bottom,0,0,1e3)}}}),parameterHints:Bre(new class extends gre{constructor(){const e={enabled:!0,cycle:!0};super(81,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:Toe(0,"Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:Toe(0,"Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:vre(t.enabled,this.defaultValue.enabled),cycle:vre(t.cycle,this.defaultValue.cycle)}}}),peekWidgetDefaultFocus:Bre(new Lre(82,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[Toe(0,"Focus the tree when opening peek"),Toe(0,"Focus the editor when opening peek")],description:Toe(0,"Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:Bre(new bre(83,"definitionLinkOpensInPeek",!1,{description:Toe(0,"Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:Bre(new class extends gre{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[Toe(0,"Quick suggestions show inside the suggest widget"),Toe(0,"Quick suggestions show as ghost text"),Toe(0,"Quick suggestions are disabled")]}];super(84,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:Toe(0,"Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:Toe(0,"Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:Toe(0,"Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:Toe(0,"Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the '{0}'-setting which controls if suggestions are triggered by special characters.","#editor.suggestOnTriggerCharacters#")}),this.defaultValue=e}validate(e){if("boolean"==typeof e){const t=e?"on":"off";return{comments:t,strings:t,other:t}}if(!e||"object"!=typeof e)return this.defaultValue;const{other:t,comments:i,strings:n}=e,o=["on","inline","off"];let s,r,a;return s="boolean"==typeof t?t?"on":"off":kre(t,this.defaultValue.other,o),r="boolean"==typeof i?i?"on":"off":kre(i,this.defaultValue.comments,o),a="boolean"==typeof n?n?"on":"off":kre(n,this.defaultValue.strings,o),{other:s,comments:r,strings:a}}}),quickSuggestionsDelay:Bre(new Cre(85,"quickSuggestionsDelay",10,0,1073741824,{description:Toe(0,"Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:Bre(new bre(86,"readOnly",!1)),renameOnType:Bre(new bre(87,"renameOnType",!1,{description:Toe(0,"Controls whether the editor auto renames on type."),markdownDeprecationMessage:Toe(0,"Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:Bre(new bre(88,"renderControlCharacters",!0,{description:Toe(0,"Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:Bre(new Lre(89,"renderFinalNewline",ise?"dimmed":"on",["off","on","dimmed"],{description:Toe(0,"Render last line number when the file ends with a newline.")})),renderLineHighlight:Bre(new Lre(90,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",Toe(0,"Highlights both the gutter and the current line.")],description:Toe(0,"Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:Bre(new bre(91,"renderLineHighlightOnlyWhenFocus",!1,{description:Toe(0,"Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:Bre(new Lre(92,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:Bre(new Lre(93,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",Toe(0,"Render whitespace characters except for single spaces between words."),Toe(0,"Render whitespace characters only on selected text."),Toe(0,"Render only trailing whitespace characters."),""],description:Toe(0,"Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:Bre(new Cre(94,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:Bre(new bre(95,"roundedSelection",!0,{description:Toe(0,"Controls whether selections should have rounded corners.")})),rulers:Bre(new class extends gre{constructor(){const e=[],t={type:"number",description:Toe(0,"Number of monospace characters at which this editor ruler will render.")};super(96,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:Toe(0,"Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:Toe(0,"Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const t=[];for(const i of e)if("number"==typeof i)t.push({column:Cre.clampedInt(i,0,0,1e4),color:null});else if(i&&"object"==typeof i){const e=i;t.push({column:Cre.clampedInt(e.column,0,0,1e4),color:e.color})}return t.sort(((e,t)=>e.column-t.column)),t}return this.defaultValue}}),scrollbar:Bre(new class extends gre{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1};super(97,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[Toe(0,"The vertical scrollbar will be visible only when necessary."),Toe(0,"The vertical scrollbar will always be visible."),Toe(0,"The vertical scrollbar will always be hidden.")],default:"auto",description:Toe(0,"Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[Toe(0,"The horizontal scrollbar will be visible only when necessary."),Toe(0,"The horizontal scrollbar will always be visible."),Toe(0,"The horizontal scrollbar will always be hidden.")],default:"auto",description:Toe(0,"Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:Toe(0,"The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:Toe(0,"The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:Toe(0,"Controls whether clicks scroll by page or jump to click position.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e,i=Cre.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=Cre.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:Cre.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:Are(t.vertical,this.defaultValue.vertical),horizontal:Are(t.horizontal,this.defaultValue.horizontal),useShadows:vre(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:vre(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:vre(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:vre(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:vre(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:Cre.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:Cre.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:vre(t.scrollByPage,this.defaultValue.scrollByPage)}}}),scrollBeyondLastColumn:Bre(new Cre(98,"scrollBeyondLastColumn",4,0,1073741824,{description:Toe(0,"Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:Bre(new bre(99,"scrollBeyondLastLine",!0,{description:Toe(0,"Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:Bre(new bre(100,"scrollPredominantAxis",!0,{description:Toe(0,"Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:Bre(new bre(101,"selectionClipboard",!0,{description:Toe(0,"Controls whether the Linux primary clipboard should be supported."),included:ise})),selectionHighlight:Bre(new bre(102,"selectionHighlight",!0,{description:Toe(0,"Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:Bre(new bre(103,"selectOnLineNumbers",!0)),showFoldingControls:Bre(new Lre(104,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[Toe(0,"Always show the folding controls."),Toe(0,"Never show the folding controls and reduce the gutter size."),Toe(0,"Only show the folding controls when the mouse is over the gutter.")],description:Toe(0,"Controls when the folding controls on the gutter are shown.")})),showUnused:Bre(new bre(105,"showUnused",!0,{description:Toe(0,"Controls fading out of unused code.")})),showDeprecated:Bre(new bre(133,"showDeprecated",!0,{description:Toe(0,"Controls strikethrough deprecated variables.")})),inlayHints:Bre(new class extends gre{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(134,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:Toe(0,"Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[Toe(0,"Inlay hints are enabled"),Toe(0,"Inlay hints are showing by default and hide when holding {0}",tse?"Ctrl+Option":"Ctrl+Alt"),Toe(0,"Inlay hints are hidden by default and show when holding {0}",tse?"Ctrl+Option":"Ctrl+Alt"),Toe(0,"Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:Toe(0,"Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:Toe(0,"Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:Toe(0,"Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return"boolean"==typeof t.enabled&&(t.enabled=t.enabled?"on":"off"),{enabled:kre(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:Cre.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Sre.string(t.fontFamily,this.defaultValue.fontFamily),padding:vre(t.padding,this.defaultValue.padding)}}}),snippetSuggestions:Bre(new Lre(106,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[Toe(0,"Show snippet suggestions on top of other suggestions."),Toe(0,"Show snippet suggestions below other suggestions."),Toe(0,"Show snippets suggestions with other suggestions."),Toe(0,"Do not show snippet suggestions.")],description:Toe(0,"Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:Bre(new class extends gre{constructor(){super(107,"smartSelect",{selectLeadingAndTrailingWhitespace:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:Toe(0,"Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"}})}validate(e){return e&&"object"==typeof e?{selectLeadingAndTrailingWhitespace:vre(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace)}:this.defaultValue}}),smoothScrolling:Bre(new bre(108,"smoothScrolling",!1,{description:Toe(0,"Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:Bre(new Cre(111,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:Bre(new class extends gre{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!0,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(112,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[Toe(0,"Insert suggestion without overwriting text right of the cursor."),Toe(0,"Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:Toe(0,"Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:Toe(0,"Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:Toe(0,"Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:Toe(0,"Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[Toe(0,"Always select a suggestion when automatically triggering IntelliSense."),Toe(0,"Never select a suggestion when automatically triggering IntelliSense."),Toe(0,"Select a suggestion only when triggering IntelliSense from a trigger character."),Toe(0,"Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:Toe(0,"Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:Toe(0,"Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:Toe(0,"Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:Toe(0,"Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:Toe(0,"Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:Toe(0,"Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:Toe(0,"This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:Toe(0,"This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:Toe(0,"When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertMode:kre(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:vre(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:vre(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:vre(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:vre(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:kre(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:vre(t.showIcons,this.defaultValue.showIcons),showStatusBar:vre(t.showStatusBar,this.defaultValue.showStatusBar),preview:vre(t.preview,this.defaultValue.preview),previewMode:kre(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:vre(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:vre(t.showMethods,this.defaultValue.showMethods),showFunctions:vre(t.showFunctions,this.defaultValue.showFunctions),showConstructors:vre(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:vre(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:vre(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:vre(t.showFields,this.defaultValue.showFields),showVariables:vre(t.showVariables,this.defaultValue.showVariables),showClasses:vre(t.showClasses,this.defaultValue.showClasses),showStructs:vre(t.showStructs,this.defaultValue.showStructs),showInterfaces:vre(t.showInterfaces,this.defaultValue.showInterfaces),showModules:vre(t.showModules,this.defaultValue.showModules),showProperties:vre(t.showProperties,this.defaultValue.showProperties),showEvents:vre(t.showEvents,this.defaultValue.showEvents),showOperators:vre(t.showOperators,this.defaultValue.showOperators),showUnits:vre(t.showUnits,this.defaultValue.showUnits),showValues:vre(t.showValues,this.defaultValue.showValues),showConstants:vre(t.showConstants,this.defaultValue.showConstants),showEnums:vre(t.showEnums,this.defaultValue.showEnums),showEnumMembers:vre(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:vre(t.showKeywords,this.defaultValue.showKeywords),showWords:vre(t.showWords,this.defaultValue.showWords),showColors:vre(t.showColors,this.defaultValue.showColors),showFiles:vre(t.showFiles,this.defaultValue.showFiles),showReferences:vre(t.showReferences,this.defaultValue.showReferences),showFolders:vre(t.showFolders,this.defaultValue.showFolders),showTypeParameters:vre(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:vre(t.showSnippets,this.defaultValue.showSnippets),showUsers:vre(t.showUsers,this.defaultValue.showUsers),showIssues:vre(t.showIssues,this.defaultValue.showIssues)}}}),inlineSuggest:Bre(new class extends gre{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover"};super(59,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:Toe(0,"Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover"],enumDescriptions:[Toe(0,"Show the inline suggestion toolbar whenever an inline suggestion is shown."),Toe(0,"Show the inline suggestion toolbar when hovering over an inline suggestion.")],description:Toe(0,"Controls when to show the inline suggestion toolbar.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:vre(t.enabled,this.defaultValue.enabled),mode:kre(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:kre(t.showToolbar,this.defaultValue.showToolbar,["always","onHover"])}}}),suggestFontSize:Bre(new Cre(113,"suggestFontSize",0,0,1e3,{markdownDescription:Toe(0,"Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:Bre(new Cre(114,"suggestLineHeight",0,0,1e3,{markdownDescription:Toe(0,"Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:Bre(new bre(115,"suggestOnTriggerCharacters",!0,{description:Toe(0,"Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:Bre(new Lre(116,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[Toe(0,"Always select the first suggestion."),Toe(0,"Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),Toe(0,"Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:Toe(0,"Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:Bre(new Lre(117,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[Toe(0,"Tab complete will insert the best matching suggestion when pressing tab."),Toe(0,"Disable tab completions."),Toe(0,"Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:Toe(0,"Enables tab completions.")})),tabIndex:Bre(new Cre(118,"tabIndex",0,-1,1073741824)),unicodeHighlight:Bre(new class extends gre{constructor(){const e={nonBasicASCII:Rre,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Rre,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(119,"unicodeHighlight",e,{"editor.unicodeHighlight.nonBasicASCII":{restricted:!0,type:["boolean","string"],enum:[!0,!1,Rre],default:e.nonBasicASCII,description:Toe(0,"Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},"editor.unicodeHighlight.invisibleCharacters":{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:Toe(0,"Controls whether characters that just reserve space or have no width at all are highlighted.")},"editor.unicodeHighlight.ambiguousCharacters":{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:Toe(0,"Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},"editor.unicodeHighlight.includeComments":{restricted:!0,type:["boolean","string"],enum:[!0,!1,Rre],default:e.includeComments,description:Toe(0,"Controls whether characters in comments should also be subject to Unicode highlighting.")},"editor.unicodeHighlight.includeStrings":{restricted:!0,type:["boolean","string"],enum:[!0,!1,Rre],default:e.includeStrings,description:Toe(0,"Controls whether characters in strings should also be subject to Unicode highlighting.")},"editor.unicodeHighlight.allowedCharacters":{restricted:!0,type:"object",default:e.allowedCharacters,description:Toe(0,"Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},"editor.unicodeHighlight.allowedLocales":{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:Toe(0,"Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(lre(e.allowedCharacters,t.allowedCharacters)||(e=Object.assign(Object.assign({},e),{allowedCharacters:t.allowedCharacters}),i=!0)),t.allowedLocales&&e&&(lre(e.allowedLocales,t.allowedLocales)||(e=Object.assign(Object.assign({},e),{allowedLocales:t.allowedLocales}),i=!0));const n=super.applyUpdate(e,t);return i?new pre(n.newValue,!0):n}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{nonBasicASCII:Ore(t.nonBasicASCII,Rre,[!0,!1,Rre]),invisibleCharacters:vre(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:vre(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:Ore(t.includeComments,Rre,[!0,!1,Rre]),includeStrings:Ore(t.includeStrings,Rre,[!0,!1,Rre]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if("object"!=typeof e||!e)return t;const i={};for(const[t,n]of Object.entries(e))!0===n&&(i[t]=!0);return i}}),unusualLineTerminators:Bre(new Lre(120,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[Toe(0,"Unusual line terminators are automatically removed."),Toe(0,"Unusual line terminators are ignored."),Toe(0,"Unusual line terminators prompt to be removed.")],description:Toe(0,"Remove unusual line terminators that might cause problems.")})),useShadowDOM:Bre(new bre(121,"useShadowDOM",!0)),useTabStops:Bre(new bre(122,"useTabStops",!0,{description:Toe(0,"Inserting and deleting whitespace follows tab stops.")})),wordBreak:Bre(new Lre(123,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[Toe(0,"Use the default line break rule."),Toe(0,"Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:Toe(0,"Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:Bre(new Sre(124,"wordSeparators",yse,{description:Toe(0,"Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:Bre(new Lre(125,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[Toe(0,"Lines will never wrap."),Toe(0,"Lines will wrap at the viewport width."),Toe(0,"Lines will wrap at `#editor.wordWrapColumn#`."),Toe(0,"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:Toe(0,"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:Bre(new Sre(126,"wordWrapBreakAfterCharacters"," \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:Bre(new Sre(127,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:Bre(new Cre(128,"wordWrapColumn",80,1,1073741824,{markdownDescription:Toe(0,"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:Bre(new Lre(129,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:Bre(new Lre(130,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:Bre(new class extends fre{constructor(){super(135)}compute(e,t,i){const n=["monaco-editor"];return t.get(36)&&n.push(t.get(36)),e.extraEditorClassName&&n.push(e.extraEditorClassName),"default"===t.get(70)?n.push("mouse-default"):"copy"===t.get(70)&&n.push("mouse-copy"),t.get(105)&&n.push("showUnused"),t.get(133)&&n.push("showDeprecated"),n.join(" ")}}),pixelRatio:Bre(new class extends fre{constructor(){super(136)}compute(e,t,i){return e.pixelRatio}}),tabFocusMode:Bre(new class extends fre{constructor(){super(137)}compute(e,t,i){return!!t.get(86)||e.tabFocusMode}}),layoutInfo:Bre(new Mre),wrappingInfo:Bre(new class extends fre{constructor(){super(139)}compute(e,t,i){const n=t.get(138);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}}),wrappingIndent:Bre(new class extends gre{constructor(){super(131,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[Toe(0,"No indentation. Wrapped lines begin at column 1."),Toe(0,"Wrapped lines get the same indentation as the parent."),Toe(0,"Wrapped lines get +1 indentation toward the parent."),Toe(0,"Wrapped lines get +2 indentation toward the parent.")],description:Toe(0,"Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,i){return 2===t.get(2)?0:i}}),wrappingStrategy:Bre(new class extends gre{constructor(){super(132,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[Toe(0,"Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),Toe(0,"Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:Toe(0,"Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return kre(e,"simple",["simple","advanced"])}compute(e,t,i){return 2===t.get(2)?"advanced":i}})},Vre=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout((()=>{if(e.stack){if(Zre.isErrorNoTelemetry(e))throw new Zre(e.message+"\n\n"+e.stack);throw new Error(e.message+"\n\n"+e.stack)}throw e}),0)}}emit(e){this.listeners.forEach((t=>{t(e)}))}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function zre(e){jre(e)||Vre.onUnexpectedError(e)}function Hre(e){jre(e)||Vre.onUnexpectedExternalError(e)}function Ure(e){if(e instanceof Error){const{name:t,message:i}=e;return{$isError:!0,name:t,message:i,stack:e.stacktrace||e.stack,noTelemetry:Zre.isErrorNoTelemetry(e)}}return e}const Kre="Canceled";function jre(e){return e instanceof qre||e instanceof Error&&e.name===Kre&&e.message===Kre}class qre extends Error{constructor(){super(Kre),this.name=this.message}}function $re(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")}class Gre extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class Zre extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof Zre)return e;const t=new Zre;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return"CodeExpectedError"===e.name}}class Yre extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Yre.prototype)}}function Qre(e){const t=this;let i,n=!1;return function(){return n||(n=!0,i=e.apply(t,arguments)),i}}let Xre=null;function Jre(e){return null==Xre||Xre.trackDisposable(e),e}function eae(e){null==Xre||Xre.markAsDisposed(e)}function tae(e,t){null==Xre||Xre.setParent(e,t)}function iae(e){return null==Xre||Xre.markAsSingleton(e),e}function nae(e){if(bse.is(e)){const t=[];for(const i of e)if(i)try{i.dispose()}catch(e){t.push(e)}if(1===t.length)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function oae(...e){const t=sae((()=>nae(e)));return function(e,t){if(Xre)for(const i of e)Xre.setParent(i,t)}(e,t),t}function sae(e){const t=Jre({dispose:Qre((()=>{eae(t),e()}))});return t}class rae{constructor(){this._toDispose=new Set,this._isDisposed=!1,Jre(this)}dispose(){this._isDisposed||(eae(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(0!==this._toDispose.size)try{nae(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return tae(e,this),this._isDisposed?rae.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}}rae.DISABLE_DISPOSED_WARNING=!1;class aae{constructor(){this._store=new rae,Jre(this),tae(this._store,this)}dispose(){eae(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}aae.None=Object.freeze({dispose(){}});class lae{constructor(){this._isDisposed=!1,Jre(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||(null===(t=this._value)||void 0===t||t.dispose(),e&&tae(e,this),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,eae(this),null===(e=this._value)||void 0===e||e.dispose(),this._value=void 0}clearAndLeak(){const e=this._value;return this._value=void 0,e&&tae(e,null),e}}class hae{constructor(){this.dispose=()=>{},this.unset=()=>{},this.isset=()=>!1,Jre(this)}set(e){let t=e;return this.unset=()=>t=void 0,this.isset=()=>void 0!==t,this.dispose=()=>{t&&(t(),t=void 0,eae(this))},this}}class dae{constructor(e){this.object=e}dispose(){}}class cae{constructor(){this._store=new Map,this._isDisposed=!1,Jre(this)}dispose(){eae(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{nae(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){var n;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||null===(n=this._store.get(e))||void 0===n||n.dispose(),this._store.set(e,t)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const uae=Zoe.performance&&"function"==typeof Zoe.performance.now;class gae{static create(e=!0){return new gae(e)}constructor(e){this._highResolution=uae&&e,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}elapsed(){return-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?Zoe.performance.now():Date.now()}}var pae;!function(e){function t(e){return(t,i=null,n)=>{let o,s=!1;return o=e((e=>{if(!s)return o?o.dispose():s=!0,t.call(i,e)}),null,n),s&&o.dispose(),o}}function i(e,t,i){return r(((i,n=null,o)=>e((e=>i.call(n,t(e))),null,o)),i)}function n(e,t,i){return r(((i,n=null,o)=>e((e=>{t(e),i.call(n,e)}),null,o)),i)}function o(e,t,i){return r(((i,n=null,o)=>e((e=>t(e)&&i.call(n,e)),null,o)),i)}function s(e,t,n,o){let s=n;return i(e,(e=>(s=t(s,e),s)),o)}function r(e,t){let i;const n=new bae({onWillAddFirstListener(){i=e(n.fire,n)},onDidRemoveLastListener(){null==i||i.dispose()}});return null==t||t.add(n),n.event}function a(e,t,i=100,n=!1,o,s){let r,a,l,h=0;const d=new bae({leakWarningThreshold:o,onWillAddFirstListener(){r=e((e=>{h++,a=t(a,e),n&&!l&&(d.fire(a),a=void 0);const o=()=>{const e=a;a=void 0,l=void 0,(!n||h>1)&&d.fire(e),h=0};"number"==typeof i?(clearTimeout(l),l=setTimeout(o,i)):void 0===l&&(l=0,queueMicrotask(o))}))},onDidRemoveLastListener(){r.dispose()}});return null==s||s.add(d),d.event}function l(e,t=((e,t)=>e===t),i){let n,s=!0;return o(e,(e=>{const i=s||!t(e,n);return s=!1,n=e,i}),i)}e.None=()=>aae.None,e.defer=function(e,t){return a(e,(()=>{}),0,void 0,void 0,t)},e.once=t,e.map=i,e.forEach=n,e.filter=o,e.signal=function(e){return e},e.any=function(...e){return(t,i=null,n)=>oae(...e.map((e=>e((e=>t.call(i,e)),null,n))))},e.reduce=s,e.debounce=a,e.accumulate=function(t,i=0,n){return e.debounce(t,((e,t)=>e?(e.push(t),e):[t]),i,void 0,void 0,n)},e.latch=l,e.split=function(t,i,n){return[e.filter(t,i,n),e.filter(t,(e=>!i(e)),n)]},e.buffer=function(e,t=!1,i=[]){let n=i.slice(),o=e((e=>{n?n.push(e):r.fire(e)}));const s=()=>{null==n||n.forEach((e=>r.fire(e))),n=null},r=new bae({onWillAddFirstListener(){o||(o=e((e=>r.fire(e))))},onDidAddFirstListener(){n&&(t?setTimeout(s):s())},onDidRemoveLastListener(){o&&o.dispose(),o=null}});return r.event};class h{constructor(e){this.event=e,this.disposables=new rae}map(e){return new h(i(this.event,e,this.disposables))}forEach(e){return new h(n(this.event,e,this.disposables))}filter(e){return new h(o(this.event,e,this.disposables))}reduce(e,t){return new h(s(this.event,e,t,this.disposables))}latch(){return new h(l(this.event,void 0,this.disposables))}debounce(e,t=100,i=!1,n){return new h(a(this.event,e,t,i,n,this.disposables))}on(e,t,i){return this.event(e,t,i)}once(e,i,n){return t(this.event)(e,i,n)}dispose(){this.disposables.dispose()}}e.chain=function(e){return new h(e)},e.fromNodeEventEmitter=function(e,t,i=(e=>e)){const n=(...e)=>o.fire(i(...e)),o=new bae({onWillAddFirstListener:()=>e.on(t,n),onDidRemoveLastListener:()=>e.removeListener(t,n)});return o.event},e.fromDOMEventEmitter=function(e,t,i=(e=>e)){const n=(...e)=>o.fire(i(...e)),o=new bae({onWillAddFirstListener:()=>e.addEventListener(t,n),onDidRemoveLastListener:()=>e.removeEventListener(t,n)});return o.event},e.toPromise=function(e){return new Promise((i=>t(e)(i)))},e.runAndSubscribe=function(e,t){return t(void 0),e((e=>t(e)))},e.runAndSubscribeWithStore=function(e,t){let i=null;function n(e){null==i||i.dispose(),i=new rae,t(e,i)}n(void 0);const o=e((e=>n(e)));return sae((()=>{o.dispose(),null==i||i.dispose()}))};class d{constructor(e,t){this.obs=e,this._counter=0,this._hasChanged=!1;const i={onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}};this.emitter=new bae(i),t&&t.add(this.emitter)}beginUpdate(e){this._counter++}handleChange(e,t){this._hasChanged=!0}endUpdate(e){0==--this._counter&&this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this.obs.get()))}}e.fromObservable=function(e,t){return new d(e,t).emitter.event}}(pae||(pae={}));class mae{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${mae._idPool++}`,mae.all.add(this)}start(e){this._stopWatch=new gae(!0),this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}mae.all=new Set,mae._idPool=0;class fae{constructor(e,t=Math.random().toString(18).slice(2,5)){this.threshold=e,this.name=t,this._warnCountdown=0}dispose(){var e;null===(e=this._stacks)||void 0===e||e.clear()}check(e,t){const i=this.threshold;if(i<=0||t<i)return;this._stacks||(this._stacks=new Map);const n=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,n+1),this._warnCountdown-=1,this._warnCountdown<=0){let e;this._warnCountdown=.5*i;let n=0;for(const[t,i]of this._stacks)(!e||n<i)&&(e=t,n=i);console.warn(`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${n}):`),console.warn(e)}return()=>{const t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}}class _ae{static create(){var e;return new _ae(null!==(e=(new Error).stack)&&void 0!==e?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split("\n").slice(2).join("\n"))}}class vae{constructor(e,t,i){this.callback=e,this.callbackThis=t,this.stack=i,this.subscription=new hae}invoke(e){this.callback.call(this.callbackThis,e)}}class bae{constructor(e){var t,i,n,o,s;this._disposed=!1,this._options=e,this._leakageMon=(null===(t=this._options)||void 0===t?void 0:t.leakWarningThreshold)?new fae(null!==(n=null===(i=this._options)||void 0===i?void 0:i.leakWarningThreshold)&&void 0!==n?n:-1):void 0,this._perfMon=(null===(o=this._options)||void 0===o?void 0:o._profName)?new mae(this._options._profName):void 0,this._deliveryQueue=null===(s=this._options)||void 0===s?void 0:s.deliveryQueue}dispose(){var e,t,i,n;this._disposed||(this._disposed=!0,this._listeners&&this._listeners.clear(),null===(e=this._deliveryQueue)||void 0===e||e.clear(this),null===(i=null===(t=this._options)||void 0===t?void 0:t.onDidRemoveLastListener)||void 0===i||i.call(t),null===(n=this._leakageMon)||void 0===n||n.dispose())}get event(){return this._event||(this._event=(e,t,i)=>{var n,o,s;if(this._listeners||(this._listeners=new Cse),this._leakageMon&&this._listeners.size>3*this._leakageMon.threshold)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),aae.None;const r=this._listeners.isEmpty();let a,l;r&&(null===(n=this._options)||void 0===n?void 0:n.onWillAddFirstListener)&&this._options.onWillAddFirstListener(this),this._leakageMon&&this._listeners.size>=Math.ceil(.2*this._leakageMon.threshold)&&(l=_ae.create(),a=this._leakageMon.check(l,this._listeners.size+1));const h=new vae(e,t,l),d=this._listeners.push(h);r&&(null===(o=this._options)||void 0===o?void 0:o.onDidAddFirstListener)&&this._options.onDidAddFirstListener(this),(null===(s=this._options)||void 0===s?void 0:s.onDidAddListener)&&this._options.onDidAddListener(this,e,t);const c=h.subscription.set((()=>{null==a||a(),!this._disposed&&(d(),this._options&&this._options.onDidRemoveLastListener)&&(this._listeners&&!this._listeners.isEmpty()||this._options.onDidRemoveLastListener(this))}));return i instanceof rae?i.add(c):Array.isArray(i)&&i.push(c),c}),this._event}fire(e){var t,i;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new Cae);for(const t of this._listeners)this._deliveryQueue.push(this,t,e);null===(t=this._perfMon)||void 0===t||t.start(this._deliveryQueue.size),this._deliveryQueue.deliver(),null===(i=this._perfMon)||void 0===i||i.stop()}}hasListeners(){return!!this._listeners&&!this._listeners.isEmpty()}}class wae{constructor(){this._queue=new Cse}get size(){return this._queue.size}push(e,t,i){this._queue.push(new yae(e,t,i))}clear(e){const t=new Cse;for(const i of this._queue)i.emitter!==e&&t.push(i);this._queue=t}deliver(){for(;this._queue.size>0;){const e=this._queue.shift();try{e.listener.invoke(e.event)}catch(e){zre(e)}}}}class Cae extends wae{clear(e){this._queue.clear()}}class yae{constructor(e,t,i){this.emitter=e,this.listener=t,this.event=i}}class Sae extends bae{constructor(e){super(e),this._isPaused=0,this._eventQueue=new Cse,this._mergeFn=null==e?void 0:e.merge}pause(){this._isPaused++}resume(){if(0!==this._isPaused&&0==--this._isPaused)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&0!==this._eventQueue.size;)super.fire(this._eventQueue.shift())}fire(e){this._listeners&&(0!==this._isPaused?this._eventQueue.push(e):super.fire(e))}}class kae extends Sae{constructor(e){var t;super(e),this._delay=null!==(t=e.delay)&&void 0!==t?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout((()=>{this._handle=void 0,this.resume()}),this._delay)),super.fire(e)}}class Lae extends bae{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=null==e?void 0:e.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),1===this._queuedEvents.length&&queueMicrotask((()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach((e=>super.fire(e))),this._queuedEvents=[]})))}}class xae{constructor(){this.buffers=[]}wrapEvent(e){return(t,i,n)=>e((e=>{const n=this.buffers[this.buffers.length-1];n?n.push((()=>t.call(i,e))):t.call(i,e)}),void 0,n)}bufferEvents(e){const t=[];this.buffers.push(t);const i=e();return this.buffers.pop(),t.forEach((e=>e())),i}}class Dae{constructor(){this.listening=!1,this.inputEvent=pae.None,this.inputEventListener=aae.None,this.emitter=new bae({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const Eae=Object.freeze((function(e,t){const i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}));var Nae;!function(e){e.isCancellationToken=function(t){return t===e.None||t===e.Cancelled||t instanceof Iae||!(!t||"object"!=typeof t)&&"boolean"==typeof t.isCancellationRequested&&"function"==typeof t.onCancellationRequested},e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:pae.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Eae})}(Nae||(Nae={}));class Iae{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Eae:(this._emitter||(this._emitter=new bae),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class Mae{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new Iae),this._token}cancel(){this._token?this._token instanceof Iae&&this._token.cancel():this._token=Nae.Cancelled}dispose(e=!1){var t;e&&this.cancel(),null===(t=this._parentListener)||void 0===t||t.dispose(),this._token?this._token instanceof Iae&&this._token.dispose():this._token=Nae.None}}class Tae{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const Aae=new Tae,Rae=new Tae,Oae=new Tae,Pae=new Array(230),Fae={},Bae=[],Wae=Object.create(null),Vae=Object.create(null),zae=[],Hae=[];for(let e=0;e<=193;e++)zae[e]=-1;for(let e=0;e<=127;e++)Hae[e]=-1;var Uae;let Kae;if(function(){const e="",t=[[0,1,0,"None",0,"unknown",0,"VK_UNKNOWN",e,e],[0,1,1,"Hyper",0,e,0,e,e,e],[0,1,2,"Super",0,e,0,e,e,e],[0,1,3,"Fn",0,e,0,e,e,e],[0,1,4,"FnLock",0,e,0,e,e,e],[0,1,5,"Suspend",0,e,0,e,e,e],[0,1,6,"Resume",0,e,0,e,e,e],[0,1,7,"Turbo",0,e,0,e,e,e],[0,1,8,"Sleep",0,e,0,"VK_SLEEP",e,e],[0,1,9,"WakeUp",0,e,0,e,e,e],[31,0,10,"KeyA",31,"A",65,"VK_A",e,e],[32,0,11,"KeyB",32,"B",66,"VK_B",e,e],[33,0,12,"KeyC",33,"C",67,"VK_C",e,e],[34,0,13,"KeyD",34,"D",68,"VK_D",e,e],[35,0,14,"KeyE",35,"E",69,"VK_E",e,e],[36,0,15,"KeyF",36,"F",70,"VK_F",e,e],[37,0,16,"KeyG",37,"G",71,"VK_G",e,e],[38,0,17,"KeyH",38,"H",72,"VK_H",e,e],[39,0,18,"KeyI",39,"I",73,"VK_I",e,e],[40,0,19,"KeyJ",40,"J",74,"VK_J",e,e],[41,0,20,"KeyK",41,"K",75,"VK_K",e,e],[42,0,21,"KeyL",42,"L",76,"VK_L",e,e],[43,0,22,"KeyM",43,"M",77,"VK_M",e,e],[44,0,23,"KeyN",44,"N",78,"VK_N",e,e],[45,0,24,"KeyO",45,"O",79,"VK_O",e,e],[46,0,25,"KeyP",46,"P",80,"VK_P",e,e],[47,0,26,"KeyQ",47,"Q",81,"VK_Q",e,e],[48,0,27,"KeyR",48,"R",82,"VK_R",e,e],[49,0,28,"KeyS",49,"S",83,"VK_S",e,e],[50,0,29,"KeyT",50,"T",84,"VK_T",e,e],[51,0,30,"KeyU",51,"U",85,"VK_U",e,e],[52,0,31,"KeyV",52,"V",86,"VK_V",e,e],[53,0,32,"KeyW",53,"W",87,"VK_W",e,e],[54,0,33,"KeyX",54,"X",88,"VK_X",e,e],[55,0,34,"KeyY",55,"Y",89,"VK_Y",e,e],[56,0,35,"KeyZ",56,"Z",90,"VK_Z",e,e],[22,0,36,"Digit1",22,"1",49,"VK_1",e,e],[23,0,37,"Digit2",23,"2",50,"VK_2",e,e],[24,0,38,"Digit3",24,"3",51,"VK_3",e,e],[25,0,39,"Digit4",25,"4",52,"VK_4",e,e],[26,0,40,"Digit5",26,"5",53,"VK_5",e,e],[27,0,41,"Digit6",27,"6",54,"VK_6",e,e],[28,0,42,"Digit7",28,"7",55,"VK_7",e,e],[29,0,43,"Digit8",29,"8",56,"VK_8",e,e],[30,0,44,"Digit9",30,"9",57,"VK_9",e,e],[21,0,45,"Digit0",21,"0",48,"VK_0",e,e],[3,1,46,"Enter",3,"Enter",13,"VK_RETURN",e,e],[9,1,47,"Escape",9,"Escape",27,"VK_ESCAPE",e,e],[1,1,48,"Backspace",1,"Backspace",8,"VK_BACK",e,e],[2,1,49,"Tab",2,"Tab",9,"VK_TAB",e,e],[10,1,50,"Space",10,"Space",32,"VK_SPACE",e,e],[83,0,51,"Minus",83,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[81,0,52,"Equal",81,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[87,0,53,"BracketLeft",87,"[",219,"VK_OEM_4","[","OEM_4"],[89,0,54,"BracketRight",89,"]",221,"VK_OEM_6","]","OEM_6"],[88,0,55,"Backslash",88,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,0,56,"IntlHash",0,e,0,e,e,e],[80,0,57,"Semicolon",80,";",186,"VK_OEM_1",";","OEM_1"],[90,0,58,"Quote",90,"'",222,"VK_OEM_7","'","OEM_7"],[86,0,59,"Backquote",86,"`",192,"VK_OEM_3","`","OEM_3"],[82,0,60,"Comma",82,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[84,0,61,"Period",84,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[85,0,62,"Slash",85,"/",191,"VK_OEM_2","/","OEM_2"],[8,1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",e,e],[59,1,64,"F1",59,"F1",112,"VK_F1",e,e],[60,1,65,"F2",60,"F2",113,"VK_F2",e,e],[61,1,66,"F3",61,"F3",114,"VK_F3",e,e],[62,1,67,"F4",62,"F4",115,"VK_F4",e,e],[63,1,68,"F5",63,"F5",116,"VK_F5",e,e],[64,1,69,"F6",64,"F6",117,"VK_F6",e,e],[65,1,70,"F7",65,"F7",118,"VK_F7",e,e],[66,1,71,"F8",66,"F8",119,"VK_F8",e,e],[67,1,72,"F9",67,"F9",120,"VK_F9",e,e],[68,1,73,"F10",68,"F10",121,"VK_F10",e,e],[69,1,74,"F11",69,"F11",122,"VK_F11",e,e],[70,1,75,"F12",70,"F12",123,"VK_F12",e,e],[0,1,76,"PrintScreen",0,e,0,e,e,e],[79,1,77,"ScrollLock",79,"ScrollLock",145,"VK_SCROLL",e,e],[7,1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",e,e],[19,1,79,"Insert",19,"Insert",45,"VK_INSERT",e,e],[14,1,80,"Home",14,"Home",36,"VK_HOME",e,e],[11,1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",e,e],[20,1,82,"Delete",20,"Delete",46,"VK_DELETE",e,e],[13,1,83,"End",13,"End",35,"VK_END",e,e],[12,1,84,"PageDown",12,"PageDown",34,"VK_NEXT",e,e],[17,1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",e],[15,1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",e],[18,1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",e],[16,1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",e],[78,1,89,"NumLock",78,"NumLock",144,"VK_NUMLOCK",e,e],[108,1,90,"NumpadDivide",108,"NumPad_Divide",111,"VK_DIVIDE",e,e],[103,1,91,"NumpadMultiply",103,"NumPad_Multiply",106,"VK_MULTIPLY",e,e],[106,1,92,"NumpadSubtract",106,"NumPad_Subtract",109,"VK_SUBTRACT",e,e],[104,1,93,"NumpadAdd",104,"NumPad_Add",107,"VK_ADD",e,e],[3,1,94,"NumpadEnter",3,e,0,e,e,e],[94,1,95,"Numpad1",94,"NumPad1",97,"VK_NUMPAD1",e,e],[95,1,96,"Numpad2",95,"NumPad2",98,"VK_NUMPAD2",e,e],[96,1,97,"Numpad3",96,"NumPad3",99,"VK_NUMPAD3",e,e],[97,1,98,"Numpad4",97,"NumPad4",100,"VK_NUMPAD4",e,e],[98,1,99,"Numpad5",98,"NumPad5",101,"VK_NUMPAD5",e,e],[99,1,100,"Numpad6",99,"NumPad6",102,"VK_NUMPAD6",e,e],[100,1,101,"Numpad7",100,"NumPad7",103,"VK_NUMPAD7",e,e],[101,1,102,"Numpad8",101,"NumPad8",104,"VK_NUMPAD8",e,e],[102,1,103,"Numpad9",102,"NumPad9",105,"VK_NUMPAD9",e,e],[93,1,104,"Numpad0",93,"NumPad0",96,"VK_NUMPAD0",e,e],[107,1,105,"NumpadDecimal",107,"NumPad_Decimal",110,"VK_DECIMAL",e,e],[92,0,106,"IntlBackslash",92,"OEM_102",226,"VK_OEM_102",e,e],[58,1,107,"ContextMenu",58,"ContextMenu",93,e,e,e],[0,1,108,"Power",0,e,0,e,e,e],[0,1,109,"NumpadEqual",0,e,0,e,e,e],[71,1,110,"F13",71,"F13",124,"VK_F13",e,e],[72,1,111,"F14",72,"F14",125,"VK_F14",e,e],[73,1,112,"F15",73,"F15",126,"VK_F15",e,e],[74,1,113,"F16",74,"F16",127,"VK_F16",e,e],[75,1,114,"F17",75,"F17",128,"VK_F17",e,e],[76,1,115,"F18",76,"F18",129,"VK_F18",e,e],[77,1,116,"F19",77,"F19",130,"VK_F19",e,e],[0,1,117,"F20",0,e,0,"VK_F20",e,e],[0,1,118,"F21",0,e,0,"VK_F21",e,e],[0,1,119,"F22",0,e,0,"VK_F22",e,e],[0,1,120,"F23",0,e,0,"VK_F23",e,e],[0,1,121,"F24",0,e,0,"VK_F24",e,e],[0,1,122,"Open",0,e,0,e,e,e],[0,1,123,"Help",0,e,0,e,e,e],[0,1,124,"Select",0,e,0,e,e,e],[0,1,125,"Again",0,e,0,e,e,e],[0,1,126,"Undo",0,e,0,e,e,e],[0,1,127,"Cut",0,e,0,e,e,e],[0,1,128,"Copy",0,e,0,e,e,e],[0,1,129,"Paste",0,e,0,e,e,e],[0,1,130,"Find",0,e,0,e,e,e],[0,1,131,"AudioVolumeMute",112,"AudioVolumeMute",173,"VK_VOLUME_MUTE",e,e],[0,1,132,"AudioVolumeUp",113,"AudioVolumeUp",175,"VK_VOLUME_UP",e,e],[0,1,133,"AudioVolumeDown",114,"AudioVolumeDown",174,"VK_VOLUME_DOWN",e,e],[105,1,134,"NumpadComma",105,"NumPad_Separator",108,"VK_SEPARATOR",e,e],[110,0,135,"IntlRo",110,"ABNT_C1",193,"VK_ABNT_C1",e,e],[0,1,136,"KanaMode",0,e,0,e,e,e],[0,0,137,"IntlYen",0,e,0,e,e,e],[0,1,138,"Convert",0,e,0,e,e,e],[0,1,139,"NonConvert",0,e,0,e,e,e],[0,1,140,"Lang1",0,e,0,e,e,e],[0,1,141,"Lang2",0,e,0,e,e,e],[0,1,142,"Lang3",0,e,0,e,e,e],[0,1,143,"Lang4",0,e,0,e,e,e],[0,1,144,"Lang5",0,e,0,e,e,e],[0,1,145,"Abort",0,e,0,e,e,e],[0,1,146,"Props",0,e,0,e,e,e],[0,1,147,"NumpadParenLeft",0,e,0,e,e,e],[0,1,148,"NumpadParenRight",0,e,0,e,e,e],[0,1,149,"NumpadBackspace",0,e,0,e,e,e],[0,1,150,"NumpadMemoryStore",0,e,0,e,e,e],[0,1,151,"NumpadMemoryRecall",0,e,0,e,e,e],[0,1,152,"NumpadMemoryClear",0,e,0,e,e,e],[0,1,153,"NumpadMemoryAdd",0,e,0,e,e,e],[0,1,154,"NumpadMemorySubtract",0,e,0,e,e,e],[0,1,155,"NumpadClear",126,"Clear",12,"VK_CLEAR",e,e],[0,1,156,"NumpadClearEntry",0,e,0,e,e,e],[5,1,0,e,5,"Ctrl",17,"VK_CONTROL",e,e],[4,1,0,e,4,"Shift",16,"VK_SHIFT",e,e],[6,1,0,e,6,"Alt",18,"VK_MENU",e,e],[57,1,0,e,57,"Meta",0,"VK_COMMAND",e,e],[5,1,157,"ControlLeft",5,e,0,"VK_LCONTROL",e,e],[4,1,158,"ShiftLeft",4,e,0,"VK_LSHIFT",e,e],[6,1,159,"AltLeft",6,e,0,"VK_LMENU",e,e],[57,1,160,"MetaLeft",57,e,0,"VK_LWIN",e,e],[5,1,161,"ControlRight",5,e,0,"VK_RCONTROL",e,e],[4,1,162,"ShiftRight",4,e,0,"VK_RSHIFT",e,e],[6,1,163,"AltRight",6,e,0,"VK_RMENU",e,e],[57,1,164,"MetaRight",57,e,0,"VK_RWIN",e,e],[0,1,165,"BrightnessUp",0,e,0,e,e,e],[0,1,166,"BrightnessDown",0,e,0,e,e,e],[0,1,167,"MediaPlay",0,e,0,e,e,e],[0,1,168,"MediaRecord",0,e,0,e,e,e],[0,1,169,"MediaFastForward",0,e,0,e,e,e],[0,1,170,"MediaRewind",0,e,0,e,e,e],[114,1,171,"MediaTrackNext",119,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",e,e],[115,1,172,"MediaTrackPrevious",120,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",e,e],[116,1,173,"MediaStop",121,"MediaStop",178,"VK_MEDIA_STOP",e,e],[0,1,174,"Eject",0,e,0,e,e,e],[117,1,175,"MediaPlayPause",122,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",e,e],[0,1,176,"MediaSelect",123,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",e,e],[0,1,177,"LaunchMail",124,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",e,e],[0,1,178,"LaunchApp2",125,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",e,e],[0,1,179,"LaunchApp1",0,e,0,"VK_MEDIA_LAUNCH_APP1",e,e],[0,1,180,"SelectTask",0,e,0,e,e,e],[0,1,181,"LaunchScreenSaver",0,e,0,e,e,e],[0,1,182,"BrowserSearch",115,"BrowserSearch",170,"VK_BROWSER_SEARCH",e,e],[0,1,183,"BrowserHome",116,"BrowserHome",172,"VK_BROWSER_HOME",e,e],[112,1,184,"BrowserBack",117,"BrowserBack",166,"VK_BROWSER_BACK",e,e],[113,1,185,"BrowserForward",118,"BrowserForward",167,"VK_BROWSER_FORWARD",e,e],[0,1,186,"BrowserStop",0,e,0,"VK_BROWSER_STOP",e,e],[0,1,187,"BrowserRefresh",0,e,0,"VK_BROWSER_REFRESH",e,e],[0,1,188,"BrowserFavorites",0,e,0,"VK_BROWSER_FAVORITES",e,e],[0,1,189,"ZoomToggle",0,e,0,e,e,e],[0,1,190,"MailReply",0,e,0,e,e,e],[0,1,191,"MailForward",0,e,0,e,e,e],[0,1,192,"MailSend",0,e,0,e,e,e],[109,1,0,e,109,"KeyInComposition",229,e,e,e],[111,1,0,e,111,"ABNT_C2",194,"VK_ABNT_C2",e,e],[91,1,0,e,91,"OEM_8",223,"VK_OEM_8",e,e],[0,1,0,e,0,e,0,"VK_KANA",e,e],[0,1,0,e,0,e,0,"VK_HANGUL",e,e],[0,1,0,e,0,e,0,"VK_JUNJA",e,e],[0,1,0,e,0,e,0,"VK_FINAL",e,e],[0,1,0,e,0,e,0,"VK_HANJA",e,e],[0,1,0,e,0,e,0,"VK_KANJI",e,e],[0,1,0,e,0,e,0,"VK_CONVERT",e,e],[0,1,0,e,0,e,0,"VK_NONCONVERT",e,e],[0,1,0,e,0,e,0,"VK_ACCEPT",e,e],[0,1,0,e,0,e,0,"VK_MODECHANGE",e,e],[0,1,0,e,0,e,0,"VK_SELECT",e,e],[0,1,0,e,0,e,0,"VK_PRINT",e,e],[0,1,0,e,0,e,0,"VK_EXECUTE",e,e],[0,1,0,e,0,e,0,"VK_SNAPSHOT",e,e],[0,1,0,e,0,e,0,"VK_HELP",e,e],[0,1,0,e,0,e,0,"VK_APPS",e,e],[0,1,0,e,0,e,0,"VK_PROCESSKEY",e,e],[0,1,0,e,0,e,0,"VK_PACKET",e,e],[0,1,0,e,0,e,0,"VK_DBE_SBCSCHAR",e,e],[0,1,0,e,0,e,0,"VK_DBE_DBCSCHAR",e,e],[0,1,0,e,0,e,0,"VK_ATTN",e,e],[0,1,0,e,0,e,0,"VK_CRSEL",e,e],[0,1,0,e,0,e,0,"VK_EXSEL",e,e],[0,1,0,e,0,e,0,"VK_EREOF",e,e],[0,1,0,e,0,e,0,"VK_PLAY",e,e],[0,1,0,e,0,e,0,"VK_ZOOM",e,e],[0,1,0,e,0,e,0,"VK_NONAME",e,e],[0,1,0,e,0,e,0,"VK_PA1",e,e],[0,1,0,e,0,e,0,"VK_OEM_CLEAR",e,e]],i=[],n=[];for(const e of t){const[t,o,s,r,a,l,h,d,c,u]=e;if(n[s]||(n[s]=!0,Bae[s]=r,Wae[r]=s,Vae[r.toLowerCase()]=s,o&&(zae[s]=a,0!==a&&3!==a&&5!==a&&4!==a&&6!==a&&57!==a&&(Hae[a]=s))),!i[a]){if(i[a]=!0,!l)throw new Error(`String representation missing for key code ${a} around scan code ${r}`);Aae.define(a,l),Rae.define(a,c||l),Oae.define(a,u||c||l)}h&&(Pae[h]=a),d&&(Fae[d]=a)}Hae[3]=46}(),function(e){e.toString=function(e){return Aae.keyCodeToStr(e)},e.fromString=function(e){return Aae.strToKeyCode(e)},e.toUserSettingsUS=function(e){return Rae.keyCodeToStr(e)},e.toUserSettingsGeneral=function(e){return Oae.keyCodeToStr(e)},e.fromUserSettings=function(e){return Rae.strToKeyCode(e)||Oae.strToKeyCode(e)},e.toElectronAccelerator=function(e){if(e>=93&&e<=108)return null;switch(e){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Aae.keyCodeToStr(e)}}(Uae||(Uae={})),void 0!==Zoe.vscode&&void 0!==Zoe.vscode.process){const e=Zoe.vscode.process;Kae={get platform(){return e.platform},get arch(){return e.arch},get env(){return e.env},cwd:()=>e.cwd()}}else Kae="undefined"!=typeof process?{get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd:()=>process.env.VSCODE_CWD||process.cwd()}:{get platform(){return ese?"win32":tse?"darwin":"linux"},get arch(){},get env(){return{}},cwd:()=>"/"};const jae=Kae.cwd,qae=Kae.env,$ae=Kae.platform,Gae=46,Zae=47,Yae=92,Qae=58;class Xae extends Error{constructor(e,t,i){let n;"string"==typeof t&&0===t.indexOf("not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";const o=-1!==e.indexOf(".")?"property":"argument";let s=`The "${e}" ${o} ${n} of type ${t}`;s+=". Received type "+typeof i,super(s),this.code="ERR_INVALID_ARG_TYPE"}}function Jae(e,t){if("string"!=typeof e)throw new Xae(t,"string",e)}const ele="win32"===$ae;function tle(e){return e===Zae||e===Yae}function ile(e){return e===Zae}function nle(e){return e>=65&&e<=90||e>=97&&e<=122}function ole(e,t,i,n){let o="",s=0,r=-1,a=0,l=0;for(let h=0;h<=e.length;++h){if(h<e.length)l=e.charCodeAt(h);else{if(n(l))break;l=Zae}if(n(l)){if(r===h-1||1===a);else if(2===a){if(o.length<2||2!==s||o.charCodeAt(o.length-1)!==Gae||o.charCodeAt(o.length-2)!==Gae){if(o.length>2){const e=o.lastIndexOf(i);-1===e?(o="",s=0):(o=o.slice(0,e),s=o.length-1-o.lastIndexOf(i)),r=h,a=0;continue}if(0!==o.length){o="",s=0,r=h,a=0;continue}}t&&(o+=o.length>0?`${i}..`:"..",s=2)}else o.length>0?o+=`${i}${e.slice(r+1,h)}`:o=e.slice(r+1,h),s=h-r-1;r=h,a=0}else l===Gae&&-1!==a?++a:a=-1}return o}function sle(e,t){!function(e,t){if(null===e||"object"!=typeof e)throw new Xae("pathObject","Object",e)}(t);const i=t.dir||t.root,n=t.base||`${t.name||""}${t.ext||""}`;return i?i===t.root?`${i}${n}`:`${i}${e}${n}`:n}const rle={resolve(...e){let t="",i="",n=!1;for(let o=e.length-1;o>=-1;o--){let s;if(o>=0){if(s=e[o],Jae(s,"path"),0===s.length)continue}else 0===t.length?s=jae():(s=qae[`=${t}`]||jae(),(void 0===s||s.slice(0,2).toLowerCase()!==t.toLowerCase()&&s.charCodeAt(2)===Yae)&&(s=`${t}\\`));const r=s.length;let a=0,l="",h=!1;const d=s.charCodeAt(0);if(1===r)tle(d)&&(a=1,h=!0);else if(tle(d))if(h=!0,tle(s.charCodeAt(1))){let e=2,t=e;for(;e<r&&!tle(s.charCodeAt(e));)e++;if(e<r&&e!==t){const i=s.slice(t,e);for(t=e;e<r&&tle(s.charCodeAt(e));)e++;if(e<r&&e!==t){for(t=e;e<r&&!tle(s.charCodeAt(e));)e++;e!==r&&e===t||(l=`\\\\${i}\\${s.slice(t,e)}`,a=e)}}}else a=1;else nle(d)&&s.charCodeAt(1)===Qae&&(l=s.slice(0,2),a=2,r>2&&tle(s.charCodeAt(2))&&(h=!0,a=3));if(l.length>0)if(t.length>0){if(l.toLowerCase()!==t.toLowerCase())continue}else t=l;if(n){if(t.length>0)break}else if(i=`${s.slice(a)}\\${i}`,n=h,h&&t.length>0)break}return i=ole(i,!n,"\\",tle),n?`${t}\\${i}`:`${t}${i}`||"."},normalize(e){Jae(e,"path");const t=e.length;if(0===t)return".";let i,n=0,o=!1;const s=e.charCodeAt(0);if(1===t)return ile(s)?"\\":e;if(tle(s))if(o=!0,tle(e.charCodeAt(1))){let o=2,s=o;for(;o<t&&!tle(e.charCodeAt(o));)o++;if(o<t&&o!==s){const r=e.slice(s,o);for(s=o;o<t&&tle(e.charCodeAt(o));)o++;if(o<t&&o!==s){for(s=o;o<t&&!tle(e.charCodeAt(o));)o++;if(o===t)return`\\\\${r}\\${e.slice(s)}\\`;o!==s&&(i=`\\\\${r}\\${e.slice(s,o)}`,n=o)}}}else n=1;else nle(s)&&e.charCodeAt(1)===Qae&&(i=e.slice(0,2),n=2,t>2&&tle(e.charCodeAt(2))&&(o=!0,n=3));let r=n<t?ole(e.slice(n),!o,"\\",tle):"";return 0!==r.length||o||(r="."),r.length>0&&tle(e.charCodeAt(t-1))&&(r+="\\"),void 0===i?o?`\\${r}`:r:o?`${i}\\${r}`:`${i}${r}`},isAbsolute(e){Jae(e,"path");const t=e.length;if(0===t)return!1;const i=e.charCodeAt(0);return tle(i)||t>2&&nle(i)&&e.charCodeAt(1)===Qae&&tle(e.charCodeAt(2))},join(...e){if(0===e.length)return".";let t,i;for(let n=0;n<e.length;++n){const o=e[n];Jae(o,"path"),o.length>0&&(void 0===t?t=i=o:t+=`\\${o}`)}if(void 0===t)return".";let n=!0,o=0;if("string"==typeof i&&tle(i.charCodeAt(0))){++o;const e=i.length;e>1&&tle(i.charCodeAt(1))&&(++o,e>2&&(tle(i.charCodeAt(2))?++o:n=!1))}if(n){for(;o<t.length&&tle(t.charCodeAt(o));)o++;o>=2&&(t=`\\${t.slice(o)}`)}return rle.normalize(t)},relative(e,t){if(Jae(e,"from"),Jae(t,"to"),e===t)return"";const i=rle.resolve(e),n=rle.resolve(t);if(i===n)return"";if((e=i.toLowerCase())===(t=n.toLowerCase()))return"";let o=0;for(;o<e.length&&e.charCodeAt(o)===Yae;)o++;let s=e.length;for(;s-1>o&&e.charCodeAt(s-1)===Yae;)s--;const r=s-o;let a=0;for(;a<t.length&&t.charCodeAt(a)===Yae;)a++;let l=t.length;for(;l-1>a&&t.charCodeAt(l-1)===Yae;)l--;const h=l-a,d=r<h?r:h;let c=-1,u=0;for(;u<d;u++){const i=e.charCodeAt(o+u);if(i!==t.charCodeAt(a+u))break;i===Yae&&(c=u)}if(u!==d){if(-1===c)return n}else{if(h>d){if(t.charCodeAt(a+u)===Yae)return n.slice(a+u+1);if(2===u)return n.slice(a+u)}r>d&&(e.charCodeAt(o+u)===Yae?c=u:2===u&&(c=3)),-1===c&&(c=0)}let g="";for(u=o+c+1;u<=s;++u)u!==s&&e.charCodeAt(u)!==Yae||(g+=0===g.length?"..":"\\..");return a+=c,g.length>0?`${g}${n.slice(a,l)}`:(n.charCodeAt(a)===Yae&&++a,n.slice(a,l))},toNamespacedPath(e){if("string"!=typeof e||0===e.length)return e;const t=rle.resolve(e);if(t.length<=2)return e;if(t.charCodeAt(0)===Yae){if(t.charCodeAt(1)===Yae){const e=t.charCodeAt(2);if(63!==e&&e!==Gae)return`\\\\?\\UNC\\${t.slice(2)}`}}else if(nle(t.charCodeAt(0))&&t.charCodeAt(1)===Qae&&t.charCodeAt(2)===Yae)return`\\\\?\\${t}`;return e},dirname(e){Jae(e,"path");const t=e.length;if(0===t)return".";let i=-1,n=0;const o=e.charCodeAt(0);if(1===t)return tle(o)?e:".";if(tle(o)){if(i=n=1,tle(e.charCodeAt(1))){let o=2,s=o;for(;o<t&&!tle(e.charCodeAt(o));)o++;if(o<t&&o!==s){for(s=o;o<t&&tle(e.charCodeAt(o));)o++;if(o<t&&o!==s){for(s=o;o<t&&!tle(e.charCodeAt(o));)o++;if(o===t)return e;o!==s&&(i=n=o+1)}}}}else nle(o)&&e.charCodeAt(1)===Qae&&(i=t>2&&tle(e.charCodeAt(2))?3:2,n=i);let s=-1,r=!0;for(let i=t-1;i>=n;--i)if(tle(e.charCodeAt(i))){if(!r){s=i;break}}else r=!1;if(-1===s){if(-1===i)return".";s=i}return e.slice(0,s)},basename(e,t){void 0!==t&&Jae(t,"ext"),Jae(e,"path");let i,n=0,o=-1,s=!0;if(e.length>=2&&nle(e.charCodeAt(0))&&e.charCodeAt(1)===Qae&&(n=2),void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let r=t.length-1,a=-1;for(i=e.length-1;i>=n;--i){const l=e.charCodeAt(i);if(tle(l)){if(!s){n=i+1;break}}else-1===a&&(s=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1==--r&&(o=i):(r=-1,o=a))}return n===o?o=a:-1===o&&(o=e.length),e.slice(n,o)}for(i=e.length-1;i>=n;--i)if(tle(e.charCodeAt(i))){if(!s){n=i+1;break}}else-1===o&&(s=!1,o=i+1);return-1===o?"":e.slice(n,o)},extname(e){Jae(e,"path");let t=0,i=-1,n=0,o=-1,s=!0,r=0;e.length>=2&&e.charCodeAt(1)===Qae&&nle(e.charCodeAt(0))&&(t=n=2);for(let a=e.length-1;a>=t;--a){const t=e.charCodeAt(a);if(tle(t)){if(!s){n=a+1;break}}else-1===o&&(s=!1,o=a+1),t===Gae?-1===i?i=a:1!==r&&(r=1):-1!==i&&(r=-1)}return-1===i||-1===o||0===r||1===r&&i===o-1&&i===n+1?"":e.slice(i,o)},format:sle.bind(null,"\\"),parse(e){Jae(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.length;let n=0,o=e.charCodeAt(0);if(1===i)return tle(o)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(tle(o)){if(n=1,tle(e.charCodeAt(1))){let t=2,o=t;for(;t<i&&!tle(e.charCodeAt(t));)t++;if(t<i&&t!==o){for(o=t;t<i&&tle(e.charCodeAt(t));)t++;if(t<i&&t!==o){for(o=t;t<i&&!tle(e.charCodeAt(t));)t++;t===i?n=t:t!==o&&(n=t+1)}}}}else if(nle(o)&&e.charCodeAt(1)===Qae){if(i<=2)return t.root=t.dir=e,t;if(n=2,tle(e.charCodeAt(2))){if(3===i)return t.root=t.dir=e,t;n=3}}n>0&&(t.root=e.slice(0,n));let s=-1,r=n,a=-1,l=!0,h=e.length-1,d=0;for(;h>=n;--h)if(o=e.charCodeAt(h),tle(o)){if(!l){r=h+1;break}}else-1===a&&(l=!1,a=h+1),o===Gae?-1===s?s=h:1!==d&&(d=1):-1!==s&&(d=-1);return-1!==a&&(-1===s||0===d||1===d&&s===a-1&&s===r+1?t.base=t.name=e.slice(r,a):(t.name=e.slice(r,s),t.base=e.slice(r,a),t.ext=e.slice(s,a))),t.dir=r>0&&r!==n?e.slice(0,r-1):t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},ale=(()=>{if(ele){const e=/\\/g;return()=>{const t=jae().replace(e,"/");return t.slice(t.indexOf("/"))}}return()=>jae()})(),lle={resolve(...e){let t="",i=!1;for(let n=e.length-1;n>=-1&&!i;n--){const o=n>=0?e[n]:ale();Jae(o,"path"),0!==o.length&&(t=`${o}/${t}`,i=o.charCodeAt(0)===Zae)}return t=ole(t,!i,"/",ile),i?`/${t}`:t.length>0?t:"."},normalize(e){if(Jae(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===Zae,i=e.charCodeAt(e.length-1)===Zae;return 0===(e=ole(e,!t,"/",ile)).length?t?"/":i?"./":".":(i&&(e+="/"),t?`/${e}`:e)},isAbsolute:e=>(Jae(e,"path"),e.length>0&&e.charCodeAt(0)===Zae),join(...e){if(0===e.length)return".";let t;for(let i=0;i<e.length;++i){const n=e[i];Jae(n,"path"),n.length>0&&(void 0===t?t=n:t+=`/${n}`)}return void 0===t?".":lle.normalize(t)},relative(e,t){if(Jae(e,"from"),Jae(t,"to"),e===t)return"";if((e=lle.resolve(e))===(t=lle.resolve(t)))return"";const i=e.length,n=i-1,o=t.length-1,s=n<o?n:o;let r=-1,a=0;for(;a<s;a++){const i=e.charCodeAt(1+a);if(i!==t.charCodeAt(1+a))break;i===Zae&&(r=a)}if(a===s)if(o>s){if(t.charCodeAt(1+a)===Zae)return t.slice(1+a+1);if(0===a)return t.slice(1+a)}else n>s&&(e.charCodeAt(1+a)===Zae?r=a:0===a&&(r=0));let l="";for(a=1+r+1;a<=i;++a)a!==i&&e.charCodeAt(a)!==Zae||(l+=0===l.length?"..":"/..");return`${l}${t.slice(1+r)}`},toNamespacedPath:e=>e,dirname(e){if(Jae(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===Zae;let i=-1,n=!0;for(let t=e.length-1;t>=1;--t)if(e.charCodeAt(t)===Zae){if(!n){i=t;break}}else n=!1;return-1===i?t?"/":".":t&&1===i?"//":e.slice(0,i)},basename(e,t){void 0!==t&&Jae(t,"ext"),Jae(e,"path");let i,n=0,o=-1,s=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let r=t.length-1,a=-1;for(i=e.length-1;i>=0;--i){const l=e.charCodeAt(i);if(l===Zae){if(!s){n=i+1;break}}else-1===a&&(s=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1==--r&&(o=i):(r=-1,o=a))}return n===o?o=a:-1===o&&(o=e.length),e.slice(n,o)}for(i=e.length-1;i>=0;--i)if(e.charCodeAt(i)===Zae){if(!s){n=i+1;break}}else-1===o&&(s=!1,o=i+1);return-1===o?"":e.slice(n,o)},extname(e){Jae(e,"path");let t=-1,i=0,n=-1,o=!0,s=0;for(let r=e.length-1;r>=0;--r){const a=e.charCodeAt(r);if(a!==Zae)-1===n&&(o=!1,n=r+1),a===Gae?-1===t?t=r:1!==s&&(s=1):-1!==t&&(s=-1);else if(!o){i=r+1;break}}return-1===t||-1===n||0===s||1===s&&t===n-1&&t===i+1?"":e.slice(t,n)},format:sle.bind(null,"/"),parse(e){Jae(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.charCodeAt(0)===Zae;let n;i?(t.root="/",n=1):n=0;let o=-1,s=0,r=-1,a=!0,l=e.length-1,h=0;for(;l>=n;--l){const t=e.charCodeAt(l);if(t!==Zae)-1===r&&(a=!1,r=l+1),t===Gae?-1===o?o=l:1!==h&&(h=1):-1!==o&&(h=-1);else if(!a){s=l+1;break}}if(-1!==r){const n=0===s&&i?1:s;-1===o||0===h||1===h&&o===r-1&&o===s+1?t.base=t.name=e.slice(n,r):(t.name=e.slice(n,o),t.base=e.slice(n,r),t.ext=e.slice(o,r))}return s>0?t.dir=e.slice(0,s-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};lle.win32=rle.win32=rle,lle.posix=rle.posix=lle;const hle=ele?rle.normalize:lle.normalize,dle=ele?rle.resolve:lle.resolve,cle=ele?rle.relative:lle.relative,ule=ele?rle.dirname:lle.dirname,gle=ele?rle.basename:lle.basename,ple=ele?rle.extname:lle.extname,mle=ele?rle.sep:lle.sep,fle=/^\w[\w\d+.-]*$/,_le=/^\//,vle=/^\/\//;function ble(e,t){if(!e.scheme&&t)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!fle.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!_le.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(vle.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}const wle="",Cle="/",yle=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class Sle{static isUri(e){return e instanceof Sle||!!e&&"string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString}constructor(e,t,i,n,o,s=!1){"object"==typeof e?(this.scheme=e.scheme||wle,this.authority=e.authority||wle,this.path=e.path||wle,this.query=e.query||wle,this.fragment=e.fragment||wle):(this.scheme=function(e,t){return e||t?e:"file"}(e,s),this.authority=t||wle,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==Cle&&(t=Cle+t):t=Cle}return t}(this.scheme,i||wle),this.query=n||wle,this.fragment=o||wle,ble(this,s))}get fsPath(){return Nle(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:n,query:o,fragment:s}=e;return void 0===t?t=this.scheme:null===t&&(t=wle),void 0===i?i=this.authority:null===i&&(i=wle),void 0===n?n=this.path:null===n&&(n=wle),void 0===o?o=this.query:null===o&&(o=wle),void 0===s?s=this.fragment:null===s&&(s=wle),t===this.scheme&&i===this.authority&&n===this.path&&o===this.query&&s===this.fragment?this:new Lle(t,i,n,o,s)}static parse(e,t=!1){const i=yle.exec(e);return i?new Lle(i[2]||wle,Ale(i[4]||wle),Ale(i[5]||wle),Ale(i[7]||wle),Ale(i[9]||wle),t):new Lle(wle,wle,wle,wle,wle)}static file(e){let t=wle;if(ese&&(e=e.replace(/\\/g,Cle)),e[0]===Cle&&e[1]===Cle){const i=e.indexOf(Cle,2);-1===i?(t=e.substring(2),e=Cle):(t=e.substring(2,i),e=e.substring(i)||Cle)}return new Lle("file",t,e,wle,wle)}static from(e){const t=new Lle(e.scheme,e.authority,e.path,e.query,e.fragment);return ble(t,!0),t}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return i=ese&&"file"===e.scheme?Sle.file(rle.join(Nle(e,!0),...t)).path:lle.join(e.path,...t),e.with({path:i})}toString(e=!1){return Ile(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof Sle)return e;{const t=new Lle(e);return t._formatted=e.external,t._fsPath=e._sep===kle?e.fsPath:null,t}}return e}}const kle=ese?1:void 0;class Lle extends Sle{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=Nle(this,!1)),this._fsPath}toString(e=!1){return e?Ile(this,!0):(this._formatted||(this._formatted=Ile(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=kle),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}const xle={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function Dle(e,t,i){let n,o=-1;for(let s=0;s<e.length;s++){const r=e.charCodeAt(s);if(r>=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||45===r||46===r||95===r||126===r||t&&47===r||i&&91===r||i&&93===r||i&&58===r)-1!==o&&(n+=encodeURIComponent(e.substring(o,s)),o=-1),void 0!==n&&(n+=e.charAt(s));else{void 0===n&&(n=e.substr(0,s));const t=xle[r];void 0!==t?(-1!==o&&(n+=encodeURIComponent(e.substring(o,s)),o=-1),n+=t):-1===o&&(o=s)}}return-1!==o&&(n+=encodeURIComponent(e.substring(o))),void 0!==n?n:e}function Ele(e){let t;for(let i=0;i<e.length;i++){const n=e.charCodeAt(i);35===n||63===n?(void 0===t&&(t=e.substr(0,i)),t+=xle[n]):void 0!==t&&(t+=e[i])}return void 0!==t?t:e}function Nle(e,t){let i;return i=e.authority&&e.path.length>1&&"file"===e.scheme?`//${e.authority}${e.path}`:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,ese&&(i=i.replace(/\//g,"\\")),i}function Ile(e,t){const i=t?Ele:Dle;let n="",{scheme:o,authority:s,path:r,query:a,fragment:l}=e;if(o&&(n+=o,n+=":"),(s||"file"===o)&&(n+=Cle,n+=Cle),s){let e=s.indexOf("@");if(-1!==e){const t=s.substr(0,e);s=s.substr(e+1),e=t.lastIndexOf(":"),-1===e?n+=i(t,!1,!1):(n+=i(t.substr(0,e),!1,!1),n+=":",n+=i(t.substr(e+1),!1,!0)),n+="@"}s=s.toLowerCase(),e=s.lastIndexOf(":"),-1===e?n+=i(s,!1,!0):(n+=i(s.substr(0,e),!1,!0),n+=s.substr(e))}if(r){if(r.length>=3&&47===r.charCodeAt(0)&&58===r.charCodeAt(2)){const e=r.charCodeAt(1);e>=65&&e<=90&&(r=`/${String.fromCharCode(e+32)}:${r.substr(3)}`)}else if(r.length>=2&&58===r.charCodeAt(1)){const e=r.charCodeAt(0);e>=65&&e<=90&&(r=`${String.fromCharCode(e+32)}:${r.substr(2)}`)}n+=i(r,!0,!1)}return a&&(n+="?",n+=i(a,!1,!1)),l&&(n+="#",n+=t?l:Dle(l,!1,!1)),n}function Mle(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+Mle(e.substr(3)):e}}const Tle=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function Ale(e){return e.match(Tle)?e.replace(Tle,(e=>Mle(e))):e}class Rle{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new Rle(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return Rle.equals(this,e)}static equals(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return Rle.isBefore(this,e)}static isBefore(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<t.column}isBeforeOrEqual(e){return Rle.isBeforeOrEqual(this,e)}static isBeforeOrEqual(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<=t.column}static compare(e,t){const i=0|e.lineNumber,n=0|t.lineNumber;return i===n?(0|e.column)-(0|t.column):i-n}clone(){return new Rle(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(e){return new Rle(e.lineNumber,e.column)}static isIPosition(e){return e&&"number"==typeof e.lineNumber&&"number"==typeof e.column}}class Ole{constructor(e,t,i,n){e>i||e===i&&t>n?(this.startLineNumber=i,this.startColumn=n,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=n)}isEmpty(){return Ole.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return Ole.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<e.startColumn||t.lineNumber===e.endLineNumber&&t.column>e.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return Ole.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>e.endColumn)}strictContainsRange(e){return Ole.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return Ole.plusRange(this,e)}static plusRange(e,t){let i,n,o,s;return t.startLineNumber<e.startLineNumber?(i=t.startLineNumber,n=t.startColumn):t.startLineNumber===e.startLineNumber?(i=t.startLineNumber,n=Math.min(t.startColumn,e.startColumn)):(i=e.startLineNumber,n=e.startColumn),t.endLineNumber>e.endLineNumber?(o=t.endLineNumber,s=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,s=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,s=e.endColumn),new Ole(i,n,o,s)}intersectRanges(e){return Ole.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn;const r=t.startLineNumber,a=t.startColumn,l=t.endLineNumber,h=t.endColumn;return i<r?(i=r,n=a):i===r&&(n=Math.max(n,a)),o>l?(o=l,s=h):o===l&&(s=Math.min(s,h)),i>o||i===o&&n>s?null:new Ole(i,n,o,s)}equalsRange(e){return Ole.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t||!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return Ole.getEndPosition(this)}static getEndPosition(e){return new Rle(e.endLineNumber,e.endColumn)}getStartPosition(){return Ole.getStartPosition(this)}static getStartPosition(e){return new Rle(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new Ole(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new Ole(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return Ole.collapseToStart(this)}static collapseToStart(e){return new Ole(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return Ole.collapseToEnd(this)}static collapseToEnd(e){return new Ole(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new Ole(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new Ole(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new Ole(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&"number"==typeof e.startLineNumber&&"number"==typeof e.startColumn&&"number"==typeof e.endLineNumber&&"number"==typeof e.endColumn}static areIntersectingOrTouching(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn)}static areIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<=t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<=e.startColumn)}static compareRangesUsingStarts(e,t){if(e&&t){const i=0|e.startLineNumber,n=0|t.startLineNumber;if(i===n){const i=0|e.startColumn,n=0|t.startColumn;if(i===n){const i=0|e.endLineNumber,n=0|t.endLineNumber;return i===n?(0|e.endColumn)-(0|t.endColumn):i-n}return i-n}return i-n}return(e?1:0)-(t?1:0)}static compareRangesUsingEnds(e,t){return e.endLineNumber===t.endLineNumber?e.endColumn===t.endColumn?e.startLineNumber===t.startLineNumber?e.startColumn-t.startColumn:e.startLineNumber-t.startLineNumber:e.endColumn-t.endColumn:e.endLineNumber-t.endLineNumber}static spansMultipleLines(e){return e.endLineNumber>e.startLineNumber}toJSON(){return this}}class Ple extends Ole{constructor(e,t,i,n){super(e,t,i,n),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=n}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return Ple.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return 0===this.getDirection()?new Ple(this.startLineNumber,this.startColumn,e,t):new Ple(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new Rle(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new Rle(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return 0===this.getDirection()?new Ple(e,t,this.endLineNumber,this.endColumn):new Ple(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new Ple(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return 0===t?new Ple(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new Ple(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new Ple(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,n=e.length;i<n;i++)if(!this.selectionsEqual(e[i],t[i]))return!1;return!0}static isISelection(e){return e&&"number"==typeof e.selectionStartLineNumber&&"number"==typeof e.selectionStartColumn&&"number"==typeof e.positionLineNumber&&"number"==typeof e.positionColumn}static createWithDirection(e,t,i,n,o){return 0===o?new Ple(e,t,i,n):new Ple(i,n,e,t)}}const Fle=Object.create(null);function Ble(e,t){if(Kse(t)){const i=Fle[t];if(void 0===i)throw new Error(`${e} references an unknown codicon: ${t}`);t=i}return Fle[e]=t,{id:e}}function Wle(){return Fle}const Vle={add:Ble("add",6e4),plus:Ble("plus",6e4),gistNew:Ble("gist-new",6e4),repoCreate:Ble("repo-create",6e4),lightbulb:Ble("lightbulb",60001),lightBulb:Ble("light-bulb",60001),repo:Ble("repo",60002),repoDelete:Ble("repo-delete",60002),gistFork:Ble("gist-fork",60003),repoForked:Ble("repo-forked",60003),gitPullRequest:Ble("git-pull-request",60004),gitPullRequestAbandoned:Ble("git-pull-request-abandoned",60004),recordKeys:Ble("record-keys",60005),keyboard:Ble("keyboard",60005),tag:Ble("tag",60006),tagAdd:Ble("tag-add",60006),tagRemove:Ble("tag-remove",60006),person:Ble("person",60007),personFollow:Ble("person-follow",60007),personOutline:Ble("person-outline",60007),personFilled:Ble("person-filled",60007),gitBranch:Ble("git-branch",60008),gitBranchCreate:Ble("git-branch-create",60008),gitBranchDelete:Ble("git-branch-delete",60008),sourceControl:Ble("source-control",60008),mirror:Ble("mirror",60009),mirrorPublic:Ble("mirror-public",60009),star:Ble("star",60010),starAdd:Ble("star-add",60010),starDelete:Ble("star-delete",60010),starEmpty:Ble("star-empty",60010),comment:Ble("comment",60011),commentAdd:Ble("comment-add",60011),alert:Ble("alert",60012),warning:Ble("warning",60012),search:Ble("search",60013),searchSave:Ble("search-save",60013),logOut:Ble("log-out",60014),signOut:Ble("sign-out",60014),logIn:Ble("log-in",60015),signIn:Ble("sign-in",60015),eye:Ble("eye",60016),eyeUnwatch:Ble("eye-unwatch",60016),eyeWatch:Ble("eye-watch",60016),circleFilled:Ble("circle-filled",60017),primitiveDot:Ble("primitive-dot",60017),closeDirty:Ble("close-dirty",60017),debugBreakpoint:Ble("debug-breakpoint",60017),debugBreakpointDisabled:Ble("debug-breakpoint-disabled",60017),debugHint:Ble("debug-hint",60017),primitiveSquare:Ble("primitive-square",60018),edit:Ble("edit",60019),pencil:Ble("pencil",60019),info:Ble("info",60020),issueOpened:Ble("issue-opened",60020),gistPrivate:Ble("gist-private",60021),gitForkPrivate:Ble("git-fork-private",60021),lock:Ble("lock",60021),mirrorPrivate:Ble("mirror-private",60021),close:Ble("close",60022),removeClose:Ble("remove-close",60022),x:Ble("x",60022),repoSync:Ble("repo-sync",60023),sync:Ble("sync",60023),clone:Ble("clone",60024),desktopDownload:Ble("desktop-download",60024),beaker:Ble("beaker",60025),microscope:Ble("microscope",60025),vm:Ble("vm",60026),deviceDesktop:Ble("device-desktop",60026),file:Ble("file",60027),fileText:Ble("file-text",60027),more:Ble("more",60028),ellipsis:Ble("ellipsis",60028),kebabHorizontal:Ble("kebab-horizontal",60028),mailReply:Ble("mail-reply",60029),reply:Ble("reply",60029),organization:Ble("organization",60030),organizationFilled:Ble("organization-filled",60030),organizationOutline:Ble("organization-outline",60030),newFile:Ble("new-file",60031),fileAdd:Ble("file-add",60031),newFolder:Ble("new-folder",60032),fileDirectoryCreate:Ble("file-directory-create",60032),trash:Ble("trash",60033),trashcan:Ble("trashcan",60033),history:Ble("history",60034),clock:Ble("clock",60034),folder:Ble("folder",60035),fileDirectory:Ble("file-directory",60035),symbolFolder:Ble("symbol-folder",60035),logoGithub:Ble("logo-github",60036),markGithub:Ble("mark-github",60036),github:Ble("github",60036),terminal:Ble("terminal",60037),console:Ble("console",60037),repl:Ble("repl",60037),zap:Ble("zap",60038),symbolEvent:Ble("symbol-event",60038),error:Ble("error",60039),stop:Ble("stop",60039),variable:Ble("variable",60040),symbolVariable:Ble("symbol-variable",60040),array:Ble("array",60042),symbolArray:Ble("symbol-array",60042),symbolModule:Ble("symbol-module",60043),symbolPackage:Ble("symbol-package",60043),symbolNamespace:Ble("symbol-namespace",60043),symbolObject:Ble("symbol-object",60043),symbolMethod:Ble("symbol-method",60044),symbolFunction:Ble("symbol-function",60044),symbolConstructor:Ble("symbol-constructor",60044),symbolBoolean:Ble("symbol-boolean",60047),symbolNull:Ble("symbol-null",60047),symbolNumeric:Ble("symbol-numeric",60048),symbolNumber:Ble("symbol-number",60048),symbolStructure:Ble("symbol-structure",60049),symbolStruct:Ble("symbol-struct",60049),symbolParameter:Ble("symbol-parameter",60050),symbolTypeParameter:Ble("symbol-type-parameter",60050),symbolKey:Ble("symbol-key",60051),symbolText:Ble("symbol-text",60051),symbolReference:Ble("symbol-reference",60052),goToFile:Ble("go-to-file",60052),symbolEnum:Ble("symbol-enum",60053),symbolValue:Ble("symbol-value",60053),symbolRuler:Ble("symbol-ruler",60054),symbolUnit:Ble("symbol-unit",60054),activateBreakpoints:Ble("activate-breakpoints",60055),archive:Ble("archive",60056),arrowBoth:Ble("arrow-both",60057),arrowDown:Ble("arrow-down",60058),arrowLeft:Ble("arrow-left",60059),arrowRight:Ble("arrow-right",60060),arrowSmallDown:Ble("arrow-small-down",60061),arrowSmallLeft:Ble("arrow-small-left",60062),arrowSmallRight:Ble("arrow-small-right",60063),arrowSmallUp:Ble("arrow-small-up",60064),arrowUp:Ble("arrow-up",60065),bell:Ble("bell",60066),bold:Ble("bold",60067),book:Ble("book",60068),bookmark:Ble("bookmark",60069),debugBreakpointConditionalUnverified:Ble("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:Ble("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:Ble("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:Ble("debug-breakpoint-data-unverified",60072),debugBreakpointData:Ble("debug-breakpoint-data",60073),debugBreakpointDataDisabled:Ble("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:Ble("debug-breakpoint-log-unverified",60074),debugBreakpointLog:Ble("debug-breakpoint-log",60075),debugBreakpointLogDisabled:Ble("debug-breakpoint-log-disabled",60075),briefcase:Ble("briefcase",60076),broadcast:Ble("broadcast",60077),browser:Ble("browser",60078),bug:Ble("bug",60079),calendar:Ble("calendar",60080),caseSensitive:Ble("case-sensitive",60081),check:Ble("check",60082),checklist:Ble("checklist",60083),chevronDown:Ble("chevron-down",60084),dropDownButton:Ble("drop-down-button",60084),chevronLeft:Ble("chevron-left",60085),chevronRight:Ble("chevron-right",60086),chevronUp:Ble("chevron-up",60087),chromeClose:Ble("chrome-close",60088),chromeMaximize:Ble("chrome-maximize",60089),chromeMinimize:Ble("chrome-minimize",60090),chromeRestore:Ble("chrome-restore",60091),circle:Ble("circle",60092),circleOutline:Ble("circle-outline",60092),debugBreakpointUnverified:Ble("debug-breakpoint-unverified",60092),circleSlash:Ble("circle-slash",60093),circuitBoard:Ble("circuit-board",60094),clearAll:Ble("clear-all",60095),clippy:Ble("clippy",60096),closeAll:Ble("close-all",60097),cloudDownload:Ble("cloud-download",60098),cloudUpload:Ble("cloud-upload",60099),code:Ble("code",60100),collapseAll:Ble("collapse-all",60101),colorMode:Ble("color-mode",60102),commentDiscussion:Ble("comment-discussion",60103),compareChanges:Ble("compare-changes",60157),creditCard:Ble("credit-card",60105),dash:Ble("dash",60108),dashboard:Ble("dashboard",60109),database:Ble("database",60110),debugContinue:Ble("debug-continue",60111),debugDisconnect:Ble("debug-disconnect",60112),debugPause:Ble("debug-pause",60113),debugRestart:Ble("debug-restart",60114),debugStart:Ble("debug-start",60115),debugStepInto:Ble("debug-step-into",60116),debugStepOut:Ble("debug-step-out",60117),debugStepOver:Ble("debug-step-over",60118),debugStop:Ble("debug-stop",60119),debug:Ble("debug",60120),deviceCameraVideo:Ble("device-camera-video",60121),deviceCamera:Ble("device-camera",60122),deviceMobile:Ble("device-mobile",60123),diffAdded:Ble("diff-added",60124),diffIgnored:Ble("diff-ignored",60125),diffModified:Ble("diff-modified",60126),diffRemoved:Ble("diff-removed",60127),diffRenamed:Ble("diff-renamed",60128),diff:Ble("diff",60129),discard:Ble("discard",60130),editorLayout:Ble("editor-layout",60131),emptyWindow:Ble("empty-window",60132),exclude:Ble("exclude",60133),extensions:Ble("extensions",60134),eyeClosed:Ble("eye-closed",60135),fileBinary:Ble("file-binary",60136),fileCode:Ble("file-code",60137),fileMedia:Ble("file-media",60138),filePdf:Ble("file-pdf",60139),fileSubmodule:Ble("file-submodule",60140),fileSymlinkDirectory:Ble("file-symlink-directory",60141),fileSymlinkFile:Ble("file-symlink-file",60142),fileZip:Ble("file-zip",60143),files:Ble("files",60144),filter:Ble("filter",60145),flame:Ble("flame",60146),foldDown:Ble("fold-down",60147),foldUp:Ble("fold-up",60148),fold:Ble("fold",60149),folderActive:Ble("folder-active",60150),folderOpened:Ble("folder-opened",60151),gear:Ble("gear",60152),gift:Ble("gift",60153),gistSecret:Ble("gist-secret",60154),gist:Ble("gist",60155),gitCommit:Ble("git-commit",60156),gitCompare:Ble("git-compare",60157),gitMerge:Ble("git-merge",60158),githubAction:Ble("github-action",60159),githubAlt:Ble("github-alt",60160),globe:Ble("globe",60161),grabber:Ble("grabber",60162),graph:Ble("graph",60163),gripper:Ble("gripper",60164),heart:Ble("heart",60165),home:Ble("home",60166),horizontalRule:Ble("horizontal-rule",60167),hubot:Ble("hubot",60168),inbox:Ble("inbox",60169),issueClosed:Ble("issue-closed",60324),issueReopened:Ble("issue-reopened",60171),issues:Ble("issues",60172),italic:Ble("italic",60173),jersey:Ble("jersey",60174),json:Ble("json",60175),bracket:Ble("bracket",60175),kebabVertical:Ble("kebab-vertical",60176),key:Ble("key",60177),law:Ble("law",60178),lightbulbAutofix:Ble("lightbulb-autofix",60179),linkExternal:Ble("link-external",60180),link:Ble("link",60181),listOrdered:Ble("list-ordered",60182),listUnordered:Ble("list-unordered",60183),liveShare:Ble("live-share",60184),loading:Ble("loading",60185),location:Ble("location",60186),mailRead:Ble("mail-read",60187),mail:Ble("mail",60188),markdown:Ble("markdown",60189),megaphone:Ble("megaphone",60190),mention:Ble("mention",60191),milestone:Ble("milestone",60192),mortarBoard:Ble("mortar-board",60193),move:Ble("move",60194),multipleWindows:Ble("multiple-windows",60195),mute:Ble("mute",60196),noNewline:Ble("no-newline",60197),note:Ble("note",60198),octoface:Ble("octoface",60199),openPreview:Ble("open-preview",60200),package_:Ble("package",60201),paintcan:Ble("paintcan",60202),pin:Ble("pin",60203),play:Ble("play",60204),run:Ble("run",60204),plug:Ble("plug",60205),preserveCase:Ble("preserve-case",60206),preview:Ble("preview",60207),project:Ble("project",60208),pulse:Ble("pulse",60209),question:Ble("question",60210),quote:Ble("quote",60211),radioTower:Ble("radio-tower",60212),reactions:Ble("reactions",60213),references:Ble("references",60214),refresh:Ble("refresh",60215),regex:Ble("regex",60216),remoteExplorer:Ble("remote-explorer",60217),remote:Ble("remote",60218),remove:Ble("remove",60219),replaceAll:Ble("replace-all",60220),replace:Ble("replace",60221),repoClone:Ble("repo-clone",60222),repoForcePush:Ble("repo-force-push",60223),repoPull:Ble("repo-pull",60224),repoPush:Ble("repo-push",60225),report:Ble("report",60226),requestChanges:Ble("request-changes",60227),rocket:Ble("rocket",60228),rootFolderOpened:Ble("root-folder-opened",60229),rootFolder:Ble("root-folder",60230),rss:Ble("rss",60231),ruby:Ble("ruby",60232),saveAll:Ble("save-all",60233),saveAs:Ble("save-as",60234),save:Ble("save",60235),screenFull:Ble("screen-full",60236),screenNormal:Ble("screen-normal",60237),searchStop:Ble("search-stop",60238),server:Ble("server",60240),settingsGear:Ble("settings-gear",60241),settings:Ble("settings",60242),shield:Ble("shield",60243),smiley:Ble("smiley",60244),sortPrecedence:Ble("sort-precedence",60245),splitHorizontal:Ble("split-horizontal",60246),splitVertical:Ble("split-vertical",60247),squirrel:Ble("squirrel",60248),starFull:Ble("star-full",60249),starHalf:Ble("star-half",60250),symbolClass:Ble("symbol-class",60251),symbolColor:Ble("symbol-color",60252),symbolCustomColor:Ble("symbol-customcolor",60252),symbolConstant:Ble("symbol-constant",60253),symbolEnumMember:Ble("symbol-enum-member",60254),symbolField:Ble("symbol-field",60255),symbolFile:Ble("symbol-file",60256),symbolInterface:Ble("symbol-interface",60257),symbolKeyword:Ble("symbol-keyword",60258),symbolMisc:Ble("symbol-misc",60259),symbolOperator:Ble("symbol-operator",60260),symbolProperty:Ble("symbol-property",60261),wrench:Ble("wrench",60261),wrenchSubaction:Ble("wrench-subaction",60261),symbolSnippet:Ble("symbol-snippet",60262),tasklist:Ble("tasklist",60263),telescope:Ble("telescope",60264),textSize:Ble("text-size",60265),threeBars:Ble("three-bars",60266),thumbsdown:Ble("thumbsdown",60267),thumbsup:Ble("thumbsup",60268),tools:Ble("tools",60269),triangleDown:Ble("triangle-down",60270),triangleLeft:Ble("triangle-left",60271),triangleRight:Ble("triangle-right",60272),triangleUp:Ble("triangle-up",60273),twitter:Ble("twitter",60274),unfold:Ble("unfold",60275),unlock:Ble("unlock",60276),unmute:Ble("unmute",60277),unverified:Ble("unverified",60278),verified:Ble("verified",60279),versions:Ble("versions",60280),vmActive:Ble("vm-active",60281),vmOutline:Ble("vm-outline",60282),vmRunning:Ble("vm-running",60283),watch:Ble("watch",60284),whitespace:Ble("whitespace",60285),wholeWord:Ble("whole-word",60286),window:Ble("window",60287),wordWrap:Ble("word-wrap",60288),zoomIn:Ble("zoom-in",60289),zoomOut:Ble("zoom-out",60290),listFilter:Ble("list-filter",60291),listFlat:Ble("list-flat",60292),listSelection:Ble("list-selection",60293),selection:Ble("selection",60293),listTree:Ble("list-tree",60294),debugBreakpointFunctionUnverified:Ble("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:Ble("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:Ble("debug-breakpoint-function-disabled",60296),debugStackframeActive:Ble("debug-stackframe-active",60297),circleSmallFilled:Ble("circle-small-filled",60298),debugStackframeDot:Ble("debug-stackframe-dot",60298),debugStackframe:Ble("debug-stackframe",60299),debugStackframeFocused:Ble("debug-stackframe-focused",60299),debugBreakpointUnsupported:Ble("debug-breakpoint-unsupported",60300),symbolString:Ble("symbol-string",60301),debugReverseContinue:Ble("debug-reverse-continue",60302),debugStepBack:Ble("debug-step-back",60303),debugRestartFrame:Ble("debug-restart-frame",60304),callIncoming:Ble("call-incoming",60306),callOutgoing:Ble("call-outgoing",60307),menu:Ble("menu",60308),expandAll:Ble("expand-all",60309),feedback:Ble("feedback",60310),groupByRefType:Ble("group-by-ref-type",60311),ungroupByRefType:Ble("ungroup-by-ref-type",60312),account:Ble("account",60313),bellDot:Ble("bell-dot",60314),debugConsole:Ble("debug-console",60315),library:Ble("library",60316),output:Ble("output",60317),runAll:Ble("run-all",60318),syncIgnored:Ble("sync-ignored",60319),pinned:Ble("pinned",60320),githubInverted:Ble("github-inverted",60321),debugAlt:Ble("debug-alt",60305),serverProcess:Ble("server-process",60322),serverEnvironment:Ble("server-environment",60323),pass:Ble("pass",60324),stopCircle:Ble("stop-circle",60325),playCircle:Ble("play-circle",60326),record:Ble("record",60327),debugAltSmall:Ble("debug-alt-small",60328),vmConnect:Ble("vm-connect",60329),cloud:Ble("cloud",60330),merge:Ble("merge",60331),exportIcon:Ble("export",60332),graphLeft:Ble("graph-left",60333),magnet:Ble("magnet",60334),notebook:Ble("notebook",60335),redo:Ble("redo",60336),checkAll:Ble("check-all",60337),pinnedDirty:Ble("pinned-dirty",60338),passFilled:Ble("pass-filled",60339),circleLargeFilled:Ble("circle-large-filled",60340),circleLarge:Ble("circle-large",60341),circleLargeOutline:Ble("circle-large-outline",60341),combine:Ble("combine",60342),gather:Ble("gather",60342),table:Ble("table",60343),variableGroup:Ble("variable-group",60344),typeHierarchy:Ble("type-hierarchy",60345),typeHierarchySub:Ble("type-hierarchy-sub",60346),typeHierarchySuper:Ble("type-hierarchy-super",60347),gitPullRequestCreate:Ble("git-pull-request-create",60348),runAbove:Ble("run-above",60349),runBelow:Ble("run-below",60350),notebookTemplate:Ble("notebook-template",60351),debugRerun:Ble("debug-rerun",60352),workspaceTrusted:Ble("workspace-trusted",60353),workspaceUntrusted:Ble("workspace-untrusted",60354),workspaceUnspecified:Ble("workspace-unspecified",60355),terminalCmd:Ble("terminal-cmd",60356),terminalDebian:Ble("terminal-debian",60357),terminalLinux:Ble("terminal-linux",60358),terminalPowershell:Ble("terminal-powershell",60359),terminalTmux:Ble("terminal-tmux",60360),terminalUbuntu:Ble("terminal-ubuntu",60361),terminalBash:Ble("terminal-bash",60362),arrowSwap:Ble("arrow-swap",60363),copy:Ble("copy",60364),personAdd:Ble("person-add",60365),filterFilled:Ble("filter-filled",60366),wand:Ble("wand",60367),debugLineByLine:Ble("debug-line-by-line",60368),inspect:Ble("inspect",60369),layers:Ble("layers",60370),layersDot:Ble("layers-dot",60371),layersActive:Ble("layers-active",60372),compass:Ble("compass",60373),compassDot:Ble("compass-dot",60374),compassActive:Ble("compass-active",60375),azure:Ble("azure",60376),issueDraft:Ble("issue-draft",60377),gitPullRequestClosed:Ble("git-pull-request-closed",60378),gitPullRequestDraft:Ble("git-pull-request-draft",60379),debugAll:Ble("debug-all",60380),debugCoverage:Ble("debug-coverage",60381),runErrors:Ble("run-errors",60382),folderLibrary:Ble("folder-library",60383),debugContinueSmall:Ble("debug-continue-small",60384),beakerStop:Ble("beaker-stop",60385),graphLine:Ble("graph-line",60386),graphScatter:Ble("graph-scatter",60387),pieChart:Ble("pie-chart",60388),bracketDot:Ble("bracket-dot",60389),bracketError:Ble("bracket-error",60390),lockSmall:Ble("lock-small",60391),azureDevops:Ble("azure-devops",60392),verifiedFilled:Ble("verified-filled",60393),newLine:Ble("newline",60394),layout:Ble("layout",60395),layoutActivitybarLeft:Ble("layout-activitybar-left",60396),layoutActivitybarRight:Ble("layout-activitybar-right",60397),layoutPanelLeft:Ble("layout-panel-left",60398),layoutPanelCenter:Ble("layout-panel-center",60399),layoutPanelJustify:Ble("layout-panel-justify",60400),layoutPanelRight:Ble("layout-panel-right",60401),layoutPanel:Ble("layout-panel",60402),layoutSidebarLeft:Ble("layout-sidebar-left",60403),layoutSidebarRight:Ble("layout-sidebar-right",60404),layoutStatusbar:Ble("layout-statusbar",60405),layoutMenubar:Ble("layout-menubar",60406),layoutCentered:Ble("layout-centered",60407),layoutSidebarRightOff:Ble("layout-sidebar-right-off",60416),layoutPanelOff:Ble("layout-panel-off",60417),layoutSidebarLeftOff:Ble("layout-sidebar-left-off",60418),target:Ble("target",60408),indent:Ble("indent",60409),recordSmall:Ble("record-small",60410),errorSmall:Ble("error-small",60411),arrowCircleDown:Ble("arrow-circle-down",60412),arrowCircleLeft:Ble("arrow-circle-left",60413),arrowCircleRight:Ble("arrow-circle-right",60414),arrowCircleUp:Ble("arrow-circle-up",60415),heartFilled:Ble("heart-filled",60420),map:Ble("map",60421),mapFilled:Ble("map-filled",60422),circleSmall:Ble("circle-small",60423),bellSlash:Ble("bell-slash",60424),bellSlashDot:Ble("bell-slash-dot",60425),commentUnresolved:Ble("comment-unresolved",60426),gitPullRequestGoToChanges:Ble("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:Ble("git-pull-request-new-changes",60428),searchFuzzy:Ble("search-fuzzy",60429),commentDraft:Ble("comment-draft",60430),dialogError:Ble("dialog-error","error"),dialogWarning:Ble("dialog-warning","warning"),dialogInfo:Ble("dialog-info","info"),dialogClose:Ble("dialog-close","close"),treeItemExpanded:Ble("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:Ble("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:Ble("tree-filter-on-type-off","list-selection"),treeFilterClear:Ble("tree-filter-clear","close"),treeItemLoading:Ble("tree-item-loading","loading"),menuSelection:Ble("menu-selection","check"),menuSubmenu:Ble("menu-submenu","chevron-right"),menuBarMore:Ble("menubar-more","more"),scrollbarButtonLeft:Ble("scrollbar-button-left","triangle-left"),scrollbarButtonRight:Ble("scrollbar-button-right","triangle-right"),scrollbarButtonUp:Ble("scrollbar-button-up","triangle-up"),scrollbarButtonDown:Ble("scrollbar-button-down","triangle-down"),toolBarMore:Ble("toolbar-more","more"),quickInputBack:Ble("quick-input-back","arrow-left")};var zle,Hle,Ule,Kle,jle,qle,$le,Gle=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Zle extends aae{get isResolved(){return this._isResolved}constructor(e,t,i){super(),this._registry=e,this._languageId=t,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}resolve(){return Gle(this,void 0,void 0,(function*(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}))}_create(){return Gle(this,void 0,void 0,(function*(){const e=yield Promise.resolve(this._factory.createTokenizationSupport());this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}))}}class Yle{constructor(e,t,i){this._tokenBrand=void 0,this.offset=e,this.type=t,this.language=i}toString(){return"("+this.offset+", "+this.type+")"}}class Qle{constructor(e,t){this._tokenizationResultBrand=void 0,this.tokens=e,this.endState=t}}class Xle{constructor(e,t){this._encodedTokenizationResultBrand=void 0,this.tokens=e,this.endState=t}}!function(e){const t=new Map;t.set(0,Vle.symbolMethod),t.set(1,Vle.symbolFunction),t.set(2,Vle.symbolConstructor),t.set(3,Vle.symbolField),t.set(4,Vle.symbolVariable),t.set(5,Vle.symbolClass),t.set(6,Vle.symbolStruct),t.set(7,Vle.symbolInterface),t.set(8,Vle.symbolModule),t.set(9,Vle.symbolProperty),t.set(10,Vle.symbolEvent),t.set(11,Vle.symbolOperator),t.set(12,Vle.symbolUnit),t.set(13,Vle.symbolValue),t.set(15,Vle.symbolEnum),t.set(14,Vle.symbolConstant),t.set(15,Vle.symbolEnum),t.set(16,Vle.symbolEnumMember),t.set(17,Vle.symbolKeyword),t.set(27,Vle.symbolSnippet),t.set(18,Vle.symbolText),t.set(19,Vle.symbolColor),t.set(20,Vle.symbolFile),t.set(21,Vle.symbolReference),t.set(22,Vle.symbolCustomColor),t.set(23,Vle.symbolFolder),t.set(24,Vle.symbolTypeParameter),t.set(25,Vle.account),t.set(26,Vle.issues),e.toIcon=function(e){let i=t.get(e);return i||(console.info("No codicon found for CompletionItemKind "+e),i=Vle.symbolProperty),i};const i=new Map;i.set("method",0),i.set("function",1),i.set("constructor",2),i.set("field",3),i.set("variable",4),i.set("class",5),i.set("struct",6),i.set("interface",7),i.set("module",8),i.set("property",9),i.set("event",10),i.set("operator",11),i.set("unit",12),i.set("value",13),i.set("constant",14),i.set("enum",15),i.set("enum-member",16),i.set("enumMember",16),i.set("keyword",17),i.set("snippet",27),i.set("text",18),i.set("color",19),i.set("file",20),i.set("reference",21),i.set("customcolor",22),i.set("folder",23),i.set("type-parameter",24),i.set("typeParameter",24),i.set("account",25),i.set("issue",26),e.fromString=function(e,t){let n=i.get(e);return void 0!==n||t||(n=9),n}}(zle||(zle={})),function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"}(Hle||(Hle={})),function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(Ule||(Ule={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(Kle||(Kle={})),function(e){const t=new Map;t.set(0,Vle.symbolFile),t.set(1,Vle.symbolModule),t.set(2,Vle.symbolNamespace),t.set(3,Vle.symbolPackage),t.set(4,Vle.symbolClass),t.set(5,Vle.symbolMethod),t.set(6,Vle.symbolProperty),t.set(7,Vle.symbolField),t.set(8,Vle.symbolConstructor),t.set(9,Vle.symbolEnum),t.set(10,Vle.symbolInterface),t.set(11,Vle.symbolFunction),t.set(12,Vle.symbolVariable),t.set(13,Vle.symbolConstant),t.set(14,Vle.symbolString),t.set(15,Vle.symbolNumber),t.set(16,Vle.symbolBoolean),t.set(17,Vle.symbolArray),t.set(18,Vle.symbolObject),t.set(19,Vle.symbolKey),t.set(20,Vle.symbolNull),t.set(21,Vle.symbolEnumMember),t.set(22,Vle.symbolStruct),t.set(23,Vle.symbolEvent),t.set(24,Vle.symbolOperator),t.set(25,Vle.symbolTypeParameter),e.toIcon=function(e){let i=t.get(e);return i||(console.info("No codicon found for SymbolKind "+e),i=Vle.symbolProperty),i}}(jle||(jle={}));class Jle{constructor(e){this.value=e}}Jle.Comment=new Jle("comment"),Jle.Imports=new Jle("imports"),Jle.Region=new Jle("region"),function(e){e.is=function(e){return!(!e||"object"!=typeof e)&&"string"==typeof e.id&&"string"==typeof e.title}}(qle||(qle={})),function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"}($le||($le={}));const ehe=new class{constructor(){this._map=new Map,this._factories=new Map,this._onDidChange=new bae,this.onDidChange=this._onDidChange.event,this._colorMap=null}fire(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._map.set(e,t),this.fire([e]),sae((()=>{this._map.get(e)===t&&(this._map.delete(e),this.fire([e]))}))}registerFactory(e,t){var i;null===(i=this._factories.get(e))||void 0===i||i.dispose();const n=new Zle(this,e,t);return this._factories.set(e,n),sae((()=>{const t=this._factories.get(e);t&&t===n&&(this._factories.delete(e),t.dispose())}))}getOrCreate(e){return Gle(this,void 0,void 0,(function*(){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(yield i.resolve(),this.get(e))}))}get(e){return this._map.get(e)||null}isResolved(e){if(this.get(e))return!0;const t=this._factories.get(e);return!(t&&!t.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._map.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}};var the,ihe,nhe,ohe,she,rhe,ahe,lhe,hhe,dhe,che,uhe,ghe,phe,mhe,fhe,_he,vhe,bhe,whe,Che,yhe,She,khe,Lhe,xhe,Dhe,Ehe,Nhe,Ihe,Mhe,The,Ahe,Rhe,Ohe,Phe,Fhe,Bhe;!function(e){e[e.Unknown=0]="Unknown",e[e.Disabled=1]="Disabled",e[e.Enabled=2]="Enabled"}(the||(the={})),function(e){e[e.Invoke=1]="Invoke",e[e.Auto=2]="Auto"}(ihe||(ihe={})),function(e){e[e.None=0]="None",e[e.KeepWhitespace=1]="KeepWhitespace",e[e.InsertAsSnippet=4]="InsertAsSnippet"}(nhe||(nhe={})),function(e){e[e.Method=0]="Method",e[e.Function=1]="Function",e[e.Constructor=2]="Constructor",e[e.Field=3]="Field",e[e.Variable=4]="Variable",e[e.Class=5]="Class",e[e.Struct=6]="Struct",e[e.Interface=7]="Interface",e[e.Module=8]="Module",e[e.Property=9]="Property",e[e.Event=10]="Event",e[e.Operator=11]="Operator",e[e.Unit=12]="Unit",e[e.Value=13]="Value",e[e.Constant=14]="Constant",e[e.Enum=15]="Enum",e[e.EnumMember=16]="EnumMember",e[e.Keyword=17]="Keyword",e[e.Text=18]="Text",e[e.Color=19]="Color",e[e.File=20]="File",e[e.Reference=21]="Reference",e[e.Customcolor=22]="Customcolor",e[e.Folder=23]="Folder",e[e.TypeParameter=24]="TypeParameter",e[e.User=25]="User",e[e.Issue=26]="Issue",e[e.Snippet=27]="Snippet"}(ohe||(ohe={})),function(e){e[e.Deprecated=1]="Deprecated"}(she||(she={})),function(e){e[e.Invoke=0]="Invoke",e[e.TriggerCharacter=1]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"}(rhe||(rhe={})),function(e){e[e.EXACT=0]="EXACT",e[e.ABOVE=1]="ABOVE",e[e.BELOW=2]="BELOW"}(ahe||(ahe={})),function(e){e[e.NotSet=0]="NotSet",e[e.ContentFlush=1]="ContentFlush",e[e.RecoverFromMarkers=2]="RecoverFromMarkers",e[e.Explicit=3]="Explicit",e[e.Paste=4]="Paste",e[e.Undo=5]="Undo",e[e.Redo=6]="Redo"}(lhe||(lhe={})),function(e){e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(hhe||(hhe={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(dhe||(dhe={})),function(e){e[e.None=0]="None",e[e.Keep=1]="Keep",e[e.Brackets=2]="Brackets",e[e.Advanced=3]="Advanced",e[e.Full=4]="Full"}(che||(che={})),function(e){e[e.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",e[e.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",e[e.accessibilitySupport=2]="accessibilitySupport",e[e.accessibilityPageSize=3]="accessibilityPageSize",e[e.ariaLabel=4]="ariaLabel",e[e.autoClosingBrackets=5]="autoClosingBrackets",e[e.autoClosingDelete=6]="autoClosingDelete",e[e.autoClosingOvertype=7]="autoClosingOvertype",e[e.autoClosingQuotes=8]="autoClosingQuotes",e[e.autoIndent=9]="autoIndent",e[e.automaticLayout=10]="automaticLayout",e[e.autoSurround=11]="autoSurround",e[e.bracketPairColorization=12]="bracketPairColorization",e[e.guides=13]="guides",e[e.codeLens=14]="codeLens",e[e.codeLensFontFamily=15]="codeLensFontFamily",e[e.codeLensFontSize=16]="codeLensFontSize",e[e.colorDecorators=17]="colorDecorators",e[e.colorDecoratorsLimit=18]="colorDecoratorsLimit",e[e.columnSelection=19]="columnSelection",e[e.comments=20]="comments",e[e.contextmenu=21]="contextmenu",e[e.copyWithSyntaxHighlighting=22]="copyWithSyntaxHighlighting",e[e.cursorBlinking=23]="cursorBlinking",e[e.cursorSmoothCaretAnimation=24]="cursorSmoothCaretAnimation",e[e.cursorStyle=25]="cursorStyle",e[e.cursorSurroundingLines=26]="cursorSurroundingLines",e[e.cursorSurroundingLinesStyle=27]="cursorSurroundingLinesStyle",e[e.cursorWidth=28]="cursorWidth",e[e.disableLayerHinting=29]="disableLayerHinting",e[e.disableMonospaceOptimizations=30]="disableMonospaceOptimizations",e[e.domReadOnly=31]="domReadOnly",e[e.dragAndDrop=32]="dragAndDrop",e[e.dropIntoEditor=33]="dropIntoEditor",e[e.emptySelectionClipboard=34]="emptySelectionClipboard",e[e.experimentalWhitespaceRendering=35]="experimentalWhitespaceRendering",e[e.extraEditorClassName=36]="extraEditorClassName",e[e.fastScrollSensitivity=37]="fastScrollSensitivity",e[e.find=38]="find",e[e.fixedOverflowWidgets=39]="fixedOverflowWidgets",e[e.folding=40]="folding",e[e.foldingStrategy=41]="foldingStrategy",e[e.foldingHighlight=42]="foldingHighlight",e[e.foldingImportsByDefault=43]="foldingImportsByDefault",e[e.foldingMaximumRegions=44]="foldingMaximumRegions",e[e.unfoldOnClickAfterEndOfLine=45]="unfoldOnClickAfterEndOfLine",e[e.fontFamily=46]="fontFamily",e[e.fontInfo=47]="fontInfo",e[e.fontLigatures=48]="fontLigatures",e[e.fontSize=49]="fontSize",e[e.fontWeight=50]="fontWeight",e[e.fontVariations=51]="fontVariations",e[e.formatOnPaste=52]="formatOnPaste",e[e.formatOnType=53]="formatOnType",e[e.glyphMargin=54]="glyphMargin",e[e.gotoLocation=55]="gotoLocation",e[e.hideCursorInOverviewRuler=56]="hideCursorInOverviewRuler",e[e.hover=57]="hover",e[e.inDiffEditor=58]="inDiffEditor",e[e.inlineSuggest=59]="inlineSuggest",e[e.letterSpacing=60]="letterSpacing",e[e.lightbulb=61]="lightbulb",e[e.lineDecorationsWidth=62]="lineDecorationsWidth",e[e.lineHeight=63]="lineHeight",e[e.lineNumbers=64]="lineNumbers",e[e.lineNumbersMinChars=65]="lineNumbersMinChars",e[e.linkedEditing=66]="linkedEditing",e[e.links=67]="links",e[e.matchBrackets=68]="matchBrackets",e[e.minimap=69]="minimap",e[e.mouseStyle=70]="mouseStyle",e[e.mouseWheelScrollSensitivity=71]="mouseWheelScrollSensitivity",e[e.mouseWheelZoom=72]="mouseWheelZoom",e[e.multiCursorMergeOverlapping=73]="multiCursorMergeOverlapping",e[e.multiCursorModifier=74]="multiCursorModifier",e[e.multiCursorPaste=75]="multiCursorPaste",e[e.multiCursorLimit=76]="multiCursorLimit",e[e.occurrencesHighlight=77]="occurrencesHighlight",e[e.overviewRulerBorder=78]="overviewRulerBorder",e[e.overviewRulerLanes=79]="overviewRulerLanes",e[e.padding=80]="padding",e[e.parameterHints=81]="parameterHints",e[e.peekWidgetDefaultFocus=82]="peekWidgetDefaultFocus",e[e.definitionLinkOpensInPeek=83]="definitionLinkOpensInPeek",e[e.quickSuggestions=84]="quickSuggestions",e[e.quickSuggestionsDelay=85]="quickSuggestionsDelay",e[e.readOnly=86]="readOnly",e[e.renameOnType=87]="renameOnType",e[e.renderControlCharacters=88]="renderControlCharacters",e[e.renderFinalNewline=89]="renderFinalNewline",e[e.renderLineHighlight=90]="renderLineHighlight",e[e.renderLineHighlightOnlyWhenFocus=91]="renderLineHighlightOnlyWhenFocus",e[e.renderValidationDecorations=92]="renderValidationDecorations",e[e.renderWhitespace=93]="renderWhitespace",e[e.revealHorizontalRightPadding=94]="revealHorizontalRightPadding",e[e.roundedSelection=95]="roundedSelection",e[e.rulers=96]="rulers",e[e.scrollbar=97]="scrollbar",e[e.scrollBeyondLastColumn=98]="scrollBeyondLastColumn",e[e.scrollBeyondLastLine=99]="scrollBeyondLastLine",e[e.scrollPredominantAxis=100]="scrollPredominantAxis",e[e.selectionClipboard=101]="selectionClipboard",e[e.selectionHighlight=102]="selectionHighlight",e[e.selectOnLineNumbers=103]="selectOnLineNumbers",e[e.showFoldingControls=104]="showFoldingControls",e[e.showUnused=105]="showUnused",e[e.snippetSuggestions=106]="snippetSuggestions",e[e.smartSelect=107]="smartSelect",e[e.smoothScrolling=108]="smoothScrolling",e[e.stickyScroll=109]="stickyScroll",e[e.stickyTabStops=110]="stickyTabStops",e[e.stopRenderingLineAfter=111]="stopRenderingLineAfter",e[e.suggest=112]="suggest",e[e.suggestFontSize=113]="suggestFontSize",e[e.suggestLineHeight=114]="suggestLineHeight",e[e.suggestOnTriggerCharacters=115]="suggestOnTriggerCharacters",e[e.suggestSelection=116]="suggestSelection",e[e.tabCompletion=117]="tabCompletion",e[e.tabIndex=118]="tabIndex",e[e.unicodeHighlighting=119]="unicodeHighlighting",e[e.unusualLineTerminators=120]="unusualLineTerminators",e[e.useShadowDOM=121]="useShadowDOM",e[e.useTabStops=122]="useTabStops",e[e.wordBreak=123]="wordBreak",e[e.wordSeparators=124]="wordSeparators",e[e.wordWrap=125]="wordWrap",e[e.wordWrapBreakAfterCharacters=126]="wordWrapBreakAfterCharacters",e[e.wordWrapBreakBeforeCharacters=127]="wordWrapBreakBeforeCharacters",e[e.wordWrapColumn=128]="wordWrapColumn",e[e.wordWrapOverride1=129]="wordWrapOverride1",e[e.wordWrapOverride2=130]="wordWrapOverride2",e[e.wrappingIndent=131]="wrappingIndent",e[e.wrappingStrategy=132]="wrappingStrategy",e[e.showDeprecated=133]="showDeprecated",e[e.inlayHints=134]="inlayHints",e[e.editorClassName=135]="editorClassName",e[e.pixelRatio=136]="pixelRatio",e[e.tabFocusMode=137]="tabFocusMode",e[e.layoutInfo=138]="layoutInfo",e[e.wrappingInfo=139]="wrappingInfo"}(uhe||(uhe={})),function(e){e[e.TextDefined=0]="TextDefined",e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(ghe||(ghe={})),function(e){e[e.LF=0]="LF",e[e.CRLF=1]="CRLF"}(phe||(phe={})),function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(mhe||(mhe={})),function(e){e[e.Both=0]="Both",e[e.Right=1]="Right",e[e.Left=2]="Left",e[e.None=3]="None"}(fhe||(fhe={})),function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"}(_he||(_he={})),function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"}(vhe||(vhe={})),function(e){e[e.DependsOnKbLayout=-1]="DependsOnKbLayout",e[e.Unknown=0]="Unknown",e[e.Backspace=1]="Backspace",e[e.Tab=2]="Tab",e[e.Enter=3]="Enter",e[e.Shift=4]="Shift",e[e.Ctrl=5]="Ctrl",e[e.Alt=6]="Alt",e[e.PauseBreak=7]="PauseBreak",e[e.CapsLock=8]="CapsLock",e[e.Escape=9]="Escape",e[e.Space=10]="Space",e[e.PageUp=11]="PageUp",e[e.PageDown=12]="PageDown",e[e.End=13]="End",e[e.Home=14]="Home",e[e.LeftArrow=15]="LeftArrow",e[e.UpArrow=16]="UpArrow",e[e.RightArrow=17]="RightArrow",e[e.DownArrow=18]="DownArrow",e[e.Insert=19]="Insert",e[e.Delete=20]="Delete",e[e.Digit0=21]="Digit0",e[e.Digit1=22]="Digit1",e[e.Digit2=23]="Digit2",e[e.Digit3=24]="Digit3",e[e.Digit4=25]="Digit4",e[e.Digit5=26]="Digit5",e[e.Digit6=27]="Digit6",e[e.Digit7=28]="Digit7",e[e.Digit8=29]="Digit8",e[e.Digit9=30]="Digit9",e[e.KeyA=31]="KeyA",e[e.KeyB=32]="KeyB",e[e.KeyC=33]="KeyC",e[e.KeyD=34]="KeyD",e[e.KeyE=35]="KeyE",e[e.KeyF=36]="KeyF",e[e.KeyG=37]="KeyG",e[e.KeyH=38]="KeyH",e[e.KeyI=39]="KeyI",e[e.KeyJ=40]="KeyJ",e[e.KeyK=41]="KeyK",e[e.KeyL=42]="KeyL",e[e.KeyM=43]="KeyM",e[e.KeyN=44]="KeyN",e[e.KeyO=45]="KeyO",e[e.KeyP=46]="KeyP",e[e.KeyQ=47]="KeyQ",e[e.KeyR=48]="KeyR",e[e.KeyS=49]="KeyS",e[e.KeyT=50]="KeyT",e[e.KeyU=51]="KeyU",e[e.KeyV=52]="KeyV",e[e.KeyW=53]="KeyW",e[e.KeyX=54]="KeyX",e[e.KeyY=55]="KeyY",e[e.KeyZ=56]="KeyZ",e[e.Meta=57]="Meta",e[e.ContextMenu=58]="ContextMenu",e[e.F1=59]="F1",e[e.F2=60]="F2",e[e.F3=61]="F3",e[e.F4=62]="F4",e[e.F5=63]="F5",e[e.F6=64]="F6",e[e.F7=65]="F7",e[e.F8=66]="F8",e[e.F9=67]="F9",e[e.F10=68]="F10",e[e.F11=69]="F11",e[e.F12=70]="F12",e[e.F13=71]="F13",e[e.F14=72]="F14",e[e.F15=73]="F15",e[e.F16=74]="F16",e[e.F17=75]="F17",e[e.F18=76]="F18",e[e.F19=77]="F19",e[e.NumLock=78]="NumLock",e[e.ScrollLock=79]="ScrollLock",e[e.Semicolon=80]="Semicolon",e[e.Equal=81]="Equal",e[e.Comma=82]="Comma",e[e.Minus=83]="Minus",e[e.Period=84]="Period",e[e.Slash=85]="Slash",e[e.Backquote=86]="Backquote",e[e.BracketLeft=87]="BracketLeft",e[e.Backslash=88]="Backslash",e[e.BracketRight=89]="BracketRight",e[e.Quote=90]="Quote",e[e.OEM_8=91]="OEM_8",e[e.IntlBackslash=92]="IntlBackslash",e[e.Numpad0=93]="Numpad0",e[e.Numpad1=94]="Numpad1",e[e.Numpad2=95]="Numpad2",e[e.Numpad3=96]="Numpad3",e[e.Numpad4=97]="Numpad4",e[e.Numpad5=98]="Numpad5",e[e.Numpad6=99]="Numpad6",e[e.Numpad7=100]="Numpad7",e[e.Numpad8=101]="Numpad8",e[e.Numpad9=102]="Numpad9",e[e.NumpadMultiply=103]="NumpadMultiply",e[e.NumpadAdd=104]="NumpadAdd",e[e.NUMPAD_SEPARATOR=105]="NUMPAD_SEPARATOR",e[e.NumpadSubtract=106]="NumpadSubtract",e[e.NumpadDecimal=107]="NumpadDecimal",e[e.NumpadDivide=108]="NumpadDivide",e[e.KEY_IN_COMPOSITION=109]="KEY_IN_COMPOSITION",e[e.ABNT_C1=110]="ABNT_C1",e[e.ABNT_C2=111]="ABNT_C2",e[e.AudioVolumeMute=112]="AudioVolumeMute",e[e.AudioVolumeUp=113]="AudioVolumeUp",e[e.AudioVolumeDown=114]="AudioVolumeDown",e[e.BrowserSearch=115]="BrowserSearch",e[e.BrowserHome=116]="BrowserHome",e[e.BrowserBack=117]="BrowserBack",e[e.BrowserForward=118]="BrowserForward",e[e.MediaTrackNext=119]="MediaTrackNext",e[e.MediaTrackPrevious=120]="MediaTrackPrevious",e[e.MediaStop=121]="MediaStop",e[e.MediaPlayPause=122]="MediaPlayPause",e[e.LaunchMediaPlayer=123]="LaunchMediaPlayer",e[e.LaunchMail=124]="LaunchMail",e[e.LaunchApp2=125]="LaunchApp2",e[e.Clear=126]="Clear",e[e.MAX_VALUE=127]="MAX_VALUE"}(bhe||(bhe={})),function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"}(whe||(whe={})),function(e){e[e.Unnecessary=1]="Unnecessary",e[e.Deprecated=2]="Deprecated"}(Che||(Che={})),function(e){e[e.Inline=1]="Inline",e[e.Gutter=2]="Gutter"}(yhe||(yhe={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.TEXTAREA=1]="TEXTAREA",e[e.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",e[e.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",e[e.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",e[e.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",e[e.CONTENT_TEXT=6]="CONTENT_TEXT",e[e.CONTENT_EMPTY=7]="CONTENT_EMPTY",e[e.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",e[e.CONTENT_WIDGET=9]="CONTENT_WIDGET",e[e.OVERVIEW_RULER=10]="OVERVIEW_RULER",e[e.SCROLLBAR=11]="SCROLLBAR",e[e.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",e[e.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"}(She||(She={})),function(e){e[e.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",e[e.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",e[e.TOP_CENTER=2]="TOP_CENTER"}(khe||(khe={})),function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"}(Lhe||(Lhe={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.None=2]="None",e[e.LeftOfInjectedText=3]="LeftOfInjectedText",e[e.RightOfInjectedText=4]="RightOfInjectedText"}(xhe||(xhe={})),function(e){e[e.Off=0]="Off",e[e.On=1]="On",e[e.Relative=2]="Relative",e[e.Interval=3]="Interval",e[e.Custom=4]="Custom"}(Dhe||(Dhe={})),function(e){e[e.None=0]="None",e[e.Text=1]="Text",e[e.Blocks=2]="Blocks"}(Ehe||(Ehe={})),function(e){e[e.Smooth=0]="Smooth",e[e.Immediate=1]="Immediate"}(Nhe||(Nhe={})),function(e){e[e.Auto=1]="Auto",e[e.Hidden=2]="Hidden",e[e.Visible=3]="Visible"}(Ihe||(Ihe={})),function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"}(Mhe||(Mhe={})),function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(The||(The={})),function(e){e[e.File=0]="File",e[e.Module=1]="Module",e[e.Namespace=2]="Namespace",e[e.Package=3]="Package",e[e.Class=4]="Class",e[e.Method=5]="Method",e[e.Property=6]="Property",e[e.Field=7]="Field",e[e.Constructor=8]="Constructor",e[e.Enum=9]="Enum",e[e.Interface=10]="Interface",e[e.Function=11]="Function",e[e.Variable=12]="Variable",e[e.Constant=13]="Constant",e[e.String=14]="String",e[e.Number=15]="Number",e[e.Boolean=16]="Boolean",e[e.Array=17]="Array",e[e.Object=18]="Object",e[e.Key=19]="Key",e[e.Null=20]="Null",e[e.EnumMember=21]="EnumMember",e[e.Struct=22]="Struct",e[e.Event=23]="Event",e[e.Operator=24]="Operator",e[e.TypeParameter=25]="TypeParameter"}(Ahe||(Ahe={})),function(e){e[e.Deprecated=1]="Deprecated"}(Rhe||(Rhe={})),function(e){e[e.Hidden=0]="Hidden",e[e.Blink=1]="Blink",e[e.Smooth=2]="Smooth",e[e.Phase=3]="Phase",e[e.Expand=4]="Expand",e[e.Solid=5]="Solid"}(Ohe||(Ohe={})),function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"}(Phe||(Phe={})),function(e){e[e.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",e[e.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",e[e.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",e[e.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"}(Fhe||(Fhe={})),function(e){e[e.None=0]="None",e[e.Same=1]="Same",e[e.Indent=2]="Indent",e[e.DeepIndent=3]="DeepIndent"}(Bhe||(Bhe={}));class Whe{static chord(e,t){return function(e,t){return(e|(65535&t)<<16>>>0)>>>0}(e,t)}}function Vhe(){return{editor:void 0,languages:void 0,CancellationTokenSource:Mae,Emitter:bae,KeyCode:bhe,KeyMod:Whe,Position:Rle,Range:Ole,Selection:Ple,SelectionDirection:Mhe,MarkerSeverity:whe,MarkerTag:Che,Uri:Sle,Token:Yle}}Whe.CtrlCmd=2048,Whe.Shift=1024,Whe.Alt=512,Whe.WinCtrl=256;var zhe,Hhe=i(7030),Uhe={};Uhe.styleTagTransform=Vr(),Uhe.setAttributes=Pr(),Uhe.insert=Rr().bind(null,"head"),Uhe.domAPI=Tr(),Uhe.insertStyleElement=Br(),Ir()(Hhe.Z,Uhe),Hhe.Z&&Hhe.Z.locals&&Hhe.Z.locals;class Khe{get cachedValues(){return this._map}constructor(e){this.fn=e,this._map=new Map}get(e){if(this._map.has(e))return this._map.get(e);const t=this.fn(e);return this._map.set(e,t),t}}class jhe{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}const qhe=/{(\d+)}/g;function $he(e,...t){return 0===t.length?e:e.replace(qhe,(function(e,i){const n=parseInt(i,10);return isNaN(n)||n<0||n>=t.length?e:t[n]}))}function Ghe(e){return e.replace(/[<>&]/g,(function(e){switch(e){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return e}}))}function Zhe(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function Yhe(e,t){if(!e||!t)return e;const i=t.length;if(0===i||0===e.length)return e;let n=0;for(;e.indexOf(t,n)===n;)n+=i;return e.substring(n)}function Qhe(e,t,i={}){if(!e)throw new Error("Cannot create regex from empty string");t||(e=Zhe(e)),i.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));let n="";return i.global&&(n+="g"),i.matchCase||(n+="i"),i.multiline&&(n+="m"),i.unicode&&(n+="u"),new RegExp(e,n)}function Xhe(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")}function Jhe(e){return e.split(/\r\n|\r|\n/)}function ede(e){for(let t=0,i=e.length;t<i;t++){const i=e.charCodeAt(t);if(32!==i&&9!==i)return t}return-1}function tde(e,t=0,i=e.length){for(let n=t;n<i;n++){const i=e.charCodeAt(n);if(32!==i&&9!==i)return e.substring(t,n)}return e.substring(t,i)}function ide(e,t=e.length-1){for(let i=t;i>=0;i--){const t=e.charCodeAt(i);if(32!==t&&9!==t)return i}return-1}function nde(e,t){return e<t?-1:e>t?1:0}function ode(e,t,i=0,n=e.length,o=0,s=t.length){for(;i<n&&o<s;i++,o++){const n=e.charCodeAt(i),s=t.charCodeAt(o);if(n<s)return-1;if(n>s)return 1}const r=n-i,a=s-o;return r<a?-1:r>a?1:0}function sde(e,t){return rde(e,t,0,e.length,0,t.length)}function rde(e,t,i=0,n=e.length,o=0,s=t.length){for(;i<n&&o<s;i++,o++){let r=e.charCodeAt(i),a=t.charCodeAt(o);if(r===a)continue;if(r>=128||a>=128)return ode(e.toLowerCase(),t.toLowerCase(),i,n,o,s);lde(r)&&(r-=32),lde(a)&&(a-=32);const l=r-a;if(0!==l)return l}const r=n-i,a=s-o;return r<a?-1:r>a?1:0}function ade(e){return e>=48&&e<=57}function lde(e){return e>=97&&e<=122}function hde(e){return e>=65&&e<=90}function dde(e,t){return e.length===t.length&&0===rde(e,t)}function cde(e,t){const i=t.length;return!(t.length>e.length)&&0===rde(e,t,0,i)}function ude(e,t){const i=Math.min(e.length,t.length);let n;for(n=0;n<i;n++)if(e.charCodeAt(n)!==t.charCodeAt(n))return n;return i}function gde(e,t){const i=Math.min(e.length,t.length);let n;const o=e.length-1,s=t.length-1;for(n=0;n<i;n++)if(e.charCodeAt(o-n)!==t.charCodeAt(s-n))return n;return i}function pde(e){return 55296<=e&&e<=56319}function mde(e){return 56320<=e&&e<=57343}function fde(e,t){return t-56320+(e-55296<<10)+65536}function _de(e,t,i){const n=e.charCodeAt(i);if(pde(n)&&i+1<t){const t=e.charCodeAt(i+1);if(mde(t))return fde(n,t)}return n}class vde{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=function(e,t){const i=e.charCodeAt(t-1);if(mde(i)&&t>1){const n=e.charCodeAt(t-2);if(pde(n))return fde(n,i)}return i}(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=_de(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class bde{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new vde(e,t)}nextGraphemeLength(){const e=Rde.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const i=t.offset,o=e.getGraphemeBreakType(t.nextCodePoint());if(Ade(n,o)){t.setOffset(i);break}n=o}return t.offset-i}prevGraphemeLength(){const e=Rde.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const i=t.offset,o=e.getGraphemeBreakType(t.prevCodePoint());if(Ade(o,n)){t.setOffset(i);break}n=o}return i-t.offset}eol(){return this._iterator.eol()}}function wde(e,t){return new bde(e,t).nextGraphemeLength()}function Cde(e,t){return new bde(e,t).prevGraphemeLength()}let yde;function Sde(e){return yde||(yde=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/),yde.test(e)}const kde=/^[\t\n\r\x20-\x7E]*$/;function Lde(e){return kde.test(e)}const xde=/[\u2028\u2029]/;function Dde(e){return xde.test(e)}function Ede(e){return e>=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}function Nde(e){return e>=127462&&e<=127487||8986===e||8987===e||9200===e||9203===e||e>=9728&&e<=10175||11088===e||11093===e||e>=127744&&e<=128591||e>=128640&&e<=128764||e>=128992&&e<=129008||e>=129280&&e<=129535||e>=129648&&e<=129782}const Ide=String.fromCharCode(65279);function Mde(e){return!!(e&&e.length>0&&65279===e.charCodeAt(0))}function Tde(e){return(e%=52)<26?String.fromCharCode(97+e):String.fromCharCode(65+e-26)}function Ade(e,t){return 0===e?5!==t&&7!==t:!(2===e&&3===t||4!==e&&2!==e&&3!==e&&4!==t&&2!==t&&3!==t&&(8===e&&(8===t||9===t||11===t||12===t)||!(11!==e&&9!==e||9!==t&&10!==t)||(12===e||10===e)&&10===t||5===t||13===t||7===t||1===e||13===e&&14===t||6===e&&6===t))}class Rde{static getInstance(){return Rde._INSTANCE||(Rde._INSTANCE=new Rde),Rde._INSTANCE}constructor(){this._data=JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}getGraphemeBreakType(e){if(e<32)return 10===e?3:13===e?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let n=1;for(;n<=i;)if(e<t[3*n])n*=2;else{if(!(e>t[3*n+1]))return t[3*n+2];n=2*n+1}return 0}}function Ode(e){return 127995<=e&&e<=127999}Rde._INSTANCE=null;class Pde{static getInstance(e){return Pde.cache.get(Array.from(e))}static getLocales(){return Pde._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}zhe=Pde,Pde.ambiguousCharacterData=new jhe((()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'))),Pde.cache=new class{constructor(e){this.fn=e,this.lastCache=void 0,this.lastArgKey=void 0}get(e){const t=JSON.stringify(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this.fn(e)),this.lastCache}}((e=>{function t(e){const t=new Map;for(let i=0;i<e.length;i+=2)t.set(e[i],e[i+1]);return t}function i(e,t){if(!e)return t;const i=new Map;for(const[n,o]of e)t.has(n)&&i.set(n,o);return i}const n=zhe.ambiguousCharacterData.value;let o,s=e.filter((e=>!e.startsWith("_")&&e in n));0===s.length&&(s=["_default"]);for(const e of s)o=i(o,t(n[e]));const r=function(e,t){const i=new Map(e);for(const[e,n]of t)i.set(e,n);return i}(t(n._common),o);return new Pde(r)})),Pde._locales=new jhe((()=>Object.keys(Pde.ambiguousCharacterData.value).filter((e=>!e.startsWith("_")))));class Fde{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static getData(){return this._data||(this._data=new Set(Fde.getRawData())),this._data}static isInvisibleCharacter(e){return Fde.getData().has(e)}static get codePoints(){return Fde.getData()}}Fde._data=void 0;class Bde{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}Bde.INSTANCE=new Bde;class Wde extends aae{constructor(){super(),this._onDidChange=this._register(new bae),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(!0),this._mediaQueryList=null,this._handleChange(!1)}_handleChange(e){var t;null===(t=this._mediaQueryList)||void 0===t||t.removeEventListener("change",this._listener),this._mediaQueryList=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),e&&this._onDidChange.fire()}}class Vde extends aae{get value(){return this._value}constructor(){super(),this._onDidChange=this._register(new bae),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio();const e=this._register(new Wde);this._register(e.onDidChange((()=>{this._value=this._getPixelRatio(),this._onDidChange.fire(this._value)})))}_getPixelRatio(){const e=document.createElement("canvas").getContext("2d");return(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}}function zde(e,t){"string"==typeof e&&(e=window.matchMedia(e)),e.addEventListener("change",t)}const Hde=new class{constructor(){this._pixelRatioMonitor=null}_getOrCreatePixelRatioMonitor(){return this._pixelRatioMonitor||(this._pixelRatioMonitor=iae(new Vde)),this._pixelRatioMonitor}get value(){return this._getOrCreatePixelRatioMonitor().value}get onDidChange(){return this._getOrCreatePixelRatioMonitor().onDidChange}};function Ude(){return Bde.INSTANCE.getZoomFactor()}const Kde=navigator.userAgent,jde=Kde.indexOf("Firefox")>=0,qde=Kde.indexOf("AppleWebKit")>=0,$de=Kde.indexOf("Chrome")>=0,Gde=!$de&&Kde.indexOf("Safari")>=0,Zde=!$de&&!Gde&&qde,Yde=Kde.indexOf("Electron/")>=0,Qde=Kde.indexOf("Android")>=0;let Xde=!1;if(window.matchMedia){const e=window.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=window.matchMedia("(display-mode: fullscreen)");Xde=e.matches,zde(e,(({matches:e})=>{Xde&&t.matches||(Xde=e)}))}function Jde(){return Xde}class ece{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){const t=tce(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=tce(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=tce(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=tce(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=tce(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=tce(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=tce(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=tce(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const t=tce(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=tce(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=tce(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function tce(e){return"number"==typeof e?`${e}px`:e}function ice(e){return new ece(e)}function nce(e,t){e instanceof ece?(e.setFontFamily(t.getMassagedFontFamily()),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setFontFeatureSettings(t.fontFeatureSettings),e.setFontVariationSettings(t.fontVariationSettings),e.setLineHeight(t.lineHeight),e.setLetterSpacing(t.letterSpacing)):(e.style.fontFamily=t.getMassagedFontFamily(),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+"px",e.style.fontFeatureSettings=t.fontFeatureSettings,e.style.fontVariationSettings=t.fontVariationSettings,e.style.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px")}class oce{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class sce{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(){this._createDomElements(),document.body.appendChild(this._container),this._readFromDomElements(),document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");nce(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");nce(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const n=document.createElement("div");nce(n,this._bareFontInfo),n.style.fontStyle="italic",e.appendChild(n);const o=[];for(const e of this._requests){let s;0===e.type&&(s=t),2===e.type&&(s=i),1===e.type&&(s=n),s.appendChild(document.createElement("br"));const r=document.createElement("span");sce._render(r,e),s.appendChild(r),o.push(r)}this._container=e,this._testElements=o}static _render(e,t){if(" "===t.chr){let t=" ";for(let e=0;e<8;e++)t+=t;e.innerText=t}else{let i=t.chr;for(let e=0;e<8;e++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e<t;e++){const t=this._requests[e],i=this._testElements[e];t.fulfill(i.offsetWidth/256)}}}const rce=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new bae,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(e){e=Math.min(Math.max(-5,e),20),this._zoomLevel!==e&&(this._zoomLevel=e,this._onDidChangeZoomLevel.fire(this._zoomLevel))}},ace=tse?1.5:1.35;class lce{static createFromValidatedSettings(e,t,i){const n=e.get(46),o=e.get(50),s=e.get(49),r=e.get(48),a=e.get(51),l=e.get(63),h=e.get(60);return lce._create(n,o,s,r,a,l,h,t,i)}static _create(e,t,i,n,o,s,r,a,l){0===s?s=ace*i:s<8&&(s*=i),(s=Math.round(s))<8&&(s=8);const h=1+(l?0:.1*rce.getZoomLevel());return i*=h,s*=h,o===Nre.TRANSLATE&&("normal"===t||"bold"===t?o=Nre.OFF:(o=`'wght' ${parseInt(t,10)}`,t="normal")),new lce({pixelRatio:a,fontFamily:e,fontWeight:t,fontSize:i,fontFeatureSettings:n,fontVariationSettings:o,lineHeight:s,letterSpacing:r})}constructor(e){this._bareFontInfoBrand=void 0,this.pixelRatio=e.pixelRatio,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.fontFeatureSettings=e.fontFeatureSettings,this.fontVariationSettings=e.fontVariationSettings,this.lineHeight=0|e.lineHeight,this.letterSpacing=e.letterSpacing}getId(){return`${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`}getMassagedFontFamily(){const e=Pre.fontFamily,t=lce._wrapInQuotes(this.fontFamily);return e&&this.fontFamily!==e?`${t}, ${e}`:t}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}}class hce extends lce{constructor(e,t){super(e),this._editorStylingBrand=void 0,this.version=2,this.isTrusted=t,this.isMonospace=e.isMonospace,this.typicalHalfwidthCharacterWidth=e.typicalHalfwidthCharacterWidth,this.typicalFullwidthCharacterWidth=e.typicalFullwidthCharacterWidth,this.canUseHalfwidthRightwardsArrow=e.canUseHalfwidthRightwardsArrow,this.spaceWidth=e.spaceWidth,this.middotWidth=e.middotWidth,this.wsmiddotWidth=e.wsmiddotWidth,this.maxDigitWidth=e.maxDigitWidth}equals(e){return this.fontFamily===e.fontFamily&&this.fontWeight===e.fontWeight&&this.fontSize===e.fontSize&&this.fontFeatureSettings===e.fontFeatureSettings&&this.fontVariationSettings===e.fontVariationSettings&&this.lineHeight===e.lineHeight&&this.letterSpacing===e.letterSpacing&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.typicalFullwidthCharacterWidth===e.typicalFullwidthCharacterWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.maxDigitWidth===e.maxDigitWidth}}class dce{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map((e=>this._values[e]))}}const cce=new class extends aae{constructor(){super(),this._onDidChange=this._register(new bae),this.onDidChange=this._onDidChange.event,this._cache=new dce,this._evictUntrustedReadingsTimeout=-1}dispose(){-1!==this._evictUntrustedReadingsTimeout&&(window.clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache=new dce,this._onDidChange.fire()}_writeToCache(e,t){this._cache.put(e,t),t.isTrusted||-1!==this._evictUntrustedReadingsTimeout||(this._evictUntrustedReadingsTimeout=window.setTimeout((()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()}),5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(const i of e)i.isTrusted||(t=!0,this._cache.remove(i));t&&this._onDidChange.fire()}readFontInfo(e){if(!this._cache.has(e)){let t=this._actualReadFontInfo(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new hce({pixelRatio:Hde.value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:t.isMonospace,typicalHalfwidthCharacterWidth:Math.max(t.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(t.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:t.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(t.spaceWidth,5),middotWidth:Math.max(t.middotWidth,5),wsmiddotWidth:Math.max(t.wsmiddotWidth,5),maxDigitWidth:Math.max(t.maxDigitWidth,5)},!1)),this._writeToCache(e,t)}return this._cache.get(e)}_createRequest(e,t,i,n){const o=new oce(e,t);return i.push(o),null==n||n.push(o),o}_actualReadFontInfo(e){const t=[],i=[],n=this._createRequest("n",0,t,i),o=this._createRequest("m",0,t,null),s=this._createRequest(" ",0,t,i),r=this._createRequest("0",0,t,i),a=this._createRequest("1",0,t,i),l=this._createRequest("2",0,t,i),h=this._createRequest("3",0,t,i),d=this._createRequest("4",0,t,i),c=this._createRequest("5",0,t,i),u=this._createRequest("6",0,t,i),g=this._createRequest("7",0,t,i),p=this._createRequest("8",0,t,i),m=this._createRequest("9",0,t,i),f=this._createRequest("→",0,t,i),_=this._createRequest("→",0,t,null),v=this._createRequest("·",0,t,i),b=this._createRequest(String.fromCharCode(11825),0,t,null),w="|/-_ilm%";for(let e=0,n=8;e<n;e++)this._createRequest(w.charAt(e),0,t,i),this._createRequest(w.charAt(e),1,t,i),this._createRequest(w.charAt(e),2,t,i);!function(e,t){new sce(e,t).read()}(e,t);const C=Math.max(r.width,a.width,l.width,h.width,d.width,c.width,u.width,g.width,p.width,m.width);let y=e.fontFeatureSettings===Ere.OFF;const S=i[0].width;for(let e=1,t=i.length;y&&e<t;e++){const t=S-i[e].width;if(t<-.001||t>.001){y=!1;break}}let k=!0;return y&&_.width!==S&&(k=!1),_.width>f.width&&(k=!1),new hce({pixelRatio:Hde.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,fontVariationSettings:e.fontVariationSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:y,typicalHalfwidthCharacterWidth:n.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:k,spaceWidth:s.width,middotWidth:v.width,wsmiddotWidth:b.width,maxDigitWidth:C},!0)}};var uce;!function(e){e.serviceIds=new Map,e.DI_TARGET="$di$target",e.DI_DEPENDENCIES="$di$dependencies",e.getServiceDependencies=function(t){return t[e.DI_DEPENDENCIES]||[]}}(uce||(uce={}));const gce=pce("instantiationService");function pce(e){if(uce.serviceIds.has(e))return uce.serviceIds.get(e);const t=function(e,i,n){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");!function(e,t,i){t[uce.DI_TARGET]===t?t[uce.DI_DEPENDENCIES].push({id:e,index:i}):(t[uce.DI_DEPENDENCIES]=[{id:e,index:i}],t[uce.DI_TARGET]=t)}(t,e,n)};return t.toString=()=>e,uce.serviceIds.set(e,t),t}const mce=pce("codeEditorService");function fce(e,t){if(!e)throw new Error(t?`Assertion failed (${t})`:"Assertion Failed")}function _ce(e,t="Unreachable"){throw new Error(t)}function vce(e){e()||(e(),zre(new Yre("Assertion Failed")))}function bce(e,t){let i=0;for(;i<e.length-1;){if(!t(e[i],e[i+1]))return!1;i++}return!0}const wce=pce("audioCue");class Cce{static register(e){return new Cce(e.fileName)}constructor(e){this.fileName=e}}Cce.error=Cce.register({fileName:"error.mp3"}),Cce.warning=Cce.register({fileName:"warning.mp3"}),Cce.foldedArea=Cce.register({fileName:"foldedAreas.mp3"}),Cce.break=Cce.register({fileName:"break.mp3"}),Cce.quickFixes=Cce.register({fileName:"quickFixes.mp3"}),Cce.taskCompleted=Cce.register({fileName:"taskCompleted.mp3"}),Cce.taskFailed=Cce.register({fileName:"taskFailed.mp3"}),Cce.terminalBell=Cce.register({fileName:"terminalBell.mp3"}),Cce.diffLineInserted=Cce.register({fileName:"diffLineInserted.mp3"}),Cce.diffLineDeleted=Cce.register({fileName:"diffLineDeleted.mp3"}),Cce.diffLineModified=Cce.register({fileName:"diffLineModified.mp3"});class yce{static register(e){const t=new yce(e.sound,e.name,e.settingsKey);return yce._audioCues.add(t),t}constructor(e,t,i){this.sound=e,this.name=t,this.settingsKey=i}}yce._audioCues=new Set,yce.error=yce.register({name:Toe(0,"Error on Line"),sound:Cce.error,settingsKey:"audioCues.lineHasError"}),yce.warning=yce.register({name:Toe(0,"Warning on Line"),sound:Cce.warning,settingsKey:"audioCues.lineHasWarning"}),yce.foldedArea=yce.register({name:Toe(0,"Folded Area on Line"),sound:Cce.foldedArea,settingsKey:"audioCues.lineHasFoldedArea"}),yce.break=yce.register({name:Toe(0,"Breakpoint on Line"),sound:Cce.break,settingsKey:"audioCues.lineHasBreakpoint"}),yce.inlineSuggestion=yce.register({name:Toe(0,"Inline Suggestion on Line"),sound:Cce.quickFixes,settingsKey:"audioCues.lineHasInlineSuggestion"}),yce.terminalQuickFix=yce.register({name:Toe(0,"Terminal Quick Fix"),sound:Cce.quickFixes,settingsKey:"audioCues.terminalQuickFix"}),yce.onDebugBreak=yce.register({name:Toe(0,"Debugger Stopped on Breakpoint"),sound:Cce.break,settingsKey:"audioCues.onDebugBreak"}),yce.noInlayHints=yce.register({name:Toe(0,"No Inlay Hints on Line"),sound:Cce.error,settingsKey:"audioCues.noInlayHints"}),yce.taskCompleted=yce.register({name:Toe(0,"Task Completed"),sound:Cce.taskCompleted,settingsKey:"audioCues.taskCompleted"}),yce.taskFailed=yce.register({name:Toe(0,"Task Failed"),sound:Cce.taskFailed,settingsKey:"audioCues.taskFailed"}),yce.terminalBell=yce.register({name:Toe(0,"Terminal Bell"),sound:Cce.terminalBell,settingsKey:"audioCues.terminalBell"}),yce.notebookCellCompleted=yce.register({name:Toe(0,"Notebook Cell Completed"),sound:Cce.taskCompleted,settingsKey:"audioCues.notebookCellCompleted"}),yce.notebookCellFailed=yce.register({name:Toe(0,"Notebook Cell Failed"),sound:Cce.taskFailed,settingsKey:"audioCues.notebookCellFailed"}),yce.diffLineInserted=yce.register({name:Toe(0,"Diff Line Inserted"),sound:Cce.diffLineInserted,settingsKey:"audioCues.diffLineInserted"}),yce.diffLineDeleted=yce.register({name:Toe(0,"Diff Line Deleted"),sound:Cce.diffLineDeleted,settingsKey:"audioCues.diffLineDeleted"}),yce.diffLineModified=yce.register({name:Toe(0,"Diff Line Modified"),sound:Cce.diffLineModified,settingsKey:"audioCues.diffLineModified"});const Sce=new Map;Sce.set("false",!1),Sce.set("true",!0),Sce.set("isMac",tse),Sce.set("isLinux",ise),Sce.set("isWindows",ese),Sce.set("isWeb",ose),Sce.set("isMacNative",tse&&!ose),Sce.set("isEdge",vse),Sce.set("isFirefox",fse),Sce.set("isChrome",mse),Sce.set("isSafari",_se);const kce=Object.prototype.hasOwnProperty;class Lce{static has(e){return Nce.create(e)}static equals(e,t){return Ice.create(e,t)}static regex(e,t){return Vce.create(e,t)}static not(e){return Rce.create(e)}static and(...e){return Uce.create(e,null,!0)}static or(...e){return Kce.create(e,null,!0)}static deserialize(e,t=!1){if(e)return this._deserializeOrExpression(e,t)}static _deserializeOrExpression(e,t){const i=e.split("||");return Kce.create(i.map((e=>this._deserializeAndExpression(e,t))),null,!0)}static _deserializeAndExpression(e,t){const i=e.split("&&");return Uce.create(i.map((e=>this._deserializeOne(e,t))),null,!0)}static _deserializeOne(e,t){if((e=e.trim()).indexOf("!=")>=0){const i=e.split("!=");return Ace.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("==")>=0){const i=e.split("==");return Ice.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("=~")>=0){const i=e.split("=~");return Vce.create(i[0].trim(),this._deserializeRegexValue(i[1],t))}if(e.indexOf(" not in ")>=0){const i=e.split(" not in ");return Tce.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf(" in ")>=0){const i=e.split(" in ");return Mce.create(i[0].trim(),this._deserializeValue(i[1],t))}if(/^[^<=>]+>=[^<=>]+$/.test(e)){const t=e.split(">=");return Fce.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(e)){const t=e.split(">");return Pce.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(e)){const t=e.split("<=");return Wce.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(e)){const t=e.split("<");return Bce.create(t[0].trim(),t[1].trim())}return/^\!\s*/.test(e)?Rce.create(e.substr(1).trim()):Nce.create(e)}static _deserializeValue(e,t){if("true"===(e=e.trim()))return!0;if("false"===e)return!1;const i=/^'([^']*)'$/.exec(e);return i?i[1].trim():e}static _deserializeRegexValue(e,t){if(!(i=e)||"string"!=typeof i||0===i.trim().length){if(t)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}var i;const n=e.indexOf("/"),o=e.lastIndexOf("/");if(n===o||n<0){if(t)throw new Error(`bad regexp-value '${e}', missing /-enclosure`);return console.warn(`bad regexp-value '${e}', missing /-enclosure`),null}const s=e.slice(n+1,o),r="i"===e[o+1]?"i":"";try{return new RegExp(s,r)}catch(i){if(t)throw new Error(`bad regexp-value '${e}', parse error: ${i}`);return console.warn(`bad regexp-value '${e}', parse error: ${i}`),null}}}function xce(e,t){return e.cmp(t)}class Dce{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return Ece.INSTANCE}}Dce.INSTANCE=new Dce;class Ece{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return Dce.INSTANCE}}Ece.INSTANCE=new Ece;class Nce{static create(e,t=null){const i=Sce.get(e);return"boolean"==typeof i?i?Ece.INSTANCE:Dce.INSTANCE:new Nce(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:$ce(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=Sce.get(this.key);return"boolean"==typeof e?e?Ece.INSTANCE:Dce.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=Rce.create(this.key,this)),this.negated}}class Ice{static create(e,t,i=null){if("boolean"==typeof t)return t?Nce.create(e,i):Rce.create(e,i);const n=Sce.get(e);return"boolean"==typeof n?t===(n?"true":"false")?Ece.INSTANCE:Dce.INSTANCE:new Ice(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:Gce(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){const e=Sce.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?Ece.INSTANCE:Dce.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Ace.create(this.key,this.value,this)),this.negated}}class Mce{static create(e,t){return new Mce(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:Gce(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type&&this.key===e.key&&this.valueKey===e.valueKey}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):"string"==typeof i&&"object"==typeof t&&null!==t&&kce.call(t,i)}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=Tce.create(this.key,this.valueKey)),this.negated}}class Tce{static create(e,t){return new Tce(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=Mce.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type&&this._negated.equals(e._negated)}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class Ace{static create(e,t,i=null){if("boolean"==typeof t)return t?Rce.create(e,i):Nce.create(e,i);const n=Sce.get(e);return"boolean"==typeof n?t===(n?"true":"false")?Dce.INSTANCE:Ece.INSTANCE:new Ace(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:Gce(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){const e=Sce.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?Dce.INSTANCE:Ece.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Ice.create(this.key,this.value,this)),this.negated}}class Rce{static create(e,t=null){const i=Sce.get(e);return"boolean"==typeof i?i?Dce.INSTANCE:Ece.INSTANCE:new Rce(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:$ce(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=Sce.get(this.key);return"boolean"==typeof e?e?Dce.INSTANCE:Ece.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Nce.create(this.key,this)),this.negated}}function Oce(e,t){if("string"==typeof e){const t=parseFloat(e);isNaN(t)||(e=t)}return"string"==typeof e||"number"==typeof e?t(e):Dce.INSTANCE}class Pce{static create(e,t,i=null){return Oce(t,(t=>new Pce(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:Gce(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Wce.create(this.key,this.value,this)),this.negated}}class Fce{static create(e,t,i=null){return Oce(t,(t=>new Fce(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:Gce(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Bce.create(this.key,this.value,this)),this.negated}}class Bce{static create(e,t,i=null){return Oce(t,(t=>new Bce(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:Gce(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Fce.create(this.key,this.value,this)),this.negated}}class Wce{static create(e,t,i=null){return Oce(t,(t=>new Wce(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:Gce(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Pce.create(this.key,this.value,this)),this.negated}}class Vce{static create(e,t){return new Vce(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.key<e.key)return-1;if(this.key>e.key)return 1;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return t<i?-1:t>i?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return!!this.regexp&&this.regexp.test(t)}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=zce.create(this)),this.negated}}class zce{static create(e){return new zce(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type&&this._actual.equals(e._actual)}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function Hce(e){let t=null;for(let i=0,n=e.length;i<n;i++){const n=e[i].substituteConstants();if(e[i]!==n&&null===t){t=[];for(let n=0;n<i;n++)t[n]=e[n]}null!==t&&(t[i]=n)}return null===t?e:t}class Uce{static create(e,t,i){return Uce._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=6}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,i=this.expr.length;t<i;t++){const i=xce(this.expr[t],e.expr[t]);if(0!==i)return i}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=Hce(this.expr);return e===this.expr?this:Uce.create(e,this.negated,!1)}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].evaluate(e))return!1;return!0}static _normalizeArr(e,t,i){const n=[];let o=!1;for(const t of e)if(t)if(1!==t.type){if(0===t.type)return Dce.INSTANCE;6!==t.type?n.push(t):n.push(...t.expr)}else o=!0;if(0===n.length&&o)return Ece.INSTANCE;if(0!==n.length){if(1===n.length)return n[0];n.sort(xce);for(let e=1;e<n.length;e++)n[e-1].equals(n[e])&&(n.splice(e,1),e--);if(1===n.length)return n[0];for(;n.length>1;){const e=n[n.length-1];if(9!==e.type)break;n.pop();const t=n.pop(),o=0===n.length,s=Kce.create(e.expr.map((e=>Uce.create([e,t],null,i))),null,o);s&&(n.push(s),n.sort(xce))}if(1===n.length)return n[0];if(i){for(let e=0;e<n.length;e++)for(let t=e+1;t<n.length;t++)if(n[e].negate().equals(n[t]))return Dce.INSTANCE;if(1===n.length)return n[0]}return new Uce(n,t)}}serialize(){return this.expr.map((e=>e.serialize())).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=Kce.create(e,this,!0)}return this.negated}}class Kce{static create(e,t,i){return Kce._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,i=this.expr.length;t<i;t++){const i=xce(this.expr[t],e.expr[t]);if(0!==i)return i}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=Hce(this.expr);return e===this.expr?this:Kce.create(e,this.negated,!1)}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(this.expr[t].evaluate(e))return!0;return!1}static _normalizeArr(e,t,i){let n=[],o=!1;if(e){for(let t=0,i=e.length;t<i;t++){const i=e[t];if(i)if(0!==i.type){if(1===i.type)return Ece.INSTANCE;9!==i.type?n.push(i):n=n.concat(i.expr)}else o=!0}if(0===n.length&&o)return Dce.INSTANCE;n.sort(xce)}if(0!==n.length){if(1===n.length)return n[0];for(let e=1;e<n.length;e++)n[e-1].equals(n[e])&&(n.splice(e,1),e--);if(1===n.length)return n[0];if(i){for(let e=0;e<n.length;e++)for(let t=e+1;t<n.length;t++)if(n[e].negate().equals(n[t]))return Ece.INSTANCE;if(1===n.length)return n[0]}return new Kce(n,t)}}serialize(){return this.expr.map((e=>e.serialize())).join(" || ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),i=e.shift(),n=[];for(const e of Qce(t))for(const t of Qce(i))n.push(Uce.create([e,t],null,!1));e.unshift(Kce.create(n,null,!1))}this.negated=Kce.create(e,this,!0)}return this.negated}}class jce extends Nce{static all(){return jce._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,"object"==typeof i?jce._info.push(Object.assign(Object.assign({},i),{key:e})):!0!==i&&jce._info.push({key:e,description:i,type:null!=t?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return Ice.create(this.key,e)}}jce._info=[];const qce=pce("contextKeyService");function $ce(e,t){return e<t?-1:e>t?1:0}function Gce(e,t,i,n){return e<i?-1:e>i?1:t<n?-1:t>n?1:0}function Zce(e,t){if(0===e.type||1===t.type)return!0;if(9===e.type)return 9===t.type&&Yce(e.expr,t.expr);if(9===t.type){for(const i of t.expr)if(Zce(e,i))return!0;return!1}if(6===e.type){if(6===t.type)return Yce(t.expr,e.expr);for(const i of e.expr)if(Zce(i,t))return!0;return!1}return e.equals(t)}function Yce(e,t){let i=0,n=0;for(;i<e.length&&n<t.length;){const o=e[i].cmp(t[n]);if(o<0)return!1;0===o?(i++,n++):n++}return i===e.length}function Qce(e){return 9===e.type?e.expr:[e]}const Xce=pce("accessibilityService"),Jce=new jce("accessibilityModeEnabled",!1);var eue=function(e,t){return function(i,n){t(i,n,e)}};const tue={followsCaret:!0,ignoreCharChanges:!0,alwaysRevealFirst:!0,findResultLoop:!0};let iue=class extends aae{constructor(e,t={},i,n,o){super(),this._audioCueService=i,this._codeEditorService=n,this._accessibilityService=o,this._onDidUpdate=this._register(new bae),this._editor=e,this._options=are(t,tue,!1),this.disposed=!1,this.nextIdx=-1,this.ranges=[],this.ignoreSelectionChange=!1,this.revealFirst=Boolean(this._options.alwaysRevealFirst),this._register(this._editor.onDidDispose((()=>this.dispose()))),this._register(this._editor.onDidUpdateDiff((()=>this._onDiffUpdated()))),this._options.followsCaret&&this._register(this._editor.getModifiedEditor().onDidChangeCursorPosition((e=>{this.ignoreSelectionChange||(this._updateAccessibilityState(e.position.lineNumber),this.nextIdx=-1)}))),this._options.alwaysRevealFirst&&this._register(this._editor.getModifiedEditor().onDidChangeModel((e=>{this.revealFirst=!0}))),this._init()}_init(){this._editor.getLineChanges()}_onDiffUpdated(){this._init(),this._compute(this._editor.getLineChanges()),this.revealFirst&&null!==this._editor.getLineChanges()&&(this.revealFirst=!1,this.nextIdx=-1,this.next(1))}_compute(e){this.ranges=[],e&&e.forEach((e=>{!this._options.ignoreCharChanges&&e.charChanges?e.charChanges.forEach((e=>{this.ranges.push({rhs:!0,range:new Ole(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn)})})):0===e.modifiedEndLineNumber?this.ranges.push({rhs:!0,range:new Ole(e.modifiedStartLineNumber,1,e.modifiedStartLineNumber+1,1)}):this.ranges.push({rhs:!0,range:new Ole(e.modifiedStartLineNumber,1,e.modifiedEndLineNumber+1,1)})})),this.ranges.sort(((e,t)=>Ole.compareRangesUsingStarts(e.range,t.range))),this._onDidUpdate.fire(this)}_initIdx(e){let t=!1;const i=this._editor.getPosition();if(i){for(let n=0,o=this.ranges.length;n<o&&!t;n++){const o=this.ranges[n].range;i.isBeforeOrEqual(o.getStartPosition())&&(this.nextIdx=n+(e?0:-1),t=!0)}t||(this.nextIdx=e?0:this.ranges.length-1),this.nextIdx<0&&(this.nextIdx=this.ranges.length-1)}else this.nextIdx=0}_move(e,t){if(fce(!this.disposed,"Illegal State - diff navigator has been disposed"),!this.canNavigate())return;-1===this.nextIdx?this._initIdx(e):e?(this.nextIdx+=1,this.nextIdx>=this.ranges.length&&(this.nextIdx=0)):(this.nextIdx-=1,this.nextIdx<0&&(this.nextIdx=this.ranges.length-1));const i=this.ranges[this.nextIdx];this.ignoreSelectionChange=!0;try{const e=i.range.getStartPosition();this._editor.setPosition(e),this._editor.revealRangeInCenter(i.range,t),this._updateAccessibilityState(e.lineNumber,!0)}finally{this.ignoreSelectionChange=!1}}_updateAccessibilityState(e,t){var i;const n=null===(i=this._editor.getModel())||void 0===i?void 0:i.modified;if(!n)return;const o=n.getLineDecorations(e).find((e=>"line-insert"===e.options.className));if(o)this._audioCueService.playAudioCue(yce.diffLineModified,!0);else{if(!t)return;this._audioCueService.playAudioCue(yce.diffLineDeleted,!0)}const s=this._codeEditorService.getActiveCodeEditor();t&&s&&o&&this._accessibilityService.isScreenReaderOptimized()&&(s.setSelection({startLineNumber:e,startColumn:0,endLineNumber:e,endColumn:Number.MAX_VALUE}),s.writeScreenReaderContent("diff-navigation"))}canNavigate(){return this.ranges&&this.ranges.length>0}next(e=0){this.canNavigateNext()&&this._move(!0,e)}previous(e=0){this.canNavigatePrevious()&&this._move(!1,e)}canNavigateNext(){return this.canNavigateLoop()||this.nextIdx<this.ranges.length-1}canNavigatePrevious(){return this.canNavigateLoop()||0!==this.nextIdx}canNavigateLoop(){return Boolean(this._options.findResultLoop)}dispose(){super.dispose(),this.ranges=[],this.disposed=!0}};iue=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([eue(2,wce),eue(3,mce),eue(4,Xce)],iue);const nue={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};var oue,sue,rue,aue;!function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"}(oue||(oue={})),function(e){e[e.Inline=1]="Inline",e[e.Gutter=2]="Gutter"}(sue||(sue={})),function(e){e[e.Both=0]="Both",e[e.Right=1]="Right",e[e.Left=2]="Left",e[e.None=3]="None"}(rue||(rue={}));class lue{get originalIndentSize(){return this._indentSizeIsTabSize?"tabSize":this.indentSize}constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,0|e.tabSize),"tabSize"===e.indentSize?(this.indentSize=this.tabSize,this._indentSizeIsTabSize=!0):(this.indentSize=Math.max(1,0|e.indentSize),this._indentSizeIsTabSize=!1),this.insertSpaces=Boolean(e.insertSpaces),this.defaultEOL=0|e.defaultEOL,this.trimAutoWhitespace=Boolean(e.trimAutoWhitespace),this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this._indentSizeIsTabSize===e._indentSizeIsTabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&lre(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}}class hue{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}class due{constructor(e,t,i,n,o,s){this.identifier=e,this.range=t,this.text=i,this.forceMoveMarkers=n,this.isAutoWhitespaceEdit=o,this._isTracked=s}}class cue{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}class uue{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}function gue(e){return!e.isTooLargeForSyncing()&&!e.isForSimpleWidget}!function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(aue||(aue={}));class pue{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t<i;t++)switch(e.notIn[t]){case"string":this._inString=!1;break;case"comment":this._inComment=!1;break;case"regex":this._inRegEx=!1}}isOK(e){switch(e){case 0:return!0;case 1:return this._inComment;case 2:return this._inString;case 3:return this._inRegEx}}shouldAutoClose(e,t){if(0===e.getTokenCount())return!0;const i=e.findTokenIndexAtOffset(t-2),n=e.getStandardTokenType(i);return this.isOK(n)}_findNeutralCharacterInRange(e,t){for(let i=e;i<=t;i++){const e=String.fromCharCode(i);if(!this.open.includes(e)&&!this.close.includes(e))return e}return null}findNeutralCharacter(){return this._neutralCharacterSearched||(this._neutralCharacterSearched=!0,this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(48,57)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(97,122)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(65,90))),this._neutralCharacter}}class mue{constructor(e){this.autoClosingPairsOpenByStart=new Map,this.autoClosingPairsOpenByEnd=new Map,this.autoClosingPairsCloseByStart=new Map,this.autoClosingPairsCloseByEnd=new Map,this.autoClosingPairsCloseSingleChar=new Map;for(const t of e)fue(this.autoClosingPairsOpenByStart,t.open.charAt(0),t),fue(this.autoClosingPairsOpenByEnd,t.open.charAt(t.open.length-1),t),fue(this.autoClosingPairsCloseByStart,t.close.charAt(0),t),fue(this.autoClosingPairsCloseByEnd,t.close.charAt(t.close.length-1),t),1===t.close.length&&1===t.open.length&&fue(this.autoClosingPairsCloseSingleChar,t.close,t)}}function fue(e,t,i){e.has(t)?e.get(t).push(i):e.set(t,[i])}function _ue(e,t){const i=e.getCount(),n=e.findTokenIndexAtOffset(t),o=e.getLanguageId(n);let s=n;for(;s+1<i&&e.getLanguageId(s+1)===o;)s++;let r=n;for(;r>0&&e.getLanguageId(r-1)===o;)r--;return new vue(e,o,r,s+1,e.getStartOffset(r),e.getEndOffset(s))}class vue{constructor(e,t,i,n,o,s){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=o,this._lastCharOffset=s}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}}function bue(e){return 0!=(3&e)}class wue{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map((e=>new pue(e))):e.brackets?this._autoClosingPairs=e.brackets.map((e=>new pue({open:e[0],close:e[1]}))):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new pue({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes="string"==typeof e.autoCloseBefore?e.autoCloseBefore:wue.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets="string"==typeof e.autoCloseBefore?e.autoCloseBefore:wue.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}}wue.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=";:.,=}])> \n\t",wue.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS="'\"`;:.,=}])> \n\t";const Cue="undefined"!=typeof Buffer;let yue,Sue,kue,Lue;class xue{static wrap(e){return Cue&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new xue(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return Cue?this.buffer.toString():(yue||(yue=new TextDecoder),yue.decode(this.buffer))}}function Due(e,t){return e[t+0]<<0>>>0|e[t+1]<<8>>>0}function Eue(e,t,i){e[i+0]=255&t,t>>>=8,e[i+1]=255&t}function Nue(e,t){return e[t]*Math.pow(2,24)+e[t+1]*Math.pow(2,16)+e[t+2]*Math.pow(2,8)+e[t+3]}function Iue(e,t,i){e[i+3]=t,t>>>=8,e[i+2]=t,t>>>=8,e[i+1]=t,t>>>=8,e[i]=t}function Mue(e,t){return e[t]}function Tue(e,t,i){e[i]=t}function Aue(){return Sue||(Sue=new TextDecoder("UTF-16LE")),Sue}function Rue(){return Lue||(Lue=pse()?Aue():(kue||(kue=new TextDecoder("UTF-16BE")),kue)),Lue}class Oue{constructor(e){this._capacity=0|e,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}reset(){this._completedStrings=null,this._bufferLength=0}build(){return null!==this._completedStrings?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()}_buildBuffer(){if(0===this._bufferLength)return"";const e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return Rue().decode(e)}_flushBuffer(){const e=this._buildBuffer();this._bufferLength=0,null===this._completedStrings?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}appendCharCode(e){const t=this._capacity-this._bufferLength;t<=1&&(0===t||pde(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIICharCode(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendString(e){const t=e.length;if(this._bufferLength+t>=this._capacity)return this._flushBuffer(),void(this._completedStrings[this._completedStrings.length]=e);for(let i=0;i<t;i++)this._buffer[this._bufferLength++]=e.charCodeAt(i)}}class Pue{constructor(e,t,i,n,o,s){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=i,this.close=n,this.forwardRegex=o,this.reversedRegex=s,this._openSet=Pue._toSet(this.open),this._closeSet=Pue._toSet(this.close)}isOpen(e){return this._openSet.has(e)}isClose(e){return this._closeSet.has(e)}static _toSet(e){const t=new Set;for(const i of e)t.add(i);return t}}class Fue{constructor(e,t){this._richEditBracketsBrand=void 0;const i=function(e){const t=e.length;e=e.map((e=>[e[0].toLowerCase(),e[1].toLowerCase()]));const i=[];for(let e=0;e<t;e++)i[e]=e;const n=(e,t)=>{const[i,n]=e,[o,s]=t;return i===o||i===s||n===o||n===s},o=(e,n)=>{const o=Math.min(e,n),s=Math.max(e,n);for(let e=0;e<t;e++)i[e]===s&&(i[e]=o)};for(let s=0;s<t;s++){const r=e[s];for(let a=s+1;a<t;a++)n(r,e[a])&&o(i[s],i[a])}const s=[];for(let n=0;n<t;n++){const o=[],r=[];for(let s=0;s<t;s++)if(i[s]===n){const[t,i]=e[s];o.push(t),r.push(i)}o.length>0&&s.push({open:o,close:r})}return s}(t);this.brackets=i.map(((t,n)=>new Pue(e,n,t.open,t.close,function(e,t,i,n){let o=[];o=o.concat(e),o=o.concat(t);for(let e=0,t=o.length;e<t;e++)Bue(o[e],i,n,o);return o=Vue(o),o.sort(Wue),o.reverse(),Hue(o)}(t.open,t.close,i,n),function(e,t,i,n){let o=[];o=o.concat(e),o=o.concat(t);for(let e=0,t=o.length;e<t;e++)Bue(o[e],i,n,o);return o=Vue(o),o.sort(Wue),o.reverse(),Hue(o.map(Uue))}(t.open,t.close,i,n)))),this.forwardRegex=function(e){let t=[];for(const i of e){for(const e of i.open)t.push(e);for(const e of i.close)t.push(e)}return t=Vue(t),Hue(t)}(this.brackets),this.reversedRegex=function(e){let t=[];for(const i of e){for(const e of i.open)t.push(e);for(const e of i.close)t.push(e)}return t=Vue(t),Hue(t.map(Uue))}(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const e of this.brackets){for(const t of e.open)this.textIsBracket[t]=e,this.textIsOpenBracket[t]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,t.length);for(const t of e.close)this.textIsBracket[t]=e,this.textIsOpenBracket[t]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,t.length)}}}function Bue(e,t,i,n){for(let o=0,s=t.length;o<s;o++){if(o===i)continue;const s=t[o];for(const t of s.open)t.indexOf(e)>=0&&n.push(t);for(const t of s.close)t.indexOf(e)>=0&&n.push(t)}}function Wue(e,t){return e.length-t.length}function Vue(e){if(e.length<=1)return e;const t=[],i=new Set;for(const n of e)i.has(n)||(t.push(n),i.add(n));return t}function zue(e){const t=/^[\w ]+$/.test(e);return e=Zhe(e),t?`\\b${e}\\b`:e}function Hue(e){return Qhe(`(${e.map(zue).join(")|(")})`,!0)}const Uue=function(){let e=null,t=null;return function(i){return e!==i&&(e=i,t=function(e){const t=new Uint16Array(e.length);let i=0;for(let n=e.length-1;n>=0;n--)t[i++]=e.charCodeAt(n);return Rue().decode(t)}(e)),t}}();class Kue{static _findPrevBracketInText(e,t,i,n){const o=i.match(e);if(!o)return null;const s=i.length-(o.index||0),r=o[0].length,a=n+s;return new Ole(t,a-r+1,t,a+1)}static findPrevBracketInRange(e,t,i,n,o){const s=Uue(i).substring(i.length-o,i.length-n);return this._findPrevBracketInText(e,t,s,n)}static findNextBracketInText(e,t,i,n){const o=i.match(e);if(!o)return null;const s=o.index||0,r=o[0].length;if(0===r)return null;const a=n+s;return new Ole(t,a+1,t,a+1+r)}static findNextBracketInRange(e,t,i,n,o){const s=i.substring(n,o);return this.findNextBracketInText(e,t,s,n)}}class jue{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const t=i.charAt(i.length-1);e.push(t)}return Mse(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||0===this._richEditBrackets.brackets.length)return null;const n=t.findTokenIndexAtOffset(i-1);if(bue(t.getStandardTokenType(n)))return null;const o=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,i-1)+e,r=Kue.findPrevBracketInRange(o,1,s,0,s.length);if(!r)return null;const a=s.substring(r.startColumn-1,r.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[a])return null;const l=t.getActualLineContentBefore(r.startColumn-1);return/^\s*$/.test(l)?{matchOpenBracket:a}:null}}function que(e){return e.global&&(e.lastIndex=0),!0}class $ue{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&que(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&que(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&que(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&que(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class Gue{constructor(e){(e=e||{}).brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach((e=>{const t=Gue._createOpenBracketRegExp(e[0]),i=Gue._createCloseBracketRegExp(e[1]);t&&i&&this._brackets.push({open:e[0],openRegExp:t,close:e[1],closeRegExp:i})})),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,n){if(e>=3)for(let e=0,o=this._regExpRules.length;e<o;e++){const o=this._regExpRules[e];if([{reg:o.beforeText,text:i},{reg:o.afterText,text:n},{reg:o.previousLineText,text:t}].every((e=>!e.reg||(e.reg.lastIndex=0,e.reg.test(e.text)))))return o.action}if(e>=2&&i.length>0&&n.length>0)for(let e=0,t=this._brackets.length;e<t;e++){const t=this._brackets[e];if(t.openRegExp.test(i)&&t.closeRegExp.test(n))return{indentAction:aue.IndentOutdent}}if(e>=2&&i.length>0)for(let e=0,t=this._brackets.length;e<t;e++)if(this._brackets[e].openRegExp.test(i))return{indentAction:aue.Indent};return null}static _createOpenBracketRegExp(e){let t=Zhe(e);return/\B/.test(t.charAt(0))||(t="\\b"+t),t+="\\s*$",Gue._safeRegExp(t)}static _createCloseBracketRegExp(e){let t=Zhe(e);return/\B/.test(t.charAt(t.length-1))||(t+="\\b"),t="^\\s*"+t,Gue._safeRegExp(t)}static _safeRegExp(e){try{return new RegExp(e)}catch(e){return zre(e),null}}}const Zue=pce("configurationService");function Yue(e,t){const i=Object.create(null);for(const n in e)Que(i,n,e[n],t);return i}function Que(e,t,i,n){const o=t.split("."),s=o.pop();let r=e;for(let e=0;e<o.length;e++){const i=o[e];let s=r[i];switch(typeof s){case"undefined":s=r[i]=Object.create(null);break;case"object":break;default:return void n(`Ignoring ${t} as ${o.slice(0,e+1).join(".")} is ${JSON.stringify(s)}`)}r=s}if("object"==typeof r&&null!==r)try{r[s]=i}catch(e){n(`Ignoring ${t} as ${o.join(".")} is ${JSON.stringify(r)}`)}else n(`Ignoring ${t} as ${o.join(".")} is ${JSON.stringify(r)}`)}function Xue(e,t){Jue(e,t.split("."))}function Jue(e,t){const i=t.shift();if(0!==t.length){if(-1!==Object.keys(e).indexOf(i)){const n=e[i];"object"!=typeof n||Array.isArray(n)||(Jue(n,t),0===Object.keys(n).length&&delete e[i])}}else delete e[i]}function ege(e,t,i){const n=function(e,t){let i=e;for(const e of t){if("object"!=typeof i||null===i)return;i=i[e]}return i}(e,t.split("."));return void 0===n?i:n}const tge=pce("languageService");class ige{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const nge=[];function oge(e,t,i){t instanceof ige||(t=new ige(t,[],Boolean(i))),nge.push([e,t])}function sge(){return nge}const rge=new class{constructor(){this.data=new Map}add(e,t){fce(Kse(e)),fce(jse(t)),fce(!this.data.has(e),"There is already an extension with this id"),this.data.set(e,t)}as(e){return this.data.get(e)||null}},age=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),lge="base.contributions.json",hge=new class{constructor(){this._onDidChangeSchema=new bae,this.schemasById={}}registerSchema(e,t){var i;this.schemasById[(i=e,i.length>0&&"#"===i.charAt(i.length-1)?i.substring(0,i.length-1):i)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}};rge.add(lge,hge);const dge="base.contributions.configuration",cge={properties:{},patternProperties:{}},uge={properties:{},patternProperties:{}},gge={properties:{},patternProperties:{}},pge={properties:{},patternProperties:{}},mge={properties:{},patternProperties:{}},fge={properties:{},patternProperties:{}},_ge="vscode://schemas/settings/resourceLanguage",vge=rge.as(lge),bge="\\[([^\\]]+)\\]",wge=new RegExp(bge,"g"),Cge=`^(${bge})+$`,yge=new RegExp(Cge);function Sge(e){const t=[];if(yge.test(e)){let i=wge.exec(e);for(;null==i?void 0:i.length;){const n=i[1].trim();n&&t.push(n),i=wge.exec(e)}}return Mse(t)}const kge=new class{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new bae,this._onDidUpdateConfiguration=new bae,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:Toe(0,"Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},vge.registerSchema(_ge,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),vge.registerSchema(_ge,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){var i;const n=[];for(const{overrides:o,source:s}of e)for(const e in o)if(t.add(e),yge.test(e)){const t=this.configurationDefaultsOverrides.get(e),r=null!==(i=null==t?void 0:t.valuesSources)&&void 0!==i?i:new Map;if(s)for(const t of Object.keys(o[e]))r.set(t,s);const a=Object.assign(Object.assign({},(null==t?void 0:t.value)||{}),o[e]);this.configurationDefaultsOverrides.set(e,{source:s,value:a,valuesSources:r});const l={type:"object",default:a,description:Toe(0,"Configure settings to be overridden for the {0} language.",e.replace(/[\[\]]/g,"")),$ref:_ge,defaultDefaultValue:a,source:Kse(s)?void 0:s,defaultValueSource:s};n.push(...Sge(e)),this.configurationProperties[e]=l,this.defaultLanguageConfigurationOverridesNode.properties[e]=l}else{this.configurationDefaultsOverrides.set(e,{value:o[e],source:s});const t=this.configurationProperties[e];t&&(this.updatePropertyDefaultValue(e,t),this.updateSchema(e,t))}this.doRegisterOverrideIdentifiers(n)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach((e=>{this.validateAndRegisterProperties(e,t,e.extensionInfo,e.restrictedProperties,void 0,i),this.configurationContributors.push(e),this.registerJSONConfiguration(e)}))}validateAndRegisterProperties(e,t=!0,i,n,o=3,s){var r;o=Xse(e.scope)?o:e.scope;const a=e.properties;if(a)for(const e in a){const l=a[e];t&&Lge(e,l)?delete a[e]:(l.source=i,l.defaultDefaultValue=a[e].default,this.updatePropertyDefaultValue(e,l),yge.test(e)?l.scope=void 0:(l.scope=Xse(l.scope)?o:l.scope,l.restricted=Xse(l.restricted)?!!(null==n?void 0:n.includes(e)):l.restricted),!a[e].hasOwnProperty("included")||a[e].included?(this.configurationProperties[e]=a[e],(null===(r=a[e].policy)||void 0===r?void 0:r.name)&&this.policyConfigurations.set(a[e].policy.name,e),!a[e].deprecationMessage&&a[e].markdownDeprecationMessage&&(a[e].deprecationMessage=a[e].markdownDeprecationMessage),s.add(e)):(this.excludedConfigurationProperties[e]=a[e],delete a[e]))}const l=e.allOf;if(l)for(const e of l)this.validateAndRegisterProperties(e,t,i,n,o,s)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=e=>{const i=e.properties;if(i)for(const e in i)this.updateSchema(e,i[e]);const n=e.allOf;null==n||n.forEach(t)};t(e)}updateSchema(e,t){switch(cge.properties[e]=t,t.scope){case 1:uge.properties[e]=t;break;case 2:gge.properties[e]=t;break;case 6:pge.properties[e]=t;break;case 3:mge.properties[e]=t;break;case 4:fge.properties[e]=t;break;case 5:fge.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:Toe(0,"Configure editor settings to be overridden for a language."),errorMessage:Toe(0,"This setting does not support per-language configuration."),$ref:_ge};this.updatePropertyDefaultValue(t,i),cge.properties[t]=i,uge.properties[t]=i,gge.properties[t]=i,pge.properties[t]=i,mge.properties[t]=i,fge.properties[t]=i}}registerOverridePropertyPatternKey(){const e={type:"object",description:Toe(0,"Configure editor settings to be overridden for a language."),errorMessage:Toe(0,"This setting does not support per-language configuration."),$ref:_ge};cge.patternProperties[Cge]=e,uge.patternProperties[Cge]=e,gge.patternProperties[Cge]=e,pge.patternProperties[Cge]=e,mge.patternProperties[Cge]=e,fge.patternProperties[Cge]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e);let n=null==i?void 0:i.value,o=null==i?void 0:i.source;Yse(n)&&(n=t.defaultDefaultValue,o=void 0),Yse(n)&&(n=function(e){switch(Array.isArray(e)?e[0]:e){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}(t.type)),t.default=n,t.defaultValueSource=o}};function Lge(e,t){var i,n,o,s;return e.trim()?yge.test(e)?Toe(0,"Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",e):void 0!==kge.getConfigurationProperties()[e]?Toe(0,"Cannot register '{0}'. This property is already registered.",e):(null===(i=t.policy)||void 0===i?void 0:i.name)&&void 0!==kge.getPolicyConfigurations().get(null===(n=t.policy)||void 0===n?void 0:n.name)?Toe(0,"Cannot register '{0}'. The associated policy {1} is already registered with {2}.",e,null===(o=t.policy)||void 0===o?void 0:o.name,kge.getPolicyConfigurations().get(null===(s=t.policy)||void 0===s?void 0:s.name)):null:Toe(0,"Cannot register an empty property")}rge.add(dge,kge);const xge=new class{constructor(){this._onDidChangeLanguages=new bae,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t<i;t++)if(this._languages[t]===e)return void this._languages.splice(t,1)}}}getLanguages(){return this._languages}};rge.add("editor.modesRegistry",xge);const Dge="plaintext";xge.registerLanguage({id:Dge,extensions:[".txt"],aliases:[Toe(0,"Plain Text"),"text"],mimetypes:[age.text]}),rge.as(dge).registerDefaultConfigurations([{overrides:{"[plaintext]":{"editor.unicodeHighlight.ambiguousCharacters":!1,"editor.unicodeHighlight.invisibleCharacters":!1}}}]);class Ege{constructor(e,t){let i;this.languageId=e,i=t.colorizedBracketPairs?Nge(t.colorizedBracketPairs.map((e=>[e[0],e[1]]))):t.brackets?Nge(t.brackets.map((e=>[e[0],e[1]])).filter((e=>!("<"===e[0]&&">"===e[1])))):[];const n=new Khe((e=>{const t=new Set;return{info:new Mge(this,e,t),closing:t}})),o=new Khe((e=>{const t=new Set;return{info:new Tge(this,e,t),opening:t}}));for(const[e,t]of i){const i=n.get(e),s=o.get(t);i.closing.add(s.info),s.opening.add(i.info)}this._openingBrackets=new Map([...n.cachedValues].map((([e,t])=>[e,t.info]))),this._closingBrackets=new Map([...o.cachedValues].map((([e,t])=>[e,t.info])))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}}function Nge(e){return e.filter((([e,t])=>""!==e&&""!==t))}class Ige{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class Mge extends Ige{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class Tge extends Ige{constructor(e,t,i){super(e,t),this.closedBrackets=i,this.isOpeningBracket=!1}closes(e){if(e.languageId===this.languageId&&e.config!==this.config)throw new Yre("Brackets from different language configuration cannot be used.");return this.closedBrackets.has(e)}getClosedBrackets(){return[...this.closedBrackets]}}var Age=function(e,t){return function(i,n){t(i,n,e)}};class Rge{constructor(e){this.languageId=e}affects(e){return!this.languageId||this.languageId===e}}const Oge=pce("languageConfigurationService");let Pge=class extends aae{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new jge),this.onDidChangeEmitter=this._register(new bae),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(Fge));this._register(this.configurationService.onDidChangeConfiguration((e=>{const t=e.change.keys.some((e=>i.has(e))),n=e.change.overrides.filter((([e,t])=>t.some((e=>i.has(e))))).map((([e])=>e));if(t)this.configurations.clear(),this.onDidChangeEmitter.fire(new Rge(void 0));else for(const e of n)this.languageService.isRegisteredLanguageId(e)&&(this.configurations.delete(e),this.onDidChangeEmitter.fire(new Rge(e)))}))),this._register(this._registry.onDidChange((e=>{this.configurations.delete(e.languageId),this.onDidChangeEmitter.fire(new Rge(e.languageId))})))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=function(e,t,i,n){let o=t.getLanguageConfiguration(e);if(!o){if(!n.isRegisteredLanguageId(e))return new qge(e,{});o=new qge(e,{})}const s=function(e,t){const i=t.getValue(Fge.brackets,{overrideIdentifier:e}),n=t.getValue(Fge.colorizedBracketPairs,{overrideIdentifier:e});return{brackets:Bge(i),colorizedBracketPairs:Bge(n)}}(o.languageId,i),r=Hge([o.underlyingConfig,s]);return new qge(o.languageId,r)}(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};Pge=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Age(0,Zue),Age(1,tge)],Pge);const Fge={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function Bge(e){if(Array.isArray(e))return e.map((e=>{if(Array.isArray(e)&&2===e.length)return[e[0],e[1]]})).filter((e=>!!e))}function Wge(e,t,i){let n=tde(e.getLineContent(t));return n.length>i-1&&(n=n.substring(0,i-1)),n}function Vge(e,t,i){return e.tokenization.forceTokenization(t),_ue(e.tokenization.getLineTokens(t),void 0===i?e.getLineMaxColumn(t)-1:i-1)}class zge{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new Uge(e,t,++this._order);return this._entries.push(i),this._resolved=null,sae((()=>{for(let e=0;e<this._entries.length;e++)if(this._entries[e]===i){this._entries.splice(e,1),this._resolved=null;break}}))}getResolvedConfiguration(){if(!this._resolved){const e=this._resolve();e&&(this._resolved=new qge(this.languageId,e))}return this._resolved}_resolve(){return 0===this._entries.length?null:(this._entries.sort(Uge.cmp),Hge(this._entries.map((e=>e.configuration))))}}function Hge(e){let t={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const i of e)t={comments:i.comments||t.comments,brackets:i.brackets||t.brackets,wordPattern:i.wordPattern||t.wordPattern,indentationRules:i.indentationRules||t.indentationRules,onEnterRules:i.onEnterRules||t.onEnterRules,autoClosingPairs:i.autoClosingPairs||t.autoClosingPairs,surroundingPairs:i.surroundingPairs||t.surroundingPairs,autoCloseBefore:i.autoCloseBefore||t.autoCloseBefore,folding:i.folding||t.folding,colorizedBracketPairs:i.colorizedBracketPairs||t.colorizedBracketPairs,__electricCharacterSupport:i.__electricCharacterSupport||t.__electricCharacterSupport};return t}class Uge{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class Kge{constructor(e){this.languageId=e}}class jge extends aae{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new bae),this.onDidChange=this._onDidChange.event,this._register(this.register(Dge,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let n=this._entries.get(e);n||(n=new zge(e),this._entries.set(e,n));const o=n.register(t,i);return this._onDidChange.fire(new Kge(e)),sae((()=>{o.dispose(),this._onDidChange.fire(new Kge(e))}))}getLanguageConfiguration(e){const t=this._entries.get(e);return(null==t?void 0:t.getResolvedConfiguration())||null}}class qge{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new Gue(this.underlyingConfig):null,this.comments=qge._handleComments(this.underlyingConfig),this.characterPair=new wue(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||Sse,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new $ue(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new Ege(e,this.underlyingConfig)}getWordDefinition(){return kse(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new Fue(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new jue(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}getAutoClosingPairs(){return new mue(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){const[e,n]=t.blockComment;i.blockCommentStartToken=e,i.blockCommentEndToken=n}return i}}oge(Oge,Pge,1);const $ge=new class{clone(){return this}equals(e){return this===e}};function Gge(e,t){return new Qle([new Yle(0,"",e)],t)}function Zge(e,t){const i=new Uint32Array(2);return i[0]=0,i[1]=(32768|e<<0|2<<24)>>>0,new Xle(i,null===t?$ge:t)}const Yge=pce("modelService"),Qge=Symbol("MicrotaskDelay");var Xge=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))},Jge=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=e[i]&&function(t){return new Promise((function(n,o){!function(e,t,i,n){Promise.resolve(n).then((function(t){e({value:t,done:i})}),t)}(n,o,(t=e[i](t)).done,t.value)}))}}};function epe(e){return!!e&&"function"==typeof e.then}function tpe(e){const t=new Mae,i=e(t.token),n=new Promise(((e,n)=>{const o=t.token.onCancellationRequested((()=>{o.dispose(),t.dispose(),n(new qre)}));Promise.resolve(i).then((i=>{o.dispose(),t.dispose(),e(i)}),(e=>{o.dispose(),t.dispose(),n(e)}))}));return new class{cancel(){t.cancel()}then(e,t){return n.then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return n.finally(e)}}}class ipe{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const e=()=>{this.queuedPromise=null;const e=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,e};this.queuedPromise=new Promise((t=>{this.activePromise.then(e,e).then(t)}))}return new Promise(((e,t)=>{this.queuedPromise.then(e,t)}))}return this.activePromise=e(),new Promise(((e,t)=>{this.activePromise.then((t=>{this.activePromise=null,e(t)}),(e=>{this.activePromise=null,t(e)}))}))}}class npe{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise(((e,t)=>{this.doResolve=e,this.doReject=t})).then((()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const e=this.task;return this.task=null,e()}})));const i=()=>{var e;this.deferred=null,null===(e=this.doResolve)||void 0===e||e.call(this,null)};return this.deferred=t===Qge?(e=>{let t=!0;return queueMicrotask((()=>{t&&(t=!1,e())})),{isTriggered:()=>t,dispose:()=>{t=!1}}})(i):((e,t)=>{let i=!0;const n=setTimeout((()=>{i=!1,t()}),e);return{isTriggered:()=>i,dispose:()=>{clearTimeout(n),i=!1}}})(t,i),this.completionPromise}isTriggered(){var e;return!!(null===(e=this.deferred)||void 0===e?void 0:e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&(null===(e=this.doReject)||void 0===e||e.call(this,new qre),this.completionPromise=null)}cancelTimeout(){var e;null===(e=this.deferred)||void 0===e||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class ope{constructor(e){this.delayer=new npe(e),this.throttler=new ipe}trigger(e,t){return this.delayer.trigger((()=>this.throttler.queue(e)),t)}dispose(){this.delayer.dispose()}}function spe(e,t){return t?new Promise(((i,n)=>{const o=setTimeout((()=>{s.dispose(),i()}),e),s=t.onCancellationRequested((()=>{clearTimeout(o),s.dispose(),n(new qre)}))})):tpe((t=>spe(e,t)))}function rpe(e,t=0){const i=setTimeout(e,t);return sae((()=>clearTimeout(i)))}class ape{constructor(e,t){this._token=-1,"function"==typeof e&&"number"==typeof t&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){-1!==this._token&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout((()=>{this._token=-1,e()}),t)}setIfNotSet(e,t){-1===this._token&&(this._token=setTimeout((()=>{this._token=-1,e()}),t))}}class lpe{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){-1!==this._token&&(clearInterval(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setInterval((()=>{e()}),t)}}class hpe{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return-1!==this.timeoutToken}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;null===(e=this.runner)||void 0===e||e.call(this)}}let dpe;dpe="function"!=typeof requestIdleCallback||"function"!=typeof cancelIdleCallback?e=>{dse((()=>{if(t)return;const i=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining:()=>Math.max(0,i-Date.now())}))}));let t=!1;return{dispose(){t||(t=!0)}}}:(e,t)=>{const i=requestIdleCallback(e,"number"==typeof t?{timeout:t}:void 0);let n=!1;return{dispose(){n||(n=!0,cancelIdleCallback(i))}}};class cpe{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(e){this._error=e}finally{this._didRun=!0}},this._handle=dpe((()=>this._executor()))}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}class upe{get isRejected(){return this.rejected}get isSettled(){return this.rejected||this.resolved}constructor(){this.rejected=!1,this.resolved=!1,this.p=new Promise(((e,t)=>{this.completeCallback=e,this.errorCallback=t}))}complete(e){return new Promise((t=>{this.completeCallback(e),this.resolved=!0,t()}))}cancel(){new Promise((e=>{this.errorCallback(new qre),this.rejected=!0,e()}))}}var gpe;!function(e){e.settled=function(e){return Xge(this,void 0,void 0,(function*(){let t;const i=yield Promise.all(e.map((e=>e.then((e=>e),(e=>{t||(t=e)})))));if(void 0!==t)throw t;return i}))},e.withAsyncBody=function(e){return new Promise(((t,i)=>Xge(this,void 0,void 0,(function*(){try{yield e(t,i)}catch(e){i(e)}}))))}}(gpe||(gpe={}));class ppe{static fromArray(e){return new ppe((t=>{t.emitMany(e)}))}static fromPromise(e){return new ppe((t=>Xge(this,void 0,void 0,(function*(){t.emitMany(yield e)}))))}static fromPromises(e){return new ppe((t=>Xge(this,void 0,void 0,(function*(){yield Promise.all(e.map((e=>Xge(this,void 0,void 0,(function*(){return t.emitOne(yield e)})))))}))))}static merge(e){return new ppe((t=>Xge(this,void 0,void 0,(function*(){yield Promise.all(e.map((e=>{var i,n,o;return Xge(this,void 0,void 0,(function*(){var s,r,a,l;try{for(i=!0,n=Jge(e);!(s=(o=yield n.next()).done);){l=o.value,i=!1;try{const e=l;t.emitOne(e)}finally{i=!0}}}catch(e){r={error:e}}finally{try{i||s||!(a=n.return)||(yield a.call(n))}finally{if(r)throw r.error}}}))})))}))))}constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new bae,queueMicrotask((()=>Xge(this,void 0,void 0,(function*(){const t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{yield Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}}))))}[Symbol.asyncIterator](){let e=0;return{next:()=>Xge(this,void 0,void 0,(function*(){for(;;){if(2===this._state)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(1===this._state)return{done:!0,value:void 0};yield pae.toPromise(this._onStateChanged.event)}}))}}static map(e,t){return new ppe((i=>Xge(this,void 0,void 0,(function*(){var n,o,s,r;try{for(var a,l=!0,h=Jge(e);!(n=(a=yield h.next()).done);){r=a.value,l=!1;try{const e=r;i.emitOne(t(e))}finally{l=!0}}}catch(e){o={error:e}}finally{try{l||n||!(s=h.return)||(yield s.call(h))}finally{if(o)throw o.error}}}))))}map(e){return ppe.map(this,e)}static filter(e,t){return new ppe((i=>Xge(this,void 0,void 0,(function*(){var n,o,s,r;try{for(var a,l=!0,h=Jge(e);!(n=(a=yield h.next()).done);){r=a.value,l=!1;try{const e=r;t(e)&&i.emitOne(e)}finally{l=!0}}}catch(e){o={error:e}}finally{try{l||n||!(s=h.return)||(yield s.call(h))}finally{if(o)throw o.error}}}))))}filter(e){return ppe.filter(this,e)}static coalesce(e){return ppe.filter(e,(e=>!!e))}coalesce(){return ppe.coalesce(this)}static toPromise(e){var t,i,n,o,s,r,a;return Xge(this,void 0,void 0,(function*(){const l=[];try{for(t=!0,i=Jge(e);n=yield i.next(),!(o=n.done);){a=n.value,t=!1;try{const e=a;l.push(e)}finally{t=!0}}}catch(e){s={error:e}}finally{try{t||o||!(r=i.return)||(yield r.call(i))}finally{if(s)throw s.error}}return l}))}toPromise(){return ppe.toPromise(this)}emitOne(e){0===this._state&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){0===this._state&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){0===this._state&&(this._state=1,this._onStateChanged.fire())}reject(e){0===this._state&&(this._state=2,this._error=e,this._onStateChanged.fire())}}ppe.EMPTY=ppe.fromArray([]);let mpe=!1;function fpe(e){ose&&(mpe||(mpe=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(e.message))}class _pe{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.method=i,this.args=n,this.type=0}}class vpe{constructor(e,t,i,n){this.vsWorker=e,this.seq=t,this.res=i,this.err=n,this.type=1}}class bpe{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=n,this.type=2}}class wpe{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class Cpe{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class ype{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){const i=String(++this._lastSentReq);return new Promise(((n,o)=>{this._pendingReplies[i]={resolve:n,reject:o},this._send(new _pe(this._workerId,i,e,t))}))}listen(e,t){let i=null;const n=new bae({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,n),this._send(new bpe(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new Cpe(this._workerId,i)),i=null}});return n.event}handleMessage(e){e&&e.vsWorker&&(-1!==this._workerId&&e.vsWorker!==this._workerId||this._handleMessage(e))}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq])return void console.warn("Got reply to unknown seq");const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;return e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),void t.reject(i)}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then((e=>{this._send(new vpe(this._workerId,t,e,void 0))}),(e=>{e.detail instanceof Error&&(e.detail=Ure(e.detail)),this._send(new vpe(this._workerId,t,void 0,Ure(e)))}))}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)((e=>{this._send(new wpe(this._workerId,t,e))}));this._pendingEvents.set(t,i)}_handleEventMessage(e){this._pendingEmitters.has(e.req)?this._pendingEmitters.get(e.req).fire(e.event):console.warn("Got event for unknown req")}_handleUnsubscribeEventMessage(e){this._pendingEvents.has(e.req)?(this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)):console.warn("Got unsubscribe for unknown req")}_send(e){const t=[];if(0===e.type)for(let i=0;i<e.args.length;i++)e.args[i]instanceof ArrayBuffer&&t.push(e.args[i]);else 1===e.type&&e.res instanceof ArrayBuffer&&t.push(e.res);this._handler.sendMessage(e,t)}}class Spe extends aae{constructor(e,t,i){super();let n=null;this._worker=this._register(e.create("vs/base/common/worker/simpleWorker",(e=>{this._protocol.handleMessage(e)}),(e=>{null==n||n(e)}))),this._protocol=new ype({sendMessage:(e,t)=>{this._worker.postMessage(e,t)},handleMessage:(e,t)=>{if("function"!=typeof i[e])return Promise.reject(new Error("Missing method "+e+" on main thread host."));try{return Promise.resolve(i[e].apply(i,t))}catch(e){return Promise.reject(e)}},handleEvent:(e,t)=>{if(Lpe(e)){const n=i[e].call(i,t);if("function"!=typeof n)throw new Error(`Missing dynamic event ${e} on main thread host.`);return n}if(kpe(e)){const t=i[e];if("function"!=typeof t)throw new Error(`Missing event ${e} on main thread host.`);return t}throw new Error(`Malformed event name ${e}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;void 0!==Zoe.require&&"function"==typeof Zoe.require.getConfig?o=Zoe.require.getConfig():void 0!==Zoe.requirejs&&(o=Zoe.requirejs.s.contexts._.config);const s=hre(i);this._onModuleLoaded=this._protocol.sendMessage("$initialize",[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,s]);const r=(e,t)=>this._request(e,t),a=(e,t)=>this._protocol.listen(e,t);this._lazyProxy=new Promise(((e,i)=>{n=i,this._onModuleLoaded.then((t=>{e(function(e,t,i){const n=e=>function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)},o=e=>function(t){return i(e,t)},s={};for(const t of e)Lpe(t)?s[t]=o(t):kpe(t)?s[t]=i(t,void 0):s[t]=n(t);return s}(t,r,a))}),(e=>{i(e),this._onError("Worker failed to load "+t,e)}))}))}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise(((i,n)=>{this._onModuleLoaded.then((()=>{this._protocol.sendMessage(e,t).then(i,n)}),n)}))}_onError(e,t){console.error(e),console.info(t)}}function kpe(e){return"o"===e[0]&&"n"===e[1]&&hde(e.charCodeAt(2))}function Lpe(e){return/^onDynamic/.test(e)&&hde(e.charCodeAt(9))}var xpe;const Dpe=null===(xpe=window.trustedTypes)||void 0===xpe?void 0:xpe.createPolicy("defaultWorkerFactory",{createScriptURL:e=>e});class Epe{constructor(e,t,i,n,o){this.id=t;const s=function(e){if(Zoe.MonacoEnvironment){if("function"==typeof Zoe.MonacoEnvironment.getWorker)return Zoe.MonacoEnvironment.getWorker("workerMain.js",e);if("function"==typeof Zoe.MonacoEnvironment.getWorkerUrl){const t=Zoe.MonacoEnvironment.getWorkerUrl("workerMain.js",e);return new Worker(Dpe?Dpe.createScriptURL(t):t,{name:e})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}(i);"function"==typeof s.then?this.worker=s:this.worker=Promise.resolve(s),this.postMessage(e,[]),this.worker.then((e=>{e.onmessage=function(e){n(e.data)},e.onmessageerror=o,"function"==typeof e.addEventListener&&e.addEventListener("error",o)}))}getId(){return this.id}postMessage(e,t){var i;null===(i=this.worker)||void 0===i||i.then((i=>i.postMessage(e,t)))}dispose(){var e;null===(e=this.worker)||void 0===e||e.then((e=>e.terminate())),this.worker=null}}class Npe{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const n=++Npe.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new Epe(e,n,this._label||"anonymous"+n,t,(e=>{fpe(e),this._webWorkerFailedBeforeError=e,i(e)}))}}Npe.LAST_WORKER_ID=0;class Ipe{constructor(e,t,i,n){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=n}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}function Mpe(e,t){switch(typeof e){case"object":return null===e?Tpe(349,t):Array.isArray(e)?(i=e,n=Tpe(104579,n=t),i.reduce(((e,t)=>Mpe(t,e)),n)):function(e,t){return t=Tpe(181387,t),Object.keys(e).sort().reduce(((t,i)=>(t=Ape(i,t),Mpe(e[i],t))),t)}(e,t);case"string":return Ape(e,t);case"boolean":return function(e,t){return Tpe(e?433:863,t)}(e,t);case"number":return Tpe(e,t);case"undefined":return Tpe(937,t);default:return Tpe(617,t)}var i,n}function Tpe(e,t){return(t<<5)-t+e|0}function Ape(e,t){t=Tpe(149417,t);for(let i=0,n=e.length;i<n;i++)t=Tpe(e.charCodeAt(i),t);return t}function Rpe(e,t,i=32){const n=i-t;return(e<<t|(~((1<<n)-1)&e)>>>n)>>>0}function Ope(e,t=0,i=e.byteLength,n=0){for(let o=0;o<i;o++)e[t+o]=n}function Ppe(e,t=32){return e instanceof ArrayBuffer?Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join(""):function(e,t,i="0"){for(;e.length<t;)e=i+e;return e}((e>>>0).toString(16),t/4)}class Fpe{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(0===t)return;const i=this._buff;let n,o,s=this._buffLen,r=this._leftoverHighSurrogate;for(0!==r?(n=r,o=-1,r=0):(n=e.charCodeAt(0),o=0);;){let a=n;if(pde(n)){if(!(o+1<t)){r=n;break}{const t=e.charCodeAt(o+1);mde(t)?(o++,a=fde(n,t)):a=65533}}else mde(n)&&(a=65533);if(s=this._push(i,s,a),o++,!(o<t))break;n=e.charCodeAt(o)}this._buffLen=s,this._leftoverHighSurrogate=r}_push(e,t,i){return i<128?e[t++]=i:i<2048?(e[t++]=192|(1984&i)>>>6,e[t++]=128|(63&i)>>>0):i<65536?(e[t++]=224|(61440&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0):(e[t++]=240|(1835008&i)>>>18,e[t++]=128|(258048&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Ppe(this._h0)+Ppe(this._h1)+Ppe(this._h2)+Ppe(this._h3)+Ppe(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,Ope(this._buff,this._buffLen),this._buffLen>56&&(this._step(),Ope(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=Fpe._bigBlock32,t=this._buffDV;for(let i=0;i<64;i+=4)e.setUint32(i,t.getUint32(i,!1),!1);for(let t=64;t<320;t+=4)e.setUint32(t,Rpe(e.getUint32(t-12,!1)^e.getUint32(t-32,!1)^e.getUint32(t-56,!1)^e.getUint32(t-64,!1),1),!1);let i,n,o,s=this._h0,r=this._h1,a=this._h2,l=this._h3,h=this._h4;for(let t=0;t<80;t++)t<20?(i=r&a|~r&l,n=1518500249):t<40?(i=r^a^l,n=1859775393):t<60?(i=r&a|r&l|a&l,n=2400959708):(i=r^a^l,n=3395469782),o=Rpe(s,5)+i+h+n+e.getUint32(4*t,!1)&4294967295,h=l,l=a,a=Rpe(r,30),r=s,s=o;this._h0=this._h0+s&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+l&4294967295,this._h4=this._h4+h&4294967295}}Fpe._bigBlock32=new DataView(new ArrayBuffer(320));class Bpe{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,n=e.length;i<n;i++)t[i]=e.charCodeAt(i);return t}}function Wpe(e,t,i){return new Upe(new Bpe(e),new Bpe(t)).ComputeDiff(i).changes}class Vpe{static Assert(e,t){if(!e)throw new Error(t)}}class zpe{static Copy(e,t,i,n,o){for(let s=0;s<o;s++)i[n+s]=e[t+s]}static Copy2(e,t,i,n,o){for(let s=0;s<o;s++)i[n+s]=e[t+s]}}class Hpe{constructor(){this.m_changes=[],this.m_originalStart=1073741824,this.m_modifiedStart=1073741824,this.m_originalCount=0,this.m_modifiedCount=0}MarkNextChange(){(this.m_originalCount>0||this.m_modifiedCount>0)&&this.m_changes.push(new Ipe(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class Upe{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[n,o,s]=Upe._getElements(e),[r,a,l]=Upe._getElements(t);this._hasStrings=s&&l,this._originalStringElements=n,this._originalElementsOrHash=o,this._modifiedStringElements=r,this._modifiedElementsOrHash=a,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&"string"==typeof e[0]}static _getElements(e){const t=e.getElements();if(Upe._isStringArray(t)){const e=new Int32Array(t.length);for(let i=0,n=t.length;i<n;i++)e[i]=Ape(t[i],0);return[t,e,!0]}return t instanceof Int32Array?[[],t,!1]:[[],new Int32Array(t),!1]}ElementsAreEqual(e,t){return this._originalElementsOrHash[e]===this._modifiedElementsOrHash[t]&&(!this._hasStrings||this._originalStringElements[e]===this._modifiedStringElements[t])}ElementsAreStrictEqual(e,t){return!!this.ElementsAreEqual(e,t)&&Upe._getStrictElement(this._originalSequence,e)===Upe._getStrictElement(this._modifiedSequence,t)}static _getStrictElement(e,t){return"function"==typeof e.getStrictElement?e.getStrictElement(t):null}OriginalElementsAreEqual(e,t){return this._originalElementsOrHash[e]===this._originalElementsOrHash[t]&&(!this._hasStrings||this._originalStringElements[e]===this._originalStringElements[t])}ModifiedElementsAreEqual(e,t){return this._modifiedElementsOrHash[e]===this._modifiedElementsOrHash[t]&&(!this._hasStrings||this._modifiedStringElements[e]===this._modifiedStringElements[t])}ComputeDiff(e){return this._ComputeDiff(0,this._originalElementsOrHash.length-1,0,this._modifiedElementsOrHash.length-1,e)}_ComputeDiff(e,t,i,n,o){const s=[!1];let r=this.ComputeDiffRecursive(e,t,i,n,s);return o&&(r=this.PrettifyChanges(r)),{quitEarly:s[0],changes:r}}ComputeDiffRecursive(e,t,i,n,o){for(o[0]=!1;e<=t&&i<=n&&this.ElementsAreEqual(e,i);)e++,i++;for(;t>=e&&n>=i&&this.ElementsAreEqual(t,n);)t--,n--;if(e>t||i>n){let o;return i<=n?(Vpe.Assert(e===t+1,"originalStart should only be one more than originalEnd"),o=[new Ipe(e,0,i,n-i+1)]):e<=t?(Vpe.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),o=[new Ipe(e,t-e+1,i,0)]):(Vpe.Assert(e===t+1,"originalStart should only be one more than originalEnd"),Vpe.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),o=[]),o}const s=[0],r=[0],a=this.ComputeRecursionPoint(e,t,i,n,s,r,o),l=s[0],h=r[0];if(null!==a)return a;if(!o[0]){const s=this.ComputeDiffRecursive(e,l,i,h,o);let r=[];return r=o[0]?[new Ipe(l+1,t-(l+1)+1,h+1,n-(h+1)+1)]:this.ComputeDiffRecursive(l+1,t,h+1,n,o),this.ConcatenateChanges(s,r)}return[new Ipe(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,o,s,r,a,l,h,d,c,u,g,p,m,f,_){let v=null,b=null,w=new Hpe,C=t,y=i,S=u[0]-m[0]-n,k=-1073741824,L=this.m_forwardHistory.length-1;do{const t=S+e;t===C||t<y&&l[t-1]<l[t+1]?(g=(d=l[t+1])-S-n,d<k&&w.MarkNextChange(),k=d,w.AddModifiedElement(d+1,g),S=t+1-e):(g=(d=l[t-1]+1)-S-n,d<k&&w.MarkNextChange(),k=d-1,w.AddOriginalElement(d,g+1),S=t-1-e),L>=0&&(e=(l=this.m_forwardHistory[L])[0],C=1,y=l.length-1)}while(--L>=-1);if(v=w.getReverseChanges(),_[0]){let e=u[0]+1,t=m[0]+1;if(null!==v&&v.length>0){const i=v[v.length-1];e=Math.max(e,i.getOriginalEnd()),t=Math.max(t,i.getModifiedEnd())}b=[new Ipe(e,c-e+1,t,p-t+1)]}else{w=new Hpe,C=s,y=r,S=u[0]-m[0]-a,k=1073741824,L=f?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const e=S+o;e===C||e<y&&h[e-1]>=h[e+1]?(g=(d=h[e+1]-1)-S-a,d>k&&w.MarkNextChange(),k=d+1,w.AddOriginalElement(d+1,g+1),S=e+1-o):(g=(d=h[e-1])-S-a,d>k&&w.MarkNextChange(),k=d,w.AddModifiedElement(d+1,g+1),S=e-1-o),L>=0&&(o=(h=this.m_reverseHistory[L])[0],C=1,y=h.length-1)}while(--L>=-1);b=w.getChanges()}return this.ConcatenateChanges(v,b)}ComputeRecursionPoint(e,t,i,n,o,s,r){let a=0,l=0,h=0,d=0,c=0,u=0;e--,i--,o[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(n-i),p=g+1,m=new Int32Array(p),f=new Int32Array(p),_=n-i,v=t-e,b=e-i,w=t-n,C=(v-_)%2==0;m[_]=e,f[v]=t,r[0]=!1;for(let y=1;y<=g/2+1;y++){let g=0,S=0;h=this.ClipDiagonalBound(_-y,y,_,p),d=this.ClipDiagonalBound(_+y,y,_,p);for(let e=h;e<=d;e+=2){a=e===h||e<d&&m[e-1]<m[e+1]?m[e+1]:m[e-1]+1,l=a-(e-_)-b;const i=a;for(;a<t&&l<n&&this.ElementsAreEqual(a+1,l+1);)a++,l++;if(m[e]=a,a+l>g+S&&(g=a,S=l),!C&&Math.abs(e-v)<=y-1&&a>=f[e])return o[0]=a,s[0]=l,i<=f[e]&&y<=1448?this.WALKTRACE(_,h,d,b,v,c,u,w,m,f,a,t,o,l,n,s,C,r):null}const k=(g-e+(S-i)-y)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(g,k))return r[0]=!0,o[0]=g,s[0]=S,k>0&&y<=1448?this.WALKTRACE(_,h,d,b,v,c,u,w,m,f,a,t,o,l,n,s,C,r):(e++,i++,[new Ipe(e,t-e+1,i,n-i+1)]);c=this.ClipDiagonalBound(v-y,y,v,p),u=this.ClipDiagonalBound(v+y,y,v,p);for(let g=c;g<=u;g+=2){a=g===c||g<u&&f[g-1]>=f[g+1]?f[g+1]-1:f[g-1],l=a-(g-v)-w;const p=a;for(;a>e&&l>i&&this.ElementsAreEqual(a,l);)a--,l--;if(f[g]=a,C&&Math.abs(g-_)<=y&&a<=m[g])return o[0]=a,s[0]=l,p>=m[g]&&y<=1448?this.WALKTRACE(_,h,d,b,v,c,u,w,m,f,a,t,o,l,n,s,C,r):null}if(y<=1447){let e=new Int32Array(d-h+2);e[0]=_-h+1,zpe.Copy2(m,h,e,1,d-h+1),this.m_forwardHistory.push(e),e=new Int32Array(u-c+2),e[0]=v-c+1,zpe.Copy2(f,c,e,1,u-c+1),this.m_reverseHistory.push(e)}}return this.WALKTRACE(_,h,d,b,v,c,u,w,m,f,a,t,o,l,n,s,C,r)}PrettifyChanges(e){for(let t=0;t<e.length;t++){const i=e[t],n=t<e.length-1?e[t+1].originalStart:this._originalElementsOrHash.length,o=t<e.length-1?e[t+1].modifiedStart:this._modifiedElementsOrHash.length,s=i.originalLength>0,r=i.modifiedLength>0;for(;i.originalStart+i.originalLength<n&&i.modifiedStart+i.modifiedLength<o&&(!s||this.OriginalElementsAreEqual(i.originalStart,i.originalStart+i.originalLength))&&(!r||this.ModifiedElementsAreEqual(i.modifiedStart,i.modifiedStart+i.modifiedLength));){const e=this.ElementsAreStrictEqual(i.originalStart,i.modifiedStart);if(this.ElementsAreStrictEqual(i.originalStart+i.originalLength,i.modifiedStart+i.modifiedLength)&&!e)break;i.originalStart++,i.modifiedStart++}const a=[null];t<e.length-1&&this.ChangesOverlap(e[t],e[t+1],a)&&(e[t]=a[0],e.splice(t+1,1),t--)}for(let t=e.length-1;t>=0;t--){const i=e[t];let n=0,o=0;if(t>0){const i=e[t-1];n=i.originalStart+i.originalLength,o=i.modifiedStart+i.modifiedLength}const s=i.originalLength>0,r=i.modifiedLength>0;let a=0,l=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let e=1;;e++){const t=i.originalStart-e,h=i.modifiedStart-e;if(t<n||h<o)break;if(s&&!this.OriginalElementsAreEqual(t,t+i.originalLength))break;if(r&&!this.ModifiedElementsAreEqual(h,h+i.modifiedLength))break;const d=(t===n&&h===o?5:0)+this._boundaryScore(t,i.originalLength,h,i.modifiedLength);d>l&&(l=d,a=e)}i.originalStart-=a,i.modifiedStart-=a;const h=[null];t>0&&this.ChangesOverlap(e[t-1],e[t],h)&&(e[t-1]=h[0],e.splice(t,1),t++)}if(this._hasStrings)for(let t=1,i=e.length;t<i;t++){const i=e[t-1],n=e[t],o=n.originalStart-i.originalStart-i.originalLength,s=i.originalStart,r=n.originalStart+n.originalLength,a=r-s,l=i.modifiedStart,h=n.modifiedStart+n.modifiedLength,d=h-l;if(o<5&&a<20&&d<20){const e=this._findBetterContiguousSequence(s,a,l,d,o);if(e){const[t,s]=e;t===i.originalStart+i.originalLength&&s===i.modifiedStart+i.modifiedLength||(i.originalLength=t-i.originalStart,i.modifiedLength=s-i.modifiedStart,n.originalStart=t+o,n.modifiedStart=s+o,n.originalLength=r-n.originalStart,n.modifiedLength=h-n.modifiedStart)}}}return e}_findBetterContiguousSequence(e,t,i,n,o){if(t<o||n<o)return null;const s=e+t-o+1,r=i+n-o+1;let a=0,l=0,h=0;for(let t=e;t<s;t++)for(let e=i;e<r;e++){const i=this._contiguousSequenceScore(t,e,o);i>0&&i>a&&(a=i,l=t,h=e)}return a>0?[l,h]:null}_contiguousSequenceScore(e,t,i){let n=0;for(let o=0;o<i;o++){if(!this.ElementsAreEqual(e+o,t+o))return 0;n+=this._originalStringElements[e+o].length}return n}_OriginalIsBoundary(e){return e<=0||e>=this._originalElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,n){return(this._OriginalRegionIsBoundary(e,t)?1:0)+(this._ModifiedRegionIsBoundary(i,n)?1:0)}ConcatenateChanges(e,t){const i=[];if(0===e.length||0===t.length)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const n=new Array(e.length+t.length-1);return zpe.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],zpe.Copy(t,1,n,e.length,t.length-1),n}{const i=new Array(e.length+t.length);return zpe.Copy(e,0,i,0,e.length),zpe.Copy(t,0,i,e.length,t.length),i}}ChangesOverlap(e,t,i){if(Vpe.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),Vpe.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const n=e.originalStart;let o=e.originalLength;const s=e.modifiedStart;let r=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(r=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new Ipe(n,o,s,r),!0}return i[0]=null,!1}ClipDiagonalBound(e,t,i,n){if(e>=0&&e<n)return e;const o=t%2==0;return e<0?o===(i%2==0)?0:1:o===((n-i-1)%2==0)?n-1:n-2}}function Kpe(e){return e<0?0:e>255?255:0|e}function jpe(e){return e<0?0:e>4294967295?4294967295:0|e}class qpe{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=jpe(e);const i=this.values,n=this.prefixSum,o=t.length;return 0!==o&&(this.values=new Uint32Array(i.length+o),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+o),this.values.set(t,e),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSum=new Uint32Array(this.values.length),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=jpe(e),t=jpe(t),this.values[e]!==t&&(this.values[e]=t,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,t){e=jpe(e),t=jpe(t);const i=this.values,n=this.prefixSum;if(e>=i.length)return!1;const o=i.length-e;return t>=o&&(t=o),0!==t&&(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return 0===this.values.length?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=jpe(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;0===t&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,n=0,o=0,s=0;for(;t<=i;)if(n=t+(i-t)/2|0,o=this.prefixSum[n],s=o-this.values[n],e<s)i=n-1;else{if(!(e>=o))break;t=n+1}return new Gpe(n,e-s)}}class $pe{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),0===e?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new Gpe(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=Rse(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e<t;e++){const t=this._values[e],i=e>0?this._prefixSum[e-1]:0;this._prefixSum[e]=i+t;for(let n=0;n<t;n++)this._indexBySum[i+n]=e}this._prefixSum.length=this._values.length,this._indexBySum.length=this._prefixSum[this._prefixSum.length-1],this._isValid=!0,this._validEndIndex=this._values.length-1}}setValue(e,t){this._values[e]!==t&&(this._values[e]=t,this._invalidate(e))}}class Gpe{constructor(e,t){this.index=e,this.remainder=t,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=t}}class Zpe{constructor(e,t,i,n){this._uri=e,this._lines=t,this._eol=i,this._versionId=n,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}get version(){return this._versionId}getText(){return null===this._cachedTextValue&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(e){e.eol&&e.eol!==this._eol&&(this._eol=e.eol,this._lineStarts=null);const t=e.changes;for(const e of t)this._acceptDeleteRange(e.range),this._acceptInsertText(new Rle(e.range.startLineNumber,e.range.startColumn),e.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){const e=this._eol.length,t=this._lines.length,i=new Uint32Array(t);for(let n=0;n<t;n++)i[n]=this._lines[n].length+e;this._lineStarts=new qpe(i)}}_setLineText(e,t){this._lines[e]=t,this._lineStarts&&this._lineStarts.setValue(e,this._lines[e].length+this._eol.length)}_acceptDeleteRange(e){if(e.startLineNumber!==e.endLineNumber)this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.endLineNumber-1].substring(e.endColumn-1)),this._lines.splice(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineStarts&&this._lineStarts.removeValues(e.startLineNumber,e.endLineNumber-e.startLineNumber);else{if(e.startColumn===e.endColumn)return;this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.startLineNumber-1].substring(e.endColumn-1))}}_acceptInsertText(e,t){if(0===t.length)return;const i=Jhe(t);if(1===i.length)return void this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+i[0]+this._lines[e.lineNumber-1].substring(e.column-1));i[i.length-1]+=this._lines[e.lineNumber-1].substring(e.column-1),this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+i[0]);const n=new Uint32Array(i.length-1);for(let t=1;t<i.length;t++)this._lines.splice(e.lineNumber+t-1,0,i[t]),n[t-1]=i[t].length+this._eol.length;this._lineStarts&&this._lineStarts.insertValues(e.lineNumber,n)}}class Ype{constructor(e){const t=Kpe(e);this._defaultValue=t,this._asciiMap=Ype._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){const t=new Uint8Array(256);return t.fill(e),t}set(e,t){const i=Kpe(t);e>=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}class Qpe{constructor(e,t,i){const n=new Uint8Array(e*t);for(let o=0,s=e*t;o<s;o++)n[o]=i;this._data=n,this.rows=e,this.cols=t}get(e,t){return this._data[e*this.cols+t]}set(e,t,i){this._data[e*this.cols+t]=i}}class Xpe{constructor(e){let t=0,i=0;for(let n=0,o=e.length;n<o;n++){const[o,s,r]=e[n];s>t&&(t=s),o>i&&(i=o),r>i&&(i=r)}t++,i++;const n=new Qpe(i,t,0);for(let t=0,i=e.length;t<i;t++){const[i,o,s]=e[t];n.set(i,o,s)}this._states=n,this._maxCharCode=t}nextState(e,t){return t<0||t>=this._maxCharCode?0:this._states.get(e,t)}}let Jpe=null,eme=null;class tme{static _createLink(e,t,i,n,o){let s=o-1;do{const i=t.charCodeAt(s);if(2!==e.get(i))break;s--}while(s>n);if(n>0){const e=t.charCodeAt(n-1),i=t.charCodeAt(s);(40===e&&41===i||91===e&&93===i||123===e&&125===i)&&s--}return{range:{startLineNumber:i,startColumn:n+1,endLineNumber:i,endColumn:s+2},url:t.substring(n,s+1)}}static computeLinks(e,t=function(){return null===Jpe&&(Jpe=new Xpe([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),Jpe}()){const i=function(){if(null===eme){eme=new Ype(0);const e=", \t<>'\"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…";for(let t=0;t<e.length;t++)eme.set(e.charCodeAt(t),1);const t=".;:";for(let e=0;e<t.length;e++)eme.set(t.charCodeAt(e),2)}return eme}(),n=[];for(let o=1,s=e.getLineCount();o<=s;o++){const s=e.getLineContent(o),r=s.length;let a=0,l=0,h=0,d=1,c=!1,u=!1,g=!1,p=!1;for(;a<r;){let e=!1;const r=s.charCodeAt(a);if(13===d){let t;switch(r){case 40:c=!0,t=0;break;case 41:t=c?0:1;break;case 91:g=!0,u=!0,t=0;break;case 93:g=!1,t=u?0:1;break;case 123:p=!0,t=0;break;case 125:t=p?0:1;break;case 39:case 34:case 96:t=h===r?1:39===h||34===h||96===h?0:1;break;case 42:t=42===h?1:0;break;case 124:t=124===h?1:0;break;case 32:t=g?0:1;break;default:t=i.get(r)}1===t&&(n.push(tme._createLink(i,s,o,l,a)),e=!0)}else if(12===d){let t;91===r?(u=!0,t=0):t=i.get(r),1===t?e=!0:d=13}else d=t.nextState(d,r),0===d&&(e=!0);e&&(d=1,c=!1,u=!1,p=!1,l=a+1,h=r),a++}13===d&&n.push(tme._createLink(i,s,o,l,r))}return n}}class ime{constructor(){this._defaultValueSet=[["true","false"],["True","False"],["Private","Public","Friend","ReadOnly","Partial","Protected","WriteOnly"],["public","protected","private"]]}navigateValueSet(e,t,i,n,o){if(e&&t){const i=this.doNavigateValueSet(t,o);if(i)return{range:e,value:i}}if(i&&n){const e=this.doNavigateValueSet(n,o);if(e)return{range:i,value:e}}return null}doNavigateValueSet(e,t){const i=this.numberReplace(e,t);return null!==i?i:this.textReplace(e,t)}numberReplace(e,t){const i=Math.pow(10,e.length-(e.lastIndexOf(".")+1));let n=Number(e);const o=parseFloat(e);return isNaN(n)||isNaN(o)||n!==o?null:0!==n||t?(n=Math.floor(n*i),n+=t?i:-i,String(n/i)):null}textReplace(e,t){return this.valueSetsReplace(this._defaultValueSet,e,t)}valueSetsReplace(e,t,i){let n=null;for(let o=0,s=e.length;null===n&&o<s;o++)n=this.valueSetReplace(e[o],t,i);return n}valueSetReplace(e,t,i){let n=e.indexOf(t);return n>=0?(n+=i?1:-1,n<0?n=e.length-1:n%=e.length,e[n]):null}}ime.INSTANCE=new ime;class nme extends Ype{constructor(e){super(0);for(let t=0,i=e.length;t<i;t++)this.set(e.charCodeAt(t),2);this.set(32,1),this.set(9,1)}}const ome=function(e){const t={};return e=>(t.hasOwnProperty(e)||(t[e]=(e=>new nme(e))(e)),t[e])}();class sme{constructor(e,t,i,n){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=n}parseSearchRequest(){if(""===this.searchString)return null;let e;e=this.isRegex?function(e){if(!e||0===e.length)return!1;for(let t=0,i=e.length;t<i;t++){const n=e.charCodeAt(t);if(10===n)return!0;if(92===n){if(t++,t>=i)break;const n=e.charCodeAt(t);if(110===n||114===n||87===n)return!0}}return!1}(this.searchString):this.searchString.indexOf("\n")>=0;let t=null;try{t=Qhe(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch(e){return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new cue(t,this.wordSeparators?ome(this.wordSeparators):null,i?this.searchString:null)}}function rme(e,t,i){if(!i)return new hue(e,null);const n=[];for(let e=0,i=t.length;e<i;e++)n[e]=t[e];return new hue(e,n)}class ame{constructor(e){const t=[];let i=0;for(let n=0,o=e.length;n<o;n++)10===e.charCodeAt(n)&&(t[i++]=n);this._lineFeedsOffsets=t}findLineFeedCountBeforeOffset(e){const t=this._lineFeedsOffsets;let i=0,n=t.length-1;if(-1===n)return 0;if(e<=t[0])return 0;for(;i<n;){const o=i+((n-i)/2>>0);t[o]>=e?n=o-1:t[o+1]>=e?(i=o,n=o):i=o+1}return i+1}}class lme{static findMatches(e,t,i,n,o){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,i,new dme(s.wordSeparators,s.regex),n,o):this._doFindMatchesLineByLine(e,i,s,n,o):[]}static _getMultilineMatchRange(e,t,i,n,o,s){let r,a,l=0;if(n?(l=n.findLineFeedCountBeforeOffset(o),r=t+o+l):r=t+o,n){const e=n.findLineFeedCountBeforeOffset(o+s.length)-l;a=r+s.length+e}else a=r+s.length;const h=e.getPositionAt(r),d=e.getPositionAt(a);return new Ole(h.lineNumber,h.column,d.lineNumber,d.column)}static _doFindMatchesMultiline(e,t,i,n,o){const s=e.getOffsetAt(t.getStartPosition()),r=e.getValueInRange(t,1),a="\r\n"===e.getEOL()?new ame(r):null,l=[];let h,d=0;for(i.reset(0);h=i.next(r);)if(l[d++]=rme(this._getMultilineMatchRange(e,s,r,a,h.index,h[0]),h,n),d>=o)return l;return l}static _doFindMatchesLineByLine(e,t,i,n,o){const s=[];let r=0;if(t.startLineNumber===t.endLineNumber){const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return r=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,r,s,n,o),s}const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);r=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,r,s,n,o);for(let a=t.startLineNumber+1;a<t.endLineNumber&&r<o;a++)r=this._findMatchesInLine(i,e.getLineContent(a),a,0,r,s,n,o);if(r<o){const a=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);r=this._findMatchesInLine(i,a,t.endLineNumber,0,r,s,n,o)}return s}static _findMatchesInLine(e,t,i,n,o,s,r,a){const l=e.wordSeparators;if(!r&&e.simpleSearch){const r=e.simpleSearch,h=r.length,d=t.length;let c=-h;for(;-1!==(c=t.indexOf(r,c+h));)if((!l||hme(l,t,d,c,h))&&(s[o++]=new hue(new Ole(i,c+1+n,i,c+1+h+n),null),o>=a))return o;return o}const h=new dme(e.wordSeparators,e.regex);let d;h.reset(0);do{if(d=h.next(t),d&&(s[o++]=rme(new Ole(i,d.index+1+n,i,d.index+1+d[0].length+n),d,r),o>=a))return o}while(d);return o}static findNextMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const s=new dme(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,s,n):this._doFindNextMatchLineByLine(e,i,s,n)}static _doFindNextMatchMultiline(e,t,i,n){const o=new Rle(t.lineNumber,1),s=e.getOffsetAt(o),r=e.getLineCount(),a=e.getValueInRange(new Ole(o.lineNumber,o.column,r,e.getLineMaxColumn(r)),1),l="\r\n"===e.getEOL()?new ame(a):null;i.reset(t.column-1);const h=i.next(a);return h?rme(this._getMultilineMatchRange(e,s,a,l,h.index,h[0]),h,n):1!==t.lineNumber||1!==t.column?this._doFindNextMatchMultiline(e,new Rle(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const o=e.getLineCount(),s=t.lineNumber,r=e.getLineContent(s),a=this._findFirstMatchInLine(i,r,s,t.column,n);if(a)return a;for(let t=1;t<=o;t++){const r=(s+t-1)%o,a=e.getLineContent(r+1),l=this._findFirstMatchInLine(i,a,r+1,1,n);if(l)return l}return null}static _findFirstMatchInLine(e,t,i,n,o){e.reset(n-1);const s=e.next(t);return s?rme(new Ole(i,s.index+1,i,s.index+1+s[0].length),s,o):null}static findPreviousMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const s=new dme(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,s,n):this._doFindPreviousMatchLineByLine(e,i,s,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const o=this._doFindMatchesMultiline(e,new Ole(1,1,t.lineNumber,t.column),i,n,9990);if(o.length>0)return o[o.length-1];const s=e.getLineCount();return t.lineNumber!==s||t.column!==e.getLineMaxColumn(s)?this._doFindPreviousMatchMultiline(e,new Rle(s,e.getLineMaxColumn(s)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const o=e.getLineCount(),s=t.lineNumber,r=e.getLineContent(s).substring(0,t.column-1),a=this._findLastMatchInLine(i,r,s,n);if(a)return a;for(let t=1;t<=o;t++){const r=(o+s-t-1)%o,a=e.getLineContent(r+1),l=this._findLastMatchInLine(i,a,r+1,n);if(l)return l}return null}static _findLastMatchInLine(e,t,i,n){let o,s=null;for(e.reset(0);o=e.next(t);)s=rme(new Ole(i,o.index+1,i,o.index+1+o[0].length),o,n);return s}}function hme(e,t,i,n,o){return function(e,t,i,n,o){if(0===n)return!0;const s=t.charCodeAt(n-1);if(0!==e.get(s))return!0;if(13===s||10===s)return!0;if(o>0){const i=t.charCodeAt(n);if(0!==e.get(i))return!0}return!1}(e,t,0,n,o)&&function(e,t,i,n,o){if(n+o===i)return!0;const s=t.charCodeAt(n+o);if(0!==e.get(s))return!0;if(13===s||10===s)return!0;if(o>0){const i=t.charCodeAt(n+o-1);if(0!==e.get(i))return!0}return!1}(e,t,i,n,o)}class dme{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t)return null;if(i=this._searchRegex.exec(e),!i)return null;const n=i.index,o=i[0].length;if(n===this._prevMatchStartIndex&&o===this._prevMatchLength){if(0===o){_de(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=o,!this._wordSeparators||hme(this._wordSeparators,e,t,n,o))return i}while(i);return null}}class cme{static computeUnicodeHighlights(e,t,i){const n=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),s=new ume(t),r=s.getCandidateCodePoints();let a;a="allNonBasicAscii"===r?new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):new RegExp(`[${Zhe(Array.from(r).map((e=>String.fromCodePoint(e))).join(""))}]`,"g");const l=new dme(null,a),h=[];let d,c=!1,u=0,g=0,p=0;e:for(let t=n,i=o;t<=i;t++){const i=e.getLineContent(t),n=i.length;l.reset(0);do{if(d=l.next(i),d){let e=d.index,o=d.index+d[0].length;e>0&&pde(i.charCodeAt(e-1))&&e--,o+1<n&&pde(i.charCodeAt(o-1))&&o++;const r=i.substring(e,o);let a=xse(e+1,Sse,i,0);a&&a.endColumn<=e+1&&(a=null);const l=s.shouldHighlightNonBasicASCII(r,a?a.word:null);if(0!==l){3===l?u++:2===l?g++:1===l?p++:_ce();const i=1e3;if(h.length>=i){c=!0;break e}h.push(new Ole(t,e+1,t,o+1))}}}while(d)}return{ranges:h,hasMore:c,ambiguousCharacterCount:u,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const i=new ume(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const n=e.codePointAt(0),o=i.ambiguousCharacters.getPrimaryConfusable(n),s=Pde.getLocales().filter((e=>!Pde.getInstance(new Set([...t.allowedLocales,e])).isAmbiguous(n)));return{kind:0,confusableWith:String.fromCodePoint(o),notAmbiguousInLocales:s}}case 1:return{kind:2}}}}class ume{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=Pde.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of Fde.codePoints)gme(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return 0;if(this.options.nonBasicASCII)return 1;let n=!1,o=!1;if(t)for(const e of t){const t=e.codePointAt(0),i=Lde(e);n=n||i,i||this.ambiguousCharacters.isAmbiguous(t)||Fde.isInvisibleCharacter(t)||(o=!0)}return!n&&o?0:this.options.invisibleCharacters&&!gme(e)&&Fde.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function gme(e){return" "===e||"\n"===e||"\t"===e}class pme{constructor(e,t,i){this.originalRange=e,this.modifiedRange=t,this.innerChanges=i}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}}class mme{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}}class fme{constructor(e,t){this.startLineNumber=e,this.endLineNumberExclusive=t}get isEmpty(){return this.startLineNumber===this.endLineNumberExclusive}delta(e){return new fme(this.startLineNumber+e,this.endLineNumberExclusive+e)}get length(){return this.endLineNumberExclusive-this.startLineNumber}join(e){return new fme(Math.min(this.startLineNumber,e.startLineNumber),Math.max(this.endLineNumberExclusive,e.endLineNumberExclusive))}toString(){return`[${this.startLineNumber},${this.endLineNumberExclusive})`}}function _me(e,t,i,n){return new Upe(e,t,i).ComputeDiff(n)}class vme{constructor(e){const t=[],i=[];for(let n=0,o=e.length;n<o;n++)t[n]=Sme(e[n],1),i[n]=kme(e[n],1);this.lines=e,this._startColumns=t,this._endColumns=i}getElements(){const e=[];for(let t=0,i=this.lines.length;t<i;t++)e[t]=this.lines[t].substring(this._startColumns[t]-1,this._endColumns[t]-1);return e}getStrictElement(e){return this.lines[e]}getStartLineNumber(e){return e+1}getEndLineNumber(e){return e+1}createCharSequence(e,t,i){const n=[],o=[],s=[];let r=0;for(let a=t;a<=i;a++){const t=this.lines[a],l=e?this._startColumns[a]:1,h=e?this._endColumns[a]:t.length+1;for(let e=l;e<h;e++)n[r]=t.charCodeAt(e-1),o[r]=a+1,s[r]=e,r++;!e&&a<i&&(n[r]=10,o[r]=a+1,s[r]=t.length+1,r++)}return new bme(n,o,s)}}class bme{constructor(e,t,i){this._charCodes=e,this._lineNumbers=t,this._columns=i}toString(){return"["+this._charCodes.map(((e,t)=>(10===e?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`)).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return-1===e?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),10===this._charCodes[e]?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return-1===e?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),10===this._charCodes[e]?1:this._columns[e]+1)}}class wme{constructor(e,t,i,n,o,s,r,a){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=n,this.modifiedStartLineNumber=o,this.modifiedStartColumn=s,this.modifiedEndLineNumber=r,this.modifiedEndColumn=a}static createFromDiffChange(e,t,i){const n=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),s=t.getEndLineNumber(e.originalStart+e.originalLength-1),r=t.getEndColumn(e.originalStart+e.originalLength-1),a=i.getStartLineNumber(e.modifiedStart),l=i.getStartColumn(e.modifiedStart),h=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),d=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new wme(n,o,s,r,a,l,h,d)}}class Cme{constructor(e,t,i,n,o){this.originalStartLineNumber=e,this.originalEndLineNumber=t,this.modifiedStartLineNumber=i,this.modifiedEndLineNumber=n,this.charChanges=o}static createFromDiffResult(e,t,i,n,o,s,r){let a,l,h,d,c;if(0===t.originalLength?(a=i.getStartLineNumber(t.originalStart)-1,l=0):(a=i.getStartLineNumber(t.originalStart),l=i.getEndLineNumber(t.originalStart+t.originalLength-1)),0===t.modifiedLength?(h=n.getStartLineNumber(t.modifiedStart)-1,d=0):(h=n.getStartLineNumber(t.modifiedStart),d=n.getEndLineNumber(t.modifiedStart+t.modifiedLength-1)),s&&t.originalLength>0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const s=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),a=n.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(s.getElements().length>0&&a.getElements().length>0){let e=_me(s,a,o,!0).changes;r&&(e=function(e){if(e.length<=1)return e;const t=[e[0]];let i=t[0];for(let n=1,o=e.length;n<o;n++){const o=e[n],s=o.originalStart-(i.originalStart+i.originalLength),r=o.modifiedStart-(i.modifiedStart+i.modifiedLength);Math.min(s,r)<3?(i.originalLength=o.originalStart+o.originalLength-i.originalStart,i.modifiedLength=o.modifiedStart+o.modifiedLength-i.modifiedStart):(t.push(o),i=o)}return t}(e)),c=[];for(let t=0,i=e.length;t<i;t++)c.push(wme.createFromDiffChange(e[t],s,a))}}return new Cme(a,l,h,d,c)}}class yme{constructor(e,t,i){this.shouldComputeCharChanges=i.shouldComputeCharChanges,this.shouldPostProcessCharChanges=i.shouldPostProcessCharChanges,this.shouldIgnoreTrimWhitespace=i.shouldIgnoreTrimWhitespace,this.shouldMakePrettyDiff=i.shouldMakePrettyDiff,this.originalLines=e,this.modifiedLines=t,this.original=new vme(e),this.modified=new vme(t),this.continueLineDiff=Lme(i.maxComputationTime),this.continueCharDiff=Lme(0===i.maxComputationTime?0:Math.min(i.maxComputationTime,5e3))}computeDiff(){if(1===this.original.lines.length&&0===this.original.lines[0].length)return 1===this.modified.lines.length&&0===this.modified.lines[0].length?{quitEarly:!1,changes:[]}:{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:1,modifiedStartLineNumber:1,modifiedEndLineNumber:this.modified.lines.length,charChanges:void 0}]};if(1===this.modified.lines.length&&0===this.modified.lines[0].length)return{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:this.original.lines.length,modifiedStartLineNumber:1,modifiedEndLineNumber:1,charChanges:void 0}]};const e=_me(this.original,this.modified,this.continueLineDiff,this.shouldMakePrettyDiff),t=e.changes,i=e.quitEarly;if(this.shouldIgnoreTrimWhitespace){const e=[];for(let i=0,n=t.length;i<n;i++)e.push(Cme.createFromDiffResult(this.shouldIgnoreTrimWhitespace,t[i],this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges));return{quitEarly:i,changes:e}}const n=[];let o=0,s=0;for(let e=-1,i=t.length;e<i;e++){const r=e+1<i?t[e+1]:null,a=r?r.originalStart:this.originalLines.length,l=r?r.modifiedStart:this.modifiedLines.length;for(;o<a&&s<l;){const e=this.originalLines[o],t=this.modifiedLines[s];if(e!==t){{let i=Sme(e,1),r=Sme(t,1);for(;i>1&&r>1&&e.charCodeAt(i-2)===t.charCodeAt(r-2);)i--,r--;(i>1||r>1)&&this._pushTrimWhitespaceCharChange(n,o+1,1,i,s+1,1,r)}{let i=kme(e,1),r=kme(t,1);const a=e.length+1,l=t.length+1;for(;i<a&&r<l&&e.charCodeAt(i-1)===e.charCodeAt(r-1);)i++,r++;(i<a||r<l)&&this._pushTrimWhitespaceCharChange(n,o+1,i,a,s+1,r,l)}}o++,s++}r&&(n.push(Cme.createFromDiffResult(this.shouldIgnoreTrimWhitespace,r,this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges)),o+=r.originalLength,s+=r.modifiedLength)}return{quitEarly:i,changes:n}}_pushTrimWhitespaceCharChange(e,t,i,n,o,s,r){if(this._mergeTrimWhitespaceCharChange(e,t,i,n,o,s,r))return;let a;this.shouldComputeCharChanges&&(a=[new wme(t,i,t,n,o,s,o,r)]),e.push(new Cme(t,t,o,o,a))}_mergeTrimWhitespaceCharChange(e,t,i,n,o,s,r){const a=e.length;if(0===a)return!1;const l=e[a-1];return 0!==l.originalEndLineNumber&&0!==l.modifiedEndLineNumber&&(l.originalEndLineNumber===t&&l.modifiedEndLineNumber===o?(this.shouldComputeCharChanges&&l.charChanges&&l.charChanges.push(new wme(t,i,t,n,o,s,o,r)),!0):l.originalEndLineNumber+1===t&&l.modifiedEndLineNumber+1===o&&(l.originalEndLineNumber=t,l.modifiedEndLineNumber=o,this.shouldComputeCharChanges&&l.charChanges&&l.charChanges.push(new wme(t,i,t,n,o,s,o,r)),!0))}}function Sme(e,t){const i=ede(e);return-1===i?t:i+1}function kme(e,t){const i=ide(e);return-1===i?t:i+2}function Lme(e){if(0===e)return()=>!0;const t=Date.now();return()=>Date.now()-t<e}class xme{constructor(e,t){this.seq1Range=e,this.seq2Range=t}reverse(){return new xme(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}}class Dme{constructor(e,t){this.start=e,this.endExclusive=t}get isEmpty(){return this.start===this.endExclusive}delta(e){return new Dme(this.start+e,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}join(e){return new Dme(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}}class Eme{constructor(e,t){this.width=e,this.height=t,this.array=[],this.array=new Array(e*t)}get(e,t){return this.array[e+t*this.width]}set(e,t,i){this.array[e+t*this.width]=i}}class Nme{compute(e,t,i){const n=new Eme(e.length,t.length),o=new Eme(e.length,t.length),s=new Eme(e.length,t.length);for(let r=0;r<e.length;r++)for(let a=0;a<t.length;a++){const l=0===r?0:n.get(r-1,a),h=0===a?0:n.get(r,a-1);let d;e.getElement(r)===t.getElement(a)?(d=0===r||0===a?0:n.get(r-1,a-1),r>0&&a>0&&3===o.get(r-1,a-1)&&(d+=s.get(r-1,a-1)),d+=i?i(r,a):1):d=-1;const c=Math.max(l,h,d);if(c===d){const e=r>0&&a>0?s.get(r-1,a-1):0;s.set(r,a,e+1),o.set(r,a,3)}else c===l?(s.set(r,a,0),o.set(r,a,1)):c===h&&(s.set(r,a,0),o.set(r,a,2));n.set(r,a,c)}const r=[];let a=e.length,l=t.length;function h(e,t){e+1===a&&t+1===l||r.push(new xme(new Dme(e+1,a),new Dme(t+1,l))),a=e,l=t}let d=e.length-1,c=t.length-1;for(;d>=0&&c>=0;)3===o.get(d,c)?(h(d,c),d--,c--):1===o.get(d,c)?d--:c--;return h(-1,-1),r.reverse(),r}}function Ime(e,t,i){let n=i;return n=function(e,t,i){const n=[];i.length>0&&n.push(i[0]);for(let e=1;e<i.length;e++){const o=n[n.length-1],s=i[e];if(s.seq1Range.isEmpty){let e=!0;const i=s.seq1Range.start-o.seq1Range.endExclusive;for(let n=1;n<=i;n++)if(t.getElement(s.seq2Range.start-n)!==t.getElement(s.seq2Range.endExclusive-n)){e=!1;break}if(e){n[n.length-1]=new xme(o.seq1Range,new Dme(o.seq2Range.start,s.seq2Range.endExclusive-i));continue}}n.push(s)}return n}(0,t,n),n=function(e,t,i){if(!e.getBoundaryScore||!t.getBoundaryScore)return i;for(let n=0;n<i.length;n++){const o=i[n];if(o.seq1Range.isEmpty){const s=n>0?i[n-1].seq2Range.endExclusive:-1,r=n+1<i.length?i[n+1].seq2Range.start:t.length;i[n]=Mme(o,e,t,r,s)}else if(o.seq2Range.isEmpty){const s=n>0?i[n-1].seq1Range.endExclusive:-1,r=n+1<i.length?i[n+1].seq1Range.start:e.length;i[n]=Mme(o.reverse(),t,e,r,s).reverse()}}return i}(e,t,n),n}function Mme(e,t,i,n,o){let s=1;for(;e.seq2Range.start-s>o&&i.getElement(e.seq2Range.start-s)===i.getElement(e.seq2Range.endExclusive-s)&&s<20;)s++;s--;let r=0;for(;e.seq2Range.start+r<n&&i.getElement(e.seq2Range.start+r)===i.getElement(e.seq2Range.endExclusive+r)&&r<20;)r++;if(0===s&&0===r)return e;let a=0,l=-1;for(let n=-s;n<=r;n++){const o=e.seq2Range.start+n,s=e.seq2Range.endExclusive+n,r=e.seq1Range.start+n,h=t.getBoundaryScore(r)+i.getBoundaryScore(o)+i.getBoundaryScore(s);h>l&&(l=h,a=n)}return 0!==a?new xme(e.seq1Range.delta(a),e.seq2Range.delta(a)):e}class Tme{compute(e,t){if(0===e.length)return[new xme(new Dme(0,0),new Dme(0,t.length))];if(0===t.length)return[new xme(new Dme(0,e.length),new Dme(0,0))];function i(i,n){for(;i<e.length&&n<t.length&&e.getElement(i)===t.getElement(n);)i++,n++;return i}let n=0;const o=new Rme;o.set(0,i(0,0));const s=new Ome;s.set(0,0===o.get(0)?null:new Ame(null,0,0,o.get(0)));let r=0;e:for(;;)for(n++,r=-n;r<=n;r+=2){const a=r===n?-1:o.get(r+1),l=r===-n?-1:o.get(r-1)+1,h=Math.min(Math.max(a,l),e.length),d=h-r,c=i(h,d);o.set(r,c);const u=h===a?s.get(r+1):s.get(r-1);if(s.set(r,c!==h?new Ame(u,h,d,c-h):u),o.get(r)===e.length&&o.get(r)-r===t.length)break e}let a=s.get(r);const l=[];let h=e.length,d=t.length;for(;;){const e=a?a.x+a.length:0,t=a?a.y+a.length:0;if(e===h&&t===d||l.push(new xme(new Dme(e,h),new Dme(t,d))),!a)break;h=a.x,d=a.y,a=a.prev}return l.reverse(),l}}class Ame{constructor(e,t,i,n){this.prev=e,this.x=t,this.y=i,this.length=n}}class Rme{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if((e=-e-1)>=this.negativeArr.length){const e=this.negativeArr;this.negativeArr=new Int32Array(2*e.length),this.negativeArr.set(e)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const e=this.positiveArr;this.positiveArr=new Int32Array(2*e.length),this.positiveArr.set(e)}this.positiveArr[e]=t}}}class Ome{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}class Pme{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){return 1e3-((0===e?0:Fme(this.lines[e-1]))+(e===this.lines.length?0:Fme(this.lines[e])))}}function Fme(e){let t=0;for(;t<e.length&&(32===e.charCodeAt(t)||9===e.charCodeAt(t));)t++;return t}class Bme{constructor(e,t){this.lines=e,this.lineRange=t;let i=0;this.firstCharOnLineOffsets=new Int32Array(t.length);for(let n=t.start;n<t.endExclusive;n++)i+=e[n].length,this.firstCharOnLineOffsets[n-t.start]=i+1,i++;this.elements=new Int32Array(i);let n=0;for(let i=t.start;i<t.endExclusive;i++){const t=e[i];for(let e=0;e<t.length;e++)this.elements[n+e]=t.charCodeAt(e);n+=t.length,i<e.length-1&&(this.elements[n]="\n".charCodeAt(0),n+=1)}}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=zme(e>0?this.elements[e-1]:-1),i=zme(e<this.elements.length?this.elements[e]:-1);if(6===t&&7===i)return 0;let n=0;return t!==i&&(n+=10,1===i&&(n+=1)),n+=Vme(t),n+=Vme(i),n}translateOffset(e){let t=0,i=this.firstCharOnLineOffsets.length;for(;t<i;){const n=Math.floor((t+i)/2);this.firstCharOnLineOffsets[n]>e?i=n:t=n+1}const n=0===t?0:this.firstCharOnLineOffsets[t-1];return new Rle(t+1,e-n+1)}translateRange(e){return Ole.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}}const Wme={0:0,1:0,2:0,3:10,4:2,5:3,6:10,7:10};function Vme(e){return Wme[e]}function zme(e){return 10===e?7:13===e?6:function(e){return 32===e||9===e}(e)?5:e>=97&&e<=122?0:e>=65&&e<=90?1:e>=48&&e<=57?2:-1===e?3:4}const Hme={smart:new class{computeDiff(e,t,i){var n;const o=new yme(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),s=[];let r=null;for(const e of o.changes){let t,i;t=0===e.originalEndLineNumber?new fme(e.originalStartLineNumber+1,e.originalStartLineNumber+1):new fme(e.originalStartLineNumber,e.originalEndLineNumber+1),i=0===e.modifiedEndLineNumber?new fme(e.modifiedStartLineNumber+1,e.modifiedStartLineNumber+1):new fme(e.modifiedStartLineNumber,e.modifiedEndLineNumber+1);let o=new pme(t,i,null===(n=e.charChanges)||void 0===n?void 0:n.map((e=>new mme(new Ole(e.originalStartLineNumber,e.originalStartColumn,e.originalEndLineNumber,e.originalEndColumn),new Ole(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn)))));r&&(r.modifiedRange.endLineNumberExclusive!==o.modifiedRange.startLineNumber&&r.originalRange.endLineNumberExclusive!==o.originalRange.startLineNumber||(o=new pme(r.originalRange.join(o.originalRange),r.modifiedRange.join(o.modifiedRange),r.innerChanges&&o.innerChanges?r.innerChanges.concat(o.innerChanges):void 0),s.pop())),s.push(o),r=o}return vce((()=>bce(s,((e,t)=>t.originalRange.startLineNumber-e.originalRange.endLineNumberExclusive==t.modifiedRange.startLineNumber-e.modifiedRange.endLineNumberExclusive&&e.originalRange.endLineNumberExclusive<t.originalRange.startLineNumber&&e.modifiedRange.endLineNumberExclusive<t.modifiedRange.startLineNumber)))),{quitEarly:o.quitEarly,changes:s}}},experimental:new class{constructor(){this.dynamicProgrammingDiffing=new Nme,this.myersDiffingAlgorithm=new Tme}computeDiff(e,t,i){const n=new Map;function o(e){let t=n.get(e);return void 0===t&&(t=n.size,n.set(e,t)),t}const s=e.map((e=>o(e.trim()))),r=t.map((e=>o(e.trim()))),a=new Pme(s,e),l=new Pme(r,t);let h=(()=>a.length+l.length<1500?this.dynamicProgrammingDiffing.compute(a,l,((i,n)=>e[i]===t[n]?0===t[n].length?.1:1+Math.log(1+t[n].length):.99)):this.myersDiffingAlgorithm.compute(a,l))();h=Ime(a,l,h);const d=[],c=i=>{for(let n=0;n<i;n++){const i=u+n,o=g+n;if(e[i]!==t[o]){const n=this.refineDiff(e,t,new xme(new Dme(i,i+1),new Dme(o,o+1)));for(const e of n)d.push(e)}}};let u=0,g=0;for(const i of h){vce((()=>i.seq1Range.start-u==i.seq2Range.start-g)),c(i.seq1Range.start-u),u=i.seq1Range.endExclusive,g=i.seq2Range.endExclusive;const n=this.refineDiff(e,t,i);for(const e of n)d.push(e)}c(e.length-u);const p=function(e){const t=[];for(const i of function*(e,t){let i,n;for(const t of e)void 0!==n&&(o=n,(s=t).originalRange.startLineNumber-(o.originalRange.endLineNumber-(o.originalRange.endColumn>1?0:1))<=1||s.modifiedRange.startLineNumber-(o.modifiedRange.endLineNumber-(o.modifiedRange.endColumn>1?0:1))<=1)?i.push(t):(i&&(yield i),i=[t]),n=t;var o,s;i&&(yield i)}(e)){const e=i[0],n=i[i.length-1];t.push(new pme(new fme(e.originalRange.startLineNumber,n.originalRange.endLineNumber+(n.originalRange.endColumn>1||n.modifiedRange.endColumn>1?1:0)),new fme(e.modifiedRange.startLineNumber,n.modifiedRange.endLineNumber+(n.originalRange.endColumn>1||n.modifiedRange.endColumn>1?1:0)),i))}return vce((()=>bce(t,((e,t)=>t.originalRange.startLineNumber-e.originalRange.endLineNumberExclusive==t.modifiedRange.startLineNumber-e.modifiedRange.endLineNumberExclusive&&e.originalRange.endLineNumberExclusive<t.originalRange.startLineNumber&&e.modifiedRange.endLineNumberExclusive<t.modifiedRange.startLineNumber)))),t}(d);return{quitEarly:!1,changes:p}}refineDiff(e,t,i){const n=new Bme(e,i.seq1Range),o=new Bme(t,i.seq2Range),s=n.length+o.length<500?this.dynamicProgrammingDiffing.compute(n,o):this.myersDiffingAlgorithm.compute(n,o);let r=Ime(n,o,s);return r=function(e,t,i){const n=[];for(const e of i){const t=n[n.length-1];t&&(e.seq1Range.start-t.seq1Range.endExclusive<=2||e.seq2Range.start-t.seq2Range.endExclusive<=2)?n[n.length-1]=new xme(t.seq1Range.join(e.seq1Range),t.seq2Range.join(e.seq2Range)):n.push(e)}return n}(0,0,r),r.map((e=>new mme(n.translateRange(e.seq1Range).delta(i.seq1Range.start),o.translateRange(e.seq2Range).delta(i.seq2Range.start))))}}};var Ume=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Kme extends Zpe{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}getLinesContent(){return this._lines.slice(0)}getLineCount(){return this._lines.length}getLineContent(e){return this._lines[e-1]}getWordAtPosition(e,t){const i=xse(e.column,kse(t),this._lines[e.lineNumber-1],0);return i?new Ole(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn):null}words(e){const t=this._lines,i=this._wordenize.bind(this);let n=0,o="",s=0,r=[];return{*[Symbol.iterator](){for(;;)if(s<r.length){const e=o.substring(r[s].start,r[s].end);s+=1,yield e}else{if(!(n<t.length))break;o=t[n],r=i(o,e),s=0,n+=1}}}}getLineWords(e,t){const i=this._lines[e-1],n=this._wordenize(i,t),o=[];for(const e of n)o.push({word:i.substring(e.start,e.end),startColumn:e.start+1,endColumn:e.end+1});return o}_wordenize(e,t){const i=[];let n;for(t.lastIndex=0;(n=t.exec(e))&&0!==n[0].length;)i.push({start:n.index,end:n.index+n[0].length});return i}getValueInRange(e){if((e=this._validateRange(e)).startLineNumber===e.endLineNumber)return this._lines[e.startLineNumber-1].substring(e.startColumn-1,e.endColumn-1);const t=this._eol,i=e.startLineNumber-1,n=e.endLineNumber-1,o=[];o.push(this._lines[i].substring(e.startColumn-1));for(let e=i+1;e<n;e++)o.push(this._lines[e]);return o.push(this._lines[n].substring(0,e.endColumn-1)),o.join(t)}offsetAt(e){return e=this._validatePosition(e),this._ensureLineStarts(),this._lineStarts.getPrefixSum(e.lineNumber-2)+(e.column-1)}positionAt(e){e=Math.floor(e),e=Math.max(0,e),this._ensureLineStarts();const t=this._lineStarts.getIndexOf(e),i=this._lines[t.index].length;return{lineNumber:1+t.index,column:1+Math.min(t.remainder,i)}}_validateRange(e){const t=this._validatePosition({lineNumber:e.startLineNumber,column:e.startColumn}),i=this._validatePosition({lineNumber:e.endLineNumber,column:e.endColumn});return t.lineNumber!==e.startLineNumber||t.column!==e.startColumn||i.lineNumber!==e.endLineNumber||i.column!==e.endColumn?{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:i.lineNumber,endColumn:i.column}:e}_validatePosition(e){if(!Rle.isIPosition(e))throw new Error("bad position");let{lineNumber:t,column:i}=e,n=!1;if(t<1)t=1,i=1,n=!0;else if(t>this._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,n=!0;else{const e=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>e&&(i=e,n=!0)}return n?{lineNumber:t,column:i}:e}}class jme{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){const e=[];return Object.keys(this._models).forEach((t=>e.push(this._models[t]))),e}acceptNewModel(e){this._models[e.url]=new Kme(Sle.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){this._models[e]&&this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}computeUnicodeHighlights(e,t,i){return Ume(this,void 0,void 0,(function*(){const n=this._getModel(e);return n?cme.computeUnicodeHighlights(n,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}))}computeDiff(e,t,i,n){return Ume(this,void 0,void 0,(function*(){const o=this._getModel(e),s=this._getModel(t);return o&&s?jme.computeDiff(o,s,i,n):null}))}static computeDiff(e,t,i,n){const o="experimental"===n?Hme.experimental:Hme.smart,s=e.getLinesContent(),r=t.getLinesContent(),a=o.computeDiff(s,r,i);return{identical:!(a.changes.length>0)&&this._modelsAreIdentical(e,t),quitEarly:a.quitEarly,changes:a.changes.map((e=>{var t;return[e.originalRange.startLineNumber,e.originalRange.endLineNumberExclusive,e.modifiedRange.startLineNumber,e.modifiedRange.endLineNumberExclusive,null===(t=e.innerChanges)||void 0===t?void 0:t.map((e=>[e.originalRange.startLineNumber,e.originalRange.startColumn,e.originalRange.endLineNumber,e.originalRange.endColumn,e.modifiedRange.startLineNumber,e.modifiedRange.startColumn,e.modifiedRange.endLineNumber,e.modifiedRange.endColumn]))]}))}}static _modelsAreIdentical(e,t){const i=e.getLineCount();if(i!==t.getLineCount())return!1;for(let n=1;n<=i;n++)if(e.getLineContent(n)!==t.getLineContent(n))return!1;return!0}computeMoreMinimalEdits(e,t){return Ume(this,void 0,void 0,(function*(){const i=this._getModel(e);if(!i)return t;const n=[];let o;t=t.slice(0).sort(((e,t)=>e.range&&t.range?Ole.compareRangesUsingStarts(e.range,t.range):(e.range?0:1)-(t.range?0:1)));for(let{range:e,text:s,eol:r}of t){if("number"==typeof r&&(o=r),Ole.isEmpty(e)&&!s)continue;const t=i.getValueInRange(e);if(s=s.replace(/\r\n|\n|\r/g,i.eol),t===s)continue;if(Math.max(s.length,t.length)>jme._diffLimit){n.push({range:e,text:s});continue}const a=Wpe(t,s,!1),l=i.offsetAt(Ole.lift(e).getStartPosition());for(const e of a){const t=i.positionAt(l+e.originalStart),o=i.positionAt(l+e.originalStart+e.originalLength),r={text:s.substr(e.modifiedStart,e.modifiedLength),range:{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:o.lineNumber,endColumn:o.column}};i.getValueInRange(r.range)!==r.text&&n.push(r)}}return"number"==typeof o&&n.push({eol:o,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),n}))}computeLinks(e){return Ume(this,void 0,void 0,(function*(){const t=this._getModel(e);return t?function(e){return e&&"function"==typeof e.getLineCount&&"function"==typeof e.getLineContent?tme.computeLinks(e):[]}(t):null}))}textualSuggest(e,t,i,n){return Ume(this,void 0,void 0,(function*(){const o=new gae(!0),s=new RegExp(i,n),r=new Set;e:for(const i of e){const e=this._getModel(i);if(e)for(const i of e.words(s))if(i!==t&&isNaN(Number(i))&&(r.add(i),r.size>jme._suggestionsLimit))break e}return{words:Array.from(r),duration:o.elapsed()}}))}computeWordRanges(e,t,i,n){return Ume(this,void 0,void 0,(function*(){const o=this._getModel(e);if(!o)return Object.create(null);const s=new RegExp(i,n),r=Object.create(null);for(let e=t.startLineNumber;e<t.endLineNumber;e++){const t=o.getLineWords(e,s);for(const i of t){if(!isNaN(Number(i.word)))continue;let t=r[i.word];t||(t=[],r[i.word]=t),t.push({startLineNumber:e,startColumn:i.startColumn,endLineNumber:e,endColumn:i.endColumn})}}return r}))}navigateValueSet(e,t,i,n,o){return Ume(this,void 0,void 0,(function*(){const s=this._getModel(e);if(!s)return null;const r=new RegExp(n,o);t.startColumn===t.endColumn&&(t={startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn+1});const a=s.getValueInRange(t),l=s.getWordAtPosition({lineNumber:t.startLineNumber,column:t.startColumn},r);if(!l)return null;const h=s.getValueInRange(l);return ime.INSTANCE.navigateValueSet(t,a,l,h,i)}))}loadForeignModule(e,t,i){const n=function(e,t){const i=e=>function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)},n={};for(const t of e)n[t]=i(t);return n}(i,((e,t)=>this._host.fhr(e,t))),o={host:n,getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(o,t),Promise.resolve(hre(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||"function"!=typeof this._foreignModule[e])return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(e){return Promise.reject(e)}}}jme._diffLimit=1e5,jme._suggestionsLimit=1e4,"function"==typeof importScripts&&(Zoe.monaco=Vhe());const qme=pce("textResourceConfigurationService"),$me=pce("textResourcePropertiesService"),Gme=pce("logService");var Zme;!function(e){e[e.Off=0]="Off",e[e.Trace=1]="Trace",e[e.Debug=2]="Debug",e[e.Info=3]="Info",e[e.Warning=4]="Warning",e[e.Error=5]="Error"}(Zme||(Zme={}));const Yme=Zme.Info;class Qme extends aae{constructor(){super(...arguments),this.level=Yme,this._onDidChangeLogLevel=this._register(new bae),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==Zme.Off&&this.level<=e}}class Xme extends Qme{constructor(e=Yme){super(),this.setLevel(e)}trace(e,...t){this.checkLogLevel(Zme.Trace)&&console.log("%cTRACE","color: #888",e,...t)}debug(e,...t){this.checkLogLevel(Zme.Debug)&&console.log("%cDEBUG","background: #eee; color: #888",e,...t)}info(e,...t){this.checkLogLevel(Zme.Info)&&console.log("%c INFO","color: #33f",e,...t)}error(e,...t){this.checkLogLevel(Zme.Error)&&console.log("%c ERR","color: #f33",e,...t)}dispose(){}}class Jme extends Qme{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const i of this.loggers)i.trace(e,...t)}debug(e,...t){for(const i of this.loggers)i.debug(e,...t)}info(e,...t){for(const i of this.loggers)i.info(e,...t)}error(e,...t){for(const i of this.loggers)i.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose()}}const efe=pce("ILanguageFeaturesService");var tfe=function(e,t){return function(i,n){t(i,n,e)}},ife=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function nfe(e,t){const i=e.getModel(t);return!!i&&!i.isTooLargeForSyncing()}let ofe=class extends aae{constructor(e,t,i,n,o){super(),this._modelService=e,this._workerManager=this._register(new rfe(this._modelService,n)),this._logService=i,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(e,t)=>nfe(this._modelService,e.uri)?this._workerManager.withWorker().then((t=>t.computeLinks(e.uri))).then((e=>e&&{links:e})):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new sfe(this._workerManager,t,this._modelService,n)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return nfe(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then((n=>n.computedUnicodeHighlights(e,t,i)))}computeDiff(e,t,i,n){return ife(this,void 0,void 0,(function*(){const o=yield this._workerManager.withWorker().then((o=>o.computeDiff(e,t,i,n)));if(!o)return null;const s={identical:o.identical,quitEarly:o.quitEarly,changes:o.changes.map((e=>{var t;return new pme(new fme(e[0],e[1]),new fme(e[2],e[3]),null===(t=e[4])||void 0===t?void 0:t.map((e=>new mme(new Ole(e[0],e[1],e[2],e[3]),new Ole(e[4],e[5],e[6],e[7])))))}))};return s}))}computeMoreMinimalEdits(e,t){if(Ise(t)){if(!nfe(this._modelService,e))return Promise.resolve(t);const i=gae.create(!0),n=this._workerManager.withWorker().then((i=>i.computeMoreMinimalEdits(e,t)));return n.finally((()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),i.elapsed()))),Promise.race([n,spe(1e3).then((()=>t))])}return Promise.resolve(void 0)}canNavigateValueSet(e){return nfe(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then((n=>n.navigateValueSet(e,t,i)))}canComputeWordRanges(e){return nfe(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then((i=>i.computeWordRanges(e,t)))}};ofe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([tfe(0,Yge),tfe(1,qme),tfe(2,Gme),tfe(3,Oge),tfe(4,efe)],ofe);class sfe{constructor(e,t,i,n){this.languageConfigurationService=n,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return ife(this,void 0,void 0,(function*(){const i=this._configurationService.getValue(e.uri,t,"editor");if(!i.wordBasedSuggestions)return;const n=[];if("currentDocument"===i.wordBasedSuggestionsMode)nfe(this._modelService,e.uri)&&n.push(e.uri);else for(const t of this._modelService.getModels())nfe(this._modelService,t.uri)&&(t===e?n.unshift(t.uri):"allDocuments"!==i.wordBasedSuggestionsMode&&t.getLanguageId()!==e.getLanguageId()||n.push(t.uri));if(0===n.length)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),s=e.getWordAtPosition(t),r=s?new Ole(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):Ole.fromPositions(t),a=r.setEndPosition(t.lineNumber,t.column),l=yield this._workerManager.withWorker(),h=yield l.textualSuggest(n,null==s?void 0:s.word,o);return h?{duration:h.duration,suggestions:h.words.map((e=>({kind:18,label:e,insertText:e,range:{insert:a,replace:r}})))}:void 0}))}}class rfe extends aae{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=(new Date).getTime(),this._register(new lpe).cancelAndSet((()=>this._checkStopIdleWorker()),Math.round(15e4)),this._register(this._modelService.onModelRemoved((e=>this._checkStopEmptyWorker())))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){this._editorWorkerClient&&0===this._modelService.getModels().length&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){this._editorWorkerClient&&(new Date).getTime()-this._lastWorkerUsedTime>3e5&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=(new Date).getTime(),this._editorWorkerClient||(this._editorWorkerClient=new dfe(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class afe extends aae{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const e=new lpe;e.cancelAndSet((()=>this._checkStopModelSync()),Math.round(3e4)),this._register(e)}}dispose(){for(const e in this._syncedModels)nae(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){const e=i.toString();this._syncedModels[e]||this._beginModelSync(i,t),this._syncedModels[e]&&(this._syncedModelsLastUsedTime[e]=(new Date).getTime())}}_checkStopModelSync(){const e=(new Date).getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>6e4&&t.push(i);for(const e of t)this._stopModelSync(e)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i)return;if(!t&&i.isTooLargeForSyncing())return;const n=e.toString();this._proxy.acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const o=new rae;o.add(i.onDidChangeContent((e=>{this._proxy.acceptModelChanged(n.toString(),e)}))),o.add(i.onWillDispose((()=>{this._stopModelSync(n)}))),o.add(sae((()=>{this._proxy.acceptRemovedModel(n)}))),this._syncedModels[n]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],nae(t)}}class lfe{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class hfe{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class dfe extends aae{constructor(e,t,i,n){super(),this.languageConfigurationService=n,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new Npe(i),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new Spe(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new hfe(this)))}catch(e){fpe(e),this._worker=new lfe(new jme(new hfe(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,(e=>(fpe(e),this._worker=new lfe(new jme(new hfe(this),null)),this._getOrCreateWorker().getProxyObject())))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new afe(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return ife(this,void 0,void 0,(function*(){return this._disposed?Promise.reject(function(){const e=new Error(Kre);return e.name=e.message,e}()):this._getProxy().then((i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i)))}))}computedUnicodeHighlights(e,t,i){return this._withSyncedResources([e]).then((n=>n.computeUnicodeHighlights(e.toString(),t,i)))}computeDiff(e,t,i,n){return this._withSyncedResources([e,t],!0).then((o=>o.computeDiff(e.toString(),t.toString(),i,n)))}computeMoreMinimalEdits(e,t){return this._withSyncedResources([e]).then((i=>i.computeMoreMinimalEdits(e.toString(),t)))}computeLinks(e){return this._withSyncedResources([e]).then((t=>t.computeLinks(e.toString())))}textualSuggest(e,t,i){return ife(this,void 0,void 0,(function*(){const n=yield this._withSyncedResources(e),o=i.source,s=Xhe(i);return n.textualSuggest(e.map((e=>e.toString())),t,o,s)}))}computeWordRanges(e,t){return this._withSyncedResources([e]).then((i=>{const n=this._modelService.getModel(e);if(!n)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId()).getWordDefinition(),s=o.source,r=Xhe(o);return i.computeWordRanges(e.toString(),t,s,r)}))}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then((n=>{const o=this._modelService.getModel(e);if(!o)return null;const s=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),r=s.source,a=Xhe(s);return n.navigateValueSet(e.toString(),t,i,r,a)}))}dispose(){super.dispose(),this._disposed=!0}}class cfe extends dfe{constructor(e,t,i){super(e,i.keepIdleModels||!1,i.label,t),this._foreignModuleId=i.moduleId,this._foreignModuleCreateData=i.createData||null,this._foreignModuleHost=i.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||"function"!=typeof this._foreignModuleHost[e])return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(e){return Promise.reject(e)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then((e=>{const t=this._foreignModuleHost?hre(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then((t=>{this._foreignModuleCreateData=null;const i=(t,i)=>e.fmr(t,i),n=(e,t)=>function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)},o={};for(const e of t)o[e]=n(e,i);return o}))}))),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then((e=>this.getProxy()))}}class ufe{static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(768&e)>>>8}static containsBalancedBrackets(e){return 0!=(1024&e)}static getFontStyle(e){return(30720&e)>>>11}static getForeground(e){return(16744448&e)>>>15}static getBackground(e){return(4278190080&e)>>>24}static getClassNameFromMetadata(e){let t="mtk"+this.getForeground(e);const i=this.getFontStyle(e);return 1&i&&(t+=" mtki"),2&i&&(t+=" mtkb"),4&i&&(t+=" mtku"),8&i&&(t+=" mtks"),t}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),n=this.getFontStyle(e);let o=`color: ${t[i]};`;1&n&&(o+="font-style: italic;"),2&n&&(o+="font-weight: bold;");let s="";return 4&n&&(s+=" underline"),8&n&&(s+=" line-through"),s&&(o+=`text-decoration:${s};`),o}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:Boolean(1&i),bold:Boolean(2&i),underline:Boolean(4&i),strikethrough:Boolean(8&i)}}}class gfe{static createEmpty(e,t){const i=gfe.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new gfe(n,e,t)}constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=i}equals(e){return e instanceof gfe&&this.slicedEquals(e,0,this._tokensCount)}slicedEquals(e,t,i){if(this._text!==e._text)return!1;if(this._tokensCount!==e._tokensCount)return!1;const n=t<<1,o=n+(i<<1);for(let t=n;t<o;t++)if(this._tokens[t]!==e._tokens[t])return!1;return!0}getLineContent(){return this._text}getCount(){return this._tokensCount}getStartOffset(e){return e>0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[1+(e<<1)]}getLanguageId(e){const t=this._tokens[1+(e<<1)],i=ufe.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[1+(e<<1)];return ufe.getTokenType(t)}getForeground(e){const t=this._tokens[1+(e<<1)];return ufe.getForeground(t)}getClassName(e){const t=this._tokens[1+(e<<1)];return ufe.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[1+(e<<1)];return ufe.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[1+(e<<1)];return ufe.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return gfe.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new pfe(this,e,t,i)}static convertToEndOffset(e,t){const i=(e.length>>>1)-1;for(let t=0;t<i;t++)e[t<<1]=e[t+1<<1];e[i<<1]=t}static findIndexInTokensArray(e,t){if(e.length<=2)return 0;let i=0,n=(e.length>>>1)-1;for(;i<n;){const o=i+Math.floor((n-i)/2),s=e[o<<1];if(s===t)return o+1;s<t?i=o+1:s>t&&(n=o)}return i}withInserted(e){if(0===e.length)return this;let t=0,i=0,n="";const o=new Array;let s=0;for(;;){const r=t<this._tokensCount?this._tokens[t<<1]:-1,a=i<e.length?e[i]:null;if(-1!==r&&(null===a||r<=a.offset)){n+=this._text.substring(s,r);const e=this._tokens[1+(t<<1)];o.push(n.length,e),t++,s=r}else{if(!a)break;if(a.offset>s){n+=this._text.substring(s,a.offset);const e=this._tokens[1+(t<<1)];o.push(n.length,e),s=a.offset}n+=a.text,o.push(n.length,a.tokenMetadata),i++}}return new gfe(new Uint32Array(o),n,this._languageIdCodec)}}gfe.defaultTokenMetadata=33587200;class pfe{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let t=this._firstTokenIndex,n=e.getCount();t<n&&!(e.getStartOffset(t)>=i);t++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof pfe&&this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount)}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}class mfe{constructor(e,t,i,n){this.startColumn=e,this.endColumn=t,this.className=i,this.type=n,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(!mfe._equals(e[n],t[n]))return!1;return!0}static extractWrapped(e,t,i){if(0===e.length)return e;const n=t+1,o=i+1,s=i-t,r=[];let a=0;for(const t of e)t.endColumn<=n||t.startColumn>=o||(r[a++]=new mfe(Math.max(1,t.startColumn-n+1),Math.min(s+1,t.endColumn-n+1),t.className,t.type));return r}static filter(e,t,i,n){if(0===e.length)return[];const o=[];let s=0;for(let r=0,a=e.length;r<a;r++){const a=e[r],l=a.range;if(l.endLineNumber<t||l.startLineNumber>t)continue;if(l.isEmpty()&&(0===a.type||3===a.type))continue;const h=l.startLineNumber===t?l.startColumn:i,d=l.endLineNumber===t?l.endColumn:n;o[s++]=new mfe(h,d,a.inlineClassName,a.type)}return o}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const i=mfe._typeCompare(e.type,t.type);return 0!==i?i:e.className!==t.className?e.className<t.className?-1:1:0}}class ffe{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.className=i,this.metadata=n}}class _fe{constructor(){this.stopOffsets=[],this.classNames=[],this.metadata=[],this.count=0}static _metadata(e){let t=0;for(let i=0,n=e.length;i<n;i++)t|=e[i];return t}consumeLowerThan(e,t,i){for(;this.count>0&&this.stopOffsets[0]<e;){let e=0;for(;e+1<this.count&&this.stopOffsets[e]===this.stopOffsets[e+1];)e++;i.push(new ffe(t,this.stopOffsets[e],this.classNames.join(" "),_fe._metadata(this.metadata))),t=this.stopOffsets[e]+1,this.stopOffsets.splice(0,e+1),this.classNames.splice(0,e+1),this.metadata.splice(0,e+1),this.count-=e+1}return this.count>0&&t<e&&(i.push(new ffe(t,e-1,this.classNames.join(" "),_fe._metadata(this.metadata))),t=e),t}insert(e,t,i){if(0===this.count||this.stopOffsets[this.count-1]<=e)this.stopOffsets.push(e),this.classNames.push(t),this.metadata.push(i);else for(let n=0;n<this.count;n++)if(this.stopOffsets[n]>=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t),this.metadata.splice(n,0,i);break}this.count++}}class vfe{static normalize(e,t){if(0===t.length)return[];const i=[],n=new _fe;let o=0;for(let s=0,r=t.length;s<r;s++){const r=t[s];let a=r.startColumn,l=r.endColumn;const h=r.className,d=1===r.type?2:2===r.type?4:0;a>1&&pde(e.charCodeAt(a-2))&&a--,l>1&&pde(e.charCodeAt(l-2))&&l--;const c=a-1,u=l-2;o=n.consumeLowerThan(c,o,i),0===n.count&&(o=c),n.insert(u,h,d)}return n.consumeLowerThan(1073741824,o,i),i}}class bfe{constructor(e,t,i,n){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=n,this._linePartBrand=void 0}isWhitespace(){return!!(1&this.metadata)}isPseudoAfter(){return!!(4&this.metadata)}}class wfe{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class Cfe{constructor(e,t,i,n,o,s,r,a,l,h,d,c,u,g,p,m,f,_,v){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=o,this.containsRTL=s,this.fauxIndentLength=r,this.lineTokens=a,this.lineDecorations=l.sort(mfe.compare),this.tabSize=h,this.startVisibleColumn=d,this.spaceWidth=c,this.stopRenderingLineAfter=p,this.renderWhitespace="all"===m?4:"boundary"===m?1:"selection"===m?2:"trailing"===m?3:0,this.renderControlCharacters=f,this.fontLigatures=_,this.selectionsOnLine=v&&v.sort(((e,t)=>e.startOffset<t.startOffset?-1:1)),Math.abs(g-c)<Math.abs(u-c)?(this.renderSpaceWidth=g,this.renderSpaceCharCode=11825):(this.renderSpaceWidth=u,this.renderSpaceCharCode=183)}sameSelection(e){if(null===this.selectionsOnLine)return null===e;if(null===e)return!1;if(e.length!==this.selectionsOnLine.length)return!1;for(let t=0;t<this.selectionsOnLine.length;t++)if(!this.selectionsOnLine[t].equals(e[t]))return!1;return!0}equals(e){return this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineContent===e.lineContent&&this.continuesWithWrappedLine===e.continuesWithWrappedLine&&this.isBasicASCII===e.isBasicASCII&&this.containsRTL===e.containsRTL&&this.fauxIndentLength===e.fauxIndentLength&&this.tabSize===e.tabSize&&this.startVisibleColumn===e.startVisibleColumn&&this.spaceWidth===e.spaceWidth&&this.renderSpaceWidth===e.renderSpaceWidth&&this.renderSpaceCharCode===e.renderSpaceCharCode&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.fontLigatures===e.fontLigatures&&mfe.equalsArr(this.lineDecorations,e.lineDecorations)&&this.lineTokens.equals(e.lineTokens)&&this.sameSelection(e.selectionsOnLine)}}class yfe{constructor(e,t){this.partIndex=e,this.charIndex=t}}class Sfe{static getPartIndex(e){return(4294901760&e)>>>16}static getCharIndex(e){return(65535&e)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,n){const o=(t<<16|i<<0)>>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=n}getHorizontalOffset(e){return 0===this._horizontalOffset.length?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return 0===this.length?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),i=Sfe.getPartIndex(t),n=Sfe.getCharIndex(t);return new yfe(i,n)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(0===this.length)return 0;const n=(e<<16|i<<0)>>>0;let o=0,s=this.length-1;for(;o+1<s;){const e=o+s>>>1,t=this._data[e];if(t===n)return e;t>n?s=e:o=e}if(o===s)return o;const r=this._data[o],a=this._data[s];if(r===n)return o;if(a===n)return s;const l=Sfe.getPartIndex(r),h=Sfe.getCharIndex(r);let d;return d=l!==Sfe.getPartIndex(a)?t:Sfe.getCharIndex(a),i-h<=d-i?o:s}}class kfe{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function Lfe(e,t){if(0===e.lineContent.length){if(e.lineDecorations.length>0){t.appendString("<span>");let i=0,n=0,o=0;for(const s of e.lineDecorations)1!==s.type&&2!==s.type||(t.appendString('<span class="'),t.appendString(s.className),t.appendString('"></span>'),1===s.type&&(o|=1,i++),2===s.type&&(o|=2,n++));t.appendString("</span>");const s=new Sfe(1,i+n);return s.setColumnInfo(1,i,0,0),new kfe(s,!1,o)}return t.appendString("<span><span></span></span>"),new kfe(new Sfe(0,0),!1,0)}return function(e,t){const i=e.fontIsMonospace,n=e.canUseHalfwidthRightwardsArrow,o=e.containsForeignElements,s=e.lineContent,r=e.len,a=e.isOverflowing,l=e.overflowingCharCount,h=e.parts,d=e.fauxIndentLength,c=e.tabSize,u=e.startVisibleColumn,g=e.containsRTL,p=e.spaceWidth,m=e.renderSpaceCharCode,f=e.renderWhitespace,_=e.renderControlCharacters,v=new Sfe(r+1,h.length);let b=!1,w=0,C=u,y=0,S=0,k=0;g?t.appendString('<span dir="ltr">'):t.appendString("<span>");for(let e=0,a=h.length;e<a;e++){const a=h[e],l=a.endIndex,u=a.type,g=a.containsRTL,L=0!==f&&a.isWhitespace(),x=L&&!i&&("mtkw"===u||!o),D=w===l&&a.isPseudoAfter();if(y=0,t.appendString("<span "),g&&t.appendString('style="unicode-bidi:isolate" '),t.appendString('class="'),t.appendString(x?"mtkz":u),t.appendASCIICharCode(34),L){let i=0;{let e=w,t=C;for(;e<l;e++){const n=0|(9===s.charCodeAt(e)?c-t%c:1);i+=n,e>=d&&(t+=n)}}for(x&&(t.appendString(' style="width:'),t.appendString(String(p*i)),t.appendString('px"')),t.appendASCIICharCode(62);w<l;w++){let i,o;if(v.setColumnInfo(w+1,e-k,y,S),k=0,9===s.charCodeAt(w)){i=c-C%c|0,o=i,!n||o>1?t.appendCharCode(8594):t.appendCharCode(65515);for(let e=2;e<=o;e++)t.appendCharCode(160)}else i=2,o=1,t.appendCharCode(m),t.appendCharCode(8204);y+=i,S+=o,w>=d&&(C+=o)}}else for(t.appendASCIICharCode(62);w<l;w++){v.setColumnInfo(w+1,e-k,y,S),k=0;const i=s.charCodeAt(w);let n=1,o=1;switch(i){case 9:n=c-C%c,o=n;for(let e=1;e<=n;e++)t.appendCharCode(160);break;case 32:t.appendCharCode(160);break;case 60:t.appendString("&lt;");break;case 62:t.appendString("&gt;");break;case 38:t.appendString("&amp;");break;case 0:_?t.appendCharCode(9216):t.appendString("&#00;");break;case 65279:case 8232:case 8233:case 133:t.appendCharCode(65533);break;default:Ede(i)&&o++,_&&i<32?t.appendCharCode(9216+i):_&&127===i?t.appendCharCode(9249):_&&Nfe(i)?(t.appendString("[U+"),t.appendString(i.toString(16).toUpperCase().padStart(4,"0")),t.appendString("]"),n=8,o=n):t.appendCharCode(i)}y+=n,S+=o,w>=d&&(C+=o)}D?k++:k=0,w>=r&&!b&&a.isPseudoAfter()&&(b=!0,v.setColumnInfo(w+1,e,y,S)),t.appendString("</span>")}return b||v.setColumnInfo(r+1,h.length-1,y,S),a&&(t.appendString('<span class="mtkoverflow">'),t.appendString(Toe(0,"Show more ({0})",function(e){return e<1024?Toe(0,"{0} chars",e):e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}(l))),t.appendString("</span>")),t.appendString("</span>"),new kfe(v,g,o)}(function(e){const t=e.lineContent;let i,n,o;-1!==e.stopRenderingLineAfter&&e.stopRenderingLineAfter<t.length?(i=!0,n=t.length-e.stopRenderingLineAfter,o=e.stopRenderingLineAfter):(i=!1,n=0,o=t.length);let s=function(e,t,i,n,o){const s=[];let r=0;n>0&&(s[r++]=new bfe(n,"",0,!1));let a=n;for(let l=0,h=i.getCount();l<h;l++){const h=i.getEndOffset(l);if(h<=n)continue;const d=i.getClassName(l);if(h>=o){const i=!!t&&Sde(e.substring(a,o));s[r++]=new bfe(o,d,0,i);break}const c=!!t&&Sde(e.substring(a,h));s[r++]=new bfe(h,d,0,c),a=h}return s}(t,e.containsRTL,e.lineTokens,e.fauxIndentLength,o);e.renderControlCharacters&&!e.isBasicASCII&&(s=function(e,t){const i=[];let n=new bfe(0,"",0,!1),o=0;for(const s of t){const t=s.endIndex;for(;o<t;o++)Nfe(e.charCodeAt(o))&&(o>n.endIndex&&(n=new bfe(o,s.type,s.metadata,s.containsRTL),i.push(n)),n=new bfe(o+1,"mtkcontrol",s.metadata,!1),i.push(n));o>n.endIndex&&(n=new bfe(t,s.type,s.metadata,s.containsRTL),i.push(n))}return i}(t,s)),(4===e.renderWhitespace||1===e.renderWhitespace||2===e.renderWhitespace&&e.selectionsOnLine||3===e.renderWhitespace&&!e.continuesWithWrappedLine)&&(s=function(e,t,i,n){const o=e.continuesWithWrappedLine,s=e.fauxIndentLength,r=e.tabSize,a=e.startVisibleColumn,l=e.useMonospaceOptimizations,h=e.selectionsOnLine,d=1===e.renderWhitespace,c=3===e.renderWhitespace,u=e.renderSpaceWidth!==e.spaceWidth,g=[];let p=0,m=0,f=n[m].type,_=n[m].containsRTL,v=n[m].endIndex;const b=n.length;let w,C=!1,y=ede(t);-1===y?(C=!0,y=i,w=i):w=ide(t);let S=!1,k=0,L=h&&h[k],x=a%r;for(let e=s;e<i;e++){const o=t.charCodeAt(e);let a;if(L&&e>=L.endOffset&&(k++,L=h&&h[k]),e<y||e>w)a=!0;else if(9===o)a=!0;else if(32===o)if(d)if(S)a=!0;else{const n=e+1<i?t.charCodeAt(e+1):0;a=32===n||9===n}else a=!0;else a=!1;if(a&&h&&(a=!!L&&L.startOffset<=e&&L.endOffset>e),a&&c&&(a=C||e>w),a&&_&&e>=y&&e<=w&&(a=!1),S){if(!a||!l&&x>=r){if(u)for(let t=(p>0?g[p-1].endIndex:s)+1;t<=e;t++)g[p++]=new bfe(t,"mtkw",1,!1);else g[p++]=new bfe(e,"mtkw",1,!1);x%=r}}else(e===v||a&&e>s)&&(g[p++]=new bfe(e,f,0,_),x%=r);for(9===o?x=r:Ede(o)?x+=2:x++,S=a;e===v&&(m++,m<b);)f=n[m].type,_=n[m].containsRTL,v=n[m].endIndex}let D=!1;if(S)if(o&&d){const e=i>0?t.charCodeAt(i-1):0,n=i>1?t.charCodeAt(i-2):0;32===e&&32!==n&&9!==n||(D=!0)}else D=!0;if(D)if(u)for(let e=(p>0?g[p-1].endIndex:s)+1;e<=i;e++)g[p++]=new bfe(e,"mtkw",1,!1);else g[p++]=new bfe(i,"mtkw",1,!1);else g[p++]=new bfe(i,f,0,_);return g}(e,t,o,s));let r=0;if(e.lineDecorations.length>0){for(let t=0,i=e.lineDecorations.length;t<i;t++){const i=e.lineDecorations[t];3===i.type||1===i.type?r|=1:2===i.type&&(r|=2)}s=function(e,t,i,n){n.sort(mfe.compare);const o=vfe.normalize(e,n),s=o.length;let r=0;const a=[];let l=0,h=0;for(let e=0,t=i.length;e<t;e++){const t=i[e],n=t.endIndex,d=t.type,c=t.metadata,u=t.containsRTL;for(;r<s&&o[r].startOffset<n;){const e=o[r];if(e.startOffset>h&&(h=e.startOffset,a[l++]=new bfe(h,d,c,u)),!(e.endOffset+1<=n)){h=n,a[l++]=new bfe(h,d+" "+e.className,c|e.metadata,u);break}h=e.endOffset+1,a[l++]=new bfe(h,d+" "+e.className,c|e.metadata,u),r++}n>h&&(h=n,a[l++]=new bfe(h,d,c,u))}const d=i[i.length-1].endIndex;if(r<s&&o[r].startOffset===d)for(;r<s&&o[r].startOffset===d;){const e=o[r];a[l++]=new bfe(h,e.className,e.metadata,!1),r++}return a}(t,0,s,e.lineDecorations)}return e.containsRTL||(s=function(e,t,i){let n=0;const o=[];let s=0;if(i)for(let i=0,r=t.length;i<r;i++){const r=t[i],a=r.endIndex;if(n+50<a){const t=r.type,i=r.metadata,l=r.containsRTL;let h=-1,d=n;for(let r=n;r<a;r++)32===e.charCodeAt(r)&&(h=r),-1!==h&&r-d>=50&&(o[s++]=new bfe(h+1,t,i,l),d=h+1,h=-1);d!==a&&(o[s++]=new bfe(a,t,i,l))}else o[s++]=r;n=a}else for(let e=0,i=t.length;e<i;e++){const i=t[e],r=i.endIndex,a=r-n;if(a>50){const e=i.type,t=i.metadata,l=i.containsRTL,h=Math.ceil(a/50);for(let i=1;i<h;i++){const r=n+50*i;o[s++]=new bfe(r,e,t,l)}o[s++]=new bfe(r,e,t,l)}else o[s++]=i;n=r}return o}(t,s,!e.isBasicASCII||e.fontLigatures)),new Efe(e.useMonospaceOptimizations,e.canUseHalfwidthRightwardsArrow,t,o,i,n,s,r,e.fauxIndentLength,e.tabSize,e.startVisibleColumn,e.containsRTL,e.spaceWidth,e.renderSpaceCharCode,e.renderWhitespace,e.renderControlCharacters)}(e),t)}class xfe{constructor(e,t,i,n){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=n}}function Dfe(e){const t=new Oue(1e4),i=Lfe(e,t);return new xfe(i.characterMapping,t.build(),i.containsRTL,i.containsForeignElements)}class Efe{constructor(e,t,i,n,o,s,r,a,l,h,d,c,u,g,p,m){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,this.isOverflowing=o,this.overflowingCharCount=s,this.parts=r,this.containsForeignElements=a,this.fauxIndentLength=l,this.tabSize=h,this.startVisibleColumn=d,this.containsRTL=c,this.spaceWidth=u,this.renderSpaceCharCode=g,this.renderWhitespace=p,this.renderControlCharacters=m}}function Nfe(e){return e<32?9!==e:127===e||e>=8234&&e<=8238||e>=8294&&e<=8297||e>=8206&&e<=8207||1564===e}class Ife{constructor(e,t,i,n){this._viewportBrand=void 0,this.top=0|e,this.left=0|t,this.width=0|i,this.height=0|n}}class Mfe{constructor(e,t){this.tabSize=e,this.data=t}}class Tfe{constructor(e,t,i,n,o,s,r){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=n,this.startVisibleColumn=o,this.tokens=s,this.inlineDecorations=r}}class Afe{constructor(e,t,i,n,o,s,r,a,l,h){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=n,this.isBasicASCII=Afe.isBasicASCII(i,s),this.containsRTL=Afe.containsRTL(i,this.isBasicASCII,o),this.tokens=r,this.inlineDecorations=a,this.tabSize=l,this.startVisibleColumn=h}static isBasicASCII(e,t){return!t||Lde(e)}static containsRTL(e,t,i){return!(t||!i)&&Sde(e)}}class Rfe{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class Ofe{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=n}toInlineDecoration(e){return new Rfe(new Ole(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class Pfe{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class Ffe{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static cmp(e,t){return e.zIndex===t.zIndex?e.color<t.color?-1:e.color>t.color?1:0:e.zIndex-t.zIndex}}function Bfe(e){return"string"==typeof e}function Wfe(e){return!Bfe(e)}function Vfe(e){return!e}function zfe(e,t){return e.ignoreCase&&t?t.toLowerCase():t}function Hfe(e){return e.replace(/[&<>'"_]/g,"-")}function Ufe(e,t){return new Error(`${e.languageId}: ${t}`)}function Kfe(e,t,i,n,o){let s=null;return t.replace(/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g,(function(t,r,a,l,h,d,c,u,g){return Vfe(a)?Vfe(l)?!Vfe(h)&&h<n.length?zfe(e,n[h]):!Vfe(c)&&e&&"string"==typeof e[c]?e[c]:(null===s&&(s=o.split("."),s.unshift(o)),!Vfe(d)&&d<s.length?zfe(e,s[d]):""):zfe(e,i):"$"}))}function jfe(e,t){let i=t;for(;i&&i.length>0;){const t=e.tokenizer[i];if(t)return t;const n=i.lastIndexOf(".");i=n<0?null:i.substr(0,n)}return null}class qfe{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(null!==e&&e.depth>=this._maxCacheDepth)return new $fe(e,t);let i=$fe.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new $fe(e,t),this._entries[i]=n,n)}}qfe._INSTANCE=new qfe(5);class $fe{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;null!==e;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;null!==e&&null!==t;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return null===e&&null===t}equals(e){return $fe._equals(this,e)}push(e){return qfe.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return qfe.create(this.parent,e)}}class Gfe{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new Gfe(this.languageId,this.state)}}class Zfe{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(null!==t)return new Yfe(e,t);if(null!==e&&e.depth>=this._maxCacheDepth)return new Yfe(e,t);const i=$fe.getStackElementId(e);let n=this._entries[i];return n||(n=new Yfe(e,null),this._entries[i]=n,n)}}Zfe._INSTANCE=new Zfe(5);class Yfe{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:Zfe.create(this.stack,this.embeddedLanguageData)}equals(e){return e instanceof Yfe&&!!this.stack.equals(e.stack)&&(null===this.embeddedLanguageData&&null===e.embeddedLanguageData||null!==this.embeddedLanguageData&&null!==e.embeddedLanguageData&&this.embeddedLanguageData.equals(e.embeddedLanguageData))}}class Qfe{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new Yle(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,n){const o=i.languageId,s=i.state,r=ehe.get(o);if(!r)return this.enterLanguage(o),this.emit(n,""),s;const a=r.tokenize(e,t,s);if(0!==n)for(const e of a.tokens)this._tokens.push(new Yle(e.offset+n,e.type,e.language));else this._tokens=this._tokens.concat(a.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,a.endState}finalize(e){return new Qle(this._tokens,e)}}class Xfe{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=1024|this._theme.match(this._currentLanguageId,t);this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const n=null!==e?e.length:0,o=t.length,s=null!==i?i.length:0;if(0===n&&0===o&&0===s)return new Uint32Array(0);if(0===n&&0===o)return i;if(0===o&&0===s)return e;const r=new Uint32Array(n+o+s);null!==e&&r.set(e);for(let e=0;e<o;e++)r[n+e]=t[e];return null!==i&&r.set(i,n+o),r}nestedLanguageTokenize(e,t,i,n){const o=i.languageId,s=i.state,r=ehe.get(o);if(!r)return this.enterLanguage(o),this.emit(n,""),s;const a=r.tokenizeEncoded(e,t,s);if(0!==n)for(let e=0,t=a.tokens.length;e<t;e+=2)a.tokens[e]+=n;return this._prependTokens=Xfe._merge(this._prependTokens,this._tokens,a.tokens),this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0,a.endState}finalize(e){return new Xle(Xfe._merge(this._prependTokens,this._tokens,null),e)}}let Jfe=class e{constructor(e,t,i,n,o){this._configurationService=o,this._languageService=e,this._standaloneThemeService=t,this._languageId=i,this._lexer=n,this._embeddedLanguages=Object.create(null),this.embeddedLoaded=Promise.resolve(void 0);let s=!1;this._tokenizationRegistryListener=ehe.onDidChange((e=>{if(s)return;let t=!1;for(let i=0,n=e.changedLanguages.length;i<n;i++){const n=e.changedLanguages[i];if(this._embeddedLanguages[n]){t=!0;break}}t&&(s=!0,ehe.fire([this._languageId]),s=!1)})),this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}),this._configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}dispose(){this._tokenizationRegistryListener.dispose()}getLoadStatus(){const t=[];for(const i in this._embeddedLanguages){const n=ehe.get(i);if(n){if(n instanceof e){const e=n.getLoadStatus();!1===e.loaded&&t.push(e.promise)}}else ehe.isResolved(i)||t.push(ehe.getOrCreate(i))}return 0===t.length?{loaded:!0}:{loaded:!1,promise:Promise.all(t).then((e=>{}))}}getInitialState(){const e=qfe.create(null,this._lexer.start);return Zfe.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return Gge(this._languageId,i);const n=new Qfe,o=this._tokenize(e,t,i,n);return n.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return Zge(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const n=new Xfe(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,i,n);return n.finalize(o)}_tokenize(e,t,i,n){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,n):this._myTokenize(e,t,i,0,n)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=jfe(this._lexer,t.stack.state),!i))throw Ufe(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,o=!1;for(const t of i){if(!Wfe(t.action)||"@pop"!==t.action.nextEmbedded)continue;o=!0;let i=t.regex;const s=t.regex.source;if("^(?:"===s.substr(0,4)&&")"===s.substr(s.length-1,1)){const e=(i.ignoreCase?"i":"")+(i.unicode?"u":"");i=new RegExp(s.substr(4,s.length-5),e)}const r=e.search(i);-1===r||0!==r&&t.matchOnlyAtLineStart||(-1===n||r<n)&&(n=r)}if(!o)throw Ufe(this._lexer,'no rule containing nextEmbedded: "@pop" in tokenizer embedded state: '+t.stack.state);return n}_nestedTokenize(e,t,i,n,o){const s=this._findLeavingNestedLanguageOffset(e,i);if(-1===s){const s=o.nestedLanguageTokenize(e,t,i.embeddedLanguageData,n);return Zfe.create(i.stack,new Gfe(i.embeddedLanguageData.languageId,s))}const r=e.substring(0,s);r.length>0&&o.nestedLanguageTokenize(r,!1,i.embeddedLanguageData,n);const a=e.substring(s);return this._myTokenize(a,t,i,n+s,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n,o){o.enterLanguage(this._languageId);const s=e.length,r=t&&this._lexer.includeLF?e+"\n":e,a=r.length;let l=i.embeddedLanguageData,h=i.stack,d=0,c=null,u=!0;for(;u||d<a;){const i=d,m=h.depth,f=c?c.groups.length:0,_=h.state;let v=null,b=null,w=null,C=null,y=null;if(c){v=c.matches;const e=c.groups.shift();b=e.matched,w=e.action,C=c.rule,0===c.groups.length&&(c=null)}else{if(!u&&d>=a)break;u=!1;let e=this._lexer.tokenizer[_];if(!e&&(e=jfe(this._lexer,_),!e))throw Ufe(this._lexer,"tokenizer state is not defined: "+_);const t=r.substr(d);for(const i of e)if((0===d||!i.matchOnlyAtLineStart)&&(v=t.match(i.regex),v)){b=v[0],w=i.action;break}}if(v||(v=[""],b=""),w||(d<a&&(v=[r.charAt(d)],b=v[0]),w=this._lexer.defaultToken),null===b)break;for(d+=b.length;!function(e){return Array.isArray(e)}(w)&&Wfe(w)&&w.test;)w=w.test(b,v,_,d===a);let S=null;if("string"==typeof w||Array.isArray(w))S=w;else if(w.group)S=w.group;else if(null!==w.token&&void 0!==w.token){if(S=w.tokenSubst?Kfe(this._lexer,w.token,b,v,_):w.token,w.nextEmbedded)if("@pop"===w.nextEmbedded){if(!l)throw Ufe(this._lexer,"cannot pop embedded language if not inside one");l=null}else{if(l)throw Ufe(this._lexer,"cannot enter embedded language from within an embedded language");y=Kfe(this._lexer,w.nextEmbedded,b,v,_)}if(w.goBack&&(d=Math.max(0,d-w.goBack)),w.switchTo&&"string"==typeof w.switchTo){let e=Kfe(this._lexer,w.switchTo,b,v,_);if("@"===e[0]&&(e=e.substr(1)),!jfe(this._lexer,e))throw Ufe(this._lexer,"trying to switch to a state '"+e+"' that is undefined in rule: "+this._safeRuleName(C));h=h.switchTo(e)}else{if(w.transform&&"function"==typeof w.transform)throw Ufe(this._lexer,"action.transform not supported");if(w.next)if("@push"===w.next){if(h.depth>=this._lexer.maxStack)throw Ufe(this._lexer,"maximum tokenizer stack size reached: ["+h.state+","+h.parent.state+",...]");h=h.push(_)}else if("@pop"===w.next){if(h.depth<=1)throw Ufe(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(C));h=h.pop()}else if("@popall"===w.next)h=h.popall();else{let e=Kfe(this._lexer,w.next,b,v,_);if("@"===e[0]&&(e=e.substr(1)),!jfe(this._lexer,e))throw Ufe(this._lexer,"trying to set a next state '"+e+"' that is undefined in rule: "+this._safeRuleName(C));h=h.push(e)}}w.log&&"string"==typeof w.log&&(g=this._lexer,p=this._lexer.languageId+": "+Kfe(this._lexer,w.log,b,v,_),console.log(`${g.languageId}: ${p}`))}if(null===S)throw Ufe(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(C));const k=i=>{const s=this._languageService.getLanguageIdByLanguageName(i)||this._languageService.getLanguageIdByMimeType(i)||i,r=this._getNestedEmbeddedLanguageData(s);if(d<a){const i=e.substr(d);return this._nestedTokenize(i,t,Zfe.create(h,r),n+d,o)}return Zfe.create(h,r)};if(Array.isArray(S)){if(c&&c.groups.length>0)throw Ufe(this._lexer,"groups cannot be nested: "+this._safeRuleName(C));if(v.length!==S.length+1)throw Ufe(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(C));let e=0;for(let t=1;t<v.length;t++)e+=v[t].length;if(e!==b.length)throw Ufe(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(C));c={rule:C,matches:v,groups:[]};for(let e=0;e<S.length;e++)c.groups[e]={action:S[e],matched:v[e+1]};d-=b.length}else{{if("@rematch"===S&&(d-=b.length,b="",v=null,S="",null!==y))return k(y);if(0===b.length){if(0===a||m!==h.depth||_!==h.state||(c?c.groups.length:0)!==f)continue;throw Ufe(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(C))}let e=null;if(Bfe(S)&&0===S.indexOf("@brackets")){const t=S.substr(9),i=e_e(this._lexer,b);if(!i)throw Ufe(this._lexer,"@brackets token returned but no bracket defined as: "+b);e=Hfe(i.token+t)}else e=Hfe(""===S?"":S+this._lexer.tokenPostfix);i<s&&o.emit(i+n,e)}if(null!==y)return k(y)}}var g,p;return Zfe.create(h,l)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new Gfe(e,$ge);e!==this._languageId&&(ehe.getOrCreate(e),this._embeddedLanguages[e]=!0);const t=ehe.get(e);return new Gfe(e,t?t.getInitialState():$ge)}};function e_e(e,t){if(!t)return null;t=zfe(e,t);const i=e.brackets;for(const e of i){if(e.open===t)return{token:e.token,bracketType:1};if(e.close===t)return{token:e.token,bracketType:-1}}return null}Jfe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(4,Zue)],Jfe);var t_e;const i_e=null===(t_e=window.trustedTypes)||void 0===t_e?void 0:t_e.createPolicy("standaloneColorizer",{createHTML:e=>e});class n_e{static colorizeElement(e,t,i,n){const o=(n=n||{}).theme||"vs",s=n.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!s)return console.error("Mode not detected"),Promise.resolve();const r=t.getLanguageIdByMimeType(s)||s;e.setTheme(o);const a=i.firstChild?i.firstChild.nodeValue:"";return i.className+=" "+o,this.colorize(t,a||"",r,n).then((e=>{var t;const n=null!==(t=null==i_e?void 0:i_e.createHTML(e))&&void 0!==t?t:e;i.innerHTML=n}),(e=>console.error(e)))}static colorize(e,t,i,n){return o=this,s=void 0,a=function*(){const o=e.languageIdCodec;let s=4;n&&"number"==typeof n.tabSize&&(s=n.tabSize),Mde(t)&&(t=t.substr(1));const r=Jhe(t);if(!e.isRegisteredLanguageId(i))return o_e(r,s,o);const a=yield ehe.getOrCreate(i);return a?function(e,t,i,n){return new Promise(((o,s)=>{const r=()=>{const a=function(e,t,i,n){let o=[],s=i.getInitialState();for(let r=0,a=e.length;r<a;r++){const a=e[r],l=i.tokenizeEncoded(a,!0,s);gfe.convertToEndOffset(l.tokens,a.length);const h=new gfe(l.tokens,a,n),d=Afe.isBasicASCII(a,!0),c=Afe.containsRTL(a,d,!0),u=Dfe(new Cfe(!1,!0,a,!1,d,c,0,h.inflate(),[],t,0,0,0,0,-1,"none",!1,!1,null));o=o.concat(u.html),o.push("<br/>"),s=l.endState}return o.join("")}(e,t,i,n);if(i instanceof Jfe){const e=i.getLoadStatus();if(!1===e.loaded)return void e.promise.then(r,s)}o(a)};r()}))}(r,s,a,o):o_e(r,s,o)},new((r=void 0)||(r=Promise))((function(e,t){function i(e){try{l(a.next(e))}catch(e){t(e)}}function n(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var o;t.done?e(t.value):(o=t.value,o instanceof r?o:new r((function(e){e(o)}))).then(i,n)}l((a=a.apply(o,s||[])).next())}));var o,s,r,a}static colorizeLine(e,t,i,n,o=4){const s=Afe.isBasicASCII(e,t),r=Afe.containsRTL(e,s,i);return Dfe(new Cfe(!1,!0,e,!1,s,r,0,n,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){const n=e.getLineContent(t);e.tokenization.forceTokenization(t);const o=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),o,i)}}function o_e(e,t,i){let n=[];const o=new Uint32Array(2);o[0]=0,o[1]=33587200;for(let s=0,r=e.length;s<r;s++){const r=e[s];o[0]=r.length;const a=new gfe(o,r,i),l=Afe.isBasicASCII(r,!0),h=Afe.containsRTL(r,l,!0),d=Dfe(new Cfe(!1,!0,r,!1,l,h,0,a,[],t,0,0,0,0,-1,"none",!1,!1,null));n=n.concat(d.html),n.push("<br/>")}return n.join("")}nse||document.queryCommandSupported&&document.queryCommandSupported("copy")||navigator&&navigator.clipboard&&navigator.clipboard.writeText,nse||navigator&&navigator.clipboard&&navigator.clipboard.readText,nse||Jde()||navigator.keyboard,"ontouchstart"in window||navigator.maxTouchPoints;const s_e=window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0);function r_e(e,t){if(0===e)return null;const i=(65535&e)>>>0,n=(4294901760&e)>>>16;return new h_e(0!==n?[a_e(i,t),a_e(n,t)]:[a_e(i,t)])}function a_e(e,t){const i=!!(2048&e),n=!!(256&e);return new l_e(2===t?n:i,!!(1024&e),!!(512&e),2===t?i:n,255&e)}class l_e{constructor(e,t,i,n,o){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyCode=o}equals(e){return e instanceof l_e&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}isModifierKey(){return 0===this.keyCode||5===this.keyCode||57===this.keyCode||6===this.keyCode||4===this.keyCode}isDuplicateModifierCase(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode}}class h_e{constructor(e){if(0===e.length)throw $re("chords");this.chords=e}}class d_e{constructor(e,t,i,n,o,s){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyLabel=o,this.keyAriaLabel=s}}class c_e{}const u_e=tse?256:2048,g_e=tse?2048:256;class p_e{constructor(e){this._standardKeyboardEventBrand=!0;const t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState("AltGraph"),this.keyCode=function(e){if(e.charCode){const t=String.fromCharCode(e.charCode).toUpperCase();return Uae.fromString(t)}const t=e.keyCode;if(3===t)return 7;if(jde){if(59===t)return 80;if(107===t)return 81;if(109===t)return 83;if(tse&&224===t)return 57}else if(qde){if(91===t)return 57;if(tse&&93===t)return 57;if(!tse&&92===t)return 57}return Pae[t]||0}(t),this.code=t.code,this.ctrlKey=this.ctrlKey||5===this.keyCode,this.altKey=this.altKey||6===this.keyCode,this.shiftKey=this.shiftKey||4===this.keyCode,this.metaKey=this.metaKey||57===this.keyCode,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=u_e),this.altKey&&(t|=512),this.shiftKey&&(t|=1024),this.metaKey&&(t|=g_e),t|=e,t}_computeKeyCodeChord(){let e=0;return 5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode),new l_e(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let m_e=!1,f_e=null;function __e(e){if(!e.parent||e.parent===e)return null;try{const t=e.location,i=e.parent.location;if("null"!==t.origin&&"null"!==i.origin&&t.origin!==i.origin)return m_e=!0,null}catch(e){return m_e=!0,null}return e.parent}class v_e{static getSameOriginWindowChain(){if(!f_e){f_e=[];let e,t=window;do{e=__e(t),e?f_e.push({window:t,iframeElement:t.frameElement||null}):f_e.push({window:t,iframeElement:null}),t=e}while(t)}return f_e.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,n=0;const o=this.getSameOriginWindowChain();for(const e of o){if(i+=e.window.scrollY,n+=e.window.scrollX,e.window===t)break;if(!e.iframeElement)break;const o=e.iframeElement.getBoundingClientRect();i+=o.top,n+=o.left}return{top:i,left:n}}}class b_e{constructor(e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=0===e.button,this.middleButton=1===e.button,this.rightButton=2===e.button,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,"dblclick"===e.type&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,"number"==typeof e.pageX?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,this.posy=e.clientY+document.body.scrollTop+document.documentElement.scrollTop);const t=v_e.getPositionOfChildWindowRelativeToAncestorWindow(self,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class w_e{constructor(e,t=0,i=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t,e){const t=e,i=e;if(void 0!==t.wheelDeltaY)this.deltaY=t.wheelDeltaY/120;else if(void 0!==i.VERTICAL_AXIS&&i.axis===i.VERTICAL_AXIS)this.deltaY=-i.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?this.deltaY=jde&&!tse?-e.deltaY/3:-e.deltaY:this.deltaY=-e.deltaY/40}if(void 0!==t.wheelDeltaX)this.deltaX=Gde&&ese?-t.wheelDeltaX/120:t.wheelDeltaX/120;else if(void 0!==i.HORIZONTAL_AXIS&&i.axis===i.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?this.deltaX=jde&&!tse?-e.deltaX/3:-e.deltaX:this.deltaX=-e.deltaX/40}0===this.deltaY&&0===this.deltaX&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;null===(e=this.browserEvent)||void 0===e||e.preventDefault()}stopPropagation(){var e;null===(e=this.browserEvent)||void 0===e||e.stopPropagation()}}var C_e=Object.hasOwnProperty,y_e=Object.setPrototypeOf,S_e=Object.isFrozen,k_e=Object.getPrototypeOf,L_e=Object.getOwnPropertyDescriptor,x_e=Object.freeze,D_e=Object.seal,E_e=Object.create,N_e="undefined"!=typeof Reflect&&Reflect,I_e=N_e.apply,M_e=N_e.construct;I_e||(I_e=function(e,t,i){return e.apply(t,i)}),x_e||(x_e=function(e){return e}),D_e||(D_e=function(e){return e}),M_e||(M_e=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}(t))))});var T_e=H_e(Array.prototype.forEach),A_e=H_e(Array.prototype.pop),R_e=H_e(Array.prototype.push),O_e=H_e(String.prototype.toLowerCase),P_e=H_e(String.prototype.match),F_e=H_e(String.prototype.replace),B_e=H_e(String.prototype.indexOf),W_e=H_e(String.prototype.trim),V_e=H_e(RegExp.prototype.test),z_e=function(e){return function(){for(var t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];return M_e(e,i)}}(TypeError);function H_e(e){return function(t){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];return I_e(e,t,n)}}function U_e(e,t){y_e&&y_e(e,null);for(var i=t.length;i--;){var n=t[i];if("string"==typeof n){var o=O_e(n);o!==n&&(S_e(t)||(t[i]=o),n=o)}e[n]=!0}return e}function K_e(e){var t=E_e(null),i=void 0;for(i in e)I_e(C_e,e,[i])&&(t[i]=e[i]);return t}function j_e(e,t){for(;null!==e;){var i=L_e(e,t);if(i){if(i.get)return H_e(i.get);if("function"==typeof i.value)return H_e(i.value)}e=k_e(e)}return function(e){return console.warn("fallback value for",e),null}}var q_e=x_e(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),$_e=x_e(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),G_e=x_e(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Z_e=x_e(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Y_e=x_e(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),Q_e=x_e(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),X_e=x_e(["#text"]),J_e=x_e(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),eve=x_e(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),tve=x_e(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ive=x_e(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),nve=D_e(/\{\{[\s\S]*|[\s\S]*\}\}/gm),ove=D_e(/<%[\s\S]*|[\s\S]*%>/gm),sve=D_e(/^data-[\-\w.\u00B7-\uFFFF]/),rve=D_e(/^aria-[\-\w]+$/),ave=D_e(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),lve=D_e(/^(?:\w+script|data):/i),hve=D_e(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),dve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function cve(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}var uve=function(){return"undefined"==typeof window?null:window},gve=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:uve(),i=function(t){return e(t)};if(i.version="2.3.1",i.removed=[],!t||!t.document||9!==t.document.nodeType)return i.isSupported=!1,i;var n=t.document,o=t.document,s=t.DocumentFragment,r=t.HTMLTemplateElement,a=t.Node,l=t.Element,h=t.NodeFilter,d=t.NamedNodeMap,c=void 0===d?t.NamedNodeMap||t.MozNamedAttrMap:d,u=t.Text,g=t.Comment,p=t.DOMParser,m=t.trustedTypes,f=l.prototype,_=j_e(f,"cloneNode"),v=j_e(f,"nextSibling"),b=j_e(f,"childNodes"),w=j_e(f,"parentNode");if("function"==typeof r){var C=o.createElement("template");C.content&&C.content.ownerDocument&&(o=C.content.ownerDocument)}var y=function(e,t){if("object"!==(void 0===e?"undefined":dve(e))||"function"!=typeof e.createPolicy)return null;var i=null,n="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(n)&&(i=t.currentScript.getAttribute(n));var o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(m,n),S=y&&te?y.createHTML(""):"",k=o,L=k.implementation,x=k.createNodeIterator,D=k.createDocumentFragment,E=k.getElementsByTagName,N=n.importNode,I={};try{I=K_e(o).documentMode?o.documentMode:{}}catch(e){}var M={};i.isSupported="function"==typeof w&&L&&void 0!==L.createHTMLDocument&&9!==I;var T=nve,A=ove,R=sve,O=rve,P=lve,F=hve,B=ave,W=null,V=U_e({},[].concat(cve(q_e),cve($_e),cve(G_e),cve(Y_e),cve(X_e))),z=null,H=U_e({},[].concat(cve(J_e),cve(eve),cve(tve),cve(ive))),U=null,K=null,j=!0,q=!0,$=!1,G=!1,Z=!1,Y=!1,Q=!1,X=!1,J=!1,ee=!0,te=!1,ie=!0,ne=!0,oe=!1,se={},re=null,ae=U_e({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),le=null,he=U_e({},["audio","video","img","source","image","track"]),de=null,ce=U_e({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ue="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",pe="http://www.w3.org/1999/xhtml",me=pe,fe=!1,_e=null,ve=o.createElement("form"),be=function(e){_e&&_e===e||(e&&"object"===(void 0===e?"undefined":dve(e))||(e={}),e=K_e(e),W="ALLOWED_TAGS"in e?U_e({},e.ALLOWED_TAGS):V,z="ALLOWED_ATTR"in e?U_e({},e.ALLOWED_ATTR):H,de="ADD_URI_SAFE_ATTR"in e?U_e(K_e(ce),e.ADD_URI_SAFE_ATTR):ce,le="ADD_DATA_URI_TAGS"in e?U_e(K_e(he),e.ADD_DATA_URI_TAGS):he,re="FORBID_CONTENTS"in e?U_e({},e.FORBID_CONTENTS):ae,U="FORBID_TAGS"in e?U_e({},e.FORBID_TAGS):{},K="FORBID_ATTR"in e?U_e({},e.FORBID_ATTR):{},se="USE_PROFILES"in e&&e.USE_PROFILES,j=!1!==e.ALLOW_ARIA_ATTR,q=!1!==e.ALLOW_DATA_ATTR,$=e.ALLOW_UNKNOWN_PROTOCOLS||!1,G=e.SAFE_FOR_TEMPLATES||!1,Z=e.WHOLE_DOCUMENT||!1,X=e.RETURN_DOM||!1,J=e.RETURN_DOM_FRAGMENT||!1,ee=!1!==e.RETURN_DOM_IMPORT,te=e.RETURN_TRUSTED_TYPE||!1,Q=e.FORCE_BODY||!1,ie=!1!==e.SANITIZE_DOM,ne=!1!==e.KEEP_CONTENT,oe=e.IN_PLACE||!1,B=e.ALLOWED_URI_REGEXP||B,me=e.NAMESPACE||pe,G&&(q=!1),J&&(X=!0),se&&(W=U_e({},[].concat(cve(X_e))),z=[],!0===se.html&&(U_e(W,q_e),U_e(z,J_e)),!0===se.svg&&(U_e(W,$_e),U_e(z,eve),U_e(z,ive)),!0===se.svgFilters&&(U_e(W,G_e),U_e(z,eve),U_e(z,ive)),!0===se.mathMl&&(U_e(W,Y_e),U_e(z,tve),U_e(z,ive))),e.ADD_TAGS&&(W===V&&(W=K_e(W)),U_e(W,e.ADD_TAGS)),e.ADD_ATTR&&(z===H&&(z=K_e(z)),U_e(z,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&U_e(de,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(re===ae&&(re=K_e(re)),U_e(re,e.FORBID_CONTENTS)),ne&&(W["#text"]=!0),Z&&U_e(W,["html","head","body"]),W.table&&(U_e(W,["tbody"]),delete U.tbody),x_e&&x_e(e),_e=e)},we=U_e({},["mi","mo","mn","ms","mtext"]),Ce=U_e({},["foreignobject","desc","title","annotation-xml"]),ye=U_e({},$_e);U_e(ye,G_e),U_e(ye,Z_e);var Se=U_e({},Y_e);U_e(Se,Q_e);var ke=function(e){R_e(i.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=S}catch(t){e.remove()}}},Le=function(e,t){try{R_e(i.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){R_e(i.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!z[e])if(X||J)try{ke(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},xe=function(e){var t=void 0,i=void 0;if(Q)e="<remove></remove>"+e;else{var n=P_e(e,/^[\r\n\t ]+/);i=n&&n[0]}var s=y?y.createHTML(e):e;if(me===pe)try{t=(new p).parseFromString(s,"text/html")}catch(e){}if(!t||!t.documentElement){t=L.createDocument(me,"template",null);try{t.documentElement.innerHTML=fe?"":s}catch(e){}}var r=t.body||t.documentElement;return e&&i&&r.insertBefore(o.createTextNode(i),r.childNodes[0]||null),me===pe?E.call(t,Z?"html":"body")[0]:Z?t.documentElement:r},De=function(e){return x.call(e.ownerDocument||e,e,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT,null,!1)},Ee=function(e){return"object"===(void 0===a?"undefined":dve(a))?e instanceof a:e&&"object"===(void 0===e?"undefined":dve(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Ne=function(e,t,n){M[e]&&T_e(M[e],(function(e){e.call(i,t,n,_e)}))},Ie=function(e){var t,n=void 0;if(Ne("beforeSanitizeElements",e,null),!((t=e)instanceof u||t instanceof g||"string"==typeof t.nodeName&&"string"==typeof t.textContent&&"function"==typeof t.removeChild&&t.attributes instanceof c&&"function"==typeof t.removeAttribute&&"function"==typeof t.setAttribute&&"string"==typeof t.namespaceURI&&"function"==typeof t.insertBefore))return ke(e),!0;if(P_e(e.nodeName,/[\u0080-\uFFFF]/))return ke(e),!0;var o=O_e(e.nodeName);if(Ne("uponSanitizeElement",e,{tagName:o,allowedTags:W}),!Ee(e.firstElementChild)&&(!Ee(e.content)||!Ee(e.content.firstElementChild))&&V_e(/<[/\w]/g,e.innerHTML)&&V_e(/<[/\w]/g,e.textContent))return ke(e),!0;if("select"===o&&V_e(/<template/i,e.innerHTML))return ke(e),!0;if(!W[o]||U[o]){if(ne&&!re[o]){var s=w(e)||e.parentNode,r=b(e)||e.childNodes;if(r&&s)for(var a=r.length-1;a>=0;--a)s.insertBefore(_(r[a],!0),v(e))}return ke(e),!0}return e instanceof l&&!function(e){var t=w(e);t&&t.tagName||(t={namespaceURI:pe,tagName:"template"});var i=O_e(e.tagName),n=O_e(t.tagName);if(e.namespaceURI===ge)return t.namespaceURI===pe?"svg"===i:t.namespaceURI===ue?"svg"===i&&("annotation-xml"===n||we[n]):Boolean(ye[i]);if(e.namespaceURI===ue)return t.namespaceURI===pe?"math"===i:t.namespaceURI===ge?"math"===i&&Ce[n]:Boolean(Se[i]);if(e.namespaceURI===pe){if(t.namespaceURI===ge&&!Ce[n])return!1;if(t.namespaceURI===ue&&!we[n])return!1;var o=U_e({},["title","style","font","a","script"]);return!Se[i]&&(o[i]||!ye[i])}return!1}(e)?(ke(e),!0):"noscript"!==o&&"noembed"!==o||!V_e(/<\/no(script|embed)/i,e.innerHTML)?(G&&3===e.nodeType&&(n=e.textContent,n=F_e(n,T," "),n=F_e(n,A," "),e.textContent!==n&&(R_e(i.removed,{element:e.cloneNode()}),e.textContent=n)),Ne("afterSanitizeElements",e,null),!1):(ke(e),!0)},Me=function(e,t,i){if(ie&&("id"===t||"name"===t)&&(i in o||i in ve))return!1;if(q&&!K[t]&&V_e(R,t));else if(j&&V_e(O,t));else{if(!z[t]||K[t])return!1;if(de[t]);else if(V_e(B,F_e(i,F,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==B_e(i,"data:")||!le[e])if($&&!V_e(P,F_e(i,F,"")));else if(i)return!1}return!0},Te=function(e){var t=void 0,n=void 0,o=void 0,s=void 0;Ne("beforeSanitizeAttributes",e,null);var r=e.attributes;if(r){var a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:z};for(s=r.length;s--;){var l=t=r[s],h=l.name,d=l.namespaceURI;if(n=W_e(t.value),o=O_e(h),a.attrName=o,a.attrValue=n,a.keepAttr=!0,a.forceKeepAttr=void 0,Ne("uponSanitizeAttribute",e,a),n=a.attrValue,!a.forceKeepAttr&&(Le(h,e),a.keepAttr))if(V_e(/\/>/i,n))Le(h,e);else{G&&(n=F_e(n,T," "),n=F_e(n,A," "));var c=e.nodeName.toLowerCase();if(Me(c,o,n))try{d?e.setAttributeNS(d,h,n):e.setAttribute(h,n),A_e(i.removed)}catch(e){}}}Ne("afterSanitizeAttributes",e,null)}},Ae=function e(t){var i=void 0,n=De(t);for(Ne("beforeSanitizeShadowDOM",t,null);i=n.nextNode();)Ne("uponSanitizeShadowNode",i,null),Ie(i)||(i.content instanceof s&&e(i.content),Te(i));Ne("afterSanitizeShadowDOM",t,null)};return i.sanitize=function(e,o){var r=void 0,l=void 0,h=void 0,d=void 0,c=void 0;if((fe=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ee(e)){if("function"!=typeof e.toString)throw z_e("toString is not a function");if("string"!=typeof(e=e.toString()))throw z_e("dirty is not a string, aborting")}if(!i.isSupported){if("object"===dve(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(Ee(e))return t.toStaticHTML(e.outerHTML)}return e}if(Y||be(o),i.removed=[],"string"==typeof e&&(oe=!1),oe);else if(e instanceof a)1===(l=(r=xe("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?r=l:r.appendChild(l);else{if(!X&&!G&&!Z&&-1===e.indexOf("<"))return y&&te?y.createHTML(e):e;if(!(r=xe(e)))return X?null:S}r&&Q&&ke(r.firstChild);for(var u=De(oe?e:r);h=u.nextNode();)3===h.nodeType&&h===d||Ie(h)||(h.content instanceof s&&Ae(h.content),Te(h),d=h);if(d=null,oe)return e;if(X){if(J)for(c=D.call(r.ownerDocument);r.firstChild;)c.appendChild(r.firstChild);else c=r;return ee&&(c=N.call(n,c,!0)),c}var g=Z?r.outerHTML:r.innerHTML;return G&&(g=F_e(g,T," "),g=F_e(g,A," ")),y&&te?y.createHTML(g):g},i.setConfig=function(e){be(e),Y=!0},i.clearConfig=function(){_e=null,Y=!1},i.isValidAttribute=function(e,t,i){_e||be({});var n=O_e(e),o=O_e(t);return Me(n,o,i)},i.addHook=function(e,t){"function"==typeof t&&(M[e]=M[e]||[],R_e(M[e],t))},i.removeHook=function(e){M[e]&&A_e(M[e])},i.removeHooks=function(e){M[e]&&(M[e]=[])},i.removeAllHooks=function(){M={}},i}();gve.version,gve.isSupported;const pve=gve.sanitize,mve=(gve.setConfig,gve.clearConfig,gve.isValidAttribute,gve.addHook),fve=gve.removeHook;var _ve;gve.removeHooks,gve.removeAllHooks,function(e){e.inMemory="inmemory",e.vscode="vscode",e.internal="private",e.walkThrough="walkThrough",e.walkThroughSnippet="walkThroughSnippet",e.http="http",e.https="https",e.file="file",e.mailto="mailto",e.untitled="untitled",e.data="data",e.command="command",e.vscodeRemote="vscode-remote",e.vscodeRemoteResource="vscode-remote-resource",e.vscodeUserData="vscode-userdata",e.vscodeCustomEditor="vscode-custom-editor",e.vscodeNotebookCell="vscode-notebook-cell",e.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",e.vscodeNotebookCellOutput="vscode-notebook-cell-output",e.vscodeInteractive="vscode-interactive",e.vscodeInteractiveInput="vscode-interactive-input",e.vscodeSettings="vscode-settings",e.vscodeWorkspaceTrust="vscode-workspace-trust",e.vscodeTerminal="vscode-terminal",e.webviewPanel="webview-panel",e.vscodeWebview="vscode-webview",e.extension="extension",e.vscodeFileResource="vscode-file",e.tmp="tmp",e.vsls="vsls",e.vscodeSourceControl="vscode-scm"}(_ve||(_ve={}));const vve=new class{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${_ve.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(t){return zre(t),e}const t=e.authority;let i=this._hosts[t];i&&-1!==i.indexOf(":")&&-1===i.indexOf("[")&&(i=`[${i}]`);const n=this._ports[t],o=this._connectionTokens[t];let s=`path=${encodeURIComponent(e.path)}`;return"string"==typeof o&&(s+=`&tkn=${encodeURIComponent(o)}`),Sle.from({scheme:ose?this._preferredWebSchema:_ve.vscodeRemoteResource,authority:`${i}:${n}`,path:this._remoteResourcesPath,query:s})}};class bve{uriToBrowserUri(e){return e.scheme===_ve.vscodeRemote?vve.rewrite(e):e.scheme===_ve.file&&(nse||sse&&Zoe.origin===`${_ve.vscodeFileResource}://${bve.FALLBACK_AUTHORITY}`)?e.with({scheme:_ve.vscodeFileResource,authority:e.authority||bve.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}bve.FALLBACK_AUTHORITY="vscode-app";const wve=new bve;var Cve;function yve(e){for(;e.firstChild;)e.firstChild.remove()}function Sve(e){var t;return null!==(t=null==e?void 0:e.isConnected)&&void 0!==t&&t}!function(e){const t=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);e.CoopAndCoep=Object.freeze(t.get("3"));const i="vscode-coi";e.getHeadersFromQuery=function(e){let n;"string"==typeof e?n=new URL(e).searchParams:e instanceof URL?n=e.searchParams:Sle.isUri(e)&&(n=new URL(e.toString(!0)).searchParams);const o=null==n?void 0:n.get(i);if(o)return t.get(o)},e.addSearchParam=function(e,t,n){if(!globalThis.crossOriginIsolated)return;const o=t&&n?"3":n?"2":"1";e instanceof URLSearchParams?e.set(i,o):e[i]=o}}(Cve||(Cve={}));class kve{constructor(e,t,i,n){this._node=e,this._type=t,this._handler=i,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function Lve(e,t,i,n){return new kve(e,t,i,n)}const xve=function(e,t,i,n){let o=i;return"click"===t||"mousedown"===t?o=function(e){return function(t){return e(new b_e(t))}}(i):"keydown"!==t&&"keypress"!==t&&"keyup"!==t||(o=function(e){return function(t){return e(new p_e(t))}}(i)),Lve(e,t,o,n)};let Dve,Eve;class Nve{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){zre(e)}}static sort(e,t){return t.priority-e.priority}}function Ive(e){return document.defaultView.getComputedStyle(e,null)}function Mve(e){if(e!==document.body)return new Ave(e.clientWidth,e.clientHeight);if(rse&&window.visualViewport)return new Ave(window.visualViewport.width,window.visualViewport.height);if(window.innerWidth&&window.innerHeight)return new Ave(window.innerWidth,window.innerHeight);if(document.body&&document.body.clientWidth&&document.body.clientHeight)return new Ave(document.body.clientWidth,document.body.clientHeight);if(document.documentElement&&document.documentElement.clientWidth&&document.documentElement.clientHeight)return new Ave(document.documentElement.clientWidth,document.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}!function(){let e=[],t=null,i=!1,n=!1;const o=()=>{for(i=!1,t=e,e=[],n=!0;t.length>0;)t.sort(Nve.sort),t.shift().execute();n=!1};Eve=(t,n=0)=>{const s=new Nve(t,n);return e.push(s),i||(i=!0,requestAnimationFrame(o)),s},Dve=(e,i)=>{if(n){const n=new Nve(e,i);return t.push(n),n}return Eve(e,i)}}();class Tve{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const n=Ive(e),o=n?n.getPropertyValue(t):"0";return Tve.convertToPixels(e,o)}static getBorderLeftWidth(e){return Tve.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return Tve.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return Tve.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return Tve.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return Tve.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return Tve.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return Tve.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return Tve.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return Tve.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return Tve.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return Tve.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return Tve.getDimension(e,"margin-bottom","marginBottom")}}class Ave{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new Ave(e,t):this}static is(e){return"object"==typeof e&&"number"==typeof e.height&&"number"==typeof e.width}static lift(e){return e instanceof Ave?e:new Ave(e.width,e.height)}static equals(e,t){return e===t||!(!e||!t)&&e.width===t.width&&e.height===t.height}}function Rve(e){const t=e.getBoundingClientRect();return{left:t.left+window.scrollX,top:t.top+window.scrollY,width:t.width,height:t.height}}function Ove(e){const t=Tve.getMarginLeft(e)+Tve.getMarginRight(e);return e.offsetWidth+t}function Pve(e){const t=Tve.getBorderLeftWidth(e)+Tve.getBorderRightWidth(e),i=Tve.getPaddingLeft(e)+Tve.getPaddingRight(e);return e.offsetWidth-t-i}function Fve(e){const t=Tve.getBorderTopWidth(e)+Tve.getBorderBottomWidth(e),i=Tve.getPaddingTop(e)+Tve.getPaddingBottom(e);return e.offsetHeight-t-i}function Bve(e){const t=Tve.getMarginTop(e)+Tve.getMarginBottom(e);return e.offsetHeight+t}function Wve(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function Vve(e,t,i){for(;e&&e.nodeType===e.ELEMENT_NODE;){if(e.classList.contains(t))return e;if(i)if("string"==typeof i){if(e.classList.contains(i))return null}else if(e===i)return null;e=e.parentNode}return null}function zve(e,t,i){return!!Vve(e,t,i)}function Hve(e){return e&&!!e.host&&!!e.mode}function Uve(e){return!!Kve(e)}function Kve(e){for(;e.parentNode;){if(e===document.body)return null;e=e.parentNode}return Hve(e)?e:null}function jve(){let e=document.activeElement;for(;null==e?void 0:e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function qve(e=document.getElementsByTagName("head")[0]){const t=document.createElement("style");return t.type="text/css",t.media="screen",e.appendChild(t),t}Ave.None=new Ave(0,0);let $ve=null;function Gve(e,t,i=function(){return $ve||($ve=qve()),$ve}()){i&&t&&i.sheet.insertRule(e+"{"+t+"}",0)}function Zve(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName}const Yve={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:qde?"webkitAnimationStart":"animationstart",ANIMATION_END:qde?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:qde?"webkitAnimationIteration":"animationiteration"},Qve=(e,t)=>(e.preventDefault(),t&&e.stopPropagation(),e);class Xve extends aae{static hasFocusWithin(e){const t=Kve(e);return Wve(t?t.activeElement:document.activeElement,e)}constructor(e){super(),this._onDidFocus=this._register(new bae),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new bae),this.onDidBlur=this._onDidBlur.event;let t=Xve.hasFocusWithin(e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,window.setTimeout((()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())}),0))};this._refreshStateHandler=()=>{Xve.hasFocusWithin(e)!==t&&(t?o():n())},this._register(Lve(e,Yve.FOCUS,n,!0)),this._register(Lve(e,Yve.BLUR,o,!0)),this._register(Lve(e,Yve.FOCUS_IN,(()=>this._refreshStateHandler()))),this._register(Lve(e,Yve.FOCUS_OUT,(()=>this._refreshStateHandler())))}}function Jve(e){return new Xve(e)}function ebe(e,...t){if(e.append(...t),1===t.length&&"string"!=typeof t[0])return t[0]}function tbe(e,...t){e.innerText="",ebe(e,...t)}const ibe=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var nbe;function obe(e,t,i,...n){const o=ibe.exec(t);if(!o)throw new Error("Bad use of emmet");const s=o[1]||"div";let r;return r=e!==nbe.HTML?document.createElementNS(e,s):document.createElement(s),o[3]&&(r.id=o[3]),o[4]&&(r.className=o[4].replace(/\./g," ").trim()),i&&Object.entries(i).forEach((([e,t])=>{void 0!==t&&(/^on\w+$/.test(e)?r[e]=t:"selected"===e?t&&r.setAttribute(e,"true"):r.setAttribute(e,t))})),r.append(...n),r}function sbe(e,t,...i){return obe(nbe.HTML,e,t,...i)}function rbe(...e){for(const t of e)t.style.display="",t.removeAttribute("aria-hidden")}function abe(...e){for(const t of e)t.style.display="none",t.setAttribute("aria-hidden","true")}function lbe(e){const t=window.devicePixelRatio*e;return Math.max(1,Math.floor(t))/window.devicePixelRatio}function hbe(e){window.open(e,"_blank","noopener")}function dbe(e){return e?`url('${wve.uriToBrowserUri(e).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function cbe(e){return`'${e.replace(/'/g,"%27")}'`}function ube(e,t){if(void 0!==e){const i=e.match(/^\s*var\((.+)\)$/);if(i){const e=i[1].split(",",2);return 2===e.length&&(t=ube(e[1].trim(),t)),`var(${e[0]}, ${t})`}return e}return t}!function(e){e.HTML="http://www.w3.org/1999/xhtml",e.SVG="http://www.w3.org/2000/svg"}(nbe||(nbe={})),sbe.SVG=function(e,t,...i){return obe(nbe.SVG,e,t,...i)},vve.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");const gbe=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]);Object.freeze({ALLOWED_TAGS:["a","button","blockquote","code","div","h1","h2","h3","h4","h5","h6","hr","input","label","li","p","pre","select","small","span","strong","textarea","ul","ol"],ALLOWED_ATTR:["href","data-href","data-command","target","title","name","src","alt","class","id","role","tabindex","style","data-code","width","height","align","x-dispatch","required","checked","placeholder","type"],RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1,RETURN_TRUSTED_TYPE:!0});class pbe extends bae{constructor(){super(),this._subscriptions=new rae,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(Lve(window,"keydown",(e=>{if(e.defaultPrevented)return;const t=new p_e(e);if(6!==t.keyCode||!e.repeat){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else{if(6===t.keyCode)return;this._keyStatus.lastKeyPressed=void 0}this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}}),!0)),this._subscriptions.add(Lve(window,"keyup",(e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))}),!0)),this._subscriptions.add(Lve(document.body,"mousedown",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),this._subscriptions.add(Lve(document.body,"mouseup",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),this._subscriptions.add(Lve(document.body,"mousemove",(e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)}),!0)),this._subscriptions.add(Lve(window,"blur",(()=>{this.resetKeyStatus()})))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return pbe.instance||(pbe.instance=new pbe),pbe.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class mbe extends aae{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this._register(Lve(this.element,Yve.DRAG_ENTER,(e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter(e)}))),this._register(Lve(this.element,Yve.DRAG_OVER,(e=>{var t,i;e.preventDefault(),null===(i=(t=this.callbacks).onDragOver)||void 0===i||i.call(t,e,e.timeStamp-this.dragStartTime)}))),this._register(Lve(this.element,Yve.DRAG_LEAVE,(e=>{this.counter--,0===this.counter&&(this.dragStartTime=0,this.callbacks.onDragLeave(e))}))),this._register(Lve(this.element,Yve.DRAG_END,(e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd(e)}))),this._register(Lve(this.element,Yve.DROP,(e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop(e)})))}}var fbe=i(7170),_be={};_be.styleTagTransform=Vr(),_be.setAttributes=Pr(),_be.insert=Rr().bind(null,"head"),_be.domAPI=Tr(),_be.insertStyleElement=Br(),Ir()(fbe.Z,_be),fbe.Z&&fbe.Z.locals&&fbe.Z.locals;const vbe=2e4;let bbe,wbe,Cbe,ybe,Sbe;function kbe(e){bbe&&(wbe.textContent!==e?(yve(Cbe),xbe(wbe,e)):(yve(wbe),xbe(Cbe,e)))}function Lbe(e){bbe&&(tse?kbe(e):ybe.textContent!==e?(yve(Sbe),xbe(ybe,e)):(yve(ybe),xbe(Sbe,e)))}function xbe(e,t){yve(e),t.length>vbe&&(t=t.substr(0,vbe)),e.textContent=t,e.style.visibility="hidden",e.style.visibility="visible"}const Dbe=pce("markerDecorationsService"),Ebe=pce("textModelService");var Nbe,Ibe,Mbe=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Tbe extends aae{constructor(e,t="",i="",n=!0,o){super(),this._onDidChange=this._register(new bae),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=n,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}run(e,t){return Mbe(this,void 0,void 0,(function*(){this._actionCallback&&(yield this._actionCallback(e))}))}}class Abe extends aae{constructor(){super(...arguments),this._onWillRun=this._register(new bae),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new bae),this.onDidRun=this._onDidRun.event}run(e,t){return Mbe(this,void 0,void 0,(function*(){if(!e.enabled)return;let i;this._onWillRun.fire({action:e});try{yield this.runAction(e,t)}catch(e){i=e}this._onDidRun.fire({action:e,error:i})}))}runAction(e,t){return Mbe(this,void 0,void 0,(function*(){yield e.run(t)}))}}class Rbe{constructor(){this.id=Rbe.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const i of e)i.length&&(t=t.length?[...t,new Rbe,...i]:i);return t}run(){return Mbe(this,void 0,void 0,(function*(){}))}}Rbe.ID="vs.actions.separator";class Obe{get actions(){return this._actions}constructor(e,t,i,n){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=n,this._actions=i}run(){return Mbe(this,void 0,void 0,(function*(){}))}}class Pbe extends Tbe{constructor(){super(Pbe.ID,Toe(0,"(empty)"),void 0,!1)}}function Fbe(e){var t,i;return{id:e.id,label:e.label,class:void 0,enabled:null===(t=e.enabled)||void 0===t||t,checked:null!==(i=e.checked)&&void 0!==i&&i,run:()=>Mbe(this,void 0,void 0,(function*(){return e.run()})),tooltip:e.label}}Pbe.ID="vs.actions.empty",function(e){e.isThemeColor=function(e){return e&&"object"==typeof e&&"string"==typeof e.id}}(Nbe||(Nbe={})),function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9-]+",e.iconModifierExpression="~[A-Za-z]+",e.iconNameCharacter="[A-Za-z0-9~-]";const t=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function i(e){const n=t.exec(e.id);if(!n)return i(Vle.error);const[,o,s]=n,r=["codicon","codicon-"+o];return s&&r.push("codicon-modifier-"+s.substring(1)),r}e.asClassNameArray=i,e.asClassName=function(e){return i(e).join(" ")},e.asCSSSelector=function(e){return"."+i(e).join(".")},e.isThemeIcon=function(e){return e&&"object"==typeof e&&"string"==typeof e.id&&(void 0===e.color||Nbe.isThemeColor(e.color))};const n=new RegExp(`^\\$\\((${e.iconNameExpression}(?:${e.iconModifierExpression})?)\\)$`);e.fromString=function(e){const t=n.exec(e);if(!t)return;const[,i]=t;return{id:i}},e.fromId=function(e){return{id:e}},e.modify=function(e,t){let i=e.id;const n=i.lastIndexOf("~");return-1!==n&&(i=i.substring(0,n)),t&&(i=`${i}~${t}`),{id:i}},e.getModifier=function(e){const t=e.id.lastIndexOf("~");if(-1!==t)return e.id.substring(t+1)},e.isEqual=function(e,t){var i,n;return e.id===t.id&&(null===(i=e.color)||void 0===i?void 0:i.id)===(null===(n=t.color)||void 0===n?void 0:n.id)}}(Ibe||(Ibe={}));const Bbe=pce("commandService"),Wbe=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new bae,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,t){if(!e)throw new Error("invalid command");if("string"==typeof e){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t})}if(e.description){const t=[];for(const i of e.description.args)t.push(i.constraint);const i=e.handler;e.handler=function(e,...n){return function(e,t){const i=Math.min(e.length,t.length);for(let n=0;n<i;n++)tre(e[n],t[n])}(n,t),i(e,...n)}}const{id:i}=e;let n=this._commands.get(i);n||(n=new Cse,this._commands.set(i,n));const o=n.unshift(e),s=sae((()=>{o();const e=this._commands.get(i);(null==e?void 0:e.isEmpty())&&this._commands.delete(i)}));return this._onDidRegisterCommand.fire(i),s}registerCommandAlias(e,t){return Wbe.registerCommand(e,((e,...i)=>e.get(Bbe).executeCommand(t,...i)))}getCommand(e){const t=this._commands.get(e);if(t&&!t.isEmpty())return bse.first(t)}getCommands(){const e=new Map;for(const t of this._commands.keys()){const i=this.getCommand(t);i&&e.set(t,i)}return e}};Wbe.registerCommand("noop",(()=>{}));class Vbe{constructor(){this._coreKeybindings=new Cse,this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(1===cse){if(e&&e.win)return e.win}else if(2===cse){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=Vbe.bindToCurrentPlatform(e),i=new rae;if(t&&t.primary){const n=r_e(t.primary,cse);n&&i.add(this._registerDefaultKeybinding(n,e.id,e.args,e.weight,0,e.when))}if(t&&Array.isArray(t.secondary))for(let n=0,o=t.secondary.length;n<o;n++){const o=r_e(t.secondary[n],cse);o&&i.add(this._registerDefaultKeybinding(o,e.id,e.args,e.weight,-n-1,e.when))}return i}registerCommandAndKeybindingRule(e){return oae(this.registerKeybindingRule(e),Wbe.registerCommand(e))}_registerDefaultKeybinding(e,t,i,n,o,s){const r=this._coreKeybindings.push({keybinding:e,command:t,commandArgs:i,when:s,weight1:n,weight2:o,extensionId:null,isBuiltinExtension:!1});return this._cachedMergedKeybindings=null,sae((()=>{r(),this._cachedMergedKeybindings=null}))}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(Hbe)),this._cachedMergedKeybindings.slice(0)}}const zbe=new Vbe;function Hbe(e,t){if(e.weight1!==t.weight1)return e.weight1-t.weight1;if(e.command&&t.command){if(e.command<t.command)return-1;if(e.command>t.command)return 1}return e.weight2-t.weight2}rge.add("platform.keybindingsRegistry",zbe);var Ube=function(e,t){return function(i,n){t(i,n,e)}};function Kbe(e){return void 0!==e.command}class jbe{constructor(e){if(jbe._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);jbe._instances.set(e,this),this.id=e}}jbe._instances=new Map,jbe.CommandPalette=new jbe("CommandPalette"),jbe.DebugBreakpointsContext=new jbe("DebugBreakpointsContext"),jbe.DebugCallStackContext=new jbe("DebugCallStackContext"),jbe.DebugConsoleContext=new jbe("DebugConsoleContext"),jbe.DebugVariablesContext=new jbe("DebugVariablesContext"),jbe.DebugWatchContext=new jbe("DebugWatchContext"),jbe.DebugToolBar=new jbe("DebugToolBar"),jbe.DebugToolBarStop=new jbe("DebugToolBarStop"),jbe.EditorContext=new jbe("EditorContext"),jbe.SimpleEditorContext=new jbe("SimpleEditorContext"),jbe.EditorContent=new jbe("EditorContent"),jbe.EditorContextCopy=new jbe("EditorContextCopy"),jbe.EditorContextPeek=new jbe("EditorContextPeek"),jbe.EditorContextShare=new jbe("EditorContextShare"),jbe.EditorTitle=new jbe("EditorTitle"),jbe.EditorTitleRun=new jbe("EditorTitleRun"),jbe.EditorTitleContext=new jbe("EditorTitleContext"),jbe.EmptyEditorGroup=new jbe("EmptyEditorGroup"),jbe.EmptyEditorGroupContext=new jbe("EmptyEditorGroupContext"),jbe.ExplorerContext=new jbe("ExplorerContext"),jbe.ExtensionContext=new jbe("ExtensionContext"),jbe.GlobalActivity=new jbe("GlobalActivity"),jbe.CommandCenter=new jbe("CommandCenter"),jbe.LayoutControlMenuSubmenu=new jbe("LayoutControlMenuSubmenu"),jbe.LayoutControlMenu=new jbe("LayoutControlMenu"),jbe.MenubarMainMenu=new jbe("MenubarMainMenu"),jbe.MenubarAppearanceMenu=new jbe("MenubarAppearanceMenu"),jbe.MenubarDebugMenu=new jbe("MenubarDebugMenu"),jbe.MenubarEditMenu=new jbe("MenubarEditMenu"),jbe.MenubarCopy=new jbe("MenubarCopy"),jbe.MenubarFileMenu=new jbe("MenubarFileMenu"),jbe.MenubarGoMenu=new jbe("MenubarGoMenu"),jbe.MenubarHelpMenu=new jbe("MenubarHelpMenu"),jbe.MenubarLayoutMenu=new jbe("MenubarLayoutMenu"),jbe.MenubarNewBreakpointMenu=new jbe("MenubarNewBreakpointMenu"),jbe.PanelAlignmentMenu=new jbe("PanelAlignmentMenu"),jbe.PanelPositionMenu=new jbe("PanelPositionMenu"),jbe.MenubarPreferencesMenu=new jbe("MenubarPreferencesMenu"),jbe.MenubarRecentMenu=new jbe("MenubarRecentMenu"),jbe.MenubarSelectionMenu=new jbe("MenubarSelectionMenu"),jbe.MenubarShare=new jbe("MenubarShare"),jbe.MenubarSwitchEditorMenu=new jbe("MenubarSwitchEditorMenu"),jbe.MenubarSwitchGroupMenu=new jbe("MenubarSwitchGroupMenu"),jbe.MenubarTerminalMenu=new jbe("MenubarTerminalMenu"),jbe.MenubarViewMenu=new jbe("MenubarViewMenu"),jbe.MenubarHomeMenu=new jbe("MenubarHomeMenu"),jbe.OpenEditorsContext=new jbe("OpenEditorsContext"),jbe.ProblemsPanelContext=new jbe("ProblemsPanelContext"),jbe.SCMChangeContext=new jbe("SCMChangeContext"),jbe.SCMResourceContext=new jbe("SCMResourceContext"),jbe.SCMResourceFolderContext=new jbe("SCMResourceFolderContext"),jbe.SCMResourceGroupContext=new jbe("SCMResourceGroupContext"),jbe.SCMSourceControl=new jbe("SCMSourceControl"),jbe.SCMTitle=new jbe("SCMTitle"),jbe.SearchContext=new jbe("SearchContext"),jbe.SearchActionMenu=new jbe("SearchActionContext"),jbe.StatusBarWindowIndicatorMenu=new jbe("StatusBarWindowIndicatorMenu"),jbe.StatusBarRemoteIndicatorMenu=new jbe("StatusBarRemoteIndicatorMenu"),jbe.StickyScrollContext=new jbe("StickyScrollContext"),jbe.TestItem=new jbe("TestItem"),jbe.TestItemGutter=new jbe("TestItemGutter"),jbe.TestPeekElement=new jbe("TestPeekElement"),jbe.TestPeekTitle=new jbe("TestPeekTitle"),jbe.TouchBarContext=new jbe("TouchBarContext"),jbe.TitleBarContext=new jbe("TitleBarContext"),jbe.TitleBarTitleContext=new jbe("TitleBarTitleContext"),jbe.TunnelContext=new jbe("TunnelContext"),jbe.TunnelPrivacy=new jbe("TunnelPrivacy"),jbe.TunnelProtocol=new jbe("TunnelProtocol"),jbe.TunnelPortInline=new jbe("TunnelInline"),jbe.TunnelTitle=new jbe("TunnelTitle"),jbe.TunnelLocalAddressInline=new jbe("TunnelLocalAddressInline"),jbe.TunnelOriginInline=new jbe("TunnelOriginInline"),jbe.ViewItemContext=new jbe("ViewItemContext"),jbe.ViewContainerTitle=new jbe("ViewContainerTitle"),jbe.ViewContainerTitleContext=new jbe("ViewContainerTitleContext"),jbe.ViewTitle=new jbe("ViewTitle"),jbe.ViewTitleContext=new jbe("ViewTitleContext"),jbe.CommentEditorActions=new jbe("CommentEditorActions"),jbe.CommentThreadTitle=new jbe("CommentThreadTitle"),jbe.CommentThreadActions=new jbe("CommentThreadActions"),jbe.CommentThreadAdditionalActions=new jbe("CommentThreadAdditionalActions"),jbe.CommentThreadTitleContext=new jbe("CommentThreadTitleContext"),jbe.CommentThreadCommentContext=new jbe("CommentThreadCommentContext"),jbe.CommentTitle=new jbe("CommentTitle"),jbe.CommentActions=new jbe("CommentActions"),jbe.InteractiveToolbar=new jbe("InteractiveToolbar"),jbe.InteractiveCellTitle=new jbe("InteractiveCellTitle"),jbe.InteractiveCellDelete=new jbe("InteractiveCellDelete"),jbe.InteractiveCellExecute=new jbe("InteractiveCellExecute"),jbe.InteractiveInputExecute=new jbe("InteractiveInputExecute"),jbe.NotebookToolbar=new jbe("NotebookToolbar"),jbe.NotebookCellTitle=new jbe("NotebookCellTitle"),jbe.NotebookCellDelete=new jbe("NotebookCellDelete"),jbe.NotebookCellInsert=new jbe("NotebookCellInsert"),jbe.NotebookCellBetween=new jbe("NotebookCellBetween"),jbe.NotebookCellListTop=new jbe("NotebookCellTop"),jbe.NotebookCellExecute=new jbe("NotebookCellExecute"),jbe.NotebookCellExecutePrimary=new jbe("NotebookCellExecutePrimary"),jbe.NotebookDiffCellInputTitle=new jbe("NotebookDiffCellInputTitle"),jbe.NotebookDiffCellMetadataTitle=new jbe("NotebookDiffCellMetadataTitle"),jbe.NotebookDiffCellOutputsTitle=new jbe("NotebookDiffCellOutputsTitle"),jbe.NotebookOutputToolbar=new jbe("NotebookOutputToolbar"),jbe.NotebookEditorLayoutConfigure=new jbe("NotebookEditorLayoutConfigure"),jbe.NotebookKernelSource=new jbe("NotebookKernelSource"),jbe.BulkEditTitle=new jbe("BulkEditTitle"),jbe.BulkEditContext=new jbe("BulkEditContext"),jbe.TimelineItemContext=new jbe("TimelineItemContext"),jbe.TimelineTitle=new jbe("TimelineTitle"),jbe.TimelineTitleContext=new jbe("TimelineTitleContext"),jbe.TimelineFilterSubMenu=new jbe("TimelineFilterSubMenu"),jbe.AccountsContext=new jbe("AccountsContext"),jbe.PanelTitle=new jbe("PanelTitle"),jbe.AuxiliaryBarTitle=new jbe("AuxiliaryBarTitle"),jbe.TerminalInstanceContext=new jbe("TerminalInstanceContext"),jbe.TerminalEditorInstanceContext=new jbe("TerminalEditorInstanceContext"),jbe.TerminalNewDropdownContext=new jbe("TerminalNewDropdownContext"),jbe.TerminalTabContext=new jbe("TerminalTabContext"),jbe.TerminalTabEmptyAreaContext=new jbe("TerminalTabEmptyAreaContext"),jbe.TerminalInlineTabContext=new jbe("TerminalInlineTabContext"),jbe.WebviewContext=new jbe("WebviewContext"),jbe.InlineCompletionsActions=new jbe("InlineCompletionsActions"),jbe.NewFile=new jbe("NewFile"),jbe.MergeInput1Toolbar=new jbe("MergeToolbar1Toolbar"),jbe.MergeInput2Toolbar=new jbe("MergeToolbar2Toolbar"),jbe.MergeBaseToolbar=new jbe("MergeBaseToolbar"),jbe.MergeInputResultToolbar=new jbe("MergeToolbarResultToolbar"),jbe.InlineSuggestionToolbar=new jbe("InlineSuggestionToolbar");const qbe=pce("menuService");class $be{static for(e){let t=this._all.get(e);return t||(t=new $be(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof $be&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}}$be._all=new Map;const Gbe=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Lae({merge:$be.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(e){return this._commands.set(e.id,e),this._onDidChangeMenu.fire($be.for(jbe.CommandPalette)),sae((()=>{this._commands.delete(e.id)&&this._onDidChangeMenu.fire($be.for(jbe.CommandPalette))}))}getCommand(e){return this._commands.get(e)}getCommands(){const e=new Map;return this._commands.forEach(((t,i)=>e.set(i,t))),e}appendMenuItem(e,t){let i=this._menuItems.get(e);i||(i=new Cse,this._menuItems.set(e,i));const n=i.push(t);return this._onDidChangeMenu.fire($be.for(e)),sae(n)}appendMenuItems(e){const t=new rae;for(const{id:i,item:n}of e)t.add(this.appendMenuItem(i,n));return t}getMenuItems(e){let t;return t=this._menuItems.has(e)?[...this._menuItems.get(e)]:[],e===jbe.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(e){const t=new Set;for(const i of e)Kbe(i)&&(t.add(i.command.id),i.alt&&t.add(i.alt.id));this._commands.forEach(((i,n)=>{t.has(n)||e.push({command:i})}))}};class Zbe extends Obe{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,"string"==typeof e.title?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let Ybe=class e{static label(e,t){return(null==t?void 0:t.renderShortTitle)&&e.shortTitle?"string"==typeof e.shortTitle?e.shortTitle:e.shortTitle.value:"string"==typeof e.title?e.title:e.title.value}constructor(t,i,n,o,s,r){var a,l;if(this.hideActions=o,this._commandService=r,this.id=t.id,this.label=e.label(t,n),this.tooltip=null!==(l="string"==typeof t.tooltip?t.tooltip:null===(a=t.tooltip)||void 0===a?void 0:a.value)&&void 0!==l?l:"",this.enabled=!t.precondition||s.contextMatchesRules(t.precondition),this.checked=void 0,t.toggled){const e=t.toggled.condition?t.toggled:{condition:t.toggled};this.checked=s.contextMatchesRules(e.condition),this.checked&&e.tooltip&&(this.tooltip="string"==typeof e.tooltip?e.tooltip:e.tooltip.value),e.title&&(this.label="string"==typeof e.title?e.title:e.title.value)}this.item=t,this.alt=i?new e(i,void 0,n,o,s,r):void 0,this._options=n,Ibe.isThemeIcon(t.icon)&&(this.class=Ibe.asClassName(t.icon))}run(...e){var t,i;let n=[];return(null===(t=this._options)||void 0===t?void 0:t.arg)&&(n=[...n,this._options.arg]),(null===(i=this._options)||void 0===i?void 0:i.shouldForwardArgs)&&(n=[...n,...e]),this._commandService.executeCommand(this.id,...n)}};Ybe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Ube(4,qce),Ube(5,Bbe)],Ybe);const Qbe=pce("telemetryService");class Xbe{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let e=t.kbExpr;this.precondition&&(e=e?Lce.and(e,this.precondition):this.precondition);const i={id:this.id,weight:t.weight,args:t.args,when:e,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};zbe.registerKeybindingRule(i)}}Wbe.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){Gbe.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}}class Jbe extends Xbe{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i){return this._implementations.push({priority:e,name:t,implementation:i}),this._implementations.sort(((e,t)=>t.priority-e.priority)),{dispose:()=>{for(let e=0;e<this._implementations.length;e++)if(this._implementations[e].implementation===i)return void this._implementations.splice(e,1)}}}runCommand(e,t){const i=e.get(Gme);i.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);for(const n of this._implementations){const o=n.implementation(e,t);if(o){if(i.trace(`Command '${this.id}' was handled by '${n.name}'.`),"boolean"==typeof o)return;return o}}i.trace(`The Command '${this.id}' was not handled by any implementation.`)}}class ewe extends Xbe{constructor(e,t){super(t),this.command=e}runCommand(e,t){return this.command.runCommand(e,t)}}class twe extends Xbe{static bindToContribution(e){return class extends twe{constructor(e){super(e),this._callback=e.handler}runEditorCommand(t,i,n){const o=e(i);o&&this._callback(o,n)}}}static runEditorCommand(e,t,i,n){const o=e.get(mce),s=o.getFocusedCodeEditor()||o.getActiveCodeEditor();if(s)return s.invokeWithinContext((e=>{if(e.get(qce).contextMatchesRules(ire(i)))return n(e,s,t)}))}runCommand(e,t){return twe.runEditorCommand(e,t,this.precondition,((e,t,i)=>this.runEditorCommand(e,t,i)))}}class iwe extends twe{static convertOptions(e){let t;function i(t){return t.menuId||(t.menuId=jbe.EditorContext),t.title||(t.title=e.label),t.when=Lce.and(e.precondition,t.when),t}return t=Array.isArray(e.menuOpts)?e.menuOpts:e.menuOpts?[e.menuOpts]:[],Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(iwe.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(Qbe).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}function nwe(e){return awe.INSTANCE.registerEditorCommand(e),e}function owe(e){const t=new e;return awe.INSTANCE.registerEditorAction(t),t}function swe(e,t,i){awe.INSTANCE.registerEditorContribution(e,t,i)}var rwe;!function(e){e.getEditorCommand=function(e){return awe.INSTANCE.getEditorCommand(e)},e.getEditorActions=function(){return awe.INSTANCE.getEditorActions()},e.getEditorContributions=function(){return awe.INSTANCE.getEditorContributions()},e.getSomeEditorContributions=function(e){return awe.INSTANCE.getEditorContributions().filter((t=>e.indexOf(t.id)>=0))},e.getDiffEditorContributions=function(){return awe.INSTANCE.getDiffEditorContributions()}}(rwe||(rwe={}));class awe{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}function lwe(e){return e.register(),e}awe.INSTANCE=new awe,rge.add("editor.contributions",awe.INSTANCE);const hwe=lwe(new Jbe({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:jbe.MenubarEditMenu,group:"1_do",title:Toe(0,"&&Undo"),order:1},{menuId:jbe.CommandPalette,group:"",title:Toe(0,"Undo"),order:1}]}));lwe(new ewe(hwe,{id:"default:undo",precondition:void 0}));const dwe=lwe(new Jbe({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:jbe.MenubarEditMenu,group:"1_do",title:Toe(0,"&&Redo"),order:2},{menuId:jbe.CommandPalette,group:"",title:Toe(0,"Redo"),order:1}]}));lwe(new ewe(dwe,{id:"default:redo",precondition:void 0}));const cwe=lwe(new Jbe({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:jbe.MenubarSelectionMenu,group:"1_basic",title:Toe(0,"&&Select All"),order:1},{menuId:jbe.CommandPalette,group:"",title:Toe(0,"Select All"),order:1}]}));let uwe=class{constructor(e,t){}dispose(){}};uwe.ID="editor.contrib.markerDecorations",uwe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,Dbe)],uwe),swe(uwe.ID,uwe,0);var gwe=i(8073),pwe={};pwe.styleTagTransform=Vr(),pwe.setAttributes=Pr(),pwe.insert=Rr().bind(null,"head"),pwe.domAPI=Tr(),pwe.insertStyleElement=Br(),Ir()(gwe.Z,pwe),gwe.Z&&gwe.Z.locals&&gwe.Z.locals;class mwe extends aae{constructor(e,t){super(),this._onDidChange=this._register(new bae),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){!this._resizeObserver&&this._referenceDomElement&&(this._resizeObserver=new ResizeObserver((e=>{e&&e[0]&&e[0].contentRect?this.observe({width:e[0].contentRect.width,height:e[0].contentRect.height}):this.observe()})),this._resizeObserver.observe(this._referenceDomElement))}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,n=0;t?(i=t.width,n=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,n=this._referenceDomElement.clientHeight),i=Math.max(5,i),n=Math.max(5,n),this._width===i&&this._height===n||(this._width=i,this._height=n,e&&this._onDidChange.fire())}}class fwe{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=fwe._read(e,this.key);this.migrate(t,(t=>fwe._read(e,t)),((t,i)=>fwe._write(e,t,i)))}static _read(e,t){if(void 0===e)return;const i=t.indexOf(".");if(i>=0){const n=t.substring(0,i);return this._read(e[n],t.substring(i+1))}return e[t]}static _write(e,t,i){const n=t.indexOf(".");if(n>=0){const o=t.substring(0,n);return e[o]=e[o]||{},void this._write(e[o],t.substring(n+1),i)}e[t]=i}}function _we(e,t){fwe.items.push(new fwe(e,t))}function vwe(e,t){_we(e,((i,n,o)=>{if(void 0!==i)for(const[n,s]of t)if(i===n)return void o(e,s)}))}fwe.items=[],vwe("wordWrap",[[!0,"on"],[!1,"off"]]),vwe("lineNumbers",[[!0,"on"],[!1,"off"]]),vwe("cursorBlinking",[["visible","solid"]]),vwe("renderWhitespace",[[!0,"boundary"],[!1,"none"]]),vwe("renderLineHighlight",[[!0,"line"],[!1,"none"]]),vwe("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]),vwe("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]),vwe("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),vwe("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),vwe("autoIndent",[[!1,"advanced"],[!0,"full"]]),vwe("matchBrackets",[[!0,"always"],[!1,"never"]]),vwe("renderFinalNewline",[[!0,"on"],[!1,"off"]]),vwe("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]),_we("autoClosingBrackets",((e,t,i)=>{!1===e&&(i("autoClosingBrackets","never"),void 0===t("autoClosingQuotes")&&i("autoClosingQuotes","never"),void 0===t("autoSurround")&&i("autoSurround","never"))})),_we("renderIndentGuides",((e,t,i)=>{void 0!==e&&(i("renderIndentGuides",void 0),void 0===t("guides.indentation")&&i("guides.indentation",!!e))})),_we("highlightActiveIndentGuide",((e,t,i)=>{void 0!==e&&(i("highlightActiveIndentGuide",void 0),void 0===t("guides.highlightActiveIndentation")&&i("guides.highlightActiveIndentation",!!e))}));const bwe={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};_we("suggest.filteredTypes",((e,t,i)=>{if(e&&"object"==typeof e){for(const n of Object.entries(bwe))!1===e[n[0]]&&void 0===t(`suggest.${n[1]}`)&&i(`suggest.${n[1]}`,!1);i("suggest.filteredTypes",void 0)}})),_we("quickSuggestions",((e,t,i)=>{if("boolean"==typeof e){const t=e?"on":"off";i("quickSuggestions",{comments:t,strings:t,other:t})}})),_we("experimental.stickyScroll.enabled",((e,t,i)=>{"boolean"==typeof e&&(i("experimental.stickyScroll.enabled",void 0),void 0===t("stickyScroll.enabled")&&i("stickyScroll.enabled",e))})),_we("experimental.stickyScroll.maxLineCount",((e,t,i)=>{"number"==typeof e&&(i("experimental.stickyScroll.maxLineCount",void 0),void 0===t("stickyScroll.maxLineCount")&&i("stickyScroll.maxLineCount",e))}));const wwe=new class{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new bae,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus!==e&&(this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus))}};let Cwe=class extends aae{constructor(e,t,i,n){super(),this._accessibilityService=n,this._onDidChange=this._register(new bae),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new bae),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._computeOptionsMemory=new ure,this.isSimpleWidget=e,this._containerObserver=this._register(new mwe(i,t.dimension)),this._rawOptions=xwe(t),this._validatedOptions=Lwe.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(10)&&this._containerObserver.startObserving(),this._register(rce.onDidChangeZoomLevel((()=>this._recomputeOptions()))),this._register(wwe.onDidChangeTabFocus((()=>this._recomputeOptions()))),this._register(this._containerObserver.onDidChange((()=>this._recomputeOptions()))),this._register(cce.onDidChange((()=>this._recomputeOptions()))),this._register(Hde.onDidChange((()=>this._recomputeOptions()))),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized((()=>this._recomputeOptions())))}_recomputeOptions(){const e=this._computeOptions(),t=Lwe.checkEquals(this.options,e);null!==t&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=lce.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),n={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:wwe.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport};return Lwe.computeOptions(this._validatedOptions,n)}_readEnvConfiguration(){return{extraEditorClassName:ywe(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:qde||jde,pixelRatio:Hde.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return cce.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=xwe(e);Lwe.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=Lwe.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){const t=function(e){let t=0;for(;e;)e=Math.floor(e/10),t++;return t||1}(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}};function ywe(){let e="";return Gde||Zde||(e+="no-user-select "),Gde&&(e+="no-minimap-shadow ",e+="enable-user-select "),tse&&(e+="mac "),e}Cwe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(3,Xce)],Cwe);class Swe{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class kwe{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}}class Lwe{static validateOptions(e){const t=new Swe;for(const i of Fre){const n="_never_"===i.name?void 0:e[i.name];t._write(i.id,i.validate(n))}return t}static computeOptions(e,t){const i=new kwe;for(const n of Fre)i._write(n.id,n.compute(t,i,e._read(n.id)));return i}static _deepEquals(e,t){if("object"!=typeof e||"object"!=typeof t||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return!(!Array.isArray(e)||!Array.isArray(t))&&Nse(e,t);if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!Lwe._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const o of Fre){const s=!Lwe._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=s,s&&(n=!0)}return n?new cre(i):null}static applyUpdate(e,t){let i=!1;for(const n of Fre)if(t.hasOwnProperty(n.name)){const o=n.applyUpdate(e[n.name],t[n.name]);e[n.name]=o.newValue,i=i||o.didChange}return i}}function xwe(e){const t=nre(e);return function(e){fwe.items.forEach((t=>t.apply(e)))}(t),t}function Dwe(e,t,i){let n=null,o=null;if("function"==typeof i.value?(n="value",o=i.value,0!==o.length&&console.warn("Memoize should only be used in functions with zero parameters")):"function"==typeof i.get&&(n="get",o=i.get),!o)throw new Error("not supported");const s=`$memoize$${t}`;i[n]=function(...e){return this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,e)}),this[s]}}var Ewe;!function(e){e.Tap="-monaco-gesturetap",e.Change="-monaco-gesturechange",e.Start="-monaco-gesturestart",e.End="-monaco-gesturesend",e.Contextmenu="-monaco-gesturecontextmenu"}(Ewe||(Ewe={}));class Nwe extends aae{constructor(){super(),this.dispatched=!1,this.targets=new Cse,this.ignoreTargets=new Cse,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Lve(document,"touchstart",(e=>this.onTouchStart(e)),{passive:!1})),this._register(Lve(document,"touchend",(e=>this.onTouchEnd(e)))),this._register(Lve(document,"touchmove",(e=>this.onTouchMove(e)),{passive:!1}))}static addTarget(e){return Nwe.isTouchDevice()?(Nwe.INSTANCE||(Nwe.INSTANCE=new Nwe),sae(Nwe.INSTANCE.targets.push(e))):aae.None}static ignoreTarget(e){return Nwe.isTouchDevice()?(Nwe.INSTANCE||(Nwe.INSTANCE=new Nwe),sae(Nwe.INSTANCE.ignoreTargets.push(e))):aae.None}static isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,n=e.targetTouches.length;i<n;i++){const n=e.targetTouches.item(i);this.activeTouches[n.identifier]={id:n.identifier,initialTarget:n.target,initialTimeStamp:t,initialPageX:n.pageX,initialPageY:n.pageY,rollingTimestamps:[t],rollingPageX:[n.pageX],rollingPageY:[n.pageY]};const o=this.newGestureEvent(Ewe.Start,n.target);o.pageX=n.pageX,o.pageY=n.pageY,this.dispatchEvent(o)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e){const t=Date.now(),i=Object.keys(this.activeTouches).length;for(let n=0,o=e.changedTouches.length;n<o;n++){const o=e.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn("move of an UNKNOWN touch",o);continue}const s=this.activeTouches[o.identifier],r=Date.now()-s.initialTimeStamp;if(r<Nwe.HOLD_DELAY&&Math.abs(s.initialPageX-Ese(s.rollingPageX))<30&&Math.abs(s.initialPageY-Ese(s.rollingPageY))<30){const e=this.newGestureEvent(Ewe.Tap,s.initialTarget);e.pageX=Ese(s.rollingPageX),e.pageY=Ese(s.rollingPageY),this.dispatchEvent(e)}else if(r>=Nwe.HOLD_DELAY&&Math.abs(s.initialPageX-Ese(s.rollingPageX))<30&&Math.abs(s.initialPageY-Ese(s.rollingPageY))<30){const e=this.newGestureEvent(Ewe.Contextmenu,s.initialTarget);e.pageX=Ese(s.rollingPageX),e.pageY=Ese(s.rollingPageY),this.dispatchEvent(e)}else if(1===i){const e=Ese(s.rollingPageX),i=Ese(s.rollingPageY),n=Ese(s.rollingTimestamps)-s.rollingTimestamps[0],o=e-s.rollingPageX[0],r=i-s.rollingPageY[0],a=[...this.targets].filter((e=>s.initialTarget instanceof Node&&e.contains(s.initialTarget)));this.inertia(a,t,Math.abs(o)/n,o>0?1:-1,e,Math.abs(r)/n,r>0?1:-1,i)}this.dispatchEvent(this.newGestureEvent(Ewe.End,s.initialTarget)),delete this.activeTouches[o.identifier]}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===Ewe.Tap){const t=(new Date).getTime();let i=0;i=t-this._lastSetTapCountTime>Nwe.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=t,e.tapCount=i}else e.type!==Ewe.Change&&e.type!==Ewe.Contextmenu||(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const t of this.ignoreTargets)if(t.contains(e.initialTarget))return;for(const t of this.targets)t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)}}inertia(e,t,i,n,o,s,r,a){this.handle=Eve((()=>{const l=Date.now(),h=l-t;let d=0,c=0,u=!0;i+=Nwe.SCROLL_FRICTION*h,s+=Nwe.SCROLL_FRICTION*h,i>0&&(u=!1,d=n*i*h),s>0&&(u=!1,c=r*s*h);const g=this.newGestureEvent(Ewe.Change);g.translationX=d,g.translationY=c,e.forEach((e=>e.dispatchEvent(g))),u||this.inertia(e,l,i,n,o+d,s,r,a+c)}))}onTouchMove(e){const t=Date.now();for(let i=0,n=e.changedTouches.length;i<n;i++){const n=e.changedTouches.item(i);if(!this.activeTouches.hasOwnProperty(String(n.identifier))){console.warn("end of an UNKNOWN touch",n);continue}const o=this.activeTouches[n.identifier],s=this.newGestureEvent(Ewe.Change,o.initialTarget);s.translationX=n.pageX-Ese(o.rollingPageX),s.translationY=n.pageY-Ese(o.rollingPageY),s.pageX=n.pageX,s.pageY=n.pageY,this.dispatchEvent(s),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(n.pageX),o.rollingPageY.push(n.pageY),o.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}Nwe.SCROLL_FRICTION=-.005,Nwe.HOLD_DELAY=700,Nwe.CLEAR_TAP_COUNT_TIME=400,function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);s>3&&r&&Object.defineProperty(t,i,r)}([Dwe],Nwe,"isTouchDevice",null);class Iwe{constructor(){this._hooks=new rae,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,n,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=o;let s=e;try{e.setPointerCapture(t),this._hooks.add(sae((()=>{try{e.releasePointerCapture(t)}catch(e){}})))}catch(e){s=window}this._hooks.add(Lve(s,Yve.POINTER_MOVE,(e=>{e.buttons===i?(e.preventDefault(),this._pointerMoveCallback(e)):this.stopMonitoring(!0)}))),this._hooks.add(Lve(s,Yve.POINTER_UP,(e=>this.stopMonitoring(!0))))}}function Mwe(e,t){const i=Math.pow(10,t);return Math.round(e*i)/i}class Twe{constructor(e,t,i,n=1){this._rgbaBrand=void 0,this.r=0|Math.min(255,Math.max(0,e)),this.g=0|Math.min(255,Math.max(0,t)),this.b=0|Math.min(255,Math.max(0,i)),this.a=Mwe(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class Awe{constructor(e,t,i,n){this._hslaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=Mwe(Math.max(Math.min(1,t),0),3),this.l=Mwe(Math.max(Math.min(1,i),0),3),this.a=Mwe(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,n=e.b/255,o=e.a,s=Math.max(t,i,n),r=Math.min(t,i,n);let a=0,l=0;const h=(r+s)/2,d=s-r;if(d>0){switch(l=Math.min(h<=.5?d/(2*h):d/(2-2*h),1),s){case t:a=(i-n)/d+(i<n?6:0);break;case i:a=(n-t)/d+2;break;case n:a=(t-i)/d+4}a*=60,a=Math.round(a)}return new Awe(a,l,h,o)}static _hue2rgb(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:n,a:o}=e;let s,r,a;if(0===i)s=r=a=n;else{const e=n<.5?n*(1+i):n+i-n*i,o=2*n-e;s=Awe._hue2rgb(o,e,t+1/3),r=Awe._hue2rgb(o,e,t),a=Awe._hue2rgb(o,e,t-1/3)}return new Twe(Math.round(255*s),Math.round(255*r),Math.round(255*a),o)}}class Rwe{constructor(e,t,i,n){this._hsvaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=Mwe(Math.max(Math.min(1,t),0),3),this.v=Mwe(Math.max(Math.min(1,i),0),3),this.a=Mwe(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,n=e.b/255,o=Math.max(t,i,n),s=o-Math.min(t,i,n),r=0===o?0:s/o;let a;return a=0===s?0:o===t?((i-n)/s%6+6)%6:o===i?(n-t)/s+2:(t-i)/s+4,new Rwe(Math.round(60*a),r,o,e.a)}static toRGBA(e){const{h:t,s:i,v:n,a:o}=e,s=n*i,r=s*(1-Math.abs(t/60%2-1)),a=n-s;let[l,h,d]=[0,0,0];return t<60?(l=s,h=r):t<120?(l=r,h=s):t<180?(h=s,d=r):t<240?(h=r,d=s):t<300?(l=r,d=s):t<=360&&(l=s,d=r),l=Math.round(255*(l+a)),h=Math.round(255*(h+a)),d=Math.round(255*(d+a)),new Twe(l,h,d,o)}}class Owe{static fromHex(e){return Owe.Format.CSS.parseHex(e)||Owe.red}static equals(e,t){return!e&&!t||!(!e||!t)&&e.equals(t)}get hsla(){return this._hsla?this._hsla:Awe.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:Rwe.fromRGBA(this.rgba)}constructor(e){if(!e)throw new Error("Color needs a value");if(e instanceof Twe)this.rgba=e;else if(e instanceof Awe)this._hsla=e,this.rgba=Awe.toRGBA(e);else{if(!(e instanceof Rwe))throw new Error("Invalid color ctor argument");this._hsva=e,this.rgba=Rwe.toRGBA(e)}}equals(e){return!!e&&Twe.equals(this.rgba,e.rgba)&&Awe.equals(this.hsla,e.hsla)&&Rwe.equals(this.hsva,e.hsva)}getRelativeLuminance(){return Mwe(.2126*Owe._relativeLuminanceForComponent(this.rgba.r)+.7152*Owe._relativeLuminanceForComponent(this.rgba.g)+.0722*Owe._relativeLuminanceForComponent(this.rgba.b),4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3>=128}isLighterThan(e){return this.getRelativeLuminance()>e.getRelativeLuminance()}isDarkerThan(e){return this.getRelativeLuminance()<e.getRelativeLuminance()}lighten(e){return new Owe(new Awe(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*e,this.hsla.a))}darken(e){return new Owe(new Awe(this.hsla.h,this.hsla.s,this.hsla.l-this.hsla.l*e,this.hsla.a))}transparent(e){const{r:t,g:i,b:n,a:o}=this.rgba;return new Owe(new Twe(t,i,n,o*e))}isTransparent(){return 0===this.rgba.a}isOpaque(){return 1===this.rgba.a}opposite(){return new Owe(new Twe(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}toString(){return this._toString||(this._toString=Owe.Format.CSS.format(this)),this._toString}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;const n=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(o-n)/o,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;const n=e.getRelativeLuminance();return i=i*(n-t.getRelativeLuminance())/n,e.darken(i)}}function Pwe(e){return`--vscode-${e.replace(/\./g,"-")}`}function Fwe(e){return`var(${Pwe(e)})`}function Bwe(e,t){return`var(${Pwe(e)}, ${t})`}Owe.white=new Owe(new Twe(255,255,255,1)),Owe.black=new Owe(new Twe(0,0,0,1)),Owe.red=new Owe(new Twe(255,0,0,1)),Owe.blue=new Owe(new Twe(0,0,255,1)),Owe.green=new Owe(new Twe(0,255,0,1)),Owe.cyan=new Owe(new Twe(0,255,255,1)),Owe.lightgrey=new Owe(new Twe(211,211,211,1)),Owe.transparent=new Owe(new Twe(0,0,0,0)),function(e){let t;!function(t){let i;!function(t){function i(e){const t=e.toString(16);return 2!==t.length?"0"+t:t}function n(e){switch(e){case 48:return 0;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case 97:case 65:return 10;case 98:case 66:return 11;case 99:case 67:return 12;case 100:case 68:return 13;case 101:case 69:return 14;case 102:case 70:return 15}return 0}t.formatRGB=function(t){return 1===t.rgba.a?`rgb(${t.rgba.r}, ${t.rgba.g}, ${t.rgba.b})`:e.Format.CSS.formatRGBA(t)},t.formatRGBA=function(e){return`rgba(${e.rgba.r}, ${e.rgba.g}, ${e.rgba.b}, ${+e.rgba.a.toFixed(2)})`},t.formatHSL=function(t){return 1===t.hsla.a?`hsl(${t.hsla.h}, ${(100*t.hsla.s).toFixed(2)}%, ${(100*t.hsla.l).toFixed(2)}%)`:e.Format.CSS.formatHSLA(t)},t.formatHSLA=function(e){return`hsla(${e.hsla.h}, ${(100*e.hsla.s).toFixed(2)}%, ${(100*e.hsla.l).toFixed(2)}%, ${e.hsla.a.toFixed(2)})`},t.formatHex=function(e){return`#${i(e.rgba.r)}${i(e.rgba.g)}${i(e.rgba.b)}`},t.formatHexA=function(t,n=!1){return n&&1===t.rgba.a?e.Format.CSS.formatHex(t):`#${i(t.rgba.r)}${i(t.rgba.g)}${i(t.rgba.b)}${i(Math.round(255*t.rgba.a))}`},t.format=function(t){return t.isOpaque()?e.Format.CSS.formatHex(t):e.Format.CSS.formatRGBA(t)},t.parseHex=function(t){const i=t.length;if(0===i)return null;if(35!==t.charCodeAt(0))return null;if(7===i){const i=16*n(t.charCodeAt(1))+n(t.charCodeAt(2)),o=16*n(t.charCodeAt(3))+n(t.charCodeAt(4)),s=16*n(t.charCodeAt(5))+n(t.charCodeAt(6));return new e(new Twe(i,o,s,1))}if(9===i){const i=16*n(t.charCodeAt(1))+n(t.charCodeAt(2)),o=16*n(t.charCodeAt(3))+n(t.charCodeAt(4)),s=16*n(t.charCodeAt(5))+n(t.charCodeAt(6)),r=16*n(t.charCodeAt(7))+n(t.charCodeAt(8));return new e(new Twe(i,o,s,r/255))}if(4===i){const i=n(t.charCodeAt(1)),o=n(t.charCodeAt(2)),s=n(t.charCodeAt(3));return new e(new Twe(16*i+i,16*o+o,16*s+s))}if(5===i){const i=n(t.charCodeAt(1)),o=n(t.charCodeAt(2)),s=n(t.charCodeAt(3)),r=n(t.charCodeAt(4));return new e(new Twe(16*i+i,16*o+o,16*s+s,(16*r+r)/255))}return null}}(i=t.CSS||(t.CSS={}))}(t=e.Format||(e.Format={}))}(Owe||(Owe={}));const Wwe="base.contributions.colors",Vwe=new class{constructor(){this._onDidChangeSchema=new bae,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,n=!1,o){const s={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:o};this.colorsById[e]=s;const r={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(r.deprecationMessage=o),this.colorSchema.properties[e]=r,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map((e=>this.colorsById[e]))}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults)return ySe(i.defaults[t.type],t)}getColorSchema(){return this.colorSchema}toString(){return Object.keys(this.colorsById).sort(((e,t)=>{const i=-1===e.indexOf(".")?0:1,n=-1===t.indexOf(".")?0:1;return i!==n?i-n:e.localeCompare(t)})).map((e=>`- \`${e}\`: ${this.colorsById[e].description}`)).join("\n")}};function zwe(e,t,i,n,o){return Vwe.registerColor(e,(null===(s=t)||void 0===s.hcLight&&(null===s.hcDark||"string"==typeof s.hcDark?s.hcLight=s.hcDark:s.hcLight=s.light),s),i,n,o);var s}rge.add(Wwe,Vwe);const Hwe=zwe("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},Toe(0,"Overall foreground color. This color is only used if not overridden by a component.")),Uwe=(zwe("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},Toe(0,"Overall foreground for disabled elements. This color is only used if not overridden by a component.")),zwe("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},Toe(0,"Overall foreground color for error messages. This color is only used if not overridden by a component.")),zwe("descriptionForeground",{light:"#717171",dark:bSe(Hwe,.7),hcDark:bSe(Hwe,.7),hcLight:bSe(Hwe,.7)},Toe(0,"Foreground color for description text providing additional information, for example for a label.")),zwe("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},Toe(0,"The default color for icons in the workbench.")),zwe("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},Toe(0,"Overall border color for focused elements. This color is only used if not overridden by a component."))),Kwe=zwe("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},Toe(0,"An extra border around elements to separate them from others for greater contrast.")),jwe=zwe("contrastActiveBorder",{light:null,dark:null,hcDark:Uwe,hcLight:Uwe},Toe(0,"An extra border around active elements to separate them from others for greater contrast.")),qwe=(zwe("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},Toe(0,"The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor.")),zwe("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:Owe.black,hcLight:"#292929"},Toe(0,"Color for text separators.")),zwe("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},Toe(0,"Foreground color for links in text."))),$we=(zwe("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},Toe(0,"Foreground color for links in text when clicked on and on mouse hover.")),zwe("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#D7BA7D",hcLight:"#292929"},Toe(0,"Foreground color for preformatted text segments.")),zwe("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hcDark:null,hcLight:"#F2F2F2"},Toe(0,"Background color for block quotes in text.")),zwe("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:Owe.white,hcLight:"#292929"},Toe(0,"Border color for block quotes in text.")),zwe("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:Owe.black,hcLight:"#F2F2F2"},Toe(0,"Background color for code blocks in text.")),zwe("widget.shadow",{dark:bSe(Owe.black,.36),light:bSe(Owe.black,.16),hcDark:null,hcLight:null},Toe(0,"Shadow color of widgets such as find/replace inside the editor."))),Gwe=zwe("widget.border",{dark:null,light:null,hcDark:Kwe,hcLight:Kwe},Toe(0,"Border color of widgets such as find/replace inside the editor.")),Zwe=zwe("input.background",{dark:"#3C3C3C",light:Owe.white,hcDark:Owe.black,hcLight:Owe.white},Toe(0,"Input box background.")),Ywe=zwe("input.foreground",{dark:Hwe,light:Hwe,hcDark:Hwe,hcLight:Hwe},Toe(0,"Input box foreground.")),Qwe=zwe("input.border",{dark:null,light:null,hcDark:Kwe,hcLight:Kwe},Toe(0,"Input box border.")),Xwe=zwe("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:Kwe,hcLight:Kwe},Toe(0,"Border color of activated options in input fields.")),Jwe=(zwe("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},Toe(0,"Background color of activated options in input fields.")),zwe("inputOption.activeBackground",{dark:bSe(Uwe,.4),light:bSe(Uwe,.2),hcDark:Owe.transparent,hcLight:Owe.transparent},Toe(0,"Background hover color of options in input fields."))),eCe=zwe("inputOption.activeForeground",{dark:Owe.white,light:Owe.black,hcDark:Hwe,hcLight:Hwe},Toe(0,"Foreground color of activated options in input fields.")),tCe=(zwe("input.placeholderForeground",{light:bSe(Hwe,.5),dark:bSe(Hwe,.5),hcDark:bSe(Hwe,.7),hcLight:bSe(Hwe,.7)},Toe(0,"Input box foreground color for placeholder text.")),zwe("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:Owe.black,hcLight:Owe.white},Toe(0,"Input validation background color for information severity."))),iCe=zwe("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:Hwe},Toe(0,"Input validation foreground color for information severity.")),nCe=zwe("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:Kwe,hcLight:Kwe},Toe(0,"Input validation border color for information severity.")),oCe=zwe("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:Owe.black,hcLight:Owe.white},Toe(0,"Input validation background color for warning severity.")),sCe=zwe("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:Hwe},Toe(0,"Input validation foreground color for warning severity.")),rCe=zwe("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:Kwe,hcLight:Kwe},Toe(0,"Input validation border color for warning severity.")),aCe=zwe("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:Owe.black,hcLight:Owe.white},Toe(0,"Input validation background color for error severity.")),lCe=zwe("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:Hwe},Toe(0,"Input validation foreground color for error severity.")),hCe=zwe("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:Kwe,hcLight:Kwe},Toe(0,"Input validation border color for error severity.")),dCe=zwe("dropdown.background",{dark:"#3C3C3C",light:Owe.white,hcDark:Owe.black,hcLight:Owe.white},Toe(0,"Dropdown background.")),cCe=zwe("dropdown.listBackground",{dark:null,light:null,hcDark:Owe.black,hcLight:Owe.white},Toe(0,"Dropdown list background.")),uCe=zwe("dropdown.foreground",{dark:"#F0F0F0",light:Hwe,hcDark:Owe.white,hcLight:Hwe},Toe(0,"Dropdown foreground.")),gCe=zwe("dropdown.border",{dark:dCe,light:"#CECECE",hcDark:Kwe,hcLight:Kwe},Toe(0,"Dropdown border.")),pCe=zwe("button.foreground",{dark:Owe.white,light:Owe.white,hcDark:Owe.white,hcLight:Owe.white},Toe(0,"Button foreground color.")),mCe=zwe("button.separator",{dark:bSe(pCe,.4),light:bSe(pCe,.4),hcDark:bSe(pCe,.4),hcLight:bSe(pCe,.4)},Toe(0,"Button separator color.")),fCe=zwe("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},Toe(0,"Button background color.")),_Ce=zwe("button.hoverBackground",{dark:vSe(fCe,.2),light:_Se(fCe,.2),hcDark:fCe,hcLight:fCe},Toe(0,"Button background color when hovering.")),vCe=zwe("button.border",{dark:Kwe,light:Kwe,hcDark:Kwe,hcLight:Kwe},Toe(0,"Button border color.")),bCe=zwe("button.secondaryForeground",{dark:Owe.white,light:Owe.white,hcDark:Owe.white,hcLight:Hwe},Toe(0,"Secondary button foreground color.")),wCe=zwe("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:Owe.white},Toe(0,"Secondary button background color.")),CCe=zwe("button.secondaryHoverBackground",{dark:vSe(wCe,.2),light:_Se(wCe,.2),hcDark:null,hcLight:null},Toe(0,"Secondary button background color when hovering.")),yCe=zwe("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:Owe.black,hcLight:"#0F4A85"},Toe(0,"Badge background color. Badges are small information labels, e.g. for search results count.")),SCe=zwe("badge.foreground",{dark:Owe.white,light:"#333",hcDark:Owe.white,hcLight:Owe.white},Toe(0,"Badge foreground color. Badges are small information labels, e.g. for search results count.")),kCe=zwe("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},Toe(0,"Scrollbar shadow to indicate that the view is scrolled.")),LCe=zwe("scrollbarSlider.background",{dark:Owe.fromHex("#797979").transparent(.4),light:Owe.fromHex("#646464").transparent(.4),hcDark:bSe(Kwe,.6),hcLight:bSe(Kwe,.4)},Toe(0,"Scrollbar slider background color.")),xCe=zwe("scrollbarSlider.hoverBackground",{dark:Owe.fromHex("#646464").transparent(.7),light:Owe.fromHex("#646464").transparent(.7),hcDark:bSe(Kwe,.8),hcLight:bSe(Kwe,.8)},Toe(0,"Scrollbar slider background color when hovering.")),DCe=zwe("scrollbarSlider.activeBackground",{dark:Owe.fromHex("#BFBFBF").transparent(.4),light:Owe.fromHex("#000000").transparent(.6),hcDark:Kwe,hcLight:Kwe},Toe(0,"Scrollbar slider background color when clicked on.")),ECe=zwe("progressBar.background",{dark:Owe.fromHex("#0E70C0"),light:Owe.fromHex("#0E70C0"),hcDark:Kwe,hcLight:Kwe},Toe(0,"Background color of the progress bar that can show for long running operations.")),NCe=(zwe("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),zwe("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},Toe(0,"Foreground color of error squigglies in the editor."))),ICe=(zwe("editorError.border",{dark:null,light:null,hcDark:Owe.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},Toe(0,"Border color of error boxes in the editor.")),zwe("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),zwe("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD37",hcLight:"#895503"},Toe(0,"Foreground color of warning squigglies in the editor."))),MCe=zwe("editorWarning.border",{dark:null,light:null,hcDark:Owe.fromHex("#FFCC00").transparent(.8),hcLight:"#"},Toe(0,"Border color of warning boxes in the editor.")),TCe=(zwe("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),zwe("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},Toe(0,"Foreground color of info squigglies in the editor."))),ACe=zwe("editorInfo.border",{dark:null,light:null,hcDark:Owe.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},Toe(0,"Border color of info boxes in the editor.")),RCe=zwe("editorHint.foreground",{dark:Owe.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},Toe(0,"Foreground color of hint squigglies in the editor.")),OCe=(zwe("editorHint.border",{dark:null,light:null,hcDark:Owe.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},Toe(0,"Border color of hint boxes in the editor.")),zwe("sash.hoverBorder",{dark:Uwe,light:Uwe,hcDark:Uwe,hcLight:Uwe},Toe(0,"Border color of active sashes.")),zwe("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:Owe.black,hcLight:Owe.white},Toe(0,"Editor background color."))),PCe=zwe("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:Owe.white,hcLight:Hwe},Toe(0,"Editor default foreground color.")),FCe=(zwe("editorStickyScroll.background",{light:OCe,dark:OCe,hcDark:OCe,hcLight:OCe},Toe(0,"Sticky scroll background color for the editor")),zwe("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:Owe.fromHex("#0F4A85").transparent(.1)},Toe(0,"Sticky scroll on hover background color for the editor")),zwe("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:Owe.white},Toe(0,"Background color of editor widgets, such as find/replace."))),BCe=zwe("editorWidget.foreground",{dark:Hwe,light:Hwe,hcDark:Hwe,hcLight:Hwe},Toe(0,"Foreground color of editor widgets, such as find/replace.")),WCe=zwe("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:Kwe,hcLight:Kwe},Toe(0,"Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.")),VCe=(zwe("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},Toe(0,"Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")),zwe("quickInput.background",{dark:FCe,light:FCe,hcDark:FCe,hcLight:FCe},Toe(0,"Quick picker background color. The quick picker widget is the container for pickers like the command palette."))),zCe=zwe("quickInput.foreground",{dark:BCe,light:BCe,hcDark:BCe,hcLight:BCe},Toe(0,"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),HCe=zwe("quickInputTitle.background",{dark:new Owe(new Twe(255,255,255,.105)),light:new Owe(new Twe(0,0,0,.06)),hcDark:"#000000",hcLight:Owe.white},Toe(0,"Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),UCe=zwe("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:Owe.white,hcLight:"#0F4A85"},Toe(0,"Quick picker color for grouping labels.")),KCe=zwe("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:Owe.white,hcLight:"#0F4A85"},Toe(0,"Quick picker color for grouping borders.")),jCe=zwe("keybindingLabel.background",{dark:new Owe(new Twe(128,128,128,.17)),light:new Owe(new Twe(221,221,221,.4)),hcDark:Owe.transparent,hcLight:Owe.transparent},Toe(0,"Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),qCe=zwe("keybindingLabel.foreground",{dark:Owe.fromHex("#CCCCCC"),light:Owe.fromHex("#555555"),hcDark:Owe.white,hcLight:Hwe},Toe(0,"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),$Ce=zwe("keybindingLabel.border",{dark:new Owe(new Twe(51,51,51,.6)),light:new Owe(new Twe(204,204,204,.4)),hcDark:new Owe(new Twe(111,195,223)),hcLight:Kwe},Toe(0,"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),GCe=zwe("keybindingLabel.bottomBorder",{dark:new Owe(new Twe(68,68,68,.6)),light:new Owe(new Twe(187,187,187,.4)),hcDark:new Owe(new Twe(111,195,223)),hcLight:Hwe},Toe(0,"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),ZCe=zwe("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},Toe(0,"Color of the editor selection.")),YCe=zwe("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:Owe.white},Toe(0,"Color of the selected text for high contrast.")),QCe=zwe("editor.inactiveSelectionBackground",{light:bSe(ZCe,.5),dark:bSe(ZCe,.5),hcDark:bSe(ZCe,.7),hcLight:bSe(ZCe,.5)},Toe(0,"Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),XCe=zwe("editor.selectionHighlightBackground",{light:CSe(ZCe,OCe,.3,.6),dark:CSe(ZCe,OCe,.3,.6),hcDark:null,hcLight:null},Toe(0,"Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0),JCe=(zwe("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:jwe,hcLight:jwe},Toe(0,"Border color for regions with the same content as the selection.")),zwe("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},Toe(0,"Color of the current search match.")),zwe("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},Toe(0,"Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0)),eye=(zwe("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},Toe(0,"Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),zwe("editor.findMatchBorder",{light:null,dark:null,hcDark:jwe,hcLight:jwe},Toe(0,"Border color of the current search match.")),zwe("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:jwe,hcLight:jwe},Toe(0,"Border color of the other search matches."))),tye=(zwe("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:bSe(jwe,.4),hcLight:bSe(jwe,.4)},Toe(0,"Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),zwe("searchEditor.findMatchBackground",{light:bSe(JCe,.66),dark:bSe(JCe,.66),hcDark:JCe,hcLight:JCe},Toe(0,"Color of the Search Editor query matches.")),zwe("searchEditor.findMatchBorder",{light:bSe(eye,.66),dark:bSe(eye,.66),hcDark:eye,hcLight:eye},Toe(0,"Border color of the Search Editor query matches.")),zwe("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},Toe(0,"Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),zwe("editorHoverWidget.background",{light:FCe,dark:FCe,hcDark:FCe,hcLight:FCe},Toe(0,"Background color of the editor hover."))),iye=(zwe("editorHoverWidget.foreground",{light:BCe,dark:BCe,hcDark:BCe,hcLight:BCe},Toe(0,"Foreground color of the editor hover.")),zwe("editorHoverWidget.border",{light:WCe,dark:WCe,hcDark:WCe,hcLight:WCe},Toe(0,"Border color of the editor hover.")),zwe("editorHoverWidget.statusBarBackground",{dark:vSe(tye,.2),light:_Se(tye,.05),hcDark:FCe,hcLight:FCe},Toe(0,"Background color of the editor hover status bar.")),zwe("editorLink.activeForeground",{dark:"#4E94CE",light:Owe.blue,hcDark:Owe.cyan,hcLight:"#292929"},Toe(0,"Color of active links.")),zwe("editorInlayHint.foreground",{dark:SCe,light:SCe,hcDark:Owe.black,hcLight:SCe},Toe(0,"Foreground color of inline hints"))),nye=zwe("editorInlayHint.background",{dark:bSe(yCe,.8),light:bSe(yCe,.6),hcDark:"#f38518",hcLight:yCe},Toe(0,"Background color of inline hints")),oye=(zwe("editorInlayHint.typeForeground",{dark:iye,light:iye,hcDark:iye,hcLight:iye},Toe(0,"Foreground color of inline hints for types")),zwe("editorInlayHint.typeBackground",{dark:nye,light:nye,hcDark:nye,hcLight:nye},Toe(0,"Background color of inline hints for types")),zwe("editorInlayHint.parameterForeground",{dark:iye,light:iye,hcDark:iye,hcLight:iye},Toe(0,"Foreground color of inline hints for parameters")),zwe("editorInlayHint.parameterBackground",{dark:nye,light:nye,hcDark:nye,hcLight:nye},Toe(0,"Background color of inline hints for parameters")),zwe("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},Toe(0,"The color used for the lightbulb actions icon.")),zwe("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},Toe(0,"The color used for the lightbulb auto fix actions icon.")),new Owe(new Twe(155,185,85,.2))),sye=new Owe(new Twe(255,0,0,.2)),rye=zwe("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},Toe(0,"Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),aye=zwe("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},Toe(0,"Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),lye=(zwe("diffEditor.insertedLineBackground",{dark:oye,light:oye,hcDark:null,hcLight:null},Toe(0,"Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),zwe("diffEditor.removedLineBackground",{dark:sye,light:sye,hcDark:null,hcLight:null},Toe(0,"Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),zwe("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"Background color for the margin where lines got inserted.")),zwe("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"Background color for the margin where lines got removed.")),zwe("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"Diff overview ruler foreground for inserted content."))),hye=zwe("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"Diff overview ruler foreground for removed content.")),dye=(zwe("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},Toe(0,"Outline color for the text that got inserted.")),zwe("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},Toe(0,"Outline color for text that got removed.")),zwe("diffEditor.border",{dark:null,light:null,hcDark:Kwe,hcLight:Kwe},Toe(0,"Border color between the two text editors.")),zwe("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},Toe(0,"Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."))),cye=zwe("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),uye=zwe("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),gye=zwe("list.focusOutline",{dark:Uwe,light:Uwe,hcDark:jwe,hcLight:jwe},Toe(0,"List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),pye=zwe("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),mye=zwe("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:Owe.fromHex("#0F4A85").transparent(.1)},Toe(0,"List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),fye=zwe("list.activeSelectionForeground",{dark:Owe.white,light:Owe.white,hcDark:null,hcLight:null},Toe(0,"List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),_ye=zwe("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),vye=zwe("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:Owe.fromHex("#0F4A85").transparent(.1)},Toe(0,"List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),bye=zwe("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),wye=zwe("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Cye=zwe("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),yye=zwe("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Sye=zwe("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:Owe.fromHex("#0F4A85").transparent(.1)},Toe(0,"List/Tree background when hovering over items using the mouse.")),kye=zwe("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"List/Tree foreground when hovering over items using the mouse.")),Lye=zwe("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},Toe(0,"List/Tree drag and drop background when moving items around using the mouse.")),xye=zwe("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Uwe,hcLight:Uwe},Toe(0,"List/Tree foreground color of the match highlights when searching inside the list/tree.")),Dye=(zwe("list.focusHighlightForeground",{dark:xye,light:function(e,t,i){return{op:5,if:e,then:t,else:"#BBE7FF"}}(mye,xye),hcDark:xye,hcLight:xye},Toe(0,"List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.")),zwe("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},Toe(0,"List/Tree foreground color for invalid items, for example an unresolved root in explorer.")),zwe("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},Toe(0,"Foreground color of list items containing errors.")),zwe("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},Toe(0,"Foreground color of list items containing warnings.")),zwe("listFilterWidget.background",{light:_Se(FCe,0),dark:vSe(FCe,0),hcDark:FCe,hcLight:FCe},Toe(0,"Background color of the type filter widget in lists and trees."))),Eye=zwe("listFilterWidget.outline",{dark:Owe.transparent,light:Owe.transparent,hcDark:"#f38518",hcLight:"#007ACC"},Toe(0,"Outline color of the type filter widget in lists and trees.")),Nye=zwe("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:Kwe,hcLight:Kwe},Toe(0,"Outline color of the type filter widget in lists and trees, when there are no matches.")),Iye=zwe("listFilterWidget.shadow",{dark:$we,light:$we,hcDark:$we,hcLight:$we},Toe(0,"Shadown color of the type filter widget in lists and trees.")),Mye=(zwe("list.filterMatchBackground",{dark:JCe,light:JCe,hcDark:null,hcLight:null},Toe(0,"Background color of the filtered match.")),zwe("list.filterMatchBorder",{dark:eye,light:eye,hcDark:Kwe,hcLight:jwe},Toe(0,"Border color of the filtered match.")),zwe("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},Toe(0,"Tree stroke color for the indentation guides."))),Tye=zwe("tree.inactiveIndentGuidesStroke",{dark:bSe(Mye,.4),light:bSe(Mye,.4),hcDark:bSe(Mye,.4),hcLight:bSe(Mye,.4)},Toe(0,"Tree stroke color for the indentation guides that are not active.")),Aye=zwe("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},Toe(0,"Table border color between columns.")),Rye=zwe("tree.tableOddRowsBackground",{dark:bSe(Hwe,.04),light:bSe(Hwe,.04),hcDark:null,hcLight:null},Toe(0,"Background color for odd table rows.")),Oye=(zwe("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},Toe(0,"List/Tree foreground color for items that are deemphasized. ")),zwe("checkbox.background",{dark:dCe,light:dCe,hcDark:dCe,hcLight:dCe},Toe(0,"Background color of checkbox widget."))),Pye=(zwe("checkbox.selectBackground",{dark:FCe,light:FCe,hcDark:FCe,hcLight:FCe},Toe(0,"Background color of checkbox widget when the element it's in is selected.")),zwe("checkbox.foreground",{dark:uCe,light:uCe,hcDark:uCe,hcLight:uCe},Toe(0,"Foreground color of checkbox widget."))),Fye=zwe("checkbox.border",{dark:gCe,light:gCe,hcDark:gCe,hcLight:gCe},Toe(0,"Border color of checkbox widget.")),Bye=(zwe("checkbox.selectBorder",{dark:FCe,light:FCe,hcDark:FCe,hcLight:FCe},Toe(0,"Border color of checkbox widget when the element it's in is selected.")),zwe("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,Toe(0,"Please use quickInputList.focusBackground instead"))),Wye=zwe("quickInputList.focusForeground",{dark:fye,light:fye,hcDark:fye,hcLight:fye},Toe(0,"Quick picker foreground color for the focused item.")),Vye=zwe("quickInputList.focusIconForeground",{dark:_ye,light:_ye,hcDark:_ye,hcLight:_ye},Toe(0,"Quick picker icon foreground color for the focused item.")),zye=zwe("quickInputList.focusBackground",{dark:wSe(Bye,mye),light:wSe(Bye,mye),hcDark:null,hcLight:null},Toe(0,"Quick picker background color for the focused item.")),Hye=zwe("menu.border",{dark:null,light:null,hcDark:Kwe,hcLight:Kwe},Toe(0,"Border color of menus.")),Uye=zwe("menu.foreground",{dark:uCe,light:uCe,hcDark:uCe,hcLight:uCe},Toe(0,"Foreground color of menu items.")),Kye=zwe("menu.background",{dark:dCe,light:dCe,hcDark:dCe,hcLight:dCe},Toe(0,"Background color of menu items.")),jye=zwe("menu.selectionForeground",{dark:fye,light:fye,hcDark:fye,hcLight:fye},Toe(0,"Foreground color of the selected menu item in menus.")),qye=zwe("menu.selectionBackground",{dark:mye,light:mye,hcDark:mye,hcLight:mye},Toe(0,"Background color of the selected menu item in menus.")),$ye=zwe("menu.selectionBorder",{dark:null,light:null,hcDark:jwe,hcLight:jwe},Toe(0,"Border color of the selected menu item in menus.")),Gye=zwe("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:Kwe,hcLight:Kwe},Toe(0,"Color of a separator menu item in menus.")),Zye=zwe("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},Toe(0,"Toolbar background when hovering over actions using the mouse")),Yye=(zwe("toolbar.hoverOutline",{dark:null,light:null,hcDark:jwe,hcLight:jwe},Toe(0,"Toolbar outline when hovering over actions using the mouse")),zwe("toolbar.activeBackground",{dark:vSe(Zye,.1),light:_Se(Zye,.1),hcDark:null,hcLight:null},Toe(0,"Toolbar background when holding the mouse over actions")),zwe("editor.snippetTabstopHighlightBackground",{dark:new Owe(new Twe(124,124,124,.3)),light:new Owe(new Twe(10,50,100,.2)),hcDark:new Owe(new Twe(124,124,124,.3)),hcLight:new Owe(new Twe(10,50,100,.2))},Toe(0,"Highlight background color of a snippet tabstop.")),zwe("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"Highlight border color of a snippet tabstop.")),zwe("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"Highlight background color of the final tabstop of a snippet.")),zwe("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new Owe(new Twe(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},Toe(0,"Highlight border color of the final tabstop of a snippet.")),zwe("breadcrumb.foreground",{light:bSe(Hwe,.8),dark:bSe(Hwe,.8),hcDark:bSe(Hwe,.8),hcLight:bSe(Hwe,.8)},Toe(0,"Color of focused breadcrumb items."))),Qye=zwe("breadcrumb.background",{light:OCe,dark:OCe,hcDark:OCe,hcLight:OCe},Toe(0,"Background color of breadcrumb items.")),Xye=zwe("breadcrumb.focusForeground",{light:_Se(Hwe,.2),dark:vSe(Hwe,.1),hcDark:vSe(Hwe,.1),hcLight:vSe(Hwe,.1)},Toe(0,"Color of focused breadcrumb items.")),Jye=zwe("breadcrumb.activeSelectionForeground",{light:_Se(Hwe,.2),dark:vSe(Hwe,.1),hcDark:vSe(Hwe,.1),hcLight:vSe(Hwe,.1)},Toe(0,"Color of selected breadcrumb items.")),eSe=(zwe("breadcrumbPicker.background",{light:FCe,dark:FCe,hcDark:FCe,hcLight:FCe},Toe(0,"Background color of breadcrumb item picker.")),Owe.fromHex("#40C8AE").transparent(.5)),tSe=Owe.fromHex("#40A6FF").transparent(.5),iSe=Owe.fromHex("#606060").transparent(.4),nSe=.4,oSe=zwe("merge.currentHeaderBackground",{dark:eSe,light:eSe,hcDark:null,hcLight:null},Toe(0,"Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),sSe=(zwe("merge.currentContentBackground",{dark:bSe(oSe,nSe),light:bSe(oSe,nSe),hcDark:bSe(oSe,nSe),hcLight:bSe(oSe,nSe)},Toe(0,"Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),zwe("merge.incomingHeaderBackground",{dark:tSe,light:tSe,hcDark:null,hcLight:null},Toe(0,"Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0)),rSe=(zwe("merge.incomingContentBackground",{dark:bSe(sSe,nSe),light:bSe(sSe,nSe),hcDark:bSe(sSe,nSe),hcLight:bSe(sSe,nSe)},Toe(0,"Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),zwe("merge.commonHeaderBackground",{dark:iSe,light:iSe,hcDark:null,hcLight:null},Toe(0,"Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0)),aSe=(zwe("merge.commonContentBackground",{dark:bSe(rSe,nSe),light:bSe(rSe,nSe),hcDark:bSe(rSe,nSe),hcLight:bSe(rSe,nSe)},Toe(0,"Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),zwe("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},Toe(0,"Border color on headers and the splitter in inline merge-conflicts."))),lSe=(zwe("editorOverviewRuler.currentContentForeground",{dark:bSe(oSe,1),light:bSe(oSe,1),hcDark:aSe,hcLight:aSe},Toe(0,"Current overview ruler foreground for inline merge-conflicts.")),zwe("editorOverviewRuler.incomingContentForeground",{dark:bSe(sSe,1),light:bSe(sSe,1),hcDark:aSe,hcLight:aSe},Toe(0,"Incoming overview ruler foreground for inline merge-conflicts.")),zwe("editorOverviewRuler.commonContentForeground",{dark:bSe(rSe,1),light:bSe(rSe,1),hcDark:aSe,hcLight:aSe},Toe(0,"Common ancestor overview ruler foreground for inline merge-conflicts.")),zwe("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},Toe(0,"Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),zwe("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},Toe(0,"Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),zwe("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},Toe(0,"Minimap marker color for find matches."),!0)),hSe=(zwe("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},Toe(0,"Minimap marker color for repeating editor selections."),!0),zwe("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},Toe(0,"Minimap marker color for the editor selection."),!0)),dSe=zwe("minimap.errorHighlight",{dark:new Owe(new Twe(255,18,18,.7)),light:new Owe(new Twe(255,18,18,.7)),hcDark:new Owe(new Twe(255,50,50,1)),hcLight:"#B5200D"},Toe(0,"Minimap marker color for errors.")),cSe=zwe("minimap.warningHighlight",{dark:ICe,light:ICe,hcDark:MCe,hcLight:MCe},Toe(0,"Minimap marker color for warnings.")),uSe=zwe("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"Minimap background color.")),gSe=zwe("minimap.foregroundOpacity",{dark:Owe.fromHex("#000f"),light:Owe.fromHex("#000f"),hcDark:Owe.fromHex("#000f"),hcLight:Owe.fromHex("#000f")},Toe(0,'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.')),pSe=(zwe("minimapSlider.background",{light:bSe(LCe,.5),dark:bSe(LCe,.5),hcDark:bSe(LCe,.5),hcLight:bSe(LCe,.5)},Toe(0,"Minimap slider background color.")),zwe("minimapSlider.hoverBackground",{light:bSe(xCe,.5),dark:bSe(xCe,.5),hcDark:bSe(xCe,.5),hcLight:bSe(xCe,.5)},Toe(0,"Minimap slider background color when hovering.")),zwe("minimapSlider.activeBackground",{light:bSe(DCe,.5),dark:bSe(DCe,.5),hcDark:bSe(DCe,.5),hcLight:bSe(DCe,.5)},Toe(0,"Minimap slider background color when clicked on.")),zwe("problemsErrorIcon.foreground",{dark:NCe,light:NCe,hcDark:NCe,hcLight:NCe},Toe(0,"The color used for the problems error icon."))),mSe=zwe("problemsWarningIcon.foreground",{dark:ICe,light:ICe,hcDark:ICe,hcLight:ICe},Toe(0,"The color used for the problems warning icon.")),fSe=zwe("problemsInfoIcon.foreground",{dark:TCe,light:TCe,hcDark:TCe,hcLight:TCe},Toe(0,"The color used for the problems info icon."));function _Se(e,t){return{op:0,value:e,factor:t}}function vSe(e,t){return{op:1,value:e,factor:t}}function bSe(e,t){return{op:2,value:e,factor:t}}function wSe(...e){return{op:3,values:e}}function CSe(e,t,i,n){return{op:4,value:e,background:t,factor:i,transparency:n}}function ySe(e,t){if(null!==e)return"string"==typeof e?"#"===e[0]?Owe.fromHex(e):t.getColor(e):e instanceof Owe?e:"object"==typeof e?function(e,t){var i,n,o;switch(e.op){case 0:return null===(i=ySe(e.value,t))||void 0===i?void 0:i.darken(e.factor);case 1:return null===(n=ySe(e.value,t))||void 0===n?void 0:n.lighten(e.factor);case 2:return null===(o=ySe(e.value,t))||void 0===o?void 0:o.transparent(e.factor);case 3:for(const i of e.values){const e=ySe(i,t);if(e)return e}return;case 5:return ySe(t.defines(e.if)?e.then:e.else,t);case 4:{const i=ySe(e.value,t);if(!i)return;const n=ySe(e.background,t);return n?i.isDarkerThan(n)?Owe.getLighterColor(i,n,e.factor).transparent(e.transparency):Owe.getDarkerColor(i,n,e.factor).transparent(e.transparency):i.transparent(e.factor*e.transparency)}default:throw _ce()}}(e,t):void 0}zwe("charts.foreground",{dark:Hwe,light:Hwe,hcDark:Hwe,hcLight:Hwe},Toe(0,"The foreground color used in charts.")),zwe("charts.lines",{dark:bSe(Hwe,.5),light:bSe(Hwe,.5),hcDark:bSe(Hwe,.5),hcLight:bSe(Hwe,.5)},Toe(0,"The color used for horizontal lines in charts.")),zwe("charts.red",{dark:NCe,light:NCe,hcDark:NCe,hcLight:NCe},Toe(0,"The red color used in chart visualizations.")),zwe("charts.blue",{dark:TCe,light:TCe,hcDark:TCe,hcLight:TCe},Toe(0,"The blue color used in chart visualizations.")),zwe("charts.yellow",{dark:ICe,light:ICe,hcDark:ICe,hcLight:ICe},Toe(0,"The yellow color used in chart visualizations.")),zwe("charts.orange",{dark:lSe,light:lSe,hcDark:lSe,hcLight:lSe},Toe(0,"The orange color used in chart visualizations.")),zwe("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},Toe(0,"The green color used in chart visualizations.")),zwe("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},Toe(0,"The purple color used in chart visualizations."));const SSe="vscode://schemas/workbench-colors",kSe=rge.as(lge);kSe.registerSchema(SSe,Vwe.getColorSchema());const LSe=new hpe((()=>kSe.notifySchemaChanged(SSe)),200);Vwe.onDidChangeSchema((()=>{LSe.isScheduled()||LSe.schedule()}));class xSe{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new DSe(this.x-window.scrollX,this.y-window.scrollY)}}class DSe{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new xSe(this.clientX+window.scrollX,this.clientY+window.scrollY)}}class ESe{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}class NSe{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function ISe(e){const t=Rve(e);return new ESe(t.left,t.top,t.width,t.height)}function MSe(e,t,i){const n=t.width/e.offsetWidth,o=t.height/e.offsetHeight,s=(i.x-t.x)/n,r=(i.y-t.y)/o;return new NSe(s,r)}class TSe extends b_e{constructor(e,t,i){super(e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new xSe(this.posx,this.posy),this.editorPos=ISe(i),this.relativePos=MSe(i,this.editorPos,this.pos)}}class ASe{constructor(e){this._editorViewDomNode=e}_create(e){return new TSe(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return Lve(e,"contextmenu",(e=>{t(this._create(e))}))}onMouseUp(e,t){return Lve(e,"mouseup",(e=>{t(this._create(e))}))}onMouseDown(e,t){return Lve(e,Yve.MOUSE_DOWN,(e=>{t(this._create(e))}))}onPointerDown(e,t){return Lve(e,Yve.POINTER_DOWN,(e=>{t(this._create(e),e.pointerId)}))}onMouseLeave(e,t){return Lve(e,Yve.MOUSE_LEAVE,(e=>{t(this._create(e))}))}onMouseMove(e,t){return Lve(e,"mousemove",(e=>t(this._create(e))))}}class RSe{constructor(e){this._editorViewDomNode=e}_create(e){return new TSe(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return Lve(e,"pointerup",(e=>{t(this._create(e))}))}onPointerDown(e,t){return Lve(e,Yve.POINTER_DOWN,(e=>{t(this._create(e),e.pointerId)}))}onPointerLeave(e,t){return Lve(e,Yve.POINTER_LEAVE,(e=>{t(this._create(e))}))}onPointerMove(e,t){return Lve(e,"pointermove",(e=>t(this._create(e))))}}class OSe extends aae{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new Iwe),this._keydownListener=null}startMonitoring(e,t,i,n,o){this._keydownListener=xve(document,"keydown",(e=>{e.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,e.browserEvent)}),!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,(e=>{n(new TSe(e,!0,this._editorViewDomNode))}),(e=>{this._keydownListener.dispose(),o(e)}))}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class PSe{constructor(e){this._editor=e,this._instanceId=++PSe._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new hpe((()=>this.garbageCollect()),1e3)}createClassNameRef(e){const t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const t=this.computeUniqueKey(e);let i=this._rules.get(t);if(!i){const n=this._counter++;i=new FSe(t,`dyn-rule-${this._instanceId}-${n}`,Uve(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}}PSe._idPool=0;class FSe{constructor(e,t,i,n){this.key=e,this.className=t,this.properties=n,this._referenceCount=0,this._styleElement=qve(i),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const e in t){const n=t[e];let o;o="object"==typeof n?Fwe(n.id):n,i+=`\n\t${BSe(e)}: ${o};`}return i+="\n}",i}dispose(){this._styleElement.remove()}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function BSe(e){return e.replace(/(^[A-Z])/,(([e])=>e.toLowerCase())).replace(/([A-Z])/g,(([e])=>`-${e.toLowerCase()}`))}class WSe extends aae{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,n=e.length;i<n;i++){const n=e[i];switch(n.type){case 0:this.onCompositionStart(n)&&(t=!0);break;case 1:this.onCompositionEnd(n)&&(t=!0);break;case 2:this.onConfigurationChanged(n)&&(t=!0);break;case 3:this.onCursorStateChanged(n)&&(t=!0);break;case 4:this.onDecorationsChanged(n)&&(t=!0);break;case 5:this.onFlushed(n)&&(t=!0);break;case 6:this.onFocusChanged(n)&&(t=!0);break;case 7:this.onLanguageConfigurationChanged(n)&&(t=!0);break;case 8:this.onLineMappingChanged(n)&&(t=!0);break;case 9:this.onLinesChanged(n)&&(t=!0);break;case 10:this.onLinesDeleted(n)&&(t=!0);break;case 11:this.onLinesInserted(n)&&(t=!0);break;case 12:this.onRevealRangeRequest(n)&&(t=!0);break;case 13:this.onScrollChanged(n)&&(t=!0);break;case 15:this.onTokensChanged(n)&&(t=!0);break;case 14:this.onThemeChanged(n)&&(t=!0);break;case 16:this.onTokensColorsChanged(n)&&(t=!0);break;case 17:this.onZonesChanged(n)&&(t=!0);break;default:console.info("View received unknown event: "),console.info(n)}}t&&(this._shouldRender=!0)}}class VSe extends WSe{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class zSe{static write(e,t){e.setAttribute("data-mprt",String(t))}static read(e){const t=e.getAttribute("data-mprt");return null===t?0:parseInt(t,10)}static collect(e,t){const i=[];let n=0;for(;e&&e!==document.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(i[n++]=this.read(e)),e=e.parentElement;const o=new Uint8Array(n);for(let e=0;e<n;e++)o[e]=i[n-e-1];return o}}class HSe{constructor(e,t){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;const i=this._viewLayout.getCurrentViewport();this.scrollTop=i.top,this.scrollLeft=i.left,this.viewportWidth=i.width,this.viewportHeight=i.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e,t){return this._viewLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t){return this._viewLayout.getVerticalOffsetAfterLineNumber(e,t)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class USe extends HSe{constructor(e,t,i){super(e,t),this._renderingContextBrand=void 0,this._viewLines=i}linesVisibleRangesForRange(e,t){return this._viewLines.linesVisibleRangesForRange(e,t)}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)}}class KSe{constructor(e,t,i){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i}}class jSe{static from(e){const t=new Array(e.length);for(let i=0,n=e.length;i<n;i++){const n=e[i];t[i]=new jSe(n.left,n.width)}return t}constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}toString(){return`[${this.left},${this.width}]`}}class qSe{constructor(e,t){this._floatHorizontalRangeBrand=void 0,this.left=e,this.width=t}toString(){return`[${this.left},${this.width}]`}static compare(e,t){return e.left-t.left}}class $Se{constructor(e,t){this.outsideRenderedLine=e,this.originalLeft=t,this.left=Math.round(this.originalLeft)}}class GSe{constructor(e,t){this.outsideRenderedLine=e,this.ranges=t}}class ZSe{static _createRange(){return this._handyReadyRange||(this._handyReadyRange=document.createRange()),this._handyReadyRange}static _detachRange(e,t){e.selectNodeContents(t)}static _readClientRects(e,t,i,n,o){const s=this._createRange();try{return s.setStart(e,t),s.setEnd(i,n),s.getClientRects()}catch(e){return null}finally{this._detachRange(s,o)}}static _mergeAdjacentRanges(e){if(1===e.length)return e;e.sort(qSe.compare);const t=[];let i=0,n=e[0];for(let o=1,s=e.length;o<s;o++){const s=e[o];n.left+n.width+.9>=s.left?n.width=Math.max(n.width,s.left+s.width-n.left):(t[i++]=n,n=s)}return t[i++]=n,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||0===e.length)return null;const n=[];for(let o=0,s=e.length;o<s;o++){const s=e[o];n[o]=new qSe(Math.max(0,(s.left-t)/i),s.width/i)}return this._mergeAdjacentRanges(n)}static readHorizontalRanges(e,t,i,n,o,s,r,a){const l=e.children.length-1;if(0>l)return null;if((t=Math.min(l,Math.max(0,t)))===(n=Math.min(l,Math.max(0,n)))&&i===o&&0===i&&!e.children[t].firstChild){const i=e.children[t].getClientRects();return this._createHorizontalRangesFromClientRects(i,s,r)}t!==n&&n>0&&0===o&&(n--,o=1073741824);let h=e.children[t].firstChild,d=e.children[n].firstChild;if(h&&d||(!h&&0===i&&t>0&&(h=e.children[t-1].firstChild,i=1073741824),!d&&0===o&&n>0&&(d=e.children[n-1].firstChild,o=1073741824)),!h||!d)return null;i=Math.min(h.textContent.length,Math.max(0,i)),o=Math.min(d.textContent.length,Math.max(0,o));const c=this._readClientRects(h,i,d,o,a);return this._createHorizontalRangesFromClientRects(c,s,r)}}var YSe;function QSe(e){return e===YSe.HIGH_CONTRAST_DARK||e===YSe.HIGH_CONTRAST_LIGHT}function XSe(e){return e===YSe.DARK||e===YSe.HIGH_CONTRAST_DARK}!function(e){e.DARK="dark",e.LIGHT="light",e.HIGH_CONTRAST_DARK="hcDark",e.HIGH_CONTRAST_LIGHT="hcLight"}(YSe||(YSe={}));const JSe=!!nse||!(ise||jde||Gde);let eke=!0;class tke{readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1,this.endNode=t}}class ike{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(47),o=i.get(35);this.renderWhitespace="off"===o?i.get(93):"none",this.renderControlCharacters=i.get(88),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(30),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(63),this.stopRenderingLineAfter=i.get(111),this.fontLigatures=i.get(48)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}class nke{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(!this._renderedViewLine)throw new Error("I have no rendered view line to set the dom node to...");this._renderedViewLine.domNode=ice(e)}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return!(!QSe(this._options.themeType)&&"selection"!==this._options.renderWhitespace||(this._isMaybeInvalid=!0,0))}renderLine(e,t,i,n){if(!1===this._isMaybeInvalid)return!1;this._isMaybeInvalid=!1;const o=i.getViewLineRenderingData(e),s=this._options,r=mfe.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let a=null;if(QSe(s.themeType)||"selection"===this._options.renderWhitespace){const t=i.selections;for(const i of t){if(i.endLineNumber<e||i.startLineNumber>e)continue;const t=i.startLineNumber===e?i.startColumn:o.minColumn,n=i.endLineNumber===e?i.endColumn:o.maxColumn;t<n&&(QSe(s.themeType)&&r.push(new mfe(t,n,"inline-selected-text",0)),"selection"===this._options.renderWhitespace&&(a||(a=[]),a.push(new wfe(t-1,n-1))))}}const l=new Cfe(s.useMonospaceOptimizations,s.canUseHalfwidthRightwardsArrow,o.content,o.continuesWithWrappedLine,o.isBasicASCII,o.containsRTL,o.minColumn-1,o.tokens,r,o.tabSize,o.startVisibleColumn,s.spaceWidth,s.middotWidth,s.wsmiddotWidth,s.stopRenderingLineAfter,s.renderWhitespace,s.renderControlCharacters,s.fontLigatures!==Ere.OFF,a);if(this._renderedViewLine&&this._renderedViewLine.input.equals(l))return!1;n.appendString('<div style="top:'),n.appendString(String(t)),n.appendString("px;height:"),n.appendString(String(this._options.lineHeight)),n.appendString('px;" class="'),n.appendString(nke.CLASS_NAME),n.appendString('">');const h=Lfe(l,n);n.appendString("</div>");let d=null;return eke&&JSe&&o.isBasicASCII&&s.useMonospaceOptimizations&&0===h.containsForeignElements&&(d=new oke(this._renderedViewLine?this._renderedViewLine.domNode:null,l,h.characterMapping)),d||(d=ake(this._renderedViewLine?this._renderedViewLine.domNode:null,l,h.characterMapping,h.containsRTL,h.containsForeignElements)),this._renderedViewLine=d,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(){return this._renderedViewLine?this._renderedViewLine.getWidth():0}getWidthIsFast(){return!this._renderedViewLine||this._renderedViewLine.getWidthIsFast()}needsMonospaceFontCheck(){return!!this._renderedViewLine&&this._renderedViewLine instanceof oke}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof oke?this._renderedViewLine.monospaceAssumptionsAreValid():eke}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof oke&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,n){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const o=this._renderedViewLine.input.stopRenderingLineAfter;if(-1!==o&&t>o+1&&i>o+1)return new GSe(!0,[new qSe(this.getWidth(),0)]);-1!==o&&t>o+1&&(t=o+1),-1!==o&&i>o+1&&(i=o+1);const s=this._renderedViewLine.getVisibleRangesForRange(e,t,i,n);return s&&s.length>0?new GSe(!1,s):null}getColumnOfNodeOffset(e,t,i){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t,i):1}}nke.CLASS_NAME="view-line";class oke{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const n=Math.floor(t.lineContent.length/300);if(n>0){this._keyColumnPixelOffsetCache=new Float32Array(n);for(let e=0;e<n;e++)this._keyColumnPixelOffsetCache[e]=-1}else this._keyColumnPixelOffsetCache=null;this._characterMapping=i,this._charWidth=t.spaceWidth}getWidth(){if(!this.domNode||this.input.lineContent.length<300){const e=this._characterMapping.getHorizontalOffset(this._characterMapping.length);return Math.round(this._charWidth*e)}return-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth),this._cachedWidth}getWidthIsFast(){return this.input.lineContent.length<300||-1!==this._cachedWidth}monospaceAssumptionsAreValid(){if(!this.domNode)return eke;if(this.input.lineContent.length<300){const e=this.getWidth(),t=this.domNode.domNode.firstChild.offsetWidth;Math.abs(e-t)>=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),eke=!1)}return eke}toSlowRenderedLine(){return ake(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,n){const o=this._getColumnPixelOffset(e,t,n),s=this._getColumnPixelOffset(e,i,n);return[new qSe(o,s-o)]}_getColumnPixelOffset(e,t,i){if(t<=300){const e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}const n=Math.floor((t-1)/300)-1,o=300*(n+1)+1;let s=-1;if(this._keyColumnPixelOffsetCache&&(s=this._keyColumnPixelOffsetCache[n],-1===s&&(s=this._actualReadPixelOffset(e,o,i),this._keyColumnPixelOffsetCache[n]=s)),-1===s){const e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}const r=this._characterMapping.getHorizontalOffset(o),a=this._characterMapping.getHorizontalOffset(t);return s+this._charWidth*(a-r)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const n=this._characterMapping.getDomPosition(t),o=ZSe.readHorizontalRanges(this._getReadingTarget(this.domNode),n.partIndex,n.charIndex,n.partIndex,n.charIndex,i.clientRectDeltaLeft,i.clientRectScale,i.endNode);return o&&0!==o.length?o[0].left:-1}getColumnOfNodeOffset(e,t,i){const n=t.textContent.length;let o=-1;for(;t;)t=t.previousSibling,o++;return this._characterMapping.getColumn(new yfe(o,i),n)}}class ske{constructor(e,t,i,n,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!n||0===this._characterMapping.length){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let e=0,t=this._characterMapping.length;e<=t;e++)this._pixelOffsetCache[e]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(){return this.domNode?(-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth),this._cachedWidth):0}getWidthIsFast(){return-1!==this._cachedWidth}getVisibleRangesForRange(e,t,i,n){if(!this.domNode)return null;if(null!==this._pixelOffsetCache){const o=this._readPixelOffset(this.domNode,e,t,n);if(-1===o)return null;const s=this._readPixelOffset(this.domNode,e,i,n);return-1===s?null:[new qSe(o,s-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,o){if(i===n){const n=this._readPixelOffset(e,t,i,o);return-1===n?null:[new qSe(n,0)]}return this._readRawVisibleRangesForRange(e,i,n,o)}_readPixelOffset(e,t,i,n){if(0===this._characterMapping.length){if(0===this._containsForeignElements)return 0;if(2===this._containsForeignElements)return 0;if(1===this._containsForeignElements)return this.getWidth();const t=this._getReadingTarget(e);return t.firstChild?t.firstChild.offsetWidth:0}if(null!==this._pixelOffsetCache){const o=this._pixelOffsetCache[i];if(-1!==o)return o;const s=this._actualReadPixelOffset(e,t,i,n);return this._pixelOffsetCache[i]=s,s}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(0===this._characterMapping.length){const t=ZSe.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,n.clientRectDeltaLeft,n.clientRectScale,n.endNode);return t&&0!==t.length?t[0].left:-1}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&0===this._containsForeignElements)return this.getWidth();const o=this._characterMapping.getDomPosition(i),s=ZSe.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,n.clientRectDeltaLeft,n.clientRectScale,n.endNode);if(!s||0===s.length)return-1;const r=s[0].left;if(this.input.isBasicASCII){const e=this._characterMapping.getHorizontalOffset(i),t=Math.round(this.input.spaceWidth*e);if(Math.abs(t-r)<=1)return t}return r}_readRawVisibleRangesForRange(e,t,i,n){if(1===t&&i===this._characterMapping.length)return[new qSe(0,this.getWidth())];const o=this._characterMapping.getDomPosition(t),s=this._characterMapping.getDomPosition(i);return ZSe.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,s.partIndex,s.charIndex,n.clientRectDeltaLeft,n.clientRectScale,n.endNode)}getColumnOfNodeOffset(e,t,i){const n=t.textContent.length;let o=-1;for(;t;)t=t.previousSibling,o++;return this._characterMapping.getColumn(new yfe(o,i),n)}}class rke extends ske{_readVisibleRangesForRange(e,t,i,n,o){const s=super._readVisibleRangesForRange(e,t,i,n,o);if(!s||0===s.length||i===n||1===i&&n===this._characterMapping.length)return s;if(!this.input.containsRTL){const i=this._readPixelOffset(e,t,n,o);if(-1!==i){const e=s[s.length-1];e.left<i&&(e.width=i-e.left)}}return s}}const ake=qde?function(e,t,i,n,o){return new rke(e,t,i,n,o)}:function(e,t,i,n,o){return new ske(e,t,i,n,o)};class lke{static _nextVisibleColumn(e,t,i){return 9===e?lke.nextRenderTabStop(t,i):Ede(e)||Nde(e)?t+2:t+1}static visibleColumnFromColumn(e,t,i){const n=Math.min(t-1,e.length),o=e.substring(0,n),s=new bde(o);let r=0;for(;!s.eol();){const e=_de(o,n,s.offset);s.nextGraphemeLength(),r=this._nextVisibleColumn(e,r,i)}return r}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;const n=e.length,o=new bde(e);let s=0,r=1;for(;!o.eol();){const a=_de(e,n,o.offset);o.nextGraphemeLength();const l=this._nextVisibleColumn(a,s,i),h=o.offset+1;if(l>=t)return l-t<t-s?h:r;s=l,r=h}return n+1}static nextRenderTabStop(e,t){return e+t-e%t}static nextIndentTabStop(e,t){return e+t-e%t}static prevRenderTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}static prevIndentTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}}class hke{static whitespaceVisibleColumn(e,t,i){const n=e.length;let o=0,s=-1,r=-1;for(let a=0;a<n;a++){if(a===t)return[s,r,o];switch(o%i==0&&(s=a,r=o),e.charCodeAt(a)){case 32:o+=1;break;case 9:o=lke.nextRenderTabStop(o,i);break;default:return[-1,-1,-1]}}return t===n?[s,r,o]:[-1,-1,-1]}static atomicPosition(e,t,i,n){const o=e.length,[s,r,a]=hke.whitespaceVisibleColumn(e,t,i);if(-1===a)return-1;let l;switch(n){case 0:l=!0;break;case 1:l=!1;break;case 2:if(a%i==0)return t;l=a%i<=i/2}if(l){if(-1===s)return-1;let t=r;for(let n=s;n<o;++n){if(t===r+i)return s;switch(e.charCodeAt(n)){case 32:t+=1;break;case 9:t=lke.nextRenderTabStop(t,i);break;default:return-1}}return t===r+i?s:-1}const h=lke.nextRenderTabStop(a,i);let d=a;for(let n=t;n<o;n++){if(d===h)return n;switch(e.charCodeAt(n)){case 32:d+=1;break;case 9:d=lke.nextRenderTabStop(d,i);break;default:return-1}}return d===h?o:-1}}class dke{constructor(e=null){this.hitTarget=e,this.type=0}}class cke{constructor(e,t,i){this.position=e,this.spanNode=t,this.injectedText=i,this.type=1}}var uke;!function(e){e.createFromDOMInfo=function(e,t,i){const n=e.getPositionFromDOMInfo(t,i);return n?new cke(n,t,null):new dke(t)}}(uke||(uke={}));class gke{constructor(e,t){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=t}}class pke{static _deduceRage(e,t=null){return!t&&e?new Ole(e.lineNumber,e.column,e.lineNumber,e.column):null!=t?t:null}static createUnknown(e,t,i){return{type:0,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createTextarea(e,t){return{type:1,element:e,mouseColumn:t,position:null,range:null}}static createMargin(e,t,i,n,o,s){return{type:e,element:t,mouseColumn:i,position:n,range:o,detail:s}}static createViewZone(e,t,i,n,o){return{type:e,element:t,mouseColumn:i,position:n,range:this._deduceRage(n),detail:o}}static createContentText(e,t,i,n,o){return{type:6,element:e,mouseColumn:t,position:i,range:this._deduceRage(i,n),detail:o}}static createContentEmpty(e,t,i,n){return{type:7,element:e,mouseColumn:t,position:i,range:this._deduceRage(i),detail:n}}static createContentWidget(e,t,i){return{type:9,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createScrollbar(e,t,i){return{type:11,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createOverlayWidget(e,t,i){return{type:12,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createOutsideEditor(e,t,i,n){return{type:13,element:null,mouseColumn:e,position:t,range:this._deduceRage(t),outsidePosition:i,outsideDistance:n}}static _typeToString(e){return 1===e?"TEXTAREA":2===e?"GUTTER_GLYPH_MARGIN":3===e?"GUTTER_LINE_NUMBERS":4===e?"GUTTER_LINE_DECORATIONS":5===e?"GUTTER_VIEW_ZONE":6===e?"CONTENT_TEXT":7===e?"CONTENT_EMPTY":8===e?"CONTENT_VIEW_ZONE":9===e?"CONTENT_WIDGET":10===e?"OVERVIEW_RULER":11===e?"SCROLLBAR":12===e?"OVERLAY_WIDGET":"UNKNOWN"}static toString(e){return this._typeToString(e.type)+": "+e.position+" - "+e.range+" - "+JSON.stringify(e.detail)}}class mke{static isTextArea(e){return 2===e.length&&3===e[0]&&6===e[1]}static isChildOfViewLines(e){return e.length>=4&&3===e[0]&&7===e[3]}static isStrictChildOfViewLines(e){return e.length>4&&3===e[0]&&7===e[3]}static isChildOfScrollableElement(e){return e.length>=2&&3===e[0]&&5===e[1]}static isChildOfMinimap(e){return e.length>=2&&3===e[0]&&8===e[1]}static isChildOfContentWidgets(e){return e.length>=4&&3===e[0]&&1===e[3]}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&2===e[0]}static isChildOfOverlayWidgets(e){return e.length>=2&&3===e[0]&&4===e[1]}}class fke{constructor(e,t,i){this.viewModel=e.viewModel;const n=e.configuration.options;this.layoutInfo=n.get(138),this.viewDomNode=t.viewDomNode,this.lineHeight=n.get(63),this.stickyTabStops=n.get(110),this.typicalHalfwidthCharacterWidth=n.get(47).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return fke.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const n=i.verticalOffset+i.height/2,o=e.viewModel.getLineCount();let s,r=null,a=null;return i.afterLineNumber!==o&&(a=new Rle(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new Rle(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),s=null===a?r:null===r?a:t<n?r:a,{viewZoneId:i.id,afterLineNumber:i.afterLineNumber,positionBefore:r,positionAfter:a,position:s}}return null}getFullLineRangeAtCoord(e){if(this._context.viewLayout.isAfterLines(e)){const e=this._context.viewModel.getLineCount(),t=this._context.viewModel.getLineMaxColumn(e);return{range:new Ole(e,t,e,t),isAfterLines:!0}}const t=this._context.viewLayout.getLineNumberAtVerticalOffset(e),i=this._context.viewModel.getLineMaxColumn(t);return{range:new Ole(t,1,t,i),isAfterLines:!1}}getLineNumberAtVerticalOffset(e){return this._context.viewLayout.getLineNumberAtVerticalOffset(e)}isAfterLines(e){return this._context.viewLayout.isAfterLines(e)}isInTopPadding(e){return this._context.viewLayout.isInTopPadding(e)}isInBottomPadding(e){return this._context.viewLayout.isInBottomPadding(e)}getVerticalOffsetForLineNumber(e){return this._context.viewLayout.getVerticalOffsetForLineNumber(e)}findAttribute(e,t){return fke._findAttribute(e,t,this._viewHelper.viewDomNode)}static _findAttribute(e,t,i){for(;e&&e!==document.body;){if(e.hasAttribute&&e.hasAttribute(t))return e.getAttribute(t);if(e===i)return null;e=e.parentNode}return null}getLineWidth(e){return this._viewHelper.getLineWidth(e)}visibleRangeForPosition(e,t){return this._viewHelper.visibleRangeForPosition(e,t)}getPositionFromDOMInfo(e,t){return this._viewHelper.getPositionFromDOMInfo(e,t)}getCurrentScrollTop(){return this._context.viewLayout.getCurrentScrollTop()}getCurrentScrollLeft(){return this._context.viewLayout.getCurrentScrollLeft()}}class _ke{constructor(e,t,i,n){this.editorPos=t,this.pos=i,this.relativePos=n,this.mouseVerticalOffset=Math.max(0,e.getCurrentScrollTop()+this.relativePos.y),this.mouseContentHorizontalOffset=e.getCurrentScrollLeft()+this.relativePos.x-e.layoutInfo.contentLeft,this.isInMarginArea=this.relativePos.x<e.layoutInfo.contentLeft&&this.relativePos.x>=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,Cke._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class vke extends _ke{constructor(e,t,i,n,o){super(e,t,i,n),this._ctx=e,o?(this.target=o,this.targetPath=zSe.collect(o,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}\n\ttarget: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?lke.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return pke.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return pke.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,n){return pke.createMargin(e,this.target,this._getMouseColumn(t),t,i,n)}fulfillViewZone(e,t,i){return pke.createViewZone(e,this.target,this._getMouseColumn(t),t,i)}fulfillContentText(e,t,i){return pke.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return pke.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return pke.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return pke.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return pke.createOverlayWidget(this.target,this._getMouseColumn(),e)}withTarget(e){return new vke(this._ctx,this.editorPos,this.pos,this.relativePos,e)}}const bke={isAfterLines:!0};function wke(e){return{isAfterLines:!1,horizontalDistanceToText:e}}class Cke{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=zSe.collect(t,this._viewHelper.viewDomNode);return!(!mke.isChildOfContentWidgets(i)&&!mke.isChildOfOverflowingContentWidgets(i)&&!mke.isChildOfOverlayWidgets(i))}createMouseTarget(e,t,i,n,o){const s=new fke(this._context,this._viewHelper,e),r=new vke(s,t,i,n,o);try{const e=Cke._createMouseTarget(s,r,!1);if(6===e.type&&s.stickyTabStops&&null!==e.position){const t=Cke._snapToSoftTabBoundary(e.position,s.viewModel),i=Ole.fromPositions(t,t).plusRange(e.range);return r.fulfillContentText(t,i,e.detail)}return e}catch(e){return r.fulfillUnknown()}}static _createMouseTarget(e,t,i){if(null===t.target){if(i)return t.fulfillUnknown();const n=Cke._doHitTest(e,t);return 1===n.type?Cke.createMouseTargetFromHitTestPosition(e,t,n.spanNode,n.position,n.injectedText):this._createMouseTarget(e,t.withTarget(n.hitTarget),!0)}const n=t;let o=null;return o=o||Cke._hitTestContentWidget(e,n),o=o||Cke._hitTestOverlayWidget(e,n),o=o||Cke._hitTestMinimap(e,n),o=o||Cke._hitTestScrollbarSlider(e,n),o=o||Cke._hitTestViewZone(e,n),o=o||Cke._hitTestMargin(e,n),o=o||Cke._hitTestViewCursor(e,n),o=o||Cke._hitTestTextArea(e,n),o=o||Cke._hitTestViewLines(e,n,i),o=o||Cke._hitTestScrollbar(e,n),o||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(mke.isChildOfContentWidgets(t.targetPath)||mke.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(mke.isChildOfOverlayWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillOverlayWidget(i):t.fulfillUnknown()}return null}static _hitTestViewCursor(e,t){if(t.target){const i=e.lastRenderData.lastViewCursorsRenderData;for(const e of i)if(t.target===e.domNode)return t.fulfillContentText(e.position,null,{mightBeForeignElement:!1,injectedText:null})}if(t.isInContentArea){const i=e.lastRenderData.lastViewCursorsRenderData,n=t.mouseContentHorizontalOffset,o=t.mouseVerticalOffset;for(const s of i){if(n<s.contentLeft)continue;if(n>s.contentLeft+s.width)continue;const i=e.getVerticalOffsetForLineNumber(s.position.lineNumber);if(i<=o&&o<=i+s.height)return t.fulfillContentText(s.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const e=t.isInContentArea?8:5;return t.fulfillViewZone(e,i.position,i)}return null}static _hitTestTextArea(e,t){return mke.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),n=i.range.getStartPosition();let o=Math.abs(t.relativePos.x);const s={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};return o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth?t.fulfillMargin(2,n,i.range,s):(o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,n,i.range,s):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,n,i.range,s)))}return null}static _hitTestViewLines(e,t,i){if(!mke.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new Rle(1,1),bke);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const i=e.viewModel.getLineCount(),n=e.viewModel.getLineMaxColumn(i);return t.fulfillContentEmpty(new Rle(i,n),bke)}if(i){if(mke.isStrictChildOfViewLines(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(0===e.viewModel.getLineLength(i)){const n=e.getLineWidth(i),o=wke(t.mouseContentHorizontalOffset-n);return t.fulfillContentEmpty(new Rle(i,1),o)}const n=e.getLineWidth(i);if(t.mouseContentHorizontalOffset>=n){const o=wke(t.mouseContentHorizontalOffset-n),s=new Rle(i,e.viewModel.getLineMaxColumn(i));return t.fulfillContentEmpty(s,o)}}return t.fulfillUnknown()}const n=Cke._doHitTest(e,t);return 1===n.type?Cke.createMouseTargetFromHitTestPosition(e,t,n.spanNode,n.position,n.injectedText):this._createMouseTarget(e,t.withTarget(n.hitTarget),!0)}static _hitTestMinimap(e,t){if(mke.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Rle(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(mke.isChildOfScrollableElement(t.targetPath)&&t.target&&1===t.target.nodeType){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Rle(i,n))}}return null}static _hitTestScrollbar(e,t){if(mke.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Rle(i,n))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(138),n=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return Cke._getMouseColumn(n,t.get(47).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n,o){const s=n.lineNumber,r=n.column,a=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>a){const e=wke(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(n,e)}const l=e.visibleRangeForPosition(s,r);if(!l)return t.fulfillUnknown(n);const h=l.left;if(Math.abs(t.mouseContentHorizontalOffset-h)<1)return t.fulfillContentText(n,null,{mightBeForeignElement:!!o,injectedText:o});const d=[];if(d.push({offset:l.left,column:r}),r>1){const t=e.visibleRangeForPosition(s,r-1);t&&d.push({offset:t.left,column:r-1})}if(r<e.viewModel.getLineMaxColumn(s)){const t=e.visibleRangeForPosition(s,r+1);t&&d.push({offset:t.left,column:r+1})}d.sort(((e,t)=>e.offset-t.offset));const c=t.pos.toClientCoordinates(),u=i.getBoundingClientRect(),g=u.left<=c.clientX&&c.clientX<=u.right;let p=null;for(let e=1;e<d.length;e++){const i=d[e-1],o=d[e];if(i.offset<=t.mouseContentHorizontalOffset&&t.mouseContentHorizontalOffset<=o.offset){p=new Ole(s,i.column,s,o.column);const e=Math.abs(i.offset-t.mouseContentHorizontalOffset),r=Math.abs(o.offset-t.mouseContentHorizontalOffset);n=new Rle(s,e<r?i.column:o.column);break}}return t.fulfillContentText(n,p,{mightBeForeignElement:!g||!!o,injectedText:o})}static _doHitTestWithCaretRangeFromPoint(e,t){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.getVerticalOffsetForLineNumber(i),o=n+e.lineHeight;if(!(i===e.viewModel.getLineCount()&&t.mouseVerticalOffset>o)){const i=Math.floor((n+o)/2);let s=t.pos.y+(i-t.mouseVerticalOffset);s<=t.editorPos.y&&(s=t.editorPos.y+1),s>=t.editorPos.y+t.editorPos.height&&(s=t.editorPos.y+t.editorPos.height-1);const r=new xSe(t.pos.x,s),a=this._actualDoHitTestWithCaretRangeFromPoint(e,r.toClientCoordinates());if(1===a.type)return a}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=Kve(e.viewDomNode);let n;if(n=i?void 0===i.caretRangeFromPoint?function(e,t,i){const n=document.createRange();let o=e.elementFromPoint(t,i);if(null!==o){for(;o&&o.firstChild&&o.firstChild.nodeType!==o.firstChild.TEXT_NODE&&o.lastChild&&o.lastChild.firstChild;)o=o.lastChild;const e=o.getBoundingClientRect(),i=window.getComputedStyle(o,null).getPropertyValue("font"),s=o.innerText;let r,a=e.left,l=0;if(t>e.left+e.width)l=s.length;else{const e=yke.getInstance();for(let n=0;n<s.length+1;n++){if(r=e.getCharWidth(s.charAt(n),i)/2,a+=r,t<a){l=n;break}a+=r}}n.setStart(o.firstChild,l),n.setEnd(o.firstChild,l)}return n}(i,t.clientX,t.clientY):i.caretRangeFromPoint(t.clientX,t.clientY):document.caretRangeFromPoint(t.clientX,t.clientY),!n||!n.startContainer)return new dke;const o=n.startContainer;if(o.nodeType===o.TEXT_NODE){const t=o.parentNode,i=t?t.parentNode:null,s=i?i.parentNode:null;return(s&&s.nodeType===s.ELEMENT_NODE?s.className:null)===nke.CLASS_NAME?uke.createFromDOMInfo(e,t,n.startOffset):new dke(o.parentNode)}if(o.nodeType===o.ELEMENT_NODE){const t=o.parentNode,i=t?t.parentNode:null;return(i&&i.nodeType===i.ELEMENT_NODE?i.className:null)===nke.CLASS_NAME?uke.createFromDOMInfo(e,o,o.textContent.length):new dke(o)}return new dke}static _doHitTestWithCaretPositionFromPoint(e,t){const i=document.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const t=i.offsetNode.parentNode,n=t?t.parentNode:null,o=n?n.parentNode:null;return(o&&o.nodeType===o.ELEMENT_NODE?o.className:null)===nke.CLASS_NAME?uke.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new dke(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const t=i.offsetNode.parentNode,n=t&&t.nodeType===t.ELEMENT_NODE?t.className:null,o=t?t.parentNode:null,s=o&&o.nodeType===o.ELEMENT_NODE?o.className:null;if(n===nke.CLASS_NAME){const t=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(t)return uke.createFromDOMInfo(e,t,0)}else if(s===nke.CLASS_NAME)return uke.createFromDOMInfo(e,i.offsetNode,0)}return new dke(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:n}=t.model.getOptions(),o=hke.atomicPosition(i,e.column-1,n,2);return-1!==o?new Rle(e.lineNumber,o+1):e}static _doHitTest(e,t){let i=new dke;if("function"==typeof document.caretRangeFromPoint?i=this._doHitTestWithCaretRangeFromPoint(e,t):document.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates())),1===i.type){const t=e.viewModel.getInjectedTextAt(i.position),n=e.viewModel.normalizePosition(i.position,2);!t&&n.equals(i.position)||(i=new cke(n,i.spanNode,t))}return i}}class yke{static getInstance(){return yke._INSTANCE||(yke._INSTANCE=new yke),yke._INSTANCE}constructor(){this._cache={},this._canvas=document.createElement("canvas")}getCharWidth(e,t){const i=e+t;if(this._cache[i])return this._cache[i];const n=this._canvas.getContext("2d");n.font=t;const o=n.measureText(e).width;return this._cache[i]=o,o}}yke._INSTANCE=null;class Ske extends aae{onclick(e,t){this._register(Lve(e,Yve.CLICK,(e=>t(new b_e(e)))))}onmousedown(e,t){this._register(Lve(e,Yve.MOUSE_DOWN,(e=>t(new b_e(e)))))}onmouseover(e,t){this._register(Lve(e,Yve.MOUSE_OVER,(e=>t(new b_e(e)))))}onmouseleave(e,t){this._register(Lve(e,Yve.MOUSE_LEAVE,(e=>t(new b_e(e)))))}onkeydown(e,t){this._register(Lve(e,Yve.KEY_DOWN,(e=>t(new p_e(e)))))}onkeyup(e,t){this._register(Lve(e,Yve.KEY_UP,(e=>t(new p_e(e)))))}oninput(e,t){this._register(Lve(e,Yve.INPUT,t))}onblur(e,t){this._register(Lve(e,Yve.BLUR,t))}onfocus(e,t){this._register(Lve(e,Yve.FOCUS,t))}ignoreGesture(e){return Nwe.ignoreTarget(e)}}class kke extends Ske{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",void 0!==e.top&&(this.bgDomNode.style.top="0px"),void 0!==e.left&&(this.bgDomNode.style.left="0px"),void 0!==e.bottom&&(this.bgDomNode.style.bottom="0px"),void 0!==e.right&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...Ibe.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width="11px",this.domNode.style.height="11px",void 0!==e.top&&(this.domNode.style.top=e.top+"px"),void 0!==e.left&&(this.domNode.style.left=e.left+"px"),void 0!==e.bottom&&(this.domNode.style.bottom=e.bottom+"px"),void 0!==e.right&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new Iwe),this._register(xve(this.bgDomNode,Yve.POINTER_DOWN,(e=>this._arrowPointerDown(e)))),this._register(xve(this.domNode,Yve.POINTER_DOWN,(e=>this._arrowPointerDown(e)))),this._pointerdownRepeatTimer=this._register(new lpe),this._pointerdownScheduleRepeatTimer=this._register(new ape)}_arrowPointerDown(e){e.target&&e.target instanceof Element&&(this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet((()=>{this._pointerdownRepeatTimer.cancelAndSet((()=>this._onActivate()),1e3/24)}),200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>{}),(()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()})),e.preventDefault())}}class Lke extends aae{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new ape)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return 2!==this._visibility&&(3===this._visibility||this._rawShouldBeVisible)}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){this._isNeeded?this._shouldBeVisible?this._reveal():this._hide(!0):this._hide(!1)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet((()=>{var e;null===(e=this._domNode)||void 0===e||e.setClassName(this._visibleClassName)}),0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,null===(t=this._domNode)||void 0===t||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}class xke extends Ske{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new Lke(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Iwe),this._shouldRender=!0,this.domNode=ice(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Lve(this.domNode.domNode,Yve.POINTER_DOWN,(e=>this._domNodePointerDown(e))))}_createArrow(e){const t=this._register(new kke(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=ice(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),"number"==typeof i&&this.slider.setWidth(i),"number"==typeof n&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Lve(this.slider.domNode,Yve.POINTER_DOWN,(e=>{0===e.button&&(e.preventDefault(),this._sliderPointerDown(e))}))),this.onclick(this.slider.domNode,(e=>{e.leftButton&&e.stopPropagation()}))}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);i<=o&&o<=n?0===e.button&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&"number"==typeof e.offsetX&&"number"==typeof e.offsetY)t=e.offsetX,i=e.offsetY;else{const n=Rve(this.domNode.domNode);t=e.pageX-n.left,i=e.pageY-n.top}const n=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),0===e.button&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!(e.target&&e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>{const o=this._sliderOrthogonalPointerPosition(e),s=Math.abs(o-i);if(ese&&s>140)return void this._setDesiredScrollPositionNow(n.getScrollPosition());const r=this._sliderPointerPosition(e)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(r))}),(()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()})),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}class Dke{constructor(e,t,i,n,o,s){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=o,this._scrollPosition=s,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Dke(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t&&(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,n,o){const s=Math.max(0,i-e),r=Math.max(0,s-2*t),a=n>0&&n>i;if(!a)return{computedAvailableSize:Math.round(s),computedIsNeeded:a,computedSliderSize:Math.round(r),computedSliderRatio:0,computedSliderPosition:0};const l=Math.round(Math.max(20,Math.floor(i*r/n))),h=(r-l)/(n-i),d=o*h;return{computedAvailableSize:Math.round(s),computedIsNeeded:a,computedSliderSize:Math.round(l),computedSliderRatio:h,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){const e=Dke._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return t<this._computedSliderPosition?i-=this._visibleSize:i+=this._visibleSize,i}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;const t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}}class Eke extends xke{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Dke(t.horizontalHasArrows?t.arrowSize:0,2===t.horizontal?0:t.horizontalScrollbarSize,2===t.vertical?0:t.verticalScrollbarSize,n.width,n.scrollWidth,o.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows){const e=(t.arrowSize-11)/2,i=(t.horizontalScrollbarSize-11)/2;this._createArrow({className:"scra",icon:Vle.scrollbarButtonLeft,top:i,left:e,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new w_e(null,1,0))}),this._createArrow({className:"scra",icon:Vle.scrollbarButtonRight,top:i,left:void 0,bottom:void 0,right:e,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new w_e(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(2===e.horizontal?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class Nke extends xke{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Dke(t.verticalHasArrows?t.arrowSize:0,2===t.vertical?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const e=(t.arrowSize-11)/2,i=(t.verticalScrollbarSize-11)/2;this._createArrow({className:"scra",icon:Vle.scrollbarButtonUp,top:e,left:i,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new w_e(null,0,1))}),this._createArrow({className:"scra",icon:Vle.scrollbarButtonDown,top:void 0,left:i,bottom:e,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new w_e(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class Ike{constructor(e,t,i,n,o,s,r){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,i|=0,n|=0,o|=0,s|=0,r|=0),this.rawScrollLeft=n,this.rawScrollTop=r,t<0&&(t=0),n+t>i&&(n=i-t),n<0&&(n=0),o<0&&(o=0),r+o>s&&(r=s-o),r<0&&(r=0),this.width=t,this.scrollWidth=i,this.scrollLeft=n,this.height=o,this.scrollHeight=s,this.scrollTop=r}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new Ike(this._forceIntegerValues,void 0!==e.width?e.width:this.width,void 0!==e.scrollWidth?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,void 0!==e.height?e.height:this.height,void 0!==e.scrollHeight?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new Ike(this._forceIntegerValues,this.width,this.scrollWidth,void 0!==e.scrollLeft?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,void 0!==e.scrollTop?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,s=this.height!==e.height,r=this.scrollHeight!==e.scrollHeight,a=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:n,scrollLeftChanged:o,heightChanged:s,scrollHeightChanged:r,scrollTopChanged:a}}}class Mke extends aae{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new bae),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new Ike(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var i;const n=this._state.withScrollDimensions(e,t);this._setState(n,Boolean(this._smoothScrolling)),null===(i=this._smoothScrolling)||void 0===i||i.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(0===this._smoothScrollDuration)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:void 0===e.scrollLeft?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:void 0===e.scrollTop?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;n=t?new Rke(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{const t=this._state.withScrollPosition(e);this._smoothScrolling=Rke.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);return this._setState(t,!0),this._smoothScrolling?e.isDone?(this._smoothScrolling.dispose(),void(this._smoothScrolling=null)):void(this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))):void 0}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class Tke{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function Ake(e,t){const i=t-e;return function(t){return e+i*(1-(n=1-t,Math.pow(n,3)));var n}}class Rke{constructor(e,t,i,n){this.from=e,this.to=t,this.duration=n,this.startTime=i,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,i){if(Math.abs(e-t)>2.5*i){let r,a;return e<t?(r=e+.75*i,a=t-.75*i):(r=e-.75*i,a=t+.75*i),n=Ake(e,r),o=Ake(a,t),s=.33,function(e){return e<s?n(e/s):o((e-s)/(1-s))}}var n,o,s;return Ake(e,t)}dispose(){null!==this.animationFrameDisposable&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){const t=(e-this.startTime)/this.duration;if(t<1){const e=this.scrollLeft(t),i=this.scrollTop(t);return new Tke(e,i,!1)}return new Tke(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,t,i){return Rke.start(e,t,i)}static start(e,t,i){i+=10;const n=Date.now()-10;return new Rke(e,t,n,i)}}var Oke,Pke,Fke=i(4625),Bke={};Bke.styleTagTransform=Vr(),Bke.setAttributes=Pr(),Bke.insert=Rr().bind(null,"head"),Bke.domAPI=Tr(),Bke.insertStyleElement=Br(),Ir()(Fke.Z,Bke),Fke.Z&&Fke.Z.locals&&Fke.Z.locals;class Wke{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}class Vke{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(-1===this._front&&-1===this._rear)return!1;let e=1,t=0,i=1,n=this._rear;for(;;){const o=n===this._front?e:Math.pow(2,-i);if(e-=o,t+=this._memory[n].score*o,n===this._front)break;n=(this._capacity+n-1)%this._capacity,i++}return t<=.5}acceptStandardWheelEvent(e){const t=window.devicePixelRatio/Ude();ese||ise?this.accept(Date.now(),e.deltaX/t,e.deltaY/t):this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,i){const n=new Wke(e,t,i);n.score=this._computeScore(n),-1===this._front&&-1===this._rear?(this._memory[0]=n,this._front=0,this._rear=0):(this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=n)}_computeScore(e){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let t=.5;return-1===this._front&&-1===this._rear||this._memory[this._rear],this._isAlmostInt(e.deltaX)&&this._isAlmostInt(e.deltaY)||(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}Vke.INSTANCE=new Vke;class zke extends Ske{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new bae),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new bae),e.style.overflow="hidden",this._options=function(e){const t={lazyRender:void 0!==e.lazyRender&&e.lazyRender,className:void 0!==e.className?e.className:"",useShadows:void 0===e.useShadows||e.useShadows,handleMouseWheel:void 0===e.handleMouseWheel||e.handleMouseWheel,flipAxes:void 0!==e.flipAxes&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:void 0!==e.consumeMouseWheelIfScrollbarIsNeeded&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:void 0!==e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:void 0!==e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:void 0!==e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:void 0!==e.fastScrollSensitivity?e.fastScrollSensitivity:5,scrollPredominantAxis:void 0===e.scrollPredominantAxis||e.scrollPredominantAxis,mouseWheelSmoothScroll:void 0===e.mouseWheelSmoothScroll||e.mouseWheelSmoothScroll,arrowSize:void 0!==e.arrowSize?e.arrowSize:11,listenOnDomNode:void 0!==e.listenOnDomNode?e.listenOnDomNode:null,horizontal:void 0!==e.horizontal?e.horizontal:1,horizontalScrollbarSize:void 0!==e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:void 0!==e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:void 0!==e.horizontalHasArrows&&e.horizontalHasArrows,vertical:void 0!==e.vertical?e.vertical:1,verticalScrollbarSize:void 0!==e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:void 0!==e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:void 0!==e.verticalSliderSize?e.verticalSliderSize:0,scrollByPage:void 0!==e.scrollByPage&&e.scrollByPage};return t.horizontalSliderSize=void 0!==e.horizontalSliderSize?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=void 0!==e.verticalSliderSize?e.verticalSliderSize:t.verticalScrollbarSize,tse&&(t.className+=" mac"),t}(t),this._scrollable=i,this._register(this._scrollable.onScroll((e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)})));const n={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Nke(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new Eke(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=ice(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ice(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ice(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,(e=>this._onMouseOver(e))),this.onmouseleave(this._listenOnDomNode,(e=>this._onMouseLeave(e))),this._hideTimeout=this._register(new ape),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=nae(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,tse&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){void 0!==e.handleMouseWheel&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),void 0!==e.mouseWheelScrollSensitivity&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),void 0!==e.fastScrollSensitivity&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),void 0!==e.scrollPredominantAxis&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),void 0!==e.horizontal&&(this._options.horizontal=e.horizontal),void 0!==e.vertical&&(this._options.vertical=e.vertical),void 0!==e.horizontalScrollbarSize&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),void 0!==e.verticalScrollbarSize&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),void 0!==e.scrollByPage&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new w_e(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=nae(this._mouseWheelToDispose),e)){const e=e=>{this._onMouseWheel(new w_e(e))};this._mouseWheelToDispose.push(Lve(this._listenOnDomNode,Yve.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(e){const t=Vke.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let n=e.deltaY*this._options.mouseWheelScrollSensitivity,o=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(Math.abs(n)>=Math.abs(o)?o=0:n=0),this._options.flipAxes&&([n,o]=[o,n]);const s=!tse&&e.browserEvent&&e.browserEvent.shiftKey;!this._options.scrollYToX&&!s||o||(o=n,n=0),e.browserEvent&&e.browserEvent.altKey&&(o*=this._options.fastScrollSensitivity,n*=this._options.fastScrollSensitivity);const r=this._scrollable.getFutureScrollPosition();let a={};if(n){const e=50*n,t=r.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(a,t)}if(o){const e=50*o,t=r.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(a,t)}a=this._scrollable.validateScrollPosition(a),(r.scrollLeft!==a.scrollLeft||r.scrollTop!==a.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(a):this._scrollable.setScrollPositionNow(a),i=!0)}let n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,n=i?" left":"",o=t?" top":"",s=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${o}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){this._mouseIsOver||this._isDragging||(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){this._mouseIsOver||this._isDragging||this._hideTimeout.cancelAndSet((()=>this._hide()),500)}}class Hke extends zke{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const i=new Mke({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:e=>Eve(e)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class Uke extends zke{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class Kke extends zke{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const i=new Mke({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:e=>Eve(e)});super(e,t,i),this._register(i),this._element=e,this.onScroll((e=>{e.scrollTopChanged&&(this._element.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this._element.scrollLeft=e.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}class jke extends WSe{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new Cke(this._context,i),this._mouseDownOperation=this._register(new qke(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,((e,t)=>this._createMouseTarget(e,t)),(e=>this._getMouseColumn(e)))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(138).height;const n=new ASe(this.viewHelper.viewDomNode);this._register(n.onContextMenu(this.viewHelper.viewDomNode,(e=>this._onContextMenu(e,!0)))),this._register(n.onMouseMove(this.viewHelper.viewDomNode,(e=>{this._onMouseMove(e),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=Lve(document,"mousemove",(e=>{this.viewHelper.viewDomNode.contains(e.target)||this._onMouseLeave(new TSe(e,!1,this.viewHelper.viewDomNode))})))}))),this._register(n.onMouseUp(this.viewHelper.viewDomNode,(e=>this._onMouseUp(e)))),this._register(n.onMouseLeave(this.viewHelper.viewDomNode,(e=>this._onMouseLeave(e))));let o=0;this._register(n.onPointerDown(this.viewHelper.viewDomNode,((e,t)=>{o=t}))),this._register(Lve(this.viewHelper.viewDomNode,Yve.POINTER_UP,(e=>{this._mouseDownOperation.onPointerUp()}))),this._register(n.onMouseDown(this.viewHelper.viewDomNode,(e=>this._onMouseDown(e,o)))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=Vke.INSTANCE;let t=0,i=rce.getZoomLevel(),n=!1,o=0;function s(e){return tse?(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey}this._register(Lve(this.viewHelper.viewDomNode,Yve.MOUSE_WHEEL,(r=>{if(this.viewController.emitMouseWheel(r),!this._context.configuration.options.get(72))return;const a=new w_e(r);if(e.acceptStandardWheelEvent(a),e.isPhysicalMouseWheel()){if(s(r)){const e=rce.getZoomLevel(),t=a.deltaY>0?1:-1;rce.setZoomLevel(e+t),a.preventDefault(),a.stopPropagation()}}else Date.now()-t>50&&(i=rce.getZoomLevel(),n=s(r),o=0),t=Date.now(),o+=a.deltaY,n&&(rce.setZoomLevel(i+o/5),a.preventDefault(),a.stopPropagation())}),{capture:!0,passive:!1}))}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(138)){const e=this._context.configuration.options.get(138).height;this._height!==e&&(this._height=e,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const i=new DSe(e,t).toPageCoordinates(),n=ISe(this.viewHelper.viewDomNode);if(i.y<n.y||i.y>n.y+n.height||i.x<n.x||i.x>n.x+n.width)return null;const o=MSe(this.viewHelper.viewDomNode,n,i);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),n,i,o,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const t=Kve(this.viewHelper.viewDomNode);t&&(i=t.elementsFromPoint(e.posx,e.posy).find((e=>this.viewHelper.viewDomNode.contains(e))))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),this._mouseDownOperation.isActive()||e.timestamp<this.lastMouseLeaveTime||this.viewController.emitMouseMove({event:e,target:this._createMouseTarget(e,!0)})}_onMouseLeave(e){this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),this.lastMouseLeaveTime=(new Date).getTime(),this.viewController.emitMouseLeave({event:e,target:null})}_onMouseUp(e){this.viewController.emitMouseUp({event:e,target:this._createMouseTarget(e,!0)})}_onMouseDown(e,t){const i=this._createMouseTarget(e,!0),n=6===i.type||7===i.type,o=2===i.type||3===i.type||4===i.type,s=3===i.type,r=this._context.configuration.options.get(103),a=8===i.type||5===i.type,l=9===i.type;let h=e.leftButton||e.middleButton;tse&&e.leftButton&&e.ctrlKey&&(h=!1);const d=()=>{e.preventDefault(),this.viewHelper.focusTextArea()};if(h&&(n||s&&r))d(),this._mouseDownOperation.start(i.type,e,t);else if(o)e.preventDefault();else if(a){const n=i.detail;h&&this.viewHelper.shouldSuppressMouseDownOnViewZone(n.viewZoneId)&&(d(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(d(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}}class qke extends aae{constructor(e,t,i,n,o,s){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=n,this._createMouseTarget=o,this._getMouseColumn=s,this._mouseMoveMonitor=this._register(new OSe(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new $ke(this._context,this._viewHelper,this._mouseTargetFactory,((e,t,i)=>this._dispatchMouse(e,t,i)))),this._mouseState=new Zke,this._currentSelection=new Ple(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):13!==t.type||"above"!==t.outsidePosition&&"below"!==t.outsidePosition?(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,1)):this._topBottomDragScrolling.start(t,e))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(3===e),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const n=this._findMousePosition(t,!0);if(!n||!n.position)return;this._mouseState.trySetCount(t.detail,n.position),t.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(86)&&o.get(32)&&!o.get(19)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&6===n.type&&n.position&&this._currentSelection.containsPosition(n.position))return this._mouseState.isDragAndDrop=!0,this._isActive=!0,void this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,(e=>this._onMouseDownThenMove(e)),(e=>{const t=this._findMousePosition(this._lastMouseEvent,!1);e&&e instanceof KeyboardEvent?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:t?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()}));this._mouseState.isDragAndDrop=!1,this._dispatchMouse(n,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,(e=>this._onMouseDownThenMove(e)),(()=>this._stop())))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,n=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posy<t.y){const i=t.y-e.posy,s=Math.max(n.getCurrentScrollTop()-i,0),r=fke.getZoneAtCoord(this._context,s);if(r){const e=this._helpPositionJumpOverViewZone(r);if(e)return pke.createOutsideEditor(o,e,"above",i)}const a=n.getLineNumberAtVerticalOffset(s);return pke.createOutsideEditor(o,new Rle(a,1),"above",i)}if(e.posy>t.y+t.height){const s=e.posy-t.y-t.height,r=n.getCurrentScrollTop()+e.relativePos.y,a=fke.getZoneAtCoord(this._context,r);if(a){const e=this._helpPositionJumpOverViewZone(a);if(e)return pke.createOutsideEditor(o,e,"below",s)}const l=n.getLineNumberAtVerticalOffset(r);return pke.createOutsideEditor(o,new Rle(l,i.getLineMaxColumn(l)),"below",s)}const s=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+e.relativePos.y);if(e.posx<t.x){const i=t.x-e.posx;return pke.createOutsideEditor(o,new Rle(s,1),"left",i)}if(e.posx>t.x+t.width){const n=e.posx-t.x-t.width;return pke.createOutsideEditor(o,new Rle(s,i.getLineMaxColumn(s)),"right",n)}return null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const n=this._createMouseTarget(e,t);if(!n.position)return null;if(8===n.type||5===n.type){const e=this._helpPositionJumpOverViewZone(n.detail);if(e)return pke.createViewZone(n.type,n.element,n.mouseColumn,e,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new Rle(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,n=e.positionAfter;return i&&n?i.isBefore(t)?i:n:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:6===e.type&&null!==e.detail.injectedText})}}class $ke extends aae{constructor(e,t,i,n){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new Gke(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class Gke extends aae{constructor(e,t,i,n,o,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._position=o,this._mouseEvent=s,this._lastTime=Date.now(),this._animationFrameDisposable=Eve((()=>this._execute()))}dispose(){this._animationFrameDisposable.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}_getScrollSpeed(){const e=this._context.configuration.options.get(63),t=this._context.configuration.options.get(138).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(63),t=this._getScrollSpeed()*(this._tick()/1e3)*e,i="above"===this._position.outsidePosition?-t:t;this._context.viewModel.viewLayout.deltaScrollNow(0,i),this._viewHelper.renderNow();const n=this._context.viewLayout.getLinesViewportData(),o="above"===this._position.outsidePosition?n.startLineNumber:n.endLineNumber;let s;{const e=ISe(this._viewHelper.viewDomNode),t=this._context.configuration.options.get(138).horizontalScrollbarHeight,i=new xSe(this._mouseEvent.pos.x,e.y+e.height-t-.1),n=MSe(this._viewHelper.viewDomNode,e,i);s=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),e,i,n,null)}s.position&&s.position.lineNumber===o||(s="above"===this._position.outsidePosition?pke.createOutsideEditor(this._position.mouseColumn,new Rle(o,1),"above",this._position.outsideDistance):pke.createOutsideEditor(this._position.mouseColumn,new Rle(o,this._context.viewModel.getLineMaxColumn(o)),"below",this._position.outsideDistance)),this._dispatchMouse(s,!0,2),this._animationFrameDisposable=Eve((()=>this._execute()))}}class Zke{get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=(new Date).getTime();i-this._lastSetMouseDownCountTime>Zke.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}Zke.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class Yke{get event(){return this.emitter.event}constructor(e,t,i){const n=e=>this.emitter.fire(e);this.emitter=new bae({onWillAddFirstListener:()=>e.addEventListener(t,n,i),onDidRemoveLastListener:()=>e.removeEventListener(t,n,i)})}dispose(){this.emitter.dispose()}}!function(e){const t={total:0,min:Number.MAX_VALUE,max:0},i=Object.assign({},t),n=Object.assign({},t),o=Object.assign({},t);let s=0;const r={keydown:0,input:0,render:0};function a(){1===r.keydown&&(performance.mark("keydown/end"),r.keydown=2)}function l(){performance.mark("input/start"),r.input=1,c()}function h(){1===r.input&&(performance.mark("input/end"),r.input=2)}function d(){1===r.render&&(performance.mark("render/end"),r.render=2)}function c(){setTimeout(u)}function u(){2===r.keydown&&2===r.input&&2===r.render&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),g("keydown",t),g("input",i),g("render",n),g("inputlatency",o),s++,performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),r.keydown=0,r.input=0,r.render=0)}function g(e,t){const i=performance.getEntriesByName(e)[0].duration;t.total+=i,t.min=Math.min(t.min,i),t.max=Math.max(t.max,i)}function p(e){return{average:e.total/s,max:e.max,min:e.min}}function m(e){e.total=0,e.min=Number.MAX_VALUE,e.max=0}e.onKeyDown=function(){u(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),r.keydown=1,queueMicrotask(a)},e.onBeforeInput=l,e.onInput=function(){0===r.input&&l(),queueMicrotask(h)},e.onKeyUp=function(){u()},e.onSelectionChange=function(){u()},e.onRenderStart=function(){2===r.keydown&&2===r.input&&0===r.render&&(performance.mark("render/start"),r.render=1,queueMicrotask(d),c())},e.getAndClearMeasurements=function(){if(0===s)return;const e={keydown:p(t),input:p(i),render:p(n),total:p(o),sampleCount:s};return m(t),m(i),m(n),m(o),s=0,e}}(Oke||(Oke={}));class Qke{constructor(e,t,i,n,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=n,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),n=e.getSelectionStart(),o=e.getSelectionEnd();let s;return t&&i.substring(0,n)===t.value.substring(0,t.selectionStart)&&(s=t.newlineCountBeforeSelection),new Qke(i,n,o,null,s)}collapseSelection(){return this.selectionStart===this.value.length?this:new Qke(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var t,i,n,o,s,r,a,l;if(e<=this.selectionStart){const n=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(null!==(i=null===(t=this.selection)||void 0===t?void 0:t.getStartPosition())&&void 0!==i?i:null,n,-1)}if(e>=this.selectionEnd){const t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(null!==(o=null===(n=this.selection)||void 0===n?void 0:n.getEndPosition())&&void 0!==o?o:null,t,1)}const h=this.value.substring(this.selectionStart,e);if(-1===h.indexOf(String.fromCharCode(8230)))return this._finishDeduceEditorPosition(null!==(r=null===(s=this.selection)||void 0===s?void 0:s.getStartPosition())&&void 0!==r?r:null,h,1);const d=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(null!==(l=null===(a=this.selection)||void 0===a?void 0:a.getEndPosition())&&void 0!==l?l:null,d,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,o=-1;for(;-1!==(o=t.indexOf("\n",o+1));)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const n=Math.min(ude(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(gde(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd),s=(e.value.substring(n,e.value.length-o),t.value.substring(n,t.value.length-o)),r=e.selectionStart-n,a=e.selectionEnd-n;if(t.selectionStart-n===t.selectionEnd-n){return{text:s,replacePrevCharCnt:e.selectionStart-n,replaceNextCharCnt:0,positionDelta:0}}return{text:s,replacePrevCharCnt:a-r,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(ude(e.value,t.value),e.selectionEnd),n=Math.min(gde(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-n),s=t.value.substring(i,t.value.length-n),r=(e.selectionStart,e.selectionEnd-i),a=(t.selectionStart,t.selectionEnd-i);return{text:s,replacePrevCharCnt:r,replaceNextCharCnt:o.length-r,positionDelta:a-s.length}}}Qke.EMPTY=new Qke("",0,0,null,void 0);class Xke{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t;return new Ole(i+1,1,i+t+1,1)}static fromEditorSelection(e,t,i,n){const o=500,s=Xke._getPageOfLine(t.startLineNumber,i),r=Xke._getRangeForPage(s,i),a=Xke._getPageOfLine(t.endLineNumber,i),l=Xke._getRangeForPage(a,i);let h=r.intersectRanges(new Ole(1,1,t.startLineNumber,t.startColumn));if(n&&e.getValueLengthInRange(h,1)>o){const t=e.modifyPosition(h.getEndPosition(),-500);h=Ole.fromPositions(t,h.getEndPosition())}const d=e.getValueInRange(h,1),c=e.getLineCount(),u=e.getLineMaxColumn(c);let g=l.intersectRanges(new Ole(t.endLineNumber,t.endColumn,c,u));if(n&&e.getValueLengthInRange(g,1)>o){const t=e.modifyPosition(g.getStartPosition(),o);g=Ole.fromPositions(g.getStartPosition(),t)}const p=e.getValueInRange(g,1);let m;if(s===a||s+1===a)m=e.getValueInRange(t,1);else{const i=r.intersectRanges(t),n=l.intersectRanges(t);m=e.getValueInRange(i,1)+String.fromCharCode(8230)+e.getValueInRange(n,1)}return n&&m.length>1e3&&(m=m.substring(0,o)+String.fromCharCode(8230)+m.substring(m.length-o,m.length)),new Qke(d+m+p,d.length,d.length+m.length,t,h.endLineNumber-h.startLineNumber)}}!function(e){e.Tap="-monaco-textarea-synthetic-tap"}(Pke||(Pke={}));class Jke{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}}Jke.INSTANCE=new Jke;class eLe{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){const t={text:e=e||"",replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}class tLe extends aae{get textAreaState(){return this._textAreaState}constructor(e,t,i,n){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._onFocus=this._register(new bae),this.onFocus=this._onFocus.event,this._onBlur=this._register(new bae),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new bae),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new bae),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new bae),this.onCut=this._onCut.event,this._onPaste=this._register(new bae),this.onPaste=this._onPaste.event,this._onType=this._register(new bae),this.onType=this._onType.event,this._onCompositionStart=this._register(new bae),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new bae),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new bae),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new bae),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new hpe((()=>this._onCut.fire()),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new hpe((()=>this.writeScreenReaderContent("asyncFocusGain")),0)),this._textAreaState=Qke.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._currentComposition=null;let o=null;this._register(this._textArea.onKeyDown((e=>{const t=new p_e(e);(109===t.keyCode||this._currentComposition&&1===t.keyCode)&&t.stopPropagation(),t.equals(9)&&t.preventDefault(),o=t,this._onKeyDown.fire(t)}))),this._register(this._textArea.onKeyUp((e=>{const t=new p_e(e);this._onKeyUp.fire(t)}))),this._register(this._textArea.onCompositionStart((e=>{const t=new eLe;if(this._currentComposition)this._currentComposition=t;else{if(this._currentComposition=t,2===this._OS&&o&&o.equals(109)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===e.data&&("ArrowRight"===o.code||"ArrowLeft"===o.code))return t.handleCompositionUpdate("x"),void this._onCompositionStart.fire({data:e.data});this._browser.isAndroid,this._onCompositionStart.fire({data:e.data})}}))),this._register(this._textArea.onCompositionUpdate((e=>{const t=this._currentComposition;if(!t)return;if(this._browser.isAndroid){const t=Qke.readFromTextArea(this._textArea,this._textAreaState),i=Qke.deduceAndroidCompositionInput(this._textAreaState,t);return this._textAreaState=t,this._onType.fire(i),void this._onCompositionUpdate.fire(e)}const i=t.handleCompositionUpdate(e.data);this._textAreaState=Qke.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(i),this._onCompositionUpdate.fire(e)}))),this._register(this._textArea.onCompositionEnd((e=>{const t=this._currentComposition;if(!t)return;if(this._currentComposition=null,this._browser.isAndroid){const e=Qke.readFromTextArea(this._textArea,this._textAreaState),t=Qke.deduceAndroidCompositionInput(this._textAreaState,e);return this._textAreaState=e,this._onType.fire(t),void this._onCompositionEnd.fire()}const i=t.handleCompositionUpdate(e.data);this._textAreaState=Qke.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(i),this._onCompositionEnd.fire()}))),this._register(this._textArea.onInput((e=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const t=Qke.readFromTextArea(this._textArea,this._textAreaState),i=Qke.deduceInput(this._textAreaState,t,2===this._OS);(0!==i.replacePrevCharCnt||1!==i.text.length||!pde(i.text.charCodeAt(0))&&127!==i.text.charCodeAt(0))&&(this._textAreaState=t,""===i.text&&0===i.replacePrevCharCnt&&0===i.replaceNextCharCnt&&0===i.positionDelta||this._onType.fire(i))}))),this._register(this._textArea.onCut((e=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(e),this._asyncTriggerCut.schedule()}))),this._register(this._textArea.onCopy((e=>{this._ensureClipboardGetsEditorSelection(e)}))),this._register(this._textArea.onPaste((e=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),e.preventDefault(),!e.clipboardData)return;let[t,i]=iLe.getTextData(e.clipboardData);t&&(i=i||Jke.INSTANCE.get(t),this._onPaste.fire({text:t,metadata:i}))}))),this._register(this._textArea.onFocus((()=>{const e=this._hasFocus;this._setHasFocus(!0),this._browser.isSafari&&!e&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()}))),this._register(this._textArea.onBlur((()=>{this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)}))),this._register(this._textArea.onSyntheticTap((()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())})))}_installSelectionChangeListener(){let e=0;return Lve(document,"selectionchange",(t=>{if(Oke.onSelectionChange(),!this._hasFocus)return;if(this._currentComposition)return;if(!this._browser.isChrome)return;const i=Date.now(),n=i-e;if(e=i,n<5)return;const o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100)return;if(!this._textAreaState.selection)return;const s=this._textArea.getValue();if(this._textAreaState.value!==s)return;const r=this._textArea.getSelectionStart(),a=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===r&&this._textAreaState.selectionEnd===a)return;const l=this._textAreaState.deduceEditorPosition(r),h=this._host.deduceModelPosition(l[0],l[1],l[2]),d=this._textAreaState.deduceEditorPosition(a),c=this._host.deduceModelPosition(d[0],d[1],d[2]),u=new Ple(h.lineNumber,h.column,c.lineNumber,c.column);this._onSelectionChangeRequest.fire(u)}))}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeScreenReaderContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeScreenReaderContent(e){this._currentComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent())}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};Jke.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,"\n"):t.text,i),e.preventDefault(),e.clipboardData&&iLe.setTextData(e.clipboardData,t.text,t.html,i)}}class iLe{static getTextData(e){const t=e.getData(age.text);let i=null;const n=e.getData("vscode-editor-data");if("string"==typeof n)try{i=JSON.parse(n),1!==i.version&&(i=null)}catch(e){}return 0===t.length&&null===i&&e.files.length>0?[Array.prototype.slice.call(e.files,0).map((e=>e.name)).join("\n"),null]:[t,i]}static setTextData(e,t,i,n){e.setData(age.text,t),"string"==typeof i&&e.setData("text/html",i),e.setData("vscode-editor-data",JSON.stringify(n))}}class nLe extends aae{constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new Yke(this._actual,"keydown")).event,this.onKeyUp=this._register(new Yke(this._actual,"keyup")).event,this.onCompositionStart=this._register(new Yke(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new Yke(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new Yke(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new Yke(this._actual,"beforeinput")).event,this.onInput=this._register(new Yke(this._actual,"input")).event,this.onCut=this._register(new Yke(this._actual,"cut")).event,this.onCopy=this._register(new Yke(this._actual,"copy")).event,this.onPaste=this._register(new Yke(this._actual,"paste")).event,this.onFocus=this._register(new Yke(this._actual,"focus")).event,this.onBlur=this._register(new Yke(this._actual,"blur")).event,this._onSyntheticTap=this._register(new bae),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown((()=>Oke.onKeyDown()))),this._register(this.onBeforeInput((()=>Oke.onBeforeInput()))),this._register(this.onInput((()=>Oke.onInput()))),this._register(this.onKeyUp((()=>Oke.onKeyUp()))),this._register(Lve(this._actual,Pke.Tap,(()=>this._onSyntheticTap.fire())))}hasFocus(){const e=Kve(this._actual);return e?e.activeElement===this._actual:!!Sve(this._actual)&&document.activeElement===this._actual}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return"backward"===this._actual.selectionDirection?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return"backward"===this._actual.selectionDirection?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const n=this._actual;let o=null;const s=Kve(n);o=s?s.activeElement:document.activeElement;const r=o===n,a=n.selectionStart,l=n.selectionEnd;if(r&&a===t&&l===i)jde&&window.parent!==window&&n.focus();else{if(r)return this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),void(jde&&window.parent!==window&&n.focus());try{const e=function(e){const t=[];for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)t[i]=e.scrollTop,e=e.parentNode;return t}(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),function(e,t){for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)e.scrollTop!==t[i]&&(e.scrollTop=t[i]),e=e.parentNode}(n,e)}catch(e){}}}}class oLe extends jke{constructor(e,t,i){super(e,t,i),this._register(Nwe.addTarget(this.viewHelper.linesContentDomNode)),this._register(Lve(this.viewHelper.linesContentDomNode,Ewe.Tap,(e=>this.onTap(e)))),this._register(Lve(this.viewHelper.linesContentDomNode,Ewe.Change,(e=>this.onChange(e)))),this._register(Lve(this.viewHelper.linesContentDomNode,Ewe.Contextmenu,(e=>this._onContextMenu(new TSe(e,!1,this.viewHelper.viewDomNode),!1)))),this._lastPointerType="mouse",this._register(Lve(this.viewHelper.linesContentDomNode,"pointerdown",(e=>{const t=e.pointerType;this._lastPointerType="mouse"!==t?"touch"===t?"touch":"pen":"mouse"})));const n=new RSe(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,(e=>this._onMouseMove(e)))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,(e=>this._onMouseUp(e)))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,(e=>this._onMouseLeave(e)))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,((e,t)=>this._onMouseDown(e,t))))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new TSe(e,!1,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:6===t.type&&null!==t.detail.injectedText})}onChange(e){"touch"===this._lastPointerType&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e,t){"touch"!==e.browserEvent.pointerType&&super._onMouseDown(e,t)}}class sLe extends jke{constructor(e,t,i){super(e,t,i),this._register(Nwe.addTarget(this.viewHelper.linesContentDomNode)),this._register(Lve(this.viewHelper.linesContentDomNode,Ewe.Tap,(e=>this.onTap(e)))),this._register(Lve(this.viewHelper.linesContentDomNode,Ewe.Change,(e=>this.onChange(e)))),this._register(Lve(this.viewHelper.linesContentDomNode,Ewe.Contextmenu,(e=>this._onContextMenu(new TSe(e,!1,this.viewHelper.viewDomNode),!1))))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new TSe(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const e=document.createEvent("CustomEvent");e.initEvent(Pke.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(e),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class rLe extends aae{constructor(e,t,i){super(),rse&&s_e?this.handler=this._register(new oLe(e,t,i)):window.TouchEvent?this.handler=this._register(new sLe(e,t,i)):this.handler=this._register(new jke(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}var aLe=i(9657),lLe={};lLe.styleTagTransform=Vr(),lLe.setAttributes=Pr(),lLe.insert=Rr().bind(null,"head"),lLe.domAPI=Tr(),lLe.insertStyleElement=Br(),Ir()(aLe.Z,lLe),aLe.Z&&aLe.Z.locals&&aLe.Z.locals;var hLe=i(5792),dLe={};dLe.styleTagTransform=Vr(),dLe.setAttributes=Pr(),dLe.insert=Rr().bind(null,"head"),dLe.domAPI=Tr(),dLe.insertStyleElement=Br(),Ir()(hLe.Z,dLe),hLe.Z&&hLe.Z.locals&&hLe.Z.locals;class cLe extends WSe{}const uLe=pce("themeService");function gLe(e){return{id:e}}function pLe(e){switch(e){case YSe.DARK:return"vs-dark";case YSe.HIGH_CONTRAST_DARK:return"hc-black";case YSe.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const mLe="base.contributions.theming",fLe=new class{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new bae}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),sae((()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)}))}getThemingParticipants(){return this.themingParticipants}};function _Le(e){return fLe.onColorThemeChange(e)}rge.add(mLe,fLe);class vLe extends aae{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange((e=>this.onThemeChange(e))))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}const bLe=zwe("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"Background color for the highlight of line at the cursor position.")),wLe=zwe("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:Kwe},Toe(0,"Background color for the border around the line at the cursor position.")),CLe=(zwe("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},Toe(0,"Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0),zwe("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:jwe,hcLight:jwe},Toe(0,"Background color of the border around highlighted ranges."),!0),zwe("editor.symbolHighlightBackground",{dark:JCe,light:JCe,hcDark:null,hcLight:null},Toe(0,"Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0),zwe("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:jwe,hcLight:jwe},Toe(0,"Background color of the border around highlighted symbols."),!0),zwe("editorCursor.foreground",{dark:"#AEAFAD",light:Owe.black,hcDark:Owe.white,hcLight:"#0F4A85"},Toe(0,"Color of the editor cursor."))),yLe=zwe("editorCursor.background",null,Toe(0,"The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),SLe=zwe("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},Toe(0,"Color of whitespace characters in the editor.")),kLe=zwe("editorIndentGuide.background",{dark:SLe,light:SLe,hcDark:SLe,hcLight:SLe},Toe(0,"Color of the editor indentation guides.")),LLe=zwe("editorIndentGuide.activeBackground",{dark:SLe,light:SLe,hcDark:SLe,hcLight:SLe},Toe(0,"Color of the active editor indentation guides.")),xLe=zwe("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:Owe.white,hcLight:"#292929"},Toe(0,"Color of editor line numbers.")),DLe=zwe("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:jwe,hcLight:jwe},Toe(0,"Color of editor active line number"),!1,Toe(0,"Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),ELe=(zwe("editorLineNumber.activeForeground",{dark:DLe,light:DLe,hcDark:DLe,hcLight:DLe},Toe(0,"Color of editor active line number")),zwe("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"Color of the final editor line when editor.renderFinalNewline is set to dimmed."))),NLe=(zwe("editorRuler.foreground",{dark:"#5A5A5A",light:Owe.lightgrey,hcDark:Owe.white,hcLight:"#292929"},Toe(0,"Color of the editor rulers.")),zwe("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},Toe(0,"Foreground color of editor CodeLens")),zwe("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},Toe(0,"Background color behind matching brackets")),zwe("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:Kwe,hcLight:Kwe},Toe(0,"Color for matching brackets boxes")),zwe("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},Toe(0,"Color of the overview ruler border."))),ILe=zwe("editorOverviewRuler.background",null,Toe(0,"Background color of the editor overview ruler.")),MLe=(zwe("editorGutter.background",{dark:OCe,light:OCe,hcDark:OCe,hcLight:OCe},Toe(0,"Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),zwe("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:Owe.fromHex("#fff").transparent(.8),hcLight:Kwe},Toe(0,"Border color of unnecessary (unused) source code in the editor.")),zwe("editorUnnecessaryCode.opacity",{dark:Owe.fromHex("#000a"),light:Owe.fromHex("#0007"),hcDark:null,hcLight:null},Toe(0,"Opacity of unnecessary (unused) source code in the editor. For example, \"#000000c0\" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out."))),TLe=(zwe("editorGhostText.border",{dark:null,light:null,hcDark:Owe.fromHex("#fff").transparent(.8),hcLight:Owe.fromHex("#292929").transparent(.8)},Toe(0,"Border color of ghost text in the editor.")),zwe("editorGhostText.foreground",{dark:Owe.fromHex("#ffffff56"),light:Owe.fromHex("#0007"),hcDark:null,hcLight:null},Toe(0,"Foreground color of the ghost text in the editor.")),zwe("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},Toe(0,"Background color of the ghost text in the editor.")),new Owe(new Twe(0,122,204,.6))),ALe=(zwe("editorOverviewRuler.rangeHighlightForeground",{dark:TLe,light:TLe,hcDark:TLe,hcLight:TLe},Toe(0,"Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),zwe("editorOverviewRuler.errorForeground",{dark:new Owe(new Twe(255,18,18,.7)),light:new Owe(new Twe(255,18,18,.7)),hcDark:new Owe(new Twe(255,50,50,1)),hcLight:"#B5200D"},Toe(0,"Overview ruler marker color for errors."))),RLe=zwe("editorOverviewRuler.warningForeground",{dark:ICe,light:ICe,hcDark:MCe,hcLight:MCe},Toe(0,"Overview ruler marker color for warnings.")),OLe=zwe("editorOverviewRuler.infoForeground",{dark:TCe,light:TCe,hcDark:ACe,hcLight:ACe},Toe(0,"Overview ruler marker color for infos.")),PLe=zwe("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},Toe(0,"Foreground color of brackets (1). Requires enabling bracket pair colorization.")),FLe=zwe("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},Toe(0,"Foreground color of brackets (2). Requires enabling bracket pair colorization.")),BLe=zwe("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},Toe(0,"Foreground color of brackets (3). Requires enabling bracket pair colorization.")),WLe=zwe("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},Toe(0,"Foreground color of brackets (4). Requires enabling bracket pair colorization.")),VLe=zwe("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},Toe(0,"Foreground color of brackets (5). Requires enabling bracket pair colorization.")),zLe=zwe("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},Toe(0,"Foreground color of brackets (6). Requires enabling bracket pair colorization.")),HLe=zwe("editorBracketHighlight.unexpectedBracket.foreground",{dark:new Owe(new Twe(255,18,18,.8)),light:new Owe(new Twe(255,18,18,.8)),hcDark:new Owe(new Twe(255,50,50,1)),hcLight:""},Toe(0,"Foreground color of unexpected brackets.")),ULe=zwe("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},Toe(0,"Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),KLe=zwe("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},Toe(0,"Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),jLe=zwe("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},Toe(0,"Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),qLe=zwe("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},Toe(0,"Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),$Le=zwe("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},Toe(0,"Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),GLe=zwe("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},Toe(0,"Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),ZLe=zwe("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},Toe(0,"Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),YLe=zwe("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},Toe(0,"Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),QLe=zwe("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},Toe(0,"Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),XLe=zwe("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},Toe(0,"Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),JLe=zwe("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},Toe(0,"Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),exe=zwe("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},Toe(0,"Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));zwe("editorUnicodeHighlight.border",{dark:"#BD9B03",light:"#CEA33D",hcDark:"#ff0000",hcLight:"#CEA33D"},Toe(0,"Border color used to highlight unicode characters.")),zwe("editorUnicodeHighlight.background",{dark:"#bd9b0326",light:"#cea33d14",hcDark:"#00000000",hcLight:"#cea33d14"},Toe(0,"Background color used to highlight unicode characters.")),_Le(((e,t)=>{const i=e.getColor(OCe),n=e.getColor(bLe),o=n&&!n.isTransparent()?n:i;o&&t.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${o}; }`)}));class txe extends cLe{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new Rle(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(63);const t=e.get(64);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(89);const i=e.get(138);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,i=!0),2!==this._renderLineNumbers&&3!==this._renderLineNumbers||(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Rle(e,1));if(1!==t.column)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(2===this._renderLineNumbers){const e=Math.abs(this._lastCursorModelPosition.lineNumber-i);return 0===e?'<span class="relative-current-line-number">'+i+"</span>":String(e)}return 3===this._renderLineNumbers?this._lastCursorModelPosition.lineNumber===i||i%10==0?String(i):"":String(i)}prepareRender(e){if(0===this._renderLineNumbers)return void(this._renderResult=null);const t=ise?this._lineHeight%2==0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o=this._context.viewModel.getLineCount(),s=[];for(let e=i;e<=n;e++){const n=e-i,r=this._getLineRenderLineNumber(e);if(!r){s[n]="";continue}let a="";if(e===o&&0===this._context.viewModel.getLineLength(e)){if("off"===this._renderFinalNewline){s[n]="";continue}"dimmed"===this._renderFinalNewline&&(a=" dimmed-line-number")}e===this._activeLineNumber&&(a=" active-line-number"),s[n]=`<div class="${txe.CLASS_NAME}${t}${a}" style="left:${this._lineNumbersLeft}px;width:${this._lineNumbersWidth}px;">${r}</div>`}this._renderResult=s}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}txe.CLASS_NAME="line-numbers",_Le(((e,t)=>{const i=e.getColor(xLe),n=e.getColor(ELe);n?t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n}; }`):i&&t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i.transparent(.4)}; }`)}));var ixe=i(4209),nxe={};nxe.styleTagTransform=Vr(),nxe.setAttributes=Pr(),nxe.insert=Rr().bind(null,"head"),nxe.domAPI=Tr(),nxe.insertStyleElement=Br(),Ir()(ixe.Z,nxe),ixe.Z&&ixe.Z.locals&&ixe.Z.locals;class oxe extends VSe{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(138);this._canUseLayerHinting=!t.get(29),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=ice(document.createElement("div")),this._domNode.setClassName(oxe.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=ice(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(oxe.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(138);return this._canUseLayerHinting=!t.get(29),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}}oxe.CLASS_NAME="glyph-margin",oxe.OUTER_CLASS_NAME="margin";var sxe=i(5626),rxe={};rxe.styleTagTransform=Vr(),rxe.setAttributes=Pr(),rxe.insert=Rr().bind(null,"head"),rxe.domAPI=Tr(),rxe.insertStyleElement=Br(),Ir()(sxe.Z,rxe),sxe.Z&&sxe.Z.locals&&sxe.Z.locals;const axe="monaco-mouse-cursor-text",lxe=new class{constructor(){this._onDidChange=new bae,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}};class hxe{constructor(e,t,i,n,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=n,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new Rle(this.modelLineNumber,this.distanceToModelLineStart+1),i=new Rle(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(this._previousPresentation=e||{foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const dxe=jde;class cxe extends VSe{constructor(t,i,n){super(t),this._primaryCursorPosition=new Rle(1,1),this._primaryCursorVisibleRange=null,this._viewController=i,this._visibleRangeProvider=n,this._scrollLeft=0,this._scrollTop=0;const o=this._context.configuration.options,s=o.get(138);this._setAccessibilityOptions(o),this._contentLeft=s.contentLeft,this._contentWidth=s.contentWidth,this._contentHeight=s.height,this._fontInfo=o.get(47),this._lineHeight=o.get(63),this._emptySelectionClipboard=o.get(34),this._copyWithSyntaxHighlighting=o.get(22),this._visibleTextArea=null,this._selections=[new Ple(1,1,1,1)],this._modelSelections=[new Ple(1,1,1,1)],this._lastRenderPosition=null,this.textArea=ice(document.createElement("textarea")),zSe.write(this.textArea,6),this.textArea.setClassName(`inputarea ${axe}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:r}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=r*this._fontInfo.spaceWidth+"px",this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(o)),this.textArea.setAttribute("tabindex",String(o.get(118))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",Toe(0,"editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this._ensureReadOnlyAttribute(),this.textAreaCover=ice(document.createElement("div")),this.textAreaCover.setPosition("absolute");const a={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:e=>this._context.viewModel.getLineMaxColumn(e),getValueInRange:(e,t)=>this._context.viewModel.getValueInRange(e,t),getValueLengthInRange:(e,t)=>this._context.viewModel.getValueLengthInRange(e,t),modifyPosition:(e,t)=>this._context.viewModel.modifyPosition(e,t)},l={getDataToCopy:()=>{const e=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,ese),t=this._context.viewModel.model.getEOL(),i=this._emptySelectionClipboard&&1===this._modelSelections.length&&this._modelSelections[0].isEmpty(),n=Array.isArray(e)?e:null,o=Array.isArray(e)?e.join(t):e;let s,r=null;if(this._copyWithSyntaxHighlighting&&o.length<65536){const e=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);e&&(s=e.html,r=e.mode)}return{isFromEmptySelection:i,multicursorText:n,text:o,html:s,mode:r}},getScreenReaderContent:()=>{if(1===this._accessibilitySupport){const e=this._selections[0];if(tse&&e.isEmpty()){const t=e.getStartPosition();let i=this._getWordBeforePosition(t);if(0===i.length&&(i=this._getCharacterBeforePosition(t)),i.length>0)return new Qke(i,i.length,i.length,Ole.fromPositions(t),0)}const t=500;if(tse&&!e.isEmpty()&&a.getValueLengthInRange(e,0)<t){const t=a.getValueInRange(e,0);return new Qke(t,0,t.length,e,0)}if(Gde&&!e.isEmpty()){const e="vscode-placeholder";return new Qke(e,0,e.length,null,void 0)}return Qke.EMPTY}if(Qde){const e=this._selections[0];if(e.isEmpty()){const t=e.getStartPosition(),[i,n]=this._getAndroidWordAtPosition(t);if(i.length>0)return new Qke(i,n,n,Ole.fromPositions(t),0)}return Qke.EMPTY}return Xke.fromEditorSelection(a,this._selections[0],this._accessibilityPageSize,0===this._accessibilitySupport)},deduceModelPosition:(e,t,i)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(e,t,i)},h=this._register(new nLe(this.textArea.domNode));this._textAreaInput=this._register(new tLe(l,h,cse,e)),this._register(this._textAreaInput.onKeyDown((e=>{this._viewController.emitKeyDown(e)}))),this._register(this._textAreaInput.onKeyUp((e=>{this._viewController.emitKeyUp(e)}))),this._register(this._textAreaInput.onPaste((e=>{let t=!1,i=null,n=null;e.metadata&&(t=this._emptySelectionClipboard&&!!e.metadata.isFromEmptySelection,i=void 0!==e.metadata.multicursorText?e.metadata.multicursorText:null,n=e.metadata.mode),this._viewController.paste(e.text,t,i,n)}))),this._register(this._textAreaInput.onCut((()=>{this._viewController.cut()}))),this._register(this._textAreaInput.onType((e=>{e.replacePrevCharCnt||e.replaceNextCharCnt||e.positionDelta?this._viewController.compositionType(e.text,e.replacePrevCharCnt,e.replaceNextCharCnt,e.positionDelta):this._viewController.type(e.text)}))),this._register(this._textAreaInput.onSelectionChangeRequest((e=>{this._viewController.setSelection(e)}))),this._register(this._textAreaInput.onCompositionStart((e=>{const t=this.textArea.domNode,i=this._modelSelections[0],{distanceToModelLineStart:n,widthOfHiddenTextBefore:o}=(()=>{const e=t.value.substring(0,Math.min(t.selectionStart,t.selectionEnd)),n=e.lastIndexOf("\n"),o=e.substring(n+1),s=o.lastIndexOf("\t"),r=o.length-s-1,a=i.getStartPosition(),l=Math.min(a.column-1,r),h=a.column-1-l,d=o.substring(0,o.length-l),{tabSize:c}=this._context.viewModel.model.getOptions(),u=function(e,t,i){if(0===e.length)return 0;const n=document.createElement("div");n.style.position="absolute",n.style.top="-50000px",n.style.width="50000px";const o=document.createElement("span");nce(o,t),o.style.whiteSpace="pre",o.style.tabSize=i*t.spaceWidth+"px",o.append(e),n.appendChild(o),document.body.appendChild(n);const s=o.offsetWidth;return document.body.removeChild(n),s}(d,this._fontInfo,c);return{distanceToModelLineStart:h,widthOfHiddenTextBefore:u}})(),{distanceToModelLineEnd:s}=(()=>{const e=t.value.substring(Math.max(t.selectionStart,t.selectionEnd)),n=e.indexOf("\n"),o=-1===n?e:e.substring(0,n),s=o.indexOf("\t"),r=-1===s?o.length:o.length-s-1,a=i.getEndPosition(),l=Math.min(this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column,r);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column-l}})();this._context.viewModel.revealRange("keyboard",!0,Ole.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new hxe(this._context,i.startLineNumber,n,o,s),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${axe} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()}))),this._register(this._textAreaInput.onCompositionUpdate((e=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())}))),this._register(this._textAreaInput.onCompositionEnd((()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${axe}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()}))),this._register(this._textAreaInput.onFocus((()=>{this._context.viewModel.setHasFocus(!0)}))),this._register(this._textAreaInput.onBlur((()=>{this._context.viewModel.setHasFocus(!1)}))),this._register(lxe.onDidChange((()=>{this._ensureReadOnlyAttribute()})))}writeScreenReaderContent(e){this._textAreaInput.writeScreenReaderContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=ome('`~!@#$%^&*()-=+[{]}\\|;:",.<>/?');let n=!0,o=e.column,s=!0,r=e.column,a=0;for(;a<50&&(n||s);){if(n&&o<=1&&(n=!1),n){const e=t.charCodeAt(o-2);0!==i.get(e)?n=!1:o--}if(s&&r>t.length&&(s=!1),s){const e=t.charCodeAt(r-1);0!==i.get(e)?s=!1:r++}a++}return[t.substring(o-1,r-1),e.column-o]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=ome(this._context.configuration.options.get(124));let n=e.column,o=0;for(;n>1;){const s=t.charCodeAt(n-2);if(0!==i.get(s)||o>50)return t.substring(n-1,e.column-1);o++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const t=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!pde(t.charCodeAt(0)))return t}return""}_getAriaLabel(e){return 1===e.get(2)?Toe(0,"The editor is not accessible at this time. Press {0} for options.",ise?"Shift+Alt+F1":"Alt+F1"):e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);2===this._accessibilitySupport&&t===Wre.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const i=e.get(138).wrappingColumn;if(-1!==i&&1!==this._accessibilitySupport){const t=e.get(47);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(i*t.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=dxe?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(138);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(47),this._lineHeight=t.get(63),this._emptySelectionClipboard=t.get(34),this._copyWithSyntaxHighlighting=t.get(22),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:n}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=n*this._fontInfo.spaceWidth+"px",this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("tabindex",String(t.get(118))),(e.hasChanged(31)||e.hasChanged(86))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!lxe.enabled||e.get(31)&&e.get(86)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new Rle(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),null===(t=this._visibleTextArea)||void 0===t||t.prepareRender(e)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){var e;if(this._visibleTextArea){const e=this._visibleTextArea.visibleTextareaStart,t=this._visibleTextArea.visibleTextareaEnd,i=this._visibleTextArea.startPosition,n=this._visibleTextArea.endPosition;if(i&&n&&e&&t&&t.left>=this._scrollLeft&&e.left<=this._scrollLeft+this._contentWidth){const o=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,s=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let r=this._visibleTextArea.widthOfHiddenLineTextBefore,a=this._contentLeft+e.left-this._scrollLeft,l=t.left-e.left+1;if(a<this._contentLeft){const e=this._contentLeft-a;a+=e,r+=e,l-=e}l>this._contentWidth&&(l=this._contentWidth);const h=this._context.viewModel.getViewLineData(i.lineNumber),d=h.tokens.findTokenIndexAtOffset(i.column-1),c=d===h.tokens.findTokenIndexAtOffset(n.column-1),u=this._visibleTextArea.definePresentation(c?h.tokens.getPresentation(d):null);this.textArea.domNode.scrollTop=s*this._lineHeight,this.textArea.domNode.scrollLeft=r,this._doRender({lastRenderPosition:null,top:o,left:a,width:l,height:this._lineHeight,useCover:!1,color:(ehe.getColorMap()||[])[u.foreground],italic:u.italic,bold:u.bold,underline:u.underline,strikethrough:u.strikethrough})}return}if(!this._primaryCursorVisibleRange)return void this._renderAtTopLeft();const t=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(t<this._contentLeft||t>this._contentLeft+this._contentWidth)return void this._renderAtTopLeft();const i=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(i<0||i>this._contentHeight)this._renderAtTopLeft();else if(tse){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const n=null!==(e=this._textAreaInput.textAreaState.newlineCountBeforeSelection)&&void 0!==e?e:this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=n*this._lineHeight}else this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:dxe?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;for(;i=e.indexOf("\n",i+1),-1!==i;)t++;return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:dxe?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;nce(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?Owe.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const n=this._context.configuration.options;n.get(54)?i.setClassName("monaco-editor-background textAreaCover "+oxe.OUTER_CLASS_NAME):0!==n.get(64).renderType?i.setClassName("monaco-editor-background textAreaCover "+txe.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}}function uxe(e,t,i){let n=ede(e);return-1===n&&(n=e.length),function(e,t,i){let n=0;for(let i=0;i<e.length;i++)"\t"===e.charAt(i)?n=lke.nextIndentTabStop(n,t):n++;let o="";if(!i){const e=Math.floor(n/t);n%=t;for(let t=0;t<e;t++)o+="\t"}for(let e=0;e<n;e++)o+=" ";return o}(e.substring(0,n),t,i)+e.substring(n)}const gxe=()=>!0,pxe=()=>!1,mxe=e=>" "===e||"\t"===e;class fxe{static shouldRecreate(e){return e.hasChanged(138)||e.hasChanged(124)||e.hasChanged(34)||e.hasChanged(73)||e.hasChanged(75)||e.hasChanged(76)||e.hasChanged(5)||e.hasChanged(8)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(122)||e.hasChanged(47)||e.hasChanged(86)}constructor(e,t,i,n){this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const o=i.options,s=o.get(138),r=o.get(47);this.readOnly=o.get(86),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=o.get(110),this.lineHeight=r.lineHeight,this.typicalHalfwidthCharacterWidth=r.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(s.height/this.lineHeight)-2),this.useTabStops=o.get(122),this.wordSeparators=o.get(124),this.emptySelectionClipboard=o.get(34),this.copyWithSyntaxHighlighting=o.get(22),this.multiCursorMergeOverlapping=o.get(73),this.multiCursorPaste=o.get(75),this.multiCursorLimit=o.get(76),this.autoClosingBrackets=o.get(5),this.autoClosingQuotes=o.get(8),this.autoClosingDelete=o.get(6),this.autoClosingOvertype=o.get(7),this.autoSurround=o.get(11),this.autoIndent=o.get(9),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const a=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(a)for(const e of a)this.surroundingPairs[e.open]=e.close}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=null===(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)||void 0===e?void 0:e.getElectricCharacters();if(t)for(const e of t)this._electricChars[e]=!0}return this._electricChars}onElectricCharacter(e,t,i){const n=_ue(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return o?o.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return uxe(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return mxe;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return gxe;case"never":return pxe}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return e=>-1!==i.indexOf(e)}visibleColumnFromColumn(e,t){return lke.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const n=lke.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(n<o)return o;const s=e.getLineMaxColumn(t);return n>s?s:n}}class _xe{static fromModelState(e){return new vxe(e)}static fromViewState(e){return new bxe(e)}static fromModelSelection(e){const t=Ple.liftSelection(e),i=new wxe(Ole.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return _xe.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this.fromModelSelection(e[i]);return t}constructor(e,t){this._cursorStateBrand=void 0,this.modelState=e,this.viewState=t}equals(e){return this.viewState.equals(e.viewState)&&this.modelState.equals(e.modelState)}}class vxe{constructor(e){this.modelState=e,this.viewState=null}}class bxe{constructor(e){this.modelState=null,this.viewState=e}}class wxe{constructor(e,t,i,n,o){this.selectionStart=e,this.selectionStartKind=t,this.selectionStartLeftoverVisibleColumns=i,this.position=n,this.leftoverVisibleColumns=o,this._singleCursorStateBrand=void 0,this.selection=wxe._computeSelection(this.selectionStart,this.position)}equals(e){return this.selectionStartLeftoverVisibleColumns===e.selectionStartLeftoverVisibleColumns&&this.leftoverVisibleColumns===e.leftoverVisibleColumns&&this.selectionStartKind===e.selectionStartKind&&this.position.equals(e.position)&&this.selectionStart.equalsRange(e.selectionStart)}hasSelection(){return!this.selection.isEmpty()||!this.selectionStart.isEmpty()}move(e,t,i,n){return e?new wxe(this.selectionStart,this.selectionStartKind,this.selectionStartLeftoverVisibleColumns,new Rle(t,i),n):new wxe(new Ole(t,i,t,i),0,n,new Rle(t,i),n)}static _computeSelection(e,t){return e.isEmpty()||!t.isBeforeOrEqual(e.getStartPosition())?Ple.fromPositions(e.getStartPosition(),t):Ple.fromPositions(e.getEndPosition(),t)}}class Cxe{constructor(e,t,i){this._editOperationResultBrand=void 0,this.type=e,this.commands=t,this.shouldPushStackElementBefore=i.shouldPushStackElementBefore,this.shouldPushStackElementAfter=i.shouldPushStackElementAfter}}function yxe(e){return"'"===e||'"'===e||"`"===e}class Sxe{static columnSelect(e,t,i,n,o,s){const r=Math.abs(o-i)+1,a=i>o,l=n>s,h=n<s,d=[];for(let o=0;o<r;o++){const r=i+(a?-o:o),c=e.columnFromVisibleColumn(t,r,n),u=e.columnFromVisibleColumn(t,r,s),g=e.visibleColumnFromColumn(t,new Rle(r,c)),p=e.visibleColumnFromColumn(t,new Rle(r,u));if(h){if(g>s)continue;if(p<n)continue}if(l){if(p>n)continue;if(g<s)continue}d.push(new wxe(new Ole(r,c,r,c),0,0,new Rle(r,u),0))}if(0===d.length)for(let e=0;e<r;e++){const n=i+(a?-e:e),o=t.getLineMaxColumn(n);d.push(new wxe(new Ole(n,o,n,o),0,0,new Rle(n,o),0))}return{viewStates:d,reversed:a,fromLineNumber:i,fromVisualColumn:n,toLineNumber:o,toVisualColumn:s}}static columnSelectLeft(e,t,i){let n=i.toViewVisualColumn;return n>0&&n--,Sxe.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),s=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let i=o;i<=s;i++){const o=t.getLineMaxColumn(i),s=e.visibleColumnFromColumn(t,new Rle(i,o));n=Math.max(n,s)}let r=i.toViewVisualColumn;return r<n&&r++,this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,r)}static columnSelectUp(e,t,i,n){const o=n?e.pageSize:1,s=Math.max(1,i.toViewLineNumber-o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,s,i.toViewVisualColumn)}static columnSelectDown(e,t,i,n){const o=n?e.pageSize:1,s=Math.min(t.getLineCount(),i.toViewLineNumber+o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,s,i.toViewVisualColumn)}}class kxe{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return Ple.fromPositions(i.getEndPosition())}}class Lxe{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return Ple.fromPositions(i.getStartPosition())}}class xxe{constructor(e,t,i,n,o=!1){this._range=e,this._text=t,this._columnDeltaOffset=n,this._lineNumberDeltaOffset=i,this.insertsAutoWhitespace=o}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return Ple.fromPositions(i.getEndPosition().delta(this._lineNumberDeltaOffset,this._columnDeltaOffset))}}class Dxe{constructor(e,t,i,n=!1){this._range=e,this._text=t,this._initialSelection=i,this._forceMoveMarkers=n,this._selectionId=null}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text,this._forceMoveMarkers),this._selectionId=t.trackSelection(this._initialSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}class Exe{constructor(e,t,i){this._cursorPositionBrand=void 0,this.lineNumber=e,this.column=t,this.leftoverVisibleColumns=i}}class Nxe{static leftPosition(e,t){if(t.column>e.getLineMinColumn(t.lineNumber))return t.delta(void 0,-Cde(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new Rle(i,e.getLineMaxColumn(i))}return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const n=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),s=hke.atomicPosition(o,t.column-1,i,0);if(-1!==s&&s+1>=n)return new Rle(t.lineNumber,s+1)}return this.leftPosition(e,t)}static left(e,t,i){const n=e.stickyTabStops?Nxe.leftPositionAtomicSoftTabs(t,i,e.tabSize):Nxe.leftPosition(t,i);return new Exe(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,o){let s,r;if(i.hasSelection()&&!n)s=i.selection.startLineNumber,r=i.selection.startColumn;else{const n=i.position.delta(void 0,-(o-1)),a=t.normalizePosition(Nxe.clipPositionColumn(n,t),0),l=Nxe.left(e,t,a);s=l.lineNumber,r=l.column}return i.move(n,s,r,0)}static clipPositionColumn(e,t){return new Rle(e.lineNumber,Nxe.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return e<t?t:e>i?i:e}static rightPosition(e,t,i){return i<e.getLineMaxColumn(t)?i+=wde(e.getLineContent(t),i-1):t<e.getLineCount()&&(t+=1,i=e.getLineMinColumn(t)),new Rle(t,i)}static rightPositionAtomicSoftTabs(e,t,i,n,o){if(i<e.getLineIndentColumn(t)){const o=e.getLineContent(t),s=hke.atomicPosition(o,i-1,n,1);if(-1!==s)return new Rle(t,s+1)}return this.rightPosition(e,t,i)}static right(e,t,i){const n=e.stickyTabStops?Nxe.rightPositionAtomicSoftTabs(t,i.lineNumber,i.column,e.tabSize,e.indentSize):Nxe.rightPosition(t,i.lineNumber,i.column);return new Exe(n.lineNumber,n.column,0)}static moveRight(e,t,i,n,o){let s,r;if(i.hasSelection()&&!n)s=i.selection.endLineNumber,r=i.selection.endColumn;else{const n=i.position.delta(void 0,o-1),a=t.normalizePosition(Nxe.clipPositionColumn(n,t),1),l=Nxe.right(e,t,a);s=l.lineNumber,r=l.column}return i.move(n,s,r,0)}static vertical(e,t,i,n,o,s,r,a){const l=lke.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize)+o,h=t.getLineCount(),d=1===i&&1===n,c=i===h&&n===t.getLineMaxColumn(i),u=s<i?d:c;if((i=s)<1?(i=1,n=r?t.getLineMinColumn(i):Math.min(t.getLineMaxColumn(i),n)):i>h?(i=h,n=r?t.getLineMaxColumn(i):Math.min(t.getLineMaxColumn(i),n)):n=e.columnFromVisibleColumn(t,i,l),o=u?0:l-lke.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),void 0!==a){const e=new Rle(i,n),s=t.normalizePosition(e,a);o+=n-s.column,i=s.lineNumber,n=s.column}return new Exe(i,n,o)}static down(e,t,i,n,o,s,r){return this.vertical(e,t,i,n,o,i+s,r,4)}static moveDown(e,t,i,n,o){let s,r;i.hasSelection()&&!n?(s=i.selection.endLineNumber,r=i.selection.endColumn):(s=i.position.lineNumber,r=i.position.column);const a=Nxe.down(e,t,s,r,i.leftoverVisibleColumns,o,!0);return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateDown(e,t,i){const n=i.selection,o=Nxe.down(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=Nxe.down(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new wxe(new Ole(o.lineNumber,o.column,o.lineNumber,o.column),0,o.leftoverVisibleColumns,new Rle(s.lineNumber,s.column),s.leftoverVisibleColumns)}static up(e,t,i,n,o,s,r){return this.vertical(e,t,i,n,o,i-s,r,3)}static moveUp(e,t,i,n,o){let s,r;i.hasSelection()&&!n?(s=i.selection.startLineNumber,r=i.selection.startColumn):(s=i.position.lineNumber,r=i.position.column);const a=Nxe.up(e,t,s,r,i.leftoverVisibleColumns,o,!0);return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateUp(e,t,i){const n=i.selection,o=Nxe.up(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=Nxe.up(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new wxe(new Ole(o.lineNumber,o.column,o.lineNumber,o.column),0,o.leftoverVisibleColumns,new Rle(s.lineNumber,s.column),s.leftoverVisibleColumns)}static _isBlankLine(e,t){return 0===e.getLineFirstNonWhitespaceColumn(t)}static moveToPrevBlankLine(e,t,i,n){let o=i.position.lineNumber;for(;o>1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(n,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,n){const o=t.getLineCount();let s=i.position.lineNumber;for(;s<o&&this._isBlankLine(t,s);)s++;for(;s<o&&!this._isBlankLine(t,s);)s++;return i.move(n,s,t.getLineMinColumn(s),0)}static moveToBeginningOfLine(e,t,i,n){const o=i.position.lineNumber,s=t.getLineMinColumn(o),r=t.getLineFirstNonWhitespaceColumn(o)||s;let a;return a=i.position.column===r?s:r,i.move(n,o,a,0)}static moveToEndOfLine(e,t,i,n,o){const s=i.position.lineNumber,r=t.getLineMaxColumn(s);return i.move(n,s,r,o?1073741824-r:0)}static moveToBeginningOfBuffer(e,t,i,n){return i.move(n,1,1,0)}static moveToEndOfBuffer(e,t,i,n){const o=t.getLineCount(),s=t.getLineMaxColumn(o);return i.move(n,o,s,0)}}class Ixe{static deleteRight(e,t,i,n){const o=[];let s=3!==e;for(let e=0,r=n.length;e<r;e++){const r=n[e];let a=r;if(a.isEmpty()){const e=r.getPosition(),n=Nxe.right(t,i,e);a=new Ole(n.lineNumber,n.column,e.lineNumber,e.column)}a.isEmpty()?o[e]=null:(a.startLineNumber!==a.endLineNumber&&(s=!0),o[e]=new kxe(a,""))}return[s,o]}static isAutoClosingPairDelete(e,t,i,n,o,s,r){if("never"===t&&"never"===i)return!1;if("never"===e)return!1;for(let a=0,l=s.length;a<l;a++){const l=s[a],h=l.getPosition();if(!l.isEmpty())return!1;const d=o.getLineContent(h.lineNumber);if(h.column<2||h.column>=d.length+1)return!1;const c=d.charAt(h.column-2),u=n.get(c);if(!u)return!1;if(yxe(c)){if("never"===i)return!1}else if("never"===t)return!1;const g=d.charAt(h.column-1);let p=!1;for(const e of u)e.open===c&&e.close===g&&(p=!0);if(!p)return!1;if("auto"===e){let e=!1;for(let t=0,i=r.length;t<i;t++){const i=r[t];if(h.lineNumber===i.startLineNumber&&h.column===i.startColumn){e=!0;break}}if(!e)return!1}}return!0}static _runAutoClosingPairDelete(e,t,i){const n=[];for(let e=0,t=i.length;e<t;e++){const t=i[e].getPosition(),o=new Ole(t.lineNumber,t.column-1,t.lineNumber,t.column+1);n[e]=new kxe(o,"")}return[!0,n]}static deleteLeft(e,t,i,n,o){if(this.isAutoClosingPairDelete(t.autoClosingDelete,t.autoClosingBrackets,t.autoClosingQuotes,t.autoClosingPairs.autoClosingPairsOpenByEnd,i,n,o))return this._runAutoClosingPairDelete(t,i,n);const s=[];let r=2!==e;for(let e=0,o=n.length;e<o;e++){const o=Ixe.getDeleteRange(n[e],i,t);o.isEmpty()?s[e]=null:(o.startLineNumber!==o.endLineNumber&&(r=!0),s[e]=new kxe(o,""))}return[r,s]}static getDeleteRange(e,t,i){if(!e.isEmpty())return e;const n=e.getPosition();if(i.useTabStops&&n.column>1){const e=t.getLineContent(n.lineNumber),o=ede(e),s=-1===o?e.length+1:o+1;if(n.column<=s){const e=i.visibleColumnFromColumn(t,n),o=lke.prevIndentTabStop(e,i.indentSize),s=i.columnFromVisibleColumn(t,n.lineNumber,o);return new Ole(n.lineNumber,s,n.lineNumber,n.column)}}return Ole.fromPositions(Ixe.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=function(e,t){if(0===e)return 0;const i=function(e,t){const i=new vde(t,e);let n=i.prevCodePoint();for(;Ode(n)||65039===n||8419===n;){if(0===i.offset)return;n=i.prevCodePoint()}if(!Nde(n))return;let o=i.offset;return o>0&&8205===i.prevCodePoint()&&(o=i.offset),o}(e,t);if(void 0!==i)return i;const n=new vde(t,e);return n.prevCodePoint(),n.offset}(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}if(e.lineNumber>1){const i=e.lineNumber-1;return new Rle(i,t.getLineMaxColumn(i))}return e}static cut(e,t,i){const n=[];let o=null;i.sort(((e,t)=>Rle.compare(e.getStartPosition(),t.getEndPosition())));for(let s=0,r=i.length;s<r;s++){const r=i[s];if(r.isEmpty())if(e.emptySelectionClipboard){const e=r.getPosition();let i,a,l,h;e.lineNumber<t.getLineCount()?(i=e.lineNumber,a=1,l=e.lineNumber+1,h=1):e.lineNumber>1&&(null==o?void 0:o.endLineNumber)!==e.lineNumber?(i=e.lineNumber-1,a=t.getLineMaxColumn(e.lineNumber-1),l=e.lineNumber,h=t.getLineMaxColumn(e.lineNumber)):(i=e.lineNumber,a=1,l=e.lineNumber,h=t.getLineMaxColumn(e.lineNumber));const d=new Ole(i,a,l,h);o=d,d.isEmpty()?n[s]=null:n[s]=new kxe(d,"")}else n[s]=null;else n[s]=new kxe(r,"")}return new Cxe(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class Mxe{static _createWord(e,t,i,n,o){return{start:n,end:o,wordType:t,nextCharClass:i}}static _findPreviousWordOnLine(e,t,i){const n=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(n,e,i)}static _doFindPreviousWordOnLine(e,t,i){let n=0;for(let o=i.column-2;o>=0;o--){const i=e.charCodeAt(o),s=t.get(i);if(0===s){if(2===n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1));n=1}else if(2===s){if(1===n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1));n=2}else if(1===s&&0!==n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1))}return 0!==n?this._createWord(e,n,1,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){const o=e.length;for(let s=n;s<o;s++){const n=e.charCodeAt(s),o=t.get(n);if(1===o)return s;if(1===i&&2===o)return s;if(2===i&&0===o)return s}return o}static _findNextWordOnLine(e,t,i){const n=t.getLineContent(i.lineNumber);return this._doFindNextWordOnLine(n,e,i)}static _doFindNextWordOnLine(e,t,i){let n=0;const o=e.length;for(let s=i.column-1;s<o;s++){const i=e.charCodeAt(s),o=t.get(i);if(0===o){if(2===n)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,s-1),s);n=1}else if(2===o){if(1===n)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,s-1),s);n=2}else if(1===o&&0!==n)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,s-1),s)}return 0!==n?this._createWord(e,n,1,this._findStartOfWord(e,t,n,o-1),o):null}static _findStartOfWord(e,t,i,n){for(let o=n;o>=0;o--){const n=e.charCodeAt(o),s=t.get(n);if(1===s)return o+1;if(1===i&&2===s)return o+1;if(2===i&&0===s)return o+1}return 0}static moveWordLeft(e,t,i,n){let o=i.lineNumber,s=i.column;1===s&&o>1&&(o-=1,s=t.getLineMaxColumn(o));let r=Mxe._findPreviousWordOnLine(e,t,new Rle(o,s));if(0===n)return new Rle(o,r?r.start+1:1);if(1===n)return r&&2===r.wordType&&r.end-r.start==1&&0===r.nextCharClass&&(r=Mxe._findPreviousWordOnLine(e,t,new Rle(o,r.start+1))),new Rle(o,r?r.start+1:1);if(3===n){for(;r&&2===r.wordType;)r=Mxe._findPreviousWordOnLine(e,t,new Rle(o,r.start+1));return new Rle(o,r?r.start+1:1)}return r&&s<=r.end+1&&(r=Mxe._findPreviousWordOnLine(e,t,new Rle(o,r.start+1))),new Rle(o,r?r.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(1===t.column)return i>1?new Rle(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let e=t.column-1;e>1;e--){const t=o.charCodeAt(e-2),s=o.charCodeAt(e-1);if(95===t&&95!==s)return new Rle(i,e);if(45===t&&45!==s)return new Rle(i,e);if((lde(t)||ade(t))&&hde(s))return new Rle(i,e);if(hde(t)&&hde(s)&&e+1<n){const t=o.charCodeAt(e);if(lde(t)||ade(t))return new Rle(i,e)}}return new Rle(i,1)}static moveWordRight(e,t,i,n){let o=i.lineNumber,s=i.column,r=!1;s===t.getLineMaxColumn(o)&&o<t.getLineCount()&&(r=!0,o+=1,s=1);let a=Mxe._findNextWordOnLine(e,t,new Rle(o,s));if(2===n)a&&2===a.wordType&&a.end-a.start==1&&0===a.nextCharClass&&(a=Mxe._findNextWordOnLine(e,t,new Rle(o,a.end+1))),s=a?a.end+1:t.getLineMaxColumn(o);else if(3===n){for(r&&(s=0);a&&(2===a.wordType||a.start+1<=s);)a=Mxe._findNextWordOnLine(e,t,new Rle(o,a.end+1));s=a?a.start+1:t.getLineMaxColumn(o)}else a&&!r&&s>=a.start+1&&(a=Mxe._findNextWordOnLine(e,t,new Rle(o,a.end+1))),s=a?a.start+1:t.getLineMaxColumn(o);return new Rle(o,s)}static _moveWordPartRight(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===n)return i<e.getLineCount()?new Rle(i+1,1):t;const o=e.getLineContent(i);for(let e=t.column+1;e<n;e++){const t=o.charCodeAt(e-2),s=o.charCodeAt(e-1);if(95!==t&&95===s)return new Rle(i,e);if(45!==t&&45===s)return new Rle(i,e);if((lde(t)||ade(t))&&hde(s))return new Rle(i,e);if(hde(t)&&hde(s)&&e+1<n){const t=o.charCodeAt(e);if(lde(t)||ade(t))return new Rle(i,e)}}return new Rle(i,n)}static _deleteWordLeftWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=t.column-2,o=ide(i,n);return o+1<n?new Ole(t.lineNumber,o+2,t.lineNumber,t.column):null}static deleteWordLeft(e,t){const i=e.wordSeparators,n=e.model,o=e.selection,s=e.whitespaceHeuristics;if(!o.isEmpty())return o;if(Ixe.isAutoClosingPairDelete(e.autoClosingDelete,e.autoClosingBrackets,e.autoClosingQuotes,e.autoClosingPairs.autoClosingPairsOpenByEnd,e.model,[e.selection],e.autoClosedCharacters)){const t=e.selection.getPosition();return new Ole(t.lineNumber,t.column-1,t.lineNumber,t.column+1)}const r=new Rle(o.positionLineNumber,o.positionColumn);let a=r.lineNumber,l=r.column;if(1===a&&1===l)return null;if(s){const e=this._deleteWordLeftWhitespace(n,r);if(e)return e}let h=Mxe._findPreviousWordOnLine(i,n,r);return 0===t?h?l=h.start+1:l>1?l=1:(a--,l=n.getLineMaxColumn(a)):(h&&l<=h.end+1&&(h=Mxe._findPreviousWordOnLine(i,n,new Rle(a,h.start+1))),h?l=h.end+1:l>1?l=1:(a--,l=n.getLineMaxColumn(a))),new Ole(a,l,r.lineNumber,r.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new Rle(i.positionLineNumber,i.positionColumn);return this._deleteInsideWordWhitespace(t,n)||this._deleteInsideWordDetermineDeleteRange(e,t,n)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return 32===i||9===i}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=i.length;if(0===n)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let s=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,s))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;s+1<n&&this._charAtIsWhitespace(i,s+1);)s++;return new Ole(t.lineNumber,o+1,t.lineNumber,s+2)}static _deleteInsideWordDetermineDeleteRange(e,t,i){const n=t.getLineContent(i.lineNumber),o=n.length;if(0===o)return i.lineNumber>1?new Ole(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumber<t.getLineCount()?new Ole(i.lineNumber,1,i.lineNumber+1,1):new Ole(i.lineNumber,1,i.lineNumber,1);const s=e=>e.start+1<=i.column&&i.column<=e.end+1,r=(e,t)=>(e=Math.min(e,i.column),t=Math.max(t,i.column),new Ole(i.lineNumber,e,i.lineNumber,t)),a=e=>{let t=e.start+1,i=e.end+1,s=!1;for(;i-1<o&&this._charAtIsWhitespace(n,i-1);)s=!0,i++;if(!s)for(;t>1&&this._charAtIsWhitespace(n,t-2);)t--;return r(t,i)},l=Mxe._findPreviousWordOnLine(e,t,i);if(l&&s(l))return a(l);const h=Mxe._findNextWordOnLine(e,t,i);return h&&s(h)?a(h):l&&h?r(l.end+1,h.start+1):l?r(l.start+1,l.end+1):h?r(h.start+1,h.end+1):r(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=Mxe._moveWordPartLeft(e,i);return new Ole(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let n=t;n<i;n++){const t=e.charAt(n);if(" "!==t&&"\t"!==t)return n}return i}static _deleteWordRightWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=t.column-1,o=this._findFirstNonWhitespaceChar(i,n);return n+1<o?new Ole(t.lineNumber,t.column,t.lineNumber,o+1):null}static deleteWordRight(e,t){const i=e.wordSeparators,n=e.model,o=e.selection,s=e.whitespaceHeuristics;if(!o.isEmpty())return o;const r=new Rle(o.positionLineNumber,o.positionColumn);let a=r.lineNumber,l=r.column;const h=n.getLineCount(),d=n.getLineMaxColumn(a);if(a===h&&l===d)return null;if(s){const e=this._deleteWordRightWhitespace(n,r);if(e)return e}let c=Mxe._findNextWordOnLine(i,n,r);return 2===t?c?l=c.end+1:l<d||a===h?l=d:(a++,c=Mxe._findNextWordOnLine(i,n,new Rle(a,1)),l=c?c.start+1:n.getLineMaxColumn(a)):(c&&l>=c.start+1&&(c=Mxe._findNextWordOnLine(i,n,new Rle(a,c.end+1))),c?l=c.start+1:l<d||a===h?l=d:(a++,c=Mxe._findNextWordOnLine(i,n,new Rle(a,1)),l=c?c.start+1:n.getLineMaxColumn(a))),new Ole(a,l,r.lineNumber,r.column)}static _deleteWordPartRight(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=Mxe._moveWordPartRight(e,i);return new Ole(i.lineNumber,i.column,n.lineNumber,n.column)}static _createWordAtPosition(e,t,i){const n=new Ole(t,i.start+1,t,i.end+1);return{word:e.getValueInRange(n),startColumn:n.startColumn,endColumn:n.endColumn}}static getWordAtPosition(e,t,i){const n=ome(t),o=Mxe._findPreviousWordOnLine(n,e,i);if(o&&1===o.wordType&&o.start<=i.column-1&&i.column-1<=o.end)return Mxe._createWordAtPosition(e,i.lineNumber,o);const s=Mxe._findNextWordOnLine(n,e,i);return s&&1===s.wordType&&s.start<=i.column-1&&i.column-1<=s.end?Mxe._createWordAtPosition(e,i.lineNumber,s):null}static word(e,t,i,n,o){const s=ome(e.wordSeparators),r=Mxe._findPreviousWordOnLine(s,t,o),a=Mxe._findNextWordOnLine(s,t,o);if(!n){let e,i;return r&&1===r.wordType&&r.start<=o.column-1&&o.column-1<=r.end?(e=r.start+1,i=r.end+1):a&&1===a.wordType&&a.start<=o.column-1&&o.column-1<=a.end?(e=a.start+1,i=a.end+1):(e=r?r.end+1:1,i=a?a.start+1:t.getLineMaxColumn(o.lineNumber)),new wxe(new Ole(o.lineNumber,e,o.lineNumber,i),1,0,new Rle(o.lineNumber,i),0)}let l,h;r&&1===r.wordType&&r.start<o.column-1&&o.column-1<r.end?(l=r.start+1,h=r.end+1):a&&1===a.wordType&&a.start<o.column-1&&o.column-1<a.end?(l=a.start+1,h=a.end+1):(l=o.column,h=o.column);const d=o.lineNumber;let c;if(i.selectionStart.containsPosition(o))c=i.selectionStart.endColumn;else if(o.isBeforeOrEqual(i.selectionStart.getStartPosition())){c=l;const e=new Rle(d,c);i.selectionStart.containsPosition(e)&&(c=i.selectionStart.endColumn)}else{c=h;const e=new Rle(d,c);i.selectionStart.containsPosition(e)&&(c=i.selectionStart.startColumn)}return i.move(!0,d,c,0)}}class Txe{static addCursorDown(e,t,i){const n=[];let o=0;for(let s=0,r=t.length;s<r;s++){const r=t[s];n[o++]=new _xe(r.modelState,r.viewState),n[o++]=i?_xe.fromModelState(Nxe.translateDown(e.cursorConfig,e.model,r.modelState)):_xe.fromViewState(Nxe.translateDown(e.cursorConfig,e,r.viewState))}return n}static addCursorUp(e,t,i){const n=[];let o=0;for(let s=0,r=t.length;s<r;s++){const r=t[s];n[o++]=new _xe(r.modelState,r.viewState),n[o++]=i?_xe.fromModelState(Nxe.translateUp(e.cursorConfig,e.model,r.modelState)):_xe.fromViewState(Nxe.translateUp(e.cursorConfig,e,r.viewState))}return n}static moveToBeginningOfLine(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o];n[o]=this._moveToLineStart(e,s,i)}return n}static _moveToLineStart(e,t,i){const n=t.viewState.position.column,o=n===t.modelState.position.column,s=t.viewState.position.lineNumber,r=e.getLineFirstNonWhitespaceColumn(s);return o||n===r?this._moveToLineStartByModel(e,t,i):this._moveToLineStartByView(e,t,i)}static _moveToLineStartByView(e,t,i){return _xe.fromViewState(Nxe.moveToBeginningOfLine(e.cursorConfig,e,t.viewState,i))}static _moveToLineStartByModel(e,t,i){return _xe.fromModelState(Nxe.moveToBeginningOfLine(e.cursorConfig,e.model,t.modelState,i))}static moveToEndOfLine(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=this._moveToLineEnd(e,r,i,n)}return o}static _moveToLineEnd(e,t,i,n){const o=t.viewState.position,s=e.getLineMaxColumn(o.lineNumber),r=o.column===s,a=t.modelState.position,l=e.model.getLineMaxColumn(a.lineNumber),h=s-o.column==l-a.column;return r||h?this._moveToLineEndByModel(e,t,i,n):this._moveToLineEndByView(e,t,i,n)}static _moveToLineEndByView(e,t,i,n){return _xe.fromViewState(Nxe.moveToEndOfLine(e.cursorConfig,e,t.viewState,i,n))}static _moveToLineEndByModel(e,t,i,n){return _xe.fromModelState(Nxe.moveToEndOfLine(e.cursorConfig,e.model,t.modelState,i,n))}static expandLineSelection(e,t){const i=[];for(let n=0,o=t.length;n<o;n++){const o=t[n],s=o.modelState.selection.startLineNumber,r=e.model.getLineCount();let a,l=o.modelState.selection.endLineNumber;l===r?a=e.model.getLineMaxColumn(r):(l++,a=1),i[n]=_xe.fromModelState(new wxe(new Ole(s,1,s,1),0,0,new Rle(l,a),0))}return i}static moveToBeginningOfBuffer(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o];n[o]=_xe.fromModelState(Nxe.moveToBeginningOfBuffer(e.cursorConfig,e.model,s.modelState,i))}return n}static moveToEndOfBuffer(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o];n[o]=_xe.fromModelState(Nxe.moveToEndOfBuffer(e.cursorConfig,e.model,s.modelState,i))}return n}static selectAll(e,t){const i=e.model.getLineCount(),n=e.model.getLineMaxColumn(i);return _xe.fromModelState(new wxe(new Ole(1,1,1,1),0,0,new Rle(i,n),0))}static line(e,t,i,n,o){const s=e.model.validatePosition(n),r=o?e.coordinatesConverter.validateViewPosition(new Rle(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);if(!i){const t=e.model.getLineCount();let i=s.lineNumber+1,n=1;return i>t&&(i=t,n=e.model.getLineMaxColumn(i)),_xe.fromModelState(new wxe(new Ole(s.lineNumber,1,i,n),2,0,new Rle(i,n),0))}const a=t.modelState.selectionStart.getStartPosition().lineNumber;if(s.lineNumber<a)return _xe.fromViewState(t.viewState.move(!0,r.lineNumber,1,0));if(s.lineNumber>a){const i=e.getLineCount();let n=r.lineNumber+1,o=1;return n>i&&(n=i,o=e.getLineMaxColumn(n)),_xe.fromViewState(t.viewState.move(!0,n,o,0))}{const e=t.modelState.selectionStart.getEndPosition();return _xe.fromModelState(t.modelState.move(!0,e.lineNumber,e.column,0))}}static word(e,t,i,n){const o=e.model.validatePosition(n);return _xe.fromModelState(Mxe.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new _xe(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return _xe.fromViewState(new wxe(new Ole(i,n,i,n),0,0,new Rle(i,n),0))}static moveTo(e,t,i,n,o){if(i){if(1===t.modelState.selectionStartKind)return this.word(e,t,i,n);if(2===t.modelState.selectionStartKind)return this.line(e,t,i,n,o)}const s=e.model.validatePosition(n),r=o?e.coordinatesConverter.validateViewPosition(new Rle(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);return _xe.fromViewState(t.viewState.move(i,r.lineNumber,r.column,0))}static simpleMove(e,t,i,n,o,s){switch(i){case 0:return 4===s?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,o);case 1:return 4===s?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,o);case 2:return 2===s?this._moveUpByViewLines(e,t,n,o):this._moveUpByModelLines(e,t,n,o);case 3:return 2===s?this._moveDownByViewLines(e,t,n,o):this._moveDownByModelLines(e,t,n,o);case 4:return 2===s?t.map((t=>_xe.fromViewState(Nxe.moveToPrevBlankLine(e.cursorConfig,e,t.viewState,n)))):t.map((t=>_xe.fromModelState(Nxe.moveToPrevBlankLine(e.cursorConfig,e.model,t.modelState,n))));case 5:return 2===s?t.map((t=>_xe.fromViewState(Nxe.moveToNextBlankLine(e.cursorConfig,e,t.viewState,n)))):t.map((t=>_xe.fromModelState(Nxe.moveToNextBlankLine(e.cursorConfig,e.model,t.modelState,n))));case 6:return this._moveToViewMinColumn(e,t,n);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case 8:return this._moveToViewCenterColumn(e,t,n);case 9:return this._moveToViewMaxColumn(e,t,n);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,o){const s=e.getCompletelyVisibleViewRange(),r=e.coordinatesConverter.convertViewRangeToModelRange(s);switch(i){case 11:{const i=this._firstLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 13:{const i=this._lastLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 12:{const i=Math.round((r.startLineNumber+r.endLineNumber)/2),o=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,o)]}case 14:{const i=[];for(let o=0,r=t.length;o<r;o++){const r=t[o];i[o]=this.findPositionInViewportIfOutside(e,r,s,n)}return i}default:return null}}static findPositionInViewportIfOutside(e,t,i,n){const o=t.viewState.position.lineNumber;if(i.startLineNumber<=o&&o<=i.endLineNumber-1)return new _xe(t.modelState,t.viewState);{let s;s=o>i.endLineNumber-1?i.endLineNumber-1:o<i.startLineNumber?i.startLineNumber:o;const r=Nxe.vertical(e.cursorConfig,e,o,t.viewState.position.column,t.viewState.leftoverVisibleColumns,s,!1);return _xe.fromViewState(t.viewState.move(n,r.lineNumber,r.column,r.leftoverVisibleColumns))}}static _firstLineNumberInRange(e,t,i){let n=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(n)&&n++,Math.min(t.endLineNumber,n+i-1)}static _lastLineNumberInRange(e,t,i){let n=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(n)&&n++,Math.max(n,t.endLineNumber-i+1)}static _moveLeft(e,t,i,n){return t.map((t=>_xe.fromViewState(Nxe.moveLeft(e.cursorConfig,e,t.viewState,i,n))))}static _moveHalfLineLeft(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=Math.round(e.getLineContent(r).length/2);n[o]=_xe.fromViewState(Nxe.moveLeft(e.cursorConfig,e,s.viewState,i,a))}return n}static _moveRight(e,t,i,n){return t.map((t=>_xe.fromViewState(Nxe.moveRight(e.cursorConfig,e,t.viewState,i,n))))}static _moveHalfLineRight(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=Math.round(e.getLineContent(r).length/2);n[o]=_xe.fromViewState(Nxe.moveRight(e.cursorConfig,e,s.viewState,i,a))}return n}static _moveDownByViewLines(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=_xe.fromViewState(Nxe.moveDown(e.cursorConfig,e,r.viewState,i,n))}return o}static _moveDownByModelLines(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=_xe.fromModelState(Nxe.moveDown(e.cursorConfig,e.model,r.modelState,i,n))}return o}static _moveUpByViewLines(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=_xe.fromViewState(Nxe.moveUp(e.cursorConfig,e,r.viewState,i,n))}return o}static _moveUpByModelLines(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=_xe.fromModelState(Nxe.moveUp(e.cursorConfig,e.model,r.modelState,i,n))}return o}static _moveToViewPosition(e,t,i,n,o){return _xe.fromViewState(t.viewState.move(i,n,o,0))}static _moveToModelPosition(e,t,i,n,o){return _xe.fromModelState(t.modelState.move(i,n,o,0))}static _moveToViewMinColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineMinColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewFirstNonWhitespaceColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineFirstNonWhitespaceColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewCenterColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=Math.round((e.getLineMaxColumn(r)+e.getLineMinColumn(r))/2);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewMaxColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineMaxColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewLastNonWhitespaceColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineLastNonWhitespaceColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}}var Axe;function Rxe(e,t,i,n){const o=Vge(t,i.startLineNumber,i.startColumn),s=n.getLanguageConfiguration(o.languageId);if(!s)return null;const r=o.getLineContent(),a=r.substr(0,i.startColumn-1-o.firstCharOffset);let l;l=i.isEmpty()?r.substr(i.startColumn-1-o.firstCharOffset):Vge(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-o.firstCharOffset);let h="";if(i.startLineNumber>1&&0===o.firstCharOffset){const e=Vge(t,i.startLineNumber-1);e.languageId===o.languageId&&(h=e.getLineContent())}const d=s.onEnter(e,h,a,l);if(!d)return null;const c=d.indentAction;let u=d.appendText;const g=d.removeText||0;u?c===aue.Indent&&(u="\t"+u):u=c===aue.Indent||c===aue.IndentOutdent?"\t":"";let p=Wge(t,i.startLineNumber,i.startColumn);return g&&(p=p.substring(0,p.length-g)),{indentAction:c,appendText:u,removeText:g,indentation:p}}!function(e){e.description={description:"Move cursor to a logical position in the view",args:[{name:"Cursor move argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'to': A mandatory logical position value providing where to move the cursor.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',\n\t\t\t\t\t\t'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'\n\t\t\t\t\t\t'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'\n\t\t\t\t\t\t'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'line', 'wrappedLine', 'character', 'halfLine'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'select': If 'true' makes the selection. Default is 'false'.\n\t\t\t\t",constraint:function(e){if(!jse(e))return!1;const t=e;return!(!Kse(t.to)||!Yse(t.select)&&!Zse(t.select)||!Yse(t.by)&&!Kse(t.by)||!Yse(t.value)&&!$se(t.value))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},e.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},e.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"},e.parse=function(t){if(!t.to)return null;let i;switch(t.to){case e.RawDirection.Left:i=0;break;case e.RawDirection.Right:i=1;break;case e.RawDirection.Up:i=2;break;case e.RawDirection.Down:i=3;break;case e.RawDirection.PrevBlankLine:i=4;break;case e.RawDirection.NextBlankLine:i=5;break;case e.RawDirection.WrappedLineStart:i=6;break;case e.RawDirection.WrappedLineFirstNonWhitespaceCharacter:i=7;break;case e.RawDirection.WrappedLineColumnCenter:i=8;break;case e.RawDirection.WrappedLineEnd:i=9;break;case e.RawDirection.WrappedLineLastNonWhitespaceCharacter:i=10;break;case e.RawDirection.ViewPortTop:i=11;break;case e.RawDirection.ViewPortBottom:i=13;break;case e.RawDirection.ViewPortCenter:i=12;break;case e.RawDirection.ViewPortIfOutside:i=14;break;default:return null}let n=0;switch(t.by){case e.RawUnit.Line:n=1;break;case e.RawUnit.WrappedLine:n=2;break;case e.RawUnit.Character:n=3;break;case e.RawUnit.HalfLine:n=4}return{direction:i,unit:n,select:!!t.select,value:t.value||1}}}(Axe||(Axe={}));const Oxe=Object.create(null);function Pxe(e,t){if(t<=0)return"";Oxe[e]||(Oxe[e]=["",e]);const i=Oxe[e];for(let n=i.length;n<=t;n++)i[n]=i[n-1]+e;return i[t]}let Fxe=class e{static unshiftIndent(e,t,i,n,o){const s=lke.visibleColumnFromColumn(e,t,i);if(o){const e=Pxe(" ",n);return Pxe(e,lke.prevIndentTabStop(s,n)/n)}return Pxe("\t",lke.prevRenderTabStop(s,i)/i)}static shiftIndent(e,t,i,n,o){const s=lke.visibleColumnFromColumn(e,t,i);if(o){const e=Pxe(" ",n);return Pxe(e,lke.nextIndentTabStop(s,n)/n)}return Pxe("\t",lke.nextRenderTabStop(s,i)/i)}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(t,i){const n=this._selection.startLineNumber;let o=this._selection.endLineNumber;1===this._selection.endColumn&&n!==o&&(o-=1);const{tabSize:s,indentSize:r,insertSpaces:a}=this._opts,l=n===o;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(t.getLineContent(n))&&(this._useLastEditRangeForCursorEndPosition=!0);let h=0,d=0;for(let c=n;c<=o;c++,h=d){d=0;const o=t.getLineContent(c);let u,g=ede(o);if((!this._opts.isUnshift||0!==o.length&&0!==g)&&(l||this._opts.isUnshift||0!==o.length)){if(-1===g&&(g=o.length),c>1&&lke.visibleColumnFromColumn(o,g+1,s)%r!=0&&t.tokenization.isCheapToTokenize(c-1)){const e=Rxe(this._opts.autoIndent,t,new Ole(c-1,t.getLineMaxColumn(c-1),c-1,t.getLineMaxColumn(c-1)),this._languageConfigurationService);if(e){if(d=h,e.appendText)for(let t=0,i=e.appendText.length;t<i&&d<r&&32===e.appendText.charCodeAt(t);t++)d++;e.removeText&&(d=Math.max(0,d-e.removeText));for(let e=0;e<d&&0!==g&&32===o.charCodeAt(g-1);e++)g--}}this._opts.isUnshift&&0===g||(u=this._opts.isUnshift?e.unshiftIndent(o,g+1,s,r,a):e.shiftIndent(o,g+1,s,r,a),this._addEditOperation(i,new Ole(c,1,c,g+1),u),c!==n||this._selection.isEmpty()||(this._selectionStartColumnStaysPut=this._selection.startColumn<=g+1))}}}else{!this._opts.isUnshift&&this._selection.isEmpty()&&0===t.getLineLength(n)&&(this._useLastEditRangeForCursorEndPosition=!0);const e=a?Pxe(" ",r):"\t";for(let s=n;s<=o;s++){const o=t.getLineContent(s);let a=ede(o);if((!this._opts.isUnshift||0!==o.length&&0!==a)&&(l||this._opts.isUnshift||0!==o.length)&&(-1===a&&(a=o.length),!this._opts.isUnshift||0!==a))if(this._opts.isUnshift){a=Math.min(a,r);for(let e=0;e<a;e++)if(9===o.charCodeAt(e)){a=e+1;break}this._addEditOperation(i,new Ole(s,1,s,a+1),"")}else this._addEditOperation(i,new Ole(s,1,s,1),e),s!==n||this._selection.isEmpty()||(this._selectionStartColumnStaysPut=1===this._selection.startColumn)}}this._selectionId=i.trackSelection(this._selection)}computeCursorState(e,t){if(this._useLastEditRangeForCursorEndPosition){const e=t.getInverseEditOperations()[0];return new Ple(e.range.endLineNumber,e.range.endColumn,e.range.endLineNumber,e.range.endColumn)}const i=t.getTrackedSelection(this._selectionId);if(this._selectionStartColumnStaysPut){const e=this._selection.startColumn;return i.startColumn<=e?i:0===i.getDirection()?new Ple(i.startLineNumber,e,i.endLineNumber,i.endColumn):new Ple(i.endLineNumber,i.endColumn,i.startLineNumber,e)}return i}};Fxe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(2,Oge)],Fxe);class Bxe{constructor(e,t,i){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=i}getEditOperations(e,t){t.addTrackedEditOperation(new Ole(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new Ole(this._range.endLineNumber,this._range.endColumn,this._range.endLineNumber,this._range.endColumn),this._charAfterSelection)}computeCursorState(e,t){const i=t.getInverseEditOperations(),n=i[0].range,o=i[1].range;return new Ple(n.endLineNumber,n.endColumn,o.endLineNumber,o.endColumn-this._charAfterSelection.length)}}class Wxe{constructor(e,t,i){this._position=e,this._text=t,this._charAfter=i}getEditOperations(e,t){t.addTrackedEditOperation(new Ole(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column),this._text+this._charAfter)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return new Ple(i.endLineNumber,i.startColumn,i.endLineNumber,i.endColumn-this._charAfter.length)}}function Vxe(e,t,i,n=!0,o){if(e<4)return null;const s=o.getLanguageConfiguration(t.tokenization.getLanguageId()).indentRulesSupport;if(!s)return null;if(i<=1)return{indentation:"",action:null};for(let e=i-1;e>0&&""===t.getLineContent(e);e--)if(1===e)return{indentation:"",action:null};const r=function(e,t,i){const n=e.tokenization.getLanguageIdAtPosition(t,0);if(t>1){let o,s=-1;for(o=t-1;o>=1;o--){if(e.tokenization.getLanguageIdAtPosition(o,0)!==n)return s;const t=e.getLineContent(o);if(!i.shouldIgnore(t)&&!/^\s+$/.test(t)&&""!==t)return o;s=o}}return-1}(t,i,s);if(r<0)return null;if(r<1)return{indentation:"",action:null};const a=t.getLineContent(r);if(s.shouldIncrease(a)||s.shouldIndentNextLine(a))return{indentation:tde(a),action:aue.Indent,line:r};if(s.shouldDecrease(a))return{indentation:tde(a),action:null,line:r};{if(1===r)return{indentation:tde(t.getLineContent(r)),action:null,line:r};const e=r-1,i=s.getIndentMetadata(t.getLineContent(e));if(!(3&i)&&4&i){let i=0;for(let n=e-1;n>0;n--)if(!s.shouldIndentNextLine(t.getLineContent(n))){i=n;break}return{indentation:tde(t.getLineContent(i+1)),action:null,line:i+1}}if(n)return{indentation:tde(t.getLineContent(r)),action:null,line:r};for(let e=r;e>0;e--){const i=t.getLineContent(e);if(s.shouldIncrease(i))return{indentation:tde(i),action:aue.Indent,line:e};if(s.shouldIndentNextLine(i)){let i=0;for(let n=e-1;n>0;n--)if(!s.shouldIndentNextLine(t.getLineContent(e))){i=n;break}return{indentation:tde(t.getLineContent(i+1)),action:null,line:i+1}}if(s.shouldDecrease(i))return{indentation:tde(i),action:null,line:e}}return{indentation:tde(t.getLineContent(1)),action:null,line:1}}}class zxe{static indent(e,t,i){if(null===t||null===i)return[];const n=[];for(let t=0,o=i.length;t<o;t++)n[t]=new Fxe(i[t],{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return n}static outdent(e,t,i){const n=[];for(let t=0,o=i.length;t<o;t++)n[t]=new Fxe(i[t],{isUnshift:!0,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return n}static shiftIndent(e,t,i){return i=i||1,Fxe.shiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static unshiftIndent(e,t,i){return i=i||1,Fxe.unshiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static _distributedPaste(e,t,i,n){const o=[];for(let e=0,t=i.length;e<t;e++)o[e]=new kxe(i[e],n[e]);return new Cxe(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _simplePaste(e,t,i,n,o){const s=[];for(let e=0,t=i.length;e<t;e++){const t=i[e],r=t.getPosition();if(o&&!t.isEmpty()&&(o=!1),o&&n.indexOf("\n")!==n.length-1&&(o=!1),o){const i=new Ole(r.lineNumber,1,r.lineNumber,1);s[e]=new Dxe(i,n,t,!0)}else s[e]=new kxe(t,n)}return new Cxe(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _distributePasteToCursors(e,t,i,n,o){if(n)return null;if(1===t.length)return null;if(o&&o.length===t.length)return o;if("spread"===e.multiCursorPaste){10===i.charCodeAt(i.length-1)&&(i=i.substr(0,i.length-1)),13===i.charCodeAt(i.length-1)&&(i=i.substr(0,i.length-1));const e=Jhe(i);if(e.length===t.length)return e}return null}static paste(e,t,i,n,o,s){const r=this._distributePasteToCursors(e,i,n,o,s);return r?(i=i.sort(Ole.compareRangesUsingStarts),this._distributedPaste(e,t,i,r)):this._simplePaste(e,t,i,n,o)}static _goodIndentForLine(e,t,i){let n=null,o="";const s=Vxe(e.autoIndent,t,i,!1,e.languageConfigurationService);if(s)n=s.action,o=s.indentation;else if(i>1){let n;for(n=i-1;n>=1&&!(ide(t.getLineContent(n))>=0);n--);if(n<1)return null;const s=t.getLineMaxColumn(n),r=Rxe(e.autoIndent,t,new Ole(n,s,n,s),e.languageConfigurationService);r&&(o=r.indentation+r.appendText)}return n&&(n===aue.Indent&&(o=zxe.shiftIndent(e,o)),n===aue.Outdent&&(o=zxe.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,n){let o="";const s=i.getStartPosition();if(e.insertSpaces){const i=e.visibleColumnFromColumn(t,s),n=e.indentSize,r=n-i%n;for(let e=0;e<r;e++)o+=" "}else o="\t";return new kxe(i,o,n)}static tab(e,t,i){const n=[];for(let o=0,s=i.length;o<s;o++){const s=i[o];if(s.isEmpty()){const i=t.getLineContent(s.startLineNumber);if(/^\s*$/.test(i)&&t.tokenization.isCheapToTokenize(s.startLineNumber)){let r=this._goodIndentForLine(e,t,s.startLineNumber);r=r||"\t";const a=e.normalizeIndentation(r);if(!i.startsWith(a)){n[o]=new kxe(new Ole(s.startLineNumber,1,s.startLineNumber,i.length+1),a,!0);continue}}n[o]=this._replaceJumpToNextIndent(e,t,s,!0)}else{if(s.startLineNumber===s.endLineNumber){const i=t.getLineMaxColumn(s.startLineNumber);if(1!==s.startColumn||s.endColumn!==i){n[o]=this._replaceJumpToNextIndent(e,t,s,!1);continue}}n[o]=new Fxe(s,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService)}}return n}static compositionType(e,t,i,n,o,s,r,a){const l=n.map((e=>this._compositionType(i,e,o,s,r,a)));return new Cxe(4,l,{shouldPushStackElementBefore:jxe(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,o,s){if(!t.isEmpty())return null;const r=t.getPosition(),a=Math.max(1,r.column-n),l=Math.min(e.getLineMaxColumn(r.lineNumber),r.column+o),h=new Ole(r.lineNumber,a,r.lineNumber,l);return e.getValueInRange(h)===i&&0===s?null:new xxe(h,i,0,s)}static _typeCommand(e,t,i){return i?new Lxe(e,t,!0):new kxe(e,t,!0)}static _enter(e,t,i,n){if(0===e.autoIndent)return zxe._typeCommand(n,"\n",i);if(!t.tokenization.isCheapToTokenize(n.getStartPosition().lineNumber)||1===e.autoIndent){const o=tde(t.getLineContent(n.startLineNumber)).substring(0,n.startColumn-1);return zxe._typeCommand(n,"\n"+e.normalizeIndentation(o),i)}const o=Rxe(e.autoIndent,t,n,e.languageConfigurationService);if(o){if(o.indentAction===aue.None)return zxe._typeCommand(n,"\n"+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===aue.Indent)return zxe._typeCommand(n,"\n"+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===aue.IndentOutdent){const t=e.normalizeIndentation(o.indentation),s=e.normalizeIndentation(o.indentation+o.appendText),r="\n"+s+"\n"+t;return i?new Lxe(n,r,!0):new xxe(n,r,-1,s.length-t.length,!0)}if(o.indentAction===aue.Outdent){const t=zxe.unshiftIndent(e,o.indentation);return zxe._typeCommand(n,"\n"+e.normalizeIndentation(t+o.appendText),i)}}const s=tde(t.getLineContent(n.startLineNumber)).substring(0,n.startColumn-1);if(e.autoIndent>=4){const o=function(e,t,i,n,o){if(e<4)return null;t.tokenization.forceTokenization(i.startLineNumber);const s=t.tokenization.getLineTokens(i.startLineNumber),r=_ue(s,i.startColumn-1),a=r.getLineContent();let l,h,d=!1;r.firstCharOffset>0&&s.getLanguageId(0)!==r.languageId?(d=!0,l=a.substr(0,i.startColumn-1-r.firstCharOffset)):l=s.getLineContent().substring(0,i.startColumn-1),h=i.isEmpty()?a.substr(i.startColumn-1-r.firstCharOffset):Vge(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-r.firstCharOffset);const c=o.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!c)return null;const u=l,g=tde(l),p={tokenization:{getLineTokens:e=>t.tokenization.getLineTokens(e),getLanguageId:()=>t.getLanguageId(),getLanguageIdAtPosition:(e,i)=>t.getLanguageIdAtPosition(e,i)},getLineContent:e=>e===i.startLineNumber?u:t.getLineContent(e)},m=tde(s.getLineContent()),f=Vxe(e,p,i.startLineNumber+1,void 0,o);if(!f){const e=d?m:g;return{beforeEnter:e,afterEnter:e}}let _=d?m:f.indentation;return f.action===aue.Indent&&(_=n.shiftIndent(_)),c.shouldDecrease(h)&&(_=n.unshiftIndent(_)),{beforeEnter:d?m:g,afterEnter:_}}(e.autoIndent,t,n,{unshiftIndent:t=>zxe.unshiftIndent(e,t),shiftIndent:t=>zxe.shiftIndent(e,t),normalizeIndentation:t=>e.normalizeIndentation(t)},e.languageConfigurationService);if(o){let s=e.visibleColumnFromColumn(t,n.getEndPosition());const r=n.endColumn,a=ede(t.getLineContent(n.endLineNumber));if(n=a>=0?n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,a+1)):n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new Lxe(n,"\n"+e.normalizeIndentation(o.afterEnter),!0);{let t=0;return r<=a+1&&(e.insertSpaces||(s=Math.ceil(s/e.indentSize)),t=Math.min(s+1-e.normalizeIndentation(o.afterEnter).length-1,0)),new xxe(n,"\n"+e.normalizeIndentation(o.afterEnter),0,t,!0)}}}return zxe._typeCommand(n,"\n"+e.normalizeIndentation(s),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let e=0,n=i.length;e<n;e++)if(!t.tokenization.isCheapToTokenize(i[e].getEndPosition().lineNumber))return!1;return!0}static _runAutoIndentType(e,t,i,n){const o=Wge(t,i.startLineNumber,i.startColumn),s=function(e,t,i,n,o,s){if(e<4)return null;const r=Vge(t,i.startLineNumber,i.startColumn);if(r.firstCharOffset)return null;const a=s.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!a)return null;const l=r.getLineContent(),h=l.substr(0,i.startColumn-1-r.firstCharOffset);let d;if(d=i.isEmpty()?l.substr(i.startColumn-1-r.firstCharOffset):Vge(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-r.firstCharOffset),!a.shouldDecrease(h+d)&&a.shouldDecrease(h+n+d)){const n=Vxe(e,t,i.startLineNumber,!1,s);if(!n)return null;let r=n.indentation;return n.action!==aue.Indent&&(r=o.unshiftIndent(r)),r}return null}(e.autoIndent,t,i,n,{shiftIndent:t=>zxe.shiftIndent(e,t),unshiftIndent:t=>zxe.unshiftIndent(e,t)},e.languageConfigurationService);if(null===s)return null;if(s!==e.normalizeIndentation(o)){const o=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return 0===o?zxe._typeCommand(new Ole(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+n,!1):zxe._typeCommand(new Ole(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+t.getLineContent(i.startLineNumber).substring(o-1,i.startColumn-1)+n,!1)}return null}static _isAutoClosingOvertype(e,t,i,n,o){if("never"===e.autoClosingOvertype)return!1;if(!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let s=0,r=i.length;s<r;s++){const r=i[s];if(!r.isEmpty())return!1;const a=r.getPosition(),l=t.getLineContent(a.lineNumber);if(l.charAt(a.column-1)!==o)return!1;const h=yxe(o);if(92===(a.column>2?l.charCodeAt(a.column-2):0)&&h)return!1;if("auto"===e.autoClosingOvertype){let e=!1;for(let t=0,i=n.length;t<i;t++){const i=n[t];if(a.lineNumber===i.startLineNumber&&a.column===i.startColumn){e=!0;break}}if(!e)return!1}}return!0}static _runAutoClosingOvertype(e,t,i,n,o){const s=[];for(let e=0,t=n.length;e<t;e++){const t=n[e].getPosition(),i=new Ole(t.lineNumber,t.column,t.lineNumber,t.column+1);s[e]=new kxe(i,o)}return new Cxe(4,s,{shouldPushStackElementBefore:jxe(e,4),shouldPushStackElementAfter:!1})}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],o=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],s=n.some((e=>t.startsWith(e.open))),r=o.some((e=>t.startsWith(e.close)));return!s&&r}static _findAutoClosingPairOpen(e,t,i,n){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!o)return null;let s=null;for(const e of o)if(null===s||e.open.length>s.open.length){let o=!0;for(const s of i)if(t.getValueInRange(new Ole(s.lineNumber,s.column-e.open.length+1,s.lineNumber,s.column))+n!==e.open){o=!1;break}o&&(s=e)}return s}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const e of n)e.open!==t.open&&t.open.includes(e.open)&&t.close.endsWith(e.close)&&(!o||e.open.length>o.open.length)&&(o=e);return o}static _getAutoClosingPairClose(e,t,i,n,o){const s=yxe(n),r=s?e.autoClosingQuotes:e.autoClosingBrackets,a=s?e.shouldAutoCloseBefore.quote:e.shouldAutoCloseBefore.bracket;if("never"===r)return null;for(const e of i)if(!e.isEmpty())return null;const l=i.map((e=>{const t=e.getPosition();return o?{lineNumber:t.lineNumber,beforeColumn:t.column-n.length,afterColumn:t.column}:{lineNumber:t.lineNumber,beforeColumn:t.column,afterColumn:t.column}})),h=this._findAutoClosingPairOpen(e,t,l.map((e=>new Rle(e.lineNumber,e.beforeColumn))),n);if(!h)return null;const d=this._findContainedAutoClosingPair(e,h),c=d?d.close:"";let u=!0;for(const i of l){const{lineNumber:o,beforeColumn:s,afterColumn:l}=i,d=t.getLineContent(o),g=d.substring(0,s-1),p=d.substring(l-1);if(p.startsWith(c)||(u=!1),p.length>0){const t=p.charAt(0);if(!zxe._isBeforeClosingBrace(e,p)&&!a(t))return null}if(1===h.open.length&&("'"===n||'"'===n)&&"always"!==r){const t=ome(e.wordSeparators);if(g.length>0){const e=g.charCodeAt(g.length-1);if(0===t.get(e))return null}}if(!t.tokenization.isCheapToTokenize(o))return null;t.tokenization.forceTokenization(o);const m=_ue(t.tokenization.getLineTokens(o),s-1);if(!h.shouldAutoClose(m,s-m.firstCharOffset))return null;const f=h.findNeutralCharacter();if(f){const e=t.tokenization.getTokenTypeIfInsertingCharacter(o,s,f);if(!h.isOK(e))return null}}return u?h.close.substring(0,h.close.length-c.length):h.close}static _runAutoClosingOpenCharType(e,t,i,n,o,s,r){const a=[];for(let e=0,t=n.length;e<t;e++){const t=n[e];a[e]=new Hxe(t,o,!s,r)}return new Cxe(4,a,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static _shouldSurroundChar(e,t){return yxe(t)?"quotes"===e.autoSurround||"languageDefined"===e.autoSurround:"brackets"===e.autoSurround||"languageDefined"===e.autoSurround}static _isSurroundSelectionType(e,t,i,n){if(!zxe._shouldSurroundChar(e,n)||!e.surroundingPairs.hasOwnProperty(n))return!1;const o=yxe(n);for(const e of i){if(e.isEmpty())return!1;let i=!0;for(let n=e.startLineNumber;n<=e.endLineNumber;n++){const o=t.getLineContent(n),s=n===e.startLineNumber?e.startColumn-1:0,r=n===e.endLineNumber?e.endColumn-1:o.length,a=o.substring(s,r);if(/[^ \t]/.test(a)){i=!1;break}}if(i)return!1;if(o&&e.startLineNumber===e.endLineNumber&&e.startColumn+1===e.endColumn&&yxe(t.getValueInRange(e)))return!1}return!0}static _runSurroundSelectionType(e,t,i,n,o){const s=[];for(let e=0,i=n.length;e<i;e++){const i=n[e],r=t.surroundingPairs[o];s[e]=new Bxe(i,o,r)}return new Cxe(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _isTypeInterceptorElectricChar(e,t,i){return!(1!==i.length||!t.tokenization.isCheapToTokenize(i[0].getEndPosition().lineNumber))}static _typeInterceptorElectricChar(e,t,i,n,o){if(!t.electricChars.hasOwnProperty(o)||!n.isEmpty())return null;const s=n.getPosition();i.tokenization.forceTokenization(s.lineNumber);const r=i.tokenization.getLineTokens(s.lineNumber);let a;try{a=t.onElectricCharacter(o,r,s.column)}catch(e){return zre(e),null}if(!a)return null;if(a.matchOpenBracket){const n=(r.getLineContent()+o).lastIndexOf(a.matchOpenBracket)+1,l=i.bracketPairs.findMatchingBracketUp(a.matchOpenBracket,{lineNumber:s.lineNumber,column:n},500);if(l){if(l.startLineNumber===s.lineNumber)return null;const n=tde(i.getLineContent(l.startLineNumber)),r=t.normalizeIndentation(n),a=i.getLineContent(s.lineNumber),h=i.getLineFirstNonWhitespaceColumn(s.lineNumber)||s.column,d=r+a.substring(h-1,s.column-1)+o,c=new Ole(s.lineNumber,1,s.lineNumber,s.column),u=new kxe(c,d);return new Cxe(Kxe(d,e),[u],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!0})}}return null}static compositionEndWithInterceptors(e,t,i,n,o,s){if(!n)return null;let r=null;for(const e of n)if(null===r)r=e.insertedText;else if(r!==e.insertedText)return null;if(!r||1!==r.length)return null;const a=r;let l=!1;for(const e of n)if(0!==e.deletedText.length){l=!0;break}if(l){if(!zxe._shouldSurroundChar(t,a)||!t.surroundingPairs.hasOwnProperty(a))return null;const e=yxe(a);for(const t of n){if(0!==t.deletedSelectionStart||t.deletedSelectionEnd!==t.deletedText.length)return null;if(/^[ \t]+$/.test(t.deletedText))return null;if(e&&yxe(t.deletedText))return null}const i=[];for(const e of o){if(!e.isEmpty())return null;i.push(e.getPosition())}if(i.length!==n.length)return null;const s=[];for(let e=0,o=i.length;e<o;e++)s.push(new Wxe(i[e],n[e].deletedText,t.surroundingPairs[a]));return new Cxe(4,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(t,i,o,s,a)){const e=o.map((e=>new kxe(new Ole(e.positionLineNumber,e.positionColumn,e.positionLineNumber,e.positionColumn+1),"",!1)));return new Cxe(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const h=this._getAutoClosingPairClose(t,i,o,a,!0);return null!==h?this._runAutoClosingOpenCharType(e,t,i,o,a,!0,h):null}static typeWithInterceptors(e,t,i,n,o,s,r){if(!e&&"\n"===r){const e=[];for(let t=0,s=o.length;t<s;t++)e[t]=zxe._enter(i,n,!1,o[t]);return new Cxe(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoIndentType(i,n,o)){const e=[];let t=!1;for(let s=0,a=o.length;s<a;s++)if(e[s]=this._runAutoIndentType(i,n,o[s],r),!e[s]){t=!0;break}if(!t)return new Cxe(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(i,n,o,s,r))return this._runAutoClosingOvertype(t,i,n,o,r);if(!e){const e=this._getAutoClosingPairClose(i,n,o,r,!1);if(e)return this._runAutoClosingOpenCharType(t,i,n,o,r,!1,e)}if(!e&&this._isSurroundSelectionType(i,n,o,r))return this._runSurroundSelectionType(t,i,n,o,r);if(!e&&this._isTypeInterceptorElectricChar(i,n,o)){const e=this._typeInterceptorElectricChar(t,i,n,o[0],r);if(e)return e}const a=[];for(let e=0,t=o.length;e<t;e++)a[e]=new kxe(o[e],r);const l=Kxe(r,t);return new Cxe(l,a,{shouldPushStackElementBefore:jxe(t,l),shouldPushStackElementAfter:!1})}static typeWithoutInterceptors(e,t,i,n,o){const s=[];for(let e=0,t=n.length;e<t;e++)s[e]=new kxe(n[e],o);const r=Kxe(o,e);return new Cxe(r,s,{shouldPushStackElementBefore:jxe(e,r),shouldPushStackElementAfter:!1})}static lineInsertBefore(e,t,i){if(null===t||null===i)return[];const n=[];for(let o=0,s=i.length;o<s;o++){let s=i[o].positionLineNumber;if(1===s)n[o]=new Lxe(new Ole(1,1,1,1),"\n");else{s--;const i=t.getLineMaxColumn(s);n[o]=this._enter(e,t,!1,new Ole(s,i,s,i))}}return n}static lineInsertAfter(e,t,i){if(null===t||null===i)return[];const n=[];for(let o=0,s=i.length;o<s;o++){const s=i[o].positionLineNumber,r=t.getLineMaxColumn(s);n[o]=this._enter(e,t,!1,new Ole(s,r,s,r))}return n}static lineBreakInsert(e,t,i){const n=[];for(let o=0,s=i.length;o<s;o++)n[o]=this._enter(e,t,!0,i[o]);return n}}class Hxe extends xxe{constructor(e,t,i,n){super(e,(i?t:"")+n,0,-n.length),this._openCharacter=t,this._closeCharacter=n,this.closeCharacterRange=null,this.enclosingRange=null}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return this.closeCharacterRange=new Ole(i.startLineNumber,i.endColumn-this._closeCharacter.length,i.endLineNumber,i.endColumn),this.enclosingRange=new Ole(i.startLineNumber,i.endColumn-this._openCharacter.length-this._closeCharacter.length,i.endLineNumber,i.endColumn),super.computeCursorState(e,t)}}class Uxe{constructor(e,t,i,n,o,s){this.deletedText=e,this.deletedSelectionStart=t,this.deletedSelectionEnd=i,this.insertedText=n,this.insertedSelectionStart=o,this.insertedSelectionEnd=s}}function Kxe(e,t){return" "===e?5===t||6===t?6:5:4}function jxe(e,t){return!(!$xe(e)||$xe(t))||5!==e&&qxe(e)!==qxe(t)}function qxe(e){return 6===e||5===e?"space":e}function $xe(e){return 4===e||5===e||6===e}var Gxe,Zxe,Yxe,Qxe;!function(e){e.editorSimpleInput=new jce("editorSimpleInput",!1,!0),e.editorTextFocus=new jce("editorTextFocus",!1,Toe(0,"Whether the editor text has focus (cursor is blinking)")),e.focus=new jce("editorFocus",!1,Toe(0,"Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),e.textInputFocus=new jce("textInputFocus",!1,Toe(0,"Whether an editor or a rich text input has focus (cursor is blinking)")),e.readOnly=new jce("editorReadonly",!1,Toe(0,"Whether the editor is read only")),e.inDiffEditor=new jce("inDiffEditor",!1,Toe(0,"Whether the context is a diff editor")),e.columnSelection=new jce("editorColumnSelection",!1,Toe(0,"Whether `editor.columnSelection` is enabled")),e.writable=e.readOnly.toNegated(),e.hasNonEmptySelection=new jce("editorHasSelection",!1,Toe(0,"Whether the editor has text selected")),e.hasOnlyEmptySelection=e.hasNonEmptySelection.toNegated(),e.hasMultipleSelections=new jce("editorHasMultipleSelections",!1,Toe(0,"Whether the editor has multiple selections")),e.hasSingleSelection=e.hasMultipleSelections.toNegated(),e.tabMovesFocus=new jce("editorTabMovesFocus",!1,Toe(0,"Whether `Tab` will move focus out of the editor")),e.tabDoesNotMoveFocus=e.tabMovesFocus.toNegated(),e.isInWalkThroughSnippet=new jce("isInEmbeddedEditor",!1,!0),e.canUndo=new jce("canUndo",!1,!0),e.canRedo=new jce("canRedo",!1,!0),e.hoverVisible=new jce("editorHoverVisible",!1,Toe(0,"Whether the editor hover is visible")),e.inCompositeEditor=new jce("inCompositeEditor",void 0,Toe(0,"Whether the editor is part of a larger editor (e.g. notebooks)")),e.notInCompositeEditor=e.inCompositeEditor.toNegated(),e.languageId=new jce("editorLangId","",Toe(0,"The language identifier of the editor")),e.hasCompletionItemProvider=new jce("editorHasCompletionItemProvider",!1,Toe(0,"Whether the editor has a completion item provider")),e.hasCodeActionsProvider=new jce("editorHasCodeActionsProvider",!1,Toe(0,"Whether the editor has a code actions provider")),e.hasCodeLensProvider=new jce("editorHasCodeLensProvider",!1,Toe(0,"Whether the editor has a code lens provider")),e.hasDefinitionProvider=new jce("editorHasDefinitionProvider",!1,Toe(0,"Whether the editor has a definition provider")),e.hasDeclarationProvider=new jce("editorHasDeclarationProvider",!1,Toe(0,"Whether the editor has a declaration provider")),e.hasImplementationProvider=new jce("editorHasImplementationProvider",!1,Toe(0,"Whether the editor has an implementation provider")),e.hasTypeDefinitionProvider=new jce("editorHasTypeDefinitionProvider",!1,Toe(0,"Whether the editor has a type definition provider")),e.hasHoverProvider=new jce("editorHasHoverProvider",!1,Toe(0,"Whether the editor has a hover provider")),e.hasDocumentHighlightProvider=new jce("editorHasDocumentHighlightProvider",!1,Toe(0,"Whether the editor has a document highlight provider")),e.hasDocumentSymbolProvider=new jce("editorHasDocumentSymbolProvider",!1,Toe(0,"Whether the editor has a document symbol provider")),e.hasReferenceProvider=new jce("editorHasReferenceProvider",!1,Toe(0,"Whether the editor has a reference provider")),e.hasRenameProvider=new jce("editorHasRenameProvider",!1,Toe(0,"Whether the editor has a rename provider")),e.hasSignatureHelpProvider=new jce("editorHasSignatureHelpProvider",!1,Toe(0,"Whether the editor has a signature help provider")),e.hasInlayHintsProvider=new jce("editorHasInlayHintsProvider",!1,Toe(0,"Whether the editor has an inline hints provider")),e.hasDocumentFormattingProvider=new jce("editorHasDocumentFormattingProvider",!1,Toe(0,"Whether the editor has a document formatting provider")),e.hasDocumentSelectionFormattingProvider=new jce("editorHasDocumentSelectionFormattingProvider",!1,Toe(0,"Whether the editor has a document selection formatting provider")),e.hasMultipleDocumentFormattingProvider=new jce("editorHasMultipleDocumentFormattingProvider",!1,Toe(0,"Whether the editor has multiple document formatting providers")),e.hasMultipleDocumentSelectionFormattingProvider=new jce("editorHasMultipleDocumentSelectionFormattingProvider",!1,Toe(0,"Whether the editor has multiple document selection formatting providers"))}(Gxe||(Gxe={}));class Xxe extends twe{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i||{})}}!function(e){e.description={description:"Scroll editor in the given direction",args:[{name:"Editor scroll argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'to': A mandatory direction value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'up', 'down'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'line', 'wrappedLine', 'page', 'halfPage', 'editor'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'revealCursor': If 'true' reveals the cursor if it is outside view port.\n\t\t\t\t",constraint:function(e){if(!jse(e))return!1;const t=e;return!(!Kse(t.to)||!Yse(t.by)&&!Kse(t.by)||!Yse(t.value)&&!$se(t.value)||!Yse(t.revealCursor)&&!Zse(t.revealCursor))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["up","down"]},by:{type:"string",enum:["line","wrappedLine","page","halfPage","editor"]},value:{type:"number",default:1},revealCursor:{type:"boolean"}}}}]},e.RawDirection={Up:"up",Right:"right",Down:"down",Left:"left"},e.RawUnit={Line:"line",WrappedLine:"wrappedLine",Page:"page",HalfPage:"halfPage",Editor:"editor",Column:"column"},e.parse=function(t){let i,n;switch(t.to){case e.RawDirection.Up:i=1;break;case e.RawDirection.Right:i=2;break;case e.RawDirection.Down:i=3;break;case e.RawDirection.Left:i=4;break;default:return null}switch(t.by){case e.RawUnit.Line:n=1;break;case e.RawUnit.WrappedLine:n=2;break;case e.RawUnit.Page:n=3;break;case e.RawUnit.HalfPage:n=4;break;case e.RawUnit.Editor:n=5;break;case e.RawUnit.Column:n=6;break;default:n=2}return{direction:i,unit:n,value:Math.floor(t.value||1),revealCursor:!!t.revealCursor,select:!!t.select}}}(Zxe||(Zxe={})),function(e){e.description={description:"Reveal the given line at the given logical position",args:[{name:"Reveal line argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'lineNumber': A mandatory line number value.\n\t\t\t\t\t* 'at': Logical position at which line has to be revealed.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'top', 'center', 'bottom'\n\t\t\t\t\t\t```\n\t\t\t\t",constraint:function(e){if(!jse(e))return!1;const t=e;return!(!$se(t.lineNumber)&&!Kse(t.lineNumber)||!Yse(t.at)&&!Kse(t.at))},schema:{type:"object",required:["lineNumber"],properties:{lineNumber:{type:["number","string"]},at:{type:"string",enum:["top","center","bottom"]}}}}]},e.RawAtArgument={Top:"top",Center:"center",Bottom:"bottom"}}(Yxe||(Yxe={}));class Jxe{constructor(e){e.addImplementation(1e4,"code-editor",((e,t)=>{const i=e.get(mce).getFocusedCodeEditor();return!(!i||!i.hasTextFocus())&&this._runEditorCommand(e,i,t)})),e.addImplementation(1e3,"generic-dom-input-textarea",((e,t)=>{const i=document.activeElement;return!!(i&&["input","textarea"].indexOf(i.tagName.toLowerCase())>=0)&&(this.runDOMCommand(),!0)})),e.addImplementation(0,"generic-dom",((e,t)=>{const i=e.get(mce).getActiveCodeEditor();return!!i&&(i.focus(),this._runEditorCommand(e,i,t))}))}_runEditorCommand(e,t,i){return this.runEditorCommand(e,t,i)||!0}}!function(e){class t extends Xxe{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[Txe.moveTo(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)])&&2!==t.revealType&&e.revealPrimaryCursor(t.source,!0,!0))}}e.MoveTo=nwe(new t({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),e.MoveToSelect=nwe(new t({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class i extends Xxe{runCoreEditorCommand(e,t){e.model.pushStackElement();const i=this._getColumnSelectResult(e,e.getPrimaryCursorState(),e.getCursorColumnSelectData(),t);null!==i&&(e.setCursorStates(t.source,3,i.viewStates.map((e=>_xe.fromViewState(e)))),e.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:i.fromLineNumber,fromViewVisualColumn:i.fromVisualColumn,toViewLineNumber:i.toLineNumber,toViewVisualColumn:i.toVisualColumn}),i.reversed?e.revealTopMostCursor(t.source):e.revealBottomMostCursor(t.source))}}e.ColumnSelect=nwe(new class extends i{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(e,t,i,n){if(void 0===n.position||void 0===n.viewPosition||void 0===n.mouseColumn)return null;const o=e.model.validatePosition(n.position),s=e.coordinatesConverter.validateViewPosition(new Rle(n.viewPosition.lineNumber,n.viewPosition.column),o),r=n.doColumnSelect?i.fromViewLineNumber:s.lineNumber,a=n.doColumnSelect?i.fromViewVisualColumn:n.mouseColumn-1;return Sxe.columnSelect(e.cursorConfig,e,r,a,s.lineNumber,n.mouseColumn-1)}}),e.CursorColumnSelectLeft=nwe(new class extends i{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return Sxe.columnSelectLeft(e.cursorConfig,e,i)}}),e.CursorColumnSelectRight=nwe(new class extends i{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return Sxe.columnSelectRight(e.cursorConfig,e,i)}});class n extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return Sxe.columnSelectUp(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectUp=nwe(new n({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:3600,linux:{primary:0}}})),e.CursorColumnSelectPageUp=nwe(new n({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:3595,linux:{primary:0}}}));class o extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return Sxe.columnSelectDown(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectDown=nwe(new o({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:3602,linux:{primary:0}}})),e.CursorColumnSelectPageDown=nwe(new o({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:3596,linux:{primary:0}}}));class s extends Xxe{constructor(){super({id:"cursorMove",precondition:void 0,description:Axe.description})}runCoreEditorCommand(e,t){const i=Axe.parse(t);i&&this._runCursorMove(e,t.source,i)}_runCursorMove(e,t,i){e.model.pushStackElement(),e.setCursorStates(t,3,s._move(e,e.getCursorStates(),i)),e.revealPrimaryCursor(t,!0)}static _move(e,t,i){const n=i.select,o=i.value;switch(i.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return Txe.simpleMove(e,t,i.direction,n,o,i.unit);case 11:case 13:case 12:case 14:return Txe.viewportMove(e,t,i.direction,n,o);default:return null}}}e.CursorMoveImpl=s,e.CursorMove=nwe(new s);class r extends Xxe{constructor(e){super(e),this._staticArgs=e.args}runCoreEditorCommand(e,t){let i=this._staticArgs;-1===this._staticArgs.value&&(i={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:t.pageSize||e.cursorConfig.pageSize}),e.model.pushStackElement(),e.setCursorStates(t.source,3,Txe.simpleMove(e,e.getCursorStates(),i.direction,i.select,i.value,i.unit)),e.revealPrimaryCursor(t.source,!0)}}e.CursorLeft=nwe(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),e.CursorLeftSelect=nwe(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:1039}})),e.CursorRight=nwe(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),e.CursorRightSelect=nwe(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:1041}})),e.CursorUp=nwe(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),e.CursorUpSelect=nwe(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),e.CursorPageUp=nwe(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:11}})),e.CursorPageUpSelect=nwe(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:1035}})),e.CursorDown=nwe(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),e.CursorDownSelect=nwe(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),e.CursorPageDown=nwe(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:12}})),e.CursorPageDownSelect=nwe(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:1036}})),e.CreateCursor=nwe(new class extends Xxe{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;let i;i=t.wholeLine?Txe.line(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition):Txe.moveTo(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition);const n=e.getCursorStates();if(n.length>1){const o=i.modelState?i.modelState.position:null,s=i.viewState?i.viewState.position:null;for(let i=0,r=n.length;i<r;i++){const r=n[i];if((!o||r.modelState.selection.containsPosition(o))&&(!s||r.viewState.selection.containsPosition(s)))return n.splice(i,1),e.model.pushStackElement(),void e.setCursorStates(t.source,3,n)}}n.push(i),e.model.pushStackElement(),e.setCursorStates(t.source,3,n)}}),e.LastCursorMoveToSelect=nwe(new class extends Xxe{constructor(){super({id:"_lastCursorMoveToSelect",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0);o[i]=Txe.moveTo(e,n[i],!0,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}});class a extends Xxe{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,Txe.moveToBeginningOfLine(e,e.getCursorStates(),this._inSelectionMode)),e.revealPrimaryCursor(t.source,!0)}}e.CursorHome=nwe(new a({inSelectionMode:!1,id:"cursorHome",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:14,mac:{primary:14,secondary:[2063]}}})),e.CursorHomeSelect=nwe(new a({inSelectionMode:!0,id:"cursorHomeSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:1038,mac:{primary:1038,secondary:[3087]}}}));class l extends Xxe{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,this._exec(e.getCursorStates())),e.revealPrimaryCursor(t.source,!0)}_exec(e){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i],o=n.modelState.position.lineNumber;t[i]=_xe.fromModelState(n.modelState.move(this._inSelectionMode,o,1,0))}return t}}e.CursorLineStart=nwe(new l({inSelectionMode:!1,id:"cursorLineStart",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:0,mac:{primary:287}}})),e.CursorLineStartSelect=nwe(new l({inSelectionMode:!0,id:"cursorLineStartSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:0,mac:{primary:1311}}}));class h extends Xxe{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,Txe.moveToEndOfLine(e,e.getCursorStates(),this._inSelectionMode,t.sticky||!1)),e.revealPrimaryCursor(t.source,!0)}}e.CursorEnd=nwe(new h({inSelectionMode:!1,id:"cursorEnd",precondition:void 0,kbOpts:{args:{sticky:!1},weight:0,kbExpr:Gxe.textInputFocus,primary:13,mac:{primary:13,secondary:[2065]}},description:{description:"Go to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:Toe(0,"Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}})),e.CursorEndSelect=nwe(new h({inSelectionMode:!0,id:"cursorEndSelect",precondition:void 0,kbOpts:{args:{sticky:!1},weight:0,kbExpr:Gxe.textInputFocus,primary:1037,mac:{primary:1037,secondary:[3089]}},description:{description:"Select to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:Toe(0,"Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}}));class d extends Xxe{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,this._exec(e,e.getCursorStates())),e.revealPrimaryCursor(t.source,!0)}_exec(e,t){const i=[];for(let n=0,o=t.length;n<o;n++){const o=t[n],s=o.modelState.position.lineNumber,r=e.model.getLineMaxColumn(s);i[n]=_xe.fromModelState(o.modelState.move(this._inSelectionMode,s,r,0))}return i}}e.CursorLineEnd=nwe(new d({inSelectionMode:!1,id:"cursorLineEnd",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:0,mac:{primary:291}}})),e.CursorLineEndSelect=nwe(new d({inSelectionMode:!0,id:"cursorLineEndSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:0,mac:{primary:1315}}}));class c extends Xxe{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,Txe.moveToBeginningOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealPrimaryCursor(t.source,!0)}}e.CursorTop=nwe(new c({inSelectionMode:!1,id:"cursorTop",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:2062,mac:{primary:2064}}})),e.CursorTopSelect=nwe(new c({inSelectionMode:!0,id:"cursorTopSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:3086,mac:{primary:3088}}}));class u extends Xxe{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,Txe.moveToEndOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealPrimaryCursor(t.source,!0)}}e.CursorBottom=nwe(new u({inSelectionMode:!1,id:"cursorBottom",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:2061,mac:{primary:2066}}})),e.CursorBottomSelect=nwe(new u({inSelectionMode:!0,id:"cursorBottomSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:3085,mac:{primary:3090}}}));class g extends Xxe{constructor(){super({id:"editorScroll",precondition:void 0,description:Zxe.description})}determineScrollMethod(e){return[6].includes(e.unit)&&[4,2].includes(e.direction)?this._runHorizontalEditorScroll.bind(this):[1,2,3,4,5,6].includes(e.unit)&&[1,3].includes(e.direction)?this._runVerticalEditorScroll.bind(this):null}runCoreEditorCommand(e,t){const i=Zxe.parse(t);if(!i)return;const n=this.determineScrollMethod(i);n&&n(e,t.source,i)}_runVerticalEditorScroll(e,t,i){const n=this._computeDesiredScrollTop(e,i);if(i.revealCursor){const o=e.getCompletelyVisibleViewRangeAtScrollTop(n);e.setCursorStates(t,3,[Txe.findPositionInViewportIfOutside(e,e.getPrimaryCursorState(),o,i.select)])}e.viewLayout.setScrollPosition({scrollTop:n},0)}_computeDesiredScrollTop(e,t){if(1===t.unit){const i=e.viewLayout.getFutureViewport(),n=e.getCompletelyVisibleViewRangeAtScrollTop(i.top),o=e.coordinatesConverter.convertViewRangeToModelRange(n);let s;s=1===t.direction?Math.max(1,o.startLineNumber-t.value):Math.min(e.model.getLineCount(),o.startLineNumber+t.value);const r=e.coordinatesConverter.convertModelPositionToViewPosition(new Rle(s,1));return e.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber)}if(5===t.unit){let i=0;return 3===t.direction&&(i=e.model.getLineCount()-e.cursorConfig.pageSize),e.viewLayout.getVerticalOffsetForLineNumber(i)}let i;i=3===t.unit?e.cursorConfig.pageSize*t.value:4===t.unit?Math.round(e.cursorConfig.pageSize/2)*t.value:t.value;const n=(1===t.direction?-1:1)*i;return e.viewLayout.getCurrentScrollTop()+n*e.cursorConfig.lineHeight}_runHorizontalEditorScroll(e,t,i){const n=this._computeDesiredScrollLeft(e,i);e.viewLayout.setScrollPosition({scrollLeft:n},0)}_computeDesiredScrollLeft(e,t){const i=(4===t.direction?-1:1)*t.value;return e.viewLayout.getCurrentScrollLeft()+i*e.cursorConfig.typicalHalfwidthCharacterWidth}}e.EditorScrollImpl=g,e.EditorScroll=nwe(new g),e.ScrollLineUp=nwe(new class extends Xxe{constructor(){super({id:"scrollLineUp",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:2064,mac:{primary:267}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:Zxe.RawDirection.Up,by:Zxe.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollPageUp=nwe(new class extends Xxe{constructor(){super({id:"scrollPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:2059,win:{primary:523},linux:{primary:523}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:Zxe.RawDirection.Up,by:Zxe.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollEditorTop=nwe(new class extends Xxe{constructor(){super({id:"scrollEditorTop",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:Zxe.RawDirection.Up,by:Zxe.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollLineDown=nwe(new class extends Xxe{constructor(){super({id:"scrollLineDown",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:2066,mac:{primary:268}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:Zxe.RawDirection.Down,by:Zxe.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollPageDown=nwe(new class extends Xxe{constructor(){super({id:"scrollPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:2060,win:{primary:524},linux:{primary:524}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:Zxe.RawDirection.Down,by:Zxe.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollEditorBottom=nwe(new class extends Xxe{constructor(){super({id:"scrollEditorBottom",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:Zxe.RawDirection.Down,by:Zxe.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollLeft=nwe(new class extends Xxe{constructor(){super({id:"scrollLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:Zxe.RawDirection.Left,by:Zxe.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollRight=nwe(new class extends Xxe{constructor(){super({id:"scrollRight",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:Zxe.RawDirection.Right,by:Zxe.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:i.source})}});class p extends Xxe{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[Txe.word(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position)]),2!==t.revealType&&e.revealPrimaryCursor(t.source,!0,!0))}}e.WordSelect=nwe(new p({inSelectionMode:!1,id:"_wordSelect",precondition:void 0})),e.WordSelectDrag=nwe(new p({inSelectionMode:!0,id:"_wordSelectDrag",precondition:void 0})),e.LastCursorWordSelect=nwe(new class extends Xxe{constructor(){super({id:"lastCursorWordSelect",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0),s=n[i];o[i]=Txe.word(e,s,s.modelState.hasSelection(),t.position),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}});class m extends Xxe{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[Txe.line(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)]),2!==t.revealType&&e.revealPrimaryCursor(t.source,!1,!0))}}e.LineSelect=nwe(new m({inSelectionMode:!1,id:"_lineSelect",precondition:void 0})),e.LineSelectDrag=nwe(new m({inSelectionMode:!0,id:"_lineSelectDrag",precondition:void 0}));class f extends Xxe{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){if(!t.position)return;const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0);o[i]=Txe.line(e,n[i],this._inSelectionMode,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}}e.LastCursorLineSelect=nwe(new f({inSelectionMode:!1,id:"lastCursorLineSelect",precondition:void 0})),e.LastCursorLineSelectDrag=nwe(new f({inSelectionMode:!0,id:"lastCursorLineSelectDrag",precondition:void 0})),e.CancelSelection=nwe(new class extends Xxe{constructor(){super({id:"cancelSelection",precondition:Gxe.hasNonEmptySelection,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[Txe.cancelSelection(e,e.getPrimaryCursorState())]),e.revealPrimaryCursor(t.source,!0)}}),e.RemoveSecondaryCursors=nwe(new class extends Xxe{constructor(){super({id:"removeSecondaryCursors",precondition:Gxe.hasMultipleSelections,kbOpts:{weight:1,kbExpr:Gxe.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[e.getPrimaryCursorState()]),e.revealPrimaryCursor(t.source,!0),Lbe(Toe(0,"Removed secondary cursors"))}}),e.RevealLine=nwe(new class extends Xxe{constructor(){super({id:"revealLine",precondition:void 0,description:Yxe.description})}runCoreEditorCommand(e,t){const i=t,n=i.lineNumber||0;let o="number"==typeof n?n+1:parseInt(n)+1;o<1&&(o=1);const s=e.model.getLineCount();o>s&&(o=s);const r=new Ole(o,1,o,e.model.getLineMaxColumn(o));let a=0;if(i.at)switch(i.at){case Yxe.RawAtArgument.Top:a=3;break;case Yxe.RawAtArgument.Center:a=1;break;case Yxe.RawAtArgument.Bottom:a=4}const l=e.coordinatesConverter.convertModelRangeToViewRange(r);e.revealRange(t.source,!1,l,a,0)}}),e.SelectAll=new class extends Jxe{constructor(){super(cwe)}runDOMCommand(){jde&&(document.activeElement.focus(),document.activeElement.select()),document.execCommand("selectAll")}runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i)}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates("keyboard",3,[Txe.selectAll(e,e.getPrimaryCursorState())])}},e.SetSelection=nwe(new class extends Xxe{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(e,t){t.selection&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[_xe.fromModelSelection(t.selection)]))}})}(Qxe||(Qxe={}));const eDe=Lce.and(Gxe.textInputFocus,Gxe.columnSelection);function tDe(e,t){zbe.registerKeybindingRule({id:e,primary:t,when:eDe,weight:1})}function iDe(e){return e.register(),e}var nDe,oDe;tDe(Qxe.CursorColumnSelectLeft.id,1039),tDe(Qxe.CursorColumnSelectRight.id,1041),tDe(Qxe.CursorColumnSelectUp.id,1040),tDe(Qxe.CursorColumnSelectPageUp.id,1035),tDe(Qxe.CursorColumnSelectDown.id,1042),tDe(Qxe.CursorColumnSelectPageDown.id,1036),function(e){class t extends twe{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditingCommand(t,n,i||{})}}e.CoreEditingCommand=t,e.LineBreakInsert=nwe(new class extends t{constructor(){super({id:"lineBreakInsert",precondition:Gxe.writable,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,zxe.lineBreakInsert(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection))))}}),e.Outdent=nwe(new class extends t{constructor(){super({id:"outdent",precondition:Gxe.writable,kbOpts:{weight:0,kbExpr:Lce.and(Gxe.editorTextFocus,Gxe.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,zxe.outdent(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)))),e.pushUndoStop()}}),e.Tab=nwe(new class extends t{constructor(){super({id:"tab",precondition:Gxe.writable,kbOpts:{weight:0,kbExpr:Lce.and(Gxe.editorTextFocus,Gxe.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,zxe.tab(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)))),e.pushUndoStop()}}),e.DeleteLeft=nwe(new class extends t{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(e,t,i){const[n,o]=Ixe.deleteLeft(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)),t.getCursorAutoClosedCharacters());n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(2)}}),e.DeleteRight=nwe(new class extends t{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:0,kbExpr:Gxe.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(e,t,i){const[n,o]=Ixe.deleteRight(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)));n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(3)}}),e.Undo=new class extends Jxe{constructor(){super(hwe)}runDOMCommand(){document.execCommand("undo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(86))return t.getModel().undo()}},e.Redo=new class extends Jxe{constructor(){super(dwe)}runDOMCommand(){document.execCommand("redo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(86))return t.getModel().redo()}}}(nDe||(nDe={}));class sDe extends Xbe{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(mce).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function rDe(e,t){iDe(new sDe("default:"+e,e)),iDe(new sDe(e,e,t))}rDe("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]}),rDe("replacePreviousChar"),rDe("compositionType"),rDe("compositionStart"),rDe("compositionEnd"),rDe("paste"),rDe("cut");class aDe{constructor(e,t,i,n){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=n}paste(e,t,i,n){this.commandDelegate.paste(e,t,i,n)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,n){this.commandDelegate.compositionType(e,t,i,n)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Qxe.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new Rle(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(74)){case"altKey":return e.altKey;case"ctrlKey":return e.ctrlKey;case"metaKey":return e.metaKey;default:return!1}}_hasNonMulticursorModifier(e){switch(this.configuration.options.get(74)){case"altKey":return e.ctrlKey||e.metaKey;case"ctrlKey":return e.altKey||e.metaKey;case"metaKey":return e.ctrlKey||e.altKey;default:return!1}}dispatchMouse(e){const t=this.configuration.options,i=ise&&t.get(101),n=t.get(19);e.middleButton&&!i?this._columnSelect(e.position,e.mouseColumn,e.inSelectionMode):e.startedOnLineNumbers?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelect(e.position,e.revealType):this._createCursor(e.position,!0):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount>=4?this._selectAll():3===e.mouseDownCount?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):2===e.mouseDownCount?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey||n?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){Qxe.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Qxe.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),Qxe.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),Qxe.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Qxe.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Qxe.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Qxe.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Qxe.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Qxe.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Qxe.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Qxe.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Qxe.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Qxe.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}class lDe{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){var t;null===(t=this.onKeyDown)||void 0===t||t.call(this,e)}emitKeyUp(e){var t;null===(t=this.onKeyUp)||void 0===t||t.call(this,e)}emitContextMenu(e){var t;null===(t=this.onContextMenu)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;null===(t=this.onMouseMove)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;null===(t=this.onMouseLeave)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;null===(t=this.onMouseDown)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;null===(t=this.onMouseUp)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;null===(t=this.onMouseDrag)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;null===(t=this.onMouseDrop)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;null===(e=this.onMouseDropCanceled)||void 0===e||e.call(this)}emitMouseWheel(e){var t;null===(t=this.onMouseWheel)||void 0===t||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return lDe.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i=Object.assign({},e);return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),i}}class hDe{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new Error("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(0===this.getCount())return null;const i=this.getStartLineNumber(),n=this.getEndLineNumber();if(t<i){const i=t-e+1;return this._rendLineNumberStart-=i,null}if(e>n)return null;let o=0,s=0;for(let r=i;r<=n;r++){const i=r-this._rendLineNumberStart;e<=r&&r<=t&&(0===s?(o=i,s=1):s++)}if(e<i){let n=0;n=t<i?t-e+1:i-e,this._rendLineNumberStart-=n}return this._lines.splice(o,s)}onLinesChanged(e,t){const i=e+t-1;if(0===this.getCount())return!1;const n=this.getStartLineNumber(),o=this.getEndLineNumber();let s=!1;for(let t=e;t<=i;t++)t>=n&&t<=o&&(this._lines[t-this._rendLineNumberStart].onContentChanged(),s=!0);return s}onLinesInserted(e,t){if(0===this.getCount())return null;const i=t-e+1,n=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const s=[];for(let e=0;e<i;e++)s[e]=this._createLine();const r=e-this._rendLineNumberStart,a=this._lines.slice(0,r),l=this._lines.slice(r,this._lines.length-i),h=this._lines.slice(this._lines.length-i,this._lines.length);return this._lines=a.concat(s).concat(l),h}onTokensChanged(e){if(0===this.getCount())return!1;const t=this.getStartLineNumber(),i=this.getEndLineNumber();let n=!1;for(let o=0,s=e.length;o<s;o++){const s=e[o];if(s.toLineNumber<t||s.fromLineNumber>i)continue;const r=Math.max(t,s.fromLineNumber),a=Math.min(i,s.toLineNumber);for(let e=r;e<=a;e++){const t=e-this._rendLineNumberStart;this._lines[t].onTokensChanged(),n=!0}}return n}}class dDe{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new hDe((()=>this._host.createVisibleLine()))}_createDomNode(){const e=ice(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(138)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,i=t.length;e<i;e++){const i=t[e].getDomNode();i&&this.domNode.domNode.removeChild(i)}return!0}onLinesInserted(e){const t=this._linesCollection.onLinesInserted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,i=t.length;e<i;e++){const i=t[e].getDomNode();i&&this.domNode.domNode.removeChild(i)}return!0}onScrollChanged(e){return e.scrollTopChanged}onTokensChanged(e){return this._linesCollection.onTokensChanged(e.ranges)}onZonesChanged(e){return!0}getStartLineNumber(){return this._linesCollection.getStartLineNumber()}getEndLineNumber(){return this._linesCollection.getEndLineNumber()}getVisibleLine(e){return this._linesCollection.getLine(e)}renderLines(e){const t=this._linesCollection._get(),i=new cDe(this.domNode.domNode,this._host,e),n={rendLineNumberStart:t.rendLineNumberStart,lines:t.lines,linesLength:t.lines.length},o=i.render(n,e.startLineNumber,e.endLineNumber,e.relativeVerticalOffset);this._linesCollection._set(o.rendLineNumberStart,o.lines)}}class cDe{constructor(e,t,i){this.domNode=e,this.host=t,this.viewportData=i}render(e,t,i,n){const o={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(o.rendLineNumberStart+o.linesLength-1<t||i<o.rendLineNumberStart){o.rendLineNumberStart=t,o.linesLength=i-t+1,o.lines=[];for(let e=t;e<=i;e++)o.lines[e-t]=this.host.createVisibleLine();return this._finishRendering(o,!0,n),o}if(this._renderUntouchedLines(o,Math.max(t-o.rendLineNumberStart,0),Math.min(i-o.rendLineNumberStart,o.linesLength-1),n,t),o.rendLineNumberStart>t){const e=t,s=Math.min(i,o.rendLineNumberStart-1);e<=s&&(this._insertLinesBefore(o,e,s,n,t),o.linesLength+=s-e+1)}else if(o.rendLineNumberStart<t){const e=Math.min(o.linesLength,t-o.rendLineNumberStart);e>0&&(this._removeLinesBefore(o,e),o.linesLength-=e)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1<i){const e=o.rendLineNumberStart+o.linesLength,s=i;e<=s&&(this._insertLinesAfter(o,e,s,n,t),o.linesLength+=s-e+1)}else if(o.rendLineNumberStart+o.linesLength-1>i){const e=Math.max(0,i-o.rendLineNumberStart+1),t=o.linesLength-1-e+1;t>0&&(this._removeLinesAfter(o,t),o.linesLength-=t)}return this._finishRendering(o,!1,n),o}_renderUntouchedLines(e,t,i,n,o){const s=e.rendLineNumberStart,r=e.lines;for(let e=t;e<=i;e++){const t=s+e;r[e].layoutLine(t,n[t-o])}}_insertLinesBefore(e,t,i,n,o){const s=[];let r=0;for(let e=t;e<=i;e++)s[r++]=this.host.createVisibleLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i<t;i++){const t=e.lines[i].getDomNode();t&&this.domNode.removeChild(t)}e.lines.splice(0,t)}_insertLinesAfter(e,t,i,n,o){const s=[];let r=0;for(let e=t;e<=i;e++)s[r++]=this.host.createVisibleLine();e.lines=e.lines.concat(s)}_removeLinesAfter(e,t){const i=e.linesLength-t;for(let n=0;n<t;n++){const t=e.lines[i+n].getDomNode();t&&this.domNode.removeChild(t)}e.lines.splice(i,t)}_finishRenderingNewLines(e,t,i,n){cDe._ttPolicy&&(i=cDe._ttPolicy.createHTML(i));const o=this.domNode.lastChild;t||!o?this.domNode.innerHTML=i:o.insertAdjacentHTML("afterend",i);let s=this.domNode.lastChild;for(let t=e.linesLength-1;t>=0;t--){const i=e.lines[t];n[t]&&(i.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");cDe._ttPolicy&&(t=cDe._ttPolicy.createHTML(t)),n.innerHTML=t;for(let t=0;t<e.linesLength;t++){const o=e.lines[t];if(i[t]){const e=n.firstChild,t=o.getDomNode();t.parentNode.replaceChild(e,t),o.setDomNode(e)}}}_finishRendering(e,t,i){const n=cDe._sb,o=e.linesLength,s=e.lines,r=e.rendLineNumberStart,a=[];{n.reset();let l=!1;for(let e=0;e<o;e++){const t=s[e];a[e]=!1,t.getDomNode()||t.renderLine(e+r,i[e],this.viewportData,n)&&(a[e]=!0,l=!0)}l&&this._finishRenderingNewLines(e,t,n.build(),a)}{n.reset();let t=!1;const l=[];for(let e=0;e<o;e++){const o=s[e];(l[e]=!1,a[e])||o.renderLine(e+r,i[e],this.viewportData,n)&&(l[e]=!0,t=!0)}t&&this._finishRenderingInvalidLines(e,n.build(),l)}}}cDe._ttPolicy=null===(oDe=window.trustedTypes)||void 0===oDe?void 0:oDe.createPolicy("editorViewLayer",{createHTML:e=>e}),cDe._sb=new Oue(1e5);class uDe extends VSe{constructor(e){super(e),this._visibleLines=new dDe(this),this.domNode=this._visibleLines.domNode;const t=this._context.configuration.options.get(47);nce(this.domNode,t),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;e<t;e++)if(this._dynamicOverlays[e].shouldRender())return!0;return!1}dispose(){super.dispose();for(let e=0,t=this._dynamicOverlays.length;e<t;e++)this._dynamicOverlays[e].dispose();this._dynamicOverlays=[]}getDomNode(){return this.domNode}createVisibleLine(){return new gDe(this._context.configuration,this._dynamicOverlays)}addDynamicOverlay(e){this._dynamicOverlays.push(e)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e);const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++)this._visibleLines.getVisibleLine(n).onConfigurationChanged(e);const n=this._context.configuration.options.get(47);return nce(this.domNode,n),!0}onFlushed(e){return this._visibleLines.onFlushed(e)}onFocusChanged(e){return this._isFocused=e.isFocused,!0}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onScrollChanged(e){return this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._visibleLines.onZonesChanged(e)}prepareRender(e){const t=this._dynamicOverlays.filter((e=>e.shouldRender()));for(let i=0,n=t.length;i<n;i++){const n=t[i];n.prepareRender(e),n.onDidRender()}}render(e){this._viewOverlaysRender(e),this.domNode.toggleClassName("focused",this._isFocused)}_viewOverlaysRender(e){this._visibleLines.renderLines(e.viewportData)}}class gDe{constructor(e,t){this._configuration=e,this._lineHeight=this._configuration.options.get(63),this._dynamicOverlays=t,this._domNode=null,this._renderedContent=null}getDomNode(){return this._domNode?this._domNode.domNode:null}setDomNode(e){this._domNode=ice(e)}onContentChanged(){}onTokensChanged(){}onConfigurationChanged(e){this._lineHeight=this._configuration.options.get(63)}renderLine(e,t,i,n){let o="";for(let t=0,n=this._dynamicOverlays.length;t<n;t++)o+=this._dynamicOverlays[t].render(i.startLineNumber,e);return this._renderedContent!==o&&(this._renderedContent=o,n.appendString('<div style="position:absolute;top:'),n.appendString(String(t)),n.appendString("px;width:100%;height:"),n.appendString(String(this._lineHeight)),n.appendString('px;">'),n.appendString(o),n.appendString("</div>"),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class pDe extends uDe{constructor(e){super(e);const t=this._context.configuration.options.get(138);this._contentWidth=t.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const t=this._context.configuration.options.get(138);return this._contentWidth=t.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class mDe extends uDe{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(138);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),nce(this.domNode,t.get(47))}onConfigurationChanged(e){const t=this._context.configuration.options;nce(this.domNode,t.get(47));const i=t.get(138);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class fDe extends VSe{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=ice(document.createElement("div")),zSe.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=ice(document.createElement("div")),zSe.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesDeleted(e){return this._updateAnchorsViewPositions(),!0}onLinesInserted(e){return this._updateAnchorsViewPositions(),!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}_updateAnchorsViewPositions(){const e=Object.keys(this._widgets);for(const t of e)this._widgets[t].updateAnchorViewPosition()}addWidget(e){const t=new _De(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i,n,o){this._widgets[e.getId()].setPosition(t,i,n,o),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t];delete this._widgets[t];const i=e.domNode.domNode;i.parentNode.removeChild(i),i.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return!!this._widgets.hasOwnProperty(e)&&this._widgets[e].suppressMouseDown}onBeforeRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].render(e)}}class _De{constructor(e,t,i){this._primaryAnchor=new vDe(null,null),this._secondaryAnchor=new vDe(null,null),this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=ice(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const n=this._context.configuration.options,o=n.get(138);this._fixedOverflowWidgets=n.get(39),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._lineHeight=n.get(63),this._affinity=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setDisplay("none"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const t=this._context.configuration.options;if(this._lineHeight=t.get(63),e.hasChanged(138)){const e=t.get(138);this._contentLeft=e.contentLeft,this._contentWidth=e.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,i){function n(e,t,i){if(!e)return new vDe(null,null);const n=t.model.validatePosition(e);if(t.coordinatesConverter.modelPositionIsVisible(n)){const o=t.coordinatesConverter.convertModelPositionToViewPosition(n,null!=i?i:void 0);return new vDe(e,o)}return new vDe(e,null)}this._affinity=e,this._primaryAnchor=n(t,this._context.viewModel,this._affinity),this._secondaryAnchor=n(i,this._context.viewModel,this._affinity)}_getMaxWidth(){return this.allowEditorOverflow?window.innerWidth||document.documentElement.offsetWidth||document.body.offsetWidth:this._contentWidth}setPosition(e,t,i,n){this._setPosition(n,e,t),this._preference=i,this._primaryAnchor.viewPosition&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,n){const o=e.top,s=o,r=e.top+e.height,a=o-i,l=s>=i,h=r,d=n.viewportHeight-r>=i;let c=e.left;return c+t>n.scrollLeft+n.viewportWidth&&(c=n.scrollLeft+n.viewportWidth-t),c<n.scrollLeft&&(c=n.scrollLeft),{fitsAbove:l,aboveTop:a,fitsBelow:d,belowTop:h,left:c}}_layoutHorizontalSegmentInPage(e,t,i,n){const o=Math.max(15,t.left-n),s=Math.min(t.left+t.width+n,e.width-15);let r=t.left+i-window.scrollX;if(r+n>s){const e=r-(s-n);r-=e,i-=e}if(r<o){const e=r-o;r-=e,i-=e}return[i,r]}_layoutBoxInPage(e,t,i,n){const o=e.top-i,s=e.top+e.height,r=Rve(this._viewDomNode.domNode),a=r.top+o-window.scrollY,l=r.top+s-window.scrollY,h=Mve(document.body),[d,c]=this._layoutHorizontalSegmentInPage(h,r,e.left-n.scrollLeft+this._contentLeft,t),u=a>=22,g=l+i<=h.height-22;return this._fixedOverflowWidgets?{fitsAbove:u,aboveTop:Math.max(a,22),fitsBelow:g,belowTop:l,left:c}:{fitsAbove:u,aboveTop:o,fitsBelow:g,belowTop:s,left:d}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new bDe(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,i;return{primary:n(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),secondary:n((null===(t=this._secondaryAnchor.viewPosition)||void 0===t?void 0:t.lineNumber)===(null===(i=this._primaryAnchor.viewPosition)||void 0===i?void 0:i.lineNumber)?this._secondaryAnchor.viewPosition:null,this._affinity,this._lineHeight)};function n(t,i,n){if(!t)return null;const o=e.visibleRangeForPosition(t);if(!o)return null;const s=1===t.column&&3===i?0:o.left,r=e.getVerticalOffsetForLineNumber(t.lineNumber)-e.scrollTop;return new wDe(r,s,n)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const n=this._context.configuration.options.get(47);let o=t.left;return o=o<e.left?Math.max(o,e.left-i+n.typicalFullwidthCharacterWidth):Math.min(o,e.left+i-n.typicalFullwidthCharacterWidth),new wDe(e.top,o,e.height)}_prepareRenderWidget(e){if(!this._preference||0===this._preference.length)return null;const{primary:t,secondary:i}=this._getAnchorsCoordinates(e);if(!t)return null;if(-1===this._cachedDomNodeOffsetWidth||-1===this._cachedDomNodeOffsetHeight){let e=null;if("function"==typeof this._actual.beforeRender&&(e=CDe(this._actual.beforeRender,this._actual)),e)this._cachedDomNodeOffsetWidth=e.width,this._cachedDomNodeOffsetHeight=e.height;else{const e=this.domNode.domNode.getBoundingClientRect();this._cachedDomNodeOffsetWidth=Math.round(e.width),this._cachedDomNodeOffsetHeight=Math.round(e.height)}}const n=this._reduceAnchorCoordinates(t,i,this._cachedDomNodeOffsetWidth);let o;o=this.allowEditorOverflow?this._layoutBoxInPage(n,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e):this._layoutBoxInViewport(n,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e);for(let e=1;e<=2;e++)for(const t of this._preference)if(1===t){if(!o)return null;if(2===e||o.fitsAbove)return{coordinate:new bDe(o.aboveTop,o.left),position:1}}else{if(2!==t)return this.allowEditorOverflow?{coordinate:this._prepareRenderWidgetAtExactPositionOverflowing(new bDe(n.top,n.left)),position:0}:{coordinate:new bDe(n.top,n.left),position:0};if(!o)return null;if(2===e||o.fitsBelow)return{coordinate:new bDe(o.belowTop,o.left),position:2}}return null}onBeforeRender(e){this._primaryAnchor.viewPosition&&this._preference&&(this._primaryAnchor.viewPosition.lineNumber<e.startLineNumber||this._primaryAnchor.viewPosition.lineNumber>e.endLineNumber||this.domNode.setMaxWidth(this._maxWidth))}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData)return this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),void("function"==typeof this._actual.afterRender&&CDe(this._actual.afterRender,this._actual,null));this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),"function"==typeof this._actual.afterRender&&CDe(this._actual.afterRender,this._actual,this._renderData.position)}}class vDe{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class bDe{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class wDe{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function CDe(e,t,...i){try{return e.call(t,...i)}catch(e){return null}}var yDe=i(3334),SDe={};SDe.styleTagTransform=Vr(),SDe.setAttributes=Pr(),SDe.insert=Rr().bind(null,"head"),SDe.domAPI=Tr(),SDe.insertStyleElement=Br(),Ir()(yDe.Z,SDe),yDe.Z&&yDe.Z.locals&&yDe.Z.locals;class kDe extends cLe{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(138);this._lineHeight=t.get(63),this._renderLineHighlight=t.get(90),this._renderLineHighlightOnlyWhenFocus=t.get(91),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new Ple(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=this._selections.map((e=>e.positionLineNumber));t.sort(((e,t)=>e-t)),Nse(this._cursorLineNumbers,t)||(this._cursorLineNumbers=t,e=!0);const i=this._selections.every((e=>e.isEmpty()));return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(138);return this._lineHeight=t.get(63),this._renderLineHighlight=t.get(90),this._renderLineHighlightOnlyWhenFocus=t.get(91),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return!!this._renderLineHighlightOnlyWhenFocus&&(this._focused=e.isFocused,!0)}prepareRender(e){if(!this._shouldRenderThis())return void(this._renderData=null);const t=this._renderOne(e),i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o=this._cursorLineNumbers.length;let s=0;const r=[];for(let e=i;e<=n;e++){const n=e-i;for(;s<o&&this._cursorLineNumbers[s]<e;)s++;s<o&&this._cursorLineNumbers[s]===e?r[n]=t:r[n]=""}this._renderData=r}render(e,t){if(!this._renderData)return"";const i=t-e;return i>=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return("gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class LDe extends kDe{_renderOne(e){return`<div class="${"current-line"+(this._shouldRenderOther()?" current-line-both":"")}" style="width:${Math.max(e.scrollWidth,this._contentWidth)}px; height:${this._lineHeight}px;"></div>`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class xDe extends kDe{_renderOne(e){return`<div class="${"current-line"+(this._shouldRenderInMargin()?" current-line-margin":"")+(this._shouldRenderOther()?" current-line-margin-both":"")}" style="width:${this._contentLeft}px; height:${this._lineHeight}px;"></div>`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}_Le(((e,t)=>{const i=e.getColor(bLe);if(i&&(t.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${i}; border: none; }`)),!i||i.isTransparent()||e.defines(wLe)){const i=e.getColor(wLe);i&&(t.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${i}; }`),QSe(e.type)&&(t.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}}));var DDe=i(4926),EDe={};EDe.styleTagTransform=Vr(),EDe.setAttributes=Pr(),EDe.insert=Rr().bind(null,"head"),EDe.domAPI=Tr(),EDe.insertStyleElement=Br(),Ir()(DDe.Z,EDe),DDe.Z&&DDe.Z.locals&&DDe.Z.locals;class NDe extends cLe{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(63),this._typicalHalfwidthCharacterWidth=t.get(47).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(63),this._typicalHalfwidthCharacterWidth=t.get(47).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],n=0;for(let e=0,o=t.length;e<o;e++){const o=t[e];o.options.className&&(i[n++]=o)}i=i.sort(((e,t)=>{if(e.options.zIndex<t.options.zIndex)return-1;if(e.options.zIndex>t.options.zIndex)return 1;const i=e.options.className,n=t.options.className;return i<n?-1:i>n?1:Ole.compareRangesUsingStarts(e.range,t.range)}));const o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,r=[];for(let e=o;e<=s;e++)r[e-o]="";this._renderWholeLineDecorations(e,i,r),this._renderNormalDecorations(e,i,r),this._renderResult=r}_renderWholeLineDecorations(e,t,i){const n=String(this._lineHeight),o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let e=0,r=t.length;e<r;e++){const r=t[e];if(!r.options.isWholeLine)continue;const a='<div class="cdr '+r.options.className+'" style="left:0;width:100%;height:'+n+'px;"></div>',l=Math.max(r.range.startLineNumber,o),h=Math.min(r.range.endLineNumber,s);for(let e=l;e<=h;e++)i[e-o]+=a}}_renderNormalDecorations(e,t,i){const n=String(this._lineHeight),o=e.visibleRange.startLineNumber;let s=null,r=!1,a=null;for(let l=0,h=t.length;l<h;l++){const h=t[l];if(h.options.isWholeLine)continue;const d=h.options.className,c=Boolean(h.options.showIfCollapsed);let u=h.range;c&&1===u.endColumn&&u.endLineNumber!==u.startLineNumber&&(u=new Ole(u.startLineNumber,u.startColumn,u.endLineNumber-1,this._context.viewModel.getLineMaxColumn(u.endLineNumber-1))),s===d&&r===c&&Ole.areIntersectingOrTouching(a,u)?a=Ole.plusRange(a,u):(null!==s&&this._renderNormalDecoration(e,a,s,r,n,o,i),s=d,r=c,a=u)}null!==s&&this._renderNormalDecoration(e,a,s,r,n,o,i)}_renderNormalDecoration(e,t,i,n,o,s,r){const a=e.linesVisibleRangesForRange(t,"findMatch"===i);if(a)for(let e=0,t=a.length;e<t;e++){const t=a[e];if(t.outsideRenderedLine)continue;const l=t.lineNumber-s;if(n&&1===t.ranges.length){const e=t.ranges[0];if(e.width<this._typicalHalfwidthCharacterWidth){const i=Math.round(e.left+e.width/2),n=Math.max(0,Math.round(i-this._typicalHalfwidthCharacterWidth/2));t.ranges[0]=new jSe(n,this._typicalHalfwidthCharacterWidth)}}for(let e=0,n=t.ranges.length;e<n;e++){const n=t.ranges[e],s='<div class="cdr '+i+'" style="left:'+String(n.left)+"px;width:"+String(n.width)+"px;height:"+o+'px;"></div>';r[l]+=s}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class IDe extends VSe{constructor(e,t,i,n){super(e);const o=this._context.configuration.options,s=o.get(97),r=o.get(71),a=o.get(37),l=o.get(100),h={listenOnDomNode:i.domNode,className:"editor-scrollable "+pLe(e.theme.type),useShadows:!1,lazyRender:!0,vertical:s.vertical,horizontal:s.horizontal,verticalHasArrows:s.verticalHasArrows,horizontalHasArrows:s.horizontalHasArrows,verticalScrollbarSize:s.verticalScrollbarSize,verticalSliderSize:s.verticalSliderSize,horizontalScrollbarSize:s.horizontalScrollbarSize,horizontalSliderSize:s.horizontalSliderSize,handleMouseWheel:s.handleMouseWheel,alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel,arrowSize:s.arrowSize,mouseWheelScrollSensitivity:r,fastScrollSensitivity:a,scrollPredominantAxis:l,scrollByPage:s.scrollByPage};this.scrollbar=this._register(new Uke(t.domNode,h,this._context.viewLayout.getScrollable())),zSe.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=ice(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const d=(e,t,i)=>{const n={};if(t){const t=e.scrollTop;t&&(n.scrollTop=this._context.viewLayout.getCurrentScrollTop()+t,e.scrollTop=0)}if(i){const t=e.scrollLeft;t&&(n.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+t,e.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(n,1)};this._register(Lve(i.domNode,"scroll",(e=>d(i.domNode,!0,!0)))),this._register(Lve(t.domNode,"scroll",(e=>d(t.domNode,!0,!1)))),this._register(Lve(n.domNode,"scroll",(e=>d(n.domNode,!0,!1)))),this._register(Lve(this.scrollbarDomNode.domNode,"scroll",(e=>d(this.scrollbarDomNode.domNode,!0,!1))))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(138);this.scrollbarDomNode.setLeft(t.contentLeft),"right"===e.get(69).side?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(97)||e.hasChanged(71)||e.hasChanged(37)){const e=this._context.configuration.options,t=e.get(97),i=e.get(71),n=e.get(37),o=e.get(100),s={vertical:t.vertical,horizontal:t.horizontal,verticalScrollbarSize:t.verticalScrollbarSize,horizontalScrollbarSize:t.horizontalScrollbarSize,scrollByPage:t.scrollByPage,handleMouseWheel:t.handleMouseWheel,mouseWheelScrollSensitivity:i,fastScrollSensitivity:n,scrollPredominantAxis:o};this.scrollbar.updateOptions(s)}return e.hasChanged(138)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+pLe(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}var MDe=i(9430),TDe={};TDe.styleTagTransform=Vr(),TDe.setAttributes=Pr(),TDe.insert=Rr().bind(null,"head"),TDe.domAPI=Tr(),TDe.insertStyleElement=Br(),Ir()(MDe.Z,TDe),MDe.Z&&MDe.Z.locals&&MDe.Z.locals;class ADe{constructor(e,t,i){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i)}}class RDe extends cLe{_render(e,t,i){const n=[];for(let i=e;i<=t;i++)n[i-e]=[];if(0===i.length)return n;i.sort(((e,t)=>e.className===t.className?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.className<t.className?-1:1));let o=null,s=0;for(let r=0,a=i.length;r<a;r++){const a=i[r],l=a.className;let h=Math.max(a.startLineNumber,e)-e;const d=Math.min(a.endLineNumber,t)-e;o===l?(h=Math.max(s+1,h),s=Math.max(s,d)):(o=l,s=d);for(let e=h;e<=s;e++)n[e].push(o)}return n}}class ODe extends RDe{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(138);this._lineHeight=t.get(63),this._glyphMargin=t.get(54),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(138);return this._lineHeight=t.get(63),this._glyphMargin=t.get(54),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let e=0,o=t.length;e<o;e++){const o=t[e],s=o.options.glyphMarginClassName;s&&(i[n++]=new ADe(o.range.startLineNumber,o.range.endLineNumber,s))}return i}prepareRender(e){if(!this._glyphMargin)return void(this._renderResult=null);const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o=this._lineHeight.toString(),s='" style="left:'+this._glyphMarginLeft.toString()+"px;width:"+this._glyphMarginWidth.toString()+"px;height:"+o+'px;"></div>',r=[];for(let e=t;e<=i;e++){const i=e-t,o=n[i];0===o.length?r[i]="":r[i]='<div class="cgmr codicon '+o.join(" ")+s}this._renderResult=r}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}var PDe,FDe=i(256),BDe={};BDe.styleTagTransform=Vr(),BDe.setAttributes=Pr(),BDe.insert=Rr().bind(null,"head"),BDe.domAPI=Tr(),BDe.insertStyleElement=Br(),Ir()(FDe.Z,BDe),FDe.Z&&FDe.Z.locals&&FDe.Z.locals;class WDe extends aae{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}!function(e){e[e.Disabled=0]="Disabled",e[e.EnabledForActive=1]="EnabledForActive",e[e.Enabled=2]="Enabled"}(PDe||(PDe={}));class VDe{constructor(e,t,i,n,o,s){if(this.visibleColumn=e,this.column=t,this.className=i,this.horizontalLine=n,this.forWrappedLinesAfterColumn=o,this.forWrappedLinesBeforeOrAtColumn=s,-1!==e==(-1!==t))throw new Error}}class zDe{constructor(e,t){this.top=e,this.endColumn=t}}class HDe extends WDe{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return function(e,t){let i=0,n=0;const o=e.length;for(;n<o;){const o=e.charCodeAt(n);if(32===o)i++;else{if(9!==o)break;i=i-i%t+t}n++}return n===o?-1:i}(this.textModel.getLineContent(e+1),this.textModel.getOptions().tabSize)}getActiveIndentGuide(e,t,i){this.assertNotDisposed();const n=this.textModel.getLineCount();if(e<1||e>n)throw new Error("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=Boolean(o&&o.offSide);let r=-2,a=-1,l=-2,h=-1;const d=e=>{if(-1!==r&&(-2===r||r>e-1)){r=-1,a=-1;for(let t=e-2;t>=0;t--){const e=this._computeIndentLevel(t);if(e>=0){r=t,a=e;break}}}if(-2===l){l=-1,h=-1;for(let t=e;t<n;t++){const e=this._computeIndentLevel(t);if(e>=0){l=t,h=e;break}}}};let c=-2,u=-1,g=-2,p=-1;const m=e=>{if(-2===c){c=-1,u=-1;for(let t=e-2;t>=0;t--){const e=this._computeIndentLevel(t);if(e>=0){c=t,u=e;break}}}if(-1!==g&&(-2===g||g<e-1)){g=-1,p=-1;for(let t=e;t<n;t++){const e=this._computeIndentLevel(t);if(e>=0){g=t,p=e;break}}}};let f=0,_=!0,v=0,b=!0,w=0,C=0;for(let o=0;_||b;o++){const r=e-o,g=e+o;o>1&&(r<1||r<t)&&(_=!1),o>1&&(g>n||g>i)&&(b=!1),o>5e4&&(_=!1,b=!1);let y=-1;if(_&&r>=1){const e=this._computeIndentLevel(r-1);e>=0?(l=r-1,h=e,y=Math.ceil(e/this.textModel.getOptions().indentSize)):(d(r),y=this._getIndentLevelForWhitespaceLine(s,a,h))}let S=-1;if(b&&g<=n){const e=this._computeIndentLevel(g-1);e>=0?(c=g-1,u=e,S=Math.ceil(e/this.textModel.getOptions().indentSize)):(m(g),S=this._getIndentLevelForWhitespaceLine(s,u,p))}if(0!==o){if(1===o){if(g<=n&&S>=0&&C+1===S){_=!1,f=g,v=g,w=S;continue}if(r>=1&&y>=0&&y-1===C){b=!1,f=r,v=r,w=y;continue}if(f=e,v=e,w=C,0===w)return{startLineNumber:f,endLineNumber:v,indent:w}}_&&(y>=w?f=r:_=!1),b&&(S>=w?v=g:b=!1)}else C=y}return{startLineNumber:f,endLineNumber:v,indent:w}}getLinesBracketGuides(e,t,i,n){var o;const s=[];for(let i=e;i<=t;i++)s.push([]);const r=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new Ole(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let a;i&&r.length>0&&(a=null===(o=function(e,t){const i=function(e,t){for(let i=e.length-1;i>=0;i--)if(t(e[i]))return i;return-1}(e,(e=>!0));if(-1!==i)return e[i]}((e<=i.lineNumber&&i.lineNumber<=t?r:this.textModel.bracketPairs.getBracketPairsInRange(Ole.fromPositions(i)).toArray()).filter((e=>Ole.strictContainsPosition(e.range,i)))))||void 0===o?void 0:o.range);const l=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,h=new UDe;for(const i of r){if(!i.closingBracketRange)continue;const o=a&&i.range.equalsRange(a);if(!o&&!n.includeInactive)continue;const r=h.getInlineClassName(i.nestingLevel,i.nestingLevelOfEqualBracketType,l)+(n.highlightActive&&o?" "+h.activeClassName:""),d=i.openingBracketRange.getStartPosition(),c=i.closingBracketRange.getStartPosition(),u=n.horizontalGuides===PDe.Enabled||n.horizontalGuides===PDe.EnabledForActive&&o;if(i.range.startLineNumber===i.range.endLineNumber){u&&s[i.range.startLineNumber-e].push(new VDe(-1,i.openingBracketRange.getEndPosition().column,r,new zDe(!1,c.column),-1,-1));continue}const g=this.getVisibleColumnFromPosition(c),p=this.getVisibleColumnFromPosition(i.openingBracketRange.getStartPosition()),m=Math.min(p,g,i.minVisibleColumnIndentation+1);let f=!1;ede(this.textModel.getLineContent(i.closingBracketRange.startLineNumber))<i.closingBracketRange.startColumn-1&&(f=!0);const _=Math.max(d.lineNumber,e),v=Math.min(c.lineNumber,t),b=f?1:0;for(let t=_;t<v+b;t++)s[t-e].push(new VDe(m,-1,r,null,t===d.lineNumber?d.column:-1,t===c.lineNumber?c.column:-1));u&&(d.lineNumber>=e&&p>m&&s[d.lineNumber-e].push(new VDe(m,-1,r,new zDe(!1,d.column),-1,-1)),c.lineNumber<=t&&g>m&&s[c.lineNumber-e].push(new VDe(m,-1,r,new zDe(!f,c.column),-1,-1)))}for(const e of s)e.sort(((e,t)=>e.visibleColumn-t.visibleColumn));return s}getVisibleColumnFromPosition(e){return lke.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const n=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=Boolean(o&&o.offSide),r=new Array(t-e+1);let a=-2,l=-1,h=-2,d=-1;for(let o=e;o<=t;o++){const t=o-e,c=this._computeIndentLevel(o-1);if(c>=0)a=o-1,l=c,r[t]=Math.ceil(c/n.indentSize);else{if(-2===a){a=-1,l=-1;for(let e=o-2;e>=0;e--){const t=this._computeIndentLevel(e);if(t>=0){a=e,l=t;break}}}if(-1!==h&&(-2===h||h<o-1)){h=-1,d=-1;for(let e=o;e<i;e++){const t=this._computeIndentLevel(e);if(t>=0){h=e,d=t;break}}}r[t]=this._getIndentLevelForWhitespaceLine(s,l,d)}}return r}_getIndentLevelForWhitespaceLine(e,t,i){const n=this.textModel.getOptions();return-1===t||-1===i?0:t<i?1+Math.floor(t/n.indentSize):t===i||e?Math.ceil(i/n.indentSize):1+Math.floor(i/n.indentSize)}}class UDe{constructor(){this.activeClassName="indent-active"}getInlineClassName(e,t,i){return this.getInlineClassNameOfLevel(i?t:e)}getInlineClassNameOfLevel(e){return"bracket-indent-guide lvl-"+e%30}}class KDe extends cLe{constructor(e){super(),this._context=e,this._primaryPosition=null;const t=this._context.configuration.options,i=t.get(139),n=t.get(47);this._lineHeight=t.get(63),this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(13),this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(139),n=t.get(47);return this._lineHeight=t.get(63),this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(13),!0}onCursorStateChanged(e){var t;const i=e.selections[0].getPosition();return!(null===(t=this._primaryPosition)||void 0===t?void 0:t.equals(i))&&(this._primaryPosition=i,!0)}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onLanguageConfigurationChanged(e){return!0}prepareRender(e){var t,i,n,o;if(!this._bracketPairGuideOptions.indentation&&!1===this._bracketPairGuideOptions.bracketPairs)return void(this._renderResult=null);const s=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=e.scrollWidth,l=this._lineHeight,h=this._primaryPosition,d=this.getGuidesByLine(s,Math.min(r+1,this._context.viewModel.getLineCount()),h),c=[];for(let h=s;h<=r;h++){const r=h-s,u=d[r];let g="";const p=null!==(i=null===(t=e.visibleRangeForPosition(new Rle(h,1)))||void 0===t?void 0:t.left)&&void 0!==i?i:0;for(const t of u){const i=-1===t.column?p+(t.visibleColumn-1)*this._spaceWidth:e.visibleRangeForPosition(new Rle(h,t.column)).left;if(i>a||this._maxIndentLeft>0&&i>this._maxIndentLeft)break;const s=t.horizontalLine?t.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",r=t.horizontalLine?(null!==(o=null===(n=e.visibleRangeForPosition(new Rle(h,t.horizontalLine.endColumn)))||void 0===n?void 0:n.left)&&void 0!==o?o:i+this._spaceWidth)-i:this._spaceWidth;g+=`<div class="core-guide ${t.className} ${s}" style="left:${i}px;height:${l}px;width:${r}px"></div>`}c[r]=g}this._renderResult=c}getGuidesByLine(e,t,i){const n=!1!==this._bracketPairGuideOptions.bracketPairs?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:!0===this._bracketPairGuideOptions.bracketPairsHorizontal?PDe.Enabled:"active"===this._bracketPairGuideOptions.bracketPairsHorizontal?PDe.EnabledForActive:PDe.Disabled,includeInactive:!0===this._bracketPairGuideOptions.bracketPairs}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let s=0,r=0,a=0;if(!1!==this._bracketPairGuideOptions.highlightActiveIndentation&&i){const n=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);s=n.startLineNumber,r=n.endLineNumber,a=n.indent}const{indentSize:l}=this._context.viewModel.model.getOptions(),h=[];for(let i=e;i<=t;i++){const t=new Array;h.push(t);const d=n?n[i-e]:[],c=new Hse(d),u=o?o[i-e]:0;for(let e=1;e<=u;e++){const n=(e-1)*l+1,o=("always"===this._bracketPairGuideOptions.highlightActiveIndentation||0===d.length)&&s<=i&&i<=r&&e===a;t.push(...c.takeWhile((e=>e.visibleColumn<n))||[]);const h=c.peek();h&&h.visibleColumn===n&&!h.horizontalLine||t.push(new VDe(n,-1,o?"core-guide-indent-active":"core-guide-indent",null,-1,-1))}t.push(...c.takeWhile((e=>!0))||[])}return h}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function jDe(e){if(!e||!e.isTransparent())return e}_Le(((e,t)=>{const i=[{bracketColor:PLe,guideColor:ULe,guideColorActive:ZLe},{bracketColor:FLe,guideColor:KLe,guideColorActive:YLe},{bracketColor:BLe,guideColor:jLe,guideColorActive:QLe},{bracketColor:WLe,guideColor:qLe,guideColorActive:XLe},{bracketColor:VLe,guideColor:$Le,guideColorActive:JLe},{bracketColor:zLe,guideColor:GLe,guideColorActive:exe}],n=new UDe,o=i.map((t=>{var i,n;const o=e.getColor(t.bracketColor),s=e.getColor(t.guideColor),r=e.getColor(t.guideColorActive),a=jDe(null!==(i=jDe(s))&&void 0!==i?i:null==o?void 0:o.transparent(.3)),l=jDe(null!==(n=jDe(r))&&void 0!==n?n:o);if(a&&l)return{guideColor:a,guideColorActive:l}})).filter(Qse);if(o.length>0){for(let e=0;e<30;e++){const i=o[e%o.length];t.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(e).replace(/ /g,".")} { --guide-color: ${i.guideColor}; --guide-color-active: ${i.guideColorActive}; }`)}t.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),t.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),t.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),t.addRule(`.monaco-editor .vertical.${n.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),t.addRule(`.monaco-editor .horizontal-top.${n.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),t.addRule(`.monaco-editor .horizontal-bottom.${n.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}}));var qDe=i(1413),$De={};$De.styleTagTransform=Vr(),$De.setAttributes=Pr(),$De.insert=Rr().bind(null,"head"),$De.domAPI=Tr(),$De.insertStyleElement=Br(),Ir()(qDe.Z,$De),qDe.Z&&qDe.Z.locals&&qDe.Z.locals;class GDe{constructor(){this._currentVisibleRange=new Ole(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class ZDe{constructor(e,t,i,n,o,s,r){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=n,this.startScrollTop=o,this.stopScrollTop=s,this.scrollType=r,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class YDe{constructor(e,t,i,n,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=n,this.scrollType=o,this.type="selections";let s=t[0].startLineNumber,r=t[0].endLineNumber;for(let e=1,i=t.length;e<i;e++){const i=t[e];s=Math.min(s,i.startLineNumber),r=Math.max(r,i.endLineNumber)}this.minLineNumber=s,this.maxLineNumber=r}}class QDe extends VSe{constructor(e,t){super(e),this._linesContent=t,this._textRangeRestingSpot=document.createElement("div"),this._visibleLines=new dDe(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration,n=this._context.configuration.options,o=n.get(47),s=n.get(139);this._lineHeight=n.get(63),this._typicalHalfwidthCharacterWidth=o.typicalHalfwidthCharacterWidth,this._isViewportWrapping=s.isViewportWrapping,this._revealHorizontalRightPadding=n.get(94),this._cursorSurroundingLines=n.get(26),this._cursorSurroundingLinesStyle=n.get(27),this._canUseLayerHinting=!n.get(29),this._viewLineOptions=new ike(i,this._context.theme.type),zSe.write(this.domNode,7),this.domNode.setClassName(`view-lines ${axe}`),nce(this.domNode,o),this._maxLineWidth=0,this._asyncUpdateLineWidths=new hpe((()=>{this._updateLineWidthsSlow()}),200),this._asyncCheckMonospaceFontAssumptions=new hpe((()=>{this._checkMonospaceFontAssumptions()}),2e3),this._lastRenderedData=new GDe,this._horizontalRevealRequest=null,this._stickyScrollEnabled=n.get(109).enabled,this._maxNumberStickyLines=n.get(109).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new nke(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(139)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(47),n=t.get(139);return this._lineHeight=t.get(63),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(94),this._cursorSurroundingLines=t.get(26),this._cursorSurroundingLinesStyle=t.get(27),this._canUseLayerHinting=!t.get(29),this._stickyScrollEnabled=t.get(109).enabled,this._maxNumberStickyLines=t.get(109).maxLineCount,nce(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(138)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new ike(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const e=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let t=e;t<=i;t++)this._visibleLines.getVisibleLine(t).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let e=t;e<=i;e++)n=this._visibleLines.getVisibleLine(e).onSelectionChanged()||n;return n}onDecorationsChanged(e){{const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++)this._visibleLines.getVisibleLine(i).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(-1===t)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new ZDe(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new YDe(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const n=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,n),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTop<t||e.scrollTop>i)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(null===i)return null;const n=this._getLineNumberFor(i);if(-1===n)return null;if(n<1||n>this._context.viewModel.getLineCount())return null;if(1===this._context.viewModel.getLineMaxColumn(n))return new Rle(n,1);const o=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();if(n<o||n>s)return null;let r=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(n,e,t);const a=this._context.viewModel.getLineMinColumn(n);return r<a&&(r=a),new Rle(n,r)}_getViewLineDomNode(e){for(;e&&1===e.nodeType;){if(e.className===nke.CLASS_NAME)return e;e=e.parentElement}return null}_getLineNumberFor(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++)if(e===this._visibleLines.getVisibleLine(n).getDomNode())return n;return-1}getLineWidth(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();return e<t||e>i?-1:this._visibleLines.getVisibleLine(e).getWidth()}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=Ole.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;const o=[];let s=0;const r=new tke(this.domNode.domNode,this._textRangeRestingSpot);let a=0;t&&(a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Rle(n.startLineNumber,1)).lineNumber);const l=this._visibleLines.getStartLineNumber(),h=this._visibleLines.getEndLineNumber();for(let e=n.startLineNumber;e<=n.endLineNumber;e++){if(e<l||e>h)continue;const d=e===n.startLineNumber?n.startColumn:1,c=e===n.endLineNumber?n.endColumn:this._context.viewModel.getLineMaxColumn(e),u=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,d,c,r);if(u){if(t&&e<i){const t=a;a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Rle(e+1,1)).lineNumber,t!==a&&(u.ranges[u.ranges.length-1].width+=this._typicalHalfwidthCharacterWidth)}o[s++]=new KSe(u.outsideRenderedLine,e,jSe.from(u.ranges))}}return 0===s?null:o}_visibleRangesForLineRange(e,t,i){return this.shouldRender()||e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber()?null:this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,new tke(this.domNode.domNode,this._textRangeRestingSpot))}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new $Se(t.outsideRenderedLine,t.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=1,o=!0;for(let s=t;s<=i;s++){const t=this._visibleLines.getVisibleLine(s);!e||t.getWidthIsFast()?n=Math.max(n,t.getWidth()):o=!1}return o&&1===t&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++){const i=this._visibleLines.getVisibleLine(o);if(i.needsMonospaceFontCheck()){const n=i.getWidth();n>t&&(t=n,e=o)}}if(-1!==e&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let e=i;e<=n;e++)this._visibleLines.getVisibleLine(e).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const t=this._horizontalRevealRequest;if(e.startLineNumber<=t.minLineNumber&&t.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const e=this._computeScrollLeftToReveal(t);e&&(this._isViewportWrapping||this._ensureMaxLineWidth(e.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:e.scrollLeft},t.scrollType))}}if(this._updateLineWidthsFast()||this._asyncUpdateLineWidths.schedule(),ise&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++)if(this._visibleLines.getVisibleLine(i).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth<t&&(this._maxLineWidth=t,this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth))}_computeScrollTopToRevealRange(e,t,i,n,o,s){const r=e.top,a=e.height,l=r+a;let h,d,c;if(o&&o.length>0){let e=o[0].startLineNumber,t=o[0].endLineNumber;for(let i=1,n=o.length;i<n;i++){const n=o[i];e=Math.min(e,n.startLineNumber),t=Math.max(t,n.endLineNumber)}h=!1,d=this._context.viewLayout.getVerticalOffsetForLineNumber(e),c=this._context.viewLayout.getVerticalOffsetForLineNumber(t)+this._lineHeight}else{if(!n)return-1;h=!0,d=this._context.viewLayout.getVerticalOffsetForLineNumber(n.startLineNumber),c=this._context.viewLayout.getVerticalOffsetForLineNumber(n.endLineNumber)+this._lineHeight}let u,g=0,p=0;if("mouse"!==t&&!i||"default"!==this._cursorSurroundingLinesStyle){const e=Math.min(a/this._lineHeight/2,this._cursorSurroundingLines);g=this._stickyScrollEnabled?Math.max(e,this._maxNumberStickyLines)*this._lineHeight:e*this._lineHeight,p=Math.max(0,e-1)*this._lineHeight}else i||(g=this._lineHeight);if(i||0!==s&&4!==s||(p+=this._lineHeight),d-=g,c+=p,c-d>a){if(!h)return-1;u=d}else if(5===s||6===s)if(6===s&&r<=d&&c<=l)u=r;else{const e=d-Math.max(5*this._lineHeight,.2*a),t=c-a;u=Math.max(t,e)}else if(1===s||2===s)if(2===s&&r<=d&&c<=l)u=r;else{const e=(d+c)/2;u=Math.max(0,e-a/2)}else u=this._computeMinimumScrolling(r,l,d,c,3===s,4===s);return u}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(138),n=t.left,o=n+t.width-i.verticalScrollbarWidth;let s=1073741824,r=0;if("range"===e.type){const t=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!t)return null;for(const e of t.ranges)s=Math.min(s,Math.round(e.left)),r=Math.max(r,Math.round(e.left+e.width))}else for(const t of e.selections){if(t.startLineNumber!==t.endLineNumber)return null;const e=this._visibleRangesForLineRange(t.startLineNumber,t.startColumn,t.endColumn);if(!e)return null;for(const t of e.ranges)s=Math.min(s,Math.round(t.left)),r=Math.max(r,Math.round(t.left+t.width))}return e.minimalReveal||(s=Math.max(0,s-QDe.HORIZONTAL_EXTRA_PX),r+=this._revealHorizontalRightPadding),"selections"===e.type&&r-s>t.width?null:{scrollLeft:this._computeMinimumScrolling(n,o,s,r),maxHorizontalOffset:r}}_computeMinimumScrolling(e,t,i,n,o,s){o=!!o,s=!!s;const r=(t|=0)-(e|=0);return(n|=0)-(i|=0)<r?o?i:s?Math.max(0,n-r):i<e?i:n>t?Math.max(0,n-r):e:i}}QDe.HORIZONTAL_EXTRA_PX=30;var XDe=i(7361),JDe={};JDe.styleTagTransform=Vr(),JDe.setAttributes=Pr(),JDe.insert=Rr().bind(null,"head"),JDe.domAPI=Tr(),JDe.insertStyleElement=Br(),Ir()(XDe.Z,JDe),XDe.Z&&XDe.Z.locals&&XDe.Z.locals;class eEe extends RDe{constructor(e){super(),this._context=e;const t=this._context.configuration.options.get(138);this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options.get(138);return this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let e=0,o=t.length;e<o;e++){const o=t[e],s=o.options.linesDecorationsClassName;s&&(i[n++]=new ADe(o.range.startLineNumber,o.range.endLineNumber,s));const r=o.options.firstLineDecorationClassName;r&&(i[n++]=new ADe(o.range.startLineNumber,o.range.startLineNumber,r))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o='" style="left:'+this._decorationsLeft.toString()+"px;width:"+this._decorationsWidth.toString()+'px;"></div>',s=[];for(let e=t;e<=i;e++){const i=e-t,r=n[i];let a="";for(let e=0,t=r.length;e<t;e++)a+='<div class="cldr '+r[e]+o;s[i]=a}this._renderResult=s}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}var tEe=i(9591),iEe={};iEe.styleTagTransform=Vr(),iEe.setAttributes=Pr(),iEe.insert=Rr().bind(null,"head"),iEe.domAPI=Tr(),iEe.insertStyleElement=Br(),Ir()(tEe.Z,iEe),tEe.Z&&tEe.Z.locals&&tEe.Z.locals;class nEe extends RDe{constructor(e){super(),this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let e=0,o=t.length;e<o;e++){const o=t[e],s=o.options.marginClassName;s&&(i[n++]=new ADe(o.range.startLineNumber,o.range.endLineNumber,s))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o=[];for(let e=t;e<=i;e++){const i=e-t,s=n[i];let r="";for(let e=0,t=s.length;e<t;e++)r+='<div class="cmdr '+s[e]+'" style=""></div>';o[i]=r}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}var oEe=i(6997),sEe={};sEe.styleTagTransform=Vr(),sEe.setAttributes=Pr(),sEe.insert=Rr().bind(null,"head"),sEe.domAPI=Tr(),sEe.insertStyleElement=Br(),Ir()(oEe.Z,sEe),oEe.Z&&oEe.Z.locals&&oEe.Z.locals;class rEe{constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=rEe._clamp(e),this.g=rEe._clamp(t),this.b=rEe._clamp(i),this.a=rEe._clamp(n)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:0|e}}rEe.Empty=new rEe(0,0,0,0);class aEe extends aae{static getInstance(){return this._INSTANCE||(this._INSTANCE=iae(new aEe)),this._INSTANCE}constructor(){super(),this._onDidChange=new bae,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(ehe.onDidChange((e=>{e.changedColorMap&&this._updateColorMap()})))}_updateColorMap(){const e=ehe.getColorMap();if(!e)return this._colors=[rEe.Empty],void(this._backgroundIsLight=!0);this._colors=[rEe.Empty];for(let t=1;t<e.length;t++){const i=e[t].rgba;this._colors[t]=new rEe(i.r,i.g,i.b,Math.round(255*i.a))}const t=e[2].getRelativeLuminance();this._backgroundIsLight=t>=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}aEe._INSTANCE=null;const lEe=(()=>{const e=[];for(let t=32;t<=126;t++)e.push(t);return e.push(65533),e})();class hEe{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=hEe.soften(e,.8),this.charDataLight=hEe.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=Kpe(e[n]*t);return i}renderChar(e,t,i,n,o,s,r,a,l,h,d){const c=1*this.scale,u=2*this.scale,g=d?1:u;if(t+c>e.width||i+g>e.height)return void console.warn("bad render request outside image data");const p=h?this.charDataLight:this.charDataNormal,m=((e,t)=>(e-=32)<0||e>96?t<=2?(e+96)%96:95:e)(n,l),f=4*e.width,_=r.r,v=r.g,b=r.b,w=o.r-_,C=o.g-v,y=o.b-b,S=Math.max(s,a),k=e.data;let L=m*c*u,x=i*f+4*t;for(let e=0;e<g;e++){let e=x;for(let t=0;t<c;t++){const t=p[L++]/255*(s/255);k[e++]=_+w*t,k[e++]=v+C*t,k[e++]=b+y*t,k[e++]=S}x+=f}}blockRenderChar(e,t,i,n,o,s,r,a){const l=1*this.scale,h=2*this.scale,d=a?1:h;if(t+l>e.width||i+d>e.height)return void console.warn("bad render request outside image data");const c=4*e.width,u=o/255*.5,g=s.r,p=s.g,m=s.b,f=g+(n.r-g)*u,_=p+(n.g-p)*u,v=m+(n.b-m)*u,b=Math.max(o,r),w=e.data;let C=i*c+4*t;for(let e=0;e<d;e++){let e=C;for(let t=0;t<l;t++)w[e++]=f,w[e++]=_,w[e++]=v,w[e++]=b;C+=c}}}const dEe={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15},cEe=e=>{const t=new Uint8ClampedArray(e.length/2);for(let i=0;i<e.length;i+=2)t[i>>1]=dEe[e[i]]<<4|15&dEe[e[i+1]];return t},uEe={1:Qre((()=>cEe("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792"))),2:Qre((()=>cEe("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126")))};class gEe{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return i=uEe[e]?new hEe(uEe[e](),e):gEe.createFromSampleData(gEe.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=960,t.style.width="960px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let n=0;for(const e of lEe)i.fillText(String.fromCharCode(e),n,8),n+=10;return i.getImageData(0,0,960,16)}static createFromSampleData(e,t){if(61440!==e.length)throw new Error("Unexpected source in MinimapCharRenderer");const i=gEe._downsample(e,t);return new hEe(i,t)}static _downsampleChar(e,t,i,n,o){const s=1*o,r=2*o;let a=n,l=0;for(let n=0;n<r;n++){const o=n/r*16,h=(n+1)/r*16;for(let n=0;n<s;n++){const r=n/s*10,d=(n+1)/s*10;let c=0,u=0;for(let i=o;i<h;i++){const n=t+3840*Math.floor(i),o=1-(i-Math.floor(i));for(let t=r;t<d;t++){const i=1-(t-Math.floor(t)),s=n+4*Math.floor(t),r=i*o;u+=r,c+=e[s]*e[s+3]/255*r}}const g=c/u;l=Math.max(l,g),i[a++]=Kpe(g)}}return l}static _downsample(e,t){const i=2*t*1*t,n=96*i,o=new Uint8ClampedArray(n);let s=0,r=0,a=0;for(let n=0;n<96;n++)a=Math.max(a,this._downsampleChar(e,r,o,s,t)),s+=i,r+=40;if(a>0){const e=255/a;for(let t=0;t<n;t++)o[t]*=e}return o}}class pEe{constructor(e,t,i){const n=e.options,o=n.get(136),s=n.get(138),r=s.minimap,a=n.get(47),l=n.get(69);this.renderMinimap=r.renderMinimap,this.size=l.size,this.minimapHeightIsEditorHeight=r.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=n.get(99),this.paddingTop=n.get(80).top,this.paddingBottom=n.get(80).bottom,this.showSlider=l.showSlider,this.autohide=l.autohide,this.pixelRatio=o,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.lineHeight=n.get(63),this.minimapLeft=r.minimapLeft,this.minimapWidth=r.minimapWidth,this.minimapHeight=s.height,this.canvasInnerWidth=r.minimapCanvasInnerWidth,this.canvasInnerHeight=r.minimapCanvasInnerHeight,this.canvasOuterWidth=r.minimapCanvasOuterWidth,this.canvasOuterHeight=r.minimapCanvasOuterHeight,this.isSampling=r.minimapIsSampling,this.editorHeight=s.height,this.fontScale=r.minimapScale,this.minimapLineHeight=r.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.charRenderer=Qre((()=>gEe.create(this.fontScale,a.fontFamily))),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=pEe._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=pEe._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(uSe);return i?new rEe(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(gSe);return t?rEe._clamp(Math.round(255*t.rgba.a)):255}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class mEe{constructor(e,t,i,n,o,s,r,a,l){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=o,this.sliderHeight=s,this.topPaddingLineCount=r,this.startLineNumber=a,this.endLineNumber=l}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,n,o,s,r,a,l,h,d){const c=e.pixelRatio,u=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/u),p=e.lineHeight;if(e.minimapHeightIsEditorHeight){let t=a*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(t+=Math.max(0,o-e.lineHeight-e.paddingBottom));const i=Math.max(1,Math.floor(o*o/t)),n=Math.max(0,e.minimapHeight-i),s=n/(h-o),d=l*s,c=n>0,u=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),g=Math.floor(e.paddingTop/e.lineHeight);return new mEe(l,h,c,s,d,i,g,1,Math.min(r,u))}let m;if(s&&i!==r){const e=i-t+1;m=Math.floor(e*u/c)}else{const e=o/p;m=Math.floor(e*u/c)}const f=Math.floor(e.paddingTop/p);let _,v=Math.floor(e.paddingBottom/p);if(e.scrollBeyondLastLine){const e=o/p;v=Math.max(v,e-1)}_=v>0?(f+r+v-o/p-1)*u/c:Math.max(0,(f+r)*u/c-m),_=Math.min(e.minimapHeight-m,_);const b=_/(h-o),w=l*b;if(g>=f+r+v)return new mEe(l,h,_>0,b,w,m,f,1,r);{let i,o;i=t>1?t+f:Math.max(1,l/p);let s=Math.max(1,Math.floor(i-w*c/u));s<f?(o=f-s+1,s=1):(o=0,s=Math.max(1,s-f)),d&&d.scrollHeight===h&&(d.scrollTop>l&&(s=Math.min(s,d.startLineNumber),o=Math.max(o,d.topPaddingLineCount)),d.scrollTop<l&&(s=Math.max(s,d.startLineNumber),o=Math.min(o,d.topPaddingLineCount)));const a=Math.min(r,s-o+g-1),_=(l-n)/p;let v;return v=l>e.paddingTop?(t-s+o+_)*u/c:l/e.paddingTop*(o+_)*u/c,new mEe(l,h,!0,b,v,m,o,s,a)}}}class fEe{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}fEe.INVALID=new fEe(-1);class _Ee{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new hDe((()=>fEe.INVALID)),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const t=this._renderedLines._get().lines;for(let e=0,i=t.length;e<i;e++)if(-1===t[e].dy)return!1;return!0}scrollEquals(e){return this.renderedLayout.startLineNumber===e.startLineNumber&&this.renderedLayout.endLineNumber===e.endLineNumber}_get(){const e=this._renderedLines._get();return{imageData:this._imageData,rendLineNumberStart:e.rendLineNumberStart,lines:e.lines}}onLinesChanged(e,t){return this._renderedLines.onLinesChanged(e,t)}onLinesDeleted(e,t){this._renderedLines.onLinesDeleted(e,t)}onLinesInserted(e,t){this._renderedLines.onLinesInserted(e,t)}onTokensChanged(e){return this._renderedLines.onTokensChanged(e)}}class vEe{constructor(e,t,i,n){this._backgroundFillData=vEe._createBackgroundFillData(t,i,n),this._buffers=[e.createImageData(t,i),e.createImageData(t,i)],this._lastUsedBuffer=0}getBuffer(){this._lastUsedBuffer=1-this._lastUsedBuffer;const e=this._buffers[this._lastUsedBuffer];return e.data.set(this._backgroundFillData),e}static _createBackgroundFillData(e,t,i){const n=i.r,o=i.g,s=i.b,r=i.a,a=new Uint8ClampedArray(e*t*4);let l=0;for(let i=0;i<t;i++)for(let t=0;t<e;t++)a[l]=n,a[l+1]=o,a[l+2]=s,a[l+3]=r,l+=4;return a}}class bEe{static compute(e,t,i){if(0===e.renderMinimap||!e.isSampling)return[null,[]];const{minimapLineCount:n}=Mre.computeContainedMinimapLineCount({viewLineCount:t,scrollBeyondLastLine:e.scrollBeyondLastLine,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:e.editorHeight,lineHeight:e.lineHeight,pixelRatio:e.pixelRatio}),o=t/n,s=o/2;if(!i||0===i.minimapLines.length){const e=[];if(e[0]=1,n>1){for(let t=0,i=n-1;t<i;t++)e[t]=Math.round(t*o+s);e[n-1]=t}return[new bEe(o,e),[]]}const r=i.minimapLines,a=r.length,l=[];let h=0,d=0,c=1,u=[],g=null;for(let e=0;e<n;e++){const i=Math.max(c,Math.round(e*o)),p=Math.max(i,Math.round((e+1)*o));for(;h<a&&r[h]<i;){if(u.length<10){const e=h+1+d;g&&"deleted"===g.type&&g._oldIndex===h-1?g.deleteToLineNumber++:(g={type:"deleted",_oldIndex:h,deleteFromLineNumber:e,deleteToLineNumber:e},u.push(g)),d--}h++}let m;if(h<a&&r[h]<=p)m=r[h],h++;else if(m=0===e?1:e+1===n?t:Math.round(e*o+s),u.length<10){const t=h+1+d;g&&"inserted"===g.type&&g._i===e-1?g.insertToLineNumber++:(g={type:"inserted",_i:e,insertFromLineNumber:t,insertToLineNumber:t},u.push(g)),d++}l[e]=m,c=m}if(u.length<10)for(;h<a;){const e=h+1+d;g&&"deleted"===g.type&&g._oldIndex===h-1?g.deleteToLineNumber++:(g={type:"deleted",_oldIndex:h,deleteFromLineNumber:e,deleteToLineNumber:e},u.push(g)),d--,h++}else u=[{type:"flush"}];return[new bEe(o,l),u]}constructor(e,t){this.samplingRatio=e,this.minimapLines=t}modelLineToMinimapLine(e){return Math.min(this.minimapLines.length,Math.max(1,Math.round(e/this.samplingRatio)))}modelLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e)-1;for(;i>0&&this.minimapLines[i-1]>=e;)i--;let n=this.modelLineToMinimapLine(t)-1;for(;n+1<this.minimapLines.length&&this.minimapLines[n+1]<=t;)n++;if(i===n){const n=this.minimapLines[i];if(n<e||n>t)return null}return[i+1,n+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),n=this.modelLineToMinimapLine(t);return e!==t&&n===i&&(n===this.minimapLines.length?i>1&&i--:n++),[i,n]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,n=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]<e.fromLineNumber);o--)this.minimapLines[o]<=e.toLineNumber?(this.minimapLines[o]=Math.max(1,e.fromLineNumber-1),i=Math.min(i,o),n=Math.max(n,o)):this.minimapLines[o]-=t;return[i,n]}onLinesInserted(e){const t=e.toLineNumber-e.fromLineNumber+1;for(let i=this.minimapLines.length-1;i>=0&&!(this.minimapLines[i]<e.fromLineNumber);i--)this.minimapLines[i]+=t}}class wEe extends VSe{constructor(e){super(e),this.tokensColorTracker=aEe.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new pEe(this._context.configuration,this._context.theme,this.tokensColorTracker);const[t]=bEe.compute(this.options,this._context.viewModel.getLineCount(),null);this._samplingState=t,this._shouldCheckSampling=!1,this._actual=new CEe(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){const e=new pEe(this._context.configuration,this._context.theme,this.tokensColorTracker);return!this.options.equals(e)&&(this.options=e,this._recreateLineSampling(),this._actual.onDidChangeOptions(),!0)}onConfigurationChanged(e){return this._onOptionsMaybeChanged()}onCursorStateChanged(e){return this._selections=e.selections,this._minimapSelections=null,this._actual.onSelectionChanged()}onDecorationsChanged(e){return!!e.affectsMinimap&&this._actual.onDecorationsChanged()}onFlushed(e){return this._samplingState&&(this._shouldCheckSampling=!0),this._actual.onFlushed()}onLinesChanged(e){if(this._samplingState){const t=this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber,e.fromLineNumber+e.count-1);return!!t&&this._actual.onLinesChanged(t[0],t[1]-t[0]+1)}return this._actual.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){if(this._samplingState){const[t,i]=this._samplingState.onLinesDeleted(e);return t<=i&&this._actual.onLinesChanged(t+1,i-t+1),this._shouldCheckSampling=!0,!0}return this._actual.onLinesDeleted(e.fromLineNumber,e.toLineNumber)}onLinesInserted(e){return this._samplingState?(this._samplingState.onLinesInserted(e),this._shouldCheckSampling=!0,!0):this._actual.onLinesInserted(e.fromLineNumber,e.toLineNumber)}onScrollChanged(e){return this._actual.onScrollChanged()}onThemeChanged(e){return this._actual.onThemeChanged(),this._onOptionsMaybeChanged(),!0}onTokensChanged(e){if(this._samplingState){const t=[];for(const i of e.ranges){const e=this._samplingState.modelLineRangeToMinimapLineRange(i.fromLineNumber,i.toLineNumber);e&&t.push({fromLineNumber:e[0],toLineNumber:e[1]})}return!!t.length&&this._actual.onTokensChanged(t)}return this._actual.onTokensChanged(e.ranges)}onTokensColorsChanged(e){return this._onOptionsMaybeChanged(),this._actual.onTokensColorsChanged()}onZonesChanged(e){return this._actual.onZonesChanged()}prepareRender(e){this._shouldCheckSampling&&(this._shouldCheckSampling=!1,this._recreateLineSampling())}render(e){let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber;this._samplingState&&(t=this._samplingState.modelLineToMinimapLine(t),i=this._samplingState.modelLineToMinimapLine(i));const n={viewportContainsWhitespaceGaps:e.viewportData.whitespaceViewportData.length>0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(n)}_recreateLineSampling(){this._minimapSelections=null;const e=Boolean(this._samplingState),[t,i]=bEe.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const e of i)switch(e.type){case"deleted":this._actual.onLinesDeleted(e.deleteFromLineNumber,e.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(e.insertFromLineNumber,e.insertToLineNumber);break;case"flush":this._actual.onFlushed()}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){const n=[];for(let o=0,s=t-e+1;o<s;o++)i[o]?n[o]=this._context.viewModel.getViewLineData(this._samplingState.minimapLines[e+o-1]):n[o]=null;return n}return this._context.viewModel.getMinimapLinesRenderingData(e,t,i).data}getSelections(){if(null===this._minimapSelections)if(this._samplingState){this._minimapSelections=[];for(const e of this._selections){const[t,i]=this._samplingState.decorationLineRangeToMinimapLineRange(e.startLineNumber,e.endLineNumber);this._minimapSelections.push(new Ple(t,e.startColumn,i,e.endColumn))}}else this._minimapSelections=this._selections;return this._minimapSelections}getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const n=this._samplingState.minimapLines[e-1],o=this._samplingState.minimapLines[t-1];i=new Ole(n,1,o,this._context.viewModel.getLineMaxColumn(o))}else i=new Ole(e,1,t,this._context.viewModel.getLineMaxColumn(t));const n=this._context.viewModel.getDecorationsInViewport(i,!0);if(this._samplingState){const e=[];for(const t of n){if(!t.options.minimap)continue;const i=t.range,n=this._samplingState.modelLineToMinimapLine(i.startLineNumber),o=this._samplingState.modelLineToMinimapLine(i.endLineNumber);e.push(new Pfe(new Ole(n,i.startColumn,o,i.endColumn),t.options))}return e}return n}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new Ole(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}}class CEe extends aae{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(hSe),this._domNode=ice(document.createElement("div")),zSe.write(this._domNode,8),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=ice(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=ice(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=ice(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=ice(document.createElement("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=ice(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=xve(this._domNode.domNode,Yve.POINTER_DOWN,(e=>{if(e.preventDefault(),0===this._model.options.renderMinimap)return;if(!this._lastRenderData)return;if("proportional"!==this._model.options.size){if(0===e.button&&this._lastRenderData){const t=Rve(this._slider.domNode),i=t.top+t.height/2;this._startSliderDragging(e,i,this._lastRenderData.renderedLayout)}return}const t=this._model.options.minimapLineHeight,i=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*e.offsetY;let n=Math.floor(i/t)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;n=Math.min(n,this._model.getLineCount()),this._model.revealLineNumber(n)})),this._sliderPointerMoveMonitor=new Iwe,this._sliderPointerDownListener=xve(this._slider.domNode,Yve.POINTER_DOWN,(e=>{e.preventDefault(),e.stopPropagation(),0===e.button&&this._lastRenderData&&this._startSliderDragging(e,e.pageY,this._lastRenderData.renderedLayout)})),this._gestureDisposable=Nwe.addTarget(this._domNode.domNode),this._sliderTouchStartListener=Lve(this._domNode.domNode,Ewe.Start,(e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(e))}),{passive:!1}),this._sliderTouchMoveListener=Lve(this._domNode.domNode,Ewe.Change,(e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(e)}),{passive:!1}),this._sliderTouchEndListener=xve(this._domNode.domNode,Ewe.End,(e=>{e.preventDefault(),e.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)}))}_startSliderDragging(e,t,i){if(!(e.target&&e.target instanceof Element))return;const n=e.pageX;this._slider.toggleClassName("active",!0);const o=(e,o)=>{const s=Rve(this._domNode.domNode),r=Math.min(Math.abs(o-n),Math.abs(o-s.left),Math.abs(o-s.left-s.width));if(ese&&r>140)return void this._model.setScrollTop(i.scrollTop);const a=e-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(a))};e.pageY!==t&&o(e.pageY,n),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>o(e.pageY,e.pageX)),(()=>{this._slider.toggleClassName("active",!1)}))}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return"always"===this._model.options.showSlider?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide&&e.push("autohide"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new vEe(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return!!this._lastRenderData&&this._lastRenderData.onLinesChanged(e,t)}onLinesDeleted(e,t){var i;return null===(i=this._lastRenderData)||void 0===i||i.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var i;return null===(i=this._lastRenderData)||void 0===i||i.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(hSe),this._renderDecorations=!0,!0}onTokensChanged(e){return!!this._lastRenderData&&this._lastRenderData.onTokensChanged(e)}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(0===this._model.options.renderMinimap)return this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),void this._sliderHorizontal.setHeight(0);e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const t=mEe.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(t.sliderNeeded?"block":"none"),this._slider.setTop(t.sliderTop),this._slider.setHeight(t.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(t.sliderHeight),this.renderDecorations(t),this._lastRenderData=this.renderLines(t)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(Ole.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort(((e,t)=>(e.options.zIndex||0)-(t.options.zIndex||0)));const{canvasInnerWidth:n,canvasInnerHeight:o}=this._model.options,s=this._model.options.minimapLineHeight,r=this._model.options.minimapCharWidth,a=this._model.getOptions().tabSize,l=this._decorationsCanvas.domNode.getContext("2d");l.clearRect(0,0,n,o);const h=new yEe(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,h,e,s),this._renderDecorationsLineHighlights(l,i,h,e,s);const d=new yEe(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,d,e,s,a,r,n),this._renderDecorationsHighlights(l,i,d,e,s,a,r,n)}}_renderSelectionLineHighlights(e,t,i,n,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let s=0,r=0;for(const a of t){const t=n.intersectWithViewport(a);if(!t)continue;const[l,h]=t;for(let e=l;e<=h;e++)i.set(e,!0);const d=n.getYForLineNumber(l,o),c=n.getYForLineNumber(h,o);r>=d||(r>s&&e.fillRect(8,s,e.canvas.width,r-s),s=d),r=c}r>s&&e.fillRect(8,s,e.canvas.width,r-s)}_renderDecorationsLineHighlights(e,t,i,n,o){const s=new Map;for(let r=t.length-1;r>=0;r--){const a=t[r],l=a.options.minimap;if(!l||l.position!==sue.Inline)continue;const h=n.intersectWithViewport(a.range);if(!h)continue;const[d,c]=h,u=l.getColor(this._theme.value);if(!u||u.isTransparent())continue;let g=s.get(u.toString());g||(g=u.transparent(.5).toString(),s.set(u.toString(),g)),e.fillStyle=g;for(let t=d;t<=c;t++){if(i.has(t))continue;i.set(t,!0);const s=n.getYForLineNumber(d,o);e.fillRect(8,s,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,n,o,s,r,a){if(this._selectionColor&&!this._selectionColor.isTransparent())for(const l of t){const t=n.intersectWithViewport(l);if(!t)continue;const[h,d]=t;for(let t=h;t<=d;t++)this.renderDecorationOnLine(e,i,l,this._selectionColor,n,t,o,o,s,r,a)}}_renderDecorationsHighlights(e,t,i,n,o,s,r,a){for(const l of t){const t=l.options.minimap;if(!t)continue;const h=n.intersectWithViewport(l.range);if(!h)continue;const[d,c]=h,u=t.getColor(this._theme.value);if(u&&!u.isTransparent())for(let h=d;h<=c;h++)switch(t.position){case sue.Inline:this.renderDecorationOnLine(e,i,l.range,u,n,h,o,o,s,r,a);continue;case sue.Gutter:{const t=n.getYForLineNumber(h,o),i=2;this.renderDecoration(e,u,i,t,2,o);continue}}}}renderDecorationOnLine(e,t,i,n,o,s,r,a,l,h,d){const c=o.getYForLineNumber(s,a);if(c+r<0||c>this._model.options.canvasInnerHeight)return;const{startLineNumber:u,endLineNumber:g}=i,p=u===s?i.startColumn:1,m=g===s?i.endColumn:this._model.getLineMaxColumn(s),f=this.getXOffsetForPosition(t,s,p,l,h,d),_=this.getXOffsetForPosition(t,s,m,l,h,d);this.renderDecoration(e,n,f,c,_-f,r)}getXOffsetForPosition(e,t,i,n,o,s){if(1===i)return 8;if((i-1)*o>=s)return s;let r=e.get(t);if(!r){const i=this._model.getLineContent(t);r=[8];let a=8;for(let e=1;e<i.length+1;e++){const t=i.charCodeAt(e-1),l=a+(9===t?n*o:Ede(t)?2*o:o);if(l>=s){r[e]=s;break}r[e]=l,a=l}e.set(t,r)}return i-1<r.length?r[i-1]:s}renderDecoration(e,t,i,n,o,s){e.fillStyle=t&&t.toString()||"",e.fillRect(i,n,o,s)}renderLines(e){const t=e.startLineNumber,i=e.endLineNumber,n=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const t=this._lastRenderData._get();return new _Ee(e,t.imageData,t.lines)}const o=this._getBuffer();if(!o)return null;const[s,r,a]=CEe._renderUntouchedLines(o,e.topPaddingLineCount,t,i,n,this._lastRenderData),l=this._model.getMinimapLinesRenderingData(t,i,a),h=this._model.getOptions().tabSize,d=this._model.options.defaultBackgroundColor,c=this._model.options.backgroundColor,u=this._model.options.foregroundAlpha,g=this._model.tokensColorTracker,p=g.backgroundIsLight(),m=this._model.options.renderMinimap,f=this._model.options.charRenderer(),_=this._model.options.fontScale,v=this._model.options.minimapCharWidth,b=(1===m?2:3)*_,w=n>b?Math.floor((n-b)/2):0,C=c.a/255,y=new rEe(Math.round((c.r-d.r)*C+d.r),Math.round((c.g-d.g)*C+d.g),Math.round((c.b-d.b)*C+d.b),255);let S=e.topPaddingLineCount*n;const k=[];for(let e=0,s=i-t+1;e<s;e++)a[e]&&CEe._renderLine(o,y,c.a,p,m,v,g,u,f,S,w,h,l[e],_,n),k[e]=new fEe(S),S+=n;const L=-1===s?0:s,x=(-1===r?o.height:r)-L;return this._canvas.domNode.getContext("2d").putImageData(o,0,0,0,L,o.width,x),new _Ee(e,o,k)}static _renderUntouchedLines(e,t,i,n,o,s){const r=[];if(!s){for(let e=0,t=n-i+1;e<t;e++)r[e]=!0;return[-1,-1,r]}const a=s._get(),l=a.imageData.data,h=a.rendLineNumberStart,d=a.lines,c=d.length,u=e.width,g=e.data,p=(n-i+1)*o*u*4;let m=-1,f=-1,_=-1,v=-1,b=-1,w=-1,C=t*o;for(let e=i;e<=n;e++){const t=e-i,n=e-h,s=n>=0&&n<c?d[n].dy:-1;if(-1===s){r[t]=!0,C+=o;continue}const a=s*u*4,y=(s+o)*u*4,S=C*u*4,k=(C+o)*u*4;v===a&&w===S?(v=y,w=k):(-1!==_&&(g.set(l.subarray(_,v),b),-1===m&&0===_&&_===b&&(m=v),-1===f&&v===p&&_===b&&(f=_)),_=a,v=y,b=S,w=k),r[t]=!1,C+=o}return-1!==_&&(g.set(l.subarray(_,v),b),-1===m&&0===_&&_===b&&(m=v),-1===f&&v===p&&_===b&&(f=_)),[-1===m?-1:m/(4*u),-1===f?-1:f/(4*u),r]}static _renderLine(e,t,i,n,o,s,r,a,l,h,d,c,u,g,p){const m=u.content,f=u.tokens,_=e.width-s,v=1===p;let b=8,w=0,C=0;for(let u=0,p=f.getCount();u<p;u++){const p=f.getEndOffset(u),y=f.getForeground(u),S=r.getColor(y);for(;w<p;w++){if(b>_)return;const r=m.charCodeAt(w);if(9===r){const e=c-(w+C)%c;C+=e-1,b+=e*s}else if(32===r)b+=s;else{const c=Ede(r)?2:1;for(let u=0;u<c;u++)if(2===o?l.blockRenderChar(e,b,h+d,S,a,t,i,v):l.renderChar(e,b,h+d,r,S,a,t,i,g,n,v),b+=s,b>_)return}}}}}class yEe{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let e=0,t=this._endLineNumber-this._startLineNumber+1;e<t;e++)this._values[e]=i}has(e){return this.get(e)!==this._defaultValue}set(e,t){e<this._startLineNumber||e>this._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return e<this._startLineNumber||e>this._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}var SEe=i(5691),kEe={};kEe.styleTagTransform=Vr(),kEe.setAttributes=Pr(),kEe.insert=Rr().bind(null,"head"),kEe.domAPI=Tr(),kEe.insertStyleElement=Br(),Ir()(SEe.Z,kEe),SEe.Z&&SEe.Z.locals&&SEe.Z.locals;class LEe extends VSe{constructor(e){super(e);const t=this._context.configuration.options.get(138);this._widgets={},this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,this._domNode=ice(document.createElement("div")),zSe.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options.get(138);return this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,!0}addWidget(e){const t=ice(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference!==t&&(i.preference=t,this.setShouldRender(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.parentNode.removeChild(e),this.setShouldRender()}}_renderWidget(e){const t=e.domNode;if(null!==e.preference)if(0===e.preference)t.setTop(0),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth);else if(1===e.preference){const e=t.domNode.clientHeight;t.setTop(this._editorHeight-e-2*this._horizontalScrollbarHeight),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth)}else 2===e.preference&&(t.setTop(0),t.domNode.style.right="50%");else t.setTop("")}prepareRender(e){}render(e){this._domNode.setWidth(this._editorWidth);const t=Object.keys(this._widgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];this._renderWidget(this._widgets[i])}}}class xEe{constructor(e,t){const i=e.options;this.lineHeight=i.get(63),this.pixelRatio=i.get(136),this.overviewRulerLanes=i.get(79),this.renderBorder=i.get(78);const n=t.getColor(NLe);this.borderColor=n?n.toString():null,this.hideCursor=i.get(56);const o=t.getColor(CLe);this.cursorColor=o?o.transparent(.7).toString():null,this.themeType=t.type;const s=i.get(69),r=s.enabled,a=s.side,l=t.getColor(ILe),h=ehe.getDefaultBackground();this.backgroundColor=l||(r&&"right"===a?h:null);const d=i.get(138).overviewRuler;this.top=d.top,this.right=d.right,this.domWidth=d.width,this.domHeight=d.height,0===this.overviewRulerLanes?(this.canvasWidth=0,this.canvasHeight=0):(this.canvasWidth=this.domWidth*this.pixelRatio|0,this.canvasHeight=this.domHeight*this.pixelRatio|0);const[c,u]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=c,this.w=u}_initLanes(e,t,i){const n=t-e;if(i>=3){const t=Math.floor(n/3),i=Math.floor(n/3),o=n-t-i,s=e+t;return[[0,e,s,e,e+t+o,e,s,e],[0,t,o,t+o,i,t+o+i,o+i,t+o+i]]}if(2===i){const t=Math.floor(n/2),i=n-t;return[[0,e,e,e,e+t,e,e,e],[0,t,t,t,i,t+i,t+i,t+i]]}return[[0,e,e,e,e,e,e,e],[0,n,n,n,n,n,n,n]]}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&Owe.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class DEe extends VSe{constructor(e){super(e),this._domNode=ice(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=ehe.onDidChange((e=>{e.changedColorMap&&this._updateSettings(!0)})),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new xEe(this._context.configuration,this._context.theme);return!(this._settings&&this._settings.equals(t)||(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),0))}onConfigurationChanged(e){return this._updateSettings(!1)}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t<i;t++)this._cursorPositions[t]=e.selections[t].getPosition();return this._cursorPositions.sort(Rle.compare),!0}onDecorationsChanged(e){return!!e.affectsOverviewRuler}onFlushed(e){return!0}onScrollChanged(e){return e.scrollHeightChanged}onZonesChanged(e){return!0}onThemeChanged(e){return this._updateSettings(!1)}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render()}_render(){const e=this._settings.backgroundColor;if(0===this._settings.overviewRulerLanes)return this._domNode.setBackgroundColor(e?Owe.Format.CSS.formatHexA(e):""),void this._domNode.setDisplay("none");this._domNode.setDisplay("block");const t=this._settings.canvasWidth,i=this._settings.canvasHeight,n=this._settings.lineHeight,o=this._context.viewLayout,s=i/this._context.viewLayout.getScrollHeight(),r=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme),a=6*this._settings.pixelRatio|0,l=a/2|0,h=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(h.fillStyle=Owe.Format.CSS.formatHexA(e),h.fillRect(0,0,t,i)):(h.clearRect(0,0,t,i),h.fillStyle=Owe.Format.CSS.formatHexA(e),h.fillRect(0,0,t,i)):h.clearRect(0,0,t,i);const d=this._settings.x,c=this._settings.w;r.sort(Ffe.cmp);for(const e of r){const t=e.color,r=e.data;h.fillStyle=t;let u=0,g=0,p=0;for(let e=0,t=r.length/3;e<t;e++){const t=r[3*e],m=r[3*e+1],f=r[3*e+2];let _=o.getVerticalOffsetForLineNumber(m)*s|0,v=(o.getVerticalOffsetForLineNumber(f)+n)*s|0;if(v-_<a){let e=(_+v)/2|0;e<l?e=l:e+l>i&&(e=i-l),_=e-l,v=e+l}_>p+1||t!==u?(0!==e&&h.fillRect(d[u],g,c[u],p-g),u=t,g=_,p=v):v>p&&(p=v)}h.fillRect(d[u],g,c[u],p-g)}if(!this._settings.hideCursor&&this._settings.cursorColor){const e=2*this._settings.pixelRatio|0,t=e/2|0,n=this._settings.x[7],r=this._settings.w[7];h.fillStyle=this._settings.cursorColor;let a=-100,l=-100;for(let d=0,c=this._cursorPositions.length;d<c;d++){const c=this._cursorPositions[d];let u=o.getVerticalOffsetForLineNumber(c.lineNumber)*s|0;u<t?u=t:u+t>i&&(u=i-t);const g=u-t,p=g+e;g>l+1?(0!==d&&h.fillRect(n,a,r,l-a),a=g,l=p):p>l&&(l=p)}h.fillRect(n,a,r,l-a)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(h.beginPath(),h.lineWidth=1,h.strokeStyle=this._settings.borderColor,h.moveTo(0,0),h.lineTo(0,i),h.stroke(),h.moveTo(0,0),h.lineTo(t,0),h.stroke())}}class EEe{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=0|e,this.to=0|t,this.colorId=0|i}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class NEe{constructor(e,t,i,n){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=n,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.color<t.color?-1:1}setColorZone(e){this._colorZone=e}getColorZones(){return this._colorZone}}class IEe{constructor(e){this._getVerticalOffsetForLine=e,this._zones=[],this._colorZonesInvalid=!1,this._lineHeight=0,this._domWidth=0,this._domHeight=0,this._outerHeight=0,this._pixelRatio=1,this._lastAssignedId=0,this._color2Id=Object.create(null),this._id2Color=[]}getId2Color(){return this._id2Color}setZones(e){this._zones=e,this._zones.sort(NEe.compare)}setLineHeight(e){return this._lineHeight!==e&&(this._lineHeight=e,this._colorZonesInvalid=!0,!0)}setPixelRatio(e){this._pixelRatio=e,this._colorZonesInvalid=!0}getDOMWidth(){return this._domWidth}getCanvasWidth(){return this._domWidth*this._pixelRatio}setDOMWidth(e){return this._domWidth!==e&&(this._domWidth=e,this._colorZonesInvalid=!0,!0)}getDOMHeight(){return this._domHeight}getCanvasHeight(){return this._domHeight*this._pixelRatio}setDOMHeight(e){return this._domHeight!==e&&(this._domHeight=e,this._colorZonesInvalid=!0,!0)}getOuterHeight(){return this._outerHeight}setOuterHeight(e){return this._outerHeight!==e&&(this._outerHeight=e,this._colorZonesInvalid=!0,!0)}resolveColorZones(){const e=this._colorZonesInvalid,t=Math.floor(this._lineHeight),i=Math.floor(this.getCanvasHeight()),n=i/Math.floor(this._outerHeight),o=Math.floor(4*this._pixelRatio/2),s=[];for(let r=0,a=this._zones.length;r<a;r++){const a=this._zones[r];if(!e){const e=a.getColorZones();if(e){s.push(e);continue}}const l=this._getVerticalOffsetForLine(a.startLineNumber),h=0===a.heightInLines?this._getVerticalOffsetForLine(a.endLineNumber)+t:l+a.heightInLines*t,d=Math.floor(n*l),c=Math.floor(n*h);let u=Math.floor((d+c)/2),g=c-u;g<o&&(g=o),u-g<0&&(u=g),u+g>i&&(u=i-g);const p=a.color;let m=this._color2Id[p];m||(m=++this._lastAssignedId,this._color2Id[p]=m,this._id2Color[m]=p);const f=new EEe(u-g,u+g,m);a.setColorZone(f),s.push(f)}return this._colorZonesInvalid=!1,s.sort(EEe.compare),s}}class MEe extends WSe{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=ice(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new IEe((e=>this._context.viewLayout.getVerticalOffsetForLineNumber(e))),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(63)),this._zoneManager.setPixelRatio(i.get(136)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(63)&&(this._zoneManager.setLineHeight(t.get(63)),this._render()),e.hasChanged(136)&&(this._zoneManager.setPixelRatio(t.get(136)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(0===this._zoneManager.getOuterHeight())return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),n=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,n,e),!0}_renderOneLane(e,t,i,n){let o=0,s=0,r=0;for(const a of t){const t=a.colorId,l=a.from,h=a.to;t!==o?(e.fillRect(0,s,n,r-s),o=t,e.fillStyle=i[o],s=l,r=h):r>=l?r=Math.max(r,h):(e.fillRect(0,s,n,r-s),s=l,r=h)}e.fillRect(0,s,n,r-s)}}var TEe=i(1941),AEe={};AEe.styleTagTransform=Vr(),AEe.setAttributes=Pr(),AEe.insert=Rr().bind(null,"head"),AEe.domAPI=Tr(),AEe.insertStyleElement=Br(),Ir()(TEe.Z,AEe),TEe.Z&&TEe.Z.locals&&TEe.Z.locals;class REe extends VSe{constructor(e){super(e),this.domNode=ice(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(96),this._typicalHalfwidthCharacterWidth=t.get(47).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(96),this._typicalHalfwidthCharacterWidth=t.get(47).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e<t){const{tabSize:i}=this._context.viewModel.model.getOptions(),n=i;let o=t-e;for(;o>0;){const e=ice(document.createElement("div"));e.setClassName("view-ruler"),e.setWidth(n),this.domNode.appendChild(e),this._renderedRulers.push(e),o--}return}let i=e-t;for(;i>0;){const e=this._renderedRulers.pop();this.domNode.removeChild(e),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t<i;t++){const i=this._renderedRulers[t],n=this._rulers[t];i.setBoxShadow(n.color?`1px 0 0 0 ${n.color} inset`:""),i.setHeight(Math.min(e.scrollHeight,1e6)),i.setLeft(n.column*this._typicalHalfwidthCharacterWidth)}}}var OEe=i(6650),PEe={};PEe.styleTagTransform=Vr(),PEe.setAttributes=Pr(),PEe.insert=Rr().bind(null,"head"),PEe.domAPI=Tr(),PEe.insertStyleElement=Br(),Ir()(OEe.Z,PEe),OEe.Z&&OEe.Z.locals&&OEe.Z.locals;class FEe extends VSe{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const t=this._context.configuration.options.get(97);this._useShadows=t.useShadows,this._domNode=ice(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true")}dispose(){super.dispose()}_updateShouldShow(){const e=this._useShadows&&this._scrollTop>0;return this._shouldShow!==e&&(this._shouldShow=e,!0)}getDomNode(){return this._domNode}_updateWidth(){const e=this._context.configuration.options.get(138);0===e.minimap.renderMinimap||e.minimap.minimapWidth>0&&0===e.minimap.minimapLeft?this._width=e.width:this._width=e.width-e.verticalScrollbarWidth}onConfigurationChanged(e){const t=this._context.configuration.options.get(97);return this._useShadows=t.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}var BEe=i(8588),WEe={};WEe.styleTagTransform=Vr(),WEe.setAttributes=Pr(),WEe.insert=Rr().bind(null,"head"),WEe.domAPI=Tr(),WEe.insertStyleElement=Br(),Ir()(BEe.Z,WEe),BEe.Z&&BEe.Z.locals&&BEe.Z.locals;class VEe{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class zEe{constructor(e,t){this.lineNumber=e,this.ranges=t}}function HEe(e){return new VEe(e)}function UEe(e){return new zEe(e.lineNumber,e.ranges.map(HEe))}class KEe extends cLe{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(63),this._roundedSelection=t.get(95),this._typicalHalfwidthCharacterWidth=t.get(47).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(63),this._roundedSelection=t.get(95),this._typicalHalfwidthCharacterWidth=t.get(47).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t<i;t++)if(e[t].ranges.length>1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const n=this._typicalHalfwidthCharacterWidth/4;let o=null,s=null;if(i&&i.length>0&&t.length>0){const n=t[0].lineNumber;if(n===e.startLineNumber)for(let e=0;!o&&e<i.length;e++)i[e].lineNumber===n&&(o=i[e].ranges[0]);const r=t[t.length-1].lineNumber;if(r===e.endLineNumber)for(let e=i.length-1;!s&&e>=0;e--)i[e].lineNumber===r&&(s=i[e].ranges[0]);o&&!o.startStyle&&(o=null),s&&!s.startStyle&&(s=null)}for(let e=0,i=t.length;e<i;e++){const r=t[e].ranges[0],a=r.left,l=r.left+r.width,h={top:0,bottom:0},d={top:0,bottom:0};if(e>0){const i=t[e-1].ranges[0].left,o=t[e-1].ranges[0].left+t[e-1].ranges[0].width;jEe(a-i)<n?h.top=2:a>i&&(h.top=1),jEe(l-o)<n?d.top=2:i<l&&l<o&&(d.top=1)}else o&&(h.top=o.startStyle.top,d.top=o.endStyle.top);if(e+1<i){const i=t[e+1].ranges[0].left,o=t[e+1].ranges[0].left+t[e+1].ranges[0].width;jEe(a-i)<n?h.bottom=2:i<a&&a<o&&(h.bottom=1),jEe(l-o)<n?d.bottom=2:l<o&&(d.bottom=1)}else s&&(h.bottom=s.startStyle.bottom,d.bottom=s.endStyle.bottom);r.startStyle=h,r.endStyle=d}}_getVisibleRangesWithStyle(e,t,i){const n=(t.linesVisibleRangesForRange(e,!0)||[]).map(UEe);return!this._visibleRangesHaveGaps(n)&&this._roundedSelection&&this._enrichVisibleRangesWithStyle(t.visibleRange,n,i),n}_createSelectionPiece(e,t,i,n,o){return'<div class="cslr '+i+'" style="top:'+e.toString()+"px;left:"+n.toString()+"px;width:"+o.toString()+"px;height:"+t+'px;"></div>'}_actualRenderOneSelection(e,t,i,n){if(0===n.length)return;const o=!!n[0].ranges[0].startStyle,s=this._lineHeight.toString(),r=(this._lineHeight-1).toString(),a=n[0].lineNumber,l=n[n.length-1].lineNumber;for(let h=0,d=n.length;h<d;h++){const d=n[h],c=d.lineNumber,u=c-t,g=!i||c!==l&&c!==a?s:r,p=i&&c===a?1:0;let m="",f="";for(let e=0,t=d.ranges.length;e<t;e++){const t=d.ranges[e];if(o){const e=t.startStyle,i=t.endStyle;if(1===e.top||1===e.bottom){m+=this._createSelectionPiece(p,g,KEe.SELECTION_CLASS_NAME,t.left-KEe.ROUNDED_PIECE_WIDTH,KEe.ROUNDED_PIECE_WIDTH);let i=KEe.EDITOR_BACKGROUND_CLASS_NAME;1===e.top&&(i+=" "+KEe.SELECTION_TOP_RIGHT),1===e.bottom&&(i+=" "+KEe.SELECTION_BOTTOM_RIGHT),m+=this._createSelectionPiece(p,g,i,t.left-KEe.ROUNDED_PIECE_WIDTH,KEe.ROUNDED_PIECE_WIDTH)}if(1===i.top||1===i.bottom){m+=this._createSelectionPiece(p,g,KEe.SELECTION_CLASS_NAME,t.left+t.width,KEe.ROUNDED_PIECE_WIDTH);let e=KEe.EDITOR_BACKGROUND_CLASS_NAME;1===i.top&&(e+=" "+KEe.SELECTION_TOP_LEFT),1===i.bottom&&(e+=" "+KEe.SELECTION_BOTTOM_LEFT),m+=this._createSelectionPiece(p,g,e,t.left+t.width,KEe.ROUNDED_PIECE_WIDTH)}}let i=KEe.SELECTION_CLASS_NAME;if(o){const e=t.startStyle,n=t.endStyle;0===e.top&&(i+=" "+KEe.SELECTION_TOP_LEFT),0===e.bottom&&(i+=" "+KEe.SELECTION_BOTTOM_LEFT),0===n.top&&(i+=" "+KEe.SELECTION_TOP_RIGHT),0===n.bottom&&(i+=" "+KEe.SELECTION_BOTTOM_RIGHT)}f+=this._createSelectionPiece(p,g,i,t.left,t.width)}e[u][0]+=m,e[u][1]+=f}}prepareRender(e){const t=[],i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber;for(let e=i;e<=n;e++)t[e-i]=["",""];const o=[];for(let n=0,s=this._selections.length;n<s;n++){const s=this._selections[n];if(s.isEmpty()){o[n]=null;continue}const r=this._getVisibleRangesWithStyle(s,e,this._previousFrameVisibleRangesWithStyle[n]);o[n]=r,this._actualRenderOneSelection(t,i,this._selections.length>1,r)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map((([e,t])=>e+t))}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function jEe(e){return e<0?-e:e}KEe.SELECTION_CLASS_NAME="selected-text",KEe.SELECTION_TOP_LEFT="top-left-radius",KEe.SELECTION_BOTTOM_LEFT="bottom-left-radius",KEe.SELECTION_TOP_RIGHT="top-right-radius",KEe.SELECTION_BOTTOM_RIGHT="bottom-right-radius",KEe.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",KEe.ROUNDED_PIECE_WIDTH=10,_Le(((e,t)=>{const i=e.getColor(YCe);i&&!i.isTransparent()&&t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${i}; }`)}));var qEe=i(1276),$Ee={};$Ee.styleTagTransform=Vr(),$Ee.setAttributes=Pr(),$Ee.insert=Rr().bind(null,"head"),$Ee.domAPI=Tr(),$Ee.insertStyleElement=Br(),Ir()(qEe.Z,$Ee),qEe.Z&&qEe.Z.locals&&qEe.Z.locals;class GEe{constructor(e,t,i,n,o,s,r){this.top=e,this.left=t,this.paddingLeft=i,this.width=n,this.height=o,this.textContent=s,this.textContentClassName=r}}class ZEe{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(47);this._cursorStyle=t.get(25),this._lineHeight=t.get(63),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(28),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=ice(document.createElement("div")),this._domNode.setClassName(`cursor ${axe}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),nce(this._domNode,i),this._domNode.setDisplay("none"),this._position=new Rle(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(47);return this._cursorStyle=t.get(25),this._lineHeight=t.get(63),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(28),this._typicalHalfwidthCharacterWidth),nce(this._domNode,i),!0}onCursorPositionChanged(e,t){return this._domNode.domNode.style.transitionProperty=t?"none":"",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[n,o]=function(e,t){t>0&&mde(e.charCodeAt(t))&&t--;const i=t+wde(e,t);return[i-Cde(e,i),i]}(i,t-1);return[new Rle(e,n+1),i.substring(n,o)]}_prepareRender(e){let t="",i="";const[n,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===Dre.Line||this._cursorStyle===Dre.LineThin){const s=e.visibleRangeForPosition(n);if(!s||s.outsideRenderedLine)return null;let r;this._cursorStyle===Dre.Line?(r=lbe(this._lineCursorWidth>0?this._lineCursorWidth:2),r>2&&(t=o,i=this._getTokenClassName(n))):r=lbe(1);let a=s.left,l=0;r>=2&&a>=1&&(l=1,a-=l);const h=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta;return new GEe(h,a,l,r,this._lineHeight,t,i)}const s=e.linesVisibleRangesForRange(new Ole(n.lineNumber,n.column,n.lineNumber,n.column+o.length),!1);if(!s||0===s.length)return null;const r=s[0];if(r.outsideRenderedLine||0===r.ranges.length)return null;const a=r.ranges[0],l="\t"===o||a.width<1?this._typicalHalfwidthCharacterWidth:a.width;this._cursorStyle===Dre.Block&&(t=o,i=this._getTokenClassName(n));let h=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta,d=this._lineHeight;return this._cursorStyle!==Dre.Underline&&this._cursorStyle!==Dre.UnderlineThin||(h+=this._lineHeight-2,d=2),new GEe(h,a.left,0,l,d,t,i)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${axe} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class YEe extends VSe{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(86),this._cursorBlinking=t.get(23),this._cursorStyle=t.get(25),this._cursorSmoothCaretAnimation=t.get(24),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new ZEe(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=ice(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new ape,this._cursorFlatBlinkInterval=new lpe,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(86),this._cursorBlinking=t.get(23),this._cursorStyle=t.get(25),this._cursorSmoothCaretAnimation=t.get(24),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let t=0,i=this._secondaryCursors.length;t<i;t++)this._secondaryCursors[t].onConfigurationChanged(e);return!0}_onCursorPositionChanged(e,t,i){const n=this._secondaryCursors.length!==t.length||"explicit"===this._cursorSmoothCaretAnimation&&3!==i;if(this._primaryCursor.onCursorPositionChanged(e,n),this._updateBlinking(),this._secondaryCursors.length<t.length){const e=t.length-this._secondaryCursors.length;for(let t=0;t<e;t++){const e=new ZEe(this._context);this._domNode.domNode.insertBefore(e.getDomNode().domNode,this._primaryCursor.getDomNode().domNode.nextSibling),this._secondaryCursors.push(e)}}else if(this._secondaryCursors.length>t.length){const e=this._secondaryCursors.length-t.length;for(let t=0;t<e;t++)this._domNode.removeChild(this._secondaryCursors[0].getDomNode()),this._secondaryCursors.splice(0,1)}for(let e=0;e<t.length;e++)this._secondaryCursors[e].onCursorPositionChanged(t[e],n)}onCursorStateChanged(e){const t=[];for(let i=0,n=e.selections.length;i<n;i++)t[i]=e.selections[i].getPosition();this._onCursorPositionChanged(t[0],t.slice(1),e.reason);const i=e.selections[0].isEmpty();return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,this._updateDomClassName()),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onFocusChanged(e){return this._editorHasFocus=e.isFocused,this._updateBlinking(),!1}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onTokensChanged(e){const t=t=>{for(let i=0,n=e.ranges.length;i<n;i++)if(e.ranges[i].fromLineNumber<=t.lineNumber&&t.lineNumber<=e.ranges[i].toLineNumber)return!0;return!1};if(t(this._primaryCursor.getPosition()))return!0;for(const e of this._secondaryCursors)if(t(e.getPosition()))return!0;return!1}onZonesChanged(e){return!0}_getCursorBlinking(){return this._isComposingInput?0:this._editorHasFocus?this._readOnly?5:this._cursorBlinking:0}_updateBlinking(){this._startCursorBlinkAnimation.cancel(),this._cursorFlatBlinkInterval.cancel();const e=this._getCursorBlinking(),t=0===e,i=5===e;t?this._hide():this._show(),this._blinkingEnabled=!1,this._updateDomClassName(),t||i||(1===e?this._cursorFlatBlinkInterval.cancelAndSet((()=>{this._isVisible?this._hide():this._show()}),YEe.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet((()=>{this._blinkingEnabled=!0,this._updateDomClassName()}),YEe.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case Dre.Line:e+=" cursor-line-style";break;case Dre.Block:e+=" cursor-block-style";break;case Dre.Underline:e+=" cursor-underline-style";break;case Dre.LineThin:e+=" cursor-line-thin-style";break;case Dre.BlockOutline:e+=" cursor-block-outline-style";break;case Dre.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return"on"!==this._cursorSmoothCaretAnimation&&"explicit"!==this._cursorSmoothCaretAnimation||(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].show();this._isVisible=!0}_hide(){this._primaryCursor.hide();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].hide();this._isVisible=!1}prepareRender(e){this._primaryCursor.prepareRender(e);for(let t=0,i=this._secondaryCursors.length;t<i;t++)this._secondaryCursors[t].prepareRender(e)}render(e){const t=[];let i=0;const n=this._primaryCursor.render(e);n&&(t[i++]=n);for(let n=0,o=this._secondaryCursors.length;n<o;n++){const o=this._secondaryCursors[n].render(e);o&&(t[i++]=o)}this._renderData=t}getLastRenderData(){return this._renderData}}YEe.BLINK_INTERVAL=500,_Le(((e,t)=>{const i=e.getColor(CLe);if(i){let n=e.getColor(yLe);n||(n=i.opposite()),t.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${i}; border-color: ${i}; color: ${n}; }`),QSe(e.type)&&t.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${n}; border-right: 1px solid ${n}; }`)}}));const QEe=()=>{throw new Error("Invalid change accessor")};class XEe extends VSe{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(138);this._lineHeight=t.get(63),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=ice(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=ice(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const i of e)t.set(i.id,i);let i=!1;return this._context.viewModel.changeWhitespace((e=>{const n=Object.keys(this._zones);for(let o=0,s=n.length;o<s;o++){const s=n[o],r=this._zones[s],a=this._computeWhitespaceProps(r.delegate);r.isInHiddenArea=a.isInHiddenArea;const l=t.get(s);!l||l.afterLineNumber===a.afterViewLineNumber&&l.height===a.heightInPx||(e.changeOneWhitespace(s,a.afterViewLineNumber,a.heightInPx),this._safeCallOnComputedHeight(r.delegate,a.heightInPx),i=!0)}})),i}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(138);return this._lineHeight=t.get(63),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,e.hasChanged(63)&&this._recomputeWhitespacesProps(),!0}onLineMappingChanged(e){return this._recomputeWhitespacesProps()}onLinesDeleted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}onLinesInserted(e){return!0}_getZoneOrdinal(e){return void 0!==e.afterColumn?e.afterColumn:1e4}_computeWhitespaceProps(e){if(0===e.afterLineNumber)return{isInHiddenArea:!1,afterViewLineNumber:0,heightInPx:this._heightInPixels(e),minWidthInPx:this._minWidthInPixels(e)};let t,i;if(void 0!==e.afterColumn)t=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:e.afterColumn});else{const i=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:1}).lineNumber;t=new Rle(i,this._context.viewModel.model.getLineMaxColumn(i))}i=t.column===this._context.viewModel.model.getLineMaxColumn(t.lineNumber)?this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber+1,column:1}):this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber,column:t.column+1});const n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t,e.afterColumnAffinity),o=this._context.viewModel.coordinatesConverter.modelPositionIsVisible(i);return{isInHiddenArea:!o,afterViewLineNumber:n.lineNumber,heightInPx:o?this._heightInPixels(e):0,minWidthInPx:this._minWidthInPixels(e)}}changeViewZones(e){let t=!1;return this._context.viewModel.changeWhitespace((i=>{const n={addZone:e=>(t=!0,this._addZone(i,e)),removeZone:e=>{e&&(t=this._removeZone(i,e)||t)},layoutZone:e=>{e&&(t=this._layoutZone(i,e)||t)}};!function(e,t){try{return e(t)}catch(e){zre(e)}}(e,n),n.addZone=QEe,n.removeZone=QEe,n.layoutZone=QEe})),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),n={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:ice(t.domNode),marginDomNode:t.marginDomNode?ice(t.marginDomNode):null};return this._safeCallOnComputedHeight(n.delegate,i.heightInPx),n.domNode.setPosition("absolute"),n.domNode.domNode.style.width="100%",n.domNode.setDisplay("none"),n.domNode.setAttribute("monaco-view-zone",n.whitespaceId),this.domNode.appendChild(n.domNode),n.marginDomNode&&(n.marginDomNode.setPosition("absolute"),n.marginDomNode.domNode.style.width="100%",n.marginDomNode.setDisplay("none"),n.marginDomNode.setAttribute("monaco-view-zone",n.whitespaceId),this.marginDomNode.appendChild(n.marginDomNode)),this._zones[n.whitespaceId]=n,this.setShouldRender(),n.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],n=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=n.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,n.afterViewLineNumber,n.heightInPx),this._safeCallOnComputedHeight(i.delegate,n.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){if(this._zones.hasOwnProperty(e)){const t=this._zones[e];return Boolean(t.delegate.suppressMouseDown)}return!1}_heightInPixels(e){return"number"==typeof e.heightInPx?e.heightInPx:"number"==typeof e.heightInLines?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return"number"==typeof e.minWidthInPx?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if("function"==typeof e.onComputedHeight)try{e.onComputedHeight(t)}catch(e){zre(e)}}_safeCallOnDomNodeTop(e,t){if("function"==typeof e.onDomNodeTop)try{e.onDomNodeTop(t)}catch(e){zre(e)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(const e of t)this._zones[e.id].isInHiddenArea||(i[e.id]=e,n=!0);const o=Object.keys(this._zones);for(let t=0,n=o.length;t<n;t++){const n=o[t],s=this._zones[n];let r=0,a=0,l="none";i.hasOwnProperty(n)?(r=i[n].verticalOffset-e.bigNumbersDelta,a=i[n].height,l="block",s.isVisible||(s.domNode.setAttribute("monaco-visible-view-zone","true"),s.isVisible=!0),this._safeCallOnDomNodeTop(s.delegate,e.getScrolledTopFromAbsoluteTop(i[n].verticalOffset))):(s.isVisible&&(s.domNode.removeAttribute("monaco-visible-view-zone"),s.isVisible=!1),this._safeCallOnDomNodeTop(s.delegate,e.getScrolledTopFromAbsoluteTop(-1e6))),s.domNode.setTop(r),s.domNode.setHeight(a),s.domNode.setDisplay(l),s.marginDomNode&&(s.marginDomNode.setTop(r),s.marginDomNode.setHeight(a),s.marginDomNode.setDisplay(l))}n&&(this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth)),this.marginDomNode.setWidth(this._contentLeft))}}class JEe{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class eNe{constructor(e,t,i){this.configuration=e,this.theme=new JEe(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}class tNe{constructor(e,t,i,n){this.selections=e,this.startLineNumber=0|t.startLineNumber,this.endLineNumber=0|t.endLineNumber,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=0|t.bigNumbersDelta,this.whitespaceViewportData=i,this._model=n,this.visibleRange=new Ole(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}var iNe=i(2246),nNe={};nNe.styleTagTransform=Vr(),nNe.setAttributes=Pr(),nNe.insert=Rr().bind(null,"head"),nNe.domAPI=Tr(),nNe.insertStyleElement=Br(),Ir()(iNe.Z,nNe),iNe.Z&&iNe.Z.locals&&iNe.Z.locals;class oNe extends VSe{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.domNode=ice(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1;const t=this._context.configuration.options.get(138),i=t.contentWidth-t.verticalScrollbarWidth;return this.contentWidth!==i&&(this.contentWidth=i,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){let t=0;const i=e.getDecorationsInViewport();for(const n of i){if(!n.options.blockClassName)continue;let i,o,s=this.blocks[t];s||(s=this.blocks[t]=ice(document.createElement("div")),this.domNode.appendChild(s)),n.options.blockIsAfterEnd?(i=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!1),o=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!0)):(i=e.getVerticalOffsetForLineNumber(n.range.startLineNumber,!0),o=n.range.isEmpty()?e.getVerticalOffsetForLineNumber(n.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!0)),s.setClassName("blockDecorations-block "+n.options.blockClassName),s.setLeft(e.scrollLeft),s.setWidth(this.contentWidth),s.setTop(i),s.setHeight(o-i),t++}for(let e=t;e<this.blocks.length;e++)this.blocks[e].domNode.remove();this.blocks.length=t}}var sNe=i(4638),rNe={};rNe.styleTagTransform=Vr(),rNe.setAttributes=Pr(),rNe.insert=Rr().bind(null,"head"),rNe.domAPI=Tr(),rNe.insertStyleElement=Br(),Ir()(sNe.Z,rNe),sNe.Z&&sNe.Z.locals&&sNe.Z.locals;class aNe extends cLe{constructor(e){super(),this._context=e,this._options=new lNe(this._context.configuration),this._selection=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=new lNe(this._context.configuration);return this._options.equals(t)?e.hasChanged(138):(this._options=t,!0)}onCursorStateChanged(e){return this._selection=e.selections,"selection"===this._options.renderWhitespace}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}prepareRender(e){if("none"===this._options.renderWhitespace)return void(this._renderResult=null);const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber-t+1,n=new Array(i);for(let e=0;e<i;e++)n[e]=!0;const o=this._context.viewModel.getMinimapLinesRenderingData(e.viewportData.startLineNumber,e.viewportData.endLineNumber,n);this._renderResult=[];for(let t=e.viewportData.startLineNumber;t<=e.viewportData.endLineNumber;t++){const i=t-e.viewportData.startLineNumber,n=o.data[i];let s=null;if("selection"===this._options.renderWhitespace){const e=this._selection;for(const i of e){if(i.endLineNumber<t||i.startLineNumber>t)continue;const e=i.startLineNumber===t?i.startColumn:n.minColumn,o=i.endLineNumber===t?i.endColumn:n.maxColumn;e<o&&(s||(s=[]),s.push(new wfe(e-1,o-1)))}}this._renderResult[i]=this._applyRenderWhitespace(e,t,s,n)}}_applyRenderWhitespace(e,t,i,n){if("selection"===this._options.renderWhitespace&&!i)return"";if("trailing"===this._options.renderWhitespace&&n.continuesWithWrappedLine)return"";const o=this._context.theme.getColor(SLe),s=this._options.renderWithSVG,r=n.content,a=-1===this._options.stopRenderingLineAfter?r.length:Math.min(this._options.stopRenderingLineAfter,r.length),l=n.continuesWithWrappedLine,h=n.minColumn-1,d="boundary"===this._options.renderWhitespace,c="trailing"===this._options.renderWhitespace,u=this._options.lineHeight,g=this._options.middotWidth,p=this._options.wsmiddotWidth,m=this._options.spaceWidth,f=Math.abs(p-m)<Math.abs(g-m)?11825:183,_=this._options.canUseHalfwidthRightwardsArrow;let v,b="",w=!1,C=ede(r);-1===C?(w=!0,C=a,v=a):v=ide(r);let y=0,S=i&&i[y],k=0;for(let n=h;n<a;n++){const o=r.charCodeAt(n);if(S&&n>=S.endOffset&&(y++,S=i&&i[y]),9!==o&&32!==o)continue;if(c&&!w&&n<=v)continue;if(d&&n>=C&&n<=v&&32===o){const e=n-1>=0?r.charCodeAt(n-1):0,t=n+1<a?r.charCodeAt(n+1):0;if(32!==e&&32!==t)continue}if(d&&l&&n===a-1){const e=n-1>=0?r.charCodeAt(n-1):0;if(32===o&&32!==e&&9!==e)continue}if(i&&(!S||S.startOffset>n||S.endOffset<=n))continue;const h=e.visibleRangeForPosition(new Rle(t,n+1));h&&(s?(k=Math.max(k,h.left),b+=9===o?this._renderArrow(u,m,h.left):`<circle cx="${(h.left+m/2).toFixed(2)}" cy="${(u/2).toFixed(2)}" r="${(m/7).toFixed(2)}" />`):b+=9===o?`<div class="mwh" style="left:${h.left}px;height:${u}px;">${_?String.fromCharCode(65515):String.fromCharCode(8594)}</div>`:`<div class="mwh" style="left:${h.left}px;height:${u}px;">${String.fromCharCode(f)}</div>`)}return s?(k=Math.round(k+m),`<svg style="position:absolute;width:${k}px;height:${u}px" viewBox="0 0 ${k} ${u}" xmlns="http://www.w3.org/2000/svg" fill="${o}">`+b+"</svg>"):b}_renderArrow(e,t,i){const n=e/2,o=i,s={x:0,y:t/7/2},r={x:.8*t,y:s.y},a={x:r.x-.2*r.x,y:r.y+.2*r.x},l={x:a.x+.1*r.x,y:a.y+.1*r.x},h={x:l.x+.35*r.x,y:l.y-.35*r.x};return`<path d="M ${[s,r,a,l,h,{x:h.x,y:-h.y},{x:l.x,y:-l.y},{x:a.x,y:-a.y},{x:r.x,y:-r.y},{x:s.x,y:-s.y}].map((e=>`${(o+e.x).toFixed(2)} ${(n+e.y).toFixed(2)}`)).join(" L ")}" />`}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class lNe{constructor(e){const t=e.options,i=t.get(47),n=t.get(35);"off"===n?(this.renderWhitespace="none",this.renderWithSVG=!1):"svg"===n?(this.renderWhitespace=t.get(93),this.renderWithSVG=!0):(this.renderWhitespace=t.get(93),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(63),this.stopRenderingLineAfter=t.get(111)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}class hNe extends WSe{constructor(e,t,i,n,o,s){super(),this._selections=[new Ple(1,1,1,1)],this._renderAnimationFrame=null;const r=new aDe(t,n,o,e);this._context=new eNe(t,i,n),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=new cxe(this._context,r,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=ice(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=ice(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=ice(document.createElement("div")),zSe.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new IDe(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new QDe(this._context,this._linesContent),this._viewZones=new XEe(this._context),this._viewParts.push(this._viewZones);const a=new DEe(this._context);this._viewParts.push(a);const l=new FEe(this._context);this._viewParts.push(l);const h=new pDe(this._context);this._viewParts.push(h),h.addDynamicOverlay(new LDe(this._context)),h.addDynamicOverlay(new KEe(this._context)),h.addDynamicOverlay(new KDe(this._context)),h.addDynamicOverlay(new NDe(this._context)),h.addDynamicOverlay(new aNe(this._context));const d=new mDe(this._context);this._viewParts.push(d),d.addDynamicOverlay(new xDe(this._context)),d.addDynamicOverlay(new ODe(this._context)),d.addDynamicOverlay(new nEe(this._context)),d.addDynamicOverlay(new eEe(this._context)),d.addDynamicOverlay(new txe(this._context));const c=new oxe(this._context);c.getDomNode().appendChild(this._viewZones.marginDomNode),c.getDomNode().appendChild(d.getDomNode()),this._viewParts.push(c),this._contentWidgets=new fDe(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new YEe(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new LEe(this._context),this._viewParts.push(this._overlayWidgets);const u=new REe(this._context);this._viewParts.push(u);const g=new oNe(this._context);this._viewParts.push(g);const p=new wEe(this._context);if(this._viewParts.push(p),a){const e=this._scrollbar.getOverviewRulerLayoutInfo();e.parent.insertBefore(a.getDomNode(),e.insertBefore)}this._linesContent.appendChild(h.getDomNode()),this._linesContent.appendChild(u.domNode),this._linesContent.appendChild(g.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(c.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(l.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(p.getDomNode()),this.domNode.appendChild(this._overflowGuardContainer),s?s.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new rLe(this._context,r,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){Oke.onRenderStart(),this._renderNow()}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new gke(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new Rle(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const e=this._context.configuration.options.get(138);this.domNode.setWidth(e.width),this.domNode.setHeight(e.height),this._overflowGuardContainer.setWidth(e.width),this._overflowGuardContainer.setHeight(e.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(135)+" "+pLe(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){null!==this._renderAnimationFrame&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){null===this._renderAnimationFrame&&(this._renderAnimationFrame=Dve(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){!function(e){try{return e()}catch(e){zre(e)}}((()=>this._actualRender()))}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!Sve(this.domNode.domNode))return;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&0===e.length)return;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new tNe(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const n=new USe(this._context.viewLayout,i,this._viewLines);for(const t of e)t.prepareRender(n);for(const t of e)t.render(n),t.onDidRender()}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.tokenizeViewport()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new Rle(n.lineNumber,n.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?lDe.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new MEe(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const e of this._viewParts)e.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){var t,i,n,o,s,r,a,l;this._contentWidgets.setWidgetPosition(e.widget,null!==(i=null===(t=e.position)||void 0===t?void 0:t.position)&&void 0!==i?i:null,null!==(o=null===(n=e.position)||void 0===n?void 0:n.secondaryPosition)&&void 0!==o?o:null,null!==(r=null===(s=e.position)||void 0===s?void 0:s.preference)&&void 0!==r?r:null,null!==(l=null===(a=e.position)||void 0===a?void 0:a.positionAffinity)&&void 0!==l?l:null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}}class dNe{constructor(e,t,i,n,o,s){this.id=e,this.label=t,this.alias=i,this._precondition=n,this._run=o,this._contextKeyService=s}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(){return this.isSupported()?this._run():Promise.resolve(void 0)}}function cNe(e){let t=0,i=0,n=0,o=0;for(let s=0,r=e.length;s<r;s++){const a=e.charCodeAt(s);13===a?(0===t&&(i=s),t++,s+1<r&&10===e.charCodeAt(s+1)?(o|=2,s++):o|=3,n=s+1):10===a&&(o|=1,0===t&&(i=s),t++,n=s+1)}return 0===t&&(i=e.length),[t,i,e.length-n,o]}class uNe{constructor(e,t,i,n){this.range=e,this.nestingLevel=t,this.nestingLevelOfEqualBracketType=i,this.isInvalid=n}}class gNe{constructor(e,t,i,n,o,s){this.range=e,this.openingBracketRange=t,this.closingBracketRange=i,this.nestingLevel=n,this.nestingLevelOfEqualBracketType=o,this.bracketPairNode=s}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}}class pNe extends gNe{constructor(e,t,i,n,o,s,r){super(e,t,i,n,o,s),this.minVisibleColumnIndentation=r}}class mNe{constructor(e,t){this.lineCount=e,this.columnCount=t}toString(){return`${this.lineCount},${this.columnCount}`}}mNe.zero=new mNe(0,0);const fNe=0;function _Ne(e){return 0===e}const vNe=Math.pow(2,26);function bNe(e,t){return e*vNe+t}function wNe(e){const t=e,i=Math.floor(t/vNe);return new mNe(i,t-i*vNe)}function CNe(e,t){let i=e+t;return t>=vNe&&(i-=e%vNe),i}function yNe(e,t){return e.reduce(((e,i)=>CNe(e,t(i))),fNe)}function SNe(e,t){const i=e,n=t;if(n-i<=0)return fNe;const o=Math.floor(i/vNe),s=Math.floor(n/vNe),r=n-s*vNe;return o===s?bNe(0,r-(i-o*vNe)):bNe(s-o,r)}function kNe(e,t){return e<t}function LNe(e,t){return e<=t}function xNe(e,t){return e>=t}function DNe(e){return bNe(e.lineNumber-1,e.column-1)}function ENe(e,t){const i=e,n=Math.floor(i/vNe),o=i-n*vNe,s=t,r=Math.floor(s/vNe);return new Ole(n+1,o+1,r+1,s-r*vNe+1)}class NNe{constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}}class INe{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map((e=>MNe.from(e)))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return null===i?null:SNe(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?bNe(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):bNe(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=wNe(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?bNe(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):bNe(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx<this.edits.length;){const t=this.edits[this.nextEditIdx],i=this.translateOldToCur(t.endOffsetAfterObj);if(!LNe(i,e))break;{this.nextEditIdx++;const e=wNe(i),n=wNe(this.translateOldToCur(t.endOffsetBeforeObj)),o=e.lineCount-n.lineCount;this.deltaOldToNewLineCount+=o;const s=this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0,r=e.columnCount-n.columnCount;this.deltaOldToNewColumnCount=s+r,this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}}}}class MNe{static from(e){return new MNe(e.startOffset,e.endOffset,e.newLength)}constructor(e,t,i){this.endOffsetBeforeObj=wNe(t),this.endOffsetAfterObj=wNe(CNe(e,i)),this.offsetObj=wNe(e)}}const TNe=[];class ANe{static create(e,t){if(e<=128&&0===t.length){let i=ANe.cache[e];return i||(i=new ANe(e,t),ANe.cache[e]=i),i}return new ANe(e,t)}static getEmpty(){return this.empty}constructor(e,t){this.items=e,this.additionalItems=t}add(e,t){const i=t.getKey(e);let n=i>>5;if(0===n){const e=1<<i|this.items;return e===this.items?this:ANe.create(e,this.additionalItems)}n--;const o=this.additionalItems.slice(0);for(;o.length<n;)o.push(0);return o[n]|=1<<(31&i),ANe.create(this.items,o)}merge(e){const t=this.items|e.items;if(this.additionalItems===TNe&&e.additionalItems===TNe)return t===this.items?this:t===e.items?e:ANe.create(t,TNe);const i=[];for(let t=0;t<Math.max(this.additionalItems.length,e.additionalItems.length);t++){const n=this.additionalItems[t]||0,o=e.additionalItems[t]||0;i.push(n|o)}return ANe.create(t,i)}intersects(e){if(0!=(this.items&e.items))return!0;for(let t=0;t<Math.min(this.additionalItems.length,e.additionalItems.length);t++)if(0!=(this.additionalItems[t]&e.additionalItems[t]))return!0;return!1}}ANe.cache=new Array(129),ANe.empty=ANe.create(0,TNe);const RNe={getKey:e=>e};class ONe{constructor(){this.items=new Map}getKey(e){let t=this.items.get(e);return void 0===t&&(t=this.items.size,this.items.set(e,t)),t}}class PNe{get length(){return this._length}constructor(e){this._length=e}}class FNe extends PNe{static create(e,t,i){let n=e.length;return t&&(n=CNe(n,t.length)),i&&(n=CNe(n,i.length)),new FNe(n,e,t,i,t?t.missingOpeningBracketIds:ANe.getEmpty())}get kind(){return 2}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw new Error("Invalid child index")}get children(){const e=[];return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}constructor(e,t,i,n,o){super(e),this.openingBracket=t,this.child=i,this.closingBracket=n,this.missingOpeningBracketIds=o}canBeReused(e){return null!==this.closingBracket&&!e.intersects(this.missingOpeningBracketIds)}deepClone(){return new FNe(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation(CNe(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class BNe extends PNe{static create23(e,t,i,n=!1){let o=e.length,s=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(o=CNe(o,t.length),s=s.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");o=CNe(o,i.length),s=s.merge(i.missingOpeningBracketIds)}return n?new VNe(o,e.listHeight+1,e,t,i,s):new WNe(o,e.listHeight+1,e,t,i,s)}static getEmpty(){return new HNe(fNe,0,[],ANe.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}constructor(e,t,i){super(e),this.listHeight=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();const e=this.childrenLength;if(0===e)return;const t=this.getChild(e-1),i=4===t.kind?t.toMutable():t;return t!==i&&this.setChild(e-1,i),i}makeFirstElementMutable(){if(this.throwIfImmutable(),0===this.childrenLength)return;const e=this.getChild(0),t=4===e.kind?e.toMutable():e;return e!==t&&this.setChild(0,t),t}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds))return!1;if(0===this.childrenLength)return!1;let t=this;for(;4===t.kind;){const e=t.childrenLength;if(0===e)throw new Yre;t=t.getChild(e-1)}return t.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();const e=this.childrenLength;let t=this.getChild(0).length,i=this.getChild(0).missingOpeningBracketIds;for(let n=1;n<e;n++){const e=this.getChild(n);t=CNe(t,e.length),i=i.merge(e.missingOpeningBracketIds)}this._length=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}computeMinIndentation(e,t){if(-1!==this.cachedMinIndentation)return this.cachedMinIndentation;let i=Number.MAX_SAFE_INTEGER,n=e;for(let e=0;e<this.childrenLength;e++){const o=this.getChild(e);o&&(i=Math.min(i,o.computeMinIndentation(n,t)),n=CNe(n,o.length))}return this.cachedMinIndentation=i,i}}class WNe extends BNe{get childrenLength(){return null!==this._item3?3:2}getChild(e){switch(e){case 0:return this._item1;case 1:return this._item2;case 2:return this._item3}throw new Error("Invalid child index")}setChild(e,t){switch(e){case 0:return void(this._item1=t);case 1:return void(this._item2=t);case 2:return void(this._item3=t)}throw new Error("Invalid child index")}get children(){return this._item3?[this._item1,this._item2,this._item3]:[this._item1,this._item2]}get item1(){return this._item1}get item2(){return this._item2}get item3(){return this._item3}constructor(e,t,i,n,o,s){super(e,t,s),this._item1=i,this._item2=n,this._item3=o}deepClone(){return new WNe(this.length,this.listHeight,this._item1.deepClone(),this._item2.deepClone(),this._item3?this._item3.deepClone():null,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){if(this._item3)throw new Error("Cannot append to a full (2,3) tree node");this.throwIfImmutable(),this._item3=e,this.handleChildrenChanged()}unappendChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item3;return this._item3=null,this.handleChildrenChanged(),e}prependChildOfSameHeight(e){if(this._item3)throw new Error("Cannot prepend to a full (2,3) tree node");this.throwIfImmutable(),this._item3=this._item2,this._item2=this._item1,this._item1=e,this.handleChildrenChanged()}unprependChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item1;return this._item1=this._item2,this._item2=this._item3,this._item3=null,this.handleChildrenChanged(),e}toMutable(){return this}}class VNe extends WNe{toMutable(){return new WNe(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}class zNe extends BNe{get childrenLength(){return this._children.length}getChild(e){return this._children[e]}setChild(e,t){this._children[e]=t}get children(){return this._children}constructor(e,t,i,n){super(e,t,n),this._children=i}deepClone(){const e=new Array(this._children.length);for(let t=0;t<this._children.length;t++)e[t]=this._children[t].deepClone();return new zNe(this.length,this.listHeight,e,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){this.throwIfImmutable(),this._children.push(e),this.handleChildrenChanged()}unappendChild(){this.throwIfImmutable();const e=this._children.pop();return this.handleChildrenChanged(),e}prependChildOfSameHeight(e){this.throwIfImmutable(),this._children.unshift(e),this.handleChildrenChanged()}unprependChild(){this.throwIfImmutable();const e=this._children.shift();return this.handleChildrenChanged(),e}toMutable(){return this}}class HNe extends zNe{toMutable(){return new zNe(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}const UNe=[];class KNe extends PNe{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return UNe}deepClone(){return this}}class jNe extends KNe{get kind(){return 0}get missingOpeningBracketIds(){return ANe.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){const i=wNe(e),n=(0===i.columnCount?i.lineCount:i.lineCount+1)+1,o=(s=CNe(e,this.length),Math.floor(s/vNe)+1);var s;let r=Number.MAX_SAFE_INTEGER;for(let e=n;e<=o;e++){const i=t.getLineFirstNonWhitespaceColumn(e),n=t.getLineContent(e);if(0===i)continue;const o=lke.visibleColumnFromColumn(n,i,t.getOptions().tabSize);r=Math.min(r,o)}return r}}class qNe extends KNe{static create(e,t,i){return new qNe(e,t,i)}get kind(){return 1}get missingOpeningBracketIds(){return ANe.getEmpty()}constructor(e,t,i){super(e),this.bracketInfo=t,this.bracketIds=i}get text(){return this.bracketInfo.bracketText}get languageId(){return this.bracketInfo.languageId}canBeReused(e){return!1}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class $Ne extends KNe{get kind(){return 3}constructor(e,t){super(t),this.missingOpeningBracketIds=e}canBeReused(e){return!e.intersects(this.missingOpeningBracketIds)}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class GNe{constructor(e,t,i,n,o){this.length=e,this.kind=t,this.bracketId=i,this.bracketIds=n,this.astNode=o}}class ZNe{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new YNe(this.textModel,this.bracketTokens),this._offset=fNe,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return bNe(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=CNe(this._offset,e);const t=wNe(this._offset);this.reader.setPosition(t.lineCount,t.columnCount)}read(){let e;return this.peeked?(this.didPeek=!1,e=this.peeked):e=this.reader.read(),e&&(this._offset=CNe(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class YNe{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}setPosition(e,t){e===this.lineIdx?(this.lineCharOffset=t,null!==this.line&&(this.lineTokenOffset=0===this.lineCharOffset?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))):(this.lineIdx=e,this.lineCharOffset=t,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){const e=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=e.length,e}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;null===this.line&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=0===this.lineCharOffset?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const n=this.lineTokens,o=n.getCount();let s=null;if(this.lineTokenOffset<o){const r=n.getMetadata(this.lineTokenOffset);for(;this.lineTokenOffset+1<o&&r===n.getMetadata(this.lineTokenOffset+1);)this.lineTokenOffset++;const a=0===ufe.getTokenType(r),l=ufe.containsBalancedBrackets(r),h=n.getEndOffset(this.lineTokenOffset);if(l&&a&&this.lineCharOffset<h){const e=n.getLanguageId(this.lineTokenOffset),t=this.line.substring(this.lineCharOffset,h),i=this.bracketTokens.getSingleLanguageBracketTokens(e),o=i.regExpGlobal;if(o){o.lastIndex=0;const e=o.exec(t);e&&(s=i.getToken(e[0]),s&&(this.lineCharOffset+=e.index))}}if(i+=h-this.lineCharOffset,s){if(e!==this.lineIdx||t!==this.lineCharOffset){this.peekedToken=s;break}return this.lineCharOffset+=s.length,s}this.lineTokenOffset++,this.lineCharOffset=h}else{if(this.lineIdx===this.textBufferLineCount-1)break;if(this.lineIdx++,this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.lineTokenOffset=0,this.line=this.lineTokens.getLineContent(),this.lineCharOffset=0,i+=33,i>1e3)break}if(i>1500)break}const n=(o=e,s=t,r=this.lineIdx,a=this.lineCharOffset,o!==r?bNe(r-o,a):bNe(0,a-s));var o,s,r,a;return new GNe(n,0,-1,ANe.getEmpty(),new jNe(n))}}class QNe{constructor(e,t){this.text=e,this._offset=fNe,this.idx=0;const i=t.getRegExpStr(),n=i?new RegExp(i+"|\n","gi"):null,o=[];let s,r=0,a=0,l=0,h=0;const d=[];for(let e=0;e<60;e++)d.push(new GNe(bNe(0,e),0,-1,ANe.getEmpty(),new jNe(bNe(0,e))));const c=[];for(let e=0;e<60;e++)c.push(new GNe(bNe(1,e),0,-1,ANe.getEmpty(),new jNe(bNe(1,e))));if(n)for(n.lastIndex=0;null!==(s=n.exec(e));){const e=s.index,i=s[0];if("\n"===i)r++,a=e+1;else{if(l!==e){let t;if(h===r){const i=e-l;if(i<d.length)t=d[i];else{const e=bNe(0,i);t=new GNe(e,0,-1,ANe.getEmpty(),new jNe(e))}}else{const i=r-h,n=e-a;if(1===i&&n<c.length)t=c[n];else{const e=bNe(i,n);t=new GNe(e,0,-1,ANe.getEmpty(),new jNe(e))}}o.push(t)}o.push(t.getToken(i)),l=e+i.length,h=r}}const u=e.length;if(l!==u){const e=h===r?bNe(0,u-l):bNe(r-h,u-a);o.push(new GNe(e,0,-1,ANe.getEmpty(),new jNe(e)))}this.length=bNe(r,u-a),this.tokens=o}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new Gre}}class XNe{static createFromLanguage(e,t){function i(e){return t.getKey(`${e.languageId}:::${e.bracketText}`)}const n=new Map;for(const t of e.bracketsNew.openingBrackets){const e=bNe(0,t.bracketText.length),o=i(t),s=ANe.getEmpty().add(o,RNe);n.set(t.bracketText,new GNe(e,1,o,s,qNe.create(e,t,s)))}for(const t of e.bracketsNew.closingBrackets){const e=bNe(0,t.bracketText.length);let o=ANe.getEmpty();const s=t.getClosedBrackets();for(const e of s)o=o.add(i(e),RNe);n.set(t.bracketText,new GNe(e,2,i(s[0]),o,qNe.create(e,t,o)))}return new XNe(n)}constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}getRegExpStr(){if(this.isEmpty)return null;{const e=[...this.map.keys()];return e.sort(),e.reverse(),e.map((e=>function(e){let t=Zhe(e);return/^[\w ]+/.test(e)&&(t=`\\b${t}`),/[\w ]+$/.test(e)&&(t=`${t}\\b`),t}(e))).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(2===i.kind&&i.bracketIds.intersects(e))return t}get isEmpty(){return 0===this.map.size}}class JNe{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=XNe.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function eIe(e,t=!1){if(0===e.length)return null;if(1===e.length)return e[0];let i=e.length;for(;i>3;){const n=i>>1;for(let o=0;o<n;o++){const n=o<<1;e[o]=BNe.create23(e[n],e[n+1],n+3===i?e[n+2]:null,t)}i=n}return BNe.create23(e[0],e[1],i>=3?e[2]:null,t)}function tIe(e,t){return Math.abs(e.listHeight-t.listHeight)}function iIe(e,t){return e.listHeight===t.listHeight?BNe.create23(e,t,null,!1):e.listHeight>t.listHeight?function(e,t){let i=e=e.toMutable();const n=[];let o;for(;;){if(t.listHeight===i.listHeight){o=t;break}if(4!==i.kind)throw new Error("unexpected");n.push(i),i=i.makeLastElementMutable()}for(let e=n.length-1;e>=0;e--){const t=n[e];o?t.childrenLength>=3?o=BNe.create23(t.unappendChild(),o,null,!1):(t.appendChildOfSameHeight(o),o=void 0):t.handleChildrenChanged()}return o?BNe.create23(e,o,null,!1):e}(e,t):function(e,t){let i=e=e.toMutable();const n=[];for(;t.listHeight!==i.listHeight;){if(4!==i.kind)throw new Error("unexpected");n.push(i),i=i.makeFirstElementMutable()}let o=t;for(let e=n.length-1;e>=0;e--){const t=n[e];o?t.childrenLength>=3?o=BNe.create23(o,t.unprependChild(),null,!1):(t.prependChildOfSameHeight(o),o=void 0):t.handleChildrenChanged()}return o?BNe.create23(o,e,null,!1):e}(t,e)}class nIe{constructor(e){this.lastOffset=fNe,this.nextNodes=[e],this.offsets=[fNe],this.idxs=[]}readLongestNodeAt(e,t){if(kNe(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=sIe(this.nextNodes);if(!i)return;const n=sIe(this.offsets);if(kNe(e,n))return;if(kNe(n,e))if(CNe(n,i.length)<=e)this.nextNodeAfterCurrent();else{const e=oIe(i);-1!==e?(this.nextNodes.push(i.getChild(e)),this.offsets.push(n),this.idxs.push(e)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const e=oIe(i);if(-1===e)return void this.nextNodeAfterCurrent();this.nextNodes.push(i.getChild(e)),this.offsets.push(n),this.idxs.push(e)}}}}nextNodeAfterCurrent(){for(;;){const e=sIe(this.offsets),t=sIe(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),0===this.idxs.length)break;const i=sIe(this.nextNodes),n=oIe(i,this.idxs[this.idxs.length-1]);if(-1!==n){this.nextNodes.push(i.getChild(n)),this.offsets.push(CNe(e,t.length)),this.idxs[this.idxs.length-1]=n;break}this.idxs.pop()}}}function oIe(e,t=-1){for(;;){if(++t>=e.childrenLength)return-1;if(e.getChild(t))return t}}function sIe(e){return e.length>0?e[e.length-1]:void 0}function rIe(e,t,i,n){return new aIe(e,t,i,n).parseDocument()}class aIe{constructor(e,t,i,n){if(this.tokenizer=e,this.createImmutableLists=n,this._itemsConstructed=0,this._itemsFromCache=0,i&&n)throw new Error("Not supported");this.oldNodeReader=i?new nIe(i):void 0,this.positionMapper=new INe(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(ANe.getEmpty());return e||(e=BNe.getEmpty()),e}parseList(e){const t=[];for(;;){let i=this.tryReadChildFromCache(e);if(!i){const t=this.tokenizer.peek();if(!t||2===t.kind&&t.bracketIds.intersects(e))break;i=this.parseChild(e)}4===i.kind&&0===i.childrenLength||t.push(i)}const i=this.oldNodeReader?function(e){if(0===e.length)return null;if(1===e.length)return e[0];let t=0;function i(){if(t>=e.length)return null;const i=t,n=e[i].listHeight;for(t++;t<e.length&&e[t].listHeight===n;)t++;return t-i>=2?eIe(0===i&&t===e.length?e:e.slice(i,t),!1):e[i]}let n=i(),o=i();if(!o)return n;for(let e=i();e;e=i())tIe(n,o)<=tIe(o,e)?(n=iIe(n,o),o=e):o=iIe(o,e);return iIe(n,o)}(t):eIe(t,this.createImmutableLists);return i}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(null===t||!_Ne(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),(i=>!(null!==t&&!kNe(i.length,t))&&i.canBeReused(e)));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e){this._itemsConstructed++;const t=this.tokenizer.read();switch(t.kind){case 2:return new $Ne(t.bracketIds,t.length);case 0:return t.astNode;case 1:{const i=e.merge(t.bracketIds),n=this.parseList(i),o=this.tokenizer.peek();return o&&2===o.kind&&(o.bracketId===t.bracketId||o.bracketIds.intersects(t.bracketIds))?(this.tokenizer.read(),FNe.create(t.astNode,n,o.astNode)):FNe.create(t.astNode,n,null)}default:throw new Error("unexpected")}}}function lIe(e,t){if(0===e.length)return t;const i=new Hse(hIe(e)),n=hIe(t);let o,s=fNe;function r(e){const t=[];for(;;){if(void 0!==o&&!_Ne(o)||!_Ne(s)){let i;void 0!==e&&LNe(e,s)?(i=e,s=SNe(e,s),e=fNe):(i=s,void 0!==e&&(e=SNe(s,e)),s=fNe),void 0===o?t.push({oldLength:i,newLength:void 0}):(t.push({oldLength:o,newLength:i}),o=fNe)}if(void 0!==e&&_Ne(e))break;const n=i.dequeue();if(!n){void 0!==e&&t.push({oldLength:e,newLength:void 0});break}void 0===n.newLength?(s=n.oldLength,o=void 0):(o=n.oldLength,s=n.newLength)}return t}const a=[];function l(e,t,i){if(a.length>0&&a[a.length-1].endOffset===e){const e=a[a.length-1];a[a.length-1]=new NNe(e.startOffset,t,CNe(e.newLength,i))}else a.push({startOffset:e,endOffset:t,newLength:i})}let h=fNe;for(const e of n){const t=r(e.oldLength);if(void 0!==e.newLength){const i=CNe(h,yNe(t,(e=>e.oldLength)));l(h,i,e.newLength),h=i}else for(const e of t){const t=h;h=CNe(h,e.oldLength),void 0!==e.newLength&&l(t,h,e.newLength)}}const d=r(void 0);for(const e of d){const t=h;h=CNe(h,e.oldLength),void 0!==e.newLength&&l(t,h,e.newLength)}return a}function hIe(e){const t=[];let i=fNe;for(const n of e){const e=SNe(i,n.startOffset);_Ne(e)||t.push({oldLength:e});const o=SNe(n.startOffset,n.endOffset);t.push({oldLength:o,newLength:n.newLength}),i=n.endOffset}return t}class dIe extends aae{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new bae,this.denseKeyProvider=new ONe,this.brackets=new JNe(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],0===e.tokenization.backgroundTokenizationState){const e=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),t=new QNe(this.textModel.getValue(),e);this.initialAstWithoutTokens=rIe(t,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}else 2===e.tokenization.backgroundTokenizationState?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):1===e.tokenization.backgroundTokenizationState&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens)}handleDidChangeBackgroundTokenizationState(){if(2===this.textModel.tokenization.backgroundTokenizationState){const e=void 0===this.initialAstWithoutTokens;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map((e=>new NNe(bNe(e.fromLineNumber-1,0),bNe(e.toLineNumber,0),bNe(e.toLineNumber-e.fromLineNumber+1,0))));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=e.changes.map((e=>{const t=Ole.lift(e.range);return new NNe(DNe(t.getStartPosition()),DNe(t.getEndPosition()),function(e){const t=Jhe(e);return bNe(t.length-1,t[t.length-1].length)}(e.text))})).reverse();this.handleEdits(t,!1)}handleEdits(e,t){const i=lIe(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=lIe(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){const n=t;return rIe(new ZNe(this.textModel,this.brackets),e,n,i)}getBracketsInRange(e){this.flushQueue();const t=bNe(e.startLineNumber-1,e.startColumn-1),i=bNe(e.endLineNumber-1,e.endColumn-1);return new Use((e=>{const n=this.initialAstWithoutTokens||this.astWithTokens;gIe(n,fNe,n.length,t,i,e,0,0,new Map)}))}getBracketPairsInRange(e,t){this.flushQueue();const i=DNe(e.getStartPosition()),n=DNe(e.getEndPosition());return new Use((e=>{const o=this.initialAstWithoutTokens||this.astWithTokens,s=new pIe(e,t,this.textModel);mIe(o,fNe,o.length,i,n,s,0,new Map)}))}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return uIe(t,fNe,t.length,DNe(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return cIe(t,fNe,t.length,DNe(e))}}function cIe(e,t,i,n){if(4===e.kind||2===e.kind){const o=[];for(const n of e.children)i=CNe(t,n.length),o.push({nodeOffsetStart:t,nodeOffsetEnd:i}),t=i;for(let t=o.length-1;t>=0;t--){const{nodeOffsetStart:i,nodeOffsetEnd:s}=o[t];if(kNe(i,n)){const o=cIe(e.children[t],i,s,n);if(o)return o}}return null}if(3===e.kind)return null;if(1===e.kind){const n=ENe(t,i);return{bracketInfo:e.bracketInfo,range:n}}return null}function uIe(e,t,i,n){if(4===e.kind||2===e.kind){for(const o of e.children){if(kNe(n,i=CNe(t,o.length))){const e=uIe(o,t,i,n);if(e)return e}t=i}return null}if(3===e.kind)return null;if(1===e.kind){const n=ENe(t,i);return{bracketInfo:e.bracketInfo,range:n}}return null}function gIe(e,t,i,n,o,s,r,a,l,h=!1){if(r>200)return!0;e:for(;;)switch(e.kind){case 4:{const a=e.childrenLength;for(let h=0;h<a;h++){const a=e.getChild(h);if(a){if(i=CNe(t,a.length),LNe(t,o)&&xNe(i,n)){if(xNe(i,o)){e=a;continue e}if(!gIe(a,t,i,n,o,s,r,0,l))return!1}t=i}}return!0}case 2:{let h=0;if(l){let t=l.get(e.openingBracket.text);void 0===t&&(t=0),h=t,t++,l.set(e.openingBracket.text,t)}const d=e.childrenLength;for(let c=0;c<d;c++){const d=e.getChild(c);if(d){if(i=CNe(t,d.length),LNe(t,o)&&xNe(i,n)){if(xNe(i,o)){e=d,r++,a=h+1;continue e}if(!gIe(d,t,i,n,o,s,r+1,h+1,l,!e.closingBracket))return!1}t=i}}return null==l||l.set(e.openingBracket.text,h),!0}case 3:{const e=ENe(t,i);return s(new uNe(e,r-1,0,!0))}case 1:{const e=ENe(t,i);return s(new uNe(e,r-1,a-1,h))}case 0:return!0}}class pIe{constructor(e,t,i){this.push=e,this.includeMinIndentation=t,this.textModel=i}}function mIe(e,t,i,n,o,s,r,a){var l;if(r>200)return!0;let h=!0;if(2===e.kind){let d=0;if(a){let t=a.get(e.openingBracket.text);void 0===t&&(t=0),d=t,t++,a.set(e.openingBracket.text,t)}const c=CNe(t,e.openingBracket.length);let u=-1;if(s.includeMinIndentation&&(u=e.computeMinIndentation(t,s.textModel)),h=s.push(new pNe(ENe(t,i),ENe(t,c),e.closingBracket?ENe(CNe(c,(null===(l=e.child)||void 0===l?void 0:l.length)||fNe),i):void 0,r,d,e,u)),t=c,h&&e.child){const l=e.child;if(i=CNe(t,l.length),LNe(t,o)&&xNe(i,n)&&(h=mIe(l,t,i,n,o,s,r+1,a),!h))return!1}null==a||a.set(e.openingBracket.text,d)}else{let i=t;for(const t of e.children){const e=i;if(i=CNe(i,t.length),LNe(e,o)&&LNe(n,i)&&(h=mIe(t,e,i,n,o,s,r,a),!h))return!1}}return h}class fIe extends aae{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new lae),this.onDidChangeEmitter=new bae,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange((e=>{var t;e.languageId&&!(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.didLanguageChange(e.languageId))||(this.bracketPairsTree.clear(),this.updateBracketPairsTree())})))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;null===(t=this.bracketPairsTree.value)||void 0===t||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;null===(e=this.bracketPairsTree.value)||void 0===e||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;null===(t=this.bracketPairsTree.value)||void 0===t||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const i=new rae;this.bracketPairsTree.value=(e=i.add(new dIe(this.textModel,(e=>this.languageConfigurationService.getLanguageConfiguration(e)))),t=i,{object:e,dispose:()=>null==t?void 0:t.dispose()}),i.add(this.bracketPairsTree.value.object.onDidChange((e=>this.onDidChangeEmitter.fire(e)))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire());var e,t}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getBracketPairsInRange(e,!1))||Use.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getBracketPairsInRange(e,!0))||Use.empty}getBracketsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getBracketsInRange(e))||Use.empty}findMatchingBracketUp(e,t,i){const n=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(n.lineNumber,n.column);if(this.canBuildAST){const i=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!i)return null;const n=this.getBracketPairsInRange(Ole.fromPositions(t,t)).findLast((e=>i.closes(e.openingBracketInfo)));return n?n.openingBracketRange:null}{const t=e.toLowerCase(),s=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!s)return null;const r=s.textIsBracket[t];return r?bIe(this._findMatchingBracketUp(r,n,_Ie(i))):null}}matchBracket(e,t){if(this.canBuildAST){const t=this.getBracketPairsInRange(Ole.fromPositions(e,e)).filter((t=>void 0!==t.closingBracketRange&&(t.openingBracketRange.containsPosition(e)||t.closingBracketRange.containsPosition(e)))).findLastMaxBy(zse((t=>t.openingBracketRange.containsPosition(e)?t.openingBracketRange:t.closingBracketRange),Ole.compareRangesUsingStarts));return t?[t.openingBracketRange,t.closingBracketRange]:null}{const i=_Ie(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,n){const o=t.getCount(),s=t.getLanguageId(n);let r=Math.max(0,e.column-1-i.maxBracketLength);for(let e=n-1;e>=0;e--){const i=t.getEndOffset(e);if(i<=r)break;if(bue(t.getStandardTokenType(e))||t.getLanguageId(e)!==s){r=i;break}}let a=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let e=n+1;e<o;e++){const i=t.getStartOffset(e);if(i>=a)break;if(bue(t.getStandardTokenType(e))||t.getLanguageId(e)!==s){a=i;break}}return{searchStartOffset:r,searchEndOffset:a}}_matchBracket(e,t){const i=e.lineNumber,n=this.textModel.tokenization.getLineTokens(i),o=this.textModel.getLineContent(i),s=n.findTokenIndexAtOffset(e.column-1);if(s<0)return null;const r=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(s)).brackets;if(r&&!bue(n.getStandardTokenType(s))){let{searchStartOffset:a,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,r,s),h=null;for(;;){const n=Kue.findNextBracketInRange(r.forwardRegex,i,o,a,l);if(!n)break;if(n.startColumn<=e.column&&e.column<=n.endColumn){const e=o.substring(n.startColumn-1,n.endColumn-1).toLowerCase(),i=this._matchFoundBracket(n,r.textIsBracket[e],r.textIsOpenBracket[e],t);if(i){if(i instanceof vIe)return null;h=i}}a=n.endColumn-1}if(h)return h}if(s>0&&n.getStartOffset(s)===e.column-1){const r=s-1,a=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(r)).brackets;if(a&&!bue(n.getStandardTokenType(r))){const{searchStartOffset:s,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,a,r),h=Kue.findPrevBracketInRange(a.reversedRegex,i,o,s,l);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const e=o.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),i=this._matchFoundBracket(h,a.textIsBracket[e],a.textIsOpenBracket[e],t);if(i)return i instanceof vIe?null:i}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return o?o instanceof vIe?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,o=e.reversedRegex;let s=-1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return vIe.INSTANCE;const h=Kue.findPrevBracketInRange(o,t,n,a,l);if(!h)break;const d=n.substring(h.startColumn-1,h.endColumn-1).toLowerCase();if(e.isOpen(d)?s++:e.isClose(d)&&s--,0===s)return h;l=h.startColumn-1}return null};for(let e=t.lineNumber;e>=1;e--){const i=this.textModel.tokenization.getLineTokens(e),o=i.getCount(),s=this.textModel.getLineContent(e);let r=o-1,l=s.length,h=s.length;e===t.lineNumber&&(r=i.findTokenIndexAtOffset(t.column-1),l=t.column-1,h=t.column-1);let d=!0;for(;r>=0;r--){const t=i.getLanguageId(r)===n&&!bue(i.getStandardTokenType(r));if(t)d?l=i.getStartOffset(r):(l=i.getStartOffset(r),h=i.getEndOffset(r));else if(d&&l!==h){const t=a(e,s,l,h);if(t)return t}d=t}if(d&&l!==h){const t=a(e,s,l,h);if(t)return t}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageId,o=e.forwardRegex;let s=1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return vIe.INSTANCE;const h=Kue.findNextBracketInRange(o,t,n,a,l);if(!h)break;const d=n.substring(h.startColumn-1,h.endColumn-1).toLowerCase();if(e.isOpen(d)?s++:e.isClose(d)&&s--,0===s)return h;a=h.endColumn-1}return null},l=this.textModel.getLineCount();for(let e=t.lineNumber;e<=l;e++){const i=this.textModel.tokenization.getLineTokens(e),o=i.getCount(),s=this.textModel.getLineContent(e);let r=0,l=0,h=0;e===t.lineNumber&&(r=i.findTokenIndexAtOffset(t.column-1),l=t.column-1,h=t.column-1);let d=!0;for(;r<o;r++){const t=i.getLanguageId(r)===n&&!bue(i.getStandardTokenType(r));if(t)d||(l=i.getStartOffset(r)),h=i.getEndOffset(r);else if(d&&l!==h){const t=a(e,s,l,h);if(t)return t}d=t}if(d&&l!==h){const t=a(e,s,l,h);if(t)return t}}return null}findPrevBracket(e){var t;const i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getFirstBracketBefore(i))||null;let n=null,o=null,s=null;for(let e=i.lineNumber;e>=1;e--){const t=this.textModel.tokenization.getLineTokens(e),r=t.getCount(),a=this.textModel.getLineContent(e);let l=r-1,h=a.length,d=a.length;if(e===i.lineNumber){l=t.findTokenIndexAtOffset(i.column-1),h=i.column-1,d=i.column-1;const e=t.getLanguageId(l);n!==e&&(n=e,o=this.languageConfigurationService.getLanguageConfiguration(n).brackets,s=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let c=!0;for(;l>=0;l--){const i=t.getLanguageId(l);if(n!==i){if(o&&s&&c&&h!==d){const t=Kue.findPrevBracketInRange(o.reversedRegex,e,a,h,d);if(t)return this._toFoundBracket(s,t);c=!1}n=i,o=this.languageConfigurationService.getLanguageConfiguration(n).brackets,s=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew}const r=!!o&&!bue(t.getStandardTokenType(l));if(r)c?h=t.getStartOffset(l):(h=t.getStartOffset(l),d=t.getEndOffset(l));else if(s&&o&&c&&h!==d){const t=Kue.findPrevBracketInRange(o.reversedRegex,e,a,h,d);if(t)return this._toFoundBracket(s,t)}c=r}if(s&&o&&c&&h!==d){const t=Kue.findPrevBracketInRange(o.reversedRegex,e,a,h,d);if(t)return this._toFoundBracket(s,t)}}return null}findNextBracket(e){var t;const i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getFirstBracketAfter(i))||null;const n=this.textModel.getLineCount();let o=null,s=null,r=null;for(let e=i.lineNumber;e<=n;e++){const t=this.textModel.tokenization.getLineTokens(e),n=t.getCount(),a=this.textModel.getLineContent(e);let l=0,h=0,d=0;if(e===i.lineNumber){l=t.findTokenIndexAtOffset(i.column-1),h=i.column-1,d=i.column-1;const e=t.getLanguageId(l);o!==e&&(o=e,s=this.languageConfigurationService.getLanguageConfiguration(o).brackets,r=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let c=!0;for(;l<n;l++){const i=t.getLanguageId(l);if(o!==i){if(r&&s&&c&&h!==d){const t=Kue.findNextBracketInRange(s.forwardRegex,e,a,h,d);if(t)return this._toFoundBracket(r,t);c=!1}o=i,s=this.languageConfigurationService.getLanguageConfiguration(o).brackets,r=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew}const n=!!s&&!bue(t.getStandardTokenType(l));if(n)c||(h=t.getStartOffset(l)),d=t.getEndOffset(l);else if(r&&s&&c&&h!==d){const t=Kue.findNextBracketInRange(s.forwardRegex,e,a,h,d);if(t)return this._toFoundBracket(r,t)}c=n}if(r&&s&&c&&h!==d){const t=Kue.findNextBracketInRange(s.forwardRegex,e,a,h,d);if(t)return this._toFoundBracket(r,t)}}return null}findEnclosingBrackets(e,t){const i=this.textModel.validatePosition(e);if(this.canBuildAST){const e=Ole.fromPositions(i),t=this.getBracketPairsInRange(Ole.fromPositions(i,i)).findLast((t=>void 0!==t.closingBracketRange&&t.range.strictContainsRange(e)));return t?[t.openingBracketRange,t.closingBracketRange]:null}const n=_Ie(t),o=this.textModel.getLineCount(),s=new Map;let r=[];const a=(e,t)=>{if(!s.has(e)){const i=[];for(let e=0,n=t?t.brackets.length:0;e<n;e++)i[e]=0;s.set(e,i)}r=s.get(e)};let l=0;const h=(e,t,i,o,s)=>{for(;;){if(n&&++l%100==0&&!n())return vIe.INSTANCE;const a=Kue.findNextBracketInRange(e.forwardRegex,t,i,o,s);if(!a)break;const h=i.substring(a.startColumn-1,a.endColumn-1).toLowerCase(),d=e.textIsBracket[h];if(d&&(d.isOpen(h)?r[d.index]++:d.isClose(h)&&r[d.index]--,-1===r[d.index]))return this._matchFoundBracket(a,d,!1,n);o=a.endColumn-1}return null};let d=null,c=null;for(let e=i.lineNumber;e<=o;e++){const t=this.textModel.tokenization.getLineTokens(e),n=t.getCount(),o=this.textModel.getLineContent(e);let s=0,r=0,l=0;if(e===i.lineNumber){s=t.findTokenIndexAtOffset(i.column-1),r=i.column-1,l=i.column-1;const e=t.getLanguageId(s);d!==e&&(d=e,c=this.languageConfigurationService.getLanguageConfiguration(d).brackets,a(d,c))}let u=!0;for(;s<n;s++){const i=t.getLanguageId(s);if(d!==i){if(c&&u&&r!==l){const t=h(c,e,o,r,l);if(t)return bIe(t);u=!1}d=i,c=this.languageConfigurationService.getLanguageConfiguration(d).brackets,a(d,c)}const n=!!c&&!bue(t.getStandardTokenType(s));if(n)u||(r=t.getStartOffset(s)),l=t.getEndOffset(s);else if(c&&u&&r!==l){const t=h(c,e,o,r,l);if(t)return bIe(t)}u=n}if(c&&u&&r!==l){const t=h(c,e,o,r,l);if(t)return bIe(t)}}return null}_toFoundBracket(e,t){if(!t)return null;let i=this.textModel.getValueInRange(t);i=i.toLowerCase();const n=e.getBracketInfo(i);return n?{range:t,bracketInfo:n}:null}}function _Ie(e){if(void 0===e)return()=>!0;{const t=Date.now();return()=>Date.now()-t<=e}}class vIe{constructor(){this._searchCanceledBrand=void 0}}function bIe(e){return e instanceof vIe?null:e}vIe.INSTANCE=new vIe;class wIe extends aae{constructor(e){super(),this.textModel=e,this.colorProvider=new CIe,this.onDidChangeEmitter=new bae,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange((e=>{this.onDidChangeEmitter.fire()})))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,n){return n||void 0===t?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e).map((e=>({id:`bracket${e.range.toString()}-${e.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(e,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:e.range}))).toArray():[]}getAllDecorations(e,t){return void 0===e?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new Ole(1,1,this.textModel.getLineCount(),1),e,t):[]}}class CIe{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return"bracket-highlighting-"+e%30}}function yIe(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}_Le(((e,t)=>{const i=[PLe,FLe,BLe,WLe,VLe,zLe],n=new CIe;t.addRule(`.monaco-editor .${n.unexpectedClosingBracketClassName} { color: ${e.getColor(HLe)}; }`);const o=i.map((t=>e.getColor(t))).filter((e=>!!e)).filter((e=>!e.isTransparent()));for(let e=0;e<30;e++){const i=o[e%o.length];t.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(e)} { color: ${i}; }`)}}));class SIe{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,i,n){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=n}toString(){return 0===this.oldText.length?`(insert@${this.oldPosition} "${yIe(this.newText)}")`:0===this.newText.length?`(delete@${this.oldPosition} "${yIe(this.oldText)}")`:`(replace@${this.oldPosition} "${yIe(this.oldText)}" with "${yIe(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;Iue(e,n,i),i+=4;for(let o=0;o<n;o++)Eue(e,t.charCodeAt(o),i),i+=2;return i}static _readString(e,t){const i=Nue(e,t);return function(e,t,i){const n=new Uint16Array(e.buffer,t,i);return i>0&&(65279===n[0]||65534===n[0])?function(e,t,i){const n=[];let o=0;for(let s=0;s<i;s++){const i=Due(e,t);t+=2,n[o++]=String.fromCharCode(i)}return n.join("")}(e,t,i):Aue().decode(n)}(e,t+=4,i)}writeSize(){return 8+SIe._writeStringSize(this.oldText)+SIe._writeStringSize(this.newText)}write(e,t){return Iue(e,this.oldPosition,t),t+=4,Iue(e,this.newPosition,t),t+=4,t=SIe._writeString(e,this.oldText,t),SIe._writeString(e,this.newText,t)}static read(e,t,i){const n=Nue(e,t),o=Nue(e,t+=4);t+=4;const s=SIe._readString(e,t);t+=SIe._writeStringSize(s);const r=SIe._readString(e,t);return t+=SIe._writeStringSize(r),i.push(new SIe(n,s,o,r)),t}}class kIe{constructor(e,t){this._prevEdits=e,this._currEdits=t,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let e=0,t=0,i=this._getPrev(e),n=this._getCurr(t);for(;e<this._prevLen||t<this._currLen;){if(null===i){this._acceptCurr(n),n=this._getCurr(++t);continue}if(null===n){this._acceptPrev(i),i=this._getPrev(++e);continue}if(n.oldEnd<=i.newPosition){this._acceptCurr(n),n=this._getCurr(++t);continue}if(i.newEnd<=n.oldPosition){this._acceptPrev(i),i=this._getPrev(++e);continue}if(n.oldPosition<i.newPosition){const[e,t]=kIe._splitCurr(n,i.newPosition-n.oldPosition);this._acceptCurr(e),n=t;continue}if(i.newPosition<n.oldPosition){const[e,t]=kIe._splitPrev(i,n.oldPosition-i.newPosition);this._acceptPrev(e),i=t;continue}let o,s;if(n.oldEnd===i.newEnd)o=i,s=n,i=this._getPrev(++e),n=this._getCurr(++t);else if(n.oldEnd<i.newEnd){const[e,r]=kIe._splitPrev(i,n.oldLength);o=e,s=n,i=r,n=this._getCurr(++t)}else{const[t,r]=kIe._splitCurr(n,i.newLength);o=i,s=t,i=this._getPrev(++e),n=r}this._result[this._resultLen++]=new SIe(o.oldPosition,o.oldText,s.newPosition,s.newText),this._prevDeltaOffset+=o.newLength-o.oldLength,this._currDeltaOffset+=s.newLength-s.oldLength}const o=kIe._merge(this._result);return kIe._removeNoOps(o)}_acceptCurr(e){this._result[this._resultLen++]=kIe._rebaseCurr(this._prevDeltaOffset,e),this._currDeltaOffset+=e.newLength-e.oldLength}_getCurr(e){return e<this._currLen?this._currEdits[e]:null}_acceptPrev(e){this._result[this._resultLen++]=kIe._rebasePrev(this._currDeltaOffset,e),this._prevDeltaOffset+=e.newLength-e.oldLength}_getPrev(e){return e<this._prevLen?this._prevEdits[e]:null}static _rebaseCurr(e,t){return new SIe(t.oldPosition-e,t.oldText,t.newPosition,t.newText)}static _rebasePrev(e,t){return new SIe(t.oldPosition,t.oldText,t.newPosition+e,t.newText)}static _splitPrev(e,t){const i=e.newText.substr(0,t),n=e.newText.substr(t);return[new SIe(e.oldPosition,e.oldText,e.newPosition,i),new SIe(e.oldEnd,"",e.newPosition+t,n)]}static _splitCurr(e,t){const i=e.oldText.substr(0,t),n=e.oldText.substr(t);return[new SIe(e.oldPosition,i,e.newPosition,e.newText),new SIe(e.oldPosition+t,n,e.newEnd,"")]}static _merge(e){if(0===e.length)return e;const t=[];let i=0,n=e[0];for(let o=1;o<e.length;o++){const s=e[o];n.oldEnd===s.oldPosition?n=new SIe(n.oldPosition,n.oldText+s.oldText,n.newPosition,n.newText+s.newText):(t[i++]=n,n=s)}return t[i++]=n,t}static _removeNoOps(e){if(0===e.length)return e;const t=[];let i=0;for(let n=0;n<e.length;n++){const o=e[n];o.oldText!==o.newText&&(t[i++]=o)}return t}}function LIe(e){return 47===e||92===e}function xIe(e){return e.replace(/[\\/]/g,lle.sep)}function DIe(e,t=lle.sep){if(!e)return"";const i=e.length,n=e.charCodeAt(0);if(LIe(n)){if(LIe(e.charCodeAt(1))&&!LIe(e.charCodeAt(2))){let n=3;const o=n;for(;n<i&&!LIe(e.charCodeAt(n));n++);if(o!==n&&!LIe(e.charCodeAt(n+1)))for(n+=1;n<i;n++)if(LIe(e.charCodeAt(n)))return e.slice(0,n+1).replace(/[\\/]/g,t)}return t}if(((o=n)>=65&&o<=90||o>=97&&o<=122)&&58===e.charCodeAt(1))return LIe(e.charCodeAt(2))?e.slice(0,2)+t:e.slice(0,2);var o;let s=e.indexOf("://");if(-1!==s)for(s+=3;s<i;s++)if(LIe(e.charCodeAt(s)))return e.slice(0,s+1);return""}function EIe(e,t,i,n=mle){if(e===t)return!0;if(!e||!t)return!1;if(t.length>e.length)return!1;if(i){if(!cde(e,t))return!1;if(t.length===e.length)return!0;let i=t.length;return t.charAt(t.length-1)===n&&i--,e.charAt(i)===n}return t.charAt(t.length-1)!==n&&(t+=n),0===e.indexOf(t)}function NIe(e){return Nle(e,!0)}class IIe{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:nde(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t||!(!e||!t)&&this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===_ve.file)return EIe(NIe(e),NIe(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(PIe(e.authority,t.authority))return EIe(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return Sle.joinPath(e,...t)}basenameOrAuthority(e){return TIe(e)||e.authority}basename(e){return lle.basename(e.path)}extname(e){return lle.extname(e.path)}dirname(e){if(0===e.path.length)return e;let t;return e.scheme===_ve.file?t=Sle.file(ule(NIe(e))).path:(t=lle.dirname(e.path),e.authority&&t.length&&47!==t.charCodeAt(0)&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return t=e.scheme===_ve.file?Sle.file(hle(NIe(e))).path:lle.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!PIe(e.authority,t.authority))return;if(e.scheme===_ve.file){const i=cle(NIe(e),NIe(t));return ese?xIe(i):i}let i=e.path||"/";const n=t.path||"/";if(this._ignorePathCasing(e)){let e=0;for(const t=Math.min(i.length,n.length);e<t&&(i.charCodeAt(e)===n.charCodeAt(e)||i.charAt(e).toLowerCase()===n.charAt(e).toLowerCase());e++);i=n.substr(0,e)+i.substr(e)}return lle.relative(i,n)}resolvePath(e,t){if(e.scheme===_ve.file){const i=Sle.file(dle(NIe(e),t));return e.with({authority:i.authority,path:i.path})}var i;return-1===(i=t).indexOf("/")&&(i=xIe(i)),/^[a-zA-Z]:(\/|$)/.test(i)&&(i="/"+i),t=i,e.with({path:lle.resolve(e.path,t)})}isAbsolutePath(e){return!!e.path&&"/"===e.path[0]}isEqualAuthority(e,t){return e===t||void 0!==e&&void 0!==t&&dde(e,t)}hasTrailingPathSeparator(e,t=mle){if(e.scheme===_ve.file){const i=NIe(e);return i.length>DIe(i).length&&i[i.length-1]===t}{const t=e.path;return t.length>1&&47===t.charCodeAt(t.length-1)&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=mle){return FIe(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=mle){let i=!1;if(e.scheme===_ve.file){const n=NIe(e);i=void 0!==n&&n.length===DIe(n).length&&n[n.length-1]===t}else{t="/";const n=e.path;i=1===n.length&&47===n.charCodeAt(n.length-1)}return i||FIe(e,t)?e:e.with({path:e.path+"/"})}}const MIe=new IIe((()=>!1)),TIe=(new IIe((e=>e.scheme!==_ve.file||!ise)),new IIe((e=>!0)),MIe.isEqual.bind(MIe),MIe.isEqualOrParent.bind(MIe),MIe.getComparisonKey.bind(MIe),MIe.basenameOrAuthority.bind(MIe),MIe.basename.bind(MIe)),AIe=(MIe.extname.bind(MIe),MIe.dirname.bind(MIe)),RIe=(MIe.joinPath.bind(MIe),MIe.normalizePath.bind(MIe)),OIe=(MIe.relativePath.bind(MIe),MIe.resolvePath.bind(MIe)),PIe=(MIe.isAbsolutePath.bind(MIe),MIe.isEqualAuthority.bind(MIe)),FIe=MIe.hasTrailingPathSeparator.bind(MIe);var BIe;function WIe(e){return e.toString()}MIe.removeTrailingPathSeparator.bind(MIe),MIe.addTrailingPathSeparator.bind(MIe),function(e){e.META_DATA_LABEL="label",e.META_DATA_DESCRIPTION="description",e.META_DATA_SIZE="size",e.META_DATA_MIME="mime",e.parseMetaData=function(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach((e=>{const[t,n]=e.split(":");t&&n&&i.set(t,n)}));const n=t.path.substring(0,t.path.indexOf(";"));return n&&i.set(e.META_DATA_MIME,n),i}}(BIe||(BIe={}));class VIe{static create(e,t){const i=e.getAlternativeVersionId(),n=UIe(e);return new VIe(i,i,n,n,t,t,[])}constructor(e,t,i,n,o,s,r){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=n,this.beforeCursorState=o,this.afterCursorState=s,this.changes=r}append(e,t,i,n,o){var s,r;t.length>0&&(this.changes=(r=t,null===(s=this.changes)||0===s.length?r:new kIe(s,r).compress())),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+16*(e?e.length:0)}static _writeSelections(e,t,i){if(Iue(e,t?t.length:0,i),i+=4,t)for(const n of t)Iue(e,n.selectionStartLineNumber,i),i+=4,Iue(e,n.selectionStartColumn,i),i+=4,Iue(e,n.positionLineNumber,i),i+=4,Iue(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=Nue(e,t);t+=4;for(let o=0;o<n;o++){const n=Nue(e,t),o=Nue(e,t+=4),s=Nue(e,t+=4),r=Nue(e,t+=4);t+=4,i.push(new Ple(n,o,s,r))}return t}serialize(){let e=10+VIe._writeSelectionsSize(this.beforeCursorState)+VIe._writeSelectionsSize(this.afterCursorState)+4;for(const t of this.changes)e+=t.writeSize();const t=new Uint8Array(e);let i=0;Iue(t,this.beforeVersionId,i),i+=4,Iue(t,this.afterVersionId,i),i+=4,Tue(t,this.beforeEOL,i),i+=1,Tue(t,this.afterEOL,i),i+=1,i=VIe._writeSelections(t,this.beforeCursorState,i),i=VIe._writeSelections(t,this.afterCursorState,i),Iue(t,this.changes.length,i),i+=4;for(const e of this.changes)i=e.write(t,i);return t.buffer}static deserialize(e){const t=new Uint8Array(e);let i=0;const n=Nue(t,i);i+=4;const o=Nue(t,i);i+=4;const s=Mue(t,i);i+=1;const r=Mue(t,i);i+=1;const a=[];i=VIe._readSelections(t,i,a);const l=[];i=VIe._readSelections(t,i,l);const h=Nue(t,i);i+=4;const d=[];for(let e=0;e<h;e++)i=SIe.read(t,i,d);return new VIe(n,o,s,r,a,l,d)}}class zIe{get type(){return 0}get resource(){return Sle.isUri(this.model)?this.model:this.model.uri}constructor(e,t,i,n){this.label=e,this.code=t,this.model=i,this._data=VIe.create(i,n)}toString(){return(this._data instanceof VIe?this._data:VIe.deserialize(this._data)).changes.map((e=>e.toString())).join(", ")}matchesResource(e){return(Sle.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof VIe}append(e,t,i,n,o){this._data instanceof VIe&&this._data.append(e,t,i,n,o)}close(){this._data instanceof VIe&&(this._data=this._data.serialize())}open(){this._data instanceof VIe||(this._data=VIe.deserialize(this._data))}undo(){if(Sle.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof VIe&&(this._data=this._data.serialize());const e=VIe.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(Sle.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof VIe&&(this._data=this._data.serialize());const e=VIe.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof VIe&&(this._data=this._data.serialize()),this._data.byteLength+168}}class HIe{get resources(){return this._editStackElementsArr.map((e=>e.resource))}constructor(e,t,i){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const e of this._editStackElementsArr){const t=WIe(e.resource);this._editStackElementsMap.set(t,e)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=WIe(e);return this._editStackElementsMap.has(t)}setModel(e){const t=WIe(Sle.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=WIe(e.uri);return!!this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).canAppend(e)}append(e,t,i,n,o){const s=WIe(e.uri);this._editStackElementsMap.get(s).append(e,t,i,n,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=WIe(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${TIe(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function UIe(e){return"\n"===e.getEOL()?0:1}function KIe(e){return!!e&&(e instanceof zIe||e instanceof HIe)}class jIe{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);KIe(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);KIe(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(KIe(i)&&i.canAppend(this._model))return i;const n=new zIe(Toe(0,"Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(n,t),n}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],UIe(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n){const o=this._getOrCreateEditStackElement(e,n),s=this._model.applyEdits(t,!0),r=jIe._computeCursorState(i,s),a=s.map(((e,t)=>({index:t,textChange:e.textChange})));return a.sort(((e,t)=>e.textChange.oldPosition===t.textChange.oldPosition?e.index-t.index:e.textChange.oldPosition-t.textChange.oldPosition)),o.append(this._model,a.map((e=>e.textChange)),UIe(this._model),this._model.getAlternativeVersionId(),r),r}static _computeCursorState(e,t){try{return e?e(t):null}catch(e){return zre(e),null}}}class qIe{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function $Ie(e,t,i,n,o){let s;for(o.spacesDiff=0,o.looksLikeAlignment=!1,s=0;s<t&&s<n&&e.charCodeAt(s)===i.charCodeAt(s);s++);let r=0,a=0;for(let i=s;i<t;i++)32===e.charCodeAt(i)?r++:a++;let l=0,h=0;for(let e=s;e<n;e++)32===i.charCodeAt(e)?l++:h++;if(r>0&&a>0)return;if(l>0&&h>0)return;const d=Math.abs(a-h),c=Math.abs(r-l);if(0===d)return o.spacesDiff=c,void(c>0&&0<=l-1&&l-1<e.length&&l<i.length&&32!==i.charCodeAt(l)&&32===e.charCodeAt(l-1)&&44===e.charCodeAt(e.length-1)&&(o.looksLikeAlignment=!0));c%d!=0||(o.spacesDiff=c/d)}function GIe(e,t,i){const n=Math.min(e.getLineCount(),1e4);let o=0,s=0,r="",a=0;const l=[2,4,6,8,3,5,7],h=[0,0,0,0,0,0,0,0,0],d=new qIe;for(let l=1;l<=n;l++){const n=e.getLineLength(l),c=e.getLineContent(l),u=n<=65536;let g=!1,p=0,m=0,f=0;for(let t=0,i=n;t<i;t++){const i=u?c.charCodeAt(t):e.getLineCharCode(l,t);if(9===i)f++;else{if(32!==i){g=!0,p=t;break}m++}}if(!g)continue;if(f>0?o++:m>1&&s++,$Ie(r,a,c,p,d),d.looksLikeAlignment&&(!i||t!==d.spacesDiff))continue;const _=d.spacesDiff;_<=8&&h[_]++,r=c,a=p}let c=i;o!==s&&(c=o<s);let u=t;if(c){let e=c?0:.1*n;l.forEach((t=>{const i=h[t];i>e&&(e=i,u=t)})),4===u&&h[4]>0&&h[2]>0&&h[2]>=h[4]/2&&(u=2)}return{insertSpaces:c,tabSize:u}}function ZIe(e){return(1&e.metadata)>>>0}function YIe(e,t){e.metadata=254&e.metadata|t<<0}function QIe(e){return(2&e.metadata)>>>1==1}function XIe(e,t){e.metadata=253&e.metadata|(t?1:0)<<1}function JIe(e){return(4&e.metadata)>>>2==1}function eMe(e,t){e.metadata=251&e.metadata|(t?1:0)<<2}function tMe(e,t){e.metadata=231&e.metadata|t<<3}function iMe(e,t){e.metadata=223&e.metadata|(t?1:0)<<5}class nMe{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,YIe(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,eMe(this,!1),tMe(this,1),iMe(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,XIe(this,!1)}reset(e,t,i,n){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=n}setOptions(e){this.options=e;const t=this.options.className;eMe(this,"squiggly-error"===t||"squiggly-warning"===t||"squiggly-info"===t),tMe(this,this.options.stickiness),iMe(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const oMe=new nMe(null,0,0);oMe.parent=oMe,oMe.left=oMe,oMe.right=oMe,YIe(oMe,0);class sMe{constructor(){this.root=oMe,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,o){return this.root===oMe?[]:function(e,t,i,n,o,s){let r=e.root,a=0,l=0,h=0,d=0;const c=[];let u=0;for(;r!==oMe;)if(QIe(r))XIe(r.left,!1),XIe(r.right,!1),r===r.parent.right&&(a-=r.parent.delta),r=r.parent;else{if(!QIe(r.left)){if(l=a+r.maxEnd,l<t){XIe(r,!0);continue}if(r.left!==oMe){r=r.left;continue}}if(h=a+r.start,h>i)XIe(r,!0);else{if(d=a+r.end,d>=t){r.setCachedOffsets(h,d,s);let e=!0;n&&r.ownerId&&r.ownerId!==n&&(e=!1),o&&JIe(r)&&(e=!1),e&&(c[u++]=r)}XIe(r,!0),r.right===oMe||QIe(r.right)||(a+=r.delta,r=r.right)}}return XIe(e.root,!1),c}(this,e,t,i,n,o)}search(e,t,i){return this.root===oMe?[]:function(e,t,i,n){let o=e.root,s=0,r=0,a=0;const l=[];let h=0;for(;o!==oMe;){if(QIe(o)){XIe(o.left,!1),XIe(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),o=o.parent;continue}if(o.left!==oMe&&!QIe(o.left)){o=o.left;continue}r=s+o.start,a=s+o.end,o.setCachedOffsets(r,a,n);let e=!0;t&&o.ownerId&&o.ownerId!==t&&(e=!1),i&&JIe(o)&&(e=!1),e&&(l[h++]=o),XIe(o,!0),o.right===oMe||QIe(o.right)||(s+=o.delta,o=o.right)}return XIe(e.root,!1),l}(this,e,t,i)}collectNodesFromOwner(e){return function(e,t){let i=e.root;const n=[];let o=0;for(;i!==oMe;)QIe(i)?(XIe(i.left,!1),XIe(i.right,!1),i=i.parent):i.left===oMe||QIe(i.left)?(i.ownerId===t&&(n[o++]=i),XIe(i,!0),i.right===oMe||QIe(i.right)||(i=i.right)):i=i.left;return XIe(e.root,!1),n}(this,e)}collectNodesPostOrder(){return function(e){let t=e.root;const i=[];let n=0;for(;t!==oMe;)QIe(t)?(XIe(t.left,!1),XIe(t.right,!1),t=t.parent):t.left===oMe||QIe(t.left)?t.right===oMe||QIe(t.right)?(i[n++]=t,XIe(t,!0)):t=t.right:t=t.left;return XIe(e.root,!1),i}(this)}insert(e){lMe(this,e),this._normalizeDeltaIfNecessary()}delete(e){hMe(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let n=0;for(;e!==this.root;)e===e.parent.right&&(n+=e.parent.delta),e=e.parent;const o=i.start+n,s=i.end+n;i.setCachedOffsets(o,s,t)}acceptReplace(e,t,i,n){const o=function(e,t,i){let n=e.root,o=0,s=0,r=0,a=0;const l=[];let h=0;for(;n!==oMe;)if(QIe(n))XIe(n.left,!1),XIe(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),n=n.parent;else{if(!QIe(n.left)){if(s=o+n.maxEnd,s<t){XIe(n,!0);continue}if(n.left!==oMe){n=n.left;continue}}r=o+n.start,r>i?XIe(n,!0):(a=o+n.end,a>=t&&(n.setCachedOffsets(r,a,0),l[h++]=n),XIe(n,!0),n.right===oMe||QIe(n.right)||(o+=n.delta,n=n.right))}return XIe(e.root,!1),l}(this,e,e+t);for(let e=0,t=o.length;e<t;e++)hMe(this,o[e]);this._normalizeDeltaIfNecessary(),function(e,t,i,n){let o=e.root,s=0,r=0,a=0;const l=n-(i-t);for(;o!==oMe;)if(QIe(o))XIe(o.left,!1),XIe(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),pMe(o),o=o.parent;else{if(!QIe(o.left)){if(r=s+o.maxEnd,r<t){XIe(o,!0);continue}if(o.left!==oMe){o=o.left;continue}}a=s+o.start,a>i?(o.start+=l,o.end+=l,o.delta+=l,(o.delta<-1073741824||o.delta>1073741824)&&(e.requestNormalizeDelta=!0),XIe(o,!0)):(XIe(o,!0),o.right===oMe||QIe(o.right)||(s+=o.delta,o=o.right))}XIe(e.root,!1)}(this,e,e+t,i),this._normalizeDeltaIfNecessary();for(let s=0,r=o.length;s<r;s++){const r=o[s];r.start=r.cachedAbsoluteStart,r.end=r.cachedAbsoluteEnd,aMe(r,e,e+t,i,n),r.maxEnd=r.end,lMe(this,r)}this._normalizeDeltaIfNecessary()}_normalizeDeltaIfNecessary(){this.requestNormalizeDelta&&(this.requestNormalizeDelta=!1,function(e){let t=e.root,i=0;for(;t!==oMe;)t.left===oMe||QIe(t.left)?t.right===oMe||QIe(t.right)?(t.start=i+t.start,t.end=i+t.end,t.delta=0,pMe(t),XIe(t,!0),XIe(t.left,!1),XIe(t.right,!1),t===t.parent.right&&(i-=t.parent.delta),t=t.parent):(i+=t.delta,t=t.right):t=t.left;XIe(e.root,!1)}(this))}}function rMe(e,t,i,n){return e<i||!(e>i)&&1!==n&&(2===n||t)}function aMe(e,t,i,n,o){const s=function(e){return(24&e.metadata)>>>3}(e),r=0===s||2===s,a=1===s||2===s,l=i-t,h=n,d=Math.min(l,h),c=e.start;let u=!1;const g=e.end;let p=!1;t<=c&&g<=i&&function(e){return(32&e.metadata)>>>5==1}(e)&&(e.start=t,u=!0,e.end=t,p=!0);{const e=o?1:l>0?2:0;!u&&rMe(c,r,t,e)&&(u=!0),!p&&rMe(g,a,t,e)&&(p=!0)}if(d>0&&!o){const e=l>h?2:0;!u&&rMe(c,r,t+d,e)&&(u=!0),!p&&rMe(g,a,t+d,e)&&(p=!0)}{const n=o?1:0;!u&&rMe(c,r,i,n)&&(e.start=t+h,u=!0),!p&&rMe(g,a,i,n)&&(e.end=t+h,p=!0)}const m=h-l;u||(e.start=Math.max(0,c+m)),p||(e.end=Math.max(0,g+m)),e.start>e.end&&(e.end=e.start)}function lMe(e,t){if(e.root===oMe)return t.parent=oMe,t.left=oMe,t.right=oMe,YIe(t,0),e.root=t,e.root;!function(e,t){let i=0,n=e.root;const o=t.start,s=t.end;for(;;)if(r=o,a=s,l=n.start+i,h=n.end+i,(r===l?a-h:r-l)<0){if(n.left===oMe){t.start-=i,t.end-=i,t.maxEnd-=i,n.left=t;break}n=n.left}else{if(n.right===oMe){t.start-=i+n.delta,t.end-=i+n.delta,t.maxEnd-=i+n.delta,n.right=t;break}i+=n.delta,n=n.right}var r,a,l,h;t.parent=n,t.left=oMe,t.right=oMe,YIe(t,1)}(e,t),mMe(t.parent);let i=t;for(;i!==e.root&&1===ZIe(i.parent);)if(i.parent===i.parent.parent.left){const t=i.parent.parent.right;1===ZIe(t)?(YIe(i.parent,0),YIe(t,0),YIe(i.parent.parent,1),i=i.parent.parent):(i===i.parent.right&&(i=i.parent,cMe(e,i)),YIe(i.parent,0),YIe(i.parent.parent,1),uMe(e,i.parent.parent))}else{const t=i.parent.parent.left;1===ZIe(t)?(YIe(i.parent,0),YIe(t,0),YIe(i.parent.parent,1),i=i.parent.parent):(i===i.parent.left&&(i=i.parent,uMe(e,i)),YIe(i.parent,0),YIe(i.parent.parent,1),cMe(e,i.parent.parent))}return YIe(e.root,0),t}function hMe(e,t){let i,n;if(t.left===oMe?(i=t.right,n=t,i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta):t.right===oMe?(i=t.left,n=t):(n=function(e){for(;e.left!==oMe;)e=e.left;return e}(t.right),i=n.right,i.start+=n.delta,i.end+=n.delta,i.delta+=n.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta,n.delta=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0)),n===e.root)return e.root=i,YIe(i,0),t.detach(),dMe(),pMe(i),void(e.root.parent=oMe);const o=1===ZIe(n);if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?i.parent=n.parent:(n.parent===t?i.parent=n:i.parent=n.parent,n.left=t.left,n.right=t.right,n.parent=t.parent,YIe(n,ZIe(t)),t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==oMe&&(n.left.parent=n),n.right!==oMe&&(n.right.parent=n)),t.detach(),o)return mMe(i.parent),n!==t&&(mMe(n),mMe(n.parent)),void dMe();let s;for(mMe(i),mMe(i.parent),n!==t&&(mMe(n),mMe(n.parent));i!==e.root&&0===ZIe(i);)i===i.parent.left?(s=i.parent.right,1===ZIe(s)&&(YIe(s,0),YIe(i.parent,1),cMe(e,i.parent),s=i.parent.right),0===ZIe(s.left)&&0===ZIe(s.right)?(YIe(s,1),i=i.parent):(0===ZIe(s.right)&&(YIe(s.left,0),YIe(s,1),uMe(e,s),s=i.parent.right),YIe(s,ZIe(i.parent)),YIe(i.parent,0),YIe(s.right,0),cMe(e,i.parent),i=e.root)):(s=i.parent.left,1===ZIe(s)&&(YIe(s,0),YIe(i.parent,1),uMe(e,i.parent),s=i.parent.left),0===ZIe(s.left)&&0===ZIe(s.right)?(YIe(s,1),i=i.parent):(0===ZIe(s.left)&&(YIe(s.right,0),YIe(s,1),cMe(e,s),s=i.parent.left),YIe(s,ZIe(i.parent)),YIe(i.parent,0),YIe(s.left,0),uMe(e,i.parent),i=e.root));YIe(i,0),dMe()}function dMe(){oMe.parent=oMe,oMe.delta=0,oMe.start=0,oMe.end=0}function cMe(e,t){const i=t.right;i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta,t.right=i.left,i.left!==oMe&&(i.left.parent=t),i.parent=t.parent,t.parent===oMe?e.root=i:t===t.parent.left?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i,pMe(t),pMe(i)}function uMe(e,t){const i=t.left;t.delta-=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(e.requestNormalizeDelta=!0),t.start-=i.delta,t.end-=i.delta,t.left=i.right,i.right!==oMe&&(i.right.parent=t),i.parent=t.parent,t.parent===oMe?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i,pMe(t),pMe(i)}function gMe(e){let t=e.end;if(e.left!==oMe){const i=e.left.maxEnd;i>t&&(t=i)}if(e.right!==oMe){const i=e.right.maxEnd+e.delta;i>t&&(t=i)}return t}function pMe(e){e.maxEnd=gMe(e)}function mMe(e){for(;e!==oMe;){const t=gMe(e);if(e.maxEnd===t)return;e.maxEnd=t,e=e.parent}}class fMe{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==_Me)return vMe(this.right);let e=this;for(;e.parent!==_Me&&e.parent.left!==e;)e=e.parent;return e.parent===_Me?_Me:e.parent}prev(){if(this.left!==_Me)return bMe(this.left);let e=this;for(;e.parent!==_Me&&e.parent.right!==e;)e=e.parent;return e.parent===_Me?_Me:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const _Me=new fMe(null,0);function vMe(e){for(;e.left!==_Me;)e=e.left;return e}function bMe(e){for(;e.right!==_Me;)e=e.right;return e}function wMe(e){return e===_Me?0:e.size_left+e.piece.length+wMe(e.right)}function CMe(e){return e===_Me?0:e.lf_left+e.piece.lineFeedCnt+CMe(e.right)}function yMe(){_Me.parent=_Me}function SMe(e,t){const i=t.right;i.size_left+=t.size_left+(t.piece?t.piece.length:0),i.lf_left+=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),t.right=i.left,i.left!==_Me&&(i.left.parent=t),i.parent=t.parent,t.parent===_Me?e.root=i:t.parent.left===t?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i}function kMe(e,t){const i=t.left;t.left=i.right,i.right!==_Me&&(i.right.parent=t),i.parent=t.parent,t.size_left-=i.size_left+(i.piece?i.piece.length:0),t.lf_left-=i.lf_left+(i.piece?i.piece.lineFeedCnt:0),t.parent===_Me?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i}function LMe(e,t){let i,n;if(t.left===_Me?(n=t,i=n.right):t.right===_Me?(n=t,i=n.left):(n=vMe(t.right),i=n.right),n===e.root)return e.root=i,i.color=0,t.detach(),yMe(),void(e.root.parent=_Me);const o=1===n.color;if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?(i.parent=n.parent,EMe(e,i)):(n.parent===t?i.parent=n:i.parent=n.parent,EMe(e,i),n.left=t.left,n.right=t.right,n.parent=t.parent,n.color=t.color,t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==_Me&&(n.left.parent=n),n.right!==_Me&&(n.right.parent=n),n.size_left=t.size_left,n.lf_left=t.lf_left,EMe(e,n)),t.detach(),i.parent.left===i){const t=wMe(i),n=CMe(i);if(t!==i.parent.size_left||n!==i.parent.lf_left){const o=t-i.parent.size_left,s=n-i.parent.lf_left;i.parent.size_left=t,i.parent.lf_left=n,DMe(e,i.parent,o,s)}}if(EMe(e,i.parent),o)return void yMe();let s;for(;i!==e.root&&0===i.color;)i===i.parent.left?(s=i.parent.right,1===s.color&&(s.color=0,i.parent.color=1,SMe(e,i.parent),s=i.parent.right),0===s.left.color&&0===s.right.color?(s.color=1,i=i.parent):(0===s.right.color&&(s.left.color=0,s.color=1,kMe(e,s),s=i.parent.right),s.color=i.parent.color,i.parent.color=0,s.right.color=0,SMe(e,i.parent),i=e.root)):(s=i.parent.left,1===s.color&&(s.color=0,i.parent.color=1,kMe(e,i.parent),s=i.parent.left),0===s.left.color&&0===s.right.color?(s.color=1,i=i.parent):(0===s.left.color&&(s.right.color=0,s.color=1,SMe(e,s),s=i.parent.left),s.color=i.parent.color,i.parent.color=0,s.left.color=0,kMe(e,i.parent),i=e.root));i.color=0,yMe()}function xMe(e,t){for(EMe(e,t);t!==e.root&&1===t.parent.color;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.right&&SMe(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,kMe(e,t.parent.parent))}else{const i=t.parent.parent.left;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.left&&kMe(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,SMe(e,t.parent.parent))}e.root.color=0}function DMe(e,t,i,n){for(;t!==e.root&&t!==_Me;)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}function EMe(e,t){let i=0,n=0;if(t!==e.root){for(;t!==e.root&&t===t.parent.right;)t=t.parent;if(t!==e.root)for(i=wMe((t=t.parent).left)-t.size_left,n=CMe(t.left)-t.lf_left,t.size_left+=i,t.lf_left+=n;t!==e.root&&(0!==i||0!==n);)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}}_Me.parent=_Me,_Me.left=_Me,_Me.right=_Me,_Me.color=0;const NMe=65535;function IMe(e){let t;return t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length),t.set(e,0),t}class MMe{constructor(e,t,i,n,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=o}}function TMe(e,t=!0){const i=[0];let n=1;for(let t=0,o=e.length;t<o;t++){const s=e.charCodeAt(t);13===s?t+1<o&&10===e.charCodeAt(t+1)?(i[n++]=t+2,t++):i[n++]=t+1:10===s&&(i[n++]=t+1)}return t?IMe(i):i}class AMe{constructor(e,t,i,n,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=o}}class RMe{constructor(e,t){this.buffer=e,this.lineStarts=t}}class OMe{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==_Me&&e.iterate(e.root,(e=>(e!==_Me&&this._pieces.push(e.piece),!0)))}read(){return 0===this._pieces.length?0===this._index?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:0===this._index?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class PMe{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber<e&&i.nodeStartLineNumber+i.node.piece.lineFeedCnt>=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const i=this._cache;for(let n=0;n<i.length;n++){const o=i[n];(null===o.node.parent||o.nodeStartOffset>=e)&&(i[n]=null,t=!0)}if(t){const e=[];for(const t of i)null!==t&&e.push(t);this._cache=e}}}class FMe{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new RMe("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=_Me,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let t=0,i=e.length;t<i;t++)if(e[t].buffer.length>0){e[t].lineStarts||(e[t].lineStarts=TMe(e[t].buffer));const i=new AMe(t+1,{line:0,column:0},{line:e[t].lineStarts.length-1,column:e[t].buffer.length-e[t].lineStarts[e[t].lineStarts.length-1]},e[t].lineStarts.length-1,e[t].buffer.length);this._buffers.push(e[t]),n=this.rbInsertRight(n,i)}this._searchCache=new PMe(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=65535-Math.floor(21845),i=2*t;let n="",o=0;const s=[];if(this.iterate(this.root,(r=>{const a=this.getNodeContent(r),l=a.length;if(o<=t||o+l<i)return n+=a,o+=l,!0;const h=n.replace(/\r\n|\r|\n/g,e);return s.push(new RMe(h,TMe(h))),n=a,o=l,!0})),o>0){const t=n.replace(/\r\n|\r|\n/g,e);s.push(new RMe(t,TMe(t)))}this.create(s,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new OMe(this,e)}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==_Me;)if(n.left!==_Me&&n.lf_left+1>=e)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt+1>=e)return i+=n.size_left,i+(this.getAccumulatedValue(n,e-n.lf_left-2)+t-1);e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right}return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const n=e;for(;t!==_Me;)if(0!==t.size_left&&t.size_left>=e)t=t.left;else{if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+o.index,0===o.index){const e=this.getOffsetAt(i+1,1);return new Rle(i+1,n-e+1)}return new Rle(i+1,o.remainder+1)}if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===_Me){const t=this.getOffsetAt(i+1,1);return new Rle(i+1,n-e-t+1)}t=t.right}return new Rle(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const i=this.nodeAt2(e.startLineNumber,e.startColumn),n=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,n);return t?t===this._EOL&&this._EOLNormalized&&t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const i=e.node,n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n.substring(o+e.remainder,o+t.remainder)}let i=e.node;const n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let s=n.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==_Me;){const e=this._buffers[i.piece.bufferIndex].buffer,n=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){s+=e.substring(n,n+t.remainder);break}s+=e.substr(n,i.piece.length),i=i.next()}return s}getLinesContent(){const e=[];let t=0,i="",n=!1;return this.iterate(this.root,(o=>{if(o===_Me)return!0;const s=o.piece;let r=s.length;if(0===r)return!0;const a=this._buffers[s.bufferIndex].buffer,l=this._buffers[s.bufferIndex].lineStarts,h=s.start.line,d=s.end.line;let c=l[h]+s.start.column;if(n&&(10===a.charCodeAt(c)&&(c++,r--),e[t++]=i,i="",n=!1,0===r))return!0;if(h===d)return this._EOLNormalized||13!==a.charCodeAt(c+r-1)?i+=a.substr(c,r):(n=!0,i+=a.substr(c,r-1)),!0;i+=this._EOLNormalized?a.substring(c,Math.max(c,l[h+1]-this._EOLLength)):a.substring(c,l[h+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let n=h+1;n<d;n++)i=this._EOLNormalized?a.substring(l[n],l[n+1]-this._EOLLength):a.substring(l[n],l[n+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;return this._EOLNormalized||13!==a.charCodeAt(l[d]+s.end.column-1)?i=a.substr(l[d],s.end.column):(n=!0,0===s.end.column?t--:i=a.substr(l[d],s.end.column-1)),!0})),n&&(e[t++]=i,i=""),e[t++]=i,e}getLength(){return this._length}getLineCount(){return this._lineCnt}getLineContent(e){return this._lastVisitedLine.lineNumber===e||(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,"")),this._lastVisitedLine.value}_getCharCode(e){if(e.remainder===e.node.piece.length){const t=e.node.next();if(!t)return 0;const i=this._buffers[t.piece.bufferIndex],n=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start);return i.buffer.charCodeAt(n)}{const t=this._buffers[e.node.piece.bufferIndex],i=this.offsetInBuffer(e.node.piece.bufferIndex,e.node.piece.start)+e.remainder;return t.buffer.charCodeAt(i)}}getLineCharCode(e,t){const i=this.nodeAt2(e,t+1);return this._getCharCode(i)}getLineLength(e){if(e===this.getLineCount()){const t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength}findMatchesInNode(e,t,i,n,o,s,r,a,l,h,d){const c=this._buffers[e.piece.bufferIndex],u=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),g=this.offsetInBuffer(e.piece.bufferIndex,o),p=this.offsetInBuffer(e.piece.bufferIndex,s);let m;const f={line:0,column:0};let _,v;t._wordSeparators?(_=c.buffer.substring(g,p),v=e=>e+g,t.reset(0)):(_=c.buffer,v=e=>e,t.reset(g));do{if(m=t.next(_),m){if(v(m.index)>=p)return h;this.positionInBuffer(e,v(m.index)-u,f);const t=this.getLineFeedCnt(e.piece.bufferIndex,o,f),s=f.line===o.line?f.column-o.column+n:f.column+1,r=s+m[0].length;if(d[h++]=rme(new Ole(i+t,s,i+t,r),m,a),v(m.index)+m[0].length>=p)return h;if(h>=l)return h}}while(m);return h}findMatchesLineByLine(e,t,i,n){const o=[];let s=0;const r=new dme(t.wordSeparators,t.regex);let a=this.nodeAt2(e.startLineNumber,e.startColumn);if(null===a)return[];const l=this.nodeAt2(e.endLineNumber,e.endColumn);if(null===l)return[];let h=this.positionInBuffer(a.node,a.remainder);const d=this.positionInBuffer(l.node,l.remainder);if(a.node===l.node)return this.findMatchesInNode(a.node,r,e.startLineNumber,e.startColumn,h,d,t,i,n,s,o),o;let c=e.startLineNumber,u=a.node;for(;u!==l.node;){const l=this.getLineFeedCnt(u.piece.bufferIndex,h,u.piece.end);if(l>=1){const a=this._buffers[u.piece.bufferIndex].lineStarts,d=this.offsetInBuffer(u.piece.bufferIndex,u.piece.start),g=a[h.line+l],p=c===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(u,r,c,p,h,this.positionInBuffer(u,g-d),t,i,n,s,o),s>=n)return o;c+=l}const d=c===e.startLineNumber?e.startColumn-1:0;if(c===e.endLineNumber){const a=this.getLineContent(c).substring(d,e.endColumn-1);return s=this._findMatchesInLine(t,r,a,e.endLineNumber,d,s,o,i,n),o}if(s=this._findMatchesInLine(t,r,this.getLineContent(c).substr(d),c,d,s,o,i,n),s>=n)return o;c++,a=this.nodeAt2(c,1),u=a.node,h=this.positionInBuffer(a.node,a.remainder)}if(c===e.endLineNumber){const a=c===e.startLineNumber?e.startColumn-1:0,l=this.getLineContent(c).substring(a,e.endColumn-1);return s=this._findMatchesInLine(t,r,l,e.endLineNumber,a,s,o,i,n),o}const g=c===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(l.node,r,c,g,h,d,t,i,n,s,o),o}_findMatchesInLine(e,t,i,n,o,s,r,a,l){const h=e.wordSeparators;if(!a&&e.simpleSearch){const t=e.simpleSearch,a=t.length,d=i.length;let c=-a;for(;-1!==(c=i.indexOf(t,c+a));)if((!h||hme(h,i,d,c,a))&&(r[s++]=new hue(new Ole(n,c+1+o,n,c+1+a+o),null),s>=l))return s;return s}let d;t.reset(0);do{if(d=t.next(i),d&&(r[s++]=rme(new Ole(n,d.index+1+o,n,d.index+1+d[0].length+o),d,a),s>=l))return s}while(d);return s}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==_Me){const{node:i,remainder:n,nodeStartOffset:o}=this.nodeAt(e),s=i.piece,r=s.bufferIndex,a=this.positionInBuffer(i,n);if(0===i.piece.bufferIndex&&s.end.line===this._lastChangeBufferPos.line&&s.end.column===this._lastChangeBufferPos.column&&o+s.length===e&&t.length<NMe)return this.appendToNode(i,t),void this.computeBufferMetadata();if(o===e)this.insertContentToNodeLeft(t,i),this._searchCache.validate(e);else if(o+i.piece.length>e){const e=[];let o=new AMe(s.bufferIndex,a,s.end,this.getLineFeedCnt(s.bufferIndex,a,s.end),this.offsetInBuffer(r,s.end)-this.offsetInBuffer(r,a));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&10===this.nodeCharCodeAt(i,n)){const e={line:o.start.line+1,column:0};o=new AMe(o.bufferIndex,e,o.end,this.getLineFeedCnt(o.bufferIndex,e,o.end),o.length-1),t+="\n"}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(13===this.nodeCharCodeAt(i,n-1)){const o=this.positionInBuffer(i,n-1);this.deleteNodeTail(i,o),t="\r"+t,0===i.piece.length&&e.push(i)}else this.deleteNodeTail(i,a);else this.deleteNodeTail(i,a);const l=this.createNewPieces(t);o.length>0&&this.rbInsertRight(i,o);let h=i;for(let e=0;e<l.length;e++)h=this.rbInsertRight(h,l[e]);this.deleteNodes(e)}else this.insertContentToNodeRight(t,i)}else{const e=this.createNewPieces(t);let i=this.rbInsertLeft(null,e[0]);for(let t=1;t<e.length;t++)i=this.rbInsertRight(i,e[t])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===_Me)return;const i=this.nodeAt(e),n=this.nodeAt(e+t),o=i.node,s=n.node;if(o===s){const s=this.positionInBuffer(o,i.remainder),r=this.positionInBuffer(o,n.remainder);if(i.nodeStartOffset===e){if(t===o.piece.length){const e=o.next();return LMe(this,o),this.validateCRLFWithPrevNode(e),void this.computeBufferMetadata()}return this.deleteNodeHead(o,r),this._searchCache.validate(e),this.validateCRLFWithPrevNode(o),void this.computeBufferMetadata()}return i.nodeStartOffset+o.piece.length===e+t?(this.deleteNodeTail(o,s),this.validateCRLFWithNextNode(o),void this.computeBufferMetadata()):(this.shrinkNode(o,s,r),void this.computeBufferMetadata())}const r=[],a=this.positionInBuffer(o,i.remainder);this.deleteNodeTail(o,a),this._searchCache.validate(e),0===o.piece.length&&r.push(o);const l=this.positionInBuffer(s,n.remainder);this.deleteNodeHead(s,l),0===s.piece.length&&r.push(s);for(let e=o.next();e!==_Me&&e!==s;e=e.next())r.push(e);const h=0===o.piece.length?o.prev():o;this.deleteNodes(r),this.validateCRLFWithNextNode(h),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){const i=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){const n=t.piece,o={line:n.start.line+1,column:0},s=new AMe(n.bufferIndex,o,n.end,this.getLineFeedCnt(n.bufferIndex,o,n.end),n.length-1);t.piece=s,e+="\n",DMe(this,t,-1,-1),0===t.piece.length&&i.push(t)}const n=this.createNewPieces(e);let o=this.rbInsertLeft(t,n[n.length-1]);for(let e=n.length-2;e>=0;e--)o=this.rbInsertLeft(o,n[e]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+="\n");const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let o=n;for(let e=1;e<i.length;e++)o=this.rbInsertRight(o,i[e]);this.validateCRLFWithPrevNode(n)}positionInBuffer(e,t,i){const n=e.piece,o=e.piece.bufferIndex,s=this._buffers[o].lineStarts,r=s[n.start.line]+n.start.column+t;let a=n.start.line,l=n.end.line,h=0,d=0,c=0;for(;a<=l&&(h=a+(l-a)/2|0,c=s[h],h!==l);)if(d=s[h+1],r<c)l=h-1;else{if(!(r>=d))break;a=h+1}return i?(i.line=h,i.column=r-c,null):{line:h,column:r-c}}getLineFeedCnt(e,t,i){if(0===i.column)return i.line-t.line;const n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;const o=n[i.line+1],s=n[i.line]+i.column;if(o>s+1)return i.line-t.line;const r=s-1;return 13===this._buffers[e].buffer.charCodeAt(r)?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;t<e.length;t++)LMe(this,e[t])}createNewPieces(e){if(e.length>NMe){const t=[];for(;e.length>NMe;){const i=e.charCodeAt(65534);let n;13===i||i>=55296&&i<=56319?(n=e.substring(0,65534),e=e.substring(65534)):(n=e.substring(0,NMe),e=e.substring(NMe));const o=TMe(n);t.push(new AMe(this._buffers.length,{line:0,column:0},{line:o.length-1,column:n.length-o[o.length-1]},o.length-1,n.length)),this._buffers.push(new RMe(n,o))}const i=TMe(e);return t.push(new AMe(this._buffers.length,{line:0,column:0},{line:i.length-1,column:e.length-i[i.length-1]},i.length-1,e.length)),this._buffers.push(new RMe(e,i)),t}let t=this._buffers[0].buffer.length;const i=TMe(e,!1);let n=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&0!==t&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},n=this._lastChangeBufferPos;for(let e=0;e<i.length;e++)i[e]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+="_"+e,t+=1}else{if(0!==t)for(let e=0;e<i.length;e++)i[e]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+=e}const o=this._buffers[0].buffer.length,s=this._buffers[0].lineStarts.length-1,r={line:s,column:o-this._buffers[0].lineStarts[s]},a=new AMe(0,n,r,this.getLineFeedCnt(0,n,r),o-t);return this._lastChangeBufferPos=r,[a]}getLineRawContent(e,t=0){let i=this.root,n="";const o=this._searchCache.get2(e);if(o){i=o.node;const s=this.getAccumulatedValue(i,e-o.nodeStartLineNumber-1),r=this._buffers[i.piece.bufferIndex].buffer,a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(o.nodeStartLineNumber+i.piece.lineFeedCnt!==e){const n=this.getAccumulatedValue(i,e-o.nodeStartLineNumber);return r.substring(a+s,a+n-t)}n=r.substring(a+s,a+i.piece.length)}else{let o=0;const s=e;for(;i!==_Me;)if(i.left!==_Me&&i.lf_left>=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){const n=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return o+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:o,nodeStartLineNumber:s-(e-1-i.lf_left)}),a.substring(l+n,l+r-t)}if(i.lf_left+i.piece.lineFeedCnt===e-1){const t=this.getAccumulatedValue(i,e-i.lf_left-2),o=this._buffers[i.piece.bufferIndex].buffer,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=o.substring(s+t,s+i.piece.length);break}e-=i.lf_left+i.piece.lineFeedCnt,o+=i.size_left+i.piece.length,i=i.right}}for(i=i.next();i!==_Me;){const e=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(i,0),s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=e.substring(s,s+o-t),n}{const t=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=e.substr(t,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==_Me;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){const i=e.piece,n=this.positionInBuffer(e,t),o=n.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const t=this.getLineFeedCnt(e.piece.bufferIndex,i.start,n);if(t!==o)return{index:t,remainder:0}}return{index:o,remainder:n.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,n=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?n[i.end.line]+i.end.column-n[i.start.line]-i.start.column:n[o]-n[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),s=t,r=this.offsetInBuffer(i.bufferIndex,s),a=this.getLineFeedCnt(i.bufferIndex,i.start,s),l=a-n,h=r-o,d=i.length+h;e.piece=new AMe(i.bufferIndex,i.start,s,a,d),DMe(this,e,h,l)}deleteNodeHead(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),s=t,r=this.getLineFeedCnt(i.bufferIndex,s,i.end),a=r-n,l=o-this.offsetInBuffer(i.bufferIndex,s),h=i.length+l;e.piece=new AMe(i.bufferIndex,s,i.end,r,h),DMe(this,e,l,a)}shrinkNode(e,t,i){const n=e.piece,o=n.start,s=n.end,r=n.length,a=n.lineFeedCnt,l=t,h=this.getLineFeedCnt(n.bufferIndex,n.start,l),d=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,o);e.piece=new AMe(n.bufferIndex,n.start,l,h,d),DMe(this,e,d-r,h-a);const c=new AMe(n.bufferIndex,i,s,this.getLineFeedCnt(n.bufferIndex,i,s),this.offsetInBuffer(n.bufferIndex,s)-this.offsetInBuffer(n.bufferIndex,i)),u=this.rbInsertRight(e,c);this.validateCRLFWithPrevNode(u)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+="\n");const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=TMe(t,!1);for(let e=0;e<o.length;e++)o[e]+=n;if(i){const e=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:n-e}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(o.slice(1));const s=this._buffers[0].lineStarts.length-1,r={line:s,column:this._buffers[0].buffer.length-this._buffers[0].lineStarts[s]},a=e.piece.length+t.length,l=e.piece.lineFeedCnt,h=this.getLineFeedCnt(0,e.piece.start,r),d=h-l;e.piece=new AMe(e.piece.bufferIndex,e.piece.start,r,h,a),this._lastChangeBufferPos=r,DMe(this,e,t.length,d)}nodeAt(e){let t=this.root;const i=this._searchCache.get(e);if(i)return{node:i.node,nodeStartOffset:i.nodeStartOffset,remainder:e-i.nodeStartOffset};let n=0;for(;t!==_Me;)if(t.size_left>e)t=t.left;else{if(t.size_left+t.piece.length>=e){n+=t.size_left;const i={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(i),i}e-=t.size_left+t.piece.length,n+=t.size_left+t.piece.length,t=t.right}return null}nodeAt2(e,t){let i=this.root,n=0;for(;i!==_Me;)if(i.left!==_Me&&i.lf_left>=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2),s=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(o+t-1,s),nodeStartOffset:n}}if(i.lf_left+i.piece.lineFeedCnt===e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:n};t-=i.piece.length-o;break}e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==_Me;){if(i.piece.lineFeedCnt>0){const e=this.getAccumulatedValue(i,0),n=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,e),nodeStartOffset:n}}if(i.piece.length>=t-1)return{node:i,remainder:t-1,nodeStartOffset:this.offsetOfNode(i)};t-=i.piece.length,i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(n)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&"\n"===this._EOL)}startWithLF(e){if("string"==typeof e)return 10===e.charCodeAt(0);if(e===_Me||0===e.piece.lineFeedCnt)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,o=i[n]+t.start.column;return n!==i.length-1&&(!(i[n+1]>o+1)&&10===this._buffers[t.bufferIndex].buffer.charCodeAt(o))}endWithCR(e){return"string"==typeof e?13===e.charCodeAt(e.length-1):e!==_Me&&0!==e.piece.lineFeedCnt&&13===this.nodeCharCodeAt(e,e.piece.length-1)}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],n=this._buffers[e.piece.bufferIndex].lineStarts;let o;o=0===e.piece.end.column?{line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};const s=e.piece.length-1,r=e.piece.lineFeedCnt-1;e.piece=new AMe(e.piece.bufferIndex,e.piece.start,o,r,s),DMe(this,e,-1,-1),0===e.piece.length&&i.push(e);const a={line:t.piece.start.line+1,column:0},l=t.piece.length-1,h=this.getLineFeedCnt(t.piece.bufferIndex,a,t.piece.end);t.piece=new AMe(t.piece.bufferIndex,a,t.piece.end,h,l),DMe(this,t,-1,-1),0===t.piece.length&&i.push(t);const d=this.createNewPieces("\r\n");this.rbInsertRight(e,d[0]);for(let e=0;e<i.length;e++)LMe(this,i[e])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const i=t.next();if(this.startWithLF(i)){if(e+="\n",1===i.piece.length)LMe(this,i);else{const e=i.piece,t={line:e.start.line+1,column:0},n=e.length-1,o=this.getLineFeedCnt(e.bufferIndex,t,e.end);i.piece=new AMe(e.bufferIndex,t,e.end,o,n),DMe(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===_Me)return t(_Me);const i=this.iterate(e.left,t);return i?t(e)&&this.iterate(e.right,t):i}getNodeContent(e){if(e===_Me)return"";const t=this._buffers[e.piece.bufferIndex],i=e.piece,n=this.offsetInBuffer(i.bufferIndex,i.start),o=this.offsetInBuffer(i.bufferIndex,i.end);return t.buffer.substring(n,o)}getPieceContent(e){const t=this._buffers[e.bufferIndex],i=this.offsetInBuffer(e.bufferIndex,e.start),n=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(i,n)}rbInsertRight(e,t){const i=new fMe(t,1);if(i.left=_Me,i.right=_Me,i.parent=_Me,i.size_left=0,i.lf_left=0,this.root===_Me)this.root=i,i.color=0;else if(e.right===_Me)e.right=i,i.parent=e;else{const t=vMe(e.right);t.left=i,i.parent=t}return xMe(this,i),i}rbInsertLeft(e,t){const i=new fMe(t,1);if(i.left=_Me,i.right=_Me,i.parent=_Me,i.size_left=0,i.lf_left=0,this.root===_Me)this.root=i,i.color=0;else if(e.left===_Me)e.left=i,i.parent=e;else{const t=bMe(e.left);t.right=i,i.parent=t}return xMe(this,i),i}}class BMe extends aae{constructor(e,t,i,n,o,s,r){super(),this._onDidChangeContent=this._register(new bae),this._BOM=t,this._mightContainNonBasicASCII=!s,this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._pieceTree=new FMe(e,i,r)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:"")}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){const i=e+t,n=this.getPositionAt(e),o=this.getPositionAt(i);return new Ole(n.lineNumber,n.column,o.lineNumber,o.column)}getValueInRange(e,t=0){if(e.isEmpty())return"";const i=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,i)}getValueLengthInRange(e,t=0){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;const i=this.getOffsetAt(e.startLineNumber,e.startColumn),n=this.getOffsetAt(e.endLineNumber,e.endColumn);let o=0;const s=this._getEndOfLine(t),r=this.getEOL();return s.length!==r.length&&(o=(s.length-r.length)*(e.endLineNumber-e.startLineNumber)),n-i+o}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0;const n=e.startLineNumber,o=e.endLineNumber;for(let t=n;t<=o;t++){const s=this.getLineContent(t),r=t===n?e.startColumn-1:0,a=t===o?e.endColumn-1:s.length;for(let e=r;e<a;e++)pde(s.charCodeAt(e))?(i+=1,e+=1):i+=1}return i+=this._getEndOfLine(t).length*(o-n),i}return this.getValueLengthInRange(e,t)}getLength(){return this._pieceTree.getLength()}getLineCount(){return this._pieceTree.getLineCount()}getLinesContent(){return this._pieceTree.getLinesContent()}getLineContent(e){return this._pieceTree.getLineContent(e)}getLineCharCode(e,t){return this._pieceTree.getLineCharCode(e,t)}getLineLength(e){return this._pieceTree.getLineLength(e)}getLineFirstNonWhitespaceColumn(e){const t=ede(this.getLineContent(e));return-1===t?0:t+1}getLineLastNonWhitespaceColumn(e){const t=ide(this.getLineContent(e));return-1===t?0:t+2}_getEndOfLine(e){switch(e){case 1:return"\n";case 2:return"\r\n";case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,i){let n=this._mightContainRTL,o=this._mightContainUnusualLineTerminators,s=this._mightContainNonBasicASCII,r=!0,a=[];for(let t=0;t<e.length;t++){const i=e[t];r&&i._isTracked&&(r=!1);const l=i.range;if(i.text){let e=!0;s||(e=!Lde(i.text),s=e),!n&&e&&(n=Sde(i.text)),!o&&e&&(o=Dde(i.text))}let h="",d=0,c=0,u=0;if(i.text){let e;[d,c,u,e]=cNe(i.text);const t=this.getEOL();h=0===e||e===("\r\n"===t?2:1)?i.text:i.text.replace(/\r\n|\r|\n/g,t)}a[t]={sortIndex:t,identifier:i.identifier||null,range:l,rangeOffset:this.getOffsetAt(l.startLineNumber,l.startColumn),rangeLength:this.getValueLengthInRange(l),text:h,eolCount:d,firstLineLength:c,lastLineLength:u,forceMoveMarkers:Boolean(i.forceMoveMarkers),isAutoWhitespaceEdit:i.isAutoWhitespaceEdit||!1}}a.sort(BMe._sortOpsAscending);let l=!1;for(let e=0,t=a.length-1;e<t;e++){const t=a[e].range.getEndPosition(),i=a[e+1].range.getStartPosition();if(i.isBeforeOrEqual(t)){if(i.isBefore(t))throw new Error("Overlapping ranges are not allowed!");l=!0}}r&&(a=this._reduceOperations(a));const h=i||t?BMe._getInverseEditRanges(a):[],d=[];if(t)for(let e=0;e<a.length;e++){const t=a[e],i=h[e];if(t.isAutoWhitespaceEdit&&t.range.isEmpty())for(let e=i.startLineNumber;e<=i.endLineNumber;e++){let n="";e===i.startLineNumber&&(n=this.getLineContent(t.range.startLineNumber),-1!==ede(n))||d.push({lineNumber:e,oldContent:n})}}let c=null;if(i){let e=0;c=[];for(let t=0;t<a.length;t++){const i=a[t],n=h[t],o=this.getValueInRange(i.range),s=i.rangeOffset+e;e+=i.text.length-o.length,c[t]={sortIndex:i.sortIndex,identifier:i.identifier,range:n,text:o,textChange:new SIe(i.rangeOffset,o,s,i.text)}}l||c.sort(((e,t)=>e.sortIndex-t.sortIndex))}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=s;const u=this._doApplyEdits(a);let g=null;if(t&&d.length>0){d.sort(((e,t)=>t.lineNumber-e.lineNumber)),g=[];for(let e=0,t=d.length;e<t;e++){const t=d[e].lineNumber;if(e>0&&d[e-1].lineNumber===t)continue;const i=d[e].oldContent,n=this.getLineContent(t);0!==n.length&&n!==i&&-1===ede(n)&&g.push(t)}}return this._onDidChangeContent.fire(),new uue(c,u,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,n=e[e.length-1].range,o=new Ole(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let s=i.startLineNumber,r=i.startColumn;const a=[];for(let i=0,n=e.length;i<n;i++){const n=e[i],o=n.range;t=t||n.forceMoveMarkers,a.push(this.getValueInRange(new Ole(s,r,o.startLineNumber,o.startColumn))),n.text.length>0&&a.push(n.text),s=o.endLineNumber,r=o.endColumn}const l=a.join(""),[h,d,c]=cNe(l);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:l,eolCount:h,firstLineLength:d,lastLineLength:c,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(BMe._sortOpsDescending);const t=[];for(let i=0;i<e.length;i++){const n=e[i],o=n.range.startLineNumber,s=n.range.startColumn,r=n.range.endLineNumber,a=n.range.endColumn;if(o===r&&s===a&&0===n.text.length)continue;n.text?(this._pieceTree.delete(n.rangeOffset,n.rangeLength),this._pieceTree.insert(n.rangeOffset,n.text,!0)):this._pieceTree.delete(n.rangeOffset,n.rangeLength);const l=new Ole(o,s,r,a);t.push({range:l,rangeLength:n.rangeLength,text:n.text,rangeOffset:n.rangeOffset,forceMoveMarkers:n.forceMoveMarkers})}return t}findMatchesLineByLine(e,t,i,n){return this._pieceTree.findMatchesLineByLine(e,t,i,n)}static _getInverseEditRanges(e){const t=[];let i=0,n=0,o=null;for(let s=0,r=e.length;s<r;s++){const r=e[s];let a,l,h;if(o?o.range.endLineNumber===r.range.startLineNumber?(a=i,l=n+(r.range.startColumn-o.range.endColumn)):(a=i+(r.range.startLineNumber-o.range.endLineNumber),l=r.range.startColumn):(a=r.range.startLineNumber,l=r.range.startColumn),r.text.length>0){const e=r.eolCount+1;h=1===e?new Ole(a,l,a,l+r.firstLineLength):new Ole(a,l,a+e-1,r.lastLineLength+1)}else h=new Ole(a,l,a,l);i=h.endLineNumber,n=h.endColumn,t.push(h),o=r}return t}static _sortOpsAscending(e,t){const i=Ole.compareRangesUsingEnds(e.range,t.range);return 0===i?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=Ole.compareRangesUsingEnds(e.range,t.range);return 0===i?t.sortIndex-e.sortIndex:-i}}class WMe{constructor(e,t,i,n,o,s,r,a,l){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=o,this._containsRTL=s,this._containsUnusualLineTerminators=r,this._isBasicASCII=a,this._normalizeEOL=l}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return 0===t?1===e?"\n":"\r\n":i>t/2?"\r\n":"\n"}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&("\r\n"===t&&(this._cr>0||this._lf>0)||"\n"===t&&(this._cr>0||this._crlf>0)))for(let e=0,n=i.length;e<n;e++){const n=i[e].buffer.replace(/\r\n|\r|\n/g,t),o=TMe(n);i[e]=new RMe(n,o)}const n=new BMe(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:n,disposable:n}}}class VMe{constructor(){this.chunks=[],this.BOM="",this._hasPreviousChar=!1,this._previousChar=0,this._tmpLineStarts=[],this.cr=0,this.lf=0,this.crlf=0,this.containsRTL=!1,this.containsUnusualLineTerminators=!1,this.isBasicASCII=!0}acceptChunk(e){if(0===e.length)return;0===this.chunks.length&&Mde(e)&&(this.BOM=Ide,e=e.substr(1));const t=e.charCodeAt(e.length-1);13===t||t>=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){(t||0!==e.length)&&(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=function(e,t){e.length=0,e[0]=0;let i=1,n=0,o=0,s=0,r=!0;for(let a=0,l=t.length;a<l;a++){const h=t.charCodeAt(a);13===h?a+1<l&&10===t.charCodeAt(a+1)?(s++,e[i++]=a+2,a++):(n++,e[i++]=a+1):10===h?(o++,e[i++]=a+1):r&&9!==h&&(h<32||h>126)&&(r=!1)}const a=new MMe(IMe(e),n,o,s,r);return e.length=0,a}(this._tmpLineStarts,e);this.chunks.push(new RMe(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,this.isBasicASCII&&(this.isBasicASCII=t.isBasicASCII),this.isBasicASCII||this.containsRTL||(this.containsRTL=Sde(e)),this.isBasicASCII||this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=Dde(e))}finish(e=!0){return this._finish(),new WMe(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(0===this.chunks.length&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=TMe(e.buffer);e.lineStarts=t,13===this._previousChar&&this.cr++}}}class zMe{get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}constructor(e,t){this._startLineNumber=e,this._tokens=t}getLineTokens(e){return this._tokens[e-this._startLineNumber]}appendLineTokens(e){this._tokens.push(e)}}class HMe{constructor(){this._tokens=[]}add(e,t){if(this._tokens.length>0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e)return void i.appendLineTokens(t)}this._tokens.push(new zMe(e,[t]))}finalize(){return this._tokens}}class UMe{constructor(e){this._default=e,this._store=[]}get(e){return e<this._store.length?this._store[e]:this._default}set(e,t){for(;e>=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}delete(e,t){0===t||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(0===t||e>=this._store.length)return;const i=[];for(let e=0;e<t;e++)i[e]=this._default;this._store=Rse(this._store,e,i)}}class KMe{get invalidLineStartIndex(){return this._firstLineNeedsTokenization}constructor(e,t){this.tokenizationSupport=e,this.initialState=t,this._lineBeginState=new UMe(null),this._lineNeedsTokenization=new UMe(!0),this._firstLineNeedsTokenization=0,this._lineBeginState.set(0,this.initialState)}markMustBeTokenized(e){this._lineNeedsTokenization.set(e,!0),this._firstLineNeedsTokenization=Math.min(this._firstLineNeedsTokenization,e)}getBeginState(e){return this._lineBeginState.get(e)}setEndState(e,t,i){if(this._lineNeedsTokenization.set(t,!1),this._firstLineNeedsTokenization=t+1,t===e-1)return;const n=this._lineBeginState.get(t+1);if(null===n||!i.equals(n))return this._lineBeginState.set(t+1,i),void this.markMustBeTokenized(t+1);let o=t+1;for(;o<e&&!this._lineNeedsTokenization.get(o);)o++;this._firstLineNeedsTokenization=o}applyEdits(e,t){this.markMustBeTokenized(e.startLineNumber-1),this._lineBeginState.delete(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineNeedsTokenization.delete(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineBeginState.insert(e.startLineNumber,t),this._lineNeedsTokenization.insert(e.startLineNumber,t)}}class jMe extends aae{constructor(e,t,i){super(),this._textModel=e,this._tokenizationPart=t,this._languageIdCodec=i,this._isScheduled=!1,this._isDisposed=!1,this._tokenizationStateStore=null,this._register(ehe.onDidChange((e=>{const t=this._textModel.getLanguageId();-1!==e.changedLanguages.indexOf(t)&&(this._resetTokenizationState(),this._tokenizationPart.clearTokens())}))),this._resetTokenizationState()}dispose(){this._isDisposed=!0,super.dispose()}handleDidChangeContent(e){if(e.isFlush)this._resetTokenizationState();else{if(this._tokenizationStateStore)for(let t=0,i=e.changes.length;t<i;t++){const i=e.changes[t],[n]=cNe(i.text);this._tokenizationStateStore.applyEdits(i.range,n)}this._beginBackgroundTokenization()}}handleDidChangeAttached(){this._beginBackgroundTokenization()}handleDidChangeLanguage(e){this._resetTokenizationState(),this._tokenizationPart.clearTokens()}_resetTokenizationState(){const[e,t]=function(e,t){if(e.isTooLargeForTokenization())return[null,null];const i=ehe.get(t.getLanguageId());if(!i)return[null,null];let n;try{n=i.getInitialState()}catch(e){return zre(e),[null,null]}return[i,n]}(this._textModel,this._tokenizationPart);this._tokenizationStateStore=e&&t?new KMe(e,t):null,this._beginBackgroundTokenization()}_beginBackgroundTokenization(){!this._isScheduled&&this._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&(this._isScheduled=!0,dpe((e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)})))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),i=()=>{!this._isDisposed&&this._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&(this._backgroundTokenizeForAtLeast1ms(),Date.now()<t?dse(i):this._beginBackgroundTokenization())};i()}_backgroundTokenizeForAtLeast1ms(){const e=this._textModel.getLineCount(),t=new HMe,i=gae.create(!1);do{if(i.elapsed()>1)break;if(this._tokenizeOneInvalidLine(t)>=e)break}while(this._hasLinesToTokenize());this._tokenizationPart.setTokens(t.finalize(),this._isTokenizationComplete())}tokenizeViewport(e,t){const i=new HMe;this._tokenizeViewport(i,e,t),this._tokenizationPart.setTokens(i.finalize(),this._isTokenizationComplete())}reset(){this._resetTokenizationState(),this._tokenizationPart.clearTokens()}forceTokenization(e){const t=new HMe;this._updateTokensUntilLine(t,e),this._tokenizationPart.setTokens(t.finalize(),this._isTokenizationComplete())}getTokenTypeIfInsertingCharacter(e,t){if(!this._tokenizationStateStore)return 0;this.forceTokenization(e.lineNumber);const i=this._tokenizationStateStore.getBeginState(e.lineNumber-1);if(!i)return 0;const n=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),s=o.substring(0,e.column-1)+t+o.substring(e.column-1),r=qMe(this._languageIdCodec,n,this._tokenizationStateStore.tokenizationSupport,s,!0,i),a=new gfe(r.tokens,s,this._languageIdCodec);if(0===a.getCount())return 0;const l=a.findTokenIndexAtOffset(e.column-1);return a.getStandardTokenType(l)}tokenizeLineWithEdit(e,t,i){const n=e.lineNumber,o=e.column;if(!this._tokenizationStateStore)return null;this.forceTokenization(n);const s=this._tokenizationStateStore.getBeginState(n-1);if(!s)return null;const r=this._textModel.getLineContent(n),a=r.substring(0,o-1)+i+r.substring(o-1+t),l=this._textModel.getLanguageIdAtPosition(n,0),h=qMe(this._languageIdCodec,l,this._tokenizationStateStore.tokenizationSupport,a,!0,s);return new gfe(h.tokens,a,this._languageIdCodec)}isCheapToTokenize(e){if(!this._tokenizationStateStore)return!0;const t=this._tokenizationStateStore.invalidLineStartIndex+1;return!(e>t)&&(e<t||this._textModel.getLineLength(e)<2048)}_hasLinesToTokenize(){return!!this._tokenizationStateStore&&this._tokenizationStateStore.invalidLineStartIndex<this._textModel.getLineCount()}_isTokenizationComplete(){return!!this._tokenizationStateStore&&this._tokenizationStateStore.invalidLineStartIndex>=this._textModel.getLineCount()}_tokenizeOneInvalidLine(e){if(!this._tokenizationStateStore||!this._hasLinesToTokenize())return this._textModel.getLineCount()+1;const t=this._tokenizationStateStore.invalidLineStartIndex+1;return this._updateTokensUntilLine(e,t),t}_updateTokensUntilLine(e,t){if(!this._tokenizationStateStore)return;const i=this._textModel.getLanguageId(),n=this._textModel.getLineCount(),o=t-1;for(let t=this._tokenizationStateStore.invalidLineStartIndex;t<=o;t++){const o=this._textModel.getLineContent(t+1),s=this._tokenizationStateStore.getBeginState(t),r=qMe(this._languageIdCodec,i,this._tokenizationStateStore.tokenizationSupport,o,!0,s);e.add(t+1,r.tokens),this._tokenizationStateStore.setEndState(n,t,r.endState),t=this._tokenizationStateStore.invalidLineStartIndex-1}}_tokenizeViewport(e,t,i){if(!this._tokenizationStateStore)return;if(i<=this._tokenizationStateStore.invalidLineStartIndex)return;if(t<=this._tokenizationStateStore.invalidLineStartIndex)return void this._updateTokensUntilLine(e,i);let n=this._textModel.getLineFirstNonWhitespaceColumn(t);const o=[];let s=null;for(let e=t-1;n>1&&e>=1;e--){const t=this._textModel.getLineFirstNonWhitespaceColumn(e);if(0!==t&&t<n&&(o.push(this._textModel.getLineContent(e)),n=t,s=this._tokenizationStateStore.getBeginState(e-1),s))break}s||(s=this._tokenizationStateStore.initialState);const r=this._textModel.getLanguageId();let a=s;for(let e=o.length-1;e>=0;e--)a=qMe(this._languageIdCodec,r,this._tokenizationStateStore.tokenizationSupport,o[e],!1,a).endState;for(let n=t;n<=i;n++){const t=this._textModel.getLineContent(n),i=qMe(this._languageIdCodec,r,this._tokenizationStateStore.tokenizationSupport,t,!0,a);e.add(n,i.tokens),this._tokenizationStateStore.markMustBeTokenized(n-1),a=i.endState}}}function qMe(e,t,i,n,o,s){let r=null;if(i)try{r=i.tokenizeEncoded(n,o,s.clone())}catch(e){zre(e)}return r||(r=Zge(e.encodeLanguageId(t),s)),gfe.convertToEndOffset(r.tokens,n.length),r}const $Me=new Uint32Array(0).buffer;class GMe{static deleteBeginning(e,t){return null===e||e===$Me?e:GMe.delete(e,0,t)}static deleteEnding(e,t){if(null===e||e===$Me)return e;const i=ZMe(e),n=i[i.length-2];return GMe.delete(e,t,n)}static delete(e,t,i){if(null===e||e===$Me||t===i)return e;const n=ZMe(e),o=n.length>>>1;if(0===t&&n[n.length-2]===i)return $Me;const s=gfe.findIndexInTokensArray(n,t),r=s>0?n[s-1<<1]:0;if(i<n[s<<1]){const r=i-t;for(let e=s;e<o;e++)n[e<<1]-=r;return e}let a,l;r!==t?(n[s<<1]=t,a=s+1<<1,l=t):(a=s<<1,l=r);const h=i-t;for(let e=s+1;e<o;e++){const t=n[e<<1]-h;t>l&&(n[a++]=t,n[a++]=n[1+(e<<1)],l=t)}if(a===n.length)return e;const d=new Uint32Array(a);return d.set(n.subarray(0,a),0),d.buffer}static append(e,t){if(t===$Me)return e;if(e===$Me)return t;if(null===e)return e;if(null===t)return null;const i=ZMe(e),n=ZMe(t),o=n.length>>>1,s=new Uint32Array(i.length+n.length);s.set(i,0);let r=i.length;const a=i[i.length-2];for(let e=0;e<o;e++)s[r++]=n[e<<1]+a,s[r++]=n[1+(e<<1)];return s.buffer}static insert(e,t,i){if(null===e||e===$Me)return e;const n=ZMe(e),o=n.length>>>1;let s=gfe.findIndexInTokensArray(n,t);s>0&&n[s-1<<1]===t&&s--;for(let e=s;e<o;e++)n[e<<1]+=i;return e}}function ZMe(e){return e instanceof Uint32Array?e:new Uint32Array(e)}class YMe{constructor(e){this._lineTokens=[],this._len=0,this._languageIdCodec=e}flush(){this._lineTokens=[],this._len=0}getTokens(e,t,i){let n=null;if(t<this._len&&(n=this._lineTokens[t]),null!==n&&n!==$Me)return new gfe(ZMe(n),i,this._languageIdCodec);const o=new Uint32Array(2);return o[0]=i.length,o[1]=QMe(this._languageIdCodec.encodeLanguageId(e)),new gfe(o,i,this._languageIdCodec)}static _massageTokens(e,t,i){const n=i?ZMe(i):null;if(0===t){let t=!1;if(n&&n.length>1&&(t=ufe.getLanguageId(n[1])!==e),!t)return $Me}if(!n||0===n.length){const i=new Uint32Array(2);return i[0]=t,i[1]=QMe(e),i.buffer}return n[n.length-2]=t,0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(0===t)return;const i=[];for(let e=0;e<t;e++)i[e]=null;this._lineTokens=Rse(this._lineTokens,e,i),this._len+=t}setTokens(e,t,i,n,o){const s=YMe._massageTokens(this._languageIdCodec.encodeLanguageId(e),i,n);this._ensureLine(t);const r=this._lineTokens[t];return this._lineTokens[t]=s,!!o&&!YMe._equals(r,s)}static _equals(e,t){if(!e||!t)return!e&&!t;const i=ZMe(e),n=ZMe(t);if(i.length!==n.length)return!1;for(let e=0,t=i.length;e<t;e++)if(i[e]!==n[e])return!1;return!0}acceptEdit(e,t,i){this._acceptDeleteRange(e),this._acceptInsertText(new Rle(e.startLineNumber,e.startColumn),t,i)}_acceptDeleteRange(e){const t=e.startLineNumber-1;if(t>=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;return void(this._lineTokens[t]=GMe.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1))}this._lineTokens[t]=GMe.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i<this._len&&(n=GMe.deleteBeginning(this._lineTokens[i],e.endColumn-1)),this._lineTokens[t]=GMe.append(this._lineTokens[t],n),this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t,i){if(0===t&&0===i)return;const n=e.lineNumber-1;n>=this._len||(0!==t?(this._lineTokens[n]=GMe.deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=GMe.insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)):this._lineTokens[n]=GMe.insert(this._lineTokens[n],e.column-1,i))}}function QMe(e){return(32768|e<<0|2<<24|1024)>>>0}class XMe{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return 0===this._pieces.length}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const n=t[0].getRange(),o=t[t.length-1].getRange();if(!n||!o)return e;i=e.plusRange(n).plusRange(o)}let n=null;for(let e=0,t=this._pieces.length;e<t;e++){const o=this._pieces[e];if(o.endLineNumber<i.startLineNumber)continue;if(o.startLineNumber>i.endLineNumber){n=n||{index:e};break}if(o.removeTokens(i),o.isEmpty()){this._pieces.splice(e,1),e--,t--;continue}if(o.endLineNumber<i.startLineNumber)continue;if(o.startLineNumber>i.endLineNumber){n=n||{index:e};continue}const[s,r]=o.split(i);s.isEmpty()?n=n||{index:e}:r.isEmpty()||(this._pieces.splice(e,1,s,r),e++,t++,n=n||{index:e})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=Rse(this._pieces,n.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(0===t.getLineContent().length)return t;const i=this._pieces;if(0===i.length)return t;const n=i[XMe._findFirstPieceWithLine(i,e)].getLineTokens(e);if(!n)return t;const o=t.getCount(),s=n.getCount();let r=0;const a=[];let l=0,h=0;const d=(e,t)=>{e!==h&&(h=e,a[l++]=e,a[l++]=t)};for(let e=0;e<s;e++){const i=n.getStartCharacter(e),s=n.getEndCharacter(e),a=n.getMetadata(e),l=((1&a?2048:0)|(2&a?4096:0)|(4&a?8192:0)|(8&a?16384:0)|(16&a?16744448:0)|(32&a?4278190080:0))>>>0,h=~l>>>0;for(;r<o&&t.getEndOffset(r)<=i;)d(t.getEndOffset(r),t.getMetadata(r)),r++;for(r<o&&t.getStartOffset(r)<i&&d(i,t.getMetadata(r));r<o&&t.getEndOffset(r)<s;)d(t.getEndOffset(r),t.getMetadata(r)&h|a&l),r++;if(r<o)d(s,t.getMetadata(r)&h|a&l),t.getEndOffset(r)===s&&r++;else{const e=Math.min(Math.max(0,r-1),o-1);d(s,t.getMetadata(e)&h|a&l)}}for(;r<o;)d(t.getEndOffset(r),t.getMetadata(r)),r++;return new gfe(new Uint32Array(a),t.getLineContent(),this._languageIdCodec)}static _findFirstPieceWithLine(e,t){let i=0,n=e.length-1;for(;i<n;){let o=i+Math.floor((n-i)/2);if(e[o].endLineNumber<t)i=o+1;else{if(!(e[o].startLineNumber>t)){for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}n=o-1}}return i}acceptEdit(e,t,i,n,o){for(const s of this._pieces)s.acceptEdit(e,t,i,n,o)}}class JMe extends WDe{constructor(e,t,i,n,o){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this.bracketPairsTextModelPart=n,this._languageId=o,this._onDidChangeLanguage=this._register(new bae),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new bae),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new bae),this.onDidChangeTokens=this._onDidChangeTokens.event,this._backgroundTokenizationState=0,this._onBackgroundTokenizationStateChanged=this._register(new bae),this._tokens=new YMe(this._languageService.languageIdCodec),this._semanticTokens=new XMe(this._languageService.languageIdCodec),this._tokenization=new jMe(i,this,this._languageService.languageIdCodec),this._languageRegistryListener=this._languageConfigurationService.onDidChange((e=>{e.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})}))}acceptEdit(e,t,i,n,o){this._tokens.acceptEdit(e,i,n),this._semanticTokens.acceptEdit(e,i,n,o,t.length>0?t.charCodeAt(0):0)}handleDidChangeAttached(){this._tokenization.handleDidChangeAttached()}flush(){this._tokens.flush(),this._semanticTokens.flush()}handleDidChangeContent(e){this._tokenization.handleDidChangeContent(e)}dispose(){this._languageRegistryListener.dispose(),this._tokenization.dispose(),super.dispose()}get backgroundTokenizationState(){return this._backgroundTokenizationState}handleTokenizationProgress(e){if(2===this._backgroundTokenizationState)return;const t=e?2:1;this._backgroundTokenizationState!==t&&(this._backgroundTokenizationState=t,this.bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState(),this._onBackgroundTokenizationStateChanged.fire())}setTokens(e,t=!1){if(0!==e.length){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];let o=0,s=0,r=!1;for(let e=n.startLineNumber;e<=n.endLineNumber;e++)r?(this._tokens.setTokens(this._languageId,e-1,this._textModel.getLineLength(e),n.getLineTokens(e),!1),s=e):this._tokens.setTokens(this._languageId,e-1,this._textModel.getLineLength(e),n.getLineTokens(e),!0)&&(r=!0,o=e,s=e);r&&t.push({fromLineNumber:o,toLineNumber:s})}t.length>0&&this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!1,ranges:t})}this.handleTokenizationProgress(t)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:null!==e,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}tokenizeViewport(e,t){e=Math.max(1,e),t=Math.min(this._textModel.getLineCount(),t),this._tokenization.tokenizeViewport(e,t)}clearTokens(){this._tokens.flush(),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!0,semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this.bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}resetTokenization(){this._tokenization.reset()}forceTokenization(e){if(e<1||e>this._textModel.getLineCount())throw new Error("Illegal value for lineNumber");this._tokenization.forceTokenization(e)}isCheapToTokenize(e){return this._tokenization.isCheapToTokenize(e)}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){if(e<1||e>this._textModel.getLineCount())throw new Error("Illegal value for lineNumber");return this._getLineTokens(e)}_getLineTokens(e){const t=this._textModel.getLineContent(e),i=this._tokens.getTokens(this._languageId,e-1,t);return this._semanticTokens.addSparseTokens(e,i)}getTokenTypeIfInsertingCharacter(e,t,i){const n=this._textModel.validatePosition(new Rle(e,t));return this._tokenization.getTokenTypeIfInsertingCharacter(n,i)}tokenizeLineWithEdit(e,t,i){const n=this._textModel.validatePosition(e);return this._tokenization.tokenizeLineWithEdit(n,t,i)}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),n=this._getLineTokens(t.lineNumber),o=n.findTokenIndexAtOffset(t.column-1),[s,r]=JMe._findLanguageBoundaries(n,o),a=xse(t.column,this.getLanguageConfiguration(n.getLanguageId(o)).getWordDefinition(),i.substring(s,r),s);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a;if(o>0&&s===t.column-1){const[s,r]=JMe._findLanguageBoundaries(n,o-1),a=xse(t.column,this.getLanguageConfiguration(n.getLanguageId(o-1)).getWordDefinition(),i.substring(s,r),s);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a}return null}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let n=0;for(let o=t;o>=0&&e.getLanguageId(o)===i;o--)n=e.getStartOffset(o);let o=e.getLineContent().length;for(let n=t,s=e.getCount();n<s&&e.getLanguageId(n)===i;n++)o=e.getEndOffset(n);return[n,o]}getWordUntilPosition(e){const t=this.getWordAtPosition(e);return t?{word:t.word.substr(0,e.column-t.startColumn),startColumn:t.startColumn,endColumn:e.column}:{word:"",startColumn:e.column,endColumn:e.column}}getLanguageId(){return this._languageId}getLanguageIdAtPosition(e,t){const i=this._textModel.validatePosition(new Rle(e,t)),n=this.getLineTokens(i.lineNumber);return n.getLanguageId(n.findTokenIndexAtOffset(i.column-1))}setLanguageId(e,t="api"){if(this._languageId===e)return;const i={oldLanguage:this._languageId,newLanguage:e,source:t};this._languageId=e,this.bracketPairsTextModelPart.handleDidChangeLanguage(i),this._tokenization.handleDidChangeLanguage(i),this._onDidChangeLanguage.fire(i),this._onDidChangeLanguageConfiguration.fire({})}}class eTe{constructor(){this.changeType=1}}class tTe{static applyInjectedText(e,t){if(!t||0===t.length)return e;let i="",n=0;for(const o of t)i+=e.substring(n,o.column-1),n=o.column-1,i+=o.options.content;return i+=e.substring(n),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new tTe(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new tTe(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort(((e,t)=>e.lineNumber===t.lineNumber?e.column===t.column?e.order-t.order:e.column-t.column:e.lineNumber-t.lineNumber)),t}constructor(e,t,i,n,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=n,this.order=o}}class iTe{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class nTe{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class oTe{constructor(e,t,i,n){this.changeType=4,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class sTe{constructor(){this.changeType=5}}class rTe{constructor(e,t,i,n){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=n,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;t<i;t++)if(this.changes[t].changeType===e)return!0;return!1}static merge(e,t){const i=[].concat(e.changes).concat(t.changes),n=t.versionId,o=e.isUndoing||t.isUndoing,s=e.isRedoing||t.isRedoing;return new rTe(i,n,o,s)}}class aTe{constructor(e){this.changes=e}}class lTe{constructor(e,t){this.rawContentChangedEvent=e,this.contentChangedEvent=t}merge(e){const t=rTe.merge(this.rawContentChangedEvent,e.rawContentChangedEvent),i=lTe._mergeChangeEvents(this.contentChangedEvent,e.contentChangedEvent);return new lTe(t,i)}static _mergeChangeEvents(e,t){return{changes:[].concat(e.changes).concat(t.changes),eol:t.eol,versionId:t.versionId,isUndoing:e.isUndoing||t.isUndoing,isRedoing:e.isRedoing||t.isRedoing,isFlush:e.isFlush||t.isFlush}}}const hTe=pce("undoRedoService");class dTe{constructor(e,t){this.resource=e,this.elements=t}}class cTe{constructor(){this.id=cTe._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}}cTe._ID=0,cTe.None=new cTe;class uTe{constructor(){this.id=uTe._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}}uTe._ID=0,uTe.None=new uTe;var gTe=function(e,t){return function(i,n){t(i,n,e)}};function pTe(e,t){let i;var n;return i="string"==typeof e?function(e){const t=new VMe;return t.acceptChunk(e),t.finish()}(e):(n=e)&&"function"==typeof n.read?function(e){const t=new VMe;let i;for(;"string"==typeof(i=e.read());)t.acceptChunk(i);return t.finish()}(e):e,i.create(t)}let mTe=0;class fTe{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;for(;;){const n=this._source.read();if(null===n)return this._eos=!0,0===t?null:e.join("");if(n.length>0&&(e[t++]=n,i+=n.length),i>=65536)return e.join("")}}}const _Te=()=>{throw new Error("Invalid change accessor")};let vTe=class e extends aae{static resolveOptions(e,t){if(t.detectIndentation){const i=GIe(e,t.tabSize,t.insertSpaces);return new lue({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new lue(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent((t=>e(t.contentChangedEvent)))}onDidChangeContentOrInjectedText(e){return oae(this._eventEmitter.fastEvent((t=>e(t))),this._onDidChangeInjectedText.event((t=>e(t))))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(t,i,n,o=null,s,r,a){super(),this._undoRedoService=s,this._languageService=r,this._languageConfigurationService=a,this._onWillDispose=this._register(new bae),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new ITe((e=>this.handleBeforeFireDecorationsChangedEvent(e)))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new bae),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new bae),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new bae),this._eventEmitter=this._register(new MTe),this._deltaDecorationCallCnt=0,mTe++,this.id="$model"+mTe,this.isForSimpleWidget=n.isForSimpleWidget,this._associatedResource=null==o?Sle.parse("inmemory://model/"+mTe):o,this._attachedEditorCount=0;const{textBuffer:l,disposable:h}=pTe(t,n.defaultEOL);this._buffer=l,this._bufferDisposable=h,this._options=e.resolveOptions(this._buffer,n),this._bracketPairs=this._register(new fIe(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new HDe(this,this._languageConfigurationService)),this._decorationProvider=this._register(new wIe(this)),this._tokenizationTextModelPart=new JMe(this._languageService,this._languageConfigurationService,this,this._bracketPairs,i);const d=this._buffer.getLineCount(),c=this._buffer.getValueLengthInRange(new Ole(1,1,d,this._buffer.getLineLength(d)+1),0);n.largeFileOptimizations?this._isTooLargeForTokenization=c>e.LARGE_FILE_SIZE_THRESHOLD||d>e.LARGE_FILE_LINE_COUNT_THRESHOLD:this._isTooLargeForTokenization=!1,this._isTooLargeForSyncing=c>e._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=Tde(mTe),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new CTe,this._commandManager=new jIe(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange((()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})))}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new BMe([],"","\n",!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=aae.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new lTe(e,t)))}setValue(e){if(this._assertNotDisposed(),null==e)throw $re();const{textBuffer:t,disposable:i}=pTe(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,o,s,r){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:o,isRedoing:s,isFlush:r}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._tokenizationTextModelPart.flush(),this._decorations=Object.create(null),this._decorationsTree=new CTe,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new rTe([new eTe],this._versionId,!1,!1),this._createContentChanged2(new Ole(1,1,o,s),0,n,this.getValue(),!1,!1,!0))}setEOL(e){this._assertNotDisposed();const t=1===e?"\r\n":"\n";if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new rTe([new sTe],this._versionId,!1,!1),this._createContentChanged2(new Ole(1,1,o,s),0,n,this.getValue(),!1,!1,!1))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i<n;i++){const n=t[i],o=n.range,s=n.cachedAbsoluteStart-n.start,r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);n.cachedAbsoluteStart=r,n.cachedAbsoluteEnd=a,n.cachedVersionId=e,n.start=r-s,n.end=a-s,pMe(n)}}onBeforeAttached(){this._attachedEditorCount++,1===this._attachedEditorCount&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0))}onBeforeDetached(){this._attachedEditorCount--,0===this._attachedEditorCount&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0))}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let n=1;n<=i;n++){const i=this._buffer.getLineLength(n);i>=1e4?t+=i:e+=i}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=void 0!==e.tabSize?e.tabSize:this._options.tabSize,i=void 0!==e.indentSize?e.indentSize:this._options.originalIndentSize,n=void 0!==e.insertSpaces?e.insertSpaces:this._options.insertSpaces,o=void 0!==e.trimAutoWhitespace?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s=void 0!==e.bracketColorizationOptions?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,r=new lue({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:s});if(this._options.equals(r))return;const a=this._options.createChangeEvent(r);this._options=r,this._bracketPairs.handleDidChangeOptions(a),this._decorationProvider.handleDidChangeOptions(a),this._onDidChangeOptions.fire(a)}detectIndentation(e,t){this._assertNotDisposed();const i=GIe(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),uxe(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(xde.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map((e=>({range:e.range,text:null}))),(()=>null))}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueInRange(i,e);return t?this._buffer.getBOM()+n:n}createSnapshot(e=!1){return new fTe(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+n:n}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){return this._assertNotDisposed(),this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),"\n"===this._buffer.getEOL()?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let o=Math.floor("number"!=typeof i||isNaN(i)?1:i),s=Math.floor("number"!=typeof n||isNaN(n)?1:n);if(o<1)o=1,s=1;else if(o>t)o=t,s=this.getLineMaxColumn(o);else if(s<=1)s=1;else{const e=this.getLineMaxColumn(o);s>=e&&(s=e)}const r=e.endLineNumber,a=e.endColumn;let l=Math.floor("number"!=typeof r||isNaN(r)?1:r),h=Math.floor("number"!=typeof a||isNaN(a)?1:a);if(l<1)l=1,h=1;else if(l>t)l=t,h=this.getLineMaxColumn(l);else if(h<=1)h=1;else{const e=this.getLineMaxColumn(l);h>=e&&(h=e)}return i===o&&n===s&&r===l&&a===h&&e instanceof Ole&&!(e instanceof Ple)?e:new Ole(o,s,l,h)}_isValidPosition(e,t,i){return"number"==typeof e&&"number"==typeof t&&(!isNaN(e)&&!isNaN(t)&&(!(e<1||t<1)&&((0|e)===e&&(0|t)===t&&(!(e>this._buffer.getLineCount())&&(1===t||!(t>this.getLineMaxColumn(e))&&(1!==i||!pde(this._buffer.getLineCharCode(e,t-2))))))))}_validatePosition(e,t,i){const n=Math.floor("number"!=typeof e||isNaN(e)?1:e),o=Math.floor("number"!=typeof t||isNaN(t)?1:t),s=this._buffer.getLineCount();if(n<1)return new Rle(1,1);if(n>s)return new Rle(s,this.getLineMaxColumn(s));if(o<=1)return new Rle(n,1);const r=this.getLineMaxColumn(n);return o>=r?new Rle(n,r):1===i&&pde(this._buffer.getLineCharCode(n,o-2))?new Rle(n,o-1):new Rle(n,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof Rle&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn;if(!this._isValidPosition(i,n,0))return!1;if(!this._isValidPosition(o,s,0))return!1;if(1===t){const e=n>1?this._buffer.getLineCharCode(i,n-2):0,t=s>1&&s<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,s-2):0,r=pde(e),a=pde(t);return!r&&!a}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof Ole&&!(e instanceof Ple)&&this._isValidRange(e,1))return e;const t=this._validatePosition(e.startLineNumber,e.startColumn,0),i=this._validatePosition(e.endLineNumber,e.endColumn,0),n=t.lineNumber,o=t.column,s=i.lineNumber,r=i.column;{const e=o>1?this._buffer.getLineCharCode(n,o-2):0,t=r>1&&r<=this._buffer.getLineLength(s)?this._buffer.getLineCharCode(s,r-2):0,i=pde(e),a=pde(t);return i||a?n===s&&o===r?new Ole(n,o-1,s,r-1):i&&a?new Ole(n,o-1,s,r+1):i?new Ole(n,o-1,s,r):new Ole(n,o,s,r+1):new Ole(n,o,s,r)}}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new Ole(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,o,s,r=999){this._assertNotDisposed();let a=null;null!==t&&(Array.isArray(t)||(t=[t]),t.every((e=>Ole.isIRange(e)))&&(a=t.map((e=>this.validateRange(e))))),null===a&&(a=[this.getFullModelRange()]),a=a.sort(((e,t)=>e.startLineNumber-t.startLineNumber||e.startColumn-t.startColumn));const l=[];let h;if(l.push(a.reduce(((e,t)=>Ole.areIntersecting(e,t)?e.plusRange(t):(l.push(e),t)))),!i&&e.indexOf("\n")<0){const t=new sme(e,i,n,o).parseSearchRequest();if(!t)return[];h=e=>this.findMatchesLineByLine(e,t,s,r)}else h=t=>lme.findMatches(this,new sme(e,i,n,o),t,s,r);return l.map(h).reduce(((e,t)=>e.concat(t)),[])}findNextMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);if(!i&&e.indexOf("\n")<0){const t=new sme(e,i,n,o).parseSearchRequest();if(!t)return null;const a=this.getLineCount();let l=new Ole(r.lineNumber,r.column,a,this.getLineMaxColumn(a)),h=this.findMatchesLineByLine(l,t,s,1);return lme.findNextMatch(this,new sme(e,i,n,o),r,s),h.length>0?h[0]:(l=new Ole(1,1,r.lineNumber,this.getLineMaxColumn(r.lineNumber)),h=this.findMatchesLineByLine(l,t,s,1),h.length>0?h[0]:null)}return lme.findNextMatch(this,new sme(e,i,n,o),r,s)}findPreviousMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);return lme.findPreviousMatch(this,new sme(e,i,n,o),r,s)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if(("\n"===this.getEOL()?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof due?e:new due(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this._validateEditOperation(e[i]);return t}pushEditOperations(e,t,i,n){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),i,n)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,i,n){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){const i=t.map((e=>({range:this.validateRange(e.range),text:e.text})));let n=!0;if(e)for(let t=0,o=e.length;t<o;t++){const o=e[t];let s=!1;for(let e=0,t=i.length;e<t;e++){const t=i[e].range,n=t.startLineNumber>o.endLineNumber,r=o.startLineNumber>t.endLineNumber;if(!n&&!r){s=!0;break}}if(!s){n=!1;break}}if(n)for(let e=0,n=this._trimAutoWhitespaceLines.length;e<n;e++){const n=this._trimAutoWhitespaceLines[e],o=this.getLineMaxColumn(n);let s=!0;for(let e=0,t=i.length;e<t;e++){const t=i[e].range,r=i[e].text;if(!(n<t.startLineNumber||n>t.endLineNumber||n===t.startLineNumber&&t.startColumn===o&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(0)||n===t.startLineNumber&&1===t.startColumn&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(r.length-1))){s=!1;break}}if(s){const e=new Ole(n,1,n,o);t.push(new due(null,e,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,n)}_applyUndo(e,t,i,n){const o=e.map((e=>{const t=this.getPositionAt(e.newPosition),i=this.getPositionAt(e.newEnd);return{range:new Ole(t.lineNumber,t.column,i.lineNumber,i.column),text:e.oldText}}));this._applyUndoRedoEdits(o,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const o=e.map((e=>{const t=this.getPositionAt(e.oldPosition),i=this.getPositionAt(e.oldEnd);return{range:new Ole(t.lineNumber,t.column,i.lineNumber,i.column),text:e.newText}}));this._applyUndoRedoEdits(o,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,o,s){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(s),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),n=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),s=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,0!==s.length){for(let e=0,t=s.length;e<t;e++){const t=s[e],[i,n,o]=cNe(t.text);this._tokenizationTextModelPart.acceptEdit(t.range,t.text,i,n,o),this._decorationsTree.acceptReplace(t.rangeOffset,t.rangeLength,t.text.length,t.forceMoveMarkers)}const e=[];this._increaseVersionId();let t=i;for(let i=0,n=s.length;i<n;i++){const n=s[i],[r]=cNe(n.text);this._onDidChangeDecorations.fire();const a=n.range.startLineNumber,l=n.range.endLineNumber,h=l-a,d=r,c=Math.min(h,d),u=d-h,g=o-t-u+a,p=g,m=g+d,f=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new Rle(p,1)),this.getOffsetAt(new Rle(m,this.getLineMaxColumn(m))),0),_=tTe.fromDecorations(f),v=new Hse(_);for(let t=c;t>=0;t--){const i=a+t,n=g+t;v.takeFromEndWhile((e=>e.lineNumber>n));const o=v.takeFromEndWhile((e=>e.lineNumber===n));e.push(new iTe(i,this.getLineContent(n),o))}if(c<h){const t=a+c;e.push(new nTe(t+1,l))}if(c<d){const i=new Hse(_),n=a+c,s=d-c,r=o-t-s+n+1,l=[],h=[];for(let e=0;e<s;e++){const t=r+e;h[e]=this.getLineContent(t),i.takeWhile((e=>e.lineNumber<t)),l[e]=i.takeWhile((e=>e.lineNumber===t))}e.push(new oTe(n+1,a+d,h,l))}t+=u}this._emitContentChangedEvent(new rTe(e,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:s,eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return null===n.reverseEdits?void 0:n.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(null===e||0===e.size)return;const t=Array.from(e).map((e=>new iTe(e,this.getLineContent(e),this._getInjectedTextInLine(e))));this._onDidChangeInjectedText.fire(new aTe(t))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(t,i)=>this._deltaDecorationsImpl(e,[],[{range:t,options:i}])[0],changeDecoration:(e,t)=>{this._changeDecorationImpl(e,t)},changeDecorationOptions:(e,t)=>{this._changeDecorationOptionsImpl(e,NTe(t))},removeDecoration:t=>{this._deltaDecorationsImpl(e,[t],[])},deltaDecorations:(t,i)=>0===t.length&&0===i.length?[]:this._deltaDecorationsImpl(e,t,i)};let n=null;try{n=t(i)}catch(e){zre(e)}return i.addDecoration=_Te,i.changeDecoration=_Te,i.changeDecorationOptions=_Te,i.removeDecoration=_Te,i.deltaDecorations=_Te,n}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),0===e.length&&0===t.length)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),zre(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const n=e?this._decorations[e]:null;if(!n)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:ETe[i]}])[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;const o=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),r=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(n),n.reset(this.getVersionId(),s,r,o),n.setOptions(ETe[i]),this._decorationsTree.insert(n),n.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let e=0,i=t.length;e<i;e++){const i=t[e];this._decorationsTree.delete(i),delete this._decorations[i.id]}}getDecorationOptions(e){const t=this._decorations[e];return t?t.options:null}getDecorationRange(e){const t=this._decorations[e];return t?this._decorationsTree.getNodeRange(this,t):null}getLineDecorations(e,t=0,i=!1){return e<1||e>this.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,n=!1){const o=this.getLineCount(),s=Math.min(o,Math.max(1,e)),r=Math.min(o,Math.max(1,t)),a=this.getLineMaxColumn(r),l=new Ole(s,1,r,a),h=this._getDecorationsInRange(l,i,n);return Fse(h,this._decorationProvider.getDecorationsInRange(l,i,n)),h}getDecorationsInRange(e,t=0,i=!1,n=!1){const o=this.validateRange(e),s=this._getDecorationsInRange(o,t,i);return Fse(s,this._decorationProvider.getDecorationsInRange(o,t,i,n)),s}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),n=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return tTe.fromDecorations(n).filter((t=>t.lineNumber===e))}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}_getDecorationsInRange(e,t,i){const n=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),o=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,n,o,t,i)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const i=this._decorations[e];if(!i)return;if(i.options.after){const t=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(t.endLineNumber)}if(i.options.before){const t=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(t.startLineNumber)}const n=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(n.startLineNumber,n.startColumn),s=this._buffer.getOffsetAt(n.endLineNumber,n.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),o,s,n),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(n.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(n.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const n=!(!i.options.overviewRuler||!i.options.overviewRuler.color),o=!(!t.overviewRuler||!t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const e=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(i.options.before||t.before){const e=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}n!==o?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i){const n=this.getVersionId(),o=t.length;let s=0;const r=i.length;let a=0;this._onDidChangeDecorations.beginDeferredEmit();try{const l=new Array(r);for(;s<o||a<r;){let h=null;if(s<o){do{h=this._decorations[t[s++]]}while(!h&&s<o);if(h){if(h.options.after){const e=this._decorationsTree.getNodeRange(this,h);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(h.options.before){const e=this._decorationsTree.getNodeRange(this,h);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}this._decorationsTree.delete(h),this._onDidChangeDecorations.checkAffectedAndFire(h.options)}}if(a<r){if(!h){const e=++this._lastDecorationId,t=`${this._instanceId};${e}`;h=new nMe(t,0,0),this._decorations[t]=h}const t=i[a],o=this._validateRangeRelaxedNoAllocations(t.range),s=NTe(t.options),r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),d=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);h.ownerId=e,h.reset(n,r,d,o),h.setOptions(s),h.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.endLineNumber),h.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.startLineNumber),this._onDidChangeDecorations.checkAffectedAndFire(s),this._decorationsTree.insert(h),l[a]=h.id,a++}else h&&delete this._decorations[h.id]}return l}finally{this._onDidChangeDecorations.endDeferredEmit()}}getLanguageId(){return this.tokenization.getLanguageId()}setMode(e,t){this.tokenization.setLanguageId(e,t)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return function(e){let t=0;for(const i of e){if(" "!==i&&"\t"!==i)break;t++}return t}(this.getLineContent(e))+1}};function bTe(e){return!(!e.options.overviewRuler||!e.options.overviewRuler.color)}function wTe(e){return!!e.options.after||!!e.options.before}vTe._MODEL_SYNC_LIMIT=52428800,vTe.LARGE_FILE_SIZE_THRESHOLD=20971520,vTe.LARGE_FILE_LINE_COUNT_THRESHOLD=3e5,vTe.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:dre.tabSize,indentSize:dre.indentSize,insertSpaces:dre.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:dre.trimAutoWhitespace,largeFileOptimizations:dre.largeFileOptimizations,bracketPairColorizationOptions:dre.bracketPairColorizationOptions},vTe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([gTe(4,hTe),gTe(5,tge),gTe(6,Oge)],vTe);class CTe{constructor(){this._decorationsTree0=new sMe,this._decorationsTree1=new sMe,this._injectedTextDecorationsTree=new sMe}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)null===i.range&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,n,o){const s=e.getVersionId(),r=this._intervalSearch(t,i,n,o,s);return this._ensureNodesHaveRanges(e,r)}_intervalSearch(e,t,i,n,o){const s=this._decorationsTree0.intervalSearch(e,t,i,n,o),r=this._decorationsTree1.intervalSearch(e,t,i,n,o),a=this._injectedTextDecorationsTree.intervalSearch(e,t,i,n,o);return s.concat(r).concat(a)}getInjectedTextInInterval(e,t,i,n){const o=e.getVersionId(),s=this._injectedTextDecorationsTree.intervalSearch(t,i,n,!1,o);return this._ensureNodesHaveRanges(e,s).filter((e=>e.options.showIfCollapsed||!e.range.isEmpty()))}getAllInjectedText(e,t){const i=e.getVersionId(),n=this._injectedTextDecorationsTree.search(t,!1,i);return this._ensureNodesHaveRanges(e,n).filter((e=>e.options.showIfCollapsed||!e.range.isEmpty()))}getAll(e,t,i,n){const o=e.getVersionId(),s=this._search(t,i,n,o);return this._ensureNodesHaveRanges(e,s)}_search(e,t,i,n){if(i)return this._decorationsTree1.search(e,t,n);{const i=this._decorationsTree0.search(e,t,n),o=this._decorationsTree1.search(e,t,n),s=this._injectedTextDecorationsTree.search(e,t,n);return i.concat(o).concat(s)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),n=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(n)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){wTe(e)?this._injectedTextDecorationsTree.insert(e):bTe(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){wTe(e)?this._injectedTextDecorationsTree.delete(e):bTe(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),null===t.range&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){wTe(e)?this._injectedTextDecorationsTree.resolveNode(e,t):bTe(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,n){this._decorationsTree0.acceptReplace(e,t,i,n),this._decorationsTree1.acceptReplace(e,t,i,n),this._injectedTextDecorationsTree.acceptReplace(e,t,i,n)}}function yTe(e){return e.replace(/[^a-z0-9\-_]/gi," ")}class STe{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class kTe extends STe{constructor(e){super(e),this._resolvedColor=null,this.position="number"==typeof e.position?e.position:oue.Center}getColor(e){return this._resolvedColor||("light"!==e.type&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if("string"==typeof e)return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class LTe extends STe{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||("light"!==e.type&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return"string"==typeof e?Owe.fromHex(e):t.getColor(e.id)}}class xTe{static from(e){return e instanceof xTe?e:new xTe(e)}constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class DTe{static register(e){return new DTe(e)}static createDynamic(e){return new DTe(e)}constructor(e){var t,i,n;this.description=e.description,this.blockClassName=e.blockClassName?yTe(e.blockClassName):null,this.blockIsAfterEnd=null!==(t=e.blockIsAfterEnd)&&void 0!==t?t:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?yTe(e.className):null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new kTe(e.overviewRuler):null,this.minimap=e.minimap?new LTe(e.minimap):null,this.glyphMarginClassName=e.glyphMarginClassName?yTe(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?yTe(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?yTe(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?yTe(e.marginClassName):null,this.inlineClassName=e.inlineClassName?yTe(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?yTe(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?yTe(e.afterContentClassName):null,this.after=e.after?xTe.from(e.after):null,this.before=e.before?xTe.from(e.before):null,this.hideInCommentTokens=null!==(i=e.hideInCommentTokens)&&void 0!==i&&i,this.hideInStringTokens=null!==(n=e.hideInStringTokens)&&void 0!==n&&n}}DTe.EMPTY=DTe.register({description:"empty"});const ETe=[DTe.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),DTe.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),DTe.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),DTe.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function NTe(e){return e instanceof DTe?e:DTe.createDynamic(e)}class ITe extends aae{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new bae),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,0===this._deferredCnt&&(this._shouldFireDeferred&&this.doFire(),null===(e=this._affectedInjectedTextLines)||void 0===e||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||(this._affectsMinimap=!(!e.minimap||!e.minimap.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!(!e.overviewRuler||!e.overviewRuler.color)),this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this.tryFire()}tryFire(){0===this._deferredCnt?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._actual.fire(e)}}class MTe extends aae{constructor(){super(),this._fastEmitter=this._register(new bae),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new bae),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,0===this._deferredCnt&&null!==this._deferredEvent){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){this._deferredCnt>0?this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e:(this._fastEmitter.fire(e),this._slowEmitter.fire(e))}}class TTe{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new wxe(new Ole(1,1,1,1),0,0,new Rle(1,1),0),new wxe(new Ole(1,1,1,1),0,0,new Rle(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new _xe(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?Ple.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):Ple.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,n){return t.equals(i)?n:e.normalizePosition(t,2)}static _validateViewState(e,t){const i=t.position,n=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),s=e.normalizePosition(i,2),r=this._validatePositionWithCache(e,n,i,s),a=this._validatePositionWithCache(e,o,n,r);return i.equals(s)&&n.equals(r)&&o.equals(a)?t:new wxe(Ole.fromPositions(r,a),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+n.column-r.column,s,t.leftoverVisibleColumns+i.column-s.column)}_setState(e,t,i){if(i&&(i=TTe._validateViewState(e.viewModel,i)),t){const i=e.model.validateRange(t.selectionStart),n=t.selectionStart.equalsRange(i)?t.selectionStartLeftoverVisibleColumns:0,o=e.model.validatePosition(t.position),s=t.position.equals(o)?t.leftoverVisibleColumns:0;t=new wxe(i,t.selectionStartKind,n,o,s)}else{if(!i)return;const n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new wxe(n,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new wxe(n,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new Rle(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new Rle(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),s=new Ole(n.lineNumber,n.column,o.lineNumber,o.column),r=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new wxe(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,r,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class ATe{constructor(e){this.context=e,this.cursors=[new TTe(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map((e=>e.readSelectionFromMarkers(this.context)))}getAll(){return this.cursors.map((e=>e.asCursorState()))}getViewPositions(){return this.cursors.map((e=>e.viewState.position))}getTopMostViewPosition(){return(e=this.cursors,t=zse((e=>e.viewState.position),Rle.compare),function(e,t){if(0===e.length)return;let i=e[0];for(let n=1;n<e.length;n++){const o=e[n];t(o,i)>0&&(i=o)}return i}(e,((e,i)=>-t(e,i)))).viewState.position;var e,t}getBottomMostViewPosition(){return function(e,t){if(0===e.length)return;let i=e[0];for(let n=1;n<e.length;n++){const o=e[n];t(o,i)>=0&&(i=o)}return i}(this.cursors,zse((e=>e.viewState.position),Rle.compare)).viewState.position}getSelections(){return this.cursors.map((e=>e.modelState.selection))}getViewSelections(){return this.cursors.map((e=>e.viewState.selection))}setSelections(e){this.setStates(_xe.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){null!==e&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,i=e.length;if(t<i){const e=i-t;for(let t=0;t<e;t++)this._addSecondaryCursor()}else if(t>i){const e=t-i;for(let t=0;t<e;t++)this._removeSecondaryCursor(this.cursors.length-2)}for(let t=0;t<i;t++)this.cursors[t+1].setState(this.context,e[t].modelState,e[t].viewState)}killSecondaryCursors(){this._setSecondaryStates([])}_addSecondaryCursor(){this.cursors.push(new TTe(this.context)),this.lastAddedCursorIndex=this.cursors.length-1}getLastAddedCursorIndex(){return 1===this.cursors.length||0===this.lastAddedCursorIndex?0:this.lastAddedCursorIndex}_removeSecondaryCursor(e){this.lastAddedCursorIndex>=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(1===this.cursors.length)return;const e=this.cursors.slice(0),t=[];for(let i=0,n=e.length;i<n;i++)t.push({index:i,selection:e[i].modelState.selection});t.sort(zse((e=>e.selection),Ole.compareRangesUsingStarts));for(let i=0;i<t.length-1;i++){const n=t[i],o=t[i+1],s=n.selection,r=o.selection;if(!this.context.cursorConfig.multiCursorMergeOverlapping)continue;let a;if(a=r.isEmpty()||s.isEmpty()?r.getStartPosition().isBeforeOrEqual(s.getEndPosition()):r.getStartPosition().isBefore(s.getEndPosition()),a){const s=n.index<o.index?i:i+1,r=n.index<o.index?i+1:i,a=t[r].index,l=t[s].index,h=t[r].selection,d=t[s].selection;if(!h.equalsSelection(d)){const i=h.plusRange(d),n=h.selectionStartLineNumber===h.startLineNumber&&h.selectionStartColumn===h.startColumn,o=d.selectionStartLineNumber===d.startLineNumber&&d.selectionStartColumn===d.startColumn;let r,c;a===this.lastAddedCursorIndex?(r=n,this.lastAddedCursorIndex=l):r=o,c=r?new Ple(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn):new Ple(i.endLineNumber,i.endColumn,i.startLineNumber,i.startColumn),t[s].selection=c;const u=_xe.fromModelSelection(c);e[l].setState(this.context,u.modelState,u.viewState)}for(const e of t)e.index>a&&e.index--;e.splice(a,1),t.splice(r,1),this._removeSecondaryCursor(a-1),i--}}}}class RTe{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}class OTe{constructor(){this.type=0}}class PTe{constructor(){this.type=1}}class FTe{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class BTe{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class WTe{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0)}}class VTe{constructor(){this.type=5}}class zTe{constructor(e){this.type=6,this.isFocused=e}}class HTe{constructor(){this.type=7}}class UTe{constructor(){this.type=8}}class KTe{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class jTe{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class qTe{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class $Te{constructor(e,t,i,n,o,s,r){this.source=e,this.minimalReveal=t,this.range=i,this.selections=n,this.verticalType=o,this.revealHorizontal=s,this.scrollType=r,this.type=12}}class GTe{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class ZTe{constructor(e){this.theme=e,this.type=14}}class YTe{constructor(e){this.type=15,this.ranges=e}}class QTe{constructor(){this.type=16}}class XTe{constructor(){this.type=17}}class JTe extends aae{constructor(){super(),this._onEvent=this._register(new bae),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t<i;t++){const i=this._outgoingEvents[t].kind===e.kind?this._outgoingEvents[t].attemptToMerge(e):null;if(i)return void(this._outgoingEvents[t]=i)}this._outgoingEvents.push(e)}_emitOutgoingEvents(){for(;this._outgoingEvents.length>0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t<i;t++)this._eventHandlers[t]===e&&console.warn("Detected duplicate listener in ViewEventDispatcher",e);this._eventHandlers.push(e)}removeViewEventHandler(e){for(let t=0;t<this._eventHandlers.length;t++)if(this._eventHandlers[t]===e){this._eventHandlers.splice(t,1);break}}beginEmitViewEvents(){return this._collectorCnt++,1===this._collectorCnt&&(this._collector=new eAe),this._collector}endEmitViewEvents(){if(this._collectorCnt--,0===this._collectorCnt){const e=this._collector.outgoingEvents,t=this._collector.viewEvents;this._collector=null;for(const t of e)this._addOutgoingEvent(t);t.length>0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class eAe{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class tAe{constructor(e,t,i,n){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=n,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new tAe(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class iAe{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new iAe(this.oldHasFocus,e.hasFocus)}}class nAe{constructor(e,t,i,n,o,s,r,a){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=o,this.scrollLeft=s,this.scrollHeight=r,this.scrollTop=a,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!(this.scrollWidthChanged||this.scrollLeftChanged||this.scrollHeightChanged||this.scrollTopChanged)}attemptToMerge(e){return e.kind!==this.kind?null:new nAe(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class oAe{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class sAe{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class rAe{constructor(e,t,i,n,o,s,r){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=o,this.reason=s,this.reachedMaxCursorCount=r}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(!e[n].equalsSelection(t[n]))return!1;return!0}isNoOp(){return rAe._selectionsAreEqual(this.oldSelections,this.selections)&&this.oldModelVersionId===this.modelVersionId}attemptToMerge(e){return e.kind!==this.kind?null:new rAe(this.oldSelections,e.selections,this.oldModelVersionId,e.modelVersionId,e.source,e.reason,this.reachedMaxCursorCount||e.reachedMaxCursorCount)}}class aAe{constructor(){this.kind=5}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class lAe{constructor(e){this.event=e,this.kind=7}isNoOp(){return!1}attemptToMerge(e){return null}}class hAe{constructor(e){this.event=e,this.kind=8}isNoOp(){return!1}attemptToMerge(e){return null}}class dAe{constructor(e){this.event=e,this.kind=9}isNoOp(){return!1}attemptToMerge(e){return null}}class cAe{constructor(e){this.event=e,this.kind=10}isNoOp(){return!1}attemptToMerge(e){return null}}class uAe{constructor(e){this.event=e,this.kind=11}isNoOp(){return!1}attemptToMerge(e){return null}}class gAe{constructor(e){this.event=e,this.kind=12}isNoOp(){return!1}attemptToMerge(e){return null}}class pAe extends aae{constructor(e,t,i,n){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new RTe(this._model,this._viewModel,this._coordinatesConverter,n),this._cursors=new ATe(this.context),this._hasFocus=!1,this._isHandling=!1,this._compositionState=null,this._columnSelectData=null,this._autoClosedActions=[],this._prevEditOperationType=0}dispose(){this._cursors.dispose(),this._autoClosedActions=nae(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new RTe(this._model,this._viewModel,this._coordinatesConverter,e),this._cursors.updateContext(this.context)}onLineMappingChanged(e){this._knownModelVersionId===this._model.getVersionId()&&this.setStates(e,"viewModel",0,this.getCursorStates())}setHasFocus(e){this._hasFocus=e}_validateAutoClosedActions(){if(this._autoClosedActions.length>0){const e=this._cursors.getSelections();for(let t=0;t<this._autoClosedActions.length;t++){const i=this._autoClosedActions[t];i.isValid(e)||(i.dispose(),this._autoClosedActions.splice(t,1),t--)}}}getPrimaryCursorState(){return this._cursors.getPrimaryCursor()}getLastAddedCursorIndex(){return this._cursors.getLastAddedCursorIndex()}getCursorStates(){return this._cursors.getAll()}setStates(e,t,i,n){let o=!1;const s=this.context.cursorConfig.multiCursorLimit;null!==n&&n.length>s&&(n=n.slice(0,s),o=!0);const r=mAe.from(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,r,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,i,n,o,s){const r=this._cursors.getViewPositions();let a=null,l=null;r.length>1?l=this._cursors.getViewSelections():a=Ole.fromPositions(r[0],r[0]),e.emitViewEvent(new $Te(t,i,a,l,n,o,s))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push({inSelectionMode:!n.isEmpty(),selectionStart:{lineNumber:n.selectionStartLineNumber,column:n.selectionStartColumn},position:{lineNumber:n.positionLineNumber,column:n.positionColumn}})}return e}restoreState(e,t){const i=[];for(let e=0,n=t.length;e<n;e++){const n=t[e];let o=1,s=1;n.position&&n.position.lineNumber&&(o=n.position.lineNumber),n.position&&n.position.column&&(s=n.position.column);let r=o,a=s;n.selectionStart&&n.selectionStart.lineNumber&&(r=n.selectionStart.lineNumber),n.selectionStart&&n.selectionStart.column&&(a=n.selectionStart.column),i.push({selectionStartLineNumber:r,selectionStartColumn:a,positionLineNumber:o,positionColumn:s})}this.setStates(e,"restoreState",0,_xe.fromModelSelections(i)),this.revealPrimary(e,"restoreState",!1,0,!0,1)}onModelContentChanged(e,t){if(t instanceof aTe){if(this._isHandling)return;this._isHandling=!0;try{this.setStates(e,"modelChange",0,this.getCursorStates())}finally{this._isHandling=!1}}else{const i=t.rawContentChangedEvent;if(this._knownModelVersionId=i.versionId,this._isHandling)return;const n=i.containsEvent(1);if(this._prevEditOperationType=0,n)this._cursors.dispose(),this._cursors=new ATe(this.context),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,"model",1,null,!1);else if(this._hasFocus&&i.resultingSelection&&i.resultingSelection.length>0){const t=_xe.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,t)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const t=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,_xe.fromModelSelections(t))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,n){this.setStates(e,t,n,_xe.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],n=[];for(let o=0,s=e.length;o<s;o++)i.push({range:e[o],options:{description:"auto-closed-character",inlineClassName:"auto-closed-character",stickiness:1}}),n.push({range:t[o],options:{description:"auto-closed-enclosing",stickiness:1}});const o=this._model.deltaDecorations([],i),s=this._model.deltaDecorations([],n);this._autoClosedActions.push(new fAe(this._model,o,s))}_executeEditOperation(e){if(!e)return;e.shouldPushStackElementBefore&&this._model.pushStackElement();const t=_Ae.executeCommands(this._model,this._cursors.getSelections(),e.commands);if(t){this._interpretCommandResult(t);const i=[],n=[];for(let t=0;t<e.commands.length;t++){const o=e.commands[t];o instanceof Hxe&&o.enclosingRange&&o.closeCharacterRange&&(i.push(o.closeCharacterRange),n.push(o.enclosingRange))}i.length>0&&this._pushAutoClosedAction(i,n),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){e&&0!==e.length||(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,n,o){const s=mAe.from(this._model,this);if(s.equals(n))return!1;const r=this._cursors.getSelections(),a=this._cursors.getViewSelections();if(e.emitViewEvent(new BTe(a,r,i)),!n||n.cursorState.length!==s.cursorState.length||s.cursorState.some(((e,t)=>!e.modelState.equals(n.cursorState[t].modelState)))){const a=n?n.cursorState.map((e=>e.modelState.selection)):null,l=n?n.modelVersionId:0;e.emitOutgoingEvent(new rAe(a,r,l,s.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n.text||n.text.indexOf("\n")>=0)return null;const o=n.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!o)return null;const s=o[1],r=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(s);if(!r||1!==r.length)return null;const a=r[0].open,l=n.text.length-o[2].length-1,h=n.text.lastIndexOf(a,l-1);if(-1===h)return null;t.push([h,l])}return t}executeEdits(e,t,i,n){let o=null;"snippet"===t&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);const s=[],r=[],a=this._model.pushEditOperations(this.getSelections(),i,(e=>{if(o)for(let t=0,i=o.length;t<i;t++){const[i,n]=o[t],a=e[t],l=a.range.startLineNumber,h=a.range.startColumn-1+i,d=a.range.startColumn-1+n;s.push(new Ole(l,d+1,l,d+2)),r.push(new Ole(l,h+1,l,d+2))}const t=n(e);return t&&(this._isHandling=!0),t}));a&&(this._isHandling=!1,this.setSelections(e,t,a,0)),s.length>0&&this._pushAutoClosedAction(s,r)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const o=mAe.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(e){zre(e)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,o,!1)&&this.revealPrimary(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return fAe.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new bAe(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit((()=>{"keyboard"===t&&this._executeEditOperation(zxe.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))}),e,t)}type(e,t,i){this._executeEdit((()=>{if("keyboard"===i){const e=t.length;let i=0;for(;i<e;){const e=wde(t,i),n=t.substr(i,e);this._executeEditOperation(zxe.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),n)),i+=e}}else this._executeEditOperation(zxe.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t))}),e,i)}compositionType(e,t,i,n,o,s){if(0!==t.length||0!==i||0!==n)this._executeEdit((()=>{this._executeEditOperation(zxe.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,o))}),e,s);else if(0!==o){const t=this.getSelections().map((e=>{const t=e.getPosition();return new Ple(t.lineNumber,t.column+o,t.lineNumber,t.column+o)}));this.setSelections(e,s,t,0)}}paste(e,t,i,n,o){this._executeEdit((()=>{this._executeEditOperation(zxe.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))}),e,o,4)}cut(e,t){this._executeEdit((()=>{this._executeEditOperation(Ixe.cut(this.context.cursorConfig,this._model,this.getSelections()))}),e,t)}executeCommand(e,t,i){this._executeEdit((()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Cxe(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))}),e,i)}executeCommands(e,t,i){this._executeEdit((()=>{this._executeEditOperation(new Cxe(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))}),e,i)}}class mAe{static from(e,t){return new mAe(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e)return!1;if(this.modelVersionId!==e.modelVersionId)return!1;if(this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t<i;t++)if(!this.cursorState[t].equals(e.cursorState[t]))return!1;return!0}}class fAe{static getAllAutoClosedCharacters(e){let t=[];for(const i of e)t=t.concat(i.getAutoClosedCharactersRanges());return t}constructor(e,t,i){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=i}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEnclosingDecorations=this._model.deltaDecorations(this._autoClosedEnclosingDecorations,[])}getAutoClosedCharactersRanges(){const e=[];for(let t=0;t<this._autoClosedCharactersDecorations.length;t++){const i=this._model.getDecorationRange(this._autoClosedCharactersDecorations[t]);i&&e.push(i)}return e}isValid(e){const t=[];for(let e=0;e<this._autoClosedEnclosingDecorations.length;e++){const i=this._model.getDecorationRange(this._autoClosedEnclosingDecorations[e]);if(i&&(t.push(i),i.startLineNumber!==i.endLineNumber))return!1}t.sort(Ole.compareRangesUsingStarts),e.sort(Ole.compareRangesUsingStarts);for(let i=0;i<e.length;i++){if(i>=t.length)return!1;if(!t[i].strictContainsRange(e[i]))return!1}return!0}}class _Ae{static executeCommands(e,t,i){const n={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(n,i);for(let e=0,t=n.trackedRanges.length;e<t;e++)n.model._setTrackedRange(n.trackedRanges[e],null,0);return o}static _innerExecuteCommands(e,t){if(this._arrayIsEmpty(t))return null;const i=this._getEditOperations(e,t);if(0===i.operations.length)return null;const n=i.operations,o=this._getLoserCursorMap(n);if(o.hasOwnProperty("0"))return console.warn("Ignoring commands"),null;const s=[];for(let e=0,t=n.length;e<t;e++)o.hasOwnProperty(n[e].identifier.major.toString())||s.push(n[e]);i.hadTrackedEditOperation&&s.length>0&&(s[0]._isTracked=!0);let r=e.model.pushEditOperations(e.selectionsBefore,s,(i=>{const n=[];for(let t=0;t<e.selectionsBefore.length;t++)n[t]=[];for(const e of i)e.identifier&&n[e.identifier.major].push(e);const o=(e,t)=>e.identifier.minor-t.identifier.minor,s=[];for(let i=0;i<e.selectionsBefore.length;i++)n[i].length>0?(n[i].sort(o),s[i]=t[i].computeCursorState(e.model,{getInverseEditOperations:()=>n[i],getTrackedSelection:t=>{const i=parseInt(t,10),n=e.model._getTrackedRange(e.trackedRanges[i]);return 0===e.trackedRangesDirection[i]?new Ple(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn):new Ple(n.endLineNumber,n.endColumn,n.startLineNumber,n.startColumn)}})):s[i]=e.selectionsBefore[i];return s}));r||(r=e.selectionsBefore);const a=[];for(const e in o)o.hasOwnProperty(e)&&a.push(parseInt(e,10));a.sort(((e,t)=>t-e));for(const e of a)r.splice(e,1);return r}static _arrayIsEmpty(e){for(let t=0,i=e.length;t<i;t++)if(e[t])return!1;return!0}static _getEditOperations(e,t){let i=[],n=!1;for(let o=0,s=t.length;o<s;o++){const s=t[o];if(s){const t=this._getEditOperationsFromCommand(e,o,s);i=i.concat(t.operations),n=n||t.hadTrackedEditOperation}}return{operations:i,hadTrackedEditOperation:n}}static _getEditOperationsFromCommand(e,t,i){const n=[];let o=0;const s=(e,s,r=!1)=>{Ole.isEmpty(e)&&""===s||n.push({identifier:{major:t,minor:o++},range:e,text:s,forceMoveMarkers:r,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let r=!1;const a={addEditOperation:s,addTrackedEditOperation:(e,t,i)=>{r=!0,s(e,t,i)},trackSelection:(t,i)=>{const n=Ple.liftSelection(t);let o;if(n.isEmpty())if("boolean"==typeof i)o=i?2:3;else{const t=e.model.getLineMaxColumn(n.startLineNumber);o=n.startColumn===t?2:3}else o=1;const s=e.trackedRanges.length,r=e.model._setTrackedRange(null,n,o);return e.trackedRanges[s]=r,e.trackedRangesDirection[s]=n.getDirection(),s.toString()}};try{i.getEditOperations(e.model,a)}catch(e){return zre(e),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:r}}static _getLoserCursorMap(e){(e=e.slice(0)).sort(((e,t)=>-Ole.compareRangesUsingEnds(e.range,t.range)));const t={};for(let i=1;i<e.length;i++){const n=e[i-1],o=e[i];if(Ole.getStartPosition(n.range).isBefore(Ole.getEndPosition(o.range))){let s;s=n.identifier.major>o.identifier.major?n.identifier.major:o.identifier.major,t[s.toString()]=!0;for(let t=0;t<e.length;t++)e[t].identifier.major===s&&(e.splice(t,1),t<i&&i--,t--);i>0&&i--}}return t}}class vAe{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class bAe{static _capture(e,t){const i=[];for(const n of t){if(n.startLineNumber!==n.endLineNumber)return null;i.push(new vAe(e.getLineContent(n.startLineNumber),n.startColumn-1,n.endColumn-1))}return i}constructor(e,t){this._original=bAe._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=bAe._capture(e,t);if(!i)return null;if(this._original.length!==i.length)return null;const n=[];for(let e=0,t=this._original.length;e<t;e++)n.push(bAe._deduceOutcome(this._original[e],i[e]));return n}static _deduceOutcome(e,t){const i=Math.min(e.startSelection,t.startSelection,ude(e.text,t.text)),n=Math.min(e.text.length-e.endSelection,t.text.length-t.endSelection,gde(e.text,t.text)),o=e.text.substring(i,e.text.length-n),s=t.text.substring(i,t.text.length-n);return new Uxe(o,e.startSelection-i,e.endSelection-i,s,t.startSelection-i,t.endSelection-i)}}function wAe(e,t,i,n,o,s,r){let a="<div>",l=n,h=0,d=!0;for(let c=0,u=t.getCount();c<u;c++){const u=t.getEndOffset(c);if(u<=n)continue;let g="";for(;l<u&&l<o;l++){const t=e.charCodeAt(l);switch(t){case 9:{let e=s-(l+h)%s;for(h+=e-1;e>0;)r&&d?(g+="&#160;",d=!1):(g+=" ",d=!0),e--;break}case 60:g+="&lt;",d=!1;break;case 62:g+="&gt;",d=!1;break;case 38:g+="&amp;",d=!1;break;case 0:g+="&#00;",d=!1;break;case 65279:case 8232:case 8233:case 133:g+="�",d=!1;break;case 13:g+="&#8203",d=!1;break;case 32:r&&d?(g+="&#160;",d=!1):(g+=" ",d=!0);break;default:g+=String.fromCharCode(t),d=!1}}if(a+=`<span style="${t.getInlineStyle(c,i)}">${g}</span>`,u>o||l>=o)break}return a+="</div>",a}class CAe{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,i=this._changes,n=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,n)}}class yAe{constructor(e,t,i,n,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=n,this.minWidth=o,this.prefixSum=0}}class SAe{constructor(e,t,i,n){this._instanceId=Tde(++SAe.INSTANCE_COUNT),this._pendingChanges=new CAe,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=n}static findInsertionIndex(e,t,i){let n=0,o=e.length;for(;n<o;){const s=n+o>>>1;t===e[s].afterLineNumber?i<e[s].ordinal?o=s:n=s+1:t<e[s].afterLineNumber?o=s:n=s+1}return n}setLineHeight(e){this._checkPendingChanges(),this._lineHeight=e}setPadding(e,t){this._paddingTop=e,this._paddingBottom=t}onFlushed(e){this._checkPendingChanges(),this._lineCount=e}changeWhitespace(e){let t=!1;try{e({insertWhitespace:(e,i,n,o)=>{t=!0,e|=0,i|=0,n|=0,o|=0;const s=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new yAe(s,e,i,n,o)),s},changeOneWhitespace:(e,i,n)=>{t=!0,i|=0,n|=0,this._pendingChanges.change({id:e,newAfterLineNumber:i,newHeight:n})},removeWhitespace:e=>{t=!0,this._pendingChanges.remove({id:e})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const t of e)this._insertWhitespace(t);for(const e of t)this._changeOneWhitespace(e.id,e.newAfterLineNumber,e.newHeight);for(const e of i){const t=this._findWhitespaceIndex(e.id);-1!==t&&this._removeWhitespace(t)}return}const n=new Set;for(const e of i)n.add(e.id);const o=new Map;for(const e of t)o.set(e.id,e);const s=e=>{const t=[];for(const i of e)if(!n.has(i.id)){if(o.has(i.id)){const e=o.get(i.id);i.afterLineNumber=e.newAfterLineNumber,i.height=e.newHeight}t.push(i)}return t},r=s(this._arr).concat(s(e));r.sort(((e,t)=>e.afterLineNumber===t.afterLineNumber?e.ordinal-t.ordinal:e.afterLineNumber-t.afterLineNumber)),this._arr=r,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=SAe.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,n=t.length;i<n;i++)if(t[i].id===e)return i;return-1}_changeOneWhitespace(e,t,i){const n=this._findWhitespaceIndex(e);if(-1!==n&&(this._arr[n].height!==i&&(this._arr[n].height=i,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,n-1)),this._arr[n].afterLineNumber!==t)){const e=this._arr[n];this._removeWhitespace(n),e.afterLineNumber=t,this._insertWhitespace(e)}}_removeWhitespace(e){this._arr.splice(e,1),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,e-1)}onLinesDeleted(e,t){this._checkPendingChanges(),e|=0,t|=0,this._lineCount-=t-e+1;for(let i=0,n=this._arr.length;i<n;i++){const n=this._arr[i].afterLineNumber;e<=n&&n<=t?this._arr[i].afterLineNumber=e-1:n>t&&(this._arr[i].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e|=0,t|=0,this._lineCount+=t-e+1;for(let i=0,n=this._arr.length;i<n;i++)e<=this._arr[i].afterLineNumber&&(this._arr[i].afterLineNumber+=t-e+1)}getWhitespacesTotalHeight(){return this._checkPendingChanges(),0===this._arr.length?0:this.getWhitespacesAccumulatedHeight(this._arr.length-1)}getWhitespacesAccumulatedHeight(e){this._checkPendingChanges(),e|=0;let t=Math.max(0,this._prefixSumValidIndex+1);0===t&&(this._arr[0].prefixSum=this._arr[0].height,t++);for(let i=t;i<=e;i++)this._arr[i].prefixSum=this._arr[i-1].prefixSum+this._arr[i].height;return this._prefixSumValidIndex=Math.max(this._prefixSumValidIndex,e),this._arr[e].prefixSum}getLinesTotalHeight(){return this._checkPendingChanges(),this._lineHeight*this._lineCount+this.getWhitespacesTotalHeight()+this._paddingTop+this._paddingBottom}getWhitespaceAccumulatedHeightBeforeLineNumber(e){this._checkPendingChanges(),e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e);return-1===t?0:this.getWhitespacesAccumulatedHeight(t)}_findLastWhitespaceBeforeLineNumber(e){e|=0;const t=this._arr;let i=0,n=t.length-1;for(;i<=n;){const o=i+((n-i|0)/2|0)|0;if(t[o].afterLineNumber<e){if(o+1>=t.length||t[o+1].afterLineNumber>=e)return o;i=o+1|0}else n=o-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e)+1;return t<this._arr.length?t:-1}getFirstWhitespaceIndexAfterLineNumber(e){return this._checkPendingChanges(),e|=0,this._findFirstWhitespaceAfterLineNumber(e)}getVerticalOffsetForLineNumber(e,t=!1){let i;return this._checkPendingChanges(),i=(e|=0)>1?this._lineHeight*(e-1):0,i+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0))+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){return this._checkPendingChanges(),e|=0,this._lineHeight*e+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0))+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),-1===this._minWidth){let e=0;for(let t=0,i=this._arr.length;t<i;t++)e=Math.max(e,this._arr[t].minWidth);this._minWidth=e}return this._minWidth}isAfterLines(e){return this._checkPendingChanges(),e>this.getLinesTotalHeight()}isInTopPadding(e){return 0!==this._paddingTop&&(this._checkPendingChanges(),e<this._paddingTop)}isInBottomPadding(e){return 0!==this._paddingBottom&&(this._checkPendingChanges(),e>=this.getLinesTotalHeight()-this._paddingBottom)}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),(e|=0)<0)return 1;const t=0|this._lineCount,i=this._lineHeight;let n=1,o=t;for(;n<o;){const t=(n+o)/2|0,s=0|this.getVerticalOffsetForLineNumber(t);if(e>=s+i)n=t+1;else{if(e>=s)return t;o=t}}return n>t?t:n}getLinesViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;const i=this._lineHeight,n=0|this.getLineNumberAtOrAfterVerticalOffset(e),o=0|this.getVerticalOffsetForLineNumber(n);let s=0|this._lineCount,r=0|this.getFirstWhitespaceIndexAfterLineNumber(n);const a=0|this.getWhitespacesCount();let l,h;-1===r?(r=a,h=s+1,l=0):(h=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));let d=o,c=d;const u=5e5;let g=0;o>=u&&(g=Math.floor(o/u)*u,g=Math.floor(g/i)*i,c-=g);const p=[],m=e+(t-e)/2;let f=-1;for(let e=n;e<=s;e++){for(-1===f&&(d<=m&&m<d+i||d>m)&&(f=e),d+=i,p[e-n]=c,c+=i;h===e;)c+=l,d+=l,r++,r>=a?h=s+1:(h=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));if(d>=t){s=e;break}}-1===f&&(f=s);const _=0|this.getVerticalOffsetForLineNumber(s);let v=n,b=s;return v<b&&o<e&&v++,v<b&&_+i>t&&b--,{bigNumbersDelta:g,startLineNumber:n,endLineNumber:s,relativeVerticalOffset:p,centeredLineNumber:f,completelyVisibleStartLineNumber:v,completelyVisibleEndLineNumber:b}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e|=0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i,n;return i=t>=1?this._lineHeight*t:0,n=e>0?this.getWhitespacesAccumulatedHeight(e-1):0,i+n+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e|=0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;if(e>=this.getVerticalOffsetForWhitespaceIndex(i)+this.getHeightForWhitespaceIndex(i))return-1;for(;t<i;){const n=Math.floor((t+i)/2),o=this.getVerticalOffsetForWhitespaceIndex(n);if(e>=o+this.getHeightForWhitespaceIndex(n))t=n+1;else{if(e>=o)return n;i=n}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e|=0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0)return null;if(t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const n=this.getHeightForWhitespaceIndex(t);return{id:this.getIdForWhitespaceIndex(t),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(t),verticalOffset:i,height:n}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),n=this.getWhitespacesCount()-1;if(i<0)return[];const o=[];for(let e=i;e<=n;e++){const i=this.getVerticalOffsetForWhitespaceIndex(e),n=this.getHeightForWhitespaceIndex(e);if(i>=t)break;o.push({id:this.getIdForWhitespaceIndex(e),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(e),verticalOffset:i,height:n})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].height}}SAe.INSTANCE_COUNT=0;class kAe{constructor(e,t,i,n){(e|=0)<0&&(e=0),(t|=0)<0&&(t=0),(i|=0)<0&&(i=0),(n|=0)<0&&(n=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=n,this.scrollHeight=Math.max(i,n)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class LAe extends aae{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new bae),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new kAe(0,0,0,0),this._scrollable=this._register(new Mke({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,n=t.contentHeight!==e.contentHeight;(i||n)&&this._onDidContentSizeChange.fire(new tAe(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}}class xAe extends aae{constructor(e,t,i){super(),this._configuration=e;const n=this._configuration.options,o=n.get(138),s=n.get(80);this._linesLayout=new SAe(t,n.get(63),s.top,s.bottom),this._scrollable=this._register(new LAe(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new kAe(o.contentWidth,0,o.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(108)?125:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(63)&&this._linesLayout.setLineHeight(t.get(63)),e.hasChanged(80)){const e=t.get(80);this._linesLayout.setPadding(e.top,e.bottom)}if(e.hasChanged(138)){const e=t.get(138),i=e.contentWidth,n=e.height,o=this._scrollable.getScrollDimensions(),s=o.contentWidth;this._scrollable.setScrollDimensions(new kAe(i,o.contentWidth,n,this._getContentHeight(i,n,s)))}else this._updateHeight();e.hasChanged(108)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const i=this._configuration.options.get(97);return 2===i.horizontal||e>=t?0:i.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return n.get(99)?o+=Math.max(0,t-n.get(63)-n.get(80).bottom):o+=this._getHorizontalScrollbarHeight(e,i),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new kAe(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new Ife(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new Ife(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(e){const t=this._configuration.options,i=t.get(139),n=t.get(47),o=t.get(138);if(i.isViewportWrapping){const i=t.get(69);return e>o.contentWidth+n.typicalHalfwidthCharacterWidth&&i.enabled&&"right"===i.side?e+o.verticalScrollbarWidth:e}{const i=t.get(98)*n.typicalHalfwidthCharacterWidth,s=this._linesLayout.getWhitespaceMinWidth();return Math.max(e+i+o.verticalScrollbarWidth,s)}}setMaxLineWidth(e){const t=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new kAe(t.width,this._computeContentWidth(e),t.height,t.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t);return{scrollTop:t,scrollTopWithoutViewZones:t-this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i),scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){1===t?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class DAe{constructor(e,t,i,n,o){this._cachedOnlyMinimapDecorations=null,this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const n=e.range,o=e.options;let s;if(o.isWholeLine){const e=this._coordinatesConverter.convertModelPositionToViewPosition(new Rle(n.startLineNumber,1),0),t=this._coordinatesConverter.convertModelPositionToViewPosition(new Rle(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)),1);s=new Ole(e.lineNumber,e.column,t.lineNumber,t.column)}else s=this._coordinatesConverter.convertModelRangeToViewRange(n,1);i=new Pfe(s,o),this._decorationsCache[t]=i}return i}getDecorationsViewportData(e,t=!1){let i=null!==this._cachedModelDecorationsResolver;return i=i&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),i=i&&this._cachedOnlyMinimapDecorations===t,i||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,t),this._cachedModelDecorationsResolverViewRange=e,this._cachedOnlyMinimapDecorations=t),this._cachedModelDecorationsResolver}getInlineDecorationsOnLine(e,t=!1){const i=new Ole(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(i,t).inlineDecorations[0]}_getDecorationsInRange(e,t){const i=this._linesCollection.getDecorationsInRange(e,this.editorId,Tre(this.configuration.options),t),n=e.startLineNumber,o=e.endLineNumber,s=[];let r=0;const a=[];for(let e=n;e<=o;e++)a[e-n]=[];for(let e=0,t=i.length;e<t;e++){const t=i[e],d=t.options;if(l=this.model,(h=t).options.hideInCommentTokens&&function(e,t){return EAe(e,t.range,(e=>1===e))}(l,h)||h.options.hideInStringTokens&&function(e,t){return EAe(e,t.range,(e=>2===e))}(l,h))continue;const c=this._getOrCreateViewModelDecoration(t),u=c.range;if(s[r++]=c,d.inlineClassName){const e=new Rfe(u,d.inlineClassName,d.inlineClassNameAffectsLetterSpacing?3:0),t=Math.max(n,u.startLineNumber),i=Math.min(o,u.endLineNumber);for(let o=t;o<=i;o++)a[o-n].push(e)}if(d.beforeContentClassName&&n<=u.startLineNumber&&u.startLineNumber<=o){const e=new Rfe(new Ole(u.startLineNumber,u.startColumn,u.startLineNumber,u.startColumn),d.beforeContentClassName,1);a[u.startLineNumber-n].push(e)}if(d.afterContentClassName&&n<=u.endLineNumber&&u.endLineNumber<=o){const e=new Rfe(new Ole(u.endLineNumber,u.endColumn,u.endLineNumber,u.endColumn),d.afterContentClassName,2);a[u.endLineNumber-n].push(e)}}var l,h;return{decorations:s,inlineDecorations:a}}}function EAe(e,t,i){for(let n=t.startLineNumber;n<=t.endLineNumber;n++){const o=e.tokenization.getLineTokens(n),s=n===t.startLineNumber,r=n===t.endLineNumber;let a=s?o.findTokenIndexAtOffset(t.startColumn-1):0;for(;a<o.getCount()&&!(r&&o.getStartOffset(a)>t.endColumn-1);){if(!i(o.getStandardTokenType(a)))return!1;a++}}return!0}function NAe(e,t){return null===e?t?MAe.INSTANCE:TAe.INSTANCE:new IAe(e,t)}class IAe{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,i){this._assertVisible();const n=i>0?this._projectionData.breakOffsets[i-1]:0,o=this._projectionData.breakOffsets[i];let s;if(null!==this._projectionData.injectionOffsets){const i=this._projectionData.injectionOffsets.map(((e,t)=>new tTe(0,0,e+1,this._projectionData.injectionOptions[t],0)));s=tTe.applyInjectedText(e.getLineContent(t),i).substring(n,o)}else s=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:o+1});return i>0&&(s=RAe(this._projectionData.wrappedTextIndentLength)+s),s}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){const n=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],n),n[0]}getViewLinesData(e,t,i,n,o,s,r){this._assertVisible();const a=this._projectionData,l=a.injectionOffsets,h=a.injectionOptions;let d,c=null;if(l){c=[];let e=0,t=0;for(let i=0;i<a.getOutputLineCount();i++){const n=new Array;c[i]=n;const o=i>0?a.breakOffsets[i-1]:0,s=a.breakOffsets[i];for(;t<l.length;){const r=h[t].content.length,d=l[t]+e,c=d+r;if(d>s)break;if(o<c){const e=h[t];if(e.inlineClassName){const t=i>0?a.wrappedTextIndentLength:0,r=t+Math.max(d-o,0),l=t+Math.min(c-o,s);r!==l&&n.push(new Ofe(r,l,e.inlineClassName,e.inlineClassNameAffectsLetterSpacing))}}if(!(c<=s))break;e+=r,t++}}}d=l?e.tokenization.getLineTokens(t).withInserted(l.map(((e,t)=>({offset:e,text:h[t].content,tokenMetadata:gfe.defaultTokenMetadata})))):e.tokenization.getLineTokens(t);for(let e=i;e<i+n;e++){const t=o+e-i;s[t]?r[t]=this._getViewLineData(d,c?c[e]:null,e):r[t]=null}}_getViewLineData(e,t,i){this._assertVisible();const n=this._projectionData,o=i>0?n.wrappedTextIndentLength:0,s=i>0?n.breakOffsets[i-1]:0,r=n.breakOffsets[i],a=e.sliceAndInflate(s,r,o);let l=a.getLineContent();i>0&&(l=RAe(n.wrappedTextIndentLength)+l);const h=this._projectionData.getMinOutputOffset(i)+1,d=l.length+1,c=i+1<this.getViewLineCount(),u=0===i?0:n.breakOffsetsVisibleColumn[i-1];return new Tfe(l,c,h,d,u,a,t)}getModelColumnOfViewPosition(e,t){return this._assertVisible(),this._projectionData.translateToInputOffset(e,t-1)+1}getViewPositionOfModelPosition(e,t,i=2){return this._assertVisible(),this._projectionData.translateToOutputPosition(t-1,i).toPosition(e)}getViewLineNumberOfModelPosition(e,t){return this._assertVisible(),e+this._projectionData.translateToOutputPosition(t-1).outputLineIndex}normalizePosition(e,t,i){const n=t.lineNumber-e;return this._projectionData.normalizeOutputPosition(e,t.column-1,i).toPosition(n)}getInjectedTextAt(e,t){return this._projectionData.getInjectedText(e,t-1)}_assertVisible(){if(!this._isVisible)throw new Error("Not supported")}}class MAe{constructor(){}isVisible(){return!0}setVisible(e){return e?this:TAe.INSTANCE}getProjectionData(){return null}getViewLineCount(){return 1}getViewLineContent(e,t,i){return e.getLineContent(t)}getViewLineLength(e,t,i){return e.getLineLength(t)}getViewLineMinColumn(e,t,i){return e.getLineMinColumn(t)}getViewLineMaxColumn(e,t,i){return e.getLineMaxColumn(t)}getViewLineData(e,t,i){const n=e.tokenization.getLineTokens(t),o=n.getLineContent();return new Tfe(o,!1,1,o.length+1,0,n.inflate(),null)}getViewLinesData(e,t,i,n,o,s,r){s[o]?r[o]=this.getViewLineData(e,t,0):r[o]=null}getModelColumnOfViewPosition(e,t){return t}getViewPositionOfModelPosition(e,t){return new Rle(e,t)}getViewLineNumberOfModelPosition(e,t){return e}normalizePosition(e,t,i){return t}getInjectedTextAt(e,t){return null}}MAe.INSTANCE=new MAe;class TAe{constructor(){}isVisible(){return!1}setVisible(e){return e?MAe.INSTANCE:this}getProjectionData(){return null}getViewLineCount(){return 0}getViewLineContent(e,t,i){throw new Error("Not supported")}getViewLineLength(e,t,i){throw new Error("Not supported")}getViewLineMinColumn(e,t,i){throw new Error("Not supported")}getViewLineMaxColumn(e,t,i){throw new Error("Not supported")}getViewLineData(e,t,i){throw new Error("Not supported")}getViewLinesData(e,t,i,n,o,s,r){throw new Error("Not supported")}getModelColumnOfViewPosition(e,t){throw new Error("Not supported")}getViewPositionOfModelPosition(e,t){throw new Error("Not supported")}getViewLineNumberOfModelPosition(e,t){throw new Error("Not supported")}normalizePosition(e,t,i){throw new Error("Not supported")}getInjectedTextAt(e,t){throw new Error("Not supported")}}TAe.INSTANCE=new TAe;const AAe=[""];function RAe(e){if(e>=AAe.length)for(let t=1;t<=e;t++)AAe[t]=OAe(t);return AAe[e]}function OAe(e){return new Array(e+1).join(" ")}class PAe{constructor(e,t,i,n,o,s,r,a,l,h){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=n,this.fontInfo=o,this.tabSize=s,this.wrappingStrategy=r,this.wrappingColumn=a,this.wrappingIndent=l,this.wordBreak=h,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new WAe(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),n=this.model.getInjectedTextDecorations(this._editorId),o=i.length,s=this.createLineBreaksComputer(),r=new Hse(tTe.fromDecorations(n));for(let e=0;e<o;e++){const n=r.takeWhile((t=>t.lineNumber===e+1));s.addRequest(i[e],n,t?t[e]:null)}const a=s.finalize(),l=[],h=this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e))).sort(Ole.compareRangesUsingStarts);let d=1,c=0,u=-1,g=u+1<h.length?c+1:o+2;for(let e=0;e<o;e++){const t=e+1;t===g&&(u++,d=h[u].startLineNumber,c=h[u].endLineNumber,g=u+1<h.length?c+1:o+2);const i=t>=d&&t<=c,n=NAe(a[e],!i);l[e]=n.getViewLineCount(),this.modelLineProjections[e]=n}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new $pe(l)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e)))}setHiddenAreas(e){const t=function(e){if(0===e.length)return[];const t=e.slice();t.sort(Ole.compareRangesUsingStarts);const i=[];let n=t[0].startLineNumber,o=t[0].endLineNumber;for(let e=1,s=t.length;e<s;e++){const s=t[e];s.startLineNumber>o+1?(i.push(new Ole(n,1,o,1)),n=s.startLineNumber,o=s.endLineNumber):s.endLineNumber>o&&(o=s.endLineNumber)}return i.push(new Ole(n,1,o,1)),i}(e.map((e=>this.model.validateRange(e)))),i=this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e))).sort(Ole.compareRangesUsingStarts);if(t.length===i.length){let e=!1;for(let n=0;n<t.length;n++)if(!t[n].equalsRange(i[n])){e=!0;break}if(!e)return!1}const n=t.map((e=>({range:e,options:DTe.EMPTY})));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,n);const o=t;let s=1,r=0,a=-1,l=a+1<o.length?r+1:this.modelLineProjections.length+2,h=!1;for(let e=0;e<this.modelLineProjections.length;e++){const t=e+1;t===l&&(a++,s=o[a].startLineNumber,r=o[a].endLineNumber,l=a+1<o.length?r+1:this.modelLineProjections.length+2);let i=!1;if(t>=s&&t<=r?this.modelLineProjections[e].isVisible()&&(this.modelLineProjections[e]=this.modelLineProjections[e].setVisible(!1),i=!0):(h=!0,this.modelLineProjections[e].isVisible()||(this.modelLineProjections[e]=this.modelLineProjections[e].setVisible(!0),i=!0)),i){const t=this.modelLineProjections[e].getViewLineCount();this.projectedModelLineLineCounts.setValue(e,t)}}return h||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return!(e<1||e>this.modelLineProjections.length)&&this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize!==e&&(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,n,o){const s=this.fontInfo.equals(e),r=this.wrappingStrategy===t,a=this.wrappingColumn===i,l=this.wrappingIndent===n,h=this.wordBreak===o;if(s&&r&&a&&l&&h)return!1;const d=s&&r&&!a&&l&&h;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=n,this.wordBreak=o;let c=null;if(d){c=[];for(let e=0,t=this.modelLineProjections.length;e<t;e++)c[e]=this.modelLineProjections[e].getProjectionData()}return this._constructLines(!1,c),!0}createLineBreaksComputer(){return("advanced"===this.wrappingStrategy?this._domLineBreaksComputerFactory:this._monospaceLineBreaksComputerFactory).createLineBreaksComputer(this.fontInfo,this.tabSize,this.wrappingColumn,this.wrappingIndent,this.wordBreak)}onModelFlushed(){this._constructLines(!0,null)}onModelLinesDeleted(e,t,i){if(!e||e<=this._validModelVersionId)return null;const n=1===t?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,o=this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections.splice(t-1,i-t+1),this.projectedModelLineLineCounts.removeValues(t-1,i-t+1),new jTe(n,o)}onModelLinesInserted(e,t,i,n){if(!e||e<=this._validModelVersionId)return null;const o=t>2&&!this.modelLineProjections[t-2].isVisible(),s=1===t?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let r=0;const a=[],l=[];for(let e=0,t=n.length;e<t;e++){const t=NAe(n[e],!o);a.push(t);const i=t.getViewLineCount();r+=i,l[e]=i}return this.modelLineProjections=this.modelLineProjections.slice(0,t-1).concat(a).concat(this.modelLineProjections.slice(t-1)),this.projectedModelLineLineCounts.insertValues(t-1,l),new qTe(s,s+r-1)}onModelLineChanged(e,t,i){if(null!==e&&e<=this._validModelVersionId)return[!1,null,null,null];const n=t-1,o=this.modelLineProjections[n].getViewLineCount(),s=NAe(i,this.modelLineProjections[n].isVisible());this.modelLineProjections[n]=s;const r=this.modelLineProjections[n].getViewLineCount();let a=!1,l=0,h=-1,d=0,c=-1,u=0,g=-1;return o>r?(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,h=l+r-1,u=h+1,g=u+(o-r)-1,a=!0):o<r?(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,h=l+o-1,d=h+1,c=d+(r-o)-1,a=!0):(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,h=l+r-1),this.projectedModelLineLineCounts.setValue(n,r),[a,l<=h?new KTe(l,h-l+1):null,d<=c?new qTe(d,c):null,u<=g?new jTe(u,g):null]}acceptVersionId(e){this._validModelVersionId=e,1!==this.modelLineProjections.length||this.modelLineProjections[0].isVisible()||this.setHiddenAreas([])}getViewLineCount(){return this.projectedModelLineLineCounts.getTotalSum()}_toValidViewLineNumber(e){if(e<1)return 1;const t=this.getViewLineCount();return e>t?t:0|e}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),s=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),r=this.model.guides.getActiveIndentGuide(n.lineNumber,o.lineNumber,s.lineNumber),a=this.convertModelPositionToViewPosition(r.startLineNumber,1),l=this.convertModelPositionToViewPosition(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber));return{startLineNumber:a.lineNumber,endLineNumber:l.lineNumber,indent:r.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,n=t.remainder;return new FAe(i+1,n)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new Rle(e.modelLineNumber,n)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new Rle(e.modelLineNumber,n)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),n=this.getViewLineInfo(t),o=new Array;let s=this.getModelStartPositionOfViewLine(i),r=new Array;for(let e=i.modelLineNumber;e<=n.modelLineNumber;e++){const t=this.modelLineProjections[e-1];if(t.isVisible()){const o=e===i.modelLineNumber?i.modelLineWrappedLineIdx:0,s=e===n.modelLineNumber?n.modelLineWrappedLineIdx+1:t.getViewLineCount();for(let t=o;t<s;t++)r.push(new FAe(e,t))}if(!t.isVisible()&&s){const t=new Rle(e-1,this.model.getLineMaxColumn(e-1)+1),i=Ole.fromPositions(s,t);o.push(new BAe(i,r)),r=[],s=null}else t.isVisible()&&!s&&(s=new Rle(e,1))}if(s){const e=Ole.fromPositions(s,this.getModelEndPositionOfViewLine(n));o.push(new BAe(e,r))}return o}getViewLinesBracketGuides(e,t,i,n){const o=i?this.convertViewPositionToModelPosition(i.lineNumber,i.column):null,s=[];for(const i of this.getViewLineInfosGroupedByModelRanges(e,t)){const e=i.modelRange.startLineNumber,t=this.model.guides.getLinesBracketGuides(e,i.modelRange.endLineNumber,o,n);for(const n of i.viewLines){const i=t[n.modelLineNumber-e].map((e=>{if(-1!==e.forWrappedLinesAfterColumn&&this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesAfterColumn).lineNumber>=n.modelLineWrappedLineIdx)return;if(-1!==e.forWrappedLinesBeforeOrAtColumn&&this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesBeforeOrAtColumn).lineNumber<n.modelLineWrappedLineIdx)return;if(!e.horizontalLine)return e;let t=-1;if(-1!==e.column){const i=this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.column);if(i.lineNumber===n.modelLineWrappedLineIdx)t=i.column;else if(i.lineNumber<n.modelLineWrappedLineIdx)t=this.getMinColumnOfViewLine(n);else if(i.lineNumber>n.modelLineWrappedLineIdx)return}const i=this.convertModelPositionToViewPosition(n.modelLineNumber,e.horizontalLine.endColumn),o=this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.horizontalLine.endColumn);return o.lineNumber===n.modelLineWrappedLineIdx?new VDe(e.visibleColumn,t,e.className,new zDe(e.horizontalLine.top,i.column),-1,-1):o.lineNumber<n.modelLineWrappedLineIdx||-1!==e.visibleColumn?void 0:new VDe(e.visibleColumn,t,e.className,new zDe(e.horizontalLine.top,this.getMaxColumnOfViewLine(n)),-1,-1)}));s.push(i.filter((e=>!!e)))}}return s}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),n=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const s=[],r=[],a=i.lineNumber-1,l=n.lineNumber-1;let h=null;for(let e=a;e<=l;e++){const t=this.modelLineProjections[e];if(t.isVisible()){const n=t.getViewLineNumberOfModelPosition(0,e===a?i.column:1),o=t.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(e+1)),l=o-n+1;let d=0;l>1&&1===t.getViewLineMinColumn(this.model,e+1,o)&&(d=0===n?1:2),s.push(l),r.push(d),null===h&&(h=new Rle(e+1,0))}else null!==h&&(o=o.concat(this.model.guides.getLinesIndentGuides(h.lineNumber,e)),h=null)}null!==h&&(o=o.concat(this.model.guides.getLinesIndentGuides(h.lineNumber,n.lineNumber)),h=null);const d=t-e+1,c=new Array(d);let u=0;for(let e=0,t=o.length;e<t;e++){let t=o[e];const i=Math.min(d-u,s[e]),n=r[e];let a;a=2===n?0:1===n?1:i;for(let e=0;e<i;e++)e===a&&(t=0),c[u++]=t}return c}getViewLineContent(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineContent(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineLength(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineLength(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMinColumn(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMinColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMaxColumn(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMaxColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineData(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineData(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLinesData(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const n=this.projectedModelLineLineCounts.getIndexOf(e-1);let o=e;const s=n.index,r=n.remainder,a=[];for(let n=s,l=this.model.getLineCount();n<l;n++){const l=this.modelLineProjections[n];if(!l.isVisible())continue;const h=n===s?r:0;let d=l.getViewLineCount()-h,c=!1;if(o+d>t&&(c=!0,d=t-o+1),l.getViewLinesData(this.model,n+1,h,d,o-e,i,a),o+=d,c)break}return a}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const n=this.projectedModelLineLineCounts.getIndexOf(e-1),o=n.index,s=n.remainder,r=this.modelLineProjections[o],a=r.getViewLineMinColumn(this.model,o+1,s),l=r.getViewLineMaxColumn(this.model,o+1,s);t<a&&(t=a),t>l&&(t=l);const h=r.getModelColumnOfViewPosition(s,t);return this.model.validatePosition(new Rle(o+1,h)).equals(i)?new Rle(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),n=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new Ole(i.lineNumber,i.column,n.lineNumber,n.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),n=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new Rle(i.modelLineNumber,n))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new Ole(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2){const n=this.model.validatePosition(new Rle(e,t)),o=n.lineNumber,s=n.column;let r=o-1,a=!1;for(;r>0&&!this.modelLineProjections[r].isVisible();)r--,a=!0;if(0===r&&!this.modelLineProjections[r].isVisible())return new Rle(1,1);const l=1+this.projectedModelLineLineCounts.getPrefixSum(r);let h;return h=a?this.modelLineProjections[r].getViewPositionOfModelPosition(l,this.model.getLineMaxColumn(r+1),i):this.modelLineProjections[o-1].getViewPositionOfModelPosition(l,s,i),h}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return Ole.fromPositions(i)}{const t=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),i=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new Ole(t.lineNumber,t.column,i.lineNumber,i.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const e=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(e,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(0===i&&!this.modelLineProjections[i].isVisible())return 1;const n=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(n,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,n){const o=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),s=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(s.lineNumber-o.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new Ole(o.lineNumber,1,s.lineNumber,s.column),t,i,n);let r=[];const a=o.lineNumber-1,l=s.lineNumber-1;let h=null;for(let e=a;e<=l;e++)if(this.modelLineProjections[e].isVisible())null===h&&(h=new Rle(e+1,e===a?o.column:1));else if(null!==h){const o=this.model.getLineMaxColumn(e);r=r.concat(this.model.getDecorationsInRange(new Ole(h.lineNumber,h.column,e,o),t,i,n)),h=null}null!==h&&(r=r.concat(this.model.getDecorationsInRange(new Ole(h.lineNumber,h.column,s.lineNumber,s.column),t,i,n)),h=null),r.sort(((e,t)=>{const i=Ole.compareRangesUsingStarts(e.range,t.range);return 0===i?e.id<t.id?-1:e.id>t.id?1:0:i}));const d=[];let c=0,u=null;for(const e of r){const t=e.id;u!==t&&(u=t,d[c++]=e)}return d}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return 0===t.modelLineWrappedLineIdx?this.model.getLineIndentColumn(t.modelLineNumber):0}}class FAe{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class BAe{constructor(e,t){this.modelRange=e,this.viewLines=t}}class WAe{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}class VAe{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new zAe(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,n){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,n)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new jTe(t,i)}onModelLinesInserted(e,t,i,n){return new qTe(t,i)}onModelLineChanged(e,t,i){return[!1,new KTe(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1,n=new Array(i);for(let e=0;e<i;e++)n[e]=0;return n}getViewLineContent(e){return this.model.getLineContent(e)}getViewLineLength(e){return this.model.getLineLength(e)}getViewLineMinColumn(e){return this.model.getLineMinColumn(e)}getViewLineMaxColumn(e){return this.model.getLineMaxColumn(e)}getViewLineData(e){const t=this.model.tokenization.getLineTokens(e),i=t.getLineContent();return new Tfe(i,!1,1,i.length+1,0,t.inflate(),null)}getViewLinesData(e,t,i){const n=this.model.getLineCount();e=Math.min(Math.max(1,e),n),t=Math.min(Math.max(1,t),n);const o=[];for(let n=e;n<=t;n++){const t=n-e;o[t]=i[t]?this.getViewLineData(n):null}return o}getDecorationsInRange(e,t,i,n){return this.model.getDecorationsInRange(e,t,i,n)}normalizePosition(e,t){return this.model.normalizePosition(e,t)}getLineIndentColumn(e){return this.model.getLineIndentColumn(e)}getInjectedTextAt(e){return null}}class zAe{constructor(e){this._lines=e}_validPosition(e){return this._lines.model.validatePosition(e)}_validRange(e){return this._lines.model.validateRange(e)}convertViewPositionToModelPosition(e){return this._validPosition(e)}convertViewRangeToModelRange(e){return this._validRange(e)}validateViewPosition(e,t){return this._validPosition(t)}validateViewRange(e,t){return this._validRange(t)}convertModelPositionToViewPosition(e){return this._validPosition(e)}convertModelRangeToViewRange(e){return this._validRange(e)}modelPositionIsVisible(e){const t=this._lines.model.getLineCount();return!(e.lineNumber<1||e.lineNumber>t)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}class HAe extends aae{constructor(e,t,i,n,o,s,r,a){if(super(),this.languageConfigurationService=r,this._themeService=a,this.hiddenAreasModel=new jAe,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new JTe,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new fxe(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._tokenizeViewportSoon=this._register(new hpe((()=>this.tokenizeViewport()),50)),this._updateConfigurationViewLineCount=this._register(new hpe((()=>this._updateConfigurationViewLineCountNow()),0)),this._hasFocus=!1,this._viewportStart=UAe.create(this.model),this.model.isTooLargeForTokenization())this._lines=new VAe(this.model);else{const e=this._configuration.options,t=e.get(47),i=e.get(132),s=e.get(139),r=e.get(131),a=e.get(123);this._lines=new PAe(this._editorId,this.model,n,o,t,this.model.getOptions().tabSize,i,s.wrappingColumn,r,a)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new pAe(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new xAe(this._configuration,this.getLineCount(),s)),this._register(this.viewLayout.onDidScroll((e=>{e.scrollTopChanged&&this._tokenizeViewportSoon.schedule(),e.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new GTe(e)),this._eventDispatcher.emitOutgoingEvent(new nAe(e.oldScrollWidth,e.oldScrollLeft,e.oldScrollHeight,e.oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop))}))),this._register(this.viewLayout.onDidContentSizeChange((e=>{this._eventDispatcher.emitOutgoingEvent(e)}))),this._decorations=new DAe(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast((e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}}))),this._register(aEe.getInstance().onDidChange((()=>{this._eventDispatcher.emitSingleViewEvent(new QTe)}))),this._register(this._themeService.onDidColorThemeChange((e=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new ZTe(e))}))),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}tokenizeViewport(){const e=this.viewLayout.getLinesViewportData(),t=new Ole(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber)),i=this._toModelVisibleRanges(t);for(const e of i)this.model.tokenization.tokenizeViewport(e.startLineNumber,e.endLineNumber)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new zTe(e)),this._eventDispatcher.emitOutgoingEvent(new iAe(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new OTe)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new PTe)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new Rle(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new $Ae(t,this._viewportStart.startLineDelta)}return new $Ae(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),n=this._configuration.options,o=n.get(47),s=n.get(132),r=n.get(139),a=n.get(131),l=n.get(123);this._lines.setWrappingSettings(o,s,r.wrappingColumn,a,l)&&(e.emitViewEvent(new VTe),e.emitViewEvent(new UTe),e.emitViewEvent(new WTe(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(86)&&(this._decorations.reset(),e.emitViewEvent(new WTe(null))),e.emitViewEvent(new FTe(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),fxe.shouldRecreate(t)&&(this.cursorConfig=new fxe(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText((e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();let i=!1,n=!1;const o=e instanceof lTe?e.rawContentChangedEvent.changes:e.changes,s=e instanceof lTe?e.rawContentChangedEvent.versionId:null,r=this._lines.createLineBreaksComputer();for(const e of o)switch(e.changeType){case 4:for(let t=0;t<e.detail.length;t++){const i=e.detail[t];let n=e.injectedTexts[t];n&&(n=n.filter((e=>!e.ownerId||e.ownerId===this._editorId))),r.addRequest(i,n,null)}break;case 2:{let t=null;e.injectedText&&(t=e.injectedText.filter((e=>!e.ownerId||e.ownerId===this._editorId))),r.addRequest(e.detail,t,null);break}}const a=r.finalize(),l=new Hse(a);for(const e of o)switch(e.changeType){case 1:this._lines.onModelFlushed(),t.emitViewEvent(new VTe),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),i=!0;break;case 3:{const n=this._lines.onModelLinesDeleted(s,e.fromLineNumber,e.toLineNumber);null!==n&&(t.emitViewEvent(n),this.viewLayout.onLinesDeleted(n.fromLineNumber,n.toLineNumber)),i=!0;break}case 4:{const n=l.takeCount(e.detail.length),o=this._lines.onModelLinesInserted(s,e.fromLineNumber,e.toLineNumber,n);null!==o&&(t.emitViewEvent(o),this.viewLayout.onLinesInserted(o.fromLineNumber,o.toLineNumber)),i=!0;break}case 2:{const i=l.dequeue(),[o,r,a,h]=this._lines.onModelLineChanged(s,e.lineNumber,i);n=o,r&&t.emitViewEvent(r),a&&(t.emitViewEvent(a),this.viewLayout.onLinesInserted(a.fromLineNumber,a.toLineNumber)),h&&(t.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber));break}}null!==s&&this._lines.acceptVersionId(s),this.viewLayout.onHeightMaybeChanged(),!i&&n&&(t.emitViewEvent(new UTe),t.emitViewEvent(new WTe(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){const e=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(e){const t=this.coordinatesConverter.convertModelPositionToViewPosition(e.getStartPosition()),i=this.viewLayout.getVerticalOffsetForLineNumber(t.lineNumber);this.viewLayout.setScrollPosition({scrollTop:i+this._viewportStart.startLineDelta},1)}}try{const t=this._eventDispatcher.beginEmitViewEvents();e instanceof lTe&&t.emitOutgoingEvent(new cAe(e.contentChangedEvent)),this._cursor.onModelContentChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._tokenizeViewportSoon.schedule()}))),this._register(this.model.onDidChangeTokens((e=>{const t=[];for(let i=0,n=e.ranges.length;i<n;i++){const n=e.ranges[i],o=this.coordinatesConverter.convertModelPositionToViewPosition(new Rle(n.fromLineNumber,1)).lineNumber,s=this.coordinatesConverter.convertModelPositionToViewPosition(new Rle(n.toLineNumber,this.model.getLineMaxColumn(n.toLineNumber))).lineNumber;t[i]={fromLineNumber:o,toLineNumber:s}}this._eventDispatcher.emitSingleViewEvent(new YTe(t)),e.tokenizationSupportChanged&&this._tokenizeViewportSoon.schedule(),this._eventDispatcher.emitOutgoingEvent(new gAe(e))}))),this._register(this.model.onDidChangeLanguageConfiguration((e=>{this._eventDispatcher.emitSingleViewEvent(new HTe),this.cursorConfig=new fxe(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new dAe(e))}))),this._register(this.model.onDidChangeLanguage((e=>{this.cursorConfig=new fxe(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new hAe(e))}))),this._register(this.model.onDidChangeOptions((e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const e=this._eventDispatcher.beginEmitViewEvents();e.emitViewEvent(new VTe),e.emitViewEvent(new UTe),e.emitViewEvent(new WTe(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new fxe(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new uAe(e))}))),this._register(this.model.onDidChangeDecorations((e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new WTe(e)),this._eventDispatcher.emitOutgoingEvent(new lAe(e))})))}setHiddenAreas(e,t){this.hiddenAreasModel.setHiddenAreas(t,e);const i=this.hiddenAreasModel.getMergedRanges();if(i===this.previousHiddenAreas)return;this.previousHiddenAreas=i;const n=this._captureStableViewport();let o=!1;try{const e=this._eventDispatcher.beginEmitViewEvents();o=this._lines.setHiddenAreas(i),o&&(e.emitViewEvent(new VTe),e.emitViewEvent(new UTe),e.emitViewEvent(new WTe(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged()),n.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),o&&this._eventDispatcher.emitOutgoingEvent(new sAe)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(138),t=this._configuration.options.get(63),i=Math.max(20,Math.round(e.height/t)),n=this.viewLayout.getLinesViewportData(),o=Math.max(1,n.completelyVisibleStartLineNumber-i),s=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new Ole(o,this.getLineMinColumn(o),s,this.getLineMaxColumn(s)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(0===i.length)return[t];const n=[];let o=0,s=t.startLineNumber,r=t.startColumn;const a=t.endLineNumber,l=t.endColumn;for(let e=0,t=i.length;e<t;e++){const t=i[e].startLineNumber,l=i[e].endLineNumber;l<s||t>a||(s<t&&(n[o++]=new Ole(s,r,t-1,this.model.getLineMaxColumn(t-1))),s=l+1,r=1)}return(s<a||s===a&&r<l)&&(n[o++]=new Ole(s,r,a,l)),n}getCompletelyVisibleViewRange(){const e=this.viewLayout.getLinesViewportData(),t=e.completelyVisibleStartLineNumber,i=e.completelyVisibleEndLineNumber;return new Ole(t,this.getLineMinColumn(t),i,this.getLineMaxColumn(i))}getCompletelyVisibleViewRangeAtScrollTop(e){const t=this.viewLayout.getLinesViewportDataAtScrollTop(e),i=t.completelyVisibleStartLineNumber,n=t.completelyVisibleEndLineNumber;return new Ole(i,this.getLineMinColumn(i),n,this.getLineMaxColumn(n))}saveState(){const e=this.viewLayout.saveState(),t=e.scrollTop,i=this.viewLayout.getLineNumberAtVerticalOffset(t),n=this.coordinatesConverter.convertViewPositionToModelPosition(new Rle(i,this.getLineMinColumn(i))),o=this.viewLayout.getVerticalOffsetForLineNumber(i)-t;return{scrollLeft:e.scrollLeft,firstPosition:n,firstPositionDeltaTop:o}}reduceRestoreState(e){if(void 0===e.firstPosition)return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),n=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:n}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,n){return this._lines.getViewLinesBracketGuides(e,t,i,n)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=ede(this.getLineContent(e));return-1===t?0:t+1}getLineLastNonWhitespaceColumn(e){const t=ide(this.getLineContent(e));return-1===t?0:t+2}getDecorationsInViewport(e,t=!1){return this._decorations.getDecorationsViewportData(e,t).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewportViewLineRenderingData(e,t){const i=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,i)}getViewLineRenderingData(e){const t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){const i=this.model.mightContainRTL(),n=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),s=this._lines.getViewLineData(e);return s.inlineDecorations&&(t=[...t,...s.inlineDecorations.map((t=>t.toInlineDecoration(e)))]),new Afe(s.minColumn,s.maxColumn,s.content,s.continuesWithWrappedLine,i,n,s.tokens,t,o,s.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const n=this._lines.getViewLinesData(e,t,i);return new Mfe(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,Tre(this._configuration.options)),i=new KAe;for(const n of t){const t=n.options,o=t.overviewRuler;if(!o)continue;const s=o.position;if(0===s)continue;const r=o.getColor(e.value),a=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.startLineNumber,n.range.startColumn),l=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.endLineNumber,n.range.endColumn);i.accept(r,t.zIndex,a,l,s)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const e=t.options.overviewRuler;null==e||e.invalidateCachedColor();const i=t.options.minimap;null==i||i.invalidateCachedColor()}}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){const i=this.coordinatesConverter.convertViewPositionToModelPosition(e);return this.model.modifyPosition(i,t)}deduceModelPositionRelativeToViewPosition(e,t,i){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e);2===this.model.getEOL().length&&(t<0?t-=i:t+=i);const o=this.model.getOffsetAt(n)+t;return this.model.getPositionAt(o)}getPlainTextToCopy(e,t,i){const n=i?"\r\n":this.model.getEOL();(e=e.slice(0)).sort(Ole.compareRangesUsingStarts);let o=!1,s=!1;for(const t of e)t.isEmpty()?o=!0:s=!0;if(!s){if(!t)return"";const i=e.map((e=>e.startLineNumber));let o="";for(let e=0;e<i.length;e++)e>0&&i[e-1]===i[e]||(o+=this.model.getLineContent(i[e])+n);return o}if(o&&t){const t=[];let n=0;for(const o of e){const e=o.startLineNumber;o.isEmpty()?e!==n&&t.push(this.model.getLineContent(e)):t.push(this.model.getValueInRange(o,i?2:0)),n=e}return 1===t.length?t[0]:t}const r=[];for(const t of e)t.isEmpty()||r.push(this.model.getValueInRange(t,i?2:0));return 1===r.length?r[0]:r}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===Dge)return null;if(1!==e.length)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const e=n.startLineNumber;n=new Ole(e,this.model.getLineMinColumn(e),e,this.model.getLineMaxColumn(e))}const o=this._configuration.options.get(47),s=this._getColorMap();let r;return/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===Pre.fontFamily?r=Pre.fontFamily:(r=o.fontFamily,r=r.replace(/"/g,"'"),/[,']/.test(r)||/[+ ]/.test(r)&&(r=`'${r}'`),r=`${r}, ${Pre.fontFamily}`),{mode:i,html:`<div style="color: ${s[1]};background-color: ${s[2]};font-family: ${r};font-weight: ${o.fontWeight};font-size: ${o.fontSize}px;line-height: ${o.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(n,s)+"</div>"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn,r=this.getTabSize();let a="";for(let e=i;e<=o;e++){const l=this.model.tokenization.getLineTokens(e),h=l.getLineContent(),d=e===i?n-1:0,c=e===o?s-1:h.length;a+=""===h?"<br>":wAe(h,l.inflate(),t,d,c,r,ese)}return a}_getColorMap(){const e=ehe.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;i<n;i++)t[i]=Owe.Format.CSS.formatHex(e[i]);return t}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,t,i){return this._withViewEventsCollector((n=>this._cursor.setStates(n,e,t,i)))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector((n=>this._cursor.setSelections(n,e,t,i)))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector((t=>this._cursor.restoreState(t,e)))}_executeCursorEdit(e){this._cursor.context.cursorConfig.readOnly?this._eventDispatcher.emitOutgoingEvent(new aAe):this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit((n=>this._cursor.executeEdits(n,e,t,i)))}startComposition(){this._executeCursorEdit((e=>this._cursor.startComposition(e)))}endComposition(e){this._executeCursorEdit((t=>this._cursor.endComposition(t,e)))}type(e,t){this._executeCursorEdit((i=>this._cursor.type(i,e,t)))}compositionType(e,t,i,n,o){this._executeCursorEdit((s=>this._cursor.compositionType(s,e,t,i,n,o)))}paste(e,t,i,n){this._executeCursorEdit((o=>this._cursor.paste(o,e,t,i,n)))}cut(e){this._executeCursorEdit((t=>this._cursor.cut(t,e)))}executeCommand(e,t){this._executeCursorEdit((i=>this._cursor.executeCommand(i,e,t)))}executeCommands(e,t){this._executeCursorEdit((i=>this._cursor.executeCommands(i,e,t)))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector((n=>this._cursor.revealPrimary(n,e,i,0,t,0)))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new Ole(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector((t=>t.emitViewEvent(new $Te(e,!1,i,null,0,!0,0))))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new Ole(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector((t=>t.emitViewEvent(new $Te(e,!1,i,null,0,!0,0))))}revealRange(e,t,i,n,o){this._withViewEventsCollector((s=>s.emitViewEvent(new $Te(e,!1,i,null,n,t,o))))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new XTe),this._eventDispatcher.emitOutgoingEvent(new oAe))}_withViewEventsCollector(e){try{return e(this._eventDispatcher.beginEmitViewEvents())}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}}class UAe{static create(e){const t=e._setTrackedRange(null,new Ole(1,1,1,1),1);return new UAe(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,n,o){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=n,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new Rle(t,e.getLineMinColumn(t))),n=e.model._setTrackedRange(this._modelTrackedRange,new Ole(i.lineNumber,i.column,i.lineNumber,i.column),1),o=e.viewLayout.getVerticalOffsetForLineNumber(t),s=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=n,this._startLineDelta=s-o}invalidate(){this._isValid=!1}}class KAe{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,o){const s=this._asMap[e];if(s){const e=s.data,t=e[e.length-3],r=e[e.length-1];if(t===o&&r+1>=i)return void(n>r&&(e[e.length-1]=n));e.push(o,i,n)}else{const s=new Ffe(e,t,[o,i,n]);this._asMap[e]=s,this.asArray.push(s)}}}class jAe{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&qAe(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce(((e,t)=>function(e,t){const i=[];let n=0,o=0;for(;n<e.length&&o<t.length;){const s=e[n],r=t[o];if(s.endLineNumber<r.startLineNumber-1)i.push(e[n++]);else if(r.endLineNumber<s.startLineNumber-1)i.push(t[o++]);else{const e=Math.min(s.startLineNumber,r.startLineNumber),t=Math.max(s.endLineNumber,r.endLineNumber);i.push(new Ole(e,1,t,1)),n++,o++}}for(;n<e.length;)i.push(e[n++]);for(;o<t.length;)i.push(t[o++]);return i}(e,t)),[]);return qAe(this.ranges,e)||(this.ranges=e),this.ranges}}function qAe(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].equalsRange(t[i]))return!1;return!0}class $Ae{constructor(e,t){this.viewportStartModelPosition=e,this.startLineDelta=t}recoverViewportStart(e,t){if(!this.viewportStartModelPosition)return;const i=e.convertModelPositionToViewPosition(this.viewportStartModelPosition),n=t.getVerticalOffsetForLineNumber(i.lineNumber);t.setScrollPosition({scrollTop:n+this.startLineDelta},1)}}class GAe{constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}get(e){return this._entries.get(e)}}var ZAe;!function(e){e[e.Ignore=0]="Ignore",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(ZAe||(ZAe={})),function(e){const t="error",i="warning",n="info";e.fromValue=function(o){return o?dde(t,o)?e.Error:dde(i,o)||dde("warn",o)?e.Warning:dde(n,o)?e.Info:e.Ignore:e.Ignore},e.toString=function(o){switch(o){case e.Error:return t;case e.Warning:return i;case e.Info:return n;default:return"ignore"}}}(ZAe||(ZAe={}));const YAe=ZAe;var QAe=YAe;const XAe=pce("notificationService");class JAe{constructor(e,t,i,n,o){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=n,this.wrappedTextIndentLength=o}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let i=this.breakOffsets[e]-t;return e>0&&(i+=this.wrappedTextIndentLength),i}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let i=0===e?t:this.breakOffsets[e-1]+t;if(null!==this.injectionOffsets)for(let e=0;e<this.injectionOffsets.length&&i>this.injectionOffsets[e];e++)i<this.injectionOffsets[e]+this.injectionOptions[e].content.length?i=this.injectionOffsets[e]:i-=this.injectionOptions[e].content.length;return i}translateToOutputPosition(e,t=2){let i=e;if(null!==this.injectionOffsets)for(let n=0;n<this.injectionOffsets.length&&!(e<this.injectionOffsets[n])&&(1===t||e!==this.injectionOffsets[n]);n++)i+=this.injectionOptions[n].content.length;return this.offsetInInputWithInjectionsToOutputPosition(i,t)}offsetInInputWithInjectionsToOutputPosition(e,t=2){let i=0,n=this.breakOffsets.length-1,o=0,s=0;for(;i<=n;){o=i+(n-i)/2|0;const r=this.breakOffsets[o];if(s=o>0?this.breakOffsets[o-1]:0,0===t)if(e<=s)n=o-1;else{if(!(e>r))break;i=o+1}else if(e<s)n=o-1;else{if(!(e>=r))break;i=o+1}}let r=e-s;return o>0&&(r+=this.wrappedTextIndentLength),new iRe(o,r)}normalizeOutputPosition(e,t,i){if(null!==this.injectionOffsets){const n=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(n,i);if(o!==n)return this.offsetInInputWithInjectionsToOutputPosition(o,i)}if(0===i){if(e>0&&t===this.getMinOutputOffset(e))return new iRe(e-1,this.getMaxOutputOffset(e-1))}else if(1===i&&e<this.getOutputLineCount()-1&&t===this.getMaxOutputOffset(e))return new iRe(e+1,this.getMinOutputOffset(e+1));return new iRe(e,t)}outputPositionToOffsetInInputWithInjections(e,t){return e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(2===t){if(e===i.offsetInInputWithInjections+i.length&&eRe(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let e=i.offsetInInputWithInjections;if(tRe(this.injectionOptions[i.injectedTextIndex].cursorStops))return e;let t=i.injectedTextIndex-1;for(;t>=0&&this.injectionOffsets[t]===this.injectionOffsets[i.injectedTextIndex]&&!eRe(this.injectionOptions[t].cursorStops)&&(e-=this.injectionOptions[t].content.length,!tRe(this.injectionOptions[t].cursorStops));)t--;return e}}if(1===t||4===t){let e=i.offsetInInputWithInjections+i.length,t=i.injectedTextIndex;for(;t+1<this.injectionOffsets.length&&this.injectionOffsets[t+1]===this.injectionOffsets[t];)e+=this.injectionOptions[t+1].content.length,t++;return e}if(0===t||3===t){let e=i.offsetInInputWithInjections,t=i.injectedTextIndex;for(;t-1>=0&&this.injectionOffsets[t-1]===this.injectionOffsets[t];)e-=this.injectionOptions[t-1].content.length,t--;return e}_ce()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),n=this.getInjectedTextAtOffset(i);return n?{options:this.injectionOptions[n.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(null!==t){let n=0;for(let o=0;o<t.length;o++){const s=i[o].content.length,r=t[o]+n,a=t[o]+n+s;if(r>e)break;if(e<=a)return{injectedTextIndex:o,offsetInInputWithInjections:r,length:s};n+=s}}}}function eRe(e){return null==e||e===rue.Right||e===rue.Both}function tRe(e){return null==e||e===rue.Left||e===rue.Both}class iRe{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new Rle(e+this.outputLineIndex,this.outputOffset+1)}}class nRe{static create(e){return new nRe(e.get(127),e.get(126))}constructor(e,t){this.classifier=new oRe(e,t)}createLineBreaksComputer(e,t,i,n,o){const s=[],r=[],a=[];return{addRequest:(e,t,i)=>{s.push(e),r.push(t),a.push(i)},finalize:()=>{const l=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,h=[];for(let e=0,d=s.length;e<d;e++){const d=r[e],c=a[e];!c||c.injectionOptions||d?h[e]=lRe(this.classifier,s[e],d,t,i,l,n,o):h[e]=aRe(this.classifier,c,s[e],t,i,l,n,o)}return sRe.length=0,rRe.length=0,h}}}}class oRe extends Ype{constructor(e,t){super(0);for(let t=0;t<e.length;t++)this.set(e.charCodeAt(t),1);for(let e=0;e<t.length;e++)this.set(t.charCodeAt(e),2)}get(e){return e>=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let sRe=[],rRe=[];function aRe(e,t,i,n,o,s,r,a){if(-1===o)return null;const l=i.length;if(l<=1)return null;const h="keepAll"===a,d=t.breakOffsets,c=t.breakOffsetsVisibleColumn,u=uRe(i,n,o,s,r),g=o-u,p=sRe,m=rRe;let f=0,_=0,v=0,b=o;const w=d.length;let C=0;if(C>=0){let e=Math.abs(c[C]-b);for(;C+1<w;){const t=Math.abs(c[C+1]-b);if(t>=e)break;e=t,C++}}for(;C<w;){let t=C<0?0:d[C],o=C<0?0:c[C];_>t&&(t=_,o=v);let r=0,a=0,u=0,y=0;if(o<=b){let v=o,w=0===t?0:i.charCodeAt(t-1),C=0===t?0:e.get(w),S=!0;for(let o=t;o<l;o++){const t=o,l=i.charCodeAt(o);let d,c;if(pde(l)?(o++,d=0,c=2):(d=e.get(l),c=hRe(l,v,n,s)),t>_&&cRe(0,C,l,d,h)&&(r=t,a=v),v+=c,v>b){t>_?(u=t,y=v-c):(u=o+1,y=v),v-a>g&&(r=0),S=!1;break}w=l,C=d}if(S){f>0&&(p[f]=d[d.length-1],m[f]=c[d.length-1],f++);break}}if(0===r){let l=o,d=i.charCodeAt(t),c=e.get(d),p=!1;for(let n=t-1;n>=_;n--){const t=n+1,o=i.charCodeAt(n);if(9===o){p=!0;break}let m,f;if(mde(o)?(n--,m=0,f=2):(m=e.get(o),f=Ede(o)?s:1),l<=b){if(0===u&&(u=t,y=l),l<=b-g)break;if(cRe(0,m,d,c,h)){r=t,a=l;break}}l-=f,d=o,c=m}if(0!==r){const e=g-(y-a);if(e<=n){const t=i.charCodeAt(u);let o;o=pde(t)?2:hRe(t,y,n,s),e-o<0&&(r=0)}}if(p){C--;continue}}if(0===r&&(r=u,a=y),r<=_){const e=i.charCodeAt(_);pde(e)?(r=_+2,a=v+2):(r=_+1,a=v+hRe(e,v,n,s))}for(_=r,p[f]=r,v=a,m[f]=a,f++,b=a+g;C<0||C<w&&c[C]<a;)C++;let S=Math.abs(c[C]-b);for(;C+1<w;){const e=Math.abs(c[C+1]-b);if(e>=S)break;S=e,C++}}return 0===f?null:(p.length=f,m.length=f,sRe=t.breakOffsets,rRe=t.breakOffsetsVisibleColumn,t.breakOffsets=p,t.breakOffsetsVisibleColumn=m,t.wrappedTextIndentLength=u,t)}function lRe(e,t,i,n,o,s,r,a){const l=tTe.applyInjectedText(t,i);let h,d;if(i&&i.length>0?(h=i.map((e=>e.options)),d=i.map((e=>e.column-1))):(h=null,d=null),-1===o)return h?new JAe(d,h,[l.length],[],0):null;const c=l.length;if(c<=1)return h?new JAe(d,h,[l.length],[],0):null;const u="keepAll"===a,g=uRe(l,n,o,s,r),p=o-g,m=[],f=[];let _=0,v=0,b=0,w=o,C=l.charCodeAt(0),y=e.get(C),S=hRe(C,0,n,s),k=1;pde(C)&&(S+=1,C=l.charCodeAt(1),y=e.get(C),k++);for(let t=k;t<c;t++){const i=t,o=l.charCodeAt(t);let r,a;pde(o)?(t++,r=0,a=2):(r=e.get(o),a=hRe(o,S,n,s)),cRe(0,y,o,r,u)&&(v=i,b=S),S+=a,S>w&&((0===v||S-b>p)&&(v=i,b=S-a),m[_]=v,f[_]=b,_++,w=b+p,v=0),C=o,y=r}return 0!==_||i&&0!==i.length?(m[_]=c,f[_]=S,new JAe(d,h,m,f,g)):null}function hRe(e,t,i,n){return 9===e?i-t%i:Ede(e)||e<32?n:1}function dRe(e,t){return t-e%t}function cRe(e,t,i,n,o){return 32!==i&&(2===t&&2!==n||1!==t&&1===n||!o&&3===t&&2!==n||!o&&3===n&&1!==t)}function uRe(e,t,i,n,o){let s=0;if(0!==o){const r=ede(e);if(-1!==r){for(let i=0;i<r;i++)s+=9===e.charCodeAt(i)?dRe(s,t):1;const a=3===o?2:2===o?1:0;for(let e=0;e<a;e++)s+=dRe(s,t);s+n>i&&(s=0)}}return s}var gRe;const pRe=null===(gRe=window.trustedTypes)||void 0===gRe?void 0:gRe.createPolicy("domLineBreaksComputer",{createHTML:e=>e});class mRe{static create(){return new mRe}constructor(){}createLineBreaksComputer(e,t,i,n,o){const s=[],r=[];return{addRequest:(e,t,i)=>{s.push(e),r.push(t)},finalize:()=>function(e,t,i,n,o,s,r){var a;function l(t){const i=r[t];if(i){const n=tTe.applyInjectedText(e[t],i),o=i.map((e=>e.options)),s=i.map((e=>e.column-1));return new JAe(s,o,[n.length],[],0)}return null}if(-1===n){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=l(i);return t}const h=Math.round(n*t.typicalHalfwidthCharacterWidth),d=3===o?2:2===o?1:0,c=Math.round(i*d),u=Math.ceil(t.spaceWidth*c),g=document.createElement("div");nce(g,t);const p=new Oue(1e4),m=[],f=[],_=[],v=[],b=[];for(let n=0;n<e.length;n++){const s=tTe.applyInjectedText(e[n],r[n]);let a=0,l=0,d=h;if(0!==o)if(a=ede(s),-1===a)a=0;else{for(let e=0;e<a;e++)l+=9===s.charCodeAt(e)?i-l%i:1;const e=Math.ceil(t.spaceWidth*l);e+t.typicalFullwidthCharacterWidth>h?(a=0,l=0):d=h-e}const c=s.substr(a),g=fRe(c,l,i,d,p,u);m[n]=a,f[n]=l,_[n]=c,v[n]=g[0],b[n]=g[1]}const w=p.build(),C=null!==(a=null==pRe?void 0:pRe.createHTML(w))&&void 0!==a?a:w;g.innerHTML=C,g.style.position="absolute",g.style.top="10000","keepAll"===s?(g.style.wordBreak="keep-all",g.style.overflowWrap="anywhere"):(g.style.wordBreak="inherit",g.style.overflowWrap="break-word"),document.body.appendChild(g);const y=document.createRange(),S=Array.prototype.slice.call(g.children,0),k=[];for(let t=0;t<e.length;t++){const e=_Re(y,S[t],_[t],v[t]);if(null===e){k[t]=l(t);continue}const i=m[t],n=f[t]+c,o=b[t],s=[];for(let t=0,i=e.length;t<i;t++)s[t]=o[e[t]];if(0!==i)for(let t=0,n=e.length;t<n;t++)e[t]+=i;let a,h;const d=r[t];d?(a=d.map((e=>e.options)),h=d.map((e=>e.column-1))):(a=null,h=null),k[t]=new JAe(h,a,e,s,n)}return document.body.removeChild(g),k}(s,e,t,i,n,o,r)}}}function fRe(e,t,i,n,o,s){if(0!==s){const e=String(s);o.appendString('<div style="text-indent: -'),o.appendString(e),o.appendString("px; padding-left: "),o.appendString(e),o.appendString("px; box-sizing: border-box; width:")}else o.appendString('<div style="width:');o.appendString(String(n)),o.appendString('px;">');const r=e.length;let a=t,l=0;const h=[],d=[];let c=0<r?e.charCodeAt(0):0;o.appendString("<span>");for(let t=0;t<r;t++){0!==t&&t%16384==0&&o.appendString("</span><span>"),h[t]=l,d[t]=a;const n=c;c=t+1<r?e.charCodeAt(t+1):0;let s=1,u=1;switch(n){case 9:s=i-a%i,u=s;for(let e=1;e<=s;e++)e<s?o.appendCharCode(160):o.appendASCIICharCode(32);break;case 32:32===c?o.appendCharCode(160):o.appendASCIICharCode(32);break;case 60:o.appendString("&lt;");break;case 62:o.appendString("&gt;");break;case 38:o.appendString("&amp;");break;case 0:o.appendString("&#00;");break;case 65279:case 8232:case 8233:case 133:o.appendCharCode(65533);break;default:Ede(n)&&u++,n<32?o.appendCharCode(9216+n):o.appendCharCode(n)}l+=s,a+=u}return o.appendString("</span>"),h[e.length]=l,d[e.length]=a,o.appendString("</div>"),[h,d]}function _Re(e,t,i,n){if(i.length<=1)return null;const o=Array.prototype.slice.call(t.children,0),s=[];try{vRe(e,o,n,0,null,i.length-1,null,s)}catch(e){return console.log(e),null}return 0===s.length?null:(s.push(i.length),s)}function vRe(e,t,i,n,o,s,r,a){if(n===s)return;if(o=o||bRe(e,t,i[n],i[n+1]),r=r||bRe(e,t,i[s],i[s+1]),Math.abs(o[0].top-r[0].top)<=.1)return;if(n+1===s)return void a.push(s);const l=n+(s-n)/2|0,h=bRe(e,t,i[l],i[l+1]);vRe(e,t,i,n,o,l,h,a),vRe(e,t,i,l,h,s,r,a)}function bRe(e,t,i,n){return e.setStart(t[i/16384|0].firstChild,i%16384),e.setEnd(t[n/16384|0].firstChild,n%16384),e.getClientRects()}class wRe extends aae{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new cae),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const e of t)this._pending.has(e.id)?zre(new Error(`Cannot have two contributions with the same id ${e.id}`)):this._pending.set(e.id,e);this._instantiateSome(0),this._register(dpe((()=>{this._instantiateSome(1)}))),this._register(dpe((()=>{this._instantiateSome(2)}))),this._register(dpe((()=>{this._instantiateSome(3)}),5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)"function"==typeof i.saveViewState&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)"function"==typeof i.restoreViewState&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){this._register(dpe((()=>{this._instantiateSome(1)}),50))}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const e of t)this._instantiateById(e.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const e=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,e),"function"==typeof e.restoreViewState&&0!==t.instantiation&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(e){zre(e)}}}}var CRe=function(e,t){return function(i,n){t(i,n,e)}};let yRe=0;class SRe{constructor(e,t,i,n,o){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=o}dispose(){nae(this.listenersToRemove),this.model.onBeforeDetached(),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}let kRe=class e extends aae{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,i,n,o,s,r,a,l,h,d,c){super(),this.languageConfigurationService=d,this._deliveryQueue=new wae,this._contributions=this._register(new wRe),this._onDidDispose=this._register(new bae),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new bae({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new bae({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new bae({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new bae({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new bae({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new bae({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new bae({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new bae({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new bae({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new bae({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new xRe(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new bae({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new LRe({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new LRe({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new xRe(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new xRe(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new xRe(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new xRe(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new xRe(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new xRe(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new xRe(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new xRe(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new xRe(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new xRe(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new xRe(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new xRe(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new xRe(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new xRe(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new xRe(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new xRe(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new xRe(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new bae({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new bae({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new bae({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new bae({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection();const u=Object.assign({},t);let g;this._domElement=e,this._overflowWidgetsDomNode=u.overflowWidgetsDomNode,delete u.overflowWidgetsDomNode,this._id=++yRe,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,u,h)),this._register(this._configuration.onDidChange((e=>{this._onDidChangeConfiguration.fire(e);const t=this._configuration.options;if(e.hasChanged(138)){const e=t.get(138);this._onDidLayoutChange.fire(e)}}))),this._contextKeyService=this._register(r.createScoped(this._domElement)),this._notificationService=l,this._codeEditorService=o,this._commandService=s,this._themeService=a,this._register(new DRe(this,this._contextKeyService)),this._register(new ERe(this,this._contextKeyService,c)),this._instantiationService=n.createChild(new GAe([qce,this._contextKeyService])),this._modelData=null,this._focusTracker=new NRe(e),this._register(this._focusTracker.onChange((()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())}))),this._contentWidgets={},this._overlayWidgets={},g=Array.isArray(i.contributions)?i.contributions:rwe.getEditorContributions(),this._contributions.initialize(this,g,this._instantiationService);for(const e of rwe.getEditorActions()){if(this._actions.has(e.id)){zre(new Error(`Cannot have two actions with the same id ${e.id}`));continue}const t=new dNe(e.id,e.label,e.alias,ire(e.precondition),(()=>this._instantiationService.invokeFunction((t=>Promise.resolve(e.runEditorCommand(t,this,null))))),this._contextKeyService);this._actions.set(t.id,t)}const p=()=>!this._configuration.options.get(86)&&this._configuration.options.get(33).enabled;this._register(new mbe(this._domElement,{onDragEnter:()=>{},onDragOver:e=>{if(!p())return;const t=this.getTargetAtClientPoint(e.clientX,e.clientY);(null==t?void 0:t.position)&&this.showDropIndicatorAt(t.position)},onDrop:e=>{return t=this,i=void 0,o=function*(){if(!p())return;if(this.removeDropIndicator(),!e.dataTransfer)return;const t=this.getTargetAtClientPoint(e.clientX,e.clientY);(null==t?void 0:t.position)&&this._onDropIntoEditor.fire({position:t.position,event:e})},new((n=void 0)||(n=Promise))((function(e,s){function r(e){try{l(o.next(e))}catch(e){s(e)}}function a(e){try{l(o.throw(e))}catch(e){s(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(r,a)}l((o=o.apply(t,i||[])).next())}));var t,i,n,o},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;null===(t=this._modelData)||void 0===t||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i){return new Cwe(e,t,this._domElement,i)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return nue.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?Mxe.getWordAtPosition(this._modelData.model,this._configuration.options.get(124),e):null}getValue(e=null){if(!this._modelData)return"";const t=!(!e||!e.preserveBOM);let i=0;return e&&e.lineEnding&&"\n"===e.lineEnding?i=1:e&&e.lineEnding&&"\r\n"===e.lineEnding&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){const t=e;if(null===this._modelData&&null===t)return;if(this._modelData&&this._modelData.model===t)return;const i=this.hasTextFocus(),n=this._detachModel();this._attachModel(t),i&&this.hasModel()&&this.focus();const o={oldModelUrl:n?n.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(o),this._postDetachModelCleanup(n),this._contributions.onAfterModelAttached()}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,n){const o=e.model.validatePosition({lineNumber:t,column:i}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(s.lineNumber,n)}getTopForLineNumber(t,i=!1){return this._modelData?e._getVerticalOffsetForPosition(this._modelData,t,1,i):-1}getTopForPosition(t,i){return this._modelData?e._getVerticalOffsetForPosition(this._modelData,t,i,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber,n)}getBottomForLineNumber(t,i=!1){return this._modelData?e._getVerticalOffsetAfterPosition(this._modelData,t,1,i):-1}setHiddenAreas(e,t){var i;null===(i=this._modelData)||void 0===i||i.viewModel.setHiddenAreas(e.map((e=>Ole.lift(e))),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return lke.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!Rle.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!Ole.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),s=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,s,t,n)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if("number"!=typeof e)throw new Error("Invalid arguments");this._sendRevealRange(new Ole(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,n){if(!Rle.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new Ole(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=Ple.isISelection(e),n=Ole.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){const i={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(i,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new Ple(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,n){if("number"!=typeof e||"number"!=typeof t)throw new Error("Invalid arguments");this._sendRevealRange(new Ole(e,1,t,1),i,!1,n)}revealRange(e,t=0,i=!1,n=!0){this._revealRange(e,i?1:0,n,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,n){if(!Ole.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(Ole.lift(e),t,i,n)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||0===e.length)throw new Error("Invalid arguments");for(let t=0,i=e.length;t<i;t++)if(!Ple.isISelection(e[t]))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,e,i)}}getContentWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getContentWidth():-1}getScrollWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollWidth():-1}getScrollLeft(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollLeft():-1}getContentHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getContentHeight():-1}getScrollHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollHeight():-1}getScrollTop(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollTop():-1}setScrollLeft(e,t=1){if(this._modelData){if("number"!=typeof e)throw new Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollLeft:e},t)}}setScrollTop(e,t=1){if(this._modelData){if("number"!=typeof e)throw new Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollTop:e},t)}}setScrollPosition(e,t=1){this._modelData&&this._modelData.viewModel.viewLayout.setScrollPosition(e,t)}saveViewState(){if(!this._modelData)return null;const e=this._contributions.saveViewState();return{cursorState:this._modelData.viewModel.saveCursorState(),viewState:this._modelData.viewModel.saveState(),contributionsState:e}}restoreViewState(e){if(!this._modelData||!this._modelData.hasRealView)return;const t=e;if(t&&t.cursorState&&t.viewState){const e=t.cursorState;Array.isArray(e)?e.length>0&&this._modelData.viewModel.restoreCursorState(e):this._modelData.viewModel.restoreCursorState([e]),this._contributions.restoreViewState(t.contributionsState||{});const i=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(i)}}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter((e=>e.isSupported())),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){switch(i=i||{},t){case"compositionStart":return void this._startComposition();case"compositionEnd":return void this._endComposition(e);case"type":{const t=i;return void this._type(e,t.text||"")}case"replacePreviousChar":{const t=i;return void this._compositionType(e,t.text||"",t.replaceCharCnt||0,0,0)}case"compositionType":{const t=i;return void this._compositionType(e,t.text||"",t.replacePrevCharCnt||0,t.replaceNextCharCnt||0,t.positionDelta||0)}case"paste":{const t=i;return void this._paste(e,t.text||"",t.pasteOnNewLine||!1,t.multicursorText||null,t.mode||null)}case"cut":return void this._cut(e)}const n=this.getAction(t);n?Promise.resolve(n.run()).then(void 0,zre):this._modelData&&(this._triggerEditorCommand(e,t,i)||this._triggerCommand(t,i))}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){this._modelData&&0!==t.length&&("keyboard"===e&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),"keyboard"===e&&this._onDidType.fire(t))}_compositionType(e,t,i,n,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,o,e)}_paste(e,t,i,n,o){if(!this._modelData||0===t.length)return;const s=this._modelData.viewModel,r=s.getSelection().getStartPosition();s.paste(t,i,n,e);const a=s.getSelection().getStartPosition();"keyboard"===e&&this._onDidPaste.fire({range:new Ole(r.lineNumber,r.column,a.lineNumber,a.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=rwe.getEditorCommand(t);return!!n&&((i=i||{}).source=e,this._instantiationService.invokeFunction((e=>{Promise.resolve(n.runEditorCommand(e,this,i)).then(void 0,zre)})),!0)}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!!this._modelData&&!this._configuration.options.get(86)&&(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!!this._modelData&&!this._configuration.options.get(86)&&(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData)return!1;if(this._configuration.options.get(86))return!1;let n;return n=i?Array.isArray(i)?()=>i:i:()=>null,this._modelData.viewModel.executeEdits(e,t,n),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new IRe(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,Tre(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,Tre(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?0===e.length&&0===t.length?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){this._modelData&&0!==e.length&&this._modelData.model.changeDecorations((t=>{t.deltaDecorations(e,[])}))}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(138)}createOverviewRuler(e){return this._modelData&&this._modelData.hasRealView?this._modelData.view.createOverviewRuler(e):null}getContainerDomNode(){return this._domElement}getDomNode(){return this._modelData&&this._modelData.hasRealView?this._modelData.view.domNode.domNode:null}delegateVerticalScrollbarPointerDown(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e){this._configuration.observeContainer(e),this.render()}focus(){this._modelData&&this._modelData.hasRealView&&this._modelData.view.focus()}hasTextFocus(){return!(!this._modelData||!this._modelData.hasRealView)&&this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id."),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const e=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(e)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const e=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(e)}}changeViewZones(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getTargetAtClientPoint(e,t):null}getScrolledVisiblePosition(t){if(!this._modelData||!this._modelData.hasRealView)return null;const i=this._modelData.model.validatePosition(t),n=this._configuration.options,o=n.get(138);return{top:e._getVerticalOffsetForPosition(this._modelData,i.lineNumber,i.column)-this.getScrollTop(),left:this._modelData.view.getOffsetForColumn(i.lineNumber,i.column)+o.glyphMarginWidth+o.lineNumbersWidth+o.decorationsWidth-this.getScrollLeft(),height:n.get(63)}}getOffsetForColumn(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getOffsetForColumn(e,t):-1}render(e=!1){this._modelData&&this._modelData.hasRealView&&this._modelData.view.render(!0,e)}setAriaOptions(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.setAriaOptions(e)}applyFontInfo(e){nce(e,this._configuration.options.get(47))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e)return void(this._modelData=null);const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount()),e.onBeforeAttached();const i=new HAe(this._id,this._configuration,e,mRe.create(),nRe.create(this._configuration.options),(e=>Eve(e)),this.languageConfigurationService,this._themeService);t.push(e.onWillDispose((()=>this.setModel(null)))),t.push(i.onEvent((t=>{switch(t.kind){case 0:this._onDidContentSizeChange.fire(t);break;case 1:this._editorTextFocus.setValue(t.hasFocus);break;case 2:this._onDidScrollChange.fire(t);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(t.reachedMaxCursorCount){const e=Toe(0,"The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",this.getOption(76));this._notificationService.prompt(QAe.Warning,e,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:Toe(0,"Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const e=[];for(let i=0,n=t.selections.length;i<n;i++)e[i]=t.selections[i].getPosition();const i={position:e[0],secondaryPositions:e.slice(1),reason:t.reason,source:t.source};this._onDidChangeCursorPosition.fire(i);const n={selection:t.selections[0],secondarySelections:t.selections.slice(1),modelVersionId:t.modelVersionId,oldSelections:t.oldSelections,oldModelVersionId:t.oldModelVersionId,source:t.source,reason:t.reason};this._onDidChangeCursorSelection.fire(n);break}case 7:this._onDidChangeModelDecorations.fire(t.event);break;case 8:this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._onDidChangeModelLanguage.fire(t.event);break;case 9:this._onDidChangeModelLanguageConfiguration.fire(t.event);break;case 10:this._onDidChangeModelContent.fire(t.event);break;case 11:this._onDidChangeModelOptions.fire(t.event);break;case 12:this._onDidChangeModelTokens.fire(t.event)}})));const[n,o]=this._createView(i);if(o){this._domElement.appendChild(n.domNode.domNode);let t=Object.keys(this._contentWidgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];n.addContentWidget(this._contentWidgets[i])}t=Object.keys(this._overlayWidgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];n.addOverlayWidget(this._overlayWidgets[i])}n.render(!1,!0),n.domNode.domNode.setAttribute("data-uri",e.uri.toString())}this._modelData=new SRe(e,i,n,o,t)}_createView(e){let t;t=this.isSimpleWidget?{paste:(e,t,i,n)=>{this._paste("keyboard",e,t,i,n)},type:e=>{this._type("keyboard",e)},compositionType:(e,t,i,n)=>{this._compositionType("keyboard",e,t,i,n)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:{paste:(e,t,i,n)=>{const o={text:e,pasteOnNewLine:t,multicursorText:i,mode:n};this._commandService.executeCommand("paste",o)},type:e=>{const t={text:e};this._commandService.executeCommand("type",t)},compositionType:(e,t,i,n)=>{if(i||n){const o={text:e,replacePrevCharCnt:t,replaceNextCharCnt:i,positionDelta:n};this._commandService.executeCommand("compositionType",o)}else{const i={text:e,replaceCharCnt:t};this._commandService.executeCommand("replacePreviousChar",i)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new lDe(e.coordinatesConverter);return i.onKeyDown=e=>this._onKeyDown.fire(e),i.onKeyUp=e=>this._onKeyUp.fire(e),i.onContextMenu=e=>this._onContextMenu.fire(e),i.onMouseMove=e=>this._onMouseMove.fire(e),i.onMouseLeave=e=>this._onMouseLeave.fire(e),i.onMouseDown=e=>this._onMouseDown.fire(e),i.onMouseUp=e=>this._onMouseUp.fire(e),i.onMouseDrag=e=>this._onMouseDrag.fire(e),i.onMouseDrop=e=>this._onMouseDrop.fire(e),i.onMouseDropCanceled=e=>this._onMouseDropCanceled.fire(e),i.onMouseWheel=e=>this._onMouseWheel.fire(e),[new hNe(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode),!0]}_postDetachModelCleanup(e){null==e||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return null!==this._modelData}showDropIndicatorAt(t){const i=[{range:new Ole(t.lineNumber,t.column,t.lineNumber,t.column),options:e.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(i),this.revealPosition(t,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}};kRe.dropIntoEditorDecorationOptions=DTe.register({description:"workbench-dnd-target",className:"dnd-target"}),kRe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([CRe(3,gce),CRe(4,mce),CRe(5,Bbe),CRe(6,qce),CRe(7,uLe),CRe(8,XAe),CRe(9,Xce),CRe(10,Oge),CRe(11,efe)],kRe);class LRe extends aae{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new bae(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new bae(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,2===this._value?this._onDidChangeToTrue.fire():1===this._value&&this._onDidChangeToFalse.fire())}}class xRe extends bae{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class DRe extends aae{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=Gxe.editorSimpleInput.bindTo(t),this._editorFocus=Gxe.focus.bindTo(t),this._textInputFocus=Gxe.textInputFocus.bindTo(t),this._editorTextFocus=Gxe.editorTextFocus.bindTo(t),this._editorTabMovesFocus=Gxe.tabMovesFocus.bindTo(t),this._editorReadonly=Gxe.readOnly.bindTo(t),this._inDiffEditor=Gxe.inDiffEditor.bindTo(t),this._editorColumnSelection=Gxe.columnSelection.bindTo(t),this._hasMultipleSelections=Gxe.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=Gxe.hasNonEmptySelection.bindTo(t),this._canUndo=Gxe.canUndo.bindTo(t),this._canRedo=Gxe.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration((()=>this._updateFromConfig()))),this._register(this._editor.onDidChangeCursorSelection((()=>this._updateFromSelection()))),this._register(this._editor.onDidFocusEditorWidget((()=>this._updateFromFocus()))),this._register(this._editor.onDidBlurEditorWidget((()=>this._updateFromFocus()))),this._register(this._editor.onDidFocusEditorText((()=>this._updateFromFocus()))),this._register(this._editor.onDidBlurEditorText((()=>this._updateFromFocus()))),this._register(this._editor.onDidChangeModel((()=>this._updateFromModel()))),this._register(this._editor.onDidChangeConfiguration((()=>this._updateFromModel()))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._editorTabMovesFocus.set(e.get(137)),this._editorReadonly.set(e.get(86)),this._inDiffEditor.set(e.get(58)),this._editorColumnSelection.set(e.get(19))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some((e=>!e.isEmpty())))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))}}class ERe extends aae{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=Gxe.languageId.bindTo(t),this._hasCompletionItemProvider=Gxe.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=Gxe.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=Gxe.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=Gxe.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=Gxe.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=Gxe.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=Gxe.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=Gxe.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=Gxe.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=Gxe.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=Gxe.hasReferenceProvider.bindTo(t),this._hasRenameProvider=Gxe.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=Gxe.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=Gxe.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=Gxe.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=Gxe.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=Gxe.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=Gxe.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=Gxe.isInWalkThroughSnippet.bindTo(t);const n=()=>this._update();this._register(e.onDidChangeModel(n)),this._register(e.onDidChangeModelLanguage(n)),this._register(i.completionProvider.onDidChange(n)),this._register(i.codeActionProvider.onDidChange(n)),this._register(i.codeLensProvider.onDidChange(n)),this._register(i.definitionProvider.onDidChange(n)),this._register(i.declarationProvider.onDidChange(n)),this._register(i.implementationProvider.onDidChange(n)),this._register(i.typeDefinitionProvider.onDidChange(n)),this._register(i.hoverProvider.onDidChange(n)),this._register(i.documentHighlightProvider.onDidChange(n)),this._register(i.documentSymbolProvider.onDidChange(n)),this._register(i.referenceProvider.onDidChange(n)),this._register(i.renameProvider.onDidChange(n)),this._register(i.documentFormattingEditProvider.onDidChange(n)),this._register(i.documentRangeFormattingEditProvider.onDidChange(n)),this._register(i.signatureHelpProvider.onDidChange(n)),this._register(i.inlayHintsProvider.onDidChange(n)),n()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents((()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInWalkThrough.reset()}))}_update(){const e=this._editor.getModel();e?this._contextKeyService.bufferChangeEvents((()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInWalkThrough.set(e.uri.scheme===_ve.walkThroughSnippet)})):this.reset()}}class NRe extends aae{constructor(e){super(),this._onChange=this._register(new bae),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(Jve(e)),this._register(this._domFocusTracker.onDidFocus((()=>{this._hasFocus=!0,this._onChange.fire(void 0)}))),this._register(this._domFocusTracker.onDidBlur((()=>{this._hasFocus=!1,this._onChange.fire(void 0)})))}hasFocus(){return this._hasFocus}}class IRe{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations((i=>{this._isChangingDecorations||e.call(t,i)}),i)}getRange(e){return this._editor.hasModel()?e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e]):null}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const n=e.getDecorationRange(i);n&&t.push(n)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){0!==this._decorationIds.length&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations((t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)}))}finally{this._isChangingDecorations=!1}}}const MRe=encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 3' enable-background='new 0 0 6 3' height='3' width='6'><g fill='"),TRe=encodeURIComponent("'><polygon points='5.5,0 2.5,3 1.1,3 4.1,0'/><polygon points='4,0 6,2 6,0.6 5.4,0'/><polygon points='0,2 1,3 2.4,3 0,0.6'/></g></svg>");function ARe(e){return MRe+encodeURIComponent(e.toString())+TRe}const RRe=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" height="3" width="12"><g fill="'),ORe=encodeURIComponent('"><circle cx="1" cy="1" r="1"/><circle cx="5" cy="1" r="1"/><circle cx="9" cy="1" r="1"/></g></svg>');_Le(((e,t)=>{const i=e.getColor(NCe);i&&t.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${ARe(i)}") repeat-x bottom left; }`);const n=e.getColor(ICe);n&&t.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${ARe(n)}") repeat-x bottom left; }`);const o=e.getColor(TCe);o&&t.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${ARe(o)}") repeat-x bottom left; }`);const s=e.getColor(RCe);s&&t.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${function(e){return RRe+encodeURIComponent(e.toString())+ORe}(s)}") no-repeat bottom left; }`);const r=e.getColor(MLe);r&&t.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${r.rgba.a}; }`)}));var PRe=i(3829),FRe={};FRe.styleTagTransform=Vr(),FRe.setAttributes=Pr(),FRe.insert=Rr().bind(null,"head"),FRe.domAPI=Tr(),FRe.insertStyleElement=Br(),Ir()(PRe.Z,FRe),PRe.Z&&PRe.Z.locals&&PRe.Z.locals;var BRe,WRe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};!function(e){e.North="north",e.South="south",e.East="east",e.West="west"}(BRe||(BRe={}));const VRe=new bae,zRe=new bae;class HRe{constructor(){this.disposables=new rae}get onPointerMove(){return this.disposables.add(new Yke(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new Yke(window,"mouseup")).event}dispose(){this.disposables.dispose()}}WRe([Dwe],HRe.prototype,"onPointerMove",null),WRe([Dwe],HRe.prototype,"onPointerUp",null);class URe{get onPointerMove(){return this.disposables.add(new Yke(this.el,Ewe.Change)).event}get onPointerUp(){return this.disposables.add(new Yke(this.el,Ewe.End)).event}constructor(e){this.el=e,this.disposables=new rae}dispose(){this.disposables.dispose()}}WRe([Dwe],URe.prototype,"onPointerMove",null),WRe([Dwe],URe.prototype,"onPointerUp",null);class KRe{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}WRe([Dwe],KRe.prototype,"onPointerMove",null),WRe([Dwe],KRe.prototype,"onPointerUp",null);const jRe="pointer-events-disabled";class qRe extends aae{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",0===e),this.el.classList.toggle("minimum",1===e),this.el.classList.toggle("maximum",2===e),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=t=>{this.orthogonalStartDragHandleDisposables.clear(),0!==t&&(this._orthogonalStartDragHandle=ebe(this.el,sbe(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(sae((()=>this._orthogonalStartDragHandle.remove()))),this.orthogonalStartDragHandleDisposables.add(new Yke(this._orthogonalStartDragHandle,"mouseenter")).event((()=>qRe.onMouseEnter(e)),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new Yke(this._orthogonalStartDragHandle,"mouseleave")).event((()=>qRe.onMouseLeave(e)),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}set orthogonalEndSash(e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=t=>{this.orthogonalEndDragHandleDisposables.clear(),0!==t&&(this._orthogonalEndDragHandle=ebe(this.el,sbe(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(sae((()=>this._orthogonalEndDragHandle.remove()))),this.orthogonalEndDragHandleDisposables.add(new Yke(this._orthogonalEndDragHandle,"mouseenter")).event((()=>qRe.onMouseEnter(e)),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new Yke(this._orthogonalEndDragHandle,"mouseleave")).event((()=>qRe.onMouseLeave(e)),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}constructor(e,t,i){super(),this.hoverDelay=300,this.hoverDelayer=this._register(new npe(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new bae),this._onDidStart=this._register(new bae),this._onDidChange=this._register(new bae),this._onDidReset=this._register(new bae),this._onDidEnd=this._register(new bae),this.orthogonalStartSashDisposables=this._register(new rae),this.orthogonalStartDragHandleDisposables=this._register(new rae),this.orthogonalEndSashDisposables=this._register(new rae),this.orthogonalEndDragHandleDisposables=this._register(new rae),this.onDidStart=this._onDidStart.event,this.onDidChange=this._onDidChange.event,this.onDidReset=this._onDidReset.event,this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.el=ebe(e,sbe(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),tse&&this.el.classList.add("mac");const n=this._register(new Yke(this.el,"mousedown")).event;this._register(n((e=>this.onPointerStart(e,new HRe)),this));const o=this._register(new Yke(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const s=this._register(new Yke(this.el,"mouseenter")).event;this._register(s((()=>qRe.onMouseEnter(this))));const r=this._register(new Yke(this.el,"mouseleave")).event;this._register(r((()=>qRe.onMouseLeave(this)))),this._register(Nwe.addTarget(this.el));const a=this._register(new Yke(this.el,Ewe.Start)).event;this._register(a((e=>this.onPointerStart(e,new URe(this.el))),this));const l=this._register(new Yke(this.el,Ewe.Tap)).event;let h;this._register(l((e=>{if(h)return clearTimeout(h),h=void 0,void this.onPointerDoublePress(e);clearTimeout(h),h=setTimeout((()=>h=void 0),250)}),this)),"number"==typeof i.size?(this.size=i.size,0===i.orientation?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=4,this._register(VRe.event((e=>{this.size=e,this.layout()})))),this._register(zRe.event((e=>this.hoverDelay=e))),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,1===this.orientation?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",!1),this.layout()}onPointerStart(e,t){Qve(e);let i=!1;if(!e.__orthogonalSashEvent){const n=this.getOrthogonalSash(e);n&&(i=!0,e.__orthogonalSashEvent=!0,n.onPointerStart(e,new KRe(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new KRe(t))),!this.state)return;const n=document.getElementsByTagName("iframe");for(const e of n)e.classList.add(jRe);const o=e.pageX,s=e.pageY,r=e.altKey,a={startX:o,currentX:o,startY:s,currentY:s,altKey:r};this.el.classList.add("active"),this._onDidStart.fire(a);const l=qve(this.el),h=()=>{let e="";e=i?"all-scroll":1===this.orientation?1===this.state?"s-resize":2===this.state?"n-resize":tse?"row-resize":"ns-resize":1===this.state?"e-resize":2===this.state?"w-resize":tse?"col-resize":"ew-resize",l.textContent=`* { cursor: ${e} !important; }`},d=new rae;h(),i||this.onDidEnablementChange.event(h,null,d),t.onPointerMove((e=>{Qve(e,!1);const t={startX:o,currentX:e.pageX,startY:s,currentY:e.pageY,altKey:r};this._onDidChange.fire(t)}),null,d),t.onPointerUp((e=>{Qve(e,!1),this.el.removeChild(l),this.el.classList.remove("active"),this._onDidEnd.fire(),d.dispose();for(const e of n)e.classList.remove(jRe)}),null,d),d.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger((()=>e.el.classList.add("hover")),e.hoverDelay).then(void 0,(()=>{})),!t&&e.linkedSash&&qRe.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&qRe.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){qRe.onMouseLeave(this)}layout(){if(0===this.orientation){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){var t;const i=null!==(t=e.initialTarget)&&void 0!==t?t:e.target;if(i&&i instanceof HTMLElement)return i.classList.contains("orthogonal-drag-handle")?i.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash:void 0}dispose(){super.dispose(),this.el.remove()}}var $Re=i(9618),GRe={};GRe.styleTagTransform=Vr(),GRe.setAttributes=Pr(),GRe.insert=Rr().bind(null,"head"),GRe.domAPI=Tr(),GRe.insertStyleElement=Br(),Ir()($Re.Z,GRe),$Re.Z&&$Re.Z.locals&&$Re.Z.locals;class ZRe{static capture(e){let t=null,i=0;if(0!==e.getScrollTop()){const n=e.getVisibleRanges();if(n.length>0){t=n[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}}return new ZRe(t,i,e.getPosition())}constructor(e,t,i){this._visiblePosition=e,this._visiblePositionScrollDelta=t,this._cursorPosition=i}restore(e){if(this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i)}}var YRe=i(4672),QRe={};QRe.styleTagTransform=Vr(),QRe.setAttributes=Pr(),QRe.insert=Rr().bind(null,"head"),QRe.domAPI=Tr(),QRe.insertStyleElement=Br(),Ir()(YRe.Z,QRe),YRe.Z&&YRe.Z.locals&&YRe.Z.locals;const XRe={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:age.text};var JRe,eOe;class tOe{constructor(e,t){this.uri=e,this.value=t}}class iOe{constructor(e,t){this[JRe]="ResourceMap",e instanceof iOe?(this.map=new Map(e.map),this.toKey=null!=t?t:iOe.defaultToKey):(this.map=new Map,this.toKey=null!=e?e:iOe.defaultToKey)}set(e,t){return this.map.set(this.toKey(e),new tOe(e,t)),this}get(e){var t;return null===(t=this.map.get(this.toKey(e)))||void 0===t?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){void 0!==t&&(e=e.bind(t));for(const[t,i]of this.map)e(i.value,i.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(JRe=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}iOe.defaultToKey=e=>e.toString();class nOe{constructor(){this[eOe]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return null===(e=this._head)||void 0===e?void 0:e.value}get last(){var e;return null===(e=this._tail)||void 0===e?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return 0!==t&&this.touch(i,t),i.value}set(e,t,i=0){let n=this._map.get(e);if(n)n.value=t,0!==i&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case 0:case 2:default:this.addItemLast(n);break;case 1:this.addItemFirst(n)}this._map.set(e,n),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const i=this._state;let n=this._head;for(;n;){if(t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");n=n.next}}keys(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.key,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}values(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.value,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}entries(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:[i.key,i.value],done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}[(eOe=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(1===t||2===t)if(1===t){if(e===this._head)return;const t=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(t.previous=i,i.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(2===t){if(e===this._tail)return;const t=e.next,i=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=i,i.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}toJSON(){const e=[];return this.forEach(((t,i)=>{e.push([i,t])})),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}class oOe extends nOe{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}function sOe(...e){return function(t,i){for(let n=0,o=e.length;n<o;n++){const o=e[n](t,i);if(o)return o}return null}}aOe.bind(void 0,!1);const rOe=aOe.bind(void 0,!0);function aOe(e,t,i){if(!i||i.length<t.length)return null;let n;return n=e?cde(i,t):0===i.indexOf(t),n?t.length>0?[{start:0,end:t.length}]:[]:null}function lOe(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]===t[n]){let o=null;return(o=lOe(e,t,i+1,n+1))?mOe({start:n,end:n+1},o):null}return lOe(e,t,i,n+1)}function hOe(e){return 97<=e&&e<=122}function dOe(e){return 65<=e&&e<=90}function cOe(e){return 48<=e&&e<=57}function uOe(e){return 32===e||9===e||10===e||13===e}const gOe=new Set;function pOe(e){return hOe(e)||dOe(e)||cOe(e)}function mOe(e,t){return 0===t.length?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function fOe(e,t){for(let i=t;i<e.length;i++){const t=e.charCodeAt(i);if(dOe(t)||cOe(t)||i>0&&!pOe(e.charCodeAt(i-1)))return i}return e.length}function _Oe(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]!==t[n].toLowerCase())return null;{let o=null,s=n+1;for(o=_Oe(e,t,i+1,n+1);!o&&(s=fOe(t,s))<t.length;)o=_Oe(e,t,i+1,s),s++;return null===o?null:mOe({start:n,end:n+1},o)}}function vOe(e,t){if(!t)return null;if(0===(t=t.trim()).length)return null;if(!function(e){let t=0,i=0,n=0,o=0;for(let s=0;s<e.length;s++)n=e.charCodeAt(s),dOe(n)&&t++,hOe(n)&&i++,uOe(n)&&o++;return 0!==t&&0!==i||0!==o?t<=5:e.length<=30}(e))return null;if(t.length>60)return null;const i=function(e){let t=0,i=0,n=0,o=0,s=0;for(let r=0;r<e.length;r++)s=e.charCodeAt(r),dOe(s)&&t++,hOe(s)&&i++,pOe(s)&&n++,cOe(s)&&o++;return{upperPercent:t/e.length,lowerPercent:i/e.length,alphaPercent:n/e.length,numericPercent:o/e.length}}(t);if(!function(e){const{upperPercent:t,lowerPercent:i,alphaPercent:n,numericPercent:o}=e;return i>.2&&t<.8&&n>.6&&o<.2}(i)){if(!function(e){const{upperPercent:t,lowerPercent:i}=e;return 0===i&&t>.6}(i))return null;t=t.toLowerCase()}let n=null,o=0;for(e=e.toLowerCase();o<t.length&&null===(n=_Oe(e,t,0,o));)o=fOe(t,o+1);return n}"()[]{}<>`'\"-/;:,.?!".split("").forEach((e=>gOe.add(e.charCodeAt(0))));const bOe=sOe(rOe,vOe,(function(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1===i?null:[{start:i,end:i+e.length}]})),wOe=sOe(rOe,vOe,(function(e,t){return lOe(e.toLowerCase(),t.toLowerCase(),0,0)})),COe=new oOe(1e4);function yOe(e,t,i=!1){if("string"!=typeof e||"string"!=typeof t)return null;let n=COe.get(e);n||(n=new RegExp(e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*"),"i"),COe.set(e,n));const o=n.exec(t);return o?[{start:o.index,end:o.index+o[0].length}]:i?wOe(e,t):bOe(e,t)}const SOe=128;function kOe(){const e=[],t=[];for(let e=0;e<=SOe;e++)t[e]=0;for(let i=0;i<=SOe;i++)e.push(t.slice(0));return e}function LOe(e){const t=[];for(let i=0;i<=e;i++)t[i]=0;return t}const xOe=LOe(256),DOe=LOe(256),EOe=kOe(),NOe=kOe(),IOe=kOe();function MOe(e,t){if(t<0||t>=e.length)return!1;const i=e.codePointAt(t);switch(i){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!Nde(i)}}function TOe(e,t){if(t<0||t>=e.length)return!1;switch(e.charCodeAt(t)){case 32:case 9:return!0;default:return!1}}function AOe(e,t,i){return t[e]!==i[e]}var ROe;!function(e){e.Default=[-100,0],e.isDefault=function(e){return!e||2===e.length&&-100===e[0]&&0===e[1]}}(ROe||(ROe={}));class OOe{constructor(e,t){this.firstMatchCanBeWeak=e,this.boostFullMatch=t}}function POe(e,t,i,n,o,s,r=OOe.default){const a=e.length>SOe?SOe:e.length,l=n.length>SOe?SOe:n.length;if(i>=a||s>=l||a-i>l-s)return;if(!function(e,t,i,n,o,s,r=!1){for(;t<i&&o<s;)e[t]===n[o]&&(r&&(xOe[t]=o),t+=1),o+=1;return t===i}(t,i,a,o,s,l,!0))return;!function(e,t,i,n,o,s){let r=e-1,a=t-1;for(;r>=i&&a>=n;)o[r]===s[a]&&(DOe[r]=a,r--),a--}(a,l,i,s,t,o);let h=1,d=1,c=i,u=s;const g=[!1];for(h=1,c=i;c<a;h++,c++){const r=xOe[c],p=DOe[c],m=c+1<a?DOe[c+1]:l;for(d=r-s+1,u=r;u<m;d++,u++){let a=Number.MIN_SAFE_INTEGER,m=!1;u<=p&&(a=FOe(e,t,c,i,n,o,u,l,s,0===EOe[h-1][d-1],g));let f=0;a!==Number.MAX_SAFE_INTEGER&&(m=!0,f=a+NOe[h-1][d-1]);const _=u>r,v=_?NOe[h][d-1]+(EOe[h][d-1]>0?-5:0):0,b=u>r+1&&EOe[h][d-1]>0,w=b?NOe[h][d-2]+(EOe[h][d-2]>0?-5:0):0;if(b&&(!_||w>=v)&&(!m||w>=f))NOe[h][d]=w,IOe[h][d]=3,EOe[h][d]=0;else if(_&&(!m||v>=f))NOe[h][d]=v,IOe[h][d]=2,EOe[h][d]=0;else{if(!m)throw new Error("not possible");NOe[h][d]=f,IOe[h][d]=1,EOe[h][d]=EOe[h-1][d-1]+1}}}if(!g[0]&&!r.firstMatchCanBeWeak)return;h--,d--;const p=[NOe[h][d],s];let m=0,f=0;for(;h>=1;){let e=d;do{const t=IOe[h][e];if(3===t)e-=2;else{if(2!==t)break;e-=1}}while(e>=1);m>1&&t[i+h-1]===o[s+d-1]&&!AOe(e+s-1,n,o)&&m+1>EOe[h][e]&&(e=d),e===d?m++:m=1,f||(f=e),h--,d=e-1,p.push(d)}l===a&&r.boostFullMatch&&(p[0]+=2);const _=f-a;return p[0]-=_,p}function FOe(e,t,i,n,o,s,r,a,l,h,d){if(t[i]!==s[r])return Number.MIN_SAFE_INTEGER;let c=1,u=!1;return r===i-n?c=e[i]===o[r]?7:5:!AOe(r,o,s)||0!==r&&AOe(r-1,o,s)?!MOe(s,r)||0!==r&&MOe(s,r-1)?(MOe(s,r-1)||TOe(s,r-1))&&(c=5,u=!0):c=5:(c=e[i]===o[r]?7:5,u=!0),c>1&&i===n&&(d[0]=!0),u||(u=AOe(r,o,s)||MOe(s,r-1)||TOe(s,r-1)),i===n?r>l&&(c-=u?3:5):c+=h?u?2:0:u?0:1,r+1===a&&(c-=u?3:5),c}OOe.default={boostFullMatch:!0,firstMatchCanBeWeak:!1};const BOe=new RegExp(`\\$\\(${Ibe.iconNameExpression}(?:${Ibe.iconModifierExpression})?\\)`,"g"),WOe=new RegExp(`(\\\\)?${BOe.source}`,"g"),VOe=new RegExp(`\\\\${BOe.source}`,"g"),zOe=new RegExp(`(\\s)?(\\\\)?${BOe.source}(\\s)?`,"g");function HOe(e){return-1===e.indexOf("$(")?e:e.replace(zOe,((e,t,i,n)=>i?e:t||n||""))}const UOe=new RegExp(`\\$\\(${Ibe.iconNameCharacter}+\\)`,"g");function KOe(e){UOe.lastIndex=0;let t="";const i=[];let n=0;for(;;){const o=UOe.lastIndex,s=UOe.exec(e),r=e.substring(o,null==s?void 0:s.index);if(r.length>0){t+=r;for(let e=0;e<r.length;e++)i.push(n)}if(!s)break;n+=s[0].length}return{text:t,iconOffsets:i}}function jOe(e,t,i=!1){const{text:n,iconOffsets:o}=t;if(!o||0===o.length)return yOe(e,n,i);const s=Yhe(n," "),r=n.length-s.length,a=yOe(e,s,i);if(a)for(const e of a){const t=o[e.start+r]+r;e.start+=t,e.end+=t}return a}class qOe{constructor(e="",t=!1){var i,n,o;if(this.value=e,"string"!=typeof this.value)throw $re("value");"boolean"==typeof t?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=null!==(i=t.isTrusted)&&void 0!==i?i:void 0,this.supportThemeIcons=null!==(n=t.supportThemeIcons)&&void 0!==n&&n,this.supportHtml=null!==(o=t.supportHtml)&&void 0!==o&&o)}appendText(e,t=0){var i;return this.value+=function(e){return e.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}(this.supportThemeIcons?(i=e,i.replace(WOe,((e,t)=>t?e:`\\${e}`))):e).replace(/([ \t]+)/g,((e,t)=>"&nbsp;".repeat(t.length))).replace(/\>/gm,"\\>").replace(/\n/g,1===t?"\\\n":"\n\n"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+="\n",this.value+=t,this.value+="\n```\n",this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(Zhe(t),"g");return e.replace(i,((t,i)=>"\\"!==e.charAt(i-1)?`\\${t}`:t))}}function $Oe(e){return e instanceof qOe||!(!e||"object"!=typeof e)&&!("string"!=typeof e.value||"boolean"!=typeof e.isTrusted&&void 0!==e.isTrusted||"boolean"!=typeof e.supportThemeIcons&&void 0!==e.supportThemeIcons)}function GOe(e){return e.replace(/"/g,"&quot;")}function ZOe(e){return e?e.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1"):e}var YOe=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class QOe{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t,i){var n;return YOe(this,void 0,void 0,(function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let o;if(void 0===e||Kse(e)||e instanceof HTMLElement)o=e;else if(ere(e.markdown)){this._hoverWidget||this.show(Toe(0,"Loading..."),t),this._cancellationTokenSource=new Mae;const i=this._cancellationTokenSource.token;if(o=yield e.markdown(i),void 0===o&&(o=e.markdownNotSupportedFallback),this.isDisposed||i.isCancellationRequested)return}else o=null!==(n=e.markdown)&&void 0!==n?n:e.markdownNotSupportedFallback;this.show(o,t,i)}))}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const o=Object.assign({content:e,target:this.target,showPointer:"element"===this.hoverDelegate.placement,hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!n},i);this._hoverWidget=this.hoverDelegate.showHover(o,t)}null==n||n.dispose()}hasContent(e){return!(!e||$Oe(e)&&!e.value)}get isDisposed(){var e;return null===(e=this._hoverWidget)||void 0===e?void 0:e.isDisposed}dispose(){var e,t;null===(e=this._hoverWidget)||void 0===e||e.dispose(),null===(t=this._cancellationTokenSource)||void 0===t||t.dispose(!0),this._cancellationTokenSource=void 0}}function XOe(e,t,i,n){let o,s;const r=(t,i)=>{var n;t&&(null==s||s.dispose(),s=void 0),i&&(null==o||o.dispose(),o=void 0),null===(n=e.onDidHideHover)||void 0===n||n.call(e)},a=(o,r,a)=>new ape((()=>YOe(this,void 0,void 0,(function*(){s&&!s.isDisposed||(s=new QOe(e,a||t,o>0),yield s.update(i,r,n))}))),o),l=Lve(t,Yve.MOUSE_OVER,(()=>{if(o)return;const i=new rae;i.add(Lve(t,Yve.MOUSE_LEAVE,(e=>r(!1,e.fromElement===t)),!0)),i.add(Lve(t,Yve.MOUSE_DOWN,(()=>r(!0,!0)),!0));const n={targetElements:[t],dispose:()=>{}};if(void 0===e.placement||"mouse"===e.placement){const e=e=>{n.x=e.x+10,e.target instanceof HTMLElement&&e.target.classList.contains("action-label")&&r(!0,!0)};i.add(Lve(t,Yve.MOUSE_MOVE,e,!0))}i.add(a(e.delay,!1,n)),o=i}),!0);return{show:e=>{r(!1,!0),a(0,e)},hide:()=>{r(!0,!0)},update:(e,t)=>YOe(this,void 0,void 0,(function*(){i=e,yield null==s?void 0:s.update(i,void 0,t)})),dispose:()=>{l.dispose(),r(!0,!0)}}}function JOe(e,t={}){const i=ePe(t);return iPe(i,function(e,t){const i={type:1,children:[]};let n=0,o=i;const s=[],r=new tPe(e);for(;!r.eos();){let e=r.next();const i="\\"===e&&0!==nPe(r.peek(),t);if(i&&(e=r.next()),i||0===nPe(e,t)||e!==r.peek())if("\n"===e)2===o.type&&(o=s.pop()),o.children.push({type:8});else if(2!==o.type){const t={type:2,content:e};o.children.push(t),s.push(o),o=t}else o.content+=e;else{r.advance(),2===o.type&&(o=s.pop());const i=nPe(e,t);if(o.type===i||5===o.type&&6===i)o=s.pop();else{const e={type:i,children:[]};5===i&&(e.index=n,n++),o.children.push(e),s.push(o),o=e}}}return 2===o.type&&(o=s.pop()),s.length,i}(e,!!t.renderCodeSegments),t.actionHandler,t.renderCodeSegments),i}function ePe(e){const t=e.inline?"span":"div",i=document.createElement(t);return e.className&&(i.className=e.className),i}class tPe{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function iPe(e,t,i,n){let o;if(2===t.type)o=document.createTextNode(t.content||"");else if(3===t.type)o=document.createElement("b");else if(4===t.type)o=document.createElement("i");else if(7===t.type&&n)o=document.createElement("code");else if(5===t.type&&i){const e=document.createElement("a");i.disposables.add(xve(e,"click",(e=>{i.callback(String(t.index),e)}))),o=e}else 8===t.type?o=document.createElement("br"):1===t.type&&(o=e);o&&e!==o&&e.appendChild(o),o&&Array.isArray(t.children)&&t.children.forEach((e=>{iPe(o,e,i,n)}))}function nPe(e,t){switch(e){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return t?7:0;default:return 0}}const oPe=new RegExp(`(\\\\)?\\$\\((${Ibe.iconNameExpression}(?:${Ibe.iconModifierExpression})?)\\)`,"g");function sPe(e){const t=new Array;let i,n=0,o=0;for(;null!==(i=oPe.exec(e));){o=i.index||0,n<o&&t.push(e.substring(n,o)),n=(i.index||0)+i[0].length;const[,s,r]=i;t.push(s?`$(${r})`:rPe({id:r}))}return n<e.length&&t.push(e.substring(n)),t}function rPe(e){const t=sbe("span");return t.classList.add(...Ibe.asClassNameArray(e)),t}class aPe{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const lPe=new aPe("id#");let hPe={};!function(){function e(e,t){t(hPe)}e.amd=!0,function(t,i){"object"==typeof exports?i(exports):e.amd?e(0,i):i((t="undefined"!=typeof globalThis?globalThis:t||self).marked={})}(this,(function(e){function t(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function n(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};var s=/[&<>"']/,r=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,h={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},d=function(e){return h[e]};function c(e,t){if(t){if(s.test(e))return e.replace(r,d)}else if(a.test(e))return e.replace(l,d);return e}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function g(e){return e.replace(u,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var p=/(^|[^\[])\^/g;function m(e,t){e="string"==typeof e?e:e.source,t=t||"";var i={replace:function(t,n){return n=(n=n.source||n).replace(p,"$1"),e=e.replace(t,n),i},getRegex:function(){return new RegExp(e,t)}};return i}var f=/[^\w:]/g,_=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function v(e,t,i){if(e){var n;try{n=decodeURIComponent(g(i)).replace(f,"").toLowerCase()}catch(e){return null}if(0===n.indexOf("javascript:")||0===n.indexOf("vbscript:")||0===n.indexOf("data:"))return null}t&&!_.test(i)&&(i=function(e,t){b[" "+e]||(w.test(e)?b[" "+e]=e+"/":b[" "+e]=x(e,"/",!0));var i=-1===(e=b[" "+e]).indexOf(":");return"//"===t.substring(0,2)?i?t:e.replace(C,"$1")+t:"/"===t.charAt(0)?i?t:e.replace(y,"$1")+t:e+t}(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(e){return null}return i}var b={},w=/^[^:]+:\/*[^/]*$/,C=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/,S={exec:function(){}};function k(e){for(var t,i,n=1;n<arguments.length;n++)for(i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}function L(e,t){var i=e.replace(/\|/g,(function(e,t,i){for(var n=!1,o=t;--o>=0&&"\\"===i[o];)n=!n;return n?"|":" |"})).split(/ \|/),n=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(/\\\|/g,"|");return i}function x(e,t,i){var n=e.length;if(0===n)return"";for(var o=0;o<n;){var s=e.charAt(n-o-1);if(s!==t||i){if(s===t||!i)break;o++}else o++}return e.slice(0,n-o)}function D(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function E(e,t){if(t<1)return"";for(var i="";t>1;)1&t&&(i+=e),t>>=1,e+=e;return i+e}function N(e,t,i,n){var o=t.href,s=t.title?c(t.title):null,r=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;var a={type:"link",raw:i,href:o,title:s,text:r,tokens:n.inlineTokens(r)};return n.state.inLink=!1,a}return{type:"image",raw:i,href:o,title:s,text:c(r)}}var I=function(){function t(t){this.options=t||e.defaults}var i=t.prototype;return i.space=function(e){var t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}},i.code=function(e){var t=this.rules.block.code.exec(e);if(t){var i=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?i:x(i,"\n")}}},i.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var i=t[0],n=function(e,t){var i=e.match(/^(\s+)(?:```)/);if(null===i)return t;var n=i[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=n.length?e.slice(n.length):e})).join("\n")}(i,t[3]||"");return{type:"code",raw:i,lang:t[2]?t[2].trim():t[2],text:n}}},i.heading=function(e){var t=this.rules.block.heading.exec(e);if(t){var i=t[2].trim();if(/#$/.test(i)){var n=x(i,"#");this.options.pedantic?i=n.trim():n&&!/ $/.test(n)||(i=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:i,tokens:this.lexer.inline(i)}}},i.hr=function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}},i.blockquote=function(e){var t=this.rules.block.blockquote.exec(e);if(t){var i=t[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(i,[]),text:i}}},i.list=function(e){var t=this.rules.block.list.exec(e);if(t){var i,o,s,r,a,l,h,d,c,u,g,p,m=t[1].trim(),f=m.length>1,_={type:"list",raw:"",ordered:f,start:f?+m.slice(0,-1):"",loose:!1,items:[]};m=f?"\\d{1,9}\\"+m.slice(-1):"\\"+m,this.options.pedantic&&(m=f?m:"[*+-]");for(var v=new RegExp("^( {0,3}"+m+")((?:[\t ][^\\n]*)?(?:\\n|$))");e&&(p=!1,t=v.exec(e))&&!this.rules.block.hr.test(e);){if(i=t[0],e=e.substring(i.length),d=t[2].split("\n",1)[0],c=e.split("\n",1)[0],this.options.pedantic?(r=2,g=d.trimLeft()):(r=(r=t[2].search(/[^ ]/))>4?1:r,g=d.slice(r),r+=t[1].length),l=!1,!d&&/^ *$/.test(c)&&(i+=c+"\n",e=e.substring(c.length+1),p=!0),!p)for(var b=new RegExp("^ {0,"+Math.min(3,r-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),w=new RegExp("^ {0,"+Math.min(3,r-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),C=new RegExp("^ {0,"+Math.min(3,r-1)+"}(?:```|~~~)"),y=new RegExp("^ {0,"+Math.min(3,r-1)+"}#");e&&(d=u=e.split("\n",1)[0],this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!C.test(d))&&!y.test(d)&&!b.test(d)&&!w.test(e);){if(d.search(/[^ ]/)>=r||!d.trim())g+="\n"+d.slice(r);else{if(l)break;g+="\n"+d}l||d.trim()||(l=!0),i+=u+"\n",e=e.substring(u.length+1)}_.loose||(h?_.loose=!0:/\n *\n *$/.test(i)&&(h=!0)),this.options.gfm&&(o=/^\[[ xX]\] /.exec(g))&&(s="[ ] "!==o[0],g=g.replace(/^\[[ xX]\] +/,"")),_.items.push({type:"list_item",raw:i,task:!!o,checked:s,loose:!1,text:g}),_.raw+=i}_.items[_.items.length-1].raw=i.trimRight(),_.items[_.items.length-1].text=g.trimRight(),_.raw=_.raw.trimRight();var S=_.items.length;for(a=0;a<S;a++){this.lexer.state.top=!1,_.items[a].tokens=this.lexer.blockTokens(_.items[a].text,[]);var k=_.items[a].tokens.filter((function(e){return"space"===e.type})),L=k.every((function(e){for(var t,i=0,o=n(e.raw.split(""));!(t=o()).done;)if("\n"===t.value&&(i+=1),i>1)return!0;return!1}));!_.loose&&k.length&&L&&(_.loose=!0,_.items[a].loose=!0)}return _}},i.html=function(e){var t=this.rules.block.html.exec(e);if(t){var i={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};if(this.options.sanitize){var n=this.options.sanitizer?this.options.sanitizer(t[0]):c(t[0]);i.type="paragraph",i.text=n,i.tokens=this.lexer.inline(n)}return i}},i.def=function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}},i.table=function(e){var t=this.rules.block.table.exec(e);if(t){var i={type:"table",header:L(t[1]).map((function(e){return{text:e}})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(i.header.length===i.align.length){i.raw=t[0];var n,o,s,r,a=i.align.length;for(n=0;n<a;n++)/^ *-+: *$/.test(i.align[n])?i.align[n]="right":/^ *:-+: *$/.test(i.align[n])?i.align[n]="center":/^ *:-+ *$/.test(i.align[n])?i.align[n]="left":i.align[n]=null;for(a=i.rows.length,n=0;n<a;n++)i.rows[n]=L(i.rows[n],i.header.length).map((function(e){return{text:e}}));for(a=i.header.length,o=0;o<a;o++)i.header[o].tokens=this.lexer.inline(i.header[o].text);for(a=i.rows.length,o=0;o<a;o++)for(r=i.rows[o],s=0;s<r.length;s++)r[s].tokens=this.lexer.inline(r[s].text);return i}}},i.lheading=function(e){var t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}},i.paragraph=function(e){var t=this.rules.block.paragraph.exec(e);if(t){var i="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:i,tokens:this.lexer.inline(i)}}},i.text=function(e){var t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}},i.escape=function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:c(t[1])}},i.tag=function(e){var t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):c(t[0]):t[0]}},i.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var i=t[2].trim();if(!this.options.pedantic&&/^</.test(i)){if(!/>$/.test(i))return;var n=x(i.slice(0,-1),"\\");if((i.length-n.length)%2==0)return}else{var o=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var i=e.length,n=0,o=0;o<i;o++)if("\\"===e[o])o++;else if(e[o]===t[0])n++;else if(e[o]===t[1]&&--n<0)return o;return-1}(t[2],"()");if(o>-1){var s=(0===t[0].indexOf("!")?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,s).trim(),t[3]=""}}var r=t[2],a="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);l&&(r=l[1],a=l[3])}else a=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(r=this.options.pedantic&&!/>$/.test(i)?r.slice(1):r.slice(1,-1)),N(t,{href:r?r.replace(this.rules.inline._escapes,"$1"):r,title:a?a.replace(this.rules.inline._escapes,"$1"):a},t[0],this.lexer)}},i.reflink=function(e,t){var i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){var n=(i[2]||i[1]).replace(/\s+/g," ");if(!(n=t[n.toLowerCase()])||!n.href){var o=i[0].charAt(0);return{type:"text",raw:o,text:o}}return N(i,n,i[0],this.lexer)}},i.emStrong=function(e,t,i){void 0===i&&(i="");var n=this.rules.inline.emStrong.lDelim.exec(e);if(n&&(!n[3]||!i.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var o=n[1]||n[2]||"";if(!o||o&&(""===i||this.rules.inline.punctuation.exec(i))){var s,r,a=n[0].length-1,l=a,h=0,d="*"===n[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+a);null!=(n=d.exec(t));)if(s=n[1]||n[2]||n[3]||n[4]||n[5]||n[6])if(r=s.length,n[3]||n[4])l+=r;else if(!((n[5]||n[6])&&a%3)||(a+r)%3){if(!((l-=r)>0)){if(r=Math.min(r,r+l+h),Math.min(a,r)%2){var c=e.slice(1,a+n.index+r);return{type:"em",raw:e.slice(0,a+n.index+r+1),text:c,tokens:this.lexer.inlineTokens(c)}}var u=e.slice(2,a+n.index+r-1);return{type:"strong",raw:e.slice(0,a+n.index+r+1),text:u,tokens:this.lexer.inlineTokens(u)}}}else h+=r}}},i.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var i=t[2].replace(/\n/g," "),n=/[^ ]/.test(i),o=/^ /.test(i)&&/ $/.test(i);return n&&o&&(i=i.substring(1,i.length-1)),i=c(i,!0),{type:"codespan",raw:t[0],text:i}}},i.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},i.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}},i.autolink=function(e,t){var i,n,o=this.rules.inline.autolink.exec(e);if(o)return n="@"===o[2]?"mailto:"+(i=c(this.options.mangle?t(o[1]):o[1])):i=c(o[1]),{type:"link",raw:o[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}},i.url=function(e,t){var i;if(i=this.rules.inline.url.exec(e)){var n,o;if("@"===i[2])o="mailto:"+(n=c(this.options.mangle?t(i[0]):i[0]));else{var s;do{s=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(s!==i[0]);n=c(i[0]),o="www."===i[1]?"http://"+n:n}return{type:"link",raw:i[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}},i.inlineText=function(e,t){var i,n=this.rules.inline.text.exec(e);if(n)return i=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):c(n[0]):n[0]:c(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:i}},t}(),M={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?<?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:S,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};M.def=m(M.def).replace("label",M._label).replace("title",M._title).getRegex(),M.bullet=/(?:[*+-]|\d{1,9}[.)])/,M.listItemStart=m(/^( *)(bull) */).replace("bull",M.bullet).getRegex(),M.list=m(M.list).replace(/bull/g,M.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+M.def.source+")").getRegex(),M._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",M._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,M.html=m(M.html,"i").replace("comment",M._comment).replace("tag",M._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),M.paragraph=m(M._paragraph).replace("hr",M.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",M._tag).getRegex(),M.blockquote=m(M.blockquote).replace("paragraph",M.paragraph).getRegex(),M.normal=k({},M),M.gfm=k({},M.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),M.gfm.table=m(M.gfm.table).replace("hr",M.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",M._tag).getRegex(),M.gfm.paragraph=m(M._paragraph).replace("hr",M.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",M.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",M._tag).getRegex(),M.pedantic=k({},M.normal,{html:m("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",M._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:S,paragraph:m(M.normal._paragraph).replace("hr",M.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",M.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var T={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:S,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:S,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function A(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function R(e){var t,i,n="",o=e.length;for(t=0;t<o;t++)i=e.charCodeAt(t),Math.random()>.5&&(i="x"+i.toString(16)),n+="&#"+i+";";return n}T._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",T.punctuation=m(T.punctuation).replace(/punctuation/g,T._punctuation).getRegex(),T.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,T.escapedEmSt=/\\\*|\\_/g,T._comment=m(M._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),T.emStrong.lDelim=m(T.emStrong.lDelim).replace(/punct/g,T._punctuation).getRegex(),T.emStrong.rDelimAst=m(T.emStrong.rDelimAst,"g").replace(/punct/g,T._punctuation).getRegex(),T.emStrong.rDelimUnd=m(T.emStrong.rDelimUnd,"g").replace(/punct/g,T._punctuation).getRegex(),T._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,T._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,T._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,T.autolink=m(T.autolink).replace("scheme",T._scheme).replace("email",T._email).getRegex(),T._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,T.tag=m(T.tag).replace("comment",T._comment).replace("attribute",T._attribute).getRegex(),T._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,T._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,T._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,T.link=m(T.link).replace("label",T._label).replace("href",T._href).replace("title",T._title).getRegex(),T.reflink=m(T.reflink).replace("label",T._label).replace("ref",M._label).getRegex(),T.nolink=m(T.nolink).replace("ref",M._label).getRegex(),T.reflinkSearch=m(T.reflinkSearch,"g").replace("reflink",T.reflink).replace("nolink",T.nolink).getRegex(),T.normal=k({},T),T.pedantic=k({},T.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:m(/^!?\[(label)\]\((.*?)\)/).replace("label",T._label).getRegex(),reflink:m(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",T._label).getRegex()}),T.gfm=k({},T.normal,{escape:m(T.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),T.gfm.url=m(T.gfm.url,"i").replace("email",T.gfm._extended_email).getRegex(),T.breaks=k({},T.gfm,{br:m(T.br).replace("{2,}","*").getRegex(),text:m(T.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var O=function(){function i(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||e.defaults,this.options.tokenizer=this.options.tokenizer||new I,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var i={block:M.normal,inline:T.normal};this.options.pedantic?(i.block=M.pedantic,i.inline=T.pedantic):this.options.gfm&&(i.block=M.gfm,this.options.breaks?i.inline=T.breaks:i.inline=T.gfm),this.tokenizer.rules=i}i.lex=function(e,t){return new i(t).lex(e)},i.lexInline=function(e,t){return new i(t).inlineTokens(e)};var n,o,s=i.prototype;return s.lex=function(e){var t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens},s.blockTokens=function(e,t){var i,n,o,s,r=this;for(void 0===t&&(t=[]),e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,(function(e,t,i){return t+" ".repeat(i.length)}));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((function(n){return!!(i=n.call({lexer:r},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)}))))if(i=this.tokenizer.space(e))e=e.substring(i.raw.length),1===i.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(i);else if(i=this.tokenizer.code(e))e=e.substring(i.raw.length),!(n=t[t.length-1])||"paragraph"!==n.type&&"text"!==n.type?t.push(i):(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(i=this.tokenizer.fences(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.heading(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.hr(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.blockquote(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.list(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.html(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.def(e))e=e.substring(i.raw.length),!(n=t[t.length-1])||"paragraph"!==n.type&&"text"!==n.type?this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title}):(n.raw+="\n"+i.raw,n.text+="\n"+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(i=this.tokenizer.table(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.lheading(e))e=e.substring(i.raw.length),t.push(i);else if(o=e,this.options.extensions&&this.options.extensions.startBlock&&function(){var t=1/0,i=e.slice(1),n=void 0;r.options.extensions.startBlock.forEach((function(e){"number"==typeof(n=e.call({lexer:this},i))&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}(),this.state.top&&(i=this.tokenizer.paragraph(o)))n=t[t.length-1],s&&"paragraph"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i),s=o.length!==e.length,e=e.substring(i.raw.length);else if(i=this.tokenizer.text(e))e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i);else if(e){var a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}throw new Error(a)}return this.state.top=!0,t},s.inline=function(e,t){return void 0===t&&(t=[]),this.inlineQueue.push({src:e,tokens:t}),t},s.inlineTokens=function(e,t){var i,n,o,s=this;void 0===t&&(t=[]);var r,a,l,h=e;if(this.tokens.links){var d=Object.keys(this.tokens.links);if(d.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(h));)d.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(h=h.slice(0,r.index)+"["+E("a",r[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(h));)h=h.slice(0,r.index)+"["+E("a",r[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.escapedEmSt.exec(h));)h=h.slice(0,r.index)+"++"+h.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(a||(l=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((function(n){return!!(i=n.call({lexer:s},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)}))))if(i=this.tokenizer.escape(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.tag(e))e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.link(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.emStrong(e,h,l))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.codespan(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.br(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.del(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.autolink(e,R))e=e.substring(i.raw.length),t.push(i);else if(this.state.inLink||!(i=this.tokenizer.url(e,R))){if(o=e,this.options.extensions&&this.options.extensions.startInline&&function(){var t=1/0,i=e.slice(1),n=void 0;s.options.extensions.startInline.forEach((function(e){"number"==typeof(n=e.call({lexer:this},i))&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}(),i=this.tokenizer.inlineText(o,A))e=e.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(l=i.raw.slice(-1)),a=!0,(n=t[t.length-1])&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(e){var c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}else e=e.substring(i.raw.length),t.push(i);return t},n=i,o=[{key:"rules",get:function(){return{block:M,inline:T}}}],null&&t(n.prototype,null),o&&t(n,o),Object.defineProperty(n,"prototype",{writable:!1}),i}(),P=function(){function t(t){this.options=t||e.defaults}var i=t.prototype;return i.code=function(e,t,i){var n=(t||"").match(/\S*/)[0];if(this.options.highlight){var o=this.options.highlight(e,n);null!=o&&o!==e&&(i=!0,e=o)}return e=e.replace(/\n$/,"")+"\n",n?'<pre><code class="'+this.options.langPrefix+c(n,!0)+'">'+(i?e:c(e,!0))+"</code></pre>\n":"<pre><code>"+(i?e:c(e,!0))+"</code></pre>\n"},i.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},i.html=function(e){return e},i.heading=function(e,t,i,n){return this.options.headerIds?"<h"+t+' id="'+(this.options.headerPrefix+n.slug(i))+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},i.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},i.list=function(e,t,i){var n=t?"ol":"ul";return"<"+n+(t&&1!==i?' start="'+i+'"':"")+">\n"+e+"</"+n+">\n"},i.listitem=function(e){return"<li>"+e+"</li>\n"},i.checkbox=function(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},i.paragraph=function(e){return"<p>"+e+"</p>\n"},i.table=function(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"},i.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},i.tablecell=function(e,t){var i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+"</"+i+">\n"},i.strong=function(e){return"<strong>"+e+"</strong>"},i.em=function(e){return"<em>"+e+"</em>"},i.codespan=function(e){return"<code>"+e+"</code>"},i.br=function(){return this.options.xhtml?"<br/>":"<br>"},i.del=function(e){return"<del>"+e+"</del>"},i.link=function(e,t,i){if(null===(e=v(this.options.sanitize,this.options.baseUrl,e)))return i;var n='<a href="'+c(e)+'"';return t&&(n+=' title="'+t+'"'),n+">"+i+"</a>"},i.image=function(e,t,i){if(null===(e=v(this.options.sanitize,this.options.baseUrl,e)))return i;var n='<img src="'+e+'" alt="'+i+'"';return t&&(n+=' title="'+t+'"'),n+(this.options.xhtml?"/>":">")},i.text=function(e){return e},t}(),F=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,i){return""+i},t.image=function(e,t,i){return""+i},t.br=function(){return""},e}(),B=function(){function e(){this.seen={}}var t=e.prototype;return t.serialize=function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},t.getNextSafeSlug=function(e,t){var i=e,n=0;if(this.seen.hasOwnProperty(i)){n=this.seen[e];do{i=e+"-"+ ++n}while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=n,this.seen[i]=0),i},t.slug=function(e,t){void 0===t&&(t={});var i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)},e}(),W=function(){function t(t){this.options=t||e.defaults,this.options.renderer=this.options.renderer||new P,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new F,this.slugger=new B}t.parse=function(e,i){return new t(i).parse(e)},t.parseInline=function(e,i){return new t(i).parseInline(e)};var i=t.prototype;return i.parse=function(e,t){void 0===t&&(t=!0);var i,n,o,s,r,a,l,h,d,c,u,p,m,f,_,v,b,w,C,y="",S=e.length;for(i=0;i<S;i++)if(c=e[i],!(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[c.type])||!1===(C=this.options.extensions.renderers[c.type].call({parser:this},c))&&["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type))switch(c.type){case"space":continue;case"hr":y+=this.renderer.hr();continue;case"heading":y+=this.renderer.heading(this.parseInline(c.tokens),c.depth,g(this.parseInline(c.tokens,this.textRenderer)),this.slugger);continue;case"code":y+=this.renderer.code(c.text,c.lang,c.escaped);continue;case"table":for(h="",l="",s=c.header.length,n=0;n<s;n++)l+=this.renderer.tablecell(this.parseInline(c.header[n].tokens),{header:!0,align:c.align[n]});for(h+=this.renderer.tablerow(l),d="",s=c.rows.length,n=0;n<s;n++){for(l="",r=(a=c.rows[n]).length,o=0;o<r;o++)l+=this.renderer.tablecell(this.parseInline(a[o].tokens),{header:!1,align:c.align[o]});d+=this.renderer.tablerow(l)}y+=this.renderer.table(h,d);continue;case"blockquote":d=this.parse(c.tokens),y+=this.renderer.blockquote(d);continue;case"list":for(u=c.ordered,p=c.start,m=c.loose,s=c.items.length,d="",n=0;n<s;n++)v=(_=c.items[n]).checked,b=_.task,f="",_.task&&(w=this.renderer.checkbox(v),m?_.tokens.length>0&&"paragraph"===_.tokens[0].type?(_.tokens[0].text=w+" "+_.tokens[0].text,_.tokens[0].tokens&&_.tokens[0].tokens.length>0&&"text"===_.tokens[0].tokens[0].type&&(_.tokens[0].tokens[0].text=w+" "+_.tokens[0].tokens[0].text)):_.tokens.unshift({type:"text",text:w}):f+=w),f+=this.parse(_.tokens,m),d+=this.renderer.listitem(f,b,v);y+=this.renderer.list(d,u,p);continue;case"html":y+=this.renderer.html(c.text);continue;case"paragraph":y+=this.renderer.paragraph(this.parseInline(c.tokens));continue;case"text":for(d=c.tokens?this.parseInline(c.tokens):c.text;i+1<S&&"text"===e[i+1].type;)d+="\n"+((c=e[++i]).tokens?this.parseInline(c.tokens):c.text);y+=t?this.renderer.paragraph(d):d;continue;default:var k='Token with "'+c.type+'" type was not found.';if(this.options.silent)return void console.error(k);throw new Error(k)}else y+=C||"";return y},i.parseInline=function(e,t){t=t||this.renderer;var i,n,o,s="",r=e.length;for(i=0;i<r;i++)if(n=e[i],!(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[n.type])||!1===(o=this.options.extensions.renderers[n.type].call({parser:this},n))&&["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type))switch(n.type){case"escape":case"text":s+=t.text(n.text);break;case"html":s+=t.html(n.text);break;case"link":s+=t.link(n.href,n.title,this.parseInline(n.tokens,t));break;case"image":s+=t.image(n.href,n.title,n.text);break;case"strong":s+=t.strong(this.parseInline(n.tokens,t));break;case"em":s+=t.em(this.parseInline(n.tokens,t));break;case"codespan":s+=t.codespan(n.text);break;case"br":s+=t.br();break;case"del":s+=t.del(this.parseInline(n.tokens,t));break;default:var a='Token with "'+n.type+'" type was not found.';if(this.options.silent)return void console.error(a);throw new Error(a)}else s+=o||"";return s},t}();function V(e,t,i){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(i=t,t=null),D(t=k({},V.defaults,t||{})),i){var n,o=t.highlight;try{n=O.lex(e,t)}catch(e){return i(e)}var s=function(e){var s;if(!e)try{t.walkTokens&&V.walkTokens(n,t.walkTokens),s=W.parse(n,t)}catch(t){e=t}return t.highlight=o,e?i(e):i(null,s)};if(!o||o.length<3)return s();if(delete t.highlight,!n.length)return s();var r=0;return V.walkTokens(n,(function(e){"code"===e.type&&(r++,setTimeout((function(){o(e.text,e.lang,(function(t,i){if(t)return s(t);null!=i&&i!==e.text&&(e.text=i,e.escaped=!0),0==--r&&s()}))}),0))})),void(0===r&&s())}function a(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+c(e.message+"",!0)+"</pre>";throw e}try{var l=O.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(V.walkTokens(l,t.walkTokens)).then((function(){return W.parse(l,t)})).catch(a);V.walkTokens(l,t.walkTokens)}return W.parse(l,t)}catch(e){a(e)}}V.options=V.setOptions=function(t){var i;return k(V.defaults,t),i=V.defaults,e.defaults=i,V},V.getDefaults=o,V.defaults=e.defaults,V.use=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var n,o=k.apply(void 0,[{}].concat(t)),s=V.defaults.extensions||{renderers:{},childTokens:{}};t.forEach((function(e){if(e.extensions&&(n=!0,e.extensions.forEach((function(e){if(!e.name)throw new Error("extension name required");if(e.renderer){var t=s.renderers?s.renderers[e.name]:null;s.renderers[e.name]=t?function(){for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];var s=e.renderer.apply(this,n);return!1===s&&(s=t.apply(this,n)),s}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");s[e.level]?s[e.level].unshift(e.tokenizer):s[e.level]=[e.tokenizer],e.start&&("block"===e.level?s.startBlock?s.startBlock.push(e.start):s.startBlock=[e.start]:"inline"===e.level&&(s.startInline?s.startInline.push(e.start):s.startInline=[e.start]))}e.childTokens&&(s.childTokens[e.name]=e.childTokens)}))),e.renderer&&function(){var t=V.defaults.renderer||new P,i=function(i){var n=t[i];t[i]=function(){for(var o=arguments.length,s=new Array(o),r=0;r<o;r++)s[r]=arguments[r];var a=e.renderer[i].apply(t,s);return!1===a&&(a=n.apply(t,s)),a}};for(var n in e.renderer)i(n);o.renderer=t}(),e.tokenizer&&function(){var t=V.defaults.tokenizer||new I,i=function(i){var n=t[i];t[i]=function(){for(var o=arguments.length,s=new Array(o),r=0;r<o;r++)s[r]=arguments[r];var a=e.tokenizer[i].apply(t,s);return!1===a&&(a=n.apply(t,s)),a}};for(var n in e.tokenizer)i(n);o.tokenizer=t}(),e.walkTokens){var t=V.defaults.walkTokens;o.walkTokens=function(i){var n=[];return n.push(e.walkTokens.call(this,i)),t&&(n=n.concat(t.call(this,i))),n}}n&&(o.extensions=s),V.setOptions(o)}))},V.walkTokens=function(e,t){for(var i,o=[],s=function(){var e=i.value;switch(o=o.concat(t.call(V,e)),e.type){case"table":for(var s,r=n(e.header);!(s=r()).done;){var a=s.value;o=o.concat(V.walkTokens(a.tokens,t))}for(var l,h=n(e.rows);!(l=h()).done;)for(var d,c=n(l.value);!(d=c()).done;){var u=d.value;o=o.concat(V.walkTokens(u.tokens,t))}break;case"list":o=o.concat(V.walkTokens(e.items,t));break;default:V.defaults.extensions&&V.defaults.extensions.childTokens&&V.defaults.extensions.childTokens[e.type]?V.defaults.extensions.childTokens[e.type].forEach((function(i){o=o.concat(V.walkTokens(e[i],t))})):e.tokens&&(o=o.concat(V.walkTokens(e.tokens,t)))}},r=n(e);!(i=r()).done;)s();return o},V.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");D(t=k({},V.defaults,t||{}));try{var i=O.lexInline(e,t);return t.walkTokens&&V.walkTokens(i,t.walkTokens),W.parseInline(i,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+c(e.message+"",!0)+"</pre>";throw e}},V.Parser=W,V.parser=W.parse,V.Renderer=P,V.TextRenderer=F,V.Lexer=O,V.lexer=O.lex,V.Tokenizer=I,V.Slugger=B,V.parse=V;var z=V.options,H=V.setOptions,U=V.use,K=V.walkTokens,j=V.parseInline,q=V,$=W.parse,G=O.lex;e.Lexer=O,e.Parser=W,e.Renderer=P,e.Slugger=B,e.TextRenderer=F,e.Tokenizer=I,e.getDefaults=o,e.lexer=G,e.marked=V,e.options=z,e.parse=q,e.parseInline=j,e.parser=$,e.setOptions=H,e.use=U,e.walkTokens=K,Object.defineProperty(e,"__esModule",{value:!0})}))}(),hPe.Lexer||exports.Lexer,hPe.Parser||exports.Parser,hPe.Renderer||exports.Renderer,hPe.Slugger||exports.Slugger,hPe.TextRenderer||exports.TextRenderer,hPe.Tokenizer||exports.Tokenizer,hPe.getDefaults||exports.getDefaults,hPe.lexer||exports.lexer;var dPe=hPe.marked||exports.marked;function cPe(e){let t=JSON.parse(e);return t=uPe(t),t}function uPe(e,t=0){if(!e||t>200)return e;if("object"==typeof e){switch(e.$mid){case 1:return Sle.revive(e);case 2:return new RegExp(e.source,e.flags);case 16:return new Date(e.source)}if(e instanceof xue||e instanceof Uint8Array)return e;if(Array.isArray(e))for(let i=0;i<e.length;++i)e[i]=uPe(e[i],t+1);else for(const i in e)Object.hasOwnProperty.call(e,i)&&(e[i]=uPe(e[i],t+1))}return e}hPe.options||exports.options,hPe.parse||exports.parse,hPe.parseInline||exports.parseInline,hPe.parser||exports.parser,hPe.setOptions||exports.setOptions,hPe.use||exports.use,hPe.walkTokens||exports.walkTokens;const gPe=Object.freeze({image:(e,t,i)=>{let n=[],o=[];return e&&(({href:e,dimensions:n}=function(e){const t=[],i=e.split("|").map((e=>e.trim()));e=i[0];const n=i[1];if(n){const e=/height=(\d+)/.exec(n),i=/width=(\d+)/.exec(n),o=e?e[1]:"",s=i?i[1]:"",r=isFinite(parseInt(s)),a=isFinite(parseInt(o));r&&t.push(`width="${s}"`),a&&t.push(`height="${o}"`)}return{href:e,dimensions:t}}(e)),o.push(`src="${GOe(e)}"`)),i&&o.push(`alt="${GOe(i)}"`),t&&o.push(`title="${GOe(t)}"`),n.length&&(o=o.concat(n)),"<img "+o.join(" ")+">"},paragraph:e=>`<p>${e}</p>`,link:(e,t,i)=>"string"!=typeof e?"":(e===i&&(i=ZOe(i)),t="string"==typeof t?GOe(ZOe(t)):"",`<a href="${e=(e=ZOe(e)).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}" title="${t||e}">${i}</a>`)});function pPe(e,t){return/^\w[\w\d+.-]*:/.test(t)?t:e.path.endsWith("/")?OIe(e,t).toString():OIe(AIe(e),t).toString()}function mPe(e,t){const{config:i,allowedSchemes:n}=function(e){const t=[_ve.http,_ve.https,_ve.mailto,_ve.data,_ve.file,_ve.vscodeFileResource,_ve.vscodeRemote,_ve.vscodeRemoteResource];return e.isTrusted&&t.push(_ve.command),{config:{ALLOWED_TAGS:[...gbe],ALLOWED_ATTR:fPe,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:t}}(e);mve("uponSanitizeAttribute",((e,t)=>{if("style"!==t.attrName&&"class"!==t.attrName);else{if("SPAN"===e.tagName){if("style"===t.attrName)return void(t.keepAttr=/^(color\:#[0-9a-fA-F]+;)?(background-color\:#[0-9a-fA-F]+;)?$/.test(t.attrValue));if("class"===t.attrName)return void(t.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(t.attrValue))}t.keepAttr=!1}}));const o=function(e,t=!1){const i=document.createElement("a");return mve("afterSanitizeAttributes",(n=>{for(const o of["href","src"])if(n.hasAttribute(o)){const s=n.getAttribute(o);if("href"===o&&s.startsWith("#"))continue;if(i.href=s,!e.includes(i.protocol.replace(/:$/,""))){if(t&&"src"===o&&i.href.startsWith("data:"))continue;n.removeAttribute(o)}}})),sae((()=>{fve("afterSanitizeAttributes")}))}(n);try{return pve(t,Object.assign(Object.assign({},i),{RETURN_TRUSTED_TYPE:!0}))}finally{fve("uponSanitizeAttribute"),o.dispose()}}const fPe=["align","autoplay","alt","class","controls","data-code","data-href","height","href","loop","muted","playsinline","poster","src","style","target","title","width"];new Map([["&quot;",'"'],["&nbsp;"," "],["&amp;","&"],["&#39;","'"],["&lt;","<"],["&gt;",">"]]),new jhe((()=>{const e=new dPe.Renderer;return e.code=e=>e,e.blockquote=e=>e,e.html=e=>"",e.heading=(e,t,i)=>e+"\n",e.hr=()=>"",e.list=(e,t)=>e,e.listitem=e=>e+"\n",e.paragraph=e=>e+"\n",e.table=(e,t)=>e+t+"\n",e.tablerow=e=>e,e.tablecell=(e,t)=>e+" ",e.strong=e=>e,e.em=e=>e,e.codespan=e=>e,e.br=()=>"\n",e.del=e=>e,e.image=(e,t,i)=>"",e.text=e=>e,e.link=(e,t,i)=>i,e}));class _Pe{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach((n=>n.splice(e,t,i)))}}function vPe(e,t,i){return Math.min(Math.max(e,t),i)}class bPe{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}class wPe{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){const t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n<this._values.length&&(this._n+=1),this._val=this._sum/this._n,this._val}get value(){return this._val}}var CPe,yPe=i(9472),SPe={};SPe.styleTagTransform=Vr(),SPe.setAttributes=Pr(),SPe.insert=Rr().bind(null,"head"),SPe.domAPI=Tr(),SPe.insertStyleElement=Br(),Ir()(yPe.Z,SPe),yPe.Z&&yPe.Z.locals&&yPe.Z.locals;class kPe extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function LPe(e,t){const i=[];for(const n of t){if(e.start>=n.range.end)continue;if(e.end<n.range.start)break;const t=CPe.intersect(e,n.range);CPe.isEmpty(t)||i.push({range:t,size:n.size})}return i}function xPe({start:e,end:t},i){return{start:e+i,end:t+i}}!function(e){function t(e,t){if(e.start>=t.end||t.start>=e.end)return{start:0,end:0};const i=Math.max(e.start,t.start),n=Math.min(e.end,t.end);return n-i<=0?{start:0,end:0}:{start:i,end:n}}function i(e){return e.end-e.start<=0}e.intersect=t,e.isEmpty=i,e.intersects=function(e,n){return!i(t(e,n))},e.relativeComplement=function(e,t){const n=[],o={start:e.start,end:Math.min(t.start,e.end)},s={start:Math.max(t.end,e.start),end:e.end};return i(o)||n.push(o),i(s)||n.push(s),n}}(CPe||(CPe={}));class DPe{constructor(){this.groups=[],this._size=0}splice(e,t,i=[]){const n=i.length-t,o=LPe({start:0,end:e},this.groups),s=LPe({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map((e=>({range:xPe(e.range,n),size:e.size}))),r=i.map(((t,i)=>({range:{start:e+i,end:e+i+1},size:t.size})));this.groups=function(...e){return function(e){const t=[];let i=null;for(const n of e){const e=n.range.start,o=n.range.end,s=n.size;i&&s===i.size?i.range.end=o:(i={range:{start:e,end:o},size:s},t.push(i))}return t}(e.reduce(((e,t)=>e.concat(t)),[]))}(o,r,s),this._size=this.groups.reduce(((e,t)=>e+t.size*(t.range.end-t.range.start)),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;let t=0,i=0;for(const n of this.groups){const o=n.range.end-n.range.start,s=i+o*n.size;if(e<s)return t+Math.floor((e-i)/n.size);t+=o,i=s}return t}indexAfter(e){return Math.min(this.indexAt(e)+1,this.count)}positionAt(e){if(e<0)return-1;let t=0,i=0;for(const n of this.groups){const o=n.range.end-n.range.start,s=i+o;if(e<s)return t+(e-i)*n.size;t+=o*n.size,i=s}return-1}}class EPe{constructor(e){this.renderers=e,this.cache=new Map,this.transactionNodesPendingRemoval=new Set,this.inTransaction=!1}alloc(e){let t=this.getTemplateCache(e).pop(),i=!1;if(t)i=this.transactionNodesPendingRemoval.has(t.domNode),i&&this.transactionNodesPendingRemoval.delete(t.domNode);else{const i=sbe(".monaco-list-row");t={domNode:i,templateId:e,templateData:this.getRenderer(e).renderTemplate(i)}}return{row:t,isReusingConnectedDomNode:i}}release(e){e&&this.releaseRow(e)}transact(e){if(this.inTransaction)throw new Error("Already in transaction");this.inTransaction=!0;try{e()}finally{for(const e of this.transactionNodesPendingRemoval)this.doRemoveNode(e);this.transactionNodesPendingRemoval.clear(),this.inTransaction=!1}}releaseRow(e){const{domNode:t,templateId:i}=e;t&&(this.inTransaction?this.transactionNodesPendingRemoval.add(t):this.doRemoveNode(t)),this.getTemplateCache(i).push(e)}doRemoveNode(e){e.classList.remove("scrolling"),function(e){var t;try{null===(t=e.parentElement)||void 0===t||t.removeChild(e)}catch(e){}}(e)}getTemplateCache(e){let t=this.cache.get(e);return t||(t=[],this.cache.set(e,t)),t}dispose(){this.cache.forEach(((e,t)=>{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null})),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var NPe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};const IPe={CurrentDragAndDropData:void 0},MPe={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements:e=>[e],getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class TPe{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class APe{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class RPe{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;t<e.files.length;t++){const i=e.files.item(t);i&&(i.size||i.type)&&this.files.push(i)}}}getData(){return{types:this.types,files:this.files}}}class OPe{constructor(e){(null==e?void 0:e.getSetSize)?this.getSetSize=e.getSetSize.bind(e):this.getSetSize=(e,t,i)=>i,(null==e?void 0:e.getPosInSet)?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(e,t)=>t+1,(null==e?void 0:e.getRole)?this.getRole=e.getRole.bind(e):this.getRole=e=>"listitem",(null==e?void 0:e.isChecked)?this.isChecked=e.isChecked.bind(e):this.isChecked=e=>{}}}class PPe{get contentHeight(){return this.rangeMap.size}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const e of this.items)this.measureItemWidth(e);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:Pve(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,i,n=MPe){var o,s,r,a,l,h,d,c,u,g,p,m;if(this.virtualDelegate=t,this.domId="list_id_"+ ++PPe.InstanceCount,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new npe(50),this.splicing=!1,this.dragOverAnimationStopDisposable=aae.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=aae.None,this.onDragLeaveTimeout=aae.None,this.disposables=new rae,this._onDidChangeContentHeight=new bae,this._horizontalScrolling=!1,n.horizontalScrolling&&n.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new DPe;for(const e of i)this.renderers.set(e.templateId,e);this.cache=this.disposables.add(new EPe(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support","boolean"!=typeof n.mouseSupport||n.mouseSupport),this._horizontalScrolling=null!==(o=n.horizontalScrolling)&&void 0!==o?o:MPe.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.additionalScrollHeight=void 0===n.additionalScrollHeight?0:n.additionalScrollHeight,this.accessibilityProvider=new OPe(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(null!==(s=n.transformOptimization)&&void 0!==s?s:MPe.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Nwe.addTarget(this.rowsContainer)),this.scrollable=new Mke({forceIntegerValues:!0,smoothScrollDuration:null!==(r=n.smoothScrolling)&&void 0!==r&&r?125:0,scheduleAtNextAnimationFrame:e=>Eve(e)}),this.scrollableElement=this.disposables.add(new Uke(this.rowsContainer,{alwaysConsumeMouseWheel:null!==(a=n.alwaysConsumeMouseWheel)&&void 0!==a?a:MPe.alwaysConsumeMouseWheel,horizontal:1,vertical:null!==(l=n.verticalScrollMode)&&void 0!==l?l:MPe.verticalScrollMode,useShadows:null!==(h=n.useShadows)&&void 0!==h?h:MPe.useShadows,mouseWheelScrollSensitivity:n.mouseWheelScrollSensitivity,fastScrollSensitivity:n.fastScrollSensitivity,scrollByPage:n.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(Lve(this.rowsContainer,Ewe.Change,(e=>this.onTouchChange(e)))),this.disposables.add(Lve(this.scrollableElement.getDomNode(),"scroll",(e=>e.target.scrollTop=0))),this.disposables.add(Lve(this.domNode,"dragover",(e=>this.onDragOver(this.toDragEvent(e))))),this.disposables.add(Lve(this.domNode,"drop",(e=>this.onDrop(this.toDragEvent(e))))),this.disposables.add(Lve(this.domNode,"dragleave",(e=>this.onDragLeave(this.toDragEvent(e))))),this.disposables.add(Lve(this.domNode,"dragend",(e=>this.onDragEnd(e)))),this.setRowLineHeight=null!==(d=n.setRowLineHeight)&&void 0!==d?d:MPe.setRowLineHeight,this.setRowHeight=null!==(c=n.setRowHeight)&&void 0!==c?c:MPe.setRowHeight,this.supportDynamicHeights=null!==(u=n.supportDynamicHeights)&&void 0!==u?u:MPe.supportDynamicHeights,this.dnd=null!==(g=n.dnd)&&void 0!==g?g:MPe.dnd,this.layout(null===(p=n.initialSize)||void 0===p?void 0:p.height,null===(m=n.initialSize)||void 0===m?void 0:m.width)}updateOptions(e){let t;void 0!==e.additionalScrollHeight&&(this.additionalScrollHeight=e.additionalScrollHeight,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),void 0!==e.smoothScrolling&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),void 0!==e.horizontalScrolling&&(this.horizontalScrolling=e.horizontalScrolling),void 0!==e.scrollByPage&&(t=Object.assign(Object.assign({},null!=t?t:{}),{scrollByPage:e.scrollByPage})),void 0!==e.mouseWheelScrollSensitivity&&(t=Object.assign(Object.assign({},null!=t?t:{}),{mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity})),void 0!==e.fastScrollSensitivity&&(t=Object.assign(Object.assign({},null!=t?t:{}),{fastScrollSensitivity:e.fastScrollSensitivity})),t&&this.scrollableElement.updateOptions(t)}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},s=CPe.intersect(n,o),r=new Map;for(let e=s.end-1;e>=s.start;e--){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){let i=r.get(t.templateId);i||(i=[],r.set(t.templateId,i));const n=this.renderers.get(t.templateId);n&&n.disposeElement&&n.disposeElement(t.element,e,t.row.templateData,t.size),i.push(t.row)}t.row=null}const a={start:e+t,end:this.items.length},l=CPe.intersect(a,n),h=CPe.relativeComplement(a,n),d=i.map((e=>({id:String(this.itemId++),element:e,templateId:this.virtualDelegate.getTemplateId(e),size:this.virtualDelegate.getHeight(e),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(e),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:aae.None,checkedDisposable:aae.None})));let c;0===e&&t>=this.items.length?(this.rangeMap=new DPe,this.rangeMap.splice(0,0,d),c=this.items,this.items=d):(this.rangeMap.splice(e,t,d),c=this.items.splice(e,t,...d));const u=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=xPe(l,u),m=CPe.intersect(g,p);for(let e=m.start;e<m.end;e++)this.updateItemInDOM(this.items[e],e);const f=CPe.relativeComplement(p,g);for(const e of f)for(let t=e.start;t<e.end;t++)this.removeItemFromDOM(t);const _=h.map((e=>xPe(e,u))),v=[{start:e,end:e+i.length},..._].map((e=>CPe.intersect(g,e))),b=this.getNextToLastElement(v);for(const e of v)for(let t=e.start;t<e.end;t++){const e=this.items[t],i=r.get(e.templateId),n=null==i?void 0:i.pop();this.insertItemInDOM(t,b,n)}for(const e of r.values())for(const t of e)this.cache.release(t);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),c.map((e=>e.element))}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Eve((()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null})))}eventuallyUpdateScrollWidth(){this.horizontalScrolling?this.scrollableElementWidthDelayer.trigger((()=>this.updateScrollWidth())):this.scrollableElementWidthDelayer.cancel()}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)void 0!==t.width&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:0===e?0:e+10})}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){const e=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),t=this.rangeMap.positionAt(e.start),i=this.rangeMap.positionAt(e.start+1);return-1!==i&&(i-t)/2+t<this.scrollTop?e.start+1:e.start}element(e){return this.items[e].element}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){const i={height:"number"==typeof e?e:Fve(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),void 0!==t&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:"number"==typeof t?t:Pve(this.domNode)})}render(e,t,i,n,o,s=!1){const r=this.getRenderRange(t,i),a=CPe.relativeComplement(r,e),l=CPe.relativeComplement(e,r),h=this.getNextToLastElement(a);if(s){const t=CPe.intersect(e,r);for(let e=t.start;e<t.end;e++)this.updateItemInDOM(this.items[e],e)}this.cache.transact((()=>{for(const e of l)for(let t=e.start;t<e.end;t++)this.removeItemFromDOM(t);for(const e of a)for(let t=e.start;t<e.end;t++)this.insertItemInDOM(t,h)})),void 0!==n&&(this.rowsContainer.style.left=`-${n}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&void 0!==o&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t,i){const n=this.items[e];let o=!1;if(!n.row)if(i)n.row=i;else{const e=this.cache.alloc(n.templateId);n.row=e.row,o=e.isReusingConnectedDomNode}const s=this.accessibilityProvider.getRole(n.element)||"listitem";n.row.domNode.setAttribute("role",s);const r=this.accessibilityProvider.isChecked(n.element);if("boolean"==typeof r)n.row.domNode.setAttribute("aria-checked",String(!!r));else if(r){const e=e=>n.row.domNode.setAttribute("aria-checked",String(!!e));e(r.value),n.checkedDisposable=r.onDidChange(e)}!o&&n.row.domNode.parentElement||(t?this.rowsContainer.insertBefore(n.row.domNode,t):this.rowsContainer.appendChild(n.row.domNode)),this.updateItemInDOM(n,e);const a=this.renderers.get(n.templateId);if(!a)throw new Error(`No renderer found for template id ${n.templateId}`);null==a||a.renderElement(n.element,e,n.row.templateData,n.size);const l=this.dnd.getDragURI(n.element);n.dragStartDisposable.dispose(),n.row.domNode.draggable=!!l,l&&(n.dragStartDisposable=Lve(n.row.domNode,"dragstart",(e=>this.onDragStart(n.element,l,e)))),this.horizontalScrolling&&(this.measureItemWidth(n),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=Pve(e.row.domNode);const t=window.getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2==0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const i=this.renderers.get(t.templateId);i&&i.disposeElement&&i.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.additionalScrollHeight}get onMouseClick(){return pae.map(this.disposables.add(new Yke(this.domNode,"click")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseDblClick(){return pae.map(this.disposables.add(new Yke(this.domNode,"dblclick")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseMiddleClick(){return pae.filter(pae.map(this.disposables.add(new Yke(this.domNode,"auxclick")).event,(e=>this.toMouseEvent(e)),this.disposables),(e=>1===e.browserEvent.button),this.disposables)}get onMouseDown(){return pae.map(this.disposables.add(new Yke(this.domNode,"mousedown")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseOver(){return pae.map(this.disposables.add(new Yke(this.domNode,"mouseover")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onContextMenu(){return pae.any(pae.map(this.disposables.add(new Yke(this.domNode,"contextmenu")).event,(e=>this.toMouseEvent(e)),this.disposables),pae.map(this.disposables.add(new Yke(this.domNode,Ewe.Contextmenu)).event,(e=>this.toGestureEvent(e)),this.disposables))}get onTouchStart(){return pae.map(this.disposables.add(new Yke(this.domNode,"touchstart")).event,(e=>this.toTouchEvent(e)),this.disposables)}get onTap(){return pae.map(this.disposables.add(new Yke(this.rowsContainer,Ewe.Tap)).event,(e=>this.toGestureEvent(e)),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){var n,o;if(!i.dataTransfer)return;const s=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(XRe.TEXT,t),i.dataTransfer.setDragImage){let e;this.dnd.getDragLabel&&(e=this.dnd.getDragLabel(s,i)),void 0===e&&(e=String(s.length));const t=sbe(".monaco-drag-image");t.textContent=e;const n=(e=>{for(;e&&!e.classList.contains("monaco-workbench");)e=e.parentElement;return e||document.body})(this.domNode);n.appendChild(t),i.dataTransfer.setDragImage(t,-10,-10),setTimeout((()=>n.removeChild(t)),0)}this.domNode.classList.add("dragging"),this.currentDragData=new TPe(s),IPe.CurrentDragAndDropData=new APe(s),null===(o=(n=this.dnd).onDragStart)||void 0===o||o.call(n,this.currentDragData,i)}onDragOver(e){var t;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),IPe.CurrentDragAndDropData&&"vscode-ui"===IPe.CurrentDragAndDropData.getData())return!1;if(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer)return!1;if(!this.currentDragData)if(IPe.CurrentDragAndDropData)this.currentDragData=IPe.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new RPe}const i=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop="boolean"==typeof i?i:i.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;let n;if(e.browserEvent.dataTransfer.dropEffect="boolean"!=typeof i&&0===i.effect?"copy":"move",n="boolean"!=typeof i&&i.feedback?i.feedback:void 0===e.index?[-1]:[e.index],n=Mse(n).filter((e=>e>=-1&&e<this.length)).sort(((e,t)=>e-t)),n=-1===n[0]?[-1]:n,o=this.currentDragFeedback,s=n,Array.isArray(o)&&Array.isArray(s)?Nse(o,s):o===s)return!0;var o,s;if(this.currentDragFeedback=n,this.currentDragFeedbackDisposable.dispose(),-1===n[0])this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=sae((()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")}));else{for(const e of n){const i=this.items[e];i.dropTarget=!0,null===(t=i.row)||void 0===t||t.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=sae((()=>{var e;for(const t of n){const i=this.items[t];i.dropTarget=!1,null===(e=i.row)||void 0===e||e.domNode.classList.remove("drop-target")}}))}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=rpe((()=>this.clearDragOverFeedback()),100),this.currentDragData&&(null===(i=(t=this.dnd).onDragLeave)||void 0===i||i.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,IPe.CurrentDragAndDropData=void 0,t&&e.browserEvent.dataTransfer&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.browserEvent))}onDragEnd(e){var t,i;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,IPe.CurrentDragAndDropData=void 0,null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=aae.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const e=function(e){let t=e.offsetParent,i=e.offsetTop,n=e.offsetLeft;for(;null!==(e=e.parentNode)&&e!==document.body&&e!==document.documentElement;){i-=e.scrollTop;const o=Hve(e)?null:Ive(e);o&&(n-="rtl"!==o.direction?e.scrollLeft:-e.scrollLeft),e===t&&(n+=Tve.getBorderLeftWidth(e),i+=Tve.getBorderTopWidth(e),i+=e.offsetTop,n+=e.offsetLeft,t=e.offsetParent)}return{left:n,top:i}}(this.domNode).top;this.dragOverAnimationDisposable=function(e){const t=()=>{e(),i=Eve(t)};let i=Eve(t);return sae((()=>i.dispose()))}(this.animateDragAndDropScrollTop.bind(this,e))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=rpe((()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}),1e3),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(void 0===this.dragOverMouseY)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;i instanceof HTMLElement&&i!==this.rowsContainer&&t.contains(i);){const e=i.getAttribute("data-index");if(e){const t=Number(e);if(!isNaN(t))return t}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){const n=this.getRenderRange(e,t);let o,s;e===this.elementTop(n.start)?(o=n.start,s=0):n.end-n.start>1&&(o=n.start+1,s=this.elementTop(o)-e);let r=0;for(;;){const a=this.getRenderRange(e,t);let l=!1;for(let e=a.start;e<a.end;e++){const t=this.probeDynamicHeight(e);0!==t&&this.rangeMap.splice(e,1,[this.items[e]]),r+=t,l=l||0!==t}if(!l){0!==r&&this.eventuallyUpdateScrollDimensions();const t=CPe.relativeComplement(n,a);for(const e of t)for(let t=e.start;t<e.end;t++)this.items[t].row&&this.removeItemFromDOM(t);const l=CPe.relativeComplement(a,n);for(const e of l)for(let t=e.start;t<e.end;t++){const e=t+1,i=e<this.items.length?this.items[e].row:null,n=i?i.domNode:null;this.insertItemInDOM(t,n)}for(let e=a.start;e<a.end;e++)this.items[e].row&&this.updateItemInDOM(this.items[e],e);if("number"==typeof o){const t=this.scrollable.getFutureScrollPosition().scrollTop-e,n=this.elementTop(o)-s+t;this.setScrollTop(n,i)}return void this._onDidChangeContentHeight.fire(this.contentHeight)}}}probeDynamicHeight(e){var t,i,n;const o=this.items[e];if(this.virtualDelegate.getDynamicHeight){const e=this.virtualDelegate.getDynamicHeight(o.element);if(null!==e){const t=o.size;return o.size=e,o.lastDynamicHeightWidth=this.renderWidth,e-t}}if(!o.hasDynamicHeight||o.lastDynamicHeightWidth===this.renderWidth)return 0;if(this.virtualDelegate.hasDynamicHeight&&!this.virtualDelegate.hasDynamicHeight(o.element))return 0;const s=o.size;if(o.row)return o.row.domNode.style.height="",o.size=o.row.domNode.offsetHeight,o.lastDynamicHeightWidth=this.renderWidth,o.size-s;const{row:r}=this.cache.alloc(o.templateId);r.domNode.style.height="",this.rowsContainer.appendChild(r.domNode);const a=this.renderers.get(o.templateId);if(!a)throw new Yre("Missing renderer for templateId: "+o.templateId);return a.renderElement(o.element,e,r.templateData,void 0),o.size=r.domNode.offsetHeight,null===(t=a.disposeElement)||void 0===t||t.call(a,o.element,e,r.templateData,void 0),null===(n=(i=this.virtualDelegate).setDynamicHeight)||void 0===n||n.call(i,o.element,o.size),o.lastDynamicHeightWidth=this.renderWidth,this.rowsContainer.removeChild(r.domNode),this.cache.release(r),o.size-s}getNextToLastElement(e){const t=e[e.length-1];if(!t)return null;const i=this.items[t.end];return i&&i.row?i.row.domNode:null}getElementDomId(e){return`${this.domId}_${e}`}dispose(){var e;if(this.items){for(const t of this.items)if(t.row){const i=this.renderers.get(t.row.templateId);i&&(null===(e=i.disposeElement)||void 0===e||e.call(i,t.element,-1,t.row.templateData,void 0),i.disposeTemplate(t.row.templateData))}this.items=[]}this.domNode&&this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),nae(this.disposables)}}PPe.InstanceCount=0,NPe([Dwe],PPe.prototype,"onMouseClick",null),NPe([Dwe],PPe.prototype,"onMouseDblClick",null),NPe([Dwe],PPe.prototype,"onMouseMiddleClick",null),NPe([Dwe],PPe.prototype,"onMouseDown",null),NPe([Dwe],PPe.prototype,"onMouseOver",null),NPe([Dwe],PPe.prototype,"onContextMenu",null),NPe([Dwe],PPe.prototype,"onTouchStart",null),NPe([Dwe],PPe.prototype,"onTap",null);var FPe,BPe,WPe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},VPe=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class zPe{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const n=this.renderedElements.findIndex((e=>e.templateData===i));if(n>=0){const e=this.renderedElements[n];this.trait.unrender(i),e.index=t}else{const e={index:t,templateData:i};this.renderedElements.push(e)}this.trait.renderIndex(t,i)}splice(e,t,i){const n=[];for(const o of this.renderedElements)o.index<e?n.push(o):o.index>=e+t&&n.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=n}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex((t=>t.templateData===e));t<0||this.renderedElements.splice(t,1)}}class HPe{get name(){return this._trait}get renderer(){return new zPe(this)}constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new bae,this.onChange=this._onChange.event}splice(e,t,i){var n;t=Math.max(0,Math.min(t,this.length-e));const o=i.length-t,s=e+t,r=[...this.sortedIndexes.filter((t=>t<e)),...i.map(((t,i)=>t?i+e:-1)).filter((e=>-1!==e)),...this.sortedIndexes.filter((e=>e>=s)).map((e=>e+o))],a=this.length+o;if(this.sortedIndexes.length>0&&0===r.length&&a>0){const t=null!==(n=this.sortedIndexes.find((t=>t>=e)))&&void 0!==n?n:a-1;r.push(Math.min(t,a-1))}this.renderer.splice(e,t,i.length),this._set(r,r),this.length=a}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(rFe),t)}_set(e,t,i){const n=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=sFe(o,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return function(e,t,i){return function(n,o){let s=0,r=n-1;for(;s<=r;){const n=(s+r)/2|0,o=i(e[n],t);if(o<0)s=n+1;else{if(!(o>0))return n;r=n-1}}return-(s+1)}(e.length)}(this.sortedIndexes,e,rFe)>=0}dispose(){nae(this._onChange)}}WPe([Dwe],HPe.prototype,"renderer",null);class UPe extends HPe{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class KPe{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,i.map((()=>!1)));const n=this.trait.get().map((e=>this.identityProvider.getId(this.view.element(e)).toString())),o=i.map((e=>n.indexOf(this.identityProvider.getId(e).toString())>-1));this.trait.splice(e,t,o)}}function jPe(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName}function qPe(e){return!!e.classList.contains("monaco-editor")||!e.classList.contains("monaco-list")&&!!e.parentElement&&qPe(e.parentElement)}function $Pe(e){return!!("A"===e.tagName&&e.classList.contains("monaco-button")||"DIV"===e.tagName&&e.classList.contains("monaco-button-dropdown"))||!e.classList.contains("monaco-list")&&!!e.parentElement&&$Pe(e.parentElement)}class GPe{get onKeyDown(){return this.disposables.add(pae.chain(this.disposables.add(new Yke(this.view.domNode,"keydown")).event).filter((e=>!jPe(e.target))).map((e=>new p_e(e))))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new rae,this.multipleSelectionDisposables=new rae,this.onKeyDown.filter((e=>3===e.keyCode)).on(this.onEnter,this,this.disposables),this.onKeyDown.filter((e=>16===e.keyCode)).on(this.onUpArrow,this,this.disposables),this.onKeyDown.filter((e=>18===e.keyCode)).on(this.onDownArrow,this,this.disposables),this.onKeyDown.filter((e=>11===e.keyCode)).on(this.onPageUpArrow,this,this.disposables),this.onKeyDown.filter((e=>12===e.keyCode)).on(this.onPageDownArrow,this,this.disposables),this.onKeyDown.filter((e=>9===e.keyCode)).on(this.onEscape,this,this.disposables),!1!==i.multipleSelectionSupport&&this.onKeyDown.filter((e=>(tse?e.metaKey:e.ctrlKey)&&31===e.keyCode)).on(this.onCtrlA,this,this.multipleSelectionDisposables)}updateOptions(e){void 0!==e.multipleSelectionSupport&&(this.multipleSelectionDisposables.clear(),e.multipleSelectionSupport&&this.onKeyDown.filter((e=>(tse?e.metaKey:e.ctrlKey)&&31===e.keyCode)).on(this.onCtrlA,this,this.multipleSelectionDisposables))}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(Ase(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}WPe([Dwe],GPe.prototype,"onKeyDown",null),function(e){e[e.Automatic=0]="Automatic",e[e.Trigger=1]="Trigger"}(FPe||(FPe={})),function(e){e[e.Idle=0]="Idle",e[e.Typing=1]="Typing"}(BPe||(BPe={}));const ZPe=new class{mightProducePrintableCharacter(e){return!(e.ctrlKey||e.metaKey||e.altKey)&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30||e.keyCode>=93&&e.keyCode<=102||e.keyCode>=80&&e.keyCode<=90)}};class YPe{constructor(e,t,i,n,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=n,this.delegate=o,this.enabled=!1,this.state=BPe.Idle,this.mode=FPe.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new rae,this.disposables=new rae,this.updateOptions(e.options)}updateOptions(e){var t,i;null===(t=e.typeNavigationEnabled)||void 0===t||t?this.enable():this.disable(),this.mode=null!==(i=e.typeNavigationMode)&&void 0!==i?i:FPe.Automatic}enable(){if(this.enabled)return;let e=!1;const t=this.enabledDisposables.add(pae.chain(this.enabledDisposables.add(new Yke(this.view.domNode,"keydown")).event)).filter((e=>!jPe(e.target))).filter((()=>this.mode===FPe.Automatic||this.triggered)).map((e=>new p_e(e))).filter((t=>e||this.keyboardNavigationEventFilter(t))).filter((e=>this.delegate.mightProducePrintableCharacter(e))).forEach((e=>Qve(e,!0))).map((e=>e.browserEvent.key)).event,i=pae.debounce(t,(()=>null),800,void 0,void 0,this.enabledDisposables);pae.reduce(pae.any(t,i),((e,t)=>null===t?null:(e||"")+t),void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t((()=>e=!0),void 0,this.enabledDisposables),i((()=>e=!1),void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const i=null===(e=this.list.options.accessibilityProvider)||void 0===e?void 0:e.getAriaLabel(this.list.element(t[0]));i&&kbe(i)}this.previouslyFocused=-1}onInput(e){if(!e)return this.state=BPe.Idle,void(this.triggered=!1);const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===BPe.Idle?1:0;this.state=BPe.Typing;for(let t=0;t<this.list.length;t++){const o=(i+t+n)%this.list.length,s=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(o)),r=s&&s.toString();if(void 0===r||rOe(e,r))return this.previouslyFocused=i,this.list.setFocus([o]),void this.list.reveal(o)}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class QPe{constructor(e,t){this.list=e,this.view=t,this.disposables=new rae,this.disposables.add(pae.chain(this.disposables.add(new Yke(t.domNode,"keydown")).event)).filter((e=>!jPe(e.target))).map((e=>new p_e(e))).filter((e=>!(2!==e.keyCode||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey))).on(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(0===t.length)return;const i=this.view.domElement(t[0]);if(!i)return;const n=i.querySelector("[tabIndex]");if(!(n&&n instanceof HTMLElement&&-1!==n.tabIndex))return;const o=window.getComputedStyle(n);"hidden"!==o.visibility&&"none"!==o.display&&(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function XPe(e){return tse?e.browserEvent.metaKey:e.browserEvent.ctrlKey}function JPe(e){return e.browserEvent.shiftKey}const eFe={isSelectionSingleChangeEvent:XPe,isSelectionRangeChangeEvent:JPe};class tFe{constructor(e){this.list=e,this.disposables=new rae,this._onPointer=new bae,this.onPointer=this._onPointer.event,!1!==e.options.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||eFe),this.mouseSupport=void 0===e.options.mouseSupport||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(Nwe.addTarget(e.getHTMLElement()))),pae.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){void 0!==e.multipleSelectionSupport&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||eFe))}isSelectionSingleChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionSingleChangeEvent(e)}isSelectionRangeChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionRangeChangeEvent(e)}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){qPe(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(jPe(e.browserEvent.target)||qPe(e.browserEvent.target))return;const t=void 0===e.index?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport)return;if(jPe(e.browserEvent.target)||qPe(e.browserEvent.target))return;const t=e.index;return void 0===t?(this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),void this.list.setAnchor(void 0)):this.isSelectionRangeChangeEvent(e)||this.isSelectionChangeEvent(e)?this.changeSelection(e):(this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),(i=e.browserEvent)instanceof MouseEvent&&2===i.button||this.list.setSelection([t],e.browserEvent),void this._onPointer.fire(e));var i}onDoubleClick(e){if(jPe(e.browserEvent.target)||qPe(e.browserEvent.target))return;if(this.isSelectionChangeEvent(e))return;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(void 0===i){const e=this.list.getFocus()[0];i=null!=e?e:t,this.list.setAnchor(i)}const n=Ase(Math.min(i,t),Math.max(i,t)+1),o=this.list.getSelection(),s=function(e,t){const i=e.indexOf(t);if(-1===i)return[];const n=[];let o=i-1;for(;o>=0&&e[o]===t-(i-o);)n.push(e[o--]);for(n.reverse(),o=i;o<e.length&&e[o]===t+(o-i);)n.push(e[o++]);return n}(sFe(o,[i]),i);if(0===s.length)return;const r=sFe(n,function(e,t){const i=[];let n=0,o=0;for(;n<e.length||o<t.length;)if(n>=e.length)i.push(t[o++]);else if(o>=t.length)i.push(e[n++]);else{if(e[n]===t[o]){n++,o++;continue}e[n]<t[o]?i.push(e[n++]):o++}return i}(o,s));this.list.setSelection(r,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const i=this.list.getSelection(),n=i.filter((e=>e!==t));this.list.setFocus([t]),this.list.setAnchor(t),i.length===n.length?this.list.setSelection([...n,t],e.browserEvent):this.list.setSelection(n,e.browserEvent)}}dispose(){this.disposables.dispose()}}class iFe{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,i;const n=this.selectorSuffix&&`.${this.selectorSuffix}`,o=[];e.listBackground&&o.push(`.monaco-list${n} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(o.push(`.monaco-list${n}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),o.push(`.monaco-list${n}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&o.push(`.monaco-list${n}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(o.push(`.monaco-list${n}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),o.push(`.monaco-list${n}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&o.push(`.monaco-list${n}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&o.push(`.monaco-list${n}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&o.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${n}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }\n\t\t\t`),e.listFocusAndSelectionForeground&&o.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${n}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }\n\t\t\t`),e.listInactiveFocusForeground&&(o.push(`.monaco-list${n} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),o.push(`.monaco-list${n} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&o.push(`.monaco-list${n} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(o.push(`.monaco-list${n} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),o.push(`.monaco-list${n} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(o.push(`.monaco-list${n} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),o.push(`.monaco-list${n} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&o.push(`.monaco-list${n} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&o.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&o.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const s=ube(e.listFocusAndSelectionOutline,ube(e.listSelectionOutline,null!==(t=e.listFocusOutline)&&void 0!==t?t:""));s&&o.push(`.monaco-list${n}:focus .monaco-list-row.focused.selected { outline: 1px solid ${s}; outline-offset: -1px;}`),e.listFocusOutline&&o.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${n}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t\t.monaco-workbench.context-menu-visible .monaco-list${n}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t`);const r=ube(e.listSelectionOutline,null!==(i=e.listInactiveFocusOutline)&&void 0!==i?i:"");r&&o.push(`.monaco-list${n} .monaco-list-row.focused.selected { outline: 1px dotted ${r}; outline-offset: -1px; }`),e.listSelectionOutline&&o.push(`.monaco-list${n} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&o.push(`.monaco-list${n} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&o.push(`.monaco-list${n} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&o.push(`\n\t\t\t\t.monaco-list${n}.drop-target,\n\t\t\t\t.monaco-list${n} .monaco-list-rows.drop-target,\n\t\t\t\t.monaco-list${n} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; }\n\t\t\t`),e.tableColumnsBorder&&o.push(`\n\t\t\t\t.monaco-table > .monaco-split-view2,\n\t\t\t\t.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before,\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2,\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: ${e.tableColumnsBorder};\n\t\t\t\t}\n\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2,\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: transparent;\n\t\t\t\t}\n\t\t\t`),e.tableOddRowsBackgroundColor&&o.push(`\n\t\t\t\t.monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {\n\t\t\t\t\tbackground-color: ${e.tableOddRowsBackgroundColor};\n\t\t\t\t}\n\t\t\t`),this.styleElement.textContent=o.join("\n")}}const nFe={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropBackground:"#383B3D",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:Owe.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:Owe.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:Owe.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0},oFe={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){}}};function sFe(e,t){const i=[];let n=0,o=0;for(;n<e.length||o<t.length;)if(n>=e.length)i.push(t[o++]);else if(o>=t.length)i.push(e[n++]);else{if(e[n]===t[o]){i.push(e[n]),n++,o++;continue}e[n]<t[o]?i.push(e[n++]):i.push(t[o++])}return i}const rFe=(e,t)=>e-t;class aFe{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map((t=>t.renderTemplate(e)))}renderElement(e,t,i,n){let o=0;for(const s of this.renderers)s.renderElement(e,t,i[o++],n)}disposeElement(e,t,i,n){var o;let s=0;for(const r of this.renderers)null===(o=r.disposeElement)||void 0===o||o.call(r,e,t,i[s],n),s+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class lFe{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e);n?i.setAttribute("aria-label",n):i.removeAttribute("aria-label");const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);"number"==typeof o?i.setAttribute("aria-level",`${o}`):i.removeAttribute("aria-level")}disposeTemplate(e){}}class hFe{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){var i,n;null===(n=(i=this.dnd).onDragStart)||void 0===n||n.call(i,e,t)}onDragOver(e,t,i,n){return this.dnd.onDragOver(e,t,i,n)}onDragLeave(e,t,i,n){var o,s;null===(s=(o=this.dnd).onDragLeave)||void 0===s||s.call(o,e,t,i,n)}onDragEnd(e){var t,i;null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}drop(e,t,i,n){this.dnd.drop(e,t,i,n)}}class dFe{get onDidChangeFocus(){return pae.map(this.eventBufferer.wrapEvent(this.focus.onChange),(e=>this.toListEvent(e)),this.disposables)}get onDidChangeSelection(){return pae.map(this.eventBufferer.wrapEvent(this.selection.onChange),(e=>this.toListEvent(e)),this.disposables)}get domId(){return this.view.domId}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=this.disposables.add(pae.chain(this.disposables.add(new Yke(this.view.domNode,"keydown")).event)).map((e=>new p_e(e))).filter((t=>e=58===t.keyCode||t.shiftKey&&68===t.keyCode)).map((e=>Qve(e,!0))).filter((()=>!1)).event,i=this.disposables.add(pae.chain(this.disposables.add(new Yke(this.view.domNode,"keyup")).event)).forEach((()=>e=!1)).map((e=>new p_e(e))).filter((e=>58===e.keyCode||e.shiftKey&&68===e.keyCode)).map((e=>Qve(e,!0))).map((({browserEvent:e})=>{const t=this.getFocus(),i=t.length?t[0]:void 0;return{index:i,element:void 0!==i?this.view.element(i):void 0,anchor:void 0!==i?this.view.domElement(i):this.view.domNode,browserEvent:e}})).event,n=this.disposables.add(pae.chain(this.view.onContextMenu)).filter((t=>!e)).map((({element:e,index:t,browserEvent:i})=>({element:e,index:t,anchor:{x:i.pageX+1,y:i.pageY},browserEvent:i}))).event;return pae.any(t,i,n)}get onKeyDown(){return this.disposables.add(new Yke(this.view.domNode,"keydown")).event}get onDidFocus(){return pae.signal(this.disposables.add(new Yke(this.view.domNode,"focus",!0)).event)}constructor(e,t,i,n,o=oFe){var s,r,a,l;this.user=e,this._options=o,this.focus=new HPe("focused"),this.anchor=new HPe("anchor"),this.eventBufferer=new xae,this._ariaLabel="",this.disposables=new rae,this._onDidDispose=new bae,this.onDidDispose=this._onDidDispose.event;const h=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?null===(s=this._options.accessibilityProvider)||void 0===s?void 0:s.getWidgetRole():"list";this.selection=new UPe("listbox"!==h);const d=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(d.push(new lFe(this.accessibilityProvider)),null===(a=(r=this.accessibilityProvider).onDidChangeActiveDescendant)||void 0===a||a.call(r,this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map((e=>new aFe(e.templateId,[...d,e])));const c=Object.assign(Object.assign({},o),{dnd:o.dnd&&new hFe(this,o.dnd)});if(this.view=this.createListView(t,i,n,c),this.view.domNode.setAttribute("role",h),o.styleController)this.styleController=o.styleController(this.view.domId);else{const e=qve(this.view.domNode);this.styleController=new iFe(e,this.view.domId)}if(this.spliceable=new _Pe([new KPe(this.focus,this.view,o.identityProvider),new KPe(this.selection,this.view,o.identityProvider),new KPe(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new QPe(this,this.view)),("boolean"!=typeof o.keyboardSupport||o.keyboardSupport)&&(this.keyboardController=new GPe(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const e=o.keyboardNavigationDelegate||ZPe;this.typeNavigationController=new YPe(this,this.view,o.keyboardNavigationLabelProvider,null!==(l=o.keyboardNavigationEventFilter)&&void 0!==l?l:()=>!0,e),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),!1!==this._options.multipleSelectionSupport&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,n){return new PPe(e,t,i,n)}createMouseController(e){return new tFe(this)}updateOptions(e={}){var t,i;this._options=Object.assign(Object.assign({},this._options),e),null===(t=this.typeNavigationController)||void 0===t||t.updateOptions(this._options),void 0!==this._options.multipleSelectionController&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),null===(i=this.keyboardController)||void 0===i||i.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new kPe(this.user,`Invalid start index: ${e}`);if(t<0)throw new kPe(this.user,`Invalid delete count: ${t}`);0===t&&0===i.length||this.eventBufferer.bufferEvents((()=>this.spliceable.splice(e,t,i)))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const t of e)if(t<0||t>=this.length)throw new kPe(this.user,`Invalid index ${t}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map((e=>this.view.element(e)))}setAnchor(e){if(void 0!==e){if(e<0||e>=this.length)throw new kPe(this.user,`Invalid index ${e}`);this.anchor.set([e])}else this.anchor.set([])}getAnchor(){return Tse(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return void 0===e?void 0:this.element(e)}setFocus(e,t){for(const t of e)if(t<0||t>=this.length)throw new kPe(this.user,`Invalid index ${t}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(0===this.length)return;const o=this.focus.get(),s=this.findNextIndex(o.length>0?o[0]+e:0,t,n);s>-1&&this.setFocus([s],i)}focusPrevious(e=1,t=!1,i,n){if(0===this.length)return;const o=this.focus.get(),s=this.findPreviousIndex(o.length>0?o[0]-e:0,t,n);s>-1&&this.setFocus([s],i)}focusNextPage(e,t){return VPe(this,void 0,void 0,(function*(){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=0===i?0:i-1;const n=this.getFocus()[0];if(n!==i&&(void 0===n||i>n)){const o=this.findPreviousIndex(i,!1,t);o>-1&&n!==o?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();let s=o+this.view.renderHeight;i>n&&(s-=this.view.elementHeight(i)),this.view.setScrollTop(s),this.view.getScrollTop()!==o&&(this.setFocus([]),yield spe(0),yield this.focusNextPage(e,t))}}))}focusPreviousPage(e,t){return VPe(this,void 0,void 0,(function*(){let i;const n=this.view.getScrollTop();i=0===n?this.view.indexAt(n):this.view.indexAfter(n-1);const o=this.getFocus()[0];if(o!==i&&(void 0===o||o>=i)){const n=this.findNextIndex(i,!1,t);n>-1&&o!==n?this.setFocus([n],e):this.setFocus([i],e)}else{const i=n;this.view.setScrollTop(n-this.view.renderHeight),this.view.getScrollTop()!==i&&(this.setFocus([]),yield spe(0),yield this.focusPreviousPage(e,t))}}))}focusLast(e,t){if(0===this.length)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(0===this.length)return;const n=this.findNextIndex(e,!1,i);n>-1&&this.setFocus([n],t)}findNextIndex(e,t=!1,i){for(let n=0;n<this.length;n++){if(e>=this.length&&!t)return-1;if(e%=this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let n=0;n<this.length;n++){if(e<0&&!t)return-1;if(e=(this.length+e%this.length)%this.length,!i||i(this.element(e)))return e;e--}return-1}getFocus(){return this.focus.get()}getFocusedElements(){return this.getFocus().map((e=>this.view.element(e)))}reveal(e,t){if(e<0||e>=this.length)throw new kPe(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),n=this.view.elementTop(e),o=this.view.elementHeight(e);if($se(t)){const e=o-this.view.renderHeight;this.view.setScrollTop(e*vPe(t,0,1)+n)}else{const e=n+o,t=i+this.view.renderHeight;n<i&&e>=t||(n<i||e>=t&&o>=this.view.renderHeight?this.view.setScrollTop(n):e>=t&&this.view.setScrollTop(e-this.view.renderHeight))}}getHTMLElement(){return this.view.domNode}getElementID(e){return this.view.getElementDomId(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map((e=>this.view.element(e))),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const t=this.focus.get();if(t.length>0){let i;(null===(e=this.accessibilityProvider)||void 0===e?void 0:e.getActiveDescendantId)&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",0===e.length),this.view.domNode.classList.toggle("selection-single",1===e.length),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}WPe([Dwe],dFe.prototype,"onDidChangeFocus",null),WPe([Dwe],dFe.prototype,"onDidChangeSelection",null),WPe([Dwe],dFe.prototype,"onContextMenu",null),WPe([Dwe],dFe.prototype,"onKeyDown",null),WPe([Dwe],dFe.prototype,"onDidFocus",null);var cFe=i(8045),uFe={};uFe.styleTagTransform=Vr(),uFe.setAttributes=Pr(),uFe.insert=Rr().bind(null,"head"),uFe.domAPI=Tr(),uFe.insertStyleElement=Br(),Ir()(cFe.Z,uFe),cFe.Z&&cFe.Z.locals&&cFe.Z.locals;const gFe=sbe,pFe="selectOption.entry.template";class mFe{get templateId(){return pFe}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=ebe(e,gFe(".option-text")),t.detail=ebe(e,gFe(".option-detail")),t.decoratorRight=ebe(e,gFe(".option-decorator-right")),t}renderElement(e,t,i){const n=i,o=e.text,s=e.detail,r=e.decoratorRight,a=e.isDisabled;n.text.textContent=o,n.detail.textContent=s||"",n.decoratorRight.innerText=r||"",a?n.root.classList.add("option-disabled"):n.root.classList.remove("option-disabled")}disposeTemplate(e){}}class fFe extends aae{constructor(e,t,i,n,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=n,this.selectBoxOptions=o||Object.create(null),"number"!=typeof this.selectBoxOptions.minBottomMargin?this.selectBoxOptions.minBottomMargin=fFe.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding","string"==typeof this.selectBoxOptions.ariaLabel&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),"string"==typeof this.selectBoxOptions.ariaDescription&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new bae,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}getHeight(){return 22}getTemplateId(){return pFe}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=sbe(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=ebe(this.selectDropDownContainer,gFe(".select-box-details-pane"));const t=ebe(this.selectDropDownContainer,gFe(".select-box-dropdown-container-width-control")),i=ebe(t,gFe(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",ebe(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=qve(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(Lve(this.selectDropDownContainer,Yve.DRAG_START,(e=>{Qve(e,!0)})))}registerListeners(){let e;this._register(xve(this.selectElement,"change",(e=>{this.selected=e.target.selectedIndex,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)}))),this._register(Lve(this.selectElement,Yve.CLICK,(e=>{Qve(e),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()}))),this._register(Lve(this.selectElement,Yve.MOUSE_DOWN,(e=>{Qve(e)}))),this._register(Lve(this.selectElement,"touchstart",(t=>{e=this._isVisible}))),this._register(Lve(this.selectElement,"touchend",(t=>{Qve(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()}))),this._register(Lve(this.selectElement,Yve.KEY_DOWN,(e=>{const t=new p_e(e);let i=!1;tse?18!==t.keyCode&&16!==t.keyCode&&10!==t.keyCode&&3!==t.keyCode||(i=!0):(18===t.keyCode&&t.altKey||16===t.keyCode&&t.altKey||10===t.keyCode||3===t.keyCode)&&(i=!0),i&&(this.showSelectDropDown(),Qve(e,!0))})))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Nse(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach(((e,t)=>{this.selectElement.add(this.createOption(e.text,t,e.isDisabled)),"string"==typeof e.description&&(this._hasDetails=!0)}))),void 0!==t&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;null===(e=this.selectList)||void 0===e||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join("\n")}styleSelectElement(){var e,t,i;const n=null!==(e=this.styles.selectBackground)&&void 0!==e?e:"",o=null!==(t=this.styles.selectForeground)&&void 0!==t?t:"",s=null!==(i=this.styles.selectBorder)&&void 0!==i?i:"";this.selectElement.style.backgroundColor=n,this.selectElement.style.color=o,this.selectElement.style.borderColor=s}styleList(){var e,t;const i=null!==(e=this.styles.selectBackground)&&void 0!==e?e:"",n=ube(this.styles.selectListBackground,i);this.selectDropDownListContainer.style.backgroundColor=n,this.selectionDetailsPane.style.backgroundColor=n;const o=null!==(t=this.styles.focusBorder)&&void 0!==t?t:"";this.selectDropDownContainer.style.outlineColor=o,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}showSelectDropDown(){this.selectionDetailsPane.innerText="",this.contextViewProvider&&!this._isVisible&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){this.contextViewProvider&&this._isVisible&&(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch(e){}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach(((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)})),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=Rve(this.selectElement),i=getComputedStyle(this.selectElement),n=parseFloat(i.getPropertyValue("--dropdown-padding-top"))+parseFloat(i.getPropertyValue("--dropdown-padding-bottom")),o=window.innerHeight-t.top-t.height-(this.selectBoxOptions.minBottomMargin||0),s=t.top-fFe.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,r=this.selectElement.offsetWidth,a=this.setWidthControlElement(this.widthControlElement),l=Math.max(a,Math.round(r)).toString()+"px";this.selectDropDownContainer.style.width=l,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let h=this.selectList.contentHeight;this._hasDetails&&void 0===this._cachedMaxDetailsHeight&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const d=this._hasDetails?this._cachedMaxDetailsHeight:0,c=h+n+d,u=Math.floor((o-n-d)/this.getHeight()),g=Math.floor((s-n-d)/this.getHeight());if(e)return!(t.top+t.height>window.innerHeight-22||t.top<fFe.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||u<1&&g<1||(u<fFe.DEFAULT_MINIMUM_VISIBLE_OPTIONS&&g>u&&this.options.length>u?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),0));if(t.top+t.height>window.innerHeight-22||t.top<fFe.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||0===this._dropDownPosition&&u<1||1===this._dropDownPosition&&g<1)return this.hideSelectDropDown(!0),!1;if(0===this._dropDownPosition){if(this._isVisible&&u+g<1)return this.hideSelectDropDown(!0),!1;c>o&&(h=u*this.getHeight())}else c>s&&(h=g*this.getHeight());return this.selectList.layout(h),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=h+n+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=h+n+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=l,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}return!1}setWidthControlElement(e){let t=0;if(e){let i=0,n=0;this.options.forEach(((e,t)=>{const o=e.detail?e.detail.length:0,s=e.decoratorRight?e.decoratorRight.length:0,r=e.text.length+o+s;r>n&&(i=t,n=r)})),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=Ove(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=ebe(e,gFe(".select-box-dropdown-list-container")),this.listRenderer=new mFe,this.selectList=new dFe("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:e=>{let t=e.text;return e.detail&&(t+=`. ${e.detail}`),e.decoratorRight&&(t+=`. ${e.decoratorRight}`),e.description&&(t+=`. ${e.description}`),t},getWidgetAriaLabel:()=>Toe(0,"Select Box"),getRole:()=>"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new Yke(this.selectDropDownListContainer,"keydown")),i=pae.chain(t.event).filter((()=>this.selectList.length>0)).map((e=>new p_e(e)));this._register(i.filter((e=>3===e.keyCode)).on((e=>this.onEnter(e)),this)),this._register(i.filter((e=>2===e.keyCode)).on((e=>this.onEnter(e)),this)),this._register(i.filter((e=>9===e.keyCode)).on((e=>this.onEscape(e)),this)),this._register(i.filter((e=>16===e.keyCode)).on((e=>this.onUpArrow(e)),this)),this._register(i.filter((e=>18===e.keyCode)).on((e=>this.onDownArrow(e)),this)),this._register(i.filter((e=>12===e.keyCode)).on(this.onPageDown,this)),this._register(i.filter((e=>11===e.keyCode)).on(this.onPageUp,this)),this._register(i.filter((e=>14===e.keyCode)).on(this.onHome,this)),this._register(i.filter((e=>13===e.keyCode)).on(this.onEnd,this)),this._register(i.filter((e=>e.keyCode>=21&&e.keyCode<=56||e.keyCode>=80&&e.keyCode<=108)).on(this.onCharacter,this)),this._register(Lve(this.selectList.getHTMLElement(),Yve.POINTER_UP,(e=>this.onPointerUp(e)))),this._register(this.selectList.onMouseOver((e=>void 0!==e.index&&this.selectList.setFocus([e.index])))),this._register(this.selectList.onDidChangeFocus((e=>this.onListFocus(e)))),this._register(Lve(this.selectDropDownContainer,Yve.FOCUS_OUT,(e=>{this._isVisible&&!Wve(e.relatedTarget,this.selectDropDownContainer)&&this.onListBlur()}))),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;Qve(e);const t=e.target;if(!t)return;if(t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const n=Number(i.getAttribute("data-index")),o=i.classList.contains("option-disabled");n>=0&&n<this.options.length&&!o&&(this.selected=n,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)),this.hideSelectDropDown(!0))}onListBlur(){this._sticky||(this.selected!==this._currentSelection&&this.select(this._currentSelection),this.hideSelectDropDown(!1))}renderDescriptionMarkdown(e,t){const i=e=>{for(let t=0;t<e.childNodes.length;t++){const n=e.childNodes.item(t);"img"===(n.tagName&&n.tagName.toLowerCase())?e.removeChild(n):i(n)}},n=function(e,t={},i={}){var n;const o=new rae;let s=!1;const r=ePe(t),a=function(t){let i;try{i=cPe(decodeURIComponent(t))}catch(e){}return i?(i=sre(i,(t=>e.uris&&e.uris[t]?Sle.revive(e.uris[t]):void 0)),encodeURIComponent(JSON.stringify(i))):t},l=function(t,i){const n=e.uris&&e.uris[t];let o=Sle.revive(n);return i?t.startsWith(_ve.data+":")?t:(o||(o=Sle.parse(t)),wve.uriToBrowserUri(o).toString(!0)):o?Sle.parse(t).toString()===o.toString()?t:(o.query&&(o=o.with({query:a(o.query)})),o.toString()):t},h=new dPe.Renderer;h.image=gPe.image,h.link=gPe.link,h.paragraph=gPe.paragraph;const d=[];if(t.codeBlockRenderer&&(h.code=(e,i)=>{const n=lPe.nextId(),o=t.codeBlockRenderer(function(e){if(!e)return"";const t=e.split(/[\s+|:|,|\{|\?]/,1);return t.length?t[0]:e}(i),e);return d.push(o.then((e=>[n,e]))),`<div class="code" data-code="${n}">${Ghe(e)}</div>`}),t.actionHandler){const i=function(i){let n=i.target;if("A"===n.tagName||(n=n.parentElement,n&&"A"===n.tagName))try{let o=n.dataset.href;o&&(e.baseUri&&(o=pPe(Sle.from(e.baseUri),o)),t.actionHandler.callback(o,i))}catch(e){zre(e)}finally{i.preventDefault()}},n=t.actionHandler.disposables.add(new Yke(r,"click")),o=t.actionHandler.disposables.add(new Yke(r,"auxclick"));t.actionHandler.disposables.add(pae.any(n.event,o.event)((e=>{const t=new b_e(e);(t.leftButton||t.middleButton)&&i(t)}))),t.actionHandler.disposables.add(Lve(r,"keydown",(e=>{const t=new p_e(e);(t.equals(10)||t.equals(3))&&i(t)})))}e.supportHtml||(i.sanitizer=t=>(e.isTrusted?t.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?t:"",i.sanitize=!0,i.silent=!0),i.renderer=h;let c=null!==(n=e.value)&&void 0!==n?n:"";c.length>1e5&&(c=`${c.substr(0,1e5)}…`),e.supportThemeIcons&&(c=c.replace(VOe,(e=>`\\${e}`)));let u=dPe.parse(c,i);e.supportThemeIcons&&(u=sPe(u).map((e=>"string"==typeof e?e:e.outerHTML)).join(""));const g=(new DOMParser).parseFromString(mPe(e,u),"text/html");if(g.body.querySelectorAll("img").forEach((t=>{const i=t.getAttribute("src");if(i){let n=i;try{e.baseUri&&(n=pPe(Sle.from(e.baseUri),n))}catch(e){}t.src=l(n,!0)}})),g.body.querySelectorAll("a").forEach((t=>{const i=t.getAttribute("href");if(t.removeAttribute("href"),!i||/^data:|javascript:/i.test(i)||/^command:/i.test(i)&&!e.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(i))t.replaceWith(...t.childNodes);else{let n=l(i,!1);e.baseUri&&(n=pPe(Sle.from(e.baseUri),i)),t.dataset.href=n}})),r.innerHTML=mPe(e,g.body.innerHTML),d.length>0&&Promise.all(d).then((e=>{var i,n;if(s)return;const o=new Map(e),a=r.querySelectorAll("div[data-code]");for(const e of a){const t=o.get(null!==(i=e.dataset.code)&&void 0!==i?i:"");t&&tbe(e,t)}null===(n=t.asyncRenderCallback)||void 0===n||n.call(t)})),t.asyncRenderCallback)for(const e of r.getElementsByTagName("img")){const i=o.add(Lve(e,"load",(()=>{i.dispose(),t.asyncRenderCallback()})))}return{element:r,dispose:()=>{s=!0,o.dispose()}}}({value:e,supportThemeIcons:!0},{actionHandler:t});return n.element.classList.add("select-box-description-markdown"),i(n.element),n.element}onListFocus(e){this._isVisible&&this._hasDetails&&this.updateDetail(e.indexes[0])}updateDetail(e){var t,i;this.selectionDetailsPane.innerText="";const n=this.options[e],o=null!==(t=null==n?void 0:n.description)&&void 0!==t?t:"",s=null!==(i=null==n?void 0:n.descriptionIsMarkdown)&&void 0!==i&&i;if(o){if(s){const e=n.descriptionMarkdownActionHandler;this.selectionDetailsPane.appendChild(this.renderDescriptionMarkdown(o,e))}else this.selectionDetailsPane.innerText=o;this.selectionDetailsPane.style.display="block"}else this.selectionDetailsPane.style.display="none";this._skipLayout=!0,this.contextViewProvider.layout(),this._skipLayout=!1}onEscape(e){Qve(e),this.select(this._currentSelection),this.hideSelectDropDown(!0)}onEnter(e){Qve(e),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)),this.hideSelectDropDown(!0)}onDownArrow(e){if(this.selected<this.options.length-1){Qve(e,!0);const t=this.options[this.selected+1].isDisabled;if(t&&this.options.length>this.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(Qve(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){Qve(e),this.selectList.focusPreviousPage(),setTimeout((()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected<this.options.length-1&&(this.selected++,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)}),1)}onPageDown(e){Qve(e),this.selectList.focusNextPage(),setTimeout((()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)}),1)}onHome(e){Qve(e),this.options.length<2||(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){Qve(e),this.options.length<2||(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=Uae.toString(e.keyCode);let i=-1;for(let n=0;n<this.options.length-1;n++)if(i=(n+this.selected+1)%this.options.length,this.options[i].text.charAt(0).toUpperCase()===t&&!this.options[i].isDisabled){this.select(i),this.selectList.setFocus([i]),this.selectList.reveal(this.selectList.getFocus()[0]),Qve(e);break}}dispose(){this.hideSelectDropDown(!1),super.dispose()}}fFe.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN=32,fFe.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN=2,fFe.DEFAULT_MINIMUM_VISIBLE_OPTIONS=3;class _Fe extends aae{constructor(e,t,i,n){super(),this.selected=0,this.selectBoxOptions=n||Object.create(null),this.options=[],this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box","string"==typeof this.selectBoxOptions.ariaLabel&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),"string"==typeof this.selectBoxOptions.ariaDescription&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=this._register(new bae),this.styles=i,this.registerListeners(),this.setOptions(e,t)}registerListeners(){this._register(Nwe.addTarget(this.selectElement)),[Ewe.Tap].forEach((e=>{this._register(Lve(this.selectElement,e,(e=>{this.selectElement.focus()})))})),this._register(xve(this.selectElement,"click",(e=>{Qve(e,!0)}))),this._register(xve(this.selectElement,"change",(e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})}))),this._register(xve(this.selectElement,"keydown",(e=>{let t=!1;tse?18!==e.keyCode&&16!==e.keyCode&&10!==e.keyCode||(t=!0):(18===e.keyCode&&e.altKey||10===e.keyCode||3===e.keyCode)&&(t=!0),t&&e.stopPropagation()})))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){this.options&&Nse(this.options,e)||(this.options=e,this.selectElement.options.length=0,this.options.forEach(((e,t)=>{this.selectElement.add(this.createOption(e.text,t,e.isDisabled))}))),void 0!==t&&this.select(t)}select(e){0===this.options.length?this.selected=0:e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected<this.options.length&&"string"==typeof this.options[this.selected].text?this.selectElement.title=this.options[this.selected].text:this.selectElement.title=""}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){e.classList.add("select-container"),e.appendChild(this.selectElement),this.setOptions(this.options,this.selected),this.applyStyles()}applyStyles(){var e,t,i;this.selectElement&&(this.selectElement.style.backgroundColor=null!==(e=this.styles.selectBackground)&&void 0!==e?e:"",this.selectElement.style.color=null!==(t=this.styles.selectForeground)&&void 0!==t?t:"",this.selectElement.style.borderColor=null!==(i=this.styles.selectBorder)&&void 0!==i?i:"")}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}}var vFe=i(1693),bFe={};bFe.styleTagTransform=Vr(),bFe.setAttributes=Pr(),bFe.insert=Rr().bind(null,"head"),bFe.domAPI=Tr(),bFe.insertStyleElement=Br(),Ir()(vFe.Z,bFe),vFe.Z&&vFe.Z.locals&&vFe.Z.locals;class wFe extends Ske{constructor(e,t,i,n,o){super(),tse&&!(null==o?void 0:o.useCustomDrawn)?this.selectBoxDelegate=new _Fe(e,t,n,o):this.selectBoxDelegate=new fFe(e,t,i,n,o),this._register(this.selectBoxDelegate)}get onDidSelect(){return this.selectBoxDelegate.onDidSelect}setOptions(e,t){this.selectBoxDelegate.setOptions(e,t)}select(e){this.selectBoxDelegate.select(e)}focus(){this.selectBoxDelegate.focus()}blur(){this.selectBoxDelegate.blur()}setFocusable(e){this.selectBoxDelegate.setFocusable(e)}render(e){this.selectBoxDelegate.render(e)}}var CFe=i(7205),yFe={};yFe.styleTagTransform=Vr(),yFe.setAttributes=Pr(),yFe.insert=Rr().bind(null,"head"),yFe.domAPI=Tr(),yFe.insertStyleElement=Br(),Ir()(CFe.Z,yFe),CFe.Z&&CFe.Z.locals&&CFe.Z.locals;class SFe extends aae{get action(){return this._action}constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof Tbe&&this._register(t.onDidChange((e=>{this.element&&this.handleActionChangeEvent(e)})))}handleActionChangeEvent(e){void 0!==e.enabled&&this.updateEnabled(),void 0!==e.checked&&this.updateChecked(),void 0!==e.class&&this.updateClass(),void 0!==e.label&&(this.updateLabel(),this.updateTooltip()),void 0!==e.tooltip&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new Abe)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(Nwe.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,jde&&this._register(Lve(e,Yve.DRAG_START,(e=>{var t;return null===(t=e.dataTransfer)||void 0===t?void 0:t.setData(XRe.TEXT,this._action.label)})))),this._register(Lve(t,Ewe.Tap,(e=>this.onClick(e,!0)))),this._register(Lve(t,Yve.MOUSE_DOWN,(e=>{i||Qve(e,!0),this._action.enabled&&0===e.button&&t.classList.add("active")}))),tse&&this._register(Lve(t,Yve.CONTEXT_MENU,(e=>{0===e.button&&!0===e.ctrlKey&&this.onClick(e)}))),this._register(Lve(t,Yve.CLICK,(e=>{Qve(e,!0),this.options&&this.options.isMenu||this.onClick(e)}))),this._register(Lve(t,Yve.DBLCLICK,(e=>{Qve(e,!0)}))),[Yve.MOUSE_UP,Yve.MOUSE_OUT].forEach((e=>{this._register(Lve(t,e,(e=>{Qve(e),t.classList.remove("active")})))}))}onClick(e,t=!1){var i;Qve(e,!0);const n=Xse(this._context)?(null===(i=this.options)||void 0===i?void 0:i.useEventAsContext)?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,n)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getTooltip(){return this.action.tooltip}updateTooltip(){var e;if(!this.element)return;const t=null!==(e=this.getTooltip())&&void 0!==e?e:"";this.updateAriaLabel(),this.options.hoverDelegate?(this.element.title="",this.customHover?this.customHover.update(t):(this.customHover=XOe(this.options.hoverDelegate,this.element,t),this._store.add(this.customHover))):this.element.title=t}updateAriaLabel(){var e;if(this.element){const t=null!==(e=this.getTooltip())&&void 0!==e?e:"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class kFe extends SFe{constructor(e,t,i){super(e,t,i),this.options=i,this.options.icon=void 0!==i.icon&&i.icon,this.options.label=void 0===i.label||i.label,this.cssClass=""}render(e){super.render(e),this.element&&(this.label=ebe(this.element,sbe("a.action-label"))),this.label&&(this._action.id===Rbe.ID?this.label.setAttribute("role","presentation"):this.options.isMenu?this.label.setAttribute("role","menuitem"):this.label.setAttribute("role","button")),this.options.label&&this.options.keybinding&&this.element&&(ebe(this.element,sbe("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=Toe(0,"{0} ({1})",e,this.options.keybinding))),null!=e?e:void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.action.class,this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):null===(e=this.label)||void 0===e||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),null===(e=this.element)||void 0===e||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),null===(t=this.element)||void 0===t||t.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){const t=null!==(e=this.getTooltip())&&void 0!==e?e:"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(this.action.checked?this.label.classList.add("checked"):this.label.classList.remove("checked"))}}class LFe extends SFe{constructor(e,t,i,n,o,s,r){super(e,t),this.selectBox=new wFe(i,n,o,s,r),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect((e=>this.runAction(e.selected,e.index))))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){var e;null===(e=this.selectBox)||void 0===e||e.focus()}blur(){var e;null===(e=this.selectBox)||void 0===e||e.blur()}render(e){this.selectBox.render(e)}}var xFe,DFe;class EFe extends aae{constructor(e,t={}){var i,n,o,s,r,a;let l,h;switch(super(),this._actionRunnerDisposables=this._register(new rae),this.viewItemDisposables=this._register(new cae),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new bae),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new bae({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new bae),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new bae),this.onWillRun=this._onWillRun.event,this.options=t,this._context=null!==(i=t.context)&&void 0!==i?i:null,this._orientation=null!==(n=this.options.orientation)&&void 0!==n?n:0,this._triggerKeys={keyDown:null!==(s=null===(o=this.options.triggerKeys)||void 0===o?void 0:o.keyDown)&&void 0!==s&&s,keys:null!==(a=null===(r=this.options.triggerKeys)||void 0===r?void 0:r.keys)&&void 0!==a?a:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new Abe,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun((e=>this._onDidRun.fire(e)))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun((e=>this._onWillRun.fire(e)))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",!1!==t.animated&&this.domNode.classList.add("animated"),this._orientation){case 0:l=[15],h=[17];break;case 1:l=[16],h=[18],this.domNode.className+=" vertical"}this._register(Lve(this.domNode,Yve.KEY_DOWN,(e=>{const t=new p_e(e);let i=!0;const n="number"==typeof this.focusedItem?this.viewItems[this.focusedItem]:void 0;l&&(t.equals(l[0])||t.equals(l[1]))?i=this.focusPrevious():h&&(t.equals(h[0])||t.equals(h[1]))?i=this.focusNext():t.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():t.equals(14)?i=this.focusFirst():t.equals(13)?i=this.focusLast():t.equals(2)&&n instanceof SFe&&n.trapsArrowNavigation?i=this.focusNext():this.isTriggerKeyEvent(t)?this._triggerKeys.keyDown?this.doTrigger(t):this.triggerKeyDown=!0:i=!1,i&&(t.preventDefault(),t.stopPropagation())}))),this._register(Lve(this.domNode,Yve.KEY_UP,(e=>{const t=new p_e(e);this.isTriggerKeyEvent(t)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(t)),t.preventDefault(),t.stopPropagation()):(t.equals(2)||t.equals(1026))&&this.updateFocusedItem()}))),this.focusTracker=this._register(Jve(this.domNode)),this._register(this.focusTracker.onDidBlur((()=>{jve()!==this.domNode&&Wve(jve(),this.domNode)||(this._onDidBlur.fire(),this.focusedItem=void 0,this.previouslyFocusedItem=void 0,this.triggerKeyDown=!1)}))),this._register(this.focusTracker.onDidFocus((()=>this.updateFocusedItem()))),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=2?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const e=this.viewItems.find((e=>e instanceof SFe&&e.isEnabled()));e instanceof SFe&&e.setFocusable(!0)}else this.viewItems.forEach((e=>{e instanceof SFe&&e.setFocusable(!1)}))}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach((i=>{t=t||e.equals(i)})),t}updateFocusedItem(){for(let e=0;e<this.actionsList.children.length;e++){const t=this.actionsList.children[e];if(Wve(jve(),t)){this.focusedItem=e;break}}}get context(){return this._context}set context(e){this._context=e,this.viewItems.forEach((t=>t.setActionContext(e)))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun((e=>this._onDidRun.fire(e)))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun((e=>this._onWillRun.fire(e)))),this.viewItems.forEach((t=>t.actionRunner=e))}getContainer(){return this.domNode}getAction(e){var t;if("number"==typeof e)return null===(t=this.viewItems[e])||void 0===t?void 0:t.action;if(e instanceof HTMLElement){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let t=0;t<this.actionsList.childNodes.length;t++)if(this.actionsList.childNodes[t]===e)return this.viewItems[t].action}}push(e,t={}){const i=Array.isArray(e)?e:[e];let n=$se(t.index)?t.index:null;i.forEach((e=>{const i=document.createElement("li");let o;i.className="action-item",i.setAttribute("role","presentation");const s=Object.assign({hoverDelegate:this.options.hoverDelegate},t);this.options.actionViewItemProvider&&(o=this.options.actionViewItemProvider(e,s)),o||(o=new kFe(this.context,e,s)),this.options.allowContextMenu||this.viewItemDisposables.set(o,Lve(i,Yve.CONTEXT_MENU,(e=>{Qve(e,!0)}))),o.actionRunner=this._actionRunner,o.setActionContext(this.context),o.render(i),this.focusable&&o instanceof SFe&&0===this.viewItems.length&&o.setFocusable(!0),null===n||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(i),this.viewItems.push(o)):(this.actionsList.insertBefore(i,this.actionsList.children[n]),this.viewItems.splice(n,0,o),n++)})),"number"==typeof this.focusedItem&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=nae(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),yve(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return 0===this.viewItems.length}focus(e){let t,i=!1;if(void 0===e?i=!0:"number"==typeof e?t=e:"boolean"==typeof e&&(i=e),i&&void 0===this.focusedItem){const e=this.viewItems.findIndex((e=>e.isEnabled()));this.focusedItem=-1===e?void 0:e,this.updateFocus(void 0,void 0,!0)}else void 0!==t&&(this.focusedItem=t),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(void 0===this.focusedItem)this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=t,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Rbe.ID));return this.updateFocus(),!0}focusPrevious(e){if(void 0===this.focusedItem)this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Rbe.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){var n;void 0===this.focusedItem&&this.actionsList.focus({preventScroll:t}),void 0!==this.previouslyFocusedItem&&this.previouslyFocusedItem!==this.focusedItem&&(null===(n=this.viewItems[this.previouslyFocusedItem])||void 0===n||n.blur());const o=void 0!==this.focusedItem&&this.viewItems[this.focusedItem];if(o){let n=!0;ere(o.focus)||(n=!1),this.options.focusOnlyEnabledItems&&ere(o.isEnabled)&&!o.isEnabled()&&(n=!1),o.action.id===Rbe.ID&&(n=!1),n?(i||this.previouslyFocusedItem!==this.focusedItem)&&(o.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0)}}doTrigger(e){if(void 0===this.focusedItem)return;const t=this.viewItems[this.focusedItem];if(t instanceof SFe){const i=null===t._context||void 0===t._context?e:t._context;this.run(t._action,i)}}run(e,t){return i=this,n=void 0,s=function*(){yield this._actionRunner.run(e,t)},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o((function(e){e(i)}))).then(r,a)}l((s=s.apply(i,n||[])).next())}));var i,n,o,s}dispose(){this._context=void 0,this.viewItems=nae(this.viewItems),this.getContainer().remove(),super.dispose()}}!function(e){e.getDefinition=function(e,t){let i=e.defaults;for(;Ibe.isThemeIcon(i);){const e=NFe.getIcon(i.id);if(!e)return;i=e.defaults}return i}}(xFe||(xFe={})),function(e){e.toJSONObject=function(e){return{weight:e.weight,style:e.style,src:e.src.map((e=>({format:e.format,location:e.location.toString()})))}},e.fromJSONObject=function(e){const t=e=>Kse(e)?e:void 0;if(e&&Array.isArray(e.src)&&e.src.every((e=>Kse(e.format)&&Kse(e.location))))return{weight:t(e.weight),style:t(e.style),src:e.src.map((e=>({format:e.format,location:Sle.parse(e.location)})))}}}(DFe||(DFe={}));const NFe=new class{constructor(){this._onDidChange=new bae,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:Toe(0,"The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:Toe(0,"The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Ibe.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,n){const o=this.iconsById[e];if(o){if(i&&!o.description){o.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const t=this.iconReferenceSchema.enum.indexOf(e);-1!==t&&(this.iconReferenceSchema.enumDescriptions[t]=i),this._onDidChange.fire()}return o}const s={id:e,description:i,defaults:t,deprecationMessage:n};this.iconsById[e]=s;const r={$ref:"#/definitions/icons"};return n&&(r.deprecationMessage=n),i&&(r.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=r,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map((e=>this.iconsById[e]))}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(e,t)=>e.id.localeCompare(t.id),t=e=>{for(;Ibe.isThemeIcon(e.defaults);)e=this.iconsById[e.defaults.id];return`codicon codicon-${e?e.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const n=Object.keys(this.iconsById).map((e=>this.iconsById[e]));for(const o of n.filter((e=>!!e.description)).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|${Ibe.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of n.filter((e=>!Ibe.isThemeIcon(e.defaults))).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|`);return i.join("\n")}};function IFe(e,t,i,n){return NFe.registerIcon(e,t,i,n)}function MFe(){return NFe}rge.add("base.contributions.icons",NFe),function(){const e=Wle();for(const t in e){const i="\\"+e[t].toString(16);NFe.registerIcon(t,{fontCharacter:i})}}();const TFe="vscode://schemas/icons",AFe=rge.as(lge);AFe.registerSchema(TFe,NFe.getIconSchema());const RFe=new hpe((()=>AFe.notifySchemaChanged(TFe)),200);NFe.onDidChange((()=>{RFe.isScheduled()||RFe.schedule()})),IFe("widget-close",Vle.close,Toe(0,"Icon for the close action in widgets.")),IFe("goto-previous-location",Vle.arrowUp,Toe(0,"Icon for goto previous editor location.")),IFe("goto-next-location",Vle.arrowDown,Toe(0,"Icon for goto next editor location.")),Ibe.modify(Vle.sync,"spin"),Ibe.modify(Vle.loading,"spin");var OFe,PFe=function(e,t){return function(i,n){t(i,n,e)}};class FFe{constructor(e,t,i,n){this.originalLineStart=e,this.originalLineEnd=t,this.modifiedLineStart=i,this.modifiedLineEnd=n}getType(){return 0===this.originalLineStart?1:0===this.modifiedLineStart?2:0}}class BFe{constructor(e){this.entries=e}}const WFe=IFe("diff-review-insert",Vle.add,Toe(0,"Icon for 'Insert' in diff review.")),VFe=IFe("diff-review-remove",Vle.remove,Toe(0,"Icon for 'Remove' in diff review.")),zFe=IFe("diff-review-close",Vle.close,Toe(0,"Icon for 'Close' in diff review."));let HFe=class e extends aae{constructor(e,t,i){super(),this._languageService=t,this._audioCueService=i,this._width=0,this._diffEditor=e,this._isVisible=!1,this.shadow=ice(document.createElement("div")),this.shadow.setClassName("diff-review-shadow"),this.actionBarContainer=ice(document.createElement("div")),this.actionBarContainer.setClassName("diff-review-actions"),this._actionBar=this._register(new EFe(this.actionBarContainer.domNode)),this._actionBar.push(new Tbe("diffreview.close",Toe(0,"Close"),"close-diff-review "+Ibe.asClassName(zFe),!0,(()=>{return e=this,t=void 0,n=function*(){return this.hide()},new((i=void 0)||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}));var e,t,i,n})),{label:!1,icon:!0}),this.domNode=ice(document.createElement("div")),this.domNode.setClassName("diff-review monaco-editor-background"),this._content=ice(document.createElement("div")),this._content.setClassName("diff-review-content"),this._content.setAttribute("role","code"),this.scrollbar=this._register(new Kke(this._content.domNode,{})),this.domNode.domNode.appendChild(this.scrollbar.getDomNode()),this._register(e.onDidUpdateDiff((()=>{this._isVisible&&(this._diffs=this._compute(),this._render())}))),this._register(e.getModifiedEditor().onDidChangeCursorPosition((()=>{this._isVisible&&this._render()}))),this._register(xve(this.domNode.domNode,"click",(e=>{e.preventDefault();const t=Vve(e.target,"diff-review-row");t&&this._goToRow(t)}))),this._register(xve(this.domNode.domNode,"keydown",(e=>{(e.equals(18)||e.equals(2066)||e.equals(530))&&(e.preventDefault(),this._goToRow(this._getNextRow(),"next")),(e.equals(16)||e.equals(2064)||e.equals(528))&&(e.preventDefault(),this._goToRow(this._getPrevRow(),"previous")),(e.equals(9)||e.equals(2057)||e.equals(521)||e.equals(1033)||e.equals(10)||e.equals(3))&&(e.preventDefault(),this.accept())}))),this._diffs=[],this._currentDiff=null}prev(){let e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){let t=-1;for(let e=0,i=this._diffs.length;e<i;e++)if(this._diffs[e]===this._currentDiff){t=e;break}e=this._diffs.length+t-1}else e=this._findDiffIndex(this._diffEditor.getPosition());if(0===this._diffs.length)return;e%=this._diffs.length;const t=this._diffs[e].entries;this._diffEditor.setPosition(new Rle(t[0].modifiedLineStart,1)),this._diffEditor.setSelection({startColumn:1,startLineNumber:t[0].modifiedLineStart,endColumn:1073741824,endLineNumber:t[t.length-1].modifiedLineEnd}),this._isVisible=!0,this._diffEditor.doLayout(),this._render(),this._goToRow(this._getPrevRow(),"previous")}next(){let e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){let t=-1;for(let e=0,i=this._diffs.length;e<i;e++)if(this._diffs[e]===this._currentDiff){t=e;break}e=t+1}else e=this._findDiffIndex(this._diffEditor.getPosition());if(0===this._diffs.length)return;e%=this._diffs.length;const t=this._diffs[e].entries;this._diffEditor.setPosition(new Rle(t[0].modifiedLineStart,1)),this._diffEditor.setSelection({startColumn:1,startLineNumber:t[0].modifiedLineStart,endColumn:1073741824,endLineNumber:t[t.length-1].modifiedLineEnd}),this._isVisible=!0,this._diffEditor.doLayout(),this._render(),this._goToRow(this._getNextRow(),"next")}accept(){let e=-1;const t=this._getCurrentFocusedRow();if(t){const i=parseInt(t.getAttribute("data-line"),10);isNaN(i)||(e=i)}this.hide(),-1!==e&&(this._diffEditor.setPosition(new Rle(e,1)),this._diffEditor.revealPosition(new Rle(e,1),1))}hide(){this._isVisible=!1,this._diffEditor.updateOptions({readOnly:!1}),this._diffEditor.focus(),this._diffEditor.doLayout(),this._render()}_getPrevRow(){const e=this._getCurrentFocusedRow();return e?e.previousElementSibling?e.previousElementSibling:e:this._getFirstRow()}_getNextRow(){const e=this._getCurrentFocusedRow();return e?e.nextElementSibling?e.nextElementSibling:e:this._getFirstRow()}_getFirstRow(){return this.domNode.domNode.querySelector(".diff-review-row")}_getCurrentFocusedRow(){const e=document.activeElement;return e&&/diff-review-row/.test(e.className)?e:null}_goToRow(e,t){const i=this._getCurrentFocusedRow();e.tabIndex=0,e.focus(),i&&i!==e&&(i.tabIndex=-1);const n=t?"next"===t?null==i?void 0:i.nextElementSibling:null==i?void 0:i.previousElementSibling:i;(null==n?void 0:n.classList.contains("line-insert"))?this._audioCueService.playAudioCue(yce.diffLineInserted,!0):(null==n?void 0:n.classList.contains("line-delete"))&&this._audioCueService.playAudioCue(yce.diffLineDeleted,!0),this.scrollbar.scanDomNode()}isVisible(){return this._isVisible}layout(e,t,i){this._width=t,this.shadow.setTop(e-6),this.shadow.setWidth(t),this.shadow.setHeight(this._isVisible?6:0),this.domNode.setTop(e),this.domNode.setWidth(t),this.domNode.setHeight(i),this._content.setHeight(i),this._content.setWidth(t),this._isVisible?(this.actionBarContainer.setAttribute("aria-hidden","false"),this.actionBarContainer.setDisplay("block")):(this.actionBarContainer.setAttribute("aria-hidden","true"),this.actionBarContainer.setDisplay("none"))}_compute(){const t=this._diffEditor.getLineChanges();if(!t||0===t.length)return[];const i=this._diffEditor.getOriginalEditor().getModel(),n=this._diffEditor.getModifiedEditor().getModel();return i&&n?e._mergeAdjacent(t,i.getLineCount(),n.getLineCount()):[]}static _mergeAdjacent(e,t,i){if(!e||0===e.length)return[];const n=[];let o=0;for(let s=0,r=e.length;s<r;s++){const a=e[s],l=a.originalStartLineNumber,h=a.originalEndLineNumber,d=a.modifiedStartLineNumber,c=a.modifiedEndLineNumber,u=[];let g=0;{const t=0===h?l:l-1,i=0===c?d:d-1;let n=1,o=1;if(s>0){const t=e[s-1];n=0===t.originalEndLineNumber?t.originalStartLineNumber+1:t.originalEndLineNumber+1,o=0===t.modifiedEndLineNumber?t.modifiedStartLineNumber+1:t.modifiedEndLineNumber+1}let r=t-3+1,a=i-3+1;if(r<n){const e=n-r;r+=e,a+=e}if(a<o){const e=o-a;r+=e,a+=e}u[g++]=new FFe(r,t,a,i)}0!==h&&(u[g++]=new FFe(l,h,0,0)),0!==c&&(u[g++]=new FFe(0,0,d,c));{const n=0===h?l+1:h+1,o=0===c?d+1:c+1;let a=t,p=i;if(s+1<r){const t=e[s+1];a=0===t.originalEndLineNumber?t.originalStartLineNumber:t.originalStartLineNumber-1,p=0===t.modifiedEndLineNumber?t.modifiedStartLineNumber:t.modifiedStartLineNumber-1}let m=n+3-1,f=o+3-1;if(m>a){const e=a-m;m+=e,f+=e}if(f>p){const e=p-f;m+=e,f+=e}u[g++]=new FFe(n,m,o,f)}n[o++]=new BFe(u)}let s=n[0].entries;const r=[];let a=0;for(let e=1,t=n.length;e<t;e++){const t=n[e].entries,i=s[s.length-1],o=t[0];0===i.getType()&&0===o.getType()&&o.originalLineStart<=i.originalLineEnd?(s[s.length-1]=new FFe(i.originalLineStart,o.originalLineEnd,i.modifiedLineStart,o.modifiedLineEnd),s=s.concat(t.slice(1))):(r[a++]=new BFe(s),s=t)}return r[a++]=new BFe(s),r}_findDiffIndex(e){const t=e.lineNumber;for(let e=0,i=this._diffs.length;e<i;e++){const i=this._diffs[e].entries;if(t<=i[i.length-1].modifiedLineEnd)return e}return 0}_render(){const t=this._diffEditor.getOriginalEditor().getOptions(),i=this._diffEditor.getModifiedEditor().getOptions(),n=this._diffEditor.getOriginalEditor().getModel(),o=this._diffEditor.getModifiedEditor().getModel(),s=n.getOptions(),r=o.getOptions();if(!this._isVisible||!n||!o)return yve(this._content.domNode),this._currentDiff=null,void this.scrollbar.scanDomNode();this._diffEditor.updateOptions({readOnly:!0});const a=this._findDiffIndex(this._diffEditor.getPosition());if(this._diffs[a]===this._currentDiff)return;this._currentDiff=this._diffs[a];const l=this._diffs[a].entries,h=document.createElement("div");h.className="diff-review-table",h.setAttribute("role","list"),h.setAttribute("aria-label",'Difference review. Use "Stage | Unstage | Revert Selected Ranges" commands'),nce(h,i.get(47));let d=0,c=0,u=0,g=0;for(let e=0,t=l.length;e<t;e++){const t=l[e],i=t.originalLineStart,n=t.originalLineEnd,o=t.modifiedLineStart,s=t.modifiedLineEnd;0!==i&&(0===d||i<d)&&(d=i),0!==n&&(0===c||n>c)&&(c=n),0!==o&&(0===u||o<u)&&(u=o),0!==s&&(0===g||s>g)&&(g=s)}const p=document.createElement("div");p.className="diff-review-row";const m=document.createElement("div");m.className="diff-review-cell diff-review-summary";const f=c-d+1,_=g-u+1;m.appendChild(document.createTextNode(`${a+1}/${this._diffs.length}: @@ -${d},${f} +${u},${_} @@`)),p.setAttribute("data-line",String(u));const v=e=>0===e?Toe(0,"no lines changed"):1===e?Toe(0,"1 line changed"):Toe(0,"{0} lines changed",e),b=v(f),w=v(_);p.setAttribute("aria-label",Toe(0,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",a+1,this._diffs.length,d,b,u,w)),p.appendChild(m),p.setAttribute("role","listitem"),h.appendChild(p);const C=i.get(63);let y=u;for(let a=0,d=l.length;a<d;a++){const d=l[a];e._renderSection(h,d,y,C,this._width,t,n,s,i,o,r,this._languageService.languageIdCodec),0!==d.modifiedLineStart&&(y=d.modifiedLineEnd)}yve(this._content.domNode),this._content.domNode.appendChild(h),this.scrollbar.scanDomNode()}static _renderSection(t,i,n,o,s,r,a,l,h,d,c,u){const g=i.getType();let p="diff-review-row",m="",f=null;switch(g){case 1:p="diff-review-row line-insert",m=" char-insert",f=WFe;break;case 2:p="diff-review-row line-delete",m=" char-delete",f=VFe}const _=i.originalLineStart,v=i.originalLineEnd,b=i.modifiedLineStart,w=i.modifiedLineEnd,C=Math.max(w-b,v-_),y=r.get(138),S=y.glyphMarginWidth+y.lineNumbersWidth,k=h.get(138),L=10+k.glyphMarginWidth+k.lineNumbersWidth;for(let i=0;i<=C;i++){const v=0===_?0:_+i,w=0===b?0:b+i,C=document.createElement("div");C.style.minWidth=s+"px",C.className=p,C.setAttribute("role","listitem"),0!==w&&(n=w),C.setAttribute("data-line",String(n));const y=document.createElement("div");y.className="diff-review-cell",y.style.height=`${o}px`,C.appendChild(y);const k=document.createElement("span");k.style.width=S+"px",k.style.minWidth=S+"px",k.className="diff-review-line-number"+m,0!==v?k.appendChild(document.createTextNode(String(v))):k.innerText=" ",y.appendChild(k);const x=document.createElement("span");x.style.width=L+"px",x.style.minWidth=L+"px",x.style.paddingRight="10px",x.className="diff-review-line-number"+m,0!==w?x.appendChild(document.createTextNode(String(w))):x.innerText=" ",y.appendChild(x);const D=document.createElement("span");if(D.className="diff-review-spacer",f){const e=document.createElement("span");e.className=Ibe.asClassName(f),e.innerText="  ",D.appendChild(e)}else D.innerText="  ";let E;if(y.appendChild(D),0!==w){let t=this._renderLine(d,h,c.tabSize,w,u);e._ttPolicy&&(t=e._ttPolicy.createHTML(t)),y.insertAdjacentHTML("beforeend",t),E=d.getLineContent(w)}else{let t=this._renderLine(a,r,l.tabSize,v,u);e._ttPolicy&&(t=e._ttPolicy.createHTML(t)),y.insertAdjacentHTML("beforeend",t),E=a.getLineContent(v)}0===E.length&&(E=Toe(0,"blank"));let N="";switch(g){case 0:N=v===w?Toe(0,"{0} unchanged line {1}",E,v):Toe(0,"{0} original line {1} modified line {2}",E,v,w);break;case 1:N=Toe(0,"+ {0} modified line {1}",E,w);break;case 2:N=Toe(0,"- {0} original line {1}",E,v)}C.setAttribute("aria-label",N),t.appendChild(C)}}static _renderLine(e,t,i,n,o){const s=e.getLineContent(n),r=t.get(47),a=gfe.createEmpty(s,o),l=Afe.isBasicASCII(s,e.mightContainNonBasicASCII()),h=Afe.containsRTL(s,l,e.mightContainRTL());return Dfe(new Cfe(r.isMonospace&&!t.get(30),r.canUseHalfwidthRightwardsArrow,s,!1,l,h,0,a,[],i,0,r.spaceWidth,r.middotWidth,r.wsmiddotWidth,t.get(111),t.get(93),t.get(88),t.get(48)!==Ere.OFF,null)).html}};function UFe(e){const t=e.get(mce),i=t.listDiffEditors(),n=t.getActiveCodeEditor();if(!n)return null;for(let e=0,t=i.length;e<t;e++){const t=i[e];if(t.getModifiedEditor().getId()===n.getId()||t.getOriginalEditor().getId()===n.getId())return t}return null}HFe._ttPolicy=null===(OFe=window.trustedTypes)||void 0===OFe?void 0:OFe.createPolicy("diffReview",{createHTML:e=>e}),HFe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([PFe(1,tge),PFe(2,wce)],HFe),owe(class extends iwe{constructor(){super({id:"editor.action.diffReview.next",label:Toe(0,"Go to Next Difference"),alias:"Go to Next Difference",precondition:Lce.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:65,weight:100}})}run(e,t){const i=UFe(e);null==i||i.diffReviewNext()}}),owe(class extends iwe{constructor(){super({id:"editor.action.diffReview.prev",label:Toe(0,"Go to Previous Difference"),alias:"Go to Previous Difference",precondition:Lce.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:1089,weight:100}})}run(e,t){const i=UFe(e);null==i||i.diffReviewPrev()}});var KFe=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class jFe extends aae{get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}constructor(e,t,i,n,o,s){super(),this._viewZoneId=e,this._marginDomNode=t,this.editor=i,this.diff=n,this._contextMenuService=o,this._clipboardService=s,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=Ibe.asClassName(Vle.lightBulb)+" lightbulb-glyph",this._diffActions.style.position="absolute";const r=i.getOption(63),a=i.getModel().getEOL();this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${r}px`,this._diffActions.style.lineHeight=`${r}px`,this._marginDomNode.appendChild(this._diffActions);const l=[],h=0===n.modifiedEndLineNumber;l.push(new Tbe("diff.clipboard.copyDeletedContent",h?n.originalEndLineNumber>n.modifiedStartLineNumber?Toe(0,"Copy deleted lines"):Toe(0,"Copy deleted line"):n.originalEndLineNumber>n.modifiedStartLineNumber?Toe(0,"Copy changed lines"):Toe(0,"Copy changed line"),void 0,!0,(()=>KFe(this,void 0,void 0,(function*(){const e=new Ole(n.originalStartLineNumber,1,n.originalEndLineNumber+1,1),t=n.originalModel.getValueInRange(e);yield this._clipboardService.writeText(t)})))));let d,c=0;n.originalEndLineNumber>n.modifiedStartLineNumber&&(d=new Tbe("diff.clipboard.copyDeletedLineContent",Toe(0,h?"Copy deleted line ({0})":"Copy changed line ({0})",n.originalStartLineNumber),void 0,!0,(()=>KFe(this,void 0,void 0,(function*(){const e=n.originalModel.getLineContent(n.originalStartLineNumber+c);if(""===e){const e=n.originalModel.getEndOfLineSequence();yield this._clipboardService.writeText(0===e?"\n":"\r\n")}else yield this._clipboardService.writeText(e)})))),l.push(d)),i.getOption(86)||l.push(new Tbe("diff.inline.revertChange",Toe(0,"Revert this change"),void 0,!0,(()=>KFe(this,void 0,void 0,(function*(){const e=new Ole(n.originalStartLineNumber,1,n.originalEndLineNumber,n.originalModel.getLineMaxColumn(n.originalEndLineNumber)),t=n.originalModel.getValueInRange(e);if(0===n.modifiedEndLineNumber){const e=i.getModel().getLineMaxColumn(n.modifiedStartLineNumber);i.executeEdits("diffEditor",[{range:new Ole(n.modifiedStartLineNumber,e,n.modifiedStartLineNumber,e),text:a+t}])}else{const e=i.getModel().getLineMaxColumn(n.modifiedEndLineNumber);i.executeEdits("diffEditor",[{range:new Ole(n.modifiedStartLineNumber,1,n.modifiedEndLineNumber,e),text:t}])}})))));const u=(e,t)=>{this._contextMenuService.showContextMenu({getAnchor:()=>({x:e,y:t}),getActions:()=>(d&&(d.label=Toe(0,h?"Copy deleted line ({0})":"Copy changed line ({0})",n.originalStartLineNumber+c)),l),autoSelectFirstItem:!0})};this._register(xve(this._diffActions,"mousedown",(e=>{const{top:t,height:i}=Rve(this._diffActions),n=Math.floor(r/3);e.preventDefault(),u(e.posx,t+i+n)}))),this._register(i.onMouseMove((e=>{(8===e.target.type||5===e.target.type)&&e.target.detail.viewZoneId===this._viewZoneId?(this.visibility=!0,c=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,r)):this.visibility=!1}))),this._register(i.onMouseDown((e=>{!e.event.rightButton||8!==e.target.type&&5!==e.target.type||e.target.detail.viewZoneId===this._viewZoneId&&(e.event.preventDefault(),c=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,r),u(e.event.posx,e.event.posy+r))})))}_updateLightBulbPosition(e,t,i){const{top:n}=Rve(e),o=t-n,s=Math.floor(o/i),r=s*i;if(this._diffActions.style.top=`${r}px`,this.diff.viewLineCounts){let e=0;for(let t=0;t<this.diff.viewLineCounts.length;t++)if(e+=this.diff.viewLineCounts[t],s<e)return t}return s}}const qFe=pce("editorWorkerService");let $Fe=class{constructor(e,t){this.editorWorkerService=t,this.onDidChangeEventEmitter=new bae,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="smart",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;null===(e=this.diffAlgorithmOnDidChangeSubscription)||void 0===e||e.dispose()}computeDiff(e,t,i){return n=this,o=void 0,r=function*(){if("string"!=typeof this.diffAlgorithm)return this.diffAlgorithm.computeDiff(e,t,i);const n=yield this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm);if(!n)throw new Error("no diff result available");return n},new((s=void 0)||(s=Promise))((function(e,t){function i(e){try{l(r.next(e))}catch(e){t(e)}}function a(e){try{l(r.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof s?n:new s((function(e){e(n)}))).then(i,a)}l((r=r.apply(n,o||[])).next())}));var n,o,s,r}setOptions(e){var t;let i=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&(null===(t=this.diffAlgorithmOnDidChangeSubscription)||void 0===t||t.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,"string"!=typeof e.diffAlgorithm&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange((()=>this.onDidChangeEventEmitter.fire()))),i=!0),i&&this.onDidChangeEventEmitter.fire()}};$Fe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,qFe)],$Fe);const GFe=pce("clipboardService"),ZFe=pce("contextViewService"),YFe=pce("contextMenuService"),QFe=pce("progressService");Object.freeze({total(){},worked(){},done(){}}),Object.freeze({report(){}});const XFe=pce("editorProgressService");var JFe,eBe=function(e,t){return function(i,n){t(i,n,e)}};class tBe{constructor(e,t){this._contextMenuService=e,this._clipboardService=t,this._zones=[],this._inlineDiffMargins=[],this._zonesMap={},this._decorations=[]}getForeignViewZones(e){return e.filter((e=>!this._zonesMap[String(e.id)]))}clean(e){this._zones.length>0&&e.changeViewZones((e=>{for(const t of this._zones)e.removeZone(t)})),this._zones=[],this._zonesMap={},e.changeDecorations((e=>{this._decorations=e.deltaDecorations(this._decorations,[])}))}apply(e,t,i,n){const o=n?ZRe.capture(e):null;e.changeViewZones((t=>{var n;for(const e of this._zones)t.removeZone(e);for(const e of this._inlineDiffMargins)e.dispose();this._zones=[],this._zonesMap={},this._inlineDiffMargins=[];for(let o=0,s=i.zones.length;o<s;o++){const s=i.zones[o];s.suppressMouseDown=!0;const r=t.addZone(s);this._zones.push(r),this._zonesMap[String(r)]=!0,i.zones[o].diff&&s.marginDomNode&&(s.suppressMouseDown=!1,0!==(null===(n=i.zones[o].diff)||void 0===n?void 0:n.originalModel.getValueLength())&&this._inlineDiffMargins.push(new jFe(r,s.marginDomNode,e,i.zones[o].diff,this._contextMenuService,this._clipboardService)))}})),null==o||o.restore(e),e.changeDecorations((e=>{this._decorations=e.deltaDecorations(this._decorations,i.decorations)})),null==t||t.setZones(i.overviewZones)}}let iBe=0;const nBe=IFe("diff-insert",Vle.add,Toe(0,"Line decoration for inserts in the diff editor.")),oBe=IFe("diff-remove",Vle.remove,Toe(0,"Line decoration for removals in the diff editor.")),sBe=null===(JFe=window.trustedTypes)||void 0===JFe?void 0:JFe.createPolicy("diffEditorWidget",{createHTML:e=>e}),rBe=Toe(0," use Shift + F7 to navigate changes");let aBe=class e extends aae{constructor(t,i,n,o,s,r,a,l,h,d,c){super(),this._editorProgressService=c,this._onDidDispose=this._register(new bae),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModel=this._register(new bae),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidUpdateDiff=this._register(new bae),this.onDidUpdateDiff=this._onDidUpdateDiff.event,this._onDidContentSizeChange=this._register(new bae),this._lastOriginalWarning=null,this._lastModifiedWarning=null,this._documentDiffProvider=this._register(r.createInstance($Fe,i)),this._register(this._documentDiffProvider.onDidChange((e=>this._beginUpdateDecorationsSoon()))),this._codeEditorService=a,this._contextKeyService=this._register(s.createScoped(t)),this._instantiationService=r.createChild(new GAe([qce,this._contextKeyService])),this._contextKeyService.createKey("isInDiffEditor",!0),this._themeService=l,this._notificationService=h,this._id=++iBe,this._state=0,this._updatingDiffProgress=null,this._domElement=t,i=i||{},this._options=kBe(i,{enableSplitViewResizing:!0,renderSideBySide:!0,renderMarginRevertIcon:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"smart"}),void 0!==i.isInEmbeddedEditor?this._contextKeyService.createKey("isInEmbeddedDiffEditor",i.isInEmbeddedEditor):this._contextKeyService.createKey("isInEmbeddedDiffEditor",!1),this._updateDecorationsRunner=this._register(new hpe((()=>this._updateDecorations()),0)),this._containerDomElement=document.createElement("div"),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide),this._containerDomElement.style.position="relative",this._containerDomElement.style.height="100%",this._domElement.appendChild(this._containerDomElement),this._overviewViewportDomElement=ice(document.createElement("div")),this._overviewViewportDomElement.setClassName("diffViewport"),this._overviewViewportDomElement.setPosition("absolute"),this._overviewDomElement=document.createElement("div"),this._overviewDomElement.className="diffOverview",this._overviewDomElement.style.position="absolute",this._overviewDomElement.appendChild(this._overviewViewportDomElement.domNode),this._register(xve(this._overviewDomElement,Yve.POINTER_DOWN,(e=>{this._modifiedEditor.delegateVerticalScrollbarPointerDown(e)}))),this._register(Lve(this._overviewDomElement,Yve.MOUSE_WHEEL,(e=>{this._modifiedEditor.delegateScrollFromMouseWheelEvent(e)}),{passive:!1})),this._options.renderOverviewRuler&&this._containerDomElement.appendChild(this._overviewDomElement),this._originalDomNode=document.createElement("div"),this._originalDomNode.className="editor original",this._originalDomNode.style.position="absolute",this._originalDomNode.style.height="100%",this._containerDomElement.appendChild(this._originalDomNode),this._modifiedDomNode=document.createElement("div"),this._modifiedDomNode.className="editor modified",this._modifiedDomNode.style.position="absolute",this._modifiedDomNode.style.height="100%",this._containerDomElement.appendChild(this._modifiedDomNode),this._beginUpdateDecorationsTimeout=-1,this._currentlyChangingViewZones=!1,this._diffComputationToken=0,this._originalEditorState=new tBe(d,o),this._modifiedEditorState=new tBe(d,o),this._isVisible=!0,this._isHandlingScrollEvent=!1,this._elementSizeObserver=this._register(new mwe(this._containerDomElement,i.dimension)),this._register(this._elementSizeObserver.onDidChange((()=>this._onDidContainerSizeChanged()))),i.automaticLayout&&this._elementSizeObserver.startObserving(),this._diffComputationResult=null,this._originalEditor=this._createLeftHandSideEditor(i,n.originalEditor||{}),this._modifiedEditor=this._createRightHandSideEditor(i,n.modifiedEditor||{}),this._originalOverviewRuler=null,this._modifiedOverviewRuler=null,this._reviewPane=r.createInstance(HFe,this),this._containerDomElement.appendChild(this._reviewPane.domNode.domNode),this._containerDomElement.appendChild(this._reviewPane.shadow.domNode),this._containerDomElement.appendChild(this._reviewPane.actionBarContainer.domNode),this._options.renderSideBySide?this._setStrategy(new gBe(this._createDataSource(),this._options.enableSplitViewResizing)):this._setStrategy(new mBe(this._createDataSource(),this._options.enableSplitViewResizing)),this._register(l.onDidColorThemeChange((t=>{this._strategy&&this._strategy.applyColors(t)&&this._updateDecorationsRunner.schedule(),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide)})));const u=rwe.getDiffEditorContributions();for(const e of u)try{this._register(r.createInstance(e.ctor,this))}catch(e){zre(e)}this._codeEditorService.addDiffEditor(this)}_setState(e){this._state!==e&&(this._state=e,this._updatingDiffProgress&&(this._updatingDiffProgress.done(),this._updatingDiffProgress=null),1===this._state&&(this._updatingDiffProgress=this._editorProgressService.show(!0,1e3)))}diffReviewNext(){this._reviewPane.next()}diffReviewPrev(){this._reviewPane.prev()}static _getClassName(e,t){let i="monaco-diff-editor monaco-editor-background ";return t&&(i+="side-by-side "),i+=pLe(e.type),i}_disposeOverviewRulers(){this._originalOverviewRuler&&(this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()),this._originalOverviewRuler.dispose(),this._originalOverviewRuler=null),this._modifiedOverviewRuler&&(this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()),this._modifiedOverviewRuler.dispose(),this._modifiedOverviewRuler=null)}_createOverviewRulers(){this._options.renderOverviewRuler&&(fce(!this._originalOverviewRuler&&!this._modifiedOverviewRuler),this._originalEditor.hasModel()&&(this._originalOverviewRuler=this._originalEditor.createOverviewRuler("original diffOverviewRuler"),this._overviewDomElement.appendChild(this._originalOverviewRuler.getDomNode())),this._modifiedEditor.hasModel()&&(this._modifiedOverviewRuler=this._modifiedEditor.createOverviewRuler("modified diffOverviewRuler"),this._overviewDomElement.appendChild(this._modifiedOverviewRuler.getDomNode())),this._layoutOverviewRulers())}_createLeftHandSideEditor(t,i){const n=this._createInnerEditor(this._instantiationService,this._originalDomNode,this._adjustOptionsForLeftHandSide(t),i);this._register(n.onDidScrollChange((e=>{this._isHandlingScrollEvent||(e.scrollTopChanged||e.scrollLeftChanged||e.scrollHeightChanged)&&(this._isHandlingScrollEvent=!0,this._modifiedEditor.setScrollPosition({scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}),this._isHandlingScrollEvent=!1,this._layoutOverviewViewport())}))),this._register(n.onDidChangeViewZones((()=>{this._onViewZonesChanged()}))),this._register(n.onDidChangeConfiguration((e=>{n.getModel()&&(e.hasChanged(47)&&this._updateDecorationsRunner.schedule(),e.hasChanged(139)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))}))),this._register(n.onDidChangeHiddenAreas((()=>{this._updateDecorationsRunner.cancel(),this._updateDecorations()}))),this._register(n.onDidChangeModelContent((()=>{this._isVisible&&this._beginUpdateDecorationsSoon()})));const o=this._contextKeyService.createKey("isInDiffLeftEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget((()=>o.set(!0)))),this._register(n.onDidBlurEditorWidget((()=>o.set(!1)))),this._register(n.onDidContentSizeChange((t=>{const i=this._originalEditor.getContentWidth()+this._modifiedEditor.getContentWidth()+e.ONE_OVERVIEW_WIDTH,n=Math.max(this._modifiedEditor.getContentHeight(),this._originalEditor.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:n,contentWidth:i,contentHeightChanged:t.contentHeightChanged,contentWidthChanged:t.contentWidthChanged})}))),n}_createRightHandSideEditor(t,i){const n=this._createInnerEditor(this._instantiationService,this._modifiedDomNode,this._adjustOptionsForRightHandSide(t),i);this._register(n.onDidScrollChange((e=>{this._isHandlingScrollEvent||(e.scrollTopChanged||e.scrollLeftChanged||e.scrollHeightChanged)&&(this._isHandlingScrollEvent=!0,this._originalEditor.setScrollPosition({scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}),this._isHandlingScrollEvent=!1,this._layoutOverviewViewport())}))),this._register(n.onDidChangeViewZones((()=>{this._onViewZonesChanged()}))),this._register(n.onDidChangeConfiguration((e=>{n.getModel()&&(e.hasChanged(47)&&this._updateDecorationsRunner.schedule(),e.hasChanged(139)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))}))),this._register(n.onDidChangeHiddenAreas((()=>{this._updateDecorationsRunner.cancel(),this._updateDecorations()}))),this._register(n.onDidChangeModelContent((()=>{this._isVisible&&this._beginUpdateDecorationsSoon()}))),this._register(n.onDidChangeModelOptions((e=>{e.tabSize&&this._updateDecorationsRunner.schedule()})));const o=this._contextKeyService.createKey("isInDiffRightEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget((()=>o.set(!0)))),this._register(n.onDidBlurEditorWidget((()=>o.set(!1)))),this._register(n.onDidContentSizeChange((t=>{const i=this._originalEditor.getContentWidth()+this._modifiedEditor.getContentWidth()+e.ONE_OVERVIEW_WIDTH,n=Math.max(this._modifiedEditor.getContentHeight(),this._originalEditor.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:n,contentWidth:i,contentHeightChanged:t.contentHeightChanged,contentWidthChanged:t.contentWidthChanged})}))),this._register(n.onMouseDown((e=>{var t,i;if(!e.event.rightButton&&e.target.position&&(null===(t=e.target.element)||void 0===t?void 0:t.className.includes("arrow-revert-change"))){const t=e.target.position.lineNumber,n=e.target,o=null===(i=this._diffComputationResult)||void 0===i?void 0:i.changes.find((e=>(null==n?void 0:n.detail.afterLineNumber)===e.modifiedStartLineNumber||e.modifiedEndLineNumber>0&&e.modifiedStartLineNumber===t));return o&&this.revertChange(o),e.event.stopPropagation(),void this._updateDecorations()}}))),n}revertChange(e){const t=this._modifiedEditor,i=this._originalEditor.getModel(),n=this._modifiedEditor.getModel();if(!i||!n||!t)return;const o=e.originalEndLineNumber>0?new Ole(e.originalStartLineNumber,1,e.originalEndLineNumber,i.getLineMaxColumn(e.originalEndLineNumber)):null,s=o?i.getValueInRange(o):null,r=e.modifiedEndLineNumber>0?new Ole(e.modifiedStartLineNumber,1,e.modifiedEndLineNumber,n.getLineMaxColumn(e.modifiedEndLineNumber)):null,a=n.getEOL();if(0===e.originalEndLineNumber&&r){let i=r;e.modifiedStartLineNumber>1?i=r.setStartPosition(e.modifiedStartLineNumber-1,n.getLineMaxColumn(e.modifiedStartLineNumber-1)):e.modifiedEndLineNumber<n.getLineCount()&&(i=r.setEndPosition(e.modifiedEndLineNumber+1,1)),t.executeEdits("diffEditor",[{range:i,text:""}])}else if(0===e.modifiedEndLineNumber&&null!==s){const i=e.modifiedStartLineNumber<n.getLineCount()?new Rle(e.modifiedStartLineNumber+1,1):new Rle(e.modifiedStartLineNumber,n.getLineMaxColumn(e.modifiedStartLineNumber));t.executeEdits("diffEditor",[{range:Ole.fromPositions(i,i),text:e.modifiedStartLineNumber<n.getLineCount()?s+a:a+s}])}else r&&null!==s&&t.executeEdits("diffEditor",[{range:r,text:s}])}_createInnerEditor(e,t,i,n){return e.createInstance(kRe,t,i,n)}dispose(){this._codeEditorService.removeDiffEditor(this),-1!==this._beginUpdateDecorationsTimeout&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1),this._cleanViewZonesAndDecorations(),this._originalOverviewRuler&&(this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()),this._originalOverviewRuler.dispose()),this._modifiedOverviewRuler&&(this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()),this._modifiedOverviewRuler.dispose()),this._overviewDomElement.removeChild(this._overviewViewportDomElement.domNode),this._options.renderOverviewRuler&&this._containerDomElement.removeChild(this._overviewDomElement),this._containerDomElement.removeChild(this._originalDomNode),this._originalEditor.dispose(),this._containerDomElement.removeChild(this._modifiedDomNode),this._modifiedEditor.dispose(),this._strategy.dispose(),this._containerDomElement.removeChild(this._reviewPane.domNode.domNode),this._containerDomElement.removeChild(this._reviewPane.shadow.domNode),this._containerDomElement.removeChild(this._reviewPane.actionBarContainer.domNode),this._reviewPane.dispose(),this._domElement.removeChild(this._containerDomElement),this._onDidDispose.fire(),super.dispose()}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return nue.IDiffEditor}getLineChanges(){return this._diffComputationResult?this._diffComputationResult.changes:null}getOriginalEditor(){return this._originalEditor}getModifiedEditor(){return this._modifiedEditor}updateOptions(t){const i=kBe(t,this._options),n=(s=i,{enableSplitViewResizing:(o=this._options).enableSplitViewResizing!==s.enableSplitViewResizing,renderSideBySide:o.renderSideBySide!==s.renderSideBySide,renderMarginRevertIcon:o.renderMarginRevertIcon!==s.renderMarginRevertIcon,maxComputationTime:o.maxComputationTime!==s.maxComputationTime,maxFileSize:o.maxFileSize!==s.maxFileSize,ignoreTrimWhitespace:o.ignoreTrimWhitespace!==s.ignoreTrimWhitespace,renderIndicators:o.renderIndicators!==s.renderIndicators,originalEditable:o.originalEditable!==s.originalEditable,diffCodeLens:o.diffCodeLens!==s.diffCodeLens,renderOverviewRuler:o.renderOverviewRuler!==s.renderOverviewRuler,diffWordWrap:o.diffWordWrap!==s.diffWordWrap,diffAlgorithm:o.diffAlgorithm!==s.diffAlgorithm});var o,s;this._options=i;const r=n.ignoreTrimWhitespace||n.renderIndicators||n.renderMarginRevertIcon,a=this._isVisible&&(n.maxComputationTime||n.maxFileSize);this._documentDiffProvider.setOptions(i),r?this._beginUpdateDecorations():a&&this._beginUpdateDecorationsSoon(),this._modifiedEditor.updateOptions(this._adjustOptionsForRightHandSide(t)),this._originalEditor.updateOptions(this._adjustOptionsForLeftHandSide(t)),this._strategy.setEnableSplitViewResizing(this._options.enableSplitViewResizing),n.renderSideBySide&&(this._options.renderSideBySide?this._setStrategy(new gBe(this._createDataSource(),this._options.enableSplitViewResizing)):this._setStrategy(new mBe(this._createDataSource(),this._options.enableSplitViewResizing)),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide)),n.renderOverviewRuler&&(this._options.renderOverviewRuler?this._containerDomElement.appendChild(this._overviewDomElement):this._containerDomElement.removeChild(this._overviewDomElement))}getModel(){return{original:this._originalEditor.getModel(),modified:this._modifiedEditor.getModel()}}setModel(e){if(e&&(!e.original||!e.modified))throw new Error(e.original?"DiffEditorWidget.setModel: Modified model is null":"DiffEditorWidget.setModel: Original model is null");this._cleanViewZonesAndDecorations(),this._disposeOverviewRulers(),this._originalEditor.setModel(e?e.original:null),this._modifiedEditor.setModel(e?e.modified:null),this._updateDecorationsRunner.cancel(),e&&(this._originalEditor.setScrollTop(0),this._modifiedEditor.setScrollTop(0)),this._diffComputationResult=null,this._diffComputationToken++,this._setState(0),e&&(this._createOverviewRulers(),this._beginUpdateDecorations()),this._layoutOverviewViewport(),this._onDidChangeModel.fire()}getContainerDomNode(){return this._domElement}getVisibleColumnFromPosition(e){return this._modifiedEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._modifiedEditor.getPosition()}setPosition(e,t="api"){this._modifiedEditor.setPosition(e,t)}revealLine(e,t=0){this._modifiedEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._modifiedEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._modifiedEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._modifiedEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._modifiedEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._modifiedEditor.revealPositionNearTop(e,t)}getSelection(){return this._modifiedEditor.getSelection()}getSelections(){return this._modifiedEditor.getSelections()}setSelection(e,t="api"){this._modifiedEditor.setSelection(e,t)}setSelections(e,t="api"){this._modifiedEditor.setSelections(e,t)}revealLines(e,t,i=0){this._modifiedEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._modifiedEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._modifiedEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._modifiedEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,n=!0){this._modifiedEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=0){this._modifiedEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._modifiedEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._modifiedEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._modifiedEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._modifiedEditor.getSupportedActions()}saveViewState(){return{original:this._originalEditor.saveViewState(),modified:this._modifiedEditor.saveViewState()}}restoreViewState(e){if(e&&e.original&&e.modified){const t=e;this._originalEditor.restoreViewState(t.original),this._modifiedEditor.restoreViewState(t.modified)}}layout(e){this._elementSizeObserver.observe(e)}focus(){this._modifiedEditor.focus()}hasTextFocus(){return this._originalEditor.hasTextFocus()||this._modifiedEditor.hasTextFocus()}trigger(e,t,i){this._modifiedEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._modifiedEditor.createDecorationsCollection(e)}changeDecorations(e){return this._modifiedEditor.changeDecorations(e)}_onDidContainerSizeChanged(){this._doLayout()}_getReviewHeight(){return this._reviewPane.isVisible()?this._elementSizeObserver.getHeight():0}_layoutOverviewRulers(){if(!this._options.renderOverviewRuler)return;if(!this._originalOverviewRuler||!this._modifiedOverviewRuler)return;const t=this._elementSizeObserver.getHeight(),i=this._getReviewHeight(),n=e.ENTIRE_DIFF_OVERVIEW_WIDTH-2*e.ONE_OVERVIEW_WIDTH;this._modifiedEditor.getLayoutInfo()&&(this._originalOverviewRuler.setLayout({top:0,width:e.ONE_OVERVIEW_WIDTH,right:n+e.ONE_OVERVIEW_WIDTH,height:t-i}),this._modifiedOverviewRuler.setLayout({top:0,right:0,width:e.ONE_OVERVIEW_WIDTH,height:t-i}))}_onViewZonesChanged(){this._currentlyChangingViewZones||this._updateDecorationsRunner.schedule()}_beginUpdateDecorationsSoon(){-1!==this._beginUpdateDecorationsTimeout&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1),this._beginUpdateDecorationsTimeout=window.setTimeout((()=>this._beginUpdateDecorations()),e.UPDATE_DIFF_DECORATIONS_DELAY)}static _equals(e,t){return!e&&!t||!(!e||!t)&&e.toString()===t.toString()}_beginUpdateDecorations(){-1!==this._beginUpdateDecorationsTimeout&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1);const t=this._originalEditor.getModel(),i=this._modifiedEditor.getModel();if(!t||!i)return;this._diffComputationToken++;const n=this._diffComputationToken,o=1024*this._options.maxFileSize*1024,s=e=>{const t=e.getValueLength();return 0===o||t<=o};s(t)&&s(i)?(this._setState(1),this._documentDiffProvider.computeDiff(t,i,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace,maxComputationTimeMs:this._options.maxComputationTime}).then((e=>{n===this._diffComputationToken&&t===this._originalEditor.getModel()&&i===this._modifiedEditor.getModel()&&(this._setState(2),this._diffComputationResult={identical:e.identical,quitEarly:e.quitEarly,changes:e.changes.map((e=>{let t,i,n,o,s=e.innerChanges;return e.originalRange.isEmpty?(t=e.originalRange.startLineNumber-1,i=0,s=void 0):(t=e.originalRange.startLineNumber,i=e.originalRange.endLineNumberExclusive-1),e.modifiedRange.isEmpty?(n=e.modifiedRange.startLineNumber-1,o=0,s=void 0):(n=e.modifiedRange.startLineNumber,o=e.modifiedRange.endLineNumberExclusive-1),{originalStartLineNumber:t,originalEndLineNumber:i,modifiedStartLineNumber:n,modifiedEndLineNumber:o,charChanges:null==s?void 0:s.map((e=>({originalStartLineNumber:e.originalRange.startLineNumber,originalStartColumn:e.originalRange.startColumn,originalEndLineNumber:e.originalRange.endLineNumber,originalEndColumn:e.originalRange.endColumn,modifiedStartLineNumber:e.modifiedRange.startLineNumber,modifiedStartColumn:e.modifiedRange.startColumn,modifiedEndLineNumber:e.modifiedRange.endLineNumber,modifiedEndColumn:e.modifiedRange.endColumn})))}}))},this._updateDecorationsRunner.schedule(),this._onDidUpdateDiff.fire())}),(e=>{n===this._diffComputationToken&&t===this._originalEditor.getModel()&&i===this._modifiedEditor.getModel()&&(this._setState(2),this._diffComputationResult=null,this._updateDecorationsRunner.schedule())}))):e._equals(t.uri,this._lastOriginalWarning)&&e._equals(i.uri,this._lastModifiedWarning)||(this._lastOriginalWarning=t.uri,this._lastModifiedWarning=i.uri,this._notificationService.warn(Toe(0,"Cannot compare files because one file is too large.")))}_cleanViewZonesAndDecorations(){this._originalEditorState.clean(this._originalEditor),this._modifiedEditorState.clean(this._modifiedEditor)}_updateDecorations(){if(!this._originalEditor.getModel()||!this._modifiedEditor.getModel())return;const e=this._diffComputationResult?this._diffComputationResult.changes:[],t=this._originalEditorState.getForeignViewZones(this._originalEditor.getWhitespaces()),i=this._modifiedEditorState.getForeignViewZones(this._modifiedEditor.getWhitespaces()),n=this._options.renderMarginRevertIcon&&!this._modifiedEditor.getOption(86),o=this._strategy.getEditorsDiffDecorations(e,this._options.ignoreTrimWhitespace,this._options.renderIndicators,n,t,i);try{this._currentlyChangingViewZones=!0,this._originalEditorState.apply(this._originalEditor,this._originalOverviewRuler,o.original,!1),this._modifiedEditorState.apply(this._modifiedEditor,this._modifiedOverviewRuler,o.modified,!0)}finally{this._currentlyChangingViewZones=!1}}_adjustOptionsForSubEditor(e){const t=Object.assign({},e);return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar=Object.assign({},t.scrollbar||{}),t.scrollbar.vertical="visible",t.folding=!1,t.codeLens=this._options.diffCodeLens,t.fixedOverflowWidgets=!0,t.minimap=Object.assign({},t.minimap||{}),t.minimap.enabled=!1,t}_adjustOptionsForLeftHandSide(e){const t=this._adjustOptionsForSubEditor(e);return this._options.renderSideBySide?t.wordWrapOverride1=this._options.diffWordWrap:(t.wordWrapOverride1="off",t.wordWrapOverride2="off"),e.originalAriaLabel&&(t.ariaLabel=e.originalAriaLabel),t.ariaLabel+=rBe,t.readOnly=!this._options.originalEditable,t.dropIntoEditor={enabled:!t.readOnly},t.extraEditorClassName="original-in-monaco-diff-editor",Object.assign(Object.assign({},t),{dimension:{height:0,width:0}})}_adjustOptionsForRightHandSide(t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel+=rBe,i.wordWrapOverride1=this._options.diffWordWrap,i.revealHorizontalRightPadding=Wre.revealHorizontalRightPadding.defaultValue+e.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",Object.assign(Object.assign({},i),{dimension:{height:0,width:0}})}doLayout(){this._elementSizeObserver.observe(),this._doLayout()}_doLayout(){const t=this._elementSizeObserver.getWidth(),i=this._elementSizeObserver.getHeight(),n=this._getReviewHeight(),o=this._strategy.layout();this._originalDomNode.style.width=o+"px",this._originalDomNode.style.left="0px",this._modifiedDomNode.style.width=t-o+"px",this._modifiedDomNode.style.left=o+"px",this._overviewDomElement.style.top="0px",this._overviewDomElement.style.height=i-n+"px",this._overviewDomElement.style.width=e.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this._overviewDomElement.style.left=t-e.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this._overviewViewportDomElement.setWidth(e.ENTIRE_DIFF_OVERVIEW_WIDTH),this._overviewViewportDomElement.setHeight(30),this._originalEditor.layout({width:o,height:i-n}),this._modifiedEditor.layout({width:t-o-(this._options.renderOverviewRuler?e.ENTIRE_DIFF_OVERVIEW_WIDTH:0),height:i-n}),(this._originalOverviewRuler||this._modifiedOverviewRuler)&&this._layoutOverviewRulers(),this._reviewPane.layout(i-n,t,n),this._layoutOverviewViewport()}_layoutOverviewViewport(){const e=this._computeOverviewViewport();e?(this._overviewViewportDomElement.setTop(e.top),this._overviewViewportDomElement.setHeight(e.height)):(this._overviewViewportDomElement.setTop(0),this._overviewViewportDomElement.setHeight(0))}_computeOverviewViewport(){const e=this._modifiedEditor.getLayoutInfo();if(!e)return null;const t=this._modifiedEditor.getScrollTop(),i=this._modifiedEditor.getScrollHeight(),n=Math.max(0,e.height),o=Math.max(0,n-0),s=i>0?o/i:0;return{height:Math.max(0,Math.floor(e.height*s)),top:Math.floor(t*s)}}_createDataSource(){return{getWidth:()=>this._elementSizeObserver.getWidth(),getHeight:()=>this._elementSizeObserver.getHeight()-this._getReviewHeight(),getOptions:()=>({renderOverviewRuler:this._options.renderOverviewRuler}),getContainerDomNode:()=>this._containerDomElement,relayoutEditors:()=>{this._doLayout()},getOriginalEditor:()=>this._originalEditor,getModifiedEditor:()=>this._modifiedEditor}}_setStrategy(e){var t;null===(t=this._strategy)||void 0===t||t.dispose(),this._strategy=e,this._boundarySashes&&e.setBoundarySashes(this._boundarySashes),e.applyColors(this._themeService.getColorTheme()),this._diffComputationResult&&this._updateDecorations(),this._doLayout()}_getLineChangeAtOrBeforeLineNumber(e,t){const i=this._diffComputationResult?this._diffComputationResult.changes:[];if(0===i.length||e<t(i[0]))return null;let n=0,o=i.length-1;for(;n<o;){const s=Math.floor((n+o)/2),r=t(i[s]),a=s+1<=o?t(i[s+1]):1073741824;e<r?o=s-1:e>=a?n=s+1:(n=s,o=s)}return i[n]}_getEquivalentLineForOriginalLineNumber(e){const t=this._getLineChangeAtOrBeforeLineNumber(e,(e=>e.originalStartLineNumber));if(!t)return e;const i=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),n=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,s=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,r=e-i;return r<=o?n+Math.min(r,s):n+s-o+r}_getEquivalentLineForModifiedLineNumber(e){const t=this._getLineChangeAtOrBeforeLineNumber(e,(e=>e.modifiedStartLineNumber));if(!t)return e;const i=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),n=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,s=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,r=e-n;return r<=s?i+Math.min(r,o):i+o-s+r}getDiffLineInformationForOriginal(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForOriginalLineNumber(e)}:null}getDiffLineInformationForModified(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForModifiedLineNumber(e)}:null}};aBe.ONE_OVERVIEW_WIDTH=15,aBe.ENTIRE_DIFF_OVERVIEW_WIDTH=30,aBe.UPDATE_DIFF_DECORATIONS_DELAY=200,aBe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([eBe(3,GFe),eBe(4,qce),eBe(5,gce),eBe(6,mce),eBe(7,uLe),eBe(8,XAe),eBe(9,YFe),eBe(10,XFe)],aBe);class lBe extends aae{constructor(e){super(),this._dataSource=e,this._insertColor=null,this._removeColor=null}applyColors(e){const t=e.getColor(lye)||(e.getColor(rye)||oye).transparent(2),i=e.getColor(hye)||(e.getColor(aye)||sye).transparent(2),n=!t.equals(this._insertColor)||!i.equals(this._removeColor);return this._insertColor=t,this._removeColor=i,n}getEditorsDiffDecorations(e,t,i,n,o,s){s=s.sort(((e,t)=>e.afterLineNumber-t.afterLineNumber)),o=o.sort(((e,t)=>e.afterLineNumber-t.afterLineNumber));const r=this._getViewZones(e,o,s,i),a=this._getOriginalEditorDecorations(r,e,t,i),l=this._getModifiedEditorDecorations(r,e,t,i,n);return{original:{decorations:a.decorations,overviewZones:a.overviewZones,zones:r.original},modified:{decorations:l.decorations,overviewZones:l.overviewZones,zones:r.modified}}}setBoundarySashes(e){}}class hBe{constructor(e){this._source=e,this._index=-1,this.current=null,this.advance()}advance(){this._index++,this._index<this._source.length?this.current=this._source[this._index]:this.current=null}}class dBe{constructor(e,t,i,n,o){this._lineChanges=e,this._originalForeignVZ=t,this._modifiedForeignVZ=i,this._originalEditor=n,this._modifiedEditor=o}static _getViewLineCount(e,t,i){const n=e.getModel(),o=e._getViewModel();if(n&&o){const e=SBe(n,o,t,i);return e.endLineNumber-e.startLineNumber+1}return i-t+1}getViewZones(){const e=this._originalEditor.getOption(63),t=this._modifiedEditor.getOption(63),i=-1!==this._originalEditor.getOption(139).wrappingColumn,n=-1!==this._modifiedEditor.getOption(139).wrappingColumn,o=i||n,s=this._originalEditor.getModel(),r=this._originalEditor._getViewModel().coordinatesConverter,a=this._modifiedEditor._getViewModel().coordinatesConverter,l=[],h=[];let d=0,c=0,u=0,g=0,p=0,m=0;const f=(e,t)=>e.afterLineNumber-t.afterLineNumber,_=(e,t)=>{if(null===t.domNode&&e.length>0){const i=e[e.length-1];if(i.afterLineNumber===t.afterLineNumber&&null===i.domNode)return void(i.heightInLines+=t.heightInLines)}e.push(t)},v=new hBe(this._modifiedForeignVZ),b=new hBe(this._originalForeignVZ);let w=1,C=1;for(let i=0,n=this._lineChanges.length;i<=n;i++){const y=i<n?this._lineChanges[i]:null;null!==y?(u=y.originalStartLineNumber+(y.originalEndLineNumber>0?-1:0),g=y.modifiedStartLineNumber+(y.modifiedEndLineNumber>0?-1:0),c=y.originalEndLineNumber>0?dBe._getViewLineCount(this._originalEditor,y.originalStartLineNumber,y.originalEndLineNumber):0,d=y.modifiedEndLineNumber>0?dBe._getViewLineCount(this._modifiedEditor,y.modifiedStartLineNumber,y.modifiedEndLineNumber):0,p=Math.max(y.originalStartLineNumber,y.originalEndLineNumber),m=Math.max(y.modifiedStartLineNumber,y.modifiedEndLineNumber)):(u+=1e7+c,g+=1e7+d,p=u,m=g);let S=[],k=[];if(o){let e;e=y?y.originalEndLineNumber>0?y.originalStartLineNumber-w:y.modifiedStartLineNumber-C:s.getLineCount()-w+1;for(let t=0;t<e;t++){const e=w+t,i=C+t,n=r.getModelLineViewLineCount(e),o=a.getModelLineViewLineCount(i);n<o?S.push({afterLineNumber:e,heightInLines:o-n,domNode:null,marginDomNode:null}):n>o&&k.push({afterLineNumber:i,heightInLines:n-o,domNode:null,marginDomNode:null})}y&&(w=(y.originalEndLineNumber>0?y.originalEndLineNumber:y.originalStartLineNumber)+1,C=(y.modifiedEndLineNumber>0?y.modifiedEndLineNumber:y.modifiedStartLineNumber)+1)}for(;v.current&&v.current.afterLineNumber<=m;){let e;e=v.current.afterLineNumber<=g?u-g+v.current.afterLineNumber:p;let i=null;y&&y.modifiedStartLineNumber<=v.current.afterLineNumber&&v.current.afterLineNumber<=y.modifiedEndLineNumber&&(i=this._createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion()),S.push({afterLineNumber:e,heightInLines:v.current.height/t,domNode:null,marginDomNode:i}),v.advance()}for(;b.current&&b.current.afterLineNumber<=p;){let t;t=b.current.afterLineNumber<=u?g-u+b.current.afterLineNumber:m,k.push({afterLineNumber:t,heightInLines:b.current.height/e,domNode:null}),b.advance()}if(null!==y&&_Be(y)){const e=this._produceOriginalFromDiff(y,c,d);e&&S.push(e)}if(null!==y&&vBe(y)){const e=this._produceModifiedFromDiff(y,c,d);e&&k.push(e)}let L=0,x=0;for(S=S.sort(f),k=k.sort(f);L<S.length&&x<k.length;){const e=S[L],t=k[x],i=e.afterLineNumber-u,n=t.afterLineNumber-g;i<n?(_(l,e),L++):n<i?(_(h,t),x++):e.shouldNotShrink?(_(l,e),L++):t.shouldNotShrink?(_(h,t),x++):e.heightInLines>=t.heightInLines?(e.heightInLines-=t.heightInLines,x++):(t.heightInLines-=e.heightInLines,L++)}for(;L<S.length;)_(l,S[L]),L++;for(;x<k.length;)_(h,k[x]),x++}return{original:dBe._ensureDomNodes(l),modified:dBe._ensureDomNodes(h)}}static _ensureDomNodes(e){return e.map((e=>(e.domNode||(e.domNode=CBe()),e)))}}function cBe(e,t,i,n,o){return{range:new Ole(e,t,i,n),options:o}}const uBe={arrowRevertChange:DTe.register({description:"diff-editor-arrow-revert-change",glyphMarginClassName:"arrow-revert-change "+Ibe.asClassName(Vle.arrowRight)}),charDelete:DTe.register({description:"diff-editor-char-delete",className:"char-delete"}),charDeleteWholeLine:DTe.register({description:"diff-editor-char-delete-whole-line",className:"char-delete",isWholeLine:!0}),charInsert:DTe.register({description:"diff-editor-char-insert",className:"char-insert"}),charInsertWholeLine:DTe.register({description:"diff-editor-char-insert-whole-line",className:"char-insert",isWholeLine:!0}),lineInsert:DTe.register({description:"diff-editor-line-insert",className:"line-insert",marginClassName:"gutter-insert",isWholeLine:!0}),lineInsertWithSign:DTe.register({description:"diff-editor-line-insert-with-sign",className:"line-insert",linesDecorationsClassName:"insert-sign "+Ibe.asClassName(nBe),marginClassName:"gutter-insert",isWholeLine:!0}),lineDelete:DTe.register({description:"diff-editor-line-delete",className:"line-delete",marginClassName:"gutter-delete",isWholeLine:!0}),lineDeleteWithSign:DTe.register({description:"diff-editor-line-delete-with-sign",className:"line-delete",linesDecorationsClassName:"delete-sign "+Ibe.asClassName(oBe),marginClassName:"gutter-delete",isWholeLine:!0}),lineDeleteMargin:DTe.register({description:"diff-editor-line-delete-margin",marginClassName:"gutter-delete"})};class gBe extends lBe{constructor(e,t){super(e),this._disableSash=!1===t,this._sashRatio=null,this._sashPosition=null,this._startSashPosition=null,this._sash=this._register(new qRe(this._dataSource.getContainerDomNode(),this,{orientation:0})),this._disableSash&&(this._sash.state=0),this._sash.onDidStart((()=>this._onSashDragStart())),this._sash.onDidChange((e=>this._onSashDrag(e))),this._sash.onDidEnd((()=>this._onSashDragEnd())),this._sash.onDidReset((()=>this._onSashReset()))}setEnableSplitViewResizing(e){const t=!1===e;this._disableSash!==t&&(this._disableSash=t,this._sash.state=this._disableSash?0:3)}layout(e=this._sashRatio){const t=this._dataSource.getWidth()-(this._dataSource.getOptions().renderOverviewRuler?aBe.ENTIRE_DIFF_OVERVIEW_WIDTH:0);let i=Math.floor((e||.5)*t);const n=Math.floor(.5*t);return i=this._disableSash?n:i||n,t>2*gBe.MINIMUM_EDITOR_WIDTH?(i<gBe.MINIMUM_EDITOR_WIDTH&&(i=gBe.MINIMUM_EDITOR_WIDTH),i>t-gBe.MINIMUM_EDITOR_WIDTH&&(i=t-gBe.MINIMUM_EDITOR_WIDTH)):i=n,this._sashPosition!==i&&(this._sashPosition=i),this._sash.layout(),this._sashPosition}_onSashDragStart(){this._startSashPosition=this._sashPosition}_onSashDrag(e){const t=this._dataSource.getWidth()-(this._dataSource.getOptions().renderOverviewRuler?aBe.ENTIRE_DIFF_OVERVIEW_WIDTH:0),i=this.layout((this._startSashPosition+(e.currentX-e.startX))/t);this._sashRatio=i/t,this._dataSource.relayoutEditors()}_onSashDragEnd(){this._sash.layout()}_onSashReset(){this._sashRatio=.5,this._dataSource.relayoutEditors(),this._sash.layout()}getVerticalSashTop(e){return 0}getVerticalSashLeft(e){return this._sashPosition}getVerticalSashHeight(e){return this._dataSource.getHeight()}setBoundarySashes(e){this._sash.orthogonalEndSash=e.bottom}_getViewZones(e,t,i){const n=this._dataSource.getOriginalEditor(),o=this._dataSource.getModifiedEditor();return new pBe(e,t,i,n,o).getViewZones()}_getOriginalEditorDecorations(e,t,i,n){const o=this._dataSource.getOriginalEditor(),s=String(this._removeColor),r={decorations:[],overviewZones:[]},a=o.getModel(),l=o._getViewModel();for(const e of t)if(vBe(e)){r.decorations.push({range:new Ole(e.originalStartLineNumber,1,e.originalEndLineNumber,1073741824),options:n?uBe.lineDeleteWithSign:uBe.lineDelete}),_Be(e)&&e.charChanges||r.decorations.push(cBe(e.originalStartLineNumber,1,e.originalEndLineNumber,1073741824,uBe.charDeleteWholeLine));const t=SBe(a,l,e.originalStartLineNumber,e.originalEndLineNumber);if(r.overviewZones.push(new NEe(t.startLineNumber,t.endLineNumber,0,s)),e.charChanges)for(const t of e.charChanges)if(wBe(t))if(i)for(let e=t.originalStartLineNumber;e<=t.originalEndLineNumber;e++){let i,n;i=e===t.originalStartLineNumber?t.originalStartColumn:a.getLineFirstNonWhitespaceColumn(e),n=e===t.originalEndLineNumber?t.originalEndColumn:a.getLineLastNonWhitespaceColumn(e),r.decorations.push(cBe(e,i,e,n,uBe.charDelete))}else r.decorations.push(cBe(t.originalStartLineNumber,t.originalStartColumn,t.originalEndLineNumber,t.originalEndColumn,uBe.charDelete))}return r}_getModifiedEditorDecorations(e,t,i,n,o){const s=this._dataSource.getModifiedEditor(),r=String(this._insertColor),a={decorations:[],overviewZones:[]},l=s.getModel(),h=s._getViewModel();for(const s of t){if(o)if(s.modifiedEndLineNumber>0)a.decorations.push({range:new Ole(s.modifiedStartLineNumber,1,s.modifiedStartLineNumber,1),options:uBe.arrowRevertChange});else{const t=e.modified.find((e=>e.afterLineNumber===s.modifiedStartLineNumber));t&&(t.marginDomNode=yBe())}if(_Be(s)){a.decorations.push({range:new Ole(s.modifiedStartLineNumber,1,s.modifiedEndLineNumber,1073741824),options:n?uBe.lineInsertWithSign:uBe.lineInsert}),vBe(s)&&s.charChanges||a.decorations.push(cBe(s.modifiedStartLineNumber,1,s.modifiedEndLineNumber,1073741824,uBe.charInsertWholeLine));const e=SBe(l,h,s.modifiedStartLineNumber,s.modifiedEndLineNumber);if(a.overviewZones.push(new NEe(e.startLineNumber,e.endLineNumber,0,r)),s.charChanges)for(const e of s.charChanges)if(bBe(e))if(i)for(let t=e.modifiedStartLineNumber;t<=e.modifiedEndLineNumber;t++){let i,n;i=t===e.modifiedStartLineNumber?e.modifiedStartColumn:l.getLineFirstNonWhitespaceColumn(t),n=t===e.modifiedEndLineNumber?e.modifiedEndColumn:l.getLineLastNonWhitespaceColumn(t),a.decorations.push(cBe(t,i,t,n,uBe.charInsert))}else a.decorations.push(cBe(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn,uBe.charInsert))}}return a}}gBe.MINIMUM_EDITOR_WIDTH=100;class pBe extends dBe{constructor(e,t,i,n,o){super(e,t,i,n,o)}_createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(){return null}_produceOriginalFromDiff(e,t,i){return i>t?{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:i-t,domNode:null}:null}_produceModifiedFromDiff(e,t,i){return t>i?{afterLineNumber:Math.max(e.modifiedStartLineNumber,e.modifiedEndLineNumber),heightInLines:t-i,domNode:null}:null}}class mBe extends lBe{constructor(e,t){super(e),this._decorationsLeft=e.getOriginalEditor().getLayoutInfo().decorationsLeft,this._register(e.getOriginalEditor().onDidLayoutChange((t=>{this._decorationsLeft!==t.decorationsLeft&&(this._decorationsLeft=t.decorationsLeft,e.relayoutEditors())})))}setEnableSplitViewResizing(e){}_getViewZones(e,t,i,n){const o=this._dataSource.getOriginalEditor(),s=this._dataSource.getModifiedEditor();return new fBe(e,t,i,o,s,n).getViewZones()}_getOriginalEditorDecorations(e,t,i,n){const o=String(this._removeColor),s={decorations:[],overviewZones:[]},r=this._dataSource.getOriginalEditor(),a=r.getModel(),l=r._getViewModel();let h=0;for(const i of t)if(vBe(i)){for(s.decorations.push({range:new Ole(i.originalStartLineNumber,1,i.originalEndLineNumber,1073741824),options:uBe.lineDeleteMargin});h<e.modified.length;){const t=e.modified[h];if(t.diff&&t.diff.originalStartLineNumber>=i.originalStartLineNumber)break;h++}let t=0;if(h<e.modified.length){const n=e.modified[h];n.diff&&n.diff.originalStartLineNumber===i.originalStartLineNumber&&n.diff.originalEndLineNumber===i.originalEndLineNumber&&n.diff.modifiedStartLineNumber===i.modifiedStartLineNumber&&n.diff.modifiedEndLineNumber===i.modifiedEndLineNumber&&(t=n.heightInLines)}const n=SBe(a,l,i.originalStartLineNumber,i.originalEndLineNumber);s.overviewZones.push(new NEe(n.startLineNumber,n.endLineNumber,t,o))}return s}_getModifiedEditorDecorations(e,t,i,n,o){const s=this._dataSource.getModifiedEditor(),r=String(this._insertColor),a={decorations:[],overviewZones:[]},l=s.getModel(),h=s._getViewModel();for(const e of t)if(_Be(e)){a.decorations.push({range:new Ole(e.modifiedStartLineNumber,1,e.modifiedEndLineNumber,1073741824),options:n?uBe.lineInsertWithSign:uBe.lineInsert});const t=SBe(l,h,e.modifiedStartLineNumber,e.modifiedEndLineNumber);if(a.overviewZones.push(new NEe(t.startLineNumber,t.endLineNumber,0,r)),e.charChanges){for(const t of e.charChanges)if(bBe(t))if(i)for(let e=t.modifiedStartLineNumber;e<=t.modifiedEndLineNumber;e++){let i,n;i=e===t.modifiedStartLineNumber?t.modifiedStartColumn:l.getLineFirstNonWhitespaceColumn(e),n=e===t.modifiedEndLineNumber?t.modifiedEndColumn:l.getLineLastNonWhitespaceColumn(e),a.decorations.push(cBe(e,i,e,n,uBe.charInsert))}else a.decorations.push(cBe(t.modifiedStartLineNumber,t.modifiedStartColumn,t.modifiedEndLineNumber,t.modifiedEndColumn,uBe.charInsert))}else a.decorations.push(cBe(e.modifiedStartLineNumber,1,e.modifiedEndLineNumber,1073741824,uBe.charInsertWholeLine))}return a}layout(){return Math.max(5,this._decorationsLeft)}}class fBe extends dBe{constructor(e,t,i,n,o,s){super(e,t,i,n,o),this._originalModel=n.getModel(),this._renderIndicators=s,this._pendingLineChange=[],this._pendingViewZones=[],this._lineBreaksComputer=this._modifiedEditor._getViewModel().createLineBreaksComputer()}getViewZones(){const e=super.getViewZones();return this._finalize(e),e}_createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(){const e=document.createElement("div");return e.className="inline-added-margin-view-zone",e}_produceOriginalFromDiff(e,t,i){const n=document.createElement("div");return n.className="inline-added-margin-view-zone",{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:i,domNode:document.createElement("div"),marginDomNode:n}}_produceModifiedFromDiff(e,t,i){const n=document.createElement("div");n.className=`view-lines line-delete ${axe}`;const o=document.createElement("div");o.className="inline-deleted-margin-view-zone";const s={shouldNotShrink:!0,afterLineNumber:0===e.modifiedEndLineNumber?e.modifiedStartLineNumber:e.modifiedStartLineNumber-1,heightInLines:t,minWidthInPx:0,domNode:n,marginDomNode:o,diff:{originalStartLineNumber:e.originalStartLineNumber,originalEndLineNumber:e.originalEndLineNumber,modifiedStartLineNumber:e.modifiedStartLineNumber,modifiedEndLineNumber:e.modifiedEndLineNumber,originalModel:this._originalModel,viewLineCounts:null}};for(let t=e.originalStartLineNumber;t<=e.originalEndLineNumber;t++)this._lineBreaksComputer.addRequest(this._originalModel.getLineContent(t),null,null);return this._pendingLineChange.push(e),this._pendingViewZones.push(s),s}_finalize(e){const t=this._modifiedEditor.getOptions(),i=this._modifiedEditor.getModel().getOptions().tabSize,n=t.get(47),o=t.get(30),s=n.typicalHalfwidthCharacterWidth,r=t.get(98),a=this._originalModel.mightContainNonBasicASCII(),l=this._originalModel.mightContainRTL(),h=t.get(63),d=t.get(138).decorationsWidth,c=t.get(111),u=t.get(93),g=t.get(88),p=t.get(48),m=this._lineBreaksComputer.finalize();let f=0;for(let t=0;t<this._pendingLineChange.length;t++){const _=this._pendingLineChange[t],v=this._pendingViewZones[t],b=v.domNode;nce(b,n);const w=v.marginDomNode;nce(w,n);const C=[];if(_.charChanges)for(const e of _.charChanges)wBe(e)&&C.push(new Rfe(new Ole(e.originalStartLineNumber,e.originalStartColumn,e.originalEndLineNumber,e.originalEndColumn),"char-delete",0));const y=C.length>0,S=new Oue(1e4);let k=0,L=0,x=null;for(let t=_.originalStartLineNumber;t<=_.originalEndLineNumber;t++){const s=t-_.originalStartLineNumber,r=this._originalModel.tokenization.getLineTokens(t),b=r.getLineContent(),D=m[f++],E=mfe.filter(C,t,1,b.length+1);if(D){let m=0;for(const e of D.breakOffsets){const t=r.sliceAndInflate(m,e,0),s=b.substring(m,e);k=Math.max(k,this._renderOriginalLine(L++,s,t,mfe.extractWrapped(E,m,e),y,a,l,n,o,h,d,c,u,g,p,i,S,w)),m=e}for(x||(x=[]);x.length<s;)x[x.length]=1;x[s]=D.breakOffsets.length,v.heightInLines+=D.breakOffsets.length-1;const f=document.createElement("div");f.className="gutter-delete",e.original.push({afterLineNumber:t,afterColumn:0,heightInLines:D.breakOffsets.length-1,domNode:CBe(),marginDomNode:f})}else k=Math.max(k,this._renderOriginalLine(L++,b,r,E,y,a,l,n,o,h,d,c,u,g,p,i,S,w))}k+=r;const D=S.build(),E=sBe?sBe.createHTML(D):D;if(b.innerHTML=E,v.minWidthInPx=k*s,x){const e=_.originalEndLineNumber-_.originalStartLineNumber;for(;x.length<=e;)x[x.length]=1}v.diff.viewLineCounts=x}e.original.sort(((e,t)=>e.afterLineNumber-t.afterLineNumber))}_renderOriginalLine(e,t,i,n,o,s,r,a,l,h,d,c,u,g,p,m,f,_){f.appendString('<div class="view-line'),o||f.appendString(" char-delete"),f.appendString('" style="top:'),f.appendString(String(e*h)),f.appendString('px;width:1000000px;">');const v=Afe.isBasicASCII(t,s),b=Afe.containsRTL(t,v,r),w=Lfe(new Cfe(a.isMonospace&&!l,a.canUseHalfwidthRightwardsArrow,t,!1,v,b,0,i,n,m,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,c,u,g,p!==Ere.OFF,null),f);if(f.appendString("</div>"),this._renderIndicators){const t=document.createElement("div");t.className=`delete-sign ${Ibe.asClassName(oBe)}`,t.setAttribute("style",`position:absolute;top:${e*h}px;width:${d}px;height:${h}px;right:0;`),_.appendChild(t)}return w.characterMapping.getHorizontalOffset(w.characterMapping.length)}}function _Be(e){return e.modifiedEndLineNumber>0}function vBe(e){return e.originalEndLineNumber>0}function bBe(e){return e.modifiedStartLineNumber===e.modifiedEndLineNumber?e.modifiedEndColumn-e.modifiedStartColumn>0:e.modifiedEndLineNumber-e.modifiedStartLineNumber>0}function wBe(e){return e.originalStartLineNumber===e.originalEndLineNumber?e.originalEndColumn-e.originalStartColumn>0:e.originalEndLineNumber-e.originalStartLineNumber>0}function CBe(){const e=document.createElement("div");return e.className="diagonal-fill",e}function yBe(){const e=document.createElement("div");return e.className="arrow-revert-change "+Ibe.asClassName(Vle.arrowRight),sbe("div",{},e)}function SBe(e,t,i,n){const o=e.getLineCount();return i=Math.min(o,Math.max(1,i)),n=Math.min(o,Math.max(1,n)),t.coordinatesConverter.convertModelRangeToViewRange(new Ole(i,e.getLineMinColumn(i),n,e.getLineMaxColumn(n)))}function kBe(e,t){return{enableSplitViewResizing:vre(e.enableSplitViewResizing,t.enableSplitViewResizing),renderSideBySide:vre(e.renderSideBySide,t.renderSideBySide),renderMarginRevertIcon:vre(e.renderMarginRevertIcon,t.renderMarginRevertIcon),maxComputationTime:wre(e.maxComputationTime,t.maxComputationTime,0,1073741824),maxFileSize:wre(e.maxFileSize,t.maxFileSize,0,1073741824),ignoreTrimWhitespace:vre(e.ignoreTrimWhitespace,t.ignoreTrimWhitespace),renderIndicators:vre(e.renderIndicators,t.renderIndicators),originalEditable:vre(e.originalEditable,t.originalEditable),diffCodeLens:vre(e.diffCodeLens,t.diffCodeLens),renderOverviewRuler:vre(e.renderOverviewRuler,t.renderOverviewRuler),diffWordWrap:(i=e.diffWordWrap,n=t.diffWordWrap,kre(i,n,["off","on","inherit"])),diffAlgorithm:kre(e.diffAlgorithm,t.diffAlgorithm,["smart","experimental"])};var i,n}_Le(((e,t)=>{const i=e.getColor(dye);t.addRule(`\n\t.monaco-editor .diagonal-fill {\n\t\tbackground-image: linear-gradient(\n\t\t\t-45deg,\n\t\t\t${i} 12.5%,\n\t\t\t#0000 12.5%, #0000 50%,\n\t\t\t${i} 50%, ${i} 62.5%,\n\t\t\t#0000 62.5%, #0000 100%\n\t\t);\n\t\tbackground-size: 8px 8px;\n\t}\n\t`)}));let LBe=class extends aae{constructor(e){super(),this._themeService=e,this._onCodeEditorAdd=this._register(new bae),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new bae),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onDiffEditorAdd=this._register(new bae),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new bae),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new Cse,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map((e=>this._codeEditors[e]))}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}removeDiffEditor(e){delete this._diffEditors[e.getId()]&&this._onDiffEditorRemove.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map((e=>this._diffEditors[e]))}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach((t=>t.removeDecorationsByType(e)))))}setModelProperty(e,t,i){const n=e.toString();let o;this._modelProperties.has(n)?o=this._modelProperties.get(n):(o=new Map,this._modelProperties.set(n,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}openCodeEditor(e,t,i){return n=this,o=void 0,r=function*(){for(const n of this._codeEditorOpenHandlers){const o=yield n(e,t,i);if(null!==o)return o}return null},new((s=void 0)||(s=Promise))((function(e,t){function i(e){try{l(r.next(e))}catch(e){t(e)}}function a(e){try{l(r.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof s?n:new s((function(e){e(n)}))).then(i,a)}l((r=r.apply(n,o||[])).next())}));var n,o,s,r}registerCodeEditorOpenHandler(e){return sae(this._codeEditorOpenHandlers.unshift(e))}};LBe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,uLe)],LBe);var xBe=function(e,t){return function(i,n){t(i,n,e)}};let DBe=class extends LBe{constructor(e,t){super(t),this.onCodeEditorAdd((()=>this._checkContextKey())),this.onCodeEditorRemove((()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this.registerCodeEditorOpenHandler(((e,t,i)=>{return n=this,o=void 0,r=function*(){return t?this.doOpenEditor(t,e):null},new((s=void 0)||(s=Promise))((function(e,t){function i(e){try{l(r.next(e))}catch(e){t(e)}}function a(e){try{l(r.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof s?n:new s((function(e){e(n)}))).then(i,a)}l((r=r.apply(n,o||[])).next())}));var n,o,s,r}))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const i=t.resource.scheme;if(i===_ve.http||i===_ve.https)return hbe(t.resource.toString()),e}return null}const i=t.options?t.options.selection:null;if(i)if("number"==typeof i.endLineNumber&&"number"==typeof i.endColumn)e.setSelection(i),e.revealRangeInCenter(i,1);else{const t={lineNumber:i.startLineNumber,column:i.startColumn};e.setPosition(t),e.revealPositionInCenter(t,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};DBe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([xBe(0,qce),xBe(1,uLe)],DBe),oge(mce,DBe,0);const EBe=pce("layoutService");var NBe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},IBe=function(e,t){return function(i,n){t(i,n,e)}};let MBe=class{get dimension(){return this._dimension||(this._dimension=Mve(window.document.body)),this._dimension}get hasContainer(){return!1}get container(){throw new Error("ILayoutService.container is not available in the standalone editor!")}focus(){var e;null===(e=this._codeEditorService.getFocusedCodeEditor())||void 0===e||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayout=pae.None,this.offset={top:0,quickPickTop:0}}};MBe=NBe([IBe(0,mce)],MBe);let TBe=class extends MBe{get hasContainer(){return!1}get container(){return this._container}constructor(e,t){super(t),this._container=e}};TBe=NBe([IBe(1,mce)],TBe),oge(EBe,MBe,1);const ABe=pce("dialogService");var RBe=function(e,t){return function(i,n){t(i,n,e)}},OBe=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function PBe(e){return e.scheme===_ve.file?e.fsPath:e.path}let FBe=0;class BBe{constructor(e,t,i,n,o,s,r){this.id=++FBe,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=n,this.groupOrder=o,this.sourceId=s,this.sourceOrder=r,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class WBe{constructor(e,t){this.resourceLabel=e,this.reason=t}}class VBe{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,i]of this.elements)(0===i.reason?e:t).push(i.resourceLabel);const i=[];return e.length>0&&i.push(Toe(0,"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(Toe(0,"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join("\n")}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class zBe{constructor(e,t,i,n,o,s,r){this.id=++FBe,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=o,this.sourceId=s,this.sourceOrder=r,this.removedResources=null,this.invalidatedResources=null}canSplit(){return"function"==typeof this.actual.split}removeResource(e,t,i){this.removedResources||(this.removedResources=new VBe),this.removedResources.has(t)||this.removedResources.set(t,new WBe(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),0===this.invalidatedResources.size&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new VBe),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new WBe(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class HBe{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t<this._past.length;t++)e.push(` * [UNDO] ${this._past[t]}`);for(let t=this._future.length-1;t>=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join("\n")}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){1===e.type?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let e=0,i=this._past.length;e<i;e++)t.push(this._past[e].id);for(let e=this._future.length-1;e>=0;e--)t.push(this._future[e].id);return new dTe(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,o=-1;for(let s=0,r=this._past.length;s<r;s++,n++){const r=this._past[s];i&&(n>=t||r.id!==e.elements[n])&&(i=!1,o=0),i||1!==r.type||r.removeResource(this.resourceLabel,this.strResource,0)}let s=-1;for(let o=this._future.length-1;o>=0;o--,n++){const r=this._future[o];i&&(n>=t||r.id!==e.elements[n])&&(i=!1,s=o),i||1!==r.type||r.removeResource(this.resourceLabel,this.strResource,0)}-1!==o&&(this._past=this._past.slice(0,o)),-1!==s&&(this._future=this._future.slice(s+1)),this.versionId++}getElements(){const e=[],t=[];for(const t of this._past)e.push(t.actual);for(const e of this._future)t.push(e.actual);return{past:e,future:t}}getClosestPastElement(){return 0===this._past.length?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return 0===this._future.length?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class UBe{constructor(e){this.editStacks=e,this._versionIds=[];for(let e=0,t=this.editStacks.length;e<t;e++)this._versionIds[e]=this.editStacks[e].versionId}isValid(){for(let e=0,t=this.editStacks.length;e<t;e++)if(this._versionIds[e]!==this.editStacks[e].versionId)return!1;return!0}}const KBe=new HBe("","");KBe.locked=!0;let jBe=class{constructor(e,t){this._dialogService=e,this._notificationService=t,this._editStacks=new Map,this._uriComparisonKeyComputers=[]}getUriComparisonKey(e){for(const t of this._uriComparisonKeyComputers)if(t[0]===e.scheme)return t[1].getComparisonKey(e);return e.toString()}_print(e){console.log("------------------------------------"),console.log(`AFTER ${e}: `);const t=[];for(const e of this._editStacks)t.push(e[1].toString());console.log(t.join("\n"))}pushElement(e,t=cTe.None,i=uTe.None){if(0===e.type){const n=PBe(e.resource),o=this.getUriComparisonKey(e.resource);this._pushElement(new BBe(e,n,o,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const n=new Set,o=[],s=[];for(const t of e.resources){const e=PBe(t),i=this.getUriComparisonKey(t);n.has(i)||(n.add(i),o.push(e),s.push(i))}1===o.length?this._pushElement(new BBe(e,o[0],s[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new zBe(e,o,s,t.id,t.nextOrder(),i.id,i.nextOrder()))}}_pushElement(e){for(let t=0,i=e.strResources.length;t<i;t++){const i=e.resourceLabels[t],n=e.strResources[t];let o;this._editStacks.has(n)?o=this._editStacks.get(n):(o=new HBe(i,n),this._editStacks.set(n,o)),o.pushElement(e)}}getLastElement(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const e=this._editStacks.get(t);if(e.hasFutureElements())return null;const i=e.getClosestPastElement();return i?i.actual:null}return null}_splitPastWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const e of i){const t=PBe(e.resource),i=this.getUriComparisonKey(e.resource),o=new BBe(e,t,i,0,0,0,0);n.set(o.strResource,o)}for(const i of e.strResources)t&&t.has(i)||this._editStacks.get(i).splitPastWorkspaceElement(e,n)}_splitFutureWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const e of i){const t=PBe(e.resource),i=this.getUriComparisonKey(e.resource),o=new BBe(e,t,i,0,0,0,0);n.set(o.strResource,o)}for(const i of e.strResources)t&&t.has(i)||this._editStacks.get(i).splitFutureWorkspaceElement(e,n)}removeElements(e){const t="string"==typeof e?e:this.getUriComparisonKey(e);this._editStacks.has(t)&&(this._editStacks.get(t).dispose(),this._editStacks.delete(t))}setElementsValidFlag(e,t,i){const n=this.getUriComparisonKey(e);this._editStacks.has(n)&&this._editStacks.get(n).setElementsValidFlag(t,i)}createSnapshot(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).createSnapshot(e):new dTe(e,[])}restoreSnapshot(e){const t=this.getUriComparisonKey(e.resource);if(this._editStacks.has(t)){const i=this._editStacks.get(t);i.restoreSnapshot(e),i.hasPastElements()||i.hasFutureElements()||(i.dispose(),this._editStacks.delete(t))}}getElements(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).getElements():{past:[],future:[]}}_findClosestUndoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestPastElement();s&&s.sourceId===e&&(!t||s.sourceOrder>t.sourceOrder)&&(t=s,i=n)}return[t,i]}canUndo(e){if(e instanceof uTe){const[,t]=this._findClosestUndoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);return!!this._editStacks.has(t)&&this._editStacks.get(t).hasPastElements()}_onError(e,t){zre(e);for(const e of t.strResources)this.removeElements(e);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,n,o){const s=this._acquireLocks(i);let r;try{r=t()}catch(t){return s(),n.dispose(),this._onError(t,e)}return r?r.then((()=>(s(),n.dispose(),o())),(t=>(s(),n.dispose(),this._onError(t,e)))):(s(),n.dispose(),o())}_invokeWorkspacePrepare(e){return OBe(this,void 0,void 0,(function*(){if(void 0===e.actual.prepareUndoRedo)return aae.None;const t=e.actual.prepareUndoRedo();return void 0===t?aae.None:t}))}_invokeResourcePrepare(e,t){if(1!==e.actual.type||void 0===e.actual.prepareUndoRedo)return t(aae.None);const i=e.actual.prepareUndoRedo();return i?"function"==typeof(n=i).dispose&&0===n.dispose.length?t(i):i.then((e=>t(e))):t(aae.None);var n}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||KBe);return new UBe(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new qBe(this._undo(e,0,!0));for(const e of t.strResources)this.removeElements(e);return this._notificationService.warn(n),new qBe}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,Toe(0,"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,Toe(0,"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const e of i.editStacks)e.getClosestPastElement()!==t&&o.push(e.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,Toe(0,"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const e of i.editStacks)e.locked&&s.push(e.resourceLabel);return s.length>0?this._tryToSplitAndUndo(e,t,null,Toe(0,"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,Toe(0,"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const n=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,n,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,n,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const i=t.getSecondClosestPastElement();if(i&&i.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}_confirmAndExecuteWorkspaceUndo(e,t,i,n){return OBe(this,void 0,void 0,(function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){const o=yield this._dialogService.show(YAe.Info,Toe(0,"Would you like to undo '{0}' across all files?",t.label),[Toe(0,"Undo in {0} Files",i.editStacks.length),Toe(0,"Undo this File"),Toe(0,"Cancel")],{cancelId:2});if(2===o.choice)return;if(1===o.choice)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const s=this._checkWorkspaceUndo(e,t,i,!1);if(s)return s.returnValue;n=!0}let o;try{o=yield this._invokeWorkspacePrepare(t)}catch(e){return this._onError(e,t)}const s=this._checkWorkspaceUndo(e,t,i,!0);if(s)return o.dispose(),s.returnValue;for(const e of i.editStacks)e.moveBackward(t);return this._safeInvokeWithLocks(t,(()=>t.actual.undo()),i,o,(()=>this._continueUndoInGroup(t.groupId,n)))}))}_resourceUndo(e,t,i){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,(n=>(e.moveBackward(t),this._safeInvokeWithLocks(t,(()=>t.actual.undo()),new UBe([e]),n,(()=>this._continueUndoInGroup(t.groupId,i))))));{const e=Toe(0,"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e)}}else e.flushAllElements()}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestPastElement();s&&s.groupId===e&&(!t||s.groupOrder>t.groupOrder)&&(t=s,i=n)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);return i?this._undo(i,0,t):void 0}undo(e){if(e instanceof uTe){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return"string"==typeof e?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const n=this._editStacks.get(e),o=n.getClosestPastElement();if(o){if(o.groupId){const[e,n]=this._findClosestUndoElementInGroup(o.groupId);if(o!==e&&n)return this._undo(n,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return 1===o.type?this._workspaceUndo(e,o,i):this._resourceUndo(n,o,i)}finally{}}}_confirmAndContinueUndo(e,t,i){return OBe(this,void 0,void 0,(function*(){if(1!==(yield this._dialogService.show(YAe.Info,Toe(0,"Would you like to undo '{0}'?",i.label),[Toe(0,"Yes"),Toe(0,"No")],{cancelId:1})).choice)return this._undo(e,t,!0)}))}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.sourceId===e&&(!t||s.sourceOrder<t.sourceOrder)&&(t=s,i=n)}return[t,i]}canRedo(e){if(e instanceof uTe){const[,t]=this._findClosestRedoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);return!!this._editStacks.has(t)&&this._editStacks.get(t).hasFutureElements()}_tryToSplitAndRedo(e,t,i,n){if(t.canSplit())return this._splitFutureWorkspaceElement(t,i),this._notificationService.warn(n),new qBe(this._redo(e));for(const e of t.strResources)this.removeElements(e);return this._notificationService.warn(n),new qBe}_checkWorkspaceRedo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndRedo(e,t,t.removedResources,Toe(0,"Could not redo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndRedo(e,t,t.invalidatedResources,Toe(0,"Could not redo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const e of i.editStacks)e.getClosestFutureElement()!==t&&o.push(e.resourceLabel);if(o.length>0)return this._tryToSplitAndRedo(e,t,null,Toe(0,"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const e of i.editStacks)e.locked&&s.push(e.resourceLabel);return s.length>0?this._tryToSplitAndRedo(e,t,null,Toe(0,"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,Toe(0,"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),n=this._checkWorkspaceRedo(e,t,i,!1);return n?n.returnValue:this._executeWorkspaceRedo(e,t,i)}_executeWorkspaceRedo(e,t,i){return OBe(this,void 0,void 0,(function*(){let n;try{n=yield this._invokeWorkspacePrepare(t)}catch(e){return this._onError(e,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return n.dispose(),o.returnValue;for(const e of i.editStacks)e.moveForward(t);return this._safeInvokeWithLocks(t,(()=>t.actual.redo()),i,n,(()=>this._continueRedoInGroup(t.groupId)))}))}_resourceRedo(e,t){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,(i=>(e.moveForward(t),this._safeInvokeWithLocks(t,(()=>t.actual.redo()),new UBe([e]),i,(()=>this._continueRedoInGroup(t.groupId))))));{const e=Toe(0,"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e)}}else e.flushAllElements()}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.groupId===e&&(!t||s.groupOrder<t.groupOrder)&&(t=s,i=n)}return[t,i]}_continueRedoInGroup(e){if(!e)return;const[,t]=this._findClosestRedoElementInGroup(e);return t?this._redo(t):void 0}redo(e){if(e instanceof uTe){const[,t]=this._findClosestRedoElementWithSource(e.id);return t?this._redo(t):void 0}return"string"==typeof e?this._redo(e):this._redo(this.getUriComparisonKey(e))}_redo(e){if(!this._editStacks.has(e))return;const t=this._editStacks.get(e),i=t.getClosestFutureElement();if(i){if(i.groupId){const[e,t]=this._findClosestRedoElementInGroup(i.groupId);if(i!==e&&t)return this._redo(t)}try{return 1===i.type?this._workspaceRedo(e,i):this._resourceRedo(t,i)}finally{}}}};jBe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([RBe(0,ABe),RBe(1,XAe)],jBe);class qBe{constructor(e){this.returnValue=e}}oge(hTe,jBe,1);const $Be=pce("openerService");function GBe(e,t){return Sle.isUri(e)?dde(e.scheme,t):cde(e,t+":")}function ZBe(e,...t){return t.some((t=>GBe(e,t)))}const YBe=pce("ILanguageFeatureDebounceService");var QBe;!function(e){const t=new WeakMap;let i=0;e.of=function(e){let n=t.get(e);return void 0===n&&(n=++i,t.set(e,n)),n}}(QBe||(QBe={}));class XBe{constructor(e,t,i,n,o,s){this._logService=e,this._name=t,this._registry=i,this._default=n,this._min=o,this._max=s,this._cache=new oOe(50,.7)}_key(e){return e.id+this._registry.all(e).reduce(((e,t)=>Mpe(QBe.of(t),e)),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?vPe(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let n=this._cache.get(i);n||(n=new wPe(6),this._cache.set(i,n));const o=vPe(n.update(t),this._min,this._max);return GBe(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new bPe;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){return vPe(0|this._overall()||this._default,this._min,this._max)}}let JBe=class{constructor(e){this._logService=e,this._data=new Map}for(e,t,i){var n,o,s;const r=null!==(n=null==i?void 0:i.min)&&void 0!==n?n:50,a=null!==(o=null==i?void 0:i.max)&&void 0!==o?o:Math.pow(r,2),l=null!==(s=null==i?void 0:i.key)&&void 0!==s?s:void 0,h=`${QBe.of(e)},${r}${l?","+l:""}`;let d=this._data.get(h);return d||(d=new XBe(this._logService,t,e,0|this._overallAverage()||1.5*r,r,a),this._data.set(h,d)),d}_overallAverage(){const e=new bPe;for(const t of this._data.values())e.update(t.default());return e.value}};JBe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,Gme)],JBe),oge(YBe,JBe,1);const eWe=pce("IWorkspaceEditService");class tWe{constructor(e){this.metadata=e}static convert(e){return e.edits.map((e=>{if(iWe.is(e))return iWe.lift(e);if(nWe.is(e))return nWe.lift(e);throw new Error("Unsupported edit")}))}}class iWe extends tWe{static is(e){return e instanceof iWe||jse(e)&&Sle.isUri(e.resource)&&jse(e.textEdit)}static lift(e){return e instanceof iWe?e:new iWe(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i}}class nWe extends tWe{static is(e){return e instanceof nWe||jse(e)&&(Boolean(e.newResource)||Boolean(e.oldResource))}static lift(e){return e instanceof nWe?e:new nWe(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},n){super(n),this.oldResource=e,this.newResource=t,this.options=i}}const oWe=Object.freeze({id:"editor",order:5,type:"object",title:Toe(0,"Editor"),scope:5}),sWe=Object.assign(Object.assign({},oWe),{properties:{"editor.tabSize":{type:"number",default:dre.tabSize,minimum:1,markdownDescription:Toe(0,"The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:Toe(0,'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:dre.insertSpaces,markdownDescription:Toe(0,"Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:dre.detectIndentation,markdownDescription:Toe(0,"Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:dre.trimAutoWhitespace,description:Toe(0,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:dre.largeFileOptimizations,description:Toe(0,"Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:Toe(0,"Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[Toe(0,"Only suggest words from the active document."),Toe(0,"Suggest words from all open documents of the same language."),Toe(0,"Suggest words from all open documents.")],description:Toe(0,"Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[Toe(0,"Semantic highlighting enabled for all color themes."),Toe(0,"Semantic highlighting disabled for all color themes."),Toe(0,"Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:Toe(0,"Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:Toe(0,"Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:Toe(0,"Lines above this length will not be tokenized for performance reasons")},"editor.language.brackets":{type:["array","null"],default:null,description:Toe(0,"Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:Toe(0,"The opening bracket character or string sequence.")},{type:"string",description:Toe(0,"The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:Toe(0,"Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:Toe(0,"The opening bracket character or string sequence.")},{type:"string",description:Toe(0,"The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:5e3,description:Toe(0,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:50,description:Toe(0,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:!0,description:Toe(0,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:!0,description:Toe(0,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:!0,description:Toe(0,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:!0,description:Toe(0,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:!1,description:Toe(0,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:"inherit",markdownEnumDescriptions:[Toe(0,"Lines will never wrap."),Toe(0,"Lines will wrap at the viewport width."),Toe(0,"Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["smart","experimental"],default:"smart",markdownEnumDescriptions:[Toe(0,"Uses the default diffing algorithm."),Toe(0,"Uses an experimental diffing algorithm.")]}}});function rWe(e){return void 0!==e.type||void 0!==e.anyOf}for(const e of Fre){const t=e.schema;if(void 0!==t)if(rWe(t))sWe.properties[`editor.${e.name}`]=t;else for(const e in t)Object.hasOwnProperty.call(t,e)&&(sWe.properties[e]=t[e])}let aWe=null;function lWe(){return null===aWe&&(aWe=Object.create(null),Object.keys(sWe.properties).forEach((e=>{aWe[e]=!0}))),aWe}rge.as(dge).registerConfiguration(sWe);class hWe{static insert(e,t){return{range:new Ole(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}function dWe(e){return Object.isFrozen(e)?e:function(e){if(!e||"object"!=typeof e)return e;const t=[e];for(;t.length>0;){const e=t.shift();Object.freeze(e);for(const i in e)if(ore.call(e,i)){const n=e[i];"object"!=typeof n||Object.isFrozen(n)||qse(n)||t.push(n)}}return e}(e)}class cWe{constructor(e={},t=[],i=[],n){this._contents=e,this._keys=t,this._overrides=i,this.raw=n,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(null===(e=this.raw)||void 0===e?void 0:e.length){const e=this.raw.map((e=>{if(e instanceof cWe)return e;const t=new uWe("");return t.parseRaw(e),t.configurationModel}));this._rawConfiguration=e.reduce(((e,t)=>t===e?t:e.merge(t)),e[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return 0===this._keys.length&&0===Object.keys(this._contents).length&&0===this._overrides.length}getValue(e){return e?ege(this.contents,e):this.contents}inspect(e,t){const i=this.rawConfiguration.getValue(e);return{value:i,override:t?this.rawConfiguration.getOverrideValue(e,t):void 0,merged:t?this.rawConfiguration.override(t).getValue(e):i}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?ege(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var t,i;const n=nre(this.contents),o=nre(this.overrides),s=[...this.keys],r=(null===(t=this.raw)||void 0===t?void 0:t.length)?[...this.raw]:[this];for(const t of e)if(r.push(...(null===(i=t.raw)||void 0===i?void 0:i.length)?t.raw:[t]),!t.isEmpty()){this.mergeContents(n,t.contents);for(const e of t.overrides){const[t]=o.filter((t=>Nse(t.identifiers,e.identifiers)));t?(this.mergeContents(t.contents,e.contents),t.keys.push(...e.keys),t.keys=Mse(t.keys)):o.push(nre(e))}for(const e of t.keys)-1===s.indexOf(e)&&s.push(e)}return new cWe(n,s,o,r.every((e=>e instanceof cWe))?void 0:r)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||"object"!=typeof t||!Object.keys(t).length)return this;const i={};for(const e of Mse([...Object.keys(this.contents),...Object.keys(t)])){let n=this.contents[e];const o=t[e];o&&("object"==typeof n&&"object"==typeof o?(n=nre(n),this.mergeContents(n,o)):n=o),i[e]=n}return new cWe(i,this.keys,this.overrides)}mergeContents(e,t){for(const i of Object.keys(t))i in e&&jse(e[i])&&jse(t[i])?this.mergeContents(e[i],t[i]):e[i]=nre(t[i])}getContentsForOverrideIdentifer(e){let t=null,i=null;const n=e=>{e&&(i?this.mergeContents(i,e):i=nre(e))};for(const i of this.overrides)Nse(i.identifiers,[e])?t=i.contents:i.identifiers.includes(e)&&n(i.contents);return n(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);-1!==t&&(this.keys.splice(t,1),Xue(this.contents,e),yge.test(e)&&this.overrides.splice(this.overrides.findIndex((t=>Nse(t.identifiers,Sge(e)))),1))}updateValue(e,t,i){Que(this.contents,e,t,(e=>console.error(e))),(i=i||-1===this.keys.indexOf(e))&&this.keys.push(e),yge.test(e)&&this.overrides.push({identifiers:Sge(e),keys:Object.keys(this.contents[e]),contents:Yue(this.contents[e],(e=>console.error(e)))})}}class uWe{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new cWe}parseRaw(e,t){this._raw=e;const{contents:i,keys:n,overrides:o,restricted:s,hasExcludedProperties:r}=this.doParseRaw(e,t);this._configurationModel=new cWe(i,n,o,r?[e]:void 0),this._restrictedConfigurations=s||[]}doParseRaw(e,t){const i=rge.as(dge).getConfigurationProperties(),n=this.filter(e,i,!0,t);return{contents:Yue(e=n.raw,(e=>console.error(`Conflict in settings file ${this._name}: ${e}`))),keys:Object.keys(e),overrides:this.toOverrides(e,(e=>console.error(`Conflict in settings file ${this._name}: ${e}`))),restricted:n.restricted,hasExcludedProperties:n.hasExcludedProperties}}filter(e,t,i,n){let o=!1;if(!(null==n?void 0:n.scopes)&&!(null==n?void 0:n.skipRestricted))return{raw:e,restricted:[],hasExcludedProperties:o};const s={},r=[];for(const a in e)if(yge.test(a)&&i){const i=this.filter(e[a],t,!1,n);s[a]=i.raw,o=o||i.hasExcludedProperties,r.push(...i.restricted)}else{const i=t[a],l=i?void 0!==i.scope?i.scope:3:void 0;(null==i?void 0:i.restricted)&&r.push(a),void 0!==l&&void 0!==n.scopes&&!n.scopes.includes(l)||n.skipRestricted&&(null==i?void 0:i.restricted)?o=!0:s[a]=e[a]}return{raw:s,restricted:r,hasExcludedProperties:o}}toOverrides(e,t){const i=[];for(const n of Object.keys(e))if(yge.test(n)){const o={};for(const t in e[n])o[t]=e[n][t];i.push({identifiers:Sge(n),keys:Object.keys(o),contents:Yue(o,t)})}return i}}class gWe{constructor(e,t,i,n,o,s,r,a,l,h,d,c,u){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=n,this.defaultConfiguration=o,this.policyConfiguration=s,this.applicationConfiguration=r,this.userConfiguration=a,this.localUserConfiguration=l,this.remoteUserConfiguration=h,this.workspaceConfiguration=d,this.folderConfigurationModel=c,this.memoryConfigurationModel=u}inspect(e,t,i){const n=e.inspect(t,i);return{get value(){return dWe(n.value)},get override(){return dWe(n.override)},get merged(){return dWe(n.merged)}}}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.inspect(this.userConfiguration,this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return void 0!==this.userInspectValue.value||void 0!==this.userInspectValue.override?{value:this.userInspectValue.value,override:this.userInspectValue.override}:void 0}}class pWe{constructor(e,t,i,n,o=new cWe,s=new cWe,r=new iOe,a=new cWe,l=new iOe){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=n,this._remoteUserConfiguration=o,this._workspaceConfiguration=s,this._folderConfigurations=r,this._memoryConfiguration=a,this._memoryConfigurationByResource=l,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new iOe,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let n;i.resource?(n=this._memoryConfigurationByResource.get(i.resource),n||(n=new cWe,this._memoryConfigurationByResource.set(i.resource,n))):n=this._memoryConfiguration,void 0===t?n.removeValue(e):n.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const n=this.getConsolidatedConfigurationModel(e,t,i),o=this.getFolderConfigurationModelForResource(t.resource,i),s=t.resource&&this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration,r=new Set;for(const t of n.overrides)for(const i of t.identifiers)void 0!==n.getOverrideValue(e,i)&&r.add(i);return new gWe(e,t,n.getValue(e),r.size?[...r]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,o||void 0,s)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let n=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(n=n.override(t.overrideIdentifier)),this._policyConfiguration.isEmpty()||void 0===this._policyConfiguration.getValue(e)||(n=n.merge(this._policyConfiguration)),n}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const n=t.getFolder(e);n&&(i=this.getFolderConsolidatedConfiguration(n.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),n=this._folderConfigurations.get(e);n?(t=i.merge(n),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce(((e,t)=>{const{contents:i,overrides:n,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n,keys:o}]),e}),[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),i=this.parseConfigurationModel(e.policy),n=this.parseConfigurationModel(e.application),o=this.parseConfigurationModel(e.user),s=this.parseConfigurationModel(e.workspace),r=e.folders.reduce(((e,t)=>(e.set(Sle.revive(t[0]),this.parseConfigurationModel(t[1])),e)),new iOe);return new pWe(t,i,n,o,new cWe,s,r,new cWe,new iOe)}static parseConfigurationModel(e){return new cWe(e.contents,e.keys,e.overrides)}}class mWe{constructor(e,t,i,n){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,this._marker="\n",this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const t of e.keys)this.affectedKeys.add(t);for(const[,t]of e.overrides)for(const e of t)this.affectedKeys.add(e);this._affectsConfigStr=this._marker;for(const e of this.affectedKeys)this._affectsConfigStr+=e+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=pWe.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var i;const n=this._marker+e,o=this._affectsConfigStr.indexOf(n);if(o<0)return!1;const s=o+n.length;if(s>=this._affectsConfigStr.length)return!1;const r=this._affectsConfigStr.charCodeAt(s);return(r===this._markerCode1||r===this._markerCode2)&&(!t||!lre(this.previousConfiguration?this.previousConfiguration.getValue(e,t,null===(i=this.previous)||void 0===i?void 0:i.workspace):void 0,this.currentConfiguraiton.getValue(e,t,this.currentWorkspace)))}}const fWe=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class _We extends aae{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:pae.None}constructor(e,t,i,n,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=o,this._onDidUpdateKeybindings=this._register(new bae),this._currentChord=null,this._currentChordChecker=new lpe,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=vWe.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new ape,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),null;const[n]=i.getDispatchChords();if(null===n)return this._log("\\ Keyboard event cannot be dispatched"),null;const o=this._contextKeyService.getContext(t),s=this._currentChord?this._currentChord.keypress:null;return this._getResolver().resolve(o,s,n)}_enterMultiChordMode(e,t){this._currentChord={keypress:e,label:t},this._currentChordStatusMessage=this._notificationService.status(Toe(0,"({0}) was pressed. Waiting for second key of chord...",t));const i=Date.now();this._currentChordChecker.cancelAndSet((()=>{this._documentHasFocus()?Date.now()-i>5e3&&this._leaveChordMode():this._leaveChordMode()}),500),lxe.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChord=null,lxe.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[n]=i.getSingleModifierDispatchChords();if(n)return this._ignoreSingleModifiers.has(n)?(this._log(`+ Ignoring single modifier ${n} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=vWe.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=vWe.EMPTY,null===this._currentSingleModifier?(this._log(`+ Storing single modifier for possible chord ${n}.`),this._currentSingleModifier=n,this._currentSingleModifierClearTimeout.cancelAndSet((()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null}),300),!1):n===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${n} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new vWe(o),null!==this._currentSingleModifier&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){let n=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let o=null,s=null;if(i){const[t]=e.getSingleModifierDispatchChords();o=t,s=t}else[o]=e.getDispatchChords(),s=this._currentChord?this._currentChord.keypress:null;if(null===o)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),n;const r=this._contextKeyService.getContext(t),a=e.getLabel(),l=this._getResolver().resolve(r,s,o);return this._logService.trace("KeybindingService#dispatch",a,null==l?void 0:l.commandId),l&&l.enterMultiChord?(n=!0,this._enterMultiChordMode(o,a),this._log("+ Entering chord mode..."),n):(this._currentChord&&(l&&l.commandId||(this._log(`+ Leaving chord mode: Nothing bound to "${this._currentChord.label} ${a}".`),this._notificationService.status(Toe(0,"The key combination ({0}, {1}) is not a command.",this._currentChord.label,a),{hideAfter:1e4}),n=!0)),this._leaveChordMode(),l&&l.commandId&&(l.bubble||(n=!0),this._log(`+ Invoking command ${l.commandId}.`),void 0===l.commandArgs?this._commandService.executeCommand(l.commandId).then(void 0,(e=>this._notificationService.warn(e))):this._commandService.executeCommand(l.commandId,l.commandArgs).then(void 0,(e=>this._notificationService.warn(e))),fWe.test(l.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:l.commandId,from:"keybinding"})),n)}mightProducePrintableCharacter(e){return!e.ctrlKey&&!e.metaKey&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30)}}class vWe{constructor(e){this._ctrlKey=!!e&&e.ctrlKey,this._shiftKey=!!e&&e.shiftKey,this._altKey=!!e&&e.altKey,this._metaKey=!!e&&e.metaKey}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}vWe.EMPTY=new vWe(null);const bWe=pce("keybindingService");class wWe{constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const t of e){const e=t.command;e&&"-"!==e.charAt(0)&&this._defaultBoundCommands.set(e,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=wWe.handleRemovals([].concat(e).concat(t));for(let e=0,t=this._keybindings.length;e<t;e++){const t=this._keybindings[e];0!==t.chords.length&&(t.when&&0===t.when.type||this._addKeyPress(t.chords[0],t))}}static _isTargetedForRemoval(e,t,i,n){if(t&&e.chords[0]!==t)return!1;if(i&&e.chords[1]!==i)return!1;if(n&&1!==n.type){if(!e.when)return!1;if(!function(e,t){const i=e?e.substituteConstants():void 0,n=t?t.substituteConstants():void 0;return!i&&!n||!(!i||!n)&&i.equals(n)}(n,e.when))return!1}return!0}static handleRemovals(e){const t=new Map;for(let i=0,n=e.length;i<n;i++){const n=e[i];if(n.command&&"-"===n.command.charAt(0)){const e=n.command.substring(1);t.has(e)?t.get(e).push(n):t.set(e,[n])}}if(0===t.size)return e;const i=[];for(let n=0,o=e.length;n<o;n++){const o=e[n];if(!o.command||0===o.command.length){i.push(o);continue}if("-"===o.command.charAt(0))continue;const s=t.get(o.command);if(!s||!o.isDefault){i.push(o);continue}let r=!1;for(const e of s){const t=e.chords[0],i=e.chords[1],n=e.when;if(this._isTargetedForRemoval(o,t,i,n)){r=!0;break}}r||i.push(o)}return i}_addKeyPress(e,t){const i=this._map.get(e);if(void 0===i)return this._map.set(e,[t]),void this._addToLookupMap(t);for(let e=i.length-1;e>=0;e--){const n=i[e];if(n.command===t.command)continue;const o=n.chords.length>1,s=t.chords.length>1;o&&s&&n.chords[1]!==t.chords[1]||wWe.whenIsEntirelyIncluded(n.when,t.when)&&this._removeFromLookupMap(n)}i.push(t),this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);void 0===t?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(void 0!==t)for(let i=0,n=t.length;i<n;i++)if(t[i]===e)return void t.splice(i,1)}static whenIsEntirelyIncluded(e,t){return!t||1===t.type||!(!e||1===e.type)&&Zce(e,t)}getKeybindings(){return this._keybindings}lookupPrimaryKeybinding(e,t){const i=this._lookupMap.get(e);if(void 0===i||0===i.length)return null;if(1===i.length)return i[0];for(let e=i.length-1;e>=0;e--){const n=i[e];if(t.contextMatchesRules(n.when))return n}return i[i.length-1]}resolve(e,t,i){this._log(`| Resolving ${i}${t?` chorded from ${t}`:""}`);let n=null;if(null!==t){const e=this._map.get(t);if(void 0===e)return this._log("\\ No keybinding entries."),null;n=[];for(let t=0,o=e.length;t<o;t++){const o=e[t];o.chords[1]===i&&n.push(o)}}else{const e=this._map.get(i);if(void 0===e)return this._log("\\ No keybinding entries."),null;n=e}const o=this._findCommand(e,n);return o?null===t&&o.chords.length>1&&null!==o.chords[1]?(this._log(`\\ From ${n.length} keybinding entries, matched chord, when: ${CWe(o.when)}, source: ${yWe(o)}.`),{enterMultiChord:!0,leaveMultiChord:!1,commandId:null,commandArgs:null,bubble:!1}):(this._log(`\\ From ${n.length} keybinding entries, matched ${o.command}, when: ${CWe(o.when)}, source: ${yWe(o)}.`),{enterMultiChord:!1,leaveMultiChord:o.chords.length>1,commandId:o.command,commandArgs:o.commandArgs,bubble:o.bubble}):(this._log(`\\ From ${n.length} keybinding entries, no when clauses matched the context.`),null)}_findCommand(e,t){for(let i=t.length-1;i>=0;i--){const n=t[i];if(wWe._contextMatchesRules(e,n.when))return n}return null}static _contextMatchesRules(e,t){return!t||t.evaluate(e)}}function CWe(e){return e?`${e.serialize()}`:"no when condition"}function yWe(e){return e.extensionId?e.isBuiltinExtension?`built-in extension ${e.extensionId}`:`user extension ${e.extensionId}`:e.isDefault?"built-in":"user"}class SWe{constructor(e,t,i,n,o,s,r){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?kWe(e.getDispatchChords()):[],e&&0===this.chords.length&&(this.chords=kWe(e.getSingleModifierDispatchChords())),this.bubble=!!t&&94===t.charCodeAt(0),this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=n,this.isDefault=o,this.extensionId=s,this.isBuiltinExtension=r}}function kWe(e){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n)return[];t.push(n)}return t}class LWe{constructor(e,t,i=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=i}toLabel(e,t,i){if(0===t.length)return null;const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=i(s);if(null===r)return null;n[o]=NWe(s,r,this.modifierLabels[e])}return n.join(" ")}}const xWe=new LWe({ctrlKey:"⌃",shiftKey:"⇧",altKey:"⌥",metaKey:"⌘",separator:""},{ctrlKey:Toe(0,"Ctrl"),shiftKey:Toe(0,"Shift"),altKey:Toe(0,"Alt"),metaKey:Toe(0,"Windows"),separator:"+"},{ctrlKey:Toe(0,"Ctrl"),shiftKey:Toe(0,"Shift"),altKey:Toe(0,"Alt"),metaKey:Toe(0,"Super"),separator:"+"}),DWe=new LWe({ctrlKey:Toe(0,"Control"),shiftKey:Toe(0,"Shift"),altKey:Toe(0,"Option"),metaKey:Toe(0,"Command"),separator:"+"},{ctrlKey:Toe(0,"Control"),shiftKey:Toe(0,"Shift"),altKey:Toe(0,"Alt"),metaKey:Toe(0,"Windows"),separator:"+"},{ctrlKey:Toe(0,"Control"),shiftKey:Toe(0,"Shift"),altKey:Toe(0,"Alt"),metaKey:Toe(0,"Super"),separator:"+"}),EWe=new LWe({ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Cmd",separator:"+"},{ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Super",separator:"+"});function NWe(e,t,i){if(null===t)return"";const n=[];return e.ctrlKey&&n.push(i.ctrlKey),e.shiftKey&&n.push(i.shiftKey),e.altKey&&n.push(i.altKey),e.metaKey&&n.push(i.metaKey),""!==t&&n.push(t),n.join(i.separator)}new LWe({ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"cmd",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"win",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"meta",separator:"+"});class IWe extends c_e{constructor(e,t){if(super(),0===t.length)throw $re("chords");this._os=e,this._chords=t}getLabel(){return xWe.toLabel(this._os,this._chords,(e=>this._getLabel(e)))}getAriaLabel(){return DWe.toLabel(this._os,this._chords,(e=>this._getAriaLabel(e)))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:EWe.toLabel(this._os,this._chords,(e=>this._getElectronAccelerator(e)))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map((e=>this._getChord(e)))}_getChord(e){return new d_e(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map((e=>this._getChordDispatch(e)))}getSingleModifierDispatchChords(){return this._chords.map((e=>this._getSingleModifierChordDispatch(e)))}}class MWe extends IWe{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(2===this._os)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return Uae.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Uae.toString(e.keyCode)}_getElectronAccelerator(e){return Uae.toElectronAccelerator(e.keyCode)}_getChordDispatch(e){return MWe.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=Uae.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return 5!==e.keyCode||e.shiftKey||e.altKey||e.metaKey?4!==e.keyCode||e.ctrlKey||e.altKey||e.metaKey?6!==e.keyCode||e.ctrlKey||e.shiftKey||e.metaKey?57!==e.keyCode||e.ctrlKey||e.shiftKey||e.altKey?null:"meta":"alt":"shift":"ctrl"}static _scanCodeToKeyCode(e){const t=zae[e];if(-1!==t)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 83;case 52:return 81;case 53:return 87;case 54:return 89;case 55:return 88;case 56:return 0;case 57:return 80;case 58:return 90;case 59:return 86;case 60:return 82;case 61:return 84;case 62:return 85;case 106:return 92}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof l_e)return e;const t=this._scanCodeToKeyCode(e.scanCode);return 0===t?null:new l_e(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=kWe(e.chords.map((e=>this._toKeyCodeChord(e))));return i.length>0?[new MWe(i,t)]:[]}}const TWe=pce("labelService");class AWe{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(e){return e.charCodeAt(0)-this._value.charCodeAt(this._pos)}value(){return this._value[this._pos]}}class RWe{constructor(e=!0){this._caseSensitive=e}reset(e){return this._value=e,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let e=!0;for(;this._to<this._value.length;this._to++)if(46===this._value.charCodeAt(this._to)){if(!e)break;this._from++}else e=!1;return this}cmp(e){return this._caseSensitive?ode(e,this._value,0,e.length,this._from,this._to):rde(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class OWe{constructor(e=!0,t=!0){this._splitOnBackslash=e,this._caseSensitive=t}reset(e){this._from=0,this._to=0,this._value=e,this._valueLen=e.length;for(let t=e.length-1;t>=0;t--,this._valueLen--){const e=this._value.charCodeAt(t);if(!(47===e||this._splitOnBackslash&&92===e))break}return this.next()}hasNext(){return this._to<this._valueLen}next(){this._from=this._to;let e=!0;for(;this._to<this._valueLen;this._to++){const t=this._value.charCodeAt(this._to);if(47===t||this._splitOnBackslash&&92===t){if(!e)break;this._from++}else e=!1}return this}cmp(e){return this._caseSensitive?ode(e,this._value,0,e.length,this._from,this._to):rde(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class PWe{constructor(e,t){this._ignorePathCasing=e,this._ignoreQueryAndFragment=t,this._states=[],this._stateIdx=0}reset(e){return this._value=e,this._states=[],this._value.scheme&&this._states.push(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new OWe(!1,!this._ignorePathCasing(e)),this._pathIterator.reset(e.path),this._pathIterator.value()&&this._states.push(3)),this._ignoreQueryAndFragment(e)||(this._value.query&&this._states.push(4),this._value.fragment&&this._states.push(5)),this._stateIdx=0,this}next(){return 3===this._states[this._stateIdx]&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return 3===this._states[this._stateIdx]&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(e){if(1===this._states[this._stateIdx])return sde(e,this._value.scheme);if(2===this._states[this._stateIdx])return sde(e,this._value.authority);if(3===this._states[this._stateIdx])return this._pathIterator.cmp(e);if(4===this._states[this._stateIdx])return nde(e,this._value.query);if(5===this._states[this._stateIdx])return nde(e,this._value.fragment);throw new Error}value(){if(1===this._states[this._stateIdx])return this._value.scheme;if(2===this._states[this._stateIdx])return this._value.authority;if(3===this._states[this._stateIdx])return this._pathIterator.value();if(4===this._states[this._stateIdx])return this._value.query;if(5===this._states[this._stateIdx])return this._value.fragment;throw new Error}}class FWe{constructor(){this.height=1}rotateLeft(){const e=this.right;return this.right=e.left,e.left=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){const e=this.left;return this.left=e.right,e.right=this,this.updateHeight(),e.updateHeight(),e}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){var e,t;return null!==(t=null===(e=this.left)||void 0===e?void 0:e.height)&&void 0!==t?t:0}get heightRight(){var e,t;return null!==(t=null===(e=this.right)||void 0===e?void 0:e.height)&&void 0!==t?t:0}}class BWe{static forUris(e=(()=>!1),t=(()=>!1)){return new BWe(new PWe(e,t))}static forStrings(){return new BWe(new AWe)}static forConfigKeys(){return new BWe(new RWe)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let n;this._root||(this._root=new FWe,this._root.segment=i.value());const o=[];for(n=this._root;;){const e=i.cmp(n.segment);if(e>0)n.left||(n.left=new FWe,n.left.segment=i.value()),o.push([-1,n]),n=n.left;else if(e<0)n.right||(n.right=new FWe,n.right.segment=i.value()),o.push([1,n]),n=n.right;else{if(!i.hasNext())break;i.next(),n.mid||(n.mid=new FWe,n.mid.segment=i.value()),o.push([0,n]),n=n.mid}}const s=n.value;n.value=t,n.key=e;for(let e=o.length-1;e>=0;e--){const t=o[e][1];t.updateHeight();const i=t.balanceFactor();if(i<-1||i>1){const i=o[e][0],n=o[e+1][0];if(1===i&&1===n)o[e][1]=t.rotateLeft();else if(-1===i&&-1===n)o[e][1]=t.rotateRight();else if(1===i&&-1===n)t.right=o[e+1][1]=o[e+1][1].rotateRight(),o[e][1]=t.rotateLeft();else{if(-1!==i||1!==n)throw new Error;t.left=o[e+1][1]=o[e+1][1].rotateLeft(),o[e][1]=t.rotateRight()}if(e>0)switch(o[e-1][0]){case-1:o[e-1][1].left=o[e][1];break;case 1:o[e-1][1].right=o[e][1];break;case 0:o[e-1][1].mid=o[e][1]}else this._root=o[0][1]}}return s}get(e){var t;return null===(t=this._getNode(e))||void 0===t?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const e=t.cmp(i.segment);if(e>0)i=i.left;else if(e<0)i=i.right;else{if(!t.hasNext())break;t.next(),i=i.mid}}return i}has(e){const t=this._getNode(e);return!(void 0===(null==t?void 0:t.value)&&void 0===(null==t?void 0:t.mid))}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var i;const n=this._iter.reset(e),o=[];let s=this._root;for(;s;){const e=n.cmp(s.segment);if(e>0)o.push([-1,s]),s=s.left;else if(e<0)o.push([1,s]),s=s.right;else{if(!n.hasNext())break;n.next(),o.push([0,s]),s=s.mid}}if(s){if(t?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){const e=this._min(s.right);if(e.key){const{key:t,value:i,segment:n}=e;this._delete(e.key,!1),s.key=t,s.value=i,s.segment=n}}else{const e=null!==(i=s.left)&&void 0!==i?i:s.right;if(o.length>0){const[t,i]=o[o.length-1];switch(t){case-1:i.left=e;break;case 0:i.mid=e;break;case 1:i.right=e}}else this._root=e}for(let e=o.length-1;e>=0;e--){const t=o[e][1];t.updateHeight();const i=t.balanceFactor();if(i>1?(t.right.balanceFactor()>=0||(t.right=t.right.rotateRight()),o[e][1]=t.rotateLeft()):i<-1&&(t.left.balanceFactor()<=0||(t.left=t.left.rotateLeft()),o[e][1]=t.rotateRight()),e>0)switch(o[e-1][0]){case-1:o[e-1][1].left=o[e][1];break;case 1:o[e-1][1].right=o[e][1];break;case 0:o[e-1][1].mid=o[e][1]}else this._root=o[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i,n=this._root;for(;n;){const e=t.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else{if(!t.hasNext())break;t.next(),i=n.value||i,n=n.mid}}return n&&n.value||i}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let n=this._root;for(;n;){const e=i.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else{if(!i.hasNext())return n.mid?this._entries(n.mid):t?n.value:void 0;i.next(),n=n.mid}}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value&&t.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const WWe=pce("contextService");class VWe{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}var zWe,HWe,UWe,KWe,jWe,qWe,$We,GWe,ZWe;Toe(0,"Code Workspace"),function(e){e.noSelection=Toe(0,"No selection"),e.singleSelectionRange=Toe(0,"Line {0}, Column {1} ({2} selected)"),e.singleSelection=Toe(0,"Line {0}, Column {1}"),e.multiSelectionRange=Toe(0,"{0} selections ({1} characters selected)"),e.multiSelection=Toe(0,"{0} selections"),e.emergencyConfOn=Toe(0,"Now changing the setting `accessibilitySupport` to 'on'."),e.openingDocs=Toe(0,"Now opening the Editor Accessibility documentation page."),e.readonlyDiffEditor=Toe(0," in a read-only pane of a diff editor."),e.editableDiffEditor=Toe(0," in a pane of a diff editor."),e.readonlyEditor=Toe(0," in a read-only code editor"),e.editableEditor=Toe(0," in a code editor"),e.changeConfigToOnMac=Toe(0,"To configure the editor to be optimized for usage with a Screen Reader press Command+E now."),e.changeConfigToOnWinLinux=Toe(0,"To configure the editor to be optimized for usage with a Screen Reader press Control+E now."),e.auto_on=Toe(0,"The editor is configured to be optimized for usage with a Screen Reader."),e.auto_off=Toe(0,"The editor is configured to never be optimized for usage with a Screen Reader, which is not the case at this time."),e.tabFocusModeOnMsg=Toe(0,"Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior by pressing {0}."),e.tabFocusModeOnMsgNoKb=Toe(0,"Pressing Tab in the current editor will move focus to the next focusable element. The command {0} is currently not triggerable by a keybinding."),e.tabFocusModeOffMsg=Toe(0,"Pressing Tab in the current editor will insert the tab character. Toggle this behavior by pressing {0}."),e.tabFocusModeOffMsgNoKb=Toe(0,"Pressing Tab in the current editor will insert the tab character. The command {0} is currently not triggerable by a keybinding."),e.openDocMac=Toe(0,"Press Command+H now to open a browser window with more information related to editor accessibility."),e.openDocWinLinux=Toe(0,"Press Control+H now to open a browser window with more information related to editor accessibility."),e.outroMsg=Toe(0,"You can dismiss this tooltip and return to the editor by pressing Escape or Shift+Escape."),e.showAccessibilityHelpAction=Toe(0,"Show Accessibility Help")}(zWe||(zWe={})),function(e){e.inspectTokensAction=Toe(0,"Developer: Inspect Tokens")}(HWe||(HWe={})),function(e){e.gotoLineActionLabel=Toe(0,"Go to Line/Column...")}(UWe||(UWe={})),function(e){e.helpQuickAccessActionLabel=Toe(0,"Show all Quick Access Providers")}(KWe||(KWe={})),function(e){e.quickCommandActionLabel=Toe(0,"Command Palette"),e.quickCommandHelp=Toe(0,"Show And Run Commands")}(jWe||(jWe={})),function(e){e.quickOutlineActionLabel=Toe(0,"Go to Symbol..."),e.quickOutlineByCategoryActionLabel=Toe(0,"Go to Symbol by Category...")}(qWe||(qWe={})),function(e){e.editorViewAccessibleLabel=Toe(0,"Editor content"),e.accessibilityHelpMessage=Toe(0,"Press Alt+F1 for Accessibility Options.")}($We||($We={})),function(e){e.toggleHighContrast=Toe(0,"Toggle High Contrast Theme")}(GWe||(GWe={})),function(e){e.bulkEditServiceSummary=Toe(0,"Made {0} edits in {1} files")}(ZWe||(ZWe={}));const YWe=pce("workspaceTrustManagementService");var QWe,XWe=i(4979),JWe={};function eVe(e,t,i){const n=i.mode===QWe.ALIGN?i.offset:i.offset+i.size,o=i.mode===QWe.ALIGN?i.offset+i.size:i.offset;return 0===i.position?t<=e-n?n:t<=o?o-t:Math.max(e-t,0):t<=o?o-t:t<=e-n?n:0}JWe.styleTagTransform=Vr(),JWe.setAttributes=Pr(),JWe.insert=Rr().bind(null,"head"),JWe.domAPI=Tr(),JWe.insertStyleElement=Br(),Ir()(XWe.Z,JWe),XWe.Z&&XWe.Z.locals&&XWe.Z.locals,function(e){e[e.AVOID=0]="AVOID",e[e.ALIGN=1]="ALIGN"}(QWe||(QWe={}));class tVe extends aae{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=aae.None,this.toDisposeOnSetContainer=aae.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=sbe(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,abe(this.view),this.setContainer(e,t),this._register(sae((()=>this.setContainer(null,1))))}setContainer(e,t){var i;if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,null===(i=this.shadowRootHostElement)||void 0===i||i.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e){if(this.container=e,this.useFixedPosition=1!==t,this.useShadowDOM=3===t,this.useShadowDOM){this.shadowRootHostElement=sbe(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=iVe,this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(sbe("slot"))}else this.container.appendChild(this.view);const i=new rae;tVe.BUBBLE_UP_EVENTS.forEach((e=>{i.add(xve(this.container,e,(e=>{this.onDOMEvent(e,!1)})))})),tVe.BUBBLE_DOWN_EVENTS.forEach((e=>{i.add(xve(this.container,e,(e=>{this.onDOMEvent(e,!0)}),!0))})),this.toDisposeOnSetContainer=i}}show(e){var t,i;this.isVisible()&&this.hide(),yve(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2575",this.view.style.position=this.useFixedPosition?"fixed":"absolute",rbe(this.view),this.toDisposeOnClean=e.render(this.view)||aae.None,this.delegate=e,this.doLayout(),null===(i=(t=this.delegate).focus)||void 0===i||i.call(t)}getViewElement(){return this.view}layout(){this.isVisible()&&(!1!==this.delegate.canRelayout||rse&&s_e?(this.delegate.layout&&this.delegate.layout(),this.doLayout()):this.hide())}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(Zve(e)){const i=Rve(e),n=function(e){let t=e,i=1;do{const e=Ive(t).zoom;null!=e&&"1"!==e&&(i*=e),t=t.parentElement}while(null!==t&&t!==document.documentElement);return i}(e);t={top:i.top*n,left:i.left*n,width:i.width*n,height:i.height*n}}else t={top:e.y,left:e.x,width:e.width||1,height:e.height||2};const i=Ove(this.view),n=Bve(this.view),o=this.delegate.anchorPosition||0,s=this.delegate.anchorAlignment||0;let r,a;if(0===(this.delegate.anchorAxisAlignment||0)){const e={offset:t.top-window.pageYOffset,size:t.height,position:0===o?0:1},l={offset:t.left,size:t.width,position:0===s?0:1,mode:QWe.ALIGN};r=eVe(window.innerHeight,n,e)+window.pageYOffset,CPe.intersects({start:r,end:r+n},{start:e.offset,end:e.offset+e.size})&&(l.mode=QWe.AVOID),a=eVe(window.innerWidth,i,l)}else{const e={offset:t.left,size:t.width,position:0===s?0:1},l={offset:t.top,size:t.height,position:0===o?0:1,mode:QWe.ALIGN};a=eVe(window.innerWidth,i,e),CPe.intersects({start:a,end:a+i},{start:e.offset,end:e.offset+e.size})&&(l.mode=QWe.AVOID),r=eVe(window.innerHeight,n,l)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(0===o?"bottom":"top"),this.view.classList.add(0===s?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const l=Rve(this.container);this.view.style.top=r-(this.useFixedPosition?Rve(this.view).top:l.top)+"px",this.view.style.left=a-(this.useFixedPosition?Rve(this.view).left:l.left)+"px",this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,(null==t?void 0:t.onHide)&&t.onHide(e),this.toDisposeOnClean.dispose(),abe(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!Wve(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}tVe.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],tVe.BUBBLE_DOWN_EVENTS=["click"];const iVe='\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t.codicon[class*=\'codicon-\'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }\n\n\t:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }\n';let nVe=class extends aae{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=aae.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new tVe(this.container,1)),this.layout(),this._register(e.onDidLayout((()=>this.layout())))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,i){t?t===this.container&&this.shadowRoot===i||(this.container=t,this.setContainer(t,i?3:2)):this.layoutService.hasContainer&&this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.shadowRoot=i,this.contextView.show(e);const n=sae((()=>{this.currentViewDisposable===n&&this.hideContextView()}));return this.currentViewDisposable=n,n}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};nVe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,EBe)],nVe);var oVe=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const sVe="**",rVe="/",aVe="[/\\\\]",lVe="[^/\\\\]",hVe=/\//g;function dVe(e,t){switch(e){case 0:return"";case 1:return`${lVe}*?`;default:return`(?:${aVe}|${lVe}+${aVe}${t?`|${aVe}${lVe}+`:""})*?`}}function cVe(e,t){if(!e)return[];const i=[];let n=!1,o=!1,s="";for(const r of e){switch(r){case t:if(!n&&!o){i.push(s),s="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1}s+=r}return s&&i.push(s),i}function uVe(e){if(!e)return"";let t="";const i=cVe(e,rVe);if(i.every((e=>e===sVe)))t=".*";else{let e=!1;i.forEach(((n,o)=>{if(n===sVe){if(e)return;t+=dVe(2,o===i.length-1)}else{let e=!1,s="",r=!1,a="";for(const i of n)if("}"!==i&&e)s+=i;else if(!r||"]"===i&&a)switch(i){case"{":e=!0;continue;case"[":r=!0;continue;case"}":{const i=`(?:${cVe(s,",").map((e=>uVe(e))).join("|")})`;t+=i,e=!1,s="";break}case"]":t+="["+a+"]",r=!1,a="";break;case"?":t+=lVe;continue;case"*":t+=dVe(1);continue;default:t+=Zhe(i)}else{let e;e="-"===i?i:"^"!==i&&"!"!==i||a?i===rVe?"":Zhe(i):"^",a+=e}o<i.length-1&&(i[o+1]!==sVe||o+2<i.length)&&(t+=aVe)}e=n===sVe}))}return t}const gVe=/^\*\*\/\*\.[\w\.-]+$/,pVe=/^\*\*\/([\w\.-]+)\/?$/,mVe=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,fVe=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,_Ve=/^\*\*((\/[\w\.-]+)+)\/?$/,vVe=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,bVe=new oOe(1e4),wVe=function(){return!1},CVe=function(){return null};function yVe(e,t){if(!e)return CVe;let i;i="string"!=typeof e?e.pattern:e,i=i.trim();const n=`${i}_${!!t.trimForExclusions}`;let o,s=bVe.get(n);return s||(s=gVe.test(i)?function(e,t){return function(i,n){return"string"==typeof i&&i.endsWith(e)?t:null}}(i.substr(4),i):(o=pVe.exec(SVe(i,t)))?function(e,t){const i=`/${e}`,n=`\\${e}`,o=function(o,s){return"string"!=typeof o?null:s?s===e?t:null:o===e||o.endsWith(i)||o.endsWith(n)?t:null},s=[e];return o.basenames=s,o.patterns=[t],o.allBasenames=s,o}(o[1],i):(t.trimForExclusions?fVe:mVe).test(i)?function(e,t){const i=xVe(e.slice(1,-1).split(",").map((e=>yVe(e,t))).filter((e=>e!==CVe)),e),n=i.length;if(!n)return CVe;if(1===n)return i[0];const o=function(t,n){for(let o=0,s=i.length;o<s;o++)if(i[o](t,n))return e;return null},s=i.find((e=>!!e.allBasenames));s&&(o.allBasenames=s.allBasenames);const r=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);return r.length&&(o.allPaths=r),o}(i,t):(o=_Ve.exec(SVe(i,t)))?kVe(o[1].substr(1),i,!0):(o=vVe.exec(SVe(i,t)))?kVe(o[1],i,!1):function(e){try{const t=new RegExp(`^${uVe(e)}$`);return function(i){return t.lastIndex=0,"string"==typeof i&&t.test(i)?e:null}}catch(e){return CVe}}(i),bVe.set(n,s)),function(e,t){if("string"==typeof t)return e;const i=function(i,n){return EIe(i,t.base,!ise)?e(Yhe(i.substr(t.base.length),mle),n):null};return i.allBasenames=e.allBasenames,i.allPaths=e.allPaths,i.basenames=e.basenames,i.patterns=e.patterns,i}(s,e)}function SVe(e,t){return t.trimForExclusions&&e.endsWith("/**")?e.substr(0,e.length-2):e}function kVe(e,t,i){const n=mle===lle.sep,o=n?e:e.replace(hVe,mle),s=mle+o,r=lle.sep+e;let a;return a=i?function(i,a){return"string"!=typeof i||i!==o&&!i.endsWith(s)&&(n||i!==e&&!i.endsWith(r))?null:t}:function(i,s){return"string"!=typeof i||i!==o&&(n||i!==e)?null:t},a.allPaths=[(i?"*/":"./")+e],a}function LVe(e,t={}){if(!e)return wVe;if("string"==typeof e||function(e){const t=e;return!!t&&("string"==typeof t.base&&"string"==typeof t.pattern)}(e)){const i=yVe(e,t);if(i===CVe)return wVe;const n=function(e,t){return!!i(e,t)};return i.allBasenames&&(n.allBasenames=i.allBasenames),i.allPaths&&(n.allPaths=i.allPaths),n}return function(e,t){const i=xVe(Object.getOwnPropertyNames(e).map((i=>function(e,t,i){if(!1===t)return CVe;const n=yVe(e,i);if(n===CVe)return CVe;if("boolean"==typeof t)return n;if(t){const i=t.when;if("string"==typeof i){const t=(t,o,s,r)=>{if(!r||!n(t,o))return null;const a=r(i.replace("$(basename)",(()=>s)));return epe(a)?a.then((t=>t?e:null)):a?e:null};return t.requiresSiblings=!0,t}}return n}(i,e[i],t))).filter((e=>e!==CVe))),n=i.length;if(!n)return CVe;if(!i.some((e=>!!e.requiresSiblings))){if(1===n)return i[0];const e=function(e,t){let n;for(let o=0,s=i.length;o<s;o++){const s=i[o](e,t);if("string"==typeof s)return s;epe(s)&&(n||(n=[]),n.push(s))}return n?(()=>oVe(this,void 0,void 0,(function*(){for(const e of n){const t=yield e;if("string"==typeof t)return t}return null})))():null},t=i.find((e=>!!e.allBasenames));t&&(e.allBasenames=t.allBasenames);const o=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);return o.length&&(e.allPaths=o),e}const o=function(e,t,n){let o,s;for(let r=0,a=i.length;r<a;r++){const a=i[r];a.requiresSiblings&&n&&(t||(t=gle(e)),o||(o=t.substr(0,t.length-ple(e).length)));const l=a(e,t,o,n);if("string"==typeof l)return l;epe(l)&&(s||(s=[]),s.push(l))}return s?(()=>oVe(this,void 0,void 0,(function*(){for(const e of s){const t=yield e;if("string"==typeof t)return t}return null})))():null},s=i.find((e=>!!e.allBasenames));s&&(o.allBasenames=s.allBasenames);const r=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);return r.length&&(o.allPaths=r),o}(e,t)}function xVe(e,t){const i=e.filter((e=>!!e.basenames));if(i.length<2)return e;const n=i.reduce(((e,t)=>{const i=t.basenames;return i?e.concat(i):e}),[]);let o;if(t){o=[];for(let e=0,i=n.length;e<i;e++)o.push(t)}else o=i.reduce(((e,t)=>{const i=t.patterns;return i?e.concat(i):e}),[]);const s=function(e,t){if("string"!=typeof e)return null;if(!t){let i;for(i=e.length;i>0;i--){const t=e.charCodeAt(i-1);if(47===t||92===t)break}t=e.substr(i)}const i=n.indexOf(t);return-1!==i?o[i]:null};s.basenames=n,s.patterns=o,s.allBasenames=n;const r=e.filter((e=>!e.basenames));return r.push(s),r}let DVe=[],EVe=[],NVe=[];function IVe(e,t=!1){!function(e,t,i){const n=function(e,t){return{id:e.id,mime:e.mime,filename:e.filename,extension:e.extension,filepattern:e.filepattern,firstline:e.firstline,userConfigured:false,filenameLowercase:e.filename?e.filename.toLowerCase():void 0,extensionLowercase:e.extension?e.extension.toLowerCase():void 0,filepatternLowercase:e.filepattern?LVe(e.filepattern.toLowerCase()):void 0,filepatternOnPath:!!e.filepattern&&e.filepattern.indexOf(lle.sep)>=0}}(e);DVe.push(n),n.userConfigured?NVe.push(n):EVe.push(n),i&&!n.userConfigured&&DVe.forEach((e=>{e.mime===n.mime||e.userConfigured||(n.extension&&e.extension===n.extension&&console.warn(`Overwriting extension <<${n.extension}>> to now point to mime <<${n.mime}>>`),n.filename&&e.filename===n.filename&&console.warn(`Overwriting filename <<${n.filename}>> to now point to mime <<${n.mime}>>`),n.filepattern&&e.filepattern===n.filepattern&&console.warn(`Overwriting filepattern <<${n.filepattern}>> to now point to mime <<${n.mime}>>`),n.firstline&&e.firstline===n.firstline&&console.warn(`Overwriting firstline <<${n.firstline}>> to now point to mime <<${n.mime}>>`))}))}(e,0,t)}function MVe(e,t,i){var n;let o,s,r;for(let a=i.length-1;a>=0;a--){const l=i[a];if(t===l.filenameLowercase){o=l;break}if(l.filepattern&&(!s||l.filepattern.length>s.filepattern.length)){const i=l.filepatternOnPath?e:t;(null===(n=l.filepatternLowercase)||void 0===n?void 0:n.call(l,i))&&(s=l)}l.extension&&(!r||l.extension.length>r.extension.length)&&t.endsWith(l.extensionLowercase)&&(r=l)}return o||s||r||void 0}const TVe=Object.prototype.hasOwnProperty,AVe="vs.editor.nullLanguage";class RVe{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(AVe,0),this._register(Dge,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||AVe}}class OVe extends aae{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new bae),this.onDidChange=this._onDidChange.event,OVe.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new RVe,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(xge.onDidChangeLanguages((e=>{this._initializeFromRegistry()}))))}dispose(){OVe.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},DVe=DVe.filter((e=>e.userConfigured)),EVe=[];const e=[].concat(xge.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach((e=>{const t=this._languages[e];t.name&&(this._nameMap[t.name]=t.identifier),t.aliases.forEach((e=>{this._lowercaseNameMap[e.toLowerCase()]=t.identifier})),t.mimetypes.forEach((e=>{this._mimeTypesMap[e]=t.identifier}))})),rge.as(dge).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;TVe.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let n=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),n=t.mimetypes[0]),n||(n=`text/x-${i}`,e.mimetypes.push(n)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const e of t.extensions)IVe({id:i,mime:n,extension:e},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const o of t.filenames)IVe({id:i,mime:n,filename:o},this._warnOnOverwrite),e.filenames.push(o);if(Array.isArray(t.filenamePatterns))for(const e of t.filenamePatterns)IVe({id:i,mime:n,filepattern:e},this._warnOnOverwrite);if("string"==typeof t.firstLine&&t.firstLine.length>0){let e=t.firstLine;"^"!==e.charAt(0)&&(e="^"+e);try{const t=new RegExp(e);"^"!==(o=t).source&&"^$"!==o.source&&"$"!==o.source&&"^\\s*$"!==o.source&&o.exec("")&&0===o.lastIndex||IVe({id:i,mime:n,firstline:t},this._warnOnOverwrite)}catch(i){console.warn(`[${t.id}]: Invalid regular expression \`${e}\`: `,i)}}var o;e.aliases.push(i);let s=null;if(void 0!==t.aliases&&Array.isArray(t.aliases)&&(s=0===t.aliases.length?[null]:t.aliases),null!==s)for(const t of s)t&&0!==t.length&&e.aliases.push(t);const r=null!==s&&s.length>0;if(r&&null===s[0]);else{const t=(r?s[0]:null)||i;!r&&e.name||(e.name=t)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return!!e&&TVe.call(this._languages,e)}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return TVe.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&TVe.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return e||t?function(e,t){return function(e,t){let i;if(e)switch(e.scheme){case _ve.file:i=e.fsPath;break;case _ve.data:i=BIe.parseMetaData(e).get(BIe.META_DATA_LABEL);break;case _ve.vscodeNotebookCell:i=void 0;break;default:i=e.path}if(!i)return[{id:"unknown",mime:age.unknown}];i=i.toLowerCase();const n=gle(i),o=MVe(i,n,NVe);if(o)return[o,{id:Dge,mime:age.text}];const s=MVe(i,n,EVe);if(s)return[s,{id:Dge,mime:age.text}];if(t){const e=function(e){if(Mde(e)&&(e=e.substr(1)),e.length>0)for(let t=DVe.length-1;t>=0;t--){const i=DVe[t];if(!i.firstline)continue;const n=e.match(i.firstline);if(n&&n.length>0)return i}}(t);if(e)return[e,{id:Dge,mime:age.text}]}return[{id:"unknown",mime:age.unknown}]}(e,t).map((e=>e.id))}(e,t):[]}}OVe.instanceCount=0;class PVe extends aae{constructor(e=!1){super(),this._onDidEncounterLanguage=this._register(new bae),this.onDidEncounterLanguage=this._onDidEncounterLanguage.event,this._onDidChange=this._register(new bae({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,PVe.instanceCount++,this._encounteredLanguages=new Set,this._registry=this._register(new OVe(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange((()=>this._onDidChange.fire())))}dispose(){PVe.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){return Tse(this._registry.guessLanguageIdByFilepathOrFirstLine(e,t),null)}createById(e){return new FVe(this.onDidChange,(()=>this._createAndGetLanguageIdentifier(e)))}createByFilepathOrFirstLine(e,t){return new FVe(this.onDidChange,(()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)}))}_createAndGetLanguageIdentifier(e){return e&&this.isRegisteredLanguageId(e)||(e=Dge),this._encounteredLanguages.has(e)||(this._encounteredLanguages.add(e),ehe.getOrCreate(e),this._onDidEncounterLanguage.fire(e)),e}}PVe.instanceCount=0;class FVe{constructor(e,t){this._onDidChangeLanguages=e,this._selector=t,this._listener=null,this._emitter=null,this.languageId=this._selector()}_dispose(){this._listener&&(this._listener.dispose(),this._listener=null),this._emitter&&(this._emitter.dispose(),this._emitter=null)}get onDidChange(){return this._listener||(this._listener=this._onDidChangeLanguages((()=>this._evaluate()))),this._emitter||(this._emitter=new bae({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const t=this._selector();t!==this.languageId&&(this.languageId=t,null===(e=this._emitter)||void 0===e||e.fire(this.languageId))}}var BVe=i(6872),WVe={};WVe.styleTagTransform=Vr(),WVe.setAttributes=Pr(),WVe.insert=Rr().bind(null,"head"),WVe.domAPI=Tr(),WVe.insertStyleElement=Br(),Ir()(BVe.Z,WVe),BVe.Z&&BVe.Z.locals&&BVe.Z.locals;class VVe extends Abe{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new bae),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=ebe(e,sbe(".monaco-dropdown")),this._label=ebe(this._element,sbe(".dropdown-label"));let i=t.labelRenderer;i||(i=e=>(e.textContent=t.label||"",null));for(const e of[Yve.CLICK,Yve.MOUSE_DOWN,Ewe.Tap])this._register(Lve(this.element,e,(e=>Qve(e,!0))));for(const e of[Yve.MOUSE_DOWN,Ewe.Tap])this._register(Lve(this._label,e,(e=>{e instanceof MouseEvent&&(e.detail>1||0!==e.button)||(this.visible?this.hide():this.show())})));this._register(Lve(this._label,Yve.KEY_UP,(e=>{const t=new p_e(e);(t.equals(3)||t.equals(10))&&(Qve(e,!0),this.visible?this.hide():this.show())})));const n=i(this._label);n&&this._register(n),this._register(Nwe.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class zVe extends VVe{constructor(e,t){super(e,t),this._actions=[],this._contextMenuProvider=t.contextMenuProvider,this.actions=t.actions||[],this.actionProvider=t.actionProvider,this.menuClassName=t.menuClassName||"",this.menuAsChild=!!t.menuAsChild}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this.actionProvider?this.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this.menuClassName,onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this.menuAsChild?this.element:void 0})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class HVe extends SFe{constructor(e,t,i,n=Object.create(null)){super(null,e,n),this.actionItem=null,this._onDidChangeVisibility=this._register(new bae),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=n,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=Array.isArray(this.menuActionsOrProvider),i={contextMenuProvider:this.contextMenuProvider,labelRenderer:e=>{this.element=ebe(e,sbe("a.action-label"));let t=[];return"string"==typeof this.options.classNames?t=this.options.classNames.split(/\s+/g).filter((e=>!!e)):this.options.classNames&&(t=this.options.classNames),t.find((e=>"icon"===e))||t.push("codicon"),this.element.classList.add(...t),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this.element.title=this._action.label||"",this.element.ariaLabel=this._action.label||"",null},menuAsChild:this.options.menuAsChild,actions:t?this.menuActionsOrProvider:void 0,actionProvider:t?void 0:this.menuActionsOrProvider};if(this.dropdownMenu=this._register(new zVe(e,i)),this._register(this.dropdownMenu.onDidChangeVisibility((e=>{var t;null===(t=this.element)||void 0===t||t.setAttribute("aria-expanded",`${e}`),this._onDidChangeVisibility.fire(e)}))),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const e=this;this.dropdownMenu.menuOptions=Object.assign(Object.assign({},this.dropdownMenu.menuOptions),{get anchorAlignment(){return e.options.anchorAlignmentProvider()}})}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),null!=e?e:void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;null===(e=this.dropdownMenu)||void 0===e||e.show()}updateEnabled(){var e,t;const i=!this.action.enabled;null===(e=this.actionItem)||void 0===e||e.classList.toggle("disabled",i),null===(t=this.element)||void 0===t||t.classList.toggle("disabled",i)}}var UVe=i(6112),KVe={};KVe.styleTagTransform=Vr(),KVe.setAttributes=Pr(),KVe.insert=Rr().bind(null,"head"),KVe.domAPI=Tr(),KVe.insertStyleElement=Br(),Ir()(UVe.Z,KVe),UVe.Z&&UVe.Z.locals&&UVe.Z.locals;var jVe,qVe,$Ve=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};!function(e){e[e.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",e[e.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"}(jVe||(jVe={})),function(e){e[e.None=0]="None",e[e.Initialized=1]="Initialized",e[e.Closed=2]="Closed"}(qVe||(qVe={}));class GVe extends aae{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new bae),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=qVe.None,this.cache=new Map,this.flushDelayer=new ope(GVe.DEFAULT_FLUSH_DELAY),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal((e=>this.onDidChangeItemsExternal(e))))}onDidChangeItemsExternal(e){var t,i;null===(t=e.changed)||void 0===t||t.forEach(((e,t)=>this.accept(t,e))),null===(i=e.deleted)||void 0===i||i.forEach((e=>this.accept(e,void 0)))}accept(e,t){if(this.state===qVe.Closed)return;let i=!1;Xse(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire(e)}get(e,t){const i=this.cache.get(e);return Xse(i)?t:i}getBoolean(e,t){const i=this.get(e);return Xse(i)?t:"true"===i}getNumber(e,t){const i=this.get(e);return Xse(i)?t:parseInt(i,10)}set(e,t){return $Ve(this,void 0,void 0,(function*(){if(this.state===qVe.Closed)return;if(Xse(t))return this.delete(e);const i=String(t);return this.cache.get(e)!==i?(this.cache.set(e,i),this.pendingInserts.set(e,i),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire(e),this.doFlush()):void 0}))}delete(e){return $Ve(this,void 0,void 0,(function*(){if(this.state!==qVe.Closed)return this.cache.delete(e)?(this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire(e),this.doFlush()):void 0}))}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}flushPending(){return $Ve(this,void 0,void 0,(function*(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally((()=>{var e;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)null===(e=this.whenFlushedCallbacks.pop())||void 0===e||e()}))}))}doFlush(e){return $Ve(this,void 0,void 0,(function*(){return this.flushDelayer.trigger((()=>this.flushPending()),e)}))}dispose(){this.flushDelayer.dispose(),super.dispose()}}GVe.DEFAULT_FLUSH_DELAY=100;class ZVe{constructor(){this.onDidChangeItemsExternal=pae.None,this.items=new Map}updateItems(e){var t,i;return $Ve(this,void 0,void 0,(function*(){null===(t=e.insert)||void 0===t||t.forEach(((e,t)=>this.items.set(t,e))),null===(i=e.delete)||void 0===i||i.forEach((e=>this.items.delete(e)))}))}}const YVe="__$__targetStorageMarker",QVe=pce("storageService");var XVe;!function(e){e[e.NONE=0]="NONE",e[e.SHUTDOWN=1]="SHUTDOWN"}(XVe||(XVe={}));class JVe extends aae{constructor(e={flushInterval:JVe.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new Sae),this.onDidChangeValue=this._onDidChangeValue.event,this._onDidChangeTarget=this._register(new Sae),this._onWillSaveState=this._register(new bae),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}emitDidChangeValue(e,t){if(t===YVe){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:t,target:this.getKeyTargets(e)[t]})}get(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.get(e,i)}getBoolean(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.getBoolean(e,i)}getNumber(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.getNumber(e,i)}store(e,t,i,n){Xse(t)?this.remove(e,i):this.withPausedEmitters((()=>{var o;this.updateKeyTarget(e,i,n),null===(o=this.getStorage(i))||void 0===o||o.set(e,t)}))}remove(e,t){this.withPausedEmitters((()=>{var i;this.updateKeyTarget(e,t,void 0),null===(i=this.getStorage(t))||void 0===i||i.delete(e)}))}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i){var n,o;const s=this.getKeyTargets(t);"number"==typeof i?s[e]!==i&&(s[e]=i,null===(n=this.getStorage(t))||void 0===n||n.set(YVe,JSON.stringify(s))):"number"==typeof s[e]&&(delete s[e],null===(o=this.getStorage(t))||void 0===o||o.set(YVe,JSON.stringify(s)))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?function(e){const t=e.get(YVe);if(t)try{return JSON.parse(t)}catch(e){}return Object.create(null)}(t):Object.create(null)}}JVe.DEFAULT_FLUSH_INTERVAL=6e4;const eze=function(e){var t,i,n,o,s;return{keybindingLabelBackground:Fwe(null!==(t=e.keybindingLabelBackground)&&void 0!==t?t:jCe),keybindingLabelForeground:Fwe(null!==(i=e.keybindingLabelForeground)&&void 0!==i?i:qCe),keybindingLabelBorder:Fwe(null!==(n=e.keybindingLabelBorder)&&void 0!==n?n:$Ce),keybindingLabelBottomBorder:Fwe(null!==(o=e.keybindingLabelBottomBorder)&&void 0!==o?o:GCe),keybindingLabelShadow:Fwe(null!==(s=e.keybindingLabelShadow)&&void 0!==s?s:$we)}}({}),tze=function(e){var t,i,n,o,s,r,a,l;return{buttonForeground:Fwe(null!==(t=e.buttonForeground)&&void 0!==t?t:pCe),buttonSeparator:Fwe(null!==(i=e.buttonSeparator)&&void 0!==i?i:mCe),buttonBackground:Fwe(null!==(n=e.buttonBackground)&&void 0!==n?n:fCe),buttonHoverBackground:Fwe(null!==(o=e.buttonHoverBackground)&&void 0!==o?o:_Ce),buttonSecondaryForeground:Fwe(null!==(s=e.buttonSecondaryForeground)&&void 0!==s?s:bCe),buttonSecondaryBackground:Fwe(null!==(r=e.buttonSecondaryBackground)&&void 0!==r?r:wCe),buttonSecondaryHoverBackground:Fwe(null!==(a=e.buttonSecondaryHoverBackground)&&void 0!==a?a:CCe),buttonBorder:Fwe(null!==(l=e.buttonBorder)&&void 0!==l?l:vCe)}}({}),ize=function(e){var t;return{progressBarBackground:Fwe(null!==(t={}.progressBarBackground)&&void 0!==t?t:ECe)}}(),nze=function(e){var t,i,n;return{inputActiveOptionBorder:Fwe(null!==(t=e.inputActiveOptionBorder)&&void 0!==t?t:Xwe),inputActiveOptionForeground:Fwe(null!==(i=e.inputActiveOptionForeground)&&void 0!==i?i:eCe),inputActiveOptionBackground:Fwe(null!==(n=e.inputActiveOptionBackground)&&void 0!==n?n:Jwe)}}({});!function(e){var t,i,n;Fwe(null!==(t=e.checkboxBackground)&&void 0!==t?t:Oye),Fwe(null!==(i=e.checkboxBorder)&&void 0!==i?i:Fye),Fwe(null!==(n=e.checkboxForeground)&&void 0!==n?n:Pye)}({}),function(e){var t,i,n,o,s,r,a,l;Fwe(null!==(t=e.dialogBackground)&&void 0!==t?t:FCe),Fwe(null!==(i=e.dialogForeground)&&void 0!==i?i:BCe),Fwe(null!==(n=e.dialogShadow)&&void 0!==n?n:$we),Fwe(null!==(o=e.dialogBorder)&&void 0!==o?o:Kwe),Fwe(null!==(s=e.errorIconForeground)&&void 0!==s?s:pSe),Fwe(null!==(r=e.warningIconForeground)&&void 0!==r?r:mSe),Fwe(null!==(a=e.infoIconForeground)&&void 0!==a?a:fSe),Fwe(null!==(l=e.textLinkForeground)&&void 0!==l?l:qwe)}({});const oze=function(e){var t,i,n,o,s,r,a,l,h,d,c,u;return{inputBackground:Fwe(null!==(t=e.inputBackground)&&void 0!==t?t:Zwe),inputForeground:Fwe(null!==(i=e.inputForeground)&&void 0!==i?i:Ywe),inputBorder:Fwe(null!==(n=e.inputBorder)&&void 0!==n?n:Qwe),inputValidationInfoBorder:Fwe(null!==(o=e.inputValidationInfoBorder)&&void 0!==o?o:nCe),inputValidationInfoBackground:Fwe(null!==(s=e.inputValidationInfoBackground)&&void 0!==s?s:tCe),inputValidationInfoForeground:Fwe(null!==(r=e.inputValidationInfoForeground)&&void 0!==r?r:iCe),inputValidationWarningBorder:Fwe(null!==(a=e.inputValidationWarningBorder)&&void 0!==a?a:rCe),inputValidationWarningBackground:Fwe(null!==(l=e.inputValidationWarningBackground)&&void 0!==l?l:oCe),inputValidationWarningForeground:Fwe(null!==(h=e.inputValidationWarningForeground)&&void 0!==h?h:sCe),inputValidationErrorBorder:Fwe(null!==(d=e.inputValidationErrorBorder)&&void 0!==d?d:hCe),inputValidationErrorBackground:Fwe(null!==(c=e.inputValidationErrorBackground)&&void 0!==c?c:aCe),inputValidationErrorForeground:Fwe(null!==(u=e.inputValidationErrorForeground)&&void 0!==u?u:lCe)}}({}),sze={listFilterWidgetBackground:Fwe(Dye),listFilterWidgetOutline:Fwe(Eye),listFilterWidgetNoMatchesOutline:Fwe(Nye),listFilterWidgetShadow:Fwe(Iye),inputBoxStyles:oze,toggleStyles:nze},rze=function(e){var t,i;return{badgeBackground:Fwe(null!==(t=e.badgeBackground)&&void 0!==t?t:yCe),badgeForeground:Fwe(null!==(i=e.badgeForeground)&&void 0!==i?i:SCe),badgeBorder:Fwe(Kwe)}}({});!function(e){var t,i,n,o,s;Fwe(null!==(t=e.breadcrumbsBackground)&&void 0!==t?t:Qye),Fwe(null!==(i=e.breadcrumbsForeground)&&void 0!==i?i:Yye),Fwe(null!==(n=e.breadcrumbsFocusForeground)&&void 0!==n?n:Xye),Fwe(null!==(o=e.breadcrumbsFocusForeground)&&void 0!==o?o:Xye),Fwe(null!==(s=e.breadcrumbsFocusAndSelectionForeground)&&void 0!==s?s:Jye)}({});const aze=lze({});function lze(e){var t,i,n,o,s,r,a,l,h,d,c,u,g,p,m,f,_,v,b,w,C,y,S;return{listBackground:e.listBackground?Fwe(e.listBackground):void 0,listInactiveFocusForeground:e.listInactiveFocusForeground?Fwe(e.listInactiveFocusForeground):void 0,listFocusBackground:Fwe(null!==(t=e.listFocusBackground)&&void 0!==t?t:cye),listFocusForeground:Fwe(null!==(i=e.listFocusForeground)&&void 0!==i?i:uye),listFocusOutline:Fwe(null!==(n=e.listFocusOutline)&&void 0!==n?n:gye),listActiveSelectionBackground:Fwe(null!==(o=e.listActiveSelectionBackground)&&void 0!==o?o:mye),listActiveSelectionForeground:Fwe(null!==(s=e.listActiveSelectionForeground)&&void 0!==s?s:fye),listActiveSelectionIconForeground:Fwe(null!==(r=e.listActiveSelectionIconForeground)&&void 0!==r?r:_ye),listFocusAndSelectionOutline:Fwe(null!==(a=e.listFocusAndSelectionOutline)&&void 0!==a?a:pye),listFocusAndSelectionBackground:Fwe(null!==(l=e.listFocusAndSelectionBackground)&&void 0!==l?l:mye),listFocusAndSelectionForeground:Fwe(null!==(h=e.listFocusAndSelectionForeground)&&void 0!==h?h:fye),listInactiveSelectionBackground:Fwe(null!==(d=e.listInactiveSelectionBackground)&&void 0!==d?d:vye),listInactiveSelectionIconForeground:Fwe(null!==(c=e.listInactiveSelectionIconForeground)&&void 0!==c?c:wye),listInactiveSelectionForeground:Fwe(null!==(u=e.listInactiveSelectionForeground)&&void 0!==u?u:bye),listInactiveFocusBackground:Fwe(null!==(g=e.listInactiveFocusBackground)&&void 0!==g?g:Cye),listInactiveFocusOutline:Fwe(null!==(p=e.listInactiveFocusOutline)&&void 0!==p?p:yye),listHoverBackground:Fwe(null!==(m=e.listHoverBackground)&&void 0!==m?m:Sye),listHoverForeground:Fwe(null!==(f=e.listHoverForeground)&&void 0!==f?f:kye),listDropBackground:Fwe(null!==(_=e.listDropBackground)&&void 0!==_?_:Lye),listSelectionOutline:Fwe(null!==(v=e.listSelectionOutline)&&void 0!==v?v:jwe),listHoverOutline:Fwe(null!==(b=e.listHoverOutline)&&void 0!==b?b:jwe),treeIndentGuidesStroke:Fwe(null!==(w=e.treeIndentGuidesStroke)&&void 0!==w?w:Mye),treeInactiveIndentGuidesStroke:Fwe(null!==(C=e.treeInactiveIndentGuidesStroke)&&void 0!==C?C:Tye),tableColumnsBorder:Fwe(null!==(y=e.tableColumnsBorder)&&void 0!==y?y:Aye),tableOddRowsBackgroundColor:Fwe(null!==(S=e.tableOddRowsBackgroundColor)&&void 0!==S?S:Rye)}}const hze=function(e){var t;return{selectBackground:Fwe(e.selectBackground||dCe),selectListBackground:Fwe(e.selectListBackground||cCe),selectForeground:Fwe(e.selectForeground||uCe),decoratorRightForeground:Fwe(e.decoratorRightForeground||UCe),selectBorder:Fwe(e.selectBorder||gCe),focusBorder:Fwe(e.focusBorder||Uwe),listFocusBackground:Fwe(e.listFocusBackground||zye),listInactiveSelectionIconForeground:Fwe(e.listInactiveSelectionIconForeground||Vye),listFocusForeground:Fwe(e.listFocusForeground||Wye),listFocusOutline:Bwe(null!==(t=e.listFocusOutline)&&void 0!==t?t:jwe,Owe.transparent.toString()),listHoverBackground:Fwe(e.listHoverBackground||Sye),listHoverForeground:Fwe(e.listHoverForeground||kye),listHoverOutline:Fwe(e.listFocusOutline||jwe),selectListBorder:Fwe(e.selectListBorder||WCe),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0}}({}),dze=function(e){var t,i,n,o,s,r,a,l,h,d,c,u;return{shadowColor:Fwe(null!==(t=e.shadowColor)&&void 0!==t?t:$we),borderColor:Fwe(null!==(i=e.borderColor)&&void 0!==i?i:Hye),foregroundColor:Fwe(null!==(n=e.foregroundColor)&&void 0!==n?n:Uye),backgroundColor:Fwe(null!==(o=e.backgroundColor)&&void 0!==o?o:Kye),selectionForegroundColor:Fwe(null!==(s=e.selectionForegroundColor)&&void 0!==s?s:jye),selectionBackgroundColor:Fwe(null!==(r=e.selectionBackgroundColor)&&void 0!==r?r:qye),selectionBorderColor:Fwe(null!==(a=e.selectionBorderColor)&&void 0!==a?a:$ye),separatorColor:Fwe(null!==(l=e.separatorColor)&&void 0!==l?l:Gye),scrollbarShadow:Fwe(null!==(h=e.scrollbarShadow)&&void 0!==h?h:kCe),scrollbarSliderBackground:Fwe(null!==(d=e.scrollbarSliderBackground)&&void 0!==d?d:LCe),scrollbarSliderHoverBackground:Fwe(null!==(c=e.scrollbarSliderHoverBackground)&&void 0!==c?c:xCe),scrollbarSliderActiveBackground:Fwe(null!==(u=e.scrollbarSliderActiveBackground)&&void 0!==u?u:DCe)}}({});var cze=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},uze=function(e,t){return function(i,n){t(i,n,e)}},gze=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let pze=class extends kFe{constructor(e,t,i,n,o,s,r){super(void 0,e,{icon:!(!e.class&&!e.item.icon),label:!e.class&&!e.item.icon,draggable:null==t?void 0:t.draggable,keybinding:null==t?void 0:t.keybinding,hoverDelegate:null==t?void 0:t.hoverDelegate}),this._keybindingService=i,this._notificationService=n,this._contextKeyService=o,this._themeService=s,this._contextMenuService=r,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new lae),this._altKey=pbe.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return gze(this,void 0,void 0,(function*(){e.preventDefault(),e.stopPropagation();try{yield this.actionRunner.run(this._commandAction,this._context)}catch(e){this._notificationService.error(e)}}))}render(e){super.render(e),e.classList.add("menu-entry"),this._updateItemClass(this._menuItemAction.item);let t=!1,i=this._altKey.keyStatus.altKey||(ese||ise)&&this._altKey.keyStatus.shiftKey;const n=()=>{var e;const n=t&&i&&!!(null===(e=this._commandAction.alt)||void 0===e?void 0:e.enabled);n!==this._wantsAltCommand&&(this._wantsAltCommand=n,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._menuItemAction.alt&&this._register(this._altKey.event((e=>{i=e.altKey||(ese||ise)&&e.shiftKey,n()}))),this._register(Lve(e,"mouseleave",(e=>{t=!1,n()}))),this._register(Lve(e,"mouseenter",(e=>{t=!0,n()})))}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var e;const t=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),i=t&&t.getLabel(),n=this._commandAction.tooltip||this._commandAction.label;let o=i?Toe(0,"{0} ({1})",n,i):n;if(!this._wantsAltCommand&&(null===(e=this._menuItemAction.alt)||void 0===e?void 0:e.enabled)){const e=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,t=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),i=t&&t.getLabel(),n=i?Toe(0,"{0} ({1})",e,i):e;o=Toe(0,"{0}\n[{1}] {2}",o,xWe.modifierLabels[cse].altKey,n)}return o}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const n=this._commandAction.checked&&(o=e.toggled)&&void 0!==o.condition&&e.toggled.icon?e.toggled.icon:e.icon;var o;if(n)if(Ibe.isThemeIcon(n)){const e=Ibe.asClassNameArray(n);i.classList.add(...e),this._itemClassDispose.value=sae((()=>{i.classList.remove(...e)}))}else i.style.backgroundImage=XSe(this._themeService.getColorTheme().type)?dbe(n.dark):dbe(n.light),i.classList.add("icon"),this._itemClassDispose.value=oae(sae((()=>{i.style.backgroundImage="",i.classList.remove("icon")})),this._themeService.onDidColorThemeChange((()=>{this.updateClass()})))}};pze=cze([uze(2,bWe),uze(3,XAe),uze(4,qce),uze(5,uLe),uze(6,YFe)],pze);let mze=class extends HVe{constructor(e,t,i,n){var o,s;const r=Object.assign({},null!=t?t:Object.create(null),{menuAsChild:null!==(o=null==t?void 0:t.menuAsChild)&&void 0!==o&&o,classNames:null!==(s=null==t?void 0:t.classNames)&&void 0!==s?s:Ibe.isThemeIcon(e.item.icon)?Ibe.asClassName(e.item.icon):void 0});super(e,{getActions:()=>e.actions},i,r),this._contextMenuService=i,this._themeService=n}render(e){super.render(e),Jse(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!Ibe.isThemeIcon(i)){this.element.classList.add("icon");const e=()=>{this.element&&(this.element.style.backgroundImage=XSe(this._themeService.getColorTheme().type)?dbe(i.dark):dbe(i.light))};e(),this._register(this._themeService.onDidColorThemeChange((()=>{e()})))}}};mze=cze([uze(2,YFe),uze(3,uLe)],mze);let fze=class extends SFe{constructor(e,t,i,n,o,s,r,a){var l,h,d;let c;super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=o,this._menuService=s,this._instaService=r,this._storageService=a,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;const u=a.get(this._storageKey,1);u&&(c=e.actions.find((e=>u===e.id))),c||(c=e.actions[0]),this._defaultAction=this._instaService.createInstance(pze,c,{keybinding:this._getDefaultActionKeybindingLabel(c)});const g=Object.assign({},null!=t?t:Object.create(null),{menuAsChild:null===(l=null==t?void 0:t.menuAsChild)||void 0===l||l,classNames:null!==(h=null==t?void 0:t.classNames)&&void 0!==h?h:["codicon","codicon-chevron-down"],actionRunner:null!==(d=null==t?void 0:t.actionRunner)&&void 0!==d?d:new Abe});this._dropdown=new HVe(e,e.actions,this._contextMenuService,g),this._dropdown.actionRunner.onDidRun((e=>{e.action instanceof Ybe&&this.update(e.action)}))}update(e){var t,i;this._storageService.store(this._storageKey,e.id,1,0),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(pze,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends Abe{runAction(e,t){return gze(this,void 0,void 0,(function*(){yield e.run(void 0)}))}},this._container&&this._defaultAction.render((t=this._container,i=sbe(".action-container"),t.insertBefore(i,t.firstChild),i))}_getDefaultActionKeybindingLabel(e){var t;let i;if(null===(t=this._options)||void 0===t?void 0:t.renderKeybindingWithDefaultActionLabel){const t=this._keybindingService.lookupKeybinding(e.id);t&&(i=`(${t.getLabel()})`)}return i}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=sbe(".action-container");this._defaultAction.render(ebe(this._container,t)),this._register(Lve(t,Yve.KEY_DOWN,(e=>{const t=new p_e(e);t.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),t.stopPropagation())})));const i=sbe(".dropdown-action-container");this._dropdown.render(ebe(this._container,i)),this._register(Lve(i,Yve.KEY_DOWN,(e=>{var t;const i=new p_e(e);i.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),null===(t=this._defaultAction.element)||void 0===t||t.focus(),i.stopPropagation())})))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};fze=cze([uze(2,bWe),uze(3,XAe),uze(4,YFe),uze(5,qbe),uze(6,gce),uze(7,QVe)],fze);let _ze=class extends LFe{constructor(e,t){super(null,e,e.actions.map((e=>({text:e.id===Rbe.ID?"─────────":e.label,isDisabled:!e.enabled}))),0,t,hze,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex((e=>e.checked))))}render(e){super.render(e),e.style.borderColor=Fwe(gCe)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};_ze=cze([uze(1,ZFe)],_ze);const vze=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,bze=/(&amp;)?(&amp;)([^\s&])/g;var wze;!function(e){e[e.Right=0]="Right",e[e.Left=1]="Left"}(wze||(wze={}));class Cze extends EFe{constructor(e,t,i,n){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:1,actionViewItemProvider:e=>this.doGetActionViewItem(e,i,s),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...tse||ise?[10]:[]],keyDown:!0}}),this.menuStyles=n,this.menuElement=o,this.actionsList.tabIndex=0,this.menuDisposables=this._register(new rae),this.initializeOrUpdateStyleSheet(e,n),this._register(Nwe.addTarget(o)),Lve(o,Yve.KEY_DOWN,(e=>{new p_e(e).equals(2)&&e.preventDefault()})),i.enableMnemonics&&this.menuDisposables.add(Lve(o,Yve.KEY_DOWN,(e=>{const t=e.key.toLocaleLowerCase();if(this.mnemonics.has(t)){Qve(e,!0);const i=this.mnemonics.get(t);if(1===i.length&&(i[0]instanceof Sze&&i[0].container&&this.focusItemByElement(i[0].container),i[0].onClick(e)),i.length>1){const e=i.shift();e&&e.container&&(this.focusItemByElement(e.container),i.push(e)),this.mnemonics.set(t,i)}}}))),ise&&this._register(Lve(o,Yve.KEY_DOWN,(e=>{const t=new p_e(e);t.equals(14)||t.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),Qve(e,!0)):(t.equals(13)||t.equals(12))&&(this.focusedItem=0,this.focusPrevious(),Qve(e,!0))}))),this._register(Lve(this.domNode,Yve.MOUSE_OUT,(e=>{Wve(e.relatedTarget,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),e.stopPropagation())}))),this._register(Lve(this.actionsList,Yve.MOUSE_OVER,(e=>{let t=e.target;if(t&&Wve(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}}))),this._register(Nwe.addTarget(this.actionsList)),this._register(Lve(this.actionsList,Ewe.Tap,(e=>{let t=e.initialTarget;if(t&&Wve(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}})));const s={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new Kke(o,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const r=this.scrollableElement.getDomNode();r.style.position="",this.styleScrollElement(r,n),this._register(Lve(o,Ewe.Change,(e=>{Qve(e,!0);const t=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:t-e.translationY})}))),this._register(Lve(r,Yve.MOUSE_UP,(e=>{e.preventDefault()}))),o.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((e=>{var t;return!(null===(t=i.submenuIds)||void 0===t?void 0:t.has(e.id))||(console.warn(`Found submenu cycle: ${e.id}`),!1)})),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter((e=>!(e instanceof kze))).forEach(((e,t,i)=>{e.updatePositionInSet(t+1,i.length)}))}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(Uve(e)?this.styleSheet=qve(e):(Cze.globalStyleSheet||(Cze.globalStyleSheet=qve()),this.styleSheet=Cze.globalStyleSheet)),this.styleSheet.textContent=function(e,t){let i=`\n.monaco-menu {\n\tfont-size: 13px;\n\tborder-radius: 5px;\n\tmin-width: 160px;\n}\n\n${Lze(Vle.menuSelection)}\n${Lze(Vle.menuSubmenu)}\n\n.monaco-menu .monaco-action-bar {\n\ttext-align: right;\n\toverflow: hidden;\n\twhite-space: nowrap;\n}\n\n.monaco-menu .monaco-action-bar .actions-container {\n\tdisplay: flex;\n\tmargin: 0 auto;\n\tpadding: 0;\n\twidth: 100%;\n\tjustify-content: flex-end;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar.reverse .actions-container {\n\tflex-direction: row-reverse;\n}\n\n.monaco-menu .monaco-action-bar .action-item {\n\tcursor: pointer;\n\tdisplay: inline-block;\n\ttransition: transform 50ms ease;\n\tposition: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled {\n\tcursor: default;\n}\n\n.monaco-menu .monaco-action-bar.animated .action-item.active {\n\ttransform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */\n}\n\n.monaco-menu .monaco-action-bar .action-item .icon,\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar .action-label {\n\tfont-size: 11px;\n\tmargin-right: 4px;\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label,\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {\n\tcolor: var(--vscode-disabledForeground);\n}\n\n/* Vertical actions */\n\n.monaco-menu .monaco-action-bar.vertical {\n\ttext-align: left;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tdisplay: block;\n\tborder-bottom: 1px solid var(--vscode-menu-separatorBackground);\n\tpadding-top: 1px;\n\tpadding: 30px;\n}\n\n.monaco-menu .secondary-actions .monaco-action-bar .action-label {\n\tmargin-left: 6px;\n}\n\n/* Action Items */\n.monaco-menu .monaco-action-bar .action-item.select-container {\n\toverflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n\tflex: 1;\n\tmax-width: 170px;\n\tmin-width: 60px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-right: 10px;\n}\n\n.monaco-menu .monaco-action-bar.vertical {\n\tmargin-left: 0;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tpadding: 0;\n\ttransform: none;\n\tdisplay: flex;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.active {\n\ttransform: none;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\tflex: 1 1 auto;\n\tdisplay: flex;\n\theight: 2em;\n\talign-items: center;\n\tposition: relative;\n\tmargin: 0 4px;\n\tborder-radius: 4px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding {\n\topacity: unset;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label {\n\tflex: 1 1 auto;\n\ttext-decoration: none;\n\tpadding: 0 1em;\n\tbackground: none;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .keybinding,\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tdisplay: inline-block;\n\tflex: 2 1 auto;\n\tpadding: 0 1em;\n\ttext-align: right;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {\n\tfont-size: 16px !important;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {\n\tmargin-left: auto;\n\tmargin-right: -20px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {\n\topacity: 0.4;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n\tmargin: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tposition: static;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {\n\tposition: absolute;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\twidth: 100%;\n\theight: 0px !important;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {\n\tpadding: 0.7em 1em 0.1em 1em;\n\tfont-weight: bold;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:hover {\n\tcolor: inherit;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tposition: absolute;\n\tvisibility: hidden;\n\twidth: 1em;\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {\n\tvisibility: visible;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/* Context Menu */\n\n.context-view.monaco-menu-container {\n\toutline: 0;\n\tborder: none;\n\tanimation: fadeIn 0.083s linear;\n\t-webkit-app-region: no-drag;\n}\n\n.context-view.monaco-menu-container :focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {\n\toutline: 0;\n}\n\n.hc-black .context-view.monaco-menu-container,\n.hc-light .context-view.monaco-menu-container,\n:host-context(.hc-black) .context-view.monaco-menu-container,\n:host-context(.hc-light) .context-view.monaco-menu-container {\n\tbox-shadow: none;\n}\n\n.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused {\n\tbackground: none;\n}\n\n/* Vertical Action Bar Styles */\n\n.monaco-menu .monaco-action-bar.vertical {\n\tpadding: 4px 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\theight: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),\n.monaco-menu .monaco-action-bar.vertical .keybinding {\n\tfont-size: inherit;\n\tpadding: 0 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tfont-size: inherit;\n\twidth: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tfont-size: inherit;\n\tmargin: 5px 0 !important;\n\tpadding: 0;\n\tborder-radius: 0;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tmargin-left: 0;\n\tmargin-right: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tfont-size: 60%;\n\tpadding: 0 1.8em;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n\tmask-size: 10px 10px;\n\t-webkit-mask-size: 10px 10px;\n}\n\n.monaco-menu .action-item {\n\tcursor: default;\n}`;if(t){i+="\n\t\t\t/* Arrows */\n\t\t\t.monaco-scrollable-element > .scrollbar > .scra {\n\t\t\t\tcursor: pointer;\n\t\t\t\tfont-size: 11px !important;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .visible {\n\t\t\t\topacity: 1;\n\n\t\t\t\t/* Background rule added for IE9 - to allow clicks on dom node */\n\t\t\t\tbackground:rgba(0,0,0,0);\n\n\t\t\t\ttransition: opacity 100ms linear;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible {\n\t\t\t\topacity: 0;\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible.fade {\n\t\t\t\ttransition: opacity 800ms linear;\n\t\t\t}\n\n\t\t\t/* Scrollable Content Inset Shadow */\n\t\t\t.monaco-scrollable-element > .shadow {\n\t\t\t\tposition: absolute;\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 3px;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 3px;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 100%;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top-left-corner {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t";const t=e.scrollbarShadow;t&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\t\tbox-shadow: ${t} 0 6px 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 0 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.top.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 6px 6px -6px inset;\n\t\t\t\t}\n\t\t\t`);const n=e.scrollbarSliderBackground;n&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider {\n\t\t\t\t\tbackground: ${n};\n\t\t\t\t}\n\t\t\t`);const o=e.scrollbarSliderHoverBackground;o&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider:hover {\n\t\t\t\t\tbackground: ${o};\n\t\t\t\t}\n\t\t\t`);const s=e.scrollbarSliderActiveBackground;s&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider.active {\n\t\t\t\t\tbackground: ${s};\n\t\t\t\t}\n\t\t\t`)}return i}(t,Uve(e))}styleScrollElement(e,t){var i,n;const o=null!==(i=t.foregroundColor)&&void 0!==i?i:"",s=null!==(n=t.backgroundColor)&&void 0!==n?n:"",r=t.borderColor?`1px solid ${t.borderColor}`:"",a=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=r,e.style.borderRadius="5px",e.style.color=o,e.style.backgroundColor=s,e.style.boxShadow=a}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t<this.actionsList.children.length;t++)if(e===this.actionsList.children[t]){this.focusedItem=t;break}}updateFocus(e){super.updateFocus(e,!0,!0),void 0!==this.focusedItem&&this.scrollableElement.setScrollPosition({scrollTop:Math.round(this.menuElement.scrollTop)})}doGetActionViewItem(e,t,i){if(e instanceof Rbe)return new kze(t.context,e,{icon:!0},this.menuStyles);if(e instanceof Obe){const n=new Sze(e,e.actions,i,Object.assign(Object.assign({},t),{submenuIds:new Set([...t.submenuIds||[],e.id])}),this.menuStyles);if(t.enableMnemonics){const e=n.getMnemonic();if(e&&n.isEnabled()){let t=[];this.mnemonics.has(e)&&(t=this.mnemonics.get(e)),t.push(n),this.mnemonics.set(e,t)}}return n}{const i={enableMnemonics:t.enableMnemonics,useEventAsContext:t.useEventAsContext};if(t.getKeyBinding){const n=t.getKeyBinding(e);if(n){const e=n.getLabel();e&&(i.keybinding=e)}}const n=new yze(t.context,e,i,this.menuStyles);if(t.enableMnemonics){const e=n.getMnemonic();if(e&&n.isEnabled()){let t=[];this.mnemonics.has(e)&&(t=this.mnemonics.get(e)),t.push(n),this.mnemonics.set(e,t)}}return n}}}class yze extends SFe{constructor(e,t,i,n){if(i.isMenu=!0,super(t,t,i),this.menuStyle=n,this.options=i,this.options.icon=void 0!==i.icon&&i.icon,this.options.label=void 0===i.label||i.label,this.cssClass="",this.options.label&&i.enableMnemonics){const e=this.action.label;if(e){const t=vze.exec(e);t&&(this.mnemonic=(t[1]?t[1]:t[3]).toLocaleLowerCase())}}this.runOnceToEnableMouseUp=new hpe((()=>{this.element&&(this._register(Lve(this.element,Yve.MOUSE_UP,(e=>{if(Qve(e,!0),jde){if(new b_e(e).rightButton)return;this.onClick(e)}else setTimeout((()=>{this.onClick(e)}),0)}))),this._register(Lve(this.element,Yve.CONTEXT_MENU,(e=>{Qve(e,!0)}))))}),100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=ebe(this.element,sbe("a.action-menu-item")),this._action.id===Rbe.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=ebe(this.item,sbe("span.menu-item-check"+Ibe.asCSSSelector(Vle.menuSelection))),this.check.setAttribute("role","none"),this.label=ebe(this.item,sbe("span.action-label")),this.options.label&&this.options.keybinding&&(ebe(this.item,sbe("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),null===(e=this.item)||void 0===e||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(this.label&&this.options.label){yve(this.label);let t=HOe(this.action.label);if(t){const i=function(e){const t=vze,i=t.exec(e);if(!i)return e;const n=!i[1];return e.replace(t,n?"$2$3":"").trim()}(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const n=vze.exec(t);if(n){t=Ghe(t),bze.lastIndex=0;let i=bze.exec(t);for(;i&&i[1];)i=bze.exec(t);const o=e=>e.replace(/&amp;&amp;/g,"&amp;");i?this.label.append(Yhe(o(t.substr(0,i.index))," "),sbe("u",{"aria-hidden":"true"},i[3]),function(e,t){if(!e||!t)return e;const i=t.length,n=e.length;if(0===i||0===n)return e;let o=n,s=-1;for(;s=e.lastIndexOf(t,o-1),-1!==s&&s+i===o;){if(0===s)return"";o=s}return e.substring(0,o)}(o(t.substr(i.index+i[0].length))," ")):this.label.innerText=o(t).trim(),null===(e=this.item)||void 0===e||e.setAttribute("aria-keyshortcuts",(n[1]?n[1]:n[3]).toLocaleLowerCase())}else this.label.innerText=t.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),void 0!==e?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,n=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=null!=t?t:"",this.item.style.backgroundColor=null!=i?i:"",this.item.style.outline=n,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=null!=t?t:"")}}class Sze extends yze{constructor(e,t,i,n,o){super(e,e,n,o),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new rae),this.mouseOver=!1,this.expandDirection=n&&void 0!==n.expandDirection?n.expandDirection:wze.Right,this.showScheduler=new hpe((()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))}),250),this.hideScheduler=new hpe((()=>{this.element&&!Wve(jve(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))}),750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=ebe(this.item,sbe("span.submenu-indicator"+Ibe.asCSSSelector(Vle.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(Lve(this.element,Yve.KEY_UP,(e=>{const t=new p_e(e);(t.equals(17)||t.equals(3))&&(Qve(e,!0),this.createSubmenu(!0))}))),this._register(Lve(this.element,Yve.KEY_DOWN,(e=>{const t=new p_e(e);jve()===this.item&&(t.equals(17)||t.equals(3))&&Qve(e,!0)}))),this._register(Lve(this.element,Yve.MOUSE_OVER,(e=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())}))),this._register(Lve(this.element,Yve.MOUSE_LEAVE,(e=>{this.mouseOver=!1}))),this._register(Lve(this.element,Yve.FOCUS_OUT,(e=>{this.element&&!Wve(jve(),this.element)&&this.hideScheduler.schedule()}))),this._register(this.parentData.parent.onScroll((()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))}))))}updateEnabled(){}onClick(e){Qve(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch(e){}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,n){const o={top:0,left:0};return o.left=eVe(e.width,t.width,{position:n===wze.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left<i.left+i.width&&(i.left+10+t.width<=e.width&&(o.left=i.left+10),i.top+=10,i.height=0),o.top=eVe(e.height,t.height,{position:0,offset:i.top,size:0}),o.top+t.height===i.top&&o.top+i.height+t.height<=e.height&&(o.top+=i.height),o}createSubmenu(e=!0){if(this.element)if(this.parentData.submenu)this.parentData.submenu.focus(!1);else{this.updateAriaExpanded("true"),this.submenuContainer=ebe(this.element,sbe("div.monaco-submenu")),this.submenuContainer.classList.add("menubar-menu-items-holder","context-view");const t=getComputedStyle(this.parentData.parent.domNode),i=parseFloat(t.paddingTop||"0")||0;this.submenuContainer.style.zIndex="1",this.submenuContainer.style.position="fixed",this.submenuContainer.style.top="0",this.submenuContainer.style.left="0",this.parentData.submenu=new Cze(this.submenuContainer,this.submenuActions.length?this.submenuActions:[new Pbe],this.submenuOptions,this.menuStyle);const n=this.element.getBoundingClientRect(),o={top:n.top-i,left:n.left,height:n.height+2*i,width:n.width},s=this.submenuContainer.getBoundingClientRect(),{top:r,left:a}=this.calculateSubmenuMenuLayout(new Ave(window.innerWidth,window.innerHeight),Ave.lift(s),o,this.expandDirection);this.submenuContainer.style.left=a-s.left+"px",this.submenuContainer.style.top=r-s.top+"px",this.submenuDisposables.add(Lve(this.submenuContainer,Yve.KEY_UP,(e=>{new p_e(e).equals(15)&&(Qve(e,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))}))),this.submenuDisposables.add(Lve(this.submenuContainer,Yve.KEY_DOWN,(e=>{new p_e(e).equals(15)&&Qve(e,!0)}))),this.submenuDisposables.add(this.parentData.submenu.onDidCancel((()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)}))),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&(null===(t=this.item)||void 0===t||t.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();const e=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=null!=e?e:"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class kze extends kFe{constructor(e,t,i,n){super(e,t,i),this.menuStyles=n}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function Lze(e){const t=Wle()[e.id];return`.codicon-${e.id}:before { content: '\\${t.toString(16)}'; }`}class xze{constructor(e,t,i,n){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;let i;this.focusToReturn=document.activeElement;const n=Zve(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:n=>{var o;this.lastContainer=n;const s=e.getMenuClassName?e.getMenuClassName():"";s&&(n.className+=" "+s),this.options.blockMouse&&(this.block=n.appendChild(sbe(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",null===(o=this.blockDisposable)||void 0===o||o.dispose(),this.blockDisposable=Lve(this.block,Yve.MOUSE_DOWN,(e=>e.stopPropagation())));const r=new rae,a=e.actionRunner||new Abe;return a.onWillRun(this.onActionRun,this,r),a.onDidRun(this.onDidActionRun,this,r),i=new Cze(n,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:a,getKeyBinding:e.getKeyBinding?e.getKeyBinding:e=>this.keybindingService.lookupKeybinding(e.id)},dze),i.onDidCancel((()=>this.contextViewService.hideContextView(!0)),null,r),i.onDidBlur((()=>this.contextViewService.hideContextView(!0)),null,r),r.add(Lve(window,Yve.BLUR,(()=>this.contextViewService.hideContextView(!0)))),r.add(Lve(window,Yve.MOUSE_DOWN,(e=>{if(e.defaultPrevented)return;const t=new b_e(e);let i=t.target;if(!t.rightButton){for(;i;){if(i===n)return;i=i.parentElement}this.contextViewService.hideContextView(!0)}}))),oae(r,i)},focus:()=>{null==i||i.focus(!!e.autoSelectFirstItem)},onHide:t=>{var i,n,o;null===(i=e.onHide)||void 0===i||i.call(e,!!t),this.block&&(this.block.remove(),this.block=null),null===(n=this.blockDisposable)||void 0===n||n.dispose(),this.blockDisposable=null,this.lastContainer&&(jve()===this.lastContainer||Wve(jve(),this.lastContainer))&&(null===(o=this.focusToReturn)||void 0===o||o.focus()),this.lastContainer=null}},n,!!n)}onActionRun(e){this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!jre(e.error)&&this.notificationService.error(e.error)}}var Dze=function(e,t){return function(i,n){t(i,n,e)}};let Eze=class extends aae{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new xze(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,o,s){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=o,this.contextKeyService=s,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new bae),this._onDidHideContextMenu=this._store.add(new bae)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=Nze.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu(Object.assign(Object.assign({},e),{onHide:t=>{var i;null===(i=e.onHide)||void 0===i||i.call(e,t),this._onDidHideContextMenu.fire()}})),pbe.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};var Nze,Ize;Eze=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Dze(0,Qbe),Dze(1,XAe),Dze(2,ZFe),Dze(3,bWe),Dze(4,qbe),Dze(5,qce)],Eze),function(e){e.transform=function(e,t,i){if(!((n=e)&&n.menuId instanceof jbe))return e;var n;const{menuId:o,menuActionOptions:s,contextKeyService:r}=e;return Object.assign(Object.assign({},e),{getActions:()=>{const n=[];if(o){const e=t.createMenu(o,null!=r?r:i);!function(e,t,i,n){const o=e.getActions(t),s=pbe.getInstance();!function(e,t,i,n=(e=>"navigation"===e),o=(()=>!1),s=!1){let r,a;Array.isArray(t)?(r=t,a=t):(r=t.primary,a=t.secondary);const l=new Set;for(const[t,o]of e){let e;n(t)?(e=r,e.length>0&&s&&e.push(new Rbe)):(e=a,e.length>0&&e.push(new Rbe));for(let n of o){i&&(n=n instanceof Ybe&&n.alt?n.alt:n);const o=e.push(n);n instanceof Obe&&l.add({group:t,action:n,index:o-1})}}for(const{group:e,action:t,index:i}of l){const s=n(e)?r:a,l=t.actions;l.length<=1&&o(t,e,s.length)&&s.splice(i,1,...l)}}(o,i,s.keyStatus.altKey||(ese||ise)&&s.keyStatus.shiftKey,(e=>"navigation"===e))}(e,s,n),e.dispose()}return e.getActions?Rbe.join(e.getActions(),n):n}})}}(Nze||(Nze={})),function(e){e[e.API=0]="API",e[e.USER=1]="USER"}(Ize||(Ize={}));var Mze=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Tze=function(e,t){return function(i,n){t(i,n,e)}},Aze=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let Rze=class{constructor(e){this._commandService=e}open(e,t){return Aze(this,void 0,void 0,(function*(){if(!GBe(e,_ve.command))return!1;if(!(null==t?void 0:t.allowCommands))return!0;if("string"==typeof e&&(e=Sle.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path))return!0;let i=[];try{i=cPe(decodeURIComponent(e.query))}catch(t){try{i=cPe(e.query)}catch(e){}}return Array.isArray(i)||(i=[i]),yield this._commandService.executeCommand(e.path,...i),!0}))}};Rze=Mze([Tze(0,Bbe)],Rze);let Oze=class{constructor(e){this._editorService=e}open(e,t){return Aze(this,void 0,void 0,(function*(){"string"==typeof e&&(e=Sle.parse(e));const{selection:i,uri:n}=function(e){let t;const i=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(e.fragment);return i&&(t={startLineNumber:parseInt(i[1]),startColumn:i[2]?parseInt(i[2]):1,endLineNumber:i[4]?parseInt(i[4]):void 0,endColumn:i[4]?i[5]?parseInt(i[5]):1:void 0},e=e.with({fragment:""})),{selection:t,uri:e}}(e);return(e=n).scheme===_ve.file&&(e=RIe(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:i,source:(null==t?void 0:t.fromUserGesture)?Ize.USER:Ize.API},null==t?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),null==t?void 0:t.openToSide),!0}))}};Oze=Mze([Tze(0,mce)],Oze);let Pze=class{constructor(e,t){this._openers=new Cse,this._validators=new Cse,this._resolvers=new Cse,this._resolvedUriTargets=new iOe((e=>e.with({path:null,fragment:null,query:null}).toString())),this._externalOpeners=new Cse,this._defaultExternalOpener={openExternal:e=>Aze(this,void 0,void 0,(function*(){return ZBe(e,_ve.http,_ve.https)?hbe(e):window.location.href=e,!0}))},this._openers.push({open:(e,t)=>Aze(this,void 0,void 0,(function*(){return!(!(null==t?void 0:t.openExternal)&&!ZBe(e,_ve.mailto,_ve.http,_ve.https,_ve.vsls)||(yield this._doOpenExternal(e,t),0))}))}),this._openers.push(new Rze(t)),this._openers.push(new Oze(e))}open(e,t){var i;return Aze(this,void 0,void 0,(function*(){const n="string"==typeof e?Sle.parse(e):e,o=null!==(i=this._resolvedUriTargets.get(n))&&void 0!==i?i:e;for(const e of this._validators)if(!(yield e.shouldOpen(o,t)))return!1;for(const i of this._openers)if(yield i.open(e,t))return!0;return!1}))}resolveExternalUri(e,t){return Aze(this,void 0,void 0,(function*(){for(const i of this._resolvers)try{const n=yield i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}catch(e){}throw new Error("Could not resolve external URI: "+e.toString())}))}_doOpenExternal(e,t){return Aze(this,void 0,void 0,(function*(){const i="string"==typeof e?Sle.parse(e):e;let n,o;try{n=(yield this.resolveExternalUri(i,t)).resolved}catch(e){n=i}if(o="string"==typeof e&&i.toString()===n.toString()?e:encodeURI(n.toString(!0)),null==t?void 0:t.allowContributedOpeners){const e="string"==typeof(null==t?void 0:t.allowContributedOpeners)?null==t?void 0:t.allowContributedOpeners:void 0;for(const t of this._externalOpeners)if(yield t.openExternal(o,{sourceUri:i,preferredOpenerId:e},Nae.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},Nae.None)}))}dispose(){this._validators.clear()}};var Fze,Bze;Pze=Mze([Tze(0,mce),Tze(1,Bbe)],Pze),function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"}(Fze||(Fze={})),function(e){e.compare=function(e,t){return t-e};const t=Object.create(null);t[e.Error]=Toe(0,"Error"),t[e.Warning]=Toe(0,"Warning"),t[e.Info]=Toe(0,"Info"),e.toString=function(e){return t[e]||""},e.fromSeverity=function(t){switch(t){case YAe.Error:return e.Error;case YAe.Warning:return e.Warning;case YAe.Info:return e.Info;case YAe.Ignore:return e.Hint}},e.toSeverity=function(t){switch(t){case e.Error:return YAe.Error;case e.Warning:return YAe.Warning;case e.Info:return YAe.Info;case e.Hint:return YAe.Ignore}}}(Fze||(Fze={})),function(e){const t="";function i(e,i){const n=[t];return e.source?n.push(e.source.replace("¦","\\¦")):n.push(t),e.code?"string"==typeof e.code?n.push(e.code.replace("¦","\\¦")):n.push(e.code.value.replace("¦","\\¦")):n.push(t),void 0!==e.severity&&null!==e.severity?n.push(Fze.toString(e.severity)):n.push(t),e.message&&i?n.push(e.message.replace("¦","\\¦")):n.push(t),void 0!==e.startLineNumber&&null!==e.startLineNumber?n.push(e.startLineNumber.toString()):n.push(t),void 0!==e.startColumn&&null!==e.startColumn?n.push(e.startColumn.toString()):n.push(t),void 0!==e.endLineNumber&&null!==e.endLineNumber?n.push(e.endLineNumber.toString()):n.push(t),void 0!==e.endColumn&&null!==e.endColumn?n.push(e.endColumn.toString()):n.push(t),n.push(t),n.join("¦")}e.makeKey=function(e){return i(e,!0)},e.makeKeyOptionalMessage=i}(Bze||(Bze={}));const Wze=pce("markerService");var Vze=function(e,t){return function(i,n){t(i,n,e)}};class zze extends aae{constructor(e){super(),this.model=e,this._markersData=new Map,this._register(sae((()=>{this.model.deltaDecorations([...this._markersData.keys()],[]),this._markersData.clear()})))}update(e,t){const i=[...this._markersData.keys()];this._markersData.clear();const n=this.model.deltaDecorations(i,t);for(let t=0;t<n.length;t++)this._markersData.set(n[t],e[t]);return 0!==i.length||0!==n.length}getMarker(e){return this._markersData.get(e.id)}}let Hze=class extends aae{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new bae),this._markerDecorations=new iOe,e.getModels().forEach((e=>this._onModelAdded(e))),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach((e=>e.dispose())),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach((e=>{const t=this._markerDecorations.get(e);t&&this._updateDecorations(t)}))}_onModelAdded(e){const t=new zze(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const i=this._markerDecorations.get(e.uri);i&&(i.dispose(),this._markerDecorations.delete(e.uri)),e.uri.scheme!==_ve.inMemory&&e.uri.scheme!==_ve.internal&&e.uri.scheme!==_ve.vscode||null===(t=this._markerService)||void 0===t||t.read({resource:e.uri}).map((e=>e.owner)).forEach((t=>this._markerService.remove(t,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500}),i=t.map((t=>({range:this._createDecorationRange(e.model,t),options:this._createDecorationOption(t)})));e.update(t,i)&&this._onDidChangeMarker.fire(e.model)}_createDecorationRange(e,t){let i=Ole.lift(t);if(t.severity!==Fze.Hint||this._hasMarkerTag(t,1)||this._hasMarkerTag(t,2)||(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),i=e.validateRange(i),i.isEmpty()){const t=e.getLineLastNonWhitespaceColumn(i.startLineNumber)||e.getLineMaxColumn(i.startLineNumber);if(1===t||i.endColumn>=t)return i;const n=e.getWordAtPosition(i.getStartPosition());n&&(i=new Ole(i.startLineNumber,n.startColumn,i.endLineNumber,n.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&1===t.startColumn&&i.startLineNumber===i.endLineNumber){const n=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);n<i.endColumn&&(i=new Ole(i.startLineNumber,n,i.endLineNumber,i.endColumn),t.startColumn=n)}return i}_createDecorationOption(e){let t,i,n,o,s;switch(e.severity){case Fze.Hint:t=this._hasMarkerTag(e,2)?void 0:this._hasMarkerTag(e,1)?"squiggly-unnecessary":"squiggly-hint",n=0;break;case Fze.Warning:t="squiggly-warning",i=gLe(RLe),n=20,s={color:gLe(cSe),position:sue.Inline};break;case Fze.Info:t="squiggly-info",i=gLe(OLe),n=10;break;case Fze.Error:default:t="squiggly-error",i=gLe(ALe),n=30,s={color:gLe(dSe),position:sue.Inline}}return e.tags&&(-1!==e.tags.indexOf(1)&&(o="squiggly-inline-unnecessary"),-1!==e.tags.indexOf(2)&&(o="squiggly-inline-deprecated")),{description:"marker-decoration",stickiness:1,className:t,showIfCollapsed:!0,overviewRuler:{color:i,position:oue.Right},minimap:s,zIndex:n,inlineClassName:o}}_hasMarkerTag(e,t){return!!e.tags&&e.tags.indexOf(t)>=0}};Hze=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Vze(0,Yge),Vze(1,Wze)],Hze);class Uze{static create(e,t){return new Uze(e,new Kze(t))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}constructor(e,t){this._startLineNumber=e,this._tokens=t,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}toString(){return this._tokens.toString(this._startLineNumber)}_updateEndLineNumber(){this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}isEmpty(){return this._tokens.isEmpty()}getLineTokens(e){return this._startLineNumber<=e&&e<=this._endLineNumber?this._tokens.getLineTokens(e-this._startLineNumber):null}getRange(){const e=this._tokens.getRange();return e?new Ole(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn):e}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,i,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber,[n,o,s]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new Uze(this._startLineNumber,n),new Uze(this._startLineNumber+s,o)]}applyEdit(e,t){const[i,n,o]=cNe(t);this.acceptEdit(e,i,n,o,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,i,n,o){this._acceptDeleteRange(e),this._acceptInsertText(new Rle(e.startLineNumber,e.startColumn),t,i,n,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;if(i<0){const e=i-t;return void(this._startLineNumber-=e)}const n=this._tokens.getMaxDeltaLine();if(!(t>=n+1)){if(t<0&&i>=n+1)return this._startLineNumber=0,void this._tokens.clear();if(t<0){const n=-t;this._startLineNumber-=n,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,n,o){if(0===t&&0===i)return;const s=e.lineNumber-this._startLineNumber;s<0?this._startLineNumber+=t:s>=this._tokens.getMaxDeltaLine()+1||this._tokens.acceptInsertText(s,e.column-1,t,i,n,o)}}class Kze{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;i<this._tokenCount;i++)t.push(`(${this._getDeltaLine(i)+e},${this._getStartCharacter(i)}-${this._getEndCharacter(i)})`);return`[${t.join(",")}]`}getMaxDeltaLine(){const e=this._getTokenCount();return 0===e?-1:this._getDeltaLine(e-1)}getRange(){const e=this._getTokenCount();if(0===e)return null;const t=this._getStartCharacter(0),i=this._getDeltaLine(e-1),n=this._getEndCharacter(e-1);return new Ole(0,t+1,i,n+1)}_getTokenCount(){return this._tokenCount}_getDeltaLine(e){return this._tokens[4*e]}_getStartCharacter(e){return this._tokens[4*e+1]}_getEndCharacter(e){return this._tokens[4*e+2]}isEmpty(){return 0===this._getTokenCount()}getLineTokens(e){let t=0,i=this._getTokenCount()-1;for(;t<i;){const n=t+Math.floor((i-t)/2),o=this._getDeltaLine(n);if(o<e)t=n+1;else{if(!(o>e)){let o=n;for(;o>t&&this._getDeltaLine(o-1)===e;)o--;let s=n;for(;s<i&&this._getDeltaLine(s+1)===e;)s++;return new jze(this._tokens.subarray(4*o,4*s+4))}i=n-1}}return this._getDeltaLine(t)===e?new jze(this._tokens.subarray(4*t,4*t+4)):null}clear(){this._tokenCount=0}removeTokens(e,t,i,n){const o=this._tokens,s=this._tokenCount;let r=0,a=!1,l=0;for(let h=0;h<s;h++){const s=4*h,d=o[s],c=o[s+1],u=o[s+2],g=o[s+3];if((d>e||d===e&&u>=t)&&(d<i||d===i&&c<=n))a=!0;else{if(0===r&&(l=d),a){const e=4*r;o[e]=d-l,o[e+1]=c,o[e+2]=u,o[e+3]=g}r++}}return this._tokenCount=r,l}split(e,t,i,n){const o=this._tokens,s=this._tokenCount,r=[],a=[];let l=r,h=0,d=0;for(let r=0;r<s;r++){const s=4*r,c=o[s],u=o[s+1],g=o[s+2],p=o[s+3];if(c>e||c===e&&g>=t){if(c<i||c===i&&u<=n)continue;l!==a&&(l=a,h=0,d=c)}l[h++]=c-d,l[h++]=u,l[h++]=g,l[h++]=p}return[new Kze(new Uint32Array(r)),new Kze(new Uint32Array(a)),d]}acceptDeleteRange(e,t,i,n,o){const s=this._tokens,r=this._tokenCount,a=n-t;let l=0,h=!1;for(let d=0;d<r;d++){const c=4*d;let u=s[c],g=s[c+1],p=s[c+2];const m=s[c+3];if(u<t||u===t&&p<=i){l++;continue}if(u===t&&g<i)u===n&&p>o?p-=o-i:p=i;else if(u===t&&g===i){if(!(u===n&&p>o)){h=!0;continue}p-=o-i}else if(u<n||u===n&&g<o){if(!(u===n&&p>o)){h=!0;continue}u===t?(g=i,p=g+(p-o)):(g=0,p=g+(p-o))}else if(u>n){if(0===a&&!h){l=r;break}u-=a}else{if(!(u===n&&g>=o))throw new Error("Not possible!");e&&0===u&&(g+=e,p+=e),u-=a,g-=o-i,p-=o-i}const f=4*l;s[f]=u,s[f+1]=g,s[f+2]=p,s[f+3]=m,l++}this._tokenCount=l}acceptInsertText(e,t,i,n,o,s){const r=0===i&&1===n&&(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122),a=this._tokens,l=this._tokenCount;for(let s=0;s<l;s++){const l=4*s;let h=a[l],d=a[l+1],c=a[l+2];if(!(h<e||h===e&&c<t)){if(h===e&&c===t){if(!r)continue;c+=1}else if(h===e&&d<t&&t<c)0===i?c+=n:c=t;else{if(h===e&&d===t&&r)continue;if(h===e)if(h+=i,0===i)d+=n,c+=n;else{const e=c-d;d=o+(d-t),c=d+e}else h+=i}a[l]=h,a[l+1]=d,a[l+2]=c}}}}class jze{constructor(e){this._tokens=e}getCount(){return this._tokens.length/4}getStartCharacter(e){return this._tokens[4*e+1]}getEndCharacter(e){return this._tokens[4*e+2]}getMetadata(e){return this._tokens[4*e+3]}}var qze=function(e,t){return function(i,n){t(i,n,e)}};let $ze=class{constructor(e,t,i,n){this._legend=e,this._themeService=t,this._languageService=i,this._logService=n,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new Zze}getMetadata(e,t,i){const n=this._languageService.languageIdCodec.encodeLanguageId(i),o=this._hashTable.get(e,t,n);let s;if(o)s=o.metadata,this._logService.getLevel()===Zme.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${ufe.getForeground(s)}, fontStyle ${ufe.getFontStyle(s).toString(2)}`);else{let o=this._legend.tokenTypes[e];const r=[];if(o){let e=t;for(let t=0;e>0&&t<this._legend.tokenModifiers.length;t++)1&e&&r.push(this._legend.tokenModifiers[t]),e>>=1;e>0&&this._logService.getLevel()===Zme.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),r.push("not-in-legend"));const n=this._themeService.getColorTheme().getTokenStyleMetadata(o,r,i);void 0===n?s=2147483647:(s=0,void 0!==n.italic&&(s|=1|(n.italic?1:0)<<11),void 0!==n.bold&&(s|=2|(n.bold?2:0)<<11),void 0!==n.underline&&(s|=4|(n.underline?4:0)<<11),void 0!==n.strikethrough&&(s|=8|(n.strikethrough?8:0)<<11),n.foreground&&(s|=16|n.foreground<<15),0===s&&(s=2147483647))}else this._logService.getLevel()===Zme.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),s=2147483647,o="not-in-legend";this._hashTable.add(e,t,n,s),this._logService.getLevel()===Zme.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${o}) / ${t} (${r.join(" ")}): foreground ${ufe.getForeground(s)}, fontStyle ${ufe.getFontStyle(s).toString(2)}`)}return s}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,console.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,n,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,console.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${n} is outside the previous data (length ${o}).`))}};$ze=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([qze(1,uLe),qze(2,tge),qze(3,Gme)],$ze);class Gze{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}}class Zze{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=Zze._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<Zze._SIZES.length?2/3*this._currentLength:0),this._elements=[],Zze._nullOutEntries(this._elements,this._currentLength)}static _nullOutEntries(e,t){for(let i=0;i<t;i++)e[i]=null}_hash2(e,t){return(e<<5)-e+t|0}_hashFunc(e,t,i){return this._hash2(this._hash2(e,t),i)%this._currentLength}get(e,t,i){const n=this._hashFunc(e,t,i);let o=this._elements[n];for(;o;){if(o.tokenTypeIndex===e&&o.tokenModifierSet===t&&o.languageId===i)return o;o=o.next}return null}add(e,t,i,n){if(this._elementsCount++,0!==this._growCount&&this._elementsCount>=this._growCount){const e=this._elements;this._currentLengthIndex++,this._currentLength=Zze._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<Zze._SIZES.length?2/3*this._currentLength:0),this._elements=[],Zze._nullOutEntries(this._elements,this._currentLength);for(const t of e){let e=t;for(;e;){const t=e.next;e.next=null,this._add(e),e=t}}}this._add(new Gze(e,t,i,n))}_add(e){const t=this._hashFunc(e.tokenTypeIndex,e.tokenModifierSet,e.languageId);e.next=this._elements[t],this._elements[t]=e}}function Yze(e){const t=new Uint32Array(function(e){let t=0;if(t+=2,"full"===e.type)t+=1+e.data.length;else{t+=1,t+=3*e.deltas.length;for(const i of e.deltas)i.data&&(t+=i.data.length)}return t}(e));let i=0;if(t[i++]=e.id,"full"===e.type)t[i++]=1,t[i++]=e.data.length,t.set(e.data,i),i+=e.data.length;else{t[i++]=2,t[i++]=e.deltas.length;for(const n of e.deltas)t[i++]=n.start,t[i++]=n.deleteCount,n.data?(t[i++]=n.data.length,t.set(n.data,i),i+=n.data.length):t[i++]=0}return function(e){const t=new Uint8Array(e.buffer,e.byteOffset,4*e.length);return pse()||function(e){for(let t=0,i=e.length;t<i;t+=4){const i=e[t+0],n=e[t+1],o=e[t+2],s=e[t+3];e[t+0]=s,e[t+1]=o,e[t+2]=n,e[t+3]=i}}(t),xue.wrap(t)}(t)}Zze._SIZES=[3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143];var Qze=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Xze(e){return e&&!!e.data}function Jze(e){return e&&Array.isArray(e.edits)}class eHe{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function tHe(e,t){return e.has(t)}function iHe(e,t,i,n,o){return Qze(this,void 0,void 0,(function*(){const s=function(e,t){const i=e.orderedGroups(t);return i.length>0?i[0]:[]}(e,t),r=yield Promise.all(s.map((e=>Qze(this,void 0,void 0,(function*(){let s,r=null;try{s=yield e.provideDocumentSemanticTokens(t,e===i?n:null,o)}catch(e){r=e,s=null}return s&&(Xze(s)||Jze(s))||(s=null),new eHe(e,s,r)})))));for(const e of r){if(e.error)throw e.error;if(e.tokens)return e}return r.length>0?r[0]:null}))}class nHe{constructor(e,t){this.provider=e,this.tokens=t}}function oHe(e,t){const i=e.orderedGroups(t);return i.length>0?i[0]:[]}function sHe(e,t,i,n){return Qze(this,void 0,void 0,(function*(){const o=oHe(e,t),s=yield Promise.all(o.map((e=>Qze(this,void 0,void 0,(function*(){let o;try{o=yield e.provideDocumentRangeSemanticTokens(t,i,n)}catch(e){Hre(e),o=null}return o&&Xze(o)||(o=null),new nHe(e,o)})))));for(const e of s)if(e.tokens)return e;return s.length>0?s[0]:null}))}Wbe.registerCommand("_provideDocumentSemanticTokensLegend",((e,...t)=>Qze(void 0,void 0,void 0,(function*(){const[i]=t;Jse(i instanceof Sle);const n=e.get(Yge).getModel(i);if(!n)return;const{documentSemanticTokensProvider:o}=e.get(efe),s=function(e,t){const i=e.orderedGroups(t);return i.length>0?i[0]:null}(o,n);return s?s[0].getLegend():e.get(Bbe).executeCommand("_provideDocumentRangeSemanticTokensLegend",i)})))),Wbe.registerCommand("_provideDocumentSemanticTokens",((e,...t)=>Qze(void 0,void 0,void 0,(function*(){const[i]=t;Jse(i instanceof Sle);const n=e.get(Yge).getModel(i);if(!n)return;const{documentSemanticTokensProvider:o}=e.get(efe);if(!tHe(o,n))return e.get(Bbe).executeCommand("_provideDocumentRangeSemanticTokens",i,n.getFullModelRange());const s=yield iHe(o,n,null,null,Nae.None);if(!s)return;const{provider:r,tokens:a}=s;if(!a||!Xze(a))return;const l=Yze({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),l})))),Wbe.registerCommand("_provideDocumentRangeSemanticTokensLegend",((e,...t)=>Qze(void 0,void 0,void 0,(function*(){const[i,n]=t;Jse(i instanceof Sle);const o=e.get(Yge).getModel(i);if(!o)return;const{documentRangeSemanticTokensProvider:s}=e.get(efe),r=oHe(s,o);if(0===r.length)return;if(1===r.length)return r[0].getLegend();if(!n||!Ole.isIRange(n))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=yield sHe(s,o,Ole.lift(n),Nae.None);return a?a.provider.getLegend():void 0})))),Wbe.registerCommand("_provideDocumentRangeSemanticTokens",((e,...t)=>Qze(void 0,void 0,void 0,(function*(){const[i,n]=t;Jse(i instanceof Sle),Jse(Ole.isIRange(n));const o=e.get(Yge).getModel(i);if(!o)return;const{documentRangeSemanticTokensProvider:s}=e.get(efe),r=yield sHe(s,o,Ole.lift(n),Nae.None);return r&&r.tokens?Yze({id:0,type:"full",data:r.tokens.data}):void 0}))));var rHe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},aHe=function(e,t){return function(i,n){t(i,n,e)}};function lHe(e){return e.toString()}function hHe(e){const t=new Fpe,i=e.createSnapshot();let n;for(;n=i.read();)t.update(n);return t.digest()}class dHe{constructor(e,t,i){this._modelEventListeners=new rae,this.model=e,this._languageSelection=null,this._languageSelectionListener=null,this._modelEventListeners.add(e.onWillDispose((()=>t(e)))),this._modelEventListeners.add(e.onDidChangeLanguage((t=>i(e,t))))}_disposeLanguageSelection(){this._languageSelectionListener&&(this._languageSelectionListener.dispose(),this._languageSelectionListener=null)}dispose(){this._modelEventListeners.dispose(),this._disposeLanguageSelection()}setLanguage(e,t){this._disposeLanguageSelection(),this._languageSelection=e,this._languageSelectionListener=this._languageSelection.onDidChange((()=>this.model.setMode(e.languageId,t))),this.model.setMode(e.languageId,t)}}const cHe=ise||tse?1:2;class uHe{constructor(e,t,i,n,o,s,r,a){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=o,this.sha1=s,this.versionId=r,this.alternativeVersionId=a}}let gHe=class e extends aae{constructor(e,t,i,n,o,s,r,a,l){super(),this._configurationService=e,this._resourcePropertiesService=t,this._themeService=i,this._logService=n,this._undoRedoService=o,this._languageService=s,this._languageConfigurationService=r,this._languageFeatureDebounceService=a,this._onModelAdded=this._register(new bae),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new bae),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new bae),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._semanticStyling=this._register(new _He(this._themeService,this._languageService,this._logService)),this._register(this._configurationService.onDidChangeConfiguration((e=>this._updateModelOptions(e)))),this._updateModelOptions(void 0),this._register(new fHe(this._semanticStyling,this,this._themeService,this._configurationService,this._languageFeatureDebounceService,l))}static _readModelOptions(e,t){var i;let n=dre.tabSize;if(e.editor&&void 0!==e.editor.tabSize){const t=parseInt(e.editor.tabSize,10);isNaN(t)||(n=t),n<1&&(n=1)}let o="tabSize";if(e.editor&&void 0!==e.editor.indentSize&&"tabSize"!==e.editor.indentSize){const t=parseInt(e.editor.indentSize,10);isNaN(t)||(o=Math.max(t,1))}let s=dre.insertSpaces;e.editor&&void 0!==e.editor.insertSpaces&&(s="false"!==e.editor.insertSpaces&&Boolean(e.editor.insertSpaces));let r=cHe;const a=e.eol;"\r\n"===a?r=2:"\n"===a&&(r=1);let l=dre.trimAutoWhitespace;e.editor&&void 0!==e.editor.trimAutoWhitespace&&(l="false"!==e.editor.trimAutoWhitespace&&Boolean(e.editor.trimAutoWhitespace));let h=dre.detectIndentation;e.editor&&void 0!==e.editor.detectIndentation&&(h="false"!==e.editor.detectIndentation&&Boolean(e.editor.detectIndentation));let d=dre.largeFileOptimizations;e.editor&&void 0!==e.editor.largeFileOptimizations&&(d="false"!==e.editor.largeFileOptimizations&&Boolean(e.editor.largeFileOptimizations));let c=dre.bracketPairColorizationOptions;return(null===(i=e.editor)||void 0===i?void 0:i.bracketPairColorization)&&"object"==typeof e.editor.bracketPairColorization&&(c={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:n,indentSize:o,insertSpaces:s,detectIndentation:h,defaultEOL:r,trimAutoWhitespace:l,largeFileOptimizations:d,bracketPairColorizationOptions:c}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&"string"==typeof i&&"auto"!==i?i:3===cse||2===cse?"\n":"\r\n"}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return"boolean"!=typeof e||e}getCreationOptions(t,i,n){let o=this._modelCreationOptionsByLanguageAndResource[t+i];if(!o){const s=this._configurationService.getValue("editor",{overrideIdentifier:t,resource:i}),r=this._getEOL(i,t);o=e._readModelOptions({editor:s,eol:r},n),this._modelCreationOptionsByLanguageAndResource[t+i]=o}return o}_updateModelOptions(t){const i=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const n=Object.keys(this._models);for(let o=0,s=n.length;o<s;o++){const s=n[o],r=this._models[s],a=r.model.getLanguageId(),l=r.model.uri;if(t&&!t.affectsConfiguration("editor",{overrideIdentifier:a,resource:l})&&!t.affectsConfiguration("files.eol",{overrideIdentifier:a,resource:l}))continue;const h=i[a+l],d=this.getCreationOptions(a,l,r.model.isForSimpleWidget);e._setModelOptionsForModel(r.model,d,h)}}static _setModelOptionsForModel(e,t,i){i&&i.defaultEOL!==t.defaultEOL&&1===e.getLineCount()&&e.setEOL(1===t.defaultEOL?0:1),i&&i.detectIndentation===t.detectIndentation&&i.insertSpaces===t.insertSpaces&&i.tabSize===t.tabSize&&i.indentSize===t.indentSize&&i.trimAutoWhitespace===t.trimAutoWhitespace&&lre(i.bracketPairColorizationOptions,t.bracketPairColorizationOptions)||(t.detectIndentation?(e.detectIndentation(t.insertSpaces,t.tabSize),e.updateOptions({trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions})):e.updateOptions({insertSpaces:t.insertSpaces,tabSize:t.tabSize,indentSize:t.indentSize,trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions}))}_insertDisposedModel(e){this._disposedModels.set(lHe(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(lHe(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(lHe(e)),t}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){const t=[];for(this._disposedModels.forEach((e=>{e.sharesUndoRedoStack||t.push(e)})),t.sort(((e,t)=>e.time-t.time));t.length>0&&this._disposedModelsHeapSize>e;){const e=t.shift();this._removeDisposedModel(e.uri),null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){const o=this.getCreationOptions(t,i,n),s=new vTe(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(lHe(i))){const e=this._removeDisposedModel(i),t=this._undoRedoService.getElements(i),n=hHe(s)===e.sha1;if(n||e.sharesUndoRedoStack){for(const e of t.past)KIe(e)&&e.matchesResource(i)&&e.setModel(s);for(const e of t.future)KIe(e)&&e.matchesResource(i)&&e.setModel(s);this._undoRedoService.setElementsValidFlag(i,!0,(e=>KIe(e)&&e.matchesResource(i))),n&&(s._overwriteVersionId(e.versionId),s._overwriteAlternativeVersionId(e.alternativeVersionId),s._overwriteInitialUndoRedoSnapshot(e.initialUndoRedoSnapshot))}else null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}const r=lHe(s.uri);if(this._models[r])throw new Error("ModelService: Cannot add model because it already exists!");const a=new dHe(s,(e=>this._onWillDispose(e)),((e,t)=>this._onDidChangeLanguage(e,t)));return this._models[r]=a,a}createModel(e,t,i,n=!1){let o;return t?(o=this._createModelData(e,t.languageId,i,n),this.setMode(o.model,t)):o=this._createModelData(e,Dge,i,n),this._onModelAdded.fire(o.model),o.model}setMode(e,t,i){if(!t)return;const n=this._models[lHe(e.uri)];n&&n.setLanguage(t,i)}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push(this._models[n].model)}return e}getModel(e){const t=lHe(e),i=this._models[t];return i?i.model:null}getSemanticTokensProviderStyling(e){return this._semanticStyling.get(e)}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===_ve.file||e.scheme===_ve.vscodeRemote||e.scheme===_ve.vscodeUserData||e.scheme===_ve.vscodeNotebookCell||"fake-fs"===e.scheme}_onWillDispose(t){const i=lHe(t.uri),n=this._models[i],o=this._undoRedoService.getUriComparisonKey(t.uri)!==t.uri.toString();let s=!1,r=0;if(o||this._shouldRestoreUndoStack()&&this._schemaShouldMaintainUndoRedoElements(t.uri)){const e=this._undoRedoService.getElements(t.uri);if(e.past.length>0||e.future.length>0){for(const i of e.past)KIe(i)&&i.matchesResource(t.uri)&&(s=!0,r+=i.heapSize(t.uri),i.setModel(t.uri));for(const i of e.future)KIe(i)&&i.matchesResource(t.uri)&&(s=!0,r+=i.heapSize(t.uri),i.setModel(t.uri))}}const a=e.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK;if(s)if(!o&&r>a){const e=n.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(t.uri,!1,(e=>KIe(e)&&e.matchesResource(t.uri))),this._insertDisposedModel(new uHe(t.uri,n.model.getInitialUndoRedoSnapshot(),Date.now(),o,r,hHe(t),t.getVersionId(),t.getAlternativeVersionId()));else if(!o){const e=n.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}delete this._models[i],n.dispose(),delete this._modelCreationOptionsByLanguageAndResource[t.getLanguageId()+t.uri],this._onModelRemoved.fire(t)}_onDidChangeLanguage(t,i){const n=i.oldLanguage,o=t.getLanguageId(),s=this.getCreationOptions(n,t.uri,t.isForSimpleWidget),r=this.getCreationOptions(o,t.uri,t.isForSimpleWidget);e._setModelOptionsForModel(t,r,s),this._onModelModeChanged.fire({model:t,oldLanguageId:n})}};gHe.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20971520,gHe=rHe([aHe(0,Zue),aHe(1,$me),aHe(2,uLe),aHe(3,Gme),aHe(4,hTe),aHe(5,tge),aHe(6,Oge),aHe(7,YBe),aHe(8,efe)],gHe);const pHe="editor.semanticHighlighting";function mHe(e,t,i){var n;const o=null===(n=i.getValue(pHe,{overrideIdentifier:e.getLanguageId(),resource:e.uri}))||void 0===n?void 0:n.enabled;return"boolean"==typeof o?o:t.getColorTheme().semanticHighlighting}let fHe=class extends aae{constructor(e,t,i,n,o,s){super(),this._watchers=Object.create(null),this._semanticStyling=e;const r=e=>{this._watchers[e.uri.toString()]=new bHe(e,this._semanticStyling,i,o,s)},a=(e,t)=>{t.dispose(),delete this._watchers[e.uri.toString()]},l=()=>{for(const e of t.getModels()){const t=this._watchers[e.uri.toString()];mHe(e,i,n)?t||r(e):t&&a(e,t)}};this._register(t.onModelAdded((e=>{mHe(e,i,n)&&r(e)}))),this._register(t.onModelRemoved((e=>{const t=this._watchers[e.uri.toString()];t&&a(e,t)}))),this._register(n.onDidChangeConfiguration((e=>{e.affectsConfiguration(pHe)&&l()}))),this._register(i.onDidColorThemeChange(l))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};fHe=rHe([aHe(1,Yge),aHe(2,uLe),aHe(3,Zue),aHe(4,YBe),aHe(5,efe)],fHe);class _He extends aae{constructor(e,t,i){super(),this._themeService=e,this._languageService=t,this._logService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange((()=>{this._caches=new WeakMap})))}get(e){return this._caches.has(e)||this._caches.set(e,new $ze(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}}class vHe{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}let bHe=class e extends aae{constructor(t,i,n,o,s){super(),this._isDisposed=!1,this._model=t,this._semanticStyling=i,this._provider=s.documentSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentSemanticTokens",{min:e.REQUEST_MIN_DELAY,max:e.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new hpe((()=>this._fetchDocumentSemanticTokensNow()),e.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent((()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._register(this._model.onDidChangeLanguage((()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)})));const r=()=>{nae(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const e of this._provider.all(t))"function"==typeof e.onDidChange&&this._documentProvidersChangeListeners.push(e.onDidChange((()=>{this._currentDocumentRequestCancellationTokenSource?this._providersChangedDuringRequest=!0:this._fetchDocumentSemanticTokens.schedule(0)})))};r(),this._register(this._provider.onDidChange((()=>{r(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._register(n.onDidColorThemeChange((e=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!tHe(this._provider,this._model))return void(this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1));const e=new Mae,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=iHe(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],s=this._model.onDidChangeContent((e=>{o.push(e)})),r=new gae(!1);n.then((e=>{if(this._debounceInformation.update(this._model,r.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),e){const{provider:t,tokens:i}=e,n=this._semanticStyling.get(t);this._setDocumentSemanticTokens(t,i||null,n,o)}else this._setDocumentSemanticTokens(null,null,null,o)}),(e=>{e&&(jre(e)||"string"==typeof e.message&&-1!==e.message.indexOf("busy"))||zre(e),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))}))}static _copy(e,t,i,n,o){o=Math.min(o,i.length-n,e.length-t);for(let s=0;s<o;s++)i[n+s]=e[t+s]}_setDocumentSemanticTokens(t,i,n,o){const s=this._currentDocumentResponse,r=()=>{(o.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed)t&&i&&t.releaseDocumentSemanticTokens(i.resultId);else if(t&&n){if(!i)return this._model.tokenization.setSemanticTokens(null,!0),void r();if(Jze(i)){if(!s)return void this._model.tokenization.setSemanticTokens(null,!0);if(0===i.edits.length)i={resultId:i.resultId,data:s.data};else{let t=0;for(const e of i.edits)t+=(e.data?e.data.length:0)-e.deleteCount;const o=s.data,r=new Uint32Array(o.length+t);let a=o.length,l=r.length;for(let t=i.edits.length-1;t>=0;t--){const h=i.edits[t];if(h.start>o.length)return n.warnInvalidEditStart(s.resultId,i.resultId,t,h.start,o.length),void this._model.tokenization.setSemanticTokens(null,!0);const d=a-(h.start+h.deleteCount);d>0&&(e._copy(o,a-d,r,l-d,d),l-=d),h.data&&(e._copy(h.data,0,r,l-h.data.length,h.data.length),l-=h.data.length),a=h.start}a>0&&e._copy(o,0,r,0,a),i={resultId:i.resultId,data:r}}}if(Xze(i)){this._currentDocumentResponse=new vHe(t,i.resultId,i.data);const e=function(e,t,i){const n=e.data,o=e.data.length/5|0,s=Math.max(Math.ceil(o/1024),400),r=[];let a=0,l=1,h=0;for(;a<o;){const e=a;let d=Math.min(e+s,o);if(d<o){let t=d;for(;t-1>e&&0===n[5*t];)t--;if(t-1===e){let e=d;for(;e+1<o&&0===n[5*e];)e++;d=e}else d=t}let c=new Uint32Array(4*(d-e)),u=0,g=0,p=0,m=0;for(;a<d;){const e=5*a,o=n[e],s=n[e+1],r=l+o|0,d=0===o?h+s|0:s,f=d+n[e+2]|0,_=n[e+3],v=n[e+4];if(f<=d)t.warnInvalidLengthSemanticTokens(r,d+1);else if(p===r&&m>d)t.warnOverlappingSemanticTokens(r,d+1);else{const e=t.getMetadata(_,v,i);2147483647!==e&&(0===g&&(g=r),c[u]=r-g,c[u+1]=d,c[u+2]=f,c[u+3]=e,u+=4,p=r,m=f)}l=r,h=d,a++}u!==c.length&&(c=c.subarray(0,u));const f=Uze.create(g,c);r.push(f)}return r}(i,n,this._model.getLanguageId());if(o.length>0)for(const t of o)for(const i of e)for(const e of t.changes)i.applyEdit(e.range,e.text);this._model.tokenization.setSemanticTokens(e,!0)}else this._model.tokenization.setSemanticTokens(null,!0);r()}else this._model.tokenization.setSemanticTokens(null,!1)}};bHe.REQUEST_MIN_DELAY=300,bHe.REQUEST_MAX_DELAY=2e3,bHe=rHe([aHe(2,uLe),aHe(3,YBe),aHe(4,efe)],bHe);var wHe=i(8425),CHe={};CHe.styleTagTransform=Vr(),CHe.setAttributes=Pr(),CHe.insert=Rr().bind(null,"head"),CHe.domAPI=Tr(),CHe.insertStyleElement=Br(),Ir()(wHe.Z,CHe),wHe.Z&&wHe.Z.locals&&wHe.Z.locals;var yHe=i(7176),SHe={};SHe.styleTagTransform=Vr(),SHe.setAttributes=Pr(),SHe.insert=Rr().bind(null,"head"),SHe.domAPI=Tr(),SHe.insertStyleElement=Br(),Ir()(yHe.Z,SHe),yHe.Z&&yHe.Z.locals&&yHe.Z.locals,Owe.white.toString(),Owe.white.toString();class kHe extends aae{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._onDidClick=this._register(new bae),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button");const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,n=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=n||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),e.appendChild(this._element),this._register(Nwe.addTarget(this._element)),[Yve.CLICK,Ewe.Tap].forEach((e=>{this._register(Lve(this._element,e,(e=>{this.enabled?this._onDidClick.fire(e):Qve(e)})))})),this._register(Lve(this._element,Yve.KEY_DOWN,(e=>{const t=new p_e(e);let i=!1;this.enabled&&(t.equals(3)||t.equals(10))?(this._onDidClick.fire(e),i=!0):t.equals(9)&&(this._element.blur(),i=!0),i&&Qve(t,!0)}))),this._register(Lve(this._element,Yve.MOUSE_OVER,(e=>{this._element.classList.contains("disabled")||this.updateBackground(!0)}))),this._register(Lve(this._element,Yve.MOUSE_OUT,(e=>{this.updateBackground(!1)}))),this.focusTracker=this._register(Jve(this._element)),this._register(this.focusTracker.onDidFocus((()=>{this.enabled&&this.updateBackground(!0)}))),this._register(this.focusTracker.onDidBlur((()=>{this.enabled&&this.updateBackground(!1)})))}getContentElements(e){const t=[];for(let i of sPe(e))if("string"==typeof i){if(i=i.trim(),""===i)continue;const e=document.createElement("span");e.textContent=i,t.push(e)}else t.push(i);return t}updateBackground(e){let t;t=this.options.secondary?e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){this._element.classList.add("monaco-text-button");const t=this.options.supportShortLabel?this._labelElement:this._element;this.options.supportIcons?tbe(t,...this.getContentElements(e)):t.textContent=e,"string"==typeof this.options.title?this._element.title=this.options.title:this.options.title&&(this._element.title=e)}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}}var LHe=i(6242),xHe={};xHe.styleTagTransform=Vr(),xHe.setAttributes=Pr(),xHe.insert=Rr().bind(null,"head"),xHe.domAPI=Tr(),xHe.insertStyleElement=Br(),Ir()(LHe.Z,xHe),LHe.Z&&LHe.Z.locals&&LHe.Z.locals;class DHe{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=ebe(e,sbe(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){var e,t;this.element.textContent=$he(this.countFormat,this.count),this.element.title=$he(this.titleFormat,this.count),this.element.style.backgroundColor=null!==(e=this.styles.badgeBackground)&&void 0!==e?e:"",this.element.style.color=null!==(t=this.styles.badgeForeground)&&void 0!==t?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}var EHe=i(4808),NHe={};NHe.styleTagTransform=Vr(),NHe.setAttributes=Pr(),NHe.insert=Rr().bind(null,"head"),NHe.domAPI=Tr(),NHe.insertStyleElement=Br(),Ir()(EHe.Z,NHe),EHe.Z&&EHe.Z.locals&&EHe.Z.locals;const IHe="done",MHe="active",THe="infinite",AHe="infinite-long-running",RHe="discrete";class OHe extends aae{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new hpe((()=>rbe(this.element)),0)),this.longRunningScheduler=this._register(new hpe((()=>this.infiniteLongRunning()),OHe.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=(null==t?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(MHe,THe,AHe,RHe),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(IHe),this.element.classList.contains(THe)?(this.bit.style.opacity="0",e?setTimeout((()=>this.off()),200):this.off()):(this.bit.style.width="inherit",e?setTimeout((()=>this.off()),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(RHe,IHe,AHe),this.element.classList.add(MHe,THe),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(AHe)}getContainer(){return this.element}}OHe.LONG_RUNNING_INFINITE_THRESHOLD=1e4;var PHe=i(2647),FHe={};FHe.styleTagTransform=Vr(),FHe.setAttributes=Pr(),FHe.insert=Rr().bind(null,"head"),FHe.domAPI=Tr(),FHe.insertStyleElement=Br(),Ir()(PHe.Z,FHe),PHe.Z&&PHe.Z.locals&&PHe.Z.locals;class BHe extends Ske{constructor(e){super(),this._onChange=this._register(new bae),this.onChange=this._onChange.event,this._onKeyDown=this._register(new bae),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...Ibe.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this.domNode.title=this._opts.title,this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,(e=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),e.preventDefault())})),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,(e=>{if(10===e.keyCode||3===e.keyCode)return this.checked=!this._checked,this._onChange.fire(!0),e.preventDefault(),void e.stopPropagation();this._onKeyDown.fire(e)}))}get enabled(){return"true"!==this.domNode.getAttribute("aria-disabled")}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}var WHe=i(4548),VHe={};VHe.styleTagTransform=Vr(),VHe.setAttributes=Pr(),VHe.insert=Rr().bind(null,"head"),VHe.domAPI=Tr(),VHe.insertStyleElement=Br(),Ir()(WHe.Z,VHe),WHe.Z&&WHe.Z.locals&&WHe.Z.locals;const zHe={},HHe=new aPe("quick-input-button-icon-");function UHe(e){if(!e)return;let t;const i=e.dark.toString();return zHe[i]?t=zHe[i]:(t=HHe.nextId(),Gve(`.${t}, .hc-light .${t}`,`background-image: ${dbe(e.light||e.dark)}`),Gve(`.vs-dark .${t}, .hc-black .${t}`,`background-image: ${dbe(e.dark)}`),zHe[i]=t),t}const KHe={ctrlCmd:!1,alt:!1};var jHe,qHe;!function(e){e[e.Blur=1]="Blur",e[e.Gesture=2]="Gesture",e[e.Other=3]="Other"}(jHe||(jHe={})),function(e){e[e.NONE=0]="NONE",e[e.FIRST=1]="FIRST",e[e.SECOND=2]="SECOND",e[e.LAST=3]="LAST"}(qHe||(qHe={})),new class{constructor(e){this.options=e}};const $He=Toe(0,"Match Case"),GHe=Toe(0,"Match Whole Word"),ZHe=Toe(0,"Use Regular Expression");class YHe extends BHe{constructor(e){super({icon:Vle.caseSensitive,title:$He+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class QHe extends BHe{constructor(e){super({icon:Vle.wholeWord,title:GHe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class XHe extends BHe{constructor(e){super({icon:Vle.regex,title:ZHe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class JHe{constructor(e,t=0,i=e.length,n=t-1){this.items=e,this.start=t,this.end=i,this.index=n}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class eUe{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._currentPosition()!==this._elements.length-1?this._navigator.next():null}previous(){return 0!==this._currentPosition()?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()===this._elements.length-1}isNowhere(){return null===this._navigator.current()}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new JHe(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach((t=>e.push(t))),e}}var tUe=i(4280),iUe={};iUe.styleTagTransform=Vr(),iUe.setAttributes=Pr(),iUe.insert=Rr().bind(null,"head"),iUe.domAPI=Tr(),iUe.insertStyleElement=Br(),Ir()(tUe.Z,iUe),tUe.Z&&tUe.Z.locals&&tUe.Z.locals;const nUe=sbe;class oUe extends Ske{constructor(e,t,i){var n;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new bae),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new bae),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=null!==(n=this.options.tooltip)&&void 0!==n?n:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=ebe(e,nUe(".monaco-inputbox.idle"));const o=this.options.flexibleHeight?"textarea":"input",s=ebe(this.element,nUe(".ibwrapper"));if(this.input=ebe(s,nUe(o+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,(()=>this.element.classList.add("synthetic-focus"))),this.onblur(this.input,(()=>this.element.classList.remove("synthetic-focus"))),this.options.flexibleHeight){this.maxHeight="number"==typeof this.options.flexibleMaxHeight?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=ebe(s,nUe("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new Hke(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),ebe(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll((e=>this.input.scrollTop=e.scrollTop)));const t=this._register(new Yke(document,"selectionchange")),i=pae.filter(t.event,(()=>{const e=document.getSelection();return(null==e?void 0:e.anchorNode)===s}));this._register(i(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,(()=>this.onValueChange())),this.onblur(this.input,(()=>this.onBlur())),this.onfocus(this.input,(()=>this.onFocus())),this._register(this.ignoreGesture(this.input)),setTimeout((()=>this.updateMirror()),0),this.options.actions&&(this.actionbar=this._register(new EFe(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.input.title=e}setAriaLabel(e){this.ariaLabel=e,e?this.input.setAttribute("aria-label",this.ariaLabel):this.input.removeAttribute("aria-label")}getAriaLabel(){return this.ariaLabel}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return"number"==typeof this.cachedHeight?this.cachedHeight:Bve(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===this.input}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if("number"!=typeof this.cachedContentHeight||"number"!=typeof this.cachedHeight||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${ube(i.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),null==e?void 0:e.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=Ove(this.element)+"px";let i;this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:i=>{var n,o;if(!this.message)return null;e=ebe(i,nUe(".monaco-inputbox-container")),t();const s={inline:!0,className:"monaco-inputbox-message"},r=this.message.formatContent?JOe(this.message.content,s):function(e,t={}){const i=ePe(t);return i.textContent=e,i}(this.message.content,s);r.classList.add(this.classForType(this.message.type));const a=this.stylesForType(this.message.type);return r.style.backgroundColor=null!==(n=a.background)&&void 0!==n?n:"",r.style.color=null!==(o=a.foreground)&&void 0!==o?o:"",r.style.border=a.border?`1px solid ${a.border}`:"",ebe(e,r),null},onHide:()=>{this.state="closed"},layout:t}),i=3===this.message.type?Toe(0,"Error: {0}",this.message.content):2===this.message.type?Toe(0,"Warning: {0}",this.message.content):Toe(0,"Info: {0}",this.message.content),kbe(i),this.state="open"}_hideMessage(){this.contextViewProvider&&("open"===this.state&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),"open"===this.state&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,t=10===e.charCodeAt(e.length-1)?" ":"";(e+t).replace(/\u000c/g,"")?this.mirror.textContent=e+t:this.mirror.innerText=" ",this.layout()}applyStyles(){var e,t,i;const n=this.options.inputBoxStyles,o=null!==(e=n.inputBackground)&&void 0!==e?e:"",s=null!==(t=n.inputForeground)&&void 0!==t?t:"",r=null!==(i=n.inputBorder)&&void 0!==i?i:"";this.element.style.backgroundColor=o,this.element.style.color=s,this.input.style.backgroundColor="inherit",this.input.style.color=s,this.element.style.border=`1px solid ${ube(r,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=Bve(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,n=t.selectionEnd,o=t.value;null!==i&&null!==n&&(this.value=o.substr(0,i)+e+o.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,null===(e=this.actionbar)||void 0===e||e.dispose(),super.dispose()}}class sUe extends oUe{constructor(e,t,i){const n=Toe(0,"for history"),o=` or ⇅ ${n}`,s=` (⇅ ${n})`;super(e,t,i),this._onDidFocus=this._register(new bae),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new bae),this.onDidBlur=this._onDidBlur.event,this.history=new eUe(i.history,100);const r=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(o)&&!this.placeholder.endsWith(s)&&this.history.getHistory().length){const e=this.placeholder.endsWith(")")?o:s,t=this.placeholder+e;i.showPlaceholderOnFocus&&document.activeElement!==this.input?this.placeholder=t:this.setPlaceHolder(t)}};this.observer=new MutationObserver(((e,t)=>{e.forEach((e=>{e.target.textContent||r()}))})),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,(()=>r())),this.onblur(this.input,(()=>{const e=e=>{if(this.placeholder.endsWith(e)){const t=this.placeholder.slice(0,this.placeholder.length-e.length);return i.showPlaceholderOnFocus?this.placeholder=t:this.setPlaceHolder(t),!0}return!1};e(s)||e(o)}))}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),e&&(this.value=e,Lbe(this.value))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,Lbe(this.value))}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()||this.history.last()}}var rUe=i(7779),aUe={};aUe.styleTagTransform=Vr(),aUe.setAttributes=Pr(),aUe.insert=Rr().bind(null,"head"),aUe.domAPI=Tr(),aUe.insertStyleElement=Br(),Ir()(rUe.Z,aUe),rUe.Z&&rUe.Z.locals&&rUe.Z.locals;const lUe=Toe(0,"input");class hUe extends Ske{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=new rae,this.additionalToggles=[],this._onDidOptionChange=this._register(new bae),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new bae),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new bae),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new bae),this._onKeyUp=this._register(new bae),this._onCaseSensitiveKeyDown=this._register(new bae),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new bae),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||lUe,this.showCommonFindToggles=!!i.showCommonFindToggles;const n=i.appendCaseSensitiveLabel||"",o=i.appendWholeWordsLabel||"",s=i.appendRegexLabel||"",r=i.history||[],a=!!i.flexibleHeight,l=!!i.flexibleWidth,h=i.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new sUe(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:r,showHistoryHint:i.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:h,inputBoxStyles:i.inputBoxStyles})),this.showCommonFindToggles){this.regex=this._register(new XHe(Object.assign({appendTitle:s,isChecked:!1},i.toggleStyles))),this._register(this.regex.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.regex.onKeyDown((e=>{this._onRegexKeyDown.fire(e)}))),this.wholeWords=this._register(new QHe(Object.assign({appendTitle:o,isChecked:!1},i.toggleStyles))),this._register(this.wholeWords.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this.caseSensitive=this._register(new YHe(Object.assign({appendTitle:n,isChecked:!1},i.toggleStyles))),this._register(this.caseSensitive.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.caseSensitive.onKeyDown((e=>{this._onCaseSensitiveKeyDown.fire(e)})));const e=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,(t=>{if(t.equals(15)||t.equals(17)||t.equals(9)){const i=e.indexOf(document.activeElement);if(i>=0){let n=-1;t.equals(17)?n=(i+1)%e.length:t.equals(15)&&(n=0===i?e.length-1:i-1),t.equals(9)?(e[i].blur(),this.inputBox.focus()):n>=0&&e[n].focus(),Qve(t,!0)}}}))}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"block":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(null==i?void 0:i.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),null==e||e.appendChild(this.domNode),this._register(Lve(this.inputBox.inputElement,"compositionstart",(e=>{this.imeSessionInProgress=!0}))),this._register(Lve(this.inputBox.inputElement,"compositionend",(e=>{this.imeSessionInProgress=!1,this._onInput.fire()}))),this.onkeydown(this.inputBox.inputElement,(e=>this._onKeyDown.fire(e))),this.onkeyup(this.inputBox.inputElement,(e=>this._onKeyUp.fire(e))),this.oninput(this.inputBox.inputElement,(e=>this._onInput.fire())),this.onmousedown(this.inputBox.inputElement,(e=>this._onMouseDown.fire(e)))}get onDidChange(){return this.inputBox.onDidChange}enable(){var e,t,i;this.domNode.classList.remove("disabled"),this.inputBox.enable(),null===(e=this.regex)||void 0===e||e.enable(),null===(t=this.wholeWords)||void 0===t||t.enable(),null===(i=this.caseSensitive)||void 0===i||i.enable();for(const e of this.additionalToggles)e.enable()}disable(){var e,t,i;this.domNode.classList.add("disabled"),this.inputBox.disable(),null===(e=this.regex)||void 0===e||e.disable(),null===(t=this.wholeWords)||void 0===t||t.disable(),null===(i=this.caseSensitive)||void 0===i||i.disable();for(const e of this.additionalToggles)e.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){var t,i,n,o,s,r;for(const e of this.additionalToggles)e.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.dispose(),this.additionalTogglesDisposables=new rae;for(const t of null!=e?e:[])this.additionalTogglesDisposables.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.add(t.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()}))),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display="block"),this.inputBox.paddingRight=(null!==(i=null===(t=this.caseSensitive)||void 0===t?void 0:t.width())&&void 0!==i?i:0)+(null!==(o=null===(n=this.wholeWords)||void 0===n?void 0:n.width())&&void 0!==o?o:0)+(null!==(r=null===(s=this.regex)||void 0===s?void 0:s.width())&&void 0!==r?r:0)+this.additionalToggles.reduce(((e,t)=>e+t.width()),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e,t;return null!==(t=null===(e=this.caseSensitive)||void 0===e?void 0:e.checked)&&void 0!==t&&t}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,t;return null!==(t=null===(e=this.wholeWords)||void 0===e?void 0:e.checked)&&void 0!==t&&t}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,t;return null!==(t=null===(e=this.regex)||void 0===e?void 0:e.checked)&&void 0!==t&&t}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;null===(e=this.caseSensitive)||void 0===e||e.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}const dUe=sbe;class cUe extends aae{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=e=>Lve(this.findInput.inputBox.inputElement,Yve.KEY_DOWN,(t=>{e(new p_e(t))})),this.onMouseDown=e=>Lve(this.findInput.inputBox.inputElement,Yve.MOUSE_DOWN,(t=>{e(new b_e(t))})),this.onDidChange=e=>this.findInput.onDidChange(e),this.container=ebe(this.parent,dUe(".quick-input-box")),this.findInput=this._register(new hUe(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}))}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get ariaLabel(){return this.findInput.inputBox.getAriaLabel()}set ariaLabel(e){this.findInput.inputBox.setAriaLabel(e)}get password(){return"password"===this.findInput.inputBox.inputElement.type}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.findInput.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===YAe.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===YAe.Info?1:e===YAe.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===YAe.Info?1:e===YAe.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}var uUe=i(3241),gUe={};gUe.styleTagTransform=Vr(),gUe.setAttributes=Pr(),gUe.insert=Rr().bind(null,"head"),gUe.domAPI=Tr(),gUe.insertStyleElement=Br(),Ir()(uUe.Z,gUe),uUe.Z&&uUe.Z.locals&&uUe.Z.locals;class pUe{constructor(e,t){var i;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=null!==(i=null==t?void 0:t.supportIcons)&&void 0!==i&&i,this.domNode=ebe(e,sbe("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",n){e||(e=""),n&&(e=pUe.escapeNewLines(e,t)),this.didEverRender&&this.text===e&&this.title===i&&lre(this.highlights,t)||(this.text=e,this.title=i,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const i of this.highlights){if(i.end===i.start)continue;if(t<i.start){const n=this.text.substring(t,i.start);this.supportIcons?e.push(...sPe(n)):e.push(n),t=i.start}const n=this.text.substring(t,i.end),o=sbe("span.highlight",void 0,...this.supportIcons?sPe(n):[n]);i.extraClasses&&o.classList.add(...i.extraClasses),e.push(o),t=i.end}if(t<this.text.length){const i=this.text.substring(t);this.supportIcons?e.push(...sPe(i)):e.push(i)}tbe(this.domNode,...e),this.title?this.domNode.title=this.title:this.domNode.removeAttribute("title"),this.didEverRender=!0}static escapeNewLines(e,t){let i=0,n=0;return e.replace(/\r\n|\r|\n/g,((e,o)=>{n="\r\n"===e?-1:0,o+=i;for(const e of t)e.end<=o||(e.start>=o&&(e.start+=n),e.end>=o&&(e.end+=n));return i+=n,"⏎"}))}}class mUe{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class fUe extends aae{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new mUe(ebe(e,sbe(".monaco-icon-label")))),this.labelContainer=ebe(this.domNode.element,sbe(".monaco-icon-label-container"));const i=ebe(this.labelContainer,sbe("span.monaco-icon-name-container"));(null==t?void 0:t.supportHighlights)||(null==t?void 0:t.supportIcons)?this.nameNode=new vUe(i,!!t.supportIcons):this.nameNode=new _Ue(i),this.hoverDelegate=null==t?void 0:t.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,i){const n=["monaco-icon-label"],o=["monaco-icon-label-container"];if(i&&(i.extraClasses&&n.push(...i.extraClasses),i.italic&&n.push("italic"),i.strikethrough&&n.push("strikethrough"),i.disabledCommand&&o.push("disabled")),this.domNode.className=n.join(" "),this.labelContainer.className=o.join(" "),this.setupHover((null==i?void 0:i.descriptionTitle)?this.labelContainer:this.element,null==i?void 0:i.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const e=this.getOrCreateDescriptionNode();e instanceof pUe?(e.set(t||"",i?i.descriptionMatches:void 0,void 0,null==i?void 0:i.labelEscapeNewLines),this.setupHover(e.element,null==i?void 0:i.descriptionTitle)):(e.textContent=t&&(null==i?void 0:i.labelEscapeNewLines)?pUe.escapeNewLines(t,[]):t||"",this.setupHover(e.element,(null==i?void 0:i.descriptionTitle)||""),e.empty=!t)}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),t)if(this.hoverDelegate){const i=XOe(this.hoverDelegate,e,t);i&&this.customHovers.set(e,i)}else!function(e,t){Kse(t)?e.title=HOe(t):(null==t?void 0:t.markdownNotSupportedFallback)?e.title=t.markdownNotSupportedFallback:e.removeAttribute("title")}(e,t);else e.removeAttribute("title")}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new mUe(ebe(this.labelContainer,sbe("span.monaco-icon-description-container"))));(null===(e=this.creationOptions)||void 0===e?void 0:e.supportDescriptionHighlights)?this.descriptionNode=new pUe(ebe(t.element,sbe("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new mUe(ebe(t.element,sbe("span.label-description"))))}return this.descriptionNode}}class _Ue{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!lre(this.options,t))if(this.label=e,this.options=t,"string"==typeof e)this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=ebe(this.container,sbe("a.label-name",{id:null==t?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i<e.length;i++){const n=e[i],o=(null==t?void 0:t.domId)&&`${null==t?void 0:t.domId}_${i}`;ebe(this.container,sbe("a.label-name",{id:o,"data-icon-label-count":e.length,"data-icon-label-index":i,role:"treeitem"},n)),i<e.length-1&&ebe(this.container,sbe("span.label-separator",void 0,(null==t?void 0:t.separator)||"/"))}}}}class vUe{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!lre(this.options,t))if(this.label=e,this.options=t,"string"==typeof e)this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=new pUe(ebe(this.container,sbe("a.label-name",{id:null==t?void 0:t.domId})),{supportIcons:this.supportIcons})),this.singleLabel.set(e,null==t?void 0:t.matches,void 0,null==t?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=(null==t?void 0:t.separator)||"/",n=function(e,t,i){if(!i)return;let n=0;return e.map((e=>{const o={start:n,end:n+e.length},s=i.map((e=>CPe.intersect(o,e))).filter((e=>!CPe.isEmpty(e))).map((({start:e,end:t})=>({start:e-n,end:t-n})));return n=o.end+t.length,s}))}(e,i,null==t?void 0:t.matches);for(let o=0;o<e.length;o++){const s=e[o],r=n?n[o]:void 0,a=sbe("a.label-name",{id:(null==t?void 0:t.domId)&&`${null==t?void 0:t.domId}_${o}`,"data-icon-label-count":e.length,"data-icon-label-index":o,role:"treeitem"});new pUe(ebe(this.container,a),{supportIcons:this.supportIcons}).set(s,r,void 0,null==t?void 0:t.labelEscapeNewLines),o<e.length-1&&ebe(a,sbe("span.label-separator",void 0,i))}}}}var bUe=i(6390),wUe={};wUe.styleTagTransform=Vr(),wUe.setAttributes=Pr(),wUe.insert=Rr().bind(null,"head"),wUe.domAPI=Tr(),wUe.insertStyleElement=Br(),Ir()(bUe.Z,wUe),bUe.Z&&bUe.Z.locals&&bUe.Z.locals;const CUe=sbe;class yUe{constructor(e,t,i){this.os=t,this.keyElements=new Set,this.options=i||Object.create(null),this.labelBackground=this.options.keybindingLabelBackground,this.labelBorder=this.options.keybindingLabelBorder,this.labelBottomBorder=this.options.keybindingLabelBottomBorder,this.labelShadow=this.options.keybindingLabelShadow;const n=this.options.keybindingLabelForeground;this.domNode=ebe(e,CUe(".monaco-keybinding")),n&&(this.domNode.style.color=n),this.didEverRender=!1,e.appendChild(this.domNode)}get element(){return this.domNode}set(e,t){this.didEverRender&&this.keybinding===e&&yUe.areSame(this.matches,t)||(this.keybinding=e,this.matches=t,this.render())}render(){var e;if(this.clear(),this.keybinding){const[t,i]=this.keybinding.getChords();t&&this.renderChord(this.domNode,t,this.matches?this.matches.firstPart:null),i&&(ebe(this.domNode,CUe("span.monaco-keybinding-key-chord-separator",void 0," ")),this.renderChord(this.domNode,i,this.matches?this.matches.chordPart:null));const n=null!==(e=this.options.disableTitle)&&void 0!==e&&e?void 0:this.keybinding.getAriaLabel()||void 0;void 0!==n?this.domNode.title=n:this.domNode.removeAttribute("title")}else this.options&&this.options.renderUnboundKeybindings&&this.renderUnbound(this.domNode);this.didEverRender=!0}clear(){yve(this.domNode),this.keyElements.clear()}renderChord(e,t,i){const n=xWe.modifierLabels[this.os];t.ctrlKey&&this.renderKey(e,n.ctrlKey,Boolean(null==i?void 0:i.ctrlKey),n.separator),t.shiftKey&&this.renderKey(e,n.shiftKey,Boolean(null==i?void 0:i.shiftKey),n.separator),t.altKey&&this.renderKey(e,n.altKey,Boolean(null==i?void 0:i.altKey),n.separator),t.metaKey&&this.renderKey(e,n.metaKey,Boolean(null==i?void 0:i.metaKey),n.separator);const o=t.keyLabel;o&&this.renderKey(e,o,Boolean(null==i?void 0:i.keyCode),"")}renderKey(e,t,i,n){ebe(e,this.createKeyElement(t,i?".highlight":"")),n&&ebe(e,CUe("span.monaco-keybinding-key-separator",void 0,n))}renderUnbound(e){ebe(e,this.createKeyElement(Toe(0,"Unbound")))}createKeyElement(e,t=""){const i=CUe("span.monaco-keybinding-key"+t,void 0,e);return this.keyElements.add(i),this.labelBackground&&(i.style.backgroundColor=this.labelBackground),this.labelBorder&&(i.style.borderColor=this.labelBorder),this.labelBottomBorder&&(i.style.borderBottomColor=this.labelBottomBorder),this.labelShadow&&(i.style.boxShadow=`inset 0 -1px 0 ${this.labelShadow}`),i}static areSame(e,t){return e===t||!e&&!t||!!e&&!!t&&lre(e.firstPart,t.firstPart)&&lre(e.chordPart,t.chordPart)}}const SUe=new jhe((()=>{const e=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:e,collatorIsNumeric:e.resolvedOptions().numeric}}));new jhe((()=>({collator:new Intl.Collator(void 0,{numeric:!0})}))),new jhe((()=>({collator:new Intl.Collator(void 0,{numeric:!0,sensitivity:"accent"})})));var kUe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};const LUe=sbe;class xUe{get checked(){return!!this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire(e))}constructor(e){this.hidden=!1,this._onChecked=new bae,this.onChecked=this._onChecked.event,Object.assign(this,e)}dispose(){this._onChecked.dispose()}}class DUe{get templateId(){return DUe.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=ebe(e,LUe(".quick-input-list-entry"));const i=ebe(t.entry,LUe("label.quick-input-list-label"));t.toDisposeTemplate.push(xve(i,Yve.CLICK,(e=>{t.checkbox.offsetParent||e.preventDefault()}))),t.checkbox=ebe(i,LUe("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(xve(t.checkbox,Yve.CHANGE,(e=>{t.element.checked=t.checkbox.checked})));const n=ebe(i,LUe(".quick-input-list-rows")),o=ebe(n,LUe(".quick-input-list-row")),s=ebe(n,LUe(".quick-input-list-row"));t.label=new fUe(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0});const r=ebe(o,LUe(".quick-input-list-entry-keybinding"));t.keybinding=new yUe(r,cse);const a=ebe(s,LUe(".quick-input-list-label-meta"));return t.detail=new fUe(a,{supportHighlights:!0,supportIcons:!0}),t.separator=ebe(t.entry,LUe(".quick-input-list-separator")),t.actionBar=new EFe(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,i){i.element=e;const n=e.item?e.item:e.separator;i.checkbox.checked=e.checked,i.toDisposeElement.push(e.onChecked((e=>i.checkbox.checked=e)));const{labelHighlights:o,descriptionHighlights:s,detailHighlights:r}=e,a=Object.create(null);a.matches=o||[],a.descriptionTitle=e.saneDescription,a.descriptionMatches=s||[],"separator"!==n.type?(a.extraClasses=n.iconClasses,a.italic=n.italic,a.strikethrough=n.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item")):i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(e.saneLabel,e.saneDescription,a),i.keybinding.set("separator"===n.type?void 0:n.keybinding),e.saneDetail&&i.detail.setLabel(e.saneDetail,void 0,{matches:r,title:e.saneDetail}),e.item&&e.separator&&e.separator.label?(i.separator.textContent=e.separator.label,i.separator.style.display=""):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!e.separator);const l=n.buttons;l&&l.length?(i.actionBar.push(l.map(((t,i)=>{let o=t.iconClass||(t.iconPath?UHe(t.iconPath):void 0);return t.alwaysVisible&&(o=o?`${o} always-visible`:"always-visible"),{id:`id-${i}`,class:o,enabled:!0,label:"",tooltip:t.tooltip||"",run:()=>{"separator"!==n.type?e.fireButtonTriggered({button:t,item:n}):e.fireSeparatorButtonTriggered({button:t,separator:n})}}})),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){i.toDisposeElement=nae(i.toDisposeElement),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=nae(e.toDisposeElement),e.toDisposeTemplate=nae(e.toDisposeTemplate)}}DUe.ID="listelement";class EUe{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return DUe.ID}}var NUe;!function(e){e[e.First=1]="First",e[e.Second=2]="Second",e[e.Last=3]="Last",e[e.Next=4]="Next",e[e.Previous=5]="Previous",e[e.NextPage=6]="NextPage",e[e.PreviousPage=7]="PreviousPage"}(NUe||(NUe={}));class IUe{constructor(e,t,i){this.parent=e,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnLabelMode="fuzzy",this.matchOnMeta=!0,this.sortByLabel=!0,this._onChangedAllVisibleChecked=new bae,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new bae,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new bae,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new bae,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new bae,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new bae,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new bae,this.onKeyDown=this._onKeyDown.event,this._onLeave=new bae,this.onLeave=this._onLeave.event,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=ebe(this.parent,LUe(".quick-input-list"));const n=new EUe,o=new TUe;this.list=i.createList("QuickInput",this.container,n,[new DUe],{identityProvider:{getId:e=>e.saneLabel},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:o}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown((e=>{const t=new p_e(e);switch(t.keyCode){case 10:this.toggleCheckbox();break;case 31:(tse?e.metaKey:e.ctrlKey)&&this.list.setFocus(Ase(this.list.length));break;case 16:{const e=this.list.getFocus();1===e.length&&0===e[0]&&this._onLeave.fire();break}case 18:{const e=this.list.getFocus();1===e.length&&e[0]===this.list.length-1&&this._onLeave.fire();break}}this._onKeyDown.fire(t)}))),this.disposables.push(this.list.onMouseDown((e=>{2!==e.browserEvent.button&&e.browserEvent.preventDefault()}))),this.disposables.push(Lve(this.container,Yve.CLICK,(e=>{(e.x||e.y)&&this._onLeave.fire()}))),this.disposables.push(this.list.onMouseMiddleClick((e=>{this._onLeave.fire()}))),this.disposables.push(this.list.onContextMenu((e=>{"number"==typeof e.index&&(e.browserEvent.preventDefault(),this.list.setSelection([e.index]))}))),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onSeparatorButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return pae.map(this.list.onDidChangeFocus,(e=>e.elements.map((e=>e.item))))}get onDidChangeSelection(){return pae.map(this.list.onDidChangeSelection,(e=>({items:e.elements.map((e=>e.item)),event:e.browserEvent})))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n.hidden){if(!n.checked)return!1;t=!0}}return t}getCheckedCount(){let e=0;const t=this.elements;for(let i=0,n=t.length;i<n;i++)t[i].checked&&e++;return e}getVisibleCount(){let e=0;const t=this.elements;for(let i=0,n=t.length;i<n;i++)t[i].hidden||e++;return e}setAllVisibleChecked(e){try{this._fireCheckedEvents=!1,this.elements.forEach((t=>{t.hidden||(t.checked=e)}))}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=nae(this.elementDisposables);const t=e=>this.fireButtonTriggered(e),i=e=>this.fireSeparatorButtonTriggered(e);this.inputElements=e,this.elements=e.reduce(((n,o,s)=>{var r,a,l;const h=s&&e[s-1],d=o.label?o.label.replace(/\r?\n/g," "):"",c=KOe(d).text.trim();let u,g,p,m,f,_;"separator"!==o.type&&(u=o.meta&&o.meta.replace(/\r?\n/g," "),g=o.description&&o.description.replace(/\r?\n/g," "),p=o.detail&&o.detail.replace(/\r?\n/g," "),m=null===(r=o.highlights)||void 0===r?void 0:r.label,f=null===(a=o.highlights)||void 0===a?void 0:a.description,_=null===(l=o.highlights)||void 0===l?void 0:l.detail);const v=o.ariaLabel||[d,g,p].map((e=>{return(t=e)?t.replace(/\$\((.*?)\)/g,((e,t)=>` ${t} `)).trim():"";var t})).filter((e=>!!e)).join(", "),b=this.parent.classList.contains("show-checkboxes");let w;if("separator"===o.type){if(!o.buttons)return n;w=o}else h&&"separator"===h.type&&!h.buttons&&(w=h);const C=new xUe({hasCheckbox:b,index:s,item:"separator"!==o.type?o:void 0,saneLabel:d,saneSortLabel:c,saneMeta:u,saneAriaLabel:v,saneDescription:g,saneDetail:p,labelHighlights:m,descriptionHighlights:f,detailHighlights:_,checked:!1,separator:w,fireButtonTriggered:t,fireSeparatorButtonTriggered:i});return this.elementDisposables.push(C),this.elementDisposables.push(C.onChecked((()=>this.fireCheckedEvents()))),n.push(C),n}),[]),this.elementsToIndexes=this.elements.reduce(((e,t,i)=>{var n;return e.set(null!==(n=t.item)&&void 0!==n?n:t.separator,i),e}),new Map),this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map((e=>e.item))}setFocusedElements(e){if(this.list.setFocus(e.filter((e=>this.elementsToIndexes.has(e))).map((e=>this.elementsToIndexes.get(e)))),e.length>0){const e=this.list.getFocus()[0];"number"==typeof e&&this.list.reveal(e)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter((e=>this.elementsToIndexes.has(e))).map((e=>this.elementsToIndexes.get(e))))}getCheckedElements(){return this.elements.filter((e=>e.checked)).map((e=>e.item)).filter((e=>!!e))}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i);for(const e of this.elements)e.checked=t.has(e.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===NUe.Second&&this.list.length<2&&(e=NUe.First),e){case NUe.First:this.list.scrollTop=0,this.list.focusFirst(void 0,(e=>!!e.item));break;case NUe.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,(e=>!!e.item));break;case NUe.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,(e=>!!e.item));break;case NUe.Next:{this.list.focusNext(void 0,!0,void 0,(e=>!!e.item));const e=this.list.getFocus()[0];0!==e&&!this.elements[e-1].item&&this.list.firstVisibleIndex>e-1&&this.list.reveal(e-1);break}case NUe.Previous:{this.list.focusPrevious(void 0,!0,void 0,(e=>!!e.item));const e=this.list.getFocus()[0];0!==e&&!this.elements[e-1].item&&this.list.firstVisibleIndex>e-1&&this.list.reveal(e-1);break}case NUe.NextPage:this.list.focusNextPage(void 0,(e=>!!e.item));break;case NUe.PreviousPage:this.list.focusPreviousPage(void 0,(e=>!!e.item))}const t=this.list.getFocus()[0];"number"==typeof t&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}layout(e){this.list.getHTMLElement().style.maxHeight=e?`calc(${44*Math.floor(e/44)}px)`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;const t=e;if((e=e.trim())&&(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail)){let i;this.elements.forEach((n=>{let o;o="fuzzy"===this.matchOnLabelMode?this.matchOnLabel?ire(jOe(e,KOe(n.saneLabel))):void 0:this.matchOnLabel?ire(function(e,t){const{text:i,iconOffsets:n}=t;if(!n||0===n.length)return MUe(e,i);const o=Yhe(i," "),s=i.length-o.length,r=MUe(e,o);if(r)for(const e of r){const t=n[e.start+s]+s;e.start+=t,e.end+=t}return r}(t,KOe(n.saneLabel))):void 0;const s=this.matchOnDescription?ire(jOe(e,KOe(n.saneDescription||""))):void 0,r=this.matchOnDetail?ire(jOe(e,KOe(n.saneDetail||""))):void 0,a=this.matchOnMeta?ire(jOe(e,KOe(n.saneMeta||""))):void 0;if(o||s||r||a?(n.labelHighlights=o,n.descriptionHighlights=s,n.detailHighlights=r,n.hidden=!1):(n.labelHighlights=void 0,n.descriptionHighlights=void 0,n.detailHighlights=void 0,n.hidden=!n.item||!n.item.alwaysShow),!this.sortByLabel){const e=n.index&&this.inputElements[n.index-1];i=e&&"separator"===e.type?e:i,i&&!n.hidden&&(n.separator=i,i=void 0)}}))}else this.elements.forEach((e=>{e.labelHighlights=void 0,e.descriptionHighlights=void 0,e.detailHighlights=void 0,e.hidden=!1;const t=e.index&&this.inputElements[e.index-1];e.item&&(e.separator=t&&"separator"===t.type&&!t.buttons?t:void 0)}));const i=this.elements.filter((e=>!e.hidden));if(this.sortByLabel&&e){const t=e.toLowerCase();i.sort(((e,i)=>function(e,t,i){const n=e.labelHighlights||[],o=t.labelHighlights||[];return n.length&&!o.length?-1:!n.length&&o.length?1:0===n.length&&0===o.length?0:function(e,t,i){const n=e.toLowerCase(),o=t.toLowerCase(),s=function(e,t,i){const n=e.toLowerCase(),o=t.toLowerCase(),s=n.startsWith(i),r=o.startsWith(i);if(s!==r)return s?-1:1;if(s&&r){if(n.length<o.length)return-1;if(n.length>o.length)return 1}return 0}(e,t,i);if(s)return s;const r=n.endsWith(i);if(r!==o.endsWith(i))return r?-1:1;const a=function(e,t,i=!1){const n=e||"",o=t||"",s=SUe.value.collator.compare(n,o);return SUe.value.collatorIsNumeric&&0===s&&n!==o?n<o?-1:1:s}(n,o);return 0!==a?a:n.localeCompare(o)}(e.saneSortLabel,t.saneSortLabel,i)}(e,i,t)))}return this.elementsToIndexes=i.reduce(((e,t,i)=>{var n;return e.set(null!==(n=t.item)&&void 0!==n?n:t.separator,i),e}),new Map),this.list.splice(0,this.list.length,i),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(i.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const i of e)i.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return"none"!==this.container.style.display}dispose(){this.elementDisposables=nae(this.elementDisposables),this.disposables=nae(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}fireSeparatorButtonTriggered(e){this._onSeparatorButtonTriggered.fire(e)}style(e){this.list.style(e)}}function MUe(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1!==i?[{start:i,end:i+e.length}]:null}kUe([Dwe],IUe.prototype,"onDidChangeFocus",null),kUe([Dwe],IUe.prototype,"onDidChangeSelection",null);class TUe{getWidgetAriaLabel(){return Toe(0,"Quick Input")}getAriaLabel(e){var t;return(null===(t=e.separator)||void 0===t?void 0:t.label)?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}var AUe=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const RUe=sbe,OUe={iconClass:Ibe.asClassName(Vle.quickInputBack),tooltip:Toe(0,"Back"),handle:-1};class PUe extends aae{constructor(e){super(),this.ui=e,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=PUe.noPromptMessage,this._severity=YAe.Ignore,this.onDidTriggerButtonEmitter=this._register(new bae),this.onDidHideEmitter=this._register(new bae),this.onDisposeEmitter=this._register(new bae),this.visibleDisposables=this._register(new rae),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!rse;this._ignoreFocusOut=e&&!rse,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=null!=e?e:[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton((e=>{-1!==this.buttons.indexOf(e)&&this.onDidTriggerButtonEmitter.fire(e)}))),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=jHe.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const i=this.getTitle();i&&this.ui.title.textContent!==i?this.ui.title.textContent=i:i||"&nbsp;"===this.ui.title.innerHTML||(this.ui.title.innerText=" ");const n=this.getDescription();if(this.ui.description1.textContent!==n&&(this.ui.description1.textContent=n),this.ui.description2.textContent!==n&&(this.ui.description2.textContent=n),this.busy&&!this.busyDelay&&(this.busyDelay=new ape,this.busyDelay.setIfNotSet((()=>{this.visible&&this.ui.progressBar.infinite()}),800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const e=this.buttons.filter((e=>e===OUe));this.ui.leftActionBar.push(e.map(((e,t)=>{const i=new Tbe(`id-${t}`,"",e.iconClass||UHe(e.iconPath),!0,(()=>AUe(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)}))));return i.tooltip=e.tooltip||"",i})),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const t=this.buttons.filter((e=>e!==OUe));this.ui.rightActionBar.push(t.map(((e,t)=>{const i=new Tbe(`id-${t}`,"",e.iconClass||UHe(e.iconPath),!0,(()=>AUe(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)}))));return i.tooltip=e.tooltip||"",i})),{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const i=null!==(t=null===(e=this.toggles)||void 0===e?void 0:e.filter((e=>e instanceof BHe)))&&void 0!==t?t:[];this.ui.inputBox.toggles=i}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const o=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==o&&(this._lastValidationMessage=o,tbe(this.ui.message,...sPe(o))),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?Toe(0,"{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==YAe.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}PUe.noPromptMessage=Toe(0,"Press 'Enter' to confirm your input or 'Escape' to cancel");class FUe extends PUe{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new bae),this.onWillAcceptEmitter=this._register(new bae),this.onDidAcceptEmitter=this._register(new bae),this.onDidCustomEmitter=this._register(new bae),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._autoFocusOnList=!0,this._keepScrollPosition=!1,this._itemActivation=this.ui.isScreenReaderOptimized()?qHe.NONE:qHe.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new bae),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new bae),this.onDidTriggerItemButtonEmitter=this._register(new bae),this.onDidTriggerSeparatorButtonEmitter=this._register(new bae),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?KHe:this.ui.keyMods}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(NUe.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange((e=>{this.doSetValue(e,!0)}))),this.visibleDisposables.add(this.ui.inputBox.onMouseDown((e=>{this.autoFocusOnList||this.ui.list.clearFocus()}))),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown((e=>{switch(e.keyCode){case 18:this.ui.list.focus(NUe.Next),this.canSelectMany&&this.ui.list.domFocus(),Qve(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(NUe.Previous):this.ui.list.focus(NUe.Last),this.canSelectMany&&this.ui.list.domFocus(),Qve(e,!0);break;case 12:this.ui.list.focus(NUe.NextPage),this.canSelectMany&&this.ui.list.domFocus(),Qve(e,!0);break;case 11:this.ui.list.focus(NUe.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),Qve(e,!0);break;case 17:if(!this._canAcceptInBackground)return;if(!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(NUe.First),Qve(e,!0));break;case 13:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(NUe.Last),Qve(e,!0))}}))),this.visibleDisposables.add(this.ui.onDidAccept((()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)}))),this.visibleDisposables.add(this.ui.onDidCustom((()=>{this.onDidCustomEmitter.fire()}))),this.visibleDisposables.add(this.ui.list.onDidChangeFocus((e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Nse(e,this._activeItems,((e,t)=>e===t))||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))}))),this.visibleDisposables.add(this.ui.list.onDidChangeSelection((({items:e,event:t})=>{this.canSelectMany?e.length&&this.ui.list.setSelectedElements([]):this.selectedItemsToConfirm!==this._selectedItems&&Nse(e,this._selectedItems,((e,t)=>e===t))||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(t instanceof MouseEvent&&1===t.button))}))),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements((e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&Nse(e,this._selectedItems,((e,t)=>e===t))||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))}))),this.visibleDisposables.add(this.ui.list.onButtonTriggered((e=>this.onDidTriggerItemButtonEmitter.fire(e)))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered((e=>this.onDidTriggerSeparatorButtonEmitter.fire(e)))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return Lve(this.ui.container,Yve.KEY_UP,(e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new p_e(e),i=t.keyCode;this._quickNavigate.keybindings.some((e=>{const[n,o]=e.getChords();return!(o||(n.shiftKey&&4===i?t.ctrlKey||t.altKey||t.metaKey:!(n.altKey&&6===i||n.ctrlKey&&5===i||n.metaKey&&57===i)))}))&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)}))}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany,ok:"default"===this.ok?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let n=this.ariaLabel;if(n||(n=this.placeholder||FUe.DEFAULT_ARIA_LABEL,this.title&&(n+=` - ${this.title}`)),this.ui.inputBox.ariaLabel!==n&&(this.ui.inputBox.ariaLabel=n),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case qHe.NONE:this._itemActivation=qHe.FIRST;break;case qHe.SECOND:this.ui.list.focus(NUe.Second),this._itemActivation=qHe.FIRST;break;case qHe.LAST:this.ui.list.focus(NUe.Last),this._itemActivation=qHe.FIRST;break;default:this.trySelectFirst()}this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",this.ui.setComboboxAccessibility(!0),i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(NUe.First)),this.keepScrollPosition&&(this.scrollTop=e)}}FUe.DEFAULT_ARIA_LABEL=Toe(0,"Type to narrow down results.");class BUe extends PUe{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new bae),this.onDidAcceptEmitter=this._register(new bae),this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange((e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))}))),this.visibleDisposables.add(this.ui.onDidAccept((()=>this.onDidAcceptEmitter.fire()))),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}}class WUe extends aae{constructor(e){super(),this.options=e,this.comboboxAccessibility=!1,this.enabled=!0,this.onDidAcceptEmitter=this._register(new bae),this.onDidCustomEmitter=this._register(new bae),this.onDidTriggerButtonEmitter=this._register(new bae),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new bae),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new bae),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=e=>{this.keyMods.ctrlCmd=e.ctrlKey||e.metaKey,this.keyMods.alt=e.altKey};this._register(Lve(window,Yve.KEY_DOWN,e,!0)),this._register(Lve(window,Yve.KEY_UP,e,!0)),this._register(Lve(window,Yve.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=ebe(this.parentElement,RUe(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=qve(e),i=ebe(e,RUe(".quick-input-titlebar")),n=this._register(new EFe(i));n.domNode.classList.add("quick-input-left-action-bar");const o=ebe(i,RUe(".quick-input-title")),s=this._register(new EFe(i));s.domNode.classList.add("quick-input-right-action-bar");const r=ebe(e,RUe(".quick-input-description")),a=ebe(e,RUe(".quick-input-header")),l=ebe(a,RUe("input.quick-input-check-all"));l.type="checkbox",l.setAttribute("aria-label",Toe(0,"Toggle all checkboxes")),this._register(xve(l,Yve.CHANGE,(e=>{const t=l.checked;S.setAllVisibleChecked(t)}))),this._register(Lve(l,Yve.CLICK,(e=>{(e.x||e.y)&&u.setFocus()})));const h=ebe(a,RUe(".quick-input-description")),d=ebe(a,RUe(".quick-input-and-message")),c=ebe(d,RUe(".quick-input-filter")),u=this._register(new cUe(c,this.styles.inputBox,this.styles.toggle));u.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=ebe(c,RUe(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=new DHe(g,{countFormat:Toe(0,"{0} Results")},this.styles.countBadge),m=ebe(c,RUe(".quick-input-count"));m.setAttribute("aria-live","polite");const f=new DHe(m,{countFormat:Toe(0,"{0} Selected")},this.styles.countBadge),_=ebe(a,RUe(".quick-input-action")),v=new kHe(_,this.styles.button);v.label=Toe(0,"OK"),this._register(v.onDidClick((e=>{this.onDidAcceptEmitter.fire()})));const b=ebe(a,RUe(".quick-input-action")),w=new kHe(b,this.styles.button);w.label=Toe(0,"Custom"),this._register(w.onDidClick((e=>{this.onDidCustomEmitter.fire()})));const C=ebe(d,RUe(`#${this.idPrefix}message.quick-input-message`)),y=new OHe(e,this.styles.progressBar);y.getContainer().classList.add("quick-input-progress");const S=this._register(new IUe(e,this.idPrefix+"list",this.options));this._register(S.onChangedAllVisibleChecked((e=>{l.checked=e}))),this._register(S.onChangedVisibleCount((e=>{p.setCount(e)}))),this._register(S.onChangedCheckedCount((e=>{f.setCount(e)}))),this._register(S.onLeave((()=>{setTimeout((()=>{u.setFocus(),this.controller instanceof FUe&&this.controller.canSelectMany&&S.clearFocus()}),0)}))),this._register(S.onDidChangeFocus((()=>{this.comboboxAccessibility&&this.getUI().inputBox.setAttribute("aria-activedescendant",this.getUI().list.getActiveDescendant()||"")})));const k=Jve(e);return this._register(k),this._register(Lve(e,Yve.FOCUS,(e=>{this.previousFocusElement=e.relatedTarget instanceof HTMLElement?e.relatedTarget:void 0}),!0)),this._register(k.onDidBlur((()=>{this.getUI().ignoreFocusOut||this.options.ignoreFocusOut()||this.hide(jHe.Blur),this.previousFocusElement=void 0}))),this._register(Lve(e,Yve.FOCUS,(e=>{u.setFocus()}))),this._register(Lve(e,Yve.KEY_DOWN,(t=>{const i=new p_e(t);switch(i.keyCode){case 3:Qve(t,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:Qve(t,!0),this.hide(jHe.Gesture);break;case 2:if(!i.altKey&&!i.ctrlKey&&!i.metaKey){const n=[".action-label.codicon"];e.classList.contains("show-checkboxes")?n.push("input"):n.push("input[type=text]"),this.getUI().list.isDisplayed()&&n.push(".monaco-list");const o=e.querySelectorAll(n.join(", "));i.shiftKey&&i.target===o[0]?(Qve(t,!0),o[o.length-1].focus()):i.shiftKey||i.target!==o[o.length-1]||(Qve(t,!0),o[0].focus())}}}))),this.ui={container:e,styleSheet:t,leftActionBar:n,titleBar:i,title:o,description1:r,description2:h,rightActionBar:s,checkAll:l,filterContainer:c,inputBox:u,visibleCountContainer:g,visibleCount:p,countContainer:m,count:f,okContainer:_,ok:v,message:C,customButtonContainer:b,customButton:w,list:S,progressBar:y,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,isScreenReaderOptimized:()=>this.options.isScreenReaderOptimized(),show:e=>this.show(e),hide:()=>this.hide(),setVisibilities:e=>this.setVisibilities(e),setComboboxAccessibility:e=>this.setComboboxAccessibility(e),setEnabled:e=>this.setEnabled(e),setContextKey:e=>this.options.setContextKey(e)},this.updateStyles(),this.ui}pick(e,t={},i=Nae.None){return new Promise(((n,o)=>{let s=e=>{var i;s=n,null===(i=t.onKeyMods)||void 0===i||i.call(t,r.keyMods),n(e)};if(i.isCancellationRequested)return void s(void 0);const r=this.createQuickPick();let a;const l=[r,r.onDidAccept((()=>{if(r.canSelectMany)s(r.selectedItems.slice()),r.hide();else{const e=r.activeItems[0];e&&(s(e),r.hide())}})),r.onDidChangeActive((e=>{const i=e[0];i&&t.onDidFocus&&t.onDidFocus(i)})),r.onDidChangeSelection((e=>{if(!r.canSelectMany){const t=e[0];t&&(s(t),r.hide())}})),r.onDidTriggerItemButton((e=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},e),{removeItem:()=>{const t=r.items.indexOf(e.item);if(-1!==t){const e=r.items.slice(),i=e.splice(t,1),n=r.activeItems.filter((e=>e!==i[0])),o=r.keepScrollPosition;r.keepScrollPosition=!0,r.items=e,n&&(r.activeItems=n),r.keepScrollPosition=o}}})))),r.onDidTriggerSeparatorButton((e=>{var i;return null===(i=t.onDidTriggerSeparatorButton)||void 0===i?void 0:i.call(t,e)})),r.onDidChangeValue((e=>{!a||e||1===r.activeItems.length&&r.activeItems[0]===a||(r.activeItems=[a])})),i.onCancellationRequested((()=>{r.hide()})),r.onDidHide((()=>{nae(l),s(void 0)}))];r.title=t.title,r.canSelectMany=!!t.canPickMany,r.placeholder=t.placeHolder,r.ignoreFocusOut=!!t.ignoreFocusLost,r.matchOnDescription=!!t.matchOnDescription,r.matchOnDetail=!!t.matchOnDetail,r.matchOnLabel=void 0===t.matchOnLabel||t.matchOnLabel,r.autoFocusOnList=void 0===t.autoFocusOnList||t.autoFocusOnList,r.quickNavigate=t.quickNavigate,r.hideInput=!!t.hideInput,r.contextKey=t.contextKey,r.busy=!0,Promise.all([e,t.activeItem]).then((([e,t])=>{a=t,r.busy=!1,r.items=e,r.canSelectMany&&(r.selectedItems=e.filter((e=>"separator"!==e.type&&e.picked))),a&&(r.activeItems=[a])})),r.show(),Promise.resolve(e).then(void 0,(e=>{o(e),r.hide()}))}))}createQuickPick(){const e=this.getUI();return new FUe(e)}createInputBox(){const e=this.getUI();return new BUe(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const i=this.controller;this.controller=e,null==i||i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(YAe.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),tbe(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,this.setComboboxAccessibility(!1),t.inputBox.ariaLabel="",t.inputBox.toggles=void 0;const n=this.options.backKeybindingLabel();OUe.tooltip=n?Toe(0,"Back ({0})",n):Toe(0,"Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=!e.description||e.inputBox||e.checkAll?"none":"",t.checkAll.style.display=e.checkAll?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setComboboxAccessibility(e){if(e!==this.comboboxAccessibility){const t=this.getUI();this.comboboxAccessibility=e,this.comboboxAccessibility?(t.inputBox.setAttribute("role","combobox"),t.inputBox.setAttribute("aria-haspopup","true"),t.inputBox.setAttribute("aria-autocomplete","list"),t.inputBox.setAttribute("aria-activedescendant",t.list.getActiveDescendant()||"")):(t.inputBox.removeAttribute("role"),t.inputBox.removeAttribute("aria-haspopup"),t.inputBox.removeAttribute("aria-autocomplete"),t.inputBox.removeAttribute("aria-activedescendant"))}}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t;const i=this.controller;if(i){const n=!(null===(t=this.ui)||void 0===t?void 0:t.container.contains(document.activeElement));if(this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",!n){let e=this.previousFocusElement;for(;e&&!e.offsetParent;)e=ire(e.parentElement);(null==e?void 0:e.offsetParent)?(e.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}i.didHide(e)}}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isDisplayed()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(.62*this.dimension.width,WUe.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&.4*this.dimension.height)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:n,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=null!=e?e:"",this.ui.container.style.backgroundColor=null!=t?t:"",this.ui.container.style.color=null!=i?i:"",this.ui.container.style.border=n?`1px solid ${n}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list);const s=[];this.styles.pickerGroup.pickerGroupBorder&&s.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator-as-item { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(s.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&s.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&s.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&s.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&s.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&s.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),s.push("}"));const r=s.join("\n");r!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=r)}}isDisplayed(){return this.ui&&"none"!==this.ui.container.style.display}}WUe.MAX_WIDTH=600;class VUe{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:aae.None}}renderElement(e,t,i,n){var o;if(null===(o=i.disposable)||void 0===o||o.dispose(),!i.data)return;const s=this.modelProvider();if(s.isResolved(e))return this.renderer.renderElement(s.get(e),e,i.data,n);const r=new Mae,a=s.resolve(e,r.token);i.disposable={dispose:()=>r.cancel()},this.renderer.renderPlaceholder(e,i.data),a.then((t=>this.renderer.renderElement(t,e,i.data,n)))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class zUe{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}class HUe{constructor(e,t,i,n,o={}){const s=()=>this.model,r=n.map((e=>new VUe(e,s)));this.list=new dFe(e,t,i,r,function(e,t){return Object.assign(Object.assign({},t),{accessibilityProvider:t.accessibilityProvider&&new zUe(e,t.accessibilityProvider)})}(s,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return pae.map(this.list.onMouseDblClick,(({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i})))}get onPointer(){return pae.map(this.list.onPointer,(({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i})))}get onDidChangeSelection(){return pae.map(this.list.onDidChangeSelection,(({elements:e,indexes:t,browserEvent:i})=>({elements:e.map((e=>this._model.get(e))),indexes:t,browserEvent:i})))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,Ase(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map((e=>this.model.get(e)))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}var UUe=i(1369),KUe={};KUe.styleTagTransform=Vr(),KUe.setAttributes=Pr(),KUe.insert=Rr().bind(null,"head"),KUe.domAPI=Tr(),KUe.insertStyleElement=Br(),Ir()(UUe.Z,KUe),UUe.Z&&UUe.Z.locals&&UUe.Z.locals;const jUe={separatorBorder:Owe.transparent};class qUe{set size(e){this._size=e}get size(){return this._size}get visible(){return void 0===this._cachedVisibleSize}setVisible(e,t){var i,n;e!==this.visible&&(e?(this.size=vPe(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize="number"==typeof t?t:this.size,this.size=0),this.container.classList.toggle("visible",e),null===(n=(i=this.view).setVisible)||void 0===n||n.call(i,e))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){var e;return null===(e=this.view.proportionalLayout)||void 0===e||e}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,n){this.container=e,this.view=t,this.disposable=n,this._cachedVisibleSize=void 0,"number"==typeof i?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e),this.view.layout(this.size,e,t)}dispose(){return this.disposable.dispose(),this.view}}class $Ue extends qUe{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class GUe extends qUe{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var ZUe,YUe;!function(e){e[e.Idle=0]="Idle",e[e.Busy=1]="Busy"}(ZUe||(ZUe={})),function(e){e.Distribute={type:"distribute"},e.Split=function(e){return{type:"split",index:e}},e.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}}}(YUe||(YUe={}));class QUe extends aae{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){var i,n,o,s,r;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=ZUe.Idle,this._onDidSashChange=this._register(new bae),this._onDidSashReset=this._register(new bae),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=null!==(i=t.orientation)&&void 0!==i?i:0,this.inverseAltBehavior=null!==(n=t.inverseAltBehavior)&&void 0!==n&&n,this.proportionalLayout=null===(o=t.proportionalLayout)||void 0===o||o,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(0===this.orientation?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=ebe(this.el,sbe(".sash-container")),this.viewContainer=sbe(".split-view-container"),this.scrollable=new Mke({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:Eve}),this.scrollableElement=this._register(new Uke(this.viewContainer,{vertical:0===this.orientation?null!==(s=t.scrollbarVisibility)&&void 0!==s?s:1:2,horizontal:1===this.orientation?null!==(r=t.scrollbarVisibility)&&void 0!==r?r:1:2},this.scrollable));const a=this._register(new Yke(this.viewContainer,"scroll")).event;this._register(a((e=>{const t=this.scrollableElement.getScrollPosition(),i=Math.abs(this.viewContainer.scrollLeft-t.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,n=Math.abs(this.viewContainer.scrollTop-t.scrollTop)<=1?void 0:this.viewContainer.scrollTop;void 0===i&&void 0===n||this.scrollableElement.setScrollPosition({scrollLeft:i,scrollTop:n})}))),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll((e=>{e.scrollTopChanged&&(this.viewContainer.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this.viewContainer.scrollLeft=e.scrollLeft)}))),ebe(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||jUe),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach(((e,t)=>{const i=Yse(e.visible)||e.visible?e.size:{type:"invisible",cachedVisibleSize:e.size},n=e.view;this.doAddView(n,i,t,!0)})),this.contentSize=this.viewItems.reduce(((e,t)=>e+t.size),0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,n){this.doAddView(e,t,i,n)}layout(e,t){const i=Math.max(this.size,this.contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let t=0;for(let i=0;i<this.viewItems.length;i++){const n=this.viewItems[i],o=this.proportions[i];"number"==typeof o?t+=o:e-=n.size}for(let i=0;i<this.viewItems.length;i++){const n=this.viewItems[i],o=this.proportions[i];"number"==typeof o&&(n.size=vPe(Math.round(o*e/t),n.minimumSize,n.maximumSize))}}else{const t=Ase(this.viewItems.length),n=t.filter((e=>1===this.viewItems[e].priority)),o=t.filter((e=>2===this.viewItems[e].priority));this.resize(this.viewItems.length-1,e-i,void 0,n,o)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map((e=>e.proportionalLayout?e.size/this.contentSize:void 0)))}onSashStart({sash:e,start:t,alt:i}){for(const e of this.viewItems)e.enabled=!1;const n=this.sashItems.findIndex((t=>t.sash===e)),o=oae(Lve(document.body,"keydown",(e=>s(this.sashDragState.current,e.altKey))),Lve(document.body,"keyup",(()=>s(this.sashDragState.current,!1)))),s=(e,t)=>{const i=this.viewItems.map((e=>e.size));let s,r,a=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(t=!t),t)if(n===this.sashItems.length-1){const e=this.viewItems[n];a=(e.minimumSize-e.size)/2,l=(e.maximumSize-e.size)/2}else{const e=this.viewItems[n+1];a=(e.size-e.maximumSize)/2,l=(e.size-e.minimumSize)/2}if(!t){const e=Ase(n,-1),t=Ase(n+1,this.viewItems.length),o=e.reduce(((e,t)=>e+(this.viewItems[t].minimumSize-i[t])),0),a=e.reduce(((e,t)=>e+(this.viewItems[t].viewMaximumSize-i[t])),0),l=0===t.length?Number.POSITIVE_INFINITY:t.reduce(((e,t)=>e+(i[t]-this.viewItems[t].minimumSize)),0),h=0===t.length?Number.NEGATIVE_INFINITY:t.reduce(((e,t)=>e+(i[t]-this.viewItems[t].viewMaximumSize)),0),d=Math.max(o,h),c=Math.min(l,a),u=this.findFirstSnapIndex(e),g=this.findFirstSnapIndex(t);if("number"==typeof u){const e=this.viewItems[u],t=Math.floor(e.viewMinimumSize/2);s={index:u,limitDelta:e.visible?d-t:d+t,size:e.size}}if("number"==typeof g){const e=this.viewItems[g],t=Math.floor(e.viewMinimumSize/2);r={index:g,limitDelta:e.visible?c+t:c-t,size:e.size}}}this.sashDragState={start:e,current:e,index:n,sizes:i,minDelta:a,maxDelta:l,alt:t,snapBefore:s,snapAfter:r,disposable:o}};s(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:n,alt:o,minDelta:s,maxDelta:r,snapBefore:a,snapAfter:l}=this.sashDragState;this.sashDragState.current=e;const h=e-i,d=this.resize(t,h,n,void 0,void 0,s,r,a,l);if(o){const e=t===this.sashItems.length-1,i=this.viewItems.map((e=>e.size)),n=e?t:t+1,o=this.viewItems[n],s=o.size-o.maximumSize,r=o.size-o.minimumSize,a=e?t-1:t+1;this.resize(a,-d,i,void 0,void 0,s,r)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const e of this.viewItems)e.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=vPe(t="number"==typeof t?t:e.size,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(this.state!==ZUe.Idle)throw new Error("Cant modify splitview");if(this.state=ZUe.Busy,e<0||e>=this.viewItems.length)return;const i=Ase(this.viewItems.length).filter((t=>t!==e)),n=[...i.filter((e=>1===this.viewItems[e].priority)),e],o=i.filter((e=>2===this.viewItems[e].priority)),s=this.viewItems[e];t=vPe(t=Math.round(t),s.minimumSize,Math.min(s.maximumSize,this.size)),s.size=t,this.relayout(n,o),this.state=ZUe.Idle}distributeViewSizes(){const e=[];let t=0;for(const i of this.viewItems)i.maximumSize-i.minimumSize>0&&(e.push(i),t+=i.size);const i=Math.floor(t/e.length);for(const t of e)t.size=vPe(i,t.minimumSize,t.maximumSize);const n=Ase(this.viewItems.length),o=n.filter((e=>1===this.viewItems[e].priority)),s=n.filter((e=>2===this.viewItems[e].priority));this.relayout(o,s)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,n){if(this.state!==ZUe.Idle)throw new Error("Cant modify splitview");this.state=ZUe.Busy;const o=sbe(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const s=e.onDidChange((e=>this.onViewChange(l,e))),r=oae(s,sae((()=>this.viewContainer.removeChild(o))));let a;a="number"==typeof t?t:"split"===t.type?this.getViewSize(t.index)/2:"invisible"===t.type?{cachedVisibleSize:t.cachedVisibleSize}:e.minimumSize;const l=0===this.orientation?new $Ue(o,e,a,r):new GUe(o,e,a,r);if(this.viewItems.splice(i,0,l),this.viewItems.length>1){const e={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},t=0===this.orientation?new qRe(this.sashContainer,{getHorizontalSashTop:e=>this.getSashPosition(e),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},e),{orientation:1})):new qRe(this.sashContainer,{getVerticalSashLeft:e=>this.getSashPosition(e),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},e),{orientation:0})),n=0===this.orientation?e=>({sash:t,start:e.startY,current:e.currentY,alt:e.altKey}):e=>({sash:t,start:e.startX,current:e.currentX,alt:e.altKey}),o=pae.map(t.onDidStart,n)(this.onSashStart,this),s=pae.map(t.onDidChange,n)(this.onSashChange,this),r=pae.map(t.onDidEnd,(()=>this.sashItems.findIndex((e=>e.sash===t)))),a=r(this.onSashEnd,this),l=t.onDidReset((()=>{const e=this.sashItems.findIndex((e=>e.sash===t)),i=Ase(e,-1),n=Ase(e+1,this.viewItems.length),o=this.findFirstSnapIndex(i),s=this.findFirstSnapIndex(n);("number"!=typeof o||this.viewItems[o].visible)&&("number"!=typeof s||this.viewItems[s].visible)&&this._onDidSashReset.fire(e)})),h=oae(o,s,a,l,t),d={sash:t,disposable:h};this.sashItems.splice(i-1,0,d)}let h;o.appendChild(e.element),"number"!=typeof t&&"split"===t.type&&(h=[t.index]),n||this.relayout([i],h),this.state=ZUe.Idle,n||"number"==typeof t||"distribute"!==t.type||this.distributeViewSizes()}relayout(e,t){const i=this.viewItems.reduce(((e,t)=>e+t.size),0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map((e=>e.size)),n,o,s=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,a,l){if(e<0||e>=this.viewItems.length)return 0;const h=Ase(e,-1),d=Ase(e+1,this.viewItems.length);if(o)for(const e of o)Ose(h,e),Ose(d,e);if(n)for(const e of n)Pse(h,e),Pse(d,e);const c=h.map((e=>this.viewItems[e])),u=h.map((e=>i[e])),g=d.map((e=>this.viewItems[e])),p=d.map((e=>i[e])),m=h.reduce(((e,t)=>e+(this.viewItems[t].minimumSize-i[t])),0),f=h.reduce(((e,t)=>e+(this.viewItems[t].maximumSize-i[t])),0),_=0===d.length?Number.POSITIVE_INFINITY:d.reduce(((e,t)=>e+(i[t]-this.viewItems[t].minimumSize)),0),v=0===d.length?Number.NEGATIVE_INFINITY:d.reduce(((e,t)=>e+(i[t]-this.viewItems[t].maximumSize)),0),b=Math.max(m,v,s),w=Math.min(_,f,r);let C=!1;if(a){const e=this.viewItems[a.index],i=t>=a.limitDelta;C=i!==e.visible,e.setVisible(i,a.size)}if(!C&&l){const e=this.viewItems[l.index],i=t<l.limitDelta;C=i!==e.visible,e.setVisible(i,l.size)}if(C)return this.resize(e,t,i,n,o,s,r);for(let e=0,i=t=vPe(t,b,w);e<c.length;e++){const t=c[e],n=vPe(u[e]+i,t.minimumSize,t.maximumSize);i-=n-u[e],t.size=n}for(let e=0,i=t;e<g.length;e++){const t=g[e],n=vPe(p[e]-i,t.minimumSize,t.maximumSize);i+=n-p[e],t.size=n}return t}distributeEmptySpace(e){const t=this.viewItems.reduce(((e,t)=>e+t.size),0);let i=this.size-t;const n=Ase(this.viewItems.length-1,-1),o=n.filter((e=>1===this.viewItems[e].priority)),s=n.filter((e=>2===this.viewItems[e].priority));for(const e of s)Ose(n,e);for(const e of o)Pse(n,e);"number"==typeof e&&Pse(n,e);for(let e=0;0!==i&&e<n.length;e++){const t=this.viewItems[n[e]],o=vPe(t.size+i,t.minimumSize,t.maximumSize);i-=o-t.size,t.size=o}}layoutViews(){this.contentSize=this.viewItems.reduce(((e,t)=>e+t.size),0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach((e=>e.sash.layout())),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){0===this.orientation?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this.contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this.contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map((t=>e=t.size-t.minimumSize>0||e));e=!1;const i=this.viewItems.map((t=>e=t.maximumSize-t.size>0||e)),n=[...this.viewItems].reverse();e=!1;const o=n.map((t=>e=t.size-t.minimumSize>0||e)).reverse();e=!1;const s=n.map((t=>e=t.maximumSize-t.size>0||e)).reverse();let r=0;for(let e=0;e<this.sashItems.length;e++){const{sash:n}=this.sashItems[e];r+=this.viewItems[e].size;const a=!(t[e]&&s[e+1]),l=!(i[e]&&o[e+1]);if(a&&l){const i=Ase(e,-1),s=Ase(e+1,this.viewItems.length),a=this.findFirstSnapIndex(i),l=this.findFirstSnapIndex(s),h="number"==typeof a&&!this.viewItems[a].visible,d="number"==typeof l&&!this.viewItems[l].visible;h&&o[e]&&(r>0||this.startSnappingEnabled)?n.state=1:d&&t[e]&&(r<this.contentSize||this.endSnappingEnabled)?n.state=2:n.state=0}else n.state=a&&!l?1:!a&&l?2:3}}getSashPosition(e){let t=0;for(let i=0;i<this.sashItems.length;i++)if(t+=this.viewItems[i].size,this.sashItems[i].sash===e)return t;return 0}findFirstSnapIndex(e){for(const t of e){const e=this.viewItems[t];if(e.visible&&e.snap)return t}for(const t of e){const e=this.viewItems[t];if(e.visible&&e.maximumSize-e.minimumSize>0)return;if(!e.visible&&e.snap)return t}}dispose(){super.dispose(),nae(this.viewItems),this.viewItems=[],this.sashItems.forEach((e=>e.disposable.dispose())),this.sashItems=[]}}var XUe,JUe=i(9251),eKe={};eKe.styleTagTransform=Vr(),eKe.setAttributes=Pr(),eKe.insert=Rr().bind(null,"head"),eKe.domAPI=Tr(),eKe.insertStyleElement=Br(),Ir()(JUe.Z,eKe),JUe.Z&&JUe.Z.locals&&JUe.Z.locals;class tKe{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=tKe.TemplateId,this.renderedTemplates=new Set;const n=new Map(t.map((e=>[e.templateId,e])));this.renderers=[];for(const t of e){const e=n.get(t.templateId);if(!e)throw new Error(`Table cell renderer for template id ${t.templateId} not found.`);this.renderers.push(e)}}renderTemplate(e){const t=ebe(e,sbe(".monaco-table-tr")),i=[],n=[];for(let e=0;e<this.columns.length;e++){const o=this.renderers[e],s=ebe(t,sbe(".monaco-table-td",{"data-col-index":e}));s.style.width=`${this.getColumnSize(e)}px`,i.push(s),n.push(o.renderTemplate(s))}const o={container:e,cellContainers:i,cellTemplateData:n};return this.renderedTemplates.add(o),o}renderElement(e,t,i,n){for(let o=0;o<this.columns.length;o++){const s=this.columns[o].project(e);this.renderers[o].renderElement(s,t,i.cellTemplateData[o],n)}}disposeElement(e,t,i,n){for(let o=0;o<this.columns.length;o++){const s=this.renderers[o];if(s.disposeElement){const r=this.columns[o].project(e);s.disposeElement(r,t,i.cellTemplateData[o],n)}}}disposeTemplate(e){for(let t=0;t<this.columns.length;t++)this.renderers[t].disposeTemplate(e.cellTemplateData[t]);yve(e.container),this.renderedTemplates.delete(e)}layoutColumn(e,t){for(const{cellContainers:i}of this.renderedTemplates)i[e].style.width=`${t}px`}}tKe.TemplateId="row";class iKe{get minimumSize(){var e;return null!==(e=this.column.minimumWidth)&&void 0!==e?e:120}get maximumSize(){var e;return null!==(e=this.column.maximumWidth)&&void 0!==e?e:Number.POSITIVE_INFINITY}get onDidChange(){var e;return null!==(e=this.column.onDidChangeWidthConstraints)&&void 0!==e?e:pae.None}constructor(e,t){this.column=e,this.index=t,this._onDidLayout=new bae,this.onDidLayout=this._onDidLayout.event,this.element=sbe(".monaco-table-th",{"data-col-index":t,title:e.tooltip},e.label)}layout(e){this._onDidLayout.fire([this.index,e])}}class nKe{get onDidChangeFocus(){return this.list.onDidChangeFocus}get onDidChangeSelection(){return this.list.onDidChangeSelection}get onMouseDblClick(){return this.list.onMouseDblClick}get onPointer(){return this.list.onPointer}get onDidFocus(){return this.list.onDidFocus}get onDidDispose(){return this.list.onDidDispose}constructor(e,t,i,n,o,s){this.virtualDelegate=i,this.domId="table_id_"+ ++nKe.InstanceCount,this.disposables=new rae,this.cachedWidth=0,this.cachedHeight=0,this.domNode=ebe(t,sbe(`.monaco-table.${this.domId}`));const r=n.map(((e,t)=>new iKe(e,t))),a={size:r.reduce(((e,t)=>e+t.column.weight),0),views:r.map((e=>({size:e.column.weight,view:e})))};this.splitview=this.disposables.add(new QUe(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:a})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const l=new tKe(n,o,(e=>this.splitview.getViewSize(e)));var h;this.list=this.disposables.add(new dFe(e,this.domNode,(h=i,{getHeight:e=>h.getHeight(e),getTemplateId:()=>tKe.TemplateId}),[l],s)),pae.any(...r.map((e=>e.onDidLayout)))((([e,t])=>l.layoutColumn(e,t)),null,this.disposables),this.splitview.onDidSashReset((e=>{const t=n.reduce(((e,t)=>e+t.weight),0),i=n[e].weight/t*this.cachedWidth;this.splitview.resizeView(e,i)}),null,this.disposables),this.styleElement=qve(this.domNode),this.style(nFe)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\ttop: ${this.virtualDelegate.headerRowHeight+1}px;\n\t\t\theight: calc(100% - ${this.virtualDelegate.headerRowHeight}px);\n\t\t}`),this.styleElement.textContent=t.join("\n"),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}nKe.InstanceCount=0,function(e){e[e.Unknown=0]="Unknown",e[e.Twistie=1]="Twistie",e[e.Element=2]="Element",e[e.Filter=3]="Filter"}(XUe||(XUe={}));class oKe extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class sKe{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}function rKe(e){return"object"==typeof e&&"visibility"in e&&"data"in e}function aKe(e){switch(e){case!0:return 1;case!1:return 0;default:return e}}function lKe(e){return"boolean"==typeof e.collapsible}class hKe{constructor(e,t,i,n={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new xae,this._onDidChangeCollapseState=new bae,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new bae,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new bae,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new npe(Qge),this.collapseByDefault=void 0!==n.collapseByDefault&&n.collapseByDefault,this.filter=n.filter,this.autoExpandSingleChildren=void 0!==n.autoExpandSingleChildren&&n.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=bse.empty(),n={}){if(0===e.length)throw new oKe(this.user,"Invalid tree location");n.diffIdentityProvider?this.spliceSmart(n.diffIdentityProvider,e,t,i,n):this.spliceSimple(e,t,i,n)}spliceSmart(e,t,i,n,o,s){var r;void 0===n&&(n=bse.empty()),void 0===s&&(s=null!==(r=o.diffDepth)&&void 0!==r?r:0);const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,n,o);const l=[...n],h=t[t.length-1],d=new Upe({getElements:()=>a.lastDiffIds},{getElements:()=>[...a.children.slice(0,h),...l,...a.children.slice(h+i)].map((t=>e.getId(t.element).toString()))}).ComputeDiff(!1);if(d.quitEarly)return a.lastDiffIds=void 0,this.spliceSimple(t,i,l,o);const c=t.slice(0,-1),u=(t,i,n)=>{if(s>0)for(let r=0;r<n;r++)t--,i--,this.spliceSmart(e,[...c,t,0],Number.MAX_SAFE_INTEGER,l[i].children,o,s-1)};let g=Math.min(a.children.length,h+i),p=l.length;for(const e of d.changes.sort(((e,t)=>t.originalStart-e.originalStart)))u(g,p,g-(e.originalStart+e.originalLength)),g=e.originalStart,p=e.modifiedStart-h,this.spliceSimple([...c,g],e.originalLength,bse.slice(l,p,p+e.modifiedLength),o);u(g,p,g)}spliceSimple(e,t,i=bse.empty(),{onDidCreateNode:n,onDidDeleteNode:o,diffIdentityProvider:s}){const{parentNode:r,listIndex:a,revealed:l,visible:h}=this.getParentNodeWithListIndex(e),d=[],c=bse.map(i,(e=>this.createTreeNode(e,r,r.visible?1:0,l,d,n))),u=e[e.length-1],g=r.children.length>0;let p=0;for(let e=u;e>=0&&e<r.children.length;e--){const t=r.children[e];if(t.visible){p=t.visibleChildIndex;break}}const m=[];let f=0,_=0;for(const e of c)m.push(e),_+=e.renderNodeCount,e.visible&&(e.visibleChildIndex=p+f++);const v=Bse(r.children,u,t,m);s?r.lastDiffIds?Bse(r.lastDiffIds,u,t,m.map((e=>s.getId(e.element).toString()))):r.lastDiffIds=r.children.map((e=>s.getId(e.element).toString())):r.lastDiffIds=void 0;let b=0;for(const e of v)e.visible&&b++;if(0!==b)for(let e=u+m.length;e<r.children.length;e++){const t=r.children[e];t.visible&&(t.visibleChildIndex-=b)}if(r.visibleChildrenCount+=f-b,l&&h){const e=v.reduce(((e,t)=>e+(t.visible?t.renderNodeCount:0)),0);this._updateAncestorsRenderNodeCount(r,_-e),this.list.splice(a,e,d)}if(v.length>0&&o){const e=t=>{o(t),t.children.forEach(e)};v.forEach(e)}this._onDidSplice.fire({insertedNodes:m,deletedNodes:v});const w=r.children.length>0;g!==w&&this.setCollapsible(e.slice(0,-1),w);let C=r;for(;C;){if(2===C.visibility){this.refilterDelayer.trigger((()=>this.refilter()));break}C=C.parent}}rerender(e){if(0===e.length)throw new oKe(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:n}=this.getTreeNodeWithListIndex(e);t.visible&&n&&this.list.splice(i,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:n}=this.getTreeNodeWithListIndex(e);return i&&n?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);void 0===t&&(t=!i.collapsible);const n={collapsible:t};return this.eventBufferer.bufferEvents((()=>this._setCollapseState(e,n)))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const n=this.getTreeNode(e);void 0===t&&(t=!n.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents((()=>this._setCollapseState(e,o)))}_setCollapseState(e,t){const{node:i,listIndex:n,revealed:o}=this.getTreeNodeWithListIndex(e),s=this._setListNodeCollapseState(i,n,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&s&&!lKe(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let n=-1;for(let e=0;e<i.children.length;e++)if(i.children[e].visible){if(n>-1){n=-1;break}n=e}n>-1&&this._setCollapseState([...e,n],t)}return s}_setListNodeCollapseState(e,t,i,n){const o=this._setNodeCollapseState(e,n,!1);if(!i||!e.visible||!o)return o;const s=e.renderNodeCount,r=this.updateNodeAfterCollapseChange(e),a=s-(-1===t?0:1);return this.list.splice(t+1,a,r.slice(1)),o}_setNodeCollapseState(e,t,i){let n;if(e===this.root?n=!1:(lKe(t)?(n=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(n=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):n=!1,n&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!lKe(t)&&t.recursive)for(const i of e.children)n=this._setNodeCollapseState(i,t,!0)||n;return n}expandTo(e){this.eventBufferer.bufferEvents((()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})}))}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t),this.refilterDelayer.cancel()}createTreeNode(e,t,i,n,o,s){const r={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:"boolean"==typeof e.collapsible?e.collapsible:void 0!==e.collapsed,collapsed:void 0===e.collapsed?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},a=this._filterNode(r,i);r.visibility=a,n&&o.push(r);const l=e.children||bse.empty(),h=n&&0!==a&&!r.collapsed;let d=0,c=1;for(const e of l){const t=this.createTreeNode(e,r,a,h,o,s);r.children.push(t),c+=t.renderNodeCount,t.visible&&(t.visibleChildIndex=d++)}return r.collapsible=r.collapsible||r.children.length>0,r.visibleChildrenCount=d,r.visible=2===a?d>0:1===a,r.visible?r.collapsed||(r.renderNodeCount=c):(r.renderNodeCount=0,n&&o.pop()),null==s||s(r),r}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(!1===e.visible)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,n=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),0===o)return e.visible=!1,e.renderNodeCount=0,!1;n&&i.push(e)}const s=i.length;e.renderNodeCount=e===this.root?0:1;let r=!1;if(e.collapsed&&0===o)e.visibleChildrenCount=0;else{let t=0;for(const s of e.children)r=this._updateNodeAfterFilterChange(s,o,i,n&&!e.collapsed)||r,s.visible&&(s.visibleChildIndex=t++);e.visibleChildrenCount=t}return e!==this.root&&(e.visible=2===o?r:1===o,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-s):(e.renderNodeCount=0,n&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(0!==t)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):1;return"boolean"==typeof i?(e.filterData=void 0,i?1:0):rKe(i)?(e.filterData=i.data,aKe(i.visibility)):(e.filterData=void 0,aKe(i))}hasTreeNode(e,t=this.root){if(!e||0===e.length)return!0;const[i,...n]=e;return!(i<0||i>t.children.length)&&this.hasTreeNode(n,t.children[i])}getTreeNode(e,t=this.root){if(!e||0===e.length)return t;const[i,...n]=e;if(i<0||i>t.children.length)throw new oKe(this.user,"Invalid tree location");return this.getTreeNode(n,t.children[i])}getTreeNodeWithListIndex(e){if(0===e.length)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:n,visible:o}=this.getParentNodeWithListIndex(e),s=e[e.length-1];if(s<0||s>t.children.length)throw new oKe(this.user,"Invalid tree location");const r=t.children[s];return{node:r,listIndex:i,revealed:n,visible:o&&r.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,o=!0){const[s,...r]=e;if(s<0||s>t.children.length)throw new oKe(this.user,"Invalid tree location");for(let e=0;e<s;e++)i+=t.children[e].renderNodeCount;return n=n&&!t.collapsed,o=o&&t.visible,0===r.length?{parentNode:t,listIndex:i,revealed:n,visible:o}:this.getParentNodeWithListIndex(r,t.children[s],i+1,n,o)}getNode(e=[]){return this.getTreeNode(e)}getNodeLocation(e){const t=[];let i=e;for(;i.parent;)t.push(i.parent.children.indexOf(i)),i=i.parent;return t.reverse()}getParentNodeLocation(e){return 0===e.length?void 0:1===e.length?[]:function(e){if(0===e.length)throw new Error("Invalid tail call");return[e.slice(0,e.length-1),e[e.length-1]]}(e)[0]}getFirstElementChild(e){const t=this.getTreeNode(e);if(0!==t.children.length)return t.children[0].element}}class dKe{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),0===i.size&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}}var cKe,uKe,gKe,pKe=i(98),mKe={};mKe.styleTagTransform=Vr(),mKe.setAttributes=Pr(),mKe.insert=Rr().bind(null,"head"),mKe.domAPI=Tr(),mKe.insertStyleElement=Br(),Ir()(pKe.Z,mKe),pKe.Z&&pKe.Z.locals&&pKe.Z.locals;class fKe extends TPe{constructor(e){super(e.elements.map((e=>e.element))),this.data=e}}function _Ke(e){return e instanceof TPe?new fKe(e):e}class vKe{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=aae.None}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map((e=>e.element)),t)}onDragStart(e,t){var i,n;null===(n=(i=this.dnd).onDragStart)||void 0===n||n.call(i,_Ke(e),t)}onDragOver(e,t,i,n,o=!0){const s=this.dnd.onDragOver(_Ke(e),t&&t.element,i,n),r=this.autoExpandNode!==t;if(r&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),void 0===t)return s;if(r&&"boolean"!=typeof s&&s.autoExpand&&(this.autoExpandDisposable=rpe((()=>{const e=this.modelProvider(),i=e.getNodeLocation(t);e.isCollapsed(i)&&e.setCollapsed(i,!1),this.autoExpandNode=void 0}),500)),"boolean"==typeof s||!s.accept||void 0===s.bubble||s.feedback)return o?s:{accept:"boolean"==typeof s?s:s.accept,effect:"boolean"==typeof s?void 0:s.effect,feedback:[i]};if(1===s.bubble){const i=this.modelProvider(),o=i.getNodeLocation(t),s=i.getParentNodeLocation(o),r=i.getNode(s),a=s&&i.getListIndex(s);return this.onDragOver(e,r,a,n,!1)}const a=this.modelProvider(),l=a.getNodeLocation(t),h=a.getListIndex(l),d=a.getListRenderCount(l);return Object.assign(Object.assign({},s),{feedback:Ase(h,h+d)})}drop(e,t,i,n){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(_Ke(e),t&&t.element,i,n)}onDragEnd(e){var t,i;null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}}class bKe{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){var i,n;null===(n=(i=this.delegate).setDynamicHeight)||void 0===n||n.call(i,e.element,t)}}!function(e){e.None="none",e.OnHover="onHover",e.Always="always"}(cKe||(cKe={}));class wKe{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new rae,this.onDidChange=pae.forEach(e,(e=>this._elements=e),this.disposables)}dispose(){this.disposables.dispose()}}class CKe{constructor(e,t,i,n,o,s={}){var r;this.renderer=e,this.modelProvider=t,this.activeNodes=n,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=CKe.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=aae.None,this.disposables=new rae,this.templateId=e.templateId,this.updateOptions(s),pae.map(i,(e=>e.node))(this.onDidChangeNodeTwistieState,this,this.disposables),null===(r=e.onDidChangeTwistieState)||void 0===r||r.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(void 0!==e.indent){const t=vPe(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[e,t]of this.renderedNodes)this.renderTreeElement(e,t)}}if(void 0!==e.renderIndentGuides){const t=e.renderIndentGuides!==cKe.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[e,t]of this.renderedNodes)this._renderIndentGuides(e,t);if(this.indentGuidesDisposable.dispose(),t){const e=new rae;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,e),this.indentGuidesDisposable=e,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}void 0!==e.hideTwistiesOfChildlessElements&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=ebe(e,sbe(".monaco-tl-row")),i=ebe(t,sbe(".monaco-tl-indent")),n=ebe(t,sbe(".monaco-tl-twistie")),o=ebe(t,sbe(".monaco-tl-contents")),s=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:n,indentGuidesDisposable:aae.None,templateData:s}}renderElement(e,t,i,n){this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,n)}disposeElement(e,t,i,n){var o,s;i.indentGuidesDisposable.dispose(),null===(s=(o=this.renderer).disposeElement)||void 0===s||s.call(o,e,t,i.templateData,n),"number"==typeof n&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){const i=CKe.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${i}px`,t.indent.style.width=i+this.indent-16+"px",e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...Ibe.asClassNameArray(Vle.treeItemExpanded));let n=!1;this.renderer.renderTwistie&&(n=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(n||t.twistie.classList.add(...Ibe.asClassNameArray(Vle.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(yve(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new rae,n=this.modelProvider();for(;;){const o=n.getNodeLocation(e),s=n.getParentNodeLocation(o);if(!s)break;const r=n.getNode(s),a=sbe(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(r)&&a.classList.add("active"),0===t.indent.childElementCount?t.indent.appendChild(a):t.indent.insertBefore(a,t.indent.firstElementChild),this.renderedIndentGuides.add(r,a),i.add(sae((()=>this.renderedIndentGuides.delete(r,a)))),e=r}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach((e=>{const n=i.getNodeLocation(e);try{const o=i.getParentNodeLocation(n);e.collapsible&&e.children.length>0&&!e.collapsed?t.add(e):o&&t.add(i.getNode(o))}catch(e){}})),this.activeIndentNodes.forEach((e=>{t.has(e)||this.renderedIndentGuides.forEach(e,(e=>e.classList.remove("active")))})),t.forEach((e=>{this.activeIndentNodes.has(e)||this.renderedIndentGuides.forEach(e,(e=>e.classList.add("active")))})),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),nae(this.disposables)}}CKe.DefaultIndent=8;class yKe{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,i){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=i,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new rae,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let i=1;if(this._filter){const n=this._filter.filter(e,t);if(i="boolean"==typeof n?n?1:0:rKe(n)?aKe(n.visibility):n,0===i)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:ROe.Default,visibility:i};const n=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(n)?n:[n];for(const e of o){const t=e&&e.toString();if(void 0===t)return{data:ROe.Default,visibility:i};let n;if(this.tree.findMatchType===gKe.Contiguous){const e=t.toLowerCase().indexOf(this._lowercasePattern);if(e>-1){n=[Number.MAX_SAFE_INTEGER,0];for(let t=this._lowercasePattern.length;t>0;t--)n.push(e+t-1)}}else n=POe(this._pattern,this._lowercasePattern,0,t,t.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(n)return this._matchCount++,1===o.length?{data:n,visibility:i}:{data:{label:t,score:n},visibility:i}}return this.tree.findMode===uKe.Filter?"number"==typeof this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:ROe.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){nae(this.disposables)}}!function(e){e[e.Highlight=0]="Highlight",e[e.Filter=1]="Filter"}(uKe||(uKe={})),function(e){e[e.Fuzzy=0]="Fuzzy",e[e.Contiguous=1]="Contiguous"}(gKe||(gKe={}));class SKe{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,n,o,s={}){var r,a;this.tree=e,this.view=i,this.filter=n,this.contextViewProvider=o,this.options=s,this._pattern="",this.width=0,this._onDidChangeMode=new bae,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new bae,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new bae,this._onDidChangeOpenState=new bae,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new rae,this.disposables=new rae,this._mode=null!==(r=e.options.defaultFindMode)&&void 0!==r?r:uKe.Highlight,this._matchType=null!==(a=e.options.defaultFindMatchType)&&void 0!==a?a:gKe.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){void 0!==e.defaultFindMode&&(this.mode=e.defaultFindMode),void 0!==e.defaultFindMatchType&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){this.widget&&0!==this.pattern.length&&(this.tree.refilter(),this.render())}render(){var e,t,i,n;const o=this.filter.totalCount>0&&0===this.filter.matchCount;this.pattern&&o?null===(e=this.tree.options.showNotFoundMessage)||void 0===e||e?null===(t=this.widget)||void 0===t||t.showMessage({type:2,content:Toe(0,"No elements found.")}):null===(i=this.widget)||void 0===i||i.showMessage({type:2}):null===(n=this.widget)||void 0===n||n.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this._mode===uKe.Filter||this.filter.totalCount>0&&this.filter.matchCount<=1||!ROe.isDefault(e.filterData)}layout(e){var t;this.width=e,null===(t=this.widget)||void 0===t||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}}function kKe(e){let t=XUe.Unknown;return zve(e.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?t=XUe.Twistie:zve(e.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?t=XUe.Element:zve(e.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(t=XUe.Filter),{browserEvent:e.browserEvent,element:e.element?e.element.element:null,target:t}}function LKe(e,t){t(e),e.children.forEach((e=>LKe(e,t)))}class xKe{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new bae,this.onDidChange=this._onDidChange.event}set(e,t){!(null==t?void 0:t.__forceEvent)&&Nse(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const e=this;this._onDidChange.fire({get elements(){return e.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map((e=>e.element))),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const e=this.createNodeSet(),i=t=>e.delete(t);return t.forEach((e=>LKe(e,i))),void this.set([...e.values()])}const i=new Set,n=e=>i.add(this.identityProvider.getId(e.element).toString());t.forEach((e=>LKe(e,n)));const o=new Map,s=e=>o.set(this.identityProvider.getId(e.element).toString(),e);e.forEach((e=>LKe(e,s)));const r=[];for(const e of this.nodes){const t=this.identityProvider.getId(e.element).toString();if(i.has(t)){const e=o.get(t);e&&r.push(e)}else r.push(e)}if(this.nodes.length>0&&0===r.length){const e=this.getFirstViewElementWithTrait();e&&r.push(e)}this._set(r,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class DKe extends tFe{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if($Pe(e.browserEvent.target)||jPe(e.browserEvent.target)||qPe(e.browserEvent.target))return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,n=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16;let o=!1;if(o="function"==typeof this.tree.expandOnlyOnTwistieClick?this.tree.expandOnlyOnTwistieClick(t.element):!!this.tree.expandOnlyOnTwistieClick,o&&!n&&2!==e.browserEvent.detail)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&2===e.browserEvent.detail)return super.onViewPointer(e);if(t.collapsible){const i=this.tree.getNodeLocation(t),s=e.browserEvent.altKey;if(this.tree.setFocus([i]),this.tree.toggleCollapsed(i,s),o&&n)return}super.onViewPointer(e)}onDoubleClick(e){!e.browserEvent.target.classList.contains("monaco-tl-twistie")&&this.tree.expandOnDoubleClick&&super.onDoubleClick(e)}}class EKe extends dFe{constructor(e,t,i,n,o,s,r,a){super(e,t,i,n,a),this.focusTrait=o,this.selectionTrait=s,this.anchorTrait=r}createMouseController(e){return new DKe(this,e.tree)}splice(e,t,i=[]){if(super.splice(e,t,i),0===i.length)return;const n=[],o=[];let s;i.forEach(((t,i)=>{this.focusTrait.has(t)&&n.push(e+i),this.selectionTrait.has(t)&&o.push(e+i),this.anchorTrait.has(t)&&(s=e+i)})),n.length>0&&super.setFocus(Mse([...super.getFocus(),...n])),o.length>0&&super.setSelection(Mse([...super.getSelection(),...o])),"number"==typeof s&&super.setAnchor(s)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map((e=>this.element(e))),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map((e=>this.element(e))),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(void 0===e?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class NKe{get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return pae.filter(pae.map(this.view.onMouseDblClick,kKe),(e=>e.target!==XUe.Filter))}get onPointer(){return pae.map(this.view.onPointer,kKe)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return pae.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,t;return null!==(t=null===(e=this.findController)||void 0===e?void 0:e.mode)&&void 0!==t?t:uKe.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,t;return null!==(t=null===(e=this.findController)||void 0===e?void 0:e.matchType)&&void 0!==t?t:gKe.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return void 0===this._options.expandOnDoubleClick||this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return void 0===this._options.expandOnlyOnTwistieClick||this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,n,o={}){var s;this._user=e,this._options=o,this.eventBufferer=new xae,this.onDidChangeFindOpenState=pae.None,this.disposables=new rae,this._onWillRefilter=new bae,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new bae;const r=new bKe(i),a=new Dae,l=new Dae,h=this.disposables.add(new wKe(l.event)),d=new dKe;this.renderers=n.map((e=>new CKe(e,(()=>this.model),a.event,h,d,o)));for(const e of this.renderers)this.disposables.add(e);let c;o.keyboardNavigationLabelProvider&&(c=new yKe(this,o.keyboardNavigationLabelProvider,o.filter),o=Object.assign(Object.assign({},o),{filter:c}),this.disposables.add(c)),this.focus=new xKe((()=>this.view.getFocusedElements()[0]),o.identityProvider),this.selection=new xKe((()=>this.view.getSelectedElements()[0]),o.identityProvider),this.anchor=new xKe((()=>this.view.getAnchorElement()),o.identityProvider),this.view=new EKe(e,t,r,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},function(e,t){return t&&Object.assign(Object.assign({},t),{identityProvider:t.identityProvider&&{getId:e=>t.identityProvider.getId(e.element)},dnd:t.dnd&&new vKe(e,t.dnd),multipleSelectionController:t.multipleSelectionController&&{isSelectionSingleChangeEvent:e=>t.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element})),isSelectionRangeChangeEvent:e=>t.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},accessibilityProvider:t.accessibilityProvider&&Object.assign(Object.assign({},t.accessibilityProvider),{getSetSize(t){const i=e(),n=i.getNodeLocation(t),o=i.getParentNodeLocation(n);return i.getNode(o).visibleChildrenCount},getPosInSet:e=>e.visibleChildIndex+1,isChecked:t.accessibilityProvider&&t.accessibilityProvider.isChecked?e=>t.accessibilityProvider.isChecked(e.element):void 0,getRole:t.accessibilityProvider&&t.accessibilityProvider.getRole?e=>t.accessibilityProvider.getRole(e.element):()=>"treeitem",getAriaLabel:e=>t.accessibilityProvider.getAriaLabel(e.element),getWidgetAriaLabel:()=>t.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:t.accessibilityProvider&&t.accessibilityProvider.getWidgetRole?()=>t.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:t.accessibilityProvider&&t.accessibilityProvider.getAriaLevel?e=>t.accessibilityProvider.getAriaLevel(e.element):e=>e.depth,getActiveDescendantId:t.accessibilityProvider.getActiveDescendantId&&(e=>t.accessibilityProvider.getActiveDescendantId(e.element))}),keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},t.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel:e=>t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)})})}((()=>this.model),o)),{tree:this})),this.model=this.createModel(e,this.view,o),a.input=this.model.onDidChangeCollapseState;const u=pae.forEach(this.model.onDidSplice,(e=>{this.eventBufferer.bufferEvents((()=>{this.focus.onDidModelSplice(e),this.selection.onDidModelSplice(e)}))}),this.disposables);if(u((()=>null),null,this.disposables),l.input=pae.chain(pae.any(u,this.focus.onDidChange,this.selection.onDidChange)).debounce((()=>null),0).map((()=>{const e=new Set;for(const t of this.focus.getNodes())e.add(t);for(const t of this.selection.getNodes())e.add(t);return[...e.values()]})).event,!1!==o.keyboardSupport){const e=pae.chain(this.view.onKeyDown).filter((e=>!jPe(e.target))).map((e=>new p_e(e)));e.filter((e=>15===e.keyCode)).on(this.onLeftArrow,this,this.disposables),e.filter((e=>17===e.keyCode)).on(this.onRightArrow,this,this.disposables),e.filter((e=>10===e.keyCode)).on(this.onSpace,this,this.disposables)}if((null===(s=o.findWidgetEnabled)||void 0===s||s)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const e=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new SKe(this,this.model,this.view,c,o.contextViewProvider,e),this.focusNavigationFilter=e=>this.findController.shouldAllowFocus(e),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=pae.None,this.onDidChangeFindMatchType=pae.None;this.styleElement=qve(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===cKe.Always)}updateOptions(e={}){var t;this._options=Object.assign(Object.assign({},this._options),e);for(const t of this.renderers)t.updateOptions(e);this.view.updateOptions(this._options),null===(t=this.findController)||void 0===t||t.updateOptions(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===cKe.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}domFocus(){this.view.domFocus()}layout(e,t){var i;this.view.layout(e,t),$se(t)&&(null===(i=this.findController)||void 0===i||i.layout(t))}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),this.styleElement.textContent=i.join("\n"),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const i=e.map((e=>this.model.getNode(e)));this.selection.set(i,t);const n=e.map((e=>this.model.getListIndex(e))).filter((e=>e>-1));this.view.setSelection(n,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const i=e.map((e=>this.model.getNode(e)));this.focus.set(i,t);const n=e.map((e=>this.model.getListIndex(e))).filter((e=>e>-1));this.view.setFocus(n,t,!0)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);-1!==i&&this.view.reveal(i,t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const e=this.model.getParentNodeLocation(n);if(!e)return;const t=this.model.getListIndex(e);this.view.reveal(t),this.view.setFocus([t])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some((e=>e.visible)))return;const[e]=this.view.getFocus(),t=e+1;this.view.reveal(t),this.view.setFocus([t])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,o)}dispose(){nae(this.disposables),this.view.dispose()}}class IKe{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new hKe(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare:(e,t)=>i.sorter.compare(e.element,t.element)}),this.identityProvider=i.identityProvider}setChildren(e,t=bse.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=bse.empty(),i){const n=new Set,o=new Set;this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:e=>{var t;if(null===e.element)return;const s=e;if(n.add(s.element),this.nodes.set(s.element,s),this.identityProvider){const e=this.identityProvider.getId(s.element).toString();o.add(e),this.nodesByIdentity.set(e,s)}null===(t=i.onDidCreateNode)||void 0===t||t.call(i,s)},onDidDeleteNode:e=>{var t;if(null===e.element)return;const s=e;if(n.has(s.element)||this.nodes.delete(s.element),this.identityProvider){const e=this.identityProvider.getId(s.element).toString();o.has(e)||this.nodesByIdentity.delete(e)}null===(t=i.onDidDeleteNode)||void 0===t||t.call(i,s)}}))}preserveCollapseState(e=bse.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),bse.map(e,(e=>{let t=this.nodes.get(e.element);if(!t&&this.identityProvider){const i=this.identityProvider.getId(e.element).toString();t=this.nodesByIdentity.get(i)}if(!t)return Object.assign(Object.assign({},e),{children:this.preserveCollapseState(e.children)});const i="boolean"==typeof e.collapsible?e.collapsible:t.collapsible,n=void 0!==e.collapsed?e.collapsed:t.collapsed;return Object.assign(Object.assign({},e),{collapsible:i,collapsed:n,children:this.preserveCollapseState(e.children)})}))}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getElementLocation(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(null===e)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new oKe(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(null===e)throw new oKe(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new oKe(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),n=this.model.getParentNodeLocation(i);return this.model.getNode(n).element}getElementLocation(e){if(null===e)return[];const t=this.nodes.get(e);if(!t)throw new oKe(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function MKe(e){return{element:{elements:[e.element],incompressible:e.incompressible||!1},children:bse.map(bse.from(e.children),MKe),collapsible:e.collapsible,collapsed:e.collapsed}}function TKe(e){const t=[e.element],i=e.incompressible||!1;let n,o;for(;[o,n]=bse.consume(bse.from(e.children),2),1===o.length&&!o[0].incompressible;)e=o[0],t.push(e.element);return{element:{elements:t,incompressible:i},children:bse.map(bse.concat(o,n),TKe),collapsible:e.collapsible,collapsed:e.collapsed}}function AKe(e,t=0){let i;return i=t<e.element.elements.length-1?[AKe(e,t+1)]:bse.map(bse.from(e.children),(e=>AKe(e,0))),0===t&&e.element.incompressible?{element:e.element.elements[t],children:i,incompressible:!0,collapsible:e.collapsible,collapsed:e.collapsed}:{element:e.element.elements[t],children:i,collapsible:e.collapsible,collapsed:e.collapsed}}function RKe(e){return AKe(e,0)}function OKe(e,t,i){return e.element===t?Object.assign(Object.assign({},e),{children:i}):Object.assign(Object.assign({},e),{children:bse.map(bse.from(e.children),(e=>OKe(e,t,i)))})}class PKe{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new IKe(e,t,i),this.enabled=void 0===i.compressionEnabled||i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=bse.empty(),i){const n=i.diffIdentityProvider&&(o=i.diffIdentityProvider,{getId:e=>e.elements.map((e=>o.getId(e).toString())).join("\0")});var o;if(null===e){const e=bse.map(t,this.enabled?TKe:MKe);return void this._setChildren(null,e,{diffIdentityProvider:n,diffDepth:1/0})}const s=this.nodes.get(e);if(!s)throw new oKe(this.user,"Unknown compressed tree node");const r=this.model.getNode(s),a=this.model.getParentNodeLocation(s),l=this.model.getNode(a),h=OKe(RKe(r),e,t),d=(this.enabled?TKe:MKe)(h),c=l.children.map((e=>e===r?d:e));this._setChildren(l.element,c,{diffIdentityProvider:n,diffDepth:r.depth-l.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const t=this.model.getNode().children,i=bse.map(t,RKe),n=bse.map(i,e?TKe:MKe);this._setChildren(null,n,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set;this.model.setChildren(e,t,Object.assign(Object.assign({},i),{onDidCreateNode:e=>{for(const t of e.element.elements)n.add(t),this.nodes.set(t,e.element)},onDidDeleteNode:e=>{for(const t of e.element.elements)n.has(t)||this.nodes.delete(t)}}))}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(void 0===e)return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return null===t?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return null===i?null:i.elements[i.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getCompressedNode(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(null===e)return null;const t=this.nodes.get(e);if(!t)throw new oKe(this.user,`Tree element not found: ${e}`);return t}}const FKe=e=>e[e.length-1];class BKe{get element(){return null===this.node.element?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map((e=>new BKe(this.unwrapper,e)))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}}class WKe{get onDidSplice(){return pae.map(this.model.onDidSplice,(({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map((e=>this.nodeMapper.map(e))),deletedNodes:t.map((e=>this.nodeMapper.map(e)))})))}get onDidChangeCollapseState(){return pae.map(this.model.onDidChangeCollapseState,(({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t})))}get onDidChangeRenderNodeCount(){return pae.map(this.model.onDidChangeRenderNodeCount,(e=>this.nodeMapper.map(e)))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||FKe;const n=e=>this.elementMapper(e.elements);this.nodeMapper=new sKe((e=>new BKe(n,e))),this.model=new PKe(e,function(e,t){return{splice(i,n,o){t.splice(i,n,o.map((t=>e.map(t))))},updateElementHeight(e,i){t.updateElementHeight(e,i)}}}(this.nodeMapper,t),function(e,t){return Object.assign(Object.assign({},t),{identityProvider:t.identityProvider&&{getId:i=>t.identityProvider.getId(e(i))},sorter:t.sorter&&{compare:(e,i)=>t.sorter.compare(e.elements[0],i.elements[0])},filter:t.filter&&{filter:(i,n)=>t.filter.filter(e(i),n)}})}(n,i))}setChildren(e,t=bse.empty(),i={}){this.model.setChildren(e,t,i)}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return null==t?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}class VKe extends NKe{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,n,o={}){super(e,t,i,n,o),this.user=e}setChildren(e,t=bse.empty(),i){this.model.setChildren(e,t,i)}rerender(e){void 0!==e?this.model.rerender(e):this.view.rerender()}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new IKe(e,t,i)}}class zKe{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){const o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);1===o.element.elements.length?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,n)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,n))}disposeElement(e,t,i,n){var o,s,r,a;i.compressedTreeNode?null===(s=(o=this.renderer).disposeCompressedElements)||void 0===s||s.call(o,i.compressedTreeNode,t,i.data,n):null===(a=(r=this.renderer).disposeElement)||void 0===a||a.call(r,e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return!!this.renderer.renderTwistie&&this.renderer.renderTwistie(e,t)}}!function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);s>3&&r&&Object.defineProperty(t,i,r)}([Dwe],zKe.prototype,"compressedTreeNodeProvider",null);class HKe extends VKe{constructor(e,t,i,n,o={}){const s=()=>this;super(e,t,i,n.map((e=>new zKe(s,e))),function(e,t){return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(i){let n;try{n=e().getCompressedTreeNode(i)}catch(e){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i)}return 1===n.element.elements.length?t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i):t.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.element.elements)}}})}(s,o))}setChildren(e,t=bse.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new WKe(e,t,i)}updateOptions(e={}){super.updateOptions(e),void 0!==e.compressionEnabled&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var UKe=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function KKe(e){return Object.assign(Object.assign({},e),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function jKe(e,t){return!!t.parent&&(t.parent===e||jKe(e,t.parent))}class qKe{get element(){return this.node.element.element}get children(){return this.node.children.map((e=>new qKe(e)))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class $Ke{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...Ibe.asClassNameArray(Vle.treeItemLoading)),!0):(t.classList.remove(...Ibe.asClassNameArray(Vle.treeItemLoading)),!1)}disposeElement(e,t,i,n){var o,s;null===(s=(o=this.renderer).disposeElement)||void 0===s||s.call(o,this.nodeMapper.map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function GKe(e){return{browserEvent:e.browserEvent,elements:e.elements.map((e=>e.element))}}function ZKe(e){return{browserEvent:e.browserEvent,element:e.element&&e.element.element,target:e.target}}class YKe extends TPe{constructor(e){super(e.elements.map((e=>e.element))),this.data=e}}function QKe(e){return e instanceof TPe?new YKe(e):e}class XKe{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map((e=>e.element)),t)}onDragStart(e,t){var i,n;null===(n=(i=this.dnd).onDragStart)||void 0===n||n.call(i,QKe(e),t)}onDragOver(e,t,i,n,o=!0){return this.dnd.onDragOver(QKe(e),t&&t.element,i,n)}drop(e,t,i,n){this.dnd.drop(QKe(e),t&&t.element,i,n)}onDragEnd(e){var t,i;null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}}function JKe(e){return e&&Object.assign(Object.assign({},e),{collapseByDefault:!0,identityProvider:e.identityProvider&&{getId:t=>e.identityProvider.getId(t.element)},dnd:e.dnd&&new XKe(e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent:t=>e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element})),isSelectionRangeChangeEvent:t=>e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},e.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",isChecked:e.accessibilityProvider.isChecked?t=>{var i;return!!(null===(i=e.accessibilityProvider)||void 0===i?void 0:i.isChecked(t.element))}:void 0,getAriaLabel:t=>e.accessibilityProvider.getAriaLabel(t.element),getWidgetAriaLabel:()=>e.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider.getAriaLevel&&(t=>e.accessibilityProvider.getAriaLevel(t.element)),getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))}),filter:e.filter&&{filter:(t,i)=>e.filter.filter(t.element,i)},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}),sorter:void 0,expandOnlyOnTwistieClick:void 0===e.expandOnlyOnTwistieClick?void 0:"function"!=typeof e.expandOnlyOnTwistieClick?e.expandOnlyOnTwistieClick:t=>e.expandOnlyOnTwistieClick(t.element),defaultFindVisibility:t=>t.hasChildren&&t.stale?1:"number"==typeof e.defaultFindVisibility?e.defaultFindVisibility:void 0===e.defaultFindVisibility?2:e.defaultFindVisibility(t.element)})}function eje(e,t){t(e),e.children.forEach((e=>eje(e,t)))}class tje{get onDidChangeFocus(){return pae.map(this.tree.onDidChangeFocus,GKe)}get onDidChangeSelection(){return pae.map(this.tree.onDidChangeSelection,GKe)}get onMouseDblClick(){return pae.map(this.tree.onMouseDblClick,ZKe)}get onPointer(){return pae.map(this.tree.onPointer,ZKe)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,n,o,s={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new bae,this._onDidChangeNodeSlowState=new bae,this.nodeMapper=new sKe((e=>new qKe(e))),this.disposables=new rae,this.identityProvider=s.identityProvider,this.autoExpandSingleChildren=void 0!==s.autoExpandSingleChildren&&s.autoExpandSingleChildren,this.sorter=s.sorter,this.collapseByDefault=s.collapseByDefault,this.tree=this.createTree(e,t,i,n,s),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.root=KKe({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=Object.assign(Object.assign({},this.root),{id:null})),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,i,n,o){const s=new bKe(i),r=n.map((e=>new $Ke(e,this.nodeMapper,this._onDidChangeNodeSlowState.event))),a=JKe(o)||{};return new VKe(e,t,s,r,a)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}setInput(e,t){return UKe(this,void 0,void 0,(function*(){this.refreshPromises.forEach((e=>e.cancel())),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&"number"==typeof t.scrollTop&&(this.scrollTop=t.scrollTop)}))}_updateChildren(e=this.root.element,t=!0,i=!1,n,o){return UKe(this,void 0,void 0,(function*(){if(void 0===this.root.element)throw new oKe(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield pae.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(yield this.refreshAndRenderNode(s,t,n,o),i)try{this.tree.rerender(s)}catch(e){}}))}rerender(e){if(void 0===e||e===this.root.element)return void this.tree.rerender();const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}expand(e,t=!1){return UKe(this,void 0,void 0,(function*(){if(void 0===this.root.element)throw new oKe(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield pae.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i))return!1;if(i.refreshPromise&&(yield this.root.refreshPromise,yield pae.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i))return!1;const n=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(yield this.root.refreshPromise,yield pae.toPromise(this._onDidRender.event)),n}))}setSelection(e,t){const i=e.map((e=>this.getDataNode(e)));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map((e=>e.element))}setFocus(e,t){const i=e.map((e=>this.getDataNode(e)));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map((e=>e.element))}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new oKe(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,i,n){return UKe(this,void 0,void 0,(function*(){yield this.refreshNode(e,t,i),this.render(e,i,n)}))}refreshNode(e,t,i){return UKe(this,void 0,void 0,(function*(){let n;return this.subTreeRefreshPromises.forEach(((o,s)=>{!n&&function(e,t){return e===t||jKe(e,t)||jKe(t,e)}(s,e)&&(n=o.then((()=>this.refreshNode(e,t,i))))})),n||(e!==this.root&&this.tree.getNode(e).collapsed?(e.hasChildren=!!this.dataSource.hasChildren(e.element),void(e.stale=!0)):this.doRefreshSubTree(e,t,i))}))}doRefreshSubTree(e,t,i){return UKe(this,void 0,void 0,(function*(){let n;e.refreshPromise=new Promise((e=>n=e)),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally((()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)}));try{const n=yield this.doRefreshNode(e,t,i);e.stale=!1,yield gpe.settled(n.map((e=>this.doRefreshSubTree(e,t,i))))}finally{n()}}))}doRefreshNode(e,t,i){return UKe(this,void 0,void 0,(function*(){let n;if(e.hasChildren=!!this.dataSource.hasChildren(e.element),e.hasChildren){const t=this.doGetChildren(e);if(Gse(t))n=Promise.resolve(t);else{const i=spe(800);i.then((()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)}),(e=>null)),n=t.finally((()=>i.cancel()))}}else n=Promise.resolve(bse.empty());try{const o=yield n;return this.setChildren(e,o,t,i)}catch(t){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),jre(t))return[];throw t}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}))}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const i=this.dataSource.getChildren(e.element);return Gse(i)?this.processChildren(i):(t=tpe((()=>UKe(this,void 0,void 0,(function*(){return this.processChildren(yield i)})))),this.refreshPromises.set(e,t),t.finally((()=>{this.refreshPromises.delete(e)})))}_onDidChangeCollapseState({node:e,deep:t}){null!==e.element&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(zre))}setChildren(e,t,i,n){const o=[...t];if(0===e.children.length&&0===o.length)return[];const s=new Map,r=new Map;for(const t of e.children)if(s.set(t.element,t),this.identityProvider){const e=this.tree.isCollapsed(t);r.set(t.id,{node:t,collapsed:e})}const a=[],l=o.map((t=>{const o=!!this.dataSource.hasChildren(t);if(!this.identityProvider){const i=KKe({element:t,parent:e,hasChildren:o});return o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(i.collapsedByDefault=!1,a.push(i)),i}const l=this.identityProvider.getId(t).toString(),h=r.get(l);if(h){const e=h.node;return s.delete(e.element),this.nodes.delete(e.element),this.nodes.set(t,e),e.element=t,e.hasChildren=o,i?h.collapsed?(e.children.forEach((e=>eje(e,(e=>this.nodes.delete(e.element))))),e.children.splice(0,e.children.length),e.stale=!0):a.push(e):o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(e.collapsedByDefault=!1,a.push(e)),e}const d=KKe({element:t,parent:e,id:l,hasChildren:o});return n&&n.viewState.focus&&n.viewState.focus.indexOf(l)>-1&&n.focus.push(d),n&&n.viewState.selection&&n.viewState.selection.indexOf(l)>-1&&n.selection.push(d),n&&n.viewState.expanded&&n.viewState.expanded.indexOf(l)>-1?a.push(d):o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(d.collapsedByDefault=!1,a.push(d)),d}));for(const e of s.values())eje(e,(e=>this.nodes.delete(e.element)));for(const e of l)this.nodes.set(e.element,e);return e.children.splice(0,e.children.length,...l),e!==this.root&&this.autoExpandSingleChildren&&1===l.length&&0===a.length&&(l[0].collapsedByDefault=!1,a.push(l[0])),a}render(e,t,i){const n=e.children.map((e=>this.asTreeElement(e,t))),o=i&&Object.assign(Object.assign({},i),{diffIdentityProvider:i.diffIdentityProvider&&{getId:e=>i.diffIdentityProvider.getId(e.element)}});this.tree.setChildren(e===this.root?null:e,n,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return i=!(t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1)&&e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?bse.map(e.children,(e=>this.asTreeElement(e,t))):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose()}}class ije{get element(){return{elements:this.node.element.elements.map((e=>e.element)),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map((e=>new ije(e)))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class nje{constructor(e,t,i,n){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderCompressedElements(e,t,i,n){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...Ibe.asClassNameArray(Vle.treeItemLoading)),!0):(t.classList.remove(...Ibe.asClassNameArray(Vle.treeItemLoading)),!1)}disposeElement(e,t,i,n){var o,s;null===(s=(o=this.renderer).disposeElement)||void 0===s||s.call(o,this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){var o,s;null===(s=(o=this.renderer).disposeCompressedElements)||void 0===s||s.call(o,this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=nae(this.disposables)}}class oje extends tje{constructor(e,t,i,n,o,s,r={}){super(e,t,i,o,s,r),this.compressionDelegate=n,this.compressibleNodeMapper=new sKe((e=>new ije(e))),this.filter=r.filter}createTree(e,t,i,n,o){const s=new bKe(i),r=n.map((e=>new nje(e,this.nodeMapper,(()=>this.compressibleNodeMapper),this._onDidChangeNodeSlowState.event))),a=function(e){const t=e&&JKe(e);return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},t.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map((e=>e.element)))})})}(o)||{};return new HKe(e,t,s,r,a)}asTreeElement(e,t){return Object.assign({incompressible:this.compressionDelegate.isIncompressible(e.element)},super.asTreeElement(e,t))}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t){if(!this.identityProvider)return super.render(e,t);const i=e=>this.identityProvider.getId(e).toString(),n=e=>{const t=new Set;for(const n of e){const e=this.tree.getCompressedTreeNode(n===this.root?null:n);if(e.element)for(const n of e.element.elements)t.add(i(n.element))}return t},o=n(this.tree.getSelection()),s=n(this.tree.getFocus());super.render(e,t);const r=this.getSelection();let a=!1;const l=this.getFocus();let h=!1;const d=e=>{const t=e.element;if(t)for(let e=0;e<t.elements.length;e++){const n=i(t.elements[e].element),d=t.elements[t.elements.length-1].element;o.has(n)&&-1===r.indexOf(d)&&(r.push(d),a=!0),s.has(n)&&-1===l.indexOf(d)&&(l.push(d),h=!0)}e.children.forEach(d)};d(this.tree.getCompressedTreeNode(e===this.root?null:e)),a&&this.setSelection(r),h&&this.setFocus(l)}processChildren(e){return this.filter&&(e=bse.filter(e,(e=>{const t="boolean"==typeof(i=this.filter.filter(e,1))?i?1:0:rKe(i)?aKe(i.visibility):aKe(i);var i;if(2===t)throw new Error("Recursive tree visibility not supported in async data compressed trees");return 1===t}))),super.processChildren(e)}}class sje extends NKe{constructor(e,t,i,n,o,s={}){super(e,t,i,n,s),this.user=e,this.dataSource=o,this.identityProvider=s.identityProvider}createModel(e,t,i){return new IKe(e,t,i)}}new jce("isMac",tse,Toe(0,"Whether the operating system is macOS")),new jce("isLinux",ise,Toe(0,"Whether the operating system is Linux")),new jce("isWindows",ese,Toe(0,"Whether the operating system is Windows")),new jce("isWeb",ose,Toe(0,"Whether the platform is a web browser")),new jce("isMacNative",tse&&!ose,Toe(0,"Whether the operating system is macOS on a non-browser platform")),new jce("isIOS",rse,Toe(0,"Whether the operating system is iOS")),new jce("isMobile",ase,Toe(0,"Whether the platform is a mobile web browser")),new jce("isDevelopment",!1,!0),new jce("productQualityType","",Toe(0,"Quality type of VS Code"));const rje="inputFocus";new jce(rje,!1,Toe(0,"Whether keyboard focus is inside an input box"));var aje=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},lje=function(e,t){return function(i,n){t(i,n,e)}};const hje=pce("listService"),dje=new jce("listFocus",!0),cje=new jce("listSupportsMultiselect",!0),uje=(Lce.and(dje,Lce.not(rje)),new jce("listHasSelectionOrFocus",!1)),gje=new jce("listDoubleSelection",!1),pje=new jce("listMultiSelection",!1),mje=new jce("listSelectionNavigation",!1),fje=new jce("listSupportsFind",!0),_je=new jce("treeElementCanCollapse",!1),vje=new jce("treeElementHasParent",!1),bje=new jce("treeElementCanExpand",!1),wje=new jce("treeElementHasChild",!1),Cje=new jce("treeFindOpen",!1),yje="listTypeNavigationMode",Sje="listAutomaticKeyboardNavigation";function kje(e,t){const i=e.createScoped(t.getHTMLElement());return dje.bindTo(i),i}const Lje="workbench.list.multiSelectModifier",xje="workbench.list.openMode",Dje="workbench.list.horizontalScrolling",Eje="workbench.list.defaultFindMode",Nje="workbench.list.typeNavigationMode",Ije="workbench.list.keyboardNavigation",Mje="workbench.list.scrollByPage",Tje="workbench.list.defaultFindMatchType",Aje="workbench.tree.indent",Rje="workbench.tree.renderIndentGuides",Oje="workbench.list.smoothScrolling",Pje="workbench.list.mouseWheelScrollSensitivity",Fje="workbench.list.fastScrollSensitivity",Bje="workbench.tree.expandMode";function Wje(e){return"alt"===e.getValue(Lje)}class Vje extends aae{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=Wje(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration(Lje)&&(this.useAltAsMultipleSelectionModifier=Wje(this.configurationService))})))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:XPe(e)}isSelectionRangeChangeEvent(e){return JPe(e)}}function zje(e,t){var i;const n=e.get(Zue),o=e.get(bWe),s=new rae;return[Object.assign(Object.assign({},t),{keyboardNavigationDelegate:{mightProducePrintableCharacter:e=>o.mightProducePrintableCharacter(e)},smoothScrolling:Boolean(n.getValue(Oje)),mouseWheelScrollSensitivity:n.getValue(Pje),fastScrollSensitivity:n.getValue(Fje),multipleSelectionController:null!==(i=t.multipleSelectionController)&&void 0!==i?i:s.add(new Vje(n)),keyboardNavigationEventFilter:Zje(o),scrollByPage:Boolean(n.getValue(Mje))}),s]}let Hje=class extends dFe{constructor(e,t,i,n,o,s,r,a,l){const h=void 0!==o.horizontalScrolling?o.horizontalScrolling:Boolean(a.getValue(Dje)),[d,c]=l.invokeFunction(zje,o);super(e,t,i,n,Object.assign(Object.assign({keyboardSupport:!1},d),{horizontalScrolling:h})),this.disposables.add(c),this.contextKeyService=kje(s,this),this.listSupportsMultiSelect=cje.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==o.multipleSelectionSupport),mje.bindTo(this.contextKeyService).set(Boolean(o.selectionNavigation)),this.listHasSelectionOrFocus=uje.bindTo(this.contextKeyService),this.listDoubleSelection=gje.bindTo(this.contextKeyService),this.listMultiSelection=pje.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Wje(a),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection((()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)}))}))),this.disposables.add(this.onDidChangeFocus((()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)}))),this.disposables.add(a.onDidChangeConfiguration((e=>{e.affectsConfiguration(Lje)&&(this._useAltAsMultipleSelectionModifier=Wje(a));let t={};if(e.affectsConfiguration(Dje)&&void 0===this.horizontalScrolling){const e=Boolean(a.getValue(Dje));t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(Mje)){const e=Boolean(a.getValue(Mje));t=Object.assign(Object.assign({},t),{scrollByPage:e})}if(e.affectsConfiguration(Oje)){const e=Boolean(a.getValue(Oje));t=Object.assign(Object.assign({},t),{smoothScrolling:e})}if(e.affectsConfiguration(Pje)){const e=a.getValue(Pje);t=Object.assign(Object.assign({},t),{mouseWheelScrollSensitivity:e})}if(e.affectsConfiguration(Fje)){const e=a.getValue(Fje);t=Object.assign(Object.assign({},t),{fastScrollSensitivity:e})}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new qje(this,Object.assign({configurationService:a},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?lze(e):aze)}};Hje=aje([lje(5,qce),lje(6,hje),lje(7,Zue),lje(8,gce)],Hje);let Uje=class extends HUe{constructor(e,t,i,n,o,s,r,a,l){const h=void 0!==o.horizontalScrolling?o.horizontalScrolling:Boolean(a.getValue(Dje)),[d,c]=l.invokeFunction(zje,o);super(e,t,i,n,Object.assign(Object.assign({keyboardSupport:!1},d),{horizontalScrolling:h})),this.disposables=new rae,this.disposables.add(c),this.contextKeyService=kje(s,this),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=cje.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==o.multipleSelectionSupport),mje.bindTo(this.contextKeyService).set(Boolean(o.selectionNavigation)),this._useAltAsMultipleSelectionModifier=Wje(a),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(a.onDidChangeConfiguration((e=>{e.affectsConfiguration(Lje)&&(this._useAltAsMultipleSelectionModifier=Wje(a));let t={};if(e.affectsConfiguration(Dje)&&void 0===this.horizontalScrolling){const e=Boolean(a.getValue(Dje));t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(Mje)){const e=Boolean(a.getValue(Mje));t=Object.assign(Object.assign({},t),{scrollByPage:e})}if(e.affectsConfiguration(Oje)){const e=Boolean(a.getValue(Oje));t=Object.assign(Object.assign({},t),{smoothScrolling:e})}if(e.affectsConfiguration(Pje)){const e=a.getValue(Pje);t=Object.assign(Object.assign({},t),{mouseWheelScrollSensitivity:e})}if(e.affectsConfiguration(Fje)){const e=a.getValue(Fje);t=Object.assign(Object.assign({},t),{fastScrollSensitivity:e})}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new qje(this,Object.assign({configurationService:a},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?lze(e):aze)}dispose(){this.disposables.dispose(),super.dispose()}};Uje=aje([lje(5,qce),lje(6,hje),lje(7,Zue),lje(8,gce)],Uje);let Kje=class extends nKe{constructor(e,t,i,n,o,s,r,a,l,h){const d=void 0!==s.horizontalScrolling?s.horizontalScrolling:Boolean(l.getValue(Dje)),[c,u]=h.invokeFunction(zje,s);super(e,t,i,n,o,Object.assign(Object.assign({keyboardSupport:!1},c),{horizontalScrolling:d})),this.disposables.add(u),this.contextKeyService=kje(r,this),this.listSupportsMultiSelect=cje.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==s.multipleSelectionSupport),mje.bindTo(this.contextKeyService).set(Boolean(s.selectionNavigation)),this.listHasSelectionOrFocus=uje.bindTo(this.contextKeyService),this.listDoubleSelection=gje.bindTo(this.contextKeyService),this.listMultiSelection=pje.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Wje(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection((()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)}))}))),this.disposables.add(this.onDidChangeFocus((()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)}))),this.disposables.add(l.onDidChangeConfiguration((e=>{e.affectsConfiguration(Lje)&&(this._useAltAsMultipleSelectionModifier=Wje(l));let t={};if(e.affectsConfiguration(Dje)&&void 0===this.horizontalScrolling){const e=Boolean(l.getValue(Dje));t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(Mje)){const e=Boolean(l.getValue(Mje));t=Object.assign(Object.assign({},t),{scrollByPage:e})}if(e.affectsConfiguration(Oje)){const e=Boolean(l.getValue(Oje));t=Object.assign(Object.assign({},t),{smoothScrolling:e})}if(e.affectsConfiguration(Pje)){const e=l.getValue(Pje);t=Object.assign(Object.assign({},t),{mouseWheelScrollSensitivity:e})}if(e.affectsConfiguration(Fje)){const e=l.getValue(Fje);t=Object.assign(Object.assign({},t),{fastScrollSensitivity:e})}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new $je(this,Object.assign({configurationService:l},s)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?lze(e):aze)}dispose(){this.disposables.dispose(),super.dispose()}};Kje=aje([lje(6,qce),lje(7,hje),lje(8,Zue),lje(9,gce)],Kje);class jje extends aae{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new bae),this.onDidOpen=this._onDidOpen.event,this._register(pae.filter(this.widget.onDidChangeSelection,(e=>e.browserEvent instanceof KeyboardEvent))((e=>this.onSelectionFromKeyboard(e)))),this._register(this.widget.onPointer((e=>this.onPointer(e.element,e.browserEvent)))),this._register(this.widget.onMouseDblClick((e=>this.onMouseDblClick(e.element,e.browserEvent)))),"boolean"!=typeof(null==t?void 0:t.openOnSingleClick)&&(null==t?void 0:t.configurationService)?(this.openOnSingleClick="doubleClick"!==(null==t?void 0:t.configurationService.getValue(xje)),this._register(null==t?void 0:t.configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration(xje)&&(this.openOnSingleClick="doubleClick"!==(null==t?void 0:t.configurationService.getValue(xje)))})))):this.openOnSingleClick=null===(i=null==t?void 0:t.openOnSingleClick)||void 0===i||i}onSelectionFromKeyboard(e){if(1!==e.elements.length)return;const t=e.browserEvent,i="boolean"!=typeof t.preserveFocus||t.preserveFocus,n="boolean"==typeof t.pinned?t.pinned:!i;this._open(this.getSelectedElement(),i,n,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick)return;if(2===t.detail)return;const i=1===t.button,n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!0,i,n,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!1,!0,n,t)}_open(e,t,i,n,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:n,element:e,browserEvent:o})}}class qje extends jje{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class $je extends jje{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class Gje extends jje{constructor(e,t){super(e,t)}getSelectedElement(){var e;return null!==(e=this.widget.getSelection()[0])&&void 0!==e?e:void 0}}function Zje(e){let t=!1;return i=>{if(i.toKeyCodeChord().isModifierKey())return!1;if(t)return t=!1,!1;const n=e.softDispatch(i,i.target);return(null==n?void 0:n.enterMultiChord)?(t=!0,!1):(t=!1,!n)}}let Yje=class extends VKe{constructor(e,t,i,n,o,s,r,a,l){const{options:h,getTypeNavigationMode:d,disposable:c}=s.invokeFunction(nqe,o);super(e,t,i,n,h),this.disposables.add(c),this.internals=new oqe(this,o,d,o.overrideStyles,r,a,l),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};Yje=aje([lje(5,gce),lje(6,qce),lje(7,hje),lje(8,Zue)],Yje);let Qje=class extends HKe{constructor(e,t,i,n,o,s,r,a,l){const{options:h,getTypeNavigationMode:d,disposable:c}=s.invokeFunction(nqe,o);super(e,t,i,n,h),this.disposables.add(c),this.internals=new oqe(this,o,d,o.overrideStyles,r,a,l),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};Qje=aje([lje(5,gce),lje(6,qce),lje(7,hje),lje(8,Zue)],Qje);let Xje=class extends sje{constructor(e,t,i,n,o,s,r,a,l,h){const{options:d,getTypeNavigationMode:c,disposable:u}=r.invokeFunction(nqe,s);super(e,t,i,n,o,d),this.disposables.add(u),this.internals=new oqe(this,s,c,s.overrideStyles,a,l,h),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),void 0!==e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};Xje=aje([lje(6,gce),lje(7,qce),lje(8,hje),lje(9,Zue)],Xje);let Jje=class extends tje{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,s,r,a,l,h){const{options:d,getTypeNavigationMode:c,disposable:u}=r.invokeFunction(nqe,s);super(e,t,i,n,o,d),this.disposables.add(u),this.internals=new oqe(this,s,c,s.overrideStyles,a,l,h),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};Jje=aje([lje(6,gce),lje(7,qce),lje(8,hje),lje(9,Zue)],Jje);let eqe=class extends oje{constructor(e,t,i,n,o,s,r,a,l,h,d){const{options:c,getTypeNavigationMode:u,disposable:g}=a.invokeFunction(nqe,r);super(e,t,i,n,o,s,c),this.disposables.add(g),this.internals=new oqe(this,r,u,r.overrideStyles,l,h,d),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};function tqe(e){const t=e.getValue(Eje);if("highlight"===t)return uKe.Highlight;if("filter"===t)return uKe.Filter;const i=e.getValue(Ije);return"simple"===i||"highlight"===i?uKe.Highlight:"filter"===i?uKe.Filter:void 0}function iqe(e){const t=e.getValue(Tje);return"fuzzy"===t?gKe.Fuzzy:"contiguous"===t?gKe.Contiguous:void 0}function nqe(e,t){var i;const n=e.get(Zue),o=e.get(ZFe),s=e.get(qce),r=e.get(gce),a=void 0!==t.horizontalScrolling?t.horizontalScrolling:Boolean(n.getValue(Dje)),[l,h]=r.invokeFunction(zje,t),d=t.additionalScrollHeight;return{getTypeNavigationMode:()=>{const e=s.getContextKeyValue(yje);if("automatic"===e)return FPe.Automatic;if("trigger"===e)return FPe.Trigger;if(!1===s.getContextKeyValue(Sje))return FPe.Trigger;const t=n.getValue(Nje);return"automatic"===t?FPe.Automatic:"trigger"===t?FPe.Trigger:void 0},disposable:h,options:Object.assign(Object.assign({keyboardSupport:!1},l),{indent:"number"==typeof n.getValue(Aje)?n.getValue(Aje):void 0,renderIndentGuides:n.getValue(Rje),smoothScrolling:Boolean(n.getValue(Oje)),defaultFindMode:tqe(n),defaultFindMatchType:iqe(n),horizontalScrolling:a,scrollByPage:Boolean(n.getValue(Mje)),additionalScrollHeight:d,hideTwistiesOfChildlessElements:t.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:null!==(i=t.expandOnlyOnTwistieClick)&&void 0!==i?i:"doubleClick"===n.getValue(Bje),contextViewProvider:o,findWidgetStyles:sze})}}eqe=aje([lje(7,gce),lje(8,qce),lje(9,hje),lje(10,Zue)],eqe);let oqe=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,o,s,r){var a;this.tree=e,this.disposables=[],this.contextKeyService=kje(o,e),this.listSupportsMultiSelect=cje.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==t.multipleSelectionSupport),mje.bindTo(this.contextKeyService).set(Boolean(t.selectionNavigation)),this.listSupportFindWidget=fje.bindTo(this.contextKeyService),this.listSupportFindWidget.set(null===(a=t.findWidgetEnabled)||void 0===a||a),this.hasSelectionOrFocus=uje.bindTo(this.contextKeyService),this.hasDoubleSelection=gje.bindTo(this.contextKeyService),this.hasMultiSelection=pje.bindTo(this.contextKeyService),this.treeElementCanCollapse=_je.bindTo(this.contextKeyService),this.treeElementHasParent=vje.bindTo(this.contextKeyService),this.treeElementCanExpand=bje.bindTo(this.contextKeyService),this.treeElementHasChild=wje.bindTo(this.contextKeyService),this.treeFindOpen=Cje.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=Wje(r),this.updateStyleOverrides(n);const l=()=>{const t=e.getFocus()[0];if(!t)return;const i=e.getNode(t);this.treeElementCanCollapse.set(i.collapsible&&!i.collapsed),this.treeElementHasParent.set(!!e.getParentElement(t)),this.treeElementCanExpand.set(i.collapsible&&i.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(t))},h=new Set;h.add(yje),h.add(Sje),this.disposables.push(this.contextKeyService,s.register(e),e.onDidChangeSelection((()=>{const t=e.getSelection(),i=e.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.hasSelectionOrFocus.set(t.length>0||i.length>0),this.hasMultiSelection.set(t.length>1),this.hasDoubleSelection.set(2===t.length)}))})),e.onDidChangeFocus((()=>{const t=e.getSelection(),i=e.getFocus();this.hasSelectionOrFocus.set(t.length>0||i.length>0),l()})),e.onDidChangeCollapseState(l),e.onDidChangeModel(l),e.onDidChangeFindOpenState((e=>this.treeFindOpen.set(e))),r.onDidChangeConfiguration((n=>{let o={};if(n.affectsConfiguration(Lje)&&(this._useAltAsMultipleSelectionModifier=Wje(r)),n.affectsConfiguration(Aje)){const e=r.getValue(Aje);o=Object.assign(Object.assign({},o),{indent:e})}if(n.affectsConfiguration(Rje)){const e=r.getValue(Rje);o=Object.assign(Object.assign({},o),{renderIndentGuides:e})}if(n.affectsConfiguration(Oje)){const e=Boolean(r.getValue(Oje));o=Object.assign(Object.assign({},o),{smoothScrolling:e})}if(n.affectsConfiguration(Eje)||n.affectsConfiguration(Ije)){const e=tqe(r);o=Object.assign(Object.assign({},o),{defaultFindMode:e})}if(n.affectsConfiguration(Nje)||n.affectsConfiguration(Ije)){const e=i();o=Object.assign(Object.assign({},o),{typeNavigationMode:e})}if(n.affectsConfiguration(Tje)){const e=iqe(r);o=Object.assign(Object.assign({},o),{defaultFindMatchType:e})}if(n.affectsConfiguration(Dje)&&void 0===t.horizontalScrolling){const e=Boolean(r.getValue(Dje));o=Object.assign(Object.assign({},o),{horizontalScrolling:e})}if(n.affectsConfiguration(Mje)){const e=Boolean(r.getValue(Mje));o=Object.assign(Object.assign({},o),{scrollByPage:e})}if(n.affectsConfiguration(Bje)&&void 0===t.expandOnlyOnTwistieClick&&(o=Object.assign(Object.assign({},o),{expandOnlyOnTwistieClick:"doubleClick"===r.getValue(Bje)})),n.affectsConfiguration(Pje)){const e=r.getValue(Pje);o=Object.assign(Object.assign({},o),{mouseWheelScrollSensitivity:e})}if(n.affectsConfiguration(Fje)){const e=r.getValue(Fje);o=Object.assign(Object.assign({},o),{fastScrollSensitivity:e})}Object.keys(o).length>0&&e.updateOptions(o)})),this.contextKeyService.onDidChangeContext((t=>{t.affectsSome(h)&&e.updateOptions({typeNavigationMode:i()})}))),this.navigator=new Gje(e,Object.assign({configurationService:r},t)),this.disposables.push(this.navigator)}updateOptions(e){void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?lze(e):aze)}dispose(){this.disposables=nae(this.disposables)}};var sqe;oqe=aje([lje(4,qce),lje(5,hje),lje(6,Zue)],oqe),rge.as(dge).registerConfiguration({id:"workbench",order:7,title:Toe(0,"Workbench"),type:"object",properties:{[Lje]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[Toe(0,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),Toe(0,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:Toe(0,"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[xje]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:Toe(0,"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[Dje]:{type:"boolean",default:!1,description:Toe(0,"Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[Mje]:{type:"boolean",default:!1,description:Toe(0,"Controls whether clicks in the scrollbar scroll page by page.")},[Aje]:{type:"number",default:8,minimum:4,maximum:40,description:Toe(0,"Controls tree indentation in pixels.")},[Rje]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:Toe(0,"Controls whether the tree should render indent guides.")},[Oje]:{type:"boolean",default:!1,description:Toe(0,"Controls whether lists and trees have smooth scrolling.")},[Pje]:{type:"number",default:1,markdownDescription:Toe(0,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[Fje]:{type:"number",default:5,description:Toe(0,"Scrolling speed multiplier when pressing `Alt`.")},[Eje]:{type:"string",enum:["highlight","filter"],enumDescriptions:[Toe(0,"Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),Toe(0,"Filter elements when searching.")],default:"highlight",description:Toe(0,"Controls the default find mode for lists and trees in the workbench.")},[Ije]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[Toe(0,"Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),Toe(0,"Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),Toe(0,"Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:Toe(0,"Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:Toe(0,"Please use 'workbench.list.defaultFindMode' and\t'workbench.list.typeNavigationMode' instead.")},[Tje]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[Toe(0,"Use fuzzy matching when searching."),Toe(0,"Use contiguous matching when searching.")],default:"fuzzy",description:Toe(0,"Controls the type of matching used when searching lists and trees in the workbench.")},[Bje]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:Toe(0,"Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[Nje]:{type:"string",enum:["automatic","trigger"],default:"automatic",description:Toe(0,"Controls the how type navigation works in lists and trees in the workbench. When set to 'trigger', type navigation begins once the 'list.triggerTypeNavigation' command is run.")}}}),function(e){e[e.PRESERVE=0]="PRESERVE",e[e.LAST=1]="LAST"}(sqe||(sqe={}));const rqe="workbench.contributions.quickaccess";rge.add(rqe,new class{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return 0===e.prefix.length?this.defaultProvider=e:this.providers.push(e),this.providers.sort(((e,t)=>t.prefix.length-e.prefix.length)),sae((()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)}))}getQuickAccessProviders(){return function(e){return e.filter((e=>!!e))}([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){const t=e&&this.providers.find((t=>e.startsWith(t.prefix)))||void 0;return t||this.defaultProvider}});const aqe=pce("quickInputService");var lqe=function(e,t){return function(i,n){t(i,n,e)}};let hqe=class extends aae{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=rge.as(rqe),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){var n;const[o,s]=this.getOrInstantiateProvider(e),r=this.visibleQuickAccess,a=null==r?void 0:r.descriptor;if(r&&s&&a===s)return e===s.prefix||(null==i?void 0:i.preserveValue)||(r.picker.value=e),void this.adjustValueSelection(r.picker,s,i);if(s&&!(null==i?void 0:i.preserveValue)){let t;if(r&&a&&a!==s){const e=r.value.substr(a.prefix.length);e&&(t=`${s.prefix}${e}`)}if(!t){const e=null==o?void 0:o.defaultFilterValue;e===sqe.LAST?t=this.lastAcceptedPickerValues.get(s):"string"==typeof e&&(t=`${s.prefix}${e}`)}"string"==typeof t&&(e=t)}const l=new rae,h=l.add(this.quickInputService.createQuickPick());let d;h.value=e,this.adjustValueSelection(h,s,i),h.placeholder=null==s?void 0:s.placeholder,h.quickNavigate=null==i?void 0:i.quickNavigateConfiguration,h.hideInput=!!h.quickNavigate&&!r,("number"==typeof(null==i?void 0:i.itemActivation)||(null==i?void 0:i.quickNavigateConfiguration))&&(h.itemActivation=null!==(n=null==i?void 0:i.itemActivation)&&void 0!==n?n:qHe.SECOND),h.contextKey=null==s?void 0:s.contextKey,h.filterValue=e=>e.substring(s?s.prefix.length:0),(null==s?void 0:s.placeholder)&&(h.ariaLabel=null==s?void 0:s.placeholder),t&&(d=new upe,l.add(Qre(h.onWillAccept)((e=>{e.veto(),h.hide()})))),l.add(this.registerPickerListeners(h,o,s,e,null==i?void 0:i.providerOptions));const c=l.add(new Mae);return o&&l.add(o.provide(h,c.token,null==i?void 0:i.providerOptions)),Qre(h.onDidHide)((()=>{0===h.selectedItems.length&&c.cancel(),l.dispose(),null==d||d.complete(h.selectedItems.slice(0))})),h.show(),t?null==d?void 0:d.p:void 0}adjustValueSelection(e,t,i){var n;let o;o=(null==i?void 0:i.preserveValue)?[e.value.length,e.value.length]:[null!==(n=null==t?void 0:t.prefix.length)&&void 0!==n?n:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,i,n,o){const s=new rae,r=this.visibleQuickAccess={picker:e,descriptor:i,value:n};return s.add(sae((()=>{r===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)}))),s.add(e.onDidChangeValue((e=>{const[i]=this.getOrInstantiateProvider(e);i!==t?this.show(e,{preserveValue:!0,providerOptions:o}):r.value=e}))),i&&s.add(e.onDidAccept((()=>{this.lastAcceptedPickerValues.set(i,e.value)}))),s}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let i=this.mapProviderToDescriptor.get(t);return i||(i=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,i)),[i,t]}};hqe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([lqe(0,aqe),lqe(1,gce)],hqe);var dqe=function(e,t){return function(i,n){t(i,n,e)}};let cqe=class extends vLe{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(hqe))),this._quickAccess}constructor(e,t,i,n,o){super(i),this.instantiationService=e,this.contextKeyService=t,this.accessibilityService=n,this.layoutService=o,this._onShow=this._register(new bae),this._onHide=this._register(new bae),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,isScreenReaderOptimized:()=>this.accessibilityService.isScreenReaderOptimized(),backKeybindingLabel:()=>{},setContextKey:e=>this.setContextKey(e),returnFocus:()=>e.focus(),createList:(e,t,i,n,o)=>this.instantiationService.createInstance(Hje,e,t,i,n,o),styles:this.computeStyles()},n=this._register(new WUe(Object.assign(Object.assign({},i),t)));return n.layout(e.dimension,e.offset.quickPickTop),this._register(e.onDidLayout((t=>n.layout(t,e.offset.quickPickTop)))),this._register(n.onShow((()=>{this.resetContextKeys(),this._onShow.fire()}))),this._register(n.onHide((()=>{this.resetContextKeys(),this._onHide.fire()}))),n}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new jce(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),t&&t.get()||(this.resetContextKeys(),null==t||t.set(!0))}resetContextKeys(){this.contexts.forEach((e=>{e.get()&&e.reset()}))}pick(e,t={},i=Nae.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:Fwe(VCe),quickInputForeground:Fwe(zCe),quickInputTitleBackground:Fwe(HCe),widgetBorder:Fwe(Gwe),widgetShadow:Fwe($we)},inputBox:oze,toggle:nze,countBadge:rze,button:tze,progressBar:ize,keybindingLabel:eze,list:lze({listBackground:VCe,listFocusBackground:zye,listFocusForeground:Wye,listInactiveFocusForeground:Wye,listInactiveSelectionIconForeground:Vye,listInactiveFocusBackground:zye,listFocusOutline:jwe,listInactiveFocusOutline:jwe}),pickerGroup:{pickerGroupBorder:Fwe(KCe),pickerGroupForeground:Fwe(UCe)}}}};cqe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([dqe(0,gce),dqe(1,qce),dqe(2,uLe),dqe(3,Xce),dqe(4,EBe)],cqe);var uqe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},gqe=function(e,t){return function(i,n){t(i,n,e)}};let pqe=class extends cqe{constructor(e,t,i,n,o,s){super(t,i,n,o,new TBe(e.getContainerDomNode(),s)),this.host=void 0;const r=fqe.get(e);if(r){const t=r.widget;this.host={_serviceBrand:void 0,get hasContainer(){return!0},get container(){return t.getDomNode()},get dimension(){return e.getLayoutInfo()},get onDidLayout(){return e.onDidLayoutChange},focus:()=>e.focus(),offset:{top:0,quickPickTop:0}}}else this.host=void 0}createController(){return super.createController(this.host)}};pqe=uqe([gqe(1,gce),gqe(2,qce),gqe(3,uLe),gqe(4,Xce),gqe(5,mce)],pqe);let mqe=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(pqe,e);this.mapEditorToService.set(e,t),Qre(e.onDidDispose)((()=>{i.dispose(),this.mapEditorToService.delete(e)}))}return t}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},i=Nae.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};mqe=uqe([gqe(0,gce),gqe(1,mce)],mqe);class fqe{static get(e){return e.getContribution(fqe.ID)}constructor(e){this.editor=e,this.widget=new _qe(this.editor)}dispose(){this.widget.dispose()}}fqe.ID="editor.controller.quickInput";class _qe{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return _qe.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}_qe.ID="editor.contrib.quickInputWidget",swe(fqe.ID,fqe,4);class vqe{constructor(e,t,i,n,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=o}}const bqe=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;class wqe{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=new Map}getId(e){if(null===e)return 0;const t=e.match(bqe);if(!t)throw new Error("Illegal value for token color: "+e);e=t[1].toUpperCase();let i=this._color2id.get(e);return i||(i=++this._lastColorId,this._color2id.set(e,i),this._id2color[i]=Owe.fromHex("#"+e),i)}getColorMap(){return this._id2color.slice(0)}}class Cqe{static createFromRawTokenTheme(e,t){return this.createFromParsedTokenTheme(function(e){if(!e||!Array.isArray(e))return[];const t=[];let i=0;for(let n=0,o=e.length;n<o;n++){const o=e[n];let s=-1;if("string"==typeof o.fontStyle){s=0;const e=o.fontStyle.split(" ");for(let t=0,i=e.length;t<i;t++)switch(e[t]){case"italic":s|=1;break;case"bold":s|=2;break;case"underline":s|=4;break;case"strikethrough":s|=8}}let r=null;"string"==typeof o.foreground&&(r=o.foreground);let a=null;"string"==typeof o.background&&(a=o.background),t[i++]=new vqe(o.token||"",n,s,r,a)}return t}(e),t)}static createFromParsedTokenTheme(e,t){return function(e,t){e.sort(((e,t)=>{const i=function(e,t){return e<t?-1:e>t?1:0}(e.token,t.token);return 0!==i?i:e.index-t.index}));let i=0,n="000000",o="ffffff";for(;e.length>=1&&""===e[0].token;){const t=e.shift();-1!==t.fontStyle&&(i=t.fontStyle),null!==t.foreground&&(n=t.foreground),null!==t.background&&(o=t.background)}const s=new wqe;for(const e of t)s.getId(e);const r=s.getId(n),a=s.getId(o),l=new Sqe(i,r,a),h=new kqe(l);for(let t=0,i=e.length;t<i;t++){const i=e[t];h.insert(i.token,i.fontStyle,s.getId(i.foreground),s.getId(i.background))}return new Cqe(s,h)}(e,t)}constructor(e,t){this._colorMap=e,this._root=t,this._cache=new Map}getColorMap(){return this._colorMap.getColorMap()}_match(e){return this._root.match(e)}match(e,t){let i=this._cache.get(t);if(void 0===i){const e=this._match(t),n=function(e){const t=e.match(yqe);if(!t)return 0;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}(t);i=(e.metadata|n<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const yqe=/\b(comment|string|regex|regexp)\b/;class Sqe{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new Sqe(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){-1!==e&&(this._fontStyle=e),0!==t&&(this._foreground=t),0!==i&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class kqe{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(""===e)return this._mainRule;const t=e.indexOf(".");let i,n;-1===t?(i=e,n=""):(i=e.substring(0,t),n=e.substring(t+1));const o=this._children.get(i);return void 0!==o?o.match(n):this._mainRule}insert(e,t,i,n){if(""===e)return void this._mainRule.acceptOverwrite(t,i,n);const o=e.indexOf(".");let s,r;-1===o?(s=e,r=""):(s=e.substring(0,o),r=e.substring(o+1));let a=this._children.get(s);void 0===a&&(a=new kqe(this._mainRule.clone()),this._children.set(s,a)),a.insert(r,t,i,n)}}const Lqe={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"098658"},{token:"attribute.value.unit",foreground:"098658"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[OCe]:"#FFFFFE",[PCe]:"#000000",[QCe]:"#E5EBF1",[kLe]:"#D3D3D3",[LLe]:"#939393",[XCe]:"#ADD6FF4D"}},xqe={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[OCe]:"#1E1E1E",[PCe]:"#D4D4D4",[QCe]:"#3A3D41",[kLe]:"#404040",[LLe]:"#707070",[XCe]:"#ADD6FF26"}},Dqe={base:"hc-black",inherit:!1,rules:[{token:"",foreground:"FFFFFF",background:"000000"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"1AEBFF"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"FFFFFF"},{token:"regexp",foreground:"C0C0C0"},{token:"annotation",foreground:"569CD6"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"FFFF00"},{token:"delimiter.html",foreground:"FFFF00"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta",foreground:"D4D4D4"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"569CD6"},{token:"metatag.content.html",foreground:"1AEBFF"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key",foreground:"9CDCFE"},{token:"string.value",foreground:"CE9178"},{token:"attribute.name",foreground:"569CD6"},{token:"attribute.value",foreground:"3FF23F"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[OCe]:"#000000",[PCe]:"#FFFFFF",[kLe]:"#FFFFFF",[LLe]:"#FFFFFF"}},Eqe={base:"hc-light",inherit:!1,rules:[{token:"",foreground:"292929",background:"FFFFFF"},{token:"invalid",foreground:"B5200D"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"264F70"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"B5200D"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"264F78"},{token:"attribute.value",foreground:"0451A5"},{token:"string",foreground:"A31515"},{token:"string.sql",foreground:"B5200D"},{token:"keyword",foreground:"0000FF"},{token:"keyword.flow",foreground:"AF00DB"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[OCe]:"#FFFFFF",[PCe]:"#292929",[kLe]:"#292929",[LLe]:"#292929"}};class Nqe{getIcon(e){const t=MFe();let i=e.defaults;for(;Ibe.isThemeIcon(i);){const e=t.getIcon(i.id);if(!e)return;i=e.defaults}return i}}const Iqe="vs",Mqe="vs-dark",Tqe="hc-black",Aqe="hc-light",Rqe=rge.as(Wwe),Oqe=rge.as(mLe);class Pqe{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(Fqe(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,Owe.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=Bqe(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,Owe.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){return this.getColors().get(e)||(!1!==t?this.getDefault(e):void 0)}getDefault(e){let t=this.defaultColors[e];return t||(t=Rqe.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Iqe:return YSe.LIGHT;case Tqe:return YSe.HIGH_CONTRAST_DARK;case Aqe:return YSe.HIGH_CONTRAST_LIGHT;default:return YSe.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const i=Bqe(this.themeData.base);e=i.rules,i.encodedTokensColors&&(t=i.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const t={token:""};i&&(t.foreground=i),n&&(t.background=n),e.push(t)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=Cqe.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const n=this.tokenTheme._match([e].concat(t).join(".")).metadata,o=ufe.getForeground(n),s=ufe.getFontStyle(n);return{foreground:o,italic:Boolean(1&s),bold:Boolean(2&s),underline:Boolean(4&s),strikethrough:Boolean(8&s)}}}function Fqe(e){return e===Iqe||e===Mqe||e===Tqe||e===Aqe}function Bqe(e){switch(e){case Iqe:return Lqe;case Mqe:return xqe;case Tqe:return Dqe;case Aqe:return Eqe}}function Wqe(e){const t=Bqe(e);return new Pqe(e,t)}const Vqe=pce("themeService");var zqe=function(e,t){return function(i,n){t(i,n,e)}};let Hqe=class extends aae{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new bae,this._onDidChangeReducedMotion=new bae,this._accessibilityModeEnabledContext=Jce.bindTo(this._contextKeyService);const n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire()),e.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())}))),n(),this._register(this.onDidChangeScreenReaderOptimized((()=>n())));const o=window.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(o)}initReducedMotionListeners(e){if(!this._layoutService.hasContainer)return;this._register(Lve(e,"change",(()=>{this._systemMotionReduced=e.matches,"auto"===this._configMotionReduced&&this._onDidChangeReducedMotion.fire()})));const t=()=>{const e=this.isMotionReduced();this._layoutService.container.classList.toggle("reduce-motion",e),this._layoutService.container.classList.toggle("enable-motion",!e)};t(),this._register(this.onDidChangeReducedMotion((()=>t())))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return"on"===e||"auto"===e&&2===this._accessibilitySupport}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return"on"===e||"auto"===e&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};Hqe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([zqe(0,qce),zqe(1,EBe),zqe(2,Zue)],Hqe);var Uqe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Kqe=function(e,t){return function(i,n){t(i,n,e)}};let jqe=class{constructor(e,t){this._commandService=e,this._hiddenStates=new qqe(t)}createMenu(e,t,i){return new Gqe(e,this._hiddenStates,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},i),this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};jqe=Uqe([Kqe(0,Bbe),Kqe(1,QVe)],jqe);let qqe=class e{constructor(t){this._storageService=t,this._disposables=new rae,this._onDidChange=new bae,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const i=t.get(e._key,0,"{}");this._data=JSON.parse(i)}catch(e){this._data=Object.create(null)}this._disposables.add(t.onDidChangeValue((i=>{if(i.key===e._key){if(!this._ignoreChangeEvent)try{const i=t.get(e._key,0,"{}");this._data=JSON.parse(i)}catch(e){console.log("FAILED to read storage after UPDATE",e)}this._onDidChange.fire()}})))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){var i;return null!==(i=this._hiddenByDefaultCache.get(`${e.id}/${t}`))&&void 0!==i&&i}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){var i,n;const o=this._isHiddenByDefault(e,t),s=null!==(n=null===(i=this._data[e.id])||void 0===i?void 0:i.includes(t))&&void 0!==n&&n;return o?!s:s}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const n=this._data[e.id];if(i)n?n.indexOf(t)<0&&n.push(t):this._data[e.id]=[t];else if(n){const i=n.indexOf(t);i>=0&&function(e,t){const i=e.length-1;t<i&&(e[t]=e[i]),e.pop()}(n,i),0===n.length&&delete this._data[e.id]}this._persist()}reset(e){if(void 0===e)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const t=JSON.stringify(this._data);this._storageService.store(e._key,t,0,0)}finally{this._ignoreChangeEvent=!1}}};qqe._key="menu.hiddenCommands",qqe=Uqe([Kqe(0,QVe)],qqe);let $qe=class e{constructor(e,t,i,n,o){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=i,this._commandService=n,this._contextKeyService=o,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const t=Gbe.getMenuItems(this._id);let i;t.sort(e._compareMenuItems);for(const e of t){const t=e.group||"";i&&i[0]===t||(i=[t,[]],this._menuGroups.push(i)),i[1].push(e),this._collectContextKeys(e)}}_collectContextKeys(t){if(e._fillInKbExprKeys(t.when,this._structureContextKeys),Kbe(t)){if(t.command.precondition&&e._fillInKbExprKeys(t.command.precondition,this._preconditionContextKeys),t.command.toggled){const i=t.command.toggled.condition||t.command.toggled;e._fillInKbExprKeys(i,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&Gbe.getMenuItems(t.submenu).forEach(this._collectContextKeys,this)}createActionGroups(t){const i=[];for(const n of this._menuGroups){const[o,s]=n,r=[];for(const i of s)if(this._contextKeyService.contextMatchesRules(i.when)){const n=Kbe(i);n&&this._hiddenStates.setDefaultState(this._id,i.command.id,!!i.isHiddenByDefault);const o=Zqe(this._id,n?i.command:i,this._hiddenStates);if(n)r.push(new Ybe(i.command,i.alt,t,o,this._contextKeyService,this._commandService));else{const n=new e(i.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(t),s=Rbe.join(...n.map((e=>e[1])));s.length>0&&r.push(new Zbe(i,o,s))}}r.length>0&&i.push([o,r])}return i}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}static _compareMenuItems(t,i){const n=t.group,o=i.group;if(n!==o){if(!n)return 1;if(!o)return-1;if("navigation"===n)return-1;if("navigation"===o)return 1;const e=n.localeCompare(o);if(0!==e)return e}const s=t.order||0,r=i.order||0;return s<r?-1:s>r?1:e._compareTitles(Kbe(t)?t.command.title:t.title,Kbe(i)?i.command.title:i.title)}static _compareTitles(e,t){const i="string"==typeof e?e:e.original,n="string"==typeof t?t:t.original;return i.localeCompare(n)}};$qe=Uqe([Kqe(3,Bbe),Kqe(4,qce)],$qe);let Gqe=class{constructor(e,t,i,n,o){this._disposables=new rae,this._menuInfo=new $qe(e,t,i.emitEventsForSubmenuChanges,n,o);const s=new hpe((()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})}),i.eventDebounceDelay);this._disposables.add(s),this._disposables.add(Gbe.onDidChangeMenu((t=>{t.has(e)&&s.schedule()})));const r=this._disposables.add(new rae);this._onDidChange=new kae({onWillAddFirstListener:()=>{r.add(o.onDidChangeContext((e=>{const t=e.affectsSome(this._menuInfo.structureContextKeys),i=e.affectsSome(this._menuInfo.preconditionContextKeys),n=e.affectsSome(this._menuInfo.toggledContextKeys);(t||i||n)&&this._onDidChange.fire({menu:this,isStructuralChange:t,isEnablementChange:i,isToggleChange:n})}))),r.add(t.onDidChange((e=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})})))},onDidRemoveLastListener:r.clear.bind(r),delay:i.eventDebounceDelay,merge:e=>{let t=!1,i=!1,n=!1;for(const o of e)if(t=t||o.isStructuralChange,i=i||o.isEnablementChange,n=n||o.isToggleChange,t&&i&&n)break;return{menu:this,isStructuralChange:t,isEnablementChange:i,isToggleChange:n}}}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};function Zqe(e,t,i){const n=void 0!==t.submenu?t.submenu.id:t.id,o="string"==typeof t.title?t.title:t.title.value,s=Fbe({id:`hide/${e.id}/${n}`,label:Toe(0,"Hide '{0}'",o),run(){i.updateHidden(e,n,!0)}}),r=Fbe({id:`toggle/${e.id}/${n}`,label:o,get checked(){return!i.isHidden(e,n)},run(){i.updateHidden(e,n,!!this.checked)}});return{hide:s,toggle:r,get isHidden(){return!r.checked}}}Gqe=Uqe([Kqe(3,Bbe),Kqe(4,qce)],Gqe);var Yqe=function(e,t){return function(i,n){t(i,n,e)}},Qqe=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let Xqe=class extends aae{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],(Gde||Zde)&&this.installWebKitWriteTextWorkaround()}installWebKitWriteTextWorkaround(){const e=()=>{const e=new upe;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=e,navigator.clipboard.write([new ClipboardItem({"text/plain":e.p})]).catch((t=>Qqe(this,void 0,void 0,(function*(){t instanceof Error&&"NotAllowedError"===t.name&&e.isRejected||this.logService.error(t)}))))};this.layoutService.hasContainer&&(this._register(Lve(this.layoutService.container,"click",e)),this._register(Lve(this.layoutService.container,"keydown",e)))}writeText(e,t){return Qqe(this,void 0,void 0,(function*(){if(t)return void this.mapTextToType.set(t,e);if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return yield navigator.clipboard.writeText(e)}catch(e){console.error(e)}const i=document.activeElement,n=document.body.appendChild(sbe("textarea",{"aria-hidden":!0}));n.style.height="1px",n.style.width="1px",n.style.position="absolute",n.value=e,n.focus(),n.select(),document.execCommand("copy"),i instanceof HTMLElement&&i.focus(),document.body.removeChild(n)}))}readText(e){return Qqe(this,void 0,void 0,(function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(e){return console.error(e),""}}))}readFindText(){return Qqe(this,void 0,void 0,(function*(){return this.findText}))}writeFindText(e){return Qqe(this,void 0,void 0,(function*(){this.findText=e}))}readResources(){return Qqe(this,void 0,void 0,(function*(){return this.resources}))}};Xqe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Yqe(0,EBe),Yqe(1,Gme)],Xqe);const Jqe="data-keybinding-context";class e$e{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return Object.assign({},this._value)}setValue(e,t){return this._value[e]!==t&&(this._value[e]=t,!0)}removeValue(e){return e in this._value&&(delete this._value[e],!0)}getValue(e){const t=this._value[e];return void 0===t&&this._parent?this._parent.getValue(e):t}}class t$e extends e$e{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}t$e.INSTANCE=new t$e;class i$e extends e$e{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=BWe.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration((e=>{if(7===e.source){const e=Array.from(this._values,(([e])=>e));this._values.clear(),i.fire(new s$e(e))}else{const t=[];for(const i of e.affectedKeys){const e=`config.${i}`,n=this._values.findSuperstr(e);void 0!==n&&(t.push(...bse.map(n,(([e])=>e))),this._values.deleteSuperstr(e)),this._values.has(e)&&(t.push(e),this._values.delete(e))}i.fire(new s$e(t))}}))}dispose(){this._listener.dispose()}getValue(e){if(0!==e.indexOf(i$e._keyPrefix))return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(i$e._keyPrefix.length),i=this._configurationService.getValue(t);let n;switch(typeof i){case"number":case"boolean":case"string":n=i;break;default:n=Array.isArray(i)?JSON.stringify(i):i}return this._values.set(e,n),n}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}i$e._keyPrefix="config.";class n$e{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){void 0===this._defaultValue?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class o$e{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class s$e{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every((t=>e.has(t)))}}class r$e{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every((t=>t.allKeysContainedIn(e)))}}class a$e{constructor(e){this._onDidChangeContext=new Sae({merge:e=>new r$e(e)}),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new n$e(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new h$e(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return!e||e.evaluate(t)}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new o$e(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new o$e(e))}getContext(e){return this._isDisposed?t$e.INSTANCE:this.getContextValuesContainer(function(e){for(;e;){if(e.hasAttribute(Jqe)){const t=e.getAttribute(Jqe);return t?parseInt(t,10):NaN}e=e.parentElement}return 0}(e))}}let l$e=class extends a$e{constructor(e){super(0),this._contexts=new Map,this._toDispose=new rae,this._lastContextId=0;const t=new i$e(this._myContextId,e,this._onDidChangeContext);this._contexts.set(this._myContextId,t),this._toDispose.add(t)}dispose(){this._onDidChangeContext.dispose(),this._isDisposed=!0,this._toDispose.dispose()}getContextValuesContainer(e){return this._isDisposed?t$e.INSTANCE:this._contexts.get(e)||t$e.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new e$e(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};l$e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,Zue)],l$e);class h$e extends a$e{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=new lae,this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(Jqe)){let e="";this._domNode.classList&&(e=Array.from(this._domNode.classList.values()).join(", ")),console.error("Element already has context attribute"+(e?": "+e:""))}this._domNode.setAttribute(Jqe,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext((e=>{var t;t=this._parent.getContextValuesContainer(this._myContextId).value,e.allKeysContainedIn(new Set(Object.keys(t)))||this._onDidChangeContext.fire(e)}))}dispose(){this._isDisposed||(this._onDidChangeContext.dispose(),this._parent.disposeContext(this._myContextId),this._parentChangeListener.dispose(),this._domNode.removeAttribute(Jqe),this._isDisposed=!0)}getContextValuesContainer(e){return this._isDisposed?t$e.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}Wbe.registerCommand("_setContext",(function(e,t,i){e.get(qce).createKey(String(t),function(e){return sre(e,(e=>"object"==typeof e&&1===e.$mid?Sle.revive(e).toString():e instanceof Sle?e.toString():void 0))}(i))})),Wbe.registerCommand({id:"getContextKeyInfo",handler:()=>[...jce.all()].sort(((e,t)=>e.key.localeCompare(t.key))),description:{description:Toe(0,"A command that returns information about context keys"),args:[]}}),Wbe.registerCommand("_generateContextKeyInfo",(function(){const e=[],t=new Set;for(const i of jce.all())t.has(i.key)||(t.add(i.key),e.push(i));e.sort(((e,t)=>e.key.localeCompare(t.key))),console.log(JSON.stringify(e,void 0,2))}));class d$e{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}}class c$e{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())0===t.outgoing.size&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),n=this.lookupOrInsertNode(t);i.outgoing.set(n.key,n),n.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const e of this._nodes.values())e.outgoing.delete(t),e.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new d$e(t,e),this._nodes.set(t,i)),i}isEmpty(){return 0===this._nodes.size}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t}\n\t(-> incoming)[${[...i.incoming.keys()].join(", ")}]\n\t(outgoing ->)[${[...i.outgoing.keys()].join(",")}]\n`);return e.join("\n")}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(const[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const e=this._findCycle(n,t);if(e)return e;t.delete(i)}}}class u$e extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=null!==(t=e.findCycleSlow())&&void 0!==t?t:`UNABLE to detect cycle, dumping graph: \n${e.toString()}`}}class g$e{constructor(e=new GAe,t=!1,i,n=!1){var o;this._services=e,this._strict=t,this._parent=i,this._enableTracing=n,this._activeInstantiations=new Set,this._services.set(gce,this),this._globalGraph=n?null!==(o=null==i?void 0:i._globalGraph)&&void 0!==o?o:new c$e((e=>e)):void 0}createChild(e){return new g$e(e,this._strict,this,this._enableTracing)}invokeFunction(e,...t){const i=p$e.traceInvocation(this._enableTracing,e);let n=!1;try{return e({get:e=>{if(n)throw"service accessor is only valid during the invocation of its target method"?new Error("Illegal state: service accessor is only valid during the invocation of its target method"):new Error("Illegal state");const t=this._getOrCreateServiceInstance(e,i);if(!t)throw new Error(`[invokeFunction] unknown service '${e}'`);return t}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){let i,n;return e instanceof ige?(i=p$e.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=p$e.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=uce.getServiceDependencies(e).sort(((e,t)=>e.index-t.index)),o=[];for(const t of n){const n=this._getOrCreateServiceInstance(t.id,i);n||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`,!1),o.push(n)}const s=n.length>0?n[0].index:t.length;if(t.length!==s){console.trace(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);const i=s-t.length;t=i>0?t.concat(new Array(i)):t.slice(0,s)}return Reflect.construct(e,t.concat(o))}_setServiceInstance(e,t){if(this._services.get(e)instanceof ige)this._services.set(e,t);else{if(!this._parent)throw new Error("illegalState - setting UNKNOWN service instance");this._parent._setServiceInstance(e,t)}}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof ige?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){var n;const o=new c$e((e=>e.id.toString()));let s=0;const r=[{id:e,desc:t,_trace:i}];for(;r.length;){const t=r.pop();if(o.lookupOrInsertNode(t),s++>1e3)throw new u$e(o);for(const i of uce.getServiceDependencies(t.desc.ctor)){const s=this._getServiceInstanceOrDescriptor(i.id);if(s||this._throwIfStrict(`[createInstance] ${e} depends on ${i.id} which is NOT registered.`,!0),null===(n=this._globalGraph)||void 0===n||n.insertEdge(String(t.id),String(i.id)),s instanceof ige){const e={id:i.id,desc:s,_trace:t._trace.branch(i.id,!0)};o.insertEdge(t,e),r.push(e)}}}for(;;){const e=o.roots();if(0===e.length){if(!o.isEmpty())throw new u$e(o);break}for(const{data:t}of e){if(this._getServiceInstanceOrDescriptor(t.id)instanceof ige){const e=this._createServiceInstanceWithOwner(t.id,t.desc.ctor,t.desc.staticArguments,t.desc.supportsDelayedInstantiation,t._trace);this._setServiceInstance(t.id,e)}o.removeNode(t)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,o){if(this._services.get(e)instanceof ige)return this._createServiceInstance(e,t,i,n,o);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],n,o){if(n){const n=new g$e(void 0,this._strict,this,this._enableTracing);n._globalGraphImplicitDependency=String(e);const s=new Map,r=new cpe((()=>{const e=n._createInstance(t,i,o);for(const[t,i]of s){const n=e[t];if("function"==typeof n)for(const t of i)n.apply(e,t)}return s.clear(),e}));return new Proxy(Object.create(null),{get(e,t){if(!r.isInitialized&&"string"==typeof t&&(t.startsWith("onDid")||t.startsWith("onWill"))){let e=s.get(t);return e||(e=new Cse,s.set(t,e)),(t,i,n)=>sae(e.push([t,i,n]))}if(t in e)return e[t];const i=r.value;let n=i[t];return"function"!=typeof n||(n=n.bind(i),e[t]=n),n},set:(e,t,i)=>(r.value[t]=i,!0),getPrototypeOf:e=>t.prototype})}return this._createInstance(t,i,o)}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class p$e{static traceInvocation(e,t){return e?new p$e(2,t.name||(new Error).stack.split("\n").slice(3,4).join("\n")):p$e._None}static traceCreation(e,t){return e?new p$e(1,t.name):p$e._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new p$e(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;p$e._totals+=e;let t=!1;const i=[`${1===this.type?"CREATE":"CALL"} ${this.name}`,`${function e(i,n){const o=[],s=new Array(i+1).join("\t");for(const[r,a,l]of n._dep)if(a&&l){t=!0,o.push(`${s}CREATES -> ${r}`);const n=e(i+1,l);n&&o.push(n)}else o.push(`${s}uses -> ${r}`);return o.join("\n")}(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${p$e._totals.toFixed(2)}ms)`];(e>2||t)&&p$e.all.add(i.join("\n"))}}p$e.all=new Set,p$e._None=new class extends p$e{constructor(){super(0,null)}stop(){}branch(){return this}},p$e._totals=0;const m$e=new Set([_ve.inMemory,_ve.vscodeSourceControl,_ve.walkThrough,_ve.walkThroughSnippet]);class f$e{constructor(){this._byResource=new iOe,this._byOwner=new Map}set(e,t,i){let n=this._byResource.get(e);n||(n=new Map,this._byResource.set(e,n)),n.set(t,i);let o=this._byOwner.get(t);o||(o=new iOe,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){const i=this._byResource.get(e);return null==i?void 0:i.get(t)}delete(e,t){let i=!1,n=!1;const o=this._byResource.get(e);o&&(i=o.delete(t));const s=this._byOwner.get(t);if(s&&(n=s.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){var t,i,n,o;return"string"==typeof e?null!==(i=null===(t=this._byOwner.get(e))||void 0===t?void 0:t.values())&&void 0!==i?i:bse.empty():Sle.isUri(e)?null!==(o=null===(n=this._byResource.get(e))||void 0===n?void 0:n.values())&&void 0!==o?o:bse.empty():bse.map(bse.concat(...this._byOwner.values()),(e=>e[1]))}}class _$e{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new iOe,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const e=this._data.get(t);e&&this._substract(e);const i=this._resourceStats(t);this._add(i),this._data.set(t,i)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(m$e.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===Fze.Error?t.errors+=1:i===Fze.Warning?t.warnings+=1:i===Fze.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class v$e{constructor(){this._onMarkerChanged=new kae({delay:0,merge:v$e._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new f$e,this._stats=new _$e(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(n=i,Array.isArray(n)&&0!==n.length){const n=[];for(const o of i){const i=v$e._toMarker(e,t,o);i&&n.push(i)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}else this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);var n}static _toMarker(e,t,i){let{code:n,severity:o,message:s,source:r,startLineNumber:a,startColumn:l,endLineNumber:h,endColumn:d,relatedInformation:c,tags:u}=i;if(s)return a=a>0?a:1,l=l>0?l:1,h=h>=a?h:a,d=d>0?d:l,{resource:t,owner:e,code:n,severity:o,message:s,source:r,startLineNumber:a,startColumn:l,endLineNumber:h,endColumn:d,relatedInformation:c,tags:u}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const t of n){const n=bse.first(t);n&&(i.push(n.resource),this._data.delete(n.resource,e))}if(Ise(t)){const n=new iOe;for(const{resource:o,marker:s}of t){const t=v$e._toMarker(e,o,s);if(!t)continue;const r=n.get(o);r?r.push(t):(n.set(o,[t]),i.push(o))}for(const[t,i]of n)this._data.set(t,e,i)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const e=this._data.get(i,t);if(e){const t=[];for(const i of e)if(v$e._accept(i,n)){const e=t.push(i);if(o>0&&e===o)break}return t}return[]}if(t||i){const e=this._data.values(null!=i?i:t),s=[];for(const t of e)for(const e of t)if(v$e._accept(e,n)){const t=s.push(e);if(o>0&&t===o)return s}return s}{const e=[];for(const t of this._data.values())for(const i of t)if(v$e._accept(i,n)){const t=e.push(i);if(o>0&&t===o)return e}return e}}static _accept(e,t){return void 0===t||(t&e.severity)===e.severity}static _merge(e){const t=new iOe;for(const i of e)for(const e of i)t.set(e,!0);return Array.from(t.keys())}}function b$e(e,t,i,n,o,s){if(Array.isArray(e)){let r=0;for(const a of e){const e=b$e(a,t,i,n,o,s);if(10===e)return e;e>r&&(r=e)}return r}if("string"==typeof e)return n?"*"===e?5:e===i?10:0:0;if(e){const{language:l,pattern:h,scheme:d,hasAccessToAllModels:c,notebookType:u}=e;if(!n&&!c)return 0;u&&o&&(t=o);let g=0;if(d)if(d===t.scheme)g=10;else{if("*"!==d)return 0;g=5}if(l)if(l===i)g=10;else{if("*"!==l)return 0;g=Math.max(g,5)}if(u)if(u===s)g=10;else{if("*"!==u||void 0===s)return 0;g=Math.max(g,5)}if(h){let e;if(e="string"==typeof h?h:Object.assign(Object.assign({},h),{base:hle(h.base)}),e!==t.fsPath&&(r=e,a=t.fsPath,!r||"string"!=typeof a||!LVe(r)(a,void 0,undefined)))return 0;g=10}return g}return 0;var r,a}function w$e(e){return"string"!=typeof e&&(Array.isArray(e)?e.every(w$e):!!e.exclusive)}class C$e{constructor(e,t,i,n){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=n}equals(e){var t,i;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&(null===(t=this.notebookUri)||void 0===t?void 0:t.toString())===(null===(i=e.notebookUri)||void 0===i?void 0:i.toString())}}class y$e{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new bae,this.onDidChange=this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),sae((()=>{if(i){const e=this._entries.indexOf(i);e>=0&&(this._entries.splice(e,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}}))}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const e of this._entries)e._score>0&&t.push(e.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,(e=>t.push(e.provider))),t}orderedGroups(e){const t=[];let i,n;return this._orderedForEach(e,(e=>{i&&n===e._score?i.push(e.provider):(n=e._score,i=[e.provider],t.push(i))})),t}_orderedForEach(e,t){this._updateScores(e);for(const e of this._entries)e._score>0&&t(e)}_updateScores(e){var t,i;const n=null===(t=this._notebookInfoResolver)||void 0===t?void 0:t.call(this,e.uri),o=n?new C$e(e.uri,e.getLanguageId(),n.uri,n.type):new C$e(e.uri,e.getLanguageId(),void 0,void 0);if(!(null===(i=this._lastCandidate)||void 0===i?void 0:i.equals(o))){this._lastCandidate=o;for(const t of this._entries)if(t._score=b$e(t.selector,o.uri,o.languageId,gue(e),o.notebookUri,o.notebookType),w$e(t.selector)&&t._score>0){for(const e of this._entries)e._score=0;t._score=1e3;break}this._entries.sort(y$e._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._score<t._score?1:e._score>t._score?-1:e._time<t._time?1:e._time>t._time?-1:0}}oge(efe,class{constructor(){this.referenceProvider=new y$e(this._score.bind(this)),this.renameProvider=new y$e(this._score.bind(this)),this.codeActionProvider=new y$e(this._score.bind(this)),this.definitionProvider=new y$e(this._score.bind(this)),this.typeDefinitionProvider=new y$e(this._score.bind(this)),this.declarationProvider=new y$e(this._score.bind(this)),this.implementationProvider=new y$e(this._score.bind(this)),this.documentSymbolProvider=new y$e(this._score.bind(this)),this.inlayHintsProvider=new y$e(this._score.bind(this)),this.colorProvider=new y$e(this._score.bind(this)),this.codeLensProvider=new y$e(this._score.bind(this)),this.documentFormattingEditProvider=new y$e(this._score.bind(this)),this.documentRangeFormattingEditProvider=new y$e(this._score.bind(this)),this.onTypeFormattingEditProvider=new y$e(this._score.bind(this)),this.signatureHelpProvider=new y$e(this._score.bind(this)),this.hoverProvider=new y$e(this._score.bind(this)),this.documentHighlightProvider=new y$e(this._score.bind(this)),this.selectionRangeProvider=new y$e(this._score.bind(this)),this.foldingRangeProvider=new y$e(this._score.bind(this)),this.linkProvider=new y$e(this._score.bind(this)),this.inlineCompletionsProvider=new y$e(this._score.bind(this)),this.completionProvider=new y$e(this._score.bind(this)),this.linkedEditingRangeProvider=new y$e(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new y$e(this._score.bind(this)),this.documentSemanticTokensProvider=new y$e(this._score.bind(this)),this.documentOnDropEditProvider=new y$e(this._score.bind(this)),this.documentPasteEditProvider=new y$e(this._score.bind(this))}_score(e){var t;return null===(t=this._notebookTypeResolver)||void 0===t?void 0:t.call(this,e)}},1);class S$e extends aae{constructor(){super(...arguments),this._configurationModel=new cWe}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new cWe;const e=rge.as(dge).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const n of e){const e=i[n],o=t[n];void 0!==e?this._configurationModel.addValue(n,e):o?this._configurationModel.addValue(n,o.default):this._configurationModel.removeValue(n)}}}class k$e extends aae{constructor(e,t=[]){super(),this.logger=new Jme([e,...t]),this._register(e.onDidChangeLogLevel((e=>this.setLevel(e))))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}error(e,...t){this.logger.error(e,...t)}}var L$e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},x$e=function(e,t){return function(i,n){t(i,n,e)}},D$e=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class E$e{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new bae}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let N$e=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new dae(new E$e(t))):Promise.reject(new Error("Model not found"))}};N$e=L$e([x$e(0,Yge)],N$e);class I$e{show(){return I$e.NULL_PROGRESS_RUNNER}showWhile(e,t){return D$e(this,void 0,void 0,(function*(){yield e}))}}I$e.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class M$e{info(e){return this.notify({severity:YAe.Info,message:e})}warn(e){return this.notify({severity:YAe.Warning,message:e})}error(e){return this.notify({severity:YAe.Error,message:e})}notify(e){switch(e.severity){case YAe.Error:console.error(e.message);break;case YAe.Warning:console.warn(e.message);break;default:console.log(e.message)}return M$e.NO_OP}prompt(e,t,i,n){return M$e.NO_OP}status(e,t){return aae.None}}M$e.NO_OP=new class{};let T$e=class{constructor(e){this._onWillExecuteCommand=new bae,this._onDidExecuteCommand=new bae,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=Wbe.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(e){return Promise.reject(e)}}};T$e=L$e([x$e(0,gce)],T$e);let A$e=class extends _We{constructor(e,t,i,n,o,s){super(e,t,i,n,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const r=e=>{const t=new rae;t.add(Lve(e,Yve.KEY_DOWN,(e=>{const t=new p_e(e);this._dispatch(t,t.target)&&(t.preventDefault(),t.stopPropagation())}))),t.add(Lve(e,Yve.KEY_UP,(e=>{const t=new p_e(e);this._singleModifierDispatch(t,t.target)&&t.preventDefault()}))),this._domNodeListeners.push(new R$e(e,t))},a=e=>{for(let t=0;t<this._domNodeListeners.length;t++){const i=this._domNodeListeners[t];i.domNode===e&&(this._domNodeListeners.splice(t,1),i.dispose())}},l=e=>{e.getOption(58)||r(e.getContainerDomNode())};this._register(s.onCodeEditorAdd(l)),this._register(s.onCodeEditorRemove((e=>{e.getOption(58)||a(e.getContainerDomNode())}))),s.listCodeEditors().forEach(l);const h=e=>{r(e.getContainerDomNode())};this._register(s.onDiffEditorAdd(h)),this._register(s.onDiffEditorRemove((e=>{a(e.getContainerDomNode())}))),s.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,n){return oae(Wbe.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map((e=>{var t;return{keybinding:r_e(e.keybinding,cse),command:null!==(t=e.command)&&void 0!==t?t:null,commandArgs:e.commandArgs,when:e.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),sae((()=>{for(let e=0;e<this._dynamicKeybindings.length;e++)if(this._dynamicKeybindings[e]===t[0])return this._dynamicKeybindings.splice(e,t.length),void this.updateResolver()}))}updateResolver(){this._cachedResolver=null,this._onDidUpdateKeybindings.fire()}_getResolver(){if(!this._cachedResolver){const e=this._toNormalizedKeybindingItems(zbe.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new wWe(e,t,(e=>this._log(e)))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const o of e){const e=o.when||void 0,s=o.keybinding;if(s){const r=MWe.resolveKeybinding(s,cse);for(const s of r)i[n++]=new SWe(s,o.command,o.commandArgs,e,t,null,!1)}else i[n++]=new SWe(void 0,o.command,o.commandArgs,e,t,null,!1)}return i}resolveKeyboardEvent(e){const t=new l_e(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new MWe([t],cse)}};A$e=L$e([x$e(0,qce),x$e(1,Bbe),x$e(2,Qbe),x$e(3,XAe),x$e(4,Gme),x$e(5,mce)],A$e);class R$e extends aae{constructor(e,t){super(),this.domNode=e,this._register(t)}}function O$e(e){return e&&"object"==typeof e&&(!e.overrideIdentifier||"string"==typeof e.overrideIdentifier)&&(!e.resource||e.resource instanceof Sle)}class P$e{constructor(){this._onDidChangeConfiguration=new bae,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new S$e;this._configuration=new pWe(e.reload(),new cWe,new cWe,new cWe),e.dispose()}getValue(e,t){const i="string"==typeof e?e:void 0,n=O$e(e)?e:O$e(t)?t:{};return this._configuration.getValue(i,n,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const t of e){const[e,n]=t;this.getValue(e)!==n&&(this._configuration.updateValue(e,n),i.push(e))}if(i.length>0){const e=new mWe({keys:i,overrides:[]},t,this._configuration);e.source=8,e.sourceConfig=null,this._onDidChangeConfiguration.fire(e)}return Promise.resolve()}updateValue(e,t,i,n){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let F$e=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new bae,this.configurationService.onDidChangeConfiguration((e=>{this._onDidChangeConfiguration.fire({affectedKeys:e.affectedKeys,affectsConfiguration:(t,i)=>e.affectsConfiguration(i)})}))}getValue(e,t,i){const n=Rle.isIPosition(t)?t:null,o=n?"string"==typeof i?i:void 0:"string"==typeof t?t:void 0,s=e?this.getLanguage(e,n):void 0;return void 0===o?this.configurationService.getValue({resource:e,overrideIdentifier:s}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:s})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};F$e=L$e([x$e(0,Zue),x$e(1,Yge),x$e(2,tge)],F$e);let B$e=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&"string"==typeof i&&"auto"!==i?i:ise||tse?"\n":"\r\n"}};B$e=L$e([x$e(0,Zue)],B$e);class W$e{constructor(){const e=Sle.from({scheme:W$e.SCHEME,authority:"model",path:"/"});this.workspace={id:"4064f6ec-cb38-4ad0-af64-ee6467e63c82",folders:[new VWe({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===W$e.SCHEME?this.workspace.folders[0]:null}}function V$e(e,t,i){if(!t)return;if(!(e instanceof P$e))return;const n=[];Object.keys(t).forEach((e=>{(function(e){return lWe()[`editor.${e}`]||!1})(e)&&n.push([`editor.${e}`,t[e]]),i&&function(e){return lWe()[`diffEditor.${e}`]||!1}(e)&&n.push([`diffEditor.${e}`,t[e]])})),n.length>0&&e.updateValues(n)}W$e.SCHEME="inmemory";let z$e=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return D$e(this,void 0,void 0,(function*(){const t=Array.isArray(e)?e:tWe.convert(e),i=new Map;for(const e of t){if(!(e instanceof iWe))throw new Error("bad edit - only text edits are supported");const t=this._modelService.getModel(e.resource);if(!t)throw new Error("bad edit - model not found");if("number"==typeof e.versionId&&t.getVersionId()!==e.versionId)throw new Error("bad state - model changed in the meantime");let n=i.get(t);n||(n=[],i.set(t,n)),n.push(hWe.replaceMove(Ole.lift(e.textEdit.range),e.textEdit.text))}let n=0,o=0;for(const[e,t]of i)e.pushStackElement(),e.pushEditOperations([],t,(()=>[])),e.pushStackElement(),o+=1,n+=t.length;return{ariaSummary:$he(ZWe.bulkEditServiceSummary,n,o),isApplied:n>0}}))}};z$e=L$e([x$e(0,Yge)],z$e);let H$e=class extends nVe{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const e=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();e&&(t=e.getContainerDomNode())}return super.showContextView(e,t,i)}};H$e=L$e([x$e(0,EBe),x$e(1,mce)],H$e);let U$e=class extends Eze{constructor(e,t,i,n,o,s){super(e,t,i,n,o,s),this.configure({blockMouse:!1})}};var K$e;U$e=L$e([x$e(0,Qbe),x$e(1,XAe),x$e(2,ZFe),x$e(3,bWe),x$e(4,qbe),x$e(5,qce)],U$e),oge(Zue,P$e,0),oge(qme,F$e,0),oge($me,B$e,0),oge(WWe,W$e,0),oge(TWe,class{getUriLabel(e,t){return"file"===e.scheme?e.fsPath:e.path}getUriBasenameLabel(e){return TIe(e)}},0),oge(Qbe,class{publicLog(e,t){return Promise.resolve(void 0)}publicLog2(e,t){return this.publicLog(e,t)}},0),oge(ABe,class{confirm(e){return this.doConfirm(e).then((e=>({confirmed:e,checkboxChecked:!1})))}doConfirm(e){let t=e.message;return e.detail&&(t=t+"\n\n"+e.detail),Promise.resolve(window.confirm(t))}show(e,t,i,n){return Promise.resolve({choice:0})}},0),oge(XAe,M$e,0),oge(Wze,v$e,0),oge(tge,class extends PVe{constructor(){super()}},0),oge(Vqe,class extends aae{constructor(){super(),this._onColorThemeChange=this._register(new bae),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new bae),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new Nqe,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Iqe,Wqe(Iqe)),this._knownThemes.set(Mqe,Wqe(Mqe)),this._knownThemes.set(Tqe,Wqe(Tqe)),this._knownThemes.set(Aqe,Wqe(Aqe));const e=function(e){const t=new bae,i=MFe();return i.onDidChange((()=>t.fire())),null==e||e.onDidProductIconThemeChange((()=>t.fire())),{onDidChange:t.event,getCSS(){const t=e?e.getProductIconTheme():new Nqe,n={},o=e=>{const i=t.getIcon(e);if(!i)return;const o=i.font;return o?(n[o.id]=o.definition,`.codicon-${e.id}:before { content: '${i.fontCharacter}'; font-family: ${cbe(o.id)}; }`):`.codicon-${e.id}:before { content: '${i.fontCharacter}'; }`},s=[];for(const e of i.getIcons()){const t=o(e);t&&s.push(t)}for(const e in n){const t=n[e],i=t.weight?`font-weight: ${t.weight};`:"",o=t.style?`font-style: ${t.style};`:"",r=t.src.map((e=>`${dbe(e.location)} format('${e.format}')`)).join(", ");s.push(`@font-face { src: ${r}; font-family: ${cbe(e)};${i}${o} font-display: block; }`)}return s.join("\n")}}}(this);this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Iqe),this._onOSSchemeChanged(),e.onDidChange((()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),zde("(forced-colors: active)",(()=>{this._onOSSchemeChanged()}))}registerEditorContainer(e){return Uve(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=qve(),this._globalStyleElement.className="monaco-colors",this._globalStyleElement.textContent=this._allCSS,this._styleElements.push(this._globalStyleElement)),aae.None}_registerShadowDomContainer(e){const t=qve(e);return t.className="monaco-colors",t.textContent=this._allCSS,this._styleElements.push(t),{dispose:()=>{for(let e=0;e<this._styleElements.length;e++)if(this._styleElements[e]===t)return void this._styleElements.splice(e,1)}}}defineTheme(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!Fqe(t.base)&&!Fqe(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new Pqe(e,t)),Fqe(e)&&this._knownThemes.forEach((t=>{t.base===e&&t.notifyBaseUpdated()})),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;t=this._knownThemes.has(e)?this._knownThemes.get(e):this._knownThemes.get(Iqe),this._updateActualTheme(t)}_updateActualTheme(e){e&&this._theme!==e&&(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=window.matchMedia("(forced-colors: active)").matches;if(e!==QSe(this._theme.type)){let t;t=XSe(this._theme.type)?e?Tqe:Mqe:e?Aqe:Iqe,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:i=>{t[i]||(e.push(i),t[i]=!0)}};Oqe.getThemingParticipants().forEach((e=>e(this._theme,i,this._environment)));const n=[];for(const e of Rqe.getColors()){const t=this._theme.getColor(e.id,!0);t&&n.push(`${Pwe(e.id)}: ${t.toString()};`)}i.addRule(`.monaco-editor { ${n.join("\n")} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(function(e){const t=[];for(let i=1,n=e.length;i<n;i++){const n=e[i];t[i]=`.mtk${i} { color: ${n}; }`}return t.push(".mtki { font-style: italic; }"),t.push(".mtkb { font-weight: bold; }"),t.push(".mtku { text-decoration: underline; text-underline-position: under; }"),t.push(".mtks { text-decoration: line-through; }"),t.push(".mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }"),t.join("\n")}(o)),this._themeCSS=e.join("\n"),this._updateCSS(),ehe.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._styleElements.forEach((e=>e.textContent=this._allCSS))}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}},0),oge(Gme,class extends k$e{constructor(){super(new Xme)}},0),oge(Yge,gHe,0),oge(Dbe,Hze,0),oge(qce,l$e,0),oge(QFe,class{withProgress(e,t,i){return t({report:()=>{}})}},0),oge(XFe,I$e,0),oge(QVe,class extends JVe{constructor(){super(),this.applicationStorage=this._register(new GVe(new ZVe,{hint:jVe.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new GVe(new ZVe,{hint:jVe.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new GVe(new ZVe,{hint:jVe.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage((e=>this.emitDidChangeValue(1,e)))),this._register(this.profileStorage.onDidChangeStorage((e=>this.emitDidChangeValue(0,e)))),this._register(this.applicationStorage.onDidChangeStorage((e=>this.emitDidChangeValue(-1,e))))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}},0),oge(qFe,ofe,0),oge(eWe,z$e,0),oge(YWe,class{constructor(){this._neverEmitter=new bae,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}},0),oge(Ebe,N$e,0),oge(Xce,Hqe,0),oge(hje,class{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new rae,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,i;e!==this._lastFocusedWidget&&(null===(t=this._lastFocusedWidget)||void 0===t||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,null===(i=this._lastFocusedWidget)||void 0===i||i.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new iFe(qve(),"").style(aze)),this.lists.some((t=>t.widget===e)))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),e.getHTMLElement()===document.activeElement&&this.setLastFocusedList(e),oae(e.onDidFocus((()=>this.setLastFocusedList(e))),sae((()=>this.lists.splice(this.lists.indexOf(i),1))),e.onDidDispose((()=>{this.lists=this.lists.filter((e=>e!==i)),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)})))}dispose(){this.disposables.dispose()}},0),oge(Bbe,T$e,0),oge(bWe,A$e,0),oge(aqe,mqe,0),oge(ZFe,H$e,0),oge($Be,Pze,0),oge(GFe,Xqe,0),oge(YFe,U$e,0),oge(qbe,jqe,0),oge(wce,class{playAudioCue(e,t){return D$e(this,void 0,void 0,(function*(){}))}},0),function(e){const t=new GAe;for(const[e,i]of sge())t.set(e,i);const i=new g$e(t,!0);t.set(gce,i),e.get=function(e){const n=t.get(e);if(!n)throw new Error("Missing service "+e);return n instanceof ige?i.invokeFunction((t=>t.get(e))):n};let n=!1;e.initialize=function(e){if(n)return i;n=!0;for(const[e,i]of sge())t.get(e)||t.set(e,i);for(const i in e)if(e.hasOwnProperty(i)){const n=pce(i);t.get(n)instanceof ige&&t.set(n,e[i])}return i}}(K$e||(K$e={}));var j$e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},q$e=function(e,t){return function(i,n){t(i,n,e)}};let $$e=0,G$e=!1;let Z$e=class extends kRe{constructor(e,t,i,n,o,s,r,a,l,h,d,c){const u=Object.assign({},t);u.ariaLabel=u.ariaLabel||$We.editorViewAccessibleLabel,u.ariaLabel=u.ariaLabel+";"+$We.accessibilityHelpMessage,super(e,u,{},i,n,o,s,a,l,h,d,c),this._standaloneKeybindingService=r instanceof A$e?r:null,function(e){if(!e){if(G$e)return;G$e=!0}!function(e){bbe=document.createElement("div"),bbe.className="monaco-aria-container";const t=()=>{const e=document.createElement("div");return e.className="monaco-alert",e.setAttribute("role","alert"),e.setAttribute("aria-atomic","true"),bbe.appendChild(e),e};wbe=t(),Cbe=t();const i=()=>{const e=document.createElement("div");return e.className="monaco-status",e.setAttribute("role","complementary"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),bbe.appendChild(e),e};ybe=i(),Sbe=i(),e.appendChild(bbe)}(e||document.body)}(u.ariaContainerElement)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const n="DYNAMIC_"+ ++$$e,o=Lce.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,o),n}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),aae.None;const t=e.id,i=e.label,n=Lce.and(Lce.equals("editorId",this.getId()),Lce.deserialize(e.precondition)),o=e.keybindings,s=Lce.and(n,Lce.deserialize(e.keybindingContext)),r=e.contextMenuGroupId||null,a=e.contextMenuOrder||0,l=(t,...i)=>Promise.resolve(e.run(this,...i)),h=new rae,d=this.getId()+":"+t;if(h.add(Wbe.registerCommand(d,l)),r){const e={command:{id:d,title:i},when:n,group:r,order:a};h.add(Gbe.appendMenuItem(jbe.EditorContext,e))}if(Array.isArray(o))for(const e of o)h.add(this._standaloneKeybindingService.addDynamicKeybinding(d,e,l,s));const c=new dNe(d,i,i,n,l,this._contextKeyService);return this._actions.set(t,c),h.add(sae((()=>{this._actions.delete(t)}))),h}_triggerCommand(e,t){if(this._codeEditorService instanceof DBe)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};Z$e=j$e([q$e(2,gce),q$e(3,mce),q$e(4,Bbe),q$e(5,qce),q$e(6,bWe),q$e(7,uLe),q$e(8,XAe),q$e(9,Xce),q$e(10,Oge),q$e(11,efe)],Z$e);let Y$e=class extends Z$e{constructor(e,t,i,n,o,s,r,a,l,h,d,c,u,g,p){const m=Object.assign({},t);V$e(h,m,!1);const f=a.registerEditorContainer(e);"string"==typeof m.theme&&a.setTheme(m.theme),void 0!==m.autoDetectHighContrast&&a.setAutoDetectHighContrast(Boolean(m.autoDetectHighContrast));const _=m.model;let v;if(delete m.model,super(e,m,i,n,o,s,r,a,l,d,g,p),this._configurationService=h,this._standaloneThemeService=a,this._register(f),void 0===_){const e=u.getLanguageIdByMimeType(m.language)||m.language||Dge;v=X$e(c,u,m.value||"",e,void 0),this._ownsModel=!0}else v=_,this._ownsModel=!1;if(this._attachModel(v),v){const e={oldModelUrl:null,newModelUrl:v.uri};this._onDidChangeModel.fire(e)}}dispose(){super.dispose()}updateOptions(e){V$e(this._configurationService,e,!1),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};Y$e=j$e([q$e(2,gce),q$e(3,mce),q$e(4,Bbe),q$e(5,qce),q$e(6,bWe),q$e(7,Vqe),q$e(8,XAe),q$e(9,Zue),q$e(10,Xce),q$e(11,Yge),q$e(12,tge),q$e(13,Oge),q$e(14,efe)],Y$e);let Q$e=class extends aBe{constructor(e,t,i,n,o,s,r,a,l,h,d){const c=Object.assign({},t);V$e(a,c,!0);const u=s.registerEditorContainer(e);"string"==typeof c.theme&&s.setTheme(c.theme),void 0!==c.autoDetectHighContrast&&s.setAutoDetectHighContrast(Boolean(c.autoDetectHighContrast)),super(e,c,{},d,n,i,o,s,r,l,h),this._configurationService=a,this._standaloneThemeService=s,this._register(u)}dispose(){super.dispose()}updateOptions(e){V$e(this._configurationService,e,!0),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(Z$e,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};function X$e(e,t,i,n,o){if(i=i||"",!n){const n=i.indexOf("\n");let s=i;return-1!==n&&(s=i.substring(0,n)),J$e(e,i,t.createByFilepathOrFirstLine(o||null,s),o)}return J$e(e,i,t.createById(n),o)}function J$e(e,t,i,n){return e.createModel(t,i,n)}function eGe(e){const t=K$e.get(bWe);return t instanceof A$e?t.addDynamicKeybindings(e.map((e=>({keybinding:e.keybinding,command:e.command,commandArgs:e.commandArgs,when:Lce.deserialize(e.when)})))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),aae.None)}function tGe(e,t){return"boolean"==typeof e?e:t}function iGe(e,t){return"string"==typeof e?e:t}function nGe(e,t=!1){t&&(e=e.map((function(e){return e.toLowerCase()})));const i=function(e){const t={};for(const i of e)t[i]=!0;return t}(e);return t?function(e){return void 0!==i[e.toLowerCase()]&&i.hasOwnProperty(e.toLowerCase())}:function(e){return void 0!==i[e]&&i.hasOwnProperty(e)}}function oGe(e,t){t=t.replace(/@@/g,"");let i,n=0;do{i=!1,t=t.replace(/@(\w+)/g,(function(n,o){i=!0;let s="";if("string"==typeof e[o])s=e[o];else{if(!(e[o]&&e[o]instanceof RegExp))throw void 0===e[o]?Ufe(e,"language definition does not contain attribute '"+o+"', used at: "+t):Ufe(e,"attribute reference '"+o+"' must be a string, used at: "+t);s=e[o].source}return Vfe(s)?"":"(?:"+s+")"})),n++}while(i&&n<5);t=t.replace(/\x01/g,"@");const o=(e.ignoreCase?"i":"")+(e.unicode?"u":"");return new RegExp(t,o)}function sGe(e,t,i,n){let o=-1,s=i,r=i.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);r&&(r[3]&&(o=parseInt(r[3]),r[2]&&(o+=100)),s=r[4]);let a,l="~",h=s;if(s&&0!==s.length?/^\w*$/.test(h)?l="==":(r=s.match(/^(@|!@|~|!~|==|!=)(.*)$/),r&&(l=r[1],h=r[2])):(l="!=",h=""),"~"!==l&&"!~"!==l||!/^(\w|\|)*$/.test(h))if("@"===l||"!@"===l){const i=e[h];if(!i)throw Ufe(e,"the @ match target '"+h+"' is not defined, in rule: "+t);if(!function(e,t){if(!t)return!1;if(!Array.isArray(t))return!1;for(const e of t)if("string"!=typeof e)return!1;return!0}(0,i))throw Ufe(e,"the @ match target '"+h+"' must be an array of strings, in rule: "+t);const n=nGe(i,e.ignoreCase);a=function(e){return"@"===l?n(e):!n(e)}}else if("~"===l||"!~"===l)if(h.indexOf("$")<0){const t=oGe(e,"^"+h+"$");a=function(e){return"~"===l?t.test(e):!t.test(e)}}else a=function(t,i,n,o){return oGe(e,"^"+Kfe(e,h,i,n,o)+"$").test(t)};else if(h.indexOf("$")<0){const t=zfe(e,h);a=function(e){return"=="===l?e===t:e!==t}}else{const t=zfe(e,h);a=function(i,n,o,s,r){const a=Kfe(e,t,n,o,s);return"=="===l?i===a:i!==a}}else{const t=nGe(h.split("|"),e.ignoreCase);a=function(e){return"~"===l?t(e):!t(e)}}return-1===o?{name:i,value:n,test:function(e,t,i,n){return a(e,e,t,i,n)}}:{name:i,value:n,test:function(e,t,i,n){const s=function(e,t,i,n){if(n<0)return e;if(n<t.length)return t[n];if(n>=100){n-=100;const e=i.split(".");if(e.unshift(i),n<e.length)return e[n]}return null}(e,t,i,o);return a(s||"",e,t,i,n)}}}function rGe(e,t,i){if(i){if("string"==typeof i)return i;if(i.token||""===i.token){if("string"!=typeof i.token)throw Ufe(e,"a 'token' attribute must be of type string, in rule: "+t);{const n={token:i.token};if(i.token.indexOf("$")>=0&&(n.tokenSubst=!0),"string"==typeof i.bracket)if("@open"===i.bracket)n.bracket=1;else{if("@close"!==i.bracket)throw Ufe(e,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+t);n.bracket=-1}if(i.next){if("string"!=typeof i.next)throw Ufe(e,"the next state must be a string value in rule: "+t);{let o=i.next;if(!/^(@pop|@push|@popall)$/.test(o)&&("@"===o[0]&&(o=o.substr(1)),o.indexOf("$")<0&&!function(e,t){let i=t;for(;i&&i.length>0;){if(e.stateNames[i])return!0;const t=i.lastIndexOf(".");i=t<0?null:i.substr(0,t)}return!1}(e,Kfe(e,o,"",[],""))))throw Ufe(e,"the next state '"+i.next+"' is not defined in rule: "+t);n.next=o}}return"number"==typeof i.goBack&&(n.goBack=i.goBack),"string"==typeof i.switchTo&&(n.switchTo=i.switchTo),"string"==typeof i.log&&(n.log=i.log),"string"==typeof i.nextEmbedded&&(n.nextEmbedded=i.nextEmbedded,e.usesEmbedded=!0),n}}if(Array.isArray(i)){const n=[];for(let o=0,s=i.length;o<s;o++)n[o]=rGe(e,t,i[o]);return{group:n}}if(i.cases){const n=[];for(const o in i.cases)if(i.cases.hasOwnProperty(o)){const s=rGe(e,t,i.cases[o]);"@default"===o||"@"===o||""===o?n.push({test:void 0,value:s,name:o}):"@eos"===o?n.push({test:function(e,t,i,n){return n},value:s,name:o}):n.push(sGe(e,t,o,s))}const o=e.defaultToken;return{test:function(e,t,i,s){for(const o of n)if(!o.test||o.test(e,t,i,s))return o.value;return o}}}throw Ufe(e,"an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: "+t)}return{token:""}}Q$e=j$e([q$e(2,gce),q$e(3,qce),q$e(4,mce),q$e(5,Vqe),q$e(6,XAe),q$e(7,Zue),q$e(8,YFe),q$e(9,XFe),q$e(10,GFe)],Q$e);class aGe{constructor(e){this.regex=new RegExp(""),this.action={token:""},this.matchOnlyAtLineStart=!1,this.name="",this.name=e}setRegex(e,t){let i;if("string"==typeof t)i=t;else{if(!(t instanceof RegExp))throw Ufe(e,"rules must start with a match string or regular expression: "+this.name);i=t.source}this.matchOnlyAtLineStart=i.length>0&&"^"===i[0],this.name=this.name+": "+i,this.regex=oGe(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=rGe(e,this.name,t)}}function lGe(e,t){if(!t||"object"!=typeof t)throw new Error("Monarch: expecting a language definition object");const i={};i.languageId=e,i.includeLF=tGe(t.includeLF,!1),i.noThrow=!1,i.maxStack=100,i.start="string"==typeof t.start?t.start:null,i.ignoreCase=tGe(t.ignoreCase,!1),i.unicode=tGe(t.unicode,!1),i.tokenPostfix=iGe(t.tokenPostfix,"."+i.languageId),i.defaultToken=iGe(t.defaultToken,"source"),i.usesEmbedded=!1;const n=t;function o(e,s,r){for(const a of r){let r=a.include;if(r){if("string"!=typeof r)throw Ufe(i,"an 'include' attribute must be a string at: "+e);if("@"===r[0]&&(r=r.substr(1)),!t.tokenizer[r])throw Ufe(i,"include target '"+r+"' is not defined at: "+e);o(e+"."+r,s,t.tokenizer[r])}else{const t=new aGe(e);if(Array.isArray(a)&&a.length>=1&&a.length<=3)if(t.setRegex(n,a[0]),a.length>=3)if("string"==typeof a[1])t.setAction(n,{token:a[1],next:a[2]});else{if("object"!=typeof a[1])throw Ufe(i,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+e);{const e=a[1];e.next=a[2],t.setAction(n,e)}}else t.setAction(n,a[1]);else{if(!a.regex)throw Ufe(i,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+e);a.name&&"string"==typeof a.name&&(t.name=a.name),a.matchOnlyAtStart&&(t.matchOnlyAtLineStart=tGe(a.matchOnlyAtLineStart,!1)),t.setRegex(n,a.regex),t.setAction(n,a.action)}s.push(t)}}}if(n.languageId=e,n.includeLF=i.includeLF,n.ignoreCase=i.ignoreCase,n.unicode=i.unicode,n.noThrow=i.noThrow,n.usesEmbedded=i.usesEmbedded,n.stateNames=t.tokenizer,n.defaultToken=i.defaultToken,!t.tokenizer||"object"!=typeof t.tokenizer)throw Ufe(i,"a language definition must define the 'tokenizer' attribute as an object");i.tokenizer=[];for(const e in t.tokenizer)if(t.tokenizer.hasOwnProperty(e)){i.start||(i.start=e);const n=t.tokenizer[e];i.tokenizer[e]=new Array,o("tokenizer."+e,i.tokenizer[e],n)}if(i.usesEmbedded=n.usesEmbedded,t.brackets){if(!Array.isArray(t.brackets))throw Ufe(i,"the 'brackets' attribute must be defined as an array")}else t.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const s=[];for(const e of t.brackets){let t=e;if(t&&Array.isArray(t)&&3===t.length&&(t={token:t[2],open:t[0],close:t[1]}),t.open===t.close)throw Ufe(i,"open and close brackets in a 'brackets' attribute must be different: "+t.open+"\n hint: use the 'bracket' attribute if matching on equal brackets is required.");if("string"!=typeof t.open||"string"!=typeof t.token||"string"!=typeof t.close)throw Ufe(i,"every element in the 'brackets' array must be a '{open,close,token}' object or array");s.push({token:t.token+i.tokenPostfix,open:zfe(i,t.open),close:zfe(i,t.close)})}return i.brackets=s,i.noThrow=!0,i}var hGe=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class dGe{constructor(e,t){this._languageId=e,this._actual=t}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if("function"==typeof this._actual.tokenize)return cGe.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new Xle(n.tokens,n.endState)}}class cGe{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let o=0,s=e.length;o<s;o++){const s=e[o];let r=s.startIndex;0===o?r=0:r<n&&(r=n),i[o]=new Yle(r,s.scopes,t),n=r}return i}static adaptTokenize(e,t,i,n){const o=t.tokenize(i,n),s=cGe._toClassicTokens(o.tokens,e);let r;return r=o.endState.equals(n)?n:o.endState,new Qle(s,r)}tokenize(e,t,i){return cGe.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,o=[];let s=0,r=0;for(let e=0,a=t.length;e<a;e++){const a=t[e],l=n.match(i,a.scopes);if(s>0&&o[s-1]===l)continue;let h=a.startIndex;0===e?h=0:h<r&&(h=r),o[s++]=h,o[s++]=l,r=h}const a=new Uint32Array(s);for(let e=0;e<s;e++)a[e]=o[e];return a}tokenizeEncoded(e,t,i){const n=this._actual.tokenize(e,i),o=this._toBinaryTokens(this._languageService.languageIdCodec,n.tokens);let s;return s=n.endState.equals(i)?i:n.endState,new Xle(o,s)}}function uGe(e){return e&&"function"==typeof e.then}function gGe(e,t){return function(e){return"tokenizeEncoded"in e}(t)?new dGe(e,t):new cGe(e,t,K$e.get(tge),K$e.get(Vqe))}function pGe(e,t){const i={createTokenizationSupport:()=>hGe(this,void 0,void 0,(function*(){const i=yield Promise.resolve(t.create());return i?function(e){return"function"==typeof e.getInitialState}(i)?gGe(e,i):new Jfe(K$e.get(tge),K$e.get(Vqe),e,lGe(e,i),K$e.get(Zue)):null}))};return ehe.registerFactory(e,i)}const mGe=pce("IEditorCancelService"),fGe=new jce("cancellableOperation",!1,Toe(0,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));oge(mGe,class{constructor(){this._tokens=new WeakMap}add(e,t){let i,n=this._tokens.get(e);return n||(n=e.invokeWithinContext((e=>({key:fGe.bindTo(e.get(qce)),tokens:new Cse}))),this._tokens.set(e,n)),n.key.set(!0),i=n.tokens.push(t),()=>{i&&(i(),n.key.set(!n.tokens.isEmpty()),i=void 0)}}cancel(e){const t=this._tokens.get(e);if(!t)return;const i=t.tokens.pop();i&&(i.cancel(),t.key.set(!t.tokens.isEmpty()))}},1),nwe(new class extends twe{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:fGe})}runEditorCommand(e,t){e.get(mGe).cancel(t)}});class _Ge{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return"string"==typeof e?e.toLowerCase():e._lower}}var vGe,bGe=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class wGe{static setFormatterSelector(e){return{dispose:wGe._selectors.unshift(e)}}static select(e,t,i){return bGe(this,void 0,void 0,(function*(){if(0===e.length)return;const n=bse.first(wGe._selectors);return n?yield n(e,t,i):void 0}))}}wGe._selectors=new Cse,Wbe.registerCommand("_executeFormatRangeProvider",(function(e,...t){return bGe(this,void 0,void 0,(function*(){const[i,n,o]=t;Jse(Sle.isUri(i)),Jse(Ole.isIRange(n));const s=e.get(Ebe),r=e.get(qFe),a=e.get(efe),l=yield s.createModelReference(i);try{return function(e,t,i,n,o,s){return bGe(this,void 0,void 0,(function*(){const r=t.documentRangeFormattingEditProvider.ordered(i);for(const t of r){const r=yield Promise.resolve(t.provideDocumentRangeFormattingEdits(i,n,o,s)).catch(Hre);if(Ise(r))return yield e.computeMoreMinimalEdits(i.uri,r)}}))}(r,a,l.object.textEditorModel,Ole.lift(n),o,Nae.None)}finally{l.dispose()}}))})),Wbe.registerCommand("_executeFormatDocumentProvider",(function(e,...t){return bGe(this,void 0,void 0,(function*(){const[i,n]=t;Jse(Sle.isUri(i));const o=e.get(Ebe),s=e.get(qFe),r=e.get(efe),a=yield o.createModelReference(i);try{return function(e,t,i,n,o){return bGe(this,void 0,void 0,(function*(){const s=function(e,t,i){const n=[],o=new Set,s=e.ordered(i);for(const e of s)n.push(e),e.extensionId&&o.add(_Ge.toKey(e.extensionId));const r=t.ordered(i);for(const e of r){if(e.extensionId){if(o.has(_Ge.toKey(e.extensionId)))continue;o.add(_Ge.toKey(e.extensionId))}n.push({displayName:e.displayName,extensionId:e.extensionId,provideDocumentFormattingEdits:(t,i,n)=>e.provideDocumentRangeFormattingEdits(t,t.getFullModelRange(),i,n)})}return n}(t.documentFormattingEditProvider,t.documentRangeFormattingEditProvider,i);for(const t of s){const s=yield Promise.resolve(t.provideDocumentFormattingEdits(i,n,o)).catch(Hre);if(Ise(s))return yield e.computeMoreMinimalEdits(i.uri,s)}}))}(s,r,a.object.textEditorModel,n,Nae.None)}finally{a.dispose()}}))})),Wbe.registerCommand("_executeFormatOnTypeProvider",(function(e,...t){return bGe(this,void 0,void 0,(function*(){const[i,n,o,s]=t;Jse(Sle.isUri(i)),Jse(Rle.isIPosition(n)),Jse("string"==typeof o);const r=e.get(Ebe),a=e.get(qFe),l=e.get(efe),h=yield r.createModelReference(i);try{return function(e,t,i,n,o,s,r){const a=t.onTypeFormattingEditProvider.ordered(i);return 0===a.length||a[0].autoFormatTriggerCharacters.indexOf(o)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(i,n,o,s,r)).catch(Hre).then((t=>e.computeMoreMinimalEdits(i.uri,t)))}(a,l,h.object.textEditorModel,Rle.lift(n),o,s,Nae.None)}finally{h.dispose()}}))})),Wre.wrappingIndent.defaultValue=0,Wre.glyphMargin.defaultValue=!1,Wre.autoIndent.defaultValue=3,Wre.overviewRulerLanes.defaultValue=2,wGe.setFormatterSelector(((e,t,i)=>Promise.resolve(e[0])));const CGe=Vhe();CGe.editor={create:function(e,t,i){return K$e.initialize(i||{}).createInstance(Y$e,e,t)},getEditors:function(){return K$e.get(mce).listCodeEditors()},getDiffEditors:function(){return K$e.get(mce).listDiffEditors()},onDidCreateEditor:function(e){return K$e.get(mce).onCodeEditorAdd((t=>{e(t)}))},onDidCreateDiffEditor:function(e){return K$e.get(mce).onDiffEditorAdd((t=>{e(t)}))},createDiffEditor:function(e,t,i){return K$e.initialize(i||{}).createInstance(Q$e,e,t)},createDiffNavigator:function(e,t){return K$e.initialize({}).createInstance(iue,e,t)},addCommand:function(e){if("string"!=typeof e.id||"function"!=typeof e.run)throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return Wbe.registerCommand(e.id,e.run)},addEditorAction:function(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const t=Lce.deserialize(e.precondition),i=new rae;if(i.add(Wbe.registerCommand(e.id,((i,...n)=>twe.runEditorCommand(i,n,t,((t,i,n)=>Promise.resolve(e.run(i,...n))))))),e.contextMenuGroupId){const n={command:{id:e.id,title:e.label},when:t,group:e.contextMenuGroupId,order:e.contextMenuOrder||0};i.add(Gbe.appendMenuItem(jbe.EditorContext,n))}if(Array.isArray(e.keybindings)){const n=K$e.get(bWe);if(n instanceof A$e){const o=Lce.and(t,Lce.deserialize(e.keybindingContext));i.add(n.addDynamicKeybindings(e.keybindings.map((t=>({keybinding:t,command:e.id,when:o})))))}else console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService")}return i},addKeybindingRule:function(e){return eGe([e])},addKeybindingRules:eGe,createModel:function(e,t,i){const n=K$e.get(tge),o=n.getLanguageIdByMimeType(t)||t;return X$e(K$e.get(Yge),n,e,o,i)},setModelLanguage:function(e,t){const i=K$e.get(tge),n=K$e.get(Yge),o=i.getLanguageIdByMimeType(t)||t||Dge;n.setMode(e,i.createById(o))},setModelMarkers:function(e,t,i){e&&K$e.get(Wze).changeOne(t,e.uri,i)},getModelMarkers:function(e){return K$e.get(Wze).read(e)},removeAllMarkers:function(e){K$e.get(Wze).changeAll(e,[])},onDidChangeMarkers:function(e){return K$e.get(Wze).onMarkerChanged(e)},getModels:function(){return K$e.get(Yge).getModels()},getModel:function(e){return K$e.get(Yge).getModel(e)},onDidCreateModel:function(e){return K$e.get(Yge).onModelAdded(e)},onWillDisposeModel:function(e){return K$e.get(Yge).onModelRemoved(e)},onDidChangeModelLanguage:function(e){return K$e.get(Yge).onModelLanguageChanged((t=>{e({model:t.model,oldLanguage:t.oldLanguageId})}))},createWebWorker:function(e){return function(e,t,i){return new cfe(e,t,i)}(K$e.get(Yge),K$e.get(Oge),e)},colorizeElement:function(e,t){const i=K$e.get(tge),n=K$e.get(Vqe);return n.registerEditorContainer(e),n_e.colorizeElement(n,i,e,t)},colorize:function(e,t,i){const n=K$e.get(tge);return K$e.get(Vqe).registerEditorContainer(document.body),n_e.colorize(n,e,t,i)},colorizeModelLine:function(e,t,i=4){return K$e.get(Vqe).registerEditorContainer(document.body),n_e.colorizeModelLine(e,t,i)},tokenize:function(e,t){ehe.getOrCreate(t);const i=function(e){return ehe.get(e)||{getInitialState:()=>$ge,tokenize:(t,i,n)=>Gge(e,n)}}(t),n=Jhe(e),o=[];let s=i.getInitialState();for(let e=0,t=n.length;e<t;e++){const t=n[e],r=i.tokenize(t,!0,s);o[e]=r.tokens,s=r.endState}return o},defineTheme:function(e,t){K$e.get(Vqe).defineTheme(e,t)},setTheme:function(e){K$e.get(Vqe).setTheme(e)},remeasureFonts:function(){cce.clearAllFontInfos()},registerCommand:function(e,t){return Wbe.registerCommand({id:e,handler:t})},AccessibilitySupport:the,ContentWidgetPositionPreference:ahe,CursorChangeReason:lhe,DefaultEndOfLine:hhe,EditorAutoIndentStrategy:che,EditorOption:uhe,EndOfLinePreference:ghe,EndOfLineSequence:phe,MinimapPosition:yhe,MouseTargetType:She,OverlayWidgetPositionPreference:khe,OverviewRulerLane:Lhe,RenderLineNumbersType:Dhe,RenderMinimap:Ehe,ScrollbarVisibility:Ihe,ScrollType:Nhe,TextEditorCursorBlinkingStyle:Ohe,TextEditorCursorStyle:Phe,TrackedRangeStickiness:Fhe,WrappingIndent:Bhe,InjectedTextCursorStops:fhe,PositionAffinity:xhe,ConfigurationChangedEvent:cre,BareFontInfo:lce,FontInfo:hce,TextModelResolvedOptions:lue,FindMatch:hue,ApplyUpdateResult:pre,LineRange:fme,LineRangeMapping:pme,RangeMapping:mme,EditorType:nue,EditorOptions:Wre},CGe.languages={register:function(e){xge.registerLanguage(e)},getLanguages:function(){let e=[];return e=e.concat(xge.getLanguages()),e},onLanguage:function(e,t){const i=K$e.get(tge).onDidEncounterLanguage((n=>{n===e&&(i.dispose(),t())}));return i},getEncodedLanguageId:function(e){return K$e.get(tge).languageIdCodec.encodeLanguageId(e)},setLanguageConfiguration:function(e,t){if(!K$e.get(tge).isRegisteredLanguageId(e))throw new Error(`Cannot set configuration for unknown language ${e}`);return K$e.get(Oge).register(e,t,100)},setColorMap:function(e){const t=K$e.get(Vqe);if(e){const i=[null];for(let t=1,n=e.length;t<n;t++)i[t]=Owe.fromHex(e[t]);t.setColorMapOverride(i)}else t.setColorMapOverride(null)},registerTokensProviderFactory:pGe,setTokensProvider:function(e,t){if(!K$e.get(tge).isRegisteredLanguageId(e))throw new Error(`Cannot set tokens provider for unknown language ${e}`);return uGe(t)?pGe(e,{create:()=>t}):ehe.register(e,gGe(e,t))},setMonarchTokensProvider:function(e,t){return uGe(t)?pGe(e,{create:()=>t}):ehe.register(e,(t=>new Jfe(K$e.get(tge),K$e.get(Vqe),e,lGe(e,t),K$e.get(Zue)))(t))},registerReferenceProvider:function(e,t){return K$e.get(efe).referenceProvider.register(e,t)},registerRenameProvider:function(e,t){return K$e.get(efe).renameProvider.register(e,t)},registerCompletionItemProvider:function(e,t){return K$e.get(efe).completionProvider.register(e,t)},registerSignatureHelpProvider:function(e,t){return K$e.get(efe).signatureHelpProvider.register(e,t)},registerHoverProvider:function(e,t){return K$e.get(efe).hoverProvider.register(e,{provideHover:(e,i,n)=>{const o=e.getWordAtPosition(i);return Promise.resolve(t.provideHover(e,i,n)).then((e=>{if(e)return!e.range&&o&&(e.range=new Ole(i.lineNumber,o.startColumn,i.lineNumber,o.endColumn)),e.range||(e.range=new Ole(i.lineNumber,i.column,i.lineNumber,i.column)),e}))}})},registerDocumentSymbolProvider:function(e,t){return K$e.get(efe).documentSymbolProvider.register(e,t)},registerDocumentHighlightProvider:function(e,t){return K$e.get(efe).documentHighlightProvider.register(e,t)},registerLinkedEditingRangeProvider:function(e,t){return K$e.get(efe).linkedEditingRangeProvider.register(e,t)},registerDefinitionProvider:function(e,t){return K$e.get(efe).definitionProvider.register(e,t)},registerImplementationProvider:function(e,t){return K$e.get(efe).implementationProvider.register(e,t)},registerTypeDefinitionProvider:function(e,t){return K$e.get(efe).typeDefinitionProvider.register(e,t)},registerCodeLensProvider:function(e,t){return K$e.get(efe).codeLensProvider.register(e,t)},registerCodeActionProvider:function(e,t,i){return K$e.get(efe).codeActionProvider.register(e,{providedCodeActionKinds:null==i?void 0:i.providedCodeActionKinds,documentation:null==i?void 0:i.documentation,provideCodeActions:(e,i,n,o)=>{const s=K$e.get(Wze).read({resource:e.uri}).filter((e=>Ole.areIntersectingOrTouching(e,i)));return t.provideCodeActions(e,i,{markers:s,only:n.only,trigger:n.trigger},o)},resolveCodeAction:t.resolveCodeAction})},registerDocumentFormattingEditProvider:function(e,t){return K$e.get(efe).documentFormattingEditProvider.register(e,t)},registerDocumentRangeFormattingEditProvider:function(e,t){return K$e.get(efe).documentRangeFormattingEditProvider.register(e,t)},registerOnTypeFormattingEditProvider:function(e,t){return K$e.get(efe).onTypeFormattingEditProvider.register(e,t)},registerLinkProvider:function(e,t){return K$e.get(efe).linkProvider.register(e,t)},registerColorProvider:function(e,t){return K$e.get(efe).colorProvider.register(e,t)},registerFoldingRangeProvider:function(e,t){return K$e.get(efe).foldingRangeProvider.register(e,t)},registerDeclarationProvider:function(e,t){return K$e.get(efe).declarationProvider.register(e,t)},registerSelectionRangeProvider:function(e,t){return K$e.get(efe).selectionRangeProvider.register(e,t)},registerDocumentSemanticTokensProvider:function(e,t){return K$e.get(efe).documentSemanticTokensProvider.register(e,t)},registerDocumentRangeSemanticTokensProvider:function(e,t){return K$e.get(efe).documentRangeSemanticTokensProvider.register(e,t)},registerInlineCompletionsProvider:function(e,t){return K$e.get(efe).inlineCompletionsProvider.register(e,t)},registerInlayHintsProvider:function(e,t){return K$e.get(efe).inlayHintsProvider.register(e,t)},DocumentHighlightKind:dhe,CompletionItemKind:ohe,CompletionItemTag:she,CompletionItemInsertTextRule:nhe,SymbolKind:Ahe,SymbolTag:Rhe,IndentAction:mhe,CompletionTriggerKind:rhe,SignatureHelpTriggerKind:The,InlayHintKind:_he,InlineCompletionTriggerKind:vhe,CodeActionTriggerType:ihe,FoldingRangeKind:Jle},CGe.CancellationTokenSource,CGe.Emitter;const yGe=CGe.KeyCode,SGe=(CGe.KeyMod,CGe.Position),kGe=CGe.Range,LGe=CGe.Selection,xGe=CGe.SelectionDirection,DGe=(CGe.MarkerSeverity,CGe.MarkerTag,CGe.Uri,CGe.Token,CGe.editor);CGe.languages,((null===(vGe=Zoe.MonacoEnvironment)||void 0===vGe?void 0:vGe.globalAPI)||"function"==typeof define&&i.amdO)&&(self.monaco=CGe),void 0!==self.require&&"function"==typeof self.require.config&&self.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]}),self.MonacoEnvironment=function(e){return{globalAPI:!1,getWorkerUrl:function(t,n){var o=i.p,s=(o?o.replace(/\/$/,"")+"/":"")+e[n];if(/^((http:)|(https:)|(file:)|(\/\/))/.test(s)){var r=String(window.location),a=r.substr(0,r.length-window.location.hash.length-window.location.search.length-window.location.pathname.length);if(s.substring(0,a.length)!==a){/^(\/\/)/.test(s)&&(s=window.location.protocol+s);var l=new Blob(["/*"+n+'*/importScripts("'+s+'");'],{type:"application/javascript"});return URL.createObjectURL(l)}}return s}}}({editorWorkerService:"editor.worker.js"});const EGe={readOnly:65,cursorWidth:20,fontInfo:32},NGe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function IGe(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||NGe.test(e))}function MGe(e,t){if(!(this instanceof MGe))return new MGe(e,t);this.line=e,this.ch=t}function TGe(e,t,i){e.dispatch(t,i)}let AGe,RGe;String.prototype.normalize?(AGe=function(e){return e.normalize("NFD").toLowerCase()},RGe=function(e){return e.normalize("NFD")}):(AGe=function(e){return e.toLowerCase()},RGe=function(e){return e});var OGe=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};function PGe(e){return new MGe(e.lineNumber-1,e.column-1)}function FGe(e){return new SGe(e.line+1,e.ch+1)}OGe.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var i=t==e;else i=t&&(e.test?e.test(t):e(t));if(i)return++this.pos,t},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){throw"not implemented"},indentation:function(){throw"not implemented"},match:function(e,t,i){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var o=function(e){return i?e.toLowerCase():e};if(o(this.string.substr(this.pos,e.length))==o(e))return!1!==t&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};class BGe{constructor(e,t,i,n){this.cm=e,this.id=t,this.lineNumber=i+1,this.column=n+1,e.marks[this.id]=this}clear(){delete this.cm.marks[this.id]}find(){return PGe(this)}}function WGe(e,t=!1){let i=!0,n=yGe[e.keyCode];e.key&&(n=e.key,i=!1);let o=n,s=t;switch(e.keyCode){case yGe.Shift:case yGe.Meta:case yGe.Alt:case yGe.Ctrl:return o;case yGe.Escape:s=!0,o="Esc";break;case yGe.Space:s=!0}return n.startsWith("Key")||n.startsWith("KEY_")?o=n[n.length-1].toLowerCase():n.startsWith("Digit")?o=n.slice(5,6):n.startsWith("Numpad")?o=n.slice(6,7):n.endsWith("Arrow")?(s=!0,o=n.substring(0,n.length-5)):(n.startsWith("US_")||n.startsWith("Bracket")||!o)&&(o=e.browserEvent.key),s||e.altKey||e.ctrlKey||e.metaKey?(e.altKey&&(o=`Alt-${o}`),e.ctrlKey&&(o=`Ctrl-${o}`),e.metaKey&&(o=`Meta-${o}`),e.shiftKey&&(o=`Shift-${o}`)):o=e.key||e.browserEvent.key,1===o.length&&i&&(o=`'${o}'`),o}class VGe{static Pos=MGe;static signal=TGe;static on=function(){};static off=function(){};static addClass=function(){};static rmClass=function(){};static defineOption=function(){};static keyMap={default:function(e){return function(e){return!0}}};static matchingBrackets={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};static isWordChar=IGe;static keyName=WGe;static StringStream=OGe;static e_stop=function(e){return e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,VGe.e_preventDefault(e),!1};static e_preventDefault=function(e){return e.preventDefault?(e.preventDefault(),e.browserEvent&&e.browserEvent.preventDefault()):e.returnValue=!1,!1};static commands={redo:function(e){e.editor.getModel().redo()},undo:function(e){e.editor.getModel().undo()},newlineAndIndent:function(e){e.triggerEditorAction("editor.action.insertLineAfter")}};static lookupKey=function e(t,i,n){"string"==typeof i&&(i=VGe.keyMap[i]);const o="function"==typeof i?i(t):i[t];if(!1===o)return"nothing";if("..."===o)return"multi";if(null!=o&&n(o))return"handled";if(i.fallthrough){if(!Array.isArray(i.fallthrough))return e(t,i.fallthrough,n);for(var s=0;s<i.fallthrough.length;s++){var r=e(t,i.fallthrough[s],n);if(r)return r}}};static defineExtension=function(e,t){VGe.prototype[e]=t};constructor(e){this.editor=e,this.state={keyMap:"vim"},this.marks={},this.$uid=0,this.disposables=[],this.listeners={},this.curOp={},this.attached=!1,this.statusBar=null,this.options={},this.addLocalListeners(),this.ctxInsert=this.editor.createContextKey("insertMode",!0)}attach(){VGe.keyMap.vim.attach(this)}addLocalListeners(){this.disposables.push(this.editor.onDidChangeCursorPosition(this.handleCursorChange),this.editor.onDidChangeModelContent(this.handleChange),this.editor.onKeyDown(this.handleKeyDown))}handleKeyDown=e=>{if(e.browserEvent.defaultPrevented&e.keyCode!==yGe.Escape)return;if(!this.attached)return;const t=WGe(e);if(this.replaceMode&&this.handleReplaceMode(t,e),!t)return;const i=this.state.keyMap;if(VGe.keyMap[i]&&VGe.keyMap[i].call){const n=VGe.keyMap[i].call(t,this);if(n){e.preventDefault(),e.stopPropagation();try{n()}catch(e){console.error(e)}}}};handleReplaceMode(e,t){let i=!1,n=e;const o=this.editor.getPosition();let s=new kGe(o.lineNumber,o.column,o.lineNumber,o.column+1);if(e.startsWith("'"))n=e[1];else if("Enter"===n)n="\n";else{if("Backspace"!==n)return;{const e=this.replaceStack.pop();if(!e)return;i=!0,n=e,s=new kGe(o.lineNumber,o.column,o.lineNumber,o.column-1)}}t.preventDefault(),t.stopPropagation(),this.replaceStack||(this.replaceStack=[]),i||this.replaceStack.push(this.editor.getModel().getValueInRange(s)),this.editor.executeEdits("vim",[{text:n,range:s,forceMoveMarkers:!0}]),i&&this.editor.setPosition(s.getStartPosition())}handleCursorChange=e=>{const{position:t,source:i}=e,{editor:n}=this,o=n.getSelection();if(!this.ctxInsert.get()&&"mouse"===e.source&&o.isEmpty()){const i=n.getModel().getLineMaxColumn(t.lineNumber);if(e.position.column===i)return void n.setPosition(new SGe(e.position.lineNumber,i-1))}this.dispatch("cursorActivity",this,e)};handleChange=e=>{const{changes:t}=e,i={text:t.reduce(((e,t)=>(e.push(t.text),e)),[]),origin:"+input"},n=this.curOp=this.curOp||{};n.changeHandlers||(n.changeHandlers=this.listeners.change&&this.listeners.change.slice()),this.virtualSelectionMode()||(n.lastChange?n.lastChange.next=n.lastChange=i:n.lastChange=n.change=i,this.dispatch("change",this,i))};setOption(e,t){this.state[e]=t,"theme"===e&&DGe.setTheme(t)}getConfiguration(){const{editor:e}=this;let t=EGe;return"function"==typeof e.getConfiguration?e.getConfiguration():("EditorOption"in DGe&&(t=DGe.EditorOption),{readOnly:e.getOption(t.readOnly),viewInfo:{cursorWidth:e.getOption(t.cursorWidth)},fontInfo:e.getOption(t.fontInfo)})}getOption(e){return"readOnly"===e?this.getConfiguration().readOnly:"firstLineNumber"===e?this.firstLine()+1:"indentWithTabs"===e?!this.editor.getModel().getOptions().insertSpaces:"function"==typeof this.editor.getConfiguration?this.editor.getRawConfiguration()[e]:this.editor.getRawOptions()[e]}dispatch(e,...t){const i=this.listeners[e];i&&i.forEach((e=>e(...t)))}on(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)}off(e,t){const i=this.listeners[e];i&&(this.listeners[e]=i.filter((e=>e!==t)))}firstLine(){return 0}lastLine(){return this.lineCount()-1}lineCount(){return this.editor.getModel().getLineCount()}defaultTextHeight(){return 1}getLine(e){if(e<0)return"";const t=this.editor.getModel().getLineCount();return e+1>t&&(e=t-1),this.editor.getModel().getLineContent(e+1)}getAnchorForSelection(e){return e.isEmpty()?e.getPosition():e.getDirection()===xGe.LTR?e.getStartPosition():e.getEndPosition()}getHeadForSelection(e){return e.isEmpty()?e.getPosition():e.getDirection()===xGe.LTR?e.getEndPosition():e.getStartPosition()}getCursor(e=null){if(!e)return PGe(this.editor.getPosition());const t=this.editor.getSelection();let i;return i=t.isEmpty()?t.getPosition():"anchor"===e?this.getAnchorForSelection(t):this.getHeadForSelection(t),PGe(i)}getRange(e,t){const i=FGe(e),n=FGe(t);return this.editor.getModel().getValueInRange(kGe.fromPositions(i,n))}getSelection(){var e=[],t=this.editor;return t.getSelections().map((function(i){e.push(t.getModel().getValueInRange(i))})),e.join("\n")}replaceRange(e,t,i){const n=FGe(t),o=i?FGe(i):n;this.editor.executeEdits("vim",[{text:e,range:kGe.fromPositions(n,o)}]),this.pushUndoStop()}pushUndoStop(){this.editor.pushUndoStop()}setCursor(e,t){let i=e;"object"!=typeof e&&(i={},i.line=e,i.ch=t);const n=this.editor.getModel().validatePosition(FGe(i));this.editor.setPosition(FGe(i)),this.editor.revealPosition(n)}somethingSelected(){return!this.editor.getSelection().isEmpty()}operation(e,t){return e()}listSelections(){const e=this.editor.getSelections();return!e.length||this.inVirtualSelectionMode?[{anchor:this.getCursor("anchor"),head:this.getCursor("head")}]:e.map((e=>(e.getPosition(),e.getStartPosition(),e.getEndPosition(),{anchor:this.clipPos(PGe(this.getAnchorForSelection(e))),head:this.clipPos(PGe(this.getHeadForSelection(e)))})))}focus(){this.editor.focus()}setSelections(e,t){const i=!!this.editor.getSelections().length,n=e.map(((e,t)=>{const{anchor:n,head:o}=e;return i?LGe.fromPositions(FGe(n),FGe(o)):LGe.fromPositions(FGe(o),FGe(n))}));if(t&&n[t]&&n.push(n.splice(t,1)[0]),!n.length)return;const o=n[0];let s;s=o.getDirection()===xGe.LTR?o.getEndPosition():o.getStartPosition(),this.editor.setSelections(n),this.editor.revealPosition(s)}setSelection(e,t){const i=kGe.fromPositions(FGe(e),FGe(t));this.editor.setSelection(i)}getSelections(){const{editor:e}=this;return e.getSelections().map((t=>e.getModel().getValueInRange(t)))}replaceSelections(e){const{editor:t}=this;t.getSelections().forEach(((i,n)=>{t.executeEdits("vim",[{range:i,text:e[n],forceMoveMarkers:!1}])}))}toggleOverwrite(e){e?(this.enterVimMode(),this.replaceMode=!0):(this.leaveVimMode(),this.replaceMode=!1,this.replaceStack=[])}charCoords(e,t){return{top:e.line,left:e.ch}}coordsChar(e,t){}clipPos(e){return PGe(this.editor.getModel().validatePosition(FGe(e)))}setBookmark(e,t){const i=new BGe(this,this.$uid++,e.line,e.ch);return t&&t.insertLeft||(i.$insertRight=!0),this.marks[i.id]=i,i}getScrollInfo(){const{editor:e}=this,[t]=e.getVisibleRanges();return{left:0,top:t.startLineNumber-1,height:e.getModel().getLineCount(),clientHeight:t.endLineNumber-t.startLineNumber+1}}triggerEditorAction(e){this.editor.trigger("vim",e)}dispose(){this.dispatch("dispose"),this.removeOverlay(),VGe.keyMap.vim&&VGe.keyMap.vim.detach(this),this.disposables.forEach((e=>e.dispose()))}getInputField(){}getWrapperElement(){}enterVimMode(e=!0){this.ctxInsert.set(!1);const t=this.getConfiguration();this.initialCursorWidth=t.viewInfo.cursorWidth||0,this.editor.updateOptions({cursorWidth:t.fontInfo.typicalFullwidthCharacterWidth,cursorBlinking:"solid"})}leaveVimMode(){this.ctxInsert.set(!0),this.editor.updateOptions({cursorWidth:this.initialCursorWidth||0,cursorBlinking:"blink"})}virtualSelectionMode(){return this.inVirtualSelectionMode}markText(){return{clear:function(){},find:function(){}}}getUserVisibleLines(){const e=this.editor.getVisibleRanges();if(!e.length)return{top:0,bottom:0};const t={top:1/0,bottom:0};return e.reduce(((e,t)=>(t.startLineNumber<e.top&&(e.top=t.startLineNumber),t.endLineNumber>e.bottom&&(e.bottom=t.endLineNumber),e)),t),t.top-=1,t.bottom-=1,t}findPosV(e,t,i){const{editor:n}=this;let o=t,s=i;const r=FGe(e);if("page"===i){const e=n.getLayoutInfo().height,t=this.getConfiguration().fontInfo.lineHeight;o*=Math.floor(e/t),s="line"}return"line"===s&&(r.lineNumber+=o),PGe(r)}findMatchingBracket(e){const t=FGe(e),i=this.editor.getModel();let n;return n=i.bracketPairs?i.bracketPairs.matchBracket(t):i.matchBracket?.(t),n&&2===n.length?{to:PGe(n[t.equals(n[1].getStartPosition())?0:1].getStartPosition())}:{to:null}}findFirstNonWhiteSpaceCharacter(e){return this.editor.getModel().getLineFirstNonWhitespaceColumn(e+1)-1}scrollTo(e,t){(e||t)&&(e||(t<0&&(t=this.editor.getPosition().lineNumber-t),this.editor.setScrollTop(this.editor.getTopForLineNumber(t+1))))}moveCurrentLineTo(e){const{editor:t}=this,i=t.getPosition(),n=kGe.fromPositions(i,i);switch(e){case"top":return void t.revealRangeAtTop(n);case"center":return void t.revealRangeInCenter(n);case"bottom":return void t._revealRange?.(n,4)}}getSearchCursor(e,t){let i=!1,n=!1;e instanceof RegExp&&!e.global&&(i=!e.ignoreCase,e=e.source,n=!0),null==t.ch&&(t.ch=Number.MAX_VALUE);const o=FGe(t),s=this,{editor:r}=this;let a=null;const l=r.getModel(),h=l.findMatches(e,!1,n,i)||[];return{getMatches:()=>h,findNext(){return this.find(!1)},findPrevious(){return this.find(!0)},jumpTo(e){if(!h||!h.length)return!1;var t=h[e];return a=t.range,s.highlightRanges([a],"currentFindMatch"),s.highlightRanges(h.map((e=>e.range)).filter((e=>!e.equalsRange(a)))),a},find(t){if(!h||!h.length)return!1;let r;if(t){const t=a?a.getStartPosition():o;if(r=l.findPreviousMatch(e,t,n,i),!r||!r.range.getStartPosition().isBeforeOrEqual(t))return!1}else{const t=a?l.getPositionAt(l.getOffsetAt(a.getStartPosition())+1):o;if(r=l.findNextMatch(e,t,n,i),!r||!t.isBeforeOrEqual(r.range.getStartPosition()))return!1}return a=r.range,s.highlightRanges([a],"currentFindMatch"),s.highlightRanges(h.map((e=>e.range)).filter((e=>!e.equalsRange(a)))),a},from:()=>a&&PGe(a.getStartPosition()),to:()=>a&&PGe(a.getEndPosition()),replace(e){a&&(r.executeEdits("vim",[{range:a,text:e,forceMoveMarkers:!0}]),a.setEndPosition(r.getPosition()),r.setPosition(a.getStartPosition()))}}}highlightRanges(e,t="findMatch"){const i=`decoration${t}`;return this[i]=this.editor.deltaDecorations(this[i]||[],e.map((e=>({range:e,options:{stickiness:DGe.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,zIndex:13,className:t,showIfCollapsed:!0}})))),this[i]}addOverlay({query:e},t,i){let n=!1,o=!1;e&&e instanceof RegExp&&!e.global&&(o=!0,n=!e.ignoreCase,e=e.source);const s=this.editor.getModel().findNextMatch(e,this.editor.getPosition(),o,n);s&&s.range&&this.highlightRanges([s.range])}removeOverlay(){["currentFindMatch","findMatch"].forEach((e=>{this.editor.deltaDecorations(this[`decoration${e}`]||[],[])}))}scrollIntoView(e){e&&this.editor.revealPosition(FGe(e))}moveH(e,t){if("char"!==t)return;const i=this.editor.getPosition();this.editor.setPosition(new SGe(i.lineNumber,i.column+e))}scanForBracket(e,t,i,n){const{bracketRegex:o}=n;let s=FGe(e);const r=this.editor.getModel(),a=(-1===t?r.findPreviousMatch:r.findNextMatch).bind(r),l=[];let h=0;for(;;){if(h>10)return;const e=a(o.source,s,!0,!0,null,!0),i=e.matches[0];if(void 0===e)return;const n=VGe.matchingBrackets[i];if(n&&">"===n.charAt(1)==t>0)l.push(i);else{if(0===l.length)return{pos:PGe(e.range.getStartPosition())};l.pop()}s=r.getPositionAt(r.getOffsetAt(e.range.getStartPosition())+t),h+=1}}indexFromPos(e){return this.editor.getModel().getOffsetAt(FGe(e))}posFromIndex(e){return PGe(this.editor.getModel().getPositionAt(e))}indentLine(e,i=!0){const{editor:n}=this;let o;o=n._getViewModel?n._getViewModel().cursorConfig:n._getCursors().context.config;const s=new SGe(e+1,1),r=LGe.fromPositions(s,s);n.executeCommand("vim",new t.ShiftCommand(r,{isUnshift:!i,tabSize:o.tabSize,indentSize:o.indentSize,insertSpaces:o.insertSpaces,useTabStops:o.useTabStops,autoIndent:o.autoIndent}))}setStatusBar(e){this.statusBar=e}openDialog(e,t,i){if(this.statusBar)return this.statusBar.setSec(e,t,i)}openNotification(e){this.statusBar&&this.statusBar.showNotification(e)}smartIndent(){this.editor.getAction("editor.action.formatSelection").run()}moveCursorTo(e){const t=this.editor.getPosition();"start"===e?t.column=1:"end"===e&&(t.column=this.editor.getModel().getLineMaxColumn(t.lineNumber)),this.editor.setPosition(t)}execCommand(e){switch(e){case"goLineLeft":this.moveCursorTo("start");break;case"goLineRight":this.moveCursorTo("end");break;case"indentAuto":this.smartIndent()}}}const zGe=VGe;var HGe=zGe.Pos;function UGe(e,t){var i=e.state.vim;if(!i||i.insertMode)return t.head;var n=i.sel.head;return n?i.visualBlock&&t.head.line!=n.line?void 0:t.from()!=t.anchor||t.empty()||t.head.line!=n.line||t.head.ch==n.ch?t.head:new HGe(t.head.line,t.head.ch-1):t.head}var KGe=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"g<Up>",type:"keyToKey",toKeys:"gk"},{keys:"g<Down>",type:"keyToKey",toKeys:"gj"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h",context:"normal"},{keys:"<Del>",type:"keyToKey",toKeys:"x",context:"normal"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B",context:"normal"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b",context:"normal"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"keyToKey",toKeys:"i",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"g$",type:"motion",motion:"moveToEndOfDisplayLine"},{keys:"g^",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"g0",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<character>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<character>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"gn",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!0}},{keys:"gN",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!1}},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-u>",type:"operatorMotion",operator:"delete",motion:"moveToStartOfLine",context:"insert"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-w>",type:"idle",context:"normal"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<character>",type:"action",action:"replayMacro"},{keys:"q<character>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<character>",type:"action",action:"setMark"},{keys:'"<character>',type:"action",action:"setRegister"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<character>",type:"motion",motion:"textObjectManipulation"},{keys:"i<character>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],jGe=KGe.length,qGe=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"vglobal",shortName:"v"},{name:"global",shortName:"g"}];zGe.Vim=function(){function e(e,i){e.attached=!1,this==zGe.keyMap.vim&&(e.options.$customCursor=null),i&&i.attach==t||function(e){e.setOption("disableInput",!1),e.off("cursorActivity",je),e.state.vim=null,Me&&clearTimeout(Me),e.leaveVimMode()}(e)}function t(e,i){this==zGe.keyMap.vim&&(e.attached=!0,e.curOp&&(e.curOp.selectionChanged=!0),e.options.$customCursor=UGe),i&&i.attach==t||function(e){e.setOption("disableInput",!0),e.setOption("showCursorWhenSelecting",!1),zGe.signal(e,"vim-mode-change",{mode:"normal"}),e.on("cursorActivity",je),I(e),e.enterVimMode()}(e)}function i(e,t){if(t){if(this[e])return this[e];var i=function(e){if("'"==e.charAt(0))return e.charAt(1);if("AltGraph"===e)return!1;var t=e.split(/-(?!$)/),i=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&"Shift"==t[0]&&1==i.length)return!1;for(var s=!1,r=0;r<t.length;r++){var a=t[r];a in n?t[r]=n[a]:s=!0,a in o&&(t[r]=o[a])}return!!s&&(_(i)&&(t[t.length-1]=i.toLowerCase()),"<"+t.join("-")+">")}(e);if(!i)return!1;var s=T.findKey(t,i);return"function"==typeof s&&zGe.signal(t,"vim-keypress",i),s}}zGe.defineOption("vimMode",!1,(function(e,t,i){t&&"vim"!=e.getOption("keyMap")?e.setOption("keyMap","vim"):!t&&i!=zGe.Init&&/^vim/.test(e.getOption("keyMap"))&&e.setOption("keyMap","default")}));var n={Shift:"S",Ctrl:"C",Alt:"A",Cmd:"D",Mod:"A",CapsLock:""},o={Enter:"CR",Backspace:"BS",Delete:"Del",Insert:"Ins"},s=/[\d]/,r=[zGe.isWordChar,function(e){return e&&!zGe.isWordChar(e)&&!/\s/.test(e)}],a=[function(e){return/\S/.test(e)}];function l(e,t){for(var i=[],n=e;n<e+t;n++)i.push(String.fromCharCode(n));return i}var h,d=l(65,26),c=l(97,26),u=l(48,10),g=[].concat(d,c,u,["<",">"]),p=[].concat(d,c,u,["-",'"',".",":","_","/"]);try{h=new RegExp("^[\\p{Lu}]$","u")}catch(e){h=/^[A-Z]$/}function m(e,t){return t>=e.firstLine()&&t<=e.lastLine()}function f(e){return/^[a-z]$/.test(e)}function _(e){return h.test(e)}function v(e){return/^\s*$/.test(e)}function b(e){return-1!=".?!".indexOf(e)}function w(e,t){for(var i=0;i<t.length;i++)if(t[i]==e)return!0;return!1}var C={};function y(e,t,i,n,o){if(void 0===t&&!o)throw Error("defaultValue is required unless callback is provided");if(i||(i="string"),C[e]={type:i,defaultValue:t,callback:o},n)for(var s=0;s<n.length;s++)C[n[s]]=C[e];t&&S(e,t)}function S(e,t,i,n){var o=C[e],s=(n=n||{}).scope;if(!o)return new Error("Unknown option: "+e);if("boolean"==o.type){if(t&&!0!==t)return new Error("Invalid argument: "+e+"="+t);!1!==t&&(t=!0)}o.callback?("local"!==s&&o.callback(t,void 0),"global"!==s&&i&&o.callback(t,i)):("local"!==s&&(o.value="boolean"==o.type?!!t:t),"global"!==s&&i&&(i.state.vim.options[e]={value:t}))}function k(e,t,i){var n=C[e],o=(i=i||{}).scope;if(!n)return new Error("Unknown option: "+e);if(n.callback){var s=t&&n.callback(void 0,t);return"global"!==o&&void 0!==s?s:"local"!==o?n.callback():void 0}return((s="global"!==o&&t&&t.state.vim.options[e])||"local"!==o&&n||{}).value}y("filetype",void 0,"string",["ft"],(function(e,t){if(void 0!==t){if(void 0===e)return"null"==(i=t.getOption("mode"))?"":i;var i=""==e?"null":e;t.setOption("mode",i)}}));var L,x,D=function(){var e=100,t=-1,i=0,n=0,o=new Array(e);function s(s,r){(t+=r)>i?t=i:t<n&&(t=n);var a=o[(e+t)%e];if(a&&!a.find()){var l,h=r>0?1:-1,d=s.getCursor();do{if((a=o[(e+(t+=h))%e])&&(l=a.find())&&!Z(d,l))break}while(t<i&&t>n)}return a}return{cachedCursor:void 0,add:function(s,r,a){var l=o[t%e];function h(i){var n=++t%e,r=o[n];r&&r.clear(),o[n]=s.setBookmark(i)}if(l){var d=l.find();d&&!Z(d,r)&&h(r)}else h(r);h(a),i=t,(n=t-e+1)<0&&(n=0)},find:function(e,i){var n=t,o=s(e,i);return t=n,o&&o.find()},move:s}},E=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};function N(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=E()}function I(e){return e.state.vim||(e.state.vim={inputState:new A,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:null,sel:{},options:{}}),e.state.vim}function M(){for(var e in L={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:D(),macroModeState:new N,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new P({}),searchHistoryController:new F,exCommandHistoryController:new F},C){var t=C[e];t.value=t.defaultValue}}N.prototype={exitMacroRecordMode:function(){var e=L.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var i=L.registerController.getRegister(t);i&&(i.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog(document.createTextNode("(recording)["+t+"]"),null,{bottom:!0})),this.isRecording=!0)}};var T={buildKeyMap:function(){},getRegisterController:function(){return L.registerController},resetVimGlobalState_:M,getVimGlobalState_:function(){return L},maybeInitVimState_:I,suppressErrorLogging:!1,InsertModeKey:qe,map:function(e,t,i){Ve.map(e,t,i)},unmap:function(e,t){return Ve.unmap(e,t)},noremap:function(e,t,i){function n(e){return e?[e]:["normal","insert","visual"]}for(var o=n(i),s=KGe.length,r=s-jGe;r<s&&o.length;r++){var a=KGe[r];if(!(a.keys!=t||i&&a.context&&a.context!==i||"ex"===a.type.substr(0,2)||"key"===a.type.substr(0,3))){var l={};for(var h in a)l[h]=a[h];l.keys=e,i&&!l.context&&(l.context=i),this._mapCommand(l);var d=n(a.context);o=o.filter((function(e){return-1===d.indexOf(e)}))}}},mapclear:function(e){var t=KGe.length,i=jGe,n=KGe.slice(0,t-i);if(KGe=KGe.slice(t-i),e)for(var o=n.length-1;o>=0;o--){var s=n[o];if(e!==s.context)if(s.context)this._mapCommand(s);else{var r=["normal","insert","visual"];for(var a in r)if(r[a]!==e){var l={};for(var h in s)l[h]=s[h];l.context=r[a],this._mapCommand(l)}}}},setOption:S,getOption:k,defineOption:y,defineEx:function(e,t,i){if(t){if(0!==e.indexOf(t))throw new Error('(Vim.defineEx) "'+t+'" is not a prefix of "'+e+'", command not registered')}else t=e;We[e]=i,Ve.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,i){var n=this.findKey(e,t,i);if("function"==typeof n)return n()},findKey:function(e,t,i){var n,o=I(e);function s(){if("<Esc>"==t){if(o.visualMode)le(e);else{if(!o.insertMode)return;ze(e)}return R(e),!0}}return n=o.insertMode?function(){if(s())return!0;for(var i=o.inputState.keyBuffer=o.inputState.keyBuffer+t,n=1==t.length,r=B.matchCommand(i,KGe,o.inputState,"insert");i.length>1&&"full"!=r.type;){i=o.inputState.keyBuffer=i.slice(1);var a=B.matchCommand(i,KGe,o.inputState,"insert");"none"!=a.type&&(r=a)}if("none"==r.type)return R(e),!1;if("partial"==r.type)return x&&window.clearTimeout(x),x=window.setTimeout((function(){o.insertMode&&o.inputState.keyBuffer&&R(e)}),k("insertModeEscKeysTimeout")),!n;if(x&&window.clearTimeout(x),n){for(var l=e.listSelections(),h=0;h<l.length;h++){var d=l[h].head;e.replaceRange("",j(d,0,-(i.length-1)),d,"+input")}L.macroModeState.lastInsertModeChanges.changes.pop()}return R(e),r.command}():function(){if(function(){var n=L.macroModeState;if(n.isRecording){if("q"==t)return n.exitMacroRecordMode(),R(e),!0;"mapping"!=i&&function(e,t){if(!e.isPlaying){var i=e.latestRegister,n=L.registerController.getRegister(i);n&&n.pushText(t)}}(n,t)}}()||s())return!0;var n=o.inputState.keyBuffer=o.inputState.keyBuffer+t;if(/^[1-9]\d*$/.test(n))return!0;if(!(l=/^(\d*)(.*)$/.exec(n)))return R(e),!1;var r=o.visualMode?"visual":"normal",a=l[2]||l[1];o.inputState.operatorShortcut&&o.inputState.operatorShortcut.slice(-1)==a&&(a=o.inputState.operatorShortcut);var l,h=B.matchCommand(a,KGe,o.inputState,r);return"none"==h.type?(R(e),!1):"partial"==h.type||(o.inputState.keyBuffer="",(l=/^(\d*)(.*)$/.exec(n))[1]&&"0"!=l[1]&&o.inputState.pushRepeatDigit(l[1]),h.command)}(),!1===n?o.insertMode||1!==t.length?void 0:function(){return!0}:!0===n?function(){return!0}:function(){return e.operation((function(){e.curOp.isVimOp=!0;try{"keyToKey"==n.type?function(i){for(var n;i;)n=/<\w+-.+?>|<\w+>|./.exec(i),t=n[0],i=i.substring(n.index+t.length),T.handleKey(e,t,"mapping")}(n.toKeys):B.processCommand(e,o,n)}catch(t){throw e.state.vim=void 0,I(e),T.suppressErrorLogging||console.log(t),t}finally{e.curOp.isVimOp=!1}return!0}))}},handleEx:function(e,t){Ve.processCommand(e,t)},defineMotion:function(e,t){W[e]=t},defineAction:function(e,t){H[e]=t},defineOperator:function(e,t){z[e]=t},mapCommand:function(e,t,i,n,o){var s={keys:e,type:t};for(var r in s[t]=i,s[t+"Args"]=n,o)s[r]=o[r];He(s)},_mapCommand:He,defineRegister:function(e,t){var i=L.registerController.registers;if(!e||1!=e.length)throw Error("Register name must be 1 character");if(i[e])throw Error("Register already defined "+e);i[e]=t,p.push(e)},exitVisualMode:le,exitInsertMode:ze};function A(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=null}function R(e,t){e.state.vim.inputState=new A,zGe.signal(e,"vim-command-done",t)}function O(e,t,i){this.clear(),this.keyBuffer=[e||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!t,this.blockwise=!!i}function P(e){this.registers=e,this.unnamedRegister=e['"']=new O,e["."]=new O,e[":"]=new O,e["/"]=new O}function F(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}A.prototype.pushRepeatDigit=function(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},A.prototype.getRepeat=function(){var e=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(""),10))),e},O.prototype={setText:function(e,t,i){this.keyBuffer=[e||""],this.linewise=!!t,this.blockwise=!!i},pushText:function(e,t){t&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(E(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},P.prototype={pushText:function(e,t,i,n,o){if("_"!==e){n&&"\n"!==i.charAt(i.length-1)&&(i+="\n");var s=this.isValidRegister(e)?this.getRegister(e):null;if(s)_(e)?s.pushText(i,n):s.setText(i,n,o),this.unnamedRegister.setText(s.toString(),n);else{switch(t){case"yank":this.registers[0]=new O(i,n,o);break;case"delete":case"change":-1==i.indexOf("\n")?this.registers["-"]=new O(i,n):(this.shiftNumericRegisters_(),this.registers[1]=new O(i,n))}this.unnamedRegister.setText(i,n,o)}}},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new O),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&w(e,p)},shiftNumericRegisters_:function(){for(var e=9;e>=2;e--)this.registers[e]=this.getRegister(""+(e-1))}},F.prototype={nextMatch:function(e,t){var i=this.historyBuffer,n=t?-1:1;null===this.initialPrefix&&(this.initialPrefix=e);for(var o=this.iterator+n;t?o>=0:o<i.length;o+=n)for(var s=i[o],r=0;r<=s.length;r++)if(this.initialPrefix==s.substring(0,r))return this.iterator=o,s;return o>=i.length?(this.iterator=i.length,this.initialPrefix):o<0?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);t>-1&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var B={matchCommand:function(e,t,i,n){var o,s=function(e,t,i,n){for(var o,s=[],r=[],a=0;a<t.length;a++){var l=t[a];"insert"==i&&"insert"!=l.context||l.context&&l.context!=i||n.operator&&"action"==l.type||!(o=q(e,l.keys))||("partial"==o&&s.push(l),"full"==o&&r.push(l))}return{partial:s.length&&s,full:r.length&&r}}(e,t,n,i);if(!s.full&&!s.partial)return{type:"none"};if(!s.full&&s.partial)return{type:"partial"};for(var r=0;r<s.full.length;r++){var a=s.full[r];o||(o=a)}if("<character>"==o.keys.slice(-11)){var l=function(e){var t=/^.*(<[^>]+>)$/.exec(e),i=t?t[1]:e.slice(-1);if(i.length>1)switch(i){case"<CR>":i="\n";break;case"<Space>":i=" ";break;default:i=""}return i}(e);if(!l)return{type:"none"};i.selectedCharacter=l}return{type:"full",command:o}},processCommand:function(e,t,i){switch(t.inputState.repeatOverride=i.repeatOverride,i.type){case"motion":this.processMotion(e,t,i);break;case"operator":this.processOperator(e,t,i);break;case"operatorMotion":this.processOperatorMotion(e,t,i);break;case"action":this.processAction(e,t,i);break;case"search":this.processSearch(e,t,i);break;case"ex":case"keyToEx":this.processEx(e,t,i)}},processMotion:function(e,t,i){t.inputState.motion=i.motion,t.inputState.motionArgs=K(i.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,i){var n=t.inputState;if(n.operator){if(n.operator==i.operator)return n.motion="expandToLine",n.motionArgs={linewise:!0},void this.evalInput(e,t);R(e)}n.operator=i.operator,n.operatorArgs=K(i.operatorArgs),i.keys.length>1&&(n.operatorShortcut=i.keys),i.exitVisualBlock&&(t.visualBlock=!1,re(e)),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,i){var n=t.visualMode,o=K(i.operatorMotionArgs);o&&n&&o.visualLine&&(t.visualLine=!0),this.processOperator(e,t,i),n||this.processMotion(e,t,i)},processAction:function(e,t,i){var n=t.inputState,o=n.getRepeat(),s=!!o,r=K(i.actionArgs)||{};n.selectedCharacter&&(r.selectedCharacter=n.selectedCharacter),i.operator&&this.processOperator(e,t,i),i.motion&&this.processMotion(e,t,i),(i.motion||i.operator)&&this.evalInput(e,t),r.repeat=o||1,r.repeatIsExplicit=s,r.registerName=n.registerName,R(e),t.lastMotion=null,i.isEdit&&this.recordLastEdit(t,n,i),H[i.action](e,r,t)},processSearch:function(e,t,i){if(e.getSearchCursor){var n=i.searchArgs.forward,o=i.searchArgs.wholeWordOnly;ye(e).setReversed(!n);var s=n?"/":"?",r=ye(e).getQuery(),a=e.getScrollInfo();switch(i.searchArgs.querySrc){case"prompt":var l=L.macroModeState;l.isPlaying?u(c=l.replaySearchQueries.shift(),!0,!1):Ne(e,{onClose:function(t){e.scrollTo(a.left,a.top),u(t,!0,!0);var i=L.macroModeState;i.isRecording&&function(e,t){if(!e.isPlaying){var i=e.latestRegister,n=L.registerController.getRegister(i);n&&n.pushSearchQuery&&n.pushSearchQuery(t)}}(i,t)},prefix:s,desc:"(JavaScript regexp)",onKeyUp:function(t,i,o){var s,r,l,h=zGe.keyName(t);"Up"==h||"Down"==h?(s="Up"==h,r=t.target?t.target.selectionEnd:0,o(i=L.searchHistoryController.nextMatch(i,s)||""),r&&t.target&&(t.target.selectionEnd=t.target.selectionStart=Math.min(r,t.target.value.length))):"Left"!=h&&"Right"!=h&&"Ctrl"!=h&&"Alt"!=h&&"Shift"!=h&&L.searchHistoryController.reset();try{l=Ie(e,i,!0,!0)}catch(t){}l?e.scrollIntoView(Ae(e,!n,l),30):(Re(e),e.scrollTo(a.left,a.top))},onKeyDown:function(t,i,n){var o=zGe.keyName(t);"Esc"==o||"Ctrl-C"==o||"Ctrl-["==o||"Backspace"==o&&""==i?(L.searchHistoryController.pushInput(i),L.searchHistoryController.reset(),Ie(e,r),Re(e),e.scrollTo(a.left,a.top),zGe.e_stop(t),R(e),n(),e.focus()):"Up"==o||"Down"==o?zGe.e_stop(t):"Ctrl-U"==o&&(zGe.e_stop(t),n(""))}});break;case"wordUnderCursor":var h=de(e,!1,0,!1,!0),d=!0;if(h||(h=de(e,!1,0,!1,!1),d=!1),!h)return;var c=e.getLine(h.start.line).substring(h.start.ch,h.end.ch);c=d&&o?"\\b"+c+"\\b":c.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1"),L.jumpList.cachedCursor=e.getCursor(),e.setCursor(h.start),u(c,!0,!1)}}function u(n,o,s){L.searchHistoryController.pushInput(n),L.searchHistoryController.reset();try{Ie(e,n,o,s)}catch(t){return Ee(e,"Invalid regex: "+n),void R(e)}B.processMotion(e,t,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:i.searchArgs.toJumplist}})}},processEx:function(e,t,i){function n(t){L.exCommandHistoryController.pushInput(t),L.exCommandHistoryController.reset(),Ve.processCommand(e,t)}function o(t,i,n){var o,s,r=zGe.keyName(t);("Esc"==r||"Ctrl-C"==r||"Ctrl-["==r||"Backspace"==r&&""==i)&&(L.exCommandHistoryController.pushInput(i),L.exCommandHistoryController.reset(),zGe.e_stop(t),R(e),n(),e.focus()),"Up"==r||"Down"==r?(zGe.e_stop(t),o="Up"==r,s=t.target?t.target.selectionEnd:0,n(i=L.exCommandHistoryController.nextMatch(i,o)||""),s&&t.target&&(t.target.selectionEnd=t.target.selectionStart=Math.min(s,t.target.value.length))):"Ctrl-U"==r?(zGe.e_stop(t),n("")):"Left"!=r&&"Right"!=r&&"Ctrl"!=r&&"Alt"!=r&&"Shift"!=r&&L.exCommandHistoryController.reset()}"keyToEx"==i.type?Ve.processCommand(e,i.exArgs.input):t.visualMode?Ne(e,{onClose:n,prefix:":",value:"'<,'>",onKeyDown:o,selectValueOnOpen:!1}):Ne(e,{onClose:n,prefix:":",onKeyDown:o})},evalInput:function(e,t){var i,n,o,s=t.inputState,r=s.motion,a=s.motionArgs||{},l=s.operator,h=s.operatorArgs||{},d=s.registerName,c=t.sel,u=G(t.visualMode?U(e,c.head):e.getCursor("head")),g=G(t.visualMode?U(e,c.anchor):e.getCursor("anchor")),p=G(u),m=G(g);if(l&&this.recordLastEdit(t,s),(o=void 0!==s.repeatOverride?s.repeatOverride:s.getRepeat())>0&&a.explicitRepeat?a.repeatIsExplicit=!0:(a.noRepeat||!a.explicitRepeat&&0===o)&&(o=1,a.repeatIsExplicit=!1),s.selectedCharacter&&(a.selectedCharacter=h.selectedCharacter=s.selectedCharacter),a.repeat=o,R(e),r){var f=W[r](e,u,a,t,s);if(t.lastMotion=W[r],!f)return;if(a.toJumplist){var _=L.jumpList,b=_.cachedCursor;b?(ce(e,b,f),delete _.cachedCursor):ce(e,u,f)}f instanceof Array?(n=f[0],i=f[1]):i=f,i||(i=G(u)),t.visualMode?(t.visualBlock&&i.ch===1/0||(i=U(e,i)),n&&(n=U(e,n)),n=n||m,c.anchor=n,c.head=i,re(e),ve(e,t,"<",Y(n,i)?n:i),ve(e,t,">",Y(n,i)?i:n)):l||(i=U(e,i),e.setCursor(i.line,i.ch))}if(l){if(h.lastSel){n=m;var w=h.lastSel,C=Math.abs(w.head.line-w.anchor.line),y=Math.abs(w.head.ch-w.anchor.ch);i=w.visualLine?new HGe(m.line+C,m.ch):w.visualBlock?new HGe(m.line+C,m.ch+y):w.head.line==w.anchor.line?new HGe(m.line,m.ch+y):new HGe(m.line+C,m.ch),t.visualMode=!0,t.visualLine=w.visualLine,t.visualBlock=w.visualBlock,c=t.sel={anchor:n,head:i},re(e)}else t.visualMode&&(h.lastSel={anchor:G(c.anchor),head:G(c.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var S,k,x,D,E;if(t.visualMode){if(S=Q(c.head,c.anchor),k=X(c.head,c.anchor),x=t.visualLine||h.linewise,E=ae(e,{anchor:S,head:k},D=t.visualBlock?"block":x?"line":"char"),x){var N=E.ranges;if("block"==D)for(var I=0;I<N.length;I++)N[I].head.ch=ee(e,N[I].head.line);else"line"==D&&(N[0].head=new HGe(N[0].head.line+1,0))}}else{if(S=G(n||m),Y(k=G(i||p),S)){var M=S;S=k,k=M}(x=a.linewise||h.linewise)?function(e,t,i){t.ch=0,i.ch=0,i.line++}(0,S,k):a.forward&&function(e,t,i){var n=e.getRange(t,i);if(/\n\s*$/.test(n)){var o=n.split("\n");o.pop();for(var s=o.pop();o.length>0&&s&&v(s);s=o.pop())i.line--,i.ch=0;s?(i.line--,i.ch=ee(e,i.line)):i.ch=0}}(e,S,k),E=ae(e,{anchor:S,head:k},D="char",!a.inclusive||x)}e.setSelections(E.ranges,E.primary),t.lastMotion=null,h.repeat=o,h.registerName=d,h.linewise=x;var T=z[l](e,h,E.ranges,m,i);t.visualMode&&le(e,null!=T),T&&e.setCursor(T)}},recordLastEdit:function(e,t,i){var n=L.macroModeState;n.isPlaying||(e.lastEditInputState=t,e.lastEditActionCommand=i,n.lastInsertModeChanges.changes=[],n.lastInsertModeChanges.expectCursorActivityForChange=!1,n.lastInsertModeChanges.visualBlock=e.visualBlock?e.sel.head.line-e.sel.anchor.line:0)}},W={moveToTopLine:function(e,t,i){var n=Oe(e).top+i.repeat-1;return new HGe(n,he(e.getLine(n)))},moveToMiddleLine:function(e){var t=Oe(e),i=Math.floor(.5*(t.top+t.bottom));return new HGe(i,he(e.getLine(i)))},moveToBottomLine:function(e,t,i){var n=Oe(e).bottom-i.repeat+1;return new HGe(n,he(e.getLine(n)))},expandToLine:function(e,t,i){return new HGe(t.line+i.repeat-1,1/0)},findNext:function(e,t,i){var n=ye(e),o=n.getQuery();if(o){var s=!i.forward;return s=n.isReversed()?!s:s,Te(e,o),Ae(e,s,o,i.repeat)}},findAndSelectNextInclusive:function(e,t,i,n,o){var s=ye(e),r=s.getQuery();if(r){var a=!i.forward,l=function(e,t,i,n,o){return void 0===n&&(n=1),e.operation((function(){var s=e.getCursor(),r=e.getSearchCursor(i,s),a=r.find(!t);!o.visualMode&&a&&Z(r.from(),s)&&r.find(!t);for(var l=0;l<n;l++)if(!(a=r.find(t))&&!(r=e.getSearchCursor(i,t?new HGe(e.lastLine()):new HGe(e.firstLine(),0))).find(t))return;return[r.from(),r.to()]}))}(e,a=s.isReversed()?!a:a,r,i.repeat,n);if(l){if(o.operator)return l;var h=l[0],d=new HGe(l[1].line,l[1].ch-1);if(n.visualMode){(n.visualLine||n.visualBlock)&&(n.visualLine=!1,n.visualBlock=!1,zGe.signal(e,"vim-mode-change",{mode:"visual",subMode:""}));var c=n.sel.anchor;if(c)return s.isReversed()?i.forward?[c,h]:[c,d]:i.forward?[c,d]:[c,h]}else n.visualMode=!0,n.visualLine=!1,n.visualBlock=!1,zGe.signal(e,"vim-mode-change",{mode:"visual",subMode:""});return a?[d,h]:[h,d]}}},goToMark:function(e,t,i,n){var o=Pe(e,n,i.selectedCharacter);return o?i.linewise?{line:o.line,ch:he(e.getLine(o.line))}:o:null},moveToOtherHighlightedEnd:function(e,t,i,n){if(n.visualBlock&&i.sameLine){var o=n.sel;return[U(e,new HGe(o.anchor.line,o.head.ch)),U(e,new HGe(o.head.line,o.anchor.ch))]}return[n.sel.head,n.sel.anchor]},jumpToMark:function(e,t,i,n){for(var o=t,s=0;s<i.repeat;s++){var r=o;for(var a in n.marks)if(f(a)){var l=n.marks[a].find();if(!((i.forward?Y(l,r):Y(r,l))||i.linewise&&l.line==r.line)){var h=Z(r,o),d=i.forward?J(r,l,o):J(o,l,r);(h||d)&&(o=l)}}}return i.linewise&&(o=new HGe(o.line,he(e.getLine(o.line)))),o},moveByCharacters:function(e,t,i){var n=t,o=i.repeat,s=i.forward?n.ch+o:n.ch-o;return new HGe(n.line,s)},moveByLines:function(e,t,i,n){var o=t,s=o.ch;switch(n.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:s=n.lastHPos;break;default:n.lastHPos=s}var r=i.repeat+(i.repeatOffset||0),a=i.forward?o.line+r:o.line-r,l=e.firstLine(),h=e.lastLine(),d=e.findPosV(o,i.forward?r:-r,"line",n.lastHSPos);return(i.forward?d.line>a:d.line<a)&&(a=d.line,s=d.ch),a<l&&o.line==l?this.moveToStartOfLine(e,t,i,n):a>h&&o.line==h?fe(e,t,i,n,!0):(i.toFirstChar&&(s=he(e.getLine(a)),n.lastHPos=s),n.lastHSPos=e.charCoords(new HGe(a,s),"div").left,new HGe(a,s))},moveByDisplayLines:function(e,t,i,n){var o=t;switch(n.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:n.lastHSPos=e.charCoords(o,"div").left}var s=i.repeat;if((a=e.findPosV(o,i.forward?s:-s,"line",n.lastHSPos)).hitSide)if(i.forward)var r={top:e.charCoords(a,"div").top+8,left:n.lastHSPos},a=e.coordsChar(r,"div");else{var l=e.charCoords(new HGe(e.firstLine(),0),"div");l.left=n.lastHSPos,a=e.coordsChar(l,"div")}return n.lastHPos=a.ch,a},moveByPage:function(e,t,i){var n=t,o=i.repeat;return e.findPosV(n,i.forward?o:-o,"page")},moveByParagraph:function(e,t,i){var n=i.forward?1:-1;return we(e,t,i.repeat,n)},moveBySentence:function(e,t,i){var n=i.forward?1:-1;return function(e,t,i,n){function o(e,t){if(t.pos+t.dir<0||t.pos+t.dir>=t.line.length){if(t.ln+=t.dir,!m(e,t.ln))return t.line=null,t.ln=null,void(t.pos=null);t.line=e.getLine(t.ln),t.pos=t.dir>0?0:t.line.length-1}else t.pos+=t.dir}function s(e,t,i,n){var s=""===(h=e.getLine(t)),r={line:h,ln:t,pos:i,dir:n},a={ln:r.ln,pos:r.pos},l=""===r.line;for(o(e,r);null!==r.line;){if(a.ln=r.ln,a.pos=r.pos,""===r.line&&!l)return{ln:r.ln,pos:r.pos};if(s&&""!==r.line&&!v(r.line[r.pos]))return{ln:r.ln,pos:r.pos};!b(r.line[r.pos])||s||r.pos!==r.line.length-1&&!v(r.line[r.pos+1])||(s=!0),o(e,r)}var h=e.getLine(a.ln);a.pos=0;for(var d=h.length-1;d>=0;--d)if(!v(h[d])){a.pos=d;break}return a}function r(e,t,i,n){var s={line:e.getLine(t),ln:t,pos:i,dir:n},r={ln:s.ln,pos:null},a=""===s.line;for(o(e,s);null!==s.line;){if(""===s.line&&!a)return null!==r.pos?r:{ln:s.ln,pos:s.pos};if(b(s.line[s.pos])&&null!==r.pos&&(s.ln!==r.ln||s.pos+1!==r.pos))return r;""===s.line||v(s.line[s.pos])||(a=!1,r={ln:s.ln,pos:s.pos}),o(e,s)}var l=e.getLine(r.ln);r.pos=0;for(var h=0;h<l.length;++h)if(!v(l[h])){r.pos=h;break}return r}for(var a={ln:t.line,pos:t.ch};i>0;)a=n<0?r(e,a.ln,a.pos,n):s(e,a.ln,a.pos,n),i--;return new HGe(a.ln,a.pos)}(e,t,i.repeat,n)},moveByScroll:function(e,t,i,n){var o,s=e.getScrollInfo(),r=i.repeat;r||(r=s.clientHeight/(2*e.defaultTextHeight()));var a=e.charCoords(t,"local");if(i.repeat=r,!(o=W.moveByDisplayLines(e,t,i,n)))return null;var l=e.charCoords(o,"local");return e.scrollTo(null,s.top+l.top-a.top),o},moveByWords:function(e,t,i){return function(e,t,i,n,o,s){var r=G(t),a=[];(n&&!o||!n&&o)&&i++;for(var l=!(n&&o),h=0;h<i;h++){var d=me(e,t,n,s,l);if(!d){var c=ee(e,e.lastLine());a.push(n?{line:e.lastLine(),from:c,to:c}:{line:0,from:0,to:0});break}a.push(d),t=new HGe(d.line,n?d.to-1:d.from)}var u=a.length!=i,g=a[0],p=a.pop();return n&&!o?(u||g.from==r.ch&&g.line==r.line||(p=a.pop()),new HGe(p.line,p.from)):n&&o?new HGe(p.line,p.to-1):!n&&o?(u||g.to==r.ch&&g.line==r.line||(p=a.pop()),new HGe(p.line,p.to)):new HGe(p.line,p.from)}(e,t,i.repeat,!!i.forward,!!i.wordEnd,!!i.bigWord)},moveTillCharacter:function(e,t,i){var n=_e(e,i.repeat,i.forward,i.selectedCharacter),o=i.forward?-1:1;return ue(o,i),n?(n.ch+=o,n):null},moveToCharacter:function(e,t,i){var n=i.repeat;return ue(0,i),_e(e,n,i.forward,i.selectedCharacter)||t},moveToSymbol:function(e,t,i){return function(e,t,i,n){var o=G(e.getCursor()),s=i?1:-1,r=i?e.lineCount():-1,a=o.ch,l=o.line,h=e.getLine(l),d={lineText:h,nextCh:h.charAt(a),lastCh:null,index:a,symb:n,reverseSymb:(i?{")":"(","}":"{"}:{"(":")","{":"}"})[n],forward:i,depth:0,curMoveThrough:!1},c=ge[n];if(!c)return o;var u=pe[c].init,g=pe[c].isComplete;for(u&&u(d);l!==r&&t;){if(d.index+=s,d.nextCh=d.lineText.charAt(d.index),!d.nextCh){if(l+=s,d.lineText=e.getLine(l)||"",s>0)d.index=0;else{var p=d.lineText.length;d.index=p>0?p-1:0}d.nextCh=d.lineText.charAt(d.index)}g(d)&&(o.line=l,o.ch=d.index,t--)}return d.nextCh||d.curMoveThrough?new HGe(l,d.index):o}(e,i.repeat,i.forward,i.selectedCharacter)||t},moveToColumn:function(e,t,i,n){var o=i.repeat;return n.lastHPos=o-1,n.lastHSPos=e.charCoords(t,"div").left,function(e,t){var i=e.getCursor().line;return U(e,new HGe(i,t-1))}(e,o)},moveToEol:function(e,t,i,n){return fe(e,t,i,n,!1)},moveToFirstNonWhiteSpaceCharacter:function(e,t){var i=t;return new HGe(i.line,he(e.getLine(i.line)))},moveToMatchedSymbol:function(e,t){var i=t,n=i.line,o=i.ch;if(o<e.getLine(n).length){var s="<"===o||">"===o?/[(){}[\]<>]/:/[(){}[\]]/;return e.findMatchingBracket(new HGe(n,o),{bracketRegex:s}).to}return i},moveToStartOfLine:function(e,t){return new HGe(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,i){var n=i.forward?e.lastLine():e.firstLine();return i.repeatIsExplicit&&(n=i.repeat-e.getOption("firstLineNumber")),new HGe(n,he(e.getLine(n)))},moveToStartOfDisplayLine:function(e){return e.execCommand("goLineLeft"),e.getCursor()},moveToEndOfDisplayLine:function(e){e.execCommand("goLineRight");var t=e.getCursor();return"before"==t.sticky&&t.ch--,t},textObjectManipulation:function(e,t,i,n){var o=i.selectedCharacter;"b"==o?o="(":"B"==o&&(o="{");var s,r=!i.textObjectInner;if({"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"}[o])s=function(e,t,i,n){var o,s,r=t,a={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[i],l={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[i],h=e.getLine(r.line).charAt(r.ch)===l?1:0;if(o=e.scanForBracket(new HGe(r.line,r.ch+h),-1,void 0,{bracketRegex:a}),s=e.scanForBracket(new HGe(r.line,r.ch+h),1,void 0,{bracketRegex:a}),!o||!s)return{start:r,end:r};if(o=o.pos,s=s.pos,o.line==s.line&&o.ch>s.ch||o.line>s.line){var d=o;o=s,s=d}return n?s.ch+=1:o.ch+=1,{start:o,end:s}}(e,t,o,r);else if({"'":!0,'"':!0,"`":!0}[o])s=function(e,t,i,n){var o,s,r,a,l=G(t),h=e.getLine(l.line).split(""),d=h.indexOf(i);if(l.ch<d?l.ch=d:d<l.ch&&h[l.ch]==i&&(s=l.ch,--l.ch),h[l.ch]!=i||s)for(r=l.ch;r>-1&&!o;r--)h[r]==i&&(o=r+1);else o=l.ch+1;if(o&&!s)for(r=o,a=h.length;r<a&&!s;r++)h[r]==i&&(s=r);return o&&s?(n&&(--o,++s),{start:new HGe(l.line,o),end:new HGe(l.line,s)}):{start:l,end:l}}(e,t,o,r);else if("W"===o)s=de(e,r,0,!0);else if("w"===o)s=de(e,r,0,!1);else if("p"===o)if(s=we(e,t,i.repeat,0,r),i.linewise=!0,n.visualMode)n.visualLine||(n.visualLine=!0);else{var a=n.inputState.operatorArgs;a&&(a.linewise=!0),s.end.line--}else{if("t"!==o)return null;s=function(e,t,i){var n=t;if(!zGe.findMatchingTag||!zGe.findEnclosingTag)return{start:n,end:n};var o=zGe.findMatchingTag(e,t)||zGe.findEnclosingTag(e,t);return o&&o.open&&o.close?i?{start:o.open.from,end:o.close.to}:{start:o.open.to,end:o.close.from}:{start:n,end:n}}(e,t,r)}return e.state.vim.visualMode?function(e,t,i){var n,o=e.state.vim.sel,s=o.head,r=o.anchor;return Y(i,t)&&(n=i,i=t,t=n),Y(s,r)?(s=Q(t,s),r=X(r,i)):(r=Q(t,r),-1==(s=j(s=X(s,i),0,-1)).ch&&s.line!=e.firstLine()&&(s=new HGe(s.line-1,ee(e,s.line-1)))),[r,s]}(e,s.start,s.end):[s.start,s.end]},repeatLastCharacterSearch:function(e,t,i){var n=L.lastCharacterSearch,o=i.repeat,s=i.forward===n.forward,r=(n.increment?1:0)*(s?-1:1);e.moveH(-r,"char"),i.inclusive=!!s;var a=_e(e,o,s,n.selectedCharacter);return a?(a.ch+=r,a):(e.moveH(r,"char"),t)}};function V(e,t){for(var i=[],n=0;n<t;n++)i.push(e);return i}var z={change:function(e,t,i){var n,o,s=e.state.vim,r=i[0].anchor,a=i[0].head;if(s.visualMode)if(t.fullLine)a.ch=Number.MAX_VALUE,a.line--,e.setSelection(r,a),o=e.getSelection(),e.replaceSelections(""),n=r;else{o=e.getSelection();var l=V("",i.length);e.replaceSelections(l),n=Q(i[0].head,i[0].anchor)}else{o=e.getRange(r,a);var h=s.lastEditInputState||{};if("moveByWords"==h.motion&&!v(o)){var d=/\s+$/.exec(o);d&&h.motionArgs&&h.motionArgs.forward&&(a=j(a,0,-d[0].length),o=o.slice(0,-d[0].length))}var c=new HGe(r.line-1,Number.MAX_VALUE),u=e.firstLine()==e.lastLine();a.line>e.lastLine()&&t.linewise&&!u?e.replaceRange("",c,a):e.replaceRange("",r,a),t.linewise&&(u||(e.setCursor(c),zGe.commands.newlineAndIndent(e)),r.ch=Number.MAX_VALUE),n=r}L.registerController.pushText(t.registerName,"change",o,t.linewise,i.length>1),H.enterInsertMode(e,{head:n},e.state.vim)},delete:function(e,t,i){var n,o;e.pushUndoStop();var s=e.state.vim;if(s.visualBlock){o=e.getSelection();var r=V("",i.length);e.replaceSelections(r),n=Q(i[0].head,i[0].anchor)}else{var a=i[0].anchor,l=i[0].head;t.linewise&&l.line!=e.firstLine()&&a.line==e.lastLine()&&a.line==l.line-1&&(a.line==e.firstLine()?a.ch=0:a=new HGe(a.line-1,ee(e,a.line-1))),o=e.getRange(a,l),e.replaceRange("",a,l),n=a,t.linewise&&(n=W.moveToFirstNonWhiteSpaceCharacter(e,a))}return L.registerController.pushText(t.registerName,"delete",o,t.linewise,s.visualBlock),U(e,n)},indent:function(e,t,i){var n=e.state.vim,o=i[0].anchor.line,s=n.visualBlock?i[i.length-1].anchor.line:i[0].head.line,r=n.visualMode?t.repeat:1;t.linewise&&s--,e.pushUndoStop();for(var a=o;a<=s;a++)for(var l=0;l<r;l++)e.indentLine(a,t.indentRight);return e.pushUndoStop(),W.moveToFirstNonWhiteSpaceCharacter(e,i[0].anchor)},indentAuto:function(e,t,i){return e.execCommand("indentAuto"),W.moveToFirstNonWhiteSpaceCharacter(e,i[0].anchor)},changeCase:function(e,t,i,n,o){for(var s=e.getSelections(),r=[],a=t.toLower,l=0;l<s.length;l++){var h=s[l],d="";if(!0===a)d=h.toLowerCase();else if(!1===a)d=h.toUpperCase();else for(var c=0;c<h.length;c++){var u=h.charAt(c);d+=_(u)?u.toLowerCase():u.toUpperCase()}r.push(d)}return e.replaceSelections(r),t.shouldMoveCursor?o:!e.state.vim.visualMode&&t.linewise&&i[0].anchor.line+1==i[0].head.line?W.moveToFirstNonWhiteSpaceCharacter(e,n):t.linewise?n:Q(i[0].anchor,i[0].head)},yank:function(e,t,i,n){var o=e.state.vim,s=e.getSelection(),r=o.visualMode?Q(o.sel.anchor,o.sel.head,i[0].head,i[0].anchor):n;return L.registerController.pushText(t.registerName,"yank",s,t.linewise,o.visualBlock),r}},H={jumpListWalk:function(e,t,i){if(!i.visualMode){var n=t.repeat,o=t.forward,s=L.jumpList.move(e,o?n:-n),r=s?s.find():void 0;r=r||e.getCursor(),e.setCursor(r)}},scroll:function(e,t,i){if(!i.visualMode){var n=t.repeat||1,o=e.defaultTextHeight(),s=e.getScrollInfo().top,r=o*n,a=t.forward?s+r:s-r,l=G(e.getCursor()),h=e.charCoords(l,"local");if(t.forward)a>h.top?(l.line+=(a-h.top)/o,l.line=Math.ceil(l.line),e.setCursor(l),h=e.charCoords(l,"local"),e.scrollTo(null,h.top)):e.scrollTo(null,a);else{var d=a+e.getScrollInfo().clientHeight;d<h.bottom?(l.line-=(h.bottom-d)/o,l.line=Math.floor(l.line),e.setCursor(l),h=e.charCoords(l,"local"),e.scrollTo(null,h.bottom-e.getScrollInfo().clientHeight)):e.scrollTo(null,a)}}},scrollToCursor:function(e,t){var i=e.getCursor().line,n=e.charCoords(new HGe(i,0),"local"),o=e.getScrollInfo().clientHeight,s=n.top,r=n.bottom-s;switch(t.position){case"center":s=s-o/2+r;break;case"bottom":s=s-o+r}e.moveCurrentLineTo(s)},replayMacro:function(e,t,i){var n=t.selectedCharacter,o=t.repeat,s=L.macroModeState;for("@"==n?n=s.latestRegister:s.latestRegister=n;o--;)Ue(e,i,s,n)},enterMacroRecordMode:function(e,t){var i=L.macroModeState,n=t.selectedCharacter;L.registerController.isValidRegister(n)&&i.enterMacroRecordMode(e,n)},toggleOverwrite:function(e){e.state.overwrite?(e.toggleOverwrite(!1),e.setOption("keyMap","vim-insert"),zGe.signal(e,"vim-mode-change",{mode:"insert"})):(e.toggleOverwrite(!0),e.setOption("keyMap","vim-replace"),zGe.signal(e,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(e,t,i){if(!e.getOption("readOnly")){i.insertMode=!0,i.insertModeRepeat=t&&t.repeat||1;var n=t?t.insertAt:null,o=i.sel,s=t.head||e.getCursor("head"),r=e.listSelections().length;if("eol"==n)s=new HGe(s.line,ee(e,s.line));else if("bol"==n)s=new HGe(s.line,0);else if("charAfter"==n)s=j(s,0,1);else if("firstNonBlank"==n)s=W.moveToFirstNonWhiteSpaceCharacter(e,s);else if("startOfSelectedArea"==n){if(!i.visualMode)return;i.visualBlock?(s=new HGe(Math.min(o.head.line,o.anchor.line),Math.min(o.head.ch,o.anchor.ch)),r=Math.abs(o.head.line-o.anchor.line)+1):s=o.head.line<o.anchor.line?o.head:new HGe(o.anchor.line,0)}else if("endOfSelectedArea"==n){if(!i.visualMode)return;i.visualBlock?(s=new HGe(Math.min(o.head.line,o.anchor.line),Math.max(o.head.ch,o.anchor.ch)+1),r=Math.abs(o.head.line-o.anchor.line)+1):s=o.head.line>=o.anchor.line?j(o.head,0,1):new HGe(o.anchor.line,0)}else if("inplace"==n){if(i.visualMode)return}else"lastEdit"==n&&(s=Fe(e)||s);e.setOption("disableInput",!1),t&&t.replace?(e.toggleOverwrite(!0),e.setOption("keyMap","vim-replace"),zGe.signal(e,"vim-mode-change",{mode:"replace"})):(e.toggleOverwrite(!1),e.setOption("keyMap","vim-insert"),zGe.signal(e,"vim-mode-change",{mode:"insert"})),L.macroModeState.isPlaying||(e.on("change",Ke),zGe.on(e.getInputField(),"keydown",$e)),i.visualMode&&le(e),oe(e,s,r)}},toggleVisualMode:function(e,t,i){var n,o=t.repeat,s=e.getCursor();i.visualMode?i.visualLine^t.linewise||i.visualBlock^t.blockwise?(i.visualLine=!!t.linewise,i.visualBlock=!!t.blockwise,zGe.signal(e,"vim-mode-change",{mode:"visual",subMode:i.visualLine?"linewise":i.visualBlock?"blockwise":""}),re(e)):le(e):(i.visualMode=!0,i.visualLine=!!t.linewise,i.visualBlock=!!t.blockwise,n=U(e,new HGe(s.line,s.ch+o-1)),i.sel={anchor:s,head:n},zGe.signal(e,"vim-mode-change",{mode:"visual",subMode:i.visualLine?"linewise":i.visualBlock?"blockwise":""}),re(e),ve(e,i,"<",Q(s,n)),ve(e,i,">",X(s,n)))},reselectLastSelection:function(e,t,i){var n=i.lastSelection;if(i.visualMode&&se(e,i),n){var o=n.anchorMark.find(),s=n.headMark.find();if(!o||!s)return;i.sel={anchor:o,head:s},i.visualMode=!0,i.visualLine=n.visualLine,i.visualBlock=n.visualBlock,re(e),ve(e,i,"<",Q(o,s)),ve(e,i,">",X(o,s)),zGe.signal(e,"vim-mode-change",{mode:"visual",subMode:i.visualLine?"linewise":i.visualBlock?"blockwise":""})}},joinLines:function(e,t,i){var n,o;if(i.visualMode){if(n=e.getCursor("anchor"),Y(o=e.getCursor("head"),n)){var s=o;o=n,n=s}o.ch=ee(e,o.line)-1}else{var r=Math.max(t.repeat,2);n=e.getCursor(),o=U(e,new HGe(n.line+r-1,1/0))}for(var a=0,l=n.line;l<o.line;l++){a=ee(e,n.line),s=new HGe(n.line+1,ee(e,n.line+1));var h=e.getRange(n,s);h=t.keepSpaces?h.replace(/\r?\n/g,""):h.replace(/\r?\n\s*/g," "),e.replaceRange(h,n,s)}var d=new HGe(n.line,a);i.visualMode&&le(e,!1),e.setCursor(d)},newLineAndEnterInsertMode:function(e,t,i){if(!e.getOption("readOnly")){i.insertMode=!0;var n=G(e.getCursor());n.line!==e.firstLine()||t.after?(n.line=t.after?n.line:n.line-1,n.ch=ee(e,n.line),e.setCursor(n),(zGe.commands.newlineAndIndentContinueComment||zGe.commands.newlineAndIndent)(e)):(e.replaceRange("\n",new HGe(e.firstLine(),0)),e.setCursor(e.firstLine(),0)),this.enterInsertMode(e,{repeat:t.repeat},i)}},paste:function(e,t,i){var n=G(e.getCursor()),o=L.registerController.getRegister(t.registerName);if(u=o.toString()){if(t.matchIndent){var s=e.getOption("tabSize"),r=function(e){var t=e.split("\t").length-1,i=e.split(" ").length-1;return t*s+1*i},a=e.getLine(e.getCursor().line),l=r(a.match(/^\s*/)[0]),h=u.replace(/\n$/,""),d=u!==h,c=r(u.match(/^\s*/)[0]),u=h.replace(/^\s*/gm,(function(t){var i=l+(r(t)-c);if(i<0)return"";if(e.getOption("indentWithTabs")){var n=Math.floor(i/s);return Array(n+1).join("\t")}return Array(i+1).join(" ")}));u+=d?"\n":""}t.repeat>1&&(u=Array(t.repeat+1).join(u));var g,p,m=o.linewise,f=o.blockwise;if(f){u=u.split("\n"),m&&u.pop();for(var _=0;_<u.length;_++)u[_]=""==u[_]?" ":u[_];n.ch+=t.after?1:0,n.ch=Math.min(ee(e,n.line),n.ch)}else m?i.visualMode?u=i.visualLine?u.slice(0,-1):"\n"+u.slice(0,u.length-1)+"\n":t.after?(u="\n"+u.slice(0,u.length-1),n.ch=ee(e,n.line)):n.ch=0:n.ch+=t.after?1:0;if(i.visualMode){var v;i.lastPastedText=u;var b=function(e,t){var i=t.lastSelection;return t.visualMode?function(){var t=e.listSelections(),i=t[0],n=t[t.length-1];return[Y(i.anchor,i.head)?i.anchor:i.head,Y(n.anchor,n.head)?n.head:n.anchor]}():function(){var t=e.getCursor(),n=e.getCursor(),o=i.visualBlock;if(o){var s=o.width,r=o.height;n=new HGe(t.line+r,t.ch+s);for(var a=[],l=t.line;l<n.line;l++){var h={anchor:new HGe(l,t.ch),head:new HGe(l,n.ch)};a.push(h)}e.setSelections(a)}else{var d=i.anchorMark.find(),c=i.headMark.find(),u=c.line-d.line,g=c.ch-d.ch;n={line:n.line+u,ch:u?n.ch:g+n.ch},i.visualLine&&(t=new HGe(t.line,0),n=new HGe(n.line,ee(e,n.line))),e.setSelection(t,n)}return[t,n]}()}(e,i),w=b[0],C=b[1],y=e.getSelection(),S=e.listSelections(),k=new Array(S.length).join("1").split("1");i.lastSelection&&(v=i.lastSelection.headMark.find()),L.registerController.unnamedRegister.setText(y),f?(e.replaceSelections(k),C=new HGe(w.line+u.length-1,w.ch),e.setCursor(w),ne(e,C),e.replaceSelections(u),g=w):i.visualBlock?(e.replaceSelections(k),e.setCursor(w),e.replaceRange(u,w,w),g=w):(e.replaceRange(u,w,C),g=e.posFromIndex(e.indexFromPos(w)+u.length-1)),v&&(i.lastSelection.headMark=e.setBookmark(v)),m&&(g.ch=0)}else if(f){for(e.setCursor(n),_=0;_<u.length;_++){var x=n.line+_;x>e.lastLine()&&e.replaceRange("\n",new HGe(x,0)),ee(e,x)<n.ch&&ie(e,x,n.ch)}e.setCursor(n),ne(e,new HGe(n.line+u.length-1,n.ch)),e.replaceSelections(u),g=n}else e.replaceRange(u,n),m&&t.after?g=new HGe(n.line+1,he(e.getLine(n.line+1))):m&&!t.after?g=new HGe(n.line,he(e.getLine(n.line))):!m&&t.after?(p=e.indexFromPos(n),g=e.posFromIndex(p+u.length-1)):(p=e.indexFromPos(n),g=e.posFromIndex(p+u.length));i.visualMode&&le(e,!1),e.setCursor(g)}},undo:function(e,t){e.operation((function(){$(e,zGe.commands.undo,t.repeat)(),e.setCursor(e.getCursor("anchor"))}))},redo:function(e,t){$(e,zGe.commands.redo,t.repeat)()},setRegister:function(e,t,i){i.inputState.registerName=t.selectedCharacter},setMark:function(e,t,i){ve(e,i,t.selectedCharacter,e.getCursor())},replace:function(e,t,i){var n,o,s=t.selectedCharacter,r=e.getCursor(),a=e.listSelections();if(i.visualMode)r=e.getCursor("start"),o=e.getCursor("end");else{var l=e.getLine(r.line);(n=r.ch+t.repeat)>l.length&&(n=l.length),o=new HGe(r.line,n)}if("\n"==s)i.visualMode||e.replaceRange("",r,o),(zGe.commands.newlineAndIndentContinueComment||zGe.commands.newlineAndIndent)(e);else{var h=e.getRange(r,o);if(h=h.replace(/[^\n]/g,s),i.visualBlock){var d=new Array(e.getOption("tabSize")+1).join(" ");h=(h=e.getSelection()).replace(/\t/g,d).replace(/[^\n]/g,s).split("\n"),e.replaceSelections(h)}else e.replaceRange(h,r,o);i.visualMode?(r=Y(a[0].anchor,a[0].head)?a[0].anchor:a[0].head,e.setCursor(r),le(e,!1)):e.setCursor(j(o,0,-1))}},incrementNumberToken:function(e,t){for(var i,n,o,s,r=e.getCursor(),a=e.getLine(r.line),l=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi;null!==(i=l.exec(a))&&(o=(n=i.index)+i[0].length,!(r.ch<o)););if((t.backtrack||!(o<=r.ch))&&i){var h=i[2]||i[4],d=i[3]||i[5],c=t.increase?1:-1,u={"0b":2,0:8,"":10,"0x":16}[h.toLowerCase()];s=(parseInt(i[1]+d,u)+c*t.repeat).toString(u);var g=h?new Array(d.length-s.length+1+i[1].length).join("0"):"";s="-"===s.charAt(0)?"-"+h+g+s.substr(1):h+g+s;var p=new HGe(r.line,n),m=new HGe(r.line,o);e.replaceRange(s,p,m),e.setCursor(new HGe(r.line,n+s.length-1))}},repeatLastEdit:function(e,t,i){if(i.lastEditInputState){var n=t.repeat;n&&t.repeatIsExplicit?i.lastEditInputState.repeatOverride=n:n=i.lastEditInputState.repeatOverride||n,Ge(e,i,n,!1)}},indent:function(e,t){e.indentLine(e.getCursor().line,t.indentRight)},exitInsertMode:ze};function U(e,t){var i=e.state.vim,n=i.insertMode||i.visualMode,o=Math.min(Math.max(e.firstLine(),t.line),e.lastLine()),s=ee(e,o)-1+!!n,r=Math.min(Math.max(0,t.ch),s);return new HGe(o,r)}function K(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function j(e,t,i){return"object"==typeof t&&(i=t.ch,t=t.line),new HGe(e.line+t,e.ch+i)}function q(e,t){if("<character>"==t.slice(-11)){var i=t.length-11,n=e.slice(0,i),o=t.slice(0,i);return n==o&&e.length>i?"full":0==o.indexOf(n)&&"partial"}return e==t?"full":0==t.indexOf(e)&&"partial"}function $(e,t,i){return function(){for(var n=0;n<i;n++)t(e)}}function G(e){return new HGe(e.line,e.ch)}function Z(e,t){return e.ch==t.ch&&e.line==t.line}function Y(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}function Q(e,t){return arguments.length>2&&(t=Q.apply(void 0,Array.prototype.slice.call(arguments,1))),Y(e,t)?e:t}function X(e,t){return arguments.length>2&&(t=X.apply(void 0,Array.prototype.slice.call(arguments,1))),Y(e,t)?t:e}function J(e,t,i){var n=Y(e,t),o=Y(t,i);return n&&o}function ee(e,t){return e.getLine(t).length}function te(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function ie(e,t,i){var n=ee(e,t),o=new Array(i-n+1).join(" ");e.setCursor(new HGe(t,n)),e.replaceRange(o,e.getCursor())}function ne(e,t){var i=[],n=e.listSelections(),o=G(e.clipPos(t)),s=!Z(t,o),r=function(e,t,i){for(var n=0;n<e.length;n++){var o=Z(e[n].anchor,t),s=Z(e[n].head,t);if(o||s)return n}return-1}(n,e.getCursor("head")),a=Z(n[r].head,n[r].anchor),l=n.length-1,h=l-r>r?l:0,d=n[h].anchor,c=Math.min(d.line,o.line),u=Math.max(d.line,o.line),g=d.ch,p=o.ch,m=n[h].head.ch-g,f=p-g;m>0&&f<=0?(g++,s||p--):m<0&&f>=0?(g--,a||p++):m<0&&-1==f&&(g--,p++);for(var _=c;_<=u;_++){var v={anchor:new HGe(_,g),head:new HGe(_,p)};i.push(v)}return e.setSelections(i),t.ch=p,d.ch=g,d}function oe(e,t,i){for(var n=[],o=0;o<i;o++){var s=j(t,o,0);n.push({anchor:s,head:s})}e.setSelections(n,0)}function se(e,t){var i=t.sel.anchor,n=t.sel.head;t.lastPastedText&&(n=e.posFromIndex(e.indexFromPos(i)+t.lastPastedText.length),t.lastPastedText=null),t.lastSelection={anchorMark:e.setBookmark(i),headMark:e.setBookmark(n),anchor:G(i),head:G(n),visualMode:t.visualMode,visualLine:t.visualLine,visualBlock:t.visualBlock}}function re(e,t,i){var n=e.state.vim,o=ae(e,t=t||n.sel,i=i||n.visualLine?"line":n.visualBlock?"block":"char",!0);e.setSelections(o.ranges,o.primary)}function ae(e,t,i,n){var o=G(t.head),s=G(t.anchor);if("char"==i){var r=n||Y(t.head,t.anchor)?0:1,a=Y(t.head,t.anchor)?1:0;return o=j(t.head,0,r),{ranges:[{anchor:s=j(t.anchor,0,a),head:o}],primary:0}}if("line"==i){if(Y(t.head,t.anchor))o.ch=0,s.ch=ee(e,s.line);else{s.ch=0;var l=e.lastLine();o.line>l&&(o.line=l),o.ch=ee(e,o.line)}return{ranges:[{anchor:s,head:o}],primary:0}}if("block"==i){var h=Math.min(s.line,o.line),d=s.ch,c=Math.max(s.line,o.line),u=o.ch;d<u?u+=1:d+=1;for(var g=c-h+1,p=o.line==h?0:g-1,m=[],f=0;f<g;f++)m.push({anchor:new HGe(h+f,d),head:new HGe(h+f,u)});return{ranges:m,primary:p}}}function le(e,t){var i=e.state.vim;!1!==t&&e.setCursor(U(e,i.sel.head)),se(e,i),i.visualMode=!1,i.visualLine=!1,i.visualBlock=!1,i.insertMode||zGe.signal(e,"vim-mode-change",{mode:"normal"})}function he(e){if(!e)return 0;var t=e.search(/\S/);return-1==t?e.length:t}function de(e,t,i,n,o){for(var s=function(e){var t=e.getCursor("head");return 1==e.getSelection().length&&(t=Q(t,e.getCursor("anchor"))),t}(e),l=e.getLine(s.line),h=s.ch,d=o?r[0]:a[0];!d(l.charAt(h));)if(++h>=l.length)return null;n?d=a[0]:(d=r[0])(l.charAt(h))||(d=r[1]);for(var c=h,u=h;d(l.charAt(c))&&c<l.length;)c++;for(;d(l.charAt(u))&&u>=0;)u--;if(u++,t){for(var g=c;/\s/.test(l.charAt(c))&&c<l.length;)c++;if(g==c){for(var p=u;/\s/.test(l.charAt(u-1))&&u>0;)u--;u||(u=p)}}return{start:new HGe(s.line,u),end:new HGe(s.line,c)}}function ce(e,t,i){Z(t,i)||L.jumpList.add(e,t,i)}function ue(e,t){L.lastCharacterSearch.increment=e,L.lastCharacterSearch.forward=t.forward,L.lastCharacterSearch.selectedCharacter=t.selectedCharacter}var ge={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},pe={bracket:{isComplete:function(e){if(e.nextCh===e.symb){if(e.depth++,e.depth>=1)return!0}else e.nextCh===e.reverseSymb&&e.depth--;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?"]":"[")===e.symb?"{":"}"},isComplete:function(e){return 0===e.index&&e.nextCh===e.symb}},comment:{isComplete:function(e){var t="*"===e.lastCh&&"/"===e.nextCh;return e.lastCh=e.nextCh,t}},method:{init:function(e){e.symb="m"===e.symb?"{":"}",e.reverseSymb="{"===e.symb?"}":"{"},isComplete:function(e){return e.nextCh===e.symb}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if("#"===e.nextCh){var t=e.lineText.match(/^#(\w+)/)[1];if("endif"===t){if(e.forward&&0===e.depth)return!0;e.depth++}else if("if"===t){if(!e.forward&&0===e.depth)return!0;e.depth--}if("else"===t&&0===e.depth)return!0}return!1}}};function me(e,t,i,n,o){var s=t.line,l=t.ch,h=e.getLine(s),d=i?1:-1,c=n?a:r;if(o&&""==h){if(s+=d,h=e.getLine(s),!m(e,s))return null;l=i?0:h.length}for(;;){if(o&&""==h)return{from:0,to:0,line:s};for(var u=d>0?h.length:-1,g=u,p=u;l!=u;){for(var f=!1,_=0;_<c.length&&!f;++_)if(c[_](h.charAt(l))){for(g=l;l!=u&&c[_](h.charAt(l));)l+=d;if(f=g!=(p=l),g==t.ch&&s==t.line&&p==g+d)continue;return{from:Math.min(g,p+1),to:Math.max(g,p),line:s}}f||(l+=d)}if(!m(e,s+=d))return null;h=e.getLine(s),l=d>0?0:h.length}}function fe(e,t,i,n,o){var s=new HGe(t.line+i.repeat-1,1/0),r=e.clipPos(s);return r.ch--,o||(n.lastHPos=1/0,n.lastHSPos=e.charCoords(r,"div").left),s}function _e(e,t,i,n){for(var o,s=e.getCursor(),r=s.ch,a=0;a<t;a++){if(-1==(o=be(r,e.getLine(s.line),n,i,!0)))return null;r=o}return new HGe(e.getCursor().line,o)}function ve(e,t,i,n){w(i,g)&&(t.marks[i]&&t.marks[i].clear(),t.marks[i]=e.setBookmark(n))}function be(e,t,i,n,o){var s;return n?-1==(s=t.indexOf(i,e+1))||o||(s-=1):-1==(s=t.lastIndexOf(i,e-1))||o||(s+=1),s}function we(e,t,i,n,o){var s,r=t.line,a=e.firstLine(),l=e.lastLine(),h=r;function d(t){return!e.getLine(t)}function c(e,t,i){return i?d(e)!=d(e+t):!d(e)&&d(e+t)}if(n){for(;a<=h&&h<=l&&i>0;)c(h,n)&&i--,h+=n;return new HGe(h,0)}var u=e.state.vim;if(u.visualLine&&c(r,1,!0)){var g=u.sel.anchor;c(g.line,-1,!0)&&(o&&g.line==r||(r+=1))}var p=d(r);for(h=r;h<=l&&i;h++)c(h,1,!0)&&(o&&d(h)==p||i--);for(s=new HGe(h,0),h>l&&!p?p=!0:o=!1,h=r;h>a&&(o&&d(h)!=p&&h!=r||!c(h,-1,!0));h--);return{start:new HGe(h,0),end:s}}function Ce(){}function ye(e){var t=e.state.vim;return t.searchState_||(t.searchState_=new Ce)}function Se(e,t){var i=ke(e,t)||[];if(!i.length)return[];var n=[];if(0===i[0]){for(var o=0;o<i.length;o++)"number"==typeof i[o]&&n.push(e.substring(i[o]+1,i[o+1]));return n}}function ke(e,t){t||(t="/");for(var i=!1,n=[],o=0;o<e.length;o++){var s=e.charAt(o);i||s!=t||n.push(o),i=!i&&"\\"==s}return n}y("pcre",!0,"boolean"),Ce.prototype={getQuery:function(){return L.query},setQuery:function(e){L.query=e},getOverlay:function(){return this.searchOverlay},setOverlay:function(e){this.searchOverlay=e},isReversed:function(){return L.isReversed},setReversed:function(e){L.isReversed=e},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(e){this.annotate=e}};var Le={"\\n":"\n","\\r":"\r","\\t":"\t"},xe={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":"\t","\\&":"&"};function De(e){"string"==typeof e&&(e=document.createElement(e));for(var t,i=1;i<arguments.length;i++)if(t=arguments[i])if("object"!=typeof t&&(t=document.createTextNode(t)),t.nodeType)e.appendChild(t);else for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&("$"===n[0]?e.style[n.slice(1)]=t[n]:e.setAttribute(n,t[n]));return e}function Ee(e,t){var i=De("pre",{$color:"red",class:"cm-vim-message"},t);e.openNotification?e.openNotification(i,{bottom:!0,duration:5e3}):alert(i.innerText)}function Ne(e,t){var i,n,o=(i=t.prefix,n=t.desc,De(document.createDocumentFragment(),De("span",{$fontFamily:"monospace",$whiteSpace:"pre"},i,De("input",{type:"text",autocorrect:"off",autocapitalize:"off",spellcheck:"false"})),n&&De("span",{$color:"#888"},n)));if(e.openDialog)e.openDialog(o,t.onClose,{onKeyDown:t.onKeyDown,onKeyUp:t.onKeyUp,bottom:!0,selectValueOnOpen:!1,value:t.value});else{var s="";"string"!=typeof t.prefix&&t.prefix&&(s+=t.prefix.textContent),t.desc&&(s+=" "+t.desc),t.onClose(prompt(s,""))}}function Ie(e,t,i,n){if(t){var o=ye(e),s=function(e,t,i){if(L.registerController.getRegister("/").setText(e),e instanceof RegExp)return e;var n,o,s=ke(e,"/");return s.length?(n=e.substring(0,s[0]),o=-1!=e.substring(s[0]).indexOf("i")):n=e,n?(k("pcre")||(n=function(e){for(var t=!1,i=[],n=-1;n<e.length;n++){var o=e.charAt(n)||"",s=e.charAt(n+1)||"",r=s&&-1!="|(){".indexOf(s);t?("\\"===o&&r||i.push(o),t=!1):"\\"===o?(t=!0,s&&-1!="}".indexOf(s)&&(r=!0),r&&"\\"!==s||i.push(o)):(i.push(o),r&&"\\"!==s&&i.push("\\"))}return i.join("")}(n)),i&&(t=/^[^A-Z]*$/.test(n)),new RegExp(n,t||o?"im":"m")):null}(t,!!i,!!n);if(s)return Te(e,s),function(e,t){if(e instanceof RegExp&&t instanceof RegExp){for(var i=["global","multiline","ignoreCase","source"],n=0;n<i.length;n++){var o=i[n];if(e[o]!==t[o])return!1}return!0}return!1}(s,o.getQuery())||o.setQuery(s),s}}var Me=0;function Te(e,t){clearTimeout(Me),Me=setTimeout((function(){if(e.state.vim){var i=ye(e),n=i.getOverlay();n&&t==n.query||(n&&e.removeOverlay(n),n=function(e){if("^"==e.source.charAt(0))var t=!0;return{token:function(i){if(!t||i.sol()){var n=i.match(e,!1);if(n)return 0==n[0].length?(i.next(),"searching"):i.sol()||(i.backUp(1),e.exec(i.next()+n[0]))?(i.match(e),"searching"):(i.next(),null);for(;!i.eol()&&(i.next(),!i.match(e,!1)););}else i.skipToEnd()},query:e}}(t),e.addOverlay(n),e.showMatchesOnScrollbar&&(i.getScrollbarAnnotate()&&i.getScrollbarAnnotate().clear(),i.setScrollbarAnnotate(e.showMatchesOnScrollbar(t))),i.setOverlay(n))}}),50)}function Ae(e,t,i,n){return void 0===n&&(n=1),e.operation((function(){for(var o=e.getCursor(),s=e.getSearchCursor(i,o),r=0;r<n;r++){var a=s.find(t);if(0==r&&a&&Z(s.from(),o)){var l=t?s.from():s.to();(a=s.find(t))&&!a[0]&&Z(s.from(),l)&&e.getLine(l.line).length==l.ch&&(a=s.find(t))}if(!a&&!(s=e.getSearchCursor(i,t?new HGe(e.lastLine()):new HGe(e.firstLine(),0))).find(t))return}return s.from()}))}function Re(e){var t=ye(e);e.removeOverlay(ye(e).getOverlay()),t.setOverlay(null),t.getScrollbarAnnotate()&&(t.getScrollbarAnnotate().clear(),t.setScrollbarAnnotate(null))}function Oe(e){var t=e.getScrollInfo(),i=e.coordsChar({left:0,top:6+t.top},"local"),n=t.clientHeight-10+t.top,o=e.coordsChar({left:0,top:n},"local");return{top:i.line,bottom:o.line}}function Pe(e,t,i){if("'"==i||"`"==i)return L.jumpList.find(e,-1)||new HGe(0,0);if("."==i)return Fe(e);var n=t.marks[i];return n&&n.find()}function Fe(e){for(var t=e.doc.history.done,i=t.length;i--;)if(t[i].changes)return G(t[i].changes[0].to)}var Be=function(){this.buildCommandMap_()};Be.prototype={processCommand:function(e,t,i){var n=this;e.operation((function(){e.curOp.isVimOp=!0,n._processCommand(e,t,i),e.curOp.isVimOp=!1}))},_processCommand:function(e,t,i){var n=e.state.vim,o=L.registerController.getRegister(":"),s=o.toString();n.visualMode&&le(e);var r=new zGe.StringStream(t);o.setText(t);var a,l,h=i||{};h.input=t;try{this.parseInput_(e,r,h)}catch(t){throw Ee(e,t.toString()),t}if(h.commandName){if(a=this.matchCommand_(h.commandName)){if(l=a.name,a.excludeFromCommandHistory&&o.setText(s),this.parseCommandArgs_(r,h,a),"exToKey"==a.type){for(var d=0;d<a.toKeys.length;d++)T.handleKey(e,a.toKeys[d],"mapping");return}if("exToEx"==a.type)return void this.processCommand(e,a.toInput)}}else void 0!==h.line&&(l="move");if(l)try{We[l](e,h),a&&a.possiblyAsync||!h.callback||h.callback()}catch(t){throw Ee(e,t.toString()),t}else Ee(e,'Not an editor command ":'+t+'"')},parseInput_:function(e,t,i){t.eatWhile(":"),t.eat("%")?(i.line=e.firstLine(),i.lineEnd=e.lastLine()):(i.line=this.parseLineSpec_(e,t),void 0!==i.line&&t.eat(",")&&(i.lineEnd=this.parseLineSpec_(e,t)));var n=t.match(/^(\w+|!!|@@|[!#&*<=>@~])/);return i.commandName=n?n[1]:t.match(/.*/)[0],i},parseLineSpec_:function(e,t){var i=t.match(/^(\d+)/);if(i)return parseInt(i[1],10)-1;switch(t.next()){case".":return this.parseLineSpecOffset_(t,e.getCursor().line);case"$":return this.parseLineSpecOffset_(t,e.lastLine());case"'":var n=t.next(),o=Pe(e,e.state.vim,n);if(!o)throw new Error("Mark not set");return this.parseLineSpecOffset_(t,o.line);case"-":case"+":return t.backUp(1),this.parseLineSpecOffset_(t,e.getCursor().line);default:return void t.backUp(1)}},parseLineSpecOffset_:function(e,t){var i=e.match(/^([+-])?(\d+)/);if(i){var n=parseInt(i[2],10);"-"==i[1]?t-=n:t+=n}return t},parseCommandArgs_:function(e,t,i){if(!e.eol()){t.argString=e.match(/.*/)[0];var n=i.argDelimiter||/\s+/,o=te(t.argString).split(n);o.length&&o[0]&&(t.args=o)}},matchCommand_:function(e){for(var t=e.length;t>0;t--){var i=e.substring(0,t);if(this.commandMap_[i]){var n=this.commandMap_[i];if(0===n.name.indexOf(e))return n}}return null},buildCommandMap_:function(){this.commandMap_={};for(var e=0;e<qGe.length;e++){var t=qGe[e],i=t.shortName||t.name;this.commandMap_[i]=t}},map:function(e,t,i){if(":"!=e&&":"==e.charAt(0)){if(i)throw Error("Mode not supported for ex mappings");var n=e.substring(1);":"!=t&&":"==t.charAt(0)?this.commandMap_[n]={name:n,type:"exToEx",toInput:t.substring(1),user:!0}:this.commandMap_[n]={name:n,type:"exToKey",toKeys:t,user:!0}}else if(":"!=t&&":"==t.charAt(0)){var o={keys:e,type:"keyToEx",exArgs:{input:t.substring(1)}};i&&(o.context=i),KGe.unshift(o)}else o={keys:e,type:"keyToKey",toKeys:t},i&&(o.context=i),KGe.unshift(o)},unmap:function(e,t){if(":"!=e&&":"==e.charAt(0)){if(t)throw Error("Mode not supported for ex mappings");var i=e.substring(1);if(this.commandMap_[i]&&this.commandMap_[i].user)return delete this.commandMap_[i],!0}else for(var n=e,o=0;o<KGe.length;o++)if(n==KGe[o].keys&&KGe[o].context===t)return KGe.splice(o,1),!0}};var We={colorscheme:function(e,t){!t.args||t.args.length<1?Ee(e,e.getOption("theme")):e.setOption("theme",t.args[0])},map:function(e,t,i){var n=t.args;!n||n.length<2?e&&Ee(e,"Invalid mapping: "+t.input):Ve.map(n[0],n[1],i)},imap:function(e,t){this.map(e,t,"insert")},nmap:function(e,t){this.map(e,t,"normal")},vmap:function(e,t){this.map(e,t,"visual")},unmap:function(e,t,i){var n=t.args;(!n||n.length<1||!Ve.unmap(n[0],i))&&e&&Ee(e,"No such mapping: "+t.input)},move:function(e,t){B.processCommand(e,e.state.vim,{type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:t.line+1})},set:function(e,t){var i=t.args,n=t.setCfg||{};if(!i||i.length<1)e&&Ee(e,"Invalid mapping: "+t.input);else{var o=i[0].split("="),s=o[0],r=o[1],a=!1;if("?"==s.charAt(s.length-1)){if(r)throw Error("Trailing characters: "+t.argString);s=s.substring(0,s.length-1),a=!0}void 0===r&&"no"==s.substring(0,2)&&(s=s.substring(2),r=!1);var l=C[s]&&"boolean"==C[s].type;if(l&&null==r&&(r=!0),!l&&void 0===r||a){var h=k(s,e,n);h instanceof Error?Ee(e,h.message):Ee(e,!0===h||!1===h?" "+(h?"":"no")+s:" "+s+"="+h)}else{var d=S(s,r,e,n);d instanceof Error&&Ee(e,d.message)}}},setlocal:function(e,t){t.setCfg={scope:"local"},this.set(e,t)},setglobal:function(e,t){t.setCfg={scope:"global"},this.set(e,t)},registers:function(e,t){var i=t.args,n=L.registerController.registers,o="----------Registers----------\n\n";if(i){i=i.join("");for(var s=0;s<i.length;s++)r=i.charAt(s),L.registerController.isValidRegister(r)&&(o+='"'+r+" "+(n[r]||new O).toString()+"\n")}else for(var r in n){var a=n[r].toString();a.length&&(o+='"'+r+" "+a+"\n")}Ee(e,o)},sort:function(e,t){var i,n,o,s,r,a=function(){if(t.argString){var e=new zGe.StringStream(t.argString);if(e.eat("!")&&(i=!0),e.eol())return;if(!e.eatSpace())return"Invalid arguments";var a=e.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!a&&!e.eol())return"Invalid arguments";if(a[1]){n=-1!=a[1].indexOf("i"),o=-1!=a[1].indexOf("u");var l=-1!=a[1].indexOf("d")||-1!=a[1].indexOf("n")&&1,h=-1!=a[1].indexOf("x")&&1,d=-1!=a[1].indexOf("o")&&1;if(l+h+d>1)return"Invalid arguments";s=(l?"decimal":h&&"hex")||d&&"octal"}a[2]&&(r=new RegExp(a[2].substr(1,a[2].length-2),n?"i":""))}}();if(a)Ee(e,a+": "+t.argString);else{var l=t.line||e.firstLine(),h=t.lineEnd||t.line||e.lastLine();if(l!=h){var d=new HGe(l,0),c=new HGe(h,ee(e,h)),u=e.getRange(d,c).split("\n"),g=r||("decimal"==s?/(-?)([\d]+)/:"hex"==s?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==s?/([0-7]+)/:null),p="decimal"==s?10:"hex"==s?16:"octal"==s?8:null,m=[],f=[];if(s||r)for(var _=0;_<u.length;_++){var v=r?u[_].match(r):null;v&&""!=v[0]?m.push(v):!r&&g.exec(u[_])?m.push(u[_]):f.push(u[_])}else f=u;if(m.sort(r?function(e,t){var o;return i&&(o=e,e=t,t=o),n&&(e[0]=e[0].toLowerCase(),t[0]=t[0].toLowerCase()),e[0]<t[0]?-1:1}:C),r)for(_=0;_<m.length;_++)m[_]=m[_].input;else s||f.sort(C);if(u=i?m.concat(f):f.concat(m),o){var b,w=u;for(u=[],_=0;_<w.length;_++)w[_]!=b&&u.push(w[_]),b=w[_]}e.replaceRange(u.join("\n"),d,c)}}function C(e,t){var o;i&&(o=e,e=t,t=o),n&&(e=e.toLowerCase(),t=t.toLowerCase());var r=s&&g.exec(e),a=s&&g.exec(t);return r?(r=parseInt((r[1]+r[2]).toLowerCase(),p))-(a=parseInt((a[1]+a[2]).toLowerCase(),p)):e<t?-1:1}},vglobal:function(e,t){this.global(e,t)},global:function(e,t){var i=t.argString;if(i){var n,o="v"===t.commandName[0],s=void 0!==t.line?t.line:e.firstLine(),r=t.lineEnd||t.line||e.lastLine(),a=function(e){return Se(e,"/")}(i),l=i;if(a.length&&(l=a[0],n=a.slice(1,a.length).join("/")),l)try{Ie(e,l,!0,!0)}catch(t){return void Ee(e,"Invalid regex: "+l)}for(var h=ye(e).getQuery(),d=[],c=s;c<=r;c++){var u=e.getLineHandle(c);h.test(u.text)!==o&&d.push(n?u:u.text)}if(n){var g=0,p=function(){if(g<d.length){var t=d[g++],i=e.getLineNumber(t);if(null==i)return void p();var o=i+1+n;Ve.processCommand(e,o,{callback:p})}};p()}else Ee(e,d.join("\n"))}else Ee(e,"Regular Expression missing from global")},substitute:function(e,t){if(!e.getSearchCursor)throw new Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var i,n,o,r,a=t.argString,l=a?Se(a,a[0]):[],h="",d=!1,c=!1;if(l.length)i=l[0],k("pcre")&&""!==i&&(i=new RegExp(i).source),void 0!==(h=l[1])&&(h=k("pcre")?function(e){for(var t=new zGe.StringStream(e),i=[];!t.eol();){for(;t.peek()&&"\\"!=t.peek();)i.push(t.next());var n=!1;for(var o in xe)if(t.match(o,!0)){n=!0,i.push(xe[o]);break}n||i.push(t.next())}return i.join("")}(h.replace(/([^\\])&/g,"$1$$&")):function(e){for(var t,i=!1,n=[],o=-1;o<e.length;o++){var r=e.charAt(o)||"",a=e.charAt(o+1)||"";Le[r+a]?(n.push(Le[r+a]),o++):i?(n.push(r),i=!1):"\\"===r?(i=!0,t=a,s.test(t)||"$"===a?n.push("$"):"/"!==a&&"\\"!==a&&n.push("\\")):("$"===r&&n.push("$"),n.push(r),"/"===a&&n.push("\\"))}return n.join("")}(h),L.lastSubstituteReplacePart=h),n=l[2]?l[2].split(" "):[];else if(a&&a.length)return void Ee(e,"Substitutions should be of the form :s/pattern/replace/");if(n&&(o=n[0],r=parseInt(n[1]),o&&(-1!=o.indexOf("c")&&(d=!0),-1!=o.indexOf("g")&&(c=!0),i=k("pcre")?i+"/"+o:i.replace(/\//g,"\\/")+"/"+o)),i)try{Ie(e,i,!0,!0)}catch(t){return void Ee(e,"Invalid regex: "+i)}if(void 0!==(h=h||L.lastSubstituteReplacePart)){var u=ye(e).getQuery(),g=void 0!==t.line?t.line:e.getCursor().line,p=t.lineEnd||g;g==e.firstLine()&&p==e.lastLine()&&(p=1/0),r&&(p=(g=p)+r-1);var m=U(e,new HGe(g,0)),f=e.getSearchCursor(u,m);e.pushUndoStop(),function(e,t,i,n,o,s,r,a,l){e.state.vim.exMode=!0;var h,d,c,u=!1;function g(){e.operation((function(){for(;!u;)p(),m();f()}))}function p(){var t=e.getRange(s.from(),s.to()).replace(r,a),i=s.to().line;s.replace(t),d=s.to().line,o+=d-i,c=d<i}function m(){for(;l=void 0,g=void 0,l=h&&G(s.to()),(g=s.findNext())&&!g[0]&&l&&Z(s.from(),l)&&(g=s.findNext()),g&&(t=s.from(),r=n,a=o,"number"!=typeof t&&(t=t.line),r instanceof Array?w(t,r):"number"==typeof a?t>=r&&t<=a:t==r);)if(i||s.from().line!=d||c)return e.scrollIntoView(s.from(),30),e.setSelection(s.from(),s.to()),h=s.from(),void(u=!1);var t,r,a,l,g;u=!0}function f(t){if(t&&t(),e.focus(),h){e.setCursor(h);var i=e.state.vim;i.exMode=!1,i.lastHPos=i.lastHSPos=h.ch}l&&l()}if(m(),!u)return t?void Ne(e,{prefix:De("span","replace with ",De("strong",a)," (y/n/a/q/l)"),onKeyDown:function(t,i,n){switch(zGe.e_stop(t),zGe.keyName(t)){case"Y":p(),m();break;case"N":m();break;case"A":var o=l;l=void 0,e.operation(g),l=o;break;case"L":p();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":f(n)}return u&&f(n),!0}}):(g(),void(l&&l()));Ee(e,"No matches for "+r.source)}(e,d,c,g,p,f,u,h,t.callback)}else Ee(e,"No previous substitute regular expression")},redo:zGe.commands.redo,undo:zGe.commands.undo,write:function(e){zGe.commands.save?zGe.commands.save(e):e.save&&e.save()},nohlsearch:function(e){Re(e)},yank:function(e){var t=G(e.getCursor()).line,i=e.getLine(t);L.registerController.pushText("0","yank",i,!0,!0)},delmarks:function(e,t){if(t.argString&&te(t.argString))for(var i=e.state.vim,n=new zGe.StringStream(te(t.argString));!n.eol();){n.eatSpace();var o=n.pos;if(!n.match(/[a-zA-Z]/,!1))return void Ee(e,"Invalid argument: "+t.argString.substring(o));var s=n.next();if(n.match("-",!0)){if(!n.match(/[a-zA-Z]/,!1))return void Ee(e,"Invalid argument: "+t.argString.substring(o));var r=s,a=n.next();if(!(f(r)&&f(a)||_(r)&&_(a)))return void Ee(e,"Invalid argument: "+r+"-");var l=r.charCodeAt(0),h=a.charCodeAt(0);if(l>=h)return void Ee(e,"Invalid argument: "+t.argString.substring(o));for(var d=0;d<=h-l;d++){var c=String.fromCharCode(l+d);delete i.marks[c]}}else delete i.marks[s]}else Ee(e,"Argument required")}},Ve=new Be;function ze(e){var t=e.state.vim,i=L.macroModeState,n=L.registerController.getRegister("."),o=i.isPlaying,s=i.lastInsertModeChanges;o||(e.off("change",Ke),zGe.off(e.getInputField(),"keydown",$e)),!o&&t.insertModeRepeat>1&&(Ge(e,t,t.insertModeRepeat-1,!0),t.lastEditInputState.repeatOverride=t.insertModeRepeat),delete t.insertModeRepeat,t.insertMode=!1,e.setCursor(e.getCursor().line,e.getCursor().ch-1),e.setOption("keyMap","vim"),e.setOption("disableInput",!0),e.toggleOverwrite(!1),n.setText(s.changes.join("")),zGe.signal(e,"vim-mode-change",{mode:"normal"}),i.isRecording&&function(e){if(!e.isPlaying){var t=e.latestRegister,i=L.registerController.getRegister(t);i&&i.pushInsertModeChanges&&i.pushInsertModeChanges(e.lastInsertModeChanges)}}(i),e.enterVimMode()}function He(e){KGe.unshift(e)}function Ue(e,t,i,n){var o=L.registerController.getRegister(n);if(":"==n)return o.keyBuffer[0]&&Ve.processCommand(e,o.keyBuffer[0]),void(i.isPlaying=!1);var s=o.keyBuffer,r=0;i.isPlaying=!0,i.replaySearchQueries=o.searchQueries.slice(0);for(var a=0;a<s.length;a++)for(var l,h,d=s[a];d;)if(h=(l=/<\w+-.+?>|<\w+>|./.exec(d))[0],d=d.substring(l.index+h.length),T.handleKey(e,h,"macro"),t.insertMode){var c=o.insertModeChanges[r++].changes;L.macroModeState.lastInsertModeChanges.changes=c,Ze(e,c,1),ze(e)}i.isPlaying=!1}function Ke(e,t){var i=L.macroModeState,n=i.lastInsertModeChanges;if(!i.isPlaying)for(;t;){if(n.expectCursorActivityForChange=!0,n.ignoreCount>1)n.ignoreCount--;else if("+input"==t.origin||"paste"==t.origin||void 0===t.origin){var o=e.listSelections().length;o>1&&(n.ignoreCount=o);var s=t.text.join("\n");n.maybeReset&&(n.changes=[],n.maybeReset=!1),s&&(e.state.overwrite&&!/\n/.test(s)?n.changes.push([s]):n.changes.push(s))}t=t.next}}function je(e){var t=e.state.vim;if(t.insertMode){var i=L.macroModeState;if(i.isPlaying)return;var n=i.lastInsertModeChanges;n.expectCursorActivityForChange?n.expectCursorActivityForChange=!1:n.maybeReset=!0}else e.curOp.isVimOp||function(e,t){var i=e.getCursor("anchor"),n=e.getCursor("head");t.visualMode&&!e.somethingSelected()?le(e,!1):t.visualMode||t.insertMode||!e.somethingSelected()||(t.visualMode=!0,t.visualLine=!1,zGe.signal(e,"vim-mode-change",{mode:"visual"})),t.visualMode?(t.sel={anchor:i,head:n},ve(e,t,"<",Q(n,i)),ve(e,t,">",X(n,i))):t.insertMode||(t.lastHPos=e.getCursor().ch)}(e,t)}function qe(e){this.keyName=e}function $e(e){var t=L.macroModeState.lastInsertModeChanges,i=zGe.keyName(e);i&&(-1==i.indexOf("Delete")&&-1==i.indexOf("Backspace")||zGe.lookupKey(i,"vim-insert",(function(){return t.maybeReset&&(t.changes=[],t.maybeReset=!1),t.changes.push(new qe(i)),!0})))}function Ge(e,t,i,n){var o=L.macroModeState;o.isPlaying=!0;var s=!!t.lastEditActionCommand,r=t.inputState;function a(){s?B.processAction(e,t,t.lastEditActionCommand):B.evalInput(e,t)}function l(i){if(o.lastInsertModeChanges.changes.length>0){i=t.lastEditActionCommand?i:1;var n=o.lastInsertModeChanges;Ze(e,n.changes,i)}}if(t.inputState=t.lastEditInputState,s&&t.lastEditActionCommand.interlaceInsertRepeat)for(var h=0;h<i;h++)a(),l(1);else n||a(),l(i);t.inputState=r,t.insertMode&&!n&&ze(e),o.isPlaying=!1}function Ze(e,t,i){function n(t){return"string"==typeof t?zGe.commands[t](e):t(e),!0}var o=e.getCursor("head"),s=L.macroModeState.lastInsertModeChanges.visualBlock;s&&(oe(e,o,s+1),i=e.listSelections().length,e.setCursor(o));for(var r=0;r<i;r++){s&&e.setCursor(j(o,r,0));for(var a=0;a<t.length;a++){var l=t[a];if(l instanceof qe)zGe.lookupKey(l.keyName,"vim-insert",n);else if("string"==typeof l)window.cm=e,e.replaceSelections(l);else{var h=e.getCursor(),d=j(h,0,l[0].length);e.replaceRange(l[0],h,d),e.setCursor(d)}}}s&&e.setCursor(j(o,0,1))}return zGe.keyMap.vim={attach:t,detach:e,call:i},y("insertModeEscKeysTimeout",200,"number"),zGe.keyMap["vim-insert"]={fallthrough:["default"],attach:t,detach:e,call:i},zGe.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:t,detach:e,call:i},M(),T}();const $Ge=zGe;class GGe{constructor(e,t,i=null){this.node=e,this.modeInfoNode=document.createElement("span"),this.secInfoNode=document.createElement("span"),this.notifNode=document.createElement("span"),this.notifNode.className="vim-notification",this.keyInfoNode=document.createElement("span"),this.keyInfoNode.setAttribute("style","float: right"),this.node.appendChild(this.modeInfoNode),this.node.appendChild(this.secInfoNode),this.node.appendChild(this.notifNode),this.node.appendChild(this.keyInfoNode),this.toggleVisibility(!1),this.editor=t,this.sanitizer=i}setMode(e){"visual"!==e.mode?this.setText(`--${e.mode.toUpperCase()}--`):"linewise"===e.subMode?this.setText("--VISUAL LINE--"):"blockwise"===e.subMode?this.setText("--VISUAL BLOCK--"):this.setText("--VISUAL--")}setKeyBuffer(e){this.keyInfoNode.textContent=e}setSec(e,t,i){if(this.notifNode.textContent="",void 0===e)return this.closeInput;this.setInnerHtml_(this.secInfoNode,e);const n=this.secInfoNode.querySelector("input");return n&&(n.focus(),this.input={callback:t,options:i,node:n},i&&(i.selectValueOnOpen&&n.select(),i.value&&(n.value=i.value)),this.addInputListeners()),this.closeInput}setText(e){this.modeInfoNode.textContent=e}toggleVisibility(e){this.node.style.display=e?"block":"none",this.input&&this.removeInputListeners(),clearInterval(this.notifTimeout)}closeInput=()=>{this.removeInputListeners(),this.input=null,this.setSec(""),this.editor&&this.editor.focus()};clear=()=>{this.setInnerHtml_(this.node,"")};inputKeyUp=e=>{const{options:t}=this.input;t&&t.onKeyUp&&t.onKeyUp(e,e.target.value,this.closeInput)};inputKeyInput=e=>{const{options:t}=this.input;t&&t.onKeyInput&&t.onKeyUp(e,e.target.value,this.closeInput)};inputBlur=()=>{const{options:e}=this.input;e.closeOnBlur&&this.closeInput()};inputKeyDown=e=>{const{options:t,callback:i}=this.input;t&&t.onKeyDown&&t.onKeyDown(e,e.target.value,this.closeInput)||((27===e.keyCode||t&&!1!==t.closeOnEnter&&13==e.keyCode)&&(this.input.node.blur(),e.stopPropagation(),this.closeInput()),13===e.keyCode&&i&&(e.stopPropagation(),e.preventDefault(),i(e.target.value)))};addInputListeners(){const{node:e}=this.input;e.addEventListener("keyup",this.inputKeyUp),e.addEventListener("keydown",this.inputKeyDown),e.addEventListener("input",this.inputKeyInput),e.addEventListener("blur",this.inputBlur)}removeInputListeners(){if(!this.input||!this.input.node)return;const{node:e}=this.input;e.removeEventListener("keyup",this.inputKeyUp),e.removeEventListener("keydown",this.inputKeyDown),e.removeEventListener("input",this.inputKeyInput),e.removeEventListener("blur",this.inputBlur)}showNotification(e){const t=document.createElement("span");this.setInnerHtml_(t,e),this.notifNode.textContent=t.textContent,this.notifTimeout=setTimeout((()=>{this.notifNode.textContent=""}),5e3)}setInnerHtml_(e,t){for(;e.childNodes.length;)e.removeChild(e.childNodes[0]);t&&(this.sanitizer?e.appendChild(this.sanitizer(t)):e.appendChild(t))}}function ZGe(e,t=null,i=GGe,n=null){const o=new $Ge(e);if(!t)return o.attach(),o;const s=new i(t,e,n);let r="";return o.on("vim-mode-change",(e=>{s.setMode(e)})),o.on("vim-keypress",(e=>{":"===e?r="":r+=e,s.setKeyBuffer(r)})),o.on("vim-command-done",(()=>{r="",s.setKeyBuffer(r)})),o.on("dispose",(function(){s.toggleVisibility(!1),s.closeInput(),s.clear()})),s.toggleVisibility(!0),o.setStatusBar(s),o.attach(),o}const YGe={comments:{},brackets:[["[","]"],["(",")"]],autoClosingPairs:[{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"}],wordPattern:new RegExp("[^\\s,{}\\[\\]()<>:#]+")},QGe={defaultToken:"",tokenPostfix:".prompt",keywords:["lora","hypernet","AND","BREAK"],brackets:[{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],escapes:/\\./,tokenizer:{root:[[/[a-zA-Z]\w*/,{cases:{"@keywords":"keyword","@default":"identifier"}}],{include:"@whitespace"},{include:"@numbers"},[/[,:]/,"delimiter"],[/[\[\]()<>]/,"@brackets"]],whitespace:[[/\s+/,"white"]],numbers:[[/-?(\d*\.)?\d+/,"number"]]}},XGe=Object.assign({},YGe,{comments:Object.assign({},YGe.comments,{lineComment:"#"}),brackets:YGe.brackets.concat([["{","}"]]),autoClosingPairs:YGe.autoClosingPairs.concat([{open:"{",close:"}"}]),surroundingPairs:YGe.surroundingPairs.concat([{open:"{",close:"}"}])}),JGe=Object.assign({},QGe,{brackets:QGe.brackets.concat([{open:"{",close:"}",token:"delimiter.curly"}]),tokenizer:Object.assign({},QGe.tokenizer,{root:[[/[a-zA-Z]\w*/,{cases:{"@keywords":"keyword","@default":"identifier"}}],{include:"@whitespace"},{include:"@numbers"},[/[,:]/,"delimiter"],[/[{}\[\]()<>]/,"@brackets"]],whitespace:QGe.tokenizer.whitespace.concat([[/(^#.*$)/,"comment"]])})});var eZe="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},tZe=[],iZe=[],nZe="undefined"!=typeof Uint8Array?Uint8Array:Array,oZe=!1;function sZe(){oZe=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)tZe[t]=e[t],iZe[e.charCodeAt(t)]=t;iZe["-".charCodeAt(0)]=62,iZe["_".charCodeAt(0)]=63}function rZe(e,t,i){for(var n,o,s=[],r=t;r<i;r+=3)n=(e[r]<<16)+(e[r+1]<<8)+e[r+2],s.push(tZe[(o=n)>>18&63]+tZe[o>>12&63]+tZe[o>>6&63]+tZe[63&o]);return s.join("")}function aZe(e){var t;oZe||sZe();for(var i=e.length,n=i%3,o="",s=[],r=16383,a=0,l=i-n;a<l;a+=r)s.push(rZe(e,a,a+r>l?l:a+r));return 1===n?(t=e[i-1],o+=tZe[t>>2],o+=tZe[t<<4&63],o+="=="):2===n&&(t=(e[i-2]<<8)+e[i-1],o+=tZe[t>>10],o+=tZe[t>>4&63],o+=tZe[t<<2&63],o+="="),s.push(o),s.join("")}function lZe(e,t,i,n,o){var s,r,a=8*o-n-1,l=(1<<a)-1,h=l>>1,d=-7,c=i?o-1:0,u=i?-1:1,g=e[t+c];for(c+=u,s=g&(1<<-d)-1,g>>=-d,d+=a;d>0;s=256*s+e[t+c],c+=u,d-=8);for(r=s&(1<<-d)-1,s>>=-d,d+=n;d>0;r=256*r+e[t+c],c+=u,d-=8);if(0===s)s=1-h;else{if(s===l)return r?NaN:1/0*(g?-1:1);r+=Math.pow(2,n),s-=h}return(g?-1:1)*r*Math.pow(2,s-n)}function hZe(e,t,i,n,o,s){var r,a,l,h=8*s-o-1,d=(1<<h)-1,c=d>>1,u=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:s-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,r=d):(r=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-r))<1&&(r--,l*=2),(t+=r+c>=1?u/l:u*Math.pow(2,1-c))*l>=2&&(r++,l/=2),r+c>=d?(a=0,r=d):r+c>=1?(a=(t*l-1)*Math.pow(2,o),r+=c):(a=t*Math.pow(2,c-1)*Math.pow(2,o),r=0));o>=8;e[i+g]=255&a,g+=p,a/=256,o-=8);for(r=r<<o|a,h+=o;h>0;e[i+g]=255&r,g+=p,r/=256,h-=8);e[i+g-p]|=128*m}var dZe={}.toString,cZe=Array.isArray||function(e){return"[object Array]"==dZe.call(e)};function uZe(){return pZe.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function gZe(e,t){if(uZe()<t)throw new RangeError("Invalid typed array length");return pZe.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=pZe.prototype:(null===e&&(e=new pZe(t)),e.length=t),e}function pZe(e,t,i){if(!(pZe.TYPED_ARRAY_SUPPORT||this instanceof pZe))return new pZe(e,t,i);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return _Ze(this,e)}return mZe(this,e,t,i)}function mZe(e,t,i,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,i,n){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===i&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,i):new Uint8Array(t,i,n),pZe.TYPED_ARRAY_SUPPORT?(e=t).__proto__=pZe.prototype:e=vZe(e,t),e}(e,t,i,n):"string"==typeof t?function(e,t,i){if("string"==typeof i&&""!==i||(i="utf8"),!pZe.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=0|CZe(t,i),o=(e=gZe(e,n)).write(t,i);return o!==n&&(e=e.slice(0,o)),e}(e,t,i):function(e,t){if(wZe(t)){var i=0|bZe(t.length);return 0===(e=gZe(e,i)).length||t.copy(e,0,0,i),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?gZe(e,0):vZe(e,t);if("Buffer"===t.type&&cZe(t.data))return vZe(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function fZe(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function _Ze(e,t){if(fZe(t),e=gZe(e,t<0?0:0|bZe(t)),!pZe.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function vZe(e,t){var i=t.length<0?0:0|bZe(t.length);e=gZe(e,i);for(var n=0;n<i;n+=1)e[n]=255&t[n];return e}function bZe(e){if(e>=uZe())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+uZe().toString(16)+" bytes");return 0|e}function wZe(e){return!(null==e||!e._isBuffer)}function CZe(e,t){if(wZe(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return $Ze(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return GZe(e).length;default:if(n)return $Ze(e).length;t=(""+t).toLowerCase(),n=!0}}function yZe(e,t,i){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return FZe(this,t,i);case"utf8":case"utf-8":return AZe(this,t,i);case"ascii":return OZe(this,t,i);case"latin1":case"binary":return PZe(this,t,i);case"base64":return TZe(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return BZe(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function SZe(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function kZe(e,t,i,n,o){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=o?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(o)return-1;i=e.length-1}else if(i<0){if(!o)return-1;i=0}if("string"==typeof t&&(t=pZe.from(t,n)),wZe(t))return 0===t.length?-1:LZe(e,t,i,n,o);if("number"==typeof t)return t&=255,pZe.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):LZe(e,[t],i,n,o);throw new TypeError("val must be string, number or Buffer")}function LZe(e,t,i,n,o){var s,r=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;r=2,a/=2,l/=2,i/=2}function h(e,t){return 1===r?e[t]:e.readUInt16BE(t*r)}if(o){var d=-1;for(s=i;s<a;s++)if(h(e,s)===h(t,-1===d?0:s-d)){if(-1===d&&(d=s),s-d+1===l)return d*r}else-1!==d&&(s-=s-d),d=-1}else for(i+l>a&&(i=a-l),s=i;s>=0;s--){for(var c=!0,u=0;u<l;u++)if(h(e,s+u)!==h(t,u)){c=!1;break}if(c)return s}return-1}function xZe(e,t,i,n){i=Number(i)||0;var o=e.length-i;n?(n=Number(n))>o&&(n=o):n=o;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var r=0;r<n;++r){var a=parseInt(t.substr(2*r,2),16);if(isNaN(a))return r;e[i+r]=a}return r}function DZe(e,t,i,n){return ZZe($Ze(t,e.length-i),e,i,n)}function EZe(e,t,i,n){return ZZe(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,n)}function NZe(e,t,i,n){return EZe(e,t,i,n)}function IZe(e,t,i,n){return ZZe(GZe(t),e,i,n)}function MZe(e,t,i,n){return ZZe(function(e,t){for(var i,n,o,s=[],r=0;r<e.length&&!((t-=2)<0);++r)n=(i=e.charCodeAt(r))>>8,o=i%256,s.push(o),s.push(n);return s}(t,e.length-i),e,i,n)}function TZe(e,t,i){return 0===t&&i===e.length?aZe(e):aZe(e.slice(t,i))}function AZe(e,t,i){i=Math.min(e.length,i);for(var n=[],o=t;o<i;){var s,r,a,l,h=e[o],d=null,c=h>239?4:h>223?3:h>191?2:1;if(o+c<=i)switch(c){case 1:h<128&&(d=h);break;case 2:128==(192&(s=e[o+1]))&&(l=(31&h)<<6|63&s)>127&&(d=l);break;case 3:s=e[o+1],r=e[o+2],128==(192&s)&&128==(192&r)&&(l=(15&h)<<12|(63&s)<<6|63&r)>2047&&(l<55296||l>57343)&&(d=l);break;case 4:s=e[o+1],r=e[o+2],a=e[o+3],128==(192&s)&&128==(192&r)&&128==(192&a)&&(l=(15&h)<<18|(63&s)<<12|(63&r)<<6|63&a)>65535&&l<1114112&&(d=l)}null===d?(d=65533,c=1):d>65535&&(d-=65536,n.push(d>>>10&1023|55296),d=56320|1023&d),n.push(d),o+=c}return function(e){var t=e.length;if(t<=RZe)return String.fromCharCode.apply(String,e);for(var i="",n=0;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=RZe));return i}(n)}pZe.TYPED_ARRAY_SUPPORT=void 0===eZe.TYPED_ARRAY_SUPPORT||eZe.TYPED_ARRAY_SUPPORT,uZe(),pZe.poolSize=8192,pZe._augment=function(e){return e.__proto__=pZe.prototype,e},pZe.from=function(e,t,i){return mZe(null,e,t,i)},pZe.TYPED_ARRAY_SUPPORT&&(pZe.prototype.__proto__=Uint8Array.prototype,pZe.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&pZe[Symbol.species]),pZe.alloc=function(e,t,i){return function(e,t,i,n){return fZe(t),t<=0?gZe(e,t):void 0!==i?"string"==typeof n?gZe(e,t).fill(i,n):gZe(e,t).fill(i):gZe(e,t)}(null,e,t,i)},pZe.allocUnsafe=function(e){return _Ze(null,e)},pZe.allocUnsafeSlow=function(e){return _Ze(null,e)},pZe.isBuffer=YZe,pZe.compare=function(e,t){if(!wZe(e)||!wZe(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,n=t.length,o=0,s=Math.min(i,n);o<s;++o)if(e[o]!==t[o]){i=e[o],n=t[o];break}return i<n?-1:n<i?1:0},pZe.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},pZe.concat=function(e,t){if(!cZe(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return pZe.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=pZe.allocUnsafe(t),o=0;for(i=0;i<e.length;++i){var s=e[i];if(!wZe(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,o),o+=s.length}return n},pZe.byteLength=CZe,pZe.prototype._isBuffer=!0,pZe.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)SZe(this,t,t+1);return this},pZe.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)SZe(this,t,t+3),SZe(this,t+1,t+2);return this},pZe.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)SZe(this,t,t+7),SZe(this,t+1,t+6),SZe(this,t+2,t+5),SZe(this,t+3,t+4);return this},pZe.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?AZe(this,0,e):yZe.apply(this,arguments)},pZe.prototype.equals=function(e){if(!wZe(e))throw new TypeError("Argument must be a Buffer");return this===e||0===pZe.compare(this,e)},pZe.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},pZe.prototype.compare=function(e,t,i,n,o){if(!wZe(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||i>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=i)return 0;if(n>=o)return-1;if(t>=i)return 1;if(this===e)return 0;for(var s=(o>>>=0)-(n>>>=0),r=(i>>>=0)-(t>>>=0),a=Math.min(s,r),l=this.slice(n,o),h=e.slice(t,i),d=0;d<a;++d)if(l[d]!==h[d]){s=l[d],r=h[d];break}return s<r?-1:r<s?1:0},pZe.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},pZe.prototype.indexOf=function(e,t,i){return kZe(this,e,t,i,!0)},pZe.prototype.lastIndexOf=function(e,t,i){return kZe(this,e,t,i,!1)},pZe.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)n=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var o=this.length-t;if((void 0===i||i>o)&&(i=o),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return xZe(this,e,t,i);case"utf8":case"utf-8":return DZe(this,e,t,i);case"ascii":return EZe(this,e,t,i);case"latin1":case"binary":return NZe(this,e,t,i);case"base64":return IZe(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return MZe(this,e,t,i);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},pZe.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var RZe=4096;function OZe(e,t,i){var n="";i=Math.min(e.length,i);for(var o=t;o<i;++o)n+=String.fromCharCode(127&e[o]);return n}function PZe(e,t,i){var n="";i=Math.min(e.length,i);for(var o=t;o<i;++o)n+=String.fromCharCode(e[o]);return n}function FZe(e,t,i){var n,o=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>o)&&(i=o);for(var s="",r=t;r<i;++r)s+=(n=e[r])<16?"0"+n.toString(16):n.toString(16);return s}function BZe(e,t,i){for(var n=e.slice(t,i),o="",s=0;s<n.length;s+=2)o+=String.fromCharCode(n[s]+256*n[s+1]);return o}function WZe(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function VZe(e,t,i,n,o,s){if(!wZe(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<s)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}function zZe(e,t,i,n){t<0&&(t=65535+t+1);for(var o=0,s=Math.min(e.length-i,2);o<s;++o)e[i+o]=(t&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function HZe(e,t,i,n){t<0&&(t=4294967295+t+1);for(var o=0,s=Math.min(e.length-i,4);o<s;++o)e[i+o]=t>>>8*(n?o:3-o)&255}function UZe(e,t,i,n,o,s){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function KZe(e,t,i,n,o){return o||UZe(e,0,i,4),hZe(e,t,i,n,23,4),i+4}function jZe(e,t,i,n,o){return o||UZe(e,0,i,8),hZe(e,t,i,n,52,8),i+8}pZe.prototype.slice=function(e,t){var i,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),pZe.TYPED_ARRAY_SUPPORT)(i=this.subarray(e,t)).__proto__=pZe.prototype;else{var o=t-e;i=new pZe(o,void 0);for(var s=0;s<o;++s)i[s]=this[s+e]}return i},pZe.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||WZe(e,t,this.length);for(var n=this[e],o=1,s=0;++s<t&&(o*=256);)n+=this[e+s]*o;return n},pZe.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||WZe(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},pZe.prototype.readUInt8=function(e,t){return t||WZe(e,1,this.length),this[e]},pZe.prototype.readUInt16LE=function(e,t){return t||WZe(e,2,this.length),this[e]|this[e+1]<<8},pZe.prototype.readUInt16BE=function(e,t){return t||WZe(e,2,this.length),this[e]<<8|this[e+1]},pZe.prototype.readUInt32LE=function(e,t){return t||WZe(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},pZe.prototype.readUInt32BE=function(e,t){return t||WZe(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},pZe.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||WZe(e,t,this.length);for(var n=this[e],o=1,s=0;++s<t&&(o*=256);)n+=this[e+s]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},pZe.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||WZe(e,t,this.length);for(var n=t,o=1,s=this[e+--n];n>0&&(o*=256);)s+=this[e+--n]*o;return s>=(o*=128)&&(s-=Math.pow(2,8*t)),s},pZe.prototype.readInt8=function(e,t){return t||WZe(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},pZe.prototype.readInt16LE=function(e,t){t||WZe(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},pZe.prototype.readInt16BE=function(e,t){t||WZe(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},pZe.prototype.readInt32LE=function(e,t){return t||WZe(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},pZe.prototype.readInt32BE=function(e,t){return t||WZe(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},pZe.prototype.readFloatLE=function(e,t){return t||WZe(e,4,this.length),lZe(this,e,!0,23,4)},pZe.prototype.readFloatBE=function(e,t){return t||WZe(e,4,this.length),lZe(this,e,!1,23,4)},pZe.prototype.readDoubleLE=function(e,t){return t||WZe(e,8,this.length),lZe(this,e,!0,52,8)},pZe.prototype.readDoubleBE=function(e,t){return t||WZe(e,8,this.length),lZe(this,e,!1,52,8)},pZe.prototype.writeUIntLE=function(e,t,i,n){e=+e,t|=0,i|=0,n||VZe(this,e,t,i,Math.pow(2,8*i)-1,0);var o=1,s=0;for(this[t]=255&e;++s<i&&(o*=256);)this[t+s]=e/o&255;return t+i},pZe.prototype.writeUIntBE=function(e,t,i,n){e=+e,t|=0,i|=0,n||VZe(this,e,t,i,Math.pow(2,8*i)-1,0);var o=i-1,s=1;for(this[t+o]=255&e;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+i},pZe.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||VZe(this,e,t,1,255,0),pZe.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},pZe.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||VZe(this,e,t,2,65535,0),pZe.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):zZe(this,e,t,!0),t+2},pZe.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||VZe(this,e,t,2,65535,0),pZe.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):zZe(this,e,t,!1),t+2},pZe.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||VZe(this,e,t,4,4294967295,0),pZe.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):HZe(this,e,t,!0),t+4},pZe.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||VZe(this,e,t,4,4294967295,0),pZe.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):HZe(this,e,t,!1),t+4},pZe.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*i-1);VZe(this,e,t,i,o-1,-o)}var s=0,r=1,a=0;for(this[t]=255&e;++s<i&&(r*=256);)e<0&&0===a&&0!==this[t+s-1]&&(a=1),this[t+s]=(e/r>>0)-a&255;return t+i},pZe.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*i-1);VZe(this,e,t,i,o-1,-o)}var s=i-1,r=1,a=0;for(this[t+s]=255&e;--s>=0&&(r*=256);)e<0&&0===a&&0!==this[t+s+1]&&(a=1),this[t+s]=(e/r>>0)-a&255;return t+i},pZe.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||VZe(this,e,t,1,127,-128),pZe.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},pZe.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||VZe(this,e,t,2,32767,-32768),pZe.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):zZe(this,e,t,!0),t+2},pZe.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||VZe(this,e,t,2,32767,-32768),pZe.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):zZe(this,e,t,!1),t+2},pZe.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||VZe(this,e,t,4,2147483647,-2147483648),pZe.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):HZe(this,e,t,!0),t+4},pZe.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||VZe(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),pZe.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):HZe(this,e,t,!1),t+4},pZe.prototype.writeFloatLE=function(e,t,i){return KZe(this,e,t,!0,i)},pZe.prototype.writeFloatBE=function(e,t,i){return KZe(this,e,t,!1,i)},pZe.prototype.writeDoubleLE=function(e,t,i){return jZe(this,e,t,!0,i)},pZe.prototype.writeDoubleBE=function(e,t,i){return jZe(this,e,t,!1,i)},pZe.prototype.copy=function(e,t,i,n){if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var o,s=n-i;if(this===e&&i<t&&t<n)for(o=s-1;o>=0;--o)e[o+t]=this[o+i];else if(s<1e3||!pZe.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+t]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+s),t);return s},pZe.prototype.fill=function(e,t,i,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!pZe.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var s;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(s=t;s<i;++s)this[s]=e;else{var r=wZe(e)?e:$Ze(new pZe(e,n).toString()),a=r.length;for(s=0;s<i-t;++s)this[s+t]=r[s%a]}return this};var qZe=/[^+\/0-9A-Za-z-_]/g;function $Ze(e,t){var i;t=t||1/0;for(var n=e.length,o=null,s=[],r=0;r<n;++r){if((i=e.charCodeAt(r))>55295&&i<57344){if(!o){if(i>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(r+1===n){(t-=3)>-1&&s.push(239,191,189);continue}o=i;continue}if(i<56320){(t-=3)>-1&&s.push(239,191,189),o=i;continue}i=65536+(o-55296<<10|i-56320)}else o&&(t-=3)>-1&&s.push(239,191,189);if(o=null,i<128){if((t-=1)<0)break;s.push(i)}else if(i<2048){if((t-=2)<0)break;s.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;s.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return s}function GZe(e){return function(e){var t,i,n,o,s,r;oZe||sZe();var a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s="="===e[a-2]?2:"="===e[a-1]?1:0,r=new nZe(3*a/4-s),n=s>0?a-4:a;var l=0;for(t=0,i=0;t<n;t+=4,i+=3)o=iZe[e.charCodeAt(t)]<<18|iZe[e.charCodeAt(t+1)]<<12|iZe[e.charCodeAt(t+2)]<<6|iZe[e.charCodeAt(t+3)],r[l++]=o>>16&255,r[l++]=o>>8&255,r[l++]=255&o;return 2===s?(o=iZe[e.charCodeAt(t)]<<2|iZe[e.charCodeAt(t+1)]>>4,r[l++]=255&o):1===s&&(o=iZe[e.charCodeAt(t)]<<10|iZe[e.charCodeAt(t+1)]<<4|iZe[e.charCodeAt(t+2)]>>2,r[l++]=o>>8&255,r[l++]=255&o),r}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(qZe,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function ZZe(e,t,i,n){for(var o=0;o<n&&!(o+i>=t.length||o>=e.length);++o)t[o+i]=e[o];return o}function YZe(e){return null!=e&&(!!e._isBuffer||QZe(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&QZe(e.slice(0,0))}(e))}function QZe(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}class XZe extends Error{constructor(e,t,i,...n){Array.isArray(t)&&(t=t.join(" ").trim()),super(t),void 0!==Error.captureStackTrace&&Error.captureStackTrace(this,XZe),this.code=e;for(const e of n)for(const t in e){const n=e[t];this[t]=YZe(n)?n.toString(i.encoding):null==n?n:JSON.parse(JSON.stringify(n))}}}const JZe=function(e){const t=[];for(let n=0,o=e.length;n<o;n++){const o=e[n];if(null==o||!1===o)t[n]={disabled:!0};else if("string"==typeof o)t[n]={name:o};else{if("object"!=typeof(i=o)||null===i||Array.isArray(i))throw new XZe("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,",`got ${JSON.stringify(o)} at position ${n}`]);if("string"!=typeof o.name)throw new XZe("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",`property "name" is required at position ${n}`,"when column is an object literal"]);t[n]=o}}var i;return t};class eYe{constructor(e=100){this.size=e,this.length=0,this.buf=pZe.allocUnsafe(e)}prepend(e){if(YZe(e)){const t=this.length+e.length;if(t>=this.size&&(this.resize(),t>=this.size))throw Error("INVALID_BUFFER_STATE");const i=this.buf;this.buf=pZe.allocUnsafe(this.size),e.copy(this.buf,0),i.copy(this.buf,e.length),this.length+=e.length}else{const t=this.length++;t===this.size&&this.resize();const i=this.clone();this.buf[0]=e,i.copy(this.buf,1,0,t)}}append(e){const t=this.length++;t===this.size&&this.resize(),this.buf[t]=e}clone(){return pZe.from(this.buf.slice(0,this.length))}resize(){const e=this.length;this.size=2*this.size;const t=pZe.allocUnsafe(this.size);this.buf.copy(t,0,0,e),this.buf=t}toString(e){return e?this.buf.slice(0,this.length).toString(e):Uint8Array.prototype.slice.call(this.buf.slice(0,this.length))}toJSON(){return this.toString("utf8")}reset(){this.length=0}}const tYe=function(e){return{bomSkipped:!1,bufBytesStart:0,castField:e.cast_function,commenting:!1,error:void 0,enabled:1===e.from_line,escaping:!1,escapeIsQuote:YZe(e.escape)&&YZe(e.quote)&&0===pZe.compare(e.escape,e.quote),expectedRecordLength:Array.isArray(e.columns)?e.columns.length:void 0,field:new eYe(20),firstLineToHeaders:e.cast_first_line_to_header,needMoreDataSize:Math.max(null!==e.comment?e.comment.length:0,...e.delimiter.map((e=>e.length)),null!==e.quote?e.quote.length:0),previousBuf:void 0,quoting:!1,stop:!1,rawBuffer:new eYe(100),record:[],recordHasError:!1,record_length:0,recordDelimiterMaxLength:0===e.record_delimiter.length?0:Math.max(...e.record_delimiter.map((e=>e.length))),trimChars:[pZe.from(" ",e.encoding)[0],pZe.from("\t",e.encoding)[0]],wasQuoting:!1,wasRowDelimiter:!1,timchars:[pZe.from(pZe.from([13],"utf8").toString(),e.encoding),pZe.from(pZe.from([10],"utf8").toString(),e.encoding),pZe.from(pZe.from([12],"utf8").toString(),e.encoding),pZe.from(pZe.from([32],"utf8").toString(),e.encoding),pZe.from(pZe.from([9],"utf8").toString(),e.encoding)]}},iYe=function(e){const t={};for(const n in e)t[(i=n,i.replace(/([A-Z])/g,(function(e,t){return"_"+t.toLowerCase()})))]=e[n];var i;if(void 0===t.encoding||!0===t.encoding)t.encoding="utf8";else if(null===t.encoding||!1===t.encoding)t.encoding=null;else if("string"!=typeof t.encoding&&null!==t.encoding)throw new XZe("CSV_INVALID_OPTION_ENCODING",["Invalid option encoding:","encoding must be a string or null to return a buffer,",`got ${JSON.stringify(t.encoding)}`],t);if(void 0===t.bom||null===t.bom||!1===t.bom)t.bom=!1;else if(!0!==t.bom)throw new XZe("CSV_INVALID_OPTION_BOM",["Invalid option bom:","bom must be true,",`got ${JSON.stringify(t.bom)}`],t);if(t.cast_function=null,void 0===t.cast||null===t.cast||!1===t.cast||""===t.cast)t.cast=void 0;else if("function"==typeof t.cast)t.cast_function=t.cast,t.cast=!0;else if(!0!==t.cast)throw new XZe("CSV_INVALID_OPTION_CAST",["Invalid option cast:","cast must be true or a function,",`got ${JSON.stringify(t.cast)}`],t);if(void 0===t.cast_date||null===t.cast_date||!1===t.cast_date||""===t.cast_date)t.cast_date=!1;else if(!0===t.cast_date)t.cast_date=function(e){const t=Date.parse(e);return isNaN(t)?e:new Date(t)};else if("function"!=typeof t.cast_date)throw new XZe("CSV_INVALID_OPTION_CAST_DATE",["Invalid option cast_date:","cast_date must be true or a function,",`got ${JSON.stringify(t.cast_date)}`],t);if(t.cast_first_line_to_header=null,!0===t.columns)t.cast_first_line_to_header=void 0;else if("function"==typeof t.columns)t.cast_first_line_to_header=t.columns,t.columns=!0;else if(Array.isArray(t.columns))t.columns=JZe(t.columns);else{if(void 0!==t.columns&&null!==t.columns&&!1!==t.columns)throw new XZe("CSV_INVALID_OPTION_COLUMNS",["Invalid option columns:","expect an array, a function or true,",`got ${JSON.stringify(t.columns)}`],t);t.columns=!1}if(void 0===t.group_columns_by_name||null===t.group_columns_by_name||!1===t.group_columns_by_name)t.group_columns_by_name=!1;else{if(!0!==t.group_columns_by_name)throw new XZe("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","expect an boolean,",`got ${JSON.stringify(t.group_columns_by_name)}`],t);if(!1===t.columns)throw new XZe("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","the `columns` mode must be activated."],t)}if(void 0===t.comment||null===t.comment||!1===t.comment||""===t.comment)t.comment=null;else if("string"==typeof t.comment&&(t.comment=pZe.from(t.comment,t.encoding)),!YZe(t.comment))throw new XZe("CSV_INVALID_OPTION_COMMENT",["Invalid option comment:","comment must be a buffer or a string,",`got ${JSON.stringify(t.comment)}`],t);if(void 0===t.comment_no_infix||null===t.comment_no_infix||!1===t.comment_no_infix)t.comment_no_infix=!1;else if(!0!==t.comment_no_infix)throw new XZe("CSV_INVALID_OPTION_COMMENT",["Invalid option comment_no_infix:","value must be a boolean,",`got ${JSON.stringify(t.comment_no_infix)}`],t);const n=JSON.stringify(t.delimiter);if(Array.isArray(t.delimiter)||(t.delimiter=[t.delimiter]),0===t.delimiter.length)throw new XZe("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${n}`],t);if(t.delimiter=t.delimiter.map((function(e){if(null==e||!1===e)return pZe.from(",",t.encoding);if("string"==typeof e&&(e=pZe.from(e,t.encoding)),!YZe(e)||0===e.length)throw new XZe("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${n}`],t);return e})),void 0===t.escape||!0===t.escape?t.escape=pZe.from('"',t.encoding):"string"==typeof t.escape?t.escape=pZe.from(t.escape,t.encoding):null!==t.escape&&!1!==t.escape||(t.escape=null),null!==t.escape&&!YZe(t.escape))throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(t.escape)}`);if(void 0===t.from||null===t.from)t.from=1;else{if("string"==typeof t.from&&/\d+/.test(t.from)&&(t.from=parseInt(t.from)),!Number.isInteger(t.from))throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(t.from)}`);if(t.from<0)throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(e.from)}`)}if(void 0===t.from_line||null===t.from_line)t.from_line=1;else{if("string"==typeof t.from_line&&/\d+/.test(t.from_line)&&(t.from_line=parseInt(t.from_line)),!Number.isInteger(t.from_line))throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(e.from_line)}`);if(t.from_line<=0)throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(e.from_line)}`)}if(void 0===t.ignore_last_delimiters||null===t.ignore_last_delimiters)t.ignore_last_delimiters=!1;else if("number"==typeof t.ignore_last_delimiters)t.ignore_last_delimiters=Math.floor(t.ignore_last_delimiters),0===t.ignore_last_delimiters&&(t.ignore_last_delimiters=!1);else if("boolean"!=typeof t.ignore_last_delimiters)throw new XZe("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",["Invalid option `ignore_last_delimiters`:","the value must be a boolean value or an integer,",`got ${JSON.stringify(t.ignore_last_delimiters)}`],t);if(!0===t.ignore_last_delimiters&&!1===t.columns)throw new XZe("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",["The option `ignore_last_delimiters`","requires the activation of the `columns` option"],t);if(void 0===t.info||null===t.info||!1===t.info)t.info=!1;else if(!0!==t.info)throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(t.info)}`);if(void 0===t.max_record_size||null===t.max_record_size||!1===t.max_record_size)t.max_record_size=0;else if(Number.isInteger(t.max_record_size)&&t.max_record_size>=0);else{if("string"!=typeof t.max_record_size||!/\d+/.test(t.max_record_size))throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(t.max_record_size)}`);t.max_record_size=parseInt(t.max_record_size)}if(void 0===t.objname||null===t.objname||!1===t.objname)t.objname=void 0;else if(YZe(t.objname)){if(0===t.objname.length)throw new Error("Invalid Option: objname must be a non empty buffer");null===t.encoding||(t.objname=t.objname.toString(t.encoding))}else if("string"==typeof t.objname){if(0===t.objname.length)throw new Error("Invalid Option: objname must be a non empty string")}else if("number"!=typeof t.objname)throw new Error(`Invalid Option: objname must be a string or a buffer, got ${t.objname}`);if(void 0!==t.objname)if("number"==typeof t.objname){if(!1!==t.columns)throw Error("Invalid Option: objname index cannot be combined with columns or be defined as a field")}else if(!1===t.columns)throw Error("Invalid Option: objname field must be combined with columns or be defined as an index");if(void 0===t.on_record||null===t.on_record)t.on_record=void 0;else if("function"!=typeof t.on_record)throw new XZe("CSV_INVALID_OPTION_ON_RECORD",["Invalid option `on_record`:","expect a function,",`got ${JSON.stringify(t.on_record)}`],t);if(null===t.quote||!1===t.quote||""===t.quote)t.quote=null;else if(void 0===t.quote||!0===t.quote?t.quote=pZe.from('"',t.encoding):"string"==typeof t.quote&&(t.quote=pZe.from(t.quote,t.encoding)),!YZe(t.quote))throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(t.quote)}`);if(void 0===t.raw||null===t.raw||!1===t.raw)t.raw=!1;else if(!0!==t.raw)throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(t.raw)}`);if(void 0===t.record_delimiter)t.record_delimiter=[];else if("string"==typeof t.record_delimiter||YZe(t.record_delimiter)){if(0===t.record_delimiter.length)throw new XZe("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer,",`got ${JSON.stringify(t.record_delimiter)}`],t);t.record_delimiter=[t.record_delimiter]}else if(!Array.isArray(t.record_delimiter))throw new XZe("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer,",`got ${JSON.stringify(t.record_delimiter)}`],t);if(t.record_delimiter=t.record_delimiter.map((function(e,i){if("string"!=typeof e&&!YZe(e))throw new XZe("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer",`at index ${i},`,`got ${JSON.stringify(e)}`],t);if(0===e.length)throw new XZe("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer",`at index ${i},`,`got ${JSON.stringify(e)}`],t);return"string"==typeof e&&(e=pZe.from(e,t.encoding)),e})),"boolean"==typeof t.relax_column_count);else{if(void 0!==t.relax_column_count&&null!==t.relax_column_count)throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(t.relax_column_count)}`);t.relax_column_count=!1}if("boolean"==typeof t.relax_column_count_less);else{if(void 0!==t.relax_column_count_less&&null!==t.relax_column_count_less)throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(t.relax_column_count_less)}`);t.relax_column_count_less=!1}if("boolean"==typeof t.relax_column_count_more);else{if(void 0!==t.relax_column_count_more&&null!==t.relax_column_count_more)throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(t.relax_column_count_more)}`);t.relax_column_count_more=!1}if("boolean"==typeof t.relax_quotes);else{if(void 0!==t.relax_quotes&&null!==t.relax_quotes)throw new Error(`Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(t.relax_quotes)}`);t.relax_quotes=!1}if("boolean"==typeof t.skip_empty_lines);else{if(void 0!==t.skip_empty_lines&&null!==t.skip_empty_lines)throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(t.skip_empty_lines)}`);t.skip_empty_lines=!1}if("boolean"==typeof t.skip_records_with_empty_values);else{if(void 0!==t.skip_records_with_empty_values&&null!==t.skip_records_with_empty_values)throw new Error(`Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(t.skip_records_with_empty_values)}`);t.skip_records_with_empty_values=!1}if("boolean"==typeof t.skip_records_with_error);else{if(void 0!==t.skip_records_with_error&&null!==t.skip_records_with_error)throw new Error(`Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(t.skip_records_with_error)}`);t.skip_records_with_error=!1}if(void 0===t.rtrim||null===t.rtrim||!1===t.rtrim)t.rtrim=!1;else if(!0!==t.rtrim)throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(t.rtrim)}`);if(void 0===t.ltrim||null===t.ltrim||!1===t.ltrim)t.ltrim=!1;else if(!0!==t.ltrim)throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(t.ltrim)}`);if(void 0===t.trim||null===t.trim||!1===t.trim)t.trim=!1;else if(!0!==t.trim)throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(t.trim)}`);if(!0===t.trim&&!1!==e.ltrim?t.ltrim=!0:!0!==t.ltrim&&(t.ltrim=!1),!0===t.trim&&!1!==e.rtrim?t.rtrim=!0:!0!==t.rtrim&&(t.rtrim=!1),void 0===t.to||null===t.to)t.to=-1;else{if("string"==typeof t.to&&/\d+/.test(t.to)&&(t.to=parseInt(t.to)),!Number.isInteger(t.to))throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(e.to)}`);if(t.to<=0)throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(e.to)}`)}if(void 0===t.to_line||null===t.to_line)t.to_line=-1;else{if("string"==typeof t.to_line&&/\d+/.test(t.to_line)&&(t.to_line=parseInt(t.to_line)),!Number.isInteger(t.to_line))throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(e.to_line)}`);if(t.to_line<=0)throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(e.to_line)}`)}return t},nYe=function(e){return e.every((e=>null==e||e.toString&&""===e.toString().trim()))},oYe={utf8:pZe.from([239,187,191]),utf16le:pZe.from([255,254])},sYe=[],rYe={},aYe={threshold:100,filteredTags:[],isRplaceUnderscore:!1},lYe=()=>aYe.isRplaceUnderscore,hYe=e=>!!isNaN(e.count)||e.count>aYe.threshold,dYe=(e,t,i=!1)=>{rYe[e]&&!i?Array.prototype.push.apply(rYe[e],t):rYe[e]=t.slice()},cYe=e=>{for(const t of function(e,t={}){"string"==typeof e&&(e=pZe.from(e));const i=t&&t.objname?{}:[],n=function(e={}){const t=iYe(e);return{info:{bytes:0,comment_lines:0,empty_lines:0,invalid_field_length:0,lines:1,records:0},original_options:e,options:t,state:tYe(t),__needMoreData:function(e,t,i){if(i)return!1;const{encoding:n,escape:o,quote:s}=this.options,{quoting:r,needMoreDataSize:a,recordDelimiterMaxLength:l}=this.state;return t-e-1<Math.max(a,0===l?pZe.from("\r\n",n).length:l,r?(null===o?0:o.length)+s.length:0,r?s.length+l:0)},parse:function(e,t,i,n){const{bom:o,comment_no_infix:s,encoding:r,from_line:a,ltrim:l,max_record_size:h,raw:d,relax_quotes:c,rtrim:u,skip_empty_lines:g,to:p,to_line:m}=this.options;let{comment:f,escape:_,quote:v,record_delimiter:b}=this.options;const{bomSkipped:w,previousBuf:C,rawBuffer:y,escapeIsQuote:S}=this.state;let k;if(void 0===C){if(void 0===e)return void n();k=e}else k=void 0!==C&&void 0===e?C:pZe.concat([C,e]);if(!1===w)if(!1===o)this.state.bomSkipped=!0;else if(k.length<3){if(!1===t)return void(this.state.previousBuf=k)}else{for(const e in oYe)if(0===oYe[e].compare(k,0,oYe[e].length)){const t=oYe[e].length;this.state.bufBytesStart+=t,k=k.slice(t),this.options=iYe({...this.original_options,encoding:e}),({comment:f,escape:_,quote:v}=this.options);break}this.state.bomSkipped=!0}const L=k.length;let x;for(x=0;x<L&&!this.__needMoreData(x,L,t);x++){if(!0===this.state.wasRowDelimiter&&(this.info.lines++,this.state.wasRowDelimiter=!1),-1!==m&&this.info.lines>m)return this.state.stop=!0,void n();!1===this.state.quoting&&0===b.length&&this.__autoDiscoverRecordDelimiter(k,x)&&(b=this.options.record_delimiter);const e=k[x];if(!0===d&&y.append(e),13!==e&&10!==e||!1!==this.state.wasRowDelimiter||(this.state.wasRowDelimiter=!0),!0===this.state.escaping)this.state.escaping=!1;else{if(null!==_&&!0===this.state.quoting&&this.__isEscape(k,x,e)&&x+_.length<L){if(!S){this.state.escaping=!0,x+=_.length-1;continue}if(this.__isQuote(k,x+_.length)){this.state.escaping=!0,x+=_.length-1;continue}}if(!1===this.state.commenting&&this.__isQuote(k,x))if(!0===this.state.quoting){const t=k[x+v.length],i=u&&this.__isCharTrimable(k,x+v.length),n=null!==f&&this.__compareBytes(f,k,x+v.length,t),o=this.__isDelimiter(k,x+v.length,t),s=0===b.length?this.__autoDiscoverRecordDelimiter(k,x+v.length):this.__isRecordDelimiter(t,k,x+v.length);if(null!==_&&this.__isEscape(k,x,e)&&this.__isQuote(k,x+_.length))x+=_.length-1;else{if(!t||o||s||n||i){this.state.quoting=!1,this.state.wasQuoting=!0,x+=v.length-1;continue}if(!1===c){const e=this.__error(new XZe("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got "${String.fromCharCode(t)}"`,`at line ${this.info.lines}`,"instead of delimiter, record delimiter, trimable character","(if activated) or comment"],this.options,this.__infoField()));if(void 0!==e)return e}else this.state.quoting=!1,this.state.wasQuoting=!0,this.state.field.prepend(v),x+=v.length-1}}else{if(0===this.state.field.length){this.state.quoting=!0,x+=v.length-1;continue}if(!1===c){const e=this.__infoField(),t=Object.keys(oYe).map((e=>!!oYe[e].equals(this.state.field.toString())&&e)).filter(Boolean)[0],i=this.__error(new XZe("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`a quote is found on field ${JSON.stringify(e.column)} at line ${e.lines}, value is ${JSON.stringify(this.state.field.toString(r))}`,t?`(${t} bom)`:void 0],this.options,e,{field:this.state.field}));if(void 0!==i)return i}}if(!1===this.state.quoting){const t=this.__isRecordDelimiter(e,k,x);if(0!==t){if(this.state.commenting&&!1===this.state.wasQuoting&&0===this.state.record.length&&0===this.state.field.length)this.info.comment_lines++;else{if(!1===this.state.enabled&&this.info.lines+(!0===this.state.wasRowDelimiter?1:0)>=a){this.state.enabled=!0,this.__resetField(),this.__resetRecord(),x+=t-1;continue}if(!0===g&&!1===this.state.wasQuoting&&0===this.state.record.length&&0===this.state.field.length){this.info.empty_lines++,x+=t-1;continue}this.info.bytes=this.state.bufBytesStart+x;const e=this.__onField();if(void 0!==e)return e;this.info.bytes=this.state.bufBytesStart+x+t;const o=this.__onRecord(i);if(void 0!==o)return o;if(-1!==p&&this.info.records>=p)return this.state.stop=!0,void n()}this.state.commenting=!1,x+=t-1;continue}if(this.state.commenting)continue;if(0!==(null===f?0:this.__compareBytes(f,k,x,e))&&(!1===s||0===this.state.field.length)){this.state.commenting=!0;continue}const o=this.__isDelimiter(k,x,e);if(0!==o){this.info.bytes=this.state.bufBytesStart+x;const e=this.__onField();if(void 0!==e)return e;x+=o-1;continue}}}if(!1===this.state.commenting&&0!==h&&this.state.record_length+this.state.field.length>h)return this.__error(new XZe("CSV_MAX_RECORD_SIZE",["Max Record Size:","record exceed the maximum number of tolerated bytes",`of ${h}`,`at line ${this.info.lines}`],this.options,this.__infoField()));const t=!1===l||!0===this.state.quoting||0!==this.state.field.length||!this.__isCharTrimable(k,x),o=!1===u||!1===this.state.wasQuoting;if(!0!==t||!0!==o){if(!0!==u||this.__isCharTrimable(k,x)){!1===t&&(x+=this.__isCharTrimable(k,x)-1);continue}return this.__error(new XZe("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",["Invalid Closing Quote:","found non trimable byte after quote",`at line ${this.info.lines}`],this.options,this.__infoField()))}this.state.field.append(e)}if(!0===t)if(!0===this.state.quoting){const e=this.__error(new XZe("CSV_QUOTE_NOT_CLOSED",["Quote Not Closed:",`the parsing is finished with an opening quote at line ${this.info.lines}`],this.options,this.__infoField()));if(void 0!==e)return e}else if(!0===this.state.wasQuoting||0!==this.state.record.length||0!==this.state.field.length){this.info.bytes=this.state.bufBytesStart+x;const e=this.__onField();if(void 0!==e)return e;const t=this.__onRecord(i);if(void 0!==t)return t}else!0===this.state.wasRowDelimiter?this.info.empty_lines++:!0===this.state.commenting&&this.info.comment_lines++;else this.state.bufBytesStart+=x,this.state.previousBuf=k.slice(x);!0===this.state.wasRowDelimiter&&(this.info.lines++,this.state.wasRowDelimiter=!1)},__onRecord:function(e){const{columns:t,group_columns_by_name:i,encoding:n,info:o,from:s,relax_column_count:r,relax_column_count_less:a,relax_column_count_more:l,raw:h,skip_records_with_empty_values:d}=this.options,{enabled:c,record:u}=this.state;if(!1===c)return this.__resetRecord();const g=u.length;if(!0===t)return!0===d&&nYe(u)?void this.__resetRecord():this.__firstLineToColumns(u);if(!1===t&&0===this.info.records&&(this.state.expectedRecordLength=g),g!==this.state.expectedRecordLength){const e=!1===t?new XZe("CSV_RECORD_INCONSISTENT_FIELDS_LENGTH",["Invalid Record Length:",`expect ${this.state.expectedRecordLength},`,`got ${g} on line ${this.info.lines}`],this.options,this.__infoField(),{record:u}):new XZe("CSV_RECORD_INCONSISTENT_COLUMNS",["Invalid Record Length:",`columns length is ${t.length},`,`got ${g} on line ${this.info.lines}`],this.options,this.__infoField(),{record:u});if(!0===r||!0===a&&g<this.state.expectedRecordLength||!0===l&&g>this.state.expectedRecordLength)this.info.invalid_field_length++,this.state.error=e;else{const t=this.__error(e);if(t)return t}}if(!0===d&&nYe(u))this.__resetRecord();else{if(!0===this.state.recordHasError)return this.__resetRecord(),void(this.state.recordHasError=!1);if(this.info.records++,1===s||this.info.records>=s){const{objname:s}=this.options;if(!1!==t){const r={};for(let e=0,n=u.length;e<n;e++)void 0===t[e]||t[e].disabled||(!0===i&&void 0!==r[t[e].name]?Array.isArray(r[t[e].name])?r[t[e].name]=r[t[e].name].concat(u[e]):r[t[e].name]=[r[t[e].name],u[e]]:r[t[e].name]=u[e]);if(!0===h||!0===o){const t=Object.assign({record:r},!0===h?{raw:this.state.rawBuffer.toString(n)}:{},!0===o?{info:this.__infoRecord()}:{}),i=this.__push(void 0===s?t:[r[s],t],e);if(i)return i}else{const t=this.__push(void 0===s?r:[r[s],r],e);if(t)return t}}else if(!0===h||!0===o){const t=Object.assign({record:u},!0===h?{raw:this.state.rawBuffer.toString(n)}:{},!0===o?{info:this.__infoRecord()}:{}),i=this.__push(void 0===s?t:[u[s],t],e);if(i)return i}else{const t=this.__push(void 0===s?u:[u[s],u],e);if(t)return t}}this.__resetRecord()}},__firstLineToColumns:function(e){const{firstLineToHeaders:t}=this.state;try{const i=void 0===t?e:t.call(null,e);if(!Array.isArray(i))return this.__error(new XZe("CSV_INVALID_COLUMN_MAPPING",["Invalid Column Mapping:","expect an array from column function,",`got ${JSON.stringify(i)}`],this.options,this.__infoField(),{headers:i}));const n=JZe(i);return this.state.expectedRecordLength=n.length,this.options.columns=n,void this.__resetRecord()}catch(e){return e}},__resetRecord:function(){!0===this.options.raw&&this.state.rawBuffer.reset(),this.state.error=void 0,this.state.record=[],this.state.record_length=0},__onField:function(){const{cast:e,encoding:t,rtrim:i,max_record_size:n}=this.options,{enabled:o,wasQuoting:s}=this.state;if(!1===o)return this.__resetField();let r=this.state.field.toString(t);if(!0===i&&!1===s&&(r=r.trimRight()),!0===e){const[e,t]=this.__cast(r);if(void 0!==e)return e;r=t}this.state.record.push(r),0!==n&&"string"==typeof r&&(this.state.record_length+=r.length),this.__resetField()},__resetField:function(){this.state.field.reset(),this.state.wasQuoting=!1},__push:function(e,t){const{on_record:i}=this.options;if(void 0!==i){const t=this.__infoRecord();try{e=i.call(null,e,t)}catch(e){return e}if(null==e)return}t(e)},__cast:function(e){const{columns:t,relax_column_count:i}=this.options;if(!0===Array.isArray(t)&&i&&this.options.columns.length<=this.state.record.length)return[void 0,void 0];if(null!==this.state.castField)try{const t=this.__infoField();return[void 0,this.state.castField.call(null,e,t)]}catch(e){return[e]}if(this.__isFloat(e))return[void 0,parseFloat(e)];if(!1!==this.options.cast_date){const t=this.__infoField();return[void 0,this.options.cast_date.call(null,e,t)]}return[void 0,e]},__isCharTrimable:function(e,t){return((e,t)=>{const{timchars:i}=this.state;e:for(let n=0;n<i.length;n++){const o=i[n];for(let i=0;i<o.length;i++)if(o[i]!==e[t+i])continue e;return o.length}return 0})(e,t)},__isFloat:function(e){return e-parseFloat(e)+1>=0},__compareBytes:function(e,t,i,n){if(e[0]!==n)return 0;const o=e.length;for(let n=1;n<o;n++)if(e[n]!==t[i+n])return 0;return o},__isDelimiter:function(e,t,i){const{delimiter:n,ignore_last_delimiters:o}=this.options;if(!0===o&&this.state.record.length===this.options.columns.length-1)return 0;if(!1!==o&&"number"==typeof o&&this.state.record.length===o-1)return 0;e:for(let o=0;o<n.length;o++){const s=n[o];if(s[0]===i){for(let i=1;i<s.length;i++)if(s[i]!==e[t+i])continue e;return s.length}}return 0},__isRecordDelimiter:function(e,t,i){const{record_delimiter:n}=this.options,o=n.length;e:for(let s=0;s<o;s++){const o=n[s],r=o.length;if(o[0]===e){for(let e=1;e<r;e++)if(o[e]!==t[i+e])continue e;return o.length}}return 0},__isEscape:function(e,t,i){const{escape:n}=this.options;if(null===n)return!1;const o=n.length;if(n[0]===i){for(let i=0;i<o;i++)if(n[i]!==e[t+i])return!1;return!0}return!1},__isQuote:function(e,t){const{quote:i}=this.options;if(null===i)return!1;const n=i.length;for(let o=0;o<n;o++)if(i[o]!==e[t+o])return!1;return!0},__autoDiscoverRecordDelimiter:function(e,t){const{encoding:i}=this.options,n=[pZe.from("\r\n",i),pZe.from("\n",i),pZe.from("\r",i)];e:for(let i=0;i<n.length;i++){const o=n[i].length;for(let s=0;s<o;s++)if(n[i][s]!==e[t+s])continue e;return this.options.record_delimiter.push(n[i]),this.state.recordDelimiterMaxLength=n[i].length,n[i].length}return 0},__error:function(e){const{encoding:t,raw:i,skip_records_with_error:n}=this.options,o="string"==typeof e?new Error(e):e;return n?(this.state.recordHasError=!0,void(void 0!==this.options.on_skip&&this.options.on_skip(o,i?this.state.rawBuffer.toString(t):void 0))):o},__infoDataSet:function(){return{...this.info,columns:this.options.columns}},__infoRecord:function(){const{columns:e,raw:t,encoding:i}=this.options;return{...this.__infoDataSet(),error:this.state.error,header:!0===e,index:this.state.record.length,raw:t?this.state.rawBuffer.toString(i):void 0}},__infoField:function(){const{columns:e}=this.options,t=Array.isArray(e);return{...this.__infoRecord(),column:!0===t?e.length>this.state.record.length?e[this.state.record.length].name:null:this.state.record.length,quoting:this.state.wasQuoting}}}}(t),o=e=>{void 0===n.options.objname?i.push(e):i[e[0]]=e[1]},s=()=>{},r=n.parse(e,!1,o,s);if(void 0!==r)throw r;const a=n.parse(void 0,!0,o,s);if(void 0!==a)throw a;return i}(e,{columns:["tag","category","count","alias"]})){const e=isNaN(t.count)?t.count:(+t.count).toLocaleString(),i={label:{label:t.tag,description:e},kind:Eoe.CompletionItemKind.Value,insertText:uYe(t.tag),count:t.count};sYe.push(i),hYe(i)&&aYe.filteredTags.push(i);for(const i of t.alias.split(",")){if(0===i.length)continue;const n={label:{label:i,detail:` -> ${t.tag}`,description:e},kind:Eoe.CompletionItemKind.Value,insertText:uYe(t.tag),count:t.count};sYe.push(n),hYe(n)&&aYe.filteredTags.push(n)}}},uYe=e=>e.replaceAll(/([\(\)\[\]])/g,"\\$1"),gYe={triggerCharacters:"<1234567890".split(""),provideCompletionItems:function(e,t,i){let n=((e,t)=>{const i=e.getWordUntilPosition(t),n=e.getWordAtPosition(t);return n?{startColumn:i.startColumn,endColumn:n.endColumn,word:n.word}:i})(e,t);const o=e.getValueInRange({startLineNumber:t.lineNumber,startColumn:n.startColumn-1,endLineNumber:t.lineNumber,endColumn:n.startColumn}),s=i.triggerCharacter||o;let r;r="<"===s?[]:aYe.filteredTags.map((e=>Object.assign({range:{startLineNumber:t.lineNumber,startColumn:n.startColumn,endLineNumber:t.lineNumber,endColumn:n.endColumn}},e,aYe.isRplaceUnderscore?{insertText:e.insertText.replaceAll("_"," ")}:{})));const a=[];for(const[e,i]of Object.entries(rYe))if("embedding"!==e||"<"!==s)for(const o of i){const i=uYe(o),r=`${e}:${i}:1.0`;a.push({label:{label:i,description:e},kind:Eoe.CompletionItemKind.Text,insertText:"embedding"===e?i:"<"===s?r:`<${r}>`,detail:e,range:{startLineNumber:t.lineNumber,startColumn:n.startColumn,endLineNumber:t.lineNumber,endColumn:n.endColumn}})}return{suggestions:r.concat(a)}}};var pYe=i(1580),mYe={};mYe.styleTagTransform=Vr(),mYe.setAttributes=Pr(),mYe.insert=Rr().bind(null,"head"),mYe.domAPI=Tr(),mYe.insertStyleElement=Br(),Ir()(pYe.Z,mYe);const fYe=pYe.Z&&pYe.Z.locals?pYe.Z.locals:void 0;for(const{id:e,lang:t}of[{id:"sd-prompt",lang:o},{id:"sd-dynamic-prompt",lang:s}])Eoe.register({id:e}),Eoe.setMonarchTokensProvider(e,t.language),Eoe.setLanguageConfiguration(e,t.conf),Eoe.registerCompletionItemProvider(e,gYe);const _Ye={instances:[]};var vYe;!function(e){e.NORMAL="NORMAL",e.VIM="VIM"}(vYe||(vYe={}));class bYe extends HTMLElement{elements={};mode=vYe.NORMAL;monaco;theme;vim;textareaDescriptor;textareaDisplay;onChangeShowLineNumbersCallbacks;onChangeShowMinimapCallbacks;onChangeReplaceUnderscoreCallbacks;onChangeThemeCallbacks;onChangeModeCallbacks;onChangeLanguageCallbacks;constructor(e,t={}){super(),this.textareaDescriptor=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),"value");const i=this.elements.container=this.attachShadow({mode:"open"}),n=this.elements.header=document.createElement("header"),o=this.elements.main=document.createElement("main"),s=this.elements.footer=document.createElement("footer"),r=this.elements.inner=document.createElement("div"),a=this.elements.monaco=document.createElement("div"),l=this.elements.status=document.createElement("div");o.appendChild(a),s.appendChild(l),r.appendChild(n),r.appendChild(o),r.appendChild(s),i.appendChild(r),r.classList.add(fYe.inner),o.classList.add(fYe.main),n.classList.add(fYe.header),s.classList.add(fYe.footer),a.classList.add(fYe.monaco),l.classList.add(fYe.status),this.onChangeShowLineNumbersCallbacks=[],this.onChangeShowMinimapCallbacks=[],this.onChangeReplaceUnderscoreCallbacks=[],this.onChangeThemeCallbacks=[],this.onChangeModeCallbacks=[],this.onChangeLanguageCallbacks=[];const h=this.monaco=Doe.create(a,{value:e.value,bracketPairColorization:{enabled:!0},automaticLayout:!0,wordWrap:"on"});this.polyfillMonacoEditorConfiguration(),this.theme=this.getThemeId(),this.changeMode(vYe.VIM),t.focus&&h.focus(),h.getModel()?.onDidChangeContent((t=>{this.textareaDescriptor.set?.call(e,this.monaco.getValue());const i=new InputEvent("input");Object.defineProperty(i,"target",{writable:!1,value:e}),e.dispatchEvent(i)})),t.handleTextAreaValue&&this.hookTextAreaElement(e),this.initHeader(),t.autoLayout&&this.handleResize(),this.copyStyleToShadow(),this.textareaDisplay=e.style.display,e.style.display="none",_Ye.instances.push(this)}changeMode(e){if(this.mode!==e){this.mode===vYe.VIM&&(this.vim.dispose(),this.vim=null),e===vYe.VIM&&(this.vim=ZGe(this.monaco,this.elements.status)),this.mode=e,this.elements.keyBindings&&(this.elements.keyBindings.value=e);for(const e of this.onChangeModeCallbacks)e()}}changeTheme(e){this.theme=e,this.elements.theme&&(this.elements.theme.value=e),this.monaco._themeService.setTheme(this.theme);for(const e of this.onChangeThemeCallbacks)e()}changeLanguage(e){this.elements.language&&(this.elements.language.value=e);const t=this.monaco.getModel();Doe.setModelLanguage(t,e);for(const e of this.onChangeLanguageCallbacks)e()}changeShowLineNumbers(e){this.elements.lineNumbers&&(this.elements.lineNumbers.checked=e),this.monaco.updateOptions({lineNumbers:e?"on":"off"});for(const e of this.onChangeShowLineNumbersCallbacks)e()}changeShowMinimap(e,t=!1){this.elements.minimap&&(this.elements.minimap.checked=e),this.monaco.updateOptions({minimap:{enabled:e}});for(const e of this.onChangeShowMinimapCallbacks)e()}changeReplaceUnderscore(e){var t;this.elements.replaceUnderscore&&(this.elements.replaceUnderscore.checked=e),t=e,aYe.isRplaceUnderscore=t;for(const e of this.onChangeReplaceUnderscoreCallbacks)e()}polyfillMonacoEditorConfiguration(){"function"!=typeof this.monaco.getConfiguration&&(this.monaco.getConfiguration=()=>{const e={};for(const[t,i]of Object.entries(Doe.EditorOptions)){const n=this.monaco.getOption(i.id);e[t]=n,"cursorWidth"===t&&(e.viewInfo||={},e.viewInfo[t]=n)}return e})}getThemeId(){return this.monaco._themeService._theme.id}setValue(e){if(e===this.monaco.getValue())return;const t=this.monaco.getPosition();this.monaco.setValue(e),this.monaco.setPosition(t)}hookTextAreaElement(e){const t=this,i=this.textareaDescriptor;Object.defineProperty(e,"value",{set:function(e){return t.setValue(e),i.set.call(this,e)},get:i.get})}initHeader(){const e=this.elements.header;for(const{label:t,title:i,callback:n,isEnabledCallback:o,toggleCallback:s}of[{label:"Minimap",callback:(e,t)=>{this.elements.minimap=t},isEnabledCallback:()=>this.monaco.getOption(Doe.EditorOption.minimap).enabled,toggleCallback:e=>{this.syncMinimap()}},{label:"LineNum",callback:(e,t)=>{this.elements.lineNumbers=t},isEnabledCallback:()=>this.monaco.getOption(Doe.EditorOption.lineNumbers).renderType!==Doe.RenderLineNumbersType.Off,toggleCallback:e=>{this.syncLineNumbers()}},{label:"Underscore",title:"Replace Underscore -> Space (Completion)",callback:(e,t)=>{this.elements.replaceUnderscore=t},isEnabledCallback:()=>lYe(),toggleCallback:e=>{this.syncReplaceUnderscore()}}])e.appendChild(this.createCheckbox(t,n,o,s,i));for(const{label:t,data:i,callback:n,isSelectedCallback:o,changeCallback:s,getValue:r}of[{label:"Language",data:this._arrayToObject(Eoe.getLanguages().map((e=>e.id))),callback:(e,t)=>{this.elements.language=t},isSelectedCallback:e=>e===this.monaco.getModel().getLanguageId(),changeCallback:e=>{e.target.value,this.syncLanguage()}},{label:"KeyBindings",data:vYe,callback:(e,t)=>{this.elements.keyBindings=t},isSelectedCallback:e=>e===this.mode,changeCallback:e=>{e.target.value,this.syncKeyBindings()}},{label:"Theme",data:this._mapToObject(this.monaco._themeService._knownThemes),callback:(e,t)=>{this.elements.theme=t},isSelectedCallback:e=>e.id===this.theme,changeCallback:e=>{const t=e.target.value;this.getThemeId()!==t&&this.syncTheme()},getValue:e=>e.id}])e.appendChild(this.createSelect(t,i,n,o,s,r));e.querySelectorAll("header > *").forEach((e=>{e.style.marginRight="1rem"}))}syncLanguage(){if(!this.elements.language)return;const e=this.elements.language.value;for(const t of _Ye.instances)t.changeLanguage(e)}syncKeyBindings(){if(!this.elements.keyBindings)return;const e=this.elements.keyBindings.value;for(const t of _Ye.instances)t.changeMode(e);this.monaco.focus()}syncTheme(){if(!this.elements.theme)return;const e=this.elements.theme.value;for(const t of _Ye.instances)t.changeTheme(e)}syncLineNumbers(){if(!this.elements.lineNumbers)return;const e=this.elements.lineNumbers.checked;for(const t of _Ye.instances)t.changeShowLineNumbers(e)}syncMinimap(){if(!this.elements.minimap)return;const e=this.elements.minimap.checked;for(const t of _Ye.instances)t.changeShowMinimap(e)}syncReplaceUnderscore(){if(!this.elements.replaceUnderscore)return;const e=this.elements.replaceUnderscore.checked;for(const t of _Ye.instances)t.changeReplaceUnderscore(e)}createCheckbox(e,t,i,n,o){const s=document.createElement("label"),r=document.createElement("input");return Object.assign(s.style,{display:"flex"}),r.checked=i(),r.type="checkbox",r.addEventListener("change",n),s.textContent=e,s.prepend(r),o&&(s.title=o),t(s,r),s}createSelect(e,t,i,n,o,s){const r=document.createElement("label");Object.assign(r.style,{display:"flex"});const a=document.createElement("select");Object.assign(a.style,{marginLeft:"0.5rem"});for(const[e,i]of Object.entries(t)){const t=document.createElement("option");t.textContent=e,t.value="function"==typeof s?s(i):i,n(i)&&(t.selected=!0),a.appendChild(t)}return a.addEventListener("change",o),r.textContent=e,r.appendChild(a),i(r,a),r}_mapToObject(e){const t={};return e.forEach(((e,i)=>{t[i]=e})),t}_arrayToObject(e){const t={};return e.forEach((e=>{t[e]=e})),t}handleResize(){const e=(e,t)=>{const i=this.elements.main;i&&(this.parentElement&&(i.style.height=this.parentElement.clientHeight+"px"),this.monaco.layout())},t=new MutationObserver(e),i=new IntersectionObserver(e,{root:document.documentElement});t.observe(this,{attributes:!0,attributeFilter:["style"]}),i.observe(this)}copyStyleToShadow(){document.head.querySelectorAll("style").forEach((e=>{this.elements.container.appendChild(e.cloneNode(!0))}))}getSettings(){return{minimap:this.elements.minimap?.checked,lineNumbers:this.elements.lineNumbers?.checked,replaceUnderscore:lYe(),language:this.monaco.getModel().getLanguageId(),theme:this.theme,mode:this.mode}}setSettings(e){const t=this.getSettings();void 0!==e.minimap&&e.minimap!==t.minimap&&this.changeShowMinimap(e.minimap),void 0!==e.lineNumbers&&e.lineNumbers!==t.lineNumbers&&this.changeShowLineNumbers(e.lineNumbers),void 0!==e.replaceUnderscore&&e.replaceUnderscore!==t.replaceUnderscore&&this.changeReplaceUnderscore(e.replaceUnderscore),void 0!==e.language&&e.language!==t.language&&this.changeLanguage(e.language),void 0!==e.theme&&e.theme!==t.theme&&this.changeTheme(e.theme),void 0!==e.mode&&e.mode!==t.mode&&this.changeMode(e.mode)}onChangeShowLineNumbers(e){this.onChangeShowLineNumbersCallbacks.push(e)}onChangeShowMinimap(e){this.onChangeShowMinimapCallbacks.push(e)}onChangeReplaceUnderscore(e){this.onChangeReplaceUnderscoreCallbacks.push(e)}onChangeTheme(e){this.onChangeThemeCallbacks.push(e)}onChangeMode(e){this.onChangeModeCallbacks.push(e)}onChangeLanguage(e){this.onChangeLanguageCallbacks.push(e)}onChange(e){this.onChangeShowLineNumbers(e),this.onChangeShowMinimap(e),this.onChangeReplaceUnderscore(e),this.onChangeTheme(e),this.onChangeMode(e),this.onChangeLanguage(e)}}window.customElements.define("prompt-editor",bYe);var wYe=Object.getOwnPropertyNames,CYe=Object.getOwnPropertySymbols,yYe=Object.prototype.hasOwnProperty;function SYe(e,t){return function(i,n,o){return e(i,n,o)&&t(i,n,o)}}function kYe(e){return function(t,i,n){if(!t||!i||"object"!=typeof t||"object"!=typeof i)return e(t,i,n);var o=n.cache,s=o.get(t),r=o.get(i);if(s&&r)return s===i&&r===t;o.set(t,i),o.set(i,t);var a=e(t,i,n);return o.delete(t),o.delete(i),a}}function LYe(e){return wYe(e).concat(CYe(e))}var xYe=Object.hasOwn||function(e,t){return yYe.call(e,t)};function DYe(e,t){return e||t?e===t:e===t||e!=e&&t!=t}var EYe="_owner",NYe=Object.getOwnPropertyDescriptor,IYe=Object.keys;function MYe(e,t,i){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!i.equals(e[n],t[n],n,n,e,t,i))return!1;return!0}function TYe(e,t){return DYe(e.getTime(),t.getTime())}function AYe(e,t,i){if(e.size!==t.size)return!1;for(var n,o,s={},r=e.entries(),a=0;(n=r.next())&&!n.done;){for(var l=t.entries(),h=!1,d=0;(o=l.next())&&!o.done;){var c=n.value,u=c[0],g=c[1],p=o.value,m=p[0],f=p[1];h||s[d]||!(h=i.equals(u,m,a,d,e,t,i)&&i.equals(g,f,u,m,e,t,i))||(s[d]=!0),d++}if(!h)return!1;a++}return!0}function RYe(e,t,i){var n,o=IYe(e),s=o.length;if(IYe(t).length!==s)return!1;for(;s-- >0;){if((n=o[s])===EYe&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof)return!1;if(!xYe(t,n)||!i.equals(e[n],t[n],n,n,e,t,i))return!1}return!0}function OYe(e,t,i){var n,o,s,r=LYe(e),a=r.length;if(LYe(t).length!==a)return!1;for(;a-- >0;){if((n=r[a])===EYe&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof)return!1;if(!xYe(t,n))return!1;if(!i.equals(e[n],t[n],n,n,e,t,i))return!1;if(o=NYe(e,n),s=NYe(t,n),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable))return!1}return!0}function PYe(e,t){return DYe(e.valueOf(),t.valueOf())}function FYe(e,t){return e.source===t.source&&e.flags===t.flags}function BYe(e,t,i){if(e.size!==t.size)return!1;for(var n,o,s={},r=e.values();(n=r.next())&&!n.done;){for(var a=t.values(),l=!1,h=0;(o=a.next())&&!o.done;)l||s[h]||!(l=i.equals(n.value,o.value,n.value,o.value,e,t,i))||(s[h]=!0),h++;if(!l)return!1}return!0}function WYe(e,t){var i=e.length;if(t.length!==i)return!1;for(;i-- >0;)if(e[i]!==t[i])return!1;return!0}var VYe=Array.isArray,zYe="function"==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView:null,HYe=Object.assign,UYe=Object.prototype.toString.call.bind(Object.prototype.toString),KYe=jYe();function jYe(e){void 0===e&&(e={});var t=e.circular,i=void 0!==t&&t,n=e.createInternalComparator,o=e.createState,s=e.strict,r=void 0!==s&&s,a=function(e){var t=e.circular,i=e.createCustomConfig,n=e.strict,o={areArraysEqual:n?OYe:MYe,areDatesEqual:TYe,areMapsEqual:n?SYe(AYe,OYe):AYe,areObjectsEqual:n?OYe:RYe,arePrimitiveWrappersEqual:PYe,areRegExpsEqual:FYe,areSetsEqual:n?SYe(BYe,OYe):BYe,areTypedArraysEqual:n?OYe:WYe};if(i&&(o=HYe({},o,i(o))),t){var s=kYe(o.areArraysEqual),r=kYe(o.areMapsEqual),a=kYe(o.areObjectsEqual),l=kYe(o.areSetsEqual);o=HYe({},o,{areArraysEqual:s,areMapsEqual:r,areObjectsEqual:a,areSetsEqual:l})}return o}(e),l=function(e){var t=e.areArraysEqual,i=e.areDatesEqual,n=e.areMapsEqual,o=e.areObjectsEqual,s=e.arePrimitiveWrappersEqual,r=e.areRegExpsEqual,a=e.areSetsEqual,l=e.areTypedArraysEqual;return function(e,h,d){if(e===h)return!0;if(null==e||null==h||"object"!=typeof e||"object"!=typeof h)return e!=e&&h!=h;var c=e.constructor;if(c!==h.constructor)return!1;if(c===Object)return o(e,h,d);if(VYe(e))return t(e,h,d);if(null!=zYe&&zYe(e))return l(e,h,d);if(c===Date)return i(e,h,d);if(c===RegExp)return r(e,h,d);if(c===Map)return n(e,h,d);if(c===Set)return a(e,h,d);var u=UYe(e);return"[object Date]"===u?i(e,h,d):"[object RegExp]"===u?r(e,h,d):"[object Map]"===u?n(e,h,d):"[object Set]"===u?a(e,h,d):"[object Object]"===u?"function"!=typeof e.then&&"function"!=typeof h.then&&o(e,h,d):"[object Arguments]"===u?o(e,h,d):("[object Boolean]"===u||"[object Number]"===u||"[object String]"===u)&&s(e,h,d)}}(a),h=n?n(l):function(e){return function(t,i,n,o,s,r,a){return e(t,i,a)}}(l);return function(e){var t=e.circular,i=e.comparator,n=e.createState,o=e.equals,s=e.strict;if(n)return function(e,r){var a=n(),l=a.cache,h=void 0===l?t?new WeakMap:void 0:l,d=a.meta;return i(e,r,{cache:h,equals:o,meta:d,strict:s})};if(t)return function(e,t){return i(e,t,{cache:new WeakMap,equals:o,meta:void 0,strict:s})};var r={cache:void 0,equals:o,meta:void 0,strict:s};return function(e,t){return i(e,t,r)}}({circular:i,comparator:l,createState:o,equals:h,strict:r})}jYe({strict:!0}),jYe({circular:!0}),jYe({circular:!0,strict:!0}),jYe({createInternalComparator:function(){return DYe}}),jYe({strict:!0,createInternalComparator:function(){return DYe}}),jYe({circular:!0,createInternalComparator:function(){return DYe}}),jYe({circular:!0,createInternalComparator:function(){return DYe},strict:!0});const qYe=JSON.parse('{"l":"/webui-monaco-prompt","b":"/webui-monaco-prompt-embeddings"}'),$Ye="webui-monaco-prompt";(e=>{let t=!1;onUiUpdate((async()=>{if(t)return;t=!0;const i=gradioApp();await(async()=>{const e=await fetch(qYe.b).then((e=>e.json())).catch((e=>new Error(`fetch error: ${e}`)));e&&e.loaded&&(console.log($Ye,"load","embedding",Object.keys(e.loaded)),dYe("embedding",Object.keys(e.loaded),!0));for(const[e,t]of[["lora","setting_sd_lora"],["hypernet","setting_sd_hypernetwork"],["lyco","setting_sd_lyco"]]){const i=gradio_config.components.filter((e=>e.props.elem_id===t&&e.props.choices))[0];if(!i)continue;const n=i.props.choices.slice();"None"===n[0]&&n.shift(),console.log($Ye,"load",e,n),dYe(e,n,!0)}})();let n=!1;onUiUpdate((async()=>{if(n)return;const e=["txt2img_prompt","txt2img_neg_prompt","img2img_prompt","img2img_neg_prompt"];for(const t of e)if(null===i.getElementById(t))return;const t=["txt2img_edit_style_prompt","txt2img_edit_style_neg_prompt","img2img_edit_style_prompt","img2img_edit_style_neg_prompt"],o=["file_edit_box_id","sddp-wildcard-file-editor"];n=!0;let s=null;const r=await fetch(qYe.l,{method:"GET"}).then((e=>e.json())).catch((e=>console.error("fetch error:",qYe.l,e)));for(const n of e.concat(t,o)){const e=i.getElementById(n);if(!e)continue;const o=e.querySelector("textarea"),a=new bYe(o,{autoLayout:!0,handleTextAreaValue:!0});a.addEventListener("keydown",(e=>{switch(e.key){case"Esc":case"Escape":e.stopPropagation()}})),o.parentElement?o.parentElement.append(a):e.append(a),Object.assign(a.style,{resize:"vertical",overflow:"overlay",display:"block",height:"100%",minHeight:"20rem",width:"100%"}),t.includes(n)&&new IntersectionObserver((e=>{a.handleResize()})).observe(a),a.setSettings(r);const l=async()=>{const e=a.getSettings();if(KYe(s,e))return;s=e;const t=await fetch(qYe.l,{method:"POST",body:JSON.stringify(e)}).then((e=>e.json())).catch((e=>console.error("fetch error:",qYe.l,e)));t.success||console.error("fetch failed:",t)};a.onChange(l)}}));const o=e.pathname.split("/").slice(0,-2);for(const e of["danbooru.csv","extra-quality-tags.csv"]){const t=o.concat(["csv",e]).join("/");sYe.length=0,aYe.filteredTags.length=0,fetch(t).then((e=>e.text())).then((e=>{cYe(e)}))}const s=[],r=[{id:"txt2img_textual_inversion_cards",type:"embedding"},{id:"txt2img_hypernetworks_cards",type:"hypernet"},{id:"txt2img_lora_cards",type:"lora"},{id:"txt2img_lycoris_cards",type:"lyco"}];var a;a=()=>{for(const e of r){const t=i.getElementById(e.id),n=[];t&&t.querySelectorAll(".card .name").forEach((e=>{const t=e.textContent;t&&n.push(t)})),0!=n.length&&(console.log($Ye,"refresh",e.type,n),dYe(e.type,n,!0))}},s.push(a),onUiUpdate((function(e){for(const t of e){const e=t.target;if(e&&e.closest&&e.closest("#txt2img_extra_tabs")){s.forEach((e=>e()));break}}}))}))})(new URL(document.currentScript.src))})(),n})()));