@weapp-vite/dashboard 6.16.27 → 6.16.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,7 +48,7 @@ Received: '{1}'.`,t,jc.getLexeme(n)),a=n.offset,o=jc.getLexeme(n);return this._p
48
48
  \`\`\`
49
49
  'top', 'center', 'bottom'
50
50
  \`\`\`
51
- `,constraint:function(e){if(!kt(e))return!1;let t=e;return!(!At(t.lineNumber)&&!Ot(t.lineNumber)||!Nt(t.at)&&!Ot(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`}})(Kf||={});var qf=class{constructor(e){e.addImplementation(1e4,`code-editor`,(e,t)=>{let n=e.get(mc).getFocusedCodeEditor();return n&&n.hasTextFocus()?this._runEditorCommand(e,n,t):!1}),e.addImplementation(1e3,`generic-dom-input-textarea`,(e,t)=>{let n=Cs();return n&&Ks(n)?(this.runDOMCommand(n),!0):!1}),e.addImplementation(0,`generic-dom`,(e,t)=>{let n=e.get(mc).getActiveCodeEditor();return n?(n.focus(),this._runEditorCommand(e,n,t)):!1})}_runEditorCommand(e,t,n){return this.runEditorCommand(e,t,n)||!0}},Jf;(function(e){class t extends Wf{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[id.moveTo(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)])&&t.revealType!==2&&e.revealAllCursors(t.source,!0,!0))}}e.MoveTo=V(new t({id:`_moveTo`,inSelectionMode:!1,precondition:void 0})),e.MoveToSelect=V(new t({id:`_moveToSelect`,inSelectionMode:!0,precondition:void 0}));class n extends Wf{runCoreEditorCommand(e,t){e.model.pushStackElement();let n=this._getColumnSelectResult(e,e.getPrimaryCursorState(),e.getCursorColumnSelectData(),t);n!==null&&(e.setCursorStates(t.source,3,n.viewStates.map(e=>yu.fromViewState(e))),e.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:n.fromLineNumber,fromViewVisualColumn:n.fromVisualColumn,toViewLineNumber:n.toLineNumber,toViewVisualColumn:n.toVisualColumn}),n.reversed?e.revealTopMostCursor(t.source):e.revealBottomMostCursor(t.source))}}e.ColumnSelect=V(new class extends n{constructor(){super({id:`columnSelect`,precondition:void 0})}_getColumnSelectResult(e,t,n,r){if(r.position===void 0||r.viewPosition===void 0||r.mouseColumn===void 0)return null;let i=e.model.validatePosition(r.position),a=e.coordinatesConverter.validateViewPosition(new F(r.viewPosition.lineNumber,r.viewPosition.column),i),o=r.doColumnSelect?n.fromViewLineNumber:a.lineNumber,s=r.doColumnSelect?n.fromViewVisualColumn:r.mouseColumn-1;return Cu.columnSelect(e.cursorConfig,e,o,s,a.lineNumber,r.mouseColumn-1)}}),e.CursorColumnSelectLeft=V(new class extends n{constructor(){super({id:`cursorColumnSelectLeft`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(e,t,n,r){return Cu.columnSelectLeft(e.cursorConfig,e,n)}}),e.CursorColumnSelectRight=V(new class extends n{constructor(){super({id:`cursorColumnSelectRight`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(e,t,n,r){return Cu.columnSelectRight(e.cursorConfig,e,n)}});class r extends n{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,n,r){return Cu.columnSelectUp(e.cursorConfig,e,n,this._isPaged)}}e.CursorColumnSelectUp=V(new r({isPaged:!1,id:`cursorColumnSelectUp`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:3600,linux:{primary:0}}})),e.CursorColumnSelectPageUp=V(new r({isPaged:!0,id:`cursorColumnSelectPageUp`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:3595,linux:{primary:0}}}));class i extends n{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,n,r){return Cu.columnSelectDown(e.cursorConfig,e,n,this._isPaged)}}e.CursorColumnSelectDown=V(new i({isPaged:!1,id:`cursorColumnSelectDown`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:3602,linux:{primary:0}}})),e.CursorColumnSelectPageDown=V(new i({isPaged:!0,id:`cursorColumnSelectPageDown`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:3596,linux:{primary:0}}}));class a extends Wf{constructor(){super({id:`cursorMove`,precondition:void 0,metadata:ad.metadata})}runCoreEditorCommand(e,t){let n=ad.parse(t);n&&this._runCursorMove(e,t.source,n)}_runCursorMove(e,t,n){let r=n.noHistory?`api`:t;e.model.pushStackElement(),e.setCursorStates(r,3,a._move(e,e.getCursorStates(),n)),e.revealAllCursors(r,!0)}static _move(e,t,n){let r=n.select,i=n.value;switch(n.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return id.simpleMove(e,t,n.direction,r,i,n.unit);case 11:case 13:case 12:case 14:return id.viewportMove(e,t,n.direction,r,i);default:return null}}}e.CursorMoveImpl=a,e.CursorMove=V(new a);class o extends Wf{constructor(e){super(e),this._staticArgs=e.args}runCoreEditorCommand(e,t){let n=this._staticArgs;this._staticArgs.value===-1&&(n={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,id.simpleMove(e,e.getCursorStates(),n.direction,n.select,n.value,n.unit)),e.revealAllCursors(t.source,!0)}}e.CursorLeft=V(new o({args:{direction:0,unit:0,select:!1,value:1},id:`cursorLeft`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),e.CursorLeftSelect=V(new o({args:{direction:0,unit:0,select:!0,value:1},id:`cursorLeftSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:1039}})),e.CursorRight=V(new o({args:{direction:1,unit:0,select:!1,value:1},id:`cursorRight`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),e.CursorRightSelect=V(new o({args:{direction:1,unit:0,select:!0,value:1},id:`cursorRightSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:1041}})),e.CursorUp=V(new o({args:{direction:2,unit:2,select:!1,value:1},id:`cursorUp`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),e.CursorUpSelect=V(new o({args:{direction:2,unit:2,select:!0,value:1},id:`cursorUpSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),e.CursorPageUp=V(new o({args:{direction:2,unit:2,select:!1,value:-1},id:`cursorPageUp`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:11}})),e.CursorPageUpSelect=V(new o({args:{direction:2,unit:2,select:!0,value:-1},id:`cursorPageUpSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:1035}})),e.CursorDown=V(new o({args:{direction:3,unit:2,select:!1,value:1},id:`cursorDown`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),e.CursorDownSelect=V(new o({args:{direction:3,unit:2,select:!0,value:1},id:`cursorDownSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),e.CursorPageDown=V(new o({args:{direction:3,unit:2,select:!1,value:-1},id:`cursorPageDown`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:12}})),e.CursorPageDownSelect=V(new o({args:{direction:3,unit:2,select:!0,value:-1},id:`cursorPageDownSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:1036}})),e.CreateCursor=V(new class extends Wf{constructor(){super({id:`createCursor`,precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;let n;n=t.wholeLine?id.line(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition):id.moveTo(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition);let r=e.getCursorStates();if(r.length>1){let i=n.modelState?n.modelState.position:null,a=n.viewState?n.viewState.position:null;for(let n=0,o=r.length;n<o;n++){let o=r[n];if(!(i&&!o.modelState.selection.containsPosition(i))&&!(a&&!o.viewState.selection.containsPosition(a))){r.splice(n,1),e.model.pushStackElement(),e.setCursorStates(t.source,3,r);return}}}r.push(n),e.model.pushStackElement(),e.setCursorStates(t.source,3,r)}}),e.LastCursorMoveToSelect=V(new class extends Wf{constructor(){super({id:`_lastCursorMoveToSelect`,precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;let n=e.getLastAddedCursorIndex(),r=e.getCursorStates(),i=r.slice(0);i[n]=id.moveTo(e,r[n],!0,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,i)}});class s extends Wf{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,id.moveToBeginningOfLine(e,e.getCursorStates(),this._inSelectionMode)),e.revealAllCursors(t.source,!0)}}e.CursorHome=V(new s({inSelectionMode:!1,id:`cursorHome`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:14,mac:{primary:14,secondary:[2063]}}})),e.CursorHomeSelect=V(new s({inSelectionMode:!0,id:`cursorHomeSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:1038,mac:{primary:1038,secondary:[3087]}}}));class c extends Wf{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,this._exec(e.getCursorStates())),e.revealAllCursors(t.source,!0)}_exec(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n],i=r.modelState.position.lineNumber;t[n]=yu.fromModelState(r.modelState.move(this._inSelectionMode,i,1,0))}return t}}e.CursorLineStart=V(new c({inSelectionMode:!1,id:`cursorLineStart`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:0,mac:{primary:287}}})),e.CursorLineStartSelect=V(new c({inSelectionMode:!0,id:`cursorLineStartSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:0,mac:{primary:1311}}}));class l extends Wf{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,id.moveToEndOfLine(e,e.getCursorStates(),this._inSelectionMode,t.sticky||!1)),e.revealAllCursors(t.source,!0)}}e.CursorEnd=V(new l({inSelectionMode:!1,id:`cursorEnd`,precondition:void 0,kbOpts:{args:{sticky:!1},weight:Uf,kbExpr:G.textInputFocus,primary:13,mac:{primary:13,secondary:[2065]}},metadata:{description:`Go to End`,args:[{name:`args`,schema:{type:`object`,properties:{sticky:{description:C(66,`Stick to the end even when going to longer lines`),type:`boolean`,default:!1}}}}]}})),e.CursorEndSelect=V(new l({inSelectionMode:!0,id:`cursorEndSelect`,precondition:void 0,kbOpts:{args:{sticky:!1},weight:Uf,kbExpr:G.textInputFocus,primary:1037,mac:{primary:1037,secondary:[3089]}},metadata:{description:`Select to End`,args:[{name:`args`,schema:{type:`object`,properties:{sticky:{description:C(67,`Stick to the end even when going to longer lines`),type:`boolean`,default:!1}}}}]}}));class u extends Wf{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.revealAllCursors(t.source,!0)}_exec(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r],a=i.modelState.position.lineNumber,o=e.model.getLineMaxColumn(a);n[r]=yu.fromModelState(i.modelState.move(this._inSelectionMode,a,o,0))}return n}}e.CursorLineEnd=V(new u({inSelectionMode:!1,id:`cursorLineEnd`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:0,mac:{primary:291}}})),e.CursorLineEndSelect=V(new u({inSelectionMode:!0,id:`cursorLineEndSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:0,mac:{primary:1315}}}));class d extends Wf{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,id.moveToBeginningOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealAllCursors(t.source,!0)}}e.CursorTop=V(new d({inSelectionMode:!1,id:`cursorTop`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:2062,mac:{primary:2064}}})),e.CursorTopSelect=V(new d({inSelectionMode:!0,id:`cursorTopSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:3086,mac:{primary:3088}}}));class f extends Wf{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,id.moveToEndOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealAllCursors(t.source,!0)}}e.CursorBottom=V(new f({inSelectionMode:!1,id:`cursorBottom`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:2061,mac:{primary:2066}}})),e.CursorBottomSelect=V(new f({inSelectionMode:!0,id:`cursorBottomSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:3085,mac:{primary:3090}}}));class p extends Wf{constructor(){super({id:`editorScroll`,precondition:void 0,metadata:Gf.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){let n=Gf.parse(t);if(!n)return;let r=this.determineScrollMethod(n);r&&r(e,t.source,n)}_runVerticalEditorScroll(e,t,n){let r=this._computeDesiredScrollTop(e,n);if(n.revealCursor){let i=e.getCompletelyVisibleViewRangeAtScrollTop(r);e.setCursorStates(t,3,[id.findPositionInViewportIfOutside(e,e.getPrimaryCursorState(),i,n.select)])}e.viewLayout.setScrollPosition({scrollTop:r},0)}_computeDesiredScrollTop(e,t){if(t.unit===1){let n=e.viewLayout.getFutureViewport(),r=e.getCompletelyVisibleViewRangeAtScrollTop(n.top),i=e.coordinatesConverter.convertViewRangeToModelRange(r),a;a=t.direction===1?Math.max(1,i.startLineNumber-t.value):Math.min(e.model.getLineCount(),i.startLineNumber+t.value);let o=e.coordinatesConverter.convertModelPositionToViewPosition(new F(a,1));return e.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber)}if(t.unit===5){let n=0;return t.direction===3&&(n=e.model.getLineCount()-e.cursorConfig.pageSize),e.viewLayout.getVerticalOffsetForLineNumber(n)}let n;n=t.unit===3?e.cursorConfig.pageSize*t.value:t.unit===4?Math.round(e.cursorConfig.pageSize/2)*t.value:t.value;let r=(t.direction===1?-1:1)*n;return e.viewLayout.getCurrentScrollTop()+r*e.cursorConfig.lineHeight}_runHorizontalEditorScroll(e,t,n){let r=this._computeDesiredScrollLeft(e,n);e.viewLayout.setScrollPosition({scrollLeft:r},0)}_computeDesiredScrollLeft(e,t){let n=(t.direction===4?-1:1)*t.value;return e.viewLayout.getCurrentScrollLeft()+n*e.cursorConfig.typicalHalfwidthCharacterWidth}}e.EditorScrollImpl=p,e.EditorScroll=V(new p),e.ScrollLineUp=V(new class extends Wf{constructor(){super({id:`scrollLineUp`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:2064,mac:{primary:267}}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:Gf.RawDirection.Up,by:Gf.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:n.source})}}),e.ScrollPageUp=V(new class extends Wf{constructor(){super({id:`scrollPageUp`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:2059,win:{primary:523},linux:{primary:523}}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:Gf.RawDirection.Up,by:Gf.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:n.source})}}),e.ScrollEditorTop=V(new class extends Wf{constructor(){super({id:`scrollEditorTop`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:Gf.RawDirection.Up,by:Gf.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:n.source})}}),e.ScrollLineDown=V(new class extends Wf{constructor(){super({id:`scrollLineDown`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:2066,mac:{primary:268}}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:Gf.RawDirection.Down,by:Gf.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:n.source})}}),e.ScrollPageDown=V(new class extends Wf{constructor(){super({id:`scrollPageDown`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:2060,win:{primary:524},linux:{primary:524}}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:Gf.RawDirection.Down,by:Gf.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:n.source})}}),e.ScrollEditorBottom=V(new class extends Wf{constructor(){super({id:`scrollEditorBottom`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:Gf.RawDirection.Down,by:Gf.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:n.source})}}),e.ScrollLeft=V(new class extends Wf{constructor(){super({id:`scrollLeft`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:Gf.RawDirection.Left,by:Gf.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:n.source})}}),e.ScrollRight=V(new class extends Wf{constructor(){super({id:`scrollRight`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:Gf.RawDirection.Right,by:Gf.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:n.source})}});class m extends Wf{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[id.word(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position)]),t.revealType!==2&&e.revealAllCursors(t.source,!0,!0))}}e.WordSelect=V(new m({inSelectionMode:!1,id:`_wordSelect`,precondition:void 0})),e.WordSelectDrag=V(new m({inSelectionMode:!0,id:`_wordSelectDrag`,precondition:void 0})),e.LastCursorWordSelect=V(new class extends Wf{constructor(){super({id:`lastCursorWordSelect`,precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;let n=e.getLastAddedCursorIndex(),r=e.getCursorStates(),i=r.slice(0),a=r[n];i[n]=id.word(e,a,a.modelState.hasSelection(),t.position),e.model.pushStackElement(),e.setCursorStates(t.source,3,i)}});class h extends Wf{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[id.line(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)]),t.revealType!==2&&e.revealAllCursors(t.source,!1,!0))}}e.LineSelect=V(new h({inSelectionMode:!1,id:`_lineSelect`,precondition:void 0})),e.LineSelectDrag=V(new h({inSelectionMode:!0,id:`_lineSelectDrag`,precondition:void 0}));class g extends Wf{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){if(!t.position)return;let n=e.getLastAddedCursorIndex(),r=e.getCursorStates(),i=r.slice(0);i[n]=id.line(e,r[n],this._inSelectionMode,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,i)}}e.LastCursorLineSelect=V(new g({inSelectionMode:!1,id:`lastCursorLineSelect`,precondition:void 0})),e.LastCursorLineSelectDrag=V(new g({inSelectionMode:!0,id:`lastCursorLineSelectDrag`,precondition:void 0})),e.CancelSelection=V(new class extends Wf{constructor(){super({id:`cancelSelection`,precondition:G.hasNonEmptySelection,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[id.cancelSelection(e,e.getPrimaryCursorState())]),e.revealAllCursors(t.source,!0)}}),e.RemoveSecondaryCursors=V(new class extends Wf{constructor(){super({id:`removeSecondaryCursors`,precondition:G.hasMultipleSelections,kbOpts:{weight:1,kbExpr:G.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[e.getPrimaryCursorState()]),e.revealAllCursors(t.source,!0),lc(C(68,`Removed secondary cursors`))}}),e.RevealLine=V(new class extends Wf{constructor(){super({id:`revealLine`,precondition:void 0,metadata:Kf.metadata})}runCoreEditorCommand(e,t){let n=t,r=n.lineNumber||0,i=typeof r==`number`?r+1:parseInt(r)+1;i<1&&(i=1);let a=e.model.getLineCount();i>a&&(i=a);let o=new U(i,1,i,e.model.getLineMaxColumn(i)),s=0;if(n.at)switch(n.at){case Kf.RawAtArgument.Top:s=3;break;case Kf.RawAtArgument.Center:s=1;break;case Kf.RawAtArgument.Bottom:s=4;break}let c=e.coordinatesConverter.convertModelRangeToViewRange(o);e.revealRange(t.source,!1,c,s,0)}}),e.SelectAll=new class extends qf{constructor(){super(lre)}runDOMCommand(e){tt&&(e.focus(),e.select()),e.ownerDocument.execCommand(`selectAll`)}runEditorCommand(e,t,n){let r=t._getViewModel();r&&this.runCoreEditorCommand(r,n)}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(`keyboard`,3,[id.selectAll(e,e.getPrimaryCursorState())])}},e.SetSelection=V(new class extends Wf{constructor(){super({id:`setSelection`,precondition:void 0})}runCoreEditorCommand(e,t){t.selection&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[yu.fromModelSelection(t.selection)]))}})})(Jf||={});var jie=R.and(G.textInputFocus,G.columnSelection);function Yf(e,t){al.registerKeybindingRule({id:e,primary:t,when:jie,weight:1})}Yf(Jf.CursorColumnSelectLeft.id,1039),Yf(Jf.CursorColumnSelectRight.id,1041),Yf(Jf.CursorColumnSelectUp.id,1040),Yf(Jf.CursorColumnSelectPageUp.id,1035),Yf(Jf.CursorColumnSelectDown.id,1042),Yf(Jf.CursorColumnSelectPageDown.id,1036);function Xf(e){return e.register(),e}var Zf;(function(e){class t extends nu{runEditorCommand(e,t,n){let r=t._getViewModel();r&&this.runCoreEditingCommand(t,r,n||{})}}e.CoreEditingCommand=t,e.LineBreakInsert=V(new class extends t{constructor(){super({id:`lineBreakInsert`,precondition:G.writable,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,jf.lineBreakInsert(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection)))}}),e.Outdent=V(new class extends t{constructor(){super({id:`outdent`,precondition:G.writable,kbOpts:{weight:Uf,kbExpr:R.and(G.editorTextFocus,G.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,Hf.outdent(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.Tab=V(new class extends t{constructor(){super({id:`tab`,precondition:G.writable,kbOpts:{weight:Uf,kbExpr:R.and(G.editorTextFocus,G.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,Hf.tab(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.DeleteLeft=V(new class extends t{constructor(){super({id:`deleteLeft`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(e,t,n){let[r,i]=Nu.deleteLeft(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection),t.getCursorAutoClosedCharacters());r&&e.pushUndoStop(),e.executeCommands(this.id,i),t.setPrevEditOperationType(2)}}),e.DeleteRight=V(new class extends t{constructor(){super({id:`deleteRight`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(e,t,n){let[r,i]=Nu.deleteRight(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection));r&&e.pushUndoStop(),e.executeCommands(this.id,i),t.setPrevEditOperationType(3)}}),e.Undo=new class extends qf{constructor(){super(du)}runDOMCommand(e){e.ownerDocument.execCommand(`undo`)}runEditorCommand(e,t,n){if(!(!t.hasModel()||t.getOption(104)===!0))return t.getModel().undo()}},e.Redo=new class extends qf{constructor(){super(fu)}runDOMCommand(e){e.ownerDocument.execCommand(`redo`)}runEditorCommand(e,t,n){if(!(!t.hasModel()||t.getOption(104)===!0))return t.getModel().redo()}}})(Zf||={});var Qf=class extends $l{constructor(e,t,n){super({id:e,precondition:void 0,metadata:n}),this._handlerId=t}runCommand(e,t){let n=e.get(mc).getFocusedCodeEditor();n&&n.trigger(`keyboard`,this._handlerId,t)}};function $f(e,t){Xf(new Qf(`default:`+e,e)),Xf(new Qf(e,e,t))}$f(`type`,{description:`Type`,args:[{name:`args`,schema:{type:`object`,required:[`text`],properties:{text:{type:`string`}}}}]}),$f(`replacePreviousChar`),$f(`compositionType`),$f(`compositionStart`),$f(`compositionEnd`),$f(`paste`),$f(`cut`);var ep=pc(`markerDecorationsService`),Mie=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Nie=function(e,t){return function(n,r){t(n,r,e)}},tp=class{static{this.ID=`editor.contrib.markerDecorations`}constructor(e,t){}dispose(){}};tp=Mie([Nie(1,ep)],tp),su(tp.ID,tp,0);var np=class{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=``}focus(){this.domNode.focus()}setMaxWidth(e){let t=rp(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=rp(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=rp(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=rp(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=rp(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=rp(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=rp(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){let t=rp(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){let t=rp(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){let t=rp(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=rp(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 rp(e){return typeof e==`number`?`${e}px`:e}function ip(e){return new np(e)}function ap(e,t){e instanceof np?(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`)}var op=class extends D{constructor(e,t){super(),this._onDidChange=this._register(new k),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,t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()},n=!1,r=!1,i=()=>{if(n&&!r)try{n=!1,r=!0,t()}finally{as(Ko(this._referenceDomElement),()=>{r=!1,i()})}};this._resizeObserver=new ResizeObserver(t=>{e=t&&t[0]&&t[0].contentRect?{width:t[0].contentRect.width,height:t[0].contentRect.height}:null,n=!0,i()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&=(this._resizeObserver.disconnect(),null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let n=0,r=0;t?(n=t.width,r=t.height):this._referenceDomElement&&(n=this._referenceDomElement.clientWidth,r=this._referenceDomElement.clientHeight),n=Math.max(5,n),r=Math.max(5,r),(this._width!==n||this._height!==r)&&(this._width=n,this._height=r,e&&this._onDidChange.fire())}},Pie=class extends D{constructor(e){super(),this._onDidChange=this._register(new k),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){this._mediaQueryList?.removeEventListener(`change`,this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener(`change`,this._listener),t&&this._onDidChange.fire()}},Fie=class extends D{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new k),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);let t=this._register(new Pie(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){let t=document.createElement(`canvas`).getContext(`2d`);return(e.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)}},sp=new class{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){let t=Jo(e),n=this.mapWindowIdToPixelRatioMonitor.get(t);return n||(n=Pn(new Fie(e)),this.mapWindowIdToPixelRatioMonitor.set(t,n),O.once(sne)(({vscodeWindowId:e})=>{e===t&&(n?.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))})),n}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}},Iie=class{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}},Lie=class e{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),this._container?.remove(),this._container=null,this._testElements=null}_createDomElements(){let t=document.createElement(`div`);t.style.position=`absolute`,t.style.top=`-50000px`,t.style.width=`50000px`;let n=document.createElement(`div`);ap(n,this._bareFontInfo),t.appendChild(n);let r=document.createElement(`div`);ap(r,this._bareFontInfo),r.style.fontWeight=`bold`,t.appendChild(r);let i=document.createElement(`div`);ap(i,this._bareFontInfo),i.style.fontStyle=`italic`,t.appendChild(i);let a=[];for(let t of this._requests){let o;t.type===0&&(o=n),t.type===2&&(o=r),t.type===1&&(o=i),o.appendChild(document.createElement(`br`));let s=document.createElement(`span`);e._render(s,t),o.appendChild(s),a.push(s)}this._container=t,this._testElements=a}static _render(e,t){if(t.chr===` `){let t=`\xA0`;for(let e=0;e<8;e++)t+=t;e.innerText=t}else{let n=t.chr;for(let e=0;e<8;e++)n+=n;e.textContent=n}}_readFromDomElements(){for(let e=0,t=this._requests.length;e<t;e++){let t=this._requests[e],n=this._testElements[e];t.fulfill(n.offsetWidth/256)}}};function Rie(e,t,n){new Lie(t,n).read(e)}var cp=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new k,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))}},lp=$t?1.5:1.35,up=class e{static _create(t,n,r,i,a,o,s,c,l){o===0?o=lp*r:o<8&&(o*=r),o=Math.round(o),o<8&&(o=8);let u=1+(l?0:cp.getZoomLevel()*.1);return r*=u,o*=u,a===`translate`&&(n===`normal`||n===`bold`?a=fp:(a=`'wght' ${parseInt(n,10)}`,n=`normal`)),new e({pixelRatio:c,fontFamily:t,fontWeight:n,fontSize:r,fontFeatureSettings:i,fontVariationSettings:a,lineHeight:o,letterSpacing:s})}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=e.lineHeight|0,this.letterSpacing=e.letterSpacing}getId(){return`${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`}getMassagedFontFamily(){let t=pp.fontFamily,n=e._wrapInQuotes(this.fontFamily);return this.fontFamily===t?n:`${n}, ${t}`}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}},dp=class extends up{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}},fp=`normal`,zie=`translate`,pp={fontFamily:$t?`Menlo, Monaco, 'Courier New', monospace`:Qt?`Consolas, 'Courier New', monospace`:`'Droid Sans Mono', 'monospace', monospace`,fontWeight:`normal`,fontSize:$t?12:14,lineHeight:0,letterSpacing:0},mp={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}},hp=class{constructor(e){this._values=e}hasChanged(e){return this._values[e]}},gp=class{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}},_p=class{constructor(e,t,n,r){this.id=e,this.name=t,this.defaultValue=n,this.schema=r}applyUpdate(e,t){return yp(e,t)}compute(e,t,n){return n}},vp=class{constructor(e,t){this.newValue=e,this.didChange=t}};function yp(e,t){if(typeof e!=`object`||typeof t!=`object`||!e||!t)return new vp(t,e!==t);if(Array.isArray(e)||Array.isArray(t))return new vp(t,!(Array.isArray(e)&&Array.isArray(t)&&va(e,t)));let n=!1;for(let r in t)if(t.hasOwnProperty(r)){let i=yp(e[r],t[r]);i.didChange&&(e[r]=i.newValue,n=!0)}return new vp(e,n)}var bp=class{constructor(e,t){this.schema=void 0,this.id=e,this.name=`_never_`,this.defaultValue=t}applyUpdate(e,t){return yp(e,t)}validate(e){return this.defaultValue}},xp=class{constructor(e,t,n,r){this.id=e,this.name=t,this.defaultValue=n,this.schema=r}applyUpdate(e,t){return yp(e,t)}compute(e,t,n){return n}};function Sp(e,t){return e===void 0?t:e===`false`?!1:!!e}var Cp=class extends xp{constructor(e,t,n,r=void 0){r!==void 0&&(r.type=`boolean`,r.default=n),super(e,t,n,r)}validate(e){return Sp(e,this.defaultValue)}};function wp(e,t,n,r){if(typeof e==`string`&&(e=parseInt(e,10)),typeof e!=`number`||isNaN(e))return t;let i=e;return i=Math.max(n,i),i=Math.min(r,i),i|0}var Tp=class e extends xp{static clampedInt(e,t,n,r){return wp(e,t,n,r)}constructor(e,t,n,r,i,a=void 0){a!==void 0&&(a.type=`integer`,a.default=n,a.minimum=r,a.maximum=i),super(e,t,n,a),this.minimum=r,this.maximum=i}validate(t){return e.clampedInt(t,this.defaultValue,this.minimum,this.maximum)}};function Bie(e,t,n,r){if(e===void 0)return t;let i=Ep.float(e,t);return Ep.clamp(i,n,r)}var Ep=class e extends xp{static clamp(e,t,n){return e<t?t:e>n?n:e}static float(e,t){return typeof e==`string`&&(e=parseFloat(e)),typeof e!=`number`||isNaN(e)?t:e}constructor(e,t,n,r,i,a,o){i!==void 0&&(i.type=`number`,i.default=n,i.minimum=a,i.maximum=o),super(e,t,n,i),this.validationFn=r,this.minimum=a,this.maximum=o}validate(t){return this.validationFn(e.float(t,this.defaultValue))}},Dp=class e extends xp{static string(e,t){return typeof e==`string`?e:t}constructor(e,t,n,r=void 0){r!==void 0&&(r.type=`string`,r.default=n),super(e,t,n,r)}validate(t){return e.string(t,this.defaultValue)}};function Op(e,t,n,r){return typeof e==`string`?r&&e in r?r[e]:n.indexOf(e)===-1?t:e:t}var kp=class extends xp{constructor(e,t,n,r,i=void 0){i!==void 0&&(i.type=`string`,i.enum=r.slice(0),i.default=n),super(e,t,n,i),this._allowedValues=r}validate(e){return Op(e,this.defaultValue,this._allowedValues)}},Ap=class extends _p{constructor(e,t,n,r,i,a,o=void 0){o!==void 0&&(o.type=`string`,o.enum=i,o.default=r),super(e,t,n,o),this._allowedValues=i,this._convert=a}validate(e){return typeof e!=`string`||this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}};function Vie(e){switch(e){case`none`:return 0;case`keep`:return 1;case`brackets`:return 2;case`advanced`:return 3;case`full`:return 4}}var Hie=class extends _p{constructor(){super(2,`accessibilitySupport`,0,{type:`string`,enum:[`auto`,`on`,`off`],enumDescriptions:[C(201,`Use platform APIs to detect when a Screen Reader is attached.`),C(202,`Optimize for usage with a Screen Reader.`),C(203,`Assume a screen reader is not attached.`)],default:`auto`,tags:[`accessibility`],description:C(204,`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,n){return n===0?e.accessibilitySupport:n}},Uie=class extends _p{constructor(){let e={insertSpace:!0,ignoreEmptyLines:!0};super(29,`comments`,e,{"editor.comments.insertSpace":{type:`boolean`,default:e.insertSpace,description:C(205,`Controls whether a space character is inserted when commenting.`)},"editor.comments.ignoreEmptyLines":{type:`boolean`,default:e.ignoreEmptyLines,description:C(206,`Controls if empty lines should be ignored with toggle, add or remove actions for line comments.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{insertSpace:Sp(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:Sp(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}};function Wie(e){switch(e){case`blink`:return 1;case`smooth`:return 2;case`phase`:return 3;case`expand`:return 4;case`solid`:return 5}}var jp;(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`})(jp||={});function Mp(e){switch(e){case`line`:return jp.Line;case`block`:return jp.Block;case`underline`:return jp.Underline;case`line-thin`:return jp.LineThin;case`block-outline`:return jp.BlockOutline;case`underline-thin`:return jp.UnderlineThin}}var Gie=class extends bp{constructor(){super(162,``)}compute(e,t,n){let r=[`monaco-editor`];return t.get(48)&&r.push(t.get(48)),e.extraEditorClassName&&r.push(e.extraEditorClassName),t.get(82)===`default`?r.push(`mouse-default`):t.get(82)===`copy`&&r.push(`mouse-copy`),t.get(127)&&r.push(`showUnused`),t.get(157)&&r.push(`showDeprecated`),r.join(` `)}},Kie=class extends Cp{constructor(){super(45,`emptySelectionClipboard`,!0,{description:C(207,`Controls whether copying without a selection copies the current line.`)})}compute(e,t,n){return n&&e.emptySelectionClipboard}},qie=class extends _p{constructor(){let e={cursorMoveOnType:!0,findOnType:!0,seedSearchStringFromSelection:`always`,autoFindInSelection:`never`,globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0,history:`workspace`,replaceHistory:`workspace`};super(50,`find`,e,{"editor.find.cursorMoveOnType":{type:`boolean`,default:e.cursorMoveOnType,description:C(208,`Controls whether the cursor should jump to find matches while typing.`)},"editor.find.seedSearchStringFromSelection":{type:`string`,enum:[`never`,`always`,`selection`],default:e.seedSearchStringFromSelection,enumDescriptions:[C(209,`Never seed search string from the editor selection.`),C(210,`Always seed search string from the editor selection, including word at cursor position.`),C(211,`Only seed search string from the editor selection.`)],description:C(212,`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:[C(213,`Never turn on Find in Selection automatically (default).`),C(214,`Always turn on Find in Selection automatically.`),C(215,`Turn on Find in Selection automatically when multiple lines of content are selected.`)],description:C(216,`Controls the condition for turning on Find in Selection automatically.`)},"editor.find.globalFindClipboard":{type:`boolean`,default:e.globalFindClipboard,description:C(217,`Controls whether the Find Widget should read or modify the shared find clipboard on macOS.`),included:$t},"editor.find.addExtraSpaceOnTop":{type:`boolean`,default:e.addExtraSpaceOnTop,description:C(218,`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:C(219,`Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.`)},"editor.find.history":{type:`string`,enum:[`never`,`workspace`],default:`workspace`,enumDescriptions:[C(220,`Do not store search history from the find widget.`),C(221,`Store search history across the active workspace`)],description:C(222,`Controls how the find widget history should be stored`)},"editor.find.replaceHistory":{type:`string`,enum:[`never`,`workspace`],default:`workspace`,enumDescriptions:[C(223,`Do not store history from the replace widget.`),C(224,`Store replace history across the active workspace`)],description:C(225,`Controls how the replace widget history should be stored`)},"editor.find.findOnType":{type:`boolean`,default:e.findOnType,description:C(226,`Controls whether the Find Widget should search as you type.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{cursorMoveOnType:Sp(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),findOnType:Sp(t.findOnType,this.defaultValue.findOnType),seedSearchStringFromSelection:typeof t.seedSearchStringFromSelection==`boolean`?t.seedSearchStringFromSelection?`always`:`never`:Op(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,[`never`,`always`,`selection`]),autoFindInSelection:typeof t.autoFindInSelection==`boolean`?t.autoFindInSelection?`always`:`never`:Op(t.autoFindInSelection,this.defaultValue.autoFindInSelection,[`never`,`always`,`multiline`]),globalFindClipboard:Sp(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:Sp(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:Sp(t.loop,this.defaultValue.loop),history:Op(t.history,this.defaultValue.history,[`never`,`workspace`]),replaceHistory:Op(t.replaceHistory,this.defaultValue.replaceHistory,[`never`,`workspace`])}}},Np=class e extends _p{static{this.OFF=`"liga" off, "calt" off`}static{this.ON=`"liga" on, "calt" on`}constructor(){super(60,`fontLigatures`,e.OFF,{anyOf:[{type:`boolean`,description:C(227,`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:C(228,`Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.`)}],description:C(229,`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(t){return t===void 0?this.defaultValue:typeof t==`string`?t===`false`||t.length===0?e.OFF:t===`true`?e.ON:t:t?e.ON:e.OFF}},Jie=class e extends _p{static{this.OFF=fp}static{this.TRANSLATE=zie}constructor(){super(63,`fontVariations`,e.OFF,{anyOf:[{type:`boolean`,description:C(230,`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:C(231,`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:C(232,`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(t){return t===void 0?this.defaultValue:typeof t==`string`?t===`false`?e.OFF:t===`true`?e.TRANSLATE:t:t?e.TRANSLATE:e.OFF}compute(e,t,n){return e.fontInfo.fontVariationSettings}},Yie=class extends bp{constructor(){super(59,new dp({pixelRatio:0,fontFamily:``,fontWeight:``,fontSize:0,fontFeatureSettings:``,fontVariationSettings:``,lineHeight:0,letterSpacing:0,isMonospace:!1,typicalHalfwidthCharacterWidth:0,typicalFullwidthCharacterWidth:0,canUseHalfwidthRightwardsArrow:!1,spaceWidth:0,middotWidth:0,wsmiddotWidth:0,maxDigitWidth:0},!1))}compute(e,t,n){return e.fontInfo}},Xie=class extends bp{constructor(){super(161,jp.Line)}compute(e,t,n){return e.inputMode===`overtype`?t.get(92):t.get(34)}},Pp=class extends bp{constructor(){super(170,!1)}compute(e,t){return e.editContextSupported&&t.get(44)}},Fp=class extends bp{constructor(){super(172,!1)}compute(e,t){return e.accessibilitySupport===2?t.get(7):t.get(6)}},Ip=class extends xp{constructor(){super(61,`fontSize`,pp.fontSize,{type:`number`,minimum:6,maximum:100,default:pp.fontSize,description:C(233,`Controls the font size in pixels.`)})}validate(e){let t=Ep.float(e,this.defaultValue);return t===0?pp.fontSize:Ep.clamp(t,6,100)}compute(e,t,n){return e.fontInfo.fontSize}},Lp=class e extends _p{static{this.SUGGESTION_VALUES=[`normal`,`bold`,`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`]}static{this.MINIMUM_VALUE=1}static{this.MAXIMUM_VALUE=1e3}constructor(){super(62,`fontWeight`,pp.fontWeight,{anyOf:[{type:`number`,minimum:e.MINIMUM_VALUE,maximum:e.MAXIMUM_VALUE,errorMessage:C(234,`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:e.SUGGESTION_VALUES}],default:pp.fontWeight,description:C(235,`Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.`)})}validate(t){return t===`normal`||t===`bold`?t:String(Tp.clampedInt(t,pp.fontWeight,e.MINIMUM_VALUE,e.MAXIMUM_VALUE))}},Rp=class extends _p{constructor(){let e={multiple:`peek`,multipleDefinitions:`peek`,multipleTypeDefinitions:`peek`,multipleDeclarations:`peek`,multipleImplementations:`peek`,multipleReferences:`peek`,multipleTests:`peek`,alternativeDefinitionCommand:`editor.action.goToReferences`,alternativeTypeDefinitionCommand:`editor.action.goToReferences`,alternativeDeclarationCommand:`editor.action.goToReferences`,alternativeImplementationCommand:``,alternativeReferenceCommand:``,alternativeTestsCommand:``},t={type:`string`,enum:[`peek`,`gotoAndPeek`,`goto`],default:e.multiple,enumDescriptions:[C(236,`Show Peek view of the results (default)`),C(237,`Go to the primary result and show a Peek view`),C(238,`Go to the primary result and enable Peek-less navigation to others`)]},n=[``,`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(67,`gotoLocation`,e,{"editor.gotoLocation.multiple":{deprecationMessage:C(239,`This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.`)},"editor.gotoLocation.multipleDefinitions":{description:C(240,`Controls the behavior the 'Go to Definition'-command when multiple target locations exist.`),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:C(241,`Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.`),...t},"editor.gotoLocation.multipleDeclarations":{description:C(242,`Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.`),...t},"editor.gotoLocation.multipleImplementations":{description:C(243,`Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.`),...t},"editor.gotoLocation.multipleReferences":{description:C(244,`Controls the behavior the 'Go to References'-command when multiple target locations exist.`),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:`string`,default:e.alternativeDefinitionCommand,enum:n,description:C(245,`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:n,description:C(246,`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:n,description:C(247,`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:n,description:C(248,`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:n,description:C(249,`Alternative command id that is being executed when the result of 'Go to Reference' is the current location.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{multiple:Op(t.multiple,this.defaultValue.multiple,[`peek`,`gotoAndPeek`,`goto`]),multipleDefinitions:Op(t.multipleDefinitions,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleTypeDefinitions:Op(t.multipleTypeDefinitions,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleDeclarations:Op(t.multipleDeclarations,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleImplementations:Op(t.multipleImplementations,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleReferences:Op(t.multipleReferences,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleTests:Op(t.multipleTests,`peek`,[`peek`,`gotoAndPeek`,`goto`]),alternativeDefinitionCommand:Dp.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Dp.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Dp.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Dp.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Dp.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:Dp.string(t.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}},zp=class extends _p{constructor(){let e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(69,`hover`,e,{"editor.hover.enabled":{type:`boolean`,default:e.enabled,description:C(250,`Controls whether the hover is shown.`)},"editor.hover.delay":{type:`number`,default:e.delay,minimum:0,maximum:1e4,description:C(251,`Controls the delay in milliseconds after which the hover is shown.`)},"editor.hover.sticky":{type:`boolean`,default:e.sticky,description:C(252,`Controls whether the hover should remain visible when mouse is moved over it.`)},"editor.hover.hidingDelay":{type:`integer`,minimum:0,default:e.hidingDelay,markdownDescription:C(253,"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:C(254,`Prefer showing hovers above the line, if there's space.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:Sp(t.enabled,this.defaultValue.enabled),delay:Tp.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:Sp(t.sticky,this.defaultValue.sticky),hidingDelay:Tp.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:Sp(t.above,this.defaultValue.above)}}},Bp=class e extends bp{constructor(){super(165,{width:0,height:0,glyphMarginLeft:0,glyphMarginWidth:0,glyphMarginDecorationLaneCount:0,lineNumbersLeft:0,lineNumbersWidth:0,decorationsLeft:0,decorationsWidth:0,contentLeft:0,contentWidth:0,minimap:{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:0,minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:0},viewportColumn:0,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1,verticalScrollbarWidth:0,horizontalScrollbarHeight:0,overviewRuler:{top:0,width:0,height:0,right:0}})}compute(t,n,r){return e.computeLayout(n,{memory:t.memory,outerWidth:t.outerWidth,outerHeight:t.outerHeight,isDominatedByLongLines:t.isDominatedByLongLines,lineHeight:t.fontInfo.lineHeight,viewLineCount:t.viewLineCount,lineNumbersDigitCount:t.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:t.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:t.fontInfo.maxDigitWidth,pixelRatio:t.pixelRatio,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){let t=e.height/e.lineHeight,n=Math.floor(e.paddingTop/e.lineHeight),r=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(r=Math.max(r,t-1));let i=(n+e.viewLineCount+r)/(e.pixelRatio*e.height),a=Math.floor(e.viewLineCount/i);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:n,extraLinesBeyondLastLine:r,desiredRatio:i,minimapLineCount:a}}static _computeMinimapLayout(t,n){let r=t.outerWidth,i=t.outerHeight,a=t.pixelRatio;if(!t.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(a*i),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:i};let o=n.stableMinimapLayoutInput,s=o&&t.outerHeight===o.outerHeight&&t.lineHeight===o.lineHeight&&t.typicalHalfwidthCharacterWidth===o.typicalHalfwidthCharacterWidth&&t.pixelRatio===o.pixelRatio&&t.scrollBeyondLastLine===o.scrollBeyondLastLine&&t.paddingTop===o.paddingTop&&t.paddingBottom===o.paddingBottom&&t.minimap.enabled===o.minimap.enabled&&t.minimap.side===o.minimap.side&&t.minimap.size===o.minimap.size&&t.minimap.showSlider===o.minimap.showSlider&&t.minimap.renderCharacters===o.minimap.renderCharacters&&t.minimap.maxColumn===o.minimap.maxColumn&&t.minimap.scale===o.minimap.scale&&t.verticalScrollbarWidth===o.verticalScrollbarWidth&&t.isViewportWrapping===o.isViewportWrapping,c=t.lineHeight,l=t.typicalHalfwidthCharacterWidth,u=t.scrollBeyondLastLine,d=t.minimap.renderCharacters,f=a>=2?Math.round(t.minimap.scale*2):t.minimap.scale,p=t.minimap.maxColumn,m=t.minimap.size,h=t.minimap.side,g=t.verticalScrollbarWidth,_=t.viewLineCount,v=t.remainingWidth,y=t.isViewportWrapping,b=d?2:3,x=Math.floor(a*i),S=x/a,ee=!1,te=!1,ne=b*f,re=f/a,ie=1;if(m===`fill`||m===`fit`){let{typicalViewportLineCount:r,extraLinesBeforeFirstLine:o,extraLinesBeyondLastLine:l,desiredRatio:d,minimapLineCount:p}=e.computeContainedMinimapLineCount({viewLineCount:_,scrollBeyondLastLine:u,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,height:i,lineHeight:c,pixelRatio:a});if(_/p>1)ee=!0,te=!0,f=1,ne=1,re=f/a;else{let e=!1,i=f+1;if(m===`fit`){let t=Math.ceil((o+_+l)*ne);y&&s&&v<=n.stableFitRemainingWidth?(e=!0,i=n.stableFitMaxMinimapScale):e=t>x}if(m===`fill`||e){ee=!0;let e=f;ne=Math.min(c*a,Math.max(1,Math.floor(1/d))),y&&s&&v<=n.stableFitRemainingWidth&&(i=n.stableFitMaxMinimapScale),f=Math.min(i,Math.max(1,Math.floor(ne/b))),f>e&&(ie=Math.min(2,f/e)),re=f/a/ie,x=Math.ceil(Math.max(r,o+_+l)*ne),y?(n.stableMinimapLayoutInput=t,n.stableFitRemainingWidth=v,n.stableFitMaxMinimapScale=f):(n.stableMinimapLayoutInput=null,n.stableFitRemainingWidth=0)}}}let ae=Math.floor(p*re),oe=Math.min(ae,Math.max(0,Math.floor((v-g-2)*re/(l+re)))+8),se=Math.floor(a*oe),ce=se/a;return se=Math.floor(se*ie),{renderMinimap:d?1:2,minimapLeft:h===`left`?0:r-oe-g,minimapWidth:oe,minimapHeightIsEditorHeight:ee,minimapIsSampling:te,minimapScale:f,minimapLineHeight:ne,minimapCanvasInnerWidth:se,minimapCanvasInnerHeight:x,minimapCanvasOuterWidth:ce,minimapCanvasOuterHeight:S}}static computeLayout(t,n){let r=n.outerWidth|0,i=n.outerHeight|0,a=n.lineHeight|0,o=n.lineNumbersDigitCount|0,s=n.typicalHalfwidthCharacterWidth,c=n.maxDigitWidth,l=n.pixelRatio,u=n.viewLineCount,d=t.get(154),f=d===`inherit`?t.get(153):d,p=f===`inherit`?t.get(149):f,m=t.get(152),h=n.isDominatedByLongLines,g=t.get(66),_=t.get(76).renderType!==0,v=t.get(77),y=t.get(119),b=t.get(96),x=t.get(81),S=t.get(117),ee=S.verticalScrollbarSize,te=S.verticalHasArrows,ne=S.arrowSize,re=S.horizontalScrollbarSize,ie=t.get(52),ae=t.get(126)!==`never`,oe=t.get(74);ie&&ae&&(oe+=16);let se=0;_&&(se=Math.round(Math.max(o,v)*c));let ce=0;g&&(ce=a*n.glyphMarginDecorationLaneCount);let le=0,ue=le+ce,de=ue+se,fe=de+oe,pe=r-ce-se-oe,me=!1,he=!1,ge=-1;t.get(2)===2&&f===`inherit`&&h?(me=!0,he=!0):p===`on`||p===`bounded`?he=!0:p===`wordWrapColumn`&&(ge=m);let _e=e._computeMinimapLayout({outerWidth:r,outerHeight:i,lineHeight:a,typicalHalfwidthCharacterWidth:s,pixelRatio:l,scrollBeyondLastLine:y,paddingTop:b.top,paddingBottom:b.bottom,minimap:x,verticalScrollbarWidth:ee,viewLineCount:u,remainingWidth:pe,isViewportWrapping:he},n.memory||new gp);_e.renderMinimap!==0&&_e.minimapLeft===0&&(le+=_e.minimapWidth,ue+=_e.minimapWidth,de+=_e.minimapWidth,fe+=_e.minimapWidth);let ve=pe-_e.minimapWidth,ye=Math.max(1,Math.floor((ve-ee-2)/s)),be=te?ne:0;return he&&(ge=Math.max(1,ye),p===`bounded`&&(ge=Math.min(ge,m))),{width:r,height:i,glyphMarginLeft:le,glyphMarginWidth:ce,glyphMarginDecorationLaneCount:n.glyphMarginDecorationLaneCount,lineNumbersLeft:ue,lineNumbersWidth:se,decorationsLeft:de,decorationsWidth:oe,contentLeft:fe,contentWidth:ve,minimap:_e,viewportColumn:ye,isWordWrapMinified:me,isViewportWrapping:he,wrappingColumn:ge,verticalScrollbarWidth:ee,horizontalScrollbarHeight:re,overviewRuler:{top:be,width:ee,height:i-2*be,right:0}}}},Vp=class extends _p{constructor(){super(156,`wrappingStrategy`,`simple`,{"editor.wrappingStrategy":{enumDescriptions:[C(255,`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.`),C(256,`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:C(257,`Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.`)}})}validate(e){return Op(e,`simple`,[`simple`,`advanced`])}compute(e,t,n){return t.get(2)===2?`advanced`:n}},Hp;(function(e){e.Off=`off`,e.OnCode=`onCode`,e.On=`on`})(Hp||={});var Zie=class extends _p{constructor(){let e={enabled:Hp.OnCode};super(73,`lightbulb`,e,{"editor.lightbulb.enabled":{type:`string`,enum:[Hp.Off,Hp.OnCode,Hp.On],default:e.enabled,enumDescriptions:[C(258,`Disable the code action menu.`),C(259,`Show the code action menu when the cursor is on lines with code.`),C(260,`Show the code action menu when the cursor is on lines with code or on empty lines.`)],description:C(261,`Enables the Code Action lightbulb in the editor.`)}})}validate(e){return!e||typeof e!=`object`?this.defaultValue:{enabled:Op(e.enabled,this.defaultValue.enabled,[Hp.Off,Hp.OnCode,Hp.On])}}},Qie=class extends _p{constructor(){let e={enabled:!0,maxLineCount:5,defaultModel:`outlineModel`,scrollWithEditor:!0};super(131,`stickyScroll`,e,{"editor.stickyScroll.enabled":{type:`boolean`,default:e.enabled,description:C(262,`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:20,description:C(263,`Defines the maximum number of sticky lines to show.`)},"editor.stickyScroll.defaultModel":{type:`string`,enum:[`outlineModel`,`foldingProviderModel`,`indentationModel`],default:e.defaultModel,description:C(264,`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:C(265,`Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:Sp(t.enabled,this.defaultValue.enabled),maxLineCount:Tp.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:Op(t.defaultModel,this.defaultValue.defaultModel,[`outlineModel`,`foldingProviderModel`,`indentationModel`]),scrollWithEditor:Sp(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}},$ie=class extends _p{constructor(){let e={enabled:`on`,fontSize:0,fontFamily:``,padding:!1,maximumLength:43};super(159,`inlayHints`,e,{"editor.inlayHints.enabled":{type:`string`,default:e.enabled,description:C(266,`Enables the inlay hints in the editor.`),enum:[`on`,`onUnlessPressed`,`offUnlessPressed`,`off`],markdownEnumDescriptions:[C(267,`Inlay hints are enabled`),C(268,`Inlay hints are showing by default and hide when holding {0}`,$t?`Ctrl+Option`:`Ctrl+Alt`),C(269,`Inlay hints are hidden by default and show when holding {0}`,$t?`Ctrl+Option`:`Ctrl+Alt`),C(270,`Inlay hints are disabled`)]},"editor.inlayHints.fontSize":{type:`number`,default:e.fontSize,markdownDescription:C(271,`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:C(272,`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:C(273,`Enables the padding around the inlay hints in the editor.`)},"editor.inlayHints.maximumLength":{type:`number`,default:e.maximumLength,markdownDescription:C(274,"Maximum overall length of inlay hints, for a single line, before they get truncated by the editor. Set to `0` to never truncate")}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return typeof t.enabled==`boolean`&&(t.enabled=t.enabled?`on`:`off`),{enabled:Op(t.enabled,this.defaultValue.enabled,[`on`,`off`,`offUnlessPressed`,`onUnlessPressed`]),fontSize:Tp.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Dp.string(t.fontFamily,this.defaultValue.fontFamily),padding:Sp(t.padding,this.defaultValue.padding),maximumLength:Tp.clampedInt(t.maximumLength,this.defaultValue.maximumLength,0,2**53-1)}}},eae=class extends _p{constructor(){super(74,`lineDecorationsWidth`,10)}validate(e){return typeof e==`string`&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):Tp.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,n){return n<0?Tp.clampedInt(-n*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):n}},tae=class extends Ep{constructor(){super(75,`lineHeight`,pp.lineHeight,e=>Ep.clamp(e,0,150),{markdownDescription:C(275,`Controls the line height.
51
+ `,constraint:function(e){if(!kt(e))return!1;let t=e;return!(!At(t.lineNumber)&&!Ot(t.lineNumber)||!Nt(t.at)&&!Ot(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`}})(Kf||={});var qf=class{constructor(e){e.addImplementation(1e4,`code-editor`,(e,t)=>{let n=e.get(mc).getFocusedCodeEditor();return n&&n.hasTextFocus()?this._runEditorCommand(e,n,t):!1}),e.addImplementation(1e3,`generic-dom-input-textarea`,(e,t)=>{let n=Cs();return n&&Ks(n)?(this.runDOMCommand(n),!0):!1}),e.addImplementation(0,`generic-dom`,(e,t)=>{let n=e.get(mc).getActiveCodeEditor();return n?(n.focus(),this._runEditorCommand(e,n,t)):!1})}_runEditorCommand(e,t,n){return this.runEditorCommand(e,t,n)||!0}},Jf;(function(e){class t extends Wf{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[id.moveTo(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)])&&t.revealType!==2&&e.revealAllCursors(t.source,!0,!0))}}e.MoveTo=V(new t({id:`_moveTo`,inSelectionMode:!1,precondition:void 0})),e.MoveToSelect=V(new t({id:`_moveToSelect`,inSelectionMode:!0,precondition:void 0}));class n extends Wf{runCoreEditorCommand(e,t){e.model.pushStackElement();let n=this._getColumnSelectResult(e,e.getPrimaryCursorState(),e.getCursorColumnSelectData(),t);n!==null&&(e.setCursorStates(t.source,3,n.viewStates.map(e=>yu.fromViewState(e))),e.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:n.fromLineNumber,fromViewVisualColumn:n.fromVisualColumn,toViewLineNumber:n.toLineNumber,toViewVisualColumn:n.toVisualColumn}),n.reversed?e.revealTopMostCursor(t.source):e.revealBottomMostCursor(t.source))}}e.ColumnSelect=V(new class extends n{constructor(){super({id:`columnSelect`,precondition:void 0})}_getColumnSelectResult(e,t,n,r){if(r.position===void 0||r.viewPosition===void 0||r.mouseColumn===void 0)return null;let i=e.model.validatePosition(r.position),a=e.coordinatesConverter.validateViewPosition(new F(r.viewPosition.lineNumber,r.viewPosition.column),i),o=r.doColumnSelect?n.fromViewLineNumber:a.lineNumber,s=r.doColumnSelect?n.fromViewVisualColumn:r.mouseColumn-1;return Cu.columnSelect(e.cursorConfig,e,o,s,a.lineNumber,r.mouseColumn-1)}}),e.CursorColumnSelectLeft=V(new class extends n{constructor(){super({id:`cursorColumnSelectLeft`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(e,t,n,r){return Cu.columnSelectLeft(e.cursorConfig,e,n)}}),e.CursorColumnSelectRight=V(new class extends n{constructor(){super({id:`cursorColumnSelectRight`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(e,t,n,r){return Cu.columnSelectRight(e.cursorConfig,e,n)}});class r extends n{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,n,r){return Cu.columnSelectUp(e.cursorConfig,e,n,this._isPaged)}}e.CursorColumnSelectUp=V(new r({isPaged:!1,id:`cursorColumnSelectUp`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:3600,linux:{primary:0}}})),e.CursorColumnSelectPageUp=V(new r({isPaged:!0,id:`cursorColumnSelectPageUp`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:3595,linux:{primary:0}}}));class i extends n{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,n,r){return Cu.columnSelectDown(e.cursorConfig,e,n,this._isPaged)}}e.CursorColumnSelectDown=V(new i({isPaged:!1,id:`cursorColumnSelectDown`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:3602,linux:{primary:0}}})),e.CursorColumnSelectPageDown=V(new i({isPaged:!0,id:`cursorColumnSelectPageDown`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:3596,linux:{primary:0}}}));class a extends Wf{constructor(){super({id:`cursorMove`,precondition:void 0,metadata:ad.metadata})}runCoreEditorCommand(e,t){let n=ad.parse(t);n&&this._runCursorMove(e,t.source,n)}_runCursorMove(e,t,n){let r=n.noHistory?`api`:t;e.model.pushStackElement(),e.setCursorStates(r,3,a._move(e,e.getCursorStates(),n)),e.revealAllCursors(r,!0)}static _move(e,t,n){let r=n.select,i=n.value;switch(n.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return id.simpleMove(e,t,n.direction,r,i,n.unit);case 11:case 13:case 12:case 14:return id.viewportMove(e,t,n.direction,r,i);default:return null}}}e.CursorMoveImpl=a,e.CursorMove=V(new a);class o extends Wf{constructor(e){super(e),this._staticArgs=e.args}runCoreEditorCommand(e,t){let n=this._staticArgs;this._staticArgs.value===-1&&(n={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,id.simpleMove(e,e.getCursorStates(),n.direction,n.select,n.value,n.unit)),e.revealAllCursors(t.source,!0)}}e.CursorLeft=V(new o({args:{direction:0,unit:0,select:!1,value:1},id:`cursorLeft`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),e.CursorLeftSelect=V(new o({args:{direction:0,unit:0,select:!0,value:1},id:`cursorLeftSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:1039}})),e.CursorRight=V(new o({args:{direction:1,unit:0,select:!1,value:1},id:`cursorRight`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),e.CursorRightSelect=V(new o({args:{direction:1,unit:0,select:!0,value:1},id:`cursorRightSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:1041}})),e.CursorUp=V(new o({args:{direction:2,unit:2,select:!1,value:1},id:`cursorUp`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),e.CursorUpSelect=V(new o({args:{direction:2,unit:2,select:!0,value:1},id:`cursorUpSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),e.CursorPageUp=V(new o({args:{direction:2,unit:2,select:!1,value:-1},id:`cursorPageUp`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:11}})),e.CursorPageUpSelect=V(new o({args:{direction:2,unit:2,select:!0,value:-1},id:`cursorPageUpSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:1035}})),e.CursorDown=V(new o({args:{direction:3,unit:2,select:!1,value:1},id:`cursorDown`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),e.CursorDownSelect=V(new o({args:{direction:3,unit:2,select:!0,value:1},id:`cursorDownSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),e.CursorPageDown=V(new o({args:{direction:3,unit:2,select:!1,value:-1},id:`cursorPageDown`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:12}})),e.CursorPageDownSelect=V(new o({args:{direction:3,unit:2,select:!0,value:-1},id:`cursorPageDownSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:1036}})),e.CreateCursor=V(new class extends Wf{constructor(){super({id:`createCursor`,precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;let n;n=t.wholeLine?id.line(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition):id.moveTo(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition);let r=e.getCursorStates();if(r.length>1){let i=n.modelState?n.modelState.position:null,a=n.viewState?n.viewState.position:null;for(let n=0,o=r.length;n<o;n++){let o=r[n];if(!(i&&!o.modelState.selection.containsPosition(i))&&!(a&&!o.viewState.selection.containsPosition(a))){r.splice(n,1),e.model.pushStackElement(),e.setCursorStates(t.source,3,r);return}}}r.push(n),e.model.pushStackElement(),e.setCursorStates(t.source,3,r)}}),e.LastCursorMoveToSelect=V(new class extends Wf{constructor(){super({id:`_lastCursorMoveToSelect`,precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;let n=e.getLastAddedCursorIndex(),r=e.getCursorStates(),i=r.slice(0);i[n]=id.moveTo(e,r[n],!0,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,i)}});class s extends Wf{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,id.moveToBeginningOfLine(e,e.getCursorStates(),this._inSelectionMode)),e.revealAllCursors(t.source,!0)}}e.CursorHome=V(new s({inSelectionMode:!1,id:`cursorHome`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:14,mac:{primary:14,secondary:[2063]}}})),e.CursorHomeSelect=V(new s({inSelectionMode:!0,id:`cursorHomeSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:1038,mac:{primary:1038,secondary:[3087]}}}));class c extends Wf{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,this._exec(e.getCursorStates())),e.revealAllCursors(t.source,!0)}_exec(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n],i=r.modelState.position.lineNumber;t[n]=yu.fromModelState(r.modelState.move(this._inSelectionMode,i,1,0))}return t}}e.CursorLineStart=V(new c({inSelectionMode:!1,id:`cursorLineStart`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:0,mac:{primary:287}}})),e.CursorLineStartSelect=V(new c({inSelectionMode:!0,id:`cursorLineStartSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:0,mac:{primary:1311}}}));class l extends Wf{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,id.moveToEndOfLine(e,e.getCursorStates(),this._inSelectionMode,t.sticky||!1)),e.revealAllCursors(t.source,!0)}}e.CursorEnd=V(new l({inSelectionMode:!1,id:`cursorEnd`,precondition:void 0,kbOpts:{args:{sticky:!1},weight:Uf,kbExpr:G.textInputFocus,primary:13,mac:{primary:13,secondary:[2065]}},metadata:{description:`Go to End`,args:[{name:`args`,schema:{type:`object`,properties:{sticky:{description:C(66,`Stick to the end even when going to longer lines`),type:`boolean`,default:!1}}}}]}})),e.CursorEndSelect=V(new l({inSelectionMode:!0,id:`cursorEndSelect`,precondition:void 0,kbOpts:{args:{sticky:!1},weight:Uf,kbExpr:G.textInputFocus,primary:1037,mac:{primary:1037,secondary:[3089]}},metadata:{description:`Select to End`,args:[{name:`args`,schema:{type:`object`,properties:{sticky:{description:C(67,`Stick to the end even when going to longer lines`),type:`boolean`,default:!1}}}}]}}));class u extends Wf{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.revealAllCursors(t.source,!0)}_exec(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r],a=i.modelState.position.lineNumber,o=e.model.getLineMaxColumn(a);n[r]=yu.fromModelState(i.modelState.move(this._inSelectionMode,a,o,0))}return n}}e.CursorLineEnd=V(new u({inSelectionMode:!1,id:`cursorLineEnd`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:0,mac:{primary:291}}})),e.CursorLineEndSelect=V(new u({inSelectionMode:!0,id:`cursorLineEndSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:0,mac:{primary:1315}}}));class d extends Wf{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,id.moveToBeginningOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealAllCursors(t.source,!0)}}e.CursorTop=V(new d({inSelectionMode:!1,id:`cursorTop`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:2062,mac:{primary:2064}}})),e.CursorTopSelect=V(new d({inSelectionMode:!0,id:`cursorTopSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:3086,mac:{primary:3088}}}));class f extends Wf{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,id.moveToEndOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealAllCursors(t.source,!0)}}e.CursorBottom=V(new f({inSelectionMode:!1,id:`cursorBottom`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:2061,mac:{primary:2066}}})),e.CursorBottomSelect=V(new f({inSelectionMode:!0,id:`cursorBottomSelect`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:3085,mac:{primary:3090}}}));class p extends Wf{constructor(){super({id:`editorScroll`,precondition:void 0,metadata:Gf.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){let n=Gf.parse(t);if(!n)return;let r=this.determineScrollMethod(n);r&&r(e,t.source,n)}_runVerticalEditorScroll(e,t,n){let r=this._computeDesiredScrollTop(e,n);if(n.revealCursor){let i=e.getCompletelyVisibleViewRangeAtScrollTop(r);e.setCursorStates(t,3,[id.findPositionInViewportIfOutside(e,e.getPrimaryCursorState(),i,n.select)])}e.viewLayout.setScrollPosition({scrollTop:r},0)}_computeDesiredScrollTop(e,t){if(t.unit===1){let n=e.viewLayout.getFutureViewport(),r=e.getCompletelyVisibleViewRangeAtScrollTop(n.top),i=e.coordinatesConverter.convertViewRangeToModelRange(r),a;a=t.direction===1?Math.max(1,i.startLineNumber-t.value):Math.min(e.model.getLineCount(),i.startLineNumber+t.value);let o=e.coordinatesConverter.convertModelPositionToViewPosition(new F(a,1));return e.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber)}if(t.unit===5){let n=0;return t.direction===3&&(n=e.model.getLineCount()-e.cursorConfig.pageSize),e.viewLayout.getVerticalOffsetForLineNumber(n)}let n;n=t.unit===3?e.cursorConfig.pageSize*t.value:t.unit===4?Math.round(e.cursorConfig.pageSize/2)*t.value:t.value;let r=(t.direction===1?-1:1)*n;return e.viewLayout.getCurrentScrollTop()+r*e.cursorConfig.lineHeight}_runHorizontalEditorScroll(e,t,n){let r=this._computeDesiredScrollLeft(e,n);e.viewLayout.setScrollPosition({scrollLeft:r},0)}_computeDesiredScrollLeft(e,t){let n=(t.direction===4?-1:1)*t.value;return e.viewLayout.getCurrentScrollLeft()+n*e.cursorConfig.typicalHalfwidthCharacterWidth}}e.EditorScrollImpl=p,e.EditorScroll=V(new p),e.ScrollLineUp=V(new class extends Wf{constructor(){super({id:`scrollLineUp`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:2064,mac:{primary:267}}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:Gf.RawDirection.Up,by:Gf.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:n.source})}}),e.ScrollPageUp=V(new class extends Wf{constructor(){super({id:`scrollPageUp`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:2059,win:{primary:523},linux:{primary:523}}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:Gf.RawDirection.Up,by:Gf.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:n.source})}}),e.ScrollEditorTop=V(new class extends Wf{constructor(){super({id:`scrollEditorTop`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:Gf.RawDirection.Up,by:Gf.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:n.source})}}),e.ScrollLineDown=V(new class extends Wf{constructor(){super({id:`scrollLineDown`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:2066,mac:{primary:268}}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:Gf.RawDirection.Down,by:Gf.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:n.source})}}),e.ScrollPageDown=V(new class extends Wf{constructor(){super({id:`scrollPageDown`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:2060,win:{primary:524},linux:{primary:524}}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:Gf.RawDirection.Down,by:Gf.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:n.source})}}),e.ScrollEditorBottom=V(new class extends Wf{constructor(){super({id:`scrollEditorBottom`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:Gf.RawDirection.Down,by:Gf.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:n.source})}}),e.ScrollLeft=V(new class extends Wf{constructor(){super({id:`scrollLeft`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:Gf.RawDirection.Left,by:Gf.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:n.source})}}),e.ScrollRight=V(new class extends Wf{constructor(){super({id:`scrollRight`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:Gf.RawDirection.Right,by:Gf.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:n.source})}});class m extends Wf{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[id.word(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position)]),t.revealType!==2&&e.revealAllCursors(t.source,!0,!0))}}e.WordSelect=V(new m({inSelectionMode:!1,id:`_wordSelect`,precondition:void 0})),e.WordSelectDrag=V(new m({inSelectionMode:!0,id:`_wordSelectDrag`,precondition:void 0})),e.LastCursorWordSelect=V(new class extends Wf{constructor(){super({id:`lastCursorWordSelect`,precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;let n=e.getLastAddedCursorIndex(),r=e.getCursorStates(),i=r.slice(0),a=r[n];i[n]=id.word(e,a,a.modelState.hasSelection(),t.position),e.model.pushStackElement(),e.setCursorStates(t.source,3,i)}});class h extends Wf{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[id.line(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)]),t.revealType!==2&&e.revealAllCursors(t.source,!1,!0))}}e.LineSelect=V(new h({inSelectionMode:!1,id:`_lineSelect`,precondition:void 0})),e.LineSelectDrag=V(new h({inSelectionMode:!0,id:`_lineSelectDrag`,precondition:void 0}));class g extends Wf{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){if(!t.position)return;let n=e.getLastAddedCursorIndex(),r=e.getCursorStates(),i=r.slice(0);i[n]=id.line(e,r[n],this._inSelectionMode,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,i)}}e.LastCursorLineSelect=V(new g({inSelectionMode:!1,id:`lastCursorLineSelect`,precondition:void 0})),e.LastCursorLineSelectDrag=V(new g({inSelectionMode:!0,id:`lastCursorLineSelectDrag`,precondition:void 0})),e.CancelSelection=V(new class extends Wf{constructor(){super({id:`cancelSelection`,precondition:G.hasNonEmptySelection,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[id.cancelSelection(e,e.getPrimaryCursorState())]),e.revealAllCursors(t.source,!0)}}),e.RemoveSecondaryCursors=V(new class extends Wf{constructor(){super({id:`removeSecondaryCursors`,precondition:G.hasMultipleSelections,kbOpts:{weight:1,kbExpr:G.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[e.getPrimaryCursorState()]),e.revealAllCursors(t.source,!0),lc(C(68,`Removed secondary cursors`))}}),e.RevealLine=V(new class extends Wf{constructor(){super({id:`revealLine`,precondition:void 0,metadata:Kf.metadata})}runCoreEditorCommand(e,t){let n=t,r=n.lineNumber||0,i=typeof r==`number`?r+1:parseInt(r)+1;i<1&&(i=1);let a=e.model.getLineCount();i>a&&(i=a);let o=new U(i,1,i,e.model.getLineMaxColumn(i)),s=0;if(n.at)switch(n.at){case Kf.RawAtArgument.Top:s=3;break;case Kf.RawAtArgument.Center:s=1;break;case Kf.RawAtArgument.Bottom:s=4;break}let c=e.coordinatesConverter.convertModelRangeToViewRange(o);e.revealRange(t.source,!1,c,s,0)}}),e.SelectAll=new class extends qf{constructor(){super(lre)}runDOMCommand(e){tt&&(e.focus(),e.select()),e.ownerDocument.execCommand(`selectAll`)}runEditorCommand(e,t,n){let r=t._getViewModel();r&&this.runCoreEditorCommand(r,n)}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(`keyboard`,3,[id.selectAll(e,e.getPrimaryCursorState())])}},e.SetSelection=V(new class extends Wf{constructor(){super({id:`setSelection`,precondition:void 0})}runCoreEditorCommand(e,t){t.selection&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[yu.fromModelSelection(t.selection)]))}})})(Jf||={});var jie=R.and(G.textInputFocus,G.columnSelection);function Yf(e,t){al.registerKeybindingRule({id:e,primary:t,when:jie,weight:1})}Yf(Jf.CursorColumnSelectLeft.id,1039),Yf(Jf.CursorColumnSelectRight.id,1041),Yf(Jf.CursorColumnSelectUp.id,1040),Yf(Jf.CursorColumnSelectPageUp.id,1035),Yf(Jf.CursorColumnSelectDown.id,1042),Yf(Jf.CursorColumnSelectPageDown.id,1036);function Xf(e){return e.register(),e}var Zf;(function(e){class t extends nu{runEditorCommand(e,t,n){let r=t._getViewModel();r&&this.runCoreEditingCommand(t,r,n||{})}}e.CoreEditingCommand=t,e.LineBreakInsert=V(new class extends t{constructor(){super({id:`lineBreakInsert`,precondition:G.writable,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,jf.lineBreakInsert(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection)))}}),e.Outdent=V(new class extends t{constructor(){super({id:`outdent`,precondition:G.writable,kbOpts:{weight:Uf,kbExpr:R.and(G.editorTextFocus,G.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,Hf.outdent(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.Tab=V(new class extends t{constructor(){super({id:`tab`,precondition:G.writable,kbOpts:{weight:Uf,kbExpr:R.and(G.editorTextFocus,G.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,Hf.tab(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.DeleteLeft=V(new class extends t{constructor(){super({id:`deleteLeft`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(e,t,n){let[r,i]=Nu.deleteLeft(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection),t.getCursorAutoClosedCharacters());r&&e.pushUndoStop(),e.executeCommands(this.id,i),t.setPrevEditOperationType(2)}}),e.DeleteRight=V(new class extends t{constructor(){super({id:`deleteRight`,precondition:void 0,kbOpts:{weight:Uf,kbExpr:G.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(e,t,n){let[r,i]=Nu.deleteRight(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection));r&&e.pushUndoStop(),e.executeCommands(this.id,i),t.setPrevEditOperationType(3)}}),e.Undo=new class extends qf{constructor(){super(du)}runDOMCommand(e){e.ownerDocument.execCommand(`undo`)}runEditorCommand(e,t,n){if(!(!t.hasModel()||t.getOption(104)===!0))return t.getModel().undo()}},e.Redo=new class extends qf{constructor(){super(fu)}runDOMCommand(e){e.ownerDocument.execCommand(`redo`)}runEditorCommand(e,t,n){if(!(!t.hasModel()||t.getOption(104)===!0))return t.getModel().redo()}}})(Zf||={});var Qf=class extends $l{constructor(e,t,n){super({id:e,precondition:void 0,metadata:n}),this._handlerId=t}runCommand(e,t){let n=e.get(mc).getFocusedCodeEditor();n&&n.trigger(`keyboard`,this._handlerId,t)}};function $f(e,t){Xf(new Qf(`default:`+e,e)),Xf(new Qf(e,e,t))}$f(`type`,{description:`Type`,args:[{name:`args`,schema:{type:`object`,required:[`text`],properties:{text:{type:`string`}}}}]}),$f(`replacePreviousChar`),$f(`compositionType`),$f(`compositionStart`),$f(`compositionEnd`),$f(`paste`),$f(`cut`);var ep=pc(`markerDecorationsService`),Mie=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Nie=function(e,t){return function(n,r){t(n,r,e)}},tp=class{static{this.ID=`editor.contrib.markerDecorations`}constructor(e,t){}dispose(){}};tp=Mie([Nie(1,ep)],tp),su(tp.ID,tp,0);var np=class{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=``}focus(){this.domNode.focus()}setMaxWidth(e){let t=rp(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=rp(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=rp(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=rp(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=rp(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=rp(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=rp(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){let t=rp(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){let t=rp(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){let t=rp(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=rp(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 rp(e){return typeof e==`number`?`${e}px`:e}function ip(e){return new np(e)}function ap(e,t){e instanceof np?(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`)}var op=class extends D{constructor(e,t){super(),this._onDidChange=this._register(new k),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,t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()},n=!1,r=!1,i=()=>{if(n&&!r)try{n=!1,r=!0,t()}finally{as(Ko(this._referenceDomElement),()=>{r=!1,i()})}};this._resizeObserver=new ResizeObserver(t=>{e=t&&t[0]&&t[0].contentRect?{width:t[0].contentRect.width,height:t[0].contentRect.height}:null,n=!0,i()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&=(this._resizeObserver.disconnect(),null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let n=0,r=0;t?(n=t.width,r=t.height):this._referenceDomElement&&(n=this._referenceDomElement.clientWidth,r=this._referenceDomElement.clientHeight),n=Math.max(5,n),r=Math.max(5,r),(this._width!==n||this._height!==r)&&(this._width=n,this._height=r,e&&this._onDidChange.fire())}},Pie=class extends D{constructor(e){super(),this._onDidChange=this._register(new k),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){this._mediaQueryList?.removeEventListener(`change`,this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener(`change`,this._listener),t&&this._onDidChange.fire()}},Fie=class extends D{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new k),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);let t=this._register(new Pie(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){let t=document.createElement(`canvas`).getContext(`2d`);return(e.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)}},sp=new class{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){let t=Jo(e),n=this.mapWindowIdToPixelRatioMonitor.get(t);return n||(n=Pn(new Fie(e)),this.mapWindowIdToPixelRatioMonitor.set(t,n),O.once(sne)(({vscodeWindowId:e})=>{e===t&&(n?.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))})),n}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}},Iie=class{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}},Lie=class e{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),this._container?.remove(),this._container=null,this._testElements=null}_createDomElements(){let t=document.createElement(`div`);t.style.position=`absolute`,t.style.top=`-50000px`,t.style.width=`50000px`;let n=document.createElement(`div`);ap(n,this._bareFontInfo),t.appendChild(n);let r=document.createElement(`div`);ap(r,this._bareFontInfo),r.style.fontWeight=`bold`,t.appendChild(r);let i=document.createElement(`div`);ap(i,this._bareFontInfo),i.style.fontStyle=`italic`,t.appendChild(i);let a=[];for(let t of this._requests){let o;t.type===0&&(o=n),t.type===2&&(o=r),t.type===1&&(o=i),o.appendChild(document.createElement(`br`));let s=document.createElement(`span`);e._render(s,t),o.appendChild(s),a.push(s)}this._container=t,this._testElements=a}static _render(e,t){if(t.chr===` `){let t=`\xA0`;for(let e=0;e<8;e++)t+=t;e.innerText=t}else{let n=t.chr;for(let e=0;e<8;e++)n+=n;e.textContent=n}}_readFromDomElements(){for(let e=0,t=this._requests.length;e<t;e++){let t=this._requests[e],n=this._testElements[e];t.fulfill(n.offsetWidth/256)}}};function Rie(e,t,n){new Lie(t,n).read(e)}var cp=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new k,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))}},lp=$t?1.5:1.35,up=class e{static _create(t,n,r,i,a,o,s,c,l){o===0?o=lp*r:o<8&&(o*=r),o=Math.round(o),o<8&&(o=8);let u=1+(l?0:cp.getZoomLevel()*.1);return r*=u,o*=u,a===`translate`&&(n===`normal`||n===`bold`?a=fp:(a=`'wght' ${parseInt(n,10)}`,n=`normal`)),new e({pixelRatio:c,fontFamily:t,fontWeight:n,fontSize:r,fontFeatureSettings:i,fontVariationSettings:a,lineHeight:o,letterSpacing:s})}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=e.lineHeight|0,this.letterSpacing=e.letterSpacing}getId(){return`${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`}getMassagedFontFamily(){let t=pp.fontFamily,n=e._wrapInQuotes(this.fontFamily);return this.fontFamily===t?n:`${n}, ${t}`}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}},dp=class extends up{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}},fp=`normal`,zie=`translate`,pp={fontFamily:$t?`Menlo, Monaco, 'Courier New', monospace`:Qt?`Consolas, 'Courier New', monospace`:`'Droid Sans Mono', 'monospace', monospace`,fontWeight:`normal`,fontSize:$t?12:14,lineHeight:0,letterSpacing:0},mp={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}},hp=class{constructor(e){this._values=e}hasChanged(e){return this._values[e]}},gp=class{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}},_p=class{constructor(e,t,n,r){this.id=e,this.name=t,this.defaultValue=n,this.schema=r}applyUpdate(e,t){return yp(e,t)}compute(e,t,n){return n}},vp=class{constructor(e,t){this.newValue=e,this.didChange=t}};function yp(e,t){if(typeof e!=`object`||typeof t!=`object`||!e||!t)return new vp(t,e!==t);if(Array.isArray(e)||Array.isArray(t))return new vp(t,!(Array.isArray(e)&&Array.isArray(t)&&va(e,t)));let n=!1;for(let r in t)if(t.hasOwnProperty(r)){let i=yp(e[r],t[r]);i.didChange&&(e[r]=i.newValue,n=!0)}return new vp(e,n)}var bp=class{constructor(e,t){this.schema=void 0,this.id=e,this.name=`_never_`,this.defaultValue=t}applyUpdate(e,t){return yp(e,t)}validate(e){return this.defaultValue}},xp=class{constructor(e,t,n,r){this.id=e,this.name=t,this.defaultValue=n,this.schema=r}applyUpdate(e,t){return yp(e,t)}compute(e,t,n){return n}};function Sp(e,t){return e===void 0?t:e===`false`?!1:!!e}var Cp=class extends xp{constructor(e,t,n,r=void 0){r!==void 0&&(r.type=`boolean`,r.default=n),super(e,t,n,r)}validate(e){return Sp(e,this.defaultValue)}};function wp(e,t,n,r){if(typeof e==`string`&&(e=parseInt(e,10)),typeof e!=`number`||isNaN(e))return t;let i=e;return i=Math.max(n,i),i=Math.min(r,i),i|0}var Tp=class e extends xp{static clampedInt(e,t,n,r){return wp(e,t,n,r)}constructor(e,t,n,r,i,a=void 0){a!==void 0&&(a.type=`integer`,a.default=n,a.minimum=r,a.maximum=i),super(e,t,n,a),this.minimum=r,this.maximum=i}validate(t){return e.clampedInt(t,this.defaultValue,this.minimum,this.maximum)}};function Bie(e,t,n,r){if(e===void 0)return t;let i=Ep.float(e,t);return Ep.clamp(i,n,r)}var Ep=class e extends xp{static clamp(e,t,n){return e<t?t:e>n?n:e}static float(e,t){return typeof e==`string`&&(e=parseFloat(e)),typeof e!=`number`||isNaN(e)?t:e}constructor(e,t,n,r,i,a,o){i!==void 0&&(i.type=`number`,i.default=n,i.minimum=a,i.maximum=o),super(e,t,n,i),this.validationFn=r,this.minimum=a,this.maximum=o}validate(t){return this.validationFn(e.float(t,this.defaultValue))}},Dp=class e extends xp{static string(e,t){return typeof e==`string`?e:t}constructor(e,t,n,r=void 0){r!==void 0&&(r.type=`string`,r.default=n),super(e,t,n,r)}validate(t){return e.string(t,this.defaultValue)}};function Op(e,t,n,r){return typeof e==`string`?r&&e in r?r[e]:n.indexOf(e)===-1?t:e:t}var kp=class extends xp{constructor(e,t,n,r,i=void 0){i!==void 0&&(i.type=`string`,i.enum=r.slice(0),i.default=n),super(e,t,n,i),this._allowedValues=r}validate(e){return Op(e,this.defaultValue,this._allowedValues)}},Ap=class extends _p{constructor(e,t,n,r,i,a,o=void 0){o!==void 0&&(o.type=`string`,o.enum=i,o.default=r),super(e,t,n,o),this._allowedValues=i,this._convert=a}validate(e){return typeof e!=`string`||this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}};function Vie(e){switch(e){case`none`:return 0;case`keep`:return 1;case`brackets`:return 2;case`advanced`:return 3;case`full`:return 4}}var Hie=class extends _p{constructor(){super(2,`accessibilitySupport`,0,{type:`string`,enum:[`auto`,`on`,`off`],enumDescriptions:[C(201,`Use platform APIs to detect when a Screen Reader is attached.`),C(202,`Optimize for usage with a Screen Reader.`),C(203,`Assume a screen reader is not attached.`)],default:`auto`,tags:[`accessibility`],description:C(204,`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,n){return n===0?e.accessibilitySupport:n}},Uie=class extends _p{constructor(){let e={insertSpace:!0,ignoreEmptyLines:!0};super(29,`comments`,e,{"editor.comments.insertSpace":{type:`boolean`,default:e.insertSpace,description:C(205,`Controls whether a space character is inserted when commenting.`)},"editor.comments.ignoreEmptyLines":{type:`boolean`,default:e.ignoreEmptyLines,description:C(206,`Controls if empty lines should be ignored with toggle, add or remove actions for line comments.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{insertSpace:Sp(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:Sp(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}};function Wie(e){switch(e){case`blink`:return 1;case`smooth`:return 2;case`phase`:return 3;case`expand`:return 4;case`solid`:return 5}}var jp;(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`})(jp||={});function Mp(e){switch(e){case`line`:return jp.Line;case`block`:return jp.Block;case`underline`:return jp.Underline;case`line-thin`:return jp.LineThin;case`block-outline`:return jp.BlockOutline;case`underline-thin`:return jp.UnderlineThin}}var Gie=class extends bp{constructor(){super(162,``)}compute(e,t,n){let r=[`monaco-editor`];return t.get(48)&&r.push(t.get(48)),e.extraEditorClassName&&r.push(e.extraEditorClassName),t.get(82)==="default"?r.push(`mouse-default`):t.get(82)===`copy`&&r.push(`mouse-copy`),t.get(127)&&r.push(`showUnused`),t.get(157)&&r.push(`showDeprecated`),r.join(` `)}},Kie=class extends Cp{constructor(){super(45,`emptySelectionClipboard`,!0,{description:C(207,`Controls whether copying without a selection copies the current line.`)})}compute(e,t,n){return n&&e.emptySelectionClipboard}},qie=class extends _p{constructor(){let e={cursorMoveOnType:!0,findOnType:!0,seedSearchStringFromSelection:`always`,autoFindInSelection:`never`,globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0,history:`workspace`,replaceHistory:`workspace`};super(50,`find`,e,{"editor.find.cursorMoveOnType":{type:`boolean`,default:e.cursorMoveOnType,description:C(208,`Controls whether the cursor should jump to find matches while typing.`)},"editor.find.seedSearchStringFromSelection":{type:`string`,enum:[`never`,`always`,`selection`],default:e.seedSearchStringFromSelection,enumDescriptions:[C(209,`Never seed search string from the editor selection.`),C(210,`Always seed search string from the editor selection, including word at cursor position.`),C(211,`Only seed search string from the editor selection.`)],description:C(212,`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:[C(213,`Never turn on Find in Selection automatically (default).`),C(214,`Always turn on Find in Selection automatically.`),C(215,`Turn on Find in Selection automatically when multiple lines of content are selected.`)],description:C(216,`Controls the condition for turning on Find in Selection automatically.`)},"editor.find.globalFindClipboard":{type:`boolean`,default:e.globalFindClipboard,description:C(217,`Controls whether the Find Widget should read or modify the shared find clipboard on macOS.`),included:$t},"editor.find.addExtraSpaceOnTop":{type:`boolean`,default:e.addExtraSpaceOnTop,description:C(218,`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:C(219,`Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.`)},"editor.find.history":{type:`string`,enum:[`never`,`workspace`],default:`workspace`,enumDescriptions:[C(220,`Do not store search history from the find widget.`),C(221,`Store search history across the active workspace`)],description:C(222,`Controls how the find widget history should be stored`)},"editor.find.replaceHistory":{type:`string`,enum:[`never`,`workspace`],default:`workspace`,enumDescriptions:[C(223,`Do not store history from the replace widget.`),C(224,`Store replace history across the active workspace`)],description:C(225,`Controls how the replace widget history should be stored`)},"editor.find.findOnType":{type:`boolean`,default:e.findOnType,description:C(226,`Controls whether the Find Widget should search as you type.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{cursorMoveOnType:Sp(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),findOnType:Sp(t.findOnType,this.defaultValue.findOnType),seedSearchStringFromSelection:typeof t.seedSearchStringFromSelection==`boolean`?t.seedSearchStringFromSelection?`always`:`never`:Op(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,[`never`,`always`,`selection`]),autoFindInSelection:typeof t.autoFindInSelection==`boolean`?t.autoFindInSelection?`always`:`never`:Op(t.autoFindInSelection,this.defaultValue.autoFindInSelection,[`never`,`always`,`multiline`]),globalFindClipboard:Sp(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:Sp(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:Sp(t.loop,this.defaultValue.loop),history:Op(t.history,this.defaultValue.history,[`never`,`workspace`]),replaceHistory:Op(t.replaceHistory,this.defaultValue.replaceHistory,[`never`,`workspace`])}}},Np=class e extends _p{static{this.OFF=`"liga" off, "calt" off`}static{this.ON=`"liga" on, "calt" on`}constructor(){super(60,`fontLigatures`,e.OFF,{anyOf:[{type:`boolean`,description:C(227,`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:C(228,`Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.`)}],description:C(229,`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(t){return t===void 0?this.defaultValue:typeof t==`string`?t===`false`||t.length===0?e.OFF:t===`true`?e.ON:t:t?e.ON:e.OFF}},Jie=class e extends _p{static{this.OFF=fp}static{this.TRANSLATE=zie}constructor(){super(63,`fontVariations`,e.OFF,{anyOf:[{type:`boolean`,description:C(230,`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:C(231,`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:C(232,`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(t){return t===void 0?this.defaultValue:typeof t==`string`?t===`false`?e.OFF:t===`true`?e.TRANSLATE:t:t?e.TRANSLATE:e.OFF}compute(e,t,n){return e.fontInfo.fontVariationSettings}},Yie=class extends bp{constructor(){super(59,new dp({pixelRatio:0,fontFamily:``,fontWeight:``,fontSize:0,fontFeatureSettings:``,fontVariationSettings:``,lineHeight:0,letterSpacing:0,isMonospace:!1,typicalHalfwidthCharacterWidth:0,typicalFullwidthCharacterWidth:0,canUseHalfwidthRightwardsArrow:!1,spaceWidth:0,middotWidth:0,wsmiddotWidth:0,maxDigitWidth:0},!1))}compute(e,t,n){return e.fontInfo}},Xie=class extends bp{constructor(){super(161,jp.Line)}compute(e,t,n){return e.inputMode===`overtype`?t.get(92):t.get(34)}},Pp=class extends bp{constructor(){super(170,!1)}compute(e,t){return e.editContextSupported&&t.get(44)}},Fp=class extends bp{constructor(){super(172,!1)}compute(e,t){return e.accessibilitySupport===2?t.get(7):t.get(6)}},Ip=class extends xp{constructor(){super(61,`fontSize`,pp.fontSize,{type:`number`,minimum:6,maximum:100,default:pp.fontSize,description:C(233,`Controls the font size in pixels.`)})}validate(e){let t=Ep.float(e,this.defaultValue);return t===0?pp.fontSize:Ep.clamp(t,6,100)}compute(e,t,n){return e.fontInfo.fontSize}},Lp=class e extends _p{static{this.SUGGESTION_VALUES=[`normal`,`bold`,`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`]}static{this.MINIMUM_VALUE=1}static{this.MAXIMUM_VALUE=1e3}constructor(){super(62,`fontWeight`,pp.fontWeight,{anyOf:[{type:`number`,minimum:e.MINIMUM_VALUE,maximum:e.MAXIMUM_VALUE,errorMessage:C(234,`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:e.SUGGESTION_VALUES}],default:pp.fontWeight,description:C(235,`Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.`)})}validate(t){return t===`normal`||t===`bold`?t:String(Tp.clampedInt(t,pp.fontWeight,e.MINIMUM_VALUE,e.MAXIMUM_VALUE))}},Rp=class extends _p{constructor(){let e={multiple:`peek`,multipleDefinitions:`peek`,multipleTypeDefinitions:`peek`,multipleDeclarations:`peek`,multipleImplementations:`peek`,multipleReferences:`peek`,multipleTests:`peek`,alternativeDefinitionCommand:`editor.action.goToReferences`,alternativeTypeDefinitionCommand:`editor.action.goToReferences`,alternativeDeclarationCommand:`editor.action.goToReferences`,alternativeImplementationCommand:``,alternativeReferenceCommand:``,alternativeTestsCommand:``},t={type:`string`,enum:[`peek`,`gotoAndPeek`,`goto`],default:e.multiple,enumDescriptions:[C(236,`Show Peek view of the results (default)`),C(237,`Go to the primary result and show a Peek view`),C(238,`Go to the primary result and enable Peek-less navigation to others`)]},n=[``,`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(67,`gotoLocation`,e,{"editor.gotoLocation.multiple":{deprecationMessage:C(239,`This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.`)},"editor.gotoLocation.multipleDefinitions":{description:C(240,`Controls the behavior the 'Go to Definition'-command when multiple target locations exist.`),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:C(241,`Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.`),...t},"editor.gotoLocation.multipleDeclarations":{description:C(242,`Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.`),...t},"editor.gotoLocation.multipleImplementations":{description:C(243,`Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.`),...t},"editor.gotoLocation.multipleReferences":{description:C(244,`Controls the behavior the 'Go to References'-command when multiple target locations exist.`),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:`string`,default:e.alternativeDefinitionCommand,enum:n,description:C(245,`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:n,description:C(246,`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:n,description:C(247,`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:n,description:C(248,`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:n,description:C(249,`Alternative command id that is being executed when the result of 'Go to Reference' is the current location.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{multiple:Op(t.multiple,this.defaultValue.multiple,[`peek`,`gotoAndPeek`,`goto`]),multipleDefinitions:Op(t.multipleDefinitions,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleTypeDefinitions:Op(t.multipleTypeDefinitions,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleDeclarations:Op(t.multipleDeclarations,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleImplementations:Op(t.multipleImplementations,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleReferences:Op(t.multipleReferences,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleTests:Op(t.multipleTests,`peek`,[`peek`,`gotoAndPeek`,`goto`]),alternativeDefinitionCommand:Dp.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Dp.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Dp.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Dp.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Dp.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:Dp.string(t.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}},zp=class extends _p{constructor(){let e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(69,`hover`,e,{"editor.hover.enabled":{type:`boolean`,default:e.enabled,description:C(250,`Controls whether the hover is shown.`)},"editor.hover.delay":{type:`number`,default:e.delay,minimum:0,maximum:1e4,description:C(251,`Controls the delay in milliseconds after which the hover is shown.`)},"editor.hover.sticky":{type:`boolean`,default:e.sticky,description:C(252,`Controls whether the hover should remain visible when mouse is moved over it.`)},"editor.hover.hidingDelay":{type:`integer`,minimum:0,default:e.hidingDelay,markdownDescription:C(253,"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:C(254,`Prefer showing hovers above the line, if there's space.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:Sp(t.enabled,this.defaultValue.enabled),delay:Tp.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:Sp(t.sticky,this.defaultValue.sticky),hidingDelay:Tp.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:Sp(t.above,this.defaultValue.above)}}},Bp=class e extends bp{constructor(){super(165,{width:0,height:0,glyphMarginLeft:0,glyphMarginWidth:0,glyphMarginDecorationLaneCount:0,lineNumbersLeft:0,lineNumbersWidth:0,decorationsLeft:0,decorationsWidth:0,contentLeft:0,contentWidth:0,minimap:{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:0,minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:0},viewportColumn:0,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1,verticalScrollbarWidth:0,horizontalScrollbarHeight:0,overviewRuler:{top:0,width:0,height:0,right:0}})}compute(t,n,r){return e.computeLayout(n,{memory:t.memory,outerWidth:t.outerWidth,outerHeight:t.outerHeight,isDominatedByLongLines:t.isDominatedByLongLines,lineHeight:t.fontInfo.lineHeight,viewLineCount:t.viewLineCount,lineNumbersDigitCount:t.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:t.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:t.fontInfo.maxDigitWidth,pixelRatio:t.pixelRatio,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){let t=e.height/e.lineHeight,n=Math.floor(e.paddingTop/e.lineHeight),r=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(r=Math.max(r,t-1));let i=(n+e.viewLineCount+r)/(e.pixelRatio*e.height),a=Math.floor(e.viewLineCount/i);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:n,extraLinesBeyondLastLine:r,desiredRatio:i,minimapLineCount:a}}static _computeMinimapLayout(t,n){let r=t.outerWidth,i=t.outerHeight,a=t.pixelRatio;if(!t.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(a*i),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:i};let o=n.stableMinimapLayoutInput,s=o&&t.outerHeight===o.outerHeight&&t.lineHeight===o.lineHeight&&t.typicalHalfwidthCharacterWidth===o.typicalHalfwidthCharacterWidth&&t.pixelRatio===o.pixelRatio&&t.scrollBeyondLastLine===o.scrollBeyondLastLine&&t.paddingTop===o.paddingTop&&t.paddingBottom===o.paddingBottom&&t.minimap.enabled===o.minimap.enabled&&t.minimap.side===o.minimap.side&&t.minimap.size===o.minimap.size&&t.minimap.showSlider===o.minimap.showSlider&&t.minimap.renderCharacters===o.minimap.renderCharacters&&t.minimap.maxColumn===o.minimap.maxColumn&&t.minimap.scale===o.minimap.scale&&t.verticalScrollbarWidth===o.verticalScrollbarWidth&&t.isViewportWrapping===o.isViewportWrapping,c=t.lineHeight,l=t.typicalHalfwidthCharacterWidth,u=t.scrollBeyondLastLine,d=t.minimap.renderCharacters,f=a>=2?Math.round(t.minimap.scale*2):t.minimap.scale,p=t.minimap.maxColumn,m=t.minimap.size,h=t.minimap.side,g=t.verticalScrollbarWidth,_=t.viewLineCount,v=t.remainingWidth,y=t.isViewportWrapping,b=d?2:3,x=Math.floor(a*i),S=x/a,ee=!1,te=!1,ne=b*f,re=f/a,ie=1;if(m===`fill`||m===`fit`){let{typicalViewportLineCount:r,extraLinesBeforeFirstLine:o,extraLinesBeyondLastLine:l,desiredRatio:d,minimapLineCount:p}=e.computeContainedMinimapLineCount({viewLineCount:_,scrollBeyondLastLine:u,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,height:i,lineHeight:c,pixelRatio:a});if(_/p>1)ee=!0,te=!0,f=1,ne=1,re=f/a;else{let e=!1,i=f+1;if(m===`fit`){let t=Math.ceil((o+_+l)*ne);y&&s&&v<=n.stableFitRemainingWidth?(e=!0,i=n.stableFitMaxMinimapScale):e=t>x}if(m===`fill`||e){ee=!0;let e=f;ne=Math.min(c*a,Math.max(1,Math.floor(1/d))),y&&s&&v<=n.stableFitRemainingWidth&&(i=n.stableFitMaxMinimapScale),f=Math.min(i,Math.max(1,Math.floor(ne/b))),f>e&&(ie=Math.min(2,f/e)),re=f/a/ie,x=Math.ceil(Math.max(r,o+_+l)*ne),y?(n.stableMinimapLayoutInput=t,n.stableFitRemainingWidth=v,n.stableFitMaxMinimapScale=f):(n.stableMinimapLayoutInput=null,n.stableFitRemainingWidth=0)}}}let ae=Math.floor(p*re),oe=Math.min(ae,Math.max(0,Math.floor((v-g-2)*re/(l+re)))+8),se=Math.floor(a*oe),ce=se/a;return se=Math.floor(se*ie),{renderMinimap:d?1:2,minimapLeft:h===`left`?0:r-oe-g,minimapWidth:oe,minimapHeightIsEditorHeight:ee,minimapIsSampling:te,minimapScale:f,minimapLineHeight:ne,minimapCanvasInnerWidth:se,minimapCanvasInnerHeight:x,minimapCanvasOuterWidth:ce,minimapCanvasOuterHeight:S}}static computeLayout(t,n){let r=n.outerWidth|0,i=n.outerHeight|0,a=n.lineHeight|0,o=n.lineNumbersDigitCount|0,s=n.typicalHalfwidthCharacterWidth,c=n.maxDigitWidth,l=n.pixelRatio,u=n.viewLineCount,d=t.get(154),f=d===`inherit`?t.get(153):d,p=f===`inherit`?t.get(149):f,m=t.get(152),h=n.isDominatedByLongLines,g=t.get(66),_=t.get(76).renderType!==0,v=t.get(77),y=t.get(119),b=t.get(96),x=t.get(81),S=t.get(117),ee=S.verticalScrollbarSize,te=S.verticalHasArrows,ne=S.arrowSize,re=S.horizontalScrollbarSize,ie=t.get(52),ae=t.get(126)!==`never`,oe=t.get(74);ie&&ae&&(oe+=16);let se=0;_&&(se=Math.round(Math.max(o,v)*c));let ce=0;g&&(ce=a*n.glyphMarginDecorationLaneCount);let le=0,ue=le+ce,de=ue+se,fe=de+oe,pe=r-ce-se-oe,me=!1,he=!1,ge=-1;t.get(2)===2&&f===`inherit`&&h?(me=!0,he=!0):p===`on`||p===`bounded`?he=!0:p===`wordWrapColumn`&&(ge=m);let _e=e._computeMinimapLayout({outerWidth:r,outerHeight:i,lineHeight:a,typicalHalfwidthCharacterWidth:s,pixelRatio:l,scrollBeyondLastLine:y,paddingTop:b.top,paddingBottom:b.bottom,minimap:x,verticalScrollbarWidth:ee,viewLineCount:u,remainingWidth:pe,isViewportWrapping:he},n.memory||new gp);_e.renderMinimap!==0&&_e.minimapLeft===0&&(le+=_e.minimapWidth,ue+=_e.minimapWidth,de+=_e.minimapWidth,fe+=_e.minimapWidth);let ve=pe-_e.minimapWidth,ye=Math.max(1,Math.floor((ve-ee-2)/s)),be=te?ne:0;return he&&(ge=Math.max(1,ye),p===`bounded`&&(ge=Math.min(ge,m))),{width:r,height:i,glyphMarginLeft:le,glyphMarginWidth:ce,glyphMarginDecorationLaneCount:n.glyphMarginDecorationLaneCount,lineNumbersLeft:ue,lineNumbersWidth:se,decorationsLeft:de,decorationsWidth:oe,contentLeft:fe,contentWidth:ve,minimap:_e,viewportColumn:ye,isWordWrapMinified:me,isViewportWrapping:he,wrappingColumn:ge,verticalScrollbarWidth:ee,horizontalScrollbarHeight:re,overviewRuler:{top:be,width:ee,height:i-2*be,right:0}}}},Vp=class extends _p{constructor(){super(156,`wrappingStrategy`,`simple`,{"editor.wrappingStrategy":{enumDescriptions:[C(255,`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.`),C(256,`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:C(257,`Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.`)}})}validate(e){return Op(e,`simple`,[`simple`,`advanced`])}compute(e,t,n){return t.get(2)===2?`advanced`:n}},Hp;(function(e){e.Off=`off`,e.OnCode=`onCode`,e.On=`on`})(Hp||={});var Zie=class extends _p{constructor(){let e={enabled:Hp.OnCode};super(73,`lightbulb`,e,{"editor.lightbulb.enabled":{type:`string`,enum:[Hp.Off,Hp.OnCode,Hp.On],default:e.enabled,enumDescriptions:[C(258,`Disable the code action menu.`),C(259,`Show the code action menu when the cursor is on lines with code.`),C(260,`Show the code action menu when the cursor is on lines with code or on empty lines.`)],description:C(261,`Enables the Code Action lightbulb in the editor.`)}})}validate(e){return!e||typeof e!=`object`?this.defaultValue:{enabled:Op(e.enabled,this.defaultValue.enabled,[Hp.Off,Hp.OnCode,Hp.On])}}},Qie=class extends _p{constructor(){let e={enabled:!0,maxLineCount:5,defaultModel:`outlineModel`,scrollWithEditor:!0};super(131,`stickyScroll`,e,{"editor.stickyScroll.enabled":{type:`boolean`,default:e.enabled,description:C(262,`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:20,description:C(263,`Defines the maximum number of sticky lines to show.`)},"editor.stickyScroll.defaultModel":{type:`string`,enum:[`outlineModel`,`foldingProviderModel`,`indentationModel`],default:e.defaultModel,description:C(264,`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:C(265,`Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:Sp(t.enabled,this.defaultValue.enabled),maxLineCount:Tp.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:Op(t.defaultModel,this.defaultValue.defaultModel,[`outlineModel`,`foldingProviderModel`,`indentationModel`]),scrollWithEditor:Sp(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}},$ie=class extends _p{constructor(){let e={enabled:`on`,fontSize:0,fontFamily:``,padding:!1,maximumLength:43};super(159,`inlayHints`,e,{"editor.inlayHints.enabled":{type:`string`,default:e.enabled,description:C(266,`Enables the inlay hints in the editor.`),enum:[`on`,`onUnlessPressed`,`offUnlessPressed`,`off`],markdownEnumDescriptions:[C(267,`Inlay hints are enabled`),C(268,`Inlay hints are showing by default and hide when holding {0}`,$t?`Ctrl+Option`:`Ctrl+Alt`),C(269,`Inlay hints are hidden by default and show when holding {0}`,$t?`Ctrl+Option`:`Ctrl+Alt`),C(270,`Inlay hints are disabled`)]},"editor.inlayHints.fontSize":{type:`number`,default:e.fontSize,markdownDescription:C(271,`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:C(272,`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:C(273,`Enables the padding around the inlay hints in the editor.`)},"editor.inlayHints.maximumLength":{type:`number`,default:e.maximumLength,markdownDescription:C(274,"Maximum overall length of inlay hints, for a single line, before they get truncated by the editor. Set to `0` to never truncate")}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return typeof t.enabled==`boolean`&&(t.enabled=t.enabled?`on`:`off`),{enabled:Op(t.enabled,this.defaultValue.enabled,[`on`,`off`,`offUnlessPressed`,`onUnlessPressed`]),fontSize:Tp.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Dp.string(t.fontFamily,this.defaultValue.fontFamily),padding:Sp(t.padding,this.defaultValue.padding),maximumLength:Tp.clampedInt(t.maximumLength,this.defaultValue.maximumLength,0,2**53-1)}}},eae=class extends _p{constructor(){super(74,`lineDecorationsWidth`,10)}validate(e){return typeof e==`string`&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):Tp.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,n){return n<0?Tp.clampedInt(-n*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):n}},tae=class extends Ep{constructor(){super(75,`lineHeight`,pp.lineHeight,e=>Ep.clamp(e,0,150),{markdownDescription:C(275,`Controls the line height.
52
52
  - Use 0 to automatically compute the line height from the font size.
53
53
  - Values between 0 and 8 will be used as a multiplier with the font size.
54
54
  - Values greater than or equal to 8 will be used as effective values.`)},0,150)}compute(e,t,n){return e.fontInfo.lineHeight}},nae=class extends _p{constructor(){let e={enabled:!0,size:`proportional`,side:`right`,showSlider:`mouseover`,autohide:`none`,renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,markSectionHeaderRegex:`\\bMARK:\\s*(?<separator>-?)\\s*(?<label>.*)$`,sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(81,`minimap`,e,{"editor.minimap.enabled":{type:`boolean`,default:e.enabled,description:C(276,`Controls whether the minimap is shown.`)},"editor.minimap.autohide":{type:`string`,enum:[`none`,`mouseover`,`scroll`],enumDescriptions:[C(277,`The minimap is always shown.`),C(278,`The minimap is hidden when mouse is not over the minimap and shown when mouse is over the minimap.`),C(279,`The minimap is only shown when the editor is scrolled`)],default:e.autohide,description:C(280,`Controls whether the minimap is hidden automatically.`)},"editor.minimap.size":{type:`string`,enum:[`proportional`,`fill`,`fit`],enumDescriptions:[C(281,`The minimap has the same size as the editor contents (and might scroll).`),C(282,`The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling).`),C(283,`The minimap will shrink as necessary to never be larger than the editor (no scrolling).`)],default:e.size,description:C(284,`Controls the size of the minimap.`)},"editor.minimap.side":{type:`string`,enum:[`left`,`right`],default:e.side,description:C(285,`Controls the side where to render the minimap.`)},"editor.minimap.showSlider":{type:`string`,enum:[`always`,`mouseover`],default:e.showSlider,description:C(286,`Controls when the minimap slider is shown.`)},"editor.minimap.scale":{type:`number`,default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:C(287,`Scale of content drawn in the minimap: 1, 2 or 3.`)},"editor.minimap.renderCharacters":{type:`boolean`,default:e.renderCharacters,description:C(288,`Render the actual characters on a line as opposed to color blocks.`)},"editor.minimap.maxColumn":{type:`number`,default:e.maxColumn,description:C(289,`Limit the width of the minimap to render at most a certain number of columns.`)},"editor.minimap.showRegionSectionHeaders":{type:`boolean`,default:e.showRegionSectionHeaders,description:C(290,`Controls whether named regions are shown as section headers in the minimap.`)},"editor.minimap.showMarkSectionHeaders":{type:`boolean`,default:e.showMarkSectionHeaders,description:C(291,`Controls whether MARK: comments are shown as section headers in the minimap.`)},"editor.minimap.markSectionHeaderRegex":{type:`string`,default:e.markSectionHeaderRegex,description:C(292,"Defines the regular expression used to find section headers in comments. The regex must contain a named match group `label` (written as `(?<label>.+)`) that encapsulates the section header, otherwise it will not work. Optionally you can include another match group named `separator`. Use \\n in the pattern to match multi-line headers.")},"editor.minimap.sectionHeaderFontSize":{type:`number`,default:e.sectionHeaderFontSize,description:C(293,`Controls the font size of section headers in the minimap.`)},"editor.minimap.sectionHeaderLetterSpacing":{type:`number`,default:e.sectionHeaderLetterSpacing,description:C(294,`Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e,n=this.defaultValue.markSectionHeaderRegex,r=t.markSectionHeaderRegex;if(typeof r==`string`)try{new RegExp(r,`d`),n=r}catch{}return{enabled:Sp(t.enabled,this.defaultValue.enabled),autohide:Op(t.autohide,this.defaultValue.autohide,[`none`,`mouseover`,`scroll`]),size:Op(t.size,this.defaultValue.size,[`proportional`,`fill`,`fit`]),side:Op(t.side,this.defaultValue.side,[`right`,`left`]),showSlider:Op(t.showSlider,this.defaultValue.showSlider,[`always`,`mouseover`]),renderCharacters:Sp(t.renderCharacters,this.defaultValue.renderCharacters),scale:Tp.clampedInt(t.scale,1,1,3),maxColumn:Tp.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:Sp(t.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:Sp(t.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),markSectionHeaderRegex:n,sectionHeaderFontSize:Ep.clamp(Ep.float(t.sectionHeaderFontSize,this.defaultValue.sectionHeaderFontSize),4,32),sectionHeaderLetterSpacing:Ep.clamp(Ep.float(t.sectionHeaderLetterSpacing,this.defaultValue.sectionHeaderLetterSpacing),0,5)}}};function rae(e){return e===`ctrlCmd`?$t?`metaKey`:`ctrlKey`:`altKey`}var iae=class extends _p{constructor(){super(96,`padding`,{top:0,bottom:0},{"editor.padding.top":{type:`number`,default:0,minimum:0,maximum:1e3,description:C(295,`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:C(296,`Controls the amount of space between the bottom edge of the editor and the last line.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{top:Tp.clampedInt(t.top,0,0,1e3),bottom:Tp.clampedInt(t.bottom,0,0,1e3)}}},aae=class extends _p{constructor(){let e={enabled:!0,cycle:!0};super(98,`parameterHints`,e,{"editor.parameterHints.enabled":{type:`boolean`,default:e.enabled,description:C(297,`Enables a pop-up that shows parameter documentation and type information as you type.`)},"editor.parameterHints.cycle":{type:`boolean`,default:e.cycle,description:C(298,`Controls whether the parameter hints menu cycles or closes when reaching the end of the list.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:Sp(t.enabled,this.defaultValue.enabled),cycle:Sp(t.cycle,this.defaultValue.cycle)}}},oae=class extends bp{constructor(){super(163,1)}compute(e,t,n){return e.pixelRatio}},sae=class extends _p{constructor(){super(100,`placeholder`,void 0)}validate(e){return e===void 0?this.defaultValue:typeof e==`string`?e:this.defaultValue}},cae=class extends _p{constructor(){let e={other:`on`,comments:`off`,strings:`off`},t=[{type:`boolean`},{type:`string`,enum:[`on`,`inline`,`off`],enumDescriptions:[C(299,`Quick suggestions show inside the suggest widget`),C(300,`Quick suggestions show as ghost text`),C(301,`Quick suggestions are disabled`)]}];super(102,`quickSuggestions`,e,{type:`object`,additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:C(302,`Enable quick suggestions inside strings.`)},comments:{anyOf:t,default:e.comments,description:C(303,`Enable quick suggestions inside comments.`)},other:{anyOf:t,default:e.other,description:C(304,`Enable quick suggestions outside of strings and comments.`)}},default:e,markdownDescription:C(305,`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(typeof e==`boolean`){let t=e?`on`:`off`;return{comments:t,strings:t,other:t}}if(!e||typeof e!=`object`)return this.defaultValue;let{other:t,comments:n,strings:r}=e,i=[`on`,`inline`,`off`],a,o,s;return a=typeof t==`boolean`?t?`on`:`off`:Op(t,this.defaultValue.other,i),o=typeof n==`boolean`?n?`on`:`off`:Op(n,this.defaultValue.comments,i),s=typeof r==`boolean`?r?`on`:`off`:Op(r,this.defaultValue.strings,i),{other:a,comments:o,strings:s}}},lae=class extends _p{constructor(){super(76,`lineNumbers`,{renderType:1,renderFn:null},{type:`string`,enum:[`off`,`on`,`relative`,`interval`],enumDescriptions:[C(306,`Line numbers are not rendered.`),C(307,`Line numbers are rendered as absolute number.`),C(308,`Line numbers are rendered as distance in lines to cursor position.`),C(309,`Line numbers are rendered every 10 lines.`)],default:`on`,description:C(310,`Controls the display of line numbers.`)})}validate(e){let t=this.defaultValue.renderType,n=this.defaultValue.renderFn;return e!==void 0&&(typeof e==`function`?(t=4,n=e):t=e===`interval`?3:e===`relative`?2:+(e===`on`)),{renderType:t,renderFn:n}}};function Up(e){let t=e.get(112);return t===`editable`?e.get(104):t!==`on`}function Wp(e){return!e.get(172)}var uae=class extends _p{constructor(){let e=[],t={type:`number`,description:C(311,`Number of monospace characters at which this editor ruler will render.`)};super(116,`rulers`,e,{type:`array`,items:{anyOf:[t,{type:[`object`],properties:{column:t,color:{type:`string`,description:C(312,`Color of this editor ruler.`),format:`color-hex`}}}]},default:e,description:C(313,`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)){let t=[];for(let n of e)if(typeof n==`number`)t.push({column:Tp.clampedInt(n,0,0,1e4),color:null});else if(n&&typeof n==`object`){let e=n;t.push({column:Tp.clampedInt(e.column,0,0,1e4),color:e.color})}return t.sort((e,t)=>e.column-t.column),t}return this.defaultValue}},dae=class extends _p{constructor(){super(105,`readOnlyMessage`,void 0)}validate(e){return!e||typeof e!=`object`?this.defaultValue:e}};function Gp(e,t){if(typeof e!=`string`)return t;switch(e){case`hidden`:return 2;case`visible`:return 3;default:return 1}}var fae=class extends _p{constructor(){let 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(117,`scrollbar`,e,{"editor.scrollbar.vertical":{type:`string`,enum:[`auto`,`visible`,`hidden`],enumDescriptions:[C(314,`The vertical scrollbar will be visible only when necessary.`),C(315,`The vertical scrollbar will always be visible.`),C(316,`The vertical scrollbar will always be hidden.`)],default:`auto`,description:C(317,`Controls the visibility of the vertical scrollbar.`)},"editor.scrollbar.horizontal":{type:`string`,enum:[`auto`,`visible`,`hidden`],enumDescriptions:[C(318,`The horizontal scrollbar will be visible only when necessary.`),C(319,`The horizontal scrollbar will always be visible.`),C(320,`The horizontal scrollbar will always be hidden.`)],default:`auto`,description:C(321,`Controls the visibility of the horizontal scrollbar.`)},"editor.scrollbar.verticalScrollbarSize":{type:`number`,default:e.verticalScrollbarSize,description:C(322,`The width of the vertical scrollbar.`)},"editor.scrollbar.horizontalScrollbarSize":{type:`number`,default:e.horizontalScrollbarSize,description:C(323,`The height of the horizontal scrollbar.`)},"editor.scrollbar.scrollByPage":{type:`boolean`,default:e.scrollByPage,description:C(324,`Controls whether clicks scroll by page or jump to click position.`)},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:`boolean`,default:e.ignoreHorizontalScrollbarInContentHeight,description:C(325,`When set, the horizontal scrollbar will not increase the size of the editor's content.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e,n=Tp.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),r=Tp.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:Tp.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:Gp(t.vertical,this.defaultValue.vertical),horizontal:Gp(t.horizontal,this.defaultValue.horizontal),useShadows:Sp(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:Sp(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:Sp(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:Sp(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:Sp(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:n,horizontalSliderSize:Tp.clampedInt(t.horizontalSliderSize,n,0,1e3),verticalScrollbarSize:r,verticalSliderSize:Tp.clampedInt(t.verticalSliderSize,r,0,1e3),scrollByPage:Sp(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:Sp(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}},Kp=`inUntrustedWorkspace`,qp={allowedCharacters:`editor.unicodeHighlight.allowedCharacters`,invisibleCharacters:`editor.unicodeHighlight.invisibleCharacters`,nonBasicASCII:`editor.unicodeHighlight.nonBasicASCII`,ambiguousCharacters:`editor.unicodeHighlight.ambiguousCharacters`,includeComments:`editor.unicodeHighlight.includeComments`,includeStrings:`editor.unicodeHighlight.includeStrings`,allowedLocales:`editor.unicodeHighlight.allowedLocales`},pae=class extends _p{constructor(){let e={nonBasicASCII:Kp,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Kp,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(142,`unicodeHighlight`,e,{[qp.nonBasicASCII]:{restricted:!0,type:[`boolean`,`string`],enum:[!0,!1,Kp],default:e.nonBasicASCII,description:C(326,`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.`)},[qp.invisibleCharacters]:{restricted:!0,type:`boolean`,default:e.invisibleCharacters,description:C(327,`Controls whether characters that just reserve space or have no width at all are highlighted.`)},[qp.ambiguousCharacters]:{restricted:!0,type:`boolean`,default:e.ambiguousCharacters,description:C(328,`Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.`)},[qp.includeComments]:{restricted:!0,type:[`boolean`,`string`],enum:[!0,!1,Kp],default:e.includeComments,description:C(329,`Controls whether characters in comments should also be subject to Unicode highlighting.`)},[qp.includeStrings]:{restricted:!0,type:[`boolean`,`string`],enum:[!0,!1,Kp],default:e.includeStrings,description:C(330,`Controls whether characters in strings should also be subject to Unicode highlighting.`)},[qp.allowedCharacters]:{restricted:!0,type:`object`,default:e.allowedCharacters,description:C(331,`Defines allowed characters that are not being highlighted.`),additionalProperties:{type:`boolean`}},[qp.allowedLocales]:{restricted:!0,type:`object`,additionalProperties:{type:`boolean`},default:e.allowedLocales,description:C(332,`Unicode characters that are common in allowed locales are not being highlighted.`)}})}applyUpdate(e,t){let n=!1;t.allowedCharacters&&e&&(Yu(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},n=!0)),t.allowedLocales&&e&&(Yu(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},n=!0));let r=super.applyUpdate(e,t);return n?new vp(r.newValue,!0):r}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{nonBasicASCII:Jp(t.nonBasicASCII,Kp,[!0,!1,Kp]),invisibleCharacters:Sp(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:Sp(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:Jp(t.includeComments,Kp,[!0,!1,Kp]),includeStrings:Jp(t.includeStrings,Kp,[!0,!1,Kp]),allowedCharacters:this.validateBooleanMap(t.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(t.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!=`object`||!e)return t;let n={};for(let[t,r]of Object.entries(e))r===!0&&(n[t]=!0);return n}},mae=class extends _p{constructor(){let e={enabled:!0,mode:`subwordSmart`,showToolbar:`onHover`,suppressSuggestions:!1,keepOnBlur:!1,fontFamily:`default`,syntaxHighlightingEnabled:!0,minShowDelay:0,suppressInSnippetMode:!0,edits:{enabled:!0,showCollapsed:!1,renderSideBySide:`auto`,allowCodeShifting:`always`},triggerCommandOnProviderChange:!1,experimental:{suppressInlineSuggestions:``,showOnSuggestConflict:`never`,emptyResponseInformation:!0}};super(71,`inlineSuggest`,e,{"editor.inlineSuggest.enabled":{type:`boolean`,default:e.enabled,description:C(333,`Controls whether to automatically show inline suggestions in the editor.`)},"editor.inlineSuggest.showToolbar":{type:`string`,default:e.showToolbar,enum:[`always`,`onHover`,`never`],enumDescriptions:[C(334,`Show the inline suggestion toolbar whenever an inline suggestion is shown.`),C(335,`Show the inline suggestion toolbar when hovering over an inline suggestion.`),C(336,`Never show the inline suggestion toolbar.`)],description:C(337,`Controls when to show the inline suggestion toolbar.`)},"editor.inlineSuggest.syntaxHighlightingEnabled":{type:`boolean`,default:e.syntaxHighlightingEnabled,description:C(338,`Controls whether to show syntax highlighting for inline suggestions in the editor.`)},"editor.inlineSuggest.suppressSuggestions":{type:`boolean`,default:e.suppressSuggestions,description:C(339,`Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.`)},"editor.inlineSuggest.suppressInSnippetMode":{type:`boolean`,default:e.suppressInSnippetMode,description:C(340,`Controls whether inline suggestions are suppressed when in snippet mode.`)},"editor.inlineSuggest.minShowDelay":{type:`number`,default:0,minimum:0,maximum:1e4,description:C(341,`Controls the minimal delay in milliseconds after which inline suggestions are shown after typing.`)},"editor.inlineSuggest.experimental.suppressInlineSuggestions":{type:`string`,default:e.experimental.suppressInlineSuggestions,tags:[`experimental`],description:C(342,`Suppresses inline completions for specified extension IDs -- comma separated.`),experiment:{mode:`auto`}},"editor.inlineSuggest.experimental.emptyResponseInformation":{type:`boolean`,default:e.experimental.emptyResponseInformation,tags:[`experimental`],description:C(343,`Controls whether to send request information from the inline suggestion provider.`),experiment:{mode:`auto`}},"editor.inlineSuggest.triggerCommandOnProviderChange":{type:`boolean`,default:e.triggerCommandOnProviderChange,tags:[`experimental`],description:C(344,`Controls whether to trigger a command when the inline suggestion provider changes.`),experiment:{mode:`auto`}},"editor.inlineSuggest.experimental.showOnSuggestConflict":{type:`string`,default:e.experimental.showOnSuggestConflict,tags:[`experimental`],enum:[`always`,`never`,`whenSuggestListIsIncomplete`],description:C(345,`Controls whether to show inline suggestions when there is a suggest conflict.`),experiment:{mode:`auto`}},"editor.inlineSuggest.fontFamily":{type:`string`,default:e.fontFamily,description:C(346,`Controls the font family of the inline suggestions.`)},"editor.inlineSuggest.edits.allowCodeShifting":{type:`string`,default:e.edits.allowCodeShifting,description:C(347,`Controls whether showing a suggestion will shift the code to make space for the suggestion inline.`),enum:[`always`,`horizontal`,`never`],tags:[`nextEditSuggestions`]},"editor.inlineSuggest.edits.renderSideBySide":{type:`string`,default:e.edits.renderSideBySide,description:C(348,`Controls whether larger suggestions can be shown side by side.`),enum:[`auto`,`never`],enumDescriptions:[C(349,`Larger suggestions will show side by side if there is enough space, otherwise they will be shown below.`),C(350,`Larger suggestions are never shown side by side and will always be shown below.`)],tags:[`nextEditSuggestions`]},"editor.inlineSuggest.edits.showCollapsed":{type:`boolean`,default:e.edits.showCollapsed,description:C(351,`Controls whether the suggestion will show as collapsed until jumping to it.`),tags:[`nextEditSuggestions`]}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:Sp(t.enabled,this.defaultValue.enabled),mode:Op(t.mode,this.defaultValue.mode,[`prefix`,`subword`,`subwordSmart`]),showToolbar:Op(t.showToolbar,this.defaultValue.showToolbar,[`always`,`onHover`,`never`]),suppressSuggestions:Sp(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:Sp(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:Dp.string(t.fontFamily,this.defaultValue.fontFamily),syntaxHighlightingEnabled:Sp(t.syntaxHighlightingEnabled,this.defaultValue.syntaxHighlightingEnabled),minShowDelay:Tp.clampedInt(t.minShowDelay,0,0,1e4),suppressInSnippetMode:Sp(t.suppressInSnippetMode,this.defaultValue.suppressInSnippetMode),edits:this._validateEdits(t.edits),triggerCommandOnProviderChange:Sp(t.triggerCommandOnProviderChange,this.defaultValue.triggerCommandOnProviderChange),experimental:this._validateExperimental(t.experimental)}}_validateEdits(e){if(!e||typeof e!=`object`)return this.defaultValue.edits;let t=e;return{enabled:Sp(t.enabled,this.defaultValue.edits.enabled),showCollapsed:Sp(t.showCollapsed,this.defaultValue.edits.showCollapsed),allowCodeShifting:Op(t.allowCodeShifting,this.defaultValue.edits.allowCodeShifting,[`always`,`horizontal`,`never`]),renderSideBySide:Op(t.renderSideBySide,this.defaultValue.edits.renderSideBySide,[`never`,`auto`])}}_validateExperimental(e){if(!e||typeof e!=`object`)return this.defaultValue.experimental;let t=e;return{suppressInlineSuggestions:Dp.string(t.suppressInlineSuggestions,this.defaultValue.experimental.suppressInlineSuggestions),showOnSuggestConflict:Op(t.showOnSuggestConflict,this.defaultValue.experimental.showOnSuggestConflict,[`always`,`never`,`whenSuggestListIsIncomplete`]),emptyResponseInformation:Sp(t.emptyResponseInformation,this.defaultValue.experimental.emptyResponseInformation)}}},hae=class extends _p{constructor(){let e={enabled:mp.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:mp.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(21,`bracketPairColorization`,e,{"editor.bracketPairColorization.enabled":{type:`boolean`,default:e.enabled,markdownDescription:C(352,`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:C(353,`Controls whether each bracket type has its own independent color pool.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:Sp(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:Sp(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}},gae=class extends _p{constructor(){let e={bracketPairs:!1,bracketPairsHorizontal:`active`,highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(22,`guides`,e,{"editor.guides.bracketPairs":{type:[`boolean`,`string`],enum:[!0,`active`,!1],enumDescriptions:[C(354,`Enables bracket pair guides.`),C(355,`Enables bracket pair guides only for the active bracket pair.`),C(356,`Disables bracket pair guides.`)],default:e.bracketPairs,description:C(357,`Controls whether bracket pair guides are enabled or not.`)},"editor.guides.bracketPairsHorizontal":{type:[`boolean`,`string`],enum:[!0,`active`,!1],enumDescriptions:[C(358,`Enables horizontal guides as addition to vertical bracket pair guides.`),C(359,`Enables horizontal guides only for the active bracket pair.`),C(360,`Disables horizontal bracket pair guides.`)],default:e.bracketPairsHorizontal,description:C(361,`Controls whether horizontal bracket pair guides are enabled or not.`)},"editor.guides.highlightActiveBracketPair":{type:`boolean`,default:e.highlightActiveBracketPair,description:C(362,`Controls whether the editor should highlight the active bracket pair.`)},"editor.guides.indentation":{type:`boolean`,default:e.indentation,description:C(363,`Controls whether the editor should render indent guides.`)},"editor.guides.highlightActiveIndentation":{type:[`boolean`,`string`],enum:[!0,`always`,!1],enumDescriptions:[C(364,`Highlights the active indent guide.`),C(365,`Highlights the active indent guide even if bracket guides are highlighted.`),C(366,`Do not highlight the active indent guide.`)],default:e.highlightActiveIndentation,description:C(367,`Controls whether the editor should highlight the active indent guide.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{bracketPairs:Jp(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,`active`]),bracketPairsHorizontal:Jp(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,`active`]),highlightActiveBracketPair:Sp(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:Sp(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:Jp(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,`always`])}}};function Jp(e,t,n){let r=n.indexOf(e);return r===-1?t:n[r]}var _ae=class extends _p{constructor(){let 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(134,`suggest`,e,{"editor.suggest.insertMode":{type:`string`,enum:[`insert`,`replace`],enumDescriptions:[C(368,`Insert suggestion without overwriting text right of the cursor.`),C(369,`Insert suggestion and overwrite text right of the cursor.`)],default:e.insertMode,description:C(370,`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:C(371,`Controls whether filtering and sorting suggestions accounts for small typos.`)},"editor.suggest.localityBonus":{type:`boolean`,default:e.localityBonus,description:C(372,`Controls whether sorting favors words that appear close to the cursor.`)},"editor.suggest.shareSuggestSelections":{type:`boolean`,default:e.shareSuggestSelections,markdownDescription:C(373,"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:[C(374,`Always select a suggestion when automatically triggering IntelliSense.`),C(375,`Never select a suggestion when automatically triggering IntelliSense.`),C(376,`Select a suggestion only when triggering IntelliSense from a trigger character.`),C(377,`Select a suggestion only when triggering IntelliSense as you type.`)],default:e.selectionMode,markdownDescription:C(378,"Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions ({0} and {1}) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.","`#editor.quickSuggestions#`","`#editor.suggestOnTriggerCharacters#`")},"editor.suggest.snippetsPreventQuickSuggestions":{type:`boolean`,default:e.snippetsPreventQuickSuggestions,description:C(379,`Controls whether an active snippet prevents quick suggestions.`)},"editor.suggest.showIcons":{type:`boolean`,default:e.showIcons,description:C(380,`Controls whether to show or hide icons in suggestions.`)},"editor.suggest.showStatusBar":{type:`boolean`,default:e.showStatusBar,description:C(381,`Controls the visibility of the status bar at the bottom of the suggest widget.`)},"editor.suggest.preview":{type:`boolean`,default:e.preview,description:C(382,`Controls whether to preview the suggestion outcome in the editor.`)},"editor.suggest.showInlineDetails":{type:`boolean`,default:e.showInlineDetails,description:C(383,`Controls whether suggest details show inline with the label or only in the details widget.`)},"editor.suggest.maxVisibleSuggestions":{type:`number`,deprecationMessage:C(384,`This setting is deprecated. The suggest widget can now be resized.`)},"editor.suggest.filteredTypes":{type:`object`,deprecationMessage:C(385,`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:C(386,"When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:`boolean`,default:!0,markdownDescription:C(387,"When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:`boolean`,default:!0,markdownDescription:C(388,"When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:`boolean`,default:!0,markdownDescription:C(389,"When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:`boolean`,default:!0,markdownDescription:C(390,"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:C(391,"When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:`boolean`,default:!0,markdownDescription:C(392,"When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:`boolean`,default:!0,markdownDescription:C(393,"When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:`boolean`,default:!0,markdownDescription:C(394,"When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:`boolean`,default:!0,markdownDescription:C(395,"When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:`boolean`,default:!0,markdownDescription:C(396,"When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:`boolean`,default:!0,markdownDescription:C(397,"When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:`boolean`,default:!0,markdownDescription:C(398,"When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:`boolean`,default:!0,markdownDescription:C(399,"When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:`boolean`,default:!0,markdownDescription:C(400,"When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:`boolean`,default:!0,markdownDescription:C(401,"When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:`boolean`,default:!0,markdownDescription:C(402,"When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:`boolean`,default:!0,markdownDescription:C(403,"When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:`boolean`,default:!0,markdownDescription:C(404,"When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:`boolean`,default:!0,markdownDescription:C(405,"When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:`boolean`,default:!0,markdownDescription:C(406,"When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:`boolean`,default:!0,markdownDescription:C(407,"When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:`boolean`,default:!0,markdownDescription:C(408,"When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:`boolean`,default:!0,markdownDescription:C(409,"When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:`boolean`,default:!0,markdownDescription:C(410,"When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:`boolean`,default:!0,markdownDescription:C(411,"When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:`boolean`,default:!0,markdownDescription:C(412,"When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:`boolean`,default:!0,markdownDescription:C(413,"When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:`boolean`,default:!0,markdownDescription:C(414,"When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:`boolean`,default:!0,markdownDescription:C(415,"When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{insertMode:Op(t.insertMode,this.defaultValue.insertMode,[`insert`,`replace`]),filterGraceful:Sp(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:Sp(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:Sp(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:Sp(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:Op(t.selectionMode,this.defaultValue.selectionMode,[`always`,`never`,`whenQuickSuggestion`,`whenTriggerCharacter`]),showIcons:Sp(t.showIcons,this.defaultValue.showIcons),showStatusBar:Sp(t.showStatusBar,this.defaultValue.showStatusBar),preview:Sp(t.preview,this.defaultValue.preview),previewMode:Op(t.previewMode,this.defaultValue.previewMode,[`prefix`,`subword`,`subwordSmart`]),showInlineDetails:Sp(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:Sp(t.showMethods,this.defaultValue.showMethods),showFunctions:Sp(t.showFunctions,this.defaultValue.showFunctions),showConstructors:Sp(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:Sp(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:Sp(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:Sp(t.showFields,this.defaultValue.showFields),showVariables:Sp(t.showVariables,this.defaultValue.showVariables),showClasses:Sp(t.showClasses,this.defaultValue.showClasses),showStructs:Sp(t.showStructs,this.defaultValue.showStructs),showInterfaces:Sp(t.showInterfaces,this.defaultValue.showInterfaces),showModules:Sp(t.showModules,this.defaultValue.showModules),showProperties:Sp(t.showProperties,this.defaultValue.showProperties),showEvents:Sp(t.showEvents,this.defaultValue.showEvents),showOperators:Sp(t.showOperators,this.defaultValue.showOperators),showUnits:Sp(t.showUnits,this.defaultValue.showUnits),showValues:Sp(t.showValues,this.defaultValue.showValues),showConstants:Sp(t.showConstants,this.defaultValue.showConstants),showEnums:Sp(t.showEnums,this.defaultValue.showEnums),showEnumMembers:Sp(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:Sp(t.showKeywords,this.defaultValue.showKeywords),showWords:Sp(t.showWords,this.defaultValue.showWords),showColors:Sp(t.showColors,this.defaultValue.showColors),showFiles:Sp(t.showFiles,this.defaultValue.showFiles),showReferences:Sp(t.showReferences,this.defaultValue.showReferences),showFolders:Sp(t.showFolders,this.defaultValue.showFolders),showTypeParameters:Sp(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:Sp(t.showSnippets,this.defaultValue.showSnippets),showUsers:Sp(t.showUsers,this.defaultValue.showUsers),showIssues:Sp(t.showIssues,this.defaultValue.showIssues)}}},vae=class extends _p{constructor(){super(129,`smartSelect`,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:C(416,`Whether leading and trailing whitespace should always be selected.`),default:!0,type:`boolean`},"editor.smartSelect.selectSubwords":{description:C(417,`Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected.`),default:!0,type:`boolean`}})}validate(e){return!e||typeof e!=`object`?this.defaultValue:{selectLeadingAndTrailingWhitespace:Sp(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:Sp(e.selectSubwords,this.defaultValue.selectSubwords)}}},yae=class extends _p{constructor(){let e=[];super(147,`wordSegmenterLocales`,e,{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}],description:C(418,`Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.).`),type:`array`,items:{type:`string`},default:e})}validate(e){if(typeof e==`string`&&(e=[e]),Array.isArray(e)){let t=[];for(let n of e)if(typeof n==`string`)try{Intl.Segmenter.supportedLocalesOf(n).length>0&&t.push(n)}catch{}return t}return this.defaultValue}},bae=class extends _p{constructor(){super(155,`wrappingIndent`,1,{"editor.wrappingIndent":{type:`string`,enum:[`none`,`same`,`indent`,`deepIndent`],enumDescriptions:[C(419,`No indentation. Wrapped lines begin at column 1.`),C(420,`Wrapped lines get the same indentation as the parent.`),C(421,`Wrapped lines get +1 indentation toward the parent.`),C(422,`Wrapped lines get +2 indentation toward the parent.`)],description:C(423,`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,n){return t.get(2)===2?0:n}},xae=class extends bp{constructor(){super(166,{isDominatedByLongLines:!1,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1})}compute(e,t,n){let r=t.get(165);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:r.isWordWrapMinified,isViewportWrapping:r.isViewportWrapping,wrappingColumn:r.wrappingColumn}}},Sae=class extends _p{constructor(){let e={enabled:!0,showDropSelector:`afterDrop`};super(43,`dropIntoEditor`,e,{"editor.dropIntoEditor.enabled":{type:`boolean`,default:e.enabled,markdownDescription:C(424,"Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:`string`,markdownDescription:C(425,`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:[C(426,`Show the drop selector widget after a file is dropped into the editor.`),C(427,`Never show the drop selector widget. Instead the default drop provider is always used.`)],default:`afterDrop`}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:Sp(t.enabled,this.defaultValue.enabled),showDropSelector:Op(t.showDropSelector,this.defaultValue.showDropSelector,[`afterDrop`,`never`])}}},Cae=class extends _p{constructor(){let e={enabled:!0,showPasteSelector:`afterPaste`};super(97,`pasteAs`,e,{"editor.pasteAs.enabled":{type:`boolean`,default:e.enabled,markdownDescription:C(428,`Controls whether you can paste content in different ways.`)},"editor.pasteAs.showPasteSelector":{type:`string`,markdownDescription:C(429,`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:[C(430,`Show the paste selector widget after content is pasted into the editor.`),C(431,`Never show the paste selector widget. Instead the default pasting behavior is always used.`)],default:`afterPaste`}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:Sp(t.enabled,this.defaultValue.enabled),showPasteSelector:Op(t.showPasteSelector,this.defaultValue.showPasteSelector,[`afterPaste`,`never`])}}},Yp=[];function K(e){return Yp[e.id]=e,e}var Xp={acceptSuggestionOnCommitCharacter:K(new Cp(0,`acceptSuggestionOnCommitCharacter`,!0,{markdownDescription:C(432,"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:K(new kp(1,`acceptSuggestionOnEnter`,`on`,[`on`,`smart`,`off`],{markdownEnumDescriptions:[``,C(433,"Only accept a suggestion with `Enter` when it makes a textual change."),``],markdownDescription:C(434,"Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:K(new Hie),accessibilityPageSize:K(new Tp(3,`accessibilityPageSize`,500,1,1073741824,{description:C(435,`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`]})),allowOverflow:K(new Cp(4,`allowOverflow`,!0)),allowVariableLineHeights:K(new Cp(5,`allowVariableLineHeights`,!0,{description:C(436,`Controls whether to allow using variable line heights in the editor.`)})),allowVariableFonts:K(new Cp(6,`allowVariableFonts`,!0,{description:C(437,`Controls whether to allow using variable fonts in the editor.`)})),allowVariableFontsInAccessibilityMode:K(new Cp(7,`allowVariableFontsInAccessibilityMode`,!1,{description:C(438,`Controls whether to allow using variable fonts in the editor in the accessibility mode.`),tags:[`accessibility`]})),ariaLabel:K(new Dp(8,`ariaLabel`,C(439,`Editor content`))),ariaRequired:K(new Cp(9,`ariaRequired`,!1,void 0)),screenReaderAnnounceInlineSuggestion:K(new Cp(12,`screenReaderAnnounceInlineSuggestion`,!0,{description:C(440,`Control whether inline suggestions are announced by a screen reader.`),tags:[`accessibility`]})),autoClosingBrackets:K(new kp(10,`autoClosingBrackets`,`languageDefined`,[`always`,`languageDefined`,`beforeWhitespace`,`never`],{enumDescriptions:[``,C(441,`Use language configurations to determine when to autoclose brackets.`),C(442,`Autoclose brackets only when the cursor is to the left of whitespace.`),``],description:C(443,`Controls whether the editor should automatically close brackets after the user adds an opening bracket.`)})),autoClosingComments:K(new kp(11,`autoClosingComments`,`languageDefined`,[`always`,`languageDefined`,`beforeWhitespace`,`never`],{enumDescriptions:[``,C(444,`Use language configurations to determine when to autoclose comments.`),C(445,`Autoclose comments only when the cursor is to the left of whitespace.`),``],description:C(446,`Controls whether the editor should automatically close comments after the user adds an opening comment.`)})),autoClosingDelete:K(new kp(13,`autoClosingDelete`,`auto`,[`always`,`auto`,`never`],{enumDescriptions:[``,C(447,`Remove adjacent closing quotes or brackets only if they were automatically inserted.`),``],description:C(448,`Controls whether the editor should remove adjacent closing quotes or brackets when deleting.`)})),autoClosingOvertype:K(new kp(14,`autoClosingOvertype`,`auto`,[`always`,`auto`,`never`],{enumDescriptions:[``,C(449,`Type over closing quotes or brackets only if they were automatically inserted.`),``],description:C(450,`Controls whether the editor should type over closing quotes or brackets.`)})),autoClosingQuotes:K(new kp(15,`autoClosingQuotes`,`languageDefined`,[`always`,`languageDefined`,`beforeWhitespace`,`never`],{enumDescriptions:[``,C(451,`Use language configurations to determine when to autoclose quotes.`),C(452,`Autoclose quotes only when the cursor is to the left of whitespace.`),``],description:C(453,`Controls whether the editor should automatically close quotes after the user adds an opening quote.`)})),autoIndent:K(new Ap(16,`autoIndent`,4,`full`,[`none`,`keep`,`brackets`,`advanced`,`full`],Vie,{enumDescriptions:[C(454,`The editor will not insert indentation automatically.`),C(455,`The editor will keep the current line's indentation.`),C(456,`The editor will keep the current line's indentation and honor language defined brackets.`),C(457,`The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages.`),C(458,`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:C(459,`Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.`)})),autoIndentOnPaste:K(new Cp(17,`autoIndentOnPaste`,!1,{description:C(460,`Controls whether the editor should automatically auto-indent the pasted content.`)})),autoIndentOnPasteWithinString:K(new Cp(18,`autoIndentOnPasteWithinString`,!0,{description:C(461,`Controls whether the editor should automatically auto-indent the pasted content when pasted within a string. This takes effect when autoIndentOnPaste is true.`)})),automaticLayout:K(new Cp(19,`automaticLayout`,!1)),autoSurround:K(new kp(20,`autoSurround`,`languageDefined`,[`languageDefined`,`quotes`,`brackets`,`never`],{enumDescriptions:[C(462,`Use language configurations to determine when to automatically surround selections.`),C(463,`Surround with quotes but not brackets.`),C(464,`Surround with brackets but not quotes.`),``],description:C(465,`Controls whether the editor should automatically surround selections when typing quotes or brackets.`)})),bracketPairColorization:K(new hae),bracketPairGuides:K(new gae),stickyTabStops:K(new Cp(132,`stickyTabStops`,!1,{description:C(466,`Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.`)})),codeLens:K(new Cp(23,`codeLens`,!0,{description:C(467,`Controls whether the editor shows CodeLens.`)})),codeLensFontFamily:K(new Dp(24,`codeLensFontFamily`,``,{description:C(468,`Controls the font family for CodeLens.`)})),codeLensFontSize:K(new Tp(25,`codeLensFontSize`,0,0,100,{type:`number`,default:0,minimum:0,maximum:100,markdownDescription:C(469,"Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:K(new Cp(26,`colorDecorators`,!0,{description:C(470,`Controls whether the editor should render the inline color decorators and color picker.`)})),colorDecoratorActivatedOn:K(new kp(168,`colorDecoratorsActivatedOn`,`clickAndHover`,[`clickAndHover`,`hover`,`click`],{enumDescriptions:[C(471,`Make the color picker appear both on click and hover of the color decorator`),C(472,`Make the color picker appear on hover of the color decorator`),C(473,`Make the color picker appear on click of the color decorator`)],description:C(474,`Controls the condition to make a color picker appear from a color decorator.`)})),colorDecoratorsLimit:K(new Tp(27,`colorDecoratorsLimit`,500,1,1e6,{markdownDescription:C(475,`Controls the max number of color decorators that can be rendered in an editor at once.`)})),columnSelection:K(new Cp(28,`columnSelection`,!1,{description:C(476,`Enable that the selection with the mouse and keys is doing column selection.`)})),comments:K(new Uie),contextmenu:K(new Cp(30,`contextmenu`,!0)),copyWithSyntaxHighlighting:K(new Cp(31,`copyWithSyntaxHighlighting`,!0,{description:C(477,`Controls whether syntax highlighting should be copied into the clipboard.`)})),cursorBlinking:K(new Ap(32,`cursorBlinking`,1,`blink`,[`blink`,`smooth`,`phase`,`expand`,`solid`],Wie,{description:C(478,`Control the cursor animation style.`)})),cursorSmoothCaretAnimation:K(new kp(33,`cursorSmoothCaretAnimation`,`off`,[`off`,`explicit`,`on`],{enumDescriptions:[C(479,`Smooth caret animation is disabled.`),C(480,`Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture.`),C(481,`Smooth caret animation is always enabled.`)],description:C(482,`Controls whether the smooth caret animation should be enabled.`)})),cursorStyle:K(new Ap(34,`cursorStyle`,jp.Line,`line`,[`line`,`block`,`underline`,`line-thin`,`block-outline`,`underline-thin`],Mp,{description:C(483,`Controls the cursor style in insert input mode.`)})),overtypeCursorStyle:K(new Ap(92,`overtypeCursorStyle`,jp.Block,`block`,[`line`,`block`,`underline`,`line-thin`,`block-outline`,`underline-thin`],Mp,{description:C(484,`Controls the cursor style in overtype input mode.`)})),cursorSurroundingLines:K(new Tp(35,`cursorSurroundingLines`,0,0,1073741824,{description:C(485,`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:K(new kp(36,`cursorSurroundingLinesStyle`,`default`,[`default`,`all`],{enumDescriptions:[C(486,"`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),C(487,"`cursorSurroundingLines` is enforced always.")],markdownDescription:C(488,"Controls when `#editor.cursorSurroundingLines#` should be enforced.")})),cursorWidth:K(new Tp(37,`cursorWidth`,0,0,1073741824,{markdownDescription:C(489,"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),cursorHeight:K(new Tp(38,`cursorHeight`,0,0,1073741824,{markdownDescription:C(490,"Controls the height of the cursor when `#editor.cursorStyle#` is set to `line`. Cursor's max height depends on line height.")})),disableLayerHinting:K(new Cp(39,`disableLayerHinting`,!1)),disableMonospaceOptimizations:K(new Cp(40,`disableMonospaceOptimizations`,!1)),domReadOnly:K(new Cp(41,`domReadOnly`,!1)),dragAndDrop:K(new Cp(42,`dragAndDrop`,!0,{description:C(491,`Controls whether the editor should allow moving selections via drag and drop.`)})),emptySelectionClipboard:K(new Kie),dropIntoEditor:K(new Sae),editContext:K(new Cp(44,`editContext`,!0,{description:C(492,`Sets whether the EditContext API should be used instead of the text area to power input in the editor.`),included:pn||mn||tn})),renderRichScreenReaderContent:K(new Cp(107,`renderRichScreenReaderContent`,!1,{markdownDescription:C(493,"Whether to render rich screen reader content when the `#editor.editContext#` setting is enabled.")})),stickyScroll:K(new Qie),experimentalGpuAcceleration:K(new kp(46,`experimentalGpuAcceleration`,`off`,[`off`,`on`],{tags:[`experimental`],enumDescriptions:[C(494,`Use regular DOM-based rendering.`),C(495,`Use GPU acceleration.`)],description:C(496,`Controls whether to use the experimental GPU acceleration to render the editor.`)})),experimentalWhitespaceRendering:K(new kp(47,`experimentalWhitespaceRendering`,`svg`,[`svg`,`font`,`off`],{enumDescriptions:[C(497,`Use a new rendering method with svgs.`),C(498,`Use a new rendering method with font characters.`),C(499,`Use the stable rendering method.`)],description:C(500,`Controls whether whitespace is rendered with a new, experimental method.`)})),extraEditorClassName:K(new Dp(48,`extraEditorClassName`,``)),fastScrollSensitivity:K(new Ep(49,`fastScrollSensitivity`,5,e=>e<=0?5:e,{markdownDescription:C(501,"Scrolling speed multiplier when pressing `Alt`.")})),find:K(new qie),fixedOverflowWidgets:K(new Cp(51,`fixedOverflowWidgets`,!1)),folding:K(new Cp(52,`folding`,!0,{description:C(502,`Controls whether the editor has code folding enabled.`)})),foldingStrategy:K(new kp(53,`foldingStrategy`,`auto`,[`auto`,`indentation`],{enumDescriptions:[C(503,`Use a language-specific folding strategy if available, else the indentation-based one.`),C(504,`Use the indentation-based folding strategy.`)],description:C(505,`Controls the strategy for computing folding ranges.`)})),foldingHighlight:K(new Cp(54,`foldingHighlight`,!0,{description:C(506,`Controls whether the editor should highlight folded ranges.`)})),foldingImportsByDefault:K(new Cp(55,`foldingImportsByDefault`,!1,{description:C(507,`Controls whether the editor automatically collapses import ranges.`)})),foldingMaximumRegions:K(new Tp(56,`foldingMaximumRegions`,5e3,10,65e3,{description:C(508,`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:K(new Cp(57,`unfoldOnClickAfterEndOfLine`,!1,{description:C(509,`Controls whether clicking on the empty content after a folded line will unfold the line.`)})),fontFamily:K(new Dp(58,`fontFamily`,pp.fontFamily,{description:C(510,`Controls the font family.`)})),fontInfo:K(new Yie),fontLigatures2:K(new Np),fontSize:K(new Ip),fontWeight:K(new Lp),fontVariations:K(new Jie),formatOnPaste:K(new Cp(64,`formatOnPaste`,!1,{description:C(511,`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:K(new Cp(65,`formatOnType`,!1,{description:C(512,`Controls whether the editor should automatically format the line after typing.`)})),glyphMargin:K(new Cp(66,`glyphMargin`,!0,{description:C(513,`Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.`)})),gotoLocation:K(new Rp),hideCursorInOverviewRuler:K(new Cp(68,`hideCursorInOverviewRuler`,!1,{description:C(514,`Controls whether the cursor should be hidden in the overview ruler.`)})),hover:K(new zp),inDiffEditor:K(new Cp(70,`inDiffEditor`,!1)),inertialScroll:K(new Cp(158,`inertialScroll`,!1,{description:C(515,`Make scrolling inertial - mostly useful with touchpad on linux.`)})),letterSpacing:K(new Ep(72,`letterSpacing`,pp.letterSpacing,e=>Ep.clamp(e,-5,20),{description:C(516,`Controls the letter spacing in pixels.`)})),lightbulb:K(new Zie),lineDecorationsWidth:K(new eae),lineHeight:K(new tae),lineNumbers:K(new lae),lineNumbersMinChars:K(new Tp(77,`lineNumbersMinChars`,5,1,300)),linkedEditing:K(new Cp(78,`linkedEditing`,!1,{description:C(517,`Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.`)})),links:K(new Cp(79,`links`,!0,{description:C(518,`Controls whether the editor should detect links and make them clickable.`)})),matchBrackets:K(new kp(80,`matchBrackets`,`always`,[`always`,`near`,`never`],{description:C(519,`Highlight matching brackets.`)})),minimap:K(new nae),mouseStyle:K(new kp(82,`mouseStyle`,`text`,[`text`,`default`,`copy`])),mouseWheelScrollSensitivity:K(new Ep(83,`mouseWheelScrollSensitivity`,1,e=>e===0?1:e,{markdownDescription:C(520,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:K(new Cp(84,`mouseWheelZoom`,!1,{markdownDescription:$t?C(521,"Zoom the font of the editor when using mouse wheel and holding `Cmd`."):C(522,"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:K(new Cp(85,`multiCursorMergeOverlapping`,!0,{description:C(523,`Merge multiple cursors when they are overlapping.`)})),multiCursorModifier:K(new Ap(86,`multiCursorModifier`,`altKey`,`alt`,[`ctrlCmd`,`alt`],rae,{markdownEnumDescriptions:[C(524,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),C(525,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:C(526,`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).`)})),mouseMiddleClickAction:K(new kp(87,`mouseMiddleClickAction`,`default`,[`default`,`openLink`,`ctrlLeftClick`],{description:C(527,`Controls what happens when middle mouse button is clicked in the editor.`)})),multiCursorPaste:K(new kp(88,`multiCursorPaste`,`spread`,[`spread`,`full`],{markdownEnumDescriptions:[C(528,`Each cursor pastes a single line of the text.`),C(529,`Each cursor pastes the full text.`)],markdownDescription:C(530,`Controls pasting when the line count of the pasted text matches the cursor count.`)})),multiCursorLimit:K(new Tp(89,`multiCursorLimit`,1e4,1,1e5,{markdownDescription:C(531,`Controls the max number of cursors that can be in an active editor at once.`)})),occurrencesHighlight:K(new kp(90,`occurrencesHighlight`,`singleFile`,[`off`,`singleFile`,`multiFile`],{markdownEnumDescriptions:[C(532,`Does not highlight occurrences.`),C(533,`Highlights occurrences only in the current file.`),C(534,`Experimental: Highlights occurrences across all valid open files.`)],markdownDescription:C(535,`Controls whether occurrences should be highlighted across open files.`)})),occurrencesHighlightDelay:K(new Tp(91,`occurrencesHighlightDelay`,0,0,2e3,{description:C(536,`Controls the delay in milliseconds after which occurrences are highlighted.`),tags:[`preview`]})),overtypeOnPaste:K(new Cp(93,`overtypeOnPaste`,!0,{description:C(537,`Controls whether pasting should overtype.`)})),overviewRulerBorder:K(new Cp(94,`overviewRulerBorder`,!0,{description:C(538,`Controls whether a border should be drawn around the overview ruler.`)})),overviewRulerLanes:K(new Tp(95,`overviewRulerLanes`,3,0,3)),padding:K(new iae),pasteAs:K(new Cae),parameterHints:K(new aae),peekWidgetDefaultFocus:K(new kp(99,`peekWidgetDefaultFocus`,`tree`,[`tree`,`editor`],{enumDescriptions:[C(539,`Focus the tree when opening peek`),C(540,`Focus the editor when opening peek`)],description:C(541,`Controls whether to focus the inline editor or the tree in the peek widget.`)})),placeholder:K(new sae),definitionLinkOpensInPeek:K(new Cp(101,`definitionLinkOpensInPeek`,!1,{description:C(542,`Controls whether the Go to Definition mouse gesture always opens the peek widget.`)})),quickSuggestions:K(new cae),quickSuggestionsDelay:K(new Tp(103,`quickSuggestionsDelay`,10,0,1073741824,{description:C(543,`Controls the delay in milliseconds after which quick suggestions will show up.`),experiment:{mode:`auto`}})),readOnly:K(new Cp(104,`readOnly`,!1)),readOnlyMessage:K(new dae),renameOnType:K(new Cp(106,`renameOnType`,!1,{description:C(544,`Controls whether the editor auto renames on type.`),markdownDeprecationMessage:C(545,"Deprecated, use `#editor.linkedEditing#` instead.")})),renderControlCharacters:K(new Cp(108,`renderControlCharacters`,!0,{description:C(546,`Controls whether the editor should render control characters.`),restricted:!0})),renderFinalNewline:K(new kp(109,`renderFinalNewline`,en?`dimmed`:`on`,[`off`,`on`,`dimmed`],{description:C(547,`Render last line number when the file ends with a newline.`)})),renderLineHighlight:K(new kp(110,`renderLineHighlight`,`line`,[`none`,`gutter`,`line`,`all`],{enumDescriptions:[``,``,``,C(548,`Highlights both the gutter and the current line.`)],description:C(549,`Controls how the editor should render the current line highlight.`)})),renderLineHighlightOnlyWhenFocus:K(new Cp(111,`renderLineHighlightOnlyWhenFocus`,!1,{description:C(550,`Controls if the editor should render the current line highlight only when the editor is focused.`)})),renderValidationDecorations:K(new kp(112,`renderValidationDecorations`,`editable`,[`editable`,`on`,`off`])),renderWhitespace:K(new kp(113,`renderWhitespace`,`selection`,[`none`,`boundary`,`selection`,`trailing`,`all`],{enumDescriptions:[``,C(551,`Render whitespace characters except for single spaces between words.`),C(552,`Render whitespace characters only on selected text.`),C(553,`Render only trailing whitespace characters.`),``],description:C(554,`Controls how the editor should render whitespace characters.`)})),revealHorizontalRightPadding:K(new Tp(114,`revealHorizontalRightPadding`,15,0,1e3)),roundedSelection:K(new Cp(115,`roundedSelection`,!0,{description:C(555,`Controls whether selections should have rounded corners.`)})),rulers:K(new uae),scrollbar:K(new fae),scrollBeyondLastColumn:K(new Tp(118,`scrollBeyondLastColumn`,4,0,1073741824,{description:C(556,`Controls the number of extra characters beyond which the editor will scroll horizontally.`)})),scrollBeyondLastLine:K(new Cp(119,`scrollBeyondLastLine`,!0,{description:C(557,`Controls whether the editor will scroll beyond the last line.`)})),scrollOnMiddleClick:K(new Cp(171,`scrollOnMiddleClick`,!1,{description:C(558,`Controls whether the editor will scroll when the middle button is pressed.`)})),scrollPredominantAxis:K(new Cp(120,`scrollPredominantAxis`,!0,{description:C(559,`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:K(new Cp(121,`selectionClipboard`,!0,{description:C(560,`Controls whether the Linux primary clipboard should be supported.`),included:en})),selectionHighlight:K(new Cp(122,`selectionHighlight`,!0,{description:C(561,`Controls whether the editor should highlight matches similar to the selection.`)})),selectionHighlightMaxLength:K(new Tp(123,`selectionHighlightMaxLength`,200,0,1073741824,{description:C(562,`Controls how many characters can be in the selection before similiar matches are not highlighted. Set to zero for unlimited.`)})),selectionHighlightMultiline:K(new Cp(124,`selectionHighlightMultiline`,!1,{description:C(563,`Controls whether the editor should highlight selection matches that span multiple lines.`)})),selectOnLineNumbers:K(new Cp(125,`selectOnLineNumbers`,!0)),showFoldingControls:K(new kp(126,`showFoldingControls`,`mouseover`,[`always`,`never`,`mouseover`],{enumDescriptions:[C(564,`Always show the folding controls.`),C(565,`Never show the folding controls and reduce the gutter size.`),C(566,`Only show the folding controls when the mouse is over the gutter.`)],description:C(567,`Controls when the folding controls on the gutter are shown.`)})),showUnused:K(new Cp(127,`showUnused`,!0,{description:C(568,`Controls fading out of unused code.`)})),showDeprecated:K(new Cp(157,`showDeprecated`,!0,{description:C(569,`Controls strikethrough deprecated variables.`)})),inlayHints:K(new $ie),snippetSuggestions:K(new kp(128,`snippetSuggestions`,`inline`,[`top`,`bottom`,`inline`,`none`],{enumDescriptions:[C(570,`Show snippet suggestions on top of other suggestions.`),C(571,`Show snippet suggestions below other suggestions.`),C(572,`Show snippets suggestions with other suggestions.`),C(573,`Do not show snippet suggestions.`)],description:C(574,`Controls whether snippets are shown with other suggestions and how they are sorted.`)})),smartSelect:K(new vae),smoothScrolling:K(new Cp(130,`smoothScrolling`,!1,{description:C(575,`Controls whether the editor will scroll using an animation.`)})),stopRenderingLineAfter:K(new Tp(133,`stopRenderingLineAfter`,1e4,-1,1073741824)),suggest:K(new _ae),inlineSuggest:K(new mae),inlineCompletionsAccessibilityVerbose:K(new Cp(169,`inlineCompletionsAccessibilityVerbose`,!1,{description:C(576,`Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.`)})),suggestFontSize:K(new Tp(135,`suggestFontSize`,0,0,1e3,{markdownDescription:C(577,`Font size for the suggest widget. When set to {0}, the value of {1} is used.`,"`0`","`#editor.fontSize#`")})),suggestLineHeight:K(new Tp(136,`suggestLineHeight`,0,0,1e3,{markdownDescription:C(578,`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:K(new Cp(137,`suggestOnTriggerCharacters`,!0,{description:C(579,`Controls whether suggestions should automatically show up when typing trigger characters.`)})),suggestSelection:K(new kp(138,`suggestSelection`,`first`,[`first`,`recentlyUsed`,`recentlyUsedByPrefix`],{markdownEnumDescriptions:[C(580,`Always select the first suggestion.`),C(581,"Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),C(582,"Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:C(583,`Controls how suggestions are pre-selected when showing the suggest list.`)})),tabCompletion:K(new kp(139,`tabCompletion`,`off`,[`on`,`off`,`onlySnippets`],{enumDescriptions:[C(584,`Tab complete will insert the best matching suggestion when pressing tab.`),C(585,`Disable tab completions.`),C(586,`Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.`)],description:C(587,`Enables tab completions.`)})),tabIndex:K(new Tp(140,`tabIndex`,0,-1,1073741824)),trimWhitespaceOnDelete:K(new Cp(141,`trimWhitespaceOnDelete`,!1,{description:C(588,`Controls whether the editor will also delete the next line's indentation whitespace when deleting a newline.`)})),unicodeHighlight:K(new pae),unusualLineTerminators:K(new kp(143,`unusualLineTerminators`,`prompt`,[`auto`,`off`,`prompt`],{enumDescriptions:[C(589,`Unusual line terminators are automatically removed.`),C(590,`Unusual line terminators are ignored.`),C(591,`Unusual line terminators prompt to be removed.`)],description:C(592,`Remove unusual line terminators that might cause problems.`)})),useShadowDOM:K(new Cp(144,`useShadowDOM`,!0)),useTabStops:K(new Cp(145,`useTabStops`,!0,{description:C(593,`Spaces and tabs are inserted and deleted in alignment with tab stops.`)})),wordBreak:K(new kp(146,`wordBreak`,`normal`,[`normal`,`keepAll`],{markdownEnumDescriptions:[C(594,`Use the default line break rule.`),C(595,`Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.`)],description:C(596,`Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.`)})),wordSegmenterLocales:K(new yae),wordSeparators:K(new Dp(148,`wordSeparators`,ld,{description:C(597,`Characters that will be used as word separators when doing word related navigations or operations.`)})),wordWrap:K(new kp(149,`wordWrap`,`off`,[`off`,`on`,`wordWrapColumn`,`bounded`],{markdownEnumDescriptions:[C(598,`Lines will never wrap.`),C(599,`Lines will wrap at the viewport width.`),C(600,"Lines will wrap at `#editor.wordWrapColumn#`."),C(601,"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:C(602,`Controls how lines should wrap.`)})),wordWrapBreakAfterCharacters:K(new Dp(150,`wordWrapBreakAfterCharacters`,` })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」`)),wordWrapBreakBeforeCharacters:K(new Dp(151,`wordWrapBreakBeforeCharacters`,`([{‘“〈《「『【〔([{「£¥$£¥++`)),wordWrapColumn:K(new Tp(152,`wordWrapColumn`,80,1,1073741824,{markdownDescription:C(603,"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:K(new kp(153,`wordWrapOverride1`,`inherit`,[`off`,`on`,`inherit`])),wordWrapOverride2:K(new kp(154,`wordWrapOverride2`,`inherit`,[`off`,`on`,`inherit`])),wrapOnEscapedLineFeeds:K(new Cp(160,`wrapOnEscapedLineFeeds`,!1,{markdownDescription:C(604,'Controls whether literal `\\n` shall trigger a wordWrap when `#editor.wordWrap#` is enabled.\n\nFor example:\n```c\nchar* str="hello\\nworld"\n```\nwill be displayed as\n```c\nchar* str="hello\\n\n world"\n```')})),effectiveCursorStyle:K(new Xie),editorClassName:K(new Gie),defaultColorDecorators:K(new kp(167,`defaultColorDecorators`,`auto`,[`auto`,`always`,`never`],{enumDescriptions:[C(605,`Show default color decorators only when no extension provides colors decorators.`),C(606,`Always show default color decorators.`),C(607,`Never show default color decorators.`)],description:C(608,`Controls whether inline color decorations should be shown using the default document color provider.`)})),pixelRatio:K(new oae),tabFocusMode:K(new Cp(164,`tabFocusMode`,!1,{markdownDescription:C(609,`Controls whether the editor receives tabs or defers them to the workbench for navigation.`)})),layoutInfo:K(new Bp),wrappingInfo:K(new xae),wrappingIndent:K(new bae),wrappingStrategy:K(new Vp),effectiveEditContextEnabled:K(new Pp),effectiveAllowVariableFonts:K(new Fp)},wae=class extends D{constructor(){super(...arguments),this._cache=new Map,this._evictUntrustedReadingsTimeout=-1,this._onDidChange=this._register(new k),this.onDidChange=this._onDidChange.event}dispose(){this._evictUntrustedReadingsTimeout!==-1&&(clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache.clear(),this._onDidChange.fire()}_ensureCache(e){let t=Jo(e),n=this._cache.get(t);return n||(n=new Tae,this._cache.set(t,n)),n}_writeToCache(e,t,n){this._ensureCache(e).put(t,n),!n.isTrusted&&this._evictUntrustedReadingsTimeout===-1&&(this._evictUntrustedReadingsTimeout=e.setTimeout(()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)},5e3))}_evictUntrustedReadings(e){let t=this._ensureCache(e),n=t.getValues(),r=!1;for(let e of n)e.isTrusted||(r=!0,t.remove(e));r&&this._onDidChange.fire()}readFontInfo(e,t){let n=this._ensureCache(e);if(!n.has(t)){let n=this._actualReadFontInfo(e,t);(n.typicalHalfwidthCharacterWidth<=2||n.typicalFullwidthCharacterWidth<=2||n.spaceWidth<=2||n.maxDigitWidth<=2)&&(n=new dp({pixelRatio:sp.getInstance(e).value,fontFamily:n.fontFamily,fontWeight:n.fontWeight,fontSize:n.fontSize,fontFeatureSettings:n.fontFeatureSettings,fontVariationSettings:n.fontVariationSettings,lineHeight:n.lineHeight,letterSpacing:n.letterSpacing,isMonospace:n.isMonospace,typicalHalfwidthCharacterWidth:Math.max(n.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(n.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:n.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(n.spaceWidth,5),middotWidth:Math.max(n.middotWidth,5),wsmiddotWidth:Math.max(n.wsmiddotWidth,5),maxDigitWidth:Math.max(n.maxDigitWidth,5)},!1)),this._writeToCache(e,t,n)}return n.get(t)}_createRequest(e,t,n,r){let i=new Iie(e,t);return n.push(i),r?.push(i),i}_actualReadFontInfo(e,t){let n=[],r=[],i=this._createRequest(`n`,0,n,r),a=this._createRequest(`m`,0,n,null),o=this._createRequest(` `,0,n,r),s=this._createRequest(`0`,0,n,r),c=this._createRequest(`1`,0,n,r),l=this._createRequest(`2`,0,n,r),u=this._createRequest(`3`,0,n,r),d=this._createRequest(`4`,0,n,r),f=this._createRequest(`5`,0,n,r),p=this._createRequest(`6`,0,n,r),m=this._createRequest(`7`,0,n,r),h=this._createRequest(`8`,0,n,r),g=this._createRequest(`9`,0,n,r),_=this._createRequest(`→`,0,n,r),v=this._createRequest(`→`,0,n,null),y=this._createRequest(`·`,0,n,r),b=this._createRequest(`⸱`,0,n,null),x=`|/-_ilm%`;for(let e=0;e<8;e++)this._createRequest(x.charAt(e),0,n,r),this._createRequest(x.charAt(e),1,n,r),this._createRequest(x.charAt(e),2,n,r);Rie(e,t,n);let S=Math.max(s.width,c.width,l.width,u.width,d.width,f.width,p.width,m.width,h.width,g.width),ee=t.fontFeatureSettings===Np.OFF,te=r[0].width;for(let e=1,t=r.length;ee&&e<t;e++){let t=te-r[e].width;if(t<-.001||t>.001){ee=!1;break}}let ne=!0;return ee&&v.width!==te&&(ne=!1),v.width>_.width&&(ne=!1),new dp({pixelRatio:sp.getInstance(e).value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:ee,typicalHalfwidthCharacterWidth:i.width,typicalFullwidthCharacterWidth:a.width,canUseHalfwidthRightwardsArrow:ne,spaceWidth:o.width,middotWidth:y.width,wsmiddotWidth:b.width,maxDigitWidth:S},!0)}},Tae=class{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){let t=e.getId();return!!this._values[t]}get(e){let t=e.getId();return this._values[t]}put(e,t){let n=e.getId();this._keys[n]=e,this._values[n]=t}remove(e){let t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}},Zp=new wae,Qp=class e{static{this.items=[]}constructor(e,t){this.key=e,this.migrate=t}apply(t){let n=e._read(t,this.key);this.migrate(n,n=>e._read(t,n),(n,r)=>e._write(t,n,r))}static _read(e,t){if(e==null)return;let n=t.indexOf(`.`);if(n>=0){let r=t.substring(0,n);return this._read(e[r],t.substring(n+1))}return e[t]}static _write(e,t,n){let r=t.indexOf(`.`);if(r>=0){let i=t.substring(0,r);e[i]=e[i]||{},this._write(e[i],t.substring(r+1),n);return}e[t]=n}};function $p(e,t){Qp.items.push(new Qp(e,t))}function em(e,t){$p(e,(n,r,i)=>{if(n!==void 0){for(let[r,a]of t)if(n===r){i(e,a);return}}})}function Eae(e){Qp.items.forEach(t=>t.apply(e))}em(`wordWrap`,[[!0,`on`],[!1,`off`]]),em(`lineNumbers`,[[!0,`on`],[!1,`off`]]),em(`cursorBlinking`,[[`visible`,`solid`]]),em(`renderWhitespace`,[[!0,`boundary`],[!1,`none`]]),em(`renderLineHighlight`,[[!0,`line`],[!1,`none`]]),em(`acceptSuggestionOnEnter`,[[!0,`on`],[!1,`off`]]),em(`tabCompletion`,[[!1,`off`],[!0,`onlySnippets`]]),em(`hover`,[[!0,{enabled:!0}],[!1,{enabled:!1}]]),em(`parameterHints`,[[!0,{enabled:!0}],[!1,{enabled:!1}]]),em(`autoIndent`,[[!1,`advanced`],[!0,`full`]]),em(`matchBrackets`,[[!0,`always`],[!1,`never`]]),em(`renderFinalNewline`,[[!0,`on`],[!1,`off`]]),em(`cursorSmoothCaretAnimation`,[[!0,`on`],[!1,`off`]]),em(`occurrencesHighlight`,[[!0,`singleFile`],[!1,`off`]]),em(`wordBasedSuggestions`,[[!0,`matchingDocuments`],[!1,`off`]]),em(`defaultColorDecorators`,[[!0,`auto`],[!1,`never`]]),em(`minimap.autohide`,[[!0,`mouseover`],[!1,`none`]]),$p(`autoClosingBrackets`,(e,t,n)=>{e===!1&&(n(`autoClosingBrackets`,`never`),t(`autoClosingQuotes`)===void 0&&n(`autoClosingQuotes`,`never`),t(`autoSurround`)===void 0&&n(`autoSurround`,`never`))}),$p(`renderIndentGuides`,(e,t,n)=>{e!==void 0&&(n(`renderIndentGuides`,void 0),t(`guides.indentation`)===void 0&&n(`guides.indentation`,!!e))}),$p(`highlightActiveIndentGuide`,(e,t,n)=>{e!==void 0&&(n(`highlightActiveIndentGuide`,void 0),t(`guides.highlightActiveIndentation`)===void 0&&n(`guides.highlightActiveIndentation`,!!e))});var Dae={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`};$p(`suggest.filteredTypes`,(e,t,n)=>{if(e&&typeof e==`object`){for(let r of Object.entries(Dae))e[r[0]]===!1&&t(`suggest.${r[1]}`)===void 0&&n(`suggest.${r[1]}`,!1);n(`suggest.filteredTypes`,void 0)}}),$p(`quickSuggestions`,(e,t,n)=>{if(typeof e==`boolean`){let t=e?`on`:`off`;n(`quickSuggestions`,{comments:t,strings:t,other:t})}}),$p(`experimental.stickyScroll.enabled`,(e,t,n)=>{typeof e==`boolean`&&(n(`experimental.stickyScroll.enabled`,void 0),t(`stickyScroll.enabled`)===void 0&&n(`stickyScroll.enabled`,e))}),$p(`experimental.stickyScroll.maxLineCount`,(e,t,n)=>{typeof e==`number`&&(n(`experimental.stickyScroll.maxLineCount`,void 0),t(`stickyScroll.maxLineCount`)===void 0&&n(`stickyScroll.maxLineCount`,e))}),$p(`editor.experimentalEditContextEnabled`,(e,t,n)=>{typeof e==`boolean`&&(n(`editor.experimentalEditContextEnabled`,void 0),t(`editor.editContext`)===void 0&&n(`editor.editContext`,e))}),$p(`codeActionsOnSave`,(e,t,n)=>{if(e&&typeof e==`object`){let t=!1,r={};for(let n of Object.entries(e))typeof n[1]==`boolean`?(t=!0,r[n[0]]=n[1]?`explicit`:`never`):r[n[0]]=n[1];t&&n(`codeActionsOnSave`,r)}}),$p(`codeActionWidget.includeNearbyQuickfixes`,(e,t,n)=>{typeof e==`boolean`&&(n(`codeActionWidget.includeNearbyQuickfixes`,void 0),t(`codeActionWidget.includeNearbyQuickFixes`)===void 0&&n(`codeActionWidget.includeNearbyQuickFixes`,e))}),$p(`lightbulb.enabled`,(e,t,n)=>{typeof e==`boolean`&&n(`lightbulb.enabled`,e?void 0:`off`)}),$p(`inlineSuggest.edits.codeShifting`,(e,t,n)=>{typeof e==`boolean`&&(n(`inlineSuggest.edits.codeShifting`,void 0),n(`inlineSuggest.edits.allowCodeShifting`,e?`always`:`never`))});var tm=new class{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new k,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}};function Oae(e,t,n){let r=e.get(58),i=e.get(62),a=e.get(61),o=e.get(60),s=e.get(63),c=e.get(75),l=e.get(72);return up._create(r,i,a,o,s,c,l,t,n)}function kae(e,t,n=!1){let r=Xp.fontFamily.validate(e.fontFamily),i=Xp.fontWeight.validate(e.fontWeight),a=Xp.fontSize.validate(e.fontSize),o=Xp.fontLigatures2.validate(e.fontLigatures),s=Xp.fontVariations.validate(e.fontVariations),c=Xp.lineHeight.validate(e.lineHeight),l=Xp.letterSpacing.validate(e.letterSpacing);return up._create(r,i,a,o,s,c,l,t,n)}var nm=pc(`accessibilityService`),rm=new z(`accessibilityModeEnabled`,!1),Aae=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},jae=function(e,t){return function(n,r){t(n,r,e)}},im=class extends D{constructor(e,t,n,r,i){super(),this._accessibilityService=i,this._onDidChange=this._register(new k),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new k),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new gp,this.isSimpleWidget=e,this.contextMenuId=t,this._containerObserver=this._register(new op(r,n.dimension)),this._targetWindowId=Ko(r).vscodeWindowId,this._rawOptions=om(n),this._validatedOptions=am.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(19)&&this._containerObserver.startObserving(),this._register(cp.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(tm.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(Zp.onDidChange(()=>this._recomputeOptions())),this._register(sp.getInstance(Ko(r)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions())),this._register(_u.onDidChangeInputMode(()=>this._recomputeOptions()))}_recomputeOptions(){let e=this._computeOptions(),t=am.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){let e=this._readEnvConfiguration(),t=Oae(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),n=this._readFontInfo(t),r={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:n,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:this._validatedOptions.get(164)||tm.getTabFocusMode(),inputMode:_u.getInputMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount,editContextSupported:e.editContextSupported};return am.computeOptions(this._validatedOptions,r)}_readEnvConfiguration(){return{extraEditorClassName:Nae(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:nt||tt,pixelRatio:sp.getInstance(Yo(this._targetWindowId,!0).window).value,editContextSupported:typeof globalThis.EditContext==`function`,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return Zp.readFontInfo(Yo(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){let t=om(e);am.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=am.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){let t=Mae(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())}};im=Aae([jae(4,nm)],im);function Mae(e){let t=0;for(;e;)e=Math.floor(e/10),t++;return t||1}function Nae(){let e=``;return it||at?(e+=`no-minimap-shadow `,e+=`enable-user-select `):e+=`no-user-select `,$t&&(e+=`mac `),e}var Pae=class{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}},Fae=class{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw Error(`Cannot read uninitialized value`);return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}},am=class e{static validateOptions(e){let t=new Pae;for(let n of Yp){let r=n.name===`_never_`?void 0:e[n.name];t._write(n.id,n.validate(r))}return t}static computeOptions(e,t){let n=new Fae;for(let r of Yp)n._write(r.id,r.compute(t,n,e._read(r.id)));return n}static _deepEquals(t,n){if(typeof t!=`object`||typeof n!=`object`||!t||!n)return t===n;if(Array.isArray(t)||Array.isArray(n))return Array.isArray(t)&&Array.isArray(n)?va(t,n):!1;if(Object.keys(t).length!==Object.keys(n).length)return!1;for(let r in t)if(!e._deepEquals(t[r],n[r]))return!1;return!0}static checkEquals(t,n){let r=[],i=!1;for(let a of Yp){let o=!e._deepEquals(t._read(a.id),n._read(a.id));r[a.id]=o,o&&(i=!0)}return i?new hp(r):null}static applyUpdate(e,t){let n=!1;for(let r of Yp)if(t.hasOwnProperty(r.name)){let i=r.applyUpdate(e[r.name],t[r.name]);e[r.name]=i.newValue,n||=i.didChange}return n}};function om(e){let t=Wu(e);return Eae(t),t}var sm;(function(e){let t={total:0,min:Number.MAX_VALUE,max:0},n={...t},r={...t},i={...t},a=0,o={keydown:0,input:0,render:0};function s(){_(),performance.mark(`inputlatency/start`),performance.mark(`keydown/start`),o.keydown=1,queueMicrotask(c)}e.onKeyDown=s;function c(){o.keydown===1&&(performance.mark(`keydown/end`),o.keydown=2)}function l(){performance.mark(`input/start`),o.input=1,g()}e.onBeforeInput=l;function u(){o.input===0&&l(),queueMicrotask(d)}e.onInput=u;function d(){o.input===1&&(performance.mark(`input/end`),o.input=2)}function f(){_()}e.onKeyUp=f;function p(){_()}e.onSelectionChange=p;function m(){o.keydown===2&&o.input===2&&o.render===0&&(performance.mark(`render/start`),o.render=1,queueMicrotask(h),g())}e.onRenderStart=m;function h(){o.render===1&&(performance.mark(`render/end`),o.render=2)}function g(){setTimeout(_)}function _(){o.keydown===2&&o.input===2&&o.render===2&&(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`),v(`keydown`,t),v(`input`,n),v(`render`,r),v(`inputlatency`,i),a++,y())}function v(e,t){let n=performance.getEntriesByName(e)[0].duration;t.total+=n,t.min=Math.min(t.min,n),t.max=Math.max(t.max,n)}function y(){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`),o.keydown=0,o.input=0,o.render=0}function b(){if(a===0)return;let e={keydown:x(t),input:x(n),render:x(r),total:x(i),sampleCount:a};return S(t),S(n),S(r),S(i),a=0,e}e.getAndClearMeasurements=b;function x(e){return{average:e.total/a,max:e.max,min:e.min}}function S(e){e.total=0,e.min=Number.MAX_VALUE,e.max=0}})(sm||={});var cm=new Map;function Iae(){return new Lae}var Lae=class{constructor(){this._currentCssStyle=``,this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.textContent=e:this._styleSheet=lm(Xe.document.head,t=>t.textContent=e))}dispose(){this._styleSheet&&=(this._styleSheet.remove(),void 0)}};function lm(e=Xe.document.head,t,n){let r=document.createElement(`style`);if(r.type=`text/css`,r.media=`screen`,t?.(r),e.appendChild(r),n&&n.add(T(()=>r.remove())),e===Xe.document.head){let e=new Set;cm.set(r,e),n&&n.add(T(()=>cm.delete(r)));for(let{window:t,disposables:i}of qo()){if(t===Xe)continue;let a=i.add(Rae(r,e,t));n?.add(a)}}return r}function Rae(e,t,n){let r=new E,i=e.cloneNode(!0);n.document.head.appendChild(i),r.add(T(()=>i.remove()));for(let t of fm(e))i.sheet?.insertRule(t.cssText,i.sheet?.cssRules.length);return r.add(hne.observe(e,r,{childList:!0,subtree:tt,characterData:tt})(()=>{i.textContent=e.textContent})),t.add(i),r.add(T(()=>t.delete(i))),r}var um=null;function dm(){return um||=lm(),um}function fm(e){return e?.sheet?.rules?e.sheet.rules:e?.sheet?.cssRules?e.sheet.cssRules:[]}function pm(e,t,n=dm()){if(!(!n||!t)){n.sheet?.insertRule(`${e} {${t}}`,0);for(let r of cm.get(n)??[])pm(e,t,r)}}function mm(e,t=dm()){if(!t)return;let n=fm(t),r=[];for(let t=0;t<n.length;t++){let i=n[t];zae(i)&&i.selectorText.indexOf(e)!==-1&&r.push(t)}for(let e=r.length-1;e>=0;e--)t.sheet?.deleteRule(r[e]);for(let n of cm.get(t)??[])mm(e,n)}function zae(e){return typeof e.selectorText==`string`}function Bae(e){let t=new E,n=t.add(Iae());return t.add(So(t=>{n.setStyle(e.read(t))})),t}var hm=class{constructor(){this._hooks=new E,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;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,i){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=i;let a=e;try{e.setPointerCapture(t),this._hooks.add(T(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{a=Ko(e)}this._hooks.add(j(a,M.POINTER_MOVE,e=>{if(e.buttons!==n){this.stopMonitoring(!0);return}e.preventDefault(),this._pointerMoveCallback(e)})),this._hooks.add(j(a,M.POINTER_UP,e=>this.stopMonitoring(!0)))}};function gm(e,t){let n=10**t;return Math.round(e*n)/n}var q=class{constructor(e,t,n,r=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,n))|0,this.a=gm(Math.max(Math.min(1,r),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}},_m=class e{constructor(e,t,n,r){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=gm(Math.max(Math.min(1,t),0),3),this.l=gm(Math.max(Math.min(1,n),0),3),this.a=gm(Math.max(Math.min(1,r),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(t){let n=t.r/255,r=t.g/255,i=t.b/255,a=t.a,o=Math.max(n,r,i),s=Math.min(n,r,i),c=0,l=0,u=(s+o)/2,d=o-s;if(d>0){switch(l=Math.min(u<=.5?d/(2*u):d/(2-2*u),1),o){case n:c=(r-i)/d+(r<i?6:0);break;case r:c=(i-n)/d+2;break;case i:c=(n-r)/d+4;break}c*=60,c=Math.round(c)}return new e(c,l,u,a)}static _hue2rgb(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}static toRGBA(t){let n=t.h/360,{s:r,l:i,a}=t,o,s,c;if(r===0)o=s=c=i;else{let t=i<.5?i*(1+r):i+r-i*r,a=2*i-t;o=e._hue2rgb(a,t,n+1/3),s=e._hue2rgb(a,t,n),c=e._hue2rgb(a,t,n-1/3)}return new q(Math.round(o*255),Math.round(s*255),Math.round(c*255),a)}},vm=class e{constructor(e,t,n,r){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=gm(Math.max(Math.min(1,t),0),3),this.v=gm(Math.max(Math.min(1,n),0),3),this.a=gm(Math.max(Math.min(1,r),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(t){let n=t.r/255,r=t.g/255,i=t.b/255,a=Math.max(n,r,i),o=a-Math.min(n,r,i),s=a===0?0:o/a,c;return c=o===0?0:a===n?((r-i)/o%6+6)%6:a===r?(i-n)/o+2:(n-r)/o+4,new e(Math.round(c*60),s,a,t.a)}static toRGBA(e){let{h:t,s:n,v:r,a:i}=e,a=r*n,o=a*(1-Math.abs(t/60%2-1)),s=r-a,[c,l,u]=[0,0,0];return t<60?(c=a,l=o):t<120?(c=o,l=a):t<180?(l=a,u=o):t<240?(l=o,u=a):t<300?(c=o,u=a):t<=360&&(c=a,u=o),c=Math.round((c+s)*255),l=Math.round((l+s)*255),u=Math.round((u+s)*255),new q(c,l,u,i)}},J=class e{static fromHex(t){return e.Format.CSS.parseHex(t)||e.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:_m.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:vm.fromRGBA(this.rgba)}constructor(e){if(!e)throw Error(`Color needs a value`);if(e instanceof q)this.rgba=e;else if(e instanceof _m)this._hsla=e,this.rgba=_m.toRGBA(e);else if(e instanceof vm)this._hsva=e,this.rgba=vm.toRGBA(e);else throw Error(`Invalid color ctor argument`)}equals(e){return!!e&&q.equals(this.rgba,e.rgba)&&_m.equals(this.hsla,e.hsla)&&vm.equals(this.hsva,e.hsva)}getRelativeLuminance(){let t=e._relativeLuminanceForComponent(this.rgba.r),n=e._relativeLuminanceForComponent(this.rgba.g),r=e._relativeLuminanceForComponent(this.rgba.b);return gm(.2126*t+.7152*n+.0722*r,4)}static _relativeLuminanceForComponent(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){return this.getRelativeLuminance()>e.getRelativeLuminance()}isDarkerThan(e){return this.getRelativeLuminance()<e.getRelativeLuminance()}lighten(t){return new e(new _m(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*t,this.hsla.a))}darken(t){return new e(new _m(this.hsla.h,this.hsla.s,this.hsla.l-this.hsla.l*t,this.hsla.a))}transparent(t){let{r:n,g:r,b:i,a}=this.rgba;return new e(new q(n,r,i,a*t))}isTransparent(){return this.rgba.a===0}isOpaque(){return this.rgba.a===1}opposite(){return new e(new q(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}mix(t,n=.5){let r=Math.min(Math.max(n,0),1),i=this.rgba,a=t.rgba;return new e(new q(i.r+(a.r-i.r)*r,i.g+(a.g-i.g)*r,i.b+(a.b-i.b)*r,i.a+(a.a-i.a)*r))}makeOpaque(t){if(this.isOpaque()||t.rgba.a!==1)return this;let{r:n,g:r,b:i,a}=this.rgba;return new e(new q(t.rgba.r-a*(t.rgba.r-n),t.rgba.g-a*(t.rgba.g-r),t.rgba.b-a*(t.rgba.b-i),1))}toString(){return this._toString||=e.Format.CSS.format(this),this._toString}toNumber32Bit(){return this._toNumber32Bit||=(this.rgba.r<<24|this.rgba.g<<16|this.rgba.b<<8|this.rgba.a*255<<0)>>>0,this._toNumber32Bit}static getLighterColor(e,t,n){if(e.isLighterThan(t))return e;n||=.5;let r=e.getRelativeLuminance(),i=t.getRelativeLuminance();return n=n*(i-r)/i,e.lighten(n)}static getDarkerColor(e,t,n){if(e.isDarkerThan(t))return e;n||=.5;let r=e.getRelativeLuminance(),i=t.getRelativeLuminance();return n=n*(r-i)/r,e.darken(n)}static{this.white=new e(new q(255,255,255,1))}static{this.black=new e(new q(0,0,0,1))}static{this.red=new e(new q(255,0,0,1))}static{this.blue=new e(new q(0,0,255,1))}static{this.green=new e(new q(0,255,0,1))}static{this.cyan=new e(new q(0,255,255,1))}static{this.lightgrey=new e(new q(211,211,211,1))}static{this.transparent=new e(new q(0,0,0,0))}};(function(e){(function(t){(function(t){function n(t){return t.rgba.a===1?`rgb(${t.rgba.r}, ${t.rgba.g}, ${t.rgba.b})`:e.Format.CSS.formatRGBA(t)}t.formatRGB=n;function r(e){return`rgba(${e.rgba.r}, ${e.rgba.g}, ${e.rgba.b}, ${+e.rgba.a.toFixed(2)})`}t.formatRGBA=r;function i(t){return t.hsla.a===1?`hsl(${t.hsla.h}, ${Math.round(t.hsla.s*100)}%, ${Math.round(t.hsla.l*100)}%)`:e.Format.CSS.formatHSLA(t)}t.formatHSL=i;function a(e){return`hsla(${e.hsla.h}, ${Math.round(e.hsla.s*100)}%, ${Math.round(e.hsla.l*100)}%, ${e.hsla.a.toFixed(2)})`}t.formatHSLA=a;function o(e){let t=e.toString(16);return t.length===2?t:`0`+t}function s(e){return`#${o(e.rgba.r)}${o(e.rgba.g)}${o(e.rgba.b)}`}t.formatHex=s;function c(t,n=!1){return n&&t.rgba.a===1?e.Format.CSS.formatHex(t):`#${o(t.rgba.r)}${o(t.rgba.g)}${o(t.rgba.b)}${o(Math.round(t.rgba.a*255))}`}t.formatHexA=c;function l(t){return t.isOpaque()?e.Format.CSS.formatHex(t):e.Format.CSS.formatRGBA(t)}t.format=l;function u(t){if(t===`transparent`)return e.transparent;if(t.startsWith(`#`))return f(t);if(t.startsWith(`rgba(`)){let n=t.match(/rgba\((?<r>(?:\+|-)?\d+), *(?<g>(?:\+|-)?\d+), *(?<b>(?:\+|-)?\d+), *(?<a>(?:\+|-)?\d+(\.\d+)?)\)/);if(!n)throw Error(`Invalid color format `+t);return new e(new q(parseInt(n.groups?.r??`0`),parseInt(n.groups?.g??`0`),parseInt(n.groups?.b??`0`),parseFloat(n.groups?.a??`0`)))}if(t.startsWith(`rgb(`)){let n=t.match(/rgb\((?<r>(?:\+|-)?\d+), *(?<g>(?:\+|-)?\d+), *(?<b>(?:\+|-)?\d+)\)/);if(!n)throw Error(`Invalid color format `+t);return new e(new q(parseInt(n.groups?.r??`0`),parseInt(n.groups?.g??`0`),parseInt(n.groups?.b??`0`)))}return d(t)}t.parse=u;function d(t){switch(t){case`aliceblue`:return new e(new q(240,248,255,1));case`antiquewhite`:return new e(new q(250,235,215,1));case`aqua`:return new e(new q(0,255,255,1));case`aquamarine`:return new e(new q(127,255,212,1));case`azure`:return new e(new q(240,255,255,1));case`beige`:return new e(new q(245,245,220,1));case`bisque`:return new e(new q(255,228,196,1));case`black`:return new e(new q(0,0,0,1));case`blanchedalmond`:return new e(new q(255,235,205,1));case`blue`:return new e(new q(0,0,255,1));case`blueviolet`:return new e(new q(138,43,226,1));case`brown`:return new e(new q(165,42,42,1));case`burlywood`:return new e(new q(222,184,135,1));case`cadetblue`:return new e(new q(95,158,160,1));case`chartreuse`:return new e(new q(127,255,0,1));case`chocolate`:return new e(new q(210,105,30,1));case`coral`:return new e(new q(255,127,80,1));case`cornflowerblue`:return new e(new q(100,149,237,1));case`cornsilk`:return new e(new q(255,248,220,1));case`crimson`:return new e(new q(220,20,60,1));case`cyan`:return new e(new q(0,255,255,1));case`darkblue`:return new e(new q(0,0,139,1));case`darkcyan`:return new e(new q(0,139,139,1));case`darkgoldenrod`:return new e(new q(184,134,11,1));case`darkgray`:return new e(new q(169,169,169,1));case`darkgreen`:return new e(new q(0,100,0,1));case`darkgrey`:return new e(new q(169,169,169,1));case`darkkhaki`:return new e(new q(189,183,107,1));case`darkmagenta`:return new e(new q(139,0,139,1));case`darkolivegreen`:return new e(new q(85,107,47,1));case`darkorange`:return new e(new q(255,140,0,1));case`darkorchid`:return new e(new q(153,50,204,1));case`darkred`:return new e(new q(139,0,0,1));case`darksalmon`:return new e(new q(233,150,122,1));case`darkseagreen`:return new e(new q(143,188,143,1));case`darkslateblue`:return new e(new q(72,61,139,1));case`darkslategray`:return new e(new q(47,79,79,1));case`darkslategrey`:return new e(new q(47,79,79,1));case`darkturquoise`:return new e(new q(0,206,209,1));case`darkviolet`:return new e(new q(148,0,211,1));case`deeppink`:return new e(new q(255,20,147,1));case`deepskyblue`:return new e(new q(0,191,255,1));case`dimgray`:return new e(new q(105,105,105,1));case`dimgrey`:return new e(new q(105,105,105,1));case`dodgerblue`:return new e(new q(30,144,255,1));case`firebrick`:return new e(new q(178,34,34,1));case`floralwhite`:return new e(new q(255,250,240,1));case`forestgreen`:return new e(new q(34,139,34,1));case`fuchsia`:return new e(new q(255,0,255,1));case`gainsboro`:return new e(new q(220,220,220,1));case`ghostwhite`:return new e(new q(248,248,255,1));case`gold`:return new e(new q(255,215,0,1));case`goldenrod`:return new e(new q(218,165,32,1));case`gray`:return new e(new q(128,128,128,1));case`green`:return new e(new q(0,128,0,1));case`greenyellow`:return new e(new q(173,255,47,1));case`grey`:return new e(new q(128,128,128,1));case`honeydew`:return new e(new q(240,255,240,1));case`hotpink`:return new e(new q(255,105,180,1));case`indianred`:return new e(new q(205,92,92,1));case`indigo`:return new e(new q(75,0,130,1));case`ivory`:return new e(new q(255,255,240,1));case`khaki`:return new e(new q(240,230,140,1));case`lavender`:return new e(new q(230,230,250,1));case`lavenderblush`:return new e(new q(255,240,245,1));case`lawngreen`:return new e(new q(124,252,0,1));case`lemonchiffon`:return new e(new q(255,250,205,1));case`lightblue`:return new e(new q(173,216,230,1));case`lightcoral`:return new e(new q(240,128,128,1));case`lightcyan`:return new e(new q(224,255,255,1));case`lightgoldenrodyellow`:return new e(new q(250,250,210,1));case`lightgray`:return new e(new q(211,211,211,1));case`lightgreen`:return new e(new q(144,238,144,1));case`lightgrey`:return new e(new q(211,211,211,1));case`lightpink`:return new e(new q(255,182,193,1));case`lightsalmon`:return new e(new q(255,160,122,1));case`lightseagreen`:return new e(new q(32,178,170,1));case`lightskyblue`:return new e(new q(135,206,250,1));case`lightslategray`:return new e(new q(119,136,153,1));case`lightslategrey`:return new e(new q(119,136,153,1));case`lightsteelblue`:return new e(new q(176,196,222,1));case`lightyellow`:return new e(new q(255,255,224,1));case`lime`:return new e(new q(0,255,0,1));case`limegreen`:return new e(new q(50,205,50,1));case`linen`:return new e(new q(250,240,230,1));case`magenta`:return new e(new q(255,0,255,1));case`maroon`:return new e(new q(128,0,0,1));case`mediumaquamarine`:return new e(new q(102,205,170,1));case`mediumblue`:return new e(new q(0,0,205,1));case`mediumorchid`:return new e(new q(186,85,211,1));case`mediumpurple`:return new e(new q(147,112,219,1));case`mediumseagreen`:return new e(new q(60,179,113,1));case`mediumslateblue`:return new e(new q(123,104,238,1));case`mediumspringgreen`:return new e(new q(0,250,154,1));case`mediumturquoise`:return new e(new q(72,209,204,1));case`mediumvioletred`:return new e(new q(199,21,133,1));case`midnightblue`:return new e(new q(25,25,112,1));case`mintcream`:return new e(new q(245,255,250,1));case`mistyrose`:return new e(new q(255,228,225,1));case`moccasin`:return new e(new q(255,228,181,1));case`navajowhite`:return new e(new q(255,222,173,1));case`navy`:return new e(new q(0,0,128,1));case`oldlace`:return new e(new q(253,245,230,1));case`olive`:return new e(new q(128,128,0,1));case`olivedrab`:return new e(new q(107,142,35,1));case`orange`:return new e(new q(255,165,0,1));case`orangered`:return new e(new q(255,69,0,1));case`orchid`:return new e(new q(218,112,214,1));case`palegoldenrod`:return new e(new q(238,232,170,1));case`palegreen`:return new e(new q(152,251,152,1));case`paleturquoise`:return new e(new q(175,238,238,1));case`palevioletred`:return new e(new q(219,112,147,1));case`papayawhip`:return new e(new q(255,239,213,1));case`peachpuff`:return new e(new q(255,218,185,1));case`peru`:return new e(new q(205,133,63,1));case`pink`:return new e(new q(255,192,203,1));case`plum`:return new e(new q(221,160,221,1));case`powderblue`:return new e(new q(176,224,230,1));case`purple`:return new e(new q(128,0,128,1));case`rebeccapurple`:return new e(new q(102,51,153,1));case`red`:return new e(new q(255,0,0,1));case`rosybrown`:return new e(new q(188,143,143,1));case`royalblue`:return new e(new q(65,105,225,1));case`saddlebrown`:return new e(new q(139,69,19,1));case`salmon`:return new e(new q(250,128,114,1));case`sandybrown`:return new e(new q(244,164,96,1));case`seagreen`:return new e(new q(46,139,87,1));case`seashell`:return new e(new q(255,245,238,1));case`sienna`:return new e(new q(160,82,45,1));case`silver`:return new e(new q(192,192,192,1));case`skyblue`:return new e(new q(135,206,235,1));case`slateblue`:return new e(new q(106,90,205,1));case`slategray`:return new e(new q(112,128,144,1));case`slategrey`:return new e(new q(112,128,144,1));case`snow`:return new e(new q(255,250,250,1));case`springgreen`:return new e(new q(0,255,127,1));case`steelblue`:return new e(new q(70,130,180,1));case`tan`:return new e(new q(210,180,140,1));case`teal`:return new e(new q(0,128,128,1));case`thistle`:return new e(new q(216,191,216,1));case`tomato`:return new e(new q(255,99,71,1));case`turquoise`:return new e(new q(64,224,208,1));case`violet`:return new e(new q(238,130,238,1));case`wheat`:return new e(new q(245,222,179,1));case`white`:return new e(new q(255,255,255,1));case`whitesmoke`:return new e(new q(245,245,245,1));case`yellow`:return new e(new q(255,255,0,1));case`yellowgreen`:return new e(new q(154,205,50,1));default:return null}}function f(t){let n=t.length;if(n===0||t.charCodeAt(0)!==35)return null;if(n===7)return new e(new q(16*p(t.charCodeAt(1))+p(t.charCodeAt(2)),16*p(t.charCodeAt(3))+p(t.charCodeAt(4)),16*p(t.charCodeAt(5))+p(t.charCodeAt(6)),1));if(n===9)return new e(new q(16*p(t.charCodeAt(1))+p(t.charCodeAt(2)),16*p(t.charCodeAt(3))+p(t.charCodeAt(4)),16*p(t.charCodeAt(5))+p(t.charCodeAt(6)),(16*p(t.charCodeAt(7))+p(t.charCodeAt(8)))/255));if(n===4){let n=p(t.charCodeAt(1)),r=p(t.charCodeAt(2)),i=p(t.charCodeAt(3));return new e(new q(16*n+n,16*r+r,16*i+i))}if(n===5){let n=p(t.charCodeAt(1)),r=p(t.charCodeAt(2)),i=p(t.charCodeAt(3)),a=p(t.charCodeAt(4));return new e(new q(16*n+n,16*r+r,16*i+i,(16*a+a)/255))}return null}t.parseHex=f;function p(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:return 10;case 65:return 10;case 98:return 11;case 66:return 11;case 99:return 12;case 67:return 12;case 100:return 13;case 68:return 13;case 101:return 14;case 69:return 14;case 102:return 15;case 70:return 15}return 0}})(t.CSS||={})})(e.Format||={})})(J||={});function ym(e){return`--vscode-${e.replace(/\./g,`-`)}`}function Y(e){return`var(${ym(e)})`}function bm(e,t){return`var(${ym(e)}, ${t})`}function xm(e){return typeof e==`object`&&!!e&&`light`in e&&`dark`in e}var Sm={ColorContribution:`base.contributions.colors`},Cm=`default`,wm=new class extends D{constructor(){super(),this._onDidChangeSchema=this._register(new k),this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:`object`,properties:{}},this.colorReferenceSchema={type:`string`,enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,n,r=!1,i){let a={id:e,description:n,defaults:t,needsTransparency:r,deprecationMessage:i};this.colorsById[e]=a;let o={type:`string`,format:`color-hex`,defaultSnippets:[{body:"${1:#ff0000}"}]};return i&&(o.deprecationMessage=i),r&&(o.pattern=`^#(?:(?<rgba>[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$`,o.patternErrorMessage=C(2022,`This color must be transparent or it will obscure content`)),this.colorSchema.properties[e]={description:n,oneOf:[o,{type:`string`,const:Cm,description:C(2023,`Use the default color.`)}]},this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(n),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){let n=this.colorsById[e];if(n?.defaults)return Mm(xm(n.defaults)?n.defaults[t.type]:n.defaults,t)}getColorSchema(){return this.colorSchema}toString(){return Object.keys(this.colorsById).sort((e,t)=>{let n=e.indexOf(`.`)===-1?0:1,r=t.indexOf(`.`)===-1?0:1;return n===r?e.localeCompare(t):n-r}).map(e=>`- \`${e}\`: ${this.colorsById[e].description}`).join(`
@@ -57,7 +57,7 @@ Received: '{1}'.`,t,jc.getLexeme(n)),a=n.offset,o=jc.getLexeme(n);return this._p
57
57
  </span></span>`):t.appendString(`<span><span></span></span>`),new Ng(new Mg(0,0),0)}return Bse(Nse(e),t)}var jse=class{constructor(e,t,n){this.characterMapping=e,this.html=t,this.containsForeignElements=n}};function Fg(e){let t=new yd(1e4),n=Pg(e,t);return new jse(n.characterMapping,t.build(),n.containsForeignElements)}var Mse=class{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.len=r,this.isOverflowing=i,this.overflowingCharCount=a,this.parts=o,this.containsForeignElements=s,this.fauxIndentLength=c,this.tabSize=l,this.startVisibleColumn=u,this.spaceWidth=d,this.renderSpaceCharCode=f,this.renderWhitespace=p,this.renderControlCharacters=m}};function Nse(e){let t=e.lineContent,n,r,i;e.stopRenderingLineAfter!==-1&&e.stopRenderingLineAfter<t.length?(n=!0,r=t.length-e.stopRenderingLineAfter,i=e.stopRenderingLineAfter):(n=!1,r=0,i=t.length);let a=Pse(t,e.containsRTL,e.lineTokens,e.fauxIndentLength,i);e.renderControlCharacters&&!e.isBasicASCII&&(a=Lse(t,a)),(e.renderWhitespace===4||e.renderWhitespace===1||e.renderWhitespace===2&&e.selectionsOnLine||e.renderWhitespace===3&&!e.continuesWithWrappedLine)&&(a=Rse(e,t,i,a));let o=0;if(e.lineDecorations.length>0){for(let t=0,n=e.lineDecorations.length;t<n;t++){let n=e.lineDecorations[t];n.type===3||n.type===1?o|=1:n.type===2&&(o|=2)}a=zse(t,i,a,e.lineDecorations)}return a=e.containsRTL?Ise(t,a):Fse(t,a,!e.isBasicASCII||e.fontLigatures),new Mse(e.useMonospaceOptimizations,e.canUseHalfwidthRightwardsArrow,t,i,n,r,a,o,e.fauxIndentLength,e.tabSize,e.startVisibleColumn,e.spaceWidth,e.renderSpaceCharCode,e.renderWhitespace,e.renderControlCharacters)}function Pse(e,t,n,r,i){let a=[],o=0;r>0&&(a[o++]=new kg(r,``,0,!1));let s=r;for(let c=0,l=n.getCount();c<l;c++){let l=n.getEndOffset(c);if(l<=r)continue;let u=n.getClassName(c);if(l>=i){let n=t?ii(e.substring(s,i)):!1;a[o++]=new kg(i,u,0,n);break}let d=t?ii(e.substring(s,l)):!1;a[o++]=new kg(l,u,0,d),s=l}return a}function Fse(e,t,n){let r=0,i=[],a=0;if(n)for(let n=0,o=t.length;n<o;n++){let o=t[n],s=o.endIndex;if(r+50<s){let t=o.type,n=o.metadata,c=o.containsRTL,l=-1,u=r;for(let o=r;o<s;o++)e.charCodeAt(o)===32&&(l=o),l!==-1&&o-u>=50&&(i[a++]=new kg(l+1,t,n,c),u=l+1,l=-1);u!==s&&(i[a++]=new kg(s,t,n,c))}else i[a++]=o;r=s}else for(let e=0,n=t.length;e<n;e++){let n=t[e],o=n.endIndex,s=o-r;if(s>50){let e=n.type,t=n.metadata,c=n.containsRTL,l=Math.ceil(s/50);for(let n=1;n<l;n++){let o=r+n*50;i[a++]=new kg(o,e,t,c)}i[a++]=new kg(o,e,t,c)}else i[a++]=n;r=o}return i}function Ise(e,t){if(t.length===0)return t;let n=t[0];if(!n.containsRTL)return t;let r=n.endIndex,i=0;for(let t=0;t<r;t++){let n=e.charCodeAt(t);if(n!==32&&n!==9){i=t;break}}if(i===0)return t;let a=[];a.push(new kg(i,n.type,n.metadata,!1)),a.push(new kg(r,n.type,n.metadata,n.containsRTL));for(let e=1;e<t.length;e++)a.push(t[e]);return a}function Ig(e){return e<32?e!==9:e===127||e>=8234&&e<=8238||e>=8294&&e<=8297||e>=8206&&e<=8207||e===1564}function Lse(e,t){let n=[],r=new kg(0,``,0,!1),i=0;for(let a of t){let t=a.endIndex;for(;i<t;i++)Ig(e.charCodeAt(i))&&(i>r.endIndex&&(r=new kg(i,a.type,a.metadata,a.containsRTL),n.push(r)),r=new kg(i+1,`mtkcontrol`,a.metadata,!1),n.push(r));i>r.endIndex&&(r=new kg(t,a.type,a.metadata,a.containsRTL),n.push(r))}return n}function Rse(e,t,n,r){let i=e.continuesWithWrappedLine,a=e.fauxIndentLength,o=e.tabSize,s=e.startVisibleColumn,c=e.useMonospaceOptimizations,l=e.selectionsOnLine,u=e.renderWhitespace===1,d=e.renderWhitespace===3,f=e.renderSpaceWidth!==e.spaceWidth,p=[],m=0,h=0,g=r[h].type,_=r[h].containsRTL,v=r[h].endIndex,y=r.length,b=!1,x=Pr(t),S;x===-1?(b=!0,x=n,S=n):S=Ir(t);let ee=!1,te=0,ne=l&&l[te],re=s%o;for(let e=a;e<n;e++){let i=t.charCodeAt(e);ne&&ne.endExclusive<=e&&(te++,ne=l&&l[te]);let s;if(e<x||e>S)s=!0;else if(i===9)s=!0;else if(i===32)if(u)if(ee)s=!0;else{let r=e+1<n?t.charCodeAt(e+1):0;s=r===32||r===9}else s=!0;else s=!1;if(s&&l&&(s=!!ne&&ne.start<=e&&e<ne.endExclusive),s&&d&&(s=b||e>S),s&&_&&e>=x&&e<=S&&(s=!1),ee){if(!s||!c&&re>=o){if(f){let t=m>0?p[m-1].endIndex:a;for(let n=t+1;n<=e;n++)p[m++]=new kg(n,`mtkw`,1,!1)}else p[m++]=new kg(e,`mtkw`,1,!1);re%=o}}else (e===v||s&&e>a)&&(p[m++]=new kg(e,g,0,_),re%=o);for(i===9?re=o:ci(i)?re+=2:re++,ee=s;e===v&&(h++,h<y);)g=r[h].type,_=r[h].containsRTL,v=r[h].endIndex}let ie=!1;if(ee)if(i&&u){let e=n>0?t.charCodeAt(n-1):0,r=n>1?t.charCodeAt(n-2):0;e===32&&r!==32&&r!==9||(ie=!0)}else ie=!0;if(ie)if(f){let e=m>0?p[m-1].endIndex:a;for(let t=e+1;t<=n;t++)p[m++]=new kg(t,`mtkw`,1,!1)}else p[m++]=new kg(n,`mtkw`,1,!1);else p[m++]=new kg(n,g,0,_);return p}function zse(e,t,n,r){r.sort(Dg.compare);let i=Ase.normalize(e,r),a=i.length,o=0,s=[],c=0,l=0;for(let e=0,t=n.length;e<t;e++){let t=n[e],r=t.endIndex,u=t.type,d=t.metadata,f=t.containsRTL;for(;o<a&&i[o].startOffset<r;){let e=i[o];if(e.startOffset>l&&(l=e.startOffset,s[c++]=new kg(l,u,d,f)),e.endOffset+1<=r)l=e.endOffset+1,s[c++]=new kg(l,u+` `+e.className,d|e.metadata,f),o++;else{l=r,s[c++]=new kg(l,u+` `+e.className,d|e.metadata,f);break}}r>l&&(l=r,s[c++]=new kg(l,u,d,f))}let u=n[n.length-1].endIndex;if(o<a&&i[o].startOffset===u)for(;o<a&&i[o].startOffset===u;){let e=i[o];s[c++]=new kg(l,e.className,e.metadata,!1),o++}return s}function Bse(e,t){let n=e.fontIsMonospace,r=e.canUseHalfwidthRightwardsArrow,i=e.containsForeignElements,a=e.lineContent,o=e.len,s=e.isOverflowing,c=e.overflowingCharCount,l=e.parts,u=e.fauxIndentLength,d=e.tabSize,f=e.startVisibleColumn,p=e.spaceWidth,m=e.renderSpaceCharCode,h=e.renderWhitespace,g=e.renderControlCharacters,_=new Mg(o+1,l.length),v=!1,y=0,b=f,x=0,S=0,ee=0;t.appendString(`<span>`);for(let e=0,s=l.length;e<s;e++){let s=l[e],c=s.endIndex,f=s.type,te=s.containsRTL,ne=h!==0&&s.isWhitespace(),re=ne&&!n&&(f===`mtkw`||!i),ie=y===c&&s.isPseudoAfter();if(x=0,t.appendString(`<span `),te&&t.appendString(`dir="rtl" style="unicode-bidi:isolate" `),t.appendString(`class="`),t.appendString(re?`mtkz`:f),t.appendASCIICharCode(34),ne){let n=0;{let e=y,t=b;for(;e<c;e++){let r=(a.charCodeAt(e)===9?d-t%d:1)|0;n+=r,e>=u&&(t+=r)}}for(re&&(t.appendString(` style="width:`),t.appendString(String(p*n)),t.appendString(`px"`)),t.appendASCIICharCode(62);y<c;y++){_.setColumnInfo(y+1,e-ee,x,S),ee=0;let n=a.charCodeAt(y),i,o;if(n===9){i=d-b%d|0,o=i,!r||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);x+=i,S+=o,y>=u&&(b+=o)}}else for(t.appendASCIICharCode(62);y<c;y++){_.setColumnInfo(y+1,e-ee,x,S),ee=0;let n=a.charCodeAt(y),r=1,i=1;switch(n){case 9:r=d-b%d,i=r;for(let e=1;e<=r;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:g?t.appendCharCode(9216):t.appendString(`&#00;`);break;case 65279:case 8232:case 8233:case 133:t.appendCharCode(65533);break;default:ci(n)&&i++,g&&n<32?t.appendCharCode(9216+n):g&&n===127?t.appendCharCode(9249):g&&Ig(n)?(t.appendString(`[U+`),t.appendString(Vse(n)),t.appendString(`]`),r=8,i=r):t.appendCharCode(n)}x+=r,S+=i,y>=u&&(b+=i)}ie?ee++:ee=0,y>=o&&!v&&s.isPseudoAfter()&&(v=!0,_.setColumnInfo(y+1,e,x,S)),t.appendString(`</span>`)}return v||_.setColumnInfo(o+1,l.length-1,x,S),s&&(t.appendString(`<span class="mtkoverflow">`),t.appendString(C(796,`Show more ({0})`,Hse(c))),t.appendString(`</span>`)),t.appendString(`</span>`),new Ng(_,i)}function Vse(e){return e.toString(16).toUpperCase().padStart(4,`0`)}function Hse(e){return e<1024?C(797,`{0} chars`,e):e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}var Lg;(function(e){e.DARK=`dark`,e.LIGHT=`light`,e.HIGH_CONTRAST_DARK=`hcDark`,e.HIGH_CONTRAST_LIGHT=`hcLight`})(Lg||={});var Rg;(function(e){e.VS=`vs`,e.VS_DARK=`vs-dark`,e.HC_BLACK=`hc-black`,e.HC_LIGHT=`hc-light`})(Rg||={});function zg(e){return e===Lg.HIGH_CONTRAST_DARK||e===Lg.HIGH_CONTRAST_LIGHT}function Bg(e){return e===Lg.DARK||e===Lg.HIGH_CONTRAST_DARK}var Use=(function(){return tn?!0:!(en||tt||it)})(),Vg=!0,Hg=class e{static{this.CLASS_NAME=`view-line`}constructor(e,t){this._viewGpuContext=e,this._options=t,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=ip(e);else throw Error(`I have no rendered view line to set the dom node to...`)}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return zg(this._options.themeType)||this._renderedViewLine?.input.renderWhitespace===2?(this._isMaybeInvalid=!0,!0):!1}renderLine(t,n,r,i,a){if(this._options.useGpu&&this._viewGpuContext?.canRender(this._options,i,t))return this._renderedViewLine?.domNode?.domNode.remove(),this._renderedViewLine=null,!1;if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;let o=i.getViewLineRenderingData(t),s=this._options,c=Dg.filter(o.inlineDecorations,t,o.minColumn,o.maxColumn),l=o.hasVariableFonts||s.experimentalWhitespaceRendering===`off`?s.renderWhitespace:`none`,u=!o.hasVariableFonts,d=null;if(zg(s.themeType)||l===`selection`){let e=i.selections;for(let n of e){if(n.endLineNumber<t||n.startLineNumber>t)continue;let e=n.startLineNumber===t?n.startColumn:o.minColumn,r=n.endLineNumber===t?n.endColumn:o.maxColumn;e<r&&(zg(s.themeType)&&c.push(new Dg(e,r,`inline-selected-text`,0)),l===`selection`&&(d||=[],d.push(new pf(e-1,r-1))))}}let f=new Ag(s.useMonospaceOptimizations,s.canUseHalfwidthRightwardsArrow,o.content,o.continuesWithWrappedLine,o.isBasicASCII,o.containsRTL,o.minColumn-1,o.tokens,c,o.tabSize,o.startVisibleColumn,s.spaceWidth,s.middotWidth,s.wsmiddotWidth,s.stopRenderingLineAfter,l,s.renderControlCharacters,s.fontLigatures!==Np.OFF,d,o.textDirection,s.verticalScrollbarSize);if(this._renderedViewLine&&this._renderedViewLine.input.equals(f))return!1;a.appendString(`<div `),o.textDirection===Qu.RTL?a.appendString(`dir="rtl" `):o.containsRTL&&a.appendString(`dir="ltr" `),a.appendString(`style="top:`),a.appendString(String(n)),a.appendString(`px;height:`),a.appendString(String(r)),a.appendString(`px;line-height:`),a.appendString(String(r)),o.textDirection===Qu.RTL&&(a.appendString(`px;padding-right:`),a.appendString(String(s.verticalScrollbarSize))),a.appendString(`px;" class="`),a.appendString(e.CLASS_NAME),a.appendString(`">`);let p=Pg(f,a);a.appendString(`</div>`);let m=null;return u&&Vg&&Use&&o.isBasicASCII&&f.isLTR&&s.useMonospaceOptimizations&&p.containsForeignElements===0&&(m=new Ug(this._renderedViewLine?this._renderedViewLine.domNode:null,f,p.characterMapping)),m||=Gg(this._renderedViewLine?this._renderedViewLine.domNode:null,f,p.characterMapping,p.containsForeignElements),this._renderedViewLine=m,!0}layoutLine(e,t,n){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(n),this._renderedViewLine.domNode.setLineHeight(n))}isRenderedRTL(){return this._renderedViewLine?this._renderedViewLine.input.textDirection===Qu.RTL:!1}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof Ug:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof Ug?this._renderedViewLine.monospaceAssumptionsAreValid():Vg}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof Ug&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,n,r){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),n=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,n));let i=this._renderedViewLine.input.stopRenderingLineAfter;if(i!==-1&&t>i+1&&n>i+1)return new Tg(!0,[new Cg(this.getWidth(r),0)]);i!==-1&&t>i+1&&(t=i+1),i!==-1&&n>i+1&&(n=i+1);let a=this._renderedViewLine.getVisibleRangesForRange(e,t,n,r);return a&&a.length>0?new Tg(!1,a):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}},Ug=class{constructor(e,t,n){this._cachedWidth=-1,this.domNode=e,this.input=t;let r=Math.floor(t.lineContent.length/300);if(r>0){this._keyColumnPixelOffsetCache=new Float32Array(r);for(let e=0;e<r;e++)this._keyColumnPixelOffsetCache[e]=-1}else this._keyColumnPixelOffsetCache=null;this._characterMapping=n,this._charWidth=t.spaceWidth}getWidth(e){if(!this.domNode||this.input.lineContent.length<300){let e=this._characterMapping.getHorizontalOffset(this._characterMapping.length);return Math.round(this._charWidth*e)}return this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e?.markDidDomLayout()),this._cachedWidth}getWidthIsFast(){return this.input.lineContent.length<300||this._cachedWidth!==-1}monospaceAssumptionsAreValid(){if(!this.domNode)return Vg;if(this.input.lineContent.length<300){let 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!`),Vg=!1)}return Vg}toSlowRenderedLine(){return Gg(this.domNode,this.input,this._characterMapping,0)}getVisibleRangesForRange(e,t,n,r){let i=this._getColumnPixelOffset(e,t,r);return[new Cg(i,this._getColumnPixelOffset(e,n,r)-i)]}_getColumnPixelOffset(e,t,n){if(t<=300){let e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}let r=Math.floor((t-1)/300)-1,i=(r+1)*300+1,a=-1;if(this._keyColumnPixelOffsetCache&&(a=this._keyColumnPixelOffsetCache[r],a===-1&&(a=this._actualReadPixelOffset(e,i,n),this._keyColumnPixelOffsetCache[r]=a)),a===-1){let e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}let o=this._characterMapping.getHorizontalOffset(i),s=this._characterMapping.getHorizontalOffset(t);return a+this._charWidth*(s-o)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,n){if(!this.domNode)return-1;let r=this._characterMapping.getDomPosition(t),i=Eg.readHorizontalRanges(this._getReadingTarget(this.domNode),r.partIndex,r.charIndex,r.partIndex,r.charIndex,n);return!i||i.length===0?-1:i[0].left}getColumnOfNodeOffset(e,t){return Kg(this._characterMapping,e,t)}},Wg=class{constructor(e,t,n,r){if(this.domNode=e,this.input=t,this._characterMapping=n,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=r,this._cachedWidth=-1,this._pixelOffsetCache=null,t.isLTR){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?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e?.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,n,r){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){let i=this._readPixelOffset(this.domNode,e,t,r);if(i===-1)return null;let a=this._readPixelOffset(this.domNode,e,n,r);return a===-1?null:[new Cg(i,a-i)]}return this._readVisibleRangesForRange(this.domNode,e,t,n,r)}_readVisibleRangesForRange(e,t,n,r,i){if(n===r){let r=this._readPixelOffset(e,t,n,i);return r===-1?null:[new Cg(r,0)]}else return this._readRawVisibleRangesForRange(e,n,r,i)}_readPixelOffset(e,t,n,r){if(this.input.isLTR&&this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(r);let t=this._getReadingTarget(e);return t.firstChild?(r.markDidDomLayout(),t.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){let i=this._pixelOffsetCache[n];if(i!==-1)return i;let a=this._actualReadPixelOffset(e,t,n,r);return this._pixelOffsetCache[n]=a,a}return this._actualReadPixelOffset(e,t,n,r)}_actualReadPixelOffset(e,t,n,r){if(this._characterMapping.length===0){let t=Eg.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,r);return!t||t.length===0?-1:t[0].left}if(this.input.isLTR&&n===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(r);let i=this._characterMapping.getDomPosition(n),a=Eg.readHorizontalRanges(this._getReadingTarget(e),i.partIndex,i.charIndex,i.partIndex,i.charIndex,r);if(!a||a.length===0)return-1;let o=a[0].left;if(this.input.isBasicASCII){let e=this._characterMapping.getHorizontalOffset(n),t=Math.round(this.input.spaceWidth*e);if(Math.abs(t-o)<=1)return t}return o}_readRawVisibleRangesForRange(e,t,n,r){if(this.input.isLTR&&t===1&&n===this._characterMapping.length)return[new Cg(0,this.getWidth(r))];let i=this._characterMapping.getDomPosition(t),a=this._characterMapping.getDomPosition(n);return Eg.readHorizontalRanges(this._getReadingTarget(e),i.partIndex,i.charIndex,a.partIndex,a.charIndex,r)}getColumnOfNodeOffset(e,t){return Kg(this._characterMapping,e,t)}},Wse=class extends Wg{_readVisibleRangesForRange(e,t,n,r,i){let a=super._readVisibleRangesForRange(e,t,n,r,i);if(!a||a.length===0||n===r||n===1&&r===this._characterMapping.length)return a;if(this.input.isLTR){let n=this._readPixelOffset(e,t,r,i);if(n!==-1){let e=a[a.length-1];e.left<n&&(e.width=n-e.left)}}return a}},Gg=(function(){return nt?Gse:Kse})();function Gse(e,t,n,r){return new Wse(e,t,n,r)}function Kse(e,t,n,r){return new Wg(e,t,n,r)}function Kg(e,t,n){let r=t.textContent.length,i=-1;for(;t;)t=t.previousSibling,i++;return e.getColumn(new jg(i,n),r)}var qg=class{constructor(e=null){this.hitTarget=e,this.type=0}},Jg=class{get hitTarget(){return this.spanNode}constructor(e,t,n){this.position=e,this.spanNode=t,this.injectedText=n,this.type=1}},Yg;(function(e){function t(e,t,n){let r=e.getPositionFromDOMInfo(t,n);return r?new Jg(r,t,null):new qg(t)}e.createFromDOMInfo=t})(Yg||={});var qse=class{constructor(e,t){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=t}},Xg=class{static _deduceRage(e,t=null){return!t&&e?new U(e.lineNumber,e.column,e.lineNumber,e.column):t??null}static createUnknown(e,t,n){return{type:0,element:e,mouseColumn:t,position:n,range:this._deduceRage(n)}}static createTextarea(e,t){return{type:1,element:e,mouseColumn:t,position:null,range:null}}static createMargin(e,t,n,r,i,a){return{type:e,element:t,mouseColumn:n,position:r,range:i,detail:a}}static createViewZone(e,t,n,r,i){return{type:e,element:t,mouseColumn:n,position:r,range:this._deduceRage(r),detail:i}}static createContentText(e,t,n,r,i){return{type:6,element:e,mouseColumn:t,position:n,range:this._deduceRage(n,r),detail:i}}static createContentEmpty(e,t,n,r){return{type:7,element:e,mouseColumn:t,position:n,range:this._deduceRage(n),detail:r}}static createContentWidget(e,t,n){return{type:9,element:e,mouseColumn:t,position:null,range:null,detail:n}}static createScrollbar(e,t,n){return{type:11,element:e,mouseColumn:t,position:n,range:this._deduceRage(n)}}static createOverlayWidget(e,t,n){return{type:12,element:e,mouseColumn:t,position:null,range:null,detail:n}}static createOutsideEditor(e,t,n,r){return{type:13,element:null,mouseColumn:e,position:t,range:this._deduceRage(t),outsidePosition:n,outsideDistance:r}}static _typeToString(e){return e===1?`TEXTAREA`:e===2?`GUTTER_GLYPH_MARGIN`:e===3?`GUTTER_LINE_NUMBERS`:e===4?`GUTTER_LINE_DECORATIONS`:e===5?`GUTTER_VIEW_ZONE`:e===6?`CONTENT_TEXT`:e===7?`CONTENT_EMPTY`:e===8?`CONTENT_VIEW_ZONE`:e===9?`CONTENT_WIDGET`:e===10?`OVERVIEW_RULER`:e===11?`SCROLLBAR`:e===12?`OVERLAY_WIDGET`:`UNKNOWN`}static toString(e){return this._typeToString(e.type)+`: `+e.position+` - `+e.range+` - `+JSON.stringify(e.detail)}},Zg=class{static isTextArea(e){return e.length===2&&e[0]===3&&e[1]===7}static isChildOfViewLines(e){return e.length>=4&&e[0]===3&&e[3]===8}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===8}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===6}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===9}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===3}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&e[0]===5}},Qg=class e{constructor(e,t,n){this.viewModel=e.viewModel;let r=e.configuration.options;this.layoutInfo=r.get(165),this.viewDomNode=t.viewDomNode,this.viewLinesGpu=t.viewLinesGpu,this.lineHeight=r.get(75),this.stickyTabStops=r.get(132),this.typicalHalfwidthCharacterWidth=r.get(59).typicalHalfwidthCharacterWidth,this.lastRenderData=n,this._context=e,this._viewHelper=t}getZoneAtCoord(t){return e.getZoneAtCoord(this._context,t)}static getZoneAtCoord(e,t){let n=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(n){let r=n.verticalOffset+n.height/2,i=e.viewModel.getLineCount(),a=null,o,s=null;return n.afterLineNumber!==i&&(s=new F(n.afterLineNumber+1,1)),n.afterLineNumber>0&&(a=new F(n.afterLineNumber,e.viewModel.getLineMaxColumn(n.afterLineNumber))),o=s===null?a:a===null?s:t<r?a:s,{viewZoneId:n.id,afterLineNumber:n.afterLineNumber,positionBefore:a,positionAfter:s,position:o}}return null}getFullLineRangeAtCoord(e){if(this._context.viewLayout.isAfterLines(e)){let e=this._context.viewModel.getLineCount(),t=this._context.viewModel.getLineMaxColumn(e);return{range:new U(e,t,e,t),isAfterLines:!0}}let t=this._context.viewLayout.getLineNumberAtVerticalOffset(e);return{range:new U(t,1,t,this._context.viewModel.getLineMaxColumn(t)),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(t,n){return e._findAttribute(t,n,this._viewHelper.viewDomNode)}static _findAttribute(e,t,n){for(;e&&e!==e.ownerDocument.body;){if(e.hasAttribute&&e.hasAttribute(t))return e.getAttribute(t);if(e===n)return null;e=e.parentNode}return null}getLineWidth(e){return this._viewHelper.getLineWidth(e)}isRtl(e){return this.viewModel.getTextDirection(e)===Qu.RTL}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()}},Jse=class{constructor(e,t,n,r){this.editorPos=t,this.pos=n,this.relativePos=r,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,t_._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}},Yse=class extends Jse{get target(){return this._useHitTestTarget?this.hitTestResult.value.hitTarget:this._eventTarget}get targetPath(){return this._targetPathCacheElement!==this.target&&(this._targetPathCacheElement=this.target,this._targetPathCacheValue=bg.collect(this.target,this._ctx.viewDomNode)),this._targetPathCacheValue}constructor(e,t,n,r,i){super(e,t,n,r),this.hitTestResult=new wr(()=>t_.doHitTest(this._ctx,this)),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array,this._ctx=e,this._eventTarget=i;let a=!!this._eventTarget;this._useHitTestTarget=!a}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}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&this.hitTestResult.value.hitTarget!==null&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?hu.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return Xg.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return Xg.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,n,r){return Xg.createMargin(e,this.target,this._getMouseColumn(t),t,n,r)}fulfillViewZone(e,t,n){return Xg.createViewZone(e,this.target,this._getMouseColumn(),t,n)}fulfillContentText(e,t,n){return Xg.createContentText(this.target,this._getMouseColumn(e),e,t,n)}fulfillContentEmpty(e,t){return Xg.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return Xg.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return Xg.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return Xg.createOverlayWidget(this.target,this._getMouseColumn(),e)}},$g={isAfterLines:!0};function e_(e){return{isAfterLines:!1,horizontalDistanceToText:e}}var t_=class e{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){let t=e.target,n=bg.collect(t,this._viewHelper.viewDomNode);return!!(Zg.isChildOfContentWidgets(n)||Zg.isChildOfOverflowingContentWidgets(n)||Zg.isChildOfOverlayWidgets(n)||Zg.isChildOfOverflowingOverlayWidgets(n))}createMouseTarget(t,n,r,i,a){let o=new Qg(this._context,this._viewHelper,t),s=new Yse(o,n,r,i,a);try{let t=e._createMouseTarget(o,s);if(t.type===6&&o.stickyTabStops&&t.position!==null){let n=e._snapToSoftTabBoundary(t.position,o.viewModel),r=U.fromPositions(n,n).plusRange(t.range);return s.fulfillContentText(n,r,t.detail)}return t}catch{return s.fulfillUnknown()}}static _createMouseTarget(t,n){if(n.target===null)return n.fulfillUnknown();let r=n,i=null;return!Zg.isChildOfOverflowGuard(n.targetPath)&&!Zg.isChildOfOverflowingContentWidgets(n.targetPath)&&!Zg.isChildOfOverflowingOverlayWidgets(n.targetPath)&&(i||=n.fulfillUnknown()),i||=e._hitTestContentWidget(t,r),i||=e._hitTestOverlayWidget(t,r),i||=e._hitTestMinimap(t,r),i||=e._hitTestScrollbarSlider(t,r),i||=e._hitTestViewZone(t,r),i||=e._hitTestMargin(t,r),i||=e._hitTestViewCursor(t,r),i||=e._hitTestTextArea(t,r),i||=e._hitTestViewLines(t,r),i||=e._hitTestScrollbar(t,r),i||n.fulfillUnknown()}static _hitTestContentWidget(e,t){if(Zg.isChildOfContentWidgets(t.targetPath)||Zg.isChildOfOverflowingContentWidgets(t.targetPath)){let n=e.findAttribute(t.target,`widgetId`);return n?t.fulfillContentWidget(n):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(Zg.isChildOfOverlayWidgets(t.targetPath)||Zg.isChildOfOverflowingOverlayWidgets(t.targetPath)){let n=e.findAttribute(t.target,`widgetId`);return n?t.fulfillOverlayWidget(n):t.fulfillUnknown()}return null}static _hitTestViewCursor(e,t){if(t.target){let n=e.lastRenderData.lastViewCursorsRenderData;for(let e of n)if(t.target===e.domNode)return t.fulfillContentText(e.position,null,{mightBeForeignElement:!1,injectedText:null})}if(t.isInContentArea){let n=e.lastRenderData.lastViewCursorsRenderData,r=t.mouseContentHorizontalOffset,i=t.mouseVerticalOffset;for(let a of n){if(r<a.contentLeft||r>a.contentLeft+a.width)continue;let n=e.getVerticalOffsetForLineNumber(a.position.lineNumber);if(n<=i&&i<=n+a.height)return t.fulfillContentText(a.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){let n=e.getZoneAtCoord(t.mouseVerticalOffset);if(n){let e=t.isInContentArea?8:5;return t.fulfillViewZone(e,n.position,n)}return null}static _hitTestTextArea(e,t){return Zg.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){let n=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),r=n.range.getStartPosition(),i=Math.abs(t.relativePos.x),a={isAfterLines:n.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:i};if(i-=e.layoutInfo.glyphMarginLeft,i<=e.layoutInfo.glyphMarginWidth){let o=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(n.range.getStartPosition());return a.glyphMarginLane=e.viewModel.glyphLanes.getLanesAtLine(o.lineNumber)[Math.floor(i/e.lineHeight)],t.fulfillMargin(2,r,n.range,a)}return i-=e.layoutInfo.glyphMarginWidth,i<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,r,n.range,a):(i-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,r,n.range,a))}return null}static _hitTestViewLines(t,n){if(!Zg.isChildOfViewLines(n.targetPath))return null;if(t.isInTopPadding(n.mouseVerticalOffset))return n.fulfillContentEmpty(new F(1,1),$g);if(t.isAfterLines(n.mouseVerticalOffset)||t.isInBottomPadding(n.mouseVerticalOffset)){let e=t.viewModel.getLineCount(),r=t.viewModel.getLineMaxColumn(e);return n.fulfillContentEmpty(new F(e,r),$g)}if(Zg.isStrictChildOfViewLines(n.targetPath)){let e=t.getLineNumberAtVerticalOffset(n.mouseVerticalOffset),r=t.viewModel.getLineLength(e),i=t.getLineWidth(e);if(r===0){let t=e_(n.mouseContentHorizontalOffset-i);return n.fulfillContentEmpty(new F(e,1),t)}if(t.isRtl(e)){if(n.mouseContentHorizontalOffset+i<=t.layoutInfo.contentWidth-t.layoutInfo.verticalScrollbarWidth){let r=e_(n.mouseContentHorizontalOffset-i),a=new F(e,t.viewModel.getLineMaxColumn(e));return n.fulfillContentEmpty(a,r)}}else if(n.mouseContentHorizontalOffset>=i){let r=e_(n.mouseContentHorizontalOffset-i),a=new F(e,t.viewModel.getLineMaxColumn(e));return n.fulfillContentEmpty(a,r)}}else if(t.viewLinesGpu){let e=t.getLineNumberAtVerticalOffset(n.mouseVerticalOffset);if(t.viewModel.getLineLength(e)===0){let r=t.getLineWidth(e),i=e_(n.mouseContentHorizontalOffset-r);return n.fulfillContentEmpty(new F(e,1),i)}let r=t.getLineWidth(e);if(t.isRtl(e)){if(n.mouseContentHorizontalOffset+r<=t.layoutInfo.contentWidth-t.layoutInfo.verticalScrollbarWidth){let i=e_(n.mouseContentHorizontalOffset-r),a=new F(e,t.viewModel.getLineMaxColumn(e));return n.fulfillContentEmpty(a,i)}}else if(n.mouseContentHorizontalOffset>=r){let i=e_(n.mouseContentHorizontalOffset-r),a=new F(e,t.viewModel.getLineMaxColumn(e));return n.fulfillContentEmpty(a,i)}let i=t.viewLinesGpu.getPositionAtCoordinate(e,n.mouseContentHorizontalOffset);if(i)return n.fulfillContentText(i,U.fromPositions(i,i),{injectedText:null,mightBeForeignElement:!1})}let r=n.hitTestResult.value;return r.type===1?e.createMouseTargetFromHitTestPosition(t,n,r.spanNode,r.position,r.injectedText):n.wouldBenefitFromHitTestTargetSwitch?(n.switchToHitTestTarget(),this._createMouseTarget(t,n)):n.fulfillUnknown()}static _hitTestMinimap(e,t){if(Zg.isChildOfMinimap(t.targetPath)){let n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new F(n,r))}return null}static _hitTestScrollbarSlider(e,t){if(Zg.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){let n=t.target.className;if(n&&/\b(slider|scrollbar)\b/.test(n)){let n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new F(n,r))}}return null}static _hitTestScrollbar(e,t){if(Zg.isChildOfScrollableElement(t.targetPath)){let n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new F(n,r))}return null}getMouseColumn(t){let n=this._context.configuration.options,r=n.get(165),i=this._context.viewLayout.getCurrentScrollLeft()+t.x-r.contentLeft;return e._getMouseColumn(i,n.get(59).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,n,r,i){let a=r.lineNumber,o=r.column,s=e.getLineWidth(a);if(t.mouseContentHorizontalOffset>s){let e=e_(t.mouseContentHorizontalOffset-s);return t.fulfillContentEmpty(r,e)}let c=e.visibleRangeForPosition(a,o);if(!c)return t.fulfillUnknown(r);let l=c.left;if(Math.abs(t.mouseContentHorizontalOffset-l)<1)return t.fulfillContentText(r,null,{mightBeForeignElement:!!i,injectedText:i});let u=[];if(u.push({offset:c.left,column:o}),o>1){let t=e.visibleRangeForPosition(a,o-1);t&&u.push({offset:t.left,column:o-1})}if(o<e.viewModel.getLineMaxColumn(a)){let t=e.visibleRangeForPosition(a,o+1);t&&u.push({offset:t.left,column:o+1})}u.sort((e,t)=>e.offset-t.offset);let d=t.pos.toClientCoordinates(Ko(e.viewDomNode)),f=n.getBoundingClientRect(),p=f.left<=d.clientX&&d.clientX<=f.right,m=null;for(let e=1;e<u.length;e++){let n=u[e-1],i=u[e];if(n.offset<=t.mouseContentHorizontalOffset&&t.mouseContentHorizontalOffset<=i.offset){m=new U(a,n.column,a,i.column),r=Math.abs(n.offset-t.mouseContentHorizontalOffset)<Math.abs(i.offset-t.mouseContentHorizontalOffset)?new F(a,n.column):new F(a,i.column);break}}return t.fulfillContentText(r,m,{mightBeForeignElement:!p||!!i,injectedText:i})}static _doHitTestWithCaretRangeFromPoint(e,t){let n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.getVerticalOffsetForLineNumber(n),i=r+e.lineHeight;if(!(n===e.viewModel.getLineCount()&&t.mouseVerticalOffset>i)){let n=Math.floor((r+i)/2),a=t.pos.y+(n-t.mouseVerticalOffset);a<=t.editorPos.y&&(a=t.editorPos.y+1),a>=t.editorPos.y+t.editorPos.height&&(a=t.editorPos.y+t.editorPos.height-1);let o=new fg(t.pos.x,a),s=this._actualDoHitTestWithCaretRangeFromPoint(e,o.toClientCoordinates(Ko(e.viewDomNode)));if(s.type===1)return s}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(Ko(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){let n=Ss(e.viewDomNode),r;if(r=n?n.caretRangeFromPoint===void 0?Xse(n,t.clientX,t.clientY):n.caretRangeFromPoint(t.clientX,t.clientY):e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!r||!r.startContainer)return new qg;let i=r.startContainer;if(i.nodeType===i.TEXT_NODE){let t=i.parentNode,n=t?t.parentNode:null,a=n?n.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===Hg.CLASS_NAME?Yg.createFromDOMInfo(e,t,r.startOffset):new qg(i.parentNode)}else if(i.nodeType===i.ELEMENT_NODE){let t=i.parentNode,n=t?t.parentNode:null;return(n&&n.nodeType===n.ELEMENT_NODE?n.className:null)===Hg.CLASS_NAME?Yg.createFromDOMInfo(e,i,i.textContent.length):new qg(i)}return new qg}static _doHitTestWithCaretPositionFromPoint(e,t){let n=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(n.offsetNode.nodeType===n.offsetNode.TEXT_NODE){let t=n.offsetNode.parentNode,r=t?t.parentNode:null,i=r?r.parentNode:null;return(i&&i.nodeType===i.ELEMENT_NODE?i.className:null)===Hg.CLASS_NAME?Yg.createFromDOMInfo(e,n.offsetNode.parentNode,n.offset):new qg(n.offsetNode.parentNode)}if(n.offsetNode.nodeType===n.offsetNode.ELEMENT_NODE){let t=n.offsetNode.parentNode,r=t&&t.nodeType===t.ELEMENT_NODE?t.className:null,i=t?t.parentNode:null,a=i&&i.nodeType===i.ELEMENT_NODE?i.className:null;if(r===Hg.CLASS_NAME){let t=n.offsetNode.childNodes[Math.min(n.offset,n.offsetNode.childNodes.length-1)];if(t)return Yg.createFromDOMInfo(e,t,0)}else if(a===Hg.CLASS_NAME)return Yg.createFromDOMInfo(e,n.offsetNode,0)}return new qg(n.offsetNode)}static _snapToSoftTabBoundary(e,t){let n=t.getLineContent(e.lineNumber),{tabSize:r}=t.model.getOptions(),i=Au.atomicPosition(n,e.column-1,r,2);return i===-1?e:new F(e.lineNumber,i+1)}static doHitTest(e,t){let n=new qg;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint==`function`?n=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(n=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(Ko(e.viewDomNode)))),n.type===1){let t=e.viewModel.getInjectedTextAt(n.position),r=e.viewModel.normalizePosition(n.position,2);(t||!r.equals(n.position))&&(n=new Jg(r,n.spanNode,t))}return n}};function Xse(e,t,n){let r=document.createRange(),i=e.elementFromPoint(t,n);if(i?.hasChildNodes()){for(;i&&i.firstChild&&i.firstChild.nodeType!==i.firstChild.TEXT_NODE&&i.lastChild&&i.lastChild.firstChild;)i=i.lastChild;let e=i.getBoundingClientRect(),n=Ko(i),a=`${n.getComputedStyle(i,null).getPropertyValue(`font-style`)} ${n.getComputedStyle(i,null).getPropertyValue(`font-variant`)} ${n.getComputedStyle(i,null).getPropertyValue(`font-weight`)} ${n.getComputedStyle(i,null).getPropertyValue(`font-size`)}/${n.getComputedStyle(i,null).getPropertyValue(`line-height`)} ${n.getComputedStyle(i,null).getPropertyValue(`font-family`)}`,o=i.innerText,s=e.left,c=0,l;if(t>e.left+e.width)c=o.length;else{let e=Zse.getInstance();for(let n=0;n<o.length+1;n++){if(l=e.getCharWidth(o.charAt(n),a)/2,s+=l,t<s){c=n;break}s+=l}}r.setStart(i.firstChild,c),r.setEnd(i.firstChild,c)}return r}var Zse=class e{static{this._INSTANCE=null}static getInstance(){return e._INSTANCE||=new e,e._INSTANCE}constructor(){this._cache={},this._canvas=document.createElement(`canvas`)}getCharWidth(e,t){let n=e+t;if(this._cache[n])return this._cache[n];let r=this._canvas.getContext(`2d`);r.font=t;let i=r.measureText(e).width;return this._cache[n]=i,i}};function n_(e,t,n){let r=null,i=null;if(typeof n.value==`function`?(r=`value`,i=n.value,i.length!==0&&console.warn(`Memoize should only be used in functions with zero parameters`)):typeof n.get==`function`&&(r=`get`,i=n.get),!i)throw Error(`not supported`);let a=`$memoize$${t}`;n[r]=function(...e){return this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:i.apply(this,e)}),this[a]}}var Qse=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},r_;(function(e){e.Tap=`-monaco-gesturetap`,e.Change=`-monaco-gesturechange`,e.Start=`-monaco-gesturestart`,e.End=`-monaco-gesturesend`,e.Contextmenu=`-monaco-gesturecontextmenu`})(r_||={});var i_=class e extends D{static{this.SCROLL_FRICTION=-.005}static{this.HOLD_DELAY=700}static{this.CLEAR_TAP_COUNT_TIME=400}constructor(){super(),this.dispatched=!1,this.targets=new Hn,this.ignoreTargets=new Hn,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(O.runAndSubscribe(Xo,({window:e,disposables:t})=>{t.add(j(e.document,`touchstart`,e=>this.onTouchStart(e),{passive:!1})),t.add(j(e.document,`touchend`,t=>this.onTouchEnd(e,t))),t.add(j(e.document,`touchmove`,e=>this.onTouchMove(e),{passive:!1}))},{window:Xe,disposables:this._store}))}static addTarget(t){return e.isTouchDevice()?(e.INSTANCE||=Pn(new e),T(e.INSTANCE.targets.push(t))):D.None}static ignoreTarget(t){return e.isTouchDevice()?(e.INSTANCE||=Pn(new e),T(e.INSTANCE.ignoreTargets.push(t))):D.None}static isTouchDevice(){return`ontouchstart`in Xe||navigator.maxTouchPoints>0}dispose(){this.handle&&=(this.handle.dispose(),null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&=(this.handle.dispose(),null);for(let n=0,r=e.targetTouches.length;n<r;n++){let r=e.targetTouches.item(n);this.activeTouches[r.identifier]={id:r.identifier,initialTarget:r.target,initialTimeStamp:t,initialPageX:r.pageX,initialPageY:r.pageY,rollingTimestamps:[t],rollingPageX:[r.pageX],rollingPageY:[r.pageY]};let i=this.newGestureEvent(r_.Start,r.target);i.pageX=r.pageX,i.pageY=r.pageY,this.dispatchEvent(i)}this.dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}onTouchEnd(t,n){let r=Date.now(),i=Object.keys(this.activeTouches).length;for(let a=0,o=n.changedTouches.length;a<o;a++){let o=n.changedTouches.item(a);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn(`move of an UNKNOWN touch`,o);continue}let s=this.activeTouches[o.identifier],c=Date.now()-s.initialTimeStamp;if(c<e.HOLD_DELAY&&Math.abs(s.initialPageX-s.rollingPageX.at(-1))<30&&Math.abs(s.initialPageY-s.rollingPageY.at(-1))<30){let e=this.newGestureEvent(r_.Tap,s.initialTarget);e.pageX=s.rollingPageX.at(-1),e.pageY=s.rollingPageY.at(-1),this.dispatchEvent(e)}else if(c>=e.HOLD_DELAY&&Math.abs(s.initialPageX-s.rollingPageX.at(-1))<30&&Math.abs(s.initialPageY-s.rollingPageY.at(-1))<30){let e=this.newGestureEvent(r_.Contextmenu,s.initialTarget);e.pageX=s.rollingPageX.at(-1),e.pageY=s.rollingPageY.at(-1),this.dispatchEvent(e)}else if(i===1){let e=s.rollingPageX.at(-1),n=s.rollingPageY.at(-1),i=s.rollingTimestamps.at(-1)-s.rollingTimestamps[0],a=e-s.rollingPageX[0],o=n-s.rollingPageY[0],c=[...this.targets].filter(e=>s.initialTarget instanceof Node&&e.contains(s.initialTarget));this.inertia(t,c,r,Math.abs(a)/i,a>0?1:-1,e,Math.abs(o)/i,o>0?1:-1,n)}this.dispatchEvent(this.newGestureEvent(r_.End,s.initialTarget)),delete this.activeTouches[o.identifier]}this.dispatched&&=(n.preventDefault(),n.stopPropagation(),!1)}newGestureEvent(e,t){let n=document.createEvent(`CustomEvent`);return n.initEvent(e,!1,!0),n.initialTarget=t,n.tapCount=0,n}dispatchEvent(t){if(t.type===r_.Tap){let n=new Date().getTime(),r=0;r=n-this._lastSetTapCountTime>e.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=n,t.tapCount=r}else (t.type===r_.Change||t.type===r_.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let e of this.ignoreTargets)if(e.contains(t.initialTarget))return;let e=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let r=0,i=t.initialTarget;for(;i&&i!==n;)r++,i=i.parentElement;e.push([r,n])}e.sort((e,t)=>e[0]-t[0]);for(let[n,r]of e)r.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,r,i,a,o,s,c,l){this.handle=as(t,()=>{let u=Date.now(),d=u-r,f=0,p=0,m=!0;i+=e.SCROLL_FRICTION*d,s+=e.SCROLL_FRICTION*d,i>0&&(m=!1,f=a*i*d),s>0&&(m=!1,p=c*s*d);let h=this.newGestureEvent(r_.Change);h.translationX=f,h.translationY=p,n.forEach(e=>e.dispatchEvent(h)),m||this.inertia(t,n,u,i,a,o+f,s,c,l+p)})}onTouchMove(e){let t=Date.now();for(let n=0,r=e.changedTouches.length;n<r;n++){let r=e.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(r.identifier))){console.warn(`end of an UNKNOWN touch`,r);continue}let i=this.activeTouches[r.identifier],a=this.newGestureEvent(r_.Change,i.initialTarget);a.translationX=r.pageX-i.rollingPageX.at(-1),a.translationY=r.pageY-i.rollingPageY.at(-1),a.pageX=r.pageX,a.pageY=r.pageY,this.dispatchEvent(a),i.rollingPageX.length>3&&(i.rollingPageX.shift(),i.rollingPageY.shift(),i.rollingTimestamps.shift()),i.rollingPageX.push(r.pageX),i.rollingPageY.push(r.pageY),i.rollingTimestamps.push(t)}this.dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}};Qse([n_],i_,`isTouchDevice`,null);var a_=class extends D{onclick(e,t){this._register(j(e,M.CLICK,n=>t(new An(Ko(e),n))))}onmousedown(e,t){this._register(j(e,M.MOUSE_DOWN,n=>t(new An(Ko(e),n))))}onmouseover(e,t){this._register(j(e,M.MOUSE_OVER,n=>t(new An(Ko(e),n))))}onmouseleave(e,t){this._register(j(e,M.MOUSE_LEAVE,n=>t(new An(Ko(e),n))))}onkeydown(e,t){this._register(j(e,M.KEY_DOWN,e=>t(new On(e))))}onkeyup(e,t){this._register(j(e,M.KEY_UP,e=>t(new On(e))))}oninput(e,t){this._register(j(e,M.INPUT,t))}onblur(e,t){this._register(j(e,M.BLUR,t))}onfocus(e,t){this._register(j(e,M.FOCUS,t))}ignoreGesture(e){return i_.ignoreTarget(e)}},$se=class extends a_{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`,e.top!==void 0&&(this.bgDomNode.style.top=`0px`),e.left!==void 0&&(this.bgDomNode.style.left=`0px`),e.bottom!==void 0&&(this.bgDomNode.style.bottom=`0px`),e.right!==void 0&&(this.bgDomNode.style.right=`0px`),this.domNode=document.createElement(`div`),this.domNode.className=e.className,this.domNode.classList.add(...Dc.asClassNameArray(e.icon)),this.domNode.style.position=`absolute`,this.domNode.style.width=`11px`,this.domNode.style.height=`11px`,e.top!==void 0&&(this.domNode.style.top=e.top+`px`),e.left!==void 0&&(this.domNode.style.left=e.left+`px`),e.bottom!==void 0&&(this.domNode.style.bottom=e.bottom+`px`),e.right!==void 0&&(this.domNode.style.right=e.right+`px`),this._pointerMoveMonitor=this._register(new hm),this._register($o(this.bgDomNode,M.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register($o(this.domNode,M.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new os),this._pointerdownScheduleRepeatTimer=this._register(new fr)}_arrowPointerDown(e){!e.target||!(e.target instanceof Element)||(this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Ko(e))},200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault())}},ece=class extends D{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new fr)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let 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(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?` fade`:``)))}},tce=140,o_=class extends a_{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 ece(e.visibility,`visible scrollbar `+e.extraScrollbarClassName,`invisible scrollbar `+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new hm),this._shouldRender=!0,this.domNode=ip(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(j(this.domNode.domNode,M.POINTER_DOWN,e=>this._domNodePointerDown(e)))}_createArrow(e){let t=this._register(new $se(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=ip(document.createElement(`div`)),this.slider.setClassName(`slider`),this.slider.setPosition(`absolute`),this.slider.setTop(e),this.slider.setLeft(t),typeof n==`number`&&this.slider.setWidth(n),typeof r==`number`&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain(`strict`),this.domNode.domNode.appendChild(this.slider.domNode),this._register(j(this.slider.domNode,M.POINTER_DOWN,e=>{e.button===0&&(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){let t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),i=this._sliderPointerPosition(e);n<=i&&i<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX==`number`&&typeof e.offsetY==`number`)t=e.offsetX,n=e.offsetY;else{let r=ps(this.domNode.domNode);t=e.pageX-r.left,n=e.pageY-r.top}let r=e.pointerType===`mouse`,i=e.button===0;if(i||!r){let e=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(e):this._scrollbarState.getDesiredScrollPositionFromOffset(e))}i&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName(`active`,!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{let i=this._sliderOrthogonalPointerPosition(e),a=Math.abs(i-n);if(Qt&&a>tce){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let o=this._sliderPointerPosition(e)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(o))},()=>{this.slider.toggleClassName(`active`,!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let 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()}},nce=20,s_=class e{constructor(e,t,n,r,i,a){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=r,this._scrollSize=i,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new e(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let t=Math.round(e);return this._visibleSize===t?!1:(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){let t=Math.round(e);return this._scrollSize===t?!1:(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){let t=Math.round(e);return this._scrollPosition===t?!1:(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,n,r,i){let a=Math.max(0,n-e),o=Math.max(0,a-2*t),s=r>0&&r>n;if(!s)return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(o),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(nce,Math.floor(n*o/r))),l=(o-c)/(r-n),u=i*l;return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(c),computedSliderRatio:l,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){let t=e._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.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;let t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize,n=this._scrollPosition;return t<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;let t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}},rce=class extends o_{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new s_(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,i.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:`horizontal`,scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows){let e=(t.arrowSize-11)/2,n=(t.horizontalScrollbarSize-11)/2;this._createArrow({className:`scra`,icon:L.scrollbarButtonLeft,top:n,left:e,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new jn(null,1,0))}),this._createArrow({className:`scra`,icon:L.scrollbarButtonRight,top:n,left:void 0,bottom:void 0,right:e,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new jn(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(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},ice=class extends o_{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new s_(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,i.scrollTop),visibility:t.vertical,extraScrollbarClassName:`vertical`,scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){let e=(t.arrowSize-11)/2,n=(t.verticalScrollbarSize-11)/2;this._createArrow({className:`scra`,icon:L.scrollbarButtonUp,top:e,left:n,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new jn(null,0,1))}),this._createArrow({className:`scra`,icon:L.scrollbarButtonDown,top:void 0,left:n,bottom:e,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new jn(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(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},ace=class e{constructor(e,t,n,r,i,a,o){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,n|=0,r|=0,i|=0,a|=0,o|=0),this.rawScrollLeft=r,this.rawScrollTop=o,t<0&&(t=0),r+t>n&&(r=n-t),r<0&&(r=0),i<0&&(i=0),o+i>a&&(o=a-i),o<0&&(o=0),this.width=t,this.scrollWidth=n,this.scrollLeft=r,this.height=i,this.scrollHeight=a,this.scrollTop=o}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(t,n){return new e(this._forceIntegerValues,t.width===void 0?this.width:t.width,t.scrollWidth===void 0?this.scrollWidth:t.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,t.height===void 0?this.height:t.height,t.scrollHeight===void 0?this.scrollHeight:t.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new e(this._forceIntegerValues,this.width,this.scrollWidth,t.scrollLeft===void 0?this.rawScrollLeft:t.scrollLeft,this.height,this.scrollHeight,t.scrollTop===void 0?this.rawScrollTop:t.scrollTop)}createScrollEvent(e,t){let n=this.width!==e.width,r=this.scrollWidth!==e.scrollWidth,i=this.scrollLeft!==e.scrollLeft,a=this.height!==e.height,o=this.scrollHeight!==e.scrollHeight,s=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:n,scrollWidthChanged:r,scrollLeftChanged:i,heightChanged:a,scrollHeightChanged:o,scrollTopChanged:s}}},c_=class extends D{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new k),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new ace(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:e.scrollLeft===void 0?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:e.scrollTop===void 0?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;r=t?new d_(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let t=this._state.withScrollPosition(e);this._smoothScrolling=d_.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},l_=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function u_(e,t){let n=t-e;return function(t){return e+n*cce(t)}}function oce(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var d_=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.duration=r,this.startTime=n,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,n){if(Math.abs(e-t)>2.5*n){let r,i;return e<t?(r=e+.75*n,i=t-.75*n):(r=e-.75*n,i=t+.75*n),oce(u_(e,r),u_(i,t),.33)}return u_(e,t)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){let t=(e-this.startTime)/this.duration;return t<1?new l_(this.scrollLeft(t),this.scrollTop(t),!1):new l_(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return e.start(t,n,r)}static start(t,n,r){return r+=10,new e(t,n,Date.now()-10,r)}};function sce(e){return e**3}function cce(e){return 1-sce(1-e)}var lce=500,f_=50,uce=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},p_=class e{static{this.INSTANCE=new e}constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,t=0,n=1,r=this._rear;do{let i=r===this._front?e:2**-n;if(e-=i,t+=this._memory[r].score*i,r===this._front)break;r=(this._capacity+r-1)%this._capacity,n++}while(!0);return t<=.5}acceptStandardWheelEvent(e){if(rt){let t=$e(Ko(e.browserEvent));this.accept(Date.now(),e.deltaX*t,e.deltaY*t)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,n){let r=null,i=new uce(e,t,n);this._front===-1&&this._rear===-1?(this._memory[0]=i,this._front=0,this._rear=0):(r=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=i),i.score=this._computeScore(i,r)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(n+=.25),t){let r=Math.abs(e.deltaX),i=Math.abs(e.deltaY),a=Math.abs(t.deltaX),o=Math.abs(t.deltaY),s=Math.max(Math.min(r,a),1),c=Math.max(Math.min(i,o),1),l=Math.max(r,a),u=Math.max(i,o);l%s===0&&u%c===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01+2**-52*100}},m_=class extends a_{get onScroll(){return this._onScroll.event}get options(){return this._options}constructor(e,t,n){super(),this._inertialTimeout=null,this._inertialSpeed={X:0,Y:0},this._onScroll=this._register(new k),this._onWillScroll=this._register(new k),e.style.overflow=`hidden`,this._options=dce(t),this._scrollable=n,this._register(this._scrollable.onScroll(e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)}));let r={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new ice(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new rce(this._scrollable,this._options,r)),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=ip(document.createElement(`div`)),this._leftShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ip(document.createElement(`div`)),this._topShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ip(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 fr),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=In(this._mouseWheelToDispose),this._inertialTimeout&&=(this._inertialTimeout.dispose(),null),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,$t&&(this._options.className+=` mac`),this._domNode.className=`monaco-scrollable-element `+this._options.className}updateOptions(e){e.handleMouseWheel!==void 0&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),e.mouseWheelScrollSensitivity!==void 0&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),e.fastScrollSensitivity!==void 0&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),e.scrollPredominantAxis!==void 0&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),e.horizontal!==void 0&&(this._options.horizontal=e.horizontal),e.vertical!==void 0&&(this._options.vertical=e.vertical),e.horizontalScrollbarSize!==void 0&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),e.verticalScrollbarSize!==void 0&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),e.scrollByPage!==void 0&&(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 jn(e))}async _periodicSync(){let e=!1;(this._inertialSpeed.X!==0||this._inertialSpeed.Y!==0)&&(this._scrollable.setScrollPositionNow({scrollTop:this._scrollable.getCurrentScrollPosition().scrollTop-this._inertialSpeed.Y*100,scrollLeft:this._scrollable.getCurrentScrollPosition().scrollLeft-this._inertialSpeed.X*100}),this._inertialSpeed.X*=.9,this._inertialSpeed.Y*=.9,Math.abs(this._inertialSpeed.X)<.01&&(this._inertialSpeed.X=0),Math.abs(this._inertialSpeed.Y)<.01&&(this._inertialSpeed.Y=0),e=this._inertialSpeed.X!==0||this._inertialSpeed.Y!==0),e?(this._inertialTimeout||=new fr,this._inertialTimeout.cancelAndSet(()=>this._periodicSync(),1e3/60)):(this._inertialTimeout?.dispose(),this._inertialTimeout=null)}_setListeningToMouseWheel(e){this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=In(this._mouseWheelToDispose),e&&this._mouseWheelToDispose.push(j(this._listenOnDomNode,M.MOUSE_WHEEL,e=>{this._onMouseWheel(new jn(e))},{passive:!1})))}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=p_.INSTANCE;t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,i=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&i+r===0?i=r=0:Math.abs(r)>=Math.abs(i)?i=0:r=0),this._options.flipAxes&&([r,i]=[i,r]);let a=!$t&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!i&&(i=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(i*=this._options.fastScrollSensitivity,r*=this._options.fastScrollSensitivity);let o=this._scrollable.getFutureScrollPosition(),s={};if(r){let e=f_*r,t=o.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(s,t)}if(i){let e=f_*i,t=o.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(s,t)}if(s=this._scrollable.validateScrollPosition(s),this._options.inertialScroll&&(i||r)&&!t.isPhysicalMouseWheel()){let e=!1;this._inertialSpeed.X===0&&this._inertialSpeed.Y===0&&(e=!0),this._inertialSpeed.Y=(r<0?-1:1)*Math.abs(r)**1.02,this._inertialSpeed.X=(i<0?-1:1)*Math.abs(i)**1.02,e&&this._periodicSync()}(o.scrollLeft!==s.scrollLeft||o.scrollTop!==s.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(s):this._scrollable.setScrollPositionNow(s),n=!0)}let r=n;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(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 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)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?` left`:``,i=t?` top`:``,a=n||t?` top-left-corner`:``;this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${i}`),this._topLeftShadowDomNode.setClassName(`shadow${a}${i}${r}`)}}_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(),lce)}},h_=class extends m_{constructor(e,t){t||={},t.mouseWheelSmoothScroll=!1;let n=new c_({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:t=>as(Ko(e),t)});super(e,t,n),this._register(n)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}},g_=class extends m_{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}},__=class extends m_{constructor(e,t){t||={},t.mouseWheelSmoothScroll=!1;let n=new c_({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:t=>as(Ko(e),t)});super(e,t,n),this._register(n),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 dce(e){let t={lazyRender:e.lazyRender===void 0?!1:e.lazyRender,className:e.className===void 0?``:e.className,useShadows:e.useShadows===void 0?!0:e.useShadows,handleMouseWheel:e.handleMouseWheel===void 0?!0:e.handleMouseWheel,flipAxes:e.flipAxes===void 0?!1:e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:e.consumeMouseWheelIfScrollbarIsNeeded===void 0?!1:e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:e.alwaysConsumeMouseWheel===void 0?!1:e.alwaysConsumeMouseWheel,scrollYToX:e.scrollYToX===void 0?!1:e.scrollYToX,mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity===void 0?1:e.mouseWheelScrollSensitivity,fastScrollSensitivity:e.fastScrollSensitivity===void 0?5:e.fastScrollSensitivity,scrollPredominantAxis:e.scrollPredominantAxis===void 0?!0:e.scrollPredominantAxis,mouseWheelSmoothScroll:e.mouseWheelSmoothScroll===void 0?!0:e.mouseWheelSmoothScroll,inertialScroll:e.inertialScroll===void 0?!1:e.inertialScroll,arrowSize:e.arrowSize===void 0?11:e.arrowSize,listenOnDomNode:e.listenOnDomNode===void 0?null:e.listenOnDomNode,horizontal:e.horizontal===void 0?1:e.horizontal,horizontalScrollbarSize:e.horizontalScrollbarSize===void 0?10:e.horizontalScrollbarSize,horizontalSliderSize:e.horizontalSliderSize===void 0?0:e.horizontalSliderSize,horizontalHasArrows:e.horizontalHasArrows===void 0?!1:e.horizontalHasArrows,vertical:e.vertical===void 0?1:e.vertical,verticalScrollbarSize:e.verticalScrollbarSize===void 0?10:e.verticalScrollbarSize,verticalHasArrows:e.verticalHasArrows===void 0?!1:e.verticalHasArrows,verticalSliderSize:e.verticalSliderSize===void 0?0:e.verticalSliderSize,scrollByPage:e.scrollByPage===void 0?!1:e.scrollByPage};return t.horizontalSliderSize=e.horizontalSliderSize===void 0?t.horizontalScrollbarSize:e.horizontalSliderSize,t.verticalSliderSize=e.verticalSliderSize===void 0?t.verticalScrollbarSize:e.verticalSliderSize,$t&&(t.className+=` mac`),t}var v_=class extends D{constructor(e,t,n,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=n,this._dispatchMouse=r,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=this._createDragScrollingOperation(e,t)}stop(){this._operation&&=(this._operation.dispose(),null)}},y_=class extends D{constructor(e,t,n,r,i,a){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=n,this._dispatchMouse=r,this._position=i,this._mouseEvent=a,this._lastTime=Date.now(),this._animationFrameDisposable=as(Ko(a.browserEvent),()=>this._execute())}dispose(){this._animationFrameDisposable.dispose(),super.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){let e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}},b_=class extends v_{_createDragScrollingOperation(e,t){return new x_(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}},x_=class extends y_{_getScrollSpeed(){let e=this._context.configuration.options.get(75),t=this._context.configuration.options.get(165).height/e,n=this._position.outsideDistance/e;return n<=1.5?Math.max(30,t*(1+n)):n<=3?Math.max(60,t*(2+n)):Math.max(200,t*(7+n))}_execute(){let e=this._context.configuration.options.get(75),t=this._getScrollSpeed()*(this._tick()/1e3)*e,n=this._position.outsidePosition===`above`?-t:t;this._context.viewModel.viewLayout.deltaScrollNow(0,n),this._viewHelper.renderNow();let r=this._context.viewLayout.getLinesViewportData(),i=this._position.outsidePosition===`above`?r.startLineNumber:r.endLineNumber,a;{let e=mg(this._viewHelper.viewDomNode),t=this._context.configuration.options.get(165).horizontalScrollbarHeight,n=new fg(this._mouseEvent.pos.x,e.y+e.height-t-.1),r=hg(this._viewHelper.viewDomNode,e,n);a=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),e,n,r,null)}(!a.position||a.position.lineNumber!==i)&&(a=this._position.outsidePosition===`above`?Xg.createOutsideEditor(this._position.mouseColumn,new F(i,1),`above`,this._position.outsideDistance):Xg.createOutsideEditor(this._position.mouseColumn,new F(i,this._context.viewModel.getLineMaxColumn(i)),`below`,this._position.outsideDistance)),this._dispatchMouse(a,!0,2),this._animationFrameDisposable=as(Ko(a.element),()=>this._execute())}},S_=class extends v_{_createDragScrollingOperation(e,t){return new C_(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}},C_=class extends y_{_getScrollSpeed(){let e=this._context.configuration.options.get(59).typicalFullwidthCharacterWidth,t=this._context.configuration.options.get(165).contentWidth/e,n=this._position.outsideDistance/e;return n<=1.5?Math.max(30,t*(1+n)):n<=3?Math.max(60,t*(2+n)):Math.max(200,t*(7+n))}_execute(){let e=this._context.configuration.options.get(59).typicalFullwidthCharacterWidth,t=this._getScrollSpeed()*(this._tick()/1e3)*e*.5,n=this._position.outsidePosition===`left`?-t:t;if(this._context.viewModel.viewLayout.deltaScrollNow(n,0),this._viewHelper.renderNow(),!this._position.position)return;let r=this._position.position.lineNumber,i;{let e=mg(this._viewHelper.viewDomNode),t=this._context.configuration.options.get(165).horizontalScrollbarHeight,n=new fg(this._mouseEvent.pos.x,e.y+e.height-t-.1),r=hg(this._viewHelper.viewDomNode,e,n);i=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),e,n,r,null)}i=this._position.outsidePosition===`left`?Xg.createOutsideEditor(i.mouseColumn,new F(r,i.mouseColumn),`left`,this._position.outsideDistance):Xg.createOutsideEditor(i.mouseColumn,new F(r,i.mouseColumn),`right`,this._position.outsideDistance),this._dispatchMouse(i,!0,2),this._animationFrameDisposable=as(Ko(i.element),()=>this._execute())}},w_=class extends vg{constructor(e,t,n){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=n,this.mouseTargetFactory=new t_(this._context,n),this._mouseDownOperation=this._register(new T_(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(165).height;let r=new Sse(this.viewHelper.viewDomNode);this._register(r.onContextMenu(this.viewHelper.viewDomNode,e=>this._onContextMenu(e,!0))),this._register(r.onMouseMove(this.viewHelper.viewDomNode,e=>{this._onMouseMove(e),this._mouseLeaveMonitor||=j(this.viewHelper.viewDomNode.ownerDocument,`mousemove`,e=>{this.viewHelper.viewDomNode.contains(e.target)||this._onMouseLeave(new gg(e,!1,this.viewHelper.viewDomNode))})})),this._register(r.onMouseUp(this.viewHelper.viewDomNode,e=>this._onMouseUp(e))),this._register(r.onMouseLeave(this.viewHelper.viewDomNode,e=>this._onMouseLeave(e)));let i=0;this._register(r.onPointerDown(this.viewHelper.viewDomNode,(e,t)=>{i=t})),this._register(j(this.viewHelper.viewDomNode,M.POINTER_UP,e=>{this._mouseDownOperation.onPointerUp()})),this._register(r.onMouseDown(this.viewHelper.viewDomNode,e=>this._onMouseDown(e,i))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){let e=p_.INSTANCE,t=0,n=cp.getZoomLevel(),r=!1,i=0;this._register(j(this.viewHelper.viewDomNode,M.MOUSE_WHEEL,o=>{if(this.viewController.emitMouseWheel(o),!this._context.configuration.options.get(84))return;let s=new jn(o);if(e.acceptStandardWheelEvent(s),e.isPhysicalMouseWheel()){if(a(o)){let e=cp.getZoomLevel(),t=s.deltaY>0?1:-1;cp.setZoomLevel(e+t),s.preventDefault(),s.stopPropagation()}}else Date.now()-t>50&&(n=cp.getZoomLevel(),r=a(o),i=0),t=Date.now(),i+=s.deltaY,r&&(cp.setZoomLevel(n+i/5),s.preventDefault(),s.stopPropagation())},{capture:!0,passive:!1}));function a(e){return $t?(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&=(this._mouseLeaveMonitor.dispose(),null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(165)){let e=this._context.configuration.options.get(165).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){let n=new pg(e,t).toPageCoordinates(Ko(this.viewHelper.viewDomNode)),r=mg(this.viewHelper.viewDomNode);if(n.y<r.y||n.y>r.y+r.height||n.x<r.x||n.x>r.x+r.width)return null;let i=hg(this.viewHelper.viewDomNode,r,n);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),r,n,i,null)}_createMouseTarget(e,t){let n=e.target;if(!this.viewHelper.viewDomNode.contains(n)){let t=Ss(this.viewHelper.viewDomNode);t&&(n=t.elementsFromPoint(e.posx,e.posy).find(e=>this.viewHelper.viewDomNode.contains(e))??null)}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?n: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(),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){let n=this._createMouseTarget(e,!0),r=n.type===6||n.type===7,i=n.type===2||n.type===3||n.type===4,a=n.type===3,o=this._context.configuration.options.get(125),s=n.type===8||n.type===5,c=n.type===9,l=e.leftButton||e.middleButton;$t&&e.leftButton&&e.ctrlKey&&(l=!1);let u=()=>{e.preventDefault(),this.viewHelper.focusTextArea()};if(l&&(r||a&&o))u(),this._mouseDownOperation.start(n.type,e,t);else if(i)e.preventDefault();else if(s){let r=n.detail;l&&this.viewHelper.shouldSuppressMouseDownOnViewZone(r.viewZoneId)&&(u(),this._mouseDownOperation.start(n.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(n.detail)&&(u(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:n})}},T_=class extends D{constructor(e,t,n,r,i,a){super(),this._context=e,this._viewController=t,this._viewHelper=n,this._mouseTargetFactory=r,this._createMouseTarget=i,this._getMouseColumn=a,this._mouseMoveMonitor=this._register(new wse(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new b_(this._context,this._viewHelper,this._mouseTargetFactory,(e,t,n)=>this._dispatchMouse(e,t,n))),this._leftRightDragScrolling=this._register(new S_(this._context,this._viewHelper,this._mouseTargetFactory,(e,t,n)=>this._dispatchMouse(e,t,n))),this._mouseState=new E_,this._currentSelection=new W(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);let t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):t.type===13?t.outsidePosition===`above`||t.outsidePosition===`below`?(this._topBottomDragScrolling.start(t,e),this._leftRightDragScrolling.stop()):(this._leftRightDragScrolling.start(t,e),this._topBottomDragScrolling.stop()):(this._topBottomDragScrolling.stop(),this._leftRightDragScrolling.stop(),this._dispatchMouse(t,!0,1)))}start(e,t,n){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);let r=this._findMousePosition(t,!0);if(!r||!r.position)return;this._mouseState.trySetCount(t.detail,r.position),t.detail=this._mouseState.count;let i=this._context.configuration.options;if(!i.get(104)&&i.get(42)&&!i.get(28)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&r.type===6&&r.position&&this._currentSelection.containsPosition(r.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,n,t.buttons,e=>this._onMouseDownThenMove(e),e=>{let t=this._findMousePosition(this._lastMouseEvent,!1);Ms(e)?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:t?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(r,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,n,t.buttons,e=>this._onMouseDownThenMove(e),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop(),this._leftRightDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){let t=e.editorPos,n=this._context.viewModel,r=this._context.viewLayout,i=this._getMouseColumn(e);if(e.posy<t.y){let n=t.y-e.posy,a=Math.max(r.getCurrentScrollTop()-n,0),o=Qg.getZoneAtCoord(this._context,a);if(o){let e=this._helpPositionJumpOverViewZone(o);if(e)return Xg.createOutsideEditor(i,e,`above`,n)}let s=r.getLineNumberAtVerticalOffset(a);return Xg.createOutsideEditor(i,new F(s,1),`above`,n)}if(e.posy>t.y+t.height){let a=e.posy-t.y-t.height,o=r.getCurrentScrollTop()+e.relativePos.y,s=Qg.getZoneAtCoord(this._context,o);if(s){let e=this._helpPositionJumpOverViewZone(s);if(e)return Xg.createOutsideEditor(i,e,`below`,a)}let c=r.getLineNumberAtVerticalOffset(o);return Xg.createOutsideEditor(i,new F(c,n.getLineMaxColumn(c)),`below`,a)}let a=r.getLineNumberAtVerticalOffset(r.getCurrentScrollTop()+e.relativePos.y),o=this._context.configuration.options.get(165),s=o.contentLeft;if(e.relativePos.x<=s){let t=s-e.relativePos.x;return Xg.createOutsideEditor(i,new F(a,1),`left`,t)}let c=o.minimap.minimapLeft===0?o.width-o.verticalScrollbarWidth:o.minimap.minimapLeft;if(e.relativePos.x>=c){let t=e.relativePos.x-c;return Xg.createOutsideEditor(i,new F(a,n.getLineMaxColumn(a)),`right`,t)}return null}_findMousePosition(e,t){let n=this._getPositionOutsideEditor(e);if(n)return n;let r=this._createMouseTarget(e,t);if(!r.position)return null;if(r.type===8||r.type===5){let e=this._helpPositionJumpOverViewZone(r.detail);if(e)return Xg.createViewZone(r.type,r.element,r.mouseColumn,e,r.detail)}return r}_helpPositionJumpOverViewZone(e){let t=new F(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),n=e.positionBefore,r=e.positionAfter;return n&&r?n.isBefore(t)?n:r:null}_dispatchMouse(e,t,n){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:n,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:e.type===6&&e.detail.injectedText!==null})}},E_=class e{static{this.CLEAR_MOUSE_DOWN_COUNT_TIME=400}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(t,n){let r=new Date().getTime();r-this._lastSetMouseDownCountTime>e.CLEAR_MOUSE_DOWN_COUNT_TIME&&(t=1),this._lastSetMouseDownCountTime=r,t>this._lastMouseDownCount+1&&(t=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(n)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=n,this._lastMouseDownCount=Math.min(t,this._lastMouseDownPositionEqualCount)}},D_=class{get event(){return this.emitter.event}constructor(e,t,n){let r=e=>this.emitter.fire(e);this.emitter=new k({onWillAddFirstListener:()=>e.addEventListener(t,r,n),onDidRemoveLastListener:()=>e.removeEventListener(t,r,n)})}dispose(){this.emitter.dispose()}};function O_(e,t,n,r){let i=e.getPlainTextToCopy(t,n,Qt),a=e.model.getEOL(),o=n&&t.length===1&&t[0].isEmpty(),s=Array.isArray(i)?i:null,c=Array.isArray(i)?i.join(a):i,l,u=null;if(A_.forceCopyWithSyntaxHighlighting||r&&c.length<65536){let r=e.getRichTextToCopy(t,n);r&&(l=r.html,u=r.mode)}return{isFromEmptySelection:o,multicursorText:s,text:c,html:l,mode:u}}var k_=class e{static{this.INSTANCE=new e}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)}},A_={forceCopyWithSyntaxHighlighting:!1},j_={getTextData(e){let t=e.getData(Ld.text),n=null,r=e.getData(`vscode-editor-data`);if(typeof r==`string`)try{n=JSON.parse(r),n.version!==1&&(n=null)}catch{}return t.length===0&&n===null&&e.files.length>0?[Array.prototype.slice.call(e.files,0).map(e=>e.name).join(`
58
58
  `),null]:[t,n]},setTextData(e,t,n,r){e.setData(Ld.text,t),typeof n==`string`&&e.setData(`text/html`,n),e.setData(`vscode-editor-data`,JSON.stringify(r))}},M_=class e{static{this.EMPTY=new e(``,0,0,null,void 0)}constructor(e,t,n,r,i){this.value=e,this.selectionStart=t,this.selectionEnd=n,this.selection=r,this.newlineCountBeforeSelection=i}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(t,n){let r=t.getValue(),i=t.getSelectionStart(),a=t.getSelectionEnd(),o;return n&&r.substring(0,i)===n.value.substring(0,n.selectionStart)&&(o=n.newlineCountBeforeSelection),new e(r,i,a,null,o)}collapseSelection(){return this.selectionStart===this.value.length?this:new e(this.value,this.value.length,this.value.length,null,void 0)}isWrittenToTextArea(e,t){let n=this.value===e.getValue();return t?this.selectionStart===e.getSelectionStart()&&this.selectionEnd===e.getSelectionEnd()&&n:n}writeToTextArea(e,t,n){t.setValue(e,this.value),n&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){let t=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,t,-1)}if(e>=this.selectionEnd){let t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,t,1)}let t=this.value.substring(this.selectionStart,e);if(t.indexOf(`…`)===-1)return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,t,1);let n=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,n,-1)}_finishDeduceEditorPosition(e,t,n){let r=0,i=-1;for(;(i=t.indexOf(`
59
59
  `,i+1))!==-1;)r++;return[e,n*t.length,r]}static deduceInput(e,t,n){if(!e)return{text:``,replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};let r=Math.min(Kr(e.value,t.value),e.selectionStart,t.selectionStart),i=Math.min(qr(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(r,e.value.length-i);let a=t.value.substring(r,t.value.length-i),o=e.selectionStart-r,s=e.selectionEnd-r;return t.selectionStart-r===t.selectionEnd-r?{text:a,replacePrevCharCnt:e.selectionStart-r,replaceNextCharCnt:0,positionDelta:0}:{text:a,replacePrevCharCnt:s-o,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};let n=Math.min(Kr(e.value,t.value),e.selectionEnd),r=Math.min(qr(e.value,t.value),e.value.length-e.selectionEnd),i=e.value.substring(n,e.value.length-r),a=t.value.substring(n,t.value.length-r);e.selectionStart-n;let o=e.selectionEnd-n;t.selectionStart-n;let s=t.selectionEnd-n;return{text:a,replacePrevCharCnt:o,replaceNextCharCnt:i.length-o,positionDelta:s-a.length}}static fromScreenReaderContentState(t){return new e(t.value,t.selectionStart,t.selectionEnd,t.selection,t.newlineCountBeforeSelection)}},N_=(function(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID.bind(crypto);let e=new Uint8Array(16),t=[];for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,`0`));return function(){crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,r=``;return r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=`-`,r+=t[e[n++]],r+=t[e[n++]],r+=`-`,r+=t[e[n++]],r+=t[e[n++]],r+=`-`,r+=t[e[n++]],r+=t[e[n++]],r+=`-`,r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r}})();function P_(e){return`${e}-${N_()}`}var F_=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},I_=function(e,t){return function(n,r){t(n,r,e)}},L_;(function(e){e.Tap=`-monaco-textarea-synthetic-tap`})(L_||={});var R_=class{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e||=``;let t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}},z_=class extends D{get textAreaState(){return this._textAreaState}constructor(e,t,n,r,i,a){super(),this._host=e,this._textArea=t,this._OS=n,this._browser=r,this._accessibilityService=i,this._logService=a,this._onFocus=this._register(new k),this.onFocus=this._onFocus.event,this._onBlur=this._register(new k),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new k),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new k),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new k),this.onCut=this._onCut.event,this._onPaste=this._register(new k),this.onPaste=this._onPaste.event,this._onType=this._register(new k),this.onType=this._onType.event,this._onCompositionStart=this._register(new k),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new k),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new k),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new k),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new zn),this._asyncTriggerCut=this._register(new mr(()=>this._onCut.fire(),0)),this._textAreaState=M_.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent(`ctor`),this._register(O.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new mr(()=>this.writeNativeTextAreaContent(`asyncFocusGain`),0)):this._asyncFocusGainWriteScreenReaderContent.clear()})),this._hasFocus=!1,this._currentComposition=null;let o=null;this._register(this._textArea.onKeyDown(e=>{let t=new On(e);(t.keyCode===114||this._currentComposition&&t.keyCode===1)&&t.stopPropagation(),t.equals(9)&&t.preventDefault(),o=t,this._onKeyDown.fire(t)})),this._register(this._textArea.onKeyUp(e=>{let t=new On(e);this._onKeyUp.fire(t)})),this._register(this._textArea.onCompositionStart(e=>{let t=new R_;if(this._currentComposition){this._currentComposition=t;return}if(this._currentComposition=t,this._OS===2&&o&&o.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===e.data&&(o.code===`ArrowRight`||o.code===`ArrowLeft`)){t.handleCompositionUpdate(`x`),this._onCompositionStart.fire({data:e.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:e.data});return}this._onCompositionStart.fire({data:e.data})})),this._register(this._textArea.onCompositionUpdate(e=>{let t=this._currentComposition;if(!t)return;if(this._browser.isAndroid){let t=M_.readFromTextArea(this._textArea,this._textAreaState),n=M_.deduceAndroidCompositionInput(this._textAreaState,t);this._textAreaState=t,this._onType.fire(n),this._onCompositionUpdate.fire(e);return}let n=t.handleCompositionUpdate(e.data);this._textAreaState=M_.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(n),this._onCompositionUpdate.fire(e)})),this._register(this._textArea.onCompositionEnd(e=>{let t=this._currentComposition;if(!t)return;if(this._currentComposition=null,this._browser.isAndroid){let e=M_.readFromTextArea(this._textArea,this._textAreaState),t=M_.deduceAndroidCompositionInput(this._textAreaState,e);this._textAreaState=e,this._onType.fire(t),this._onCompositionEnd.fire();return}let n=t.handleCompositionUpdate(e.data);this._textAreaState=M_.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(n),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(e=>{if(this._textArea.setIgnoreSelectionChangeTime(`received input event`),this._currentComposition)return;let t=M_.readFromTextArea(this._textArea,this._textAreaState),n=M_.deduceInput(this._textAreaState,t,this._OS===2);n.replacePrevCharCnt===0&&n.text.length===1&&(Jr(n.text.charCodeAt(0))||n.text.charCodeAt(0)===127)||(this._textAreaState=t,(n.text!==``||n.replacePrevCharCnt!==0||n.replaceNextCharCnt!==0||n.positionDelta!==0)&&(e.inputType===`insertFromPaste`?this._onPaste.fire({text:n.text,metadata:k_.INSTANCE.get(n.text)}):this._onType.fire(n)))})),this._register(this._textArea.onCut(e=>{this._logService.trace(`TextAreaInput#onCut`,e),this._textArea.setIgnoreSelectionChangeTime(`received cut event`),this._ensureClipboardGetsEditorSelection(e),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(e=>{this._logService.trace(`TextAreaInput#onCopy`,e),this._ensureClipboardGetsEditorSelection(e)})),this._register(this._textArea.onPaste(e=>{if(this._logService.trace(`TextAreaInput#onPaste`,e),this._textArea.setIgnoreSelectionChangeTime(`received paste event`),e.preventDefault(),!e.clipboardData)return;let[t,n]=j_.getTextData(e.clipboardData);this._logService.trace(`TextAreaInput#onPaste with id : `,n?.id,` with text.length: `,t.length),t&&(n||=k_.INSTANCE.get(t),this._logService.trace(`TextAreaInput#onPaste (before onPaste)`),this._onPaste.fire({text:t,metadata:n}))})),this._register(this._textArea.onFocus(()=>{let e=this._hasFocus;this._setHasFocus(!0),this._accessibilityService.isScreenReaderOptimized()&&this._browser.isSafari&&!e&&this._hasFocus&&(this._asyncFocusGainWriteScreenReaderContent.value||(this._asyncFocusGainWriteScreenReaderContent.value=new mr(()=>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 j(this._textArea.ownerDocument,`selectionchange`,t=>{if(sm.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;let n=Date.now(),r=n-e;if(e=n,r<5)return;let i=n-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),i<100||!this._textAreaState.selection)return;let a=this._textArea.getValue();if(this._textAreaState.value!==a)return;let o=this._textArea.getSelectionStart(),s=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===o&&this._textAreaState.selectionEnd===s)return;let c=this._textAreaState.deduceEditorPosition(o),l=this._host.deduceModelPosition(c[0],c[1],c[2]),u=this._textAreaState.deduceEditorPosition(s),d=this._host.deduceModelPosition(u[0],u[1],u[2]),f=new W(l.lineNumber,l.column,d.lineNumber,d.column);this._onSelectionChangeRequest.fire(f)})}dispose(){super.dispose(),this._selectionChangeListener&&=(this._selectionChangeListener.dispose(),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(),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.isWrittenToTextArea(this._textArea,this._hasFocus)||this._logService.trace(`writeTextAreaState(reason: ${e})`),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeNativeTextAreaContent(e){!this._accessibilityService.isScreenReaderOptimized()&&e===`render`||this._currentComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent())}_ensureClipboardGetsEditorSelection(e){let t=this._host.getDataToCopy(),n;this._logService.getLevel()===Hl.Trace&&(n=N_());let r={version:1,id:n,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};k_.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,`
60
- `):t.text,r),e.preventDefault(),e.clipboardData&&j_.setTextData(e.clipboardData,t.text,t.html,r),this._logService.trace(`TextAreaEditContextInput#_ensureClipboardGetsEditorSelection with id : `,n,` with text.length: `,t.text.length)}};z_=F_([I_(4,nm),I_(5,Bl)],z_);var B_=class extends D{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this._onSyntheticTap=this._register(new k),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this.onKeyDown=this._register(new D_(this._actual,`keydown`)).event,this.onKeyPress=this._register(new D_(this._actual,`keypress`)).event,this.onKeyUp=this._register(new D_(this._actual,`keyup`)).event,this.onCompositionStart=this._register(new D_(this._actual,`compositionstart`)).event,this.onCompositionUpdate=this._register(new D_(this._actual,`compositionupdate`)).event,this.onCompositionEnd=this._register(new D_(this._actual,`compositionend`)).event,this.onBeforeInput=this._register(new D_(this._actual,`beforeinput`)).event,this.onInput=this._register(new D_(this._actual,`input`)).event,this.onCut=this._register(new D_(this._actual,`cut`)).event,this.onCopy=this._register(new D_(this._actual,`copy`)).event,this.onPaste=this._register(new D_(this._actual,`paste`)).event,this.onFocus=this._register(new D_(this._actual,`focus`)).event,this.onBlur=this._register(new D_(this._actual,`blur`)).event,this._register(this.onKeyDown(()=>sm.onKeyDown())),this._register(this.onBeforeInput(()=>sm.onBeforeInput())),this._register(this.onInput(()=>sm.onInput())),this._register(this.onKeyUp(()=>sm.onKeyUp())),this._register(j(this._actual,L_.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){let e=Ss(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?Cs()===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){let n=this._actual;n.value!==t&&(this.setIgnoreSelectionChangeTime(`setValue`),n.value=t)}getSelectionStart(){return this._actual.selectionDirection===`backward`?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection===`backward`?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,n){let r=this._actual,i=null,a=Ss(r);i=a?a.activeElement:Cs();let o=Ko(i),s=i===r,c=r.selectionStart,l=r.selectionEnd;if(s&&c===t&&l===n){tt&&o.parent!==o&&r.focus();return}if(s){this.setIgnoreSelectionChangeTime(`setSelectionRange`),r.setSelectionRange(t,n),tt&&o.parent!==o&&r.focus();return}try{let e=_ne(r);this.setIgnoreSelectionChangeTime(`setSelectionRange`),r.focus(),r.setSelectionRange(t,n),vne(r,e)}catch{}}},V_=class extends w_{constructor(e,t,n){super(e,t,n),this._register(i_.addTarget(this.viewHelper.linesContentDomNode)),this._register(j(this.viewHelper.linesContentDomNode,r_.Tap,e=>this.onTap(e))),this._register(j(this.viewHelper.linesContentDomNode,r_.Change,e=>this.onChange(e))),this._register(j(this.viewHelper.linesContentDomNode,r_.Contextmenu,e=>this._onContextMenu(new gg(e,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType=`mouse`,this._register(j(this.viewHelper.linesContentDomNode,`pointerdown`,e=>{let t=e.pointerType;if(t===`mouse`){this._lastPointerType=`mouse`;return}else t===`touch`?this._lastPointerType=`touch`:this._lastPointerType=`pen`}));let r=new Cse(this.viewHelper.viewDomNode);this._register(r.onPointerMove(this.viewHelper.viewDomNode,e=>this._onMouseMove(e))),this._register(r.onPointerUp(this.viewHelper.viewDomNode,e=>this._onMouseUp(e))),this._register(r.onPointerLeave(this.viewHelper.viewDomNode,e=>this._onMouseLeave(e))),this._register(r.onPointerDown(this.viewHelper.viewDomNode,(e,t)=>this._onMouseDown(e,t)))}onTap(e){!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget)||(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){this._lastPointerType===`touch`&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),this._lastPointerType===`pen`&&this._dispatchGesture(e,!0)}_dispatchGesture(e,t){let n=this._createMouseTarget(new gg(e,!1,this.viewHelper.viewDomNode),!1);n.position&&this.viewController.dispatchMouse({position:n.position,mouseColumn:n.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:n.type===6&&n.detail.injectedText!==null})}_onMouseDown(e,t){e.browserEvent.pointerType!==`touch`&&super._onMouseDown(e,t)}},H_=class extends w_{constructor(e,t,n){super(e,t,n),this._register(i_.addTarget(this.viewHelper.linesContentDomNode)),this._register(j(this.viewHelper.linesContentDomNode,r_.Tap,e=>this.onTap(e))),this._register(j(this.viewHelper.linesContentDomNode,r_.Change,e=>this.onChange(e))),this._register(j(this.viewHelper.linesContentDomNode,r_.Contextmenu,e=>this._onContextMenu(new gg(e,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();let t=this._createMouseTarget(new gg(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){let e=document.createEvent(`CustomEvent`);e.initEvent(L_.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(e),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}},U_=class extends D{constructor(e,t,n){super(),(rn||dee&&an)&&hn.pointerEvents?this.handler=this._register(new V_(e,t,n)):Xe.TouchEvent?this.handler=this._register(new H_(e,t,n)):this.handler=this._register(new w_(e,t,n))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}},W_=class{constructor(e,t,n,r){this.configuration=e,this.viewModel=t,this.userInputEvents=n,this.commandDelegate=r}paste(e,t,n,r){this.commandDelegate.paste(e,t,n,r)}type(e){this.commandDelegate.type(e)}compositionType(e,t,n,r){this.commandDelegate.compositionType(e,t,n,r)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Jf.SetSelection.runCoreEditorCommand(this.viewModel,{source:`keyboard`,selection:e})}_validateViewColumn(e){let t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new F(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(86)){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(86)){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){let t=this.configuration.options,n=en&&t.get(121),r=t.get(28),i=t.get(171);e.middleButton&&!n?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():e.mouseDownCount===3?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):e.mouseDownCount===2?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||r?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){Jf.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Jf.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,n){e=this._validateViewColumn(e),Jf.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:`mouse`,position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:n})}_createCursor(e,t){e=this._validateViewColumn(e),Jf.CreateCursor.runCoreEditorCommand(this.viewModel,{source:`mouse`,position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Jf.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Jf.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Jf.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Jf.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Jf.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Jf.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Jf.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Jf.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Jf.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)}};function G_(e,t){let n=ct();if(n?.createTrustedTypesPolicy)try{return n.createTrustedTypesPolicy(e,t)}catch(e){dt(e);return}try{return globalThis.trustedTypes?.createPolicy(e,t)}catch(e){dt(e);return}}var K_=class{constructor(e){this._lineFactory=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){let t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new xt(`Illegal value for lineNumber`);return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;let n=this.getStartLineNumber(),r=this.getEndLineNumber();if(t<n){let n=t-e+1;return this._rendLineNumberStart-=n,null}if(e>r)return null;let i=0,a=0;for(let o=n;o<=r;o++){let n=o-this._rendLineNumberStart;e<=o&&o<=t&&(a===0?(i=n,a=1):a++)}if(e<n){let r=0;r=t<n?t-e+1:n-e,this._rendLineNumberStart-=r}return this._lines.splice(i,a)}onLinesChanged(e,t){let n=e+t-1;if(this.getCount()===0)return!1;let r=this.getStartLineNumber(),i=this.getEndLineNumber(),a=!1;for(let t=e;t<=n;t++)t>=r&&t<=i&&(this._lines[t-this._rendLineNumberStart].onContentChanged(),a=!0);return a}onLinesInserted(e,t){if(this.getCount()===0)return null;let n=t-e+1,r=this.getStartLineNumber(),i=this.getEndLineNumber();if(e<=r)return this._rendLineNumberStart+=n,null;if(e>i)return null;if(n+e>i)return this._lines.splice(e-this._rendLineNumberStart,i-e+1);let a=[];for(let e=0;e<n;e++)a[e]=this._lineFactory.createLine();let o=e-this._rendLineNumberStart,s=this._lines.slice(0,o),c=this._lines.slice(o,this._lines.length-n),l=this._lines.slice(this._lines.length-n,this._lines.length);return this._lines=s.concat(a).concat(c),l}onTokensChanged(e){if(this.getCount()===0)return!1;let t=this.getStartLineNumber(),n=this.getEndLineNumber(),r=!1;for(let i=0,a=e.length;i<a;i++){let a=e[i];if(a.toLineNumber<t||a.fromLineNumber>n)continue;let o=Math.max(t,a.fromLineNumber),s=Math.min(n,a.toLineNumber);for(let e=o;e<=s;e++){let t=e-this._rendLineNumberStart;this._lines[t].onTokensChanged(),r=!0}}return r}},q_=class{constructor(e,t){this._viewContext=e,this._lineFactory=t,this.domNode=this._createDomNode(),this._linesCollection=new K_(this._lineFactory)}_createDomNode(){let e=ip(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(165)}onFlushed(e,t){if(t){let e=this._linesCollection.getStartLineNumber(),t=this._linesCollection.getEndLineNumber();for(let n=e;n<=t;n++)this._linesCollection.getLine(n).getDomNode()?.remove()}return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){let t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,n=t.length;e<n;e++)t[e].getDomNode()?.remove();return!0}onLinesInserted(e){let t=this._linesCollection.onLinesInserted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,n=t.length;e<n;e++)t[e].getDomNode()?.remove();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){let t=this._linesCollection._get(),n=new J_(this.domNode.domNode,this._lineFactory,e,this._viewContext),r={rendLineNumberStart:t.rendLineNumberStart,lines:t.lines,linesLength:t.lines.length},i=n.render(r,e.startLineNumber,e.endLineNumber,e.relativeVerticalOffset);this._linesCollection._set(i.rendLineNumberStart,i.lines)}},J_=class e{static{this._ttPolicy=G_(`editorViewLayer`,{createHTML:e=>e})}constructor(e,t,n,r){this._domNode=e,this._lineFactory=t,this._viewportData=n,this._viewContext=r}render(e,t,n,r){let i={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(i.rendLineNumberStart+i.linesLength-1<t||n<i.rendLineNumberStart){i.rendLineNumberStart=t,i.linesLength=n-t+1,i.lines=[];for(let e=t;e<=n;e++)i.lines[e-t]=this._lineFactory.createLine();return this._finishRendering(i,!0,r),i}if(this._renderUntouchedLines(i,Math.max(t-i.rendLineNumberStart,0),Math.min(n-i.rendLineNumberStart,i.linesLength-1),r,t),i.rendLineNumberStart>t){let e=t,a=Math.min(n,i.rendLineNumberStart-1);e<=a&&(this._insertLinesBefore(i,e,a,r,t),i.linesLength+=a-e+1)}else if(i.rendLineNumberStart<t){let e=Math.min(i.linesLength,t-i.rendLineNumberStart);e>0&&(this._removeLinesBefore(i,e),i.linesLength-=e)}if(i.rendLineNumberStart=t,i.rendLineNumberStart+i.linesLength-1<n){let e=i.rendLineNumberStart+i.linesLength,a=n;e<=a&&(this._insertLinesAfter(i,e,a,r,t),i.linesLength+=a-e+1)}else if(i.rendLineNumberStart+i.linesLength-1>n){let e=Math.max(0,n-i.rendLineNumberStart+1),t=i.linesLength-1-e+1;t>0&&(this._removeLinesAfter(i,t),i.linesLength-=t)}return this._finishRendering(i,!1,r),i}_renderUntouchedLines(e,t,n,r,i){let a=e.rendLineNumberStart,o=e.lines;for(let e=t;e<=n;e++){let t=a+e;o[e].layoutLine(t,r[t-i],this._lineHeightForLineNumber(t))}}_insertLinesBefore(e,t,n,r,i){let a=[],o=0;for(let e=t;e<=n;e++)a[o++]=this._lineFactory.createLine();e.lines=a.concat(e.lines)}_removeLinesBefore(e,t){for(let n=0;n<t;n++)e.lines[n].getDomNode()?.remove();e.lines.splice(0,t)}_insertLinesAfter(e,t,n,r,i){let a=[],o=0;for(let e=t;e<=n;e++)a[o++]=this._lineFactory.createLine();e.lines=e.lines.concat(a)}_removeLinesAfter(e,t){let n=e.linesLength-t;for(let r=0;r<t;r++)e.lines[n+r].getDomNode()?.remove();e.lines.splice(n,t)}_finishRenderingNewLines(t,n,r,i){e._ttPolicy&&(r=e._ttPolicy.createHTML(r));let a=this._domNode.lastChild;n||!a?this._domNode.innerHTML=r:a.insertAdjacentHTML(`afterend`,r);let o=this._domNode.lastChild;for(let e=t.linesLength-1;e>=0;e--){let n=t.lines[e];i[e]&&(n.setDomNode(o),o=o.previousSibling)}}_finishRenderingInvalidLines(t,n,r){let i=document.createElement(`div`);e._ttPolicy&&(n=e._ttPolicy.createHTML(n)),i.innerHTML=n;for(let e=0;e<t.linesLength;e++){let n=t.lines[e];if(r[e]){let e=i.firstChild;n.getDomNode().replaceWith(e),n.setDomNode(e)}}}static{this._sb=new yd(1e5)}_finishRendering(t,n,r){let i=e._sb,a=t.linesLength,o=t.lines,s=t.rendLineNumberStart,c=[];{i.reset();let e=!1;for(let t=0;t<a;t++){let n=o[t];if(c[t]=!1,n.getDomNode())continue;let a=t+s;n.renderLine(a,r[t],this._lineHeightForLineNumber(a),this._viewportData,i)&&(c[t]=!0,e=!0)}e&&this._finishRenderingNewLines(t,n,i.build(),c)}{i.reset();let e=!1,n=[];for(let t=0;t<a;t++){let a=o[t];if(n[t]=!1,c[t])continue;let l=t+s;a.renderLine(l,r[t],this._lineHeightForLineNumber(l),this._viewportData,i)&&(n[t]=!0,e=!0)}e&&this._finishRenderingInvalidLines(t,i.build(),n)}}_lineHeightForLineNumber(e){return this._viewContext.viewLayout.getLineHeightForLineNumber(e)}},Y_=class extends yg{constructor(e){super(e),this._dynamicOverlays=[],this._isFocused=!1,this._visibleLines=new q_(this._context,{createLine:()=>new X_(this._dynamicOverlays)}),this.domNode=this._visibleLines.domNode;let t=this._context.configuration.options.get(59);ap(this.domNode,t),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}addDynamicOverlay(e){this._dynamicOverlays.push(e)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e);let t=this._context.configuration.options.get(59);return ap(this.domNode,t),!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){let t=this._dynamicOverlays.filter(e=>e.shouldRender());for(let n=0,r=t.length;n<r;n++){let r=t[n];r.prepareRender(e),r.onDidRender()}}render(e){this._viewOverlaysRender(e),this.domNode.toggleClassName(`focused`,this._isFocused)}_viewOverlaysRender(e){this._visibleLines.renderLines(e.viewportData)}},X_=class{constructor(e){this._dynamicOverlays=e,this._domNode=null,this._renderedContent=null}getDomNode(){return this._domNode?this._domNode.domNode:null}setDomNode(e){this._domNode=ip(e)}onContentChanged(){}onTokensChanged(){}renderLine(e,t,n,r,i){let a=``;for(let t=0,n=this._dynamicOverlays.length;t<n;t++){let n=this._dynamicOverlays[t];a+=n.render(r.startLineNumber,e)}return this._renderedContent===a?!1:(this._renderedContent=a,i.appendString(`<div style="top:`),i.appendString(String(t)),i.appendString(`px;height:`),i.appendString(String(n)),i.appendString(`px;line-height:`),i.appendString(String(n)),i.appendString(`px;">`),i.appendString(a),i.appendString(`</div>`),!0)}layoutLine(e,t,n){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(n),this._domNode.setLineHeight(n))}},Z_=class extends Y_{constructor(e){super(e);let t=this._context.configuration.options.get(165);this._contentWidth=t.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){let t=this._context.configuration.options.get(165);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))}},Q_=class extends Y_{constructor(e){super(e);let t=this._context.configuration.options,n=t.get(165);this._contentLeft=n.contentLeft,this.domNode.setClassName(`margin-view-overlays`),this.domNode.setWidth(1),ap(this.domNode,t.get(59))}onConfigurationChanged(e){let t=this._context.configuration.options;ap(this.domNode,t.get(59));let n=t.get(165);return this._contentLeft=n.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);let t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}},$_=class e{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){this.onKeyDown?.(e)}emitKeyUp(e){this.onKeyUp?.(e)}emitContextMenu(e){this.onContextMenu?.(this._convertViewToModelMouseEvent(e))}emitMouseMove(e){this.onMouseMove?.(this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){this.onMouseLeave?.(this._convertViewToModelMouseEvent(e))}emitMouseDown(e){this.onMouseDown?.(this._convertViewToModelMouseEvent(e))}emitMouseUp(e){this.onMouseUp?.(this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){this.onMouseDrag?.(this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){this.onMouseDrop?.(this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){this.onMouseDropCanceled?.()}emitMouseWheel(e){this.onMouseWheel?.(e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(t){return e.convertViewToModelMouseTarget(t,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){let n={...e};return n.position&&=t.convertViewPositionToModelPosition(n.position),n.range&&=t.convertViewRangeToModelRange(n.range),(n.type===5||n.type===8)&&(n.detail=this.convertViewToModelViewZoneData(n.detail,t)),n}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 F(e.afterLineNumber,1)).lineNumber}}},ev=class extends yg{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=ip(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,t=this._context.configuration.options.get(165),n=t.contentWidth-t.verticalScrollbarWidth;this.contentWidth!==n&&(this.contentWidth=n,e=!0);let r=t.contentLeft;return this.contentLeft!==r&&(this.contentLeft=r,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,n=e.getDecorationsInViewport();for(let r of n){if(!r.options.blockClassName)continue;let n=this.blocks[t];n||(n=this.blocks[t]=ip(document.createElement(`div`)),this.domNode.appendChild(n));let i,a;r.options.blockIsAfterEnd?(i=e.getVerticalOffsetAfterLineNumber(r.range.endLineNumber,!1),a=e.getVerticalOffsetAfterLineNumber(r.range.endLineNumber,!0)):(i=e.getVerticalOffsetForLineNumber(r.range.startLineNumber,!0),a=r.range.isEmpty()&&!r.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(r.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(r.range.endLineNumber,!0));let[o,s,c,l]=r.options.blockPadding??[0,0,0,0];n.setClassName(`blockDecorations-block `+r.options.blockClassName),n.setLeft(this.contentLeft-l),n.setWidth(this.contentWidth+l+s),n.setTop(i-e.scrollTop-o),n.setHeight(a-i+o+c),t++}for(let e=t;e<this.blocks.length;e++)this.blocks[e].domNode.remove();this.blocks.length=t}},tv=class extends yg{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=ip(document.createElement(`div`)),bg.write(this.domNode,1),this.domNode.setClassName(`contentWidgets`),this.domNode.setPosition(`absolute`),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=ip(document.createElement(`div`)),bg.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName(`overflowingContentWidgets`)}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){let t=Object.keys(this._widgets);for(let n of t)this._widgets[n].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(){let e=Object.keys(this._widgets);for(let t of e)this._widgets[t].updateAnchorViewPosition()}addWidget(e){let t=new nv(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,n,r,i){this._widgets[e.getId()].setPosition(t,n,r,i),this.setShouldRender()}removeWidget(e){let t=e.getId();if(this._widgets.hasOwnProperty(t)){let e=this._widgets[t];delete this._widgets[t];let n=e.domNode.domNode;n.remove(),n.removeAttribute(`monaco-visible-content-widget`),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return this._widgets.hasOwnProperty(e)?this._widgets[e].suppressMouseDown:!1}onBeforeRender(e){let t=Object.keys(this._widgets);for(let n of t)this._widgets[n].onBeforeRender(e)}prepareRender(e){let t=Object.keys(this._widgets);for(let n of t)this._widgets[n].prepareRender(e)}render(e){let t=Object.keys(this._widgets);for(let n of t)this._widgets[n].render(e)}},nv=class{constructor(e,t,n){this._primaryAnchor=new rv(null,null),this._secondaryAnchor=new rv(null,null),this._context=e,this._viewDomNode=t,this._actual=n;let r=this._context.configuration.options,i=r.get(165),a=r.get(4);this.domNode=ip(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=(this._actual.allowEditorOverflow||!1)&&a,this.suppressMouseDown=this._actual.suppressMouseDown||!1,this._fixedOverflowWidgets=r.get(51),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,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){let t=this._context.configuration.options;if(e.hasChanged(165)){let e=t.get(165);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,n){this._affinity=e,this._primaryAnchor=r(t,this._context.viewModel,this._affinity),this._secondaryAnchor=r(n,this._context.viewModel,this._affinity);function r(e,t,n){if(!e)return new rv(null,null);let r=t.model.validatePosition(e);return t.coordinatesConverter.modelPositionIsVisible(r)?new rv(e,t.coordinatesConverter.convertModelPositionToViewPosition(r,n??void 0)):new rv(e,null)}}_getMaxWidth(){let e=this.domNode.domNode.ownerDocument,t=e.defaultView;return this.allowEditorOverflow?t?.innerWidth||e.documentElement.offsetWidth||e.body.offsetWidth:this._contentWidth}setPosition(e,t,n,r){this._setPosition(r,e,t),this._preference=n,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,n,r){let i=e.top,a=i,o=e.top+e.height,s=r.viewportHeight-o,c=i-n,l=a>=n,u=o,d=s>=n,f=e.left;return f+t>r.scrollLeft+r.viewportWidth&&(f=r.scrollLeft+r.viewportWidth-t),f<r.scrollLeft&&(f=r.scrollLeft),{fitsAbove:l,aboveTop:c,fitsBelow:d,belowTop:u,left:f}}_layoutHorizontalSegmentInPage(e,t,n,r){let i=Math.max(15,t.left-r),a=Math.min(t.left+t.width+r,e.width-15),o=this._viewDomNode.domNode.ownerDocument.defaultView,s=t.left+n-(o?.scrollX??0);if(s+r>a){let e=s-(a-r);s-=e,n-=e}if(s<i){let e=s-i;s-=e,n-=e}return[n,s]}_layoutBoxInPage(e,t,n,r){let i=e.top-n,a=e.top+e.height,o=ps(this._viewDomNode.domNode),s=this._viewDomNode.domNode.ownerDocument,c=s.defaultView,l=o.top+i-(c?.scrollY??0),u=o.top+a-(c?.scrollY??0),d=ls(s.body),[f,p]=this._layoutHorizontalSegmentInPage(d,o,e.left-r.scrollLeft+this._contentLeft,t),m=l>=22,h=u+n<=d.height-22;return this._fixedOverflowWidgets?{fitsAbove:m,aboveTop:Math.max(l,22),fitsBelow:h,belowTop:u,left:p}:{fitsAbove:m,aboveTop:i,fitsBelow:h,belowTop:a,left:f}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new iv(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){return{primary:t(this._primaryAnchor.viewPosition,this._affinity),secondary:t(this._secondaryAnchor.viewPosition?.lineNumber===this._primaryAnchor.viewPosition?.lineNumber?this._secondaryAnchor.viewPosition:null,this._affinity)};function t(t,n){if(!t)return null;let r=e.visibleRangeForPosition(t);if(!r)return null;let i=t.column===1&&n===3?0:r.left;return new av(e.getVerticalOffsetForLineNumber(t.lineNumber)-e.scrollTop,i,e.getLineHeightForLineNumber(t.lineNumber))}}_reduceAnchorCoordinates(e,t,n){if(!t)return e;let r=this._context.configuration.options.get(59),i=t.left;return i=i<e.left?Math.max(i,e.left-n+r.typicalFullwidthCharacterWidth):Math.min(i,e.left+n-r.typicalFullwidthCharacterWidth),new av(e.top,i,e.height)}_prepareRenderWidget(e){if(!this._preference||this._preference.length===0)return null;let{primary:t,secondary:n}=this._getAnchorsCoordinates(e);if(!t)return{kind:`offViewport`,preserveFocus:this.domNode.domNode.contains(this.domNode.domNode.ownerDocument.activeElement)};if(this._cachedDomNodeOffsetWidth===-1||this._cachedDomNodeOffsetHeight===-1){let e=null;if(typeof this._actual.beforeRender==`function`&&(e=ov(this._actual.beforeRender,this._actual)),e)this._cachedDomNodeOffsetWidth=e.width,this._cachedDomNodeOffsetHeight=e.height;else{let e=this.domNode.domNode.getBoundingClientRect();this._cachedDomNodeOffsetWidth=Math.round(e.width),this._cachedDomNodeOffsetHeight=Math.round(e.height)}}let r=this._reduceAnchorCoordinates(t,n,this._cachedDomNodeOffsetWidth),i;i=this.allowEditorOverflow?this._layoutBoxInPage(r,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e):this._layoutBoxInViewport(r,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e);for(let e=1;e<=2;e++)for(let t of this._preference)if(t===1){if(!i)return null;if(e===2||i.fitsAbove)return{kind:`inViewport`,coordinate:new iv(i.aboveTop,i.left),position:1}}else if(t===2){if(!i)return null;if(e===2||i.fitsBelow)return{kind:`inViewport`,coordinate:new iv(i.belowTop,i.left),position:2}}else if(this.allowEditorOverflow)return{kind:`inViewport`,coordinate:this._prepareRenderWidgetAtExactPositionOverflowing(new iv(r.top,r.left)),position:0};else return{kind:`inViewport`,coordinate:new iv(r.top,r.left),position:0};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||this._renderData.kind===`offViewport`){this._isVisible&&(this.domNode.removeAttribute(`monaco-visible-content-widget`),this._isVisible=!1,this._renderData?.kind===`offViewport`&&this._renderData.preserveFocus?this.domNode.setTop(-1e3):this.domNode.setVisibility(`hidden`)),typeof this._actual.afterRender==`function`&&ov(this._actual.afterRender,this._actual,null,null);return}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`),!0),typeof this._actual.afterRender==`function`&&ov(this._actual.afterRender,this._actual,this._renderData.position,this._renderData.coordinate)}},rv=class{constructor(e,t){this.modelPosition=e,this.viewPosition=t}},iv=class{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}},av=class{constructor(e,t,n){this.top=e,this.left=t,this.height=n,this._anchorCoordinateBrand=void 0}};function ov(e,t,...n){try{return e.call(t,...n)}catch{return null}}var sv=class extends vg{},cv=pc(`themeService`);function lv(e){return{id:e}}function uv(e){switch(e){case Lg.DARK:return Rg.VS_DARK;case Lg.HIGH_CONTRAST_DARK:return Rg.HC_BLACK;case Lg.HIGH_CONTRAST_LIGHT:return Rg.HC_LIGHT;default:return Rg.VS}}var dv={ThemingContribution:`base.contributions.theming`},fv=new class extends D{constructor(){super(),this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=this._register(new k)}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),T(()=>{let t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}};il.add(dv.ThemingContribution,fv);function pv(e){return fv.onColorThemeChange(e)}var mv=class extends D{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(){}},hv=X(`editor.lineHighlightBackground`,null,C(610,`Background color for the highlight of line at the cursor position.`)),gv=X(`editor.lineHighlightBorder`,{dark:`#282828`,light:`#eeeeee`,hcDark:`#f38518`,hcLight:Bm},C(611,`Background color for the border around the line at the cursor position.`));X(`editor.rangeHighlightBackground`,{dark:`#ffffff0b`,light:`#fdff0033`,hcDark:null,hcLight:null},C(612,`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),X(`editor.rangeHighlightBorder`,{dark:null,light:null,hcDark:Vm,hcLight:Vm},C(613,`Background color of the border around highlighted ranges.`)),X(`editor.symbolHighlightBackground`,{dark:oh,light:oh,hcDark:null,hcLight:null},C(614,`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),X(`editor.symbolHighlightBorder`,{dark:null,light:null,hcDark:Vm,hcLight:Vm},C(615,`Background color of the border around highlighted symbols.`));var _v=X(`editorCursor.foreground`,{dark:`#AEAFAD`,light:J.black,hcDark:J.white,hcLight:`#0F4A85`},C(616,`Color of the editor cursor.`)),vv=X(`editorCursor.background`,null,C(617,`The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.`)),yv=X(`editorMultiCursor.primary.foreground`,_v,C(618,`Color of the primary editor cursor when multiple cursors are present.`)),bv=X(`editorMultiCursor.primary.background`,vv,C(619,`The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.`)),xv=X(`editorMultiCursor.secondary.foreground`,_v,C(620,`Color of secondary editor cursors when multiple cursors are present.`)),Sv=X(`editorMultiCursor.secondary.background`,vv,C(621,`The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.`)),Cv=X(`editorWhitespace.foreground`,{dark:`#e3e4e229`,light:`#33333333`,hcDark:`#e3e4e229`,hcLight:`#CCCCCC`},C(622,`Color of whitespace characters in the editor.`)),wv=X(`editorLineNumber.foreground`,{dark:`#858585`,light:`#237893`,hcDark:J.white,hcLight:`#292929`},C(623,`Color of editor line numbers.`)),Tv=X(`editorIndentGuide.background`,Cv,C(624,`Color of the editor indentation guides.`),!1,C(625,`'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.`)),fce=X(`editorIndentGuide.activeBackground`,Cv,C(626,`Color of the active editor indentation guides.`),!1,C(627,`'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.`)),Ev=X(`editorIndentGuide.background1`,Tv,C(628,`Color of the editor indentation guides (1).`)),pce=X(`editorIndentGuide.background2`,`#00000000`,C(629,`Color of the editor indentation guides (2).`)),mce=X(`editorIndentGuide.background3`,`#00000000`,C(630,`Color of the editor indentation guides (3).`)),hce=X(`editorIndentGuide.background4`,`#00000000`,C(631,`Color of the editor indentation guides (4).`)),gce=X(`editorIndentGuide.background5`,`#00000000`,C(632,`Color of the editor indentation guides (5).`)),_ce=X(`editorIndentGuide.background6`,`#00000000`,C(633,`Color of the editor indentation guides (6).`)),Dv=X(`editorIndentGuide.activeBackground1`,fce,C(634,`Color of the active editor indentation guides (1).`)),vce=X(`editorIndentGuide.activeBackground2`,`#00000000`,C(635,`Color of the active editor indentation guides (2).`)),yce=X(`editorIndentGuide.activeBackground3`,`#00000000`,C(636,`Color of the active editor indentation guides (3).`)),bce=X(`editorIndentGuide.activeBackground4`,`#00000000`,C(637,`Color of the active editor indentation guides (4).`)),xce=X(`editorIndentGuide.activeBackground5`,`#00000000`,C(638,`Color of the active editor indentation guides (5).`)),Sce=X(`editorIndentGuide.activeBackground6`,`#00000000`,C(639,`Color of the active editor indentation guides (6).`));X(`editorLineNumber.activeForeground`,X(`editorActiveLineNumber.foreground`,{dark:`#c6c6c6`,light:`#0B216F`,hcDark:Vm,hcLight:Vm},C(640,`Color of editor active line number`),!1,C(641,`Id is deprecated. Use 'editorLineNumber.activeForeground' instead.`)),C(642,`Color of editor active line number`));var Cce=X(`editorLineNumber.dimmedForeground`,null,C(643,`Color of the final editor line when editor.renderFinalNewline is set to dimmed.`)),wce=X(`editorRuler.foreground`,{dark:`#5A5A5A`,light:J.lightgrey,hcDark:J.white,hcLight:`#292929`},C(644,`Color of the editor rulers.`));X(`editorCodeLens.foreground`,{dark:`#999999`,light:`#919191`,hcDark:`#999999`,hcLight:`#292929`},C(645,`Foreground color of editor CodeLens`)),X(`editorBracketMatch.background`,{dark:`#0064001a`,light:`#0064001a`,hcDark:`#0064001a`,hcLight:`#0000`},C(646,`Background color behind matching brackets`)),X(`editorBracketMatch.border`,{dark:`#888`,light:`#B9B9B9`,hcDark:Bm,hcLight:Bm},C(647,`Color for matching brackets boxes`));var Tce=X(`editorOverviewRuler.border`,{dark:`#7f7f7f4d`,light:`#7f7f7f4d`,hcDark:`#7f7f7f4d`,hcLight:`#666666`},C(648,`Color of the overview ruler border.`)),Ece=X(`editorOverviewRuler.background`,null,C(649,`Background color of the editor overview ruler.`));X(`editorGutter.background`,qm,C(650,`Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.`)),X(`editorUnnecessaryCode.border`,{dark:null,light:null,hcDark:J.fromHex(`#fff`).transparent(.8),hcLight:Bm},C(651,`Border color of unnecessary (unused) source code in the editor.`));var Dce=X(`editorUnnecessaryCode.opacity`,{dark:J.fromHex(`#000a`),light:J.fromHex(`#0007`),hcDark:null,hcLight:null},C(652,`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.`));X(`editorGhostText.border`,{dark:null,light:null,hcDark:J.fromHex(`#fff`).transparent(.8),hcLight:J.fromHex(`#292929`).transparent(.8)},C(653,`Border color of ghost text in the editor.`));var Oce=X(`editorGhostText.foreground`,{dark:J.fromHex(`#ffffff56`),light:J.fromHex(`#0007`),hcDark:null,hcLight:null},C(654,`Foreground color of the ghost text in the editor.`));X(`editorGhostText.background`,null,C(655,`Background color of the ghost text in the editor.`));var Ov=X(`editorOverviewRuler.rangeHighlightForeground`,new J(new q(0,122,204,.6)),C(656,`Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations.`),!0),kce=X(`editorOverviewRuler.errorForeground`,{dark:new J(new q(255,18,18,.7)),light:new J(new q(255,18,18,.7)),hcDark:new J(new q(255,50,50,1)),hcLight:`#B5200D`},C(657,`Overview ruler marker color for errors.`)),Ace=X(`editorOverviewRuler.warningForeground`,{dark:$m,light:$m,hcDark:eh,hcLight:eh},C(658,`Overview ruler marker color for warnings.`)),jce=X(`editorOverviewRuler.infoForeground`,{dark:th,light:th,hcDark:nh,hcLight:nh},C(659,`Overview ruler marker color for infos.`)),kv=X(`editorBracketHighlight.foreground1`,{dark:`#FFD700`,light:`#0431FAFF`,hcDark:`#FFD700`,hcLight:`#0431FAFF`},C(660,`Foreground color of brackets (1). Requires enabling bracket pair colorization.`)),Av=X(`editorBracketHighlight.foreground2`,{dark:`#DA70D6`,light:`#319331FF`,hcDark:`#DA70D6`,hcLight:`#319331FF`},C(661,`Foreground color of brackets (2). Requires enabling bracket pair colorization.`)),jv=X(`editorBracketHighlight.foreground3`,{dark:`#179FFF`,light:`#7B3814FF`,hcDark:`#87CEFA`,hcLight:`#7B3814FF`},C(662,`Foreground color of brackets (3). Requires enabling bracket pair colorization.`)),Mv=X(`editorBracketHighlight.foreground4`,`#00000000`,C(663,`Foreground color of brackets (4). Requires enabling bracket pair colorization.`)),Nv=X(`editorBracketHighlight.foreground5`,`#00000000`,C(664,`Foreground color of brackets (5). Requires enabling bracket pair colorization.`)),Pv=X(`editorBracketHighlight.foreground6`,`#00000000`,C(665,`Foreground color of brackets (6). Requires enabling bracket pair colorization.`)),Mce=X(`editorBracketHighlight.unexpectedBracket.foreground`,{dark:new J(new q(255,18,18,.8)),light:new J(new q(255,18,18,.8)),hcDark:new J(new q(255,50,50,1)),hcLight:`#B5200D`},C(666,`Foreground color of unexpected brackets.`)),Nce=X(`editorBracketPairGuide.background1`,`#00000000`,C(667,`Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.`)),Pce=X(`editorBracketPairGuide.background2`,`#00000000`,C(668,`Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.`)),Fce=X(`editorBracketPairGuide.background3`,`#00000000`,C(669,`Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.`)),Ice=X(`editorBracketPairGuide.background4`,`#00000000`,C(670,`Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.`)),Lce=X(`editorBracketPairGuide.background5`,`#00000000`,C(671,`Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.`)),Rce=X(`editorBracketPairGuide.background6`,`#00000000`,C(672,`Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.`)),zce=X(`editorBracketPairGuide.activeBackground1`,`#00000000`,C(673,`Background color of active bracket pair guides (1). Requires enabling bracket pair guides.`)),Bce=X(`editorBracketPairGuide.activeBackground2`,`#00000000`,C(674,`Background color of active bracket pair guides (2). Requires enabling bracket pair guides.`)),Vce=X(`editorBracketPairGuide.activeBackground3`,`#00000000`,C(675,`Background color of active bracket pair guides (3). Requires enabling bracket pair guides.`)),Hce=X(`editorBracketPairGuide.activeBackground4`,`#00000000`,C(676,`Background color of active bracket pair guides (4). Requires enabling bracket pair guides.`)),Uce=X(`editorBracketPairGuide.activeBackground5`,`#00000000`,C(677,`Background color of active bracket pair guides (5). Requires enabling bracket pair guides.`)),Wce=X(`editorBracketPairGuide.activeBackground6`,`#00000000`,C(678,`Background color of active bracket pair guides (6). Requires enabling bracket pair guides.`));X(`editorUnicodeHighlight.border`,$m,C(679,`Border color used to highlight unicode characters.`)),X(`editorUnicodeHighlight.background`,Gae,C(680,`Background color used to highlight unicode characters.`)),pv((e,t)=>{let n=e.getColor(qm),r=e.getColor(hv),i=r&&!r.isTransparent()?r:n;i&&t.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${i}; }`)});var Fv=class extends sv{constructor(e){super(),this._context=e;let t=this._context.configuration.options,n=t.get(165);this._renderLineHighlight=t.get(110),this._renderLineHighlightOnlyWhenFocus=t.get(111),this._wordWrap=n.isViewportWrapping,this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new W(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1,t=new Set;for(let e of this._selections)t.add(e.positionLineNumber);let n=Array.from(t);n.sort((e,t)=>e-t),va(this._cursorLineNumbers,n)||(this._cursorLineNumbers=n,e=!0);let r=this._selections.every(e=>e.isEmpty());return this._selectionIsEmpty!==r&&(this._selectionIsEmpty=r,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){let t=this._context.configuration.options,n=t.get(165);return this._renderLineHighlight=t.get(110),this._renderLineHighlightOnlyWhenFocus=t.get(111),this._wordWrap=n.isViewportWrapping,this._contentLeft=n.contentLeft,this._contentWidth=n.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):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}let t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,r=[];for(let e=t;e<=n;e++){let n=e-t;r[n]=``}if(this._wordWrap){let i=this._renderOne(e,!1);for(let e of this._cursorLineNumbers){let a=this._context.viewModel.coordinatesConverter,o=a.convertViewPositionToModelPosition(new F(e,1)).lineNumber,s=a.convertModelPositionToViewPosition(new F(o,1)).lineNumber,c=a.convertModelPositionToViewPosition(new F(o,this._context.viewModel.model.getLineMaxColumn(o))).lineNumber,l=Math.max(s,t),u=Math.min(c,n);for(let e=l;e<=u;e++){let n=e-t;r[n]=i}}}let i=this._renderOne(e,!0);for(let e of this._cursorLineNumbers){if(e<t||e>n)continue;let a=e-t;r[a]=i}this._renderData=r}render(e,t){if(!this._renderData)return``;let n=t-e;return n>=this._renderData.length?``:this._renderData[n]}_shouldRenderInMargin(){return(this._renderLineHighlight===`gutter`||this._renderLineHighlight===`all`)&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight===`line`||this._renderLineHighlight===`all`)&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}},Gce=class extends Fv{_renderOne(e,t){return`<div class="${`current-line`+(this._shouldRenderInMargin()?` current-line-both`:``)+(t?` current-line-exact`:``)}" style="width:${Math.max(e.scrollWidth,this._contentWidth)}px;"></div>`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}},Kce=class extends Fv{_renderOne(e,t){return`<div class="${`current-line`+(this._shouldRenderInMargin()?` current-line-margin`:``)+(this._shouldRenderOther()?` current-line-margin-both`:``)+(this._shouldRenderInMargin()&&t?` current-line-exact-margin`:``)}" style="width:${this._contentLeft}px"></div>`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}};pv((e,t)=>{let n=e.getColor(hv);if(n&&(t.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${n}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${n}; border: none; }`)),!n||n.isTransparent()||e.defines(gv)){let n=e.getColor(gv);n&&(t.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${n}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${n}; }`),zg(e.type)&&(t.addRule(`.monaco-editor .view-overlays .current-line-exact { border-width: 1px; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }`)))}});var qce=class extends sv{constructor(e){super(),this._context=e;let t=this._context.configuration.options;this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return this._typicalHalfwidthCharacterWidth=t.get(59).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){let t=e.getDecorationsInViewport(),n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];i.options.className&&(n[r++]=i)}n=n.sort((e,t)=>{if(e.options.zIndex<t.options.zIndex)return-1;if(e.options.zIndex>t.options.zIndex)return 1;let n=e.options.className,r=t.options.className;return n<r?-1:n>r?1:U.compareRangesUsingStarts(e.range,t.range)});let i=e.visibleRange.startLineNumber,a=e.visibleRange.endLineNumber,o=[];for(let e=i;e<=a;e++){let t=e-i;o[t]=``}this._renderWholeLineDecorations(e,n,o),this._renderNormalDecorations(e,n,o),this._renderResult=o}_renderWholeLineDecorations(e,t,n){let r=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber;for(let e=0,a=t.length;e<a;e++){let a=t[e];if(!a.options.isWholeLine)continue;let o=`<div class="cdr `+a.options.className+`" style="left:0;width:100%;"></div>`,s=Math.max(a.range.startLineNumber,r),c=Math.min(a.range.endLineNumber,i);for(let e=s;e<=c;e++){let t=e-r;n[t]+=o}}}_renderNormalDecorations(e,t,n){let r=e.visibleRange.startLineNumber,i=null,a=!1,o=null,s=!1;for(let c=0,l=t.length;c<l;c++){let l=t[c];if(l.options.isWholeLine)continue;let u=l.options.className,d=!!l.options.showIfCollapsed,f=l.range;if(d&&f.endColumn===1&&f.endLineNumber!==f.startLineNumber&&(f=new U(f.startLineNumber,f.startColumn,f.endLineNumber-1,this._context.viewModel.getLineMaxColumn(f.endLineNumber-1))),i===u&&a===d&&U.areIntersectingOrTouching(o,f)){o=U.plusRange(o,f);continue}i!==null&&this._renderNormalDecoration(e,o,i,s,a,r,n),i=u,a=d,o=f,s=l.options.shouldFillLineOnLineBreak??!1}i!==null&&this._renderNormalDecoration(e,o,i,s,a,r,n)}_renderNormalDecoration(e,t,n,r,i,a,o){let s=e.linesVisibleRangesForRange(t,n===`findMatch`);if(s)for(let e=0,t=s.length;e<t;e++){let t=s[e];if(t.outsideRenderedLine)continue;let c=t.lineNumber-a;if(i&&t.ranges.length===1){let e=t.ranges[0];if(e.width<this._typicalHalfwidthCharacterWidth){let n=Math.round(e.left+e.width/2),r=Math.max(0,Math.round(n-this._typicalHalfwidthCharacterWidth/2));t.ranges[0]=new Sg(r,this._typicalHalfwidthCharacterWidth)}}for(let e=0,i=t.ranges.length;e<i;e++){let a=r&&t.continuesOnNextLine&&i===1,s=t.ranges[e],l=`<div class="cdr `+n+`" style="left:`+String(s.left)+`px;width:`+(a?`100%;`:String(s.width)+`px;`)+`"></div>`;o[c]+=l}}}render(e,t){if(!this._renderResult)return``;let n=t-e;return n<0||n>=this._renderResult.length?``:this._renderResult[n]}},Jce=class extends yg{constructor(e,t,n,r){super(e);let i=this._context.configuration.options,a=i.get(117),o=i.get(83),s=i.get(49),c=i.get(120),l=i.get(158),u={listenOnDomNode:n.domNode,className:`editor-scrollable `+uv(e.theme.type),useShadows:!1,lazyRender:!0,vertical:a.vertical,horizontal:a.horizontal,verticalHasArrows:a.verticalHasArrows,horizontalHasArrows:a.horizontalHasArrows,verticalScrollbarSize:a.verticalScrollbarSize,verticalSliderSize:a.verticalSliderSize,horizontalScrollbarSize:a.horizontalScrollbarSize,horizontalSliderSize:a.horizontalSliderSize,handleMouseWheel:a.handleMouseWheel,alwaysConsumeMouseWheel:a.alwaysConsumeMouseWheel,arrowSize:a.arrowSize,mouseWheelScrollSensitivity:o,fastScrollSensitivity:s,scrollPredominantAxis:c,scrollByPage:a.scrollByPage,inertialScroll:l};this.scrollbar=this._register(new g_(t.domNode,u,this._context.viewLayout.getScrollable())),bg.write(this.scrollbar.getDomNode(),6),this.scrollbarDomNode=ip(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition(`absolute`),this._setLayout();let d=(e,t,n)=>{let r={};{let t=e.scrollTop;t&&(r.scrollTop=this._context.viewLayout.getCurrentScrollTop()+t,e.scrollTop=0)}if(n){let t=e.scrollLeft;t&&(r.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+t,e.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(r,1)};this._register(j(n.domNode,`scroll`,e=>d(n.domNode,!0,!0))),this._register(j(t.domNode,`scroll`,e=>d(t.domNode,!0,!1))),this._register(j(r.domNode,`scroll`,e=>d(r.domNode,!0,!1))),this._register(j(this.scrollbarDomNode.domNode,`scroll`,e=>d(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){let e=this._context.configuration.options,t=e.get(165);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(81).side===`right`?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(117)||e.hasChanged(83)||e.hasChanged(49)){let e=this._context.configuration.options,t=e.get(117),n=e.get(83),r=e.get(49),i=e.get(120),a={vertical:t.vertical,horizontal:t.horizontal,verticalScrollbarSize:t.verticalScrollbarSize,horizontalScrollbarSize:t.horizontalScrollbarSize,scrollByPage:t.scrollByPage,handleMouseWheel:t.handleMouseWheel,mouseWheelScrollSensitivity:n,fastScrollSensitivity:r,scrollPredominantAxis:i};this.scrollbar.updateOptions(a)}return e.hasChanged(165)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName(`editor-scrollable `+uv(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}},Iv=class{constructor(e,t,n,r,i){this.startLineNumber=e,this.endLineNumber=t,this.className=n,this.tooltip=r,this._decorationToRenderBrand=void 0,this.zIndex=i??0}},Yce=class{constructor(e,t,n){this.className=e,this.zIndex=t,this.tooltip=n}},Xce=class{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}},Lv=class extends sv{_render(e,t,n){let r=[];for(let n=e;n<=t;n++){let t=n-e;r[t]=new Xce}if(n.length===0)return r;n.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 i=null,a=0;for(let o=0,s=n.length;o<s;o++){let s=n[o],c=s.className,l=s.zIndex,u=Math.max(s.startLineNumber,e)-e,d=Math.min(s.endLineNumber,t)-e;i===c?(u=Math.max(a+1,u),a=Math.max(a,d)):(i=c,a=d);for(let e=u;e<=a;e++)r[e].add(new Yce(c,l,s.tooltip))}return r}},Zce=class extends yg{constructor(e){super(e),this._widgets={},this._context=e;let t=this._context.configuration.options,n=t.get(165);this.domNode=ip(document.createElement(`div`)),this.domNode.setClassName(`glyph-margin-widgets`),this.domNode.setPosition(`absolute`),this.domNode.setTop(0),this._lineHeight=t.get(75),this._glyphMargin=t.get(66),this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,this._glyphMarginDecorationLaneCount=n.glyphMarginDecorationLaneCount,this._managedDomNodes=[],this._decorationGlyphsToRender=[]}dispose(){this._managedDomNodes=[],this._decorationGlyphsToRender=[],this._widgets={},super.dispose()}getWidgets(){return Object.values(this._widgets)}onConfigurationChanged(e){let t=this._context.configuration.options,n=t.get(165);return this._lineHeight=t.get(75),this._glyphMargin=t.get(66),this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,this._glyphMarginDecorationLaneCount=n.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){let t=ip(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){let n=this._widgets[e.getId()];return n.preference.lane===t.lane&&n.preference.zIndex===t.zIndex&&U.equalsRange(n.preference.range,t.range)?!1:(n.preference=t,this.setShouldRender(),!0)}removeWidget(e){let t=e.getId();if(this._widgets[t]){let e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.remove(),this.setShouldRender()}}_collectDecorationBasedGlyphRenderRequest(e,t){let n=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,i=e.getDecorationsInViewport();for(let e of i){let i=e.options.glyphMarginClassName;if(!i)continue;let a=Math.max(e.range.startLineNumber,n),o=Math.min(e.range.endLineNumber,r),s=e.options.glyphMargin?.position??Zu.Center,c=e.options.zIndex??0;for(let e=a;e<=o;e++){let n=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new F(e,0)),r=this._context.viewModel.glyphLanes.getLanesAtLine(n.lineNumber).indexOf(s);t.push(new Qce(e,r,c,i))}}}_collectWidgetBasedGlyphRenderRequest(e,t){let n=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(let e of Object.values(this._widgets)){let i=e.preference.range,{startLineNumber:a,endLineNumber:o}=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(U.lift(i));if(!a||!o||o<n||a>r)continue;let s=Math.max(a,n),c=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new F(s,0)),l=this._context.viewModel.glyphLanes.getLanesAtLine(c.lineNumber).indexOf(e.preference.lane);t.push(new $ce(s,l,e.preference.zIndex,e))}}_collectSortedGlyphRenderRequests(e){let t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((e,t)=>e.lineNumber===t.lineNumber?e.laneIndex===t.laneIndex?e.zIndex===t.zIndex?t.type===e.type?e.type===0&&t.type===0?e.className<t.className?-1:1:0:t.type-e.type:t.zIndex-e.zIndex:e.laneIndex-t.laneIndex:e.lineNumber-t.lineNumber),t}prepareRender(e){if(!this._glyphMargin){this._decorationGlyphsToRender=[];return}for(let e of Object.values(this._widgets))e.renderInfo=null;let t=new Ua(this._collectSortedGlyphRenderRequests(e)),n=[];for(;t.length>0;){let e=t.peek();if(!e)break;let r=t.takeWhile(t=>t.lineNumber===e.lineNumber&&t.laneIndex===e.laneIndex);if(!r||r.length===0)break;let i=r[0];if(i.type===0){let e=[];for(let t of r){if(t.zIndex!==i.zIndex||t.type!==i.type)break;(e.length===0||e[e.length-1]!==t.className)&&e.push(t.className)}n.push(i.accept(e.join(` `)))}else i.widget.renderInfo={lineNumber:i.lineNumber,laneIndex:i.laneIndex}}this._decorationGlyphsToRender=n}render(e){if(!this._glyphMargin){for(let e of Object.values(this._widgets))e.domNode.setDisplay(`none`);for(;this._managedDomNodes.length>0;)this._managedDomNodes.pop()?.domNode.remove();return}let t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(let n of Object.values(this._widgets))if(!n.renderInfo)n.domNode.setDisplay(`none`);else{let r=e.viewportData.relativeVerticalOffset[n.renderInfo.lineNumber-e.viewportData.startLineNumber],i=this._glyphMarginLeft+n.renderInfo.laneIndex*this._lineHeight;n.domNode.setDisplay(`block`),n.domNode.setTop(r),n.domNode.setLeft(i),n.domNode.setWidth(t),n.domNode.setHeight(this._lineHeight)}for(let n=0;n<this._decorationGlyphsToRender.length;n++){let r=this._decorationGlyphsToRender[n],i=r.lineNumber,a=e.viewportData.relativeVerticalOffset[i-e.viewportData.startLineNumber],o=this._glyphMarginLeft+r.laneIndex*this._lineHeight,s;n<this._managedDomNodes.length?s=this._managedDomNodes[n]:(s=ip(document.createElement(`div`)),this._managedDomNodes.push(s),this.domNode.appendChild(s));let c=this._context.viewLayout.getLineHeightForLineNumber(i);s.setClassName(`cgmr codicon `+r.combinedClassName),s.setPosition(`absolute`),s.setTop(a),s.setLeft(o),s.setWidth(t),s.setHeight(c)}for(;this._managedDomNodes.length>this._decorationGlyphsToRender.length;)this._managedDomNodes.pop()?.domNode.remove()}},Qce=class{constructor(e,t,n,r){this.lineNumber=e,this.laneIndex=t,this.zIndex=n,this.className=r,this.type=0}accept(e){return new ele(this.lineNumber,this.laneIndex,e)}},$ce=class{constructor(e,t,n,r){this.lineNumber=e,this.laneIndex=t,this.zIndex=n,this.widget=r,this.type=1}},ele=class{constructor(e,t,n){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=n}};function Rv(e,t,n=e.length-1){let r=tle(e,t,n);if(r!==-1)return e[r]}function tle(e,t,n=e.length-1){for(let r=n;r>=0;r--){let n=e[r];if(t(n,r))return r}return-1}function zv(e,t){let n=Bv(e,t);return n===-1?void 0:e[n]}function Bv(e,t,n=0,r=e.length){let i=n,a=r;for(;i<a;){let n=Math.floor((i+a)/2);t(e[n])?i=n+1:a=n}return i-1}function nle(e,t){let n=Vv(e,t);return n===e.length?void 0:e[n]}function Vv(e,t,n=0,r=e.length){let i=n,a=r;for(;i<a;){let n=Math.floor((i+a)/2);t(e[n])?a=n:i=n+1}return i}var Hv=class e{static{this.assertInvariants=!1}constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(t){if(e.assertInvariants){if(this._prevFindLastPredicate){for(let e of this._array)if(this._prevFindLastPredicate(e)&&!t(e))throw Error(`MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.`)}this._prevFindLastPredicate=t}let n=Bv(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=n+1,n===-1?void 0:this._array[n]}};function Uv(e,t){if(e.length===0)return;let n=e[0];for(let r=1;r<e.length;r++){let i=e[r];t(i,n)>0&&(n=i)}return n}function Wv(e,t){if(e.length===0)return;let n=e[0];for(let r=1;r<e.length;r++){let i=e[r];t(i,n)>=0&&(n=i)}return n}function Gv(e,t){return Uv(e,(e,n)=>-t(e,n))}function rle(e,t){if(e.length===0)return-1;let n=0;for(let r=1;r<e.length;r++){let i=e[r];t(i,e[n])>0&&(n=r)}return n}function ile(e,t){for(let n of e){let e=t(n);if(e!==void 0)return e}}var Kv=class extends D{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw Error(`TextModelPart is disposed!`)}};function qv(e,t){let n=0,r=0,i=e.length;for(;r<i;){let i=e.charCodeAt(r);if(i===32)n++;else if(i===9)n=n-n%t+t;else break;r++}return r===i?-1:n}var Jv;(function(e){e[e.Disabled=0]=`Disabled`,e[e.EnabledForActive=1]=`EnabledForActive`,e[e.Enabled=2]=`Enabled`})(Jv||={});var Yv=class{constructor(e,t,n,r,i,a){if(this.visibleColumn=e,this.column=t,this.className=n,this.horizontalLine=r,this.forWrappedLinesAfterColumn=i,this.forWrappedLinesBeforeOrAtColumn=a,e!==-1==(t!==-1))throw Error()}},Xv=class{constructor(e,t){this.top=e,this.endColumn=t}},ale=class extends Kv{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return qv(this.textModel.getLineContent(e+1),this.textModel.getOptions().tabSize)}getActiveIndentGuide(e,t,n){this.assertNotDisposed();let r=this.textModel.getLineCount();if(e<1||e>r)throw new xt(`Illegal value for lineNumber`);let i=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,a=!!(i&&i.offSide),o=-2,s=-1,c=-2,l=-1,u=e=>{if(o!==-1&&(o===-2||o>e-1)){o=-1,s=-1;for(let t=e-2;t>=0;t--){let e=this._computeIndentLevel(t);if(e>=0){o=t,s=e;break}}}if(c===-2){c=-1,l=-1;for(let t=e;t<r;t++){let e=this._computeIndentLevel(t);if(e>=0){c=t,l=e;break}}}},d=-2,f=-1,p=-2,m=-1,h=e=>{if(d===-2){d=-1,f=-1;for(let t=e-2;t>=0;t--){let e=this._computeIndentLevel(t);if(e>=0){d=t,f=e;break}}}if(p!==-1&&(p===-2||p<e-1)){p=-1,m=-1;for(let t=e;t<r;t++){let e=this._computeIndentLevel(t);if(e>=0){p=t,m=e;break}}}},g=0,_=!0,v=0,y=!0,b=0,x=0;for(let i=0;_||y;i++){let o=e-i,p=e+i;i>1&&(o<1||o<t)&&(_=!1),i>1&&(p>r||p>n)&&(y=!1),i>5e4&&(_=!1,y=!1);let S=-1;if(_&&o>=1){let e=this._computeIndentLevel(o-1);e>=0?(c=o-1,l=e,S=Math.ceil(e/this.textModel.getOptions().indentSize)):(u(o),S=this._getIndentLevelForWhitespaceLine(a,s,l))}let ee=-1;if(y&&p<=r){let e=this._computeIndentLevel(p-1);e>=0?(d=p-1,f=e,ee=Math.ceil(e/this.textModel.getOptions().indentSize)):(h(p),ee=this._getIndentLevelForWhitespaceLine(a,f,m))}if(i===0){x=S;continue}if(i===1){if(p<=r&&ee>=0&&x+1===ee){_=!1,g=p,v=p,b=ee;continue}if(o>=1&&S>=0&&S-1===x){y=!1,g=o,v=o,b=S;continue}if(g=e,v=e,b=x,b===0)return{startLineNumber:g,endLineNumber:v,indent:b}}_&&(S>=b?g=o:_=!1),y&&(ee>=b?v=p:y=!1)}return{startLineNumber:g,endLineNumber:v,indent:b}}getLinesBracketGuides(e,t,n,r){let i=[];for(let n=e;n<=t;n++)i.push([]);let a=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new U(e,1,t,this.textModel.getLineMaxColumn(t))).toArray(),o;n&&a.length>0&&(o=Rv((e<=n.lineNumber&&n.lineNumber<=t?a:this.textModel.bracketPairs.getBracketPairsInRange(U.fromPositions(n)).toArray()).filter(e=>U.strictContainsPosition(e.range,n)),e=>!0)?.range);let s=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,c=new Zv;for(let n of a){if(!n.closingBracketRange)continue;let a=o&&n.range.equalsRange(o);if(!a&&!r.includeInactive)continue;let l=c.getInlineClassName(n.nestingLevel,n.nestingLevelOfEqualBracketType,s)+(r.highlightActive&&a?` `+c.activeClassName:``),u=n.openingBracketRange.getStartPosition(),d=n.closingBracketRange.getStartPosition(),f=r.horizontalGuides===Jv.Enabled||r.horizontalGuides===Jv.EnabledForActive&&a;if(n.range.startLineNumber===n.range.endLineNumber){f&&i[n.range.startLineNumber-e].push(new Yv(-1,n.openingBracketRange.getEndPosition().column,l,new Xv(!1,d.column),-1,-1));continue}let p=this.getVisibleColumnFromPosition(d),m=this.getVisibleColumnFromPosition(n.openingBracketRange.getStartPosition()),h=Math.min(m,p,n.minVisibleColumnIndentation+1),g=!1;Pr(this.textModel.getLineContent(n.closingBracketRange.startLineNumber))<n.closingBracketRange.startColumn-1&&(g=!0);let _=Math.max(u.lineNumber,e),v=Math.min(d.lineNumber,t),y=+!!g;for(let t=_;t<v+y;t++)i[t-e].push(new Yv(h,-1,l,null,t===u.lineNumber?u.column:-1,t===d.lineNumber?d.column:-1));f&&(u.lineNumber>=e&&m>h&&i[u.lineNumber-e].push(new Yv(h,-1,l,new Xv(!1,u.column),-1,-1)),d.lineNumber<=t&&p>h&&i[d.lineNumber-e].push(new Yv(h,-1,l,new Xv(!g,d.column),-1,-1)))}for(let e of i)e.sort((e,t)=>e.visibleColumn-t.visibleColumn);return i}getVisibleColumnFromPosition(e){return hu.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();let n=this.textModel.getLineCount();if(e<1||e>n)throw Error(`Illegal value for startLineNumber`);if(t<1||t>n)throw Error(`Illegal value for endLineNumber`);let r=this.textModel.getOptions(),i=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,a=!!(i&&i.offSide),o=Array(t-e+1),s=-2,c=-1,l=-2,u=-1;for(let i=e;i<=t;i++){let t=i-e,d=this._computeIndentLevel(i-1);if(d>=0){s=i-1,c=d,o[t]=Math.ceil(d/r.indentSize);continue}if(s===-2){s=-1,c=-1;for(let e=i-2;e>=0;e--){let t=this._computeIndentLevel(e);if(t>=0){s=e,c=t;break}}}if(l!==-1&&(l===-2||l<i-1)){l=-1,u=-1;for(let e=i;e<n;e++){let t=this._computeIndentLevel(e);if(t>=0){l=e,u=t;break}}}o[t]=this._getIndentLevelForWhitespaceLine(a,c,u)}return o}_getIndentLevelForWhitespaceLine(e,t,n){let r=this.textModel.getOptions();return t===-1||n===-1?0:t<n?1+Math.floor(t/r.indentSize):t===n||e?Math.ceil(n/r.indentSize):1+Math.floor(n/r.indentSize)}},Zv=class{constructor(){this.activeClassName=`indent-active`}getInlineClassName(e,t,n){return this.getInlineClassNameOfLevel(n?t:e)}getInlineClassNameOfLevel(e){return`bracket-indent-guide lvl-${e%30}`}},ole=class extends sv{constructor(e){super(),this._context=e,this._primaryPosition=null;let t=this._context.configuration.options,n=t.get(166),r=t.get(59);this._spaceWidth=r.spaceWidth,this._maxIndentLeft=n.wrappingColumn===-1?-1:n.wrappingColumn*r.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(22),this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options,n=t.get(166),r=t.get(59);return this._spaceWidth=r.spaceWidth,this._maxIndentLeft=n.wrappingColumn===-1?-1:n.wrappingColumn*r.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(22),!0}onCursorStateChanged(e){let t=e.selections[0].getPosition();return this._primaryPosition?.equals(t)?!1:(this._primaryPosition=t,!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){if(!this._bracketPairGuideOptions.indentation&&this._bracketPairGuideOptions.bracketPairs===!1){this._renderResult=null;return}let t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,r=e.scrollWidth,i=this._primaryPosition,a=this.getGuidesByLine(t,Math.min(n+1,this._context.viewModel.getLineCount()),i),o=[];for(let i=t;i<=n;i++){let n=i-t,s=a[n],c=``,l=e.visibleRangeForPosition(new F(i,1))?.left??0;for(let t of s){let n=t.column===-1?l+(t.visibleColumn-1)*this._spaceWidth:e.visibleRangeForPosition(new F(i,t.column)).left;if(n>r||this._maxIndentLeft>0&&n>this._maxIndentLeft)break;let a=t.horizontalLine?t.horizontalLine.top?`horizontal-top`:`horizontal-bottom`:`vertical`,o=t.horizontalLine?(e.visibleRangeForPosition(new F(i,t.horizontalLine.endColumn))?.left??n+this._spaceWidth)-n:this._spaceWidth;c+=`<div class="core-guide ${t.className} ${a}" style="left:${n}px;width:${o}px"></div>`}o[n]=c}this._renderResult=o}getGuidesByLine(e,t,n){let r=this._bracketPairGuideOptions.bracketPairs===!1?null:this._context.viewModel.getBracketGuidesInRangeByLine(e,t,n,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?Jv.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal===`active`?Jv.EnabledForActive:Jv.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}),i=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null,a=0,o=0,s=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&n){let r=this._context.viewModel.getActiveIndentGuide(n.lineNumber,e,t);a=r.startLineNumber,o=r.endLineNumber,s=r.indent}let{indentSize:c}=this._context.viewModel.model.getOptions(),l=[];for(let n=e;n<=t;n++){let t=[];l.push(t);let u=r?r[n-e]:[],d=new Ua(u),f=i?i[n-e]:0;for(let e=1;e<=f;e++){let r=(e-1)*c+1,i=(this._bracketPairGuideOptions.highlightActiveIndentation===`always`||u.length===0)&&a<=n&&n<=o&&e===s;t.push(...d.takeWhile(e=>e.visibleColumn<r)||[]);let l=d.peek();(!l||l.visibleColumn!==r||l.horizontalLine)&&t.push(new Yv(r,-1,`core-guide-indent lvl-${(e-1)%30}`+(i?` indent-active`:``),null,-1,-1))}t.push(...d.takeWhile(e=>!0)||[])}return l}render(e,t){if(!this._renderResult)return``;let n=t-e;return n<0||n>=this._renderResult.length?``:this._renderResult[n]}};function Qv(e){if(!(e&&e.isTransparent()))return e}pv((e,t)=>{let n=[{bracketColor:kv,guideColor:Nce,guideColorActive:zce},{bracketColor:Av,guideColor:Pce,guideColorActive:Bce},{bracketColor:jv,guideColor:Fce,guideColorActive:Vce},{bracketColor:Mv,guideColor:Ice,guideColorActive:Hce},{bracketColor:Nv,guideColor:Lce,guideColorActive:Uce},{bracketColor:Pv,guideColor:Rce,guideColorActive:Wce}],r=new Zv,i=[{indentColor:Ev,indentColorActive:Dv},{indentColor:pce,indentColorActive:vce},{indentColor:mce,indentColorActive:yce},{indentColor:hce,indentColorActive:bce},{indentColor:gce,indentColorActive:xce},{indentColor:_ce,indentColorActive:Sce}],a=n.map(t=>{let n=e.getColor(t.bracketColor),r=e.getColor(t.guideColor),i=e.getColor(t.guideColorActive),a=Qv(Qv(r)??n?.transparent(.3)),o=Qv(Qv(i)??n);if(!(!a||!o))return{guideColor:a,guideColorActive:o}}).filter(Pt),o=i.map(t=>{let n=e.getColor(t.indentColor),r=e.getColor(t.indentColorActive),i=Qv(n),a=Qv(r);if(!(!i||!a))return{indentColor:i,indentColorActive:a}}).filter(Pt);if(a.length>0){for(let e=0;e<30;e++){let n=a[e%a.length];t.addRule(`.monaco-editor .${r.getInlineClassNameOfLevel(e).replace(/ /g,`.`)} { --guide-color: ${n.guideColor}; --guide-color-active: ${n.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.${r.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),t.addRule(`.monaco-editor .horizontal-top.${r.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),t.addRule(`.monaco-editor .horizontal-bottom.${r.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(o.length>0){for(let e=0;e<30;e++){let n=o[e%o.length];t.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${e} { --indent-color: ${n.indentColor}; --indent-color-active: ${n.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 $v=class e extends sv{static{this.CLASS_NAME=`line-numbers`}constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new F(1,1),this._renderResult=null,this._activeModelLineNumber=1,this._context.addEventHandler(this)}_readConfig(){let e=this._context.configuration.options;this._lineHeight=e.get(75);let t=e.get(76);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(109);let n=e.get(165);this._lineNumbersLeft=n.lineNumbersLeft,this._lineNumbersWidth=n.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){let t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let n=!1;return this._activeModelLineNumber!==this._lastCursorModelPosition.lineNumber&&(this._activeModelLineNumber=this._lastCursorModelPosition.lineNumber,n=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(n=!0),n}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}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){let t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new F(e,1));if(t.column!==1)return``;let n=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(n);if(this._renderLineNumbers===2){let e=Math.abs(this._lastCursorModelPosition.lineNumber-n);return e===0?`<span class="relative-current-line-number">`+n+`</span>`:String(e)}return this._renderLineNumbers===3?this._lastCursorModelPosition.lineNumber===n||n%10==0||n===this._context.viewModel.getLineCount()?String(n):``:String(n)}prepareRender(t){if(this._renderLineNumbers===0){this._renderResult=null;return}let n=en?this._lineHeight%2==0?` lh-even`:` lh-odd`:``,r=t.visibleRange.startLineNumber,i=t.visibleRange.endLineNumber,a=this._context.viewModel.getDecorationsInViewport(t.visibleRange).filter(e=>!!e.options.lineNumberClassName);a.sort((e,t)=>U.compareRangesUsingEnds(e.range,t.range));let o=0,s=this._context.viewModel.getLineCount(),c=[];for(let t=r;t<=i;t++){let i=t-r,l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new F(t,1)).lineNumber,u=this._getLineRenderLineNumber(t),d=``;for(;o<a.length&&a[o].range.endLineNumber<t;)o++;for(let e=o;e<a.length;e++){let{range:n,options:r}=a[e];n.startLineNumber<=t&&(d+=` `+r.lineNumberClassName)}if(!u&&!d){c[i]=``;continue}t===s&&this._context.viewModel.getLineLength(t)===0&&(this._renderFinalNewline===`off`&&(u=``),this._renderFinalNewline===`dimmed`&&(d+=` dimmed-line-number`)),l===this._activeModelLineNumber&&(d+=` active-line-number`),c[i]=`<div class="${e.CLASS_NAME}${n}${d}" style="left:${this._lineNumbersLeft}px;width:${this._lineNumbersWidth}px;">${u}</div>`}this._renderResult=c}render(e,t){if(!this._renderResult)return``;let n=t-e;return n<0||n>=this._renderResult.length?``:this._renderResult[n]}};pv((e,t)=>{let n=e.getColor(wv),r=e.getColor(Cce);r?t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${r}; }`):n&&t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n.transparent(.4)}; }`)});var ey=`monaco-mouse-cursor-text`,ty=class{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;let 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}},ny=class{constructor(e,t){this.themeType=t;let n=e.options,r=n.get(59);this.renderWhitespace=n.get(113),this.experimentalWhitespaceRendering=n.get(47),this.renderControlCharacters=n.get(108),this.spaceWidth=r.spaceWidth,this.middotWidth=r.middotWidth,this.wsmiddotWidth=r.wsmiddotWidth,this.useMonospaceOptimizations=r.isMonospace&&!n.get(40),this.canUseHalfwidthRightwardsArrow=r.canUseHalfwidthRightwardsArrow,this.lineHeight=n.get(75),this.stopRenderingLineAfter=n.get(133),this.fontLigatures=n.get(60),this.verticalScrollbarSize=n.get(117).verticalScrollbarSize,this.useGpu=n.get(46)===`on`}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.experimentalWhitespaceRendering===e.experimentalWhitespaceRendering&&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&&this.verticalScrollbarSize===e.verticalScrollbarSize&&this.useGpu===e.useGpu}},sle=class{constructor(){this._currentVisibleRange=new U(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}},cle=class{constructor(e,t,n,r,i,a,o){this.minimalReveal=e,this.lineNumber=t,this.startColumn=n,this.endColumn=r,this.startScrollTop=i,this.stopScrollTop=a,this.scrollType=o,this.type=`range`,this.minLineNumber=t,this.maxLineNumber=t}},lle=class{constructor(e,t,n,r,i){this.minimalReveal=e,this.selections=t,this.startScrollTop=n,this.stopScrollTop=r,this.scrollType=i,this.type=`selections`;let a=t[0].startLineNumber,o=t[0].endLineNumber;for(let e=1,n=t.length;e<n;e++){let n=t[e];a=Math.min(a,n.startLineNumber),o=Math.max(o,n.endLineNumber)}this.minLineNumber=a,this.maxLineNumber=o}},ule=class e extends yg{static{this.HORIZONTAL_EXTRA_PX=30}constructor(e,t,n){super(e);let r=this._context.configuration,i=this._context.configuration.options,a=i.get(59),o=i.get(166);this._lineHeight=i.get(75),this._typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this._isViewportWrapping=o.isViewportWrapping,this._revealHorizontalRightPadding=i.get(114),this._cursorSurroundingLines=i.get(35),this._cursorSurroundingLinesStyle=i.get(36),this._canUseLayerHinting=!i.get(39),this._viewLineOptions=new ny(r,this._context.theme.type),this._linesContent=n,this._textRangeRestingSpot=document.createElement(`div`),this._visibleLines=new q_(this._context,{createLine:()=>new Hg(t,this._viewLineOptions)}),this.domNode=this._visibleLines.domNode,bg.write(this.domNode,8),this.domNode.setClassName(`view-lines ${ey}`),ap(this.domNode,a),this._maxLineWidth=0,this._asyncUpdateLineWidths=new mr(()=>{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new mr(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new sle,this._horizontalRevealRequest=null,this._stickyScrollEnabled=i.get(131).enabled,this._maxNumberStickyLines=i.get(131).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(166)&&(this._maxLineWidth=0);let t=this._context.configuration.options,n=t.get(59),r=t.get(166);return this._lineHeight=t.get(75),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._isViewportWrapping=r.isViewportWrapping,this._revealHorizontalRightPadding=t.get(114),this._cursorSurroundingLines=t.get(35),this._cursorSurroundingLinesStyle=t.get(36),this._canUseLayerHinting=!t.get(39),this._stickyScrollEnabled=t.get(131).enabled,this._maxNumberStickyLines=t.get(131).maxLineCount,ap(this.domNode,n),this._onOptionsMaybeChanged(),e.hasChanged(165)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){let e=this._context.configuration,t=new ny(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;let e=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let t=e;t<=n;t++)this._visibleLines.getVisibleLine(t).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){let t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber(),r=!1;for(let e=t;e<=n;e++)r=this._visibleLines.getVisibleLine(e).onSelectionChanged()||r;return r}onDecorationsChanged(e){{let e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let n=e;n<=t;n++)this._visibleLines.getVisibleLine(n).onDecorationsChanged()}return!0}onFlushed(e){let t=this._visibleLines.onFlushed(e,this._viewLineOptions.useGpu);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){let t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(t===-1)return!1;let n=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?n={scrollTop:n.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new cle(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new lle(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;let r=Math.abs(this._context.viewLayout.getCurrentScrollTop()-n.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(n,r),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){let t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),n=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTop<t||e.scrollTop>n)&&(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){let n=this._getViewLineDomNode(e);if(n===null)return null;let r=this._getLineNumberFor(n);if(r===-1||r<1||r>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(r)===1)return new F(r,1);let i=this._visibleLines.getStartLineNumber(),a=this._visibleLines.getEndLineNumber();if(r<i||r>a)return null;let o=this._visibleLines.getVisibleLine(r).getColumnOfNodeOffset(e,t),s=this._context.viewModel.getLineMinColumn(r);return o<s&&(o=s),new F(r,o)}_getViewLineDomNode(e){for(;e&&e.nodeType===1;){if(e.className===Hg.CLASS_NAME)return e;e=e.parentElement}return null}_getLineNumberFor(e){let t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let r=t;r<=n;r++)if(e===this._visibleLines.getVisibleLine(r).getDomNode())return r;return-1}getLineWidth(e){let t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();if(e<t||e>n)return-1;let r=new ty(this.domNode.domNode,this._textRangeRestingSpot),i=this._visibleLines.getVisibleLine(e).getWidth(r);return this._updateLineWidthsSlowIfDomDidLayout(r),i}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;let n=e.endLineNumber,r=U.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!r)return null;let i=[],a=0,o=new ty(this.domNode.domNode,this._textRangeRestingSpot),s=0;t&&(s=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new F(r.startLineNumber,1)).lineNumber);let c=this._visibleLines.getStartLineNumber(),l=this._visibleLines.getEndLineNumber();for(let e=r.startLineNumber;e<=r.endLineNumber;e++){if(e<c||e>l)continue;let u=e===r.startLineNumber?r.startColumn:1,d=e!==n,f=d?this._context.viewModel.getLineMaxColumn(e):r.endColumn,p=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,u,f,o);if(p){if(t&&e<n){let t=s;if(s=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new F(e+1,1)).lineNumber,t!==s){let e=p.ranges[p.ranges.length-1];e.width+=this._typicalHalfwidthCharacterWidth,this._context.viewModel.getTextDirection(t)===Qu.RTL&&(e.left-=this._typicalHalfwidthCharacterWidth)}}i[a++]=new xg(p.outsideRenderedLine,e,Sg.from(p.ranges),d)}}return this._updateLineWidthsSlowIfDomDidLayout(o),a===0?null:i}_visibleRangesForLineRange(e,t,n){if(this.shouldRender()||e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber())return null;let r=new ty(this.domNode.domNode,this._textRangeRestingSpot),i=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,n,r);return this._updateLineWidthsSlowIfDomDidLayout(r),i}_lineIsRenderedRTL(e){return e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber()?!1:this._visibleLines.getVisibleLine(e).isRenderedRTL()}visibleRangeForPosition(e){let t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new wg(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){let t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber(),r=1,i=!0;for(let a=t;a<=n;a++){let t=this._visibleLines.getVisibleLine(a);if(e&&!t.getWidthIsFast()){i=!1;continue}r=Math.max(r,t.getWidth(null))}return i&&t===1&&n===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(r),i}_checkMonospaceFontAssumptions(){let e=-1,t=-1,n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let i=n;i<=r;i++){let n=this._visibleLines.getVisibleLine(i);if(n.needsMonospaceFontCheck()){let r=n.getWidth(null);r>t&&(t=r,e=i)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let e=n;e<=r;e++)this._visibleLines.getVisibleLine(e).onMonospaceAssumptionsInvalidated()}prepareRender(){throw Error(`Not supported`)}render(){throw 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){let t=this._horizontalRevealRequest;if(e.startLineNumber<=t.minLineNumber&&t.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();let e=this._computeScrollLeftToReveal(t);e&&(!this._isViewportWrapping&&!e.hasRTL&&this._ensureMaxLineWidth(e.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:e.scrollLeft},t.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),en&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){let e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let n=e;n<=t;n++)if(this._visibleLines.getVisibleLine(n).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain(`strict`);let t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){let t=Math.ceil(e);this._maxLineWidth<t&&(this._maxLineWidth=t,this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth))}_computeScrollTopToRevealRange(e,t,n,r,i,a){let o=e.top,s=e.height,c=o+s,l,u,d;if(i&&i.length>0){let e=i[0].startLineNumber,t=i[0].endLineNumber;for(let n=1,r=i.length;n<r;n++){let r=i[n];e=Math.min(e,r.startLineNumber),t=Math.max(t,r.endLineNumber)}l=!1,u=this._context.viewLayout.getVerticalOffsetForLineNumber(e),d=this._context.viewLayout.getVerticalOffsetForLineNumber(t)+this._lineHeight}else if(r)l=!0,u=this._context.viewLayout.getVerticalOffsetForLineNumber(r.startLineNumber),d=this._context.viewLayout.getVerticalOffsetForLineNumber(r.endLineNumber)+this._lineHeight;else return-1;let f=(t===`mouse`||n)&&this._cursorSurroundingLinesStyle===`default`,p=0,m=0;if(f)n||(p=this._lineHeight);else{let e=s/this._lineHeight,t=Math.max(this._cursorSurroundingLines,this._stickyScrollEnabled?this._maxNumberStickyLines:0),n=Math.min(e/2,t);p=n*this._lineHeight,m=Math.max(0,n-1)*this._lineHeight}n||(a===0||a===4)&&(m+=this._lineHeight),u-=p,d+=m;let h;if(d-u>s){if(!l)return-1;h=u}else if(a===5||a===6)if(a===6&&o<=u&&d<=c)h=o;else{let e=Math.max(5*this._lineHeight,s*.2),t=u-e,n=d-s;h=Math.max(n,t)}else if(a===1||a===2)if(a===2&&o<=u&&d<=c)h=o;else{let e=(u+d)/2;h=Math.max(0,e-s/2)}else h=this._computeMinimumScrolling(o,c,u,d,a===3,a===4);return h}_computeScrollLeftToReveal(t){let n=this._context.viewLayout.getCurrentViewport(),r=this._context.configuration.options.get(165),i=n.left,a=i+n.width-r.verticalScrollbarWidth,o=1073741824,s=0,c=!1;if(t.type===`range`){c=this._lineIsRenderedRTL(t.lineNumber);let e=this._visibleRangesForLineRange(t.lineNumber,t.startColumn,t.endColumn);if(!e)return null;for(let t of e.ranges)o=Math.min(o,Math.round(t.left)),s=Math.max(s,Math.round(t.left+t.width))}else for(let e of t.selections){if(e.startLineNumber!==e.endLineNumber)return null;let t=this._visibleRangesForLineRange(e.startLineNumber,e.startColumn,e.endColumn);if(c||=this._lineIsRenderedRTL(e.startLineNumber),!t)return null;for(let e of t.ranges)o=Math.min(o,Math.round(e.left)),s=Math.max(s,Math.round(e.left+e.width))}return t.minimalReveal||(o=Math.max(0,o-e.HORIZONTAL_EXTRA_PX),s+=this._revealHorizontalRightPadding),t.type===`selections`&&s-o>n.width?null:{scrollLeft:this._computeMinimumScrolling(i,a,o,s),maxHorizontalOffset:s,hasRTL:c}}_computeMinimumScrolling(e,t,n,r,i,a){e|=0,t|=0,n|=0,r|=0,i=!!i,a=!!a;let o=t-e;if(r-n<o){if(i)return n;if(a)return Math.max(0,r-o);if(n<e)return n;if(r>t)return Math.max(0,r-o)}else return n;return e}},dle=class extends Lv{constructor(e){super(),this._context=e;let t=this._context.configuration.options.get(165);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){let t=this._context.configuration.options.get(165);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){let t=e.getDecorationsInViewport(),n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e],a=i.options.linesDecorationsClassName,o=i.options.zIndex;a&&(n[r++]=new Iv(i.range.startLineNumber,i.range.endLineNumber,a,i.options.linesDecorationsTooltip??null,o));let s=i.options.firstLineDecorationClassName;s&&(n[r++]=new Iv(i.range.startLineNumber,i.range.startLineNumber,s,i.options.linesDecorationsTooltip??null,o))}return n}prepareRender(e){let t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,r=this._render(t,n,this._getDecorations(e)),i=this._decorationsLeft.toString(),a=this._decorationsWidth.toString(),o=`" style="left:`+i+`px;width:`+a+`px;"></div>`,s=[];for(let e=t;e<=n;e++){let n=e-t,i=r[n].getDecorations(),a=``;for(let e of i){let t=`<div class="cldr `+e.className;e.tooltip!==null&&(t+=`" title="`+e.tooltip),t+=o,a+=t}s[n]=a}this._renderResult=s}render(e,t){return this._renderResult?this._renderResult[t-e]:``}},ry=class e extends yg{static{this.CLASS_NAME=`glyph-margin`}static{this.OUTER_CLASS_NAME=`margin`}constructor(t){super(t);let n=this._context.configuration.options,r=n.get(165);this._canUseLayerHinting=!n.get(39),this._contentLeft=r.contentLeft,this._glyphMarginLeft=r.glyphMarginLeft,this._glyphMarginWidth=r.glyphMarginWidth,this._domNode=ip(document.createElement(`div`)),this._domNode.setClassName(e.OUTER_CLASS_NAME),this._domNode.setPosition(`absolute`),this._domNode.setAttribute(`role`,`presentation`),this._domNode.setAttribute(`aria-hidden`,`true`),this._glyphMarginBackgroundDomNode=ip(document.createElement(`div`)),this._glyphMarginBackgroundDomNode.setClassName(e.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){let t=this._context.configuration.options,n=t.get(165);return this._canUseLayerHinting=!t.get(39),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain(`strict`);let t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);let n=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(n),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(n)}},fle=class extends Lv{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){let t=e.getDecorationsInViewport(),n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e],a=i.options.marginClassName,o=i.options.zIndex;a&&(n[r++]=new Iv(i.range.startLineNumber,i.range.endLineNumber,a,null,o))}return n}prepareRender(e){let t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,r=this._render(t,n,this._getDecorations(e)),i=[];for(let e=t;e<=n;e++){let n=e-t,a=r[n].getDecorations(),o=``;for(let e of a)o+=`<div class="cmdr `+e.className+`" style=""></div>`;i[n]=o}this._renderResult=i}render(e,t){return this._renderResult?this._renderResult[t-e]:``}},iy=class e{static{this.Empty=new e(0,0,0,0)}constructor(t,n,r,i){this._rgba8Brand=void 0,this.r=e._clamp(t),this.g=e._clamp(n),this.b=e._clamp(r),this.a=e._clamp(i)}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:e|0}},ple=class{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new k,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]),T(()=>{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){this._factories.get(e)?.dispose();let n=new mle(this,e,t);return this._factories.set(e,n),T(()=>{let t=this._factories.get(e);!t||t!==n||(this._factories.delete(e),t.dispose())})}async getOrCreate(e){let t=this.get(e);if(t)return t;let n=this._factories.get(e);return!n||n.isResolved?null:(await n.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;let 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}},mle=class extends D{get isResolved(){return this._isResolved}constructor(e,t,n){super(),this._registry=e,this._languageId=t,this._factory=n,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||=this._create(),this._resolvePromise}async _create(){let e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}},ay=class{constructor(e,t,n){this.offset=e,this.type=t,this.language=n,this._tokenBrand=void 0}toString(){return`(`+this.offset+`, `+this.type+`)`}},oy=class{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}},sy=class{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}},cy;(function(e){e[e.Increase=0]=`Increase`,e[e.Decrease=1]=`Decrease`})(cy||={});var ly;(function(e){let t=new Map;t.set(0,L.symbolMethod),t.set(1,L.symbolFunction),t.set(2,L.symbolConstructor),t.set(3,L.symbolField),t.set(4,L.symbolVariable),t.set(5,L.symbolClass),t.set(6,L.symbolStruct),t.set(7,L.symbolInterface),t.set(8,L.symbolModule),t.set(9,L.symbolProperty),t.set(10,L.symbolEvent),t.set(11,L.symbolOperator),t.set(12,L.symbolUnit),t.set(13,L.symbolValue),t.set(15,L.symbolEnum),t.set(14,L.symbolConstant),t.set(15,L.symbolEnum),t.set(16,L.symbolEnumMember),t.set(17,L.symbolKeyword),t.set(28,L.symbolSnippet),t.set(18,L.symbolText),t.set(19,L.symbolColor),t.set(20,L.symbolFile),t.set(21,L.symbolReference),t.set(22,L.symbolCustomColor),t.set(23,L.symbolFolder),t.set(24,L.symbolTypeParameter),t.set(25,L.account),t.set(26,L.issues),t.set(27,L.tools);function n(e){let n=t.get(e);return n||=(console.info(`No codicon found for CompletionItemKind `+e),L.symbolProperty),n}e.toIcon=n;function r(e){switch(e){case 0:return C(728,`Method`);case 1:return C(729,`Function`);case 2:return C(730,`Constructor`);case 3:return C(731,`Field`);case 4:return C(732,`Variable`);case 5:return C(733,`Class`);case 6:return C(734,`Struct`);case 7:return C(735,`Interface`);case 8:return C(736,`Module`);case 9:return C(737,`Property`);case 10:return C(738,`Event`);case 11:return C(739,`Operator`);case 12:return C(740,`Unit`);case 13:return C(741,`Value`);case 14:return C(742,`Constant`);case 15:return C(743,`Enum`);case 16:return C(744,`Enum Member`);case 17:return C(745,`Keyword`);case 18:return C(746,`Text`);case 19:return C(747,`Color`);case 20:return C(748,`File`);case 21:return C(749,`Reference`);case 22:return C(750,`Custom Color`);case 23:return C(751,`Folder`);case 24:return C(752,`Type Parameter`);case 25:return C(753,`User`);case 26:return C(754,`Issue`);case 27:return C(755,`Tool`);case 28:return C(756,`Snippet`);default:return``}}e.toLabel=r;let 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`,28),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),i.set(`tool`,27);function a(e,t){let n=i.get(e);return n===void 0&&!t&&(n=9),n}e.fromString=a})(ly||={});var uy;(function(e){e[e.Automatic=0]=`Automatic`,e[e.Explicit=1]=`Explicit`})(uy||={});var dy=class{constructor(e,t,n,r){this.range=e,this.text=t,this.completionKind=n,this.isSnippetText=r}equals(e){return U.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}},fy;(function(e){e[e.Code=1]=`Code`,e[e.Label=2]=`Label`})(fy||={});var py=class e{static fromExtensionId(t){return new e(t,void 0,void 0)}constructor(e,t,n){this.extensionId=e,this.extensionVersion=t,this.providerId=n}toString(){let e=``;return this.extensionId&&(e+=this.extensionId),this.extensionVersion&&(e+=`@${this.extensionVersion}`),this.providerId&&(e+=`:${this.providerId}`),e.length===0&&(e=`unknown`),e}toStringWithoutVersion(){let e=``;return this.extensionId&&(e+=this.extensionId),this.providerId&&(e+=`:${this.providerId}`),e}},my;(function(e){e[e.Accepted=0]=`Accepted`,e[e.Rejected=1]=`Rejected`,e[e.Ignored=2]=`Ignored`})(my||={});var hy;(function(e){e[e.Automatic=0]=`Automatic`,e[e.PasteAs=1]=`PasteAs`})(hy||={});var gy;(function(e){e[e.Invoke=1]=`Invoke`,e[e.TriggerCharacter=2]=`TriggerCharacter`,e[e.ContentChange=3]=`ContentChange`})(gy||={});var _y;(function(e){e[e.Text=0]=`Text`,e[e.Read=1]=`Read`,e[e.Write=2]=`Write`})(_y||={});function hle(e){return!!e&&Vi.isUri(e.uri)&&U.isIRange(e.range)&&(U.isIRange(e.originSelectionRange)||U.isIRange(e.targetSelectionRange))}var gle={17:C(757,`array`),16:C(758,`boolean`),4:C(759,`class`),13:C(760,`constant`),8:C(761,`constructor`),9:C(762,`enumeration`),21:C(763,`enumeration member`),23:C(764,`event`),7:C(765,`field`),0:C(766,`file`),11:C(767,`function`),10:C(768,`interface`),19:C(769,`key`),5:C(770,`method`),1:C(771,`module`),2:C(772,`namespace`),20:C(773,`null`),15:C(774,`number`),18:C(775,`object`),24:C(776,`operator`),3:C(777,`package`),6:C(778,`property`),14:C(779,`string`),22:C(780,`struct`),25:C(781,`type parameter`),12:C(782,`variable`)};function _le(e,t){return C(783,`{0} ({1})`,e,gle[t])}var vy;(function(e){let t=new Map;t.set(0,L.symbolFile),t.set(1,L.symbolModule),t.set(2,L.symbolNamespace),t.set(3,L.symbolPackage),t.set(4,L.symbolClass),t.set(5,L.symbolMethod),t.set(6,L.symbolProperty),t.set(7,L.symbolField),t.set(8,L.symbolConstructor),t.set(9,L.symbolEnum),t.set(10,L.symbolInterface),t.set(11,L.symbolFunction),t.set(12,L.symbolVariable),t.set(13,L.symbolConstant),t.set(14,L.symbolString),t.set(15,L.symbolNumber),t.set(16,L.symbolBoolean),t.set(17,L.symbolArray),t.set(18,L.symbolObject),t.set(19,L.symbolKey),t.set(20,L.symbolNull),t.set(21,L.symbolEnumMember),t.set(22,L.symbolStruct),t.set(23,L.symbolEvent),t.set(24,L.symbolOperator),t.set(25,L.symbolTypeParameter);function n(e){let n=t.get(e);return n||=(console.info(`No codicon found for SymbolKind `+e),L.symbolProperty),n}e.toIcon=n;let r=new Map;r.set(0,20),r.set(1,8),r.set(2,8),r.set(3,8),r.set(4,5),r.set(5,0),r.set(6,9),r.set(7,3),r.set(8,2),r.set(9,15),r.set(10,7),r.set(11,1),r.set(12,4),r.set(13,14),r.set(14,18),r.set(15,13),r.set(16,13),r.set(17,13),r.set(18,13),r.set(19,17),r.set(20,13),r.set(21,16),r.set(22,6),r.set(23,10),r.set(24,11),r.set(25,24);function i(e){let t=r.get(e);return t===void 0&&(console.info(`No completion kind found for SymbolKind `+e),t=20),t}e.toCompletionKind=i})(vy||={});var yy=class e{static{this.Comment=new e(`comment`)}static{this.Imports=new e(`imports`)}static{this.Region=new e(`region`)}static fromValue(t){switch(t){case`comment`:return e.Comment;case`imports`:return e.Imports;case`region`:return e.Region}return new e(t)}constructor(e){this.value=e}},by;(function(e){e[e.AIGenerated=1]=`AIGenerated`})(by||={});var xy;(function(e){e[e.Invoke=0]=`Invoke`,e[e.Automatic=1]=`Automatic`})(xy||={});var Sy;(function(e){function t(e){return!e||typeof e!=`object`?!1:typeof e.id==`string`&&typeof e.title==`string`}e.is=t})(Sy||={});var Cy;(function(e){e[e.Type=1]=`Type`,e[e.Parameter=2]=`Parameter`})(Cy||={});var vle=class{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||=this.createSupport(),this._tokenizationSupport}},wy=new ple,Ty=class e extends D{static{this._INSTANCE=null}static getInstance(){return this._INSTANCE||=Pn(new e),this._INSTANCE}constructor(){super(),this._onDidChange=new k,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(wy.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){let e=wy.getColorMap();if(!e){this._colors=[iy.Empty],this._backgroundIsLight=!0;return}this._colors=[iy.Empty];for(let t=1;t<e.length;t++){let n=e[t].rgba;this._colors[t]=new iy(n.r,n.g,n.b,Math.round(n.a*255))}let 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}},yle=(()=>{let e=[];for(let t=32;t<=126;t++)e.push(t);return e.push(65533),e})(),ble=(e,t)=>(e-=32,e<0||e>96?t<=2?(e+96)%96:95:e),Ey=class e{constructor(t,n){this.scale=n,this._minimapCharRendererBrand=void 0,this.charDataNormal=e.soften(t,12/15),this.charDataLight=e.soften(t,50/60)}static soften(e,t){let n=new Uint8ClampedArray(e.length);for(let r=0,i=e.length;r<i;r++)n[r]=Fu(e[r]*t);return n}renderChar(e,t,n,r,i,a,o,s,c,l,u){let d=1*this.scale,f=2*this.scale,p=u?1:f;if(t+d>e.width||n+p>e.height){console.warn(`bad render request outside image data`);return}let m=l?this.charDataLight:this.charDataNormal,h=ble(r,c),g=e.width*4,_=o.r,v=o.g,y=o.b,b=i.r-_,x=i.g-v,S=i.b-y,ee=Math.max(a,s),te=e.data,ne=h*d*f,re=n*g+t*4;for(let e=0;e<p;e++){let e=re;for(let t=0;t<d;t++){let t=m[ne++]/255*(a/255);te[e++]=_+b*t,te[e++]=v+x*t,te[e++]=y+S*t,te[e++]=ee}re+=g}}blockRenderChar(e,t,n,r,i,a,o,s){let c=1*this.scale,l=2*this.scale,u=s?1:l;if(t+c>e.width||n+u>e.height){console.warn(`bad render request outside image data`);return}let d=e.width*4,f=i/255*.5,p=a.r,m=a.g,h=a.b,g=r.r-p,_=r.g-m,v=r.b-h,y=p+g*f,b=m+_*f,x=h+v*f,S=Math.max(i,o),ee=e.data,te=n*d+t*4;for(let e=0;e<u;e++){let e=te;for(let t=0;t<c;t++)ee[e++]=y,ee[e++]=b,ee[e++]=x,ee[e++]=S;te+=d}}},Dy={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},Oy=e=>{let t=new Uint8ClampedArray(e.length/2);for(let n=0;n<e.length;n+=2)t[n>>1]=Dy[e[n]]<<4|Dy[e[n+1]]&15;return t},ky={1:Mn(()=>Oy(`0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792`)),2:Mn(()=>Oy(`000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126`))},xle=class e{static create(t,n){if(this.lastCreated&&t===this.lastCreated.scale&&n===this.lastFontFamily)return this.lastCreated;let r;return r=ky[t]?new Ey(ky[t](),t):e.createFromSampleData(e.createSampleData(n).data,t),this.lastFontFamily=n,this.lastCreated=r,r}static createSampleData(e){let t=document.createElement(`canvas`),n=t.getContext(`2d`);t.style.height=`16px`,t.height=16,t.width=960,t.style.width=`960px`,n.fillStyle=`#ffffff`,n.font=`bold 16px ${e}`,n.textBaseline=`middle`;let r=0;for(let e of yle)n.fillText(String.fromCharCode(e),r,16/2),r+=10;return n.getImageData(0,0,960,16)}static createFromSampleData(t,n){if(t.length!==640*96)throw Error(`Unexpected source in MinimapCharRenderer`);return new Ey(e._downsample(t,n),n)}static _downsampleChar(e,t,n,r,i){let a=1*i,o=2*i,s=r,c=0;for(let r=0;r<o;r++){let i=r/o*16,l=(r+1)/o*16;for(let r=0;r<a;r++){let o=r/a*10,u=(r+1)/a*10,d=0,f=0;for(let n=i;n<l;n++){let r=t+Math.floor(n)*3840,i=1-(n-Math.floor(n));for(let t=o;t<u;t++){let n=1-(t-Math.floor(t)),a=r+Math.floor(t)*4,o=n*i;f+=o,d+=e[a]*e[a+3]/255*o}}let p=d/f;c=Math.max(c,p),n[s++]=Fu(p)}}return c}static _downsample(e,t){let n=2*t*1*t,r=n*96,i=new Uint8ClampedArray(r),a=0,o=0,s=0;for(let r=0;r<96;r++)s=Math.max(s,this._downsampleChar(e,o,i,a,t)),a+=n,o+=40;if(s>0){let e=255/s;for(let t=0;t<r;t++)i[t]*=e}return i}},Sle=Qt?`"Segoe WPC", "Segoe UI", sans-serif`:$t?`-apple-system, BlinkMacSystemFont, sans-serif`:`system-ui, "Ubuntu", "Droid Sans", sans-serif`,Ay=class{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}};function jy(e,t){return!(t.options.hideInCommentTokens&&My(e,t)||t.options.hideInStringTokens&&Ny(e,t))}function My(e,t){return Py(e,t.range,e=>e===1)}function Ny(e,t){return Py(e,t.range,e=>e===2)}function Py(e,t,n){for(let r=t.startLineNumber;r<=t.endLineNumber;r++){let i=e.tokenization.getLineTokens(r),a=r===t.startLineNumber,o=r===t.endLineNumber,s=a?i.findTokenIndexAtOffset(t.startColumn-1):0;for(;s<i.getCount()&&!(o&&i.getStartOffset(s)>t.endColumn-1);){if(!n(i.getStandardTokenType(s)))return!1;s++}}return!0}var Cle=140,wle=2,Fy=class e{constructor(t,n,r){let i=t.options,a=i.get(163),o=i.get(165),s=o.minimap,c=i.get(59),l=i.get(81);this.renderMinimap=s.renderMinimap,this.size=l.size,this.minimapHeightIsEditorHeight=s.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=i.get(119),this.paddingTop=i.get(96).top,this.paddingBottom=i.get(96).bottom,this.showSlider=l.showSlider,this.autohide=l.autohide,this.pixelRatio=a,this.typicalHalfwidthCharacterWidth=c.typicalHalfwidthCharacterWidth,this.lineHeight=i.get(75),this.minimapLeft=s.minimapLeft,this.minimapWidth=s.minimapWidth,this.minimapHeight=o.height,this.canvasInnerWidth=s.minimapCanvasInnerWidth,this.canvasInnerHeight=s.minimapCanvasInnerHeight,this.canvasOuterWidth=s.minimapCanvasOuterWidth,this.canvasOuterHeight=s.minimapCanvasOuterHeight,this.isSampling=s.minimapIsSampling,this.editorHeight=o.height,this.fontScale=s.minimapScale,this.minimapLineHeight=s.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.sectionHeaderFontFamily=Sle,this.sectionHeaderFontSize=l.sectionHeaderFontSize*a,this.sectionHeaderLetterSpacing=l.sectionHeaderLetterSpacing,this.sectionHeaderFontColor=e._getSectionHeaderColor(n,r.getColor(1)),this.charRenderer=Mn(()=>xle.create(this.fontScale,c.fontFamily)),this.defaultBackgroundColor=r.getColor(2),this.backgroundColor=e._getMinimapBackground(n,this.defaultBackgroundColor),this.foregroundAlpha=e._getMinimapForegroundOpacity(n)}static _getMinimapBackground(e,t){let n=e.getColor(moe);return n?new iy(n.rgba.r,n.rgba.g,n.rgba.b,Math.round(255*n.rgba.a)):t}static _getMinimapForegroundOpacity(e){let t=e.getColor(hoe);return t?iy._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){let n=e.getColor(Jm);return n?new iy(n.rgba.r,n.rgba.g,n.rgba.b,Math.round(255*n.rgba.a)):t}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.sectionHeaderFontSize===e.sectionHeaderFontSize&&this.sectionHeaderLetterSpacing===e.sectionHeaderLetterSpacing&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}},Tle=class e{constructor(e,t,n,r,i,a,o,s,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=n,this._computedSliderRatio=r,this.sliderTop=i,this.sliderHeight=a,this.topPaddingLineCount=o,this.startLineNumber=s,this.endLineNumber=c}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){let t=Math.max(this.startLineNumber,e.startLineNumber),n=Math.min(this.endLineNumber,e.endLineNumber);return t>n?null:[t,n]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(t,n,r,i,a,o,s,c,l,u,d){let f=t.pixelRatio,p=t.minimapLineHeight,m=Math.floor(t.canvasInnerHeight/p),h=t.lineHeight;if(t.minimapHeightIsEditorHeight){let n=c*t.lineHeight+t.paddingTop+t.paddingBottom;t.scrollBeyondLastLine&&(n+=Math.max(0,a-t.lineHeight-t.paddingBottom));let r=Math.max(1,Math.floor(a*a/n)),i=Math.max(0,t.minimapHeight-r),o=i/(u-a),d=l*o,f=i>0,p=Math.floor(t.canvasInnerHeight/t.minimapLineHeight);return new e(l,u,f,o,d,r,Math.floor(t.paddingTop/t.lineHeight),1,Math.min(s,p))}let g;if(o&&r!==s){let e=r-n+1;g=Math.floor(e*p/f)}else{let e=a/h;g=Math.floor(e*p/f)}let _=Math.floor(t.paddingTop/h),v=Math.floor(t.paddingBottom/h);if(t.scrollBeyondLastLine){let e=a/h;v=Math.max(v,e-1)}let y;if(v>0){let e=a/h;y=(_+s+v-e-1)*p/f}else y=Math.max(0,(_+s)*p/f-g);y=Math.min(t.minimapHeight-g,y);let b=y/(u-a),x=l*b;if(m>=_+s+v)return new e(l,u,y>0,b,x,g,_,1,s);{let r;r=n>1?n+_:Math.max(1,l/h);let a,o=Math.max(1,Math.floor(r-x*f/p));o<_?(a=_-o+1,o=1):(a=0,o=Math.max(1,o-_)),d&&d.scrollHeight===u&&(d.scrollTop>l&&(o=Math.min(o,d.startLineNumber),a=Math.max(a,d.topPaddingLineCount)),d.scrollTop<l&&(o=Math.max(o,d.startLineNumber),a=Math.min(a,d.topPaddingLineCount)));let c=Math.min(s,o-a+m-1),v=(l-i)/h,y;return y=l>=t.paddingTop?(n-o+a+v)*p/f:l/t.paddingTop*(a+v)*p/f,new e(l,u,!0,b,y,g,a,o,c)}}},Iy=class e{static{this.INVALID=new e(-1)}constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}},Ly=class{constructor(e,t,n){this.renderedLayout=e,this._imageData=t,this._renderedLines=new K_({createLine:()=>Iy.INVALID}),this._renderedLines._set(e.startLineNumber,n)}linesEquals(e){if(!this.scrollEquals(e))return!1;let t=this._renderedLines._get().lines;for(let e=0,n=t.length;e<n;e++)if(t[e].dy===-1)return!1;return!0}scrollEquals(e){return this.renderedLayout.startLineNumber===e.startLineNumber&&this.renderedLayout.endLineNumber===e.endLineNumber}_get(){let 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)}},Ele=class e{constructor(t,n,r,i){this._backgroundFillData=e._createBackgroundFillData(n,r,i),this._buffers=[t.createImageData(n,r),t.createImageData(n,r)],this._lastUsedBuffer=0}getBuffer(){this._lastUsedBuffer=1-this._lastUsedBuffer;let e=this._buffers[this._lastUsedBuffer];return e.data.set(this._backgroundFillData),e}static _createBackgroundFillData(e,t,n){let r=n.r,i=n.g,a=n.b,o=n.a,s=new Uint8ClampedArray(e*t*4),c=0;for(let n=0;n<t;n++)for(let t=0;t<e;t++)s[c]=r,s[c+1]=i,s[c+2]=a,s[c+3]=o,c+=4;return s}},Ry=class e{static compute(t,n,r){if(t.renderMinimap===0||!t.isSampling)return[null,[]];let{minimapLineCount:i}=Bp.computeContainedMinimapLineCount({viewLineCount:n,scrollBeyondLastLine:t.scrollBeyondLastLine,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,height:t.editorHeight,lineHeight:t.lineHeight,pixelRatio:t.pixelRatio}),a=n/i,o=a/2;if(!r||r.minimapLines.length===0){let t=[];if(t[0]=1,i>1){for(let e=0,n=i-1;e<n;e++)t[e]=Math.round(e*a+o);t[i-1]=n}return[new e(a,t),[]]}let s=r.minimapLines,c=s.length,l=[],u=0,d=0,f=1,p=[],m=null;for(let e=0;e<i;e++){let t=Math.max(f,Math.round(e*a)),r=Math.max(t,Math.round((e+1)*a));for(;u<c&&s[u]<t;){if(p.length<10){let e=u+1+d;m&&m.type===`deleted`&&m._oldIndex===u-1?m.deleteToLineNumber++:(m={type:`deleted`,_oldIndex:u,deleteFromLineNumber:e,deleteToLineNumber:e},p.push(m)),d--}u++}let h;if(u<c&&s[u]<=r)h=s[u],u++;else if(h=e===0?1:e+1===i?n:Math.round(e*a+o),p.length<10){let t=u+1+d;m&&m.type===`inserted`&&m._i===e-1?m.insertToLineNumber++:(m={type:`inserted`,_i:e,insertFromLineNumber:t,insertToLineNumber:t},p.push(m)),d++}l[e]=h,f=h}if(p.length<10)for(;u<c;){let e=u+1+d;m&&m.type===`deleted`&&m._oldIndex===u-1?m.deleteToLineNumber++:(m={type:`deleted`,_oldIndex:u,deleteFromLineNumber:e,deleteToLineNumber:e},p.push(m)),d--,u++}else p=[{type:`flush`}];return[new e(a,l),p]}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 n=this.modelLineToMinimapLine(e)-1;for(;n>0&&this.minimapLines[n-1]>=e;)n--;let r=this.modelLineToMinimapLine(t)-1;for(;r+1<this.minimapLines.length&&this.minimapLines[r+1]<=t;)r++;if(n===r){let r=this.minimapLines[n];if(r<e||r>t)return null}return[n+1,r+1]}decorationLineRangeToMinimapLineRange(e,t){let n=this.modelLineToMinimapLine(e),r=this.modelLineToMinimapLine(t);return e!==t&&r===n&&(r===this.minimapLines.length?n>1&&n--:r++),[n,r]}onLinesDeleted(e){let t=e.toLineNumber-e.fromLineNumber+1,n=this.minimapLines.length,r=0;for(let i=this.minimapLines.length-1;i>=0&&!(this.minimapLines[i]<e.fromLineNumber);i--)this.minimapLines[i]<=e.toLineNumber?(this.minimapLines[i]=Math.max(1,e.fromLineNumber-1),n=Math.min(n,i),r=Math.max(r,i)):this.minimapLines[i]-=t;return[n,r]}onLinesInserted(e){let t=e.toLineNumber-e.fromLineNumber+1;for(let n=this.minimapLines.length-1;n>=0&&!(this.minimapLines[n]<e.fromLineNumber);n--)this.minimapLines[n]+=t}},Dle=class extends yg{constructor(e){super(e),this._sectionHeaderCache=new Sl(10,1.5),this.tokensColorTracker=Ty.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new Fy(this._context.configuration,this._context.theme,this.tokensColorTracker);let[t]=Ry.compute(this.options,this._context.viewModel.getLineCount(),null);this._samplingState=t,this._shouldCheckSampling=!1,this._actual=new Ole(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){let e=new Fy(this._context.configuration,this._context.theme,this.tokensColorTracker);return this.options.equals(e)?!1:(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():!1}onFlushed(e){return this._samplingState&&(this._shouldCheckSampling=!0),this._actual.onFlushed()}onLinesChanged(e){if(this._samplingState){let t=this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber,e.fromLineNumber+e.count-1);return t?this._actual.onLinesChanged(t[0],t[1]-t[0]+1):!1}else return this._actual.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){if(this._samplingState){let[t,n]=this._samplingState.onLinesDeleted(e);return t<=n&&this._actual.onLinesChanged(t+1,n-t+1),this._shouldCheckSampling=!0,!0}else 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(e)}onThemeChanged(e){return this._actual.onThemeChanged(),this._onOptionsMaybeChanged(),!0}onTokensChanged(e){if(this._samplingState){let t=[];for(let n of e.ranges){let e=this._samplingState.modelLineRangeToMinimapLineRange(n.fromLineNumber,n.toLineNumber);e&&t.push({fromLineNumber:e[0],toLineNumber:e[1]})}return t.length?this._actual.onTokensChanged(t):!1}else 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,n=e.visibleRange.endLineNumber;this._samplingState&&(t=this._samplingState.modelLineToMinimapLine(t),n=this._samplingState.modelLineToMinimapLine(n));let r={viewportContainsWhitespaceGaps:e.viewportData.whitespaceViewportData.length>0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:n,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(r)}_recreateLineSampling(){this._minimapSelections=null;let e=!!this._samplingState,[t,n]=Ry.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(let e of n)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();break}}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,n){if(this._samplingState){let r=[];for(let i=0,a=t-e+1;i<a;i++)n[i]?r[i]=this._context.viewModel.getViewLineData(this._samplingState.minimapLines[e+i-1]):r[i]=null;return r}return this._context.viewModel.getMinimapLinesRenderingData(e,t,n).data}getSelections(){if(this._minimapSelections===null)if(this._samplingState){this._minimapSelections=[];for(let e of this._selections){let[t,n]=this._samplingState.decorationLineRangeToMinimapLineRange(e.startLineNumber,e.endLineNumber);this._minimapSelections.push(new W(t,e.startColumn,n,e.endColumn))}}else this._minimapSelections=this._selections;return this._minimapSelections}getMinimapDecorationsInViewport(e,t){return this._getMinimapDecorationsInViewport(e,t).filter(e=>!e.options.minimap?.sectionHeaderStyle)}getSectionHeaderDecorationsInViewport(e,t){let n=this.options.sectionHeaderFontSize/this.options.minimapLineHeight;return e=Math.floor(Math.max(1,e-n)),this._getMinimapDecorationsInViewport(e,t).filter(e=>!!e.options.minimap?.sectionHeaderStyle)}_getMinimapDecorationsInViewport(e,t){let n;if(this._samplingState){let r=this._samplingState.minimapLines[e-1],i=this._samplingState.minimapLines[t-1];n=new U(r,1,i,this._context.viewModel.getLineMaxColumn(i))}else n=new U(e,1,t,this._context.viewModel.getLineMaxColumn(t));let r=this._context.viewModel.getMinimapDecorationsInRange(n);if(this._samplingState){let e=[];for(let t of r){if(!t.options.minimap)continue;let n=t.range,r=this._samplingState.modelLineToMinimapLine(n.startLineNumber),i=this._samplingState.modelLineToMinimapLine(n.endLineNumber);e.push(new Ay(new U(r,n.startColumn,i,n.endColumn),t.options))}return e}return r}getSectionHeaderText(e,t){let n=e.options.minimap?.sectionHeaderText;if(!n)return null;let r=this._sectionHeaderCache.get(n);if(r)return r;let i=t(n);return this._sectionHeaderCache.set(n,i),i}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange(`mouse`,!1,new U(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}},Ole=class e extends D{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._isMouseOverMinimap=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(Ih),this._domNode=ip(document.createElement(`div`)),bg.write(this._domNode,9),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition(`absolute`),this._domNode.setAttribute(`role`,`presentation`),this._domNode.setAttribute(`aria-hidden`,`true`),this._shadow=ip(document.createElement(`div`)),this._shadow.setClassName(`minimap-shadow-hidden`),this._domNode.appendChild(this._shadow),this._canvas=ip(document.createElement(`canvas`)),this._canvas.setPosition(`absolute`),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=ip(document.createElement(`canvas`)),this._decorationsCanvas.setPosition(`absolute`),this._decorationsCanvas.setClassName(`minimap-decorations-layer`),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=ip(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=ip(document.createElement(`div`)),this._sliderHorizontal.setPosition(`absolute`),this._sliderHorizontal.setClassName(`minimap-slider-horizontal`),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._hideDelayedScheduler=this._register(new mr(()=>this._hideImmediatelyIfMouseIsOutside(),500)),this._register($o(this._domNode.domNode,M.MOUSE_OVER,()=>{this._isMouseOverMinimap=!0})),this._register($o(this._domNode.domNode,M.MOUSE_LEAVE,()=>{this._isMouseOverMinimap=!1})),this._pointerDownListener=$o(this._domNode.domNode,M.POINTER_DOWN,e=>{e.preventDefault();let t=e.pointerType===`mouse`,n=e.button===0;if(this._model.options.renderMinimap!==0&&this._lastRenderData){if(this._model.options.size!==`proportional`){if(n&&this._lastRenderData){let t=ps(this._slider.domNode),n=t.top+t.height/2;this._startSliderDragging(e,n,this._lastRenderData.renderedLayout)}return}if(n||!t){let t=this._model.options.minimapLineHeight,n=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*e.offsetY,r=Math.floor(n/t)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;r=Math.min(r,this._model.getLineCount()),this._model.revealLineNumber(r)}}}),this._sliderPointerMoveMonitor=new hm,this._sliderPointerDownListener=$o(this._slider.domNode,M.POINTER_DOWN,e=>{e.preventDefault(),e.stopPropagation(),e.button===0&&this._lastRenderData&&this._startSliderDragging(e,e.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=i_.addTarget(this._domNode.domNode),this._sliderTouchStartListener=j(this._domNode.domNode,r_.Start,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName(`active`,!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(e))},{passive:!1}),this._sliderTouchMoveListener=j(this._domNode.domNode,r_.Change,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(e)},{passive:!1}),this._sliderTouchEndListener=$o(this._domNode.domNode,r_.End,e=>{e.preventDefault(),e.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName(`active`,!1)})}_hideSoon(){this._hideDelayedScheduler.cancel(),this._hideDelayedScheduler.schedule()}_hideImmediatelyIfMouseIsOutside(){if(this._isMouseOverMinimap){this._hideSoon();return}this._domNode.toggleClassName(`active`,!1)}_startSliderDragging(e,t,n){if(!e.target||!(e.target instanceof Element))return;let r=e.pageX;this._slider.toggleClassName(`active`,!0);let i=(e,i)=>{let a=ps(this._domNode.domNode),o=Math.min(Math.abs(i-r),Math.abs(i-a.left),Math.abs(i-a.left-a.width));if(Qt&&o>Cle){this._model.setScrollTop(n.scrollTop);return}let s=e-t;this._model.setScrollTop(n.getDesiredScrollTopFromDelta(s))};e.pageY!==t&&i(e.pageY,r),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>i(e.pageY,e.pageX),()=>{this._slider.toggleClassName(`active`,!1)})}scrollDueToTouchEvent(e){let t=this._domNode.domNode.getBoundingClientRect().top,n=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(n)}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(){let e=[`minimap`];return this._model.options.showSlider===`always`?e.push(`slider-always`):e.push(`slider-mouseover`),this._model.options.autohide===`mouseover`?e.push(`minimap-autohide-mouseover`):this._model.options.autohide===`scroll`&&e.push(`minimap-autohide-scroll`),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 Ele(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):!1}onLinesDeleted(e,t){return this._lastRenderData?.onLinesDeleted(e,t),!0}onLinesInserted(e,t){return this._lastRenderData?.onLinesInserted(e,t),!0}onScrollChanged(e){return this._model.options.autohide===`scroll`&&(e.scrollTopChanged||e.scrollHeightChanged)&&(this._domNode.toggleClassName(`active`,!0),this._hideSoon()),this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(Ih),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===0){this._shadow.setClassName(`minimap-shadow-hidden`),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName(`minimap-shadow-hidden`):this._shadow.setClassName(`minimap-shadow-visible`);let t=Tle.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;let t=this._model.getSelections();t.sort(U.compareRangesUsingStarts);let n=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);n.sort((e,t)=>(e.options.zIndex||0)-(t.options.zIndex||0));let{canvasInnerWidth:r,canvasInnerHeight:i}=this._model.options,a=this._model.options.minimapLineHeight,o=this._model.options.minimapCharWidth,s=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext(`2d`);c.clearRect(0,0,r,i);let l=new zy(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,l,e,a),this._renderDecorationsLineHighlights(c,n,l,e,a);let u=new zy(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,u,e,a,s,o,r),this._renderDecorationsHighlights(c,n,u,e,a,s,o,r),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,n,r,i){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let a=0,o=0;for(let s of t){let t=r.intersectWithViewport(s);if(!t)continue;let[c,l]=t;for(let e=c;e<=l;e++)n.set(e,!0);let u=r.getYForLineNumber(c,i),d=r.getYForLineNumber(l,i);o>=u?o=d:(o>a&&e.fillRect(8,a,e.canvas.width,o-a),a=u,o=d)}o>a&&e.fillRect(8,a,e.canvas.width,o-a)}_renderDecorationsLineHighlights(e,t,n,r,i){let a=new Map;for(let o=t.length-1;o>=0;o--){let s=t[o],c=s.options.minimap;if(!c||c.position!==1)continue;let l=r.intersectWithViewport(s.range);if(!l)continue;let[u,d]=l,f=c.getColor(this._theme.value);if(!f||f.isTransparent())continue;let p=a.get(f.toString());p||(p=f.transparent(.5).toString(),a.set(f.toString(),p)),e.fillStyle=p;for(let t=u;t<=d;t++){if(n.has(t))continue;n.set(t,!0);let a=r.getYForLineNumber(u,i);e.fillRect(8,a,e.canvas.width,i)}}}_renderSelectionsHighlights(e,t,n,r,i,a,o,s){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(let c of t){let t=r.intersectWithViewport(c);if(!t)continue;let[l,u]=t;for(let t=l;t<=u;t++)this.renderDecorationOnLine(e,n,c,this._selectionColor,r,t,i,i,a,o,s)}}_renderDecorationsHighlights(e,t,n,r,i,a,o,s){for(let c of t){let t=c.options.minimap;if(!t)continue;let l=r.intersectWithViewport(c.range);if(!l)continue;let[u,d]=l,f=t.getColor(this._theme.value);if(!(!f||f.isTransparent()))for(let l=u;l<=d;l++)switch(t.position){case 1:this.renderDecorationOnLine(e,n,c.range,f,r,l,i,i,a,o,s);continue;case 2:{let t=r.getYForLineNumber(l,i);this.renderDecoration(e,f,2,t,wle,i);continue}}}}renderDecorationOnLine(e,t,n,r,i,a,o,s,c,l,u){let d=i.getYForLineNumber(a,s);if(d+o<0||d>this._model.options.canvasInnerHeight)return;let{startLineNumber:f,endLineNumber:p}=n,m=f===a?n.startColumn:1,h=p===a?n.endColumn:this._model.getLineMaxColumn(a),g=this.getXOffsetForPosition(t,a,m,c,l,u),_=this.getXOffsetForPosition(t,a,h,c,l,u);this.renderDecoration(e,r,g,d,_-g,o)}getXOffsetForPosition(e,t,n,r,i,a){if(n===1)return 8;if((n-1)*i>=a)return a;let o=e.get(t);if(!o){let n=this._model.getLineContent(t);o=[8];let s=8;for(let e=1;e<n.length+1;e++){let t=n.charCodeAt(e-1),c=t===9?r*i:ci(t)?2*i:i,l=s+c;if(l>=a){o[e]=a;break}o[e]=l,s=l}e.set(t,o)}return n-1<o.length?o[n-1]:a}renderDecoration(e,t,n,r,i,a){e.fillStyle=t&&t.toString()||``,e.fillRect(n,r,i,a)}_renderSectionHeaders(t){let n=this._model.options.minimapLineHeight,r=this._model.options.sectionHeaderFontSize,i=this._model.options.sectionHeaderLetterSpacing,a=r*1.5,{canvasInnerWidth:o}=this._model.options,s=this._model.options.backgroundColor,c=`rgb(${s.r} ${s.g} ${s.b} / .7)`,l=this._model.options.sectionHeaderFontColor,u=`rgb(${l.r} ${l.g} ${l.b})`,d=u,f=this._decorationsCanvas.domNode.getContext(`2d`);f.letterSpacing=i+`px`,f.font=`500 `+r+`px `+this._model.options.sectionHeaderFontFamily,f.strokeStyle=d,f.lineWidth=.4;let p=this._model.getSectionHeaderDecorationsInViewport(t.startLineNumber,t.endLineNumber);p.sort((e,t)=>e.range.startLineNumber-t.range.startLineNumber);let m=e._fitSectionHeader.bind(null,f,o-8);for(let i of p){let s=t.getYForLineNumber(i.range.startLineNumber,n)+r,l=s-r,d=l+2,p=this._model.getSectionHeaderText(i,m);e._renderSectionLabel(f,p,i.options.minimap?.sectionHeaderStyle===2,c,u,o,l,a,s,d)}}static _fitSectionHeader(e,t,n){if(!n)return n;let r=e.measureText(n).width,i=e.measureText(`…`).width;if(r<=t||r<=i)return n;let a=n.length,o=r/n.length,s=Math.floor((t-i)/o)-1,c=Math.ceil(s/2);for(;c>0&&/\s/.test(n[c-1]);)--c;return n.substring(0,c)+`…`+n.substring(a-(s-c))}static _renderSectionLabel(e,t,n,r,i,a,o,s,c,l){t&&(e.fillStyle=r,e.fillRect(0,o,a,s),e.fillStyle=i,e.fillText(t,8,c)),n&&(e.beginPath(),e.moveTo(0,l),e.lineTo(a,l),e.closePath(),e.stroke())}renderLines(t){let n=t.startLineNumber,r=t.endLineNumber,i=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(t)){let e=this._lastRenderData._get();return new Ly(t,e.imageData,e.lines)}let a=this._getBuffer();if(!a)return null;let[o,s,c]=e._renderUntouchedLines(a,t.topPaddingLineCount,n,r,i,this._lastRenderData),l=this._model.getMinimapLinesRenderingData(n,r,c),u=this._model.getOptions().tabSize,d=this._model.options.defaultBackgroundColor,f=this._model.options.backgroundColor,p=this._model.options.foregroundAlpha,m=this._model.tokensColorTracker,h=m.backgroundIsLight(),g=this._model.options.renderMinimap,_=this._model.options.charRenderer(),v=this._model.options.fontScale,y=this._model.options.minimapCharWidth,b=(g===1?2:3)*v,x=i>b?Math.floor((i-b)/2):0,S=f.a/255,ee=new iy(Math.round((f.r-d.r)*S+d.r),Math.round((f.g-d.g)*S+d.g),Math.round((f.b-d.b)*S+d.b),255),te=t.topPaddingLineCount*i,ne=[];for(let t=0,o=r-n+1;t<o;t++)c[t]&&e._renderLine(a,ee,f.a,h,g,y,m,p,_,te,x,u,l[t],v,i),ne[t]=new Iy(te),te+=i;let re=o===-1?0:o,ie=(s===-1?a.height:s)-re;return this._canvas.domNode.getContext(`2d`).putImageData(a,0,0,0,re,a.width,ie),new Ly(t,a,ne)}static _renderUntouchedLines(e,t,n,r,i,a){let o=[];if(!a){for(let e=0,t=r-n+1;e<t;e++)o[e]=!0;return[-1,-1,o]}let s=a._get(),c=s.imageData.data,l=s.rendLineNumberStart,u=s.lines,d=u.length,f=e.width,p=e.data,m=(r-n+1)*i*f*4,h=-1,g=-1,_=-1,v=-1,y=-1,b=-1,x=t*i;for(let e=n;e<=r;e++){let t=e-n,r=e-l,a=r>=0&&r<d?u[r].dy:-1;if(a===-1){o[t]=!0,x+=i;continue}let s=a*f*4,S=(a+i)*f*4,ee=x*f*4,te=(x+i)*f*4;v===s&&b===ee?(v=S,b=te):(_!==-1&&(p.set(c.subarray(_,v),y),h===-1&&_===0&&_===y&&(h=v),g===-1&&v===m&&_===y&&(g=_)),_=s,v=S,y=ee,b=te),o[t]=!1,x+=i}return _!==-1&&(p.set(c.subarray(_,v),y),h===-1&&_===0&&_===y&&(h=v),g===-1&&v===m&&_===y&&(g=_)),[h===-1?-1:h/(f*4),g===-1?-1:g/(f*4),o]}static _renderLine(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){let h=f.content,g=f.tokens,_=e.width-a,v=m===1,y=8,b=0,x=0;for(let f=0,m=g.getCount();f<m;f++){let m=g.getEndOffset(f),S=g.getForeground(f),ee=o.getColor(S);for(;b<m;b++){if(y>_)return;let o=h.charCodeAt(b);if(o===9){let e=d-(b+x)%d;x+=e-1,y+=e*a}else if(o===32)y+=a;else{let d=ci(o)?2:1;for(let f=0;f<d;f++)if(i===2?c.blockRenderChar(e,y,l+u,ee,s,t,n,v):c.renderChar(e,y,l+u,o,ee,s,t,n,p,r,v),y+=a,y>_)return}}}}},zy=class{constructor(e,t,n){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=n,this._values=[];for(let e=0,t=this._endLineNumber-this._startLineNumber+1;e<t;e++)this._values[e]=n}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]}},kle=class extends yg{constructor(e,t){super(e),this._viewDomNode=t;let n=this._context.configuration.options.get(165);this._widgets={},this._verticalScrollbarWidth=n.verticalScrollbarWidth,this._minimapWidth=n.minimap.minimapWidth,this._horizontalScrollbarHeight=n.horizontalScrollbarHeight,this._editorHeight=n.height,this._editorWidth=n.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=ip(document.createElement(`div`)),bg.write(this._domNode,4),this._domNode.setClassName(`overlayWidgets`),this.overflowingOverlayWidgetsDomNode=ip(document.createElement(`div`)),bg.write(this.overflowingOverlayWidgetsDomNode,5),this.overflowingOverlayWidgetsDomNode.setClassName(`overflowingOverlayWidgets`)}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){let t=this._context.configuration.options.get(165);return this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,!0}_widgetCanOverflow(e){let t=this._context.configuration.options.get(4);return(e.allowEditorOverflow||!1)&&t}addWidget(e){let t=ip(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition(`absolute`),t.setAttribute(`widgetId`,e.getId()),this._widgetCanOverflow(e)?this.overflowingOverlayWidgetsDomNode.appendChild(t):this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){let n=this._widgets[e.getId()],r=t?t.preference:null,i=t?.stackOridinal;return n.preference===r&&n.stack===i?(this._updateMaxMinWidth(),!1):(n.preference=r,n.stack=i,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){let t=e.getId();if(this._widgets.hasOwnProperty(t)){let e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){let e=0,t=Object.keys(this._widgets);for(let n=0,r=t.length;n<r;n++){let r=t[n],i=this._widgets[r].widget.getMinContentWidthInPx?.();i!==void 0&&(e=Math.max(e,i))}this._context.viewLayout.setOverlayWidgetsMinWidth(e)}_renderWidget(e,t){let n=e.domNode;if(e.preference===null){n.setTop(``);return}let r=2*this._verticalScrollbarWidth+this._minimapWidth;if(e.preference===0||e.preference===1){if(e.preference===1){let e=n.domNode.clientHeight;n.setTop(this._editorHeight-e-2*this._horizontalScrollbarHeight)}else n.setTop(0);e.stack===void 0?n.setRight(r):(n.setTop(t[e.preference]),t[e.preference]+=n.domNode.clientWidth)}else if(e.preference===2)n.domNode.style.right=`50%`,e.stack===void 0?n.setTop(0):(n.setTop(t[2]),t[2]+=n.domNode.clientHeight);else{let{top:t,left:r}=e.preference;if(this._context.configuration.options.get(51)&&this._widgetCanOverflow(e.widget)){let e=this._viewDomNodeRect;n.setTop(t+e.top),n.setLeft(r+e.left),n.setPosition(`fixed`)}else n.setTop(t),n.setLeft(r),n.setPosition(`absolute`)}}prepareRender(e){this._viewDomNodeRect=ps(this._viewDomNode.domNode)}render(e){this._domNode.setWidth(this._editorWidth);let t=Object.keys(this._widgets),n=Array.from({length:3},()=>0);t.sort((e,t)=>(this._widgets[e].stack||0)-(this._widgets[t].stack||0));for(let e=0,r=t.length;e<r;e++){let r=t[e];this._renderWidget(this._widgets[r],n)}}},By=class{constructor(e,t,n,r){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=n|0,this.height=r|0}},Ale=class{constructor(e,t){this.tabSize=e,this.data=t}},Vy=class{constructor(e,t,n,r,i,a,o){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=n,this.maxColumn=r,this.startVisibleColumn=i,this.tokens=a,this.inlineDecorations=o}},Hy=class e{constructor(t,n,r,i,a,o,s,c,l,u,d,f){this.minColumn=t,this.maxColumn=n,this.content=r,this.continuesWithWrappedLine=i,this.isBasicASCII=e.isBasicASCII(r,o),this.containsRTL=e.containsRTL(r,this.isBasicASCII,a),this.tokens=s,this.inlineDecorations=c,this.tabSize=l,this.startVisibleColumn=u,this.textDirection=d,this.hasVariableFonts=f}static isBasicASCII(e,t){return t?ai(e):!0}static containsRTL(e,t,n){return!t&&n?ii(e):!1}},Uy=class e{constructor(e,t,n){this.color=e,this.zIndex=t,this.data=n}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.color<t.color?-1:+(e.color>t.color):e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&va(e.data,t.data)}static equalsArr(t,n){return va(t,n,e.equals)}},jle=class{constructor(e,t){let n=e.options;this.lineHeight=n.get(75),this.pixelRatio=n.get(163),this.overviewRulerLanes=n.get(95),this.renderBorder=n.get(94);let r=t.getColor(Tce);this.borderColor=r?r.toString():null,this.hideCursor=n.get(68);let i=t.getColor(_v);this.cursorColorSingle=i?i.transparent(.7).toString():null;let a=t.getColor(yv);this.cursorColorPrimary=a?a.transparent(.7).toString():null;let o=t.getColor(xv);this.cursorColorSecondary=o?o.transparent(.7).toString():null,this.themeType=t.type;let s=n.get(81),c=s.enabled,l=s.side,u=t.getColor(Ece),d=wy.getDefaultBackground();u?this.backgroundColor=u:c&&l===`right`?this.backgroundColor=d:this.backgroundColor=null;let f=n.get(165).overviewRuler;this.top=f.top,this.right=f.right,this.domWidth=f.width,this.domHeight=f.height,this.overviewRulerLanes===0?(this.canvasWidth=0,this.canvasHeight=0):(this.canvasWidth=this.domWidth*this.pixelRatio|0,this.canvasHeight=this.domHeight*this.pixelRatio|0);let[p,m]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=p,this.w=m}_initLanes(e,t,n){let r=t-e;if(n>=3){let t=Math.floor(r/3),n=Math.floor(r/3),i=r-t-n,a=e,o=a+t;return[[0,a,o,a,a+t+i,a,o,a],[0,t,i,t+i,n,t+i+n,i+n,t+i+n]]}else if(n===2){let t=Math.floor(r/2),n=r-t,i=e;return[[0,i,i,i,i+t,i,i,i],[0,t,t,t,n,t+n,t+n,t+n]]}else{let t=e,n=r;return[[0,t,t,t,t,t,t,t],[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.cursorColorSingle===e.cursorColorSingle&&this.cursorColorPrimary===e.cursorColorPrimary&&this.cursorColorSecondary===e.cursorColorSecondary&&this.themeType===e.themeType&&J.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}},Mle=class extends yg{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=ip(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=wy.onDidChange(e=>{e.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[{position:new F(1,1),color:this._settings.cursorColorSingle}]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){let t=new jle(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(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():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,n=e.selections.length;t<n;t++){let r=this._settings.cursorColorSingle;n>1&&(r=t===0?this._settings.cursorColorPrimary:this._settings.cursorColorSecondary),this._cursorPositions.push({position:e.selections[t].getPosition(),color:r})}return this._cursorPositions.sort((e,t)=>F.compare(e.position,t.position)),this._markRenderingIsMaybeNeeded()}onDecorationsChanged(e){return e.affectsOverviewRuler?this._markRenderingIsMaybeNeeded():!1}onFlushed(e){return this._markRenderingIsNeeded()}onScrollChanged(e){return e.scrollHeightChanged?this._markRenderingIsNeeded():!1}onZonesChanged(e){return this._markRenderingIsNeeded()}onThemeChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render(),this._actualShouldRender=0}_render(){let e=this._settings.backgroundColor;if(this._settings.overviewRulerLanes===0){this._domNode.setBackgroundColor(e?J.Format.CSS.formatHexA(e):``),this._domNode.setDisplay(`none`);return}let t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(Uy.compareByRenderingProps),this._actualShouldRender===1&&!Uy.equalsArr(this._renderedDecorations,t)&&(this._actualShouldRender=2),this._actualShouldRender===1&&!va(this._renderedCursorPositions,this._cursorPositions,(e,t)=>e.position.lineNumber===t.position.lineNumber&&e.color===t.color)&&(this._actualShouldRender=2),this._actualShouldRender===1)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay(`block`);let n=this._settings.canvasWidth,r=this._settings.canvasHeight,i=this._settings.lineHeight,a=this._context.viewLayout,o=r/this._context.viewLayout.getScrollHeight(),s=6*this._settings.pixelRatio|0,c=s/2|0,l=this._domNode.domNode.getContext(`2d`);e?e.isOpaque()?(l.fillStyle=J.Format.CSS.formatHexA(e),l.fillRect(0,0,n,r)):(l.clearRect(0,0,n,r),l.fillStyle=J.Format.CSS.formatHexA(e),l.fillRect(0,0,n,r)):l.clearRect(0,0,n,r);let u=this._settings.x,d=this._settings.w;for(let e of t){let t=e.color,n=e.data;l.fillStyle=t;let f=0,p=0,m=0;for(let e=0,t=n.length/3;e<t;e++){let t=n[3*e],h=n[3*e+1],g=n[3*e+2],_=a.getVerticalOffsetForLineNumber(h)*o|0,v=(a.getVerticalOffsetForLineNumber(g)+i)*o|0;if(v-_<s){let e=(_+v)/2|0;e<c?e=c:e+c>r&&(e=r-c),_=e-c,v=e+c}_>m+1||t!==f?(e!==0&&l.fillRect(u[f],p,d[f],m-p),f=t,p=_,m=v):v>m&&(m=v)}l.fillRect(u[f],p,d[f],m-p)}if(!this._settings.hideCursor){let e=2*this._settings.pixelRatio|0,t=e/2|0,n=this._settings.x[7],i=this._settings.w[7],s=-100,c=-100,u=null;for(let d=0,f=this._cursorPositions.length;d<f;d++){let f=this._cursorPositions[d].color;if(!f)continue;let p=this._cursorPositions[d].position,m=a.getVerticalOffsetForLineNumber(p.lineNumber)*o|0;m<t?m=t:m+t>r&&(m=r-t);let h=m-t,g=h+e;h>c+1||f!==u?(d!==0&&u&&l.fillRect(n,s,i,c-s),s=h,c=g):g>c&&(c=g),u=f,l.fillStyle=f}u&&l.fillRect(n,s,i,c-s)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(l.beginPath(),l.lineWidth=1,l.strokeStyle=this._settings.borderColor,l.moveTo(0,0),l.lineTo(0,r),l.moveTo(1,0),l.lineTo(n,0),l.stroke())}},Wy=class{constructor(e,t,n){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=n|0}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}},Gy=class{constructor(e,t,n,r){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=n,this.color=r,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}},Nle=class{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(Gy.compare)}setLineHeight(e){return this._lineHeight===e?!1:(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?!1:(this._domWidth=e,this._colorZonesInvalid=!0,!0)}getDOMHeight(){return this._domHeight}getCanvasHeight(){return this._domHeight*this._pixelRatio}setDOMHeight(e){return this._domHeight===e?!1:(this._domHeight=e,this._colorZonesInvalid=!0,!0)}getOuterHeight(){return this._outerHeight}setOuterHeight(e){return this._outerHeight===e?!1:(this._outerHeight=e,this._colorZonesInvalid=!0,!0)}resolveColorZones(){let e=this._colorZonesInvalid,t=Math.floor(this._lineHeight),n=Math.floor(this.getCanvasHeight()),r=n/Math.floor(this._outerHeight),i=Math.floor(4*this._pixelRatio/2),a=[];for(let o=0,s=this._zones.length;o<s;o++){let s=this._zones[o];if(!e){let e=s.getColorZones();if(e){a.push(e);continue}}let c=this._getVerticalOffsetForLine(s.startLineNumber),l=s.heightInLines===0?this._getVerticalOffsetForLine(s.endLineNumber)+t:c+s.heightInLines*t,u=Math.floor(r*c),d=Math.floor(r*l),f=Math.floor((u+d)/2),p=d-f;p<i&&(p=i),f-p<0&&(f=p),f+p>n&&(f=n-p);let m=s.color,h=this._color2Id[m];h||(h=++this._lastAssignedId,this._color2Id[m]=h,this._id2Color[h]=m);let g=new Wy(f-p,f+p,h);s.setColorZone(g),a.push(g)}return this._colorZonesInvalid=!1,a.sort(Wy.compare),a}},Ple=class extends vg{constructor(e,t){super(),this._context=e;let n=this._context.configuration.options;this._domNode=ip(document.createElement(`canvas`)),this._domNode.setClassName(t),this._domNode.setPosition(`absolute`),this._domNode.setLayerHinting(!0),this._domNode.setContain(`strict`),this._zoneManager=new Nle(e=>this._context.viewLayout.getVerticalOffsetForLineNumber(e)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(n.get(75)),this._zoneManager.setPixelRatio(n.get(163)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return e.hasChanged(75)&&(this._zoneManager.setLineHeight(t.get(75)),this._render()),e.hasChanged(163)&&(this._zoneManager.setPixelRatio(t.get(163)),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(this._zoneManager.getOuterHeight()===0)return!1;let e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),n=this._zoneManager.resolveColorZones(),r=this._zoneManager.getId2Color(),i=this._domNode.domNode.getContext(`2d`);return i.clearRect(0,0,e,t),n.length>0&&this._renderOneLane(i,n,r,e),!0}_renderOneLane(e,t,n,r){let i=0,a=0,o=0;for(let s of t){let t=s.colorId,c=s.from,l=s.to;t===i?o>=c?o=Math.max(o,l):(e.fillRect(0,a,r,o-a),a=c,o=l):(e.fillRect(0,a,r,o-a),i=t,e.fillStyle=n[i],a=c,o=l)}e.fillRect(0,a,r,o-a)}},Fle=class extends yg{constructor(e){super(e),this.domNode=ip(document.createElement(`div`)),this.domNode.setAttribute(`role`,`presentation`),this.domNode.setAttribute(`aria-hidden`,`true`),this.domNode.setClassName(`view-rulers`),this._renderedRulers=[];let t=this._context.configuration.options;this._rulers=t.get(116),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return this._rulers=t.get(116),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){let e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e<t){let{tabSize:n}=this._context.viewModel.model.getOptions(),r=n,i=t-e;for(;i>0;){let e=ip(document.createElement(`div`));e.setClassName(`view-ruler`),e.setWidth(r),this.domNode.appendChild(e),this._renderedRulers.push(e),i--}return}let n=e-t;for(;n>0;){let e=this._renderedRulers.pop();this.domNode.removeChild(e),n--}}render(e){this._ensureRulersCount();for(let t=0,n=this._rulers.length;t<n;t++){let n=this._renderedRulers[t],r=this._rulers[t];n.setBoxShadow(r.color?`1px 0 0 0 ${r.color} inset`:``),n.setHeight(Math.min(e.scrollHeight,1e6)),n.setLeft(r.column*this._typicalHalfwidthCharacterWidth)}}},Ile=class extends yg{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;let t=this._context.configuration.options.get(117);this._useShadows=t.useShadows,this._domNode=ip(document.createElement(`div`)),this._domNode.setAttribute(`role`,`presentation`),this._domNode.setAttribute(`aria-hidden`,`true`)}dispose(){super.dispose()}_updateShouldShow(){let e=this._useShadows&&this._scrollTop>0;return this._shouldShow===e?!1:(this._shouldShow=e,!0)}getDomNode(){return this._domNode}_updateWidth(){let e=this._context.configuration.options.get(165);e.minimap.renderMinimap===0||e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?this._width=e.width:this._width=e.width-e.verticalScrollbarWidth}onConfigurationChanged(e){let t=this._context.configuration.options.get(117);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`:``)}},Lle=class{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}},Rle=class{constructor(e,t){this.lineNumber=e,this.ranges=t}};function zle(e){return new Lle(e)}function Ble(e){return new Rle(e.lineNumber,e.ranges.map(zle))}var Vle=class e extends sv{static{this.SELECTION_CLASS_NAME=`selected-text`}static{this.SELECTION_TOP_LEFT=`top-left-radius`}static{this.SELECTION_BOTTOM_LEFT=`bottom-left-radius`}static{this.SELECTION_TOP_RIGHT=`top-right-radius`}static{this.SELECTION_BOTTOM_RIGHT=`bottom-right-radius`}static{this.EDITOR_BACKGROUND_CLASS_NAME=`monaco-editor-background`}static{this.ROUNDED_PIECE_WIDTH=10}constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;let t=this._context.configuration.options;this._roundedSelection=t.get(115),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return this._roundedSelection=t.get(115),this._typicalHalfwidthCharacterWidth=t.get(59).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,n=e.length;t<n;t++)if(e[t].ranges.length>1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,n){let r=this._typicalHalfwidthCharacterWidth/4,i=null,a=null;if(n&&n.length>0&&t.length>0){let r=t[0].lineNumber;if(r===e.startLineNumber)for(let e=0;!i&&e<n.length;e++)n[e].lineNumber===r&&(i=n[e].ranges[0]);let o=t[t.length-1].lineNumber;if(o===e.endLineNumber)for(let e=n.length-1;!a&&e>=0;e--)n[e].lineNumber===o&&(a=n[e].ranges[0]);i&&!i.startStyle&&(i=null),a&&!a.startStyle&&(a=null)}for(let e=0,n=t.length;e<n;e++){let o=t[e].ranges[0],s=o.left,c=o.left+o.width,l={top:0,bottom:0},u={top:0,bottom:0};if(e>0){let n=t[e-1].ranges[0].left,i=t[e-1].ranges[0].left+t[e-1].ranges[0].width;Ky(s-n)<r?l.top=2:s>n&&(l.top=1),Ky(c-i)<r?u.top=2:n<c&&c<i&&(u.top=1)}else i&&(l.top=i.startStyle.top,u.top=i.endStyle.top);if(e+1<n){let n=t[e+1].ranges[0].left,i=t[e+1].ranges[0].left+t[e+1].ranges[0].width;Ky(s-n)<r?l.bottom=2:n<s&&s<i&&(l.bottom=1),Ky(c-i)<r?u.bottom=2:c<i&&(u.bottom=1)}else a&&(l.bottom=a.startStyle.bottom,u.bottom=a.endStyle.bottom);o.startStyle=l,o.endStyle=u}}_getVisibleRangesWithStyle(e,t,n){let r=(t.linesVisibleRangesForRange(e,!0)||[]).map(Ble);return!this._visibleRangesHaveGaps(r)&&this._roundedSelection&&this._enrichVisibleRangesWithStyle(t.visibleRange,r,n),r}_createSelectionPiece(e,t,n,r,i){return`<div class="cslr `+n+`" style="top:`+e.toString()+`px;bottom:`+t.toString()+`px;left:`+r.toString()+`px;width:`+i.toString()+`px;"></div>`}_actualRenderOneSelection(t,n,r,i){if(i.length===0)return;let a=!!i[0].ranges[0].startStyle,o=i[0].lineNumber,s=i[i.length-1].lineNumber;for(let c=0,l=i.length;c<l;c++){let l=i[c],u=l.lineNumber,d=u-n,f=r?+(u===o):0,p=r?+(u!==o&&u===s):0,m=``,h=``;for(let t=0,n=l.ranges.length;t<n;t++){let n=l.ranges[t];if(a){let t=n.startStyle,r=n.endStyle;if(t.top===1||t.bottom===1){m+=this._createSelectionPiece(f,p,e.SELECTION_CLASS_NAME,n.left-e.ROUNDED_PIECE_WIDTH,e.ROUNDED_PIECE_WIDTH);let r=e.EDITOR_BACKGROUND_CLASS_NAME;t.top===1&&(r+=` `+e.SELECTION_TOP_RIGHT),t.bottom===1&&(r+=` `+e.SELECTION_BOTTOM_RIGHT),m+=this._createSelectionPiece(f,p,r,n.left-e.ROUNDED_PIECE_WIDTH,e.ROUNDED_PIECE_WIDTH)}if(r.top===1||r.bottom===1){m+=this._createSelectionPiece(f,p,e.SELECTION_CLASS_NAME,n.left+n.width,e.ROUNDED_PIECE_WIDTH);let t=e.EDITOR_BACKGROUND_CLASS_NAME;r.top===1&&(t+=` `+e.SELECTION_TOP_LEFT),r.bottom===1&&(t+=` `+e.SELECTION_BOTTOM_LEFT),m+=this._createSelectionPiece(f,p,t,n.left+n.width,e.ROUNDED_PIECE_WIDTH)}}let r=e.SELECTION_CLASS_NAME;if(a){let t=n.startStyle,i=n.endStyle;t.top===0&&(r+=` `+e.SELECTION_TOP_LEFT),t.bottom===0&&(r+=` `+e.SELECTION_BOTTOM_LEFT),i.top===0&&(r+=` `+e.SELECTION_TOP_RIGHT),i.bottom===0&&(r+=` `+e.SELECTION_BOTTOM_RIGHT)}h+=this._createSelectionPiece(f,p,r,n.left,n.width)}t[d][0]+=m,t[d][1]+=h}}prepareRender(e){let t=[],n=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(let e=n;e<=r;e++){let r=e-n;t[r]=[``,``]}let i=[];for(let r=0,a=this._selections.length;r<a;r++){let a=this._selections[r];if(a.isEmpty()){i[r]=null;continue}let o=this._getVisibleRangesWithStyle(a,e,this._previousFrameVisibleRangesWithStyle[r]);i[r]=o,this._actualRenderOneSelection(t,n,this._selections.length>1,o)}this._previousFrameVisibleRangesWithStyle=i,this._renderResult=t.map(([e,t])=>e+t)}render(e,t){if(!this._renderResult)return``;let n=t-e;return n<0||n>=this._renderResult.length?``:this._renderResult[n]}};pv((e,t)=>{let n=e.getColor(Jae);n&&!n.isTransparent()&&t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${n}; }`)});function Ky(e){return e<0?-e:e}var qy=class{constructor(e,t,n,r,i,a,o){this.top=e,this.left=t,this.paddingLeft=n,this.width=r,this.height=i,this.textContent=a,this.textContentClassName=o}},Jy;(function(e){e[e.Single=0]=`Single`,e[e.MultiPrimary=1]=`MultiPrimary`,e[e.MultiSecondary=2]=`MultiSecondary`})(Jy||={});var Yy=class{constructor(e,t){this._context=e;let n=this._context.configuration.options,r=n.get(59);this._cursorStyle=n.get(161),this._typicalHalfwidthCharacterWidth=r.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(n.get(37),this._typicalHalfwidthCharacterWidth),this._lineCursorHeight=n.get(38),this._isVisible=!0,this._domNode=ip(document.createElement(`div`)),this._domNode.setClassName(`cursor ${ey}`),this._domNode.setHeight(this._context.viewLayout.getLineHeightForLineNumber(1)),this._domNode.setTop(0),this._domNode.setLeft(0),ap(this._domNode,r),this._domNode.setDisplay(`none`),this._position=new F(1,1),this._pluralityClass=``,this.setPlurality(t),this._lastRenderedContent=``,this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}setPlurality(e){switch(e){default:case Jy.Single:this._pluralityClass=``;break;case Jy.MultiPrimary:this._pluralityClass=`cursor-primary`;break;case Jy.MultiSecondary:this._pluralityClass=`cursor-secondary`;break}}show(){this._isVisible||=(this._domNode.setVisibility(`inherit`),!0)}hide(){this._isVisible&&=(this._domNode.setVisibility(`hidden`),!1)}onConfigurationChanged(e){let t=this._context.configuration.options,n=t.get(59);return this._cursorStyle=t.get(161),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(37),this._typicalHalfwidthCharacterWidth),this._lineCursorHeight=t.get(38),ap(this._domNode,n),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty=`none`:this._domNode.domNode.style.transitionProperty=``,this._position=e,!0}_getGraphemeAwarePosition(){let{lineNumber:e,column:t}=this._position,n=this._context.viewModel.getLineContent(e),[r,i]=Yee(n,t-1);return[new F(e,r+1),n.substring(r,i)]}_prepareRender(e){let t=``,n=``,[r,i]=this._getGraphemeAwarePosition(),a=this._context.viewLayout.getLineHeightForLineNumber(r.lineNumber),o=this._lineCursorHeight===0?a:Math.min(a,this._lineCursorHeight),s=(a-o)/2;if(this._cursorStyle===jp.Line||this._cursorStyle===jp.LineThin){let a=e.visibleRangeForPosition(r);if(!a||a.outsideRenderedLine)return null;let c=Ko(this._domNode.domNode),l;this._cursorStyle===jp.Line?(l=Vs(c,this._lineCursorWidth>0?this._lineCursorWidth:2),l>2&&(t=i,n=this._getTokenClassName(r))):l=Vs(c,1);let u=a.left,d=0;return l>=2&&u>=1&&(d=1,u-=d),new qy(e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta+s,u,d,l,o,t,n)}let c=e.linesVisibleRangesForRange(new U(r.lineNumber,r.column,r.lineNumber,r.column+i.length),!1);if(!c||c.length===0)return null;let l=c[0];if(l.outsideRenderedLine||l.ranges.length===0)return null;let u=l.ranges[0],d=i===` `||u.width<1?this._typicalHalfwidthCharacterWidth:u.width;this._cursorStyle===jp.Block&&(t=i,n=this._getTokenClassName(r));let f=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta,p=a;return(this._cursorStyle===jp.Underline||this._cursorStyle===jp.UnderlineThin)&&(f+=a-2,p=2),new qy(f,u.left,0,d,p,t,n)}_getTokenClassName(e){let t=this._context.viewModel.getViewLineData(e.lineNumber),n=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(n)}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 ${this._pluralityClass} ${ey} ${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)}},Hle=class e extends yg{static{this.BLINK_INTERVAL=500}constructor(e){super(e);let t=this._context.configuration.options;this._readOnly=t.get(104),this._cursorBlinking=t.get(32),this._cursorStyle=t.get(161),this._cursorSmoothCaretAnimation=t.get(33),this._editContextEnabled=t.get(170),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new Yy(this._context,Jy.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=ip(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 fr,this._cursorFlatBlinkInterval=new os,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){let t=this._context.configuration.options;this._readOnly=t.get(104),this._cursorBlinking=t.get(32),this._cursorStyle=t.get(161),this._cursorSmoothCaretAnimation=t.get(33),this._editContextEnabled=t.get(170),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let t=0,n=this._secondaryCursors.length;t<n;t++)this._secondaryCursors[t].onConfigurationChanged(e);return!0}_onCursorPositionChanged(e,t,n){let r=this._secondaryCursors.length!==t.length||this._cursorSmoothCaretAnimation===`explicit`&&n!==3;if(this._primaryCursor.setPlurality(t.length?Jy.MultiPrimary:Jy.Single),this._primaryCursor.onCursorPositionChanged(e,r),this._updateBlinking(),this._secondaryCursors.length<t.length){let e=t.length-this._secondaryCursors.length;for(let t=0;t<e;t++){let e=new Yy(this._context,Jy.MultiSecondary);this._domNode.domNode.insertBefore(e.getDomNode().domNode,this._primaryCursor.getDomNode().domNode.nextSibling),this._secondaryCursors.push(e)}}else if(this._secondaryCursors.length>t.length){let 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],r)}onCursorStateChanged(e){let t=[];for(let n=0,r=e.selections.length;n<r;n++)t[n]=e.selections[n].getPosition();this._onCursorPositionChanged(t[0],t.slice(1),e.reason);let n=e.selections[0].isEmpty();return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,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){let t=t=>{for(let n=0,r=e.ranges.length;n<r;n++)if(e.ranges[n].fromLineNumber<=t.lineNumber&&t.lineNumber<=e.ranges[n].toLineNumber)return!0;return!1};if(t(this._primaryCursor.getPosition()))return!0;for(let e of this._secondaryCursors)if(t(e.getPosition()))return!0;return!1}onZonesChanged(e){return!0}_getCursorBlinking(){return this._isComposingInput&&!this._editContextEnabled||!this._editorHasFocus?0:this._readOnly?5:this._cursorBlinking}_updateBlinking(){this._startCursorBlinkAnimation.cancel(),this._cursorFlatBlinkInterval.cancel();let t=this._getCursorBlinking(),n=t===0,r=t===5;n?this._hide():this._show(),this._blinkingEnabled=!1,this._updateDomClassName(),!n&&!r&&(t===1?this._cursorFlatBlinkInterval.cancelAndSet(()=>{this._isVisible?this._hide():this._show()},e.BLINK_INTERVAL,Ko(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},e.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e=`cursors-layer`;switch(this._selectionIsEmpty||(e+=` has-selection`),this._cursorStyle){case jp.Line:e+=` cursor-line-style`;break;case jp.Block:e+=` cursor-block-style`;break;case jp.Underline:e+=` cursor-underline-style`;break;case jp.LineThin:e+=` cursor-line-thin-style`;break;case jp.BlockOutline:e+=` cursor-block-outline-style`;break;case jp.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;case 5:e+=` cursor-solid`;break;default:e+=` cursor-solid`}else e+=` cursor-solid`;return(this._cursorSmoothCaretAnimation===`on`||this._cursorSmoothCaretAnimation===`explicit`)&&(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,n=this._secondaryCursors.length;t<n;t++)this._secondaryCursors[t].prepareRender(e)}render(e){let t=[],n=0,r=this._primaryCursor.render(e);r&&(t[n++]=r);for(let r=0,i=this._secondaryCursors.length;r<i;r++){let i=this._secondaryCursors[r].render(e);i&&(t[n++]=i)}this._renderData=t}getLastRenderData(){return this._renderData}};pv((e,t)=>{let n=[{class:`.cursor`,foreground:_v,background:vv},{class:`.cursor-primary`,foreground:yv,background:bv},{class:`.cursor-secondary`,foreground:xv,background:Sv}];for(let r of n){let n=e.getColor(r.foreground);if(n){let i=e.getColor(r.background);i||=n.opposite(),t.addRule(`.monaco-editor .cursors-layer ${r.class} { background-color: ${n}; border-color: ${n}; color: ${i}; }`),zg(e.type)&&t.addRule(`.monaco-editor .cursors-layer.has-selection ${r.class} { border-left: 1px solid ${i}; border-right: 1px solid ${i}; }`)}}});var Xy=()=>{throw Error(`Invalid change accessor`)},Ule=class extends yg{constructor(e){super(e);let t=this._context.configuration.options,n=t.get(165);this._lineHeight=t.get(75),this._contentWidth=n.contentWidth,this._contentLeft=n.contentLeft,this.domNode=ip(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=ip(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(){let e=this._context.viewLayout.getWhitespaces(),t=new Map;for(let n of e)t.set(n.id,n);let n=!1;return this._context.viewModel.changeWhitespace(e=>{let r=Object.keys(this._zones);for(let i=0,a=r.length;i<a;i++){let a=r[i],o=this._zones[a],s=this._computeWhitespaceProps(o.delegate);o.isInHiddenArea=s.isInHiddenArea;let c=t.get(a);c&&(c.afterLineNumber!==s.afterViewLineNumber||c.height!==s.heightInPx)&&(e.changeOneWhitespace(a,s.afterViewLineNumber,s.heightInPx),this._safeCallOnComputedHeight(o.delegate,s.heightInPx),n=!0)}}),n}onConfigurationChanged(e){let t=this._context.configuration.options,n=t.get(165);return this._lineHeight=t.get(75),this._contentWidth=n.contentWidth,this._contentLeft=n.contentLeft,e.hasChanged(75)&&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 e.ordinal??e.afterColumn??1e4}_computeWhitespaceProps(e){if(e.afterLineNumber===0)return{isInHiddenArea:!1,afterViewLineNumber:0,heightInPx:this._heightInPixels(e),minWidthInPx:this._minWidthInPixels(e)};let t;if(e.afterColumn!==void 0)t=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:e.afterColumn});else{let n=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:1}).lineNumber;t=new F(n,this._context.viewModel.model.getLineMaxColumn(n))}let n;n=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});let r=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t,e.afterColumnAffinity,!0),i=e.showInHiddenAreas||this._context.viewModel.coordinatesConverter.modelPositionIsVisible(n);return{isInHiddenArea:!i,afterViewLineNumber:r.lineNumber,heightInPx:i?this._heightInPixels(e):0,minWidthInPx:this._minWidthInPixels(e)}}changeViewZones(e){let t=!1;return this._context.viewModel.changeWhitespace(n=>{let r={addZone:e=>(t=!0,this._addZone(n,e)),removeZone:e=>{e&&(t=this._removeZone(n,e)||t)},layoutZone:e=>{e&&(t=this._layoutZone(n,e)||t)}};Wle(e,r),r.addZone=Xy,r.removeZone=Xy,r.layoutZone=Xy}),t}_addZone(e,t){let n=this._computeWhitespaceProps(t),r={whitespaceId:e.insertWhitespace(n.afterViewLineNumber,this._getZoneOrdinal(t),n.heightInPx,n.minWidthInPx),delegate:t,isInHiddenArea:n.isInHiddenArea,isVisible:!1,domNode:ip(t.domNode),marginDomNode:t.marginDomNode?ip(t.marginDomNode):null};return this._safeCallOnComputedHeight(r.delegate,n.heightInPx),r.domNode.setPosition(`absolute`),r.domNode.domNode.style.width=`100%`,r.domNode.setDisplay(`none`),r.domNode.setAttribute(`monaco-view-zone`,r.whitespaceId),this.domNode.appendChild(r.domNode),r.marginDomNode&&(r.marginDomNode.setPosition(`absolute`),r.marginDomNode.domNode.style.width=`100%`,r.marginDomNode.setDisplay(`none`),r.marginDomNode.setAttribute(`monaco-view-zone`,r.whitespaceId),this.marginDomNode.appendChild(r.marginDomNode)),this._zones[r.whitespaceId]=r,this.setShouldRender(),r.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){let n=this._zones[t];return delete this._zones[t],e.removeWhitespace(n.whitespaceId),n.domNode.removeAttribute(`monaco-visible-view-zone`),n.domNode.removeAttribute(`monaco-view-zone`),n.domNode.domNode.remove(),n.marginDomNode&&(n.marginDomNode.removeAttribute(`monaco-visible-view-zone`),n.marginDomNode.removeAttribute(`monaco-view-zone`),n.marginDomNode.domNode.remove()),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){let n=this._zones[t],r=this._computeWhitespaceProps(n.delegate);return n.isInHiddenArea=r.isInHiddenArea,e.changeOneWhitespace(n.whitespaceId,r.afterViewLineNumber,r.heightInPx),this._safeCallOnComputedHeight(n.delegate,r.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx==`number`?e.heightInPx:typeof e.heightInLines==`number`?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx==`number`?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight==`function`)try{e.onComputedHeight(t)}catch(e){dt(e)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop==`function`)try{e.onDomNodeTop(t)}catch(e){dt(e)}}prepareRender(e){}render(e){let t=e.viewportData.whitespaceViewportData,n={},r=!1;for(let e of t)this._zones[e.id].isInHiddenArea||(n[e.id]=e,r=!0);let i=Object.keys(this._zones);for(let t=0,r=i.length;t<r;t++){let r=i[t],a=this._zones[r],o=0,s=0,c=`none`;n.hasOwnProperty(r)?(o=n[r].verticalOffset-e.bigNumbersDelta,s=n[r].height,c=`block`,a.isVisible||=(a.domNode.setAttribute(`monaco-visible-view-zone`,`true`),!0),this._safeCallOnDomNodeTop(a.delegate,e.getScrolledTopFromAbsoluteTop(n[r].verticalOffset))):(a.isVisible&&=(a.domNode.removeAttribute(`monaco-visible-view-zone`),!1),this._safeCallOnDomNodeTop(a.delegate,e.getScrolledTopFromAbsoluteTop(-1e6))),a.domNode.setTop(o),a.domNode.setHeight(s),a.domNode.setDisplay(c),a.marginDomNode&&(a.marginDomNode.setTop(o),a.marginDomNode.setHeight(s),a.marginDomNode.setDisplay(c))}r&&(this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth)),this.marginDomNode.setWidth(this._contentLeft))}};function Wle(e,t){try{return e(t)}catch(e){dt(e);return}}var Gle=class extends sv{constructor(e){super(),this._context=e,this._options=new Zy(this._context.configuration),this._selection=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=new Zy(this._context.configuration);return this._options.equals(t)?e.hasChanged(165):(this._options=t,!0)}onCursorStateChanged(e){return this._selection=e.selections,this._options.renderWhitespace===`selection`}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(this._options.renderWhitespace===`none`){this._renderResult=null;return}let t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=!0;this._renderResult=[];for(let t=e.viewportData.startLineNumber;t<=e.viewportData.endLineNumber;t++){let n=t-e.viewportData.startLineNumber,r=this._context.viewModel.getViewLineRenderingData(t),i=null;if(this._options.renderWhitespace===`selection`){let e=this._selection;for(let n of e){if(n.endLineNumber<t||n.startLineNumber>t)continue;let e=n.startLineNumber===t?n.startColumn:r.minColumn,a=n.endLineNumber===t?n.endColumn:r.maxColumn;e<a&&(i||=[],i.push(new pf(e-1,a-1)))}}this._renderResult[n]=this._applyRenderWhitespace(e,t,i,r)}}_applyRenderWhitespace(e,t,n,r){if(r.hasVariableFonts||this._options.renderWhitespace===`selection`&&!n||this._options.renderWhitespace===`trailing`&&r.continuesWithWrappedLine)return``;let i=this._context.theme.getColor(Cv),a=this._options.renderWithSVG,o=r.content,s=this._options.stopRenderingLineAfter===-1?o.length:Math.min(this._options.stopRenderingLineAfter,o.length),c=r.continuesWithWrappedLine,l=r.minColumn-1,u=this._options.renderWhitespace===`boundary`,d=this._options.renderWhitespace===`trailing`,f=e.getLineHeightForLineNumber(t),p=this._options.middotWidth,m=this._options.wsmiddotWidth,h=this._options.spaceWidth,g=Math.abs(m-h)<Math.abs(p-h)?11825:183,_=this._options.canUseHalfwidthRightwardsArrow,v=``,y=!1,b=Pr(o),x;b===-1?(y=!0,b=s,x=s):x=Ir(o);let S=0,ee=n&&n[S],te=0;for(let r=l;r<s;r++){let i=o.charCodeAt(r);if(ee&&ee.endExclusive<=r&&(S++,ee=n&&n[S]),i!==9&&i!==32||d&&!y&&r<=x)continue;if(u&&r>=b&&r<=x&&i===32){let e=r-1>=0?o.charCodeAt(r-1):0,t=r+1<s?o.charCodeAt(r+1):0;if(e!==32&&t!==32)continue}if(u&&c&&r===s-1){let e=r-1>=0?o.charCodeAt(r-1):0;if(i===32&&e!==32&&e!==9)continue}if(n&&!(ee&&ee.start<=r&&r<ee.endExclusive))continue;let l=e.visibleRangeForPosition(new F(t,r+1));l&&(a?(te=Math.max(te,l.left),i===9?v+=this._renderArrow(f,h,l.left):v+=`<circle cx="${(l.left+h/2).toFixed(2)}" cy="${(f/2).toFixed(2)}" r="${(h/7).toFixed(2)}" />`):i===9?v+=`<div class="mwh" style="left:${l.left}px;height:${f}px;">${_?`→`:`→`}</div>`:v+=`<div class="mwh" style="left:${l.left}px;height:${f}px;">${String.fromCharCode(g)}</div>`)}return a?(te=Math.round(te+h),`<svg style="bottom:0;position:absolute;width:${te}px;height:${f}px" viewBox="0 0 ${te} ${f}" xmlns="http://www.w3.org/2000/svg" fill="${i}">`+v+`</svg>`):v}_renderArrow(e,t,n){let r=t/7,i=t,a=e/2,o=n,s={x:0,y:r/2},c={x:100/125*i,y:s.y},l={x:c.x-.2*c.x,y:c.y+.2*c.x},u={x:l.x+.1*c.x,y:l.y+.1*c.x},d={x:u.x+.35*c.x,y:u.y-.35*c.x};return`<path d="M ${[s,c,l,u,d,{x:d.x,y:-d.y},{x:u.x,y:-u.y},{x:l.x,y:-l.y},{x:c.x,y:-c.y},{x:s.x,y:-s.y}].map(e=>`${(o+e.x).toFixed(2)} ${(a+e.y).toFixed(2)}`).join(` L `)}" />`}render(e,t){if(!this._renderResult)return``;let n=t-e;return n<0||n>=this._renderResult.length?``:this._renderResult[n]}},Zy=class{constructor(e){let t=e.options,n=t.get(59),r=t.get(47);r===`off`?(this.renderWhitespace=`none`,this.renderWithSVG=!1):r===`svg`?(this.renderWhitespace=t.get(113),this.renderWithSVG=!0):(this.renderWhitespace=t.get(113),this.renderWithSVG=!1),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(75),this.stopRenderingLineAfter=t.get(133)}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}},Kle=class{constructor(e,t,n,r){this.selections=e,this.startLineNumber=t.startLineNumber|0,this.endLineNumber=t.endLineNumber|0,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=t.bigNumbersDelta|0,this.lineHeight=t.lineHeight|0,this.whitespaceViewportData=n,this._model=r,this.visibleRange=new U(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)}},qle=class{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)}},Jle=class{constructor(e,t,n){this.configuration=e,this.theme=new qle(t),this.viewModel=n,this.viewLayout=n.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}},Qy=new Float32Array([1,0,1,1,0,1,0,0,0,1,1,0]);function $y(e){if(!e)throw Error(`Value "${e}" cannot be null`);return e}function eb(e,t,n){let r=new t.ResizeObserver(t=>{let i=t.find(t=>t.target===e);if(!i)return;if(!(`devicePixelContentBoxSize`in i)){r?.disconnect(),r=void 0;return}let a=i.devicePixelContentBoxSize[0].inlineSize,o=i.devicePixelContentBoxSize[0].blockSize;a>0&&o>0&&n(a,o)});try{r.observe(e,{box:[`device-pixel-content-box`]})}catch{throw r.disconnect(),r=void 0,new xt(`Could not observe device pixel dimensions`)}return T(()=>r?.disconnect())}var Yle=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Xle=0,tb=class extends D{get cacheKey(){return`${this.fontFamily}_${this.fontSize}px`}constructor(e,t,n,r){super(),this.fontSize=e,this.fontFamily=t,this.devicePixelRatio=n,this._decorationStyleCache=r,this.id=Xle++,this._workGlyph={source:null,boundingBox:{left:0,bottom:0,right:0,top:0},originOffset:{x:0,y:0},fontBoundingBoxAscent:0,fontBoundingBoxDescent:0},this._workGlyphConfig={chars:void 0,tokenMetadata:0,decorationStyleSetId:0},this._antiAliasing=$t?`greyscale`:`subpixel`;let i=Math.ceil(this.fontSize*n);this._canvas=new OffscreenCanvas(i*3,i*3),this._ctx=$y(this._canvas.getContext(`2d`,{willReadFrequently:!0,alpha:this._antiAliasing===`greyscale`})),this._ctx.textBaseline=`top`,this._ctx.fillStyle=`#FFFFFF`,this._ctx.font=`${i}px ${this.fontFamily}`,this._textMetrics=this._ctx.measureText(`A`)}rasterizeGlyph(e,t,n,r){return e===``?{source:this._canvas,boundingBox:{top:0,left:0,bottom:-1,right:-1},originOffset:{x:0,y:0},fontBoundingBoxAscent:0,fontBoundingBoxDescent:0}:this._workGlyphConfig.chars===e&&this._workGlyphConfig.tokenMetadata===t&&this._workGlyphConfig.decorationStyleSetId===n?this._workGlyph:(this._workGlyphConfig.chars=e,this._workGlyphConfig.tokenMetadata=t,this._workGlyphConfig.decorationStyleSetId=n,this._rasterizeGlyph(e,t,n,r))}_rasterizeGlyph(e,t,n,r){let i=Math.ceil(this.fontSize*this.devicePixelRatio),a=i*3;this._canvas.width!==a&&(this._canvas.width=a,this._canvas.height=a),this._ctx.save();let o=(t&15)/10,s=r[ff.getBackground(t)],c=this._decorationStyleCache.getStyleSet(n);this._antiAliasing===`subpixel`?(this._ctx.fillStyle=s,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height)):this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height);let l=new yd(200),u=ff.getFontStyle(t);u&1&&l.appendString(`italic `),c?.bold===void 0?u&2&&l.appendString(`bold `):c.bold&&l.appendString(`bold `),l.appendString(`${i}px ${this.fontFamily}`),this._ctx.font=l.build();let d=i,f=i;c?.color===void 0?this._ctx.fillStyle=r[ff.getForeground(t)]:this._ctx.fillStyle=`#${c.color.toString(16).padStart(8,`0`)}`,this._ctx.textBaseline=`top`,c?.opacity!==void 0&&(this._ctx.globalAlpha=c.opacity),this._ctx.fillText(e,d+o,f),this._ctx.restore();let p=this._ctx.getImageData(0,0,this._canvas.width,this._canvas.height);if(this._antiAliasing===`subpixel`){let e=parseInt(s.substring(1,3),16),t=parseInt(s.substring(3,5),16),n=parseInt(s.substring(5,7),16);this._clearColor(p,e,t,n),this._ctx.putImageData(p,0,0)}return this._findGlyphBoundingBox(p,this._workGlyph.boundingBox),this._workGlyph.source=this._canvas,this._workGlyph.originOffset.x=this._workGlyph.boundingBox.left-d,this._workGlyph.originOffset.y=this._workGlyph.boundingBox.top-f,this._workGlyph.fontBoundingBoxAscent=this._textMetrics.fontBoundingBoxAscent,this._workGlyph.fontBoundingBoxDescent=this._textMetrics.fontBoundingBoxDescent,this._workGlyph}_clearColor(e,t,n,r){for(let i=0;i<e.data.length;i+=4)e.data[i]===t&&e.data[i+1]===n&&e.data[i+2]===r&&(e.data[i+3]=0)}_findGlyphBoundingBox(e,t){let n=this._canvas.height,r=this._canvas.width,i=!1;for(let a=0;a<n;a++){for(let n=0;n<r;n++){let o=a*r*4+n*4+3;if(e.data[o]!==0){t.top=a,i=!0;break}}if(i)break}t.left=0,i=!1;for(let a=0;a<r;a++){for(let o=0;o<n;o++){let n=o*r*4+a*4+3;if(e.data[n]!==0){t.left=a,i=!0;break}}if(i)break}t.right=r,i=!1;for(let a=r-1;a>=t.left;a--){for(let o=0;o<n;o++){let n=o*r*4+a*4+3;if(e.data[n]!==0){t.right=a,i=!0;break}}if(i)break}t.bottom=t.top,i=!1;for(let a=n-1;a>=0;a--){for(let n=0;n<r;n++){let o=a*r*4+n*4+3;if(e.data[o]!==0){t.bottom=a,i=!0;break}}if(i)break}}getTextMetrics(e){return this._ctx.measureText(e)}};Yle([n_],tb.prototype,`cacheKey`,null);var Zle=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Qle=function(e,t){return function(n,r){t(n,r,e)}},nb=class extends D{constructor(e){super(),this._logService=e,this._tasks=[],this._i=0,this._register(T(()=>this.clear()))}enqueue(e){this._tasks.push(e),this._start()}clear(){this._idleCallback&&=(this._cancelCallback(this._idleCallback),void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||=this._requestCallback(this._process.bind(this))}_process(e){this._idleCallback=void 0;let t=0,n=0,r=e.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(t=Date.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,Date.now()-t),n=Math.max(t,n),i=e.timeRemaining(),n*1.5>i){r-t<-20&&this._logService.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=i}this.clear()}};nb=Zle([Qle(0,Bl)],nb);var $le=class extends nb{_requestCallback(e){return Ds().setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){Ds().clearTimeout(e)}_createDeadline(e){let t=Date.now()+e;return{timeRemaining:()=>Math.max(0,t-Date.now())}}},eue=class extends nb{_requestCallback(e){return Ds().requestIdleCallback(e)}_cancelCallback(e){Ds().cancelIdleCallback(e)}},tue=`requestIdleCallback`in Ds()?eue:$le,nue=class{constructor(e,t){this._canvas=e,this._textureIndex=t,this._currentRow={x:0,y:0,h:0},this._allocatedGlyphs=new Set,this._nextIndex=0,this._ctx=$y(this._canvas.getContext(`2d`,{willReadFrequently:!0}))}allocate(e){let t=e.boundingBox.right-e.boundingBox.left+1,n=e.boundingBox.bottom-e.boundingBox.top+1;if(t>this._canvas.width||n>this._canvas.height)throw new xt(`Glyph is too large for the atlas page`);if(e.boundingBox.right-e.boundingBox.left+1>this._canvas.width-this._currentRow.x&&(this._currentRow.x=0,this._currentRow.y+=this._currentRow.h,this._currentRow.h=1),this._currentRow.y+e.boundingBox.bottom-e.boundingBox.top+1>this._canvas.height)return;this._ctx.drawImage(e.source,e.boundingBox.left,e.boundingBox.top,t,n,this._currentRow.x,this._currentRow.y,t,n);let r={pageIndex:this._textureIndex,glyphIndex:this._nextIndex++,x:this._currentRow.x,y:this._currentRow.y,w:t,h:n,originOffsetX:e.originOffset.x,originOffsetY:e.originOffset.y,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent};return this._currentRow.x+=t,this._currentRow.h=Math.max(this._currentRow.h,n),this._allocatedGlyphs.add(r),r}getUsagePreview(){let e=this._canvas.width,t=this._canvas.height,n=new OffscreenCanvas(e,t),r=$y(n.getContext(`2d`));r.fillStyle=`#808080`,r.fillRect(0,0,e,t);let i=new Map,a=new Map;for(let e of this._allocatedGlyphs)i.set(e.y,Math.max(i.get(e.y)??0,e.h)),a.set(e.y,Math.max(a.get(e.y)??0,e.x+e.w));for(let e of this._allocatedGlyphs)r.fillStyle=`#4040FF`,r.fillRect(e.x,e.y,e.w,e.h),r.fillStyle=`#FF0000`,r.fillRect(e.x,e.y+e.h,e.w,i.get(e.y)-e.h);for(let[t,n]of a.entries())t!==this._currentRow.y&&(r.fillStyle=`#FF0000`,r.fillRect(n,t,e-n,i.get(t)));return n.convertToBlob()}getStats(){let e=this._canvas.width,t=this._canvas.height,n=0,r=0,i=e*t,a=new Map,o=new Map;for(let e of this._allocatedGlyphs)a.set(e.y,Math.max(a.get(e.y)??0,e.h)),o.set(e.y,Math.max(o.get(e.y)??0,e.x+e.w));for(let e of this._allocatedGlyphs)n+=e.w*e.h,r+=e.w*(a.get(e.y)-e.h);for(let[t,n]of o.entries())t!==this._currentRow.y&&(r+=(e-n)*a.get(t));return[`page${this._textureIndex}:`,` Total: ${i} (${e}x${t})`,` Used: ${n} (${(n/i*100).toPrecision(2)}%)`,` Wasted: ${r} (${(r/i*100).toPrecision(2)}%)`,`Efficiency: ${(n/(n+r)*100).toPrecision(2)}%`].join(`
60
+ `):t.text,r),e.preventDefault(),e.clipboardData&&j_.setTextData(e.clipboardData,t.text,t.html,r),this._logService.trace(`TextAreaEditContextInput#_ensureClipboardGetsEditorSelection with id : `,n,` with text.length: `,t.text.length)}};z_=F_([I_(4,nm),I_(5,Bl)],z_);var B_=class extends D{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this._onSyntheticTap=this._register(new k),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this.onKeyDown=this._register(new D_(this._actual,`keydown`)).event,this.onKeyPress=this._register(new D_(this._actual,`keypress`)).event,this.onKeyUp=this._register(new D_(this._actual,`keyup`)).event,this.onCompositionStart=this._register(new D_(this._actual,`compositionstart`)).event,this.onCompositionUpdate=this._register(new D_(this._actual,`compositionupdate`)).event,this.onCompositionEnd=this._register(new D_(this._actual,`compositionend`)).event,this.onBeforeInput=this._register(new D_(this._actual,`beforeinput`)).event,this.onInput=this._register(new D_(this._actual,`input`)).event,this.onCut=this._register(new D_(this._actual,`cut`)).event,this.onCopy=this._register(new D_(this._actual,`copy`)).event,this.onPaste=this._register(new D_(this._actual,`paste`)).event,this.onFocus=this._register(new D_(this._actual,`focus`)).event,this.onBlur=this._register(new D_(this._actual,`blur`)).event,this._register(this.onKeyDown(()=>sm.onKeyDown())),this._register(this.onBeforeInput(()=>sm.onBeforeInput())),this._register(this.onInput(()=>sm.onInput())),this._register(this.onKeyUp(()=>sm.onKeyUp())),this._register(j(this._actual,L_.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){let e=Ss(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?Cs()===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){let n=this._actual;n.value!==t&&(this.setIgnoreSelectionChangeTime(`setValue`),n.value=t)}getSelectionStart(){return this._actual.selectionDirection===`backward`?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection===`backward`?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,n){let r=this._actual,i=null,a=Ss(r);i=a?a.activeElement:Cs();let o=Ko(i),s=i===r,c=r.selectionStart,l=r.selectionEnd;if(s&&c===t&&l===n){tt&&o.parent!==o&&r.focus();return}if(s){this.setIgnoreSelectionChangeTime(`setSelectionRange`),r.setSelectionRange(t,n),tt&&o.parent!==o&&r.focus();return}try{let e=_ne(r);this.setIgnoreSelectionChangeTime(`setSelectionRange`),r.focus(),r.setSelectionRange(t,n),vne(r,e)}catch{}}},V_=class extends w_{constructor(e,t,n){super(e,t,n),this._register(i_.addTarget(this.viewHelper.linesContentDomNode)),this._register(j(this.viewHelper.linesContentDomNode,r_.Tap,e=>this.onTap(e))),this._register(j(this.viewHelper.linesContentDomNode,r_.Change,e=>this.onChange(e))),this._register(j(this.viewHelper.linesContentDomNode,r_.Contextmenu,e=>this._onContextMenu(new gg(e,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType=`mouse`,this._register(j(this.viewHelper.linesContentDomNode,`pointerdown`,e=>{let t=e.pointerType;if(t===`mouse`){this._lastPointerType=`mouse`;return}else t===`touch`?this._lastPointerType=`touch`:this._lastPointerType=`pen`}));let r=new Cse(this.viewHelper.viewDomNode);this._register(r.onPointerMove(this.viewHelper.viewDomNode,e=>this._onMouseMove(e))),this._register(r.onPointerUp(this.viewHelper.viewDomNode,e=>this._onMouseUp(e))),this._register(r.onPointerLeave(this.viewHelper.viewDomNode,e=>this._onMouseLeave(e))),this._register(r.onPointerDown(this.viewHelper.viewDomNode,(e,t)=>this._onMouseDown(e,t)))}onTap(e){!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget)||(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){this._lastPointerType===`touch`&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),this._lastPointerType===`pen`&&this._dispatchGesture(e,!0)}_dispatchGesture(e,t){let n=this._createMouseTarget(new gg(e,!1,this.viewHelper.viewDomNode),!1);n.position&&this.viewController.dispatchMouse({position:n.position,mouseColumn:n.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:n.type===6&&n.detail.injectedText!==null})}_onMouseDown(e,t){e.browserEvent.pointerType!==`touch`&&super._onMouseDown(e,t)}},H_=class extends w_{constructor(e,t,n){super(e,t,n),this._register(i_.addTarget(this.viewHelper.linesContentDomNode)),this._register(j(this.viewHelper.linesContentDomNode,r_.Tap,e=>this.onTap(e))),this._register(j(this.viewHelper.linesContentDomNode,r_.Change,e=>this.onChange(e))),this._register(j(this.viewHelper.linesContentDomNode,r_.Contextmenu,e=>this._onContextMenu(new gg(e,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();let t=this._createMouseTarget(new gg(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){let e=document.createEvent(`CustomEvent`);e.initEvent(L_.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(e),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}},U_=class extends D{constructor(e,t,n){super(),(rn||dee&&an)&&hn.pointerEvents?this.handler=this._register(new V_(e,t,n)):Xe.TouchEvent?this.handler=this._register(new H_(e,t,n)):this.handler=this._register(new w_(e,t,n))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}},W_=class{constructor(e,t,n,r){this.configuration=e,this.viewModel=t,this.userInputEvents=n,this.commandDelegate=r}paste(e,t,n,r){this.commandDelegate.paste(e,t,n,r)}type(e){this.commandDelegate.type(e)}compositionType(e,t,n,r){this.commandDelegate.compositionType(e,t,n,r)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Jf.SetSelection.runCoreEditorCommand(this.viewModel,{source:`keyboard`,selection:e})}_validateViewColumn(e){let t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new F(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(86)){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(86)){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){let t=this.configuration.options,n=en&&t.get(121),r=t.get(28),i=t.get(171);e.middleButton&&!n?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():e.mouseDownCount===3?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):e.mouseDownCount===2?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||r?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){Jf.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Jf.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,n){e=this._validateViewColumn(e),Jf.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:`mouse`,position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:n})}_createCursor(e,t){e=this._validateViewColumn(e),Jf.CreateCursor.runCoreEditorCommand(this.viewModel,{source:`mouse`,position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Jf.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Jf.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Jf.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Jf.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Jf.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Jf.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Jf.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Jf.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Jf.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)}};function G_(e,t){let n=ct();if(n?.createTrustedTypesPolicy)try{return n.createTrustedTypesPolicy(e,t)}catch(e){dt(e);return}try{return globalThis.trustedTypes?.createPolicy(e,t)}catch(e){dt(e);return}}var K_=class{constructor(e){this._lineFactory=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){let t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new xt(`Illegal value for lineNumber`);return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;let n=this.getStartLineNumber(),r=this.getEndLineNumber();if(t<n){let n=t-e+1;return this._rendLineNumberStart-=n,null}if(e>r)return null;let i=0,a=0;for(let o=n;o<=r;o++){let n=o-this._rendLineNumberStart;e<=o&&o<=t&&(a===0?(i=n,a=1):a++)}if(e<n){let r=0;r=t<n?t-e+1:n-e,this._rendLineNumberStart-=r}return this._lines.splice(i,a)}onLinesChanged(e,t){let n=e+t-1;if(this.getCount()===0)return!1;let r=this.getStartLineNumber(),i=this.getEndLineNumber(),a=!1;for(let t=e;t<=n;t++)t>=r&&t<=i&&(this._lines[t-this._rendLineNumberStart].onContentChanged(),a=!0);return a}onLinesInserted(e,t){if(this.getCount()===0)return null;let n=t-e+1,r=this.getStartLineNumber(),i=this.getEndLineNumber();if(e<=r)return this._rendLineNumberStart+=n,null;if(e>i)return null;if(n+e>i)return this._lines.splice(e-this._rendLineNumberStart,i-e+1);let a=[];for(let e=0;e<n;e++)a[e]=this._lineFactory.createLine();let o=e-this._rendLineNumberStart,s=this._lines.slice(0,o),c=this._lines.slice(o,this._lines.length-n),l=this._lines.slice(this._lines.length-n,this._lines.length);return this._lines=s.concat(a).concat(c),l}onTokensChanged(e){if(this.getCount()===0)return!1;let t=this.getStartLineNumber(),n=this.getEndLineNumber(),r=!1;for(let i=0,a=e.length;i<a;i++){let a=e[i];if(a.toLineNumber<t||a.fromLineNumber>n)continue;let o=Math.max(t,a.fromLineNumber),s=Math.min(n,a.toLineNumber);for(let e=o;e<=s;e++){let t=e-this._rendLineNumberStart;this._lines[t].onTokensChanged(),r=!0}}return r}},q_=class{constructor(e,t){this._viewContext=e,this._lineFactory=t,this.domNode=this._createDomNode(),this._linesCollection=new K_(this._lineFactory)}_createDomNode(){let e=ip(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(165)}onFlushed(e,t){if(t){let e=this._linesCollection.getStartLineNumber(),t=this._linesCollection.getEndLineNumber();for(let n=e;n<=t;n++)this._linesCollection.getLine(n).getDomNode()?.remove()}return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){let t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,n=t.length;e<n;e++)t[e].getDomNode()?.remove();return!0}onLinesInserted(e){let t=this._linesCollection.onLinesInserted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,n=t.length;e<n;e++)t[e].getDomNode()?.remove();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){let t=this._linesCollection._get(),n=new J_(this.domNode.domNode,this._lineFactory,e,this._viewContext),r={rendLineNumberStart:t.rendLineNumberStart,lines:t.lines,linesLength:t.lines.length},i=n.render(r,e.startLineNumber,e.endLineNumber,e.relativeVerticalOffset);this._linesCollection._set(i.rendLineNumberStart,i.lines)}},J_=class e{static{this._ttPolicy=G_(`editorViewLayer`,{createHTML:e=>e})}constructor(e,t,n,r){this._domNode=e,this._lineFactory=t,this._viewportData=n,this._viewContext=r}render(e,t,n,r){let i={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(i.rendLineNumberStart+i.linesLength-1<t||n<i.rendLineNumberStart){i.rendLineNumberStart=t,i.linesLength=n-t+1,i.lines=[];for(let e=t;e<=n;e++)i.lines[e-t]=this._lineFactory.createLine();return this._finishRendering(i,!0,r),i}if(this._renderUntouchedLines(i,Math.max(t-i.rendLineNumberStart,0),Math.min(n-i.rendLineNumberStart,i.linesLength-1),r,t),i.rendLineNumberStart>t){let e=t,a=Math.min(n,i.rendLineNumberStart-1);e<=a&&(this._insertLinesBefore(i,e,a,r,t),i.linesLength+=a-e+1)}else if(i.rendLineNumberStart<t){let e=Math.min(i.linesLength,t-i.rendLineNumberStart);e>0&&(this._removeLinesBefore(i,e),i.linesLength-=e)}if(i.rendLineNumberStart=t,i.rendLineNumberStart+i.linesLength-1<n){let e=i.rendLineNumberStart+i.linesLength,a=n;e<=a&&(this._insertLinesAfter(i,e,a,r,t),i.linesLength+=a-e+1)}else if(i.rendLineNumberStart+i.linesLength-1>n){let e=Math.max(0,n-i.rendLineNumberStart+1),t=i.linesLength-1-e+1;t>0&&(this._removeLinesAfter(i,t),i.linesLength-=t)}return this._finishRendering(i,!1,r),i}_renderUntouchedLines(e,t,n,r,i){let a=e.rendLineNumberStart,o=e.lines;for(let e=t;e<=n;e++){let t=a+e;o[e].layoutLine(t,r[t-i],this._lineHeightForLineNumber(t))}}_insertLinesBefore(e,t,n,r,i){let a=[],o=0;for(let e=t;e<=n;e++)a[o++]=this._lineFactory.createLine();e.lines=a.concat(e.lines)}_removeLinesBefore(e,t){for(let n=0;n<t;n++)e.lines[n].getDomNode()?.remove();e.lines.splice(0,t)}_insertLinesAfter(e,t,n,r,i){let a=[],o=0;for(let e=t;e<=n;e++)a[o++]=this._lineFactory.createLine();e.lines=e.lines.concat(a)}_removeLinesAfter(e,t){let n=e.linesLength-t;for(let r=0;r<t;r++)e.lines[n+r].getDomNode()?.remove();e.lines.splice(n,t)}_finishRenderingNewLines(t,n,r,i){e._ttPolicy&&(r=e._ttPolicy.createHTML(r));let a=this._domNode.lastChild;n||!a?this._domNode.innerHTML=r:a.insertAdjacentHTML(`afterend`,r);let o=this._domNode.lastChild;for(let e=t.linesLength-1;e>=0;e--){let n=t.lines[e];i[e]&&(n.setDomNode(o),o=o.previousSibling)}}_finishRenderingInvalidLines(t,n,r){let i=document.createElement(`div`);e._ttPolicy&&(n=e._ttPolicy.createHTML(n)),i.innerHTML=n;for(let e=0;e<t.linesLength;e++){let n=t.lines[e];if(r[e]){let e=i.firstChild;n.getDomNode().replaceWith(e),n.setDomNode(e)}}}static{this._sb=new yd(1e5)}_finishRendering(t,n,r){let i=e._sb,a=t.linesLength,o=t.lines,s=t.rendLineNumberStart,c=[];{i.reset();let e=!1;for(let t=0;t<a;t++){let n=o[t];if(c[t]=!1,n.getDomNode())continue;let a=t+s;n.renderLine(a,r[t],this._lineHeightForLineNumber(a),this._viewportData,i)&&(c[t]=!0,e=!0)}e&&this._finishRenderingNewLines(t,n,i.build(),c)}{i.reset();let e=!1,n=[];for(let t=0;t<a;t++){let a=o[t];if(n[t]=!1,c[t])continue;let l=t+s;a.renderLine(l,r[t],this._lineHeightForLineNumber(l),this._viewportData,i)&&(n[t]=!0,e=!0)}e&&this._finishRenderingInvalidLines(t,i.build(),n)}}_lineHeightForLineNumber(e){return this._viewContext.viewLayout.getLineHeightForLineNumber(e)}},Y_=class extends yg{constructor(e){super(e),this._dynamicOverlays=[],this._isFocused=!1,this._visibleLines=new q_(this._context,{createLine:()=>new X_(this._dynamicOverlays)}),this.domNode=this._visibleLines.domNode;let t=this._context.configuration.options.get(59);ap(this.domNode,t),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}addDynamicOverlay(e){this._dynamicOverlays.push(e)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e);let t=this._context.configuration.options.get(59);return ap(this.domNode,t),!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){let t=this._dynamicOverlays.filter(e=>e.shouldRender());for(let n=0,r=t.length;n<r;n++){let r=t[n];r.prepareRender(e),r.onDidRender()}}render(e){this._viewOverlaysRender(e),this.domNode.toggleClassName(`focused`,this._isFocused)}_viewOverlaysRender(e){this._visibleLines.renderLines(e.viewportData)}},X_=class{constructor(e){this._dynamicOverlays=e,this._domNode=null,this._renderedContent=null}getDomNode(){return this._domNode?this._domNode.domNode:null}setDomNode(e){this._domNode=ip(e)}onContentChanged(){}onTokensChanged(){}renderLine(e,t,n,r,i){let a=``;for(let t=0,n=this._dynamicOverlays.length;t<n;t++){let n=this._dynamicOverlays[t];a+=n.render(r.startLineNumber,e)}return this._renderedContent===a?!1:(this._renderedContent=a,i.appendString(`<div style="top:`),i.appendString(String(t)),i.appendString(`px;height:`),i.appendString(String(n)),i.appendString(`px;line-height:`),i.appendString(String(n)),i.appendString(`px;">`),i.appendString(a),i.appendString(`</div>`),!0)}layoutLine(e,t,n){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(n),this._domNode.setLineHeight(n))}},Z_=class extends Y_{constructor(e){super(e);let t=this._context.configuration.options.get(165);this._contentWidth=t.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){let t=this._context.configuration.options.get(165);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))}},Q_=class extends Y_{constructor(e){super(e);let t=this._context.configuration.options,n=t.get(165);this._contentLeft=n.contentLeft,this.domNode.setClassName(`margin-view-overlays`),this.domNode.setWidth(1),ap(this.domNode,t.get(59))}onConfigurationChanged(e){let t=this._context.configuration.options;ap(this.domNode,t.get(59));let n=t.get(165);return this._contentLeft=n.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);let t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}},$_=class e{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){this.onKeyDown?.(e)}emitKeyUp(e){this.onKeyUp?.(e)}emitContextMenu(e){this.onContextMenu?.(this._convertViewToModelMouseEvent(e))}emitMouseMove(e){this.onMouseMove?.(this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){this.onMouseLeave?.(this._convertViewToModelMouseEvent(e))}emitMouseDown(e){this.onMouseDown?.(this._convertViewToModelMouseEvent(e))}emitMouseUp(e){this.onMouseUp?.(this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){this.onMouseDrag?.(this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){this.onMouseDrop?.(this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){this.onMouseDropCanceled?.()}emitMouseWheel(e){this.onMouseWheel?.(e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(t){return e.convertViewToModelMouseTarget(t,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){let n={...e};return n.position&&=t.convertViewPositionToModelPosition(n.position),n.range&&=t.convertViewRangeToModelRange(n.range),(n.type===5||n.type===8)&&(n.detail=this.convertViewToModelViewZoneData(n.detail,t)),n}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 F(e.afterLineNumber,1)).lineNumber}}},ev=class extends yg{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=ip(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,t=this._context.configuration.options.get(165),n=t.contentWidth-t.verticalScrollbarWidth;this.contentWidth!==n&&(this.contentWidth=n,e=!0);let r=t.contentLeft;return this.contentLeft!==r&&(this.contentLeft=r,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,n=e.getDecorationsInViewport();for(let r of n){if(!r.options.blockClassName)continue;let n=this.blocks[t];n||(n=this.blocks[t]=ip(document.createElement(`div`)),this.domNode.appendChild(n));let i,a;r.options.blockIsAfterEnd?(i=e.getVerticalOffsetAfterLineNumber(r.range.endLineNumber,!1),a=e.getVerticalOffsetAfterLineNumber(r.range.endLineNumber,!0)):(i=e.getVerticalOffsetForLineNumber(r.range.startLineNumber,!0),a=r.range.isEmpty()&&!r.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(r.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(r.range.endLineNumber,!0));let[o,s,c,l]=r.options.blockPadding??[0,0,0,0];n.setClassName(`blockDecorations-block `+r.options.blockClassName),n.setLeft(this.contentLeft-l),n.setWidth(this.contentWidth+l+s),n.setTop(i-e.scrollTop-o),n.setHeight(a-i+o+c),t++}for(let e=t;e<this.blocks.length;e++)this.blocks[e].domNode.remove();this.blocks.length=t}},tv=class extends yg{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=ip(document.createElement(`div`)),bg.write(this.domNode,1),this.domNode.setClassName(`contentWidgets`),this.domNode.setPosition(`absolute`),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=ip(document.createElement(`div`)),bg.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName(`overflowingContentWidgets`)}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){let t=Object.keys(this._widgets);for(let n of t)this._widgets[n].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(){let e=Object.keys(this._widgets);for(let t of e)this._widgets[t].updateAnchorViewPosition()}addWidget(e){let t=new nv(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,n,r,i){this._widgets[e.getId()].setPosition(t,n,r,i),this.setShouldRender()}removeWidget(e){let t=e.getId();if(this._widgets.hasOwnProperty(t)){let e=this._widgets[t];delete this._widgets[t];let n=e.domNode.domNode;n.remove(),n.removeAttribute(`monaco-visible-content-widget`),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return this._widgets.hasOwnProperty(e)?this._widgets[e].suppressMouseDown:!1}onBeforeRender(e){let t=Object.keys(this._widgets);for(let n of t)this._widgets[n].onBeforeRender(e)}prepareRender(e){let t=Object.keys(this._widgets);for(let n of t)this._widgets[n].prepareRender(e)}render(e){let t=Object.keys(this._widgets);for(let n of t)this._widgets[n].render(e)}},nv=class{constructor(e,t,n){this._primaryAnchor=new rv(null,null),this._secondaryAnchor=new rv(null,null),this._context=e,this._viewDomNode=t,this._actual=n;let r=this._context.configuration.options,i=r.get(165),a=r.get(4);this.domNode=ip(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=(this._actual.allowEditorOverflow||!1)&&a,this.suppressMouseDown=this._actual.suppressMouseDown||!1,this._fixedOverflowWidgets=r.get(51),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,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){let t=this._context.configuration.options;if(e.hasChanged(165)){let e=t.get(165);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,n){this._affinity=e,this._primaryAnchor=r(t,this._context.viewModel,this._affinity),this._secondaryAnchor=r(n,this._context.viewModel,this._affinity);function r(e,t,n){if(!e)return new rv(null,null);let r=t.model.validatePosition(e);return t.coordinatesConverter.modelPositionIsVisible(r)?new rv(e,t.coordinatesConverter.convertModelPositionToViewPosition(r,n??void 0)):new rv(e,null)}}_getMaxWidth(){let e=this.domNode.domNode.ownerDocument,t=e.defaultView;return this.allowEditorOverflow?t?.innerWidth||e.documentElement.offsetWidth||e.body.offsetWidth:this._contentWidth}setPosition(e,t,n,r){this._setPosition(r,e,t),this._preference=n,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,n,r){let i=e.top,a=i,o=e.top+e.height,s=r.viewportHeight-o,c=i-n,l=a>=n,u=o,d=s>=n,f=e.left;return f+t>r.scrollLeft+r.viewportWidth&&(f=r.scrollLeft+r.viewportWidth-t),f<r.scrollLeft&&(f=r.scrollLeft),{fitsAbove:l,aboveTop:c,fitsBelow:d,belowTop:u,left:f}}_layoutHorizontalSegmentInPage(e,t,n,r){let i=Math.max(15,t.left-r),a=Math.min(t.left+t.width+r,e.width-15),o=this._viewDomNode.domNode.ownerDocument.defaultView,s=t.left+n-(o?.scrollX??0);if(s+r>a){let e=s-(a-r);s-=e,n-=e}if(s<i){let e=s-i;s-=e,n-=e}return[n,s]}_layoutBoxInPage(e,t,n,r){let i=e.top-n,a=e.top+e.height,o=ps(this._viewDomNode.domNode),s=this._viewDomNode.domNode.ownerDocument,c=s.defaultView,l=o.top+i-(c?.scrollY??0),u=o.top+a-(c?.scrollY??0),d=ls(s.body),[f,p]=this._layoutHorizontalSegmentInPage(d,o,e.left-r.scrollLeft+this._contentLeft,t),m=l>=22,h=u+n<=d.height-22;return this._fixedOverflowWidgets?{fitsAbove:m,aboveTop:Math.max(l,22),fitsBelow:h,belowTop:u,left:p}:{fitsAbove:m,aboveTop:i,fitsBelow:h,belowTop:a,left:f}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new iv(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){return{primary:t(this._primaryAnchor.viewPosition,this._affinity),secondary:t(this._secondaryAnchor.viewPosition?.lineNumber===this._primaryAnchor.viewPosition?.lineNumber?this._secondaryAnchor.viewPosition:null,this._affinity)};function t(t,n){if(!t)return null;let r=e.visibleRangeForPosition(t);if(!r)return null;let i=t.column===1&&n===3?0:r.left;return new av(e.getVerticalOffsetForLineNumber(t.lineNumber)-e.scrollTop,i,e.getLineHeightForLineNumber(t.lineNumber))}}_reduceAnchorCoordinates(e,t,n){if(!t)return e;let r=this._context.configuration.options.get(59),i=t.left;return i=i<e.left?Math.max(i,e.left-n+r.typicalFullwidthCharacterWidth):Math.min(i,e.left+n-r.typicalFullwidthCharacterWidth),new av(e.top,i,e.height)}_prepareRenderWidget(e){if(!this._preference||this._preference.length===0)return null;let{primary:t,secondary:n}=this._getAnchorsCoordinates(e);if(!t)return{kind:`offViewport`,preserveFocus:this.domNode.domNode.contains(this.domNode.domNode.ownerDocument.activeElement)};if(this._cachedDomNodeOffsetWidth===-1||this._cachedDomNodeOffsetHeight===-1){let e=null;if(typeof this._actual.beforeRender==`function`&&(e=ov(this._actual.beforeRender,this._actual)),e)this._cachedDomNodeOffsetWidth=e.width,this._cachedDomNodeOffsetHeight=e.height;else{let e=this.domNode.domNode.getBoundingClientRect();this._cachedDomNodeOffsetWidth=Math.round(e.width),this._cachedDomNodeOffsetHeight=Math.round(e.height)}}let r=this._reduceAnchorCoordinates(t,n,this._cachedDomNodeOffsetWidth),i;i=this.allowEditorOverflow?this._layoutBoxInPage(r,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e):this._layoutBoxInViewport(r,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e);for(let e=1;e<=2;e++)for(let t of this._preference)if(t===1){if(!i)return null;if(e===2||i.fitsAbove)return{kind:`inViewport`,coordinate:new iv(i.aboveTop,i.left),position:1}}else if(t===2){if(!i)return null;if(e===2||i.fitsBelow)return{kind:`inViewport`,coordinate:new iv(i.belowTop,i.left),position:2}}else if(this.allowEditorOverflow)return{kind:`inViewport`,coordinate:this._prepareRenderWidgetAtExactPositionOverflowing(new iv(r.top,r.left)),position:0};else return{kind:`inViewport`,coordinate:new iv(r.top,r.left),position:0};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||this._renderData.kind===`offViewport`){this._isVisible&&(this.domNode.removeAttribute(`monaco-visible-content-widget`),this._isVisible=!1,this._renderData?.kind===`offViewport`&&this._renderData.preserveFocus?this.domNode.setTop(-1e3):this.domNode.setVisibility(`hidden`)),typeof this._actual.afterRender==`function`&&ov(this._actual.afterRender,this._actual,null,null);return}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`),!0),typeof this._actual.afterRender==`function`&&ov(this._actual.afterRender,this._actual,this._renderData.position,this._renderData.coordinate)}},rv=class{constructor(e,t){this.modelPosition=e,this.viewPosition=t}},iv=class{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}},av=class{constructor(e,t,n){this.top=e,this.left=t,this.height=n,this._anchorCoordinateBrand=void 0}};function ov(e,t,...n){try{return e.call(t,...n)}catch{return null}}var sv=class extends vg{},cv=pc(`themeService`);function lv(e){return{id:e}}function uv(e){switch(e){case Lg.DARK:return Rg.VS_DARK;case Lg.HIGH_CONTRAST_DARK:return Rg.HC_BLACK;case Lg.HIGH_CONTRAST_LIGHT:return Rg.HC_LIGHT;default:return Rg.VS}}var dv={ThemingContribution:`base.contributions.theming`},fv=new class extends D{constructor(){super(),this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=this._register(new k)}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),T(()=>{let t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}};il.add(dv.ThemingContribution,fv);function pv(e){return fv.onColorThemeChange(e)}var mv=class extends D{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(){}},hv=X(`editor.lineHighlightBackground`,null,C(610,`Background color for the highlight of line at the cursor position.`)),gv=X(`editor.lineHighlightBorder`,{dark:`#282828`,light:`#eeeeee`,hcDark:`#f38518`,hcLight:Bm},C(611,`Background color for the border around the line at the cursor position.`));X(`editor.rangeHighlightBackground`,{dark:`#ffffff0b`,light:`#fdff0033`,hcDark:null,hcLight:null},C(612,`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),X(`editor.rangeHighlightBorder`,{dark:null,light:null,hcDark:Vm,hcLight:Vm},C(613,`Background color of the border around highlighted ranges.`)),X(`editor.symbolHighlightBackground`,{dark:oh,light:oh,hcDark:null,hcLight:null},C(614,`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),X(`editor.symbolHighlightBorder`,{dark:null,light:null,hcDark:Vm,hcLight:Vm},C(615,`Background color of the border around highlighted symbols.`));var _v=X(`editorCursor.foreground`,{dark:`#AEAFAD`,light:J.black,hcDark:J.white,hcLight:`#0F4A85`},C(616,`Color of the editor cursor.`)),vv=X(`editorCursor.background`,null,C(617,`The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.`)),yv=X(`editorMultiCursor.primary.foreground`,_v,C(618,`Color of the primary editor cursor when multiple cursors are present.`)),bv=X(`editorMultiCursor.primary.background`,vv,C(619,`The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.`)),xv=X(`editorMultiCursor.secondary.foreground`,_v,C(620,`Color of secondary editor cursors when multiple cursors are present.`)),Sv=X(`editorMultiCursor.secondary.background`,vv,C(621,`The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.`)),Cv=X(`editorWhitespace.foreground`,{dark:`#e3e4e229`,light:`#33333333`,hcDark:`#e3e4e229`,hcLight:`#CCCCCC`},C(622,`Color of whitespace characters in the editor.`)),wv=X(`editorLineNumber.foreground`,{dark:`#858585`,light:`#237893`,hcDark:J.white,hcLight:`#292929`},C(623,`Color of editor line numbers.`)),Tv=X(`editorIndentGuide.background`,Cv,C(624,`Color of the editor indentation guides.`),!1,C(625,`'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.`)),fce=X(`editorIndentGuide.activeBackground`,Cv,C(626,`Color of the active editor indentation guides.`),!1,C(627,`'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.`)),Ev=X(`editorIndentGuide.background1`,Tv,C(628,`Color of the editor indentation guides (1).`)),pce=X(`editorIndentGuide.background2`,`#00000000`,C(629,`Color of the editor indentation guides (2).`)),mce=X(`editorIndentGuide.background3`,`#00000000`,C(630,`Color of the editor indentation guides (3).`)),hce=X(`editorIndentGuide.background4`,`#00000000`,C(631,`Color of the editor indentation guides (4).`)),gce=X(`editorIndentGuide.background5`,`#00000000`,C(632,`Color of the editor indentation guides (5).`)),_ce=X(`editorIndentGuide.background6`,`#00000000`,C(633,`Color of the editor indentation guides (6).`)),Dv=X(`editorIndentGuide.activeBackground1`,fce,C(634,`Color of the active editor indentation guides (1).`)),vce=X(`editorIndentGuide.activeBackground2`,`#00000000`,C(635,`Color of the active editor indentation guides (2).`)),yce=X(`editorIndentGuide.activeBackground3`,`#00000000`,C(636,`Color of the active editor indentation guides (3).`)),bce=X(`editorIndentGuide.activeBackground4`,`#00000000`,C(637,`Color of the active editor indentation guides (4).`)),xce=X(`editorIndentGuide.activeBackground5`,`#00000000`,C(638,`Color of the active editor indentation guides (5).`)),Sce=X(`editorIndentGuide.activeBackground6`,`#00000000`,C(639,`Color of the active editor indentation guides (6).`));X(`editorLineNumber.activeForeground`,X(`editorActiveLineNumber.foreground`,{dark:`#c6c6c6`,light:`#0B216F`,hcDark:Vm,hcLight:Vm},C(640,`Color of editor active line number`),!1,C(641,`Id is deprecated. Use 'editorLineNumber.activeForeground' instead.`)),C(642,`Color of editor active line number`));var Cce=X(`editorLineNumber.dimmedForeground`,null,C(643,`Color of the final editor line when editor.renderFinalNewline is set to dimmed.`)),wce=X(`editorRuler.foreground`,{dark:`#5A5A5A`,light:J.lightgrey,hcDark:J.white,hcLight:`#292929`},C(644,`Color of the editor rulers.`));X(`editorCodeLens.foreground`,{dark:`#999999`,light:`#919191`,hcDark:`#999999`,hcLight:`#292929`},C(645,`Foreground color of editor CodeLens`)),X(`editorBracketMatch.background`,{dark:`#0064001a`,light:`#0064001a`,hcDark:`#0064001a`,hcLight:`#0000`},C(646,`Background color behind matching brackets`)),X(`editorBracketMatch.border`,{dark:`#888`,light:`#B9B9B9`,hcDark:Bm,hcLight:Bm},C(647,`Color for matching brackets boxes`));var Tce=X(`editorOverviewRuler.border`,{dark:`#7f7f7f4d`,light:`#7f7f7f4d`,hcDark:`#7f7f7f4d`,hcLight:`#666666`},C(648,`Color of the overview ruler border.`)),Ece=X(`editorOverviewRuler.background`,null,C(649,`Background color of the editor overview ruler.`));X(`editorGutter.background`,qm,C(650,`Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.`)),X(`editorUnnecessaryCode.border`,{dark:null,light:null,hcDark:J.fromHex(`#fff`).transparent(.8),hcLight:Bm},C(651,`Border color of unnecessary (unused) source code in the editor.`));var Dce=X(`editorUnnecessaryCode.opacity`,{dark:J.fromHex(`#000a`),light:J.fromHex(`#0007`),hcDark:null,hcLight:null},C(652,`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.`));X(`editorGhostText.border`,{dark:null,light:null,hcDark:J.fromHex(`#fff`).transparent(.8),hcLight:J.fromHex(`#292929`).transparent(.8)},C(653,`Border color of ghost text in the editor.`));var Oce=X(`editorGhostText.foreground`,{dark:J.fromHex(`#ffffff56`),light:J.fromHex(`#0007`),hcDark:null,hcLight:null},C(654,`Foreground color of the ghost text in the editor.`));X(`editorGhostText.background`,null,C(655,`Background color of the ghost text in the editor.`));var Ov=X(`editorOverviewRuler.rangeHighlightForeground`,new J(new q(0,122,204,.6)),C(656,`Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations.`),!0),kce=X(`editorOverviewRuler.errorForeground`,{dark:new J(new q(255,18,18,.7)),light:new J(new q(255,18,18,.7)),hcDark:new J(new q(255,50,50,1)),hcLight:`#B5200D`},C(657,`Overview ruler marker color for errors.`)),Ace=X(`editorOverviewRuler.warningForeground`,{dark:$m,light:$m,hcDark:eh,hcLight:eh},C(658,`Overview ruler marker color for warnings.`)),jce=X(`editorOverviewRuler.infoForeground`,{dark:th,light:th,hcDark:nh,hcLight:nh},C(659,`Overview ruler marker color for infos.`)),kv=X(`editorBracketHighlight.foreground1`,{dark:`#FFD700`,light:`#0431FAFF`,hcDark:`#FFD700`,hcLight:`#0431FAFF`},C(660,`Foreground color of brackets (1). Requires enabling bracket pair colorization.`)),Av=X(`editorBracketHighlight.foreground2`,{dark:`#DA70D6`,light:`#319331FF`,hcDark:`#DA70D6`,hcLight:`#319331FF`},C(661,`Foreground color of brackets (2). Requires enabling bracket pair colorization.`)),jv=X(`editorBracketHighlight.foreground3`,{dark:`#179FFF`,light:`#7B3814FF`,hcDark:`#87CEFA`,hcLight:`#7B3814FF`},C(662,`Foreground color of brackets (3). Requires enabling bracket pair colorization.`)),Mv=X(`editorBracketHighlight.foreground4`,`#00000000`,C(663,`Foreground color of brackets (4). Requires enabling bracket pair colorization.`)),Nv=X(`editorBracketHighlight.foreground5`,`#00000000`,C(664,`Foreground color of brackets (5). Requires enabling bracket pair colorization.`)),Pv=X(`editorBracketHighlight.foreground6`,`#00000000`,C(665,`Foreground color of brackets (6). Requires enabling bracket pair colorization.`)),Mce=X(`editorBracketHighlight.unexpectedBracket.foreground`,{dark:new J(new q(255,18,18,.8)),light:new J(new q(255,18,18,.8)),hcDark:new J(new q(255,50,50,1)),hcLight:`#B5200D`},C(666,`Foreground color of unexpected brackets.`)),Nce=X(`editorBracketPairGuide.background1`,`#00000000`,C(667,`Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.`)),Pce=X(`editorBracketPairGuide.background2`,`#00000000`,C(668,`Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.`)),Fce=X(`editorBracketPairGuide.background3`,`#00000000`,C(669,`Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.`)),Ice=X(`editorBracketPairGuide.background4`,`#00000000`,C(670,`Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.`)),Lce=X(`editorBracketPairGuide.background5`,`#00000000`,C(671,`Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.`)),Rce=X(`editorBracketPairGuide.background6`,`#00000000`,C(672,`Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.`)),zce=X(`editorBracketPairGuide.activeBackground1`,`#00000000`,C(673,`Background color of active bracket pair guides (1). Requires enabling bracket pair guides.`)),Bce=X(`editorBracketPairGuide.activeBackground2`,`#00000000`,C(674,`Background color of active bracket pair guides (2). Requires enabling bracket pair guides.`)),Vce=X(`editorBracketPairGuide.activeBackground3`,`#00000000`,C(675,`Background color of active bracket pair guides (3). Requires enabling bracket pair guides.`)),Hce=X(`editorBracketPairGuide.activeBackground4`,`#00000000`,C(676,`Background color of active bracket pair guides (4). Requires enabling bracket pair guides.`)),Uce=X(`editorBracketPairGuide.activeBackground5`,`#00000000`,C(677,`Background color of active bracket pair guides (5). Requires enabling bracket pair guides.`)),Wce=X(`editorBracketPairGuide.activeBackground6`,`#00000000`,C(678,`Background color of active bracket pair guides (6). Requires enabling bracket pair guides.`));X(`editorUnicodeHighlight.border`,$m,C(679,`Border color used to highlight unicode characters.`)),X(`editorUnicodeHighlight.background`,Gae,C(680,`Background color used to highlight unicode characters.`)),pv((e,t)=>{let n=e.getColor(qm),r=e.getColor(hv),i=r&&!r.isTransparent()?r:n;i&&t.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${i}; }`)});var Fv=class extends sv{constructor(e){super(),this._context=e;let t=this._context.configuration.options,n=t.get(165);this._renderLineHighlight=t.get(110),this._renderLineHighlightOnlyWhenFocus=t.get(111),this._wordWrap=n.isViewportWrapping,this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new W(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1,t=new Set;for(let e of this._selections)t.add(e.positionLineNumber);let n=Array.from(t);n.sort((e,t)=>e-t),va(this._cursorLineNumbers,n)||(this._cursorLineNumbers=n,e=!0);let r=this._selections.every(e=>e.isEmpty());return this._selectionIsEmpty!==r&&(this._selectionIsEmpty=r,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){let t=this._context.configuration.options,n=t.get(165);return this._renderLineHighlight=t.get(110),this._renderLineHighlightOnlyWhenFocus=t.get(111),this._wordWrap=n.isViewportWrapping,this._contentLeft=n.contentLeft,this._contentWidth=n.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):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}let t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,r=[];for(let e=t;e<=n;e++){let n=e-t;r[n]=``}if(this._wordWrap){let i=this._renderOne(e,!1);for(let e of this._cursorLineNumbers){let a=this._context.viewModel.coordinatesConverter,o=a.convertViewPositionToModelPosition(new F(e,1)).lineNumber,s=a.convertModelPositionToViewPosition(new F(o,1)).lineNumber,c=a.convertModelPositionToViewPosition(new F(o,this._context.viewModel.model.getLineMaxColumn(o))).lineNumber,l=Math.max(s,t),u=Math.min(c,n);for(let e=l;e<=u;e++){let n=e-t;r[n]=i}}}let i=this._renderOne(e,!0);for(let e of this._cursorLineNumbers){if(e<t||e>n)continue;let a=e-t;r[a]=i}this._renderData=r}render(e,t){if(!this._renderData)return``;let n=t-e;return n>=this._renderData.length?``:this._renderData[n]}_shouldRenderInMargin(){return(this._renderLineHighlight===`gutter`||this._renderLineHighlight===`all`)&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight===`line`||this._renderLineHighlight===`all`)&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}},Gce=class extends Fv{_renderOne(e,t){return`<div class="${`current-line`+(this._shouldRenderInMargin()?` current-line-both`:``)+(t?` current-line-exact`:``)}" style="width:${Math.max(e.scrollWidth,this._contentWidth)}px;"></div>`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}},Kce=class extends Fv{_renderOne(e,t){return`<div class="${`current-line`+(this._shouldRenderInMargin()?` current-line-margin`:``)+(this._shouldRenderOther()?` current-line-margin-both`:``)+(this._shouldRenderInMargin()&&t?` current-line-exact-margin`:``)}" style="width:${this._contentLeft}px"></div>`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}};pv((e,t)=>{let n=e.getColor(hv);if(n&&(t.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${n}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${n}; border: none; }`)),!n||n.isTransparent()||e.defines(gv)){let n=e.getColor(gv);n&&(t.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${n}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${n}; }`),zg(e.type)&&(t.addRule(`.monaco-editor .view-overlays .current-line-exact { border-width: 1px; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }`)))}});var qce=class extends sv{constructor(e){super(),this._context=e;let t=this._context.configuration.options;this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return this._typicalHalfwidthCharacterWidth=t.get(59).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){let t=e.getDecorationsInViewport(),n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];i.options.className&&(n[r++]=i)}n=n.sort((e,t)=>{if(e.options.zIndex<t.options.zIndex)return-1;if(e.options.zIndex>t.options.zIndex)return 1;let n=e.options.className,r=t.options.className;return n<r?-1:n>r?1:U.compareRangesUsingStarts(e.range,t.range)});let i=e.visibleRange.startLineNumber,a=e.visibleRange.endLineNumber,o=[];for(let e=i;e<=a;e++){let t=e-i;o[t]=``}this._renderWholeLineDecorations(e,n,o),this._renderNormalDecorations(e,n,o),this._renderResult=o}_renderWholeLineDecorations(e,t,n){let r=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber;for(let e=0,a=t.length;e<a;e++){let a=t[e];if(!a.options.isWholeLine)continue;let o=`<div class="cdr `+a.options.className+`" style="left:0;width:100%;"></div>`,s=Math.max(a.range.startLineNumber,r),c=Math.min(a.range.endLineNumber,i);for(let e=s;e<=c;e++){let t=e-r;n[t]+=o}}}_renderNormalDecorations(e,t,n){let r=e.visibleRange.startLineNumber,i=null,a=!1,o=null,s=!1;for(let c=0,l=t.length;c<l;c++){let l=t[c];if(l.options.isWholeLine)continue;let u=l.options.className,d=!!l.options.showIfCollapsed,f=l.range;if(d&&f.endColumn===1&&f.endLineNumber!==f.startLineNumber&&(f=new U(f.startLineNumber,f.startColumn,f.endLineNumber-1,this._context.viewModel.getLineMaxColumn(f.endLineNumber-1))),i===u&&a===d&&U.areIntersectingOrTouching(o,f)){o=U.plusRange(o,f);continue}i!==null&&this._renderNormalDecoration(e,o,i,s,a,r,n),i=u,a=d,o=f,s=l.options.shouldFillLineOnLineBreak??!1}i!==null&&this._renderNormalDecoration(e,o,i,s,a,r,n)}_renderNormalDecoration(e,t,n,r,i,a,o){let s=e.linesVisibleRangesForRange(t,n===`findMatch`);if(s)for(let e=0,t=s.length;e<t;e++){let t=s[e];if(t.outsideRenderedLine)continue;let c=t.lineNumber-a;if(i&&t.ranges.length===1){let e=t.ranges[0];if(e.width<this._typicalHalfwidthCharacterWidth){let n=Math.round(e.left+e.width/2),r=Math.max(0,Math.round(n-this._typicalHalfwidthCharacterWidth/2));t.ranges[0]=new Sg(r,this._typicalHalfwidthCharacterWidth)}}for(let e=0,i=t.ranges.length;e<i;e++){let a=r&&t.continuesOnNextLine&&i===1,s=t.ranges[e],l=`<div class="cdr `+n+`" style="left:`+String(s.left)+`px;width:`+(a?`100%;`:String(s.width)+`px;`)+`"></div>`;o[c]+=l}}}render(e,t){if(!this._renderResult)return``;let n=t-e;return n<0||n>=this._renderResult.length?``:this._renderResult[n]}},Jce=class extends yg{constructor(e,t,n,r){super(e);let i=this._context.configuration.options,a=i.get(117),o=i.get(83),s=i.get(49),c=i.get(120),l=i.get(158),u={listenOnDomNode:n.domNode,className:`editor-scrollable `+uv(e.theme.type),useShadows:!1,lazyRender:!0,vertical:a.vertical,horizontal:a.horizontal,verticalHasArrows:a.verticalHasArrows,horizontalHasArrows:a.horizontalHasArrows,verticalScrollbarSize:a.verticalScrollbarSize,verticalSliderSize:a.verticalSliderSize,horizontalScrollbarSize:a.horizontalScrollbarSize,horizontalSliderSize:a.horizontalSliderSize,handleMouseWheel:a.handleMouseWheel,alwaysConsumeMouseWheel:a.alwaysConsumeMouseWheel,arrowSize:a.arrowSize,mouseWheelScrollSensitivity:o,fastScrollSensitivity:s,scrollPredominantAxis:c,scrollByPage:a.scrollByPage,inertialScroll:l};this.scrollbar=this._register(new g_(t.domNode,u,this._context.viewLayout.getScrollable())),bg.write(this.scrollbar.getDomNode(),6),this.scrollbarDomNode=ip(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition(`absolute`),this._setLayout();let d=(e,t,n)=>{let r={};{let t=e.scrollTop;t&&(r.scrollTop=this._context.viewLayout.getCurrentScrollTop()+t,e.scrollTop=0)}if(n){let t=e.scrollLeft;t&&(r.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+t,e.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(r,1)};this._register(j(n.domNode,`scroll`,e=>d(n.domNode,!0,!0))),this._register(j(t.domNode,`scroll`,e=>d(t.domNode,!0,!1))),this._register(j(r.domNode,`scroll`,e=>d(r.domNode,!0,!1))),this._register(j(this.scrollbarDomNode.domNode,`scroll`,e=>d(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){let e=this._context.configuration.options,t=e.get(165);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(81).side===`right`?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(117)||e.hasChanged(83)||e.hasChanged(49)){let e=this._context.configuration.options,t=e.get(117),n=e.get(83),r=e.get(49),i=e.get(120),a={vertical:t.vertical,horizontal:t.horizontal,verticalScrollbarSize:t.verticalScrollbarSize,horizontalScrollbarSize:t.horizontalScrollbarSize,scrollByPage:t.scrollByPage,handleMouseWheel:t.handleMouseWheel,mouseWheelScrollSensitivity:n,fastScrollSensitivity:r,scrollPredominantAxis:i};this.scrollbar.updateOptions(a)}return e.hasChanged(165)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName(`editor-scrollable `+uv(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}},Iv=class{constructor(e,t,n,r,i){this.startLineNumber=e,this.endLineNumber=t,this.className=n,this.tooltip=r,this._decorationToRenderBrand=void 0,this.zIndex=i??0}},Yce=class{constructor(e,t,n){this.className=e,this.zIndex=t,this.tooltip=n}},Xce=class{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}},Lv=class extends sv{_render(e,t,n){let r=[];for(let n=e;n<=t;n++){let t=n-e;r[t]=new Xce}if(n.length===0)return r;n.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 i=null,a=0;for(let o=0,s=n.length;o<s;o++){let s=n[o],c=s.className,l=s.zIndex,u=Math.max(s.startLineNumber,e)-e,d=Math.min(s.endLineNumber,t)-e;i===c?(u=Math.max(a+1,u),a=Math.max(a,d)):(i=c,a=d);for(let e=u;e<=a;e++)r[e].add(new Yce(c,l,s.tooltip))}return r}},Zce=class extends yg{constructor(e){super(e),this._widgets={},this._context=e;let t=this._context.configuration.options,n=t.get(165);this.domNode=ip(document.createElement(`div`)),this.domNode.setClassName(`glyph-margin-widgets`),this.domNode.setPosition(`absolute`),this.domNode.setTop(0),this._lineHeight=t.get(75),this._glyphMargin=t.get(66),this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,this._glyphMarginDecorationLaneCount=n.glyphMarginDecorationLaneCount,this._managedDomNodes=[],this._decorationGlyphsToRender=[]}dispose(){this._managedDomNodes=[],this._decorationGlyphsToRender=[],this._widgets={},super.dispose()}getWidgets(){return Object.values(this._widgets)}onConfigurationChanged(e){let t=this._context.configuration.options,n=t.get(165);return this._lineHeight=t.get(75),this._glyphMargin=t.get(66),this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,this._glyphMarginDecorationLaneCount=n.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){let t=ip(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){let n=this._widgets[e.getId()];return n.preference.lane===t.lane&&n.preference.zIndex===t.zIndex&&U.equalsRange(n.preference.range,t.range)?!1:(n.preference=t,this.setShouldRender(),!0)}removeWidget(e){let t=e.getId();if(this._widgets[t]){let e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.remove(),this.setShouldRender()}}_collectDecorationBasedGlyphRenderRequest(e,t){let n=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,i=e.getDecorationsInViewport();for(let e of i){let i=e.options.glyphMarginClassName;if(!i)continue;let a=Math.max(e.range.startLineNumber,n),o=Math.min(e.range.endLineNumber,r),s=e.options.glyphMargin?.position??Zu.Center,c=e.options.zIndex??0;for(let e=a;e<=o;e++){let n=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new F(e,0)),r=this._context.viewModel.glyphLanes.getLanesAtLine(n.lineNumber).indexOf(s);t.push(new Qce(e,r,c,i))}}}_collectWidgetBasedGlyphRenderRequest(e,t){let n=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(let e of Object.values(this._widgets)){let i=e.preference.range,{startLineNumber:a,endLineNumber:o}=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(U.lift(i));if(!a||!o||o<n||a>r)continue;let s=Math.max(a,n),c=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new F(s,0)),l=this._context.viewModel.glyphLanes.getLanesAtLine(c.lineNumber).indexOf(e.preference.lane);t.push(new $ce(s,l,e.preference.zIndex,e))}}_collectSortedGlyphRenderRequests(e){let t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((e,t)=>e.lineNumber===t.lineNumber?e.laneIndex===t.laneIndex?e.zIndex===t.zIndex?t.type===e.type?e.type===0&&t.type===0?e.className<t.className?-1:1:0:t.type-e.type:t.zIndex-e.zIndex:e.laneIndex-t.laneIndex:e.lineNumber-t.lineNumber),t}prepareRender(e){if(!this._glyphMargin){this._decorationGlyphsToRender=[];return}for(let e of Object.values(this._widgets))e.renderInfo=null;let t=new Ua(this._collectSortedGlyphRenderRequests(e)),n=[];for(;t.length>0;){let e=t.peek();if(!e)break;let r=t.takeWhile(t=>t.lineNumber===e.lineNumber&&t.laneIndex===e.laneIndex);if(!r||r.length===0)break;let i=r[0];if(i.type===0){let e=[];for(let t of r){if(t.zIndex!==i.zIndex||t.type!==i.type)break;(e.length===0||e[e.length-1]!==t.className)&&e.push(t.className)}n.push(i.accept(e.join(` `)))}else i.widget.renderInfo={lineNumber:i.lineNumber,laneIndex:i.laneIndex}}this._decorationGlyphsToRender=n}render(e){if(!this._glyphMargin){for(let e of Object.values(this._widgets))e.domNode.setDisplay(`none`);for(;this._managedDomNodes.length>0;)this._managedDomNodes.pop()?.domNode.remove();return}let t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(let n of Object.values(this._widgets))if(!n.renderInfo)n.domNode.setDisplay(`none`);else{let r=e.viewportData.relativeVerticalOffset[n.renderInfo.lineNumber-e.viewportData.startLineNumber],i=this._glyphMarginLeft+n.renderInfo.laneIndex*this._lineHeight;n.domNode.setDisplay(`block`),n.domNode.setTop(r),n.domNode.setLeft(i),n.domNode.setWidth(t),n.domNode.setHeight(this._lineHeight)}for(let n=0;n<this._decorationGlyphsToRender.length;n++){let r=this._decorationGlyphsToRender[n],i=r.lineNumber,a=e.viewportData.relativeVerticalOffset[i-e.viewportData.startLineNumber],o=this._glyphMarginLeft+r.laneIndex*this._lineHeight,s;n<this._managedDomNodes.length?s=this._managedDomNodes[n]:(s=ip(document.createElement(`div`)),this._managedDomNodes.push(s),this.domNode.appendChild(s));let c=this._context.viewLayout.getLineHeightForLineNumber(i);s.setClassName(`cgmr codicon `+r.combinedClassName),s.setPosition(`absolute`),s.setTop(a),s.setLeft(o),s.setWidth(t),s.setHeight(c)}for(;this._managedDomNodes.length>this._decorationGlyphsToRender.length;)this._managedDomNodes.pop()?.domNode.remove()}},Qce=class{constructor(e,t,n,r){this.lineNumber=e,this.laneIndex=t,this.zIndex=n,this.className=r,this.type=0}accept(e){return new ele(this.lineNumber,this.laneIndex,e)}},$ce=class{constructor(e,t,n,r){this.lineNumber=e,this.laneIndex=t,this.zIndex=n,this.widget=r,this.type=1}},ele=class{constructor(e,t,n){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=n}};function Rv(e,t,n=e.length-1){let r=tle(e,t,n);if(r!==-1)return e[r]}function tle(e,t,n=e.length-1){for(let r=n;r>=0;r--){let n=e[r];if(t(n,r))return r}return-1}function zv(e,t){let n=Bv(e,t);return n===-1?void 0:e[n]}function Bv(e,t,n=0,r=e.length){let i=n,a=r;for(;i<a;){let n=Math.floor((i+a)/2);t(e[n])?i=n+1:a=n}return i-1}function nle(e,t){let n=Vv(e,t);return n===e.length?void 0:e[n]}function Vv(e,t,n=0,r=e.length){let i=n,a=r;for(;i<a;){let n=Math.floor((i+a)/2);t(e[n])?a=n:i=n+1}return i}var Hv=class e{static{this.assertInvariants=!1}constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(t){if(e.assertInvariants){if(this._prevFindLastPredicate){for(let e of this._array)if(this._prevFindLastPredicate(e)&&!t(e))throw Error(`MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.`)}this._prevFindLastPredicate=t}let n=Bv(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=n+1,n===-1?void 0:this._array[n]}};function Uv(e,t){if(e.length===0)return;let n=e[0];for(let r=1;r<e.length;r++){let i=e[r];t(i,n)>0&&(n=i)}return n}function Wv(e,t){if(e.length===0)return;let n=e[0];for(let r=1;r<e.length;r++){let i=e[r];t(i,n)>=0&&(n=i)}return n}function Gv(e,t){return Uv(e,(e,n)=>-t(e,n))}function rle(e,t){if(e.length===0)return-1;let n=0;for(let r=1;r<e.length;r++){let i=e[r];t(i,e[n])>0&&(n=r)}return n}function ile(e,t){for(let n of e){let e=t(n);if(e!==void 0)return e}}var Kv=class extends D{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw Error(`TextModelPart is disposed!`)}};function qv(e,t){let n=0,r=0,i=e.length;for(;r<i;){let i=e.charCodeAt(r);if(i===32)n++;else if(i===9)n=n-n%t+t;else break;r++}return r===i?-1:n}var Jv;(function(e){e[e.Disabled=0]=`Disabled`,e[e.EnabledForActive=1]=`EnabledForActive`,e[e.Enabled=2]=`Enabled`})(Jv||={});var Yv=class{constructor(e,t,n,r,i,a){if(this.visibleColumn=e,this.column=t,this.className=n,this.horizontalLine=r,this.forWrappedLinesAfterColumn=i,this.forWrappedLinesBeforeOrAtColumn=a,e!==-1==(t!==-1))throw Error()}},Xv=class{constructor(e,t){this.top=e,this.endColumn=t}},ale=class extends Kv{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return qv(this.textModel.getLineContent(e+1),this.textModel.getOptions().tabSize)}getActiveIndentGuide(e,t,n){this.assertNotDisposed();let r=this.textModel.getLineCount();if(e<1||e>r)throw new xt(`Illegal value for lineNumber`);let i=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,a=!!(i&&i.offSide),o=-2,s=-1,c=-2,l=-1,u=e=>{if(o!==-1&&(o===-2||o>e-1)){o=-1,s=-1;for(let t=e-2;t>=0;t--){let e=this._computeIndentLevel(t);if(e>=0){o=t,s=e;break}}}if(c===-2){c=-1,l=-1;for(let t=e;t<r;t++){let e=this._computeIndentLevel(t);if(e>=0){c=t,l=e;break}}}},d=-2,f=-1,p=-2,m=-1,h=e=>{if(d===-2){d=-1,f=-1;for(let t=e-2;t>=0;t--){let e=this._computeIndentLevel(t);if(e>=0){d=t,f=e;break}}}if(p!==-1&&(p===-2||p<e-1)){p=-1,m=-1;for(let t=e;t<r;t++){let e=this._computeIndentLevel(t);if(e>=0){p=t,m=e;break}}}},g=0,_=!0,v=0,y=!0,b=0,x=0;for(let i=0;_||y;i++){let o=e-i,p=e+i;i>1&&(o<1||o<t)&&(_=!1),i>1&&(p>r||p>n)&&(y=!1),i>5e4&&(_=!1,y=!1);let S=-1;if(_&&o>=1){let e=this._computeIndentLevel(o-1);e>=0?(c=o-1,l=e,S=Math.ceil(e/this.textModel.getOptions().indentSize)):(u(o),S=this._getIndentLevelForWhitespaceLine(a,s,l))}let ee=-1;if(y&&p<=r){let e=this._computeIndentLevel(p-1);e>=0?(d=p-1,f=e,ee=Math.ceil(e/this.textModel.getOptions().indentSize)):(h(p),ee=this._getIndentLevelForWhitespaceLine(a,f,m))}if(i===0){x=S;continue}if(i===1){if(p<=r&&ee>=0&&x+1===ee){_=!1,g=p,v=p,b=ee;continue}if(o>=1&&S>=0&&S-1===x){y=!1,g=o,v=o,b=S;continue}if(g=e,v=e,b=x,b===0)return{startLineNumber:g,endLineNumber:v,indent:b}}_&&(S>=b?g=o:_=!1),y&&(ee>=b?v=p:y=!1)}return{startLineNumber:g,endLineNumber:v,indent:b}}getLinesBracketGuides(e,t,n,r){let i=[];for(let n=e;n<=t;n++)i.push([]);let a=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new U(e,1,t,this.textModel.getLineMaxColumn(t))).toArray(),o;n&&a.length>0&&(o=Rv((e<=n.lineNumber&&n.lineNumber<=t?a:this.textModel.bracketPairs.getBracketPairsInRange(U.fromPositions(n)).toArray()).filter(e=>U.strictContainsPosition(e.range,n)),e=>!0)?.range);let s=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,c=new Zv;for(let n of a){if(!n.closingBracketRange)continue;let a=o&&n.range.equalsRange(o);if(!a&&!r.includeInactive)continue;let l=c.getInlineClassName(n.nestingLevel,n.nestingLevelOfEqualBracketType,s)+(r.highlightActive&&a?` `+c.activeClassName:``),u=n.openingBracketRange.getStartPosition(),d=n.closingBracketRange.getStartPosition(),f=r.horizontalGuides===Jv.Enabled||r.horizontalGuides===Jv.EnabledForActive&&a;if(n.range.startLineNumber===n.range.endLineNumber){f&&i[n.range.startLineNumber-e].push(new Yv(-1,n.openingBracketRange.getEndPosition().column,l,new Xv(!1,d.column),-1,-1));continue}let p=this.getVisibleColumnFromPosition(d),m=this.getVisibleColumnFromPosition(n.openingBracketRange.getStartPosition()),h=Math.min(m,p,n.minVisibleColumnIndentation+1),g=!1;Pr(this.textModel.getLineContent(n.closingBracketRange.startLineNumber))<n.closingBracketRange.startColumn-1&&(g=!0);let _=Math.max(u.lineNumber,e),v=Math.min(d.lineNumber,t),y=+!!g;for(let t=_;t<v+y;t++)i[t-e].push(new Yv(h,-1,l,null,t===u.lineNumber?u.column:-1,t===d.lineNumber?d.column:-1));f&&(u.lineNumber>=e&&m>h&&i[u.lineNumber-e].push(new Yv(h,-1,l,new Xv(!1,u.column),-1,-1)),d.lineNumber<=t&&p>h&&i[d.lineNumber-e].push(new Yv(h,-1,l,new Xv(!g,d.column),-1,-1)))}for(let e of i)e.sort((e,t)=>e.visibleColumn-t.visibleColumn);return i}getVisibleColumnFromPosition(e){return hu.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();let n=this.textModel.getLineCount();if(e<1||e>n)throw Error(`Illegal value for startLineNumber`);if(t<1||t>n)throw Error(`Illegal value for endLineNumber`);let r=this.textModel.getOptions(),i=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,a=!!(i&&i.offSide),o=Array(t-e+1),s=-2,c=-1,l=-2,u=-1;for(let i=e;i<=t;i++){let t=i-e,d=this._computeIndentLevel(i-1);if(d>=0){s=i-1,c=d,o[t]=Math.ceil(d/r.indentSize);continue}if(s===-2){s=-1,c=-1;for(let e=i-2;e>=0;e--){let t=this._computeIndentLevel(e);if(t>=0){s=e,c=t;break}}}if(l!==-1&&(l===-2||l<i-1)){l=-1,u=-1;for(let e=i;e<n;e++){let t=this._computeIndentLevel(e);if(t>=0){l=e,u=t;break}}}o[t]=this._getIndentLevelForWhitespaceLine(a,c,u)}return o}_getIndentLevelForWhitespaceLine(e,t,n){let r=this.textModel.getOptions();return t===-1||n===-1?0:t<n?1+Math.floor(t/r.indentSize):t===n||e?Math.ceil(n/r.indentSize):1+Math.floor(n/r.indentSize)}},Zv=class{constructor(){this.activeClassName=`indent-active`}getInlineClassName(e,t,n){return this.getInlineClassNameOfLevel(n?t:e)}getInlineClassNameOfLevel(e){return`bracket-indent-guide lvl-${e%30}`}},ole=class extends sv{constructor(e){super(),this._context=e,this._primaryPosition=null;let t=this._context.configuration.options,n=t.get(166),r=t.get(59);this._spaceWidth=r.spaceWidth,this._maxIndentLeft=n.wrappingColumn===-1?-1:n.wrappingColumn*r.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(22),this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options,n=t.get(166),r=t.get(59);return this._spaceWidth=r.spaceWidth,this._maxIndentLeft=n.wrappingColumn===-1?-1:n.wrappingColumn*r.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(22),!0}onCursorStateChanged(e){let t=e.selections[0].getPosition();return this._primaryPosition?.equals(t)?!1:(this._primaryPosition=t,!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){if(!this._bracketPairGuideOptions.indentation&&this._bracketPairGuideOptions.bracketPairs===!1){this._renderResult=null;return}let t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,r=e.scrollWidth,i=this._primaryPosition,a=this.getGuidesByLine(t,Math.min(n+1,this._context.viewModel.getLineCount()),i),o=[];for(let i=t;i<=n;i++){let n=i-t,s=a[n],c=``,l=e.visibleRangeForPosition(new F(i,1))?.left??0;for(let t of s){let n=t.column===-1?l+(t.visibleColumn-1)*this._spaceWidth:e.visibleRangeForPosition(new F(i,t.column)).left;if(n>r||this._maxIndentLeft>0&&n>this._maxIndentLeft)break;let a=t.horizontalLine?t.horizontalLine.top?`horizontal-top`:`horizontal-bottom`:`vertical`,o=t.horizontalLine?(e.visibleRangeForPosition(new F(i,t.horizontalLine.endColumn))?.left??n+this._spaceWidth)-n:this._spaceWidth;c+=`<div class="core-guide ${t.className} ${a}" style="left:${n}px;width:${o}px"></div>`}o[n]=c}this._renderResult=o}getGuidesByLine(e,t,n){let r=this._bracketPairGuideOptions.bracketPairs===!1?null:this._context.viewModel.getBracketGuidesInRangeByLine(e,t,n,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?Jv.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal===`active`?Jv.EnabledForActive:Jv.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}),i=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null,a=0,o=0,s=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&n){let r=this._context.viewModel.getActiveIndentGuide(n.lineNumber,e,t);a=r.startLineNumber,o=r.endLineNumber,s=r.indent}let{indentSize:c}=this._context.viewModel.model.getOptions(),l=[];for(let n=e;n<=t;n++){let t=[];l.push(t);let u=r?r[n-e]:[],d=new Ua(u),f=i?i[n-e]:0;for(let e=1;e<=f;e++){let r=(e-1)*c+1,i=(this._bracketPairGuideOptions.highlightActiveIndentation===`always`||u.length===0)&&a<=n&&n<=o&&e===s;t.push(...d.takeWhile(e=>e.visibleColumn<r)||[]);let l=d.peek();(!l||l.visibleColumn!==r||l.horizontalLine)&&t.push(new Yv(r,-1,`core-guide-indent lvl-${(e-1)%30}`+(i?` indent-active`:``),null,-1,-1))}t.push(...d.takeWhile(e=>!0)||[])}return l}render(e,t){if(!this._renderResult)return``;let n=t-e;return n<0||n>=this._renderResult.length?``:this._renderResult[n]}};function Qv(e){if(!(e&&e.isTransparent()))return e}pv((e,t)=>{let n=[{bracketColor:kv,guideColor:Nce,guideColorActive:zce},{bracketColor:Av,guideColor:Pce,guideColorActive:Bce},{bracketColor:jv,guideColor:Fce,guideColorActive:Vce},{bracketColor:Mv,guideColor:Ice,guideColorActive:Hce},{bracketColor:Nv,guideColor:Lce,guideColorActive:Uce},{bracketColor:Pv,guideColor:Rce,guideColorActive:Wce}],r=new Zv,i=[{indentColor:Ev,indentColorActive:Dv},{indentColor:pce,indentColorActive:vce},{indentColor:mce,indentColorActive:yce},{indentColor:hce,indentColorActive:bce},{indentColor:gce,indentColorActive:xce},{indentColor:_ce,indentColorActive:Sce}],a=n.map(t=>{let n=e.getColor(t.bracketColor),r=e.getColor(t.guideColor),i=e.getColor(t.guideColorActive),a=Qv(Qv(r)??n?.transparent(.3)),o=Qv(Qv(i)??n);if(!(!a||!o))return{guideColor:a,guideColorActive:o}}).filter(Pt),o=i.map(t=>{let n=e.getColor(t.indentColor),r=e.getColor(t.indentColorActive),i=Qv(n),a=Qv(r);if(!(!i||!a))return{indentColor:i,indentColorActive:a}}).filter(Pt);if(a.length>0){for(let e=0;e<30;e++){let n=a[e%a.length];t.addRule(`.monaco-editor .${r.getInlineClassNameOfLevel(e).replace(/ /g,`.`)} { --guide-color: ${n.guideColor}; --guide-color-active: ${n.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.${r.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),t.addRule(`.monaco-editor .horizontal-top.${r.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),t.addRule(`.monaco-editor .horizontal-bottom.${r.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(o.length>0){for(let e=0;e<30;e++){let n=o[e%o.length];t.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${e} { --indent-color: ${n.indentColor}; --indent-color-active: ${n.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 $v=class e extends sv{static{this.CLASS_NAME=`line-numbers`}constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new F(1,1),this._renderResult=null,this._activeModelLineNumber=1,this._context.addEventHandler(this)}_readConfig(){let e=this._context.configuration.options;this._lineHeight=e.get(75);let t=e.get(76);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(109);let n=e.get(165);this._lineNumbersLeft=n.lineNumbersLeft,this._lineNumbersWidth=n.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){let t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let n=!1;return this._activeModelLineNumber!==this._lastCursorModelPosition.lineNumber&&(this._activeModelLineNumber=this._lastCursorModelPosition.lineNumber,n=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(n=!0),n}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}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){let t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new F(e,1));if(t.column!==1)return``;let n=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(n);if(this._renderLineNumbers===2){let e=Math.abs(this._lastCursorModelPosition.lineNumber-n);return e===0?`<span class="relative-current-line-number">`+n+`</span>`:String(e)}return this._renderLineNumbers===3?this._lastCursorModelPosition.lineNumber===n||n%10==0||n===this._context.viewModel.getLineCount()?String(n):``:String(n)}prepareRender(t){if(this._renderLineNumbers===0){this._renderResult=null;return}let n=en?this._lineHeight%2==0?` lh-even`:` lh-odd`:``,r=t.visibleRange.startLineNumber,i=t.visibleRange.endLineNumber,a=this._context.viewModel.getDecorationsInViewport(t.visibleRange).filter(e=>!!e.options.lineNumberClassName);a.sort((e,t)=>U.compareRangesUsingEnds(e.range,t.range));let o=0,s=this._context.viewModel.getLineCount(),c=[];for(let t=r;t<=i;t++){let i=t-r,l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new F(t,1)).lineNumber,u=this._getLineRenderLineNumber(t),d=``;for(;o<a.length&&a[o].range.endLineNumber<t;)o++;for(let e=o;e<a.length;e++){let{range:n,options:r}=a[e];n.startLineNumber<=t&&(d+=` `+r.lineNumberClassName)}if(!u&&!d){c[i]=``;continue}t===s&&this._context.viewModel.getLineLength(t)===0&&(this._renderFinalNewline===`off`&&(u=``),this._renderFinalNewline===`dimmed`&&(d+=` dimmed-line-number`)),l===this._activeModelLineNumber&&(d+=` active-line-number`),c[i]=`<div class="${e.CLASS_NAME}${n}${d}" style="left:${this._lineNumbersLeft}px;width:${this._lineNumbersWidth}px;">${u}</div>`}this._renderResult=c}render(e,t){if(!this._renderResult)return``;let n=t-e;return n<0||n>=this._renderResult.length?``:this._renderResult[n]}};pv((e,t)=>{let n=e.getColor(wv),r=e.getColor(Cce);r?t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${r}; }`):n&&t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n.transparent(.4)}; }`)});var ey=`monaco-mouse-cursor-text`,ty=class{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;let 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}},ny=class{constructor(e,t){this.themeType=t;let n=e.options,r=n.get(59);this.renderWhitespace=n.get(113),this.experimentalWhitespaceRendering=n.get(47),this.renderControlCharacters=n.get(108),this.spaceWidth=r.spaceWidth,this.middotWidth=r.middotWidth,this.wsmiddotWidth=r.wsmiddotWidth,this.useMonospaceOptimizations=r.isMonospace&&!n.get(40),this.canUseHalfwidthRightwardsArrow=r.canUseHalfwidthRightwardsArrow,this.lineHeight=n.get(75),this.stopRenderingLineAfter=n.get(133),this.fontLigatures=n.get(60),this.verticalScrollbarSize=n.get(117).verticalScrollbarSize,this.useGpu=n.get(46)===`on`}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.experimentalWhitespaceRendering===e.experimentalWhitespaceRendering&&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&&this.verticalScrollbarSize===e.verticalScrollbarSize&&this.useGpu===e.useGpu}},sle=class{constructor(){this._currentVisibleRange=new U(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}},cle=class{constructor(e,t,n,r,i,a,o){this.minimalReveal=e,this.lineNumber=t,this.startColumn=n,this.endColumn=r,this.startScrollTop=i,this.stopScrollTop=a,this.scrollType=o,this.type=`range`,this.minLineNumber=t,this.maxLineNumber=t}},lle=class{constructor(e,t,n,r,i){this.minimalReveal=e,this.selections=t,this.startScrollTop=n,this.stopScrollTop=r,this.scrollType=i,this.type=`selections`;let a=t[0].startLineNumber,o=t[0].endLineNumber;for(let e=1,n=t.length;e<n;e++){let n=t[e];a=Math.min(a,n.startLineNumber),o=Math.max(o,n.endLineNumber)}this.minLineNumber=a,this.maxLineNumber=o}},ule=class e extends yg{static{this.HORIZONTAL_EXTRA_PX=30}constructor(e,t,n){super(e);let r=this._context.configuration,i=this._context.configuration.options,a=i.get(59),o=i.get(166);this._lineHeight=i.get(75),this._typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this._isViewportWrapping=o.isViewportWrapping,this._revealHorizontalRightPadding=i.get(114),this._cursorSurroundingLines=i.get(35),this._cursorSurroundingLinesStyle=i.get(36),this._canUseLayerHinting=!i.get(39),this._viewLineOptions=new ny(r,this._context.theme.type),this._linesContent=n,this._textRangeRestingSpot=document.createElement(`div`),this._visibleLines=new q_(this._context,{createLine:()=>new Hg(t,this._viewLineOptions)}),this.domNode=this._visibleLines.domNode,bg.write(this.domNode,8),this.domNode.setClassName(`view-lines ${ey}`),ap(this.domNode,a),this._maxLineWidth=0,this._asyncUpdateLineWidths=new mr(()=>{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new mr(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new sle,this._horizontalRevealRequest=null,this._stickyScrollEnabled=i.get(131).enabled,this._maxNumberStickyLines=i.get(131).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(166)&&(this._maxLineWidth=0);let t=this._context.configuration.options,n=t.get(59),r=t.get(166);return this._lineHeight=t.get(75),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._isViewportWrapping=r.isViewportWrapping,this._revealHorizontalRightPadding=t.get(114),this._cursorSurroundingLines=t.get(35),this._cursorSurroundingLinesStyle=t.get(36),this._canUseLayerHinting=!t.get(39),this._stickyScrollEnabled=t.get(131).enabled,this._maxNumberStickyLines=t.get(131).maxLineCount,ap(this.domNode,n),this._onOptionsMaybeChanged(),e.hasChanged(165)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){let e=this._context.configuration,t=new ny(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;let e=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let t=e;t<=n;t++)this._visibleLines.getVisibleLine(t).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){let t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber(),r=!1;for(let e=t;e<=n;e++)r=this._visibleLines.getVisibleLine(e).onSelectionChanged()||r;return r}onDecorationsChanged(e){{let e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let n=e;n<=t;n++)this._visibleLines.getVisibleLine(n).onDecorationsChanged()}return!0}onFlushed(e){let t=this._visibleLines.onFlushed(e,this._viewLineOptions.useGpu);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){let t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(t===-1)return!1;let n=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?n={scrollTop:n.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new cle(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new lle(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;let r=Math.abs(this._context.viewLayout.getCurrentScrollTop()-n.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(n,r),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){let t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),n=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTop<t||e.scrollTop>n)&&(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){let n=this._getViewLineDomNode(e);if(n===null)return null;let r=this._getLineNumberFor(n);if(r===-1||r<1||r>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(r)===1)return new F(r,1);let i=this._visibleLines.getStartLineNumber(),a=this._visibleLines.getEndLineNumber();if(r<i||r>a)return null;let o=this._visibleLines.getVisibleLine(r).getColumnOfNodeOffset(e,t),s=this._context.viewModel.getLineMinColumn(r);return o<s&&(o=s),new F(r,o)}_getViewLineDomNode(e){for(;e&&e.nodeType===1;){if(e.className===Hg.CLASS_NAME)return e;e=e.parentElement}return null}_getLineNumberFor(e){let t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let r=t;r<=n;r++)if(e===this._visibleLines.getVisibleLine(r).getDomNode())return r;return-1}getLineWidth(e){let t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();if(e<t||e>n)return-1;let r=new ty(this.domNode.domNode,this._textRangeRestingSpot),i=this._visibleLines.getVisibleLine(e).getWidth(r);return this._updateLineWidthsSlowIfDomDidLayout(r),i}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;let n=e.endLineNumber,r=U.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!r)return null;let i=[],a=0,o=new ty(this.domNode.domNode,this._textRangeRestingSpot),s=0;t&&(s=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new F(r.startLineNumber,1)).lineNumber);let c=this._visibleLines.getStartLineNumber(),l=this._visibleLines.getEndLineNumber();for(let e=r.startLineNumber;e<=r.endLineNumber;e++){if(e<c||e>l)continue;let u=e===r.startLineNumber?r.startColumn:1,d=e!==n,f=d?this._context.viewModel.getLineMaxColumn(e):r.endColumn,p=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,u,f,o);if(p){if(t&&e<n){let t=s;if(s=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new F(e+1,1)).lineNumber,t!==s){let e=p.ranges[p.ranges.length-1];e.width+=this._typicalHalfwidthCharacterWidth,this._context.viewModel.getTextDirection(t)===Qu.RTL&&(e.left-=this._typicalHalfwidthCharacterWidth)}}i[a++]=new xg(p.outsideRenderedLine,e,Sg.from(p.ranges),d)}}return this._updateLineWidthsSlowIfDomDidLayout(o),a===0?null:i}_visibleRangesForLineRange(e,t,n){if(this.shouldRender()||e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber())return null;let r=new ty(this.domNode.domNode,this._textRangeRestingSpot),i=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,n,r);return this._updateLineWidthsSlowIfDomDidLayout(r),i}_lineIsRenderedRTL(e){return e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber()?!1:this._visibleLines.getVisibleLine(e).isRenderedRTL()}visibleRangeForPosition(e){let t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new wg(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){let t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber(),r=1,i=!0;for(let a=t;a<=n;a++){let t=this._visibleLines.getVisibleLine(a);if(e&&!t.getWidthIsFast()){i=!1;continue}r=Math.max(r,t.getWidth(null))}return i&&t===1&&n===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(r),i}_checkMonospaceFontAssumptions(){let e=-1,t=-1,n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let i=n;i<=r;i++){let n=this._visibleLines.getVisibleLine(i);if(n.needsMonospaceFontCheck()){let r=n.getWidth(null);r>t&&(t=r,e=i)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let e=n;e<=r;e++)this._visibleLines.getVisibleLine(e).onMonospaceAssumptionsInvalidated()}prepareRender(){throw Error(`Not supported`)}render(){throw 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){let t=this._horizontalRevealRequest;if(e.startLineNumber<=t.minLineNumber&&t.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();let e=this._computeScrollLeftToReveal(t);e&&(!this._isViewportWrapping&&!e.hasRTL&&this._ensureMaxLineWidth(e.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:e.scrollLeft},t.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),en&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){let e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let n=e;n<=t;n++)if(this._visibleLines.getVisibleLine(n).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain(`strict`);let t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){let t=Math.ceil(e);this._maxLineWidth<t&&(this._maxLineWidth=t,this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth))}_computeScrollTopToRevealRange(e,t,n,r,i,a){let o=e.top,s=e.height,c=o+s,l,u,d;if(i&&i.length>0){let e=i[0].startLineNumber,t=i[0].endLineNumber;for(let n=1,r=i.length;n<r;n++){let r=i[n];e=Math.min(e,r.startLineNumber),t=Math.max(t,r.endLineNumber)}l=!1,u=this._context.viewLayout.getVerticalOffsetForLineNumber(e),d=this._context.viewLayout.getVerticalOffsetForLineNumber(t)+this._lineHeight}else if(r)l=!0,u=this._context.viewLayout.getVerticalOffsetForLineNumber(r.startLineNumber),d=this._context.viewLayout.getVerticalOffsetForLineNumber(r.endLineNumber)+this._lineHeight;else return-1;let f=(t===`mouse`||n)&&this._cursorSurroundingLinesStyle==="default",p=0,m=0;if(f)n||(p=this._lineHeight);else{let e=s/this._lineHeight,t=Math.max(this._cursorSurroundingLines,this._stickyScrollEnabled?this._maxNumberStickyLines:0),n=Math.min(e/2,t);p=n*this._lineHeight,m=Math.max(0,n-1)*this._lineHeight}n||(a===0||a===4)&&(m+=this._lineHeight),u-=p,d+=m;let h;if(d-u>s){if(!l)return-1;h=u}else if(a===5||a===6)if(a===6&&o<=u&&d<=c)h=o;else{let e=Math.max(5*this._lineHeight,s*.2),t=u-e,n=d-s;h=Math.max(n,t)}else if(a===1||a===2)if(a===2&&o<=u&&d<=c)h=o;else{let e=(u+d)/2;h=Math.max(0,e-s/2)}else h=this._computeMinimumScrolling(o,c,u,d,a===3,a===4);return h}_computeScrollLeftToReveal(t){let n=this._context.viewLayout.getCurrentViewport(),r=this._context.configuration.options.get(165),i=n.left,a=i+n.width-r.verticalScrollbarWidth,o=1073741824,s=0,c=!1;if(t.type===`range`){c=this._lineIsRenderedRTL(t.lineNumber);let e=this._visibleRangesForLineRange(t.lineNumber,t.startColumn,t.endColumn);if(!e)return null;for(let t of e.ranges)o=Math.min(o,Math.round(t.left)),s=Math.max(s,Math.round(t.left+t.width))}else for(let e of t.selections){if(e.startLineNumber!==e.endLineNumber)return null;let t=this._visibleRangesForLineRange(e.startLineNumber,e.startColumn,e.endColumn);if(c||=this._lineIsRenderedRTL(e.startLineNumber),!t)return null;for(let e of t.ranges)o=Math.min(o,Math.round(e.left)),s=Math.max(s,Math.round(e.left+e.width))}return t.minimalReveal||(o=Math.max(0,o-e.HORIZONTAL_EXTRA_PX),s+=this._revealHorizontalRightPadding),t.type===`selections`&&s-o>n.width?null:{scrollLeft:this._computeMinimumScrolling(i,a,o,s),maxHorizontalOffset:s,hasRTL:c}}_computeMinimumScrolling(e,t,n,r,i,a){e|=0,t|=0,n|=0,r|=0,i=!!i,a=!!a;let o=t-e;if(r-n<o){if(i)return n;if(a)return Math.max(0,r-o);if(n<e)return n;if(r>t)return Math.max(0,r-o)}else return n;return e}},dle=class extends Lv{constructor(e){super(),this._context=e;let t=this._context.configuration.options.get(165);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){let t=this._context.configuration.options.get(165);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){let t=e.getDecorationsInViewport(),n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e],a=i.options.linesDecorationsClassName,o=i.options.zIndex;a&&(n[r++]=new Iv(i.range.startLineNumber,i.range.endLineNumber,a,i.options.linesDecorationsTooltip??null,o));let s=i.options.firstLineDecorationClassName;s&&(n[r++]=new Iv(i.range.startLineNumber,i.range.startLineNumber,s,i.options.linesDecorationsTooltip??null,o))}return n}prepareRender(e){let t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,r=this._render(t,n,this._getDecorations(e)),i=this._decorationsLeft.toString(),a=this._decorationsWidth.toString(),o=`" style="left:`+i+`px;width:`+a+`px;"></div>`,s=[];for(let e=t;e<=n;e++){let n=e-t,i=r[n].getDecorations(),a=``;for(let e of i){let t=`<div class="cldr `+e.className;e.tooltip!==null&&(t+=`" title="`+e.tooltip),t+=o,a+=t}s[n]=a}this._renderResult=s}render(e,t){return this._renderResult?this._renderResult[t-e]:``}},ry=class e extends yg{static{this.CLASS_NAME=`glyph-margin`}static{this.OUTER_CLASS_NAME=`margin`}constructor(t){super(t);let n=this._context.configuration.options,r=n.get(165);this._canUseLayerHinting=!n.get(39),this._contentLeft=r.contentLeft,this._glyphMarginLeft=r.glyphMarginLeft,this._glyphMarginWidth=r.glyphMarginWidth,this._domNode=ip(document.createElement(`div`)),this._domNode.setClassName(e.OUTER_CLASS_NAME),this._domNode.setPosition(`absolute`),this._domNode.setAttribute(`role`,`presentation`),this._domNode.setAttribute(`aria-hidden`,`true`),this._glyphMarginBackgroundDomNode=ip(document.createElement(`div`)),this._glyphMarginBackgroundDomNode.setClassName(e.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){let t=this._context.configuration.options,n=t.get(165);return this._canUseLayerHinting=!t.get(39),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain(`strict`);let t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);let n=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(n),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(n)}},fle=class extends Lv{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){let t=e.getDecorationsInViewport(),n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e],a=i.options.marginClassName,o=i.options.zIndex;a&&(n[r++]=new Iv(i.range.startLineNumber,i.range.endLineNumber,a,null,o))}return n}prepareRender(e){let t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,r=this._render(t,n,this._getDecorations(e)),i=[];for(let e=t;e<=n;e++){let n=e-t,a=r[n].getDecorations(),o=``;for(let e of a)o+=`<div class="cmdr `+e.className+`" style=""></div>`;i[n]=o}this._renderResult=i}render(e,t){return this._renderResult?this._renderResult[t-e]:``}},iy=class e{static{this.Empty=new e(0,0,0,0)}constructor(t,n,r,i){this._rgba8Brand=void 0,this.r=e._clamp(t),this.g=e._clamp(n),this.b=e._clamp(r),this.a=e._clamp(i)}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:e|0}},ple=class{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new k,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]),T(()=>{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){this._factories.get(e)?.dispose();let n=new mle(this,e,t);return this._factories.set(e,n),T(()=>{let t=this._factories.get(e);!t||t!==n||(this._factories.delete(e),t.dispose())})}async getOrCreate(e){let t=this.get(e);if(t)return t;let n=this._factories.get(e);return!n||n.isResolved?null:(await n.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;let 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}},mle=class extends D{get isResolved(){return this._isResolved}constructor(e,t,n){super(),this._registry=e,this._languageId=t,this._factory=n,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||=this._create(),this._resolvePromise}async _create(){let e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}},ay=class{constructor(e,t,n){this.offset=e,this.type=t,this.language=n,this._tokenBrand=void 0}toString(){return`(`+this.offset+`, `+this.type+`)`}},oy=class{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}},sy=class{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}},cy;(function(e){e[e.Increase=0]=`Increase`,e[e.Decrease=1]=`Decrease`})(cy||={});var ly;(function(e){let t=new Map;t.set(0,L.symbolMethod),t.set(1,L.symbolFunction),t.set(2,L.symbolConstructor),t.set(3,L.symbolField),t.set(4,L.symbolVariable),t.set(5,L.symbolClass),t.set(6,L.symbolStruct),t.set(7,L.symbolInterface),t.set(8,L.symbolModule),t.set(9,L.symbolProperty),t.set(10,L.symbolEvent),t.set(11,L.symbolOperator),t.set(12,L.symbolUnit),t.set(13,L.symbolValue),t.set(15,L.symbolEnum),t.set(14,L.symbolConstant),t.set(15,L.symbolEnum),t.set(16,L.symbolEnumMember),t.set(17,L.symbolKeyword),t.set(28,L.symbolSnippet),t.set(18,L.symbolText),t.set(19,L.symbolColor),t.set(20,L.symbolFile),t.set(21,L.symbolReference),t.set(22,L.symbolCustomColor),t.set(23,L.symbolFolder),t.set(24,L.symbolTypeParameter),t.set(25,L.account),t.set(26,L.issues),t.set(27,L.tools);function n(e){let n=t.get(e);return n||=(console.info(`No codicon found for CompletionItemKind `+e),L.symbolProperty),n}e.toIcon=n;function r(e){switch(e){case 0:return C(728,`Method`);case 1:return C(729,`Function`);case 2:return C(730,`Constructor`);case 3:return C(731,`Field`);case 4:return C(732,`Variable`);case 5:return C(733,`Class`);case 6:return C(734,`Struct`);case 7:return C(735,`Interface`);case 8:return C(736,`Module`);case 9:return C(737,`Property`);case 10:return C(738,`Event`);case 11:return C(739,`Operator`);case 12:return C(740,`Unit`);case 13:return C(741,`Value`);case 14:return C(742,`Constant`);case 15:return C(743,`Enum`);case 16:return C(744,`Enum Member`);case 17:return C(745,`Keyword`);case 18:return C(746,`Text`);case 19:return C(747,`Color`);case 20:return C(748,`File`);case 21:return C(749,`Reference`);case 22:return C(750,`Custom Color`);case 23:return C(751,`Folder`);case 24:return C(752,`Type Parameter`);case 25:return C(753,`User`);case 26:return C(754,`Issue`);case 27:return C(755,`Tool`);case 28:return C(756,`Snippet`);default:return``}}e.toLabel=r;let 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`,28),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),i.set(`tool`,27);function a(e,t){let n=i.get(e);return n===void 0&&!t&&(n=9),n}e.fromString=a})(ly||={});var uy;(function(e){e[e.Automatic=0]=`Automatic`,e[e.Explicit=1]=`Explicit`})(uy||={});var dy=class{constructor(e,t,n,r){this.range=e,this.text=t,this.completionKind=n,this.isSnippetText=r}equals(e){return U.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}},fy;(function(e){e[e.Code=1]=`Code`,e[e.Label=2]=`Label`})(fy||={});var py=class e{static fromExtensionId(t){return new e(t,void 0,void 0)}constructor(e,t,n){this.extensionId=e,this.extensionVersion=t,this.providerId=n}toString(){let e=``;return this.extensionId&&(e+=this.extensionId),this.extensionVersion&&(e+=`@${this.extensionVersion}`),this.providerId&&(e+=`:${this.providerId}`),e.length===0&&(e=`unknown`),e}toStringWithoutVersion(){let e=``;return this.extensionId&&(e+=this.extensionId),this.providerId&&(e+=`:${this.providerId}`),e}},my;(function(e){e[e.Accepted=0]=`Accepted`,e[e.Rejected=1]=`Rejected`,e[e.Ignored=2]=`Ignored`})(my||={});var hy;(function(e){e[e.Automatic=0]=`Automatic`,e[e.PasteAs=1]=`PasteAs`})(hy||={});var gy;(function(e){e[e.Invoke=1]=`Invoke`,e[e.TriggerCharacter=2]=`TriggerCharacter`,e[e.ContentChange=3]=`ContentChange`})(gy||={});var _y;(function(e){e[e.Text=0]=`Text`,e[e.Read=1]=`Read`,e[e.Write=2]=`Write`})(_y||={});function hle(e){return!!e&&Vi.isUri(e.uri)&&U.isIRange(e.range)&&(U.isIRange(e.originSelectionRange)||U.isIRange(e.targetSelectionRange))}var gle={17:C(757,`array`),16:C(758,`boolean`),4:C(759,`class`),13:C(760,`constant`),8:C(761,`constructor`),9:C(762,`enumeration`),21:C(763,`enumeration member`),23:C(764,`event`),7:C(765,`field`),0:C(766,`file`),11:C(767,`function`),10:C(768,`interface`),19:C(769,`key`),5:C(770,`method`),1:C(771,`module`),2:C(772,`namespace`),20:C(773,`null`),15:C(774,`number`),18:C(775,`object`),24:C(776,`operator`),3:C(777,`package`),6:C(778,`property`),14:C(779,`string`),22:C(780,`struct`),25:C(781,`type parameter`),12:C(782,`variable`)};function _le(e,t){return C(783,`{0} ({1})`,e,gle[t])}var vy;(function(e){let t=new Map;t.set(0,L.symbolFile),t.set(1,L.symbolModule),t.set(2,L.symbolNamespace),t.set(3,L.symbolPackage),t.set(4,L.symbolClass),t.set(5,L.symbolMethod),t.set(6,L.symbolProperty),t.set(7,L.symbolField),t.set(8,L.symbolConstructor),t.set(9,L.symbolEnum),t.set(10,L.symbolInterface),t.set(11,L.symbolFunction),t.set(12,L.symbolVariable),t.set(13,L.symbolConstant),t.set(14,L.symbolString),t.set(15,L.symbolNumber),t.set(16,L.symbolBoolean),t.set(17,L.symbolArray),t.set(18,L.symbolObject),t.set(19,L.symbolKey),t.set(20,L.symbolNull),t.set(21,L.symbolEnumMember),t.set(22,L.symbolStruct),t.set(23,L.symbolEvent),t.set(24,L.symbolOperator),t.set(25,L.symbolTypeParameter);function n(e){let n=t.get(e);return n||=(console.info(`No codicon found for SymbolKind `+e),L.symbolProperty),n}e.toIcon=n;let r=new Map;r.set(0,20),r.set(1,8),r.set(2,8),r.set(3,8),r.set(4,5),r.set(5,0),r.set(6,9),r.set(7,3),r.set(8,2),r.set(9,15),r.set(10,7),r.set(11,1),r.set(12,4),r.set(13,14),r.set(14,18),r.set(15,13),r.set(16,13),r.set(17,13),r.set(18,13),r.set(19,17),r.set(20,13),r.set(21,16),r.set(22,6),r.set(23,10),r.set(24,11),r.set(25,24);function i(e){let t=r.get(e);return t===void 0&&(console.info(`No completion kind found for SymbolKind `+e),t=20),t}e.toCompletionKind=i})(vy||={});var yy=class e{static{this.Comment=new e(`comment`)}static{this.Imports=new e(`imports`)}static{this.Region=new e(`region`)}static fromValue(t){switch(t){case`comment`:return e.Comment;case`imports`:return e.Imports;case`region`:return e.Region}return new e(t)}constructor(e){this.value=e}},by;(function(e){e[e.AIGenerated=1]=`AIGenerated`})(by||={});var xy;(function(e){e[e.Invoke=0]=`Invoke`,e[e.Automatic=1]=`Automatic`})(xy||={});var Sy;(function(e){function t(e){return!e||typeof e!=`object`?!1:typeof e.id==`string`&&typeof e.title==`string`}e.is=t})(Sy||={});var Cy;(function(e){e[e.Type=1]=`Type`,e[e.Parameter=2]=`Parameter`})(Cy||={});var vle=class{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||=this.createSupport(),this._tokenizationSupport}},wy=new ple,Ty=class e extends D{static{this._INSTANCE=null}static getInstance(){return this._INSTANCE||=Pn(new e),this._INSTANCE}constructor(){super(),this._onDidChange=new k,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(wy.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){let e=wy.getColorMap();if(!e){this._colors=[iy.Empty],this._backgroundIsLight=!0;return}this._colors=[iy.Empty];for(let t=1;t<e.length;t++){let n=e[t].rgba;this._colors[t]=new iy(n.r,n.g,n.b,Math.round(n.a*255))}let 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}},yle=(()=>{let e=[];for(let t=32;t<=126;t++)e.push(t);return e.push(65533),e})(),ble=(e,t)=>(e-=32,e<0||e>96?t<=2?(e+96)%96:95:e),Ey=class e{constructor(t,n){this.scale=n,this._minimapCharRendererBrand=void 0,this.charDataNormal=e.soften(t,12/15),this.charDataLight=e.soften(t,50/60)}static soften(e,t){let n=new Uint8ClampedArray(e.length);for(let r=0,i=e.length;r<i;r++)n[r]=Fu(e[r]*t);return n}renderChar(e,t,n,r,i,a,o,s,c,l,u){let d=1*this.scale,f=2*this.scale,p=u?1:f;if(t+d>e.width||n+p>e.height){console.warn(`bad render request outside image data`);return}let m=l?this.charDataLight:this.charDataNormal,h=ble(r,c),g=e.width*4,_=o.r,v=o.g,y=o.b,b=i.r-_,x=i.g-v,S=i.b-y,ee=Math.max(a,s),te=e.data,ne=h*d*f,re=n*g+t*4;for(let e=0;e<p;e++){let e=re;for(let t=0;t<d;t++){let t=m[ne++]/255*(a/255);te[e++]=_+b*t,te[e++]=v+x*t,te[e++]=y+S*t,te[e++]=ee}re+=g}}blockRenderChar(e,t,n,r,i,a,o,s){let c=1*this.scale,l=2*this.scale,u=s?1:l;if(t+c>e.width||n+u>e.height){console.warn(`bad render request outside image data`);return}let d=e.width*4,f=i/255*.5,p=a.r,m=a.g,h=a.b,g=r.r-p,_=r.g-m,v=r.b-h,y=p+g*f,b=m+_*f,x=h+v*f,S=Math.max(i,o),ee=e.data,te=n*d+t*4;for(let e=0;e<u;e++){let e=te;for(let t=0;t<c;t++)ee[e++]=y,ee[e++]=b,ee[e++]=x,ee[e++]=S;te+=d}}},Dy={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},Oy=e=>{let t=new Uint8ClampedArray(e.length/2);for(let n=0;n<e.length;n+=2)t[n>>1]=Dy[e[n]]<<4|Dy[e[n+1]]&15;return t},ky={1:Mn(()=>Oy(`0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792`)),2:Mn(()=>Oy(`000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126`))},xle=class e{static create(t,n){if(this.lastCreated&&t===this.lastCreated.scale&&n===this.lastFontFamily)return this.lastCreated;let r;return r=ky[t]?new Ey(ky[t](),t):e.createFromSampleData(e.createSampleData(n).data,t),this.lastFontFamily=n,this.lastCreated=r,r}static createSampleData(e){let t=document.createElement(`canvas`),n=t.getContext(`2d`);t.style.height=`16px`,t.height=16,t.width=960,t.style.width=`960px`,n.fillStyle=`#ffffff`,n.font=`bold 16px ${e}`,n.textBaseline=`middle`;let r=0;for(let e of yle)n.fillText(String.fromCharCode(e),r,16/2),r+=10;return n.getImageData(0,0,960,16)}static createFromSampleData(t,n){if(t.length!==640*96)throw Error(`Unexpected source in MinimapCharRenderer`);return new Ey(e._downsample(t,n),n)}static _downsampleChar(e,t,n,r,i){let a=1*i,o=2*i,s=r,c=0;for(let r=0;r<o;r++){let i=r/o*16,l=(r+1)/o*16;for(let r=0;r<a;r++){let o=r/a*10,u=(r+1)/a*10,d=0,f=0;for(let n=i;n<l;n++){let r=t+Math.floor(n)*3840,i=1-(n-Math.floor(n));for(let t=o;t<u;t++){let n=1-(t-Math.floor(t)),a=r+Math.floor(t)*4,o=n*i;f+=o,d+=e[a]*e[a+3]/255*o}}let p=d/f;c=Math.max(c,p),n[s++]=Fu(p)}}return c}static _downsample(e,t){let n=2*t*1*t,r=n*96,i=new Uint8ClampedArray(r),a=0,o=0,s=0;for(let r=0;r<96;r++)s=Math.max(s,this._downsampleChar(e,o,i,a,t)),a+=n,o+=40;if(s>0){let e=255/s;for(let t=0;t<r;t++)i[t]*=e}return i}},Sle=Qt?`"Segoe WPC", "Segoe UI", sans-serif`:$t?`-apple-system, BlinkMacSystemFont, sans-serif`:`system-ui, "Ubuntu", "Droid Sans", sans-serif`,Ay=class{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}};function jy(e,t){return!(t.options.hideInCommentTokens&&My(e,t)||t.options.hideInStringTokens&&Ny(e,t))}function My(e,t){return Py(e,t.range,e=>e===1)}function Ny(e,t){return Py(e,t.range,e=>e===2)}function Py(e,t,n){for(let r=t.startLineNumber;r<=t.endLineNumber;r++){let i=e.tokenization.getLineTokens(r),a=r===t.startLineNumber,o=r===t.endLineNumber,s=a?i.findTokenIndexAtOffset(t.startColumn-1):0;for(;s<i.getCount()&&!(o&&i.getStartOffset(s)>t.endColumn-1);){if(!n(i.getStandardTokenType(s)))return!1;s++}}return!0}var Cle=140,wle=2,Fy=class e{constructor(t,n,r){let i=t.options,a=i.get(163),o=i.get(165),s=o.minimap,c=i.get(59),l=i.get(81);this.renderMinimap=s.renderMinimap,this.size=l.size,this.minimapHeightIsEditorHeight=s.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=i.get(119),this.paddingTop=i.get(96).top,this.paddingBottom=i.get(96).bottom,this.showSlider=l.showSlider,this.autohide=l.autohide,this.pixelRatio=a,this.typicalHalfwidthCharacterWidth=c.typicalHalfwidthCharacterWidth,this.lineHeight=i.get(75),this.minimapLeft=s.minimapLeft,this.minimapWidth=s.minimapWidth,this.minimapHeight=o.height,this.canvasInnerWidth=s.minimapCanvasInnerWidth,this.canvasInnerHeight=s.minimapCanvasInnerHeight,this.canvasOuterWidth=s.minimapCanvasOuterWidth,this.canvasOuterHeight=s.minimapCanvasOuterHeight,this.isSampling=s.minimapIsSampling,this.editorHeight=o.height,this.fontScale=s.minimapScale,this.minimapLineHeight=s.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.sectionHeaderFontFamily=Sle,this.sectionHeaderFontSize=l.sectionHeaderFontSize*a,this.sectionHeaderLetterSpacing=l.sectionHeaderLetterSpacing,this.sectionHeaderFontColor=e._getSectionHeaderColor(n,r.getColor(1)),this.charRenderer=Mn(()=>xle.create(this.fontScale,c.fontFamily)),this.defaultBackgroundColor=r.getColor(2),this.backgroundColor=e._getMinimapBackground(n,this.defaultBackgroundColor),this.foregroundAlpha=e._getMinimapForegroundOpacity(n)}static _getMinimapBackground(e,t){let n=e.getColor(moe);return n?new iy(n.rgba.r,n.rgba.g,n.rgba.b,Math.round(255*n.rgba.a)):t}static _getMinimapForegroundOpacity(e){let t=e.getColor(hoe);return t?iy._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){let n=e.getColor(Jm);return n?new iy(n.rgba.r,n.rgba.g,n.rgba.b,Math.round(255*n.rgba.a)):t}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.sectionHeaderFontSize===e.sectionHeaderFontSize&&this.sectionHeaderLetterSpacing===e.sectionHeaderLetterSpacing&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}},Tle=class e{constructor(e,t,n,r,i,a,o,s,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=n,this._computedSliderRatio=r,this.sliderTop=i,this.sliderHeight=a,this.topPaddingLineCount=o,this.startLineNumber=s,this.endLineNumber=c}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){let t=Math.max(this.startLineNumber,e.startLineNumber),n=Math.min(this.endLineNumber,e.endLineNumber);return t>n?null:[t,n]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(t,n,r,i,a,o,s,c,l,u,d){let f=t.pixelRatio,p=t.minimapLineHeight,m=Math.floor(t.canvasInnerHeight/p),h=t.lineHeight;if(t.minimapHeightIsEditorHeight){let n=c*t.lineHeight+t.paddingTop+t.paddingBottom;t.scrollBeyondLastLine&&(n+=Math.max(0,a-t.lineHeight-t.paddingBottom));let r=Math.max(1,Math.floor(a*a/n)),i=Math.max(0,t.minimapHeight-r),o=i/(u-a),d=l*o,f=i>0,p=Math.floor(t.canvasInnerHeight/t.minimapLineHeight);return new e(l,u,f,o,d,r,Math.floor(t.paddingTop/t.lineHeight),1,Math.min(s,p))}let g;if(o&&r!==s){let e=r-n+1;g=Math.floor(e*p/f)}else{let e=a/h;g=Math.floor(e*p/f)}let _=Math.floor(t.paddingTop/h),v=Math.floor(t.paddingBottom/h);if(t.scrollBeyondLastLine){let e=a/h;v=Math.max(v,e-1)}let y;if(v>0){let e=a/h;y=(_+s+v-e-1)*p/f}else y=Math.max(0,(_+s)*p/f-g);y=Math.min(t.minimapHeight-g,y);let b=y/(u-a),x=l*b;if(m>=_+s+v)return new e(l,u,y>0,b,x,g,_,1,s);{let r;r=n>1?n+_:Math.max(1,l/h);let a,o=Math.max(1,Math.floor(r-x*f/p));o<_?(a=_-o+1,o=1):(a=0,o=Math.max(1,o-_)),d&&d.scrollHeight===u&&(d.scrollTop>l&&(o=Math.min(o,d.startLineNumber),a=Math.max(a,d.topPaddingLineCount)),d.scrollTop<l&&(o=Math.max(o,d.startLineNumber),a=Math.min(a,d.topPaddingLineCount)));let c=Math.min(s,o-a+m-1),v=(l-i)/h,y;return y=l>=t.paddingTop?(n-o+a+v)*p/f:l/t.paddingTop*(a+v)*p/f,new e(l,u,!0,b,y,g,a,o,c)}}},Iy=class e{static{this.INVALID=new e(-1)}constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}},Ly=class{constructor(e,t,n){this.renderedLayout=e,this._imageData=t,this._renderedLines=new K_({createLine:()=>Iy.INVALID}),this._renderedLines._set(e.startLineNumber,n)}linesEquals(e){if(!this.scrollEquals(e))return!1;let t=this._renderedLines._get().lines;for(let e=0,n=t.length;e<n;e++)if(t[e].dy===-1)return!1;return!0}scrollEquals(e){return this.renderedLayout.startLineNumber===e.startLineNumber&&this.renderedLayout.endLineNumber===e.endLineNumber}_get(){let 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)}},Ele=class e{constructor(t,n,r,i){this._backgroundFillData=e._createBackgroundFillData(n,r,i),this._buffers=[t.createImageData(n,r),t.createImageData(n,r)],this._lastUsedBuffer=0}getBuffer(){this._lastUsedBuffer=1-this._lastUsedBuffer;let e=this._buffers[this._lastUsedBuffer];return e.data.set(this._backgroundFillData),e}static _createBackgroundFillData(e,t,n){let r=n.r,i=n.g,a=n.b,o=n.a,s=new Uint8ClampedArray(e*t*4),c=0;for(let n=0;n<t;n++)for(let t=0;t<e;t++)s[c]=r,s[c+1]=i,s[c+2]=a,s[c+3]=o,c+=4;return s}},Ry=class e{static compute(t,n,r){if(t.renderMinimap===0||!t.isSampling)return[null,[]];let{minimapLineCount:i}=Bp.computeContainedMinimapLineCount({viewLineCount:n,scrollBeyondLastLine:t.scrollBeyondLastLine,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,height:t.editorHeight,lineHeight:t.lineHeight,pixelRatio:t.pixelRatio}),a=n/i,o=a/2;if(!r||r.minimapLines.length===0){let t=[];if(t[0]=1,i>1){for(let e=0,n=i-1;e<n;e++)t[e]=Math.round(e*a+o);t[i-1]=n}return[new e(a,t),[]]}let s=r.minimapLines,c=s.length,l=[],u=0,d=0,f=1,p=[],m=null;for(let e=0;e<i;e++){let t=Math.max(f,Math.round(e*a)),r=Math.max(t,Math.round((e+1)*a));for(;u<c&&s[u]<t;){if(p.length<10){let e=u+1+d;m&&m.type===`deleted`&&m._oldIndex===u-1?m.deleteToLineNumber++:(m={type:`deleted`,_oldIndex:u,deleteFromLineNumber:e,deleteToLineNumber:e},p.push(m)),d--}u++}let h;if(u<c&&s[u]<=r)h=s[u],u++;else if(h=e===0?1:e+1===i?n:Math.round(e*a+o),p.length<10){let t=u+1+d;m&&m.type===`inserted`&&m._i===e-1?m.insertToLineNumber++:(m={type:`inserted`,_i:e,insertFromLineNumber:t,insertToLineNumber:t},p.push(m)),d++}l[e]=h,f=h}if(p.length<10)for(;u<c;){let e=u+1+d;m&&m.type===`deleted`&&m._oldIndex===u-1?m.deleteToLineNumber++:(m={type:`deleted`,_oldIndex:u,deleteFromLineNumber:e,deleteToLineNumber:e},p.push(m)),d--,u++}else p=[{type:`flush`}];return[new e(a,l),p]}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 n=this.modelLineToMinimapLine(e)-1;for(;n>0&&this.minimapLines[n-1]>=e;)n--;let r=this.modelLineToMinimapLine(t)-1;for(;r+1<this.minimapLines.length&&this.minimapLines[r+1]<=t;)r++;if(n===r){let r=this.minimapLines[n];if(r<e||r>t)return null}return[n+1,r+1]}decorationLineRangeToMinimapLineRange(e,t){let n=this.modelLineToMinimapLine(e),r=this.modelLineToMinimapLine(t);return e!==t&&r===n&&(r===this.minimapLines.length?n>1&&n--:r++),[n,r]}onLinesDeleted(e){let t=e.toLineNumber-e.fromLineNumber+1,n=this.minimapLines.length,r=0;for(let i=this.minimapLines.length-1;i>=0&&!(this.minimapLines[i]<e.fromLineNumber);i--)this.minimapLines[i]<=e.toLineNumber?(this.minimapLines[i]=Math.max(1,e.fromLineNumber-1),n=Math.min(n,i),r=Math.max(r,i)):this.minimapLines[i]-=t;return[n,r]}onLinesInserted(e){let t=e.toLineNumber-e.fromLineNumber+1;for(let n=this.minimapLines.length-1;n>=0&&!(this.minimapLines[n]<e.fromLineNumber);n--)this.minimapLines[n]+=t}},Dle=class extends yg{constructor(e){super(e),this._sectionHeaderCache=new Sl(10,1.5),this.tokensColorTracker=Ty.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new Fy(this._context.configuration,this._context.theme,this.tokensColorTracker);let[t]=Ry.compute(this.options,this._context.viewModel.getLineCount(),null);this._samplingState=t,this._shouldCheckSampling=!1,this._actual=new Ole(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){let e=new Fy(this._context.configuration,this._context.theme,this.tokensColorTracker);return this.options.equals(e)?!1:(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():!1}onFlushed(e){return this._samplingState&&(this._shouldCheckSampling=!0),this._actual.onFlushed()}onLinesChanged(e){if(this._samplingState){let t=this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber,e.fromLineNumber+e.count-1);return t?this._actual.onLinesChanged(t[0],t[1]-t[0]+1):!1}else return this._actual.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){if(this._samplingState){let[t,n]=this._samplingState.onLinesDeleted(e);return t<=n&&this._actual.onLinesChanged(t+1,n-t+1),this._shouldCheckSampling=!0,!0}else 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(e)}onThemeChanged(e){return this._actual.onThemeChanged(),this._onOptionsMaybeChanged(),!0}onTokensChanged(e){if(this._samplingState){let t=[];for(let n of e.ranges){let e=this._samplingState.modelLineRangeToMinimapLineRange(n.fromLineNumber,n.toLineNumber);e&&t.push({fromLineNumber:e[0],toLineNumber:e[1]})}return t.length?this._actual.onTokensChanged(t):!1}else 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,n=e.visibleRange.endLineNumber;this._samplingState&&(t=this._samplingState.modelLineToMinimapLine(t),n=this._samplingState.modelLineToMinimapLine(n));let r={viewportContainsWhitespaceGaps:e.viewportData.whitespaceViewportData.length>0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:n,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(r)}_recreateLineSampling(){this._minimapSelections=null;let e=!!this._samplingState,[t,n]=Ry.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(let e of n)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();break}}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,n){if(this._samplingState){let r=[];for(let i=0,a=t-e+1;i<a;i++)n[i]?r[i]=this._context.viewModel.getViewLineData(this._samplingState.minimapLines[e+i-1]):r[i]=null;return r}return this._context.viewModel.getMinimapLinesRenderingData(e,t,n).data}getSelections(){if(this._minimapSelections===null)if(this._samplingState){this._minimapSelections=[];for(let e of this._selections){let[t,n]=this._samplingState.decorationLineRangeToMinimapLineRange(e.startLineNumber,e.endLineNumber);this._minimapSelections.push(new W(t,e.startColumn,n,e.endColumn))}}else this._minimapSelections=this._selections;return this._minimapSelections}getMinimapDecorationsInViewport(e,t){return this._getMinimapDecorationsInViewport(e,t).filter(e=>!e.options.minimap?.sectionHeaderStyle)}getSectionHeaderDecorationsInViewport(e,t){let n=this.options.sectionHeaderFontSize/this.options.minimapLineHeight;return e=Math.floor(Math.max(1,e-n)),this._getMinimapDecorationsInViewport(e,t).filter(e=>!!e.options.minimap?.sectionHeaderStyle)}_getMinimapDecorationsInViewport(e,t){let n;if(this._samplingState){let r=this._samplingState.minimapLines[e-1],i=this._samplingState.minimapLines[t-1];n=new U(r,1,i,this._context.viewModel.getLineMaxColumn(i))}else n=new U(e,1,t,this._context.viewModel.getLineMaxColumn(t));let r=this._context.viewModel.getMinimapDecorationsInRange(n);if(this._samplingState){let e=[];for(let t of r){if(!t.options.minimap)continue;let n=t.range,r=this._samplingState.modelLineToMinimapLine(n.startLineNumber),i=this._samplingState.modelLineToMinimapLine(n.endLineNumber);e.push(new Ay(new U(r,n.startColumn,i,n.endColumn),t.options))}return e}return r}getSectionHeaderText(e,t){let n=e.options.minimap?.sectionHeaderText;if(!n)return null;let r=this._sectionHeaderCache.get(n);if(r)return r;let i=t(n);return this._sectionHeaderCache.set(n,i),i}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange(`mouse`,!1,new U(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}},Ole=class e extends D{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._isMouseOverMinimap=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(Ih),this._domNode=ip(document.createElement(`div`)),bg.write(this._domNode,9),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition(`absolute`),this._domNode.setAttribute(`role`,`presentation`),this._domNode.setAttribute(`aria-hidden`,`true`),this._shadow=ip(document.createElement(`div`)),this._shadow.setClassName(`minimap-shadow-hidden`),this._domNode.appendChild(this._shadow),this._canvas=ip(document.createElement(`canvas`)),this._canvas.setPosition(`absolute`),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=ip(document.createElement(`canvas`)),this._decorationsCanvas.setPosition(`absolute`),this._decorationsCanvas.setClassName(`minimap-decorations-layer`),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=ip(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=ip(document.createElement(`div`)),this._sliderHorizontal.setPosition(`absolute`),this._sliderHorizontal.setClassName(`minimap-slider-horizontal`),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._hideDelayedScheduler=this._register(new mr(()=>this._hideImmediatelyIfMouseIsOutside(),500)),this._register($o(this._domNode.domNode,M.MOUSE_OVER,()=>{this._isMouseOverMinimap=!0})),this._register($o(this._domNode.domNode,M.MOUSE_LEAVE,()=>{this._isMouseOverMinimap=!1})),this._pointerDownListener=$o(this._domNode.domNode,M.POINTER_DOWN,e=>{e.preventDefault();let t=e.pointerType===`mouse`,n=e.button===0;if(this._model.options.renderMinimap!==0&&this._lastRenderData){if(this._model.options.size!==`proportional`){if(n&&this._lastRenderData){let t=ps(this._slider.domNode),n=t.top+t.height/2;this._startSliderDragging(e,n,this._lastRenderData.renderedLayout)}return}if(n||!t){let t=this._model.options.minimapLineHeight,n=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*e.offsetY,r=Math.floor(n/t)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;r=Math.min(r,this._model.getLineCount()),this._model.revealLineNumber(r)}}}),this._sliderPointerMoveMonitor=new hm,this._sliderPointerDownListener=$o(this._slider.domNode,M.POINTER_DOWN,e=>{e.preventDefault(),e.stopPropagation(),e.button===0&&this._lastRenderData&&this._startSliderDragging(e,e.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=i_.addTarget(this._domNode.domNode),this._sliderTouchStartListener=j(this._domNode.domNode,r_.Start,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName(`active`,!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(e))},{passive:!1}),this._sliderTouchMoveListener=j(this._domNode.domNode,r_.Change,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(e)},{passive:!1}),this._sliderTouchEndListener=$o(this._domNode.domNode,r_.End,e=>{e.preventDefault(),e.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName(`active`,!1)})}_hideSoon(){this._hideDelayedScheduler.cancel(),this._hideDelayedScheduler.schedule()}_hideImmediatelyIfMouseIsOutside(){if(this._isMouseOverMinimap){this._hideSoon();return}this._domNode.toggleClassName(`active`,!1)}_startSliderDragging(e,t,n){if(!e.target||!(e.target instanceof Element))return;let r=e.pageX;this._slider.toggleClassName(`active`,!0);let i=(e,i)=>{let a=ps(this._domNode.domNode),o=Math.min(Math.abs(i-r),Math.abs(i-a.left),Math.abs(i-a.left-a.width));if(Qt&&o>Cle){this._model.setScrollTop(n.scrollTop);return}let s=e-t;this._model.setScrollTop(n.getDesiredScrollTopFromDelta(s))};e.pageY!==t&&i(e.pageY,r),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>i(e.pageY,e.pageX),()=>{this._slider.toggleClassName(`active`,!1)})}scrollDueToTouchEvent(e){let t=this._domNode.domNode.getBoundingClientRect().top,n=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(n)}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(){let e=[`minimap`];return this._model.options.showSlider===`always`?e.push(`slider-always`):e.push(`slider-mouseover`),this._model.options.autohide===`mouseover`?e.push(`minimap-autohide-mouseover`):this._model.options.autohide===`scroll`&&e.push(`minimap-autohide-scroll`),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 Ele(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):!1}onLinesDeleted(e,t){return this._lastRenderData?.onLinesDeleted(e,t),!0}onLinesInserted(e,t){return this._lastRenderData?.onLinesInserted(e,t),!0}onScrollChanged(e){return this._model.options.autohide===`scroll`&&(e.scrollTopChanged||e.scrollHeightChanged)&&(this._domNode.toggleClassName(`active`,!0),this._hideSoon()),this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(Ih),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===0){this._shadow.setClassName(`minimap-shadow-hidden`),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName(`minimap-shadow-hidden`):this._shadow.setClassName(`minimap-shadow-visible`);let t=Tle.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;let t=this._model.getSelections();t.sort(U.compareRangesUsingStarts);let n=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);n.sort((e,t)=>(e.options.zIndex||0)-(t.options.zIndex||0));let{canvasInnerWidth:r,canvasInnerHeight:i}=this._model.options,a=this._model.options.minimapLineHeight,o=this._model.options.minimapCharWidth,s=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext(`2d`);c.clearRect(0,0,r,i);let l=new zy(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,l,e,a),this._renderDecorationsLineHighlights(c,n,l,e,a);let u=new zy(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,u,e,a,s,o,r),this._renderDecorationsHighlights(c,n,u,e,a,s,o,r),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,n,r,i){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let a=0,o=0;for(let s of t){let t=r.intersectWithViewport(s);if(!t)continue;let[c,l]=t;for(let e=c;e<=l;e++)n.set(e,!0);let u=r.getYForLineNumber(c,i),d=r.getYForLineNumber(l,i);o>=u?o=d:(o>a&&e.fillRect(8,a,e.canvas.width,o-a),a=u,o=d)}o>a&&e.fillRect(8,a,e.canvas.width,o-a)}_renderDecorationsLineHighlights(e,t,n,r,i){let a=new Map;for(let o=t.length-1;o>=0;o--){let s=t[o],c=s.options.minimap;if(!c||c.position!==1)continue;let l=r.intersectWithViewport(s.range);if(!l)continue;let[u,d]=l,f=c.getColor(this._theme.value);if(!f||f.isTransparent())continue;let p=a.get(f.toString());p||(p=f.transparent(.5).toString(),a.set(f.toString(),p)),e.fillStyle=p;for(let t=u;t<=d;t++){if(n.has(t))continue;n.set(t,!0);let a=r.getYForLineNumber(u,i);e.fillRect(8,a,e.canvas.width,i)}}}_renderSelectionsHighlights(e,t,n,r,i,a,o,s){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(let c of t){let t=r.intersectWithViewport(c);if(!t)continue;let[l,u]=t;for(let t=l;t<=u;t++)this.renderDecorationOnLine(e,n,c,this._selectionColor,r,t,i,i,a,o,s)}}_renderDecorationsHighlights(e,t,n,r,i,a,o,s){for(let c of t){let t=c.options.minimap;if(!t)continue;let l=r.intersectWithViewport(c.range);if(!l)continue;let[u,d]=l,f=t.getColor(this._theme.value);if(!(!f||f.isTransparent()))for(let l=u;l<=d;l++)switch(t.position){case 1:this.renderDecorationOnLine(e,n,c.range,f,r,l,i,i,a,o,s);continue;case 2:{let t=r.getYForLineNumber(l,i);this.renderDecoration(e,f,2,t,wle,i);continue}}}}renderDecorationOnLine(e,t,n,r,i,a,o,s,c,l,u){let d=i.getYForLineNumber(a,s);if(d+o<0||d>this._model.options.canvasInnerHeight)return;let{startLineNumber:f,endLineNumber:p}=n,m=f===a?n.startColumn:1,h=p===a?n.endColumn:this._model.getLineMaxColumn(a),g=this.getXOffsetForPosition(t,a,m,c,l,u),_=this.getXOffsetForPosition(t,a,h,c,l,u);this.renderDecoration(e,r,g,d,_-g,o)}getXOffsetForPosition(e,t,n,r,i,a){if(n===1)return 8;if((n-1)*i>=a)return a;let o=e.get(t);if(!o){let n=this._model.getLineContent(t);o=[8];let s=8;for(let e=1;e<n.length+1;e++){let t=n.charCodeAt(e-1),c=t===9?r*i:ci(t)?2*i:i,l=s+c;if(l>=a){o[e]=a;break}o[e]=l,s=l}e.set(t,o)}return n-1<o.length?o[n-1]:a}renderDecoration(e,t,n,r,i,a){e.fillStyle=t&&t.toString()||``,e.fillRect(n,r,i,a)}_renderSectionHeaders(t){let n=this._model.options.minimapLineHeight,r=this._model.options.sectionHeaderFontSize,i=this._model.options.sectionHeaderLetterSpacing,a=r*1.5,{canvasInnerWidth:o}=this._model.options,s=this._model.options.backgroundColor,c=`rgb(${s.r} ${s.g} ${s.b} / .7)`,l=this._model.options.sectionHeaderFontColor,u=`rgb(${l.r} ${l.g} ${l.b})`,d=u,f=this._decorationsCanvas.domNode.getContext(`2d`);f.letterSpacing=i+`px`,f.font=`500 `+r+`px `+this._model.options.sectionHeaderFontFamily,f.strokeStyle=d,f.lineWidth=.4;let p=this._model.getSectionHeaderDecorationsInViewport(t.startLineNumber,t.endLineNumber);p.sort((e,t)=>e.range.startLineNumber-t.range.startLineNumber);let m=e._fitSectionHeader.bind(null,f,o-8);for(let i of p){let s=t.getYForLineNumber(i.range.startLineNumber,n)+r,l=s-r,d=l+2,p=this._model.getSectionHeaderText(i,m);e._renderSectionLabel(f,p,i.options.minimap?.sectionHeaderStyle===2,c,u,o,l,a,s,d)}}static _fitSectionHeader(e,t,n){if(!n)return n;let r=e.measureText(n).width,i=e.measureText(`…`).width;if(r<=t||r<=i)return n;let a=n.length,o=r/n.length,s=Math.floor((t-i)/o)-1,c=Math.ceil(s/2);for(;c>0&&/\s/.test(n[c-1]);)--c;return n.substring(0,c)+`…`+n.substring(a-(s-c))}static _renderSectionLabel(e,t,n,r,i,a,o,s,c,l){t&&(e.fillStyle=r,e.fillRect(0,o,a,s),e.fillStyle=i,e.fillText(t,8,c)),n&&(e.beginPath(),e.moveTo(0,l),e.lineTo(a,l),e.closePath(),e.stroke())}renderLines(t){let n=t.startLineNumber,r=t.endLineNumber,i=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(t)){let e=this._lastRenderData._get();return new Ly(t,e.imageData,e.lines)}let a=this._getBuffer();if(!a)return null;let[o,s,c]=e._renderUntouchedLines(a,t.topPaddingLineCount,n,r,i,this._lastRenderData),l=this._model.getMinimapLinesRenderingData(n,r,c),u=this._model.getOptions().tabSize,d=this._model.options.defaultBackgroundColor,f=this._model.options.backgroundColor,p=this._model.options.foregroundAlpha,m=this._model.tokensColorTracker,h=m.backgroundIsLight(),g=this._model.options.renderMinimap,_=this._model.options.charRenderer(),v=this._model.options.fontScale,y=this._model.options.minimapCharWidth,b=(g===1?2:3)*v,x=i>b?Math.floor((i-b)/2):0,S=f.a/255,ee=new iy(Math.round((f.r-d.r)*S+d.r),Math.round((f.g-d.g)*S+d.g),Math.round((f.b-d.b)*S+d.b),255),te=t.topPaddingLineCount*i,ne=[];for(let t=0,o=r-n+1;t<o;t++)c[t]&&e._renderLine(a,ee,f.a,h,g,y,m,p,_,te,x,u,l[t],v,i),ne[t]=new Iy(te),te+=i;let re=o===-1?0:o,ie=(s===-1?a.height:s)-re;return this._canvas.domNode.getContext(`2d`).putImageData(a,0,0,0,re,a.width,ie),new Ly(t,a,ne)}static _renderUntouchedLines(e,t,n,r,i,a){let o=[];if(!a){for(let e=0,t=r-n+1;e<t;e++)o[e]=!0;return[-1,-1,o]}let s=a._get(),c=s.imageData.data,l=s.rendLineNumberStart,u=s.lines,d=u.length,f=e.width,p=e.data,m=(r-n+1)*i*f*4,h=-1,g=-1,_=-1,v=-1,y=-1,b=-1,x=t*i;for(let e=n;e<=r;e++){let t=e-n,r=e-l,a=r>=0&&r<d?u[r].dy:-1;if(a===-1){o[t]=!0,x+=i;continue}let s=a*f*4,S=(a+i)*f*4,ee=x*f*4,te=(x+i)*f*4;v===s&&b===ee?(v=S,b=te):(_!==-1&&(p.set(c.subarray(_,v),y),h===-1&&_===0&&_===y&&(h=v),g===-1&&v===m&&_===y&&(g=_)),_=s,v=S,y=ee,b=te),o[t]=!1,x+=i}return _!==-1&&(p.set(c.subarray(_,v),y),h===-1&&_===0&&_===y&&(h=v),g===-1&&v===m&&_===y&&(g=_)),[h===-1?-1:h/(f*4),g===-1?-1:g/(f*4),o]}static _renderLine(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){let h=f.content,g=f.tokens,_=e.width-a,v=m===1,y=8,b=0,x=0;for(let f=0,m=g.getCount();f<m;f++){let m=g.getEndOffset(f),S=g.getForeground(f),ee=o.getColor(S);for(;b<m;b++){if(y>_)return;let o=h.charCodeAt(b);if(o===9){let e=d-(b+x)%d;x+=e-1,y+=e*a}else if(o===32)y+=a;else{let d=ci(o)?2:1;for(let f=0;f<d;f++)if(i===2?c.blockRenderChar(e,y,l+u,ee,s,t,n,v):c.renderChar(e,y,l+u,o,ee,s,t,n,p,r,v),y+=a,y>_)return}}}}},zy=class{constructor(e,t,n){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=n,this._values=[];for(let e=0,t=this._endLineNumber-this._startLineNumber+1;e<t;e++)this._values[e]=n}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]}},kle=class extends yg{constructor(e,t){super(e),this._viewDomNode=t;let n=this._context.configuration.options.get(165);this._widgets={},this._verticalScrollbarWidth=n.verticalScrollbarWidth,this._minimapWidth=n.minimap.minimapWidth,this._horizontalScrollbarHeight=n.horizontalScrollbarHeight,this._editorHeight=n.height,this._editorWidth=n.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=ip(document.createElement(`div`)),bg.write(this._domNode,4),this._domNode.setClassName(`overlayWidgets`),this.overflowingOverlayWidgetsDomNode=ip(document.createElement(`div`)),bg.write(this.overflowingOverlayWidgetsDomNode,5),this.overflowingOverlayWidgetsDomNode.setClassName(`overflowingOverlayWidgets`)}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){let t=this._context.configuration.options.get(165);return this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,!0}_widgetCanOverflow(e){let t=this._context.configuration.options.get(4);return(e.allowEditorOverflow||!1)&&t}addWidget(e){let t=ip(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition(`absolute`),t.setAttribute(`widgetId`,e.getId()),this._widgetCanOverflow(e)?this.overflowingOverlayWidgetsDomNode.appendChild(t):this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){let n=this._widgets[e.getId()],r=t?t.preference:null,i=t?.stackOridinal;return n.preference===r&&n.stack===i?(this._updateMaxMinWidth(),!1):(n.preference=r,n.stack=i,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){let t=e.getId();if(this._widgets.hasOwnProperty(t)){let e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){let e=0,t=Object.keys(this._widgets);for(let n=0,r=t.length;n<r;n++){let r=t[n],i=this._widgets[r].widget.getMinContentWidthInPx?.();i!==void 0&&(e=Math.max(e,i))}this._context.viewLayout.setOverlayWidgetsMinWidth(e)}_renderWidget(e,t){let n=e.domNode;if(e.preference===null){n.setTop(``);return}let r=2*this._verticalScrollbarWidth+this._minimapWidth;if(e.preference===0||e.preference===1){if(e.preference===1){let e=n.domNode.clientHeight;n.setTop(this._editorHeight-e-2*this._horizontalScrollbarHeight)}else n.setTop(0);e.stack===void 0?n.setRight(r):(n.setTop(t[e.preference]),t[e.preference]+=n.domNode.clientWidth)}else if(e.preference===2)n.domNode.style.right=`50%`,e.stack===void 0?n.setTop(0):(n.setTop(t[2]),t[2]+=n.domNode.clientHeight);else{let{top:t,left:r}=e.preference;if(this._context.configuration.options.get(51)&&this._widgetCanOverflow(e.widget)){let e=this._viewDomNodeRect;n.setTop(t+e.top),n.setLeft(r+e.left),n.setPosition(`fixed`)}else n.setTop(t),n.setLeft(r),n.setPosition(`absolute`)}}prepareRender(e){this._viewDomNodeRect=ps(this._viewDomNode.domNode)}render(e){this._domNode.setWidth(this._editorWidth);let t=Object.keys(this._widgets),n=Array.from({length:3},()=>0);t.sort((e,t)=>(this._widgets[e].stack||0)-(this._widgets[t].stack||0));for(let e=0,r=t.length;e<r;e++){let r=t[e];this._renderWidget(this._widgets[r],n)}}},By=class{constructor(e,t,n,r){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=n|0,this.height=r|0}},Ale=class{constructor(e,t){this.tabSize=e,this.data=t}},Vy=class{constructor(e,t,n,r,i,a,o){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=n,this.maxColumn=r,this.startVisibleColumn=i,this.tokens=a,this.inlineDecorations=o}},Hy=class e{constructor(t,n,r,i,a,o,s,c,l,u,d,f){this.minColumn=t,this.maxColumn=n,this.content=r,this.continuesWithWrappedLine=i,this.isBasicASCII=e.isBasicASCII(r,o),this.containsRTL=e.containsRTL(r,this.isBasicASCII,a),this.tokens=s,this.inlineDecorations=c,this.tabSize=l,this.startVisibleColumn=u,this.textDirection=d,this.hasVariableFonts=f}static isBasicASCII(e,t){return t?ai(e):!0}static containsRTL(e,t,n){return!t&&n?ii(e):!1}},Uy=class e{constructor(e,t,n){this.color=e,this.zIndex=t,this.data=n}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.color<t.color?-1:+(e.color>t.color):e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&va(e.data,t.data)}static equalsArr(t,n){return va(t,n,e.equals)}},jle=class{constructor(e,t){let n=e.options;this.lineHeight=n.get(75),this.pixelRatio=n.get(163),this.overviewRulerLanes=n.get(95),this.renderBorder=n.get(94);let r=t.getColor(Tce);this.borderColor=r?r.toString():null,this.hideCursor=n.get(68);let i=t.getColor(_v);this.cursorColorSingle=i?i.transparent(.7).toString():null;let a=t.getColor(yv);this.cursorColorPrimary=a?a.transparent(.7).toString():null;let o=t.getColor(xv);this.cursorColorSecondary=o?o.transparent(.7).toString():null,this.themeType=t.type;let s=n.get(81),c=s.enabled,l=s.side,u=t.getColor(Ece),d=wy.getDefaultBackground();u?this.backgroundColor=u:c&&l===`right`?this.backgroundColor=d:this.backgroundColor=null;let f=n.get(165).overviewRuler;this.top=f.top,this.right=f.right,this.domWidth=f.width,this.domHeight=f.height,this.overviewRulerLanes===0?(this.canvasWidth=0,this.canvasHeight=0):(this.canvasWidth=this.domWidth*this.pixelRatio|0,this.canvasHeight=this.domHeight*this.pixelRatio|0);let[p,m]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=p,this.w=m}_initLanes(e,t,n){let r=t-e;if(n>=3){let t=Math.floor(r/3),n=Math.floor(r/3),i=r-t-n,a=e,o=a+t;return[[0,a,o,a,a+t+i,a,o,a],[0,t,i,t+i,n,t+i+n,i+n,t+i+n]]}else if(n===2){let t=Math.floor(r/2),n=r-t,i=e;return[[0,i,i,i,i+t,i,i,i],[0,t,t,t,n,t+n,t+n,t+n]]}else{let t=e,n=r;return[[0,t,t,t,t,t,t,t],[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.cursorColorSingle===e.cursorColorSingle&&this.cursorColorPrimary===e.cursorColorPrimary&&this.cursorColorSecondary===e.cursorColorSecondary&&this.themeType===e.themeType&&J.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}},Mle=class extends yg{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=ip(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=wy.onDidChange(e=>{e.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[{position:new F(1,1),color:this._settings.cursorColorSingle}]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){let t=new jle(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(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():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,n=e.selections.length;t<n;t++){let r=this._settings.cursorColorSingle;n>1&&(r=t===0?this._settings.cursorColorPrimary:this._settings.cursorColorSecondary),this._cursorPositions.push({position:e.selections[t].getPosition(),color:r})}return this._cursorPositions.sort((e,t)=>F.compare(e.position,t.position)),this._markRenderingIsMaybeNeeded()}onDecorationsChanged(e){return e.affectsOverviewRuler?this._markRenderingIsMaybeNeeded():!1}onFlushed(e){return this._markRenderingIsNeeded()}onScrollChanged(e){return e.scrollHeightChanged?this._markRenderingIsNeeded():!1}onZonesChanged(e){return this._markRenderingIsNeeded()}onThemeChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render(),this._actualShouldRender=0}_render(){let e=this._settings.backgroundColor;if(this._settings.overviewRulerLanes===0){this._domNode.setBackgroundColor(e?J.Format.CSS.formatHexA(e):``),this._domNode.setDisplay(`none`);return}let t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(Uy.compareByRenderingProps),this._actualShouldRender===1&&!Uy.equalsArr(this._renderedDecorations,t)&&(this._actualShouldRender=2),this._actualShouldRender===1&&!va(this._renderedCursorPositions,this._cursorPositions,(e,t)=>e.position.lineNumber===t.position.lineNumber&&e.color===t.color)&&(this._actualShouldRender=2),this._actualShouldRender===1)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay(`block`);let n=this._settings.canvasWidth,r=this._settings.canvasHeight,i=this._settings.lineHeight,a=this._context.viewLayout,o=r/this._context.viewLayout.getScrollHeight(),s=6*this._settings.pixelRatio|0,c=s/2|0,l=this._domNode.domNode.getContext(`2d`);e?e.isOpaque()?(l.fillStyle=J.Format.CSS.formatHexA(e),l.fillRect(0,0,n,r)):(l.clearRect(0,0,n,r),l.fillStyle=J.Format.CSS.formatHexA(e),l.fillRect(0,0,n,r)):l.clearRect(0,0,n,r);let u=this._settings.x,d=this._settings.w;for(let e of t){let t=e.color,n=e.data;l.fillStyle=t;let f=0,p=0,m=0;for(let e=0,t=n.length/3;e<t;e++){let t=n[3*e],h=n[3*e+1],g=n[3*e+2],_=a.getVerticalOffsetForLineNumber(h)*o|0,v=(a.getVerticalOffsetForLineNumber(g)+i)*o|0;if(v-_<s){let e=(_+v)/2|0;e<c?e=c:e+c>r&&(e=r-c),_=e-c,v=e+c}_>m+1||t!==f?(e!==0&&l.fillRect(u[f],p,d[f],m-p),f=t,p=_,m=v):v>m&&(m=v)}l.fillRect(u[f],p,d[f],m-p)}if(!this._settings.hideCursor){let e=2*this._settings.pixelRatio|0,t=e/2|0,n=this._settings.x[7],i=this._settings.w[7],s=-100,c=-100,u=null;for(let d=0,f=this._cursorPositions.length;d<f;d++){let f=this._cursorPositions[d].color;if(!f)continue;let p=this._cursorPositions[d].position,m=a.getVerticalOffsetForLineNumber(p.lineNumber)*o|0;m<t?m=t:m+t>r&&(m=r-t);let h=m-t,g=h+e;h>c+1||f!==u?(d!==0&&u&&l.fillRect(n,s,i,c-s),s=h,c=g):g>c&&(c=g),u=f,l.fillStyle=f}u&&l.fillRect(n,s,i,c-s)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(l.beginPath(),l.lineWidth=1,l.strokeStyle=this._settings.borderColor,l.moveTo(0,0),l.lineTo(0,r),l.moveTo(1,0),l.lineTo(n,0),l.stroke())}},Wy=class{constructor(e,t,n){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=n|0}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}},Gy=class{constructor(e,t,n,r){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=n,this.color=r,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}},Nle=class{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(Gy.compare)}setLineHeight(e){return this._lineHeight===e?!1:(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?!1:(this._domWidth=e,this._colorZonesInvalid=!0,!0)}getDOMHeight(){return this._domHeight}getCanvasHeight(){return this._domHeight*this._pixelRatio}setDOMHeight(e){return this._domHeight===e?!1:(this._domHeight=e,this._colorZonesInvalid=!0,!0)}getOuterHeight(){return this._outerHeight}setOuterHeight(e){return this._outerHeight===e?!1:(this._outerHeight=e,this._colorZonesInvalid=!0,!0)}resolveColorZones(){let e=this._colorZonesInvalid,t=Math.floor(this._lineHeight),n=Math.floor(this.getCanvasHeight()),r=n/Math.floor(this._outerHeight),i=Math.floor(4*this._pixelRatio/2),a=[];for(let o=0,s=this._zones.length;o<s;o++){let s=this._zones[o];if(!e){let e=s.getColorZones();if(e){a.push(e);continue}}let c=this._getVerticalOffsetForLine(s.startLineNumber),l=s.heightInLines===0?this._getVerticalOffsetForLine(s.endLineNumber)+t:c+s.heightInLines*t,u=Math.floor(r*c),d=Math.floor(r*l),f=Math.floor((u+d)/2),p=d-f;p<i&&(p=i),f-p<0&&(f=p),f+p>n&&(f=n-p);let m=s.color,h=this._color2Id[m];h||(h=++this._lastAssignedId,this._color2Id[m]=h,this._id2Color[h]=m);let g=new Wy(f-p,f+p,h);s.setColorZone(g),a.push(g)}return this._colorZonesInvalid=!1,a.sort(Wy.compare),a}},Ple=class extends vg{constructor(e,t){super(),this._context=e;let n=this._context.configuration.options;this._domNode=ip(document.createElement(`canvas`)),this._domNode.setClassName(t),this._domNode.setPosition(`absolute`),this._domNode.setLayerHinting(!0),this._domNode.setContain(`strict`),this._zoneManager=new Nle(e=>this._context.viewLayout.getVerticalOffsetForLineNumber(e)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(n.get(75)),this._zoneManager.setPixelRatio(n.get(163)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return e.hasChanged(75)&&(this._zoneManager.setLineHeight(t.get(75)),this._render()),e.hasChanged(163)&&(this._zoneManager.setPixelRatio(t.get(163)),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(this._zoneManager.getOuterHeight()===0)return!1;let e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),n=this._zoneManager.resolveColorZones(),r=this._zoneManager.getId2Color(),i=this._domNode.domNode.getContext(`2d`);return i.clearRect(0,0,e,t),n.length>0&&this._renderOneLane(i,n,r,e),!0}_renderOneLane(e,t,n,r){let i=0,a=0,o=0;for(let s of t){let t=s.colorId,c=s.from,l=s.to;t===i?o>=c?o=Math.max(o,l):(e.fillRect(0,a,r,o-a),a=c,o=l):(e.fillRect(0,a,r,o-a),i=t,e.fillStyle=n[i],a=c,o=l)}e.fillRect(0,a,r,o-a)}},Fle=class extends yg{constructor(e){super(e),this.domNode=ip(document.createElement(`div`)),this.domNode.setAttribute(`role`,`presentation`),this.domNode.setAttribute(`aria-hidden`,`true`),this.domNode.setClassName(`view-rulers`),this._renderedRulers=[];let t=this._context.configuration.options;this._rulers=t.get(116),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return this._rulers=t.get(116),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){let e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e<t){let{tabSize:n}=this._context.viewModel.model.getOptions(),r=n,i=t-e;for(;i>0;){let e=ip(document.createElement(`div`));e.setClassName(`view-ruler`),e.setWidth(r),this.domNode.appendChild(e),this._renderedRulers.push(e),i--}return}let n=e-t;for(;n>0;){let e=this._renderedRulers.pop();this.domNode.removeChild(e),n--}}render(e){this._ensureRulersCount();for(let t=0,n=this._rulers.length;t<n;t++){let n=this._renderedRulers[t],r=this._rulers[t];n.setBoxShadow(r.color?`1px 0 0 0 ${r.color} inset`:``),n.setHeight(Math.min(e.scrollHeight,1e6)),n.setLeft(r.column*this._typicalHalfwidthCharacterWidth)}}},Ile=class extends yg{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;let t=this._context.configuration.options.get(117);this._useShadows=t.useShadows,this._domNode=ip(document.createElement(`div`)),this._domNode.setAttribute(`role`,`presentation`),this._domNode.setAttribute(`aria-hidden`,`true`)}dispose(){super.dispose()}_updateShouldShow(){let e=this._useShadows&&this._scrollTop>0;return this._shouldShow===e?!1:(this._shouldShow=e,!0)}getDomNode(){return this._domNode}_updateWidth(){let e=this._context.configuration.options.get(165);e.minimap.renderMinimap===0||e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?this._width=e.width:this._width=e.width-e.verticalScrollbarWidth}onConfigurationChanged(e){let t=this._context.configuration.options.get(117);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`:``)}},Lle=class{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}},Rle=class{constructor(e,t){this.lineNumber=e,this.ranges=t}};function zle(e){return new Lle(e)}function Ble(e){return new Rle(e.lineNumber,e.ranges.map(zle))}var Vle=class e extends sv{static{this.SELECTION_CLASS_NAME=`selected-text`}static{this.SELECTION_TOP_LEFT=`top-left-radius`}static{this.SELECTION_BOTTOM_LEFT=`bottom-left-radius`}static{this.SELECTION_TOP_RIGHT=`top-right-radius`}static{this.SELECTION_BOTTOM_RIGHT=`bottom-right-radius`}static{this.EDITOR_BACKGROUND_CLASS_NAME=`monaco-editor-background`}static{this.ROUNDED_PIECE_WIDTH=10}constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;let t=this._context.configuration.options;this._roundedSelection=t.get(115),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return this._roundedSelection=t.get(115),this._typicalHalfwidthCharacterWidth=t.get(59).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,n=e.length;t<n;t++)if(e[t].ranges.length>1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,n){let r=this._typicalHalfwidthCharacterWidth/4,i=null,a=null;if(n&&n.length>0&&t.length>0){let r=t[0].lineNumber;if(r===e.startLineNumber)for(let e=0;!i&&e<n.length;e++)n[e].lineNumber===r&&(i=n[e].ranges[0]);let o=t[t.length-1].lineNumber;if(o===e.endLineNumber)for(let e=n.length-1;!a&&e>=0;e--)n[e].lineNumber===o&&(a=n[e].ranges[0]);i&&!i.startStyle&&(i=null),a&&!a.startStyle&&(a=null)}for(let e=0,n=t.length;e<n;e++){let o=t[e].ranges[0],s=o.left,c=o.left+o.width,l={top:0,bottom:0},u={top:0,bottom:0};if(e>0){let n=t[e-1].ranges[0].left,i=t[e-1].ranges[0].left+t[e-1].ranges[0].width;Ky(s-n)<r?l.top=2:s>n&&(l.top=1),Ky(c-i)<r?u.top=2:n<c&&c<i&&(u.top=1)}else i&&(l.top=i.startStyle.top,u.top=i.endStyle.top);if(e+1<n){let n=t[e+1].ranges[0].left,i=t[e+1].ranges[0].left+t[e+1].ranges[0].width;Ky(s-n)<r?l.bottom=2:n<s&&s<i&&(l.bottom=1),Ky(c-i)<r?u.bottom=2:c<i&&(u.bottom=1)}else a&&(l.bottom=a.startStyle.bottom,u.bottom=a.endStyle.bottom);o.startStyle=l,o.endStyle=u}}_getVisibleRangesWithStyle(e,t,n){let r=(t.linesVisibleRangesForRange(e,!0)||[]).map(Ble);return!this._visibleRangesHaveGaps(r)&&this._roundedSelection&&this._enrichVisibleRangesWithStyle(t.visibleRange,r,n),r}_createSelectionPiece(e,t,n,r,i){return`<div class="cslr `+n+`" style="top:`+e.toString()+`px;bottom:`+t.toString()+`px;left:`+r.toString()+`px;width:`+i.toString()+`px;"></div>`}_actualRenderOneSelection(t,n,r,i){if(i.length===0)return;let a=!!i[0].ranges[0].startStyle,o=i[0].lineNumber,s=i[i.length-1].lineNumber;for(let c=0,l=i.length;c<l;c++){let l=i[c],u=l.lineNumber,d=u-n,f=r?+(u===o):0,p=r?+(u!==o&&u===s):0,m=``,h=``;for(let t=0,n=l.ranges.length;t<n;t++){let n=l.ranges[t];if(a){let t=n.startStyle,r=n.endStyle;if(t.top===1||t.bottom===1){m+=this._createSelectionPiece(f,p,e.SELECTION_CLASS_NAME,n.left-e.ROUNDED_PIECE_WIDTH,e.ROUNDED_PIECE_WIDTH);let r=e.EDITOR_BACKGROUND_CLASS_NAME;t.top===1&&(r+=` `+e.SELECTION_TOP_RIGHT),t.bottom===1&&(r+=` `+e.SELECTION_BOTTOM_RIGHT),m+=this._createSelectionPiece(f,p,r,n.left-e.ROUNDED_PIECE_WIDTH,e.ROUNDED_PIECE_WIDTH)}if(r.top===1||r.bottom===1){m+=this._createSelectionPiece(f,p,e.SELECTION_CLASS_NAME,n.left+n.width,e.ROUNDED_PIECE_WIDTH);let t=e.EDITOR_BACKGROUND_CLASS_NAME;r.top===1&&(t+=` `+e.SELECTION_TOP_LEFT),r.bottom===1&&(t+=` `+e.SELECTION_BOTTOM_LEFT),m+=this._createSelectionPiece(f,p,t,n.left+n.width,e.ROUNDED_PIECE_WIDTH)}}let r=e.SELECTION_CLASS_NAME;if(a){let t=n.startStyle,i=n.endStyle;t.top===0&&(r+=` `+e.SELECTION_TOP_LEFT),t.bottom===0&&(r+=` `+e.SELECTION_BOTTOM_LEFT),i.top===0&&(r+=` `+e.SELECTION_TOP_RIGHT),i.bottom===0&&(r+=` `+e.SELECTION_BOTTOM_RIGHT)}h+=this._createSelectionPiece(f,p,r,n.left,n.width)}t[d][0]+=m,t[d][1]+=h}}prepareRender(e){let t=[],n=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(let e=n;e<=r;e++){let r=e-n;t[r]=[``,``]}let i=[];for(let r=0,a=this._selections.length;r<a;r++){let a=this._selections[r];if(a.isEmpty()){i[r]=null;continue}let o=this._getVisibleRangesWithStyle(a,e,this._previousFrameVisibleRangesWithStyle[r]);i[r]=o,this._actualRenderOneSelection(t,n,this._selections.length>1,o)}this._previousFrameVisibleRangesWithStyle=i,this._renderResult=t.map(([e,t])=>e+t)}render(e,t){if(!this._renderResult)return``;let n=t-e;return n<0||n>=this._renderResult.length?``:this._renderResult[n]}};pv((e,t)=>{let n=e.getColor(Jae);n&&!n.isTransparent()&&t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${n}; }`)});function Ky(e){return e<0?-e:e}var qy=class{constructor(e,t,n,r,i,a,o){this.top=e,this.left=t,this.paddingLeft=n,this.width=r,this.height=i,this.textContent=a,this.textContentClassName=o}},Jy;(function(e){e[e.Single=0]=`Single`,e[e.MultiPrimary=1]=`MultiPrimary`,e[e.MultiSecondary=2]=`MultiSecondary`})(Jy||={});var Yy=class{constructor(e,t){this._context=e;let n=this._context.configuration.options,r=n.get(59);this._cursorStyle=n.get(161),this._typicalHalfwidthCharacterWidth=r.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(n.get(37),this._typicalHalfwidthCharacterWidth),this._lineCursorHeight=n.get(38),this._isVisible=!0,this._domNode=ip(document.createElement(`div`)),this._domNode.setClassName(`cursor ${ey}`),this._domNode.setHeight(this._context.viewLayout.getLineHeightForLineNumber(1)),this._domNode.setTop(0),this._domNode.setLeft(0),ap(this._domNode,r),this._domNode.setDisplay(`none`),this._position=new F(1,1),this._pluralityClass=``,this.setPlurality(t),this._lastRenderedContent=``,this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}setPlurality(e){switch(e){default:case Jy.Single:this._pluralityClass=``;break;case Jy.MultiPrimary:this._pluralityClass=`cursor-primary`;break;case Jy.MultiSecondary:this._pluralityClass=`cursor-secondary`;break}}show(){this._isVisible||=(this._domNode.setVisibility(`inherit`),!0)}hide(){this._isVisible&&=(this._domNode.setVisibility(`hidden`),!1)}onConfigurationChanged(e){let t=this._context.configuration.options,n=t.get(59);return this._cursorStyle=t.get(161),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(37),this._typicalHalfwidthCharacterWidth),this._lineCursorHeight=t.get(38),ap(this._domNode,n),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty=`none`:this._domNode.domNode.style.transitionProperty=``,this._position=e,!0}_getGraphemeAwarePosition(){let{lineNumber:e,column:t}=this._position,n=this._context.viewModel.getLineContent(e),[r,i]=Yee(n,t-1);return[new F(e,r+1),n.substring(r,i)]}_prepareRender(e){let t=``,n=``,[r,i]=this._getGraphemeAwarePosition(),a=this._context.viewLayout.getLineHeightForLineNumber(r.lineNumber),o=this._lineCursorHeight===0?a:Math.min(a,this._lineCursorHeight),s=(a-o)/2;if(this._cursorStyle===jp.Line||this._cursorStyle===jp.LineThin){let a=e.visibleRangeForPosition(r);if(!a||a.outsideRenderedLine)return null;let c=Ko(this._domNode.domNode),l;this._cursorStyle===jp.Line?(l=Vs(c,this._lineCursorWidth>0?this._lineCursorWidth:2),l>2&&(t=i,n=this._getTokenClassName(r))):l=Vs(c,1);let u=a.left,d=0;return l>=2&&u>=1&&(d=1,u-=d),new qy(e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta+s,u,d,l,o,t,n)}let c=e.linesVisibleRangesForRange(new U(r.lineNumber,r.column,r.lineNumber,r.column+i.length),!1);if(!c||c.length===0)return null;let l=c[0];if(l.outsideRenderedLine||l.ranges.length===0)return null;let u=l.ranges[0],d=i===` `||u.width<1?this._typicalHalfwidthCharacterWidth:u.width;this._cursorStyle===jp.Block&&(t=i,n=this._getTokenClassName(r));let f=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta,p=a;return(this._cursorStyle===jp.Underline||this._cursorStyle===jp.UnderlineThin)&&(f+=a-2,p=2),new qy(f,u.left,0,d,p,t,n)}_getTokenClassName(e){let t=this._context.viewModel.getViewLineData(e.lineNumber),n=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(n)}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 ${this._pluralityClass} ${ey} ${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)}},Hle=class e extends yg{static{this.BLINK_INTERVAL=500}constructor(e){super(e);let t=this._context.configuration.options;this._readOnly=t.get(104),this._cursorBlinking=t.get(32),this._cursorStyle=t.get(161),this._cursorSmoothCaretAnimation=t.get(33),this._editContextEnabled=t.get(170),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new Yy(this._context,Jy.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=ip(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 fr,this._cursorFlatBlinkInterval=new os,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){let t=this._context.configuration.options;this._readOnly=t.get(104),this._cursorBlinking=t.get(32),this._cursorStyle=t.get(161),this._cursorSmoothCaretAnimation=t.get(33),this._editContextEnabled=t.get(170),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let t=0,n=this._secondaryCursors.length;t<n;t++)this._secondaryCursors[t].onConfigurationChanged(e);return!0}_onCursorPositionChanged(e,t,n){let r=this._secondaryCursors.length!==t.length||this._cursorSmoothCaretAnimation===`explicit`&&n!==3;if(this._primaryCursor.setPlurality(t.length?Jy.MultiPrimary:Jy.Single),this._primaryCursor.onCursorPositionChanged(e,r),this._updateBlinking(),this._secondaryCursors.length<t.length){let e=t.length-this._secondaryCursors.length;for(let t=0;t<e;t++){let e=new Yy(this._context,Jy.MultiSecondary);this._domNode.domNode.insertBefore(e.getDomNode().domNode,this._primaryCursor.getDomNode().domNode.nextSibling),this._secondaryCursors.push(e)}}else if(this._secondaryCursors.length>t.length){let 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],r)}onCursorStateChanged(e){let t=[];for(let n=0,r=e.selections.length;n<r;n++)t[n]=e.selections[n].getPosition();this._onCursorPositionChanged(t[0],t.slice(1),e.reason);let n=e.selections[0].isEmpty();return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,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){let t=t=>{for(let n=0,r=e.ranges.length;n<r;n++)if(e.ranges[n].fromLineNumber<=t.lineNumber&&t.lineNumber<=e.ranges[n].toLineNumber)return!0;return!1};if(t(this._primaryCursor.getPosition()))return!0;for(let e of this._secondaryCursors)if(t(e.getPosition()))return!0;return!1}onZonesChanged(e){return!0}_getCursorBlinking(){return this._isComposingInput&&!this._editContextEnabled||!this._editorHasFocus?0:this._readOnly?5:this._cursorBlinking}_updateBlinking(){this._startCursorBlinkAnimation.cancel(),this._cursorFlatBlinkInterval.cancel();let t=this._getCursorBlinking(),n=t===0,r=t===5;n?this._hide():this._show(),this._blinkingEnabled=!1,this._updateDomClassName(),!n&&!r&&(t===1?this._cursorFlatBlinkInterval.cancelAndSet(()=>{this._isVisible?this._hide():this._show()},e.BLINK_INTERVAL,Ko(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},e.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e=`cursors-layer`;switch(this._selectionIsEmpty||(e+=` has-selection`),this._cursorStyle){case jp.Line:e+=` cursor-line-style`;break;case jp.Block:e+=` cursor-block-style`;break;case jp.Underline:e+=` cursor-underline-style`;break;case jp.LineThin:e+=` cursor-line-thin-style`;break;case jp.BlockOutline:e+=` cursor-block-outline-style`;break;case jp.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;case 5:e+=` cursor-solid`;break;default:e+=` cursor-solid`}else e+=` cursor-solid`;return(this._cursorSmoothCaretAnimation===`on`||this._cursorSmoothCaretAnimation===`explicit`)&&(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,n=this._secondaryCursors.length;t<n;t++)this._secondaryCursors[t].prepareRender(e)}render(e){let t=[],n=0,r=this._primaryCursor.render(e);r&&(t[n++]=r);for(let r=0,i=this._secondaryCursors.length;r<i;r++){let i=this._secondaryCursors[r].render(e);i&&(t[n++]=i)}this._renderData=t}getLastRenderData(){return this._renderData}};pv((e,t)=>{let n=[{class:`.cursor`,foreground:_v,background:vv},{class:`.cursor-primary`,foreground:yv,background:bv},{class:`.cursor-secondary`,foreground:xv,background:Sv}];for(let r of n){let n=e.getColor(r.foreground);if(n){let i=e.getColor(r.background);i||=n.opposite(),t.addRule(`.monaco-editor .cursors-layer ${r.class} { background-color: ${n}; border-color: ${n}; color: ${i}; }`),zg(e.type)&&t.addRule(`.monaco-editor .cursors-layer.has-selection ${r.class} { border-left: 1px solid ${i}; border-right: 1px solid ${i}; }`)}}});var Xy=()=>{throw Error(`Invalid change accessor`)},Ule=class extends yg{constructor(e){super(e);let t=this._context.configuration.options,n=t.get(165);this._lineHeight=t.get(75),this._contentWidth=n.contentWidth,this._contentLeft=n.contentLeft,this.domNode=ip(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=ip(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(){let e=this._context.viewLayout.getWhitespaces(),t=new Map;for(let n of e)t.set(n.id,n);let n=!1;return this._context.viewModel.changeWhitespace(e=>{let r=Object.keys(this._zones);for(let i=0,a=r.length;i<a;i++){let a=r[i],o=this._zones[a],s=this._computeWhitespaceProps(o.delegate);o.isInHiddenArea=s.isInHiddenArea;let c=t.get(a);c&&(c.afterLineNumber!==s.afterViewLineNumber||c.height!==s.heightInPx)&&(e.changeOneWhitespace(a,s.afterViewLineNumber,s.heightInPx),this._safeCallOnComputedHeight(o.delegate,s.heightInPx),n=!0)}}),n}onConfigurationChanged(e){let t=this._context.configuration.options,n=t.get(165);return this._lineHeight=t.get(75),this._contentWidth=n.contentWidth,this._contentLeft=n.contentLeft,e.hasChanged(75)&&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 e.ordinal??e.afterColumn??1e4}_computeWhitespaceProps(e){if(e.afterLineNumber===0)return{isInHiddenArea:!1,afterViewLineNumber:0,heightInPx:this._heightInPixels(e),minWidthInPx:this._minWidthInPixels(e)};let t;if(e.afterColumn!==void 0)t=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:e.afterColumn});else{let n=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:1}).lineNumber;t=new F(n,this._context.viewModel.model.getLineMaxColumn(n))}let n;n=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});let r=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t,e.afterColumnAffinity,!0),i=e.showInHiddenAreas||this._context.viewModel.coordinatesConverter.modelPositionIsVisible(n);return{isInHiddenArea:!i,afterViewLineNumber:r.lineNumber,heightInPx:i?this._heightInPixels(e):0,minWidthInPx:this._minWidthInPixels(e)}}changeViewZones(e){let t=!1;return this._context.viewModel.changeWhitespace(n=>{let r={addZone:e=>(t=!0,this._addZone(n,e)),removeZone:e=>{e&&(t=this._removeZone(n,e)||t)},layoutZone:e=>{e&&(t=this._layoutZone(n,e)||t)}};Wle(e,r),r.addZone=Xy,r.removeZone=Xy,r.layoutZone=Xy}),t}_addZone(e,t){let n=this._computeWhitespaceProps(t),r={whitespaceId:e.insertWhitespace(n.afterViewLineNumber,this._getZoneOrdinal(t),n.heightInPx,n.minWidthInPx),delegate:t,isInHiddenArea:n.isInHiddenArea,isVisible:!1,domNode:ip(t.domNode),marginDomNode:t.marginDomNode?ip(t.marginDomNode):null};return this._safeCallOnComputedHeight(r.delegate,n.heightInPx),r.domNode.setPosition(`absolute`),r.domNode.domNode.style.width=`100%`,r.domNode.setDisplay(`none`),r.domNode.setAttribute(`monaco-view-zone`,r.whitespaceId),this.domNode.appendChild(r.domNode),r.marginDomNode&&(r.marginDomNode.setPosition(`absolute`),r.marginDomNode.domNode.style.width=`100%`,r.marginDomNode.setDisplay(`none`),r.marginDomNode.setAttribute(`monaco-view-zone`,r.whitespaceId),this.marginDomNode.appendChild(r.marginDomNode)),this._zones[r.whitespaceId]=r,this.setShouldRender(),r.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){let n=this._zones[t];return delete this._zones[t],e.removeWhitespace(n.whitespaceId),n.domNode.removeAttribute(`monaco-visible-view-zone`),n.domNode.removeAttribute(`monaco-view-zone`),n.domNode.domNode.remove(),n.marginDomNode&&(n.marginDomNode.removeAttribute(`monaco-visible-view-zone`),n.marginDomNode.removeAttribute(`monaco-view-zone`),n.marginDomNode.domNode.remove()),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){let n=this._zones[t],r=this._computeWhitespaceProps(n.delegate);return n.isInHiddenArea=r.isInHiddenArea,e.changeOneWhitespace(n.whitespaceId,r.afterViewLineNumber,r.heightInPx),this._safeCallOnComputedHeight(n.delegate,r.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx==`number`?e.heightInPx:typeof e.heightInLines==`number`?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx==`number`?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight==`function`)try{e.onComputedHeight(t)}catch(e){dt(e)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop==`function`)try{e.onDomNodeTop(t)}catch(e){dt(e)}}prepareRender(e){}render(e){let t=e.viewportData.whitespaceViewportData,n={},r=!1;for(let e of t)this._zones[e.id].isInHiddenArea||(n[e.id]=e,r=!0);let i=Object.keys(this._zones);for(let t=0,r=i.length;t<r;t++){let r=i[t],a=this._zones[r],o=0,s=0,c=`none`;n.hasOwnProperty(r)?(o=n[r].verticalOffset-e.bigNumbersDelta,s=n[r].height,c=`block`,a.isVisible||=(a.domNode.setAttribute(`monaco-visible-view-zone`,`true`),!0),this._safeCallOnDomNodeTop(a.delegate,e.getScrolledTopFromAbsoluteTop(n[r].verticalOffset))):(a.isVisible&&=(a.domNode.removeAttribute(`monaco-visible-view-zone`),!1),this._safeCallOnDomNodeTop(a.delegate,e.getScrolledTopFromAbsoluteTop(-1e6))),a.domNode.setTop(o),a.domNode.setHeight(s),a.domNode.setDisplay(c),a.marginDomNode&&(a.marginDomNode.setTop(o),a.marginDomNode.setHeight(s),a.marginDomNode.setDisplay(c))}r&&(this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth)),this.marginDomNode.setWidth(this._contentLeft))}};function Wle(e,t){try{return e(t)}catch(e){dt(e);return}}var Gle=class extends sv{constructor(e){super(),this._context=e,this._options=new Zy(this._context.configuration),this._selection=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=new Zy(this._context.configuration);return this._options.equals(t)?e.hasChanged(165):(this._options=t,!0)}onCursorStateChanged(e){return this._selection=e.selections,this._options.renderWhitespace===`selection`}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(this._options.renderWhitespace===`none`){this._renderResult=null;return}let t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=!0;this._renderResult=[];for(let t=e.viewportData.startLineNumber;t<=e.viewportData.endLineNumber;t++){let n=t-e.viewportData.startLineNumber,r=this._context.viewModel.getViewLineRenderingData(t),i=null;if(this._options.renderWhitespace===`selection`){let e=this._selection;for(let n of e){if(n.endLineNumber<t||n.startLineNumber>t)continue;let e=n.startLineNumber===t?n.startColumn:r.minColumn,a=n.endLineNumber===t?n.endColumn:r.maxColumn;e<a&&(i||=[],i.push(new pf(e-1,a-1)))}}this._renderResult[n]=this._applyRenderWhitespace(e,t,i,r)}}_applyRenderWhitespace(e,t,n,r){if(r.hasVariableFonts||this._options.renderWhitespace===`selection`&&!n||this._options.renderWhitespace===`trailing`&&r.continuesWithWrappedLine)return``;let i=this._context.theme.getColor(Cv),a=this._options.renderWithSVG,o=r.content,s=this._options.stopRenderingLineAfter===-1?o.length:Math.min(this._options.stopRenderingLineAfter,o.length),c=r.continuesWithWrappedLine,l=r.minColumn-1,u=this._options.renderWhitespace===`boundary`,d=this._options.renderWhitespace===`trailing`,f=e.getLineHeightForLineNumber(t),p=this._options.middotWidth,m=this._options.wsmiddotWidth,h=this._options.spaceWidth,g=Math.abs(m-h)<Math.abs(p-h)?11825:183,_=this._options.canUseHalfwidthRightwardsArrow,v=``,y=!1,b=Pr(o),x;b===-1?(y=!0,b=s,x=s):x=Ir(o);let S=0,ee=n&&n[S],te=0;for(let r=l;r<s;r++){let i=o.charCodeAt(r);if(ee&&ee.endExclusive<=r&&(S++,ee=n&&n[S]),i!==9&&i!==32||d&&!y&&r<=x)continue;if(u&&r>=b&&r<=x&&i===32){let e=r-1>=0?o.charCodeAt(r-1):0,t=r+1<s?o.charCodeAt(r+1):0;if(e!==32&&t!==32)continue}if(u&&c&&r===s-1){let e=r-1>=0?o.charCodeAt(r-1):0;if(i===32&&e!==32&&e!==9)continue}if(n&&!(ee&&ee.start<=r&&r<ee.endExclusive))continue;let l=e.visibleRangeForPosition(new F(t,r+1));l&&(a?(te=Math.max(te,l.left),i===9?v+=this._renderArrow(f,h,l.left):v+=`<circle cx="${(l.left+h/2).toFixed(2)}" cy="${(f/2).toFixed(2)}" r="${(h/7).toFixed(2)}" />`):i===9?v+=`<div class="mwh" style="left:${l.left}px;height:${f}px;">${_?`→`:`→`}</div>`:v+=`<div class="mwh" style="left:${l.left}px;height:${f}px;">${String.fromCharCode(g)}</div>`)}return a?(te=Math.round(te+h),`<svg style="bottom:0;position:absolute;width:${te}px;height:${f}px" viewBox="0 0 ${te} ${f}" xmlns="http://www.w3.org/2000/svg" fill="${i}">`+v+`</svg>`):v}_renderArrow(e,t,n){let r=t/7,i=t,a=e/2,o=n,s={x:0,y:r/2},c={x:100/125*i,y:s.y},l={x:c.x-.2*c.x,y:c.y+.2*c.x},u={x:l.x+.1*c.x,y:l.y+.1*c.x},d={x:u.x+.35*c.x,y:u.y-.35*c.x};return`<path d="M ${[s,c,l,u,d,{x:d.x,y:-d.y},{x:u.x,y:-u.y},{x:l.x,y:-l.y},{x:c.x,y:-c.y},{x:s.x,y:-s.y}].map(e=>`${(o+e.x).toFixed(2)} ${(a+e.y).toFixed(2)}`).join(` L `)}" />`}render(e,t){if(!this._renderResult)return``;let n=t-e;return n<0||n>=this._renderResult.length?``:this._renderResult[n]}},Zy=class{constructor(e){let t=e.options,n=t.get(59),r=t.get(47);r===`off`?(this.renderWhitespace=`none`,this.renderWithSVG=!1):r===`svg`?(this.renderWhitespace=t.get(113),this.renderWithSVG=!0):(this.renderWhitespace=t.get(113),this.renderWithSVG=!1),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(75),this.stopRenderingLineAfter=t.get(133)}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}},Kle=class{constructor(e,t,n,r){this.selections=e,this.startLineNumber=t.startLineNumber|0,this.endLineNumber=t.endLineNumber|0,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=t.bigNumbersDelta|0,this.lineHeight=t.lineHeight|0,this.whitespaceViewportData=n,this._model=r,this.visibleRange=new U(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)}},qle=class{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)}},Jle=class{constructor(e,t,n){this.configuration=e,this.theme=new qle(t),this.viewModel=n,this.viewLayout=n.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}},Qy=new Float32Array([1,0,1,1,0,1,0,0,0,1,1,0]);function $y(e){if(!e)throw Error(`Value "${e}" cannot be null`);return e}function eb(e,t,n){let r=new t.ResizeObserver(t=>{let i=t.find(t=>t.target===e);if(!i)return;if(!(`devicePixelContentBoxSize`in i)){r?.disconnect(),r=void 0;return}let a=i.devicePixelContentBoxSize[0].inlineSize,o=i.devicePixelContentBoxSize[0].blockSize;a>0&&o>0&&n(a,o)});try{r.observe(e,{box:[`device-pixel-content-box`]})}catch{throw r.disconnect(),r=void 0,new xt(`Could not observe device pixel dimensions`)}return T(()=>r?.disconnect())}var Yle=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Xle=0,tb=class extends D{get cacheKey(){return`${this.fontFamily}_${this.fontSize}px`}constructor(e,t,n,r){super(),this.fontSize=e,this.fontFamily=t,this.devicePixelRatio=n,this._decorationStyleCache=r,this.id=Xle++,this._workGlyph={source:null,boundingBox:{left:0,bottom:0,right:0,top:0},originOffset:{x:0,y:0},fontBoundingBoxAscent:0,fontBoundingBoxDescent:0},this._workGlyphConfig={chars:void 0,tokenMetadata:0,decorationStyleSetId:0},this._antiAliasing=$t?`greyscale`:`subpixel`;let i=Math.ceil(this.fontSize*n);this._canvas=new OffscreenCanvas(i*3,i*3),this._ctx=$y(this._canvas.getContext(`2d`,{willReadFrequently:!0,alpha:this._antiAliasing===`greyscale`})),this._ctx.textBaseline=`top`,this._ctx.fillStyle=`#FFFFFF`,this._ctx.font=`${i}px ${this.fontFamily}`,this._textMetrics=this._ctx.measureText(`A`)}rasterizeGlyph(e,t,n,r){return e===``?{source:this._canvas,boundingBox:{top:0,left:0,bottom:-1,right:-1},originOffset:{x:0,y:0},fontBoundingBoxAscent:0,fontBoundingBoxDescent:0}:this._workGlyphConfig.chars===e&&this._workGlyphConfig.tokenMetadata===t&&this._workGlyphConfig.decorationStyleSetId===n?this._workGlyph:(this._workGlyphConfig.chars=e,this._workGlyphConfig.tokenMetadata=t,this._workGlyphConfig.decorationStyleSetId=n,this._rasterizeGlyph(e,t,n,r))}_rasterizeGlyph(e,t,n,r){let i=Math.ceil(this.fontSize*this.devicePixelRatio),a=i*3;this._canvas.width!==a&&(this._canvas.width=a,this._canvas.height=a),this._ctx.save();let o=(t&15)/10,s=r[ff.getBackground(t)],c=this._decorationStyleCache.getStyleSet(n);this._antiAliasing===`subpixel`?(this._ctx.fillStyle=s,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height)):this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height);let l=new yd(200),u=ff.getFontStyle(t);u&1&&l.appendString(`italic `),c?.bold===void 0?u&2&&l.appendString(`bold `):c.bold&&l.appendString(`bold `),l.appendString(`${i}px ${this.fontFamily}`),this._ctx.font=l.build();let d=i,f=i;c?.color===void 0?this._ctx.fillStyle=r[ff.getForeground(t)]:this._ctx.fillStyle=`#${c.color.toString(16).padStart(8,`0`)}`,this._ctx.textBaseline=`top`,c?.opacity!==void 0&&(this._ctx.globalAlpha=c.opacity),this._ctx.fillText(e,d+o,f),this._ctx.restore();let p=this._ctx.getImageData(0,0,this._canvas.width,this._canvas.height);if(this._antiAliasing===`subpixel`){let e=parseInt(s.substring(1,3),16),t=parseInt(s.substring(3,5),16),n=parseInt(s.substring(5,7),16);this._clearColor(p,e,t,n),this._ctx.putImageData(p,0,0)}return this._findGlyphBoundingBox(p,this._workGlyph.boundingBox),this._workGlyph.source=this._canvas,this._workGlyph.originOffset.x=this._workGlyph.boundingBox.left-d,this._workGlyph.originOffset.y=this._workGlyph.boundingBox.top-f,this._workGlyph.fontBoundingBoxAscent=this._textMetrics.fontBoundingBoxAscent,this._workGlyph.fontBoundingBoxDescent=this._textMetrics.fontBoundingBoxDescent,this._workGlyph}_clearColor(e,t,n,r){for(let i=0;i<e.data.length;i+=4)e.data[i]===t&&e.data[i+1]===n&&e.data[i+2]===r&&(e.data[i+3]=0)}_findGlyphBoundingBox(e,t){let n=this._canvas.height,r=this._canvas.width,i=!1;for(let a=0;a<n;a++){for(let n=0;n<r;n++){let o=a*r*4+n*4+3;if(e.data[o]!==0){t.top=a,i=!0;break}}if(i)break}t.left=0,i=!1;for(let a=0;a<r;a++){for(let o=0;o<n;o++){let n=o*r*4+a*4+3;if(e.data[n]!==0){t.left=a,i=!0;break}}if(i)break}t.right=r,i=!1;for(let a=r-1;a>=t.left;a--){for(let o=0;o<n;o++){let n=o*r*4+a*4+3;if(e.data[n]!==0){t.right=a,i=!0;break}}if(i)break}t.bottom=t.top,i=!1;for(let a=n-1;a>=0;a--){for(let n=0;n<r;n++){let o=a*r*4+n*4+3;if(e.data[o]!==0){t.bottom=a,i=!0;break}}if(i)break}}getTextMetrics(e){return this._ctx.measureText(e)}};Yle([n_],tb.prototype,`cacheKey`,null);var Zle=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Qle=function(e,t){return function(n,r){t(n,r,e)}},nb=class extends D{constructor(e){super(),this._logService=e,this._tasks=[],this._i=0,this._register(T(()=>this.clear()))}enqueue(e){this._tasks.push(e),this._start()}clear(){this._idleCallback&&=(this._cancelCallback(this._idleCallback),void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||=this._requestCallback(this._process.bind(this))}_process(e){this._idleCallback=void 0;let t=0,n=0,r=e.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(t=Date.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,Date.now()-t),n=Math.max(t,n),i=e.timeRemaining(),n*1.5>i){r-t<-20&&this._logService.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=i}this.clear()}};nb=Zle([Qle(0,Bl)],nb);var $le=class extends nb{_requestCallback(e){return Ds().setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){Ds().clearTimeout(e)}_createDeadline(e){let t=Date.now()+e;return{timeRemaining:()=>Math.max(0,t-Date.now())}}},eue=class extends nb{_requestCallback(e){return Ds().requestIdleCallback(e)}_cancelCallback(e){Ds().cancelIdleCallback(e)}},tue=`requestIdleCallback`in Ds()?eue:$le,nue=class{constructor(e,t){this._canvas=e,this._textureIndex=t,this._currentRow={x:0,y:0,h:0},this._allocatedGlyphs=new Set,this._nextIndex=0,this._ctx=$y(this._canvas.getContext(`2d`,{willReadFrequently:!0}))}allocate(e){let t=e.boundingBox.right-e.boundingBox.left+1,n=e.boundingBox.bottom-e.boundingBox.top+1;if(t>this._canvas.width||n>this._canvas.height)throw new xt(`Glyph is too large for the atlas page`);if(e.boundingBox.right-e.boundingBox.left+1>this._canvas.width-this._currentRow.x&&(this._currentRow.x=0,this._currentRow.y+=this._currentRow.h,this._currentRow.h=1),this._currentRow.y+e.boundingBox.bottom-e.boundingBox.top+1>this._canvas.height)return;this._ctx.drawImage(e.source,e.boundingBox.left,e.boundingBox.top,t,n,this._currentRow.x,this._currentRow.y,t,n);let r={pageIndex:this._textureIndex,glyphIndex:this._nextIndex++,x:this._currentRow.x,y:this._currentRow.y,w:t,h:n,originOffsetX:e.originOffset.x,originOffsetY:e.originOffset.y,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent};return this._currentRow.x+=t,this._currentRow.h=Math.max(this._currentRow.h,n),this._allocatedGlyphs.add(r),r}getUsagePreview(){let e=this._canvas.width,t=this._canvas.height,n=new OffscreenCanvas(e,t),r=$y(n.getContext(`2d`));r.fillStyle=`#808080`,r.fillRect(0,0,e,t);let i=new Map,a=new Map;for(let e of this._allocatedGlyphs)i.set(e.y,Math.max(i.get(e.y)??0,e.h)),a.set(e.y,Math.max(a.get(e.y)??0,e.x+e.w));for(let e of this._allocatedGlyphs)r.fillStyle=`#4040FF`,r.fillRect(e.x,e.y,e.w,e.h),r.fillStyle=`#FF0000`,r.fillRect(e.x,e.y+e.h,e.w,i.get(e.y)-e.h);for(let[t,n]of a.entries())t!==this._currentRow.y&&(r.fillStyle=`#FF0000`,r.fillRect(n,t,e-n,i.get(t)));return n.convertToBlob()}getStats(){let e=this._canvas.width,t=this._canvas.height,n=0,r=0,i=e*t,a=new Map,o=new Map;for(let e of this._allocatedGlyphs)a.set(e.y,Math.max(a.get(e.y)??0,e.h)),o.set(e.y,Math.max(o.get(e.y)??0,e.x+e.w));for(let e of this._allocatedGlyphs)n+=e.w*e.h,r+=e.w*(a.get(e.y)-e.h);for(let[t,n]of o.entries())t!==this._currentRow.y&&(r+=(e-n)*a.get(t));return[`page${this._textureIndex}:`,` Total: ${i} (${e}x${t})`,` Used: ${n} (${(n/i*100).toPrecision(2)}%)`,` Wasted: ${r} (${(r/i*100).toPrecision(2)}%)`,`Efficiency: ${(n/(n+r)*100).toPrecision(2)}%`].join(`
61
61
  `)}},rue=class{constructor(e,t,n){this._canvas=e,this._textureIndex=t,this._slabs=[],this._activeSlabsByDims=new wl,this._unusedRects=[],this._openRegionsByHeight=new Map,this._openRegionsByWidth=new Map,this._allocatedGlyphs=new Set,this._nextIndex=0,this._ctx=$y(this._canvas.getContext(`2d`,{willReadFrequently:!0})),this._slabW=Math.min(n?.slabW??64<<Math.max(Math.floor(Ds().devicePixelRatio)-1,0),this._canvas.width),this._slabH=Math.min(n?.slabH??this._slabW,this._canvas.height),this._slabsPerRow=Math.floor(this._canvas.width/this._slabW),this._slabsPerColumn=Math.floor(this._canvas.height/this._slabH)}allocate(e){let t=e.boundingBox.right-e.boundingBox.left+1,n=e.boundingBox.bottom-e.boundingBox.top+1;if(t>this._canvas.width||n>this._canvas.height)throw new xt(`Glyph is too large for the atlas page`);if(t>this._slabW||n>this._slabH){if(this._allocatedGlyphs.size>0)return;let e=this._canvas.width;for(;t<e/2&&n<e/2;)e/=2;this._slabW=e,this._slabH=e,this._slabsPerRow=Math.floor(this._canvas.width/this._slabW),this._slabsPerColumn=Math.floor(this._canvas.height/this._slabH)}let r={w:t,h:n},i=this._activeSlabsByDims.get(r.w,r.h);if(i){let e=Math.floor(this._slabW/i.entryW)*Math.floor(this._slabH/i.entryH);i.count>=e&&(i=void 0)}let a,o;if(!i)if(t<n){let e=this._openRegionsByWidth.get(t);if(e?.length)for(let r=e.length-1;r>=0;r--){let i=e[r];if(i.w>=t&&i.h>=n){a=i.x,o=i.y,t<i.w&&this._unusedRects.push({x:i.x+t,y:i.y,w:i.w-t,h:n}),i.y+=n,i.h-=n,i.h===0&&(r===e.length-1?e.pop():this._unusedRects.splice(r,1));break}}}else{let e=this._openRegionsByHeight.get(n);if(e?.length)for(let r=e.length-1;r>=0;r--){let i=e[r];if(i.w>=t&&i.h>=n){a=i.x,o=i.y,n<i.h&&this._unusedRects.push({x:i.x,y:i.y+n,w:t,h:i.h-n}),i.x+=t,i.w-=t,i.h===0&&(r===e.length-1?e.pop():this._unusedRects.splice(r,1));break}}}if(a===void 0||o===void 0){if(!i){if(this._slabs.length>=this._slabsPerRow*this._slabsPerColumn)return;i={x:Math.floor(this._slabs.length%this._slabsPerRow)*this._slabW,y:Math.floor(this._slabs.length/this._slabsPerRow)*this._slabH,entryW:r.w,entryH:r.h,count:0};let e=this._slabW%i.entryW,t=this._slabH%i.entryH;e&&rb(this._openRegionsByWidth,e,{x:i.x+this._slabW-e,w:e,y:i.y,h:this._slabH-(t??0)}),t&&rb(this._openRegionsByHeight,t,{x:i.x,w:this._slabW,y:i.y+this._slabH-t,h:t}),this._slabs.push(i),this._activeSlabsByDims.set(i,r.w,r.h)}let e=Math.floor(this._slabW/i.entryW);a=i.x+Math.floor(i.count%e)*i.entryW,o=i.y+Math.floor(i.count/e)*i.entryH,i.count++}this._ctx.drawImage(e.source,e.boundingBox.left,e.boundingBox.top,t,n,a,o,t,n);let s={pageIndex:this._textureIndex,glyphIndex:this._nextIndex++,x:a,y:o,w:t,h:n,originOffsetX:e.originOffset.x,originOffsetY:e.originOffset.y,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent};return this._allocatedGlyphs.add(s),s}getUsagePreview(){let e=this._canvas.width,t=this._canvas.height,n=new OffscreenCanvas(e,t),r=$y(n.getContext(`2d`));r.fillStyle=`#808080`,r.fillRect(0,0,e,t);let i=0,a=0,o=0,s=64<<Math.floor(Ds().devicePixelRatio)-1,c=s;for(let e of this._slabs){let t=0,n=0;for(let a=0;a<e.count;a++)t+e.entryW>s&&(t=0,n+=e.entryH),r.fillStyle=`#FF0000`,r.fillRect(e.x+t,e.y+n,e.entryW,e.entryH),i+=e.entryW*e.entryH,t+=e.entryW;let a=Math.floor(s/e.entryW),o=Math.floor(c/e.entryH);e.entryW*a*e.entryH*o}for(let e of this._allocatedGlyphs)a+=e.w*e.h,r.fillStyle=`#4040FF`,r.fillRect(e.x,e.y,e.w,e.h);let l=Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat());for(let e of l)r.fillStyle=`#FF000088`,r.fillRect(e.x,e.y,e.w,e.h),o+=e.w*e.h;return r.globalAlpha=.5,r.drawImage(this._canvas,0,0),r.globalAlpha=1,n.convertToBlob()}getStats(){let e=this._canvas.width,t=this._canvas.height,n=0,r=0,i=0,a=0,o=0,s=e*t,c=64<<Math.floor(Ds().devicePixelRatio)-1,l=c;for(let e of this._slabs){let t=0,r=0;for(let i=0;i<e.count;i++)t+e.entryW>c&&(t=0,r+=e.entryH),n+=e.entryW*e.entryH,t+=e.entryW;let a=Math.floor(c/e.entryW),o=Math.floor(l/e.entryH),s=e.entryW*a*e.entryH*o;i+=c*l-s}for(let e of this._allocatedGlyphs)r+=e.w*e.h;let u=Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat());for(let e of u)o+=e.w*e.h;let d=i-o;a=n-(r-d);let f=r/(r+a+o);return[`page[${this._textureIndex}]:`,` Total: ${s}px (${e}x${t})`,` Used: ${r}px (${(r/s*100).toFixed(2)}%)`,` Wasted: ${a}px (${(a/s*100).toFixed(2)}%)`,`Restricted: ${o}px (${(o/s*100).toFixed(2)}%) (hard to allocate)`,`Efficiency: ${f===1?`100`:(f*100).toFixed(2)}%`,` Slabs: ${this._slabs.length} of ${Math.floor(this._canvas.width/c)*Math.floor(this._canvas.height/l)}`].join(`
62
62
  `)}};function rb(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}var iue=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},ib=function(e,t){return function(n,r){t(n,r,e)}},ab,ob=class extends D{static{ab=this}get version(){return this._version}static{this.maximumGlyphCount=5e3}get usedArea(){return this._usedArea}get source(){return this._canvas}get glyphs(){return this._glyphInOrderSet.values()}constructor(e,t,n,r,i){switch(super(),this._logService=r,this._version=0,this._usedArea={left:0,top:0,right:0,bottom:0},this._glyphMap=new wl,this._glyphInOrderSet=new Set,this._canvas=new OffscreenCanvas(t,t),this._colorMap=i.getColorTheme().tokenColorMap,n){case`shelf`:this._allocator=new nue(this._canvas,e);break;case`slab`:this._allocator=new rue(this._canvas,e);break;default:this._allocator=n(this._canvas,e);break}this._register(T(()=>{this._canvas.width=1,this._canvas.height=1}))}getGlyph(e,t,n,r){return this._glyphMap.get(t,n,r,e.cacheKey)??this._createGlyph(e,t,n,r)}_createGlyph(e,t,n,r){if(this._glyphInOrderSet.size>=ab.maximumGlyphCount)return;let i=e.rasterizeGlyph(t,n,r,this._colorMap),a=this._allocator.allocate(i);if(a!==void 0)return this._glyphMap.set(a,t,n,r,e.cacheKey),this._glyphInOrderSet.add(a),this._version++,this._usedArea.right=Math.max(this._usedArea.right,a.x+a.w-1),this._usedArea.bottom=Math.max(this._usedArea.bottom,a.y+a.h-1),this._logService.getLevel()===Hl.Trace&&this._logService.trace(`New glyph`,{chars:t,tokenMetadata:n,decorationStyleSetId:r,rasterizedGlyph:i,glyph:a}),a}getUsagePreview(){return this._allocator.getUsagePreview()}getStats(){return this._allocator.getStats()}};ob=ab=iue([ib(3,Bl),ib(4,cv)],ob);var aue=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},sb=function(e,t){return function(n,r){t(n,r,e)}},cb,lb=class extends D{static{cb=this}static{this.maximumPageCount=16}get pages(){return this._pages}constructor(e,t,n,r,i){super(),this._maxTextureSize=e,this._decorationStyleCache=n,this._themeService=r,this._instantiationService=i,this._warmUpTask=this._register(new zn),this._warmedUpRasterizers=new Set,this._pages=[],this._glyphPageIndex=new wl,this._onDidDeleteGlyphs=this._register(new k),this.onDidDeleteGlyphs=this._onDidDeleteGlyphs.event,this._allocatorType=t?.allocatorType??`slab`,this._register(O.runAndSubscribe(this._themeService.onDidColorThemeChange,()=>{this._colorMap&&this.clear(),this._colorMap=this._themeService.getColorTheme().tokenColorMap}));let a=Math.max(1,Math.floor(Ds().devicePixelRatio));this.pageSize=Math.min(1024*a,this._maxTextureSize),this._initFirstPage(),this._register(T(()=>In(this._pages)))}_initFirstPage(){let e=this._instantiationService.createInstance(ob,0,this.pageSize,this._allocatorType);this._pages.push(e);let t=new tb(1,``,1,this._decorationStyleCache);e.getGlyph(t,``,0,0),t.dispose()}clear(){for(let e of this._pages)e.dispose();this._pages.length=0,this._glyphPageIndex.clear(),this._warmedUpRasterizers.clear(),this._warmUpTask.clear(),this._initFirstPage(),this._onDidDeleteGlyphs.fire()}getGlyph(e,t,n,r,i){return n&=-2048,n|=Math.floor(i%1*10),this._warmedUpRasterizers.has(e.id)||(this._warmUpAtlas(e),this._warmedUpRasterizers.add(e.id)),this._tryGetGlyph(this._glyphPageIndex.get(t,n,r,e.cacheKey)??0,e,t,n,r)}_tryGetGlyph(e,t,n,r,i){return this._glyphPageIndex.set(e,n,r,i,t.cacheKey),this._pages[e].getGlyph(t,n,r,i)??(e+1<this._pages.length?this._tryGetGlyph(e+1,t,n,r,i):void 0)??this._getGlyphFromNewPage(t,n,r,i)}_getGlyphFromNewPage(e,t,n,r){if(this._pages.length>=cb.maximumPageCount)throw Error(`Attempt to create a texture atlas page past the limit ${cb.maximumPageCount}`);return this._pages.push(this._instantiationService.createInstance(ob,this._pages.length,this.pageSize,this._allocatorType)),this._glyphPageIndex.set(this._pages.length-1,t,n,r,e.cacheKey),this._pages[this._pages.length-1].getGlyph(e,t,n,r)}getStats(){return this._pages.map(e=>e.getStats())}_warmUpAtlas(e){let t=this._colorMap;if(!t)throw new xt(`Cannot warm atlas without color map`);this._warmUpTask.value?.clear();let n=this._warmUpTask.value=this._instantiationService.createInstance(tue);for(let r=65;r<=90;r++)for(let i of t.keys())n.enqueue(()=>{for(let t=0;t<1;t+=.1)this.getGlyph(e,String.fromCharCode(r),i<<15&16744448,0,t)});for(let r=97;r<=122;r++)for(let i of t.keys())n.enqueue(()=>{for(let t=0;t<1;t+=.1)this.getGlyph(e,String.fromCharCode(r),i<<15&16744448,0,t)});for(let r=33;r<=126;r++)for(let i of t.keys())n.enqueue(()=>{for(let t=0;t<1;t+=.1)this.getGlyph(e,String.fromCharCode(r),i<<15&16744448,0,t)})}};lb=cb=aue([sb(3,cv),sb(4,fc)],lb);var ub;(function(e){e[e.Ignore=0]=`Ignore`,e[e.Info=1]=`Info`,e[e.Warning=2]=`Warning`,e[e.Error=3]=`Error`})(ub||={}),(function(e){let t=`error`,n=`warning`,r=`info`;function i(i){return i?Wr(t,i)?e.Error:Wr(n,i)||Wr(`warn`,i)?e.Warning:Wr(r,i)?e.Info:e.Ignore:e.Ignore}e.fromValue=i;function a(i){switch(i){case e.Error:return t;case e.Warning:return n;case e.Info:return r;default:return`ignore`}}e.toString=a})(ub||={});var db=ub,fb=db,pb=pc(`notificationService`),oue=class{},mb;(function(e){async function t(e){try{if(!navigator.gpu)throw Error(`This browser does not support WebGPU`);let e=await navigator.gpu.requestAdapter();if(!e)throw Error(`This browser supports WebGPU but it appears to be disabled`);return hb(await e.requestDevice())}catch(t){throw e&&e(t.message),t}}e.requestDevice=t;function n(e,t,n){let r=e.createBuffer(t);return n&&e.queue.writeBuffer(r,0,Rt(n)?n():n),hb(r)}e.createBuffer=n;function r(e,t){return hb(e.createTexture(t))}e.createTexture=r})(mb||={});function hb(e){return{object:e,dispose:()=>e.destroy()}}var sue=class{get dataOffset(){return this._startIndex}get dirtySize(){if(!(this._startIndex===void 0||this._endIndex===void 0))return this._endIndex-this._startIndex+1}get isDirty(){return this._startIndex!==void 0}flag(e,t=1){return this._flag(e),t>1&&this._flag(e+t-1),e}_flag(e){(this._startIndex===void 0||e<this._startIndex)&&(this._startIndex=e),(this._endIndex===void 0||e>this._endIndex)&&(this._endIndex=e)}clear(){this._startIndex=void 0,this._endIndex=void 0}};function cue(e,t){return new lue(e,t)}var lue=class extends D{get entryCount(){return this._entries.size}get dirtyTracker(){return this._dirtyTracker}constructor(e,t){super(),this.propertySpecs=e,this.capacity=t,this._dirtyTracker=new sue,this._propertySpecsMap=new Map,this._entries=new Hn,this._onDidChange=this._register(new k),this._onDidChangeBuffer=this._register(new k),this.onDidChangeBuffer=this._onDidChangeBuffer.event,this.view=new Float32Array(t*e.length),this.buffer=this.view.buffer,this._entrySize=e.length;for(let t=0;t<e.length;t++){let n={offset:t,...e[t]};this._propertySpecsMap.set(n.name,n)}this._register(T(()=>In(this._entries)))}createEntry(e){this._entries.size===this.capacity&&(this._expandBuffer(),this._onDidChangeBuffer.fire());let t=new uue(this.view,this._propertySpecsMap,this._dirtyTracker,this._entries.size,e),n=this._entries.push(t),r=[];return r.push(O.forward(t.onDidChange,this._onDidChange)),r.push(t.onWillDispose(()=>{let e=t.i;n(),this.view.set(this.view.subarray(e*this._entrySize+2,this._entries.size*this._entrySize+2),e*this._entrySize);for(let t of this._entries)t.i>e&&t.i--;this._dirtyTracker.flag(e,(this._entries.size-e)*this._entrySize),In(r)})),t}_expandBuffer(){this.capacity*=2;let e=new Float32Array(this.capacity*this._entrySize);e.set(this.view),this.view=e,this.buffer=this.view.buffer}},uue=class extends D{constructor(e,t,n,r,i){super(),this._view=e,this._propertySpecsMap=t,this._dirtyTracker=n,this.i=r,this._onDidChange=this._register(new k),this.onDidChange=this._onDidChange.event,this._onWillDispose=this._register(new k),this.onWillDispose=this._onWillDispose.event;for(let e of this._propertySpecsMap.values())this._view[this.i*this._propertySpecsMap.size+e.offset]=i[e.name];this._dirtyTracker.flag(this.i*this._propertySpecsMap.size,this._propertySpecsMap.size)}dispose(){this._onWillDispose.fire(),super.dispose()}setRaw(e){if(e.length!==this._propertySpecsMap.size)throw Error(`Data length ${e.length} does not match the number of properties in the collection (${this._propertySpecsMap.size})`);this._view.set(e,this.i*this._propertySpecsMap.size),this._dirtyTracker.flag(this.i*this._propertySpecsMap.size,this._propertySpecsMap.size)}},due=`
63
63
 
@@ -859,7 +859,7 @@ ${c4(L.menuSubmenu)}
859
859
  `?a=2:o===`
860
860
  `&&(a=1);let s=mp.trimAutoWhitespace;e.editor&&e.editor.trimAutoWhitespace!==void 0&&(s=e.editor.trimAutoWhitespace===`false`?!1:!!e.editor.trimAutoWhitespace);let c=mp.detectIndentation;e.editor&&e.editor.detectIndentation!==void 0&&(c=e.editor.detectIndentation===`false`?!1:!!e.editor.detectIndentation);let l=mp.largeFileOptimizations;e.editor&&e.editor.largeFileOptimizations!==void 0&&(l=e.editor.largeFileOptimizations===`false`?!1:!!e.editor.largeFileOptimizations);let u=mp.bracketPairColorizationOptions;if(e.editor?.bracketPairColorization&&typeof e.editor.bracketPairColorization==`object`){let t=e.editor.bracketPairColorization;u={enabled:!!t.enabled,independentColorPoolPerBracketType:!!t.independentColorPoolPerBracketType}}return{isForSimpleWidget:t,tabSize:n,indentSize:r,insertSpaces:i,detectIndentation:c,defaultEOL:a,trimAutoWhitespace:s,largeFileOptimizations:l,bracketPairColorizationOptions:u}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);let n=this._configurationService.getValue(`files.eol`,{overrideIdentifier:t});return n&&typeof n==`string`&&n!==`auto`?n:ln===3||ln===2?`
861
861
  `:`\r
862
- `}_shouldRestoreUndoStack(){let e=this._configurationService.getValue(`files.restoreUndoStack`);return typeof e==`boolean`?e:!0}getCreationOptions(e,t,n){let r=typeof e==`string`?e:e.languageId,i=this._modelCreationOptionsByLanguageAndResource[r+t];if(!i){let e=this._configurationService.getValue(`editor`,{overrideIdentifier:r,resource:t}),a=this._getEOL(t,r);i=x4._readModelOptions({editor:e,eol:a},n),this._modelCreationOptionsByLanguageAndResource[r+t]=i}return i}_updateModelOptions(e){let t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);let n=Object.keys(this._models);for(let r=0,i=n.length;r<i;r++){let i=n[r],a=this._models[i],o=a.model.getLanguageId(),s=a.model.uri;if(e&&!e.affectsConfiguration(`editor`,{overrideIdentifier:o,resource:s})&&!e.affectsConfiguration(`files.eol`,{overrideIdentifier:o,resource:s}))continue;let c=t[o+s],l=this.getCreationOptions(o,s,a.model.isForSimpleWidget);x4._setModelOptionsForModel(a.model,l,c)}}static _setModelOptionsForModel(e,t,n){n&&n.defaultEOL!==t.defaultEOL&&e.getLineCount()===1&&e.setEOL(t.defaultEOL===1?0:1),!(n&&n.detectIndentation===t.detectIndentation&&n.insertSpaces===t.insertSpaces&&n.tabSize===t.tabSize&&n.indentSize===t.indentSize&&n.trimAutoWhitespace===t.trimAutoWhitespace&&Yu(n.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(S4(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){let t=this._disposedModels.get(S4(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(S4(e)),t}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){let 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;){let e=t.shift();this._removeDisposedModel(e.uri),e.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}}}_createModelData(e,t,n,r){let i=this.getCreationOptions(t,n,r),a=this._instantiationService.createInstance(Cw,e,t,i,n);if(n&&this._disposedModels.has(S4(n))){let e=this._removeDisposedModel(n),t=this._undoRedoService.getElements(n),r=this._getSHA1Computer(),i=r.canComputeSHA1(a)?r.computeSHA1(a)===e.sha1:!1;if(i||e.sharesUndoRedoStack){for(let e of t.past)PS(e)&&e.matchesResource(n)&&e.setModel(a);for(let e of t.future)PS(e)&&e.matchesResource(n)&&e.setModel(a);this._undoRedoService.setElementsValidFlag(n,!0,e=>PS(e)&&e.matchesResource(n)),i&&(a._overwriteVersionId(e.versionId),a._overwriteAlternativeVersionId(e.alternativeVersionId),a._overwriteInitialUndoRedoSnapshot(e.initialUndoRedoSnapshot))}else e.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}let o=S4(a.uri);if(this._models[o])throw Error(`ModelService: Cannot add model because it already exists!`);let s=new eIe(a,e=>this._onWillDispose(e),(e,t)=>this._onDidChangeLanguage(e,t));return this._models[o]=s,s}createModel(e,t,n,r=!1){let i;return i=t?this._createModelData(e,t,n,r):this._createModelData(e,Zd,n,r),this._onModelAdded.fire(i.model),i.model}getModels(){let e=[],t=Object.keys(this._models);for(let n=0,r=t.length;n<r;n++){let r=t[n];e.push(this._models[r].model)}return e}getModel(e){let t=S4(e),n=this._models[t];return n?n.model:null}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===Zi.file||e.scheme===Zi.vscodeRemote||e.scheme===Zi.vscodeUserData||e.scheme===Zi.vscodeNotebookCell||e.scheme===`fake-fs`}_onWillDispose(e){let t=S4(e.uri),n=this._models[t],r=this._undoRedoService.getUriComparisonKey(e.uri)!==e.uri.toString(),i=!1,a=0;if(r||this._shouldRestoreUndoStack()&&this._schemaShouldMaintainUndoRedoElements(e.uri)){let t=this._undoRedoService.getElements(e.uri);if(t.past.length>0||t.future.length>0){for(let n of t.past)PS(n)&&n.matchesResource(e.uri)&&(i=!0,a+=n.heapSize(e.uri),n.setModel(e.uri));for(let n of t.future)PS(n)&&n.matchesResource(e.uri)&&(i=!0,a+=n.heapSize(e.uri),n.setModel(e.uri))}}let o=x4.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,s=this._getSHA1Computer();if(!i){if(!r){let e=n.model.getInitialUndoRedoSnapshot();e!==null&&this._undoRedoService.restoreSnapshot(e)}}else if(!r&&(a>o||!s.canComputeSHA1(e))){let e=n.model.getInitialUndoRedoSnapshot();e!==null&&this._undoRedoService.restoreSnapshot(e)}else this._ensureDisposedModelsHeapSize(o-a),this._undoRedoService.setElementsValidFlag(e.uri,!1,t=>PS(t)&&t.matchesResource(e.uri)),this._insertDisposedModel(new nIe(e.uri,n.model.getInitialUndoRedoSnapshot(),Date.now(),r,a,s.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));delete this._models[t],n.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){let n=t.oldLanguage,r=e.getLanguageId(),i=this.getCreationOptions(n,e.uri,e.isForSimpleWidget),a=this.getCreationOptions(r,e.uri,e.isForSimpleWidget);x4._setModelOptionsForModel(e,a,i),this._onModelModeChanged.fire({model:e,oldLanguageId:n})}_getSHA1Computer(){return new rIe}};C4=x4=$Fe([b4(0,Dd),b4(1,oZ),b4(2,fw),b4(3,fc)],C4);var rIe=class e{static{this.MAX_MODEL_SIZE=10*1024*1024}canComputeSHA1(t){return t.getValueLength()<=e.MAX_MODEL_SIZE}computeSHA1(e){let t=new Ote,n=e.createSnapshot(),r;for(;r=n.read();)t.update(r);return t.digest()}},iIe=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},w4=function(e,t){return function(n,r){t(n,r,e)}},T4=class extends D{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=il.as(S$.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0,this._register(T(()=>{for(let e of this.mapProviderToDescriptor.values())Fn(e)&&e.dispose();this.visibleQuickAccess?.picker.dispose()}))}show(e=``,t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,n){let[r,i]=this.getOrInstantiateProvider(e,n?.enabledProviderPrefixes),a=this.visibleQuickAccess,o=a?.descriptor;if(a&&i&&o===i){e!==i.prefix&&!n?.preserveValue&&(a.picker.value=e),this.adjustValueSelection(a.picker,i,n);return}if(i&&!n?.preserveValue){let t;if(a&&o&&o!==i){let e=a.value.substr(o.prefix.length);e&&(t=`${i.prefix}${e}`)}if(!t){let e=r?.defaultFilterValue;e===x$.LAST?t=this.lastAcceptedPickerValues.get(i):typeof e==`string`&&(t=`${i.prefix}${e}`)}typeof t==`string`&&(e=t)}let s=a?.picker?.valueSelection,c=a?.picker?.value,l=new E,u=l.add(this.quickInputService.createQuickPick({useSeparators:!0}));u.value=e,this.adjustValueSelection(u,i,n),u.placeholder=n?.placeholder??i?.placeholder,u.quickNavigate=n?.quickNavigateConfiguration,u.hideInput=!!u.quickNavigate&&!a,(typeof n?.itemActivation==`number`||n?.quickNavigateConfiguration)&&(u.itemActivation=n?.itemActivation??SN.SECOND),u.contextKey=i?.contextKey,u.filterValue=e=>e.substring(i?i.prefix.length:0);let d;t&&(d=new vr,l.add(O.once(u.onWillAccept)(e=>{e.veto(),u.hide()}))),l.add(this.registerPickerListeners(u,r,i,e,n));let f=l.add(new tr);if(r&&l.add(r.provide(u,f.token,n?.providerOptions)),O.once(u.onDidHide)(()=>{u.selectedItems.length===0&&f.cancel(),l.dispose(),d?.complete(u.selectedItems.slice(0))}),u.show(),s&&c===e&&(u.valueSelection=s),t)return d?.p}adjustValueSelection(e,t,n){let r;r=n?.preserveValue?[e.value.length,e.value.length]:[t?.prefix.length??0,e.value.length],e.valueSelection=r}registerPickerListeners(e,t,n,r,i){let a=new E,o=this.visibleQuickAccess={picker:e,descriptor:n,value:r};return a.add(T(()=>{o===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),a.add(e.onDidChangeValue(e=>{let[n]=this.getOrInstantiateProvider(e,i?.enabledProviderPrefixes);n===t?o.value=e:this.show(e,{enabledProviderPrefixes:i?.enabledProviderPrefixes,preserveValue:!0,providerOptions:i?.providerOptions})})),n&&a.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(n,e.value)})),a}getOrInstantiateProvider(e,t){let n=this.registry.getQuickAccessProvider(e);if(!n||t&&!t?.includes(n.prefix))return[void 0,void 0];let r=this.mapProviderToDescriptor.get(n);return r||(r=this.instantiationService.createInstance(n.ctor),this.mapProviderToDescriptor.set(n,r)),[r,n]}};T4=iIe([w4(0,TN),w4(1,fc)],T4);var aIe=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},E4=class{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e==`string`?e:e.label).join(``)}};aIe([n_],E4.prototype,`toString`,null);var oIe=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function sIe(e){let t=[],n=0,r;for(;r=oIe.exec(e);){r.index-n>0&&t.push(e.substring(n,r.index));let[,i,a,,o]=r;o?t.push({label:i,href:a,title:o}):t.push({label:i,href:a}),n=r.index+r[0].length}return n<e.length&&t.push(e.substring(n)),new E4(t)}var D4={},cIe=new lD(`quick-input-button-icon-`);function lIe(e){if(!e)return;let t,n=e.dark.toString();return D4[n]?t=D4[n]:(t=cIe.nextId(),pm(`.${t}, .hc-light .${t}`,`background-image: ${YT(e.light||e.dark)}`),pm(`.vs-dark .${t}, .hc-black .${t}`,`background-image: ${YT(e.dark)}`),D4[n]=t),t}function O4(e,t,n){let r=e.iconClass||lIe(e.iconPath);return e.alwaysVisible&&(r=r?`${r} always-visible`:`always-visible`),{id:t,label:``,tooltip:e.tooltip||``,class:r,enabled:!0,run:n}}function uIe(e,t,n){Is(t);let r=sIe(e),i=0;for(let e of r.nodes)if(typeof e==`string`)t.append(...JO(e));else{let r=e.title;!r&&e.href.startsWith(`command:`)?r=C(1771,`Click to execute command '{0}'`,e.href.substring(8)):r||=e.href;let a=P(`a`,{href:e.href,title:r,tabIndex:i++},e.label);a.style.textDecoration=`underline`;let o=t=>{gne(t)&&Ns.stop(t,!0),n.callback(e.href)},s=n.disposables.add(new D_(a,M.CLICK)).event,c=n.disposables.add(new D_(a,M.KEY_DOWN)).event,l=O.chain(c,e=>e.filter(e=>{let t=new On(e);return t.equals(10)||t.equals(3)}));n.disposables.add(i_.addTarget(a));let u=n.disposables.add(new D_(a,r_.Tap)).event;O.any(s,u,l)(o,null,n.disposables),t.appendChild(a)}}var dIe=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},k4=function(e,t){return function(n,r){t(n,r,e)}},A4=`inQuickInput`,fIe=new z(A4,!1,C(1748,`Whether keyboard focus is inside the quick input control`)),j4=R.has(A4),pIe=new z(`quickInputAlignment`,`top`,C(1749,`The alignment of the quick input`)),M4=`quickInputType`,mIe=new z(M4,void 0,C(1750,`The type of the currently visible quick input`)),N4=`cursorAtEndOfQuickInputBox`,hIe=new z(N4,!1,C(1751,`Whether the cursor in the quick input is at the end of the input box`)),gIe=R.has(N4),P4={iconClass:Dc.asClassName(L.quickInputBack),tooltip:C(1752,`Back`)},F4=class e extends D{static{this.noPromptMessage=C(1753,`Press 'Enter' to confirm your input or 'Escape' to cancel`)}constructor(t){super(),this.ui=t,this._visible=Uo(`visible`,!1),this._widgetUpdated=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._leftButtons=[],this._rightButtons=[],this._inlineButtons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=e.noPromptMessage,this._severity=db.Ignore,this.onDidTriggerButtonEmitter=this._register(new k),this.onDidHideEmitter=this._register(new k),this.onWillHideEmitter=this._register(new k),this.onDisposeEmitter=this._register(new k),this.visibleDisposables=this._register(new E),this.onDidHide=this.onDidHideEmitter.event}get visible(){return this._visible.get()}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){let t=this._ignoreFocusOut!==e&&!rn;this._ignoreFocusOut=e&&!rn,t&&this.update()}get titleButtons(){return this._leftButtons.length?[...this._leftButtons,this._rightButtons]:this._rightButtons}get buttons(){return[...this._leftButtons,...this._rightButtons,...this._inlineButtons]}set buttons(e){this._leftButtons=e.filter(e=>e===P4),this._rightButtons=e.filter(e=>e!==P4&&e.location!==wN.Inline),this._inlineButtons=e.filter(e=>e.location===wN.Inline),this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=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=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this._visible.set(!0,void 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=xN.Other){this._visible.set(!1,void 0),this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}willHide(e=xN.Other){this.onWillHideEmitter.fire({reason:e})}update(){if(!this.visible)return;let e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:!e&&this.ui.title.innerHTML!==`&nbsp;`&&(this.ui.title.innerText=`\xA0`);let t=this.getDescription();if(this.ui.description1.textContent!==t&&(this.ui.description1.textContent=t),this.ui.description2.textContent!==t&&(this.ui.description2.textContent=t),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?Is(this.ui.widget,this._widget):Is(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new fr,this.busyDelay.setIfNotSet(()=>{this.visible&&(this.ui.progressBar.infinite(),this.ui.progressBar.getContainer().removeAttribute(`aria-hidden`))},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.ui.progressBar.getContainer().setAttribute(`aria-hidden`,`true`),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();let e=this._leftButtons.map((e,t)=>O4(e,`id-${t}`,async()=>this.onDidTriggerButtonEmitter.fire(e)));this.ui.leftActionBar.push(e,{icon:!0,label:!1}),this.ui.rightActionBar.clear();let t=this._rightButtons.map((e,t)=>O4(e,`id-${t}`,async()=>this.onDidTriggerButtonEmitter.fire(e)));this.ui.rightActionBar.push(t,{icon:!0,label:!1}),this.ui.inlineActionBar.clear();let n=this._inlineButtons.map((e,t)=>O4(e,`id-${t}`,async()=>this.onDidTriggerButtonEmitter.fire(e)));this.ui.inlineActionBar.push(n,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;let e=this.toggles?.filter(e=>e instanceof iL)??[];this.ui.inputBox.toggles=e;let t=e.length*22;this.ui.countContainer.style.right=t>0?`${4+t}px`:`4px`,this.ui.visibleCountContainer.style.right=t>0?`${4+t}px`:`4px`}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);let n=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==n&&(this._lastValidationMessage=n,Is(this.ui.message),n&&uIe(n,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?C(1754,`{0}/{1}`,this.step,this.totalSteps):this.step?String(this.step):``}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==db.Ignore){let 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()}},I4=class e extends F4{static{this.DEFAULT_ARIA_LABEL=C(1755,`Type to narrow down results.`)}constructor(e){super(e),this._value=``,this.onDidChangeValueEmitter=this._register(new k),this.onWillAcceptEmitter=this._register(new k),this.onDidAcceptEmitter=this._register(new k),this.onDidCustomEmitter=this._register(new k),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._keepScrollPosition=!1,this._itemActivation=SN.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new k),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new k),this.onDidTriggerItemButtonEmitter=this._register(new k),this.onDidTriggerSeparatorButtonEmitter=this._register(new k),this.valueSelectionUpdated=!0,this._ok=`default`,this._customButton=!1,this._focusEventBufferer=new Xn,this.type=`quickPick`,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,this.noValidationMessage=void 0}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 prompt(){return this.noValidationMessage}set prompt(e){this.noValidationMessage=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 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?eye:this.ui.keyMods}get valueSelection(){let e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}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 okLabel(){return this._okLabel??C(1756,`OK`)}set okLabel(e){this._okLabel=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.canSelectMany||this.ui.list.focus(CN.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(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._focusEventBufferer.wrapEvent(this.ui.list.onDidChangeFocus,(e,t)=>t)(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&va(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})=>{if(this.canSelectMany&&!e.some(e=>e.pickable===!1)){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&va(e,this._selectedItems,(e,t)=>e===t)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(js(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{!this.canSelectMany||!this.visible||this.selectedItemsToConfirm!==this._selectedItems&&va(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 j(this.ui.container,M.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;let t=new On(e),n=t.keyCode;this._quickNavigate.keybindings.some(e=>{let r=e.getChords();return r.length>1?!1:r[0].shiftKey&&n===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(r[0].altKey&&n===6||r[0].ctrlKey&&n===5||r[0].metaKey&&n===57)})&&(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;let t=this.keepScrollPosition?this.scrollTop:0,n=!!this.description,r={title:!!this.title||!!this.step||!!this.titleButtons.length,description:n,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||n,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok===`default`?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage||!!this.prompt,customButton:this.customButton};this.ui.setVisibilities(r),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 i=this.ariaLabel;!i&&r.inputBox&&(i=this.placeholder,this.title&&(i=i?`${i} - ${this.title}`:this.title),i||=e.DEFAULT_ARIA_LABEL),this.ui.list.ariaLabel!==i&&(this.ui.list.ariaLabel=i??null),this.ui.inputBox.ariaLabel!==i&&(this.ui.inputBox.ariaLabel=i??`input`),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&&(this.itemsUpdated=!1,this._focusEventBufferer.bufferEvents(()=>{switch(this.ui.list.setElements(this.items),this.ui.list.shouldLoop=!this.canSelectMany,this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this._itemActivation){case SN.NONE:this._itemActivation=SN.FIRST;break;case SN.SECOND:this.ui.list.focus(CN.Second),this._itemActivation=SN.FIRST;break;case SN.LAST:this.ui.list.focus(CN.Last),this._itemActivation=SN.FIRST;break;default:this.trySelectFirst();break}})),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.ok.label=this.okLabel||``,this.ui.customButton.label=this.customLabel||``,this.ui.customButton.element.title=this.customHover||``,r.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(CN.First)),this.keepScrollPosition&&(this.scrollTop=t)}focus(e){this.ui.list.focus(e),this.canSelectMany&&this.ui.list.domFocus()}accept(e){e&&!this._canAcceptInBackground||(this.activeItems[0]&&!this._canSelectMany&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(e??!1))}},_Ie=class extends F4{constructor(){super(...arguments),this._value=``,this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new k),this.onDidAcceptEmitter=this._register(new k),this.type=`inputBox`,this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||``,this.update()}get valueSelection(){let e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}get prompt(){return this._prompt}set prompt(e){this._prompt=e,this.noValidationMessage=e?C(1757,`{0} (Press 'Enter' to confirm or 'Escape' to cancel)`,e):F4.noPromptMessage,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()}accept(){this.onDidAcceptEmitter.fire()}update(){if(!this.visible)return;this.ui.container.classList.remove(`hidden-input`);let e={title:!!this.title||!!this.step||!!this.titleButtons.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);let t=this.ariaLabel;!t&&e.inputBox&&(t=this.placeholder?this.title?`${this.placeholder} - ${this.title}`:this.placeholder:this.title?this.title:`input`),this.ui.inputBox.ariaLabel!==t&&(this.ui.inputBox.ariaLabel=t||`input`)}},L4=class extends LM{constructor(e,t){super(`mouse`,void 0,e=>this.getOverrideOptions(e),e,t)}getOverrideOptions(e){return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:(Os(e.content)?e.content.textContent??``:typeof e.content==`string`?e.content:e.content.value).includes(`
862
+ `}_shouldRestoreUndoStack(){let e=this._configurationService.getValue(`files.restoreUndoStack`);return typeof e==`boolean`?e:!0}getCreationOptions(e,t,n){let r=typeof e==`string`?e:e.languageId,i=this._modelCreationOptionsByLanguageAndResource[r+t];if(!i){let e=this._configurationService.getValue(`editor`,{overrideIdentifier:r,resource:t}),a=this._getEOL(t,r);i=x4._readModelOptions({editor:e,eol:a},n),this._modelCreationOptionsByLanguageAndResource[r+t]=i}return i}_updateModelOptions(e){let t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);let n=Object.keys(this._models);for(let r=0,i=n.length;r<i;r++){let i=n[r],a=this._models[i],o=a.model.getLanguageId(),s=a.model.uri;if(e&&!e.affectsConfiguration(`editor`,{overrideIdentifier:o,resource:s})&&!e.affectsConfiguration(`files.eol`,{overrideIdentifier:o,resource:s}))continue;let c=t[o+s],l=this.getCreationOptions(o,s,a.model.isForSimpleWidget);x4._setModelOptionsForModel(a.model,l,c)}}static _setModelOptionsForModel(e,t,n){n&&n.defaultEOL!==t.defaultEOL&&e.getLineCount()===1&&e.setEOL(t.defaultEOL===1?0:1),!(n&&n.detectIndentation===t.detectIndentation&&n.insertSpaces===t.insertSpaces&&n.tabSize===t.tabSize&&n.indentSize===t.indentSize&&n.trimAutoWhitespace===t.trimAutoWhitespace&&Yu(n.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(S4(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){let t=this._disposedModels.get(S4(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(S4(e)),t}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){let 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;){let e=t.shift();this._removeDisposedModel(e.uri),e.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}}}_createModelData(e,t,n,r){let i=this.getCreationOptions(t,n,r),a=this._instantiationService.createInstance(Cw,e,t,i,n);if(n&&this._disposedModels.has(S4(n))){let e=this._removeDisposedModel(n),t=this._undoRedoService.getElements(n),r=this._getSHA1Computer(),i=r.canComputeSHA1(a)?r.computeSHA1(a)===e.sha1:!1;if(i||e.sharesUndoRedoStack){for(let e of t.past)PS(e)&&e.matchesResource(n)&&e.setModel(a);for(let e of t.future)PS(e)&&e.matchesResource(n)&&e.setModel(a);this._undoRedoService.setElementsValidFlag(n,!0,e=>PS(e)&&e.matchesResource(n)),i&&(a._overwriteVersionId(e.versionId),a._overwriteAlternativeVersionId(e.alternativeVersionId),a._overwriteInitialUndoRedoSnapshot(e.initialUndoRedoSnapshot))}else e.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}let o=S4(a.uri);if(this._models[o])throw Error(`ModelService: Cannot add model because it already exists!`);let s=new eIe(a,e=>this._onWillDispose(e),(e,t)=>this._onDidChangeLanguage(e,t));return this._models[o]=s,s}createModel(e,t,n,r=!1){let i;return i=t?this._createModelData(e,t,n,r):this._createModelData(e,Zd,n,r),this._onModelAdded.fire(i.model),i.model}getModels(){let e=[],t=Object.keys(this._models);for(let n=0,r=t.length;n<r;n++){let r=t[n];e.push(this._models[r].model)}return e}getModel(e){let t=S4(e),n=this._models[t];return n?n.model:null}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===Zi.file||e.scheme===Zi.vscodeRemote||e.scheme===Zi.vscodeUserData||e.scheme===Zi.vscodeNotebookCell||e.scheme===`fake-fs`}_onWillDispose(e){let t=S4(e.uri),n=this._models[t],r=this._undoRedoService.getUriComparisonKey(e.uri)!==e.uri.toString(),i=!1,a=0;if(r||this._shouldRestoreUndoStack()&&this._schemaShouldMaintainUndoRedoElements(e.uri)){let t=this._undoRedoService.getElements(e.uri);if(t.past.length>0||t.future.length>0){for(let n of t.past)PS(n)&&n.matchesResource(e.uri)&&(i=!0,a+=n.heapSize(e.uri),n.setModel(e.uri));for(let n of t.future)PS(n)&&n.matchesResource(e.uri)&&(i=!0,a+=n.heapSize(e.uri),n.setModel(e.uri))}}let o=x4.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,s=this._getSHA1Computer();if(!i){if(!r){let e=n.model.getInitialUndoRedoSnapshot();e!==null&&this._undoRedoService.restoreSnapshot(e)}}else if(!r&&(a>o||!s.canComputeSHA1(e))){let e=n.model.getInitialUndoRedoSnapshot();e!==null&&this._undoRedoService.restoreSnapshot(e)}else this._ensureDisposedModelsHeapSize(o-a),this._undoRedoService.setElementsValidFlag(e.uri,!1,t=>PS(t)&&t.matchesResource(e.uri)),this._insertDisposedModel(new nIe(e.uri,n.model.getInitialUndoRedoSnapshot(),Date.now(),r,a,s.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));delete this._models[t],n.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){let n=t.oldLanguage,r=e.getLanguageId(),i=this.getCreationOptions(n,e.uri,e.isForSimpleWidget),a=this.getCreationOptions(r,e.uri,e.isForSimpleWidget);x4._setModelOptionsForModel(e,a,i),this._onModelModeChanged.fire({model:e,oldLanguageId:n})}_getSHA1Computer(){return new rIe}};C4=x4=$Fe([b4(0,Dd),b4(1,oZ),b4(2,fw),b4(3,fc)],C4);var rIe=class e{static{this.MAX_MODEL_SIZE=10*1024*1024}canComputeSHA1(t){return t.getValueLength()<=e.MAX_MODEL_SIZE}computeSHA1(e){let t=new Ote,n=e.createSnapshot(),r;for(;r=n.read();)t.update(r);return t.digest()}},iIe=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},w4=function(e,t){return function(n,r){t(n,r,e)}},T4=class extends D{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=il.as(S$.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0,this._register(T(()=>{for(let e of this.mapProviderToDescriptor.values())Fn(e)&&e.dispose();this.visibleQuickAccess?.picker.dispose()}))}show(e=``,t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,n){let[r,i]=this.getOrInstantiateProvider(e,n?.enabledProviderPrefixes),a=this.visibleQuickAccess,o=a?.descriptor;if(a&&i&&o===i){e!==i.prefix&&!n?.preserveValue&&(a.picker.value=e),this.adjustValueSelection(a.picker,i,n);return}if(i&&!n?.preserveValue){let t;if(a&&o&&o!==i){let e=a.value.substr(o.prefix.length);e&&(t=`${i.prefix}${e}`)}if(!t){let e=r?.defaultFilterValue;e===x$.LAST?t=this.lastAcceptedPickerValues.get(i):typeof e==`string`&&(t=`${i.prefix}${e}`)}typeof t==`string`&&(e=t)}let s=a?.picker?.valueSelection,c=a?.picker?.value,l=new E,u=l.add(this.quickInputService.createQuickPick({useSeparators:!0}));u.value=e,this.adjustValueSelection(u,i,n),u.placeholder=n?.placeholder??i?.placeholder,u.quickNavigate=n?.quickNavigateConfiguration,u.hideInput=!!u.quickNavigate&&!a,(typeof n?.itemActivation==`number`||n?.quickNavigateConfiguration)&&(u.itemActivation=n?.itemActivation??SN.SECOND),u.contextKey=i?.contextKey,u.filterValue=e=>e.substring(i?i.prefix.length:0);let d;t&&(d=new vr,l.add(O.once(u.onWillAccept)(e=>{e.veto(),u.hide()}))),l.add(this.registerPickerListeners(u,r,i,e,n));let f=l.add(new tr);if(r&&l.add(r.provide(u,f.token,n?.providerOptions)),O.once(u.onDidHide)(()=>{u.selectedItems.length===0&&f.cancel(),l.dispose(),d?.complete(u.selectedItems.slice(0))}),u.show(),s&&c===e&&(u.valueSelection=s),t)return d?.p}adjustValueSelection(e,t,n){let r;r=n?.preserveValue?[e.value.length,e.value.length]:[t?.prefix.length??0,e.value.length],e.valueSelection=r}registerPickerListeners(e,t,n,r,i){let a=new E,o=this.visibleQuickAccess={picker:e,descriptor:n,value:r};return a.add(T(()=>{o===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),a.add(e.onDidChangeValue(e=>{let[n]=this.getOrInstantiateProvider(e,i?.enabledProviderPrefixes);n===t?o.value=e:this.show(e,{enabledProviderPrefixes:i?.enabledProviderPrefixes,preserveValue:!0,providerOptions:i?.providerOptions})})),n&&a.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(n,e.value)})),a}getOrInstantiateProvider(e,t){let n=this.registry.getQuickAccessProvider(e);if(!n||t&&!t?.includes(n.prefix))return[void 0,void 0];let r=this.mapProviderToDescriptor.get(n);return r||(r=this.instantiationService.createInstance(n.ctor),this.mapProviderToDescriptor.set(n,r)),[r,n]}};T4=iIe([w4(0,TN),w4(1,fc)],T4);var aIe=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},E4=class{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e==`string`?e:e.label).join(``)}};aIe([n_],E4.prototype,`toString`,null);var oIe=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function sIe(e){let t=[],n=0,r;for(;r=oIe.exec(e);){r.index-n>0&&t.push(e.substring(n,r.index));let[,i,a,,o]=r;o?t.push({label:i,href:a,title:o}):t.push({label:i,href:a}),n=r.index+r[0].length}return n<e.length&&t.push(e.substring(n)),new E4(t)}var D4={},cIe=new lD(`quick-input-button-icon-`);function lIe(e){if(!e)return;let t,n=e.dark.toString();return D4[n]?t=D4[n]:(t=cIe.nextId(),pm(`.${t}, .hc-light .${t}`,`background-image: ${YT(e.light||e.dark)}`),pm(`.vs-dark .${t}, .hc-black .${t}`,`background-image: ${YT(e.dark)}`),D4[n]=t),t}function O4(e,t,n){let r=e.iconClass||lIe(e.iconPath);return e.alwaysVisible&&(r=r?`${r} always-visible`:`always-visible`),{id:t,label:``,tooltip:e.tooltip||``,class:r,enabled:!0,run:n}}function uIe(e,t,n){Is(t);let r=sIe(e),i=0;for(let e of r.nodes)if(typeof e==`string`)t.append(...JO(e));else{let r=e.title;!r&&e.href.startsWith(`command:`)?r=C(1771,`Click to execute command '{0}'`,e.href.substring(8)):r||=e.href;let a=P(`a`,{href:e.href,title:r,tabIndex:i++},e.label);a.style.textDecoration=`underline`;let o=t=>{gne(t)&&Ns.stop(t,!0),n.callback(e.href)},s=n.disposables.add(new D_(a,M.CLICK)).event,c=n.disposables.add(new D_(a,M.KEY_DOWN)).event,l=O.chain(c,e=>e.filter(e=>{let t=new On(e);return t.equals(10)||t.equals(3)}));n.disposables.add(i_.addTarget(a));let u=n.disposables.add(new D_(a,r_.Tap)).event;O.any(s,u,l)(o,null,n.disposables),t.appendChild(a)}}var dIe=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},k4=function(e,t){return function(n,r){t(n,r,e)}},A4=`inQuickInput`,fIe=new z(A4,!1,C(1748,`Whether keyboard focus is inside the quick input control`)),j4=R.has(A4),pIe=new z(`quickInputAlignment`,`top`,C(1749,`The alignment of the quick input`)),M4=`quickInputType`,mIe=new z(M4,void 0,C(1750,`The type of the currently visible quick input`)),N4=`cursorAtEndOfQuickInputBox`,hIe=new z(N4,!1,C(1751,`Whether the cursor in the quick input is at the end of the input box`)),gIe=R.has(N4),P4={iconClass:Dc.asClassName(L.quickInputBack),tooltip:C(1752,`Back`)},F4=class e extends D{static{this.noPromptMessage=C(1753,`Press 'Enter' to confirm your input or 'Escape' to cancel`)}constructor(t){super(),this.ui=t,this._visible=Uo(`visible`,!1),this._widgetUpdated=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._leftButtons=[],this._rightButtons=[],this._inlineButtons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=e.noPromptMessage,this._severity=db.Ignore,this.onDidTriggerButtonEmitter=this._register(new k),this.onDidHideEmitter=this._register(new k),this.onWillHideEmitter=this._register(new k),this.onDisposeEmitter=this._register(new k),this.visibleDisposables=this._register(new E),this.onDidHide=this.onDidHideEmitter.event}get visible(){return this._visible.get()}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){let t=this._ignoreFocusOut!==e&&!rn;this._ignoreFocusOut=e&&!rn,t&&this.update()}get titleButtons(){return this._leftButtons.length?[...this._leftButtons,this._rightButtons]:this._rightButtons}get buttons(){return[...this._leftButtons,...this._rightButtons,...this._inlineButtons]}set buttons(e){this._leftButtons=e.filter(e=>e===P4),this._rightButtons=e.filter(e=>e!==P4&&e.location!==wN.Inline),this._inlineButtons=e.filter(e=>e.location===wN.Inline),this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=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=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this._visible.set(!0,void 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=xN.Other){this._visible.set(!1,void 0),this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}willHide(e=xN.Other){this.onWillHideEmitter.fire({reason:e})}update(){if(!this.visible)return;let e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:!e&&this.ui.title.innerHTML!==`&nbsp;`&&(this.ui.title.innerText=`\xA0`);let t=this.getDescription();if(this.ui.description1.textContent!==t&&(this.ui.description1.textContent=t),this.ui.description2.textContent!==t&&(this.ui.description2.textContent=t),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?Is(this.ui.widget,this._widget):Is(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new fr,this.busyDelay.setIfNotSet(()=>{this.visible&&(this.ui.progressBar.infinite(),this.ui.progressBar.getContainer().removeAttribute(`aria-hidden`))},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.ui.progressBar.getContainer().setAttribute(`aria-hidden`,`true`),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();let e=this._leftButtons.map((e,t)=>O4(e,`id-${t}`,async()=>this.onDidTriggerButtonEmitter.fire(e)));this.ui.leftActionBar.push(e,{icon:!0,label:!1}),this.ui.rightActionBar.clear();let t=this._rightButtons.map((e,t)=>O4(e,`id-${t}`,async()=>this.onDidTriggerButtonEmitter.fire(e)));this.ui.rightActionBar.push(t,{icon:!0,label:!1}),this.ui.inlineActionBar.clear();let n=this._inlineButtons.map((e,t)=>O4(e,`id-${t}`,async()=>this.onDidTriggerButtonEmitter.fire(e)));this.ui.inlineActionBar.push(n,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;let e=this.toggles?.filter(e=>e instanceof iL)??[];this.ui.inputBox.toggles=e;let t=e.length*22;this.ui.countContainer.style.right=t>0?`${4+t}px`:`4px`,this.ui.visibleCountContainer.style.right=t>0?`${4+t}px`:`4px`}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);let n=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==n&&(this._lastValidationMessage=n,Is(this.ui.message),n&&uIe(n,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?C(1754,`{0}/{1}`,this.step,this.totalSteps):this.step?String(this.step):``}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==db.Ignore){let 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()}},I4=class e extends F4{static{this.DEFAULT_ARIA_LABEL=C(1755,`Type to narrow down results.`)}constructor(e){super(e),this._value=``,this.onDidChangeValueEmitter=this._register(new k),this.onWillAcceptEmitter=this._register(new k),this.onDidAcceptEmitter=this._register(new k),this.onDidCustomEmitter=this._register(new k),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._keepScrollPosition=!1,this._itemActivation=SN.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new k),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new k),this.onDidTriggerItemButtonEmitter=this._register(new k),this.onDidTriggerSeparatorButtonEmitter=this._register(new k),this.valueSelectionUpdated=!0,this._ok=`default`,this._customButton=!1,this._focusEventBufferer=new Xn,this.type=`quickPick`,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,this.noValidationMessage=void 0}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 prompt(){return this.noValidationMessage}set prompt(e){this.noValidationMessage=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 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?eye:this.ui.keyMods}get valueSelection(){let e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}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 okLabel(){return this._okLabel??C(1756,`OK`)}set okLabel(e){this._okLabel=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.canSelectMany||this.ui.list.focus(CN.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(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._focusEventBufferer.wrapEvent(this.ui.list.onDidChangeFocus,(e,t)=>t)(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&va(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})=>{if(this.canSelectMany&&!e.some(e=>e.pickable===!1)){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&va(e,this._selectedItems,(e,t)=>e===t)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(js(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{!this.canSelectMany||!this.visible||this.selectedItemsToConfirm!==this._selectedItems&&va(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 j(this.ui.container,M.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;let t=new On(e),n=t.keyCode;this._quickNavigate.keybindings.some(e=>{let r=e.getChords();return r.length>1?!1:r[0].shiftKey&&n===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(r[0].altKey&&n===6||r[0].ctrlKey&&n===5||r[0].metaKey&&n===57)})&&(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;let t=this.keepScrollPosition?this.scrollTop:0,n=!!this.description,r={title:!!this.title||!!this.step||!!this.titleButtons.length,description:n,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||n,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage||!!this.prompt,customButton:this.customButton};this.ui.setVisibilities(r),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 i=this.ariaLabel;!i&&r.inputBox&&(i=this.placeholder,this.title&&(i=i?`${i} - ${this.title}`:this.title),i||=e.DEFAULT_ARIA_LABEL),this.ui.list.ariaLabel!==i&&(this.ui.list.ariaLabel=i??null),this.ui.inputBox.ariaLabel!==i&&(this.ui.inputBox.ariaLabel=i??`input`),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&&(this.itemsUpdated=!1,this._focusEventBufferer.bufferEvents(()=>{switch(this.ui.list.setElements(this.items),this.ui.list.shouldLoop=!this.canSelectMany,this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this._itemActivation){case SN.NONE:this._itemActivation=SN.FIRST;break;case SN.SECOND:this.ui.list.focus(CN.Second),this._itemActivation=SN.FIRST;break;case SN.LAST:this.ui.list.focus(CN.Last),this._itemActivation=SN.FIRST;break;default:this.trySelectFirst();break}})),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.ok.label=this.okLabel||``,this.ui.customButton.label=this.customLabel||``,this.ui.customButton.element.title=this.customHover||``,r.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(CN.First)),this.keepScrollPosition&&(this.scrollTop=t)}focus(e){this.ui.list.focus(e),this.canSelectMany&&this.ui.list.domFocus()}accept(e){e&&!this._canAcceptInBackground||(this.activeItems[0]&&!this._canSelectMany&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(e??!1))}},_Ie=class extends F4{constructor(){super(...arguments),this._value=``,this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new k),this.onDidAcceptEmitter=this._register(new k),this.type=`inputBox`,this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||``,this.update()}get valueSelection(){let e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}get prompt(){return this._prompt}set prompt(e){this._prompt=e,this.noValidationMessage=e?C(1757,`{0} (Press 'Enter' to confirm or 'Escape' to cancel)`,e):F4.noPromptMessage,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()}accept(){this.onDidAcceptEmitter.fire()}update(){if(!this.visible)return;this.ui.container.classList.remove(`hidden-input`);let e={title:!!this.title||!!this.step||!!this.titleButtons.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);let t=this.ariaLabel;!t&&e.inputBox&&(t=this.placeholder?this.title?`${this.placeholder} - ${this.title}`:this.placeholder:this.title?this.title:`input`),this.ui.inputBox.ariaLabel!==t&&(this.ui.inputBox.ariaLabel=t||`input`)}},L4=class extends LM{constructor(e,t){super(`mouse`,void 0,e=>this.getOverrideOptions(e),e,t)}getOverrideOptions(e){return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:(Os(e.content)?e.content.textContent??``:typeof e.content==`string`?e.content:e.content.value).includes(`
863
863
  `),skipFadeInAnimation:!0}}}};L4=dIe([k4(0,Dd),k4(1,IM)],L4);var R4=`done`,z4=`active`,B4=`infinite`,V4=`infinite-long-running`,H4=`discrete`,vIe=class e extends D{static{this.LONG_RUNNING_INFINITE_THRESHOLD=1e4}constructor(t,n){super(),this.progressSignal=this._register(new zn),this.workedVal=0,this.showDelayedScheduler=this._register(new mr(()=>zs(this.element),0)),this.longRunningScheduler=this._register(new mr(()=>this.infiniteLongRunning(),e.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(t,n)}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=t?.progressBarBackground||`#0E70C0`,this.element.appendChild(this.bit)}off(){this.bit.style.width=`inherit`,this.bit.style.opacity=`1`,this.element.classList.remove(z4,B4,V4,H4),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel(),this.progressSignal.clear()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(R4),this.element.classList.contains(B4)?(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(H4,R4,V4),this.element.classList.add(z4,B4),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(V4)}getContainer(){return this.element}},yIe=P,bIe=class extends D{constructor(e,t,n){super(),this.parent=e,this.onDidChange=e=>this.findInput.onDidChange(e),this.container=N(this.parent,yIe(`.quick-input-box`)),this.findInput=this._register(new jL(this.container,void 0,{label:``,inputBoxStyles:t,toggleStyles:n}));let r=this.findInput.inputBox.inputElement;r.role=`textbox`,r.ariaHasPopup=`menu`,r.ariaAutoComplete=`list`}get onKeyDown(){return this.findInput.onKeyDown}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}getSelection(){return this.findInput.inputBox.getSelection()}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 this.findInput.inputBox.inputElement.type===`password`}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)}get ariaLabel(){return this.findInput.inputBox.inputElement.getAttribute(`aria-label`)||``}set ariaLabel(e){this.findInput.inputBox.inputElement.setAttribute(`aria-label`,e)}hasFocus(){return this.findInput.inputBox.hasFocus()}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.findInput.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===db.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===db.Info?1:e===db.Warning?2:3,content:``})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===db.Info?1:e===db.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}},U4=new wr(()=>{let e=Pu.Collator(void 0,{numeric:!0,sensitivity:`base`}).value;return{collator:e,collatorIsNumeric:e.resolvedOptions().numeric}});new wr(()=>({collator:Pu.Collator(void 0,{numeric:!0}).value})),new wr(()=>({collator:Pu.Collator(void 0,{numeric:!0,sensitivity:`accent`}).value}));function xIe(e,t,n=!1){let r=e||``,i=t||``,a=U4.value.collator.compare(r,i);return U4.value.collatorIsNumeric&&a===0&&r!==i?r<i?-1:1:a}function SIe(e,t,n){let r=e.toLowerCase(),i=t.toLowerCase(),a=CIe(e,t,n);if(a)return a;let o=r.endsWith(n);if(o!==i.endsWith(n))return o?-1:1;let s=xIe(r,i);return s===0?r.localeCompare(i):s}function CIe(e,t,n){let r=e.toLowerCase(),i=t.toLowerCase(),a=r.startsWith(n),o=i.startsWith(n);if(a!==o)return a?-1:1;if(a&&o){if(r.length<i.length)return-1;if(r.length>i.length)return 1}return 0}var W4=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},G4=function(e,t){return function(n,r){t(n,r,e)}},K4,q4=P,J4=class{constructor(e,t,n){this.index=e,this.hasCheckbox=t,this._hidden=!1,this._init=new wr(()=>{let e=n.label??``;return{saneLabel:e,saneSortLabel:ZE(e).text.trim(),saneAriaLabel:n.ariaLabel||[e,this.saneDescription,this.saneDetail].map(e=>YE(e)).filter(e=>!!e).join(`, `)}}),this._saneDescription=n.description,this._saneTooltip=n.tooltip}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 saneDescription(){return this._saneDescription}set saneDescription(e){this._saneDescription=e}get saneDetail(){return this._saneDetail}set saneDetail(e){this._saneDetail=e}get saneTooltip(){return this._saneTooltip}set saneTooltip(e){this._saneTooltip=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}},Y4=class extends J4{constructor(e,t,n,r,i,a,o){super(e,n,a),this.childIndex=t,this.fireButtonTriggered=r,this._onChecked=i,this.item=a,this._separator=o,this._checked=!1,this.onChecked=n?O.map(O.filter(this._onChecked.event,e=>e.element===this),e=>e.checked):O.None,this._saneDetail=a.detail,this._labelHighlights=a.highlights?.label,this._descriptionHighlights=a.highlights?.description,this._detailHighlights=a.highlights?.detail}get separator(){return this._separator}set separator(e){this._separator=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({element:this,checked:e}))}get checkboxDisabled(){return!!this.item.disabled}},X4;(function(e){e[e.NONE=0]=`NONE`,e[e.MOUSE_HOVER=1]=`MOUSE_HOVER`,e[e.ACTIVE_ITEM=2]=`ACTIVE_ITEM`})(X4||={});var Z4=class extends J4{constructor(e,t,n){super(e,!1,n),this.fireSeparatorButtonTriggered=t,this.separator=n,this.children=[],this.focusInsideSeparator=X4.NONE}},wIe=class{getHeight(e){return e instanceof Z4?30:e.saneDetail?44:22}getTemplateId(e){return e instanceof Y4?$4.ID:e3.ID}},TIe=class{getWidgetAriaLabel(){return C(1770,`Quick Input`)}getAriaLabel(e){return e.separator?.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return`listbox`}getRole(e){return e.hasCheckbox?`checkbox`:`option`}isChecked(e){if(!(!e.hasCheckbox||!(e instanceof Y4)))return{get value(){return e.checked},onDidChange:t=>e.onChecked(()=>t())}}},Q4=class{constructor(e){this.hoverDelegate=e}renderTemplate(e){let t=Object.create(null);t.toDisposeElement=new E,t.toDisposeTemplate=new E,t.entry=N(e,q4(`.quick-input-list-entry`));let n=N(t.entry,q4(`label.quick-input-list-label`));t.outerLabel=n,t.checkbox=t.toDisposeTemplate.add(new zn),t.toDisposeTemplate.add($o(n,M.CLICK,e=>{if(t.checkbox.value&&!e.defaultPrevented&&t.checkbox.value.enabled){let e=!t.checkbox.value.checked;t.checkbox.value.checked=e,t.element.checked=e}}));let r=N(n,q4(`.quick-input-list-rows`)),i=N(r,q4(`.quick-input-list-row`)),a=N(r,q4(`.quick-input-list-row`));return t.label=new YV(i,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.label),t.icon=Fs(t.label.element,q4(`.quick-input-list-icon`)),t.keybinding=new OP(N(i,q4(`.quick-input-list-entry-keybinding`)),ln),t.toDisposeTemplate.add(t.keybinding),t.detail=new YV(N(a,q4(`.quick-input-list-label-meta`)),{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.detail),t.separator=N(t.entry,q4(`.quick-input-list-separator`)),t.actionBar=new Uk(t.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),t.actionBar.domNode.classList.add(`quick-input-list-entry-action-bar`),t.toDisposeTemplate.add(t.actionBar),t}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}disposeElement(e,t,n){n.toDisposeElement.clear(),n.actionBar.clear()}},$4=class extends Q4{static{K4=this}static{this.ID=`quickpickitem`}constructor(e,t){super(e),this.themeService=t,this._itemsWithSeparatorsFrequency=new Map}get templateId(){return K4.ID}ensureCheckbox(e,t){if(!e.hasCheckbox){t.checkbox.value?.domNode.remove(),t.checkbox.clear();return}let n=t.checkbox.value;n?n.setTitle(e.saneLabel):(n=new oL(e.saneLabel,e.checked,{...aM,size:15}),t.checkbox.value=n,t.outerLabel.prepend(n.domNode)),e.checkboxDisabled?n.disable():n.enable(),n.checked=e.checked,t.toDisposeElement.add(e.onChecked(e=>n.checked=e)),t.toDisposeElement.add(n.onChange(()=>e.checked=n.checked))}renderElement(e,t,n){let r=e.element;n.element=r,r.element=n.entry??void 0;let i=r.item;r.element.classList.toggle(`not-pickable`,r.item.pickable===!1),this.ensureCheckbox(r,n);let{labelHighlights:a,descriptionHighlights:o,detailHighlights:s}=r;if(i.iconPath){let e=Bg(this.themeService.getColorTheme().type)?i.iconPath.dark:i.iconPath.light??i.iconPath.dark,t=Vi.revive(e);n.icon.className=`quick-input-list-icon`,n.icon.style.backgroundImage=YT(t)}else n.icon.style.backgroundImage=``,n.icon.className=i.iconClass?`quick-input-list-icon ${i.iconClass}`:``;let c;!r.saneTooltip&&r.saneDescription&&(c={markdown:{value:Dr(r.saneDescription),supportThemeIcons:!0},markdownNotSupportedFallback:r.saneDescription});let l={matches:a||[],descriptionTitle:c,descriptionMatches:o||[],labelEscapeNewLines:!0};if(l.extraClasses=i.iconClasses,l.italic=i.italic,l.strikethrough=i.strikethrough,n.entry.classList.remove(`quick-input-list-separator-as-item`),n.label.setLabel(r.saneLabel,r.saneDescription,l),n.keybinding.set(i.keybinding),r.saneDetail){let e;r.saneTooltip||(e={markdown:{value:Dr(r.saneDetail),supportThemeIcons:!0},markdownNotSupportedFallback:r.saneDetail}),n.detail.element.style.display=``,n.detail.setLabel(r.saneDetail,void 0,{matches:s,title:e,labelEscapeNewLines:!0})}else n.detail.element.style.display=`none`;r.separator?.label?(n.separator.textContent=r.separator.label,n.separator.style.display=``,this.addItemWithSeparator(r)):n.separator.style.display=`none`,n.entry.classList.toggle(`quick-input-list-separator-border`,!!r.separator&&r.childIndex!==0);let u=i.buttons;u&&u.length?(n.actionBar.push(u.map((e,t)=>O4(e,`id-${t}`,()=>r.fireButtonTriggered({button:e,item:r.item}))),{icon:!0,label:!1}),n.entry.classList.add(`has-actions`)):n.entry.classList.remove(`has-actions`)}disposeElement(e,t,n){this.removeItemWithSeparator(e.element),super.disposeElement(e,t,n)}isItemWithSeparatorVisible(e){return this._itemsWithSeparatorsFrequency.has(e)}addItemWithSeparator(e){this._itemsWithSeparatorsFrequency.set(e,(this._itemsWithSeparatorsFrequency.get(e)||0)+1)}removeItemWithSeparator(e){let t=this._itemsWithSeparatorsFrequency.get(e)||0;t>1?this._itemsWithSeparatorsFrequency.set(e,t-1):this._itemsWithSeparatorsFrequency.delete(e)}};$4=K4=W4([G4(1,cv)],$4);var e3=class e extends Q4{constructor(){super(...arguments),this._visibleSeparatorsFrequency=new Map}static{this.ID=`quickpickseparator`}get templateId(){return e.ID}get visibleSeparators(){return[...this._visibleSeparatorsFrequency.keys()]}isSeparatorVisible(e){return this._visibleSeparatorsFrequency.has(e)}renderElement(e,t,n){let r=e.element;n.element=r,r.element=n.entry??void 0,r.element.classList.toggle(`focus-inside`,!!r.focusInsideSeparator);let i=r.separator,{labelHighlights:a,descriptionHighlights:o}=r;n.icon.style.backgroundImage=``,n.icon.className=``;let s;!r.saneTooltip&&r.saneDescription&&(s={markdown:{value:Dr(r.saneDescription),supportThemeIcons:!0},markdownNotSupportedFallback:r.saneDescription});let c={matches:a||[],descriptionTitle:s,descriptionMatches:o||[],labelEscapeNewLines:!0};n.entry.classList.add(`quick-input-list-separator-as-item`),n.label.setLabel(r.saneLabel,r.saneDescription,c),n.separator.style.display=`none`,n.entry.classList.add(`quick-input-list-separator-border`);let l=i.buttons;l&&l.length?(n.actionBar.push(l.map((e,t)=>O4(e,`id-${t}`,()=>r.fireSeparatorButtonTriggered({button:e,separator:r.separator}))),{icon:!0,label:!1}),n.entry.classList.add(`has-actions`)):n.entry.classList.remove(`has-actions`),this.addSeparator(r)}disposeElement(e,t,n){this.removeSeparator(e.element),this.isSeparatorVisible(e.element)||e.element.element?.classList.remove(`focus-inside`),super.disposeElement(e,t,n)}addSeparator(e){this._visibleSeparatorsFrequency.set(e,(this._visibleSeparatorsFrequency.get(e)||0)+1)}removeSeparator(e){let t=this._visibleSeparatorsFrequency.get(e)||0;t>1?this._visibleSeparatorsFrequency.set(e,t-1):this._visibleSeparatorsFrequency.delete(e)}},t3=class extends D{constructor(e,t,n,r,i,a){super(),this.parent=e,this.hoverDelegate=t,this.linkOpenerDelegate=n,this.accessibilityService=a,this._onKeyDown=new k,this._onLeave=new k,this.onLeave=this._onLeave.event,this._visibleCountObservable=Uo(`VisibleCount`,0),this.onChangedVisibleCount=O.fromObservable(this._visibleCountObservable,this._store),this._allVisibleCheckedObservable=Uo(`AllVisibleChecked`,!1),this.onChangedAllVisibleChecked=O.fromObservable(this._allVisibleCheckedObservable,this._store),this._checkedCountObservable=Uo(`CheckedCount`,0),this.onChangedCheckedCount=O.fromObservable(this._checkedCountObservable,this._store),this._checkedElementsObservable=FC({equalsFn:va},[]),this.onChangedCheckedElements=O.fromObservable(this._checkedElementsObservable,this._store),this._onButtonTriggered=new k,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new k,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._elementChecked=new k,this._elementCheckedEventBufferer=new Xn,this._hasCheckboxes=!1,this._inputElements=[],this._elementTree=[],this._itemElements=[],this._elementDisposable=this._register(new E),this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode=`fuzzy`,this._sortByLabel=!0,this._shouldLoop=!0,this._container=N(this.parent,q4(`.quick-input-list`)),this._separatorRenderer=new e3(t),this._itemRenderer=i.createInstance($4,t),this._tree=this._register(i.createInstance(PV,`QuickInput`,this._container,new wIe,[this._itemRenderer,this._separatorRenderer],{filter:{filter(e){return e.hidden?0:e instanceof Z4?2:1}},sorter:{compare:(e,t)=>!this.sortByLabel||!this._lastQueryString?0:DIe(e,t,this._lastQueryString.toLowerCase())},accessibilityProvider:new TIe,setRowLineHeight:!1,multipleSelectionSupport:!1,hideTwistiesOfChildlessElements:!0,renderIndentGuides:Oz.None,findWidgetEnabled:!1,indent:0,horizontalScrolling:!1,allowNonCollapsibleParents:!0,alwaysConsumeMouseWheel:!0})),this._tree.getHTMLElement().id=r,this._registerListeners()}get onDidChangeFocus(){return O.map(this._tree.onDidChangeFocus,e=>e.elements.filter(e=>e instanceof Y4).map(e=>e.item),this._store)}get onDidChangeSelection(){return O.map(this._tree.onDidChangeSelection,e=>({items:e.elements.filter(e=>e instanceof Y4).map(e=>e.item),event:e.browserEvent}),this._store)}get displayed(){return this._container.style.display!==`none`}set displayed(e){this._container.style.display=e?``:`none`}get scrollTop(){return this._tree.scrollTop}set scrollTop(e){this._tree.scrollTop=e}get ariaLabel(){return this._tree.ariaLabel}set ariaLabel(e){this._tree.ariaLabel=e??``}set enabled(e){this._tree.getHTMLElement().style.pointerEvents=e?``:`none`}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}get shouldLoop(){return this._shouldLoop}set shouldLoop(e){this._shouldLoop=e}_registerListeners(){this._registerOnKeyDown(),this._registerOnContainerClick(),this._registerOnMouseMiddleClick(),this._registerOnTreeModelChanged(),this._registerOnElementChecked(),this._registerOnContextMenu(),this._registerHoverListeners(),this._registerSelectionChangeListener(),this._registerSeparatorActionShowingListeners()}_registerOnKeyDown(){this._register(this._tree.onKeyDown(e=>{let t=new On(e);switch(t.keyCode){case 10:this.toggleCheckbox();break}this._onKeyDown.fire(t)}))}_registerOnContainerClick(){this._register(j(this._container,M.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()}))}_registerOnMouseMiddleClick(){this._register(j(this._container,M.AUXCLICK,e=>{e.button===1&&this._onLeave.fire()}))}_registerOnTreeModelChanged(){this._register(this._tree.onDidChangeModel(()=>{let e=this._itemElements.filter(e=>!e.hidden).length;this._visibleCountObservable.set(e,void 0),this._hasCheckboxes&&this._updateCheckedObservables()}))}_registerOnElementChecked(){this._register(this._elementCheckedEventBufferer.wrapEvent(this._elementChecked.event,(e,t)=>t)(e=>this._updateCheckedObservables()))}_registerOnContextMenu(){this._register(this._tree.onContextMenu(e=>{e.element&&(e.browserEvent.preventDefault(),this._tree.setSelection([e.element]))}))}_registerHoverListeners(){let e=this._register(new cr(typeof this.hoverDelegate.delay==`function`?this.hoverDelegate.delay():this.hoverDelegate.delay));this._register(this._tree.onMouseOver(async t=>{if(ks(t.browserEvent.target)){e.cancel();return}if(!(!ks(t.browserEvent.relatedTarget)&&vs(t.browserEvent.relatedTarget,t.element?.element)))try{await e.trigger(async()=>{t.element instanceof Y4&&this.showHover(t.element)})}catch(e){if(!ht(e))throw e}})),this._register(this._tree.onMouseOut(t=>{vs(t.browserEvent.relatedTarget,t.element?.element)||e.cancel()}))}_registerSeparatorActionShowingListeners(){this._register(this._tree.onDidChangeFocus(e=>{let t=e.elements[0]?this._tree.getParentElement(e.elements[0]):null;for(let e of this._separatorRenderer.visibleSeparators){let n=e===t;!!(e.focusInsideSeparator&X4.ACTIVE_ITEM)!==n&&(n?e.focusInsideSeparator|=X4.ACTIVE_ITEM:e.focusInsideSeparator&=~X4.ACTIVE_ITEM,this._tree.rerender(e))}})),this._register(this._tree.onMouseOver(e=>{let t=e.element?this._tree.getParentElement(e.element):null;for(let e of this._separatorRenderer.visibleSeparators)e===t&&(e.focusInsideSeparator&X4.MOUSE_HOVER||(e.focusInsideSeparator|=X4.MOUSE_HOVER,this._tree.rerender(e)))})),this._register(this._tree.onMouseOut(e=>{let t=e.element?this._tree.getParentElement(e.element):null;for(let e of this._separatorRenderer.visibleSeparators)e===t&&e.focusInsideSeparator&X4.MOUSE_HOVER&&(e.focusInsideSeparator&=~X4.MOUSE_HOVER,this._tree.rerender(e))}))}_registerSelectionChangeListener(){this._register(this._tree.onDidChangeSelection(e=>{let t=e.elements.filter(e=>e instanceof Y4);t.length!==e.elements.length&&(e.elements.length===1&&e.elements[0]instanceof Z4&&(this._tree.setFocus([e.elements[0].children[0]]),this._tree.reveal(e.elements[0],0)),this._tree.setSelection(t))}))}setAllVisibleChecked(e){this._elementCheckedEventBufferer.bufferEvents(()=>{this._itemElements.forEach(t=>{!t.hidden&&!t.checkboxDisabled&&t.item.pickable!==!1&&(t.checked=e)})})}setElements(e){this._elementDisposable.clear(),this._lastQueryString=void 0,this._inputElements=e,this._hasCheckboxes=this.parent.classList.contains(`show-checkboxes`);let t;this._itemElements=[],this._elementTree=e.reduce((n,r,i)=>{let a;if(r.type===`separator`){if(!r.buttons)return n;t=new Z4(i,e=>this._onSeparatorButtonTriggered.fire(e),r),a=t}else{let o=i>0?e[i-1]:void 0,s;o&&o.type===`separator`&&!o.buttons&&(s=o);let c=new Y4(i,t?.children?t.children.length:i,this._hasCheckboxes&&r.pickable!==!1,e=>this._onButtonTriggered.fire(e),this._elementChecked,r,s);if(this._itemElements.push(c),t)return t.children.push(c),n;a=c}return n.push(a),n},[]),this._setElementsToTree(this._elementTree),this.accessibilityService.isScreenReaderOptimized()&&setTimeout(()=>{let e=this._tree.getHTMLElement().querySelector(`.monaco-list-row.focused`),t=e?.parentNode;if(e&&t){let n=e.nextSibling;e.remove(),t.insertBefore(e,n)}},0)}setFocusedElements(e){let t=e.map(e=>this._itemElements.find(t=>t.item===e)).filter(e=>!!e).filter(e=>!e.hidden);if(this._tree.setFocus(t),e.length>0){let e=this._tree.getFocus()[0];e&&this._tree.reveal(e)}}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute(`aria-activedescendant`)}setSelectedElements(e){let t=e.map(e=>this._itemElements.find(t=>t.item===e)).filter(e=>!!e);this._tree.setSelection(t)}getCheckedElements(){return this._itemElements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){this._elementCheckedEventBufferer.bufferEvents(()=>{let t=new Set;for(let n of e)t.add(n);for(let e of this._itemElements)e.checked=t.has(e.item)})}focus(e){if(this._itemElements.length)switch(e===CN.Second&&this._itemElements.length<2&&(e=CN.First),e){case CN.First:this._tree.scrollTop=0,this._tree.focusFirst(void 0,e=>e.element instanceof Y4);break;case CN.Second:{this._tree.scrollTop=0;let e=!1;this._tree.focusFirst(void 0,t=>t.element instanceof Y4?e?!0:(e=!e,!1):!1);break}case CN.Last:this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,e=>e.element instanceof Y4);break;case CN.Next:{let e=this._tree.getFocus();this._tree.focusNext(void 0,this._shouldLoop,void 0,e=>e.element instanceof Y4?(this._tree.reveal(e.element),!0):!1);let t=this._tree.getFocus();e.length&&e[0]===t[0]&&this._onLeave.fire();break}case CN.Previous:{let e=this._tree.getFocus();this._tree.focusPrevious(void 0,this._shouldLoop,void 0,e=>{if(!(e.element instanceof Y4))return!1;let t=this._tree.getParentElement(e.element);return t===null||t.children[0]!==e.element?this._tree.reveal(e.element):this._tree.reveal(t),!0});let t=this._tree.getFocus();e.length&&e[0]===t[0]&&this._onLeave.fire();break}case CN.NextPage:this._tree.focusNextPage(void 0,e=>e.element instanceof Y4?(this._tree.reveal(e.element),!0):!1);break;case CN.PreviousPage:this._tree.focusPreviousPage(void 0,e=>{if(!(e.element instanceof Y4))return!1;let t=this._tree.getParentElement(e.element);return t===null||t.children[0]!==e.element?this._tree.reveal(e.element):this._tree.reveal(t),!0});break;case CN.NextSeparator:{let e=!1,t=this._tree.getFocus()[0];this._tree.focusNext(void 0,!0,void 0,t=>{if(e)return!0;if(t.element instanceof Z4)e=!0,this._separatorRenderer.isSeparatorVisible(t.element)?this._tree.reveal(t.element.children[0]):this._tree.reveal(t.element,0);else if(t.element instanceof Y4){if(t.element.separator)return this._itemRenderer.isItemWithSeparatorVisible(t.element)?this._tree.reveal(t.element):this._tree.reveal(t.element,0),!0;if(t.element===this._elementTree[0])return this._tree.reveal(t.element,0),!0}return!1}),t===this._tree.getFocus()[0]&&(this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,e=>e.element instanceof Y4));break}case CN.PreviousSeparator:{let e,t=!!this._tree.getFocus()[0]?.separator;this._tree.focusPrevious(void 0,!0,void 0,n=>{if(n.element instanceof Z4)t?e||=(this._separatorRenderer.isSeparatorVisible(n.element)?this._tree.reveal(n.element):this._tree.reveal(n.element,0),n.element.children[0]):t=!0;else if(n.element instanceof Y4&&!e){if(n.element.separator)this._itemRenderer.isItemWithSeparatorVisible(n.element)?this._tree.reveal(n.element):this._tree.reveal(n.element,0),e=n.element;else if(n.element===this._elementTree[0])return this._tree.reveal(n.element,0),!0}return!1}),e&&this._tree.setFocus([e]);break}}}clearFocus(){this._tree.setFocus([])}domFocus(){this._tree.domFocus()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:``,this._tree.layout()}filter(e){if(this._lastQueryString=e,!(this._sortByLabel||this._matchOnLabel||this._matchOnDescription||this._matchOnDetail))return this._tree.layout(),!1;let t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this._itemElements.forEach(e=>{e.labelHighlights=void 0,e.descriptionHighlights=void 0,e.detailHighlights=void 0,e.hidden=!1;let t=e.index&&this._inputElements[e.index-1];e.item&&(e.separator=t&&t.type===`separator`&&!t.buttons?t:void 0)});else{let n;this._itemElements.forEach(r=>{let i;i=this.matchOnLabelMode===`fuzzy`?this.matchOnLabel?QE(e,ZE(r.saneLabel))??void 0:void 0:this.matchOnLabel?EIe(t,ZE(r.saneLabel))??void 0:void 0;let a=this.matchOnDescription?QE(e,ZE(r.saneDescription||``))??void 0:void 0,o=this.matchOnDetail?QE(e,ZE(r.saneDetail||``))??void 0:void 0;if(i||a||o?(r.labelHighlights=i,r.descriptionHighlights=a,r.detailHighlights=o,r.hidden=!1):(r.labelHighlights=void 0,r.descriptionHighlights=void 0,r.detailHighlights=void 0,r.hidden=r.item?!r.item.alwaysShow:!0),r.item?r.separator=void 0:r.separator&&(r.hidden=!0),!this.sortByLabel){let e=r.index&&this._inputElements[r.index-1]||void 0;e?.type===`separator`&&!e.buttons&&(n=e),n&&!r.hidden&&(r.separator=n,n=void 0)}})}return this._setElementsToTree(this._sortByLabel&&e?this._itemElements:this._elementTree),this._tree.layout(),!0}toggleCheckbox(){this._elementCheckedEventBufferer.bufferEvents(()=>{let e=this._tree.getFocus().filter(e=>e instanceof Y4),t=this._allVisibleChecked(e);for(let n of e)n.checkboxDisabled||(n.checked=!t)})}style(e){this._tree.style(e)}toggleHover(){let e=this._tree.getFocus()[0];if(!e?.saneTooltip||!(e instanceof Y4))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}this.showHover(e);let t=new E;t.add(this._tree.onDidChangeFocus(e=>{e.elements[0]instanceof Y4&&this.showHover(e.elements[0])})),this._lastHover&&t.add(this._lastHover),this._elementDisposable.add(t)}_setElementsToTree(e){let t=[];for(let n of e)n instanceof Z4?t.push({element:n,collapsible:!1,collapsed:!1,children:n.children.map(e=>({element:e,collapsible:!1,collapsed:!1}))}):t.push({element:n,collapsible:!1,collapsed:!1});this._tree.setChildren(null,t)}_allVisibleChecked(e,t=!0){for(let n=0,r=e.length;n<r;n++){let r=e[n];if(!r.hidden&&r.item.pickable!==!1)if(r.checked)t=!0;else return!1}return t}_updateCheckedObservables(){Do(e=>{this._allVisibleCheckedObservable.set(this._allVisibleChecked(this._itemElements,!1),e);let t=this._itemElements.filter(e=>e.checked).length;this._checkedCountObservable.set(t,e),this._checkedElementsObservable.set(this.getCheckedElements(),e)})}showHover(e){this._lastHover&&!this._lastHover.isDisposed&&(this.hoverDelegate.onDidHideHover?.(),this._lastHover?.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:e=>{this.linkOpenerDelegate(e)},appearance:{showPointer:!0},container:this._container,position:{hoverPosition:1}},!1))}};W4([n_],t3.prototype,`onDidChangeFocus`,null),W4([n_],t3.prototype,`onDidChangeSelection`,null),t3=W4([G4(4,fc),G4(5,nm)],t3);function EIe(e,t){let{text:n,iconOffsets:r}=t;if(!r||r.length===0)return n3(e,n);let i=kr(n,` `),a=n.length-i.length,o=n3(e,i);if(o)for(let e of o){let t=r[e.start+a]+a;e.start+=t,e.end+=t}return o}function n3(e,t){let n=t.toLowerCase().indexOf(e.toLowerCase());return n===-1?null:[{start:n,end:n+e.length}]}function DIe(e,t,n){let r=e.labelHighlights||[],i=t.labelHighlights||[];return r.length&&!i.length?-1:!r.length&&i.length?1:r.length===0&&i.length===0?0:SIe(e.saneSortLabel,t.saneSortLabel,n)}function OIe(e,t={}){al.registerCommandAndKeybindingRule({weight:200,when:j4,metadata:{description:C(1758,`Used while in the context of any kind of quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.`)},...e,secondary:a3(e.primary,e.secondary??[],t)})}function r3(e,t={}){al.registerCommandAndKeybindingRule({weight:200,when:R.and(R.or(R.equals(M4,`quickPick`),R.equals(M4,`quickTree`)),j4),metadata:{description:C(1759,`Used while in the context of the quick pick. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.`)},...e,secondary:a3(e.primary,e.secondary??[],t)})}var i3=$t?256:2048;function a3(e,t,n={}){return n.withAltMod&&t.push(512+e),n.withCtrlMod&&(t.push(i3+e),n.withAltMod&&t.push(512+i3+e)),n.withCmdMod&&$t&&(t.push(2048+e),n.withCtrlMod&&t.push(2304+e),n.withAltMod&&(t.push(2560+e),n.withCtrlMod&&t.push(2816+e))),t}function o3(e,t){return n=>{let r=n.get(TN).currentQuickInput;if(r)return t&&r.quickNavigate?r.focus(t):r.focus(e)}}r3({id:`quickInput.pageNext`,primary:12,handler:o3(CN.NextPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0}),r3({id:`quickInput.pagePrevious`,primary:11,handler:o3(CN.PreviousPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0}),r3({id:`quickInput.first`,primary:i3+14,handler:o3(CN.First)},{withAltMod:!0,withCmdMod:!0}),r3({id:`quickInput.last`,primary:i3+13,handler:o3(CN.Last)},{withAltMod:!0,withCmdMod:!0}),r3({id:`quickInput.next`,primary:18,handler:o3(CN.Next)},{withCtrlMod:!0}),r3({id:`quickInput.previous`,primary:16,handler:o3(CN.Previous)},{withCtrlMod:!0});var s3=C(1760,`If we're in quick access mode, this will navigate to the next item. If we are not in quick access mode, this will navigate to the next separator.`),c3=C(1761,`If we're in quick access mode, this will navigate to the previous item. If we are not in quick access mode, this will navigate to the previous separator.`);$t?(r3({id:`quickInput.nextSeparatorWithQuickAccessFallback`,primary:2066,handler:o3(CN.NextSeparator,CN.Next),metadata:{description:s3}}),r3({id:`quickInput.nextSeparator`,primary:2578,secondary:[2322],handler:o3(CN.NextSeparator)},{withCtrlMod:!0}),r3({id:`quickInput.previousSeparatorWithQuickAccessFallback`,primary:2064,handler:o3(CN.PreviousSeparator,CN.Previous),metadata:{description:c3}}),r3({id:`quickInput.previousSeparator`,primary:2576,secondary:[2320],handler:o3(CN.PreviousSeparator)},{withCtrlMod:!0})):(r3({id:`quickInput.nextSeparatorWithQuickAccessFallback`,primary:530,handler:o3(CN.NextSeparator,CN.Next),metadata:{description:s3}}),r3({id:`quickInput.nextSeparator`,primary:2578,handler:o3(CN.NextSeparator)}),r3({id:`quickInput.previousSeparatorWithQuickAccessFallback`,primary:528,handler:o3(CN.PreviousSeparator,CN.Previous),metadata:{description:c3}}),r3({id:`quickInput.previousSeparator`,primary:2576,handler:o3(CN.PreviousSeparator)})),al.registerCommandAndKeybindingRule({id:`quickInput.accept`,primary:3,weight:200,when:R.and(R.notEquals(M4,`quickWidget`),j4,R.not(`isComposing`)),metadata:{description:C(1762,`Used while in the context of some quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.`)},handler:e=>{e.get(TN).currentQuickInput?.accept()},secondary:a3(3,[],{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0})}),r3({id:`quickInput.acceptInBackground`,when:R.and(j4,R.equals(M4,`quickPick`),R.or(VB.negate(),gIe)),primary:17,weight:250,handler:e=>{e.get(TN).currentQuickInput?.accept(!0)}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0}),OIe({id:`quickInput.hide`,primary:9,handler:e=>{e.get(TN).currentQuickInput?.hide()}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0}),r3({id:`quickInput.toggleHover`,primary:i3|10,handler:e=>{e.get(TN).toggleHover()}});var kIe=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},AIe=function(e,t){return function(n,r){t(n,r,e)}},l3,u3=P,d3=class extends D{static{l3=this}static{this.ID=`quickInputTreeElement`}constructor(e,t,n,r){super(),this._hoverDelegate=e,this._buttonTriggeredEmitter=t,this.onCheckedEvent=n,this._themeService=r,this.templateId=l3.ID}renderTemplate(e){let t=new E,n=N(e,u3(`.quick-input-tree-entry`)),r=t.add(new sL(``,!1,{...aM,size:15}));n.appendChild(r.domNode);let i=N(N(N(n,u3(`label.quick-input-tree-label`)),u3(`.quick-input-tree-rows`)),u3(`.quick-input-tree-row`)),a=Fs(i,u3(`.quick-input-tree-icon`)),o=t.add(new YV(i,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this._hoverDelegate})),s=t.add(new Uk(n,this._hoverDelegate?{hoverDelegate:this._hoverDelegate}:void 0));return s.domNode.classList.add(`quick-input-tree-entry-action-bar`),{toDisposeTemplate:t,entry:n,checkbox:r,icon:a,label:o,actionBar:s,toDisposeElement:new E}}renderElement(e,t,n,r){let i=n.toDisposeElement,a=e.element;if(a.pickable===!1?n.checkbox.domNode.style.display=`none`:(n.checkbox.domNode.style.display=``,n.checkbox.checked=a.checked??!1,i.add(O.filter(this.onCheckedEvent,e=>e.item===a)(e=>n.checkbox.checked=e.checked)),a.disabled&&n.checkbox.disable()),a.iconPath){let e=Bg(this._themeService.getColorTheme().type)?a.iconPath.dark:a.iconPath.light??a.iconPath.dark,t=Vi.revive(e);n.icon.className=`quick-input-tree-icon`,n.icon.style.backgroundImage=YT(t)}else n.icon.style.backgroundImage=``,n.icon.className=a.iconClass?`quick-input-tree-icon ${a.iconClass}`:``;let{labelHighlights:o,descriptionHighlights:s}=e.filterData||{},c;a.description&&(c={markdown:{value:Dr(a.description),supportThemeIcons:!0},markdownNotSupportedFallback:a.description}),n.label.setLabel(a.label,a.description,{matches:o,descriptionMatches:s,extraClasses:a.iconClasses,italic:a.italic,strikethrough:a.strikethrough,labelEscapeNewLines:!0,descriptionTitle:c});let l=a.buttons;l&&l.length?(n.actionBar.push(l.map((e,t)=>O4(e,`tree-${t}`,()=>this._buttonTriggeredEmitter.fire({item:a,button:e}))),{icon:!0,label:!1}),n.entry.classList.add(`has-actions`)):n.entry.classList.remove(`has-actions`)}disposeElement(e,t,n,r){n.toDisposeElement.clear(),n.actionBar.clear()}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}};d3=l3=kIe([AIe(3,cv)],d3);var jIe=class{getHeight(e){return 22}getTemplateId(e){return d3.ID}};function MIe(e){let t=!1,n=!1,r=!1;for(let i of e){switch(i.element?.checked){case`mixed`:r=!0;break;case!0:t=!0;break;default:n=!0;break}if(t&&n&&r)break}return n?r||t?`mixed`:!1:r?`mixed`:t}var NIe=class{constructor(e){this.onCheckedEvent=e}getWidgetAriaLabel(){return C(1772,`Quick Tree`)}getAriaLabel(e){return e.ariaLabel||[e.label,e.description].map(e=>YE(e)).filter(e=>!!e).join(`, `)}getWidgetRole(){return`tree`}getRole(e){return`checkbox`}isChecked(e){return{get value(){return e.checked===`mixed`?`mixed`:!!e.checked},onDidChange:t=>O.filter(this.onCheckedEvent,t=>t.item===e)(e=>t())}}},PIe=class{constructor(){this.filterValue=``,this.matchOnLabel=!0,this.matchOnDescription=!1}filter(e,t){if(!this.filterValue||!(this.matchOnLabel||this.matchOnDescription))return e.children?{visibility:2,data:{}}:{visibility:1,data:{}};let n=this.matchOnLabel?QE(this.filterValue,ZE(e.label))??void 0:void 0,r=this.matchOnDescription?QE(this.filterValue,ZE(e.description||``))??void 0:void 0;return{visibility:t===1||n||r?1:e.children?2:0,data:{labelHighlights:n,descriptionHighlights:r}}}},FIe=class extends D{constructor(){super(...arguments),this._sortByLabel=!0}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}compare(e,t){if(!this._sortByLabel)return 0;if(e.label<t.label)return-1;if(e.label>t.label)return 1;if(e.description&&t.description){if(e.description<t.description)return-1;if(e.description>t.description)return 1}else if(e.description)return-1;else if(t.description)return 1;return 0}},IIe=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},LIe=function(e,t){return function(n,r){t(n,r,e)}},RIe=P,f3=class extends D{constructor(e,t,n){super(),this.instantiationService=n,this._onDidTriggerButton=this._register(new k),this._onDidChangeCheckboxState=this._register(new k),this.onDidChangeCheckboxState=this._onDidChangeCheckboxState.event,this._onDidCheckedLeafItemsChange=this._register(new k),this._onLeave=new k,this.onLeave=this._onLeave.event,this._onDidAccept=this._register(new k),this.onDidAccept=this._onDidAccept.event,this._container=N(e,RIe(`.quick-input-tree`)),this._renderer=this._register(this.instantiationService.createInstance(d3,t,this._onDidTriggerButton,this.onDidChangeCheckboxState)),this._filter=this.instantiationService.createInstance(PIe),this._sorter=this._register(new FIe),this._tree=this._register(this.instantiationService.createInstance(PV,`QuickInputTree`,this._container,new jIe,[this._renderer],{accessibilityProvider:new NIe(this.onDidChangeCheckboxState),horizontalScrolling:!1,multipleSelectionSupport:!1,findWidgetEnabled:!1,alwaysConsumeMouseWheel:!0,hideTwistiesOfChildlessElements:!0,renderIndentGuides:Oz.None,expandOnDoubleClick:!0,expandOnlyOnTwistieClick:!0,disableExpandOnSpacebar:!0,sorter:this._sorter,filter:this._filter})),this.registerOnOpenListener()}get tree(){return this._tree}get displayed(){return this._container.style.display!==`none`}set displayed(e){this._container.style.display=e?``:`none`}get sortByLabel(){return this._sorter.sortByLabel}set sortByLabel(e){this._sorter.sortByLabel=e,this._tree.resort(null,!0)}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute(`aria-activedescendant`)}updateFilterOptions(e){e.matchOnLabel!==void 0&&(this._filter.matchOnLabel=e.matchOnLabel),e.matchOnDescription!==void 0&&(this._filter.matchOnDescription=e.matchOnDescription),this._tree.refilter()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:``,this._tree.layout()}registerOnOpenListener(){this._register(this._tree.onDidOpen(e=>{let t=e.element;if(!t||t.disabled)return;if(t.pickable===!1){this._tree.setFocus([t]),this._onDidAccept.fire();return}let n=t.checked!==!0;if((t.checked??!1)===n)return;t.checked=n,this._tree.rerender(t);let r=new Set,i=[...this._tree.getNode(t).children];for(;i.length;){let e=i.shift();e?.element&&!r.has(e.element)&&(r.add(e.element),(e.element.checked??!1)!==t.checked&&(e.element.checked=t.checked,this._tree.rerender(e.element)),i.push(...e.children))}let a=this._tree.getParentElement(t);for(;a;){let e=MIe([...this._tree.getNode(a).children]);(a.checked??!1)!==e&&(a.checked=e,this._tree.rerender(a)),a=this._tree.getParentElement(a)}this._onDidChangeCheckboxState.fire({item:t,checked:t.checked??!1}),this._onDidCheckedLeafItemsChange.fire(this.getCheckedLeafItems())}))}getCheckedLeafItems(){let e=new Set,t=[...this._tree.getNode().children],n=[];for(;t.length;){let r=t.shift();!r?.element||e.has(r.element)||r.element.checked&&(e.add(r.element),t.push(...r.children),r.element.children||n.push(r.element))}return n}};f3=IIe([LIe(2,fc)],f3);var p3=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},m3=function(e,t){return function(n,r){t(n,r,e)}},h3,g3=P,_3=`workbench.quickInput.viewState`,v3=class extends D{static{h3=this}static{this.MAX_WIDTH=600}get currentQuickInput(){return this.controller??void 0}get container(){return this._container}constructor(e,t,n,r,i){super(),this.options=e,this.layoutService=t,this.instantiationService=n,this.storageService=i,this.enabled=!0,this.onDidAcceptEmitter=this._register(new k),this.onDidCustomEmitter=this._register(new k),this.onDidTriggerButtonEmitter=this._register(new k),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new k),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new k),this.onHide=this.onHideEmitter.event,this.inQuickInputContext=fIe.bindTo(r),this.quickInputTypeContext=mIe.bindTo(r),this.endOfQuickInputBoxContext=hIe.bindTo(r),this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(O.runAndSubscribe(Xo,({window:e,disposables:t})=>this.registerKeyModsListeners(e,t),{window:Xe,disposables:this._store})),this._register(one(e=>{this.ui&&Ko(this.ui.container)===e&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))})),this.viewState=this.loadViewState()}registerKeyModsListeners(e,t){let n=e=>{this.keyMods.ctrlCmd=e.ctrlKey||e.metaKey,this.keyMods.alt=e.altKey};for(let r of[M.KEY_DOWN,M.KEY_UP,M.MOUSE_DOWN])t.add(j(e,r,n,!0))}getUI(e){if(this.ui)return e&&Ko(this._container)!==Ko(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;let t=N(this._container,g3(`.quick-input-widget.show-file-icons`));t.tabIndex=-1,t.style.display=`none`;let n=lm(t),r=N(t,g3(`.quick-input-titlebar`)),i=this._register(new Uk(r,{hoverDelegate:this.options.hoverDelegate}));i.domNode.classList.add(`quick-input-left-action-bar`);let a=N(r,g3(`.quick-input-title`)),o=this._register(new Uk(r,{hoverDelegate:this.options.hoverDelegate}));o.domNode.classList.add(`quick-input-right-action-bar`);let s=N(t,g3(`.quick-input-header`)),c=this._register(new sL(C(1763,`Toggle all checkboxes`),!1,{...aM,size:15}));N(s,c.domNode),this._register(c.onChange(()=>{let e=c.checked;ie.setAllVisibleChecked(e===!0)})),this._register(j(c.domNode,M.CLICK,e=>{(e.x||e.y)&&f.setFocus()}));let l=N(s,g3(`.quick-input-description`)),u=N(s,g3(`.quick-input-and-message`)),d=N(u,g3(`.quick-input-filter`)),f=this._register(new bIe(d,this.styles.inputBox,this.styles.toggle));f.setAttribute(`aria-describedby`,`${this.idPrefix}message`);let p=N(d,g3(`.quick-input-visible-count`));p.setAttribute(`aria-live`,`polite`),p.setAttribute(`aria-atomic`,`true`);let m=this._register(new KV(p,{countFormat:C(1764,`{0} Results`)},this.styles.countBadge)),h=N(d,g3(`.quick-input-count`));h.setAttribute(`aria-live`,`polite`);let g=this._register(new KV(h,{countFormat:C(1765,`{0} Selected`)},this.styles.countBadge)),_=this._register(new Uk(s,{hoverDelegate:this.options.hoverDelegate}));_.domNode.classList.add(`quick-input-inline-action-bar`);let v=N(s,g3(`.quick-input-action`)),y=this._register(new SP(v,this.styles.button));y.label=C(1766,`OK`),this._register(y.onDidClick(e=>{this.onDidAcceptEmitter.fire()}));let b=N(s,g3(`.quick-input-action`)),x=this._register(new SP(b,{...this.styles.button,supportIcons:!0}));x.label=C(1767,`Custom`),this._register(x.onDidClick(e=>{this.onDidCustomEmitter.fire()}));let S=N(u,g3(`#${this.idPrefix}message.quick-input-message`)),ee=this._register(new vIe(t,this.styles.progressBar));ee.getContainer().classList.add(`quick-input-progress`);let te=N(t,g3(`.quick-input-html-widget`));te.tabIndex=-1;let ne=N(t,g3(`.quick-input-description`)),re=this.idPrefix+`list`,ie=this._register(this.instantiationService.createInstance(t3,t,this.options.hoverDelegate,this.options.linkOpenerDelegate,re));f.setAttribute(`aria-controls`,re),this._register(ie.onDidChangeFocus(()=>{f.hasFocus()&&f.setAttribute(`aria-activedescendant`,ie.getActiveDescendant()??``)})),this._register(ie.onChangedAllVisibleChecked(e=>{c.checked=e})),this._register(ie.onChangedVisibleCount(e=>{m.setCount(e)})),this._register(ie.onChangedCheckedCount(e=>{cn(()=>g.setCount(e))})),this._register(ie.onLeave(()=>{setTimeout(()=>{this.controller&&(f.setFocus(),this.controller instanceof I4&&this.controller.canSelectMany&&ie.clearFocus())},0)}));let ae=this._register(this.instantiationService.createInstance(f3,t,this.options.hoverDelegate));this._register(ae.tree.onDidChangeFocus(()=>{f.hasFocus()&&f.setAttribute(`aria-activedescendant`,ae.getActiveDescendant()??``)})),this._register(ae.onLeave(()=>{setTimeout(()=>{this.controller&&(f.setFocus(),ae.tree.setFocus([]))},0)})),this._register(ae.onDidAccept(()=>{this.onDidAcceptEmitter.fire()})),this._register(ae.tree.onDidChangeContentHeight(()=>this.updateLayout()));let oe=Ps(t);return this._register(oe),this._register(j(t,M.FOCUS,e=>{let t=this.getUI();if(vs(e.relatedTarget,t.inputContainer)){let e=t.inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==e&&this.endOfQuickInputBoxContext.set(e)}vs(e.relatedTarget,t.container)||(this.inQuickInputContext.set(!0),this.previousFocusElement=Os(e.relatedTarget)?e.relatedTarget:void 0)},!0)),this._register(oe.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(xN.Blur),this.inQuickInputContext.set(!1),this.endOfQuickInputBoxContext.set(!1),this.previousFocusElement=void 0})),this._register(f.onKeyDown(e=>{let t=this.getUI().inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==t&&this.endOfQuickInputBoxContext.set(t),f.removeAttribute(`aria-activedescendant`)})),this._register(j(t,M.FOCUS,e=>{f.setFocus()})),this.dndController=this._register(this.instantiationService.createInstance(y3,this._container,t,[{node:r,includeChildren:!0},{node:s,includeChildren:!1}],this.viewState)),this._register(So(e=>{let t=this.dndController?.dndViewState.read(e);t&&(t.top!==void 0&&t.left!==void 0?this.viewState={...this.viewState,top:t.top,left:t.left}:this.viewState=void 0,this.updateLayout(),t.done&&this.saveViewState(this.viewState))})),this.ui={container:t,styleSheet:n,leftActionBar:i,titleBar:r,title:a,description1:ne,description2:l,widget:te,rightActionBar:o,inlineActionBar:_,checkAll:c,inputContainer:u,filterContainer:d,inputBox:f,visibleCountContainer:p,visibleCount:m,countContainer:h,count:g,okContainer:v,ok:y,message:S,customButtonContainer:b,customButton:x,list:ie,tree:ae,progressBar:ee,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._container=e,N(this._container,this.ui.container),this.dndController?.reparentUI(this._container))}pick(e,t={},n=$n.None){return new Promise((r,i)=>{let a=e=>{a=r,t.onKeyMods?.(o.keyMods),r(e)};if(n.isCancellationRequested){a(void 0);return}let o=this.createQuickPick({useSeparators:!0}),s,c=[o,o.onDidAccept(()=>{if(o.canSelectMany)a(o.selectedItems.slice()),o.hide();else{let e=o.activeItems[0];e&&(a(e),o.hide())}}),o.onDidChangeActive(e=>{let n=e[0];n&&t.onDidFocus&&t.onDidFocus(n)}),o.onDidChangeSelection(e=>{if(!o.canSelectMany){let t=e[0];t&&(a(t),o.hide())}}),o.onDidTriggerItemButton(e=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...e,removeItem:()=>{let t=o.items.indexOf(e.item);if(t!==-1){let e=o.items.slice(),n=e.splice(t,1),r=o.activeItems.filter(e=>e!==n[0]),i=o.keepScrollPosition;o.keepScrollPosition=!0,o.items=e,r&&(o.activeItems=r),o.keepScrollPosition=i}}})),o.onDidTriggerSeparatorButton(e=>t.onDidTriggerSeparatorButton?.(e)),o.onDidChangeValue(e=>{s&&!e&&(o.activeItems.length!==1||o.activeItems[0]!==s)&&(o.activeItems=[s])}),n.onCancellationRequested(()=>{o.hide()}),o.onDidHide(()=>{In(c),a(void 0)})];o.title=t.title,t.value&&(o.value=t.value),o.canSelectMany=!!t.canPickMany,o.placeholder=t.placeHolder,o.prompt=t.prompt,o.ignoreFocusOut=!!t.ignoreFocusLost,o.matchOnDescription=!!t.matchOnDescription,o.matchOnDetail=!!t.matchOnDetail,t.sortByLabel!==void 0&&(o.sortByLabel=t.sortByLabel),o.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,o.quickNavigate=t.quickNavigate,o.hideInput=!!t.hideInput,o.contextKey=t.contextKey,o.busy=!0,Promise.all([e,t.activeItem]).then(([e,t])=>{s=t,o.busy=!1,o.items=e,o.canSelectMany&&(o.selectedItems=e.filter(e=>e.type!==`separator`&&e.picked)),s&&(o.activeItems=[s])}),o.show(),Promise.resolve(e).then(void 0,e=>{i(e),o.hide()})})}setValidationOnInput(e,t){t&&Ot(t)?(e.severity=db.Error,e.validationMessage=t):t&&!Ot(t)?(e.severity=t.severity,e.validationMessage=t.content):(e.severity=db.Ignore,e.validationMessage=void 0)}input(e={},t=$n.None){return new Promise(n=>{if(t.isCancellationRequested){n(void 0);return}let r=this.createInputBox(),i=e.validateInput||(()=>Promise.resolve(void 0)),a=O.debounce(r.onDidChangeValue,(e,t)=>t,100),o=e.value||``,s=Promise.resolve(i(o)),c=[r,a(e=>{e!==o&&(s=Promise.resolve(i(e)),o=e),s.then(t=>{e===o&&this.setValidationOnInput(r,t)})}),r.onDidAccept(()=>{let e=r.value;e!==o&&(s=Promise.resolve(i(e)),o=e),s.then(t=>{!t||!Ot(t)&&t.severity!==db.Error?(n(e),r.hide()):e===o&&this.setValidationOnInput(r,t)})}),t.onCancellationRequested(()=>{r.hide()}),r.onDidHide(()=>{In(c),n(void 0)})];r.title=e.title,r.value=e.value||``,r.valueSelection=e.valueSelection,r.prompt=e.prompt,r.placeholder=e.placeHolder,r.password=!!e.password,r.ignoreFocusOut=!!e.ignoreFocusLost,r.show()})}createQuickPick(e={useSeparators:!1}){return new I4(this.getUI(!0))}createInputBox(){return new _Ie(this.getUI(!0))}show(e){let t=this.getUI(!0);this.onShowEmitter.fire();let n=this.controller;this.controller=e,n?.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent=``,t.description1.textContent=``,t.description2.textContent=``,Is(t.widget),t.rightActionBar.clear(),t.inlineActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder=``,t.inputBox.password=!1,t.inputBox.showDecoration(db.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),Is(t.message),t.progressBar.stop(),t.progressBar.getContainer().setAttribute(`aria-hidden`,`true`),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.tree.updateFilterOptions({matchOnDescription:!1,matchOnLabel:!0}),t.tree.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;let r=this.options.backKeybindingLabel();P4.tooltip=r?C(1768,`Back ({0})`,r):C(1769,`Back`),t.container.style.display=``,this.updateLayout(),this.dndController?.layoutContainer(),t.inputBox.setFocus(),this.quickInputTypeContext.set(e.type)}isVisible(){return!!this.ui&&this.ui.container.style.display!==`none`}setVisibilities(e){let 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.domNode.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.displayed=!!e.list,t.tree.displayed=!!e.tree,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;let t=this.getUI();for(let n of t.leftActionBar.viewItems)n.action.enabled=e;for(let n of t.rightActionBar.viewItems)n.action.enabled=e;e?t.checkAll.enable():t.checkAll.disable(),t.inputBox.enabled=e,t.ok.enabled=e,t.list.enabled=e}}hide(e){let t=this.controller;if(!t)return;t.willHide(e);let n=this.ui?.container,r=n&&!Ts(n);if(this.controller=null,this.onHideEmitter.fire(),n&&(n.style.display=`none`),!r){let e=this.previousFocusElement;for(;e&&!e.offsetParent;)e=e.parentElement??void 0;e?.offsetParent?(e.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}t.didHide(e)}toggleHover(){this.isVisible()&&this.controller instanceof I4&&this.getUI().list.toggleHover()}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isVisible()){let e=this.ui.container.style,t=Math.min(this.dimension.width*.62,h3.MAX_WIDTH);e.width=t+`px`,e.top=`${this.viewState?.top?Math.round(this.dimension.height*this.viewState.top):this.titleBarOffset}px`,e.left=`${Math.round(this.dimension.width*(this.viewState?.left??.5)-t/2)}px`,this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4),this.ui.tree.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){let{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:n,widgetBorder:r,widgetShadow:i}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??``,this.ui.container.style.backgroundColor=t??``,this.ui.container.style.color=n??``,this.ui.container.style.border=r?`1px solid ${r}`:``,this.ui.container.style.boxShadow=i?`0 0 8px 2px ${i}`:``,this.ui.list.style(this.styles.list),this.ui.tree.tree.style(this.styles.list);let a=[];this.styles.pickerGroup.pickerGroupBorder&&a.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&a.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&a.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)&&(a.push(`.quick-input-list .monaco-keybinding > .monaco-keybinding-key {`),this.styles.keybindingLabel.keybindingLabelBackground&&a.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&a.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&a.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&a.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&a.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),a.push(`}`));let o=a.join(`
864
864
  `);o!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=o)}}loadViewState(){try{let e=JSON.parse(this.storageService.get(_3,-1,`{}`));if(e.top!==void 0||e.left!==void 0)return e}catch{}}saveViewState(e){this.layoutService.activeContainer===this.layoutService.mainContainer&&(e===void 0?this.storageService.remove(_3,-1):this.storageService.store(_3,JSON.stringify(e),-1,1))}};v3=h3=p3([m3(1,kP),m3(2,fc),m3(3,Qc),m3(4,tM)],v3);var y3=class extends D{constructor(e,t,n,r,i,a,o){super(),this._container=e,this._quickInputContainer=t,this._quickInputDragAreas=n,this._layoutService=i,this.configurationService=o,this.dndViewState=Uo(this,void 0),this._snapThreshold=20,this._snapLineHorizontalRatio=.25,this._quickInputAlignmentContext=pIe.bindTo(a);let s=gve(this.configurationService)===`custom`;this._controlsOnLeft=s&&on===1,this._controlsOnRight=s&&(on===3||on===2),this._registerLayoutListener(),this.registerMouseListeners(),this.dndViewState.set({...r,done:!0},void 0)}reparentUI(e){this._container=e}layoutContainer(e=this._layoutService.activeContainerDimension){let t=this.dndViewState.get(),n=this._quickInputContainer.getBoundingClientRect();if(t?.top&&t?.left){let r=Math.round(t.left*100)/100,i=e.width,a=n.width,o=r*i-a/2;this._layout(t.top*e.height,o)}}_registerLayoutListener(){this._register(O.filter(this._layoutService.onDidLayoutContainer,e=>e.container===this._container)(e=>this.layoutContainer(e.dimension)))}registerMouseListeners(){let e=this._quickInputContainer;this._register(ts(e,t=>{let n=new An(Ko(e),t);n.detail===2&&this._quickInputDragAreas.some(({node:e,includeChildren:t})=>t?vs(n.target,e):n.target===e)&&this.dndViewState.set({top:void 0,left:void 0,done:!0},void 0)})),this._register(es(e,e=>{let t=Ko(this._layoutService.activeContainer),n=new An(t,e);if(!this._quickInputDragAreas.some(({node:e,includeChildren:t})=>t?vs(n.target,e):n.target===e))return;let r=this._quickInputContainer.getBoundingClientRect(),i=n.browserEvent.clientX-r.left,a=n.browserEvent.clientY-r.top,o=!1,s=dne(t,e=>{new An(t,e).preventDefault(),o||=!0,this._layout(e.clientY-a,e.clientX-i)}),c=ts(t,e=>{if(o){let e=this.dndViewState.get();this.dndViewState.set({top:e?.top,left:e?.left,done:!0},void 0)}s.dispose(),c.dispose()})}))}_layout(e,t){let n=this._getTopSnapValue(),r=this._getCenterYSnapValue(),i=this._getCenterXSnapValue();e=Math.max(0,Math.min(e,this._container.clientHeight-this._quickInputContainer.clientHeight)),e<this._layoutService.activeContainerOffset.top&&(this._controlsOnLeft?t=Math.max(t,80/$e(Ds())):this._controlsOnRight&&(t=Math.min(t,this._container.clientWidth-this._quickInputContainer.clientWidth-140/$e(Ds()))));let a=Math.abs(e-n)<this._snapThreshold;e=a?n:e;let o=Math.abs(e-r)<this._snapThreshold;e=o?r:e;let s=e/this._container.clientHeight;t=Math.max(0,Math.min(t,this._container.clientWidth-this._quickInputContainer.clientWidth));let c=Math.abs(t-i)<this._snapThreshold;t=c?i:t;let l=this._container.clientWidth,u=this._quickInputContainer.clientWidth,d=(t+u/2)/l;if(this.dndViewState.set({top:s,left:d,done:!1},void 0),c){if(a){this._quickInputAlignmentContext.set(`top`);return}else if(o){this._quickInputAlignmentContext.set(`center`);return}}this._quickInputAlignmentContext.set(void 0)}_getTopSnapValue(){return this._layoutService.activeContainerOffset.quickPickTop}_getCenterYSnapValue(){return Math.round(this._container.clientHeight*this._snapLineHorizontalRatio)}_getCenterXSnapValue(){return Math.round(this._container.clientWidth/2)-Math.round(this._quickInputContainer.clientWidth/2)}};y3=p3([m3(4,kP),m3(5,Qc),m3(6,Dd)],y3);var zIe=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},b3=function(e,t){return function(n,r){t(n,r,e)}},x3=class extends mv{get controller(){return this._controller||=this._register(this.createController()),this._controller}get hasController(){return!!this._controller}get currentQuickInput(){return this.controller.currentQuickInput}get quickAccess(){return this._quickAccess||=this._register(this.instantiationService.createInstance(T4)),this._quickAccess}constructor(e,t,n,r,i){super(n),this.instantiationService=e,this.contextKeyService=t,this.layoutService=r,this.configurationService=i,this._onShow=this._register(new k),this._onHide=this._register(new k),this.contexts=new Map}createController(e=this.layoutService,t){let n={idPrefix:`quickInput_`,container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>void 0,setContextKey:e=>this.setContextKey(e),linkOpenerDelegate:e=>{this.instantiationService.invokeFunction(t=>{t.get(BN).open(e,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(L4))},r=this._register(this.instantiationService.createInstance(v3,{...n,...t}));return r.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(t=>{Ko(e.activeContainer)===Ko(r.container)&&r.layout(t,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{r.isVisible()||r.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(r.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(r.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),r}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new z(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t?.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t,n=$n.None){return this.controller.pick(e,t,n)}input(e={},t=$n.None){return this.controller.input(e,t)}createQuickPick(e={useSeparators:!1}){return this.controller.createQuickPick(e)}createInputBox(){return this.controller.createInputBox()}toggleHover(){this.hasController&&this.controller.toggleHover()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:Y(og),quickInputForeground:Y(_se),quickInputTitleBackground:Y(vse),widgetBorder:Y(yh),widgetShadow:Y(vh)},inputBox:oM,toggle:iM,countBadge:sM,button:lve,progressBar:uve,keybindingLabel:rM,list:lM({listBackground:og,listFocusBackground:dg,listFocusForeground:lg,listInactiveFocusForeground:lg,listInactiveSelectionIconForeground:ug,listInactiveFocusBackground:dg,listFocusOutline:Vm,listInactiveFocusOutline:Vm,treeStickyScrollBackground:og}),pickerGroup:{pickerGroupBorder:Y(yse),pickerGroupForeground:Y(sg)}}}};x3=zIe([b3(0,fc),b3(1,Qc),b3(2,cv),b3(3,kP),b3(4,Dd)],x3);var S3=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},C3=function(e,t){return function(n,r){t(n,r,e)}},w3=class extends x3{constructor(e,t,n,r,i,a){super(t,n,r,new i2(e.getContainerDomNode(),i),a),this.host=void 0;let o=E3.get(e);if(o){let t=o.widget;this.host={_serviceBrand:void 0,get mainContainer(){return t.getDomNode()},getContainer(){return t.getDomNode()},whenContainerStylesLoaded(){},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 O.map(e.onDidLayoutChange,e=>({container:t.getDomNode(),dimension:e}))},get onDidChangeActiveContainer(){return O.None},get onDidAddContainer(){return O.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)}};w3=S3([C3(1,fc),C3(2,Qc),C3(3,cv),C3(4,mc),C3(5,Dd)],w3);var T3=class{get activeService(){let e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw Error(`Quick input service needs a focused editor to work.`);let t=this.mapEditorToService.get(e);if(!t){let n=t=this.instantiationService.createInstance(w3,e);this.mapEditorToService.set(e,t),Mn(e.onDidDispose)(()=>{n.dispose(),this.mapEditorToService.delete(e)})}return t}get currentQuickInput(){return this.activeService.currentQuickInput}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t,n=$n.None){return this.activeService.pick(e,t,n)}input(e,t){return this.activeService.input(e,t)}createQuickPick(e={useSeparators:!1}){return this.activeService.createQuickPick(e)}createInputBox(){return this.activeService.createInputBox()}toggleHover(){return this.activeService.toggleHover()}};T3=S3([C3(0,fc),C3(1,mc)],T3);var E3=class e{static{this.ID=`editor.controller.quickInput`}static get(t){return t.getContribution(e.ID)}constructor(e){this.editor=e,this.widget=new BIe(this.editor)}dispose(){this.widget.dispose()}},BIe=class e{static{this.ID=`editor.contrib.quickInputWidget`}constructor(e){this.codeEditor=e,this.domNode=document.createElement(`div`),this.codeEditor.addOverlayWidget(this)}getId(){return e.ID}getDomNode(){return this.domNode}getPosition(){return{preference:{top:0,left:0}}}dispose(){this.codeEditor.removeOverlayWidget(this)}};su(E3.ID,E3,4);var VIe=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},D3=function(e,t){return function(n,r){t(n,r,e)}},O3=class extends D{constructor(e,t,n){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=n,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new k,this._onDidChangeReducedMotion=new k,this._onDidChangeLinkUnderline=new k,this._accessibilityModeEnabledContext=rm.bindTo(this._contextKeyService);let r=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(`editor.accessibilitySupport`)&&(r(),this._onDidChangeScreenReaderOptimized.fire()),e.affectsConfiguration(`workbench.reduceMotion`)&&(this._configMotionReduced=this._configurationService.getValue(`workbench.reduceMotion`),this._onDidChangeReducedMotion.fire())})),r(),this._register(this.onDidChangeScreenReaderOptimized(()=>r()));let i=Xe.matchMedia(`(prefers-reduced-motion: reduce)`);this._systemMotionReduced=i.matches,this._configMotionReduced=this._configurationService.getValue(`workbench.reduceMotion`),this._linkUnderlinesEnabled=this._configurationService.getValue(`accessibility.underlineLinks`),this.initReducedMotionListeners(i),this.initLinkUnderlineListeners()}initReducedMotionListeners(e){this._register(j(e,`change`,()=>{this._systemMotionReduced=e.matches,this._configMotionReduced===`auto`&&this._onDidChangeReducedMotion.fire()}));let t=()=>{let e=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle(`monaco-reduce-motion`,e),this._layoutService.mainContainer.classList.toggle(`monaco-enable-motion`,!e)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}initLinkUnderlineListeners(){this._register(this._configurationService.onDidChangeConfiguration(e=>{if(e.affectsConfiguration(`accessibility.underlineLinks`)){let e=this._configurationService.getValue(`accessibility.underlineLinks`);this._linkUnderlinesEnabled=e,this._onDidChangeLinkUnderline.fire()}}));let e=()=>{let e=this._linkUnderlinesEnabled;this._layoutService.mainContainer.classList.toggle(`underline-links`,e)};e(),this._register(this.onDidChangeLinkUnderlines(()=>e()))}onDidChangeLinkUnderlines(e){return this._onDidChangeLinkUnderline.event(e)}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){let e=this._configurationService.getValue(`editor.accessibilitySupport`);return e===`on`||e===`auto`&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){let e=this._configMotionReduced;return e===`on`||e===`auto`&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};O3=VIe([D3(0,Qc),D3(1,kP),D3(2,Dd)],O3);var HIe=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},k3=function(e,t){return function(n,r){t(n,r,e)}},A3,j3=`application/vnd.code.resources`,M3=class extends D{static{A3=this}constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText=``,this.resources=[],this.resourcesStateHash=void 0,(it||at)&&this.installWebKitWriteTextWorkaround(),this._register(O.runAndSubscribe(Xo,({window:e,disposables:t})=>{t.add(j(e.document,`copy`,()=>this.clearResourcesState()))},{window:Xe,disposables:this._store}))}triggerPaste(){this.logService.trace(`BrowserClipboardService#triggerPaste`)}installWebKitWriteTextWorkaround(){let e=()=>{let e=new vr;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=e,Ds().navigator.clipboard.write([new ClipboardItem({"text/plain":e.p})]).catch(async t=>{(!(t instanceof Error)||t.name!==`NotAllowedError`||!e.isRejected)&&this.logService.error(t)})};this._register(O.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:n})=>{n.add(j(t,`click`,e)),n.add(j(t,`keydown`,e))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.logService.trace(`BrowserClipboardService#writeText called with type:`,t,` text.length:`,e.length),this.clearResourcesState(),t){this.mapTextToType.set(t,e),this.logService.trace(`BrowserClipboardService#writeText`);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return this.logService.trace(`before navigator.clipboard.writeText`),await Ds().navigator.clipboard.writeText(e)}catch(e){console.error(e)}this.fallbackWriteText(e)}fallbackWriteText(e){this.logService.trace(`BrowserClipboardService#fallbackWriteText`);let t=Es(),n=t.activeElement,r=t.body.appendChild(P(`textarea`,{"aria-hidden":!0}));r.style.height=`1px`,r.style.width=`1px`,r.style.position=`absolute`,r.value=e,r.focus(),r.select(),t.execCommand(`copy`),Os(n)&&n.focus(),r.remove()}async readText(e){if(this.logService.trace(`BrowserClipboardService#readText called with type:`,e),e){let t=this.mapTextToType.get(e)||``;return this.logService.trace(`BrowserClipboardService#readText text.length:`,t.length),t}try{let e=await Ds().navigator.clipboard.readText();return this.logService.trace(`BrowserClipboardService#readText text.length:`,e.length),e}catch(e){console.error(e)}return``}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}static{this.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3}async readResources(){try{let e=await Ds().navigator.clipboard.read();for(let t of e)if(t.types.includes(`web ${j3}`)){let e=await t.getType(`web ${j3}`);return JSON.parse(await e.text()).map(e=>Vi.from(e))}}catch{}let e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResourcesState(),this.resources}async computeResourcesStateHash(){if(this.resources.length!==0)return fa((await this.readText()).substring(0,A3.MAX_RESOURCE_STATE_SOURCE_LENGTH))}clearInternalState(){this.clearResourcesState()}clearResourcesState(){this.resources=[],this.resourcesStateHash=void 0}};M3=A3=HIe([k3(0,kP),k3(1,Bl)],M3);var UIe=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},WIe=function(e,t){return function(n,r){t(n,r,e)}},N3=`data-keybinding-context`,P3=class{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?!1:(this._value[e]=t,!0)}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){let t=this._value[e];return t===void 0&&this._parent?this._parent.getValue(e):t}},F3=class e extends P3{static{this.INSTANCE=new e}constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}},GIe=class e extends P3{static{this._keyPrefix=`config.`}constructor(e,t,n){super(e,null),this._configurationService=t,this._values=XN.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(e=>{if(e.source===7){let e=Array.from(this._values,([e])=>e);this._values.clear(),n.fire(new L3(e))}else{let t=[];for(let n of e.affectedKeys){let e=`config.${n}`,r=this._values.findSuperstr(e);r!==void 0&&(t.push(...Nn.map(r,([e])=>e)),this._values.deleteSuperstr(e)),this._values.has(e)&&(t.push(e),this._values.delete(e))}n.fire(new L3(t))}})}dispose(){this._listener.dispose()}getValue(t){if(t.indexOf(e._keyPrefix)!==0)return super.getValue(t);if(this._values.has(t))return this._values.get(t);let n=t.substr(e._keyPrefix.length),r=this._configurationService.getValue(n),i;switch(typeof r){case`number`:case`boolean`:case`string`:i=r;break;default:i=Array.isArray(r)?JSON.stringify(r):r}return this._values.set(t,i),i}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}},KIe=class{constructor(e,t,n){this._service=e,this._key=t,this._defaultValue=n,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){this._defaultValue===void 0?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}},I3=class{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}},L3=class{constructor(e){this.keys=e}affectsSome(e){for(let t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}},qIe=class{constructor(e){this.events=e}affectsSome(e){for(let t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}};function JIe(e,t){return e.allKeysContainedIn(new Set(Object.keys(t)))}var R3=class extends D{get onDidChangeContext(){return this._onDidChangeContext.event}constructor(e){super(),this._onDidChangeContext=this._register(new Jn({merge:e=>new qIe(e)})),this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw Error(`AbstractContextKeyService has been disposed`);return new KIe(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw Error(`AbstractContextKeyService has been disposed`);return new YIe(this,e)}contextMatchesRules(e){if(this._isDisposed)throw Error(`AbstractContextKeyService has been disposed`);let t=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(t):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;let n=this.getContextValuesContainer(this._myContextId);n&&n.setValue(e,t)&&this._onDidChangeContext.fire(new I3(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new I3(e))}getContext(e){return this._isDisposed?F3.INSTANCE:this.getContextValuesContainer(XIe(e))}dispose(){super.dispose(),this._isDisposed=!0}},z3=class extends R3{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0,this.inputFocusedContext=VB.bindTo(this);let t=this._register(new GIe(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t),this._register(O.runAndSubscribe(Xo,({window:e,disposables:t})=>{let n=t.add(new zn);t.add(j(e,M.FOCUS_IN,()=>{n.value=new E,this.updateInputContextKeys(e.document,n.value)},!0))},{window:Xe,disposables:this._store}))}updateInputContextKeys(e,t){function n(){return!!e.activeElement&&Ks(e.activeElement)}let r=n();if(this.inputFocusedContext.set(r),r){let r=t.add(Ps(e.activeElement));O.once(r.onDidBlur)(()=>{Ds().document===e&&this.inputFocusedContext.set(n()),r.dispose()},void 0,t)}}getContextValuesContainer(e){return this._isDisposed?F3.INSTANCE:this._contexts.get(e)||F3.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw Error(`ContextKeyService has been disposed`);let t=++this._lastContextId;return this._contexts.set(t,new P3(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};z3=UIe([WIe(0,Dd)],z3);var YIe=class extends R3{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new zn),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(N3)){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(N3,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{let t=this._parent.getContextValuesContainer(this._myContextId).value;JIe(e,t)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(N3),super.dispose())}getContextValuesContainer(e){return this._isDisposed?F3.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw Error(`ScopedContextKeyService has been disposed`);return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}};function XIe(e){for(;e;){if(e.hasAttribute(N3)){let t=e.getAttribute(N3);return t?parseInt(t,10):NaN}e=e.parentElement}return 0}function ZIe(e,t,n){e.get(Qc).createKey(String(t),QIe(n))}function QIe(e){return Ku(e,e=>{if(typeof e==`object`&&e.$mid===1)return Vi.revive(e).toString();if(e instanceof Vi)return e.toString()})}kc.registerCommand(`_setContext`,ZIe),kc.registerCommand({id:`getContextKeyInfo`,handler(){return[...z.all()].sort((e,t)=>e.key.localeCompare(t.key))},metadata:{description:C(1674,`A command that returns information about context keys`),args:[]}}),kc.registerCommand(`_generateContextKeyInfo`,function(){let e=[],t=new Set;for(let n of z.all())t.has(n.key)||(t.add(n.key),e.push(n));e.sort((e,t)=>e.key.localeCompare(t.key)),console.log(JSON.stringify(e,void 0,2))});var $Ie=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}},B3=class{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){let e=[];for(let t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){let n=this.lookupOrInsertNode(e),r=this.lookupOrInsertNode(t);n.outgoing.set(r.key,r),r.incoming.set(n.key,n)}removeNode(e){let t=this._hashFn(e);this._nodes.delete(t);for(let e of this._nodes.values())e.outgoing.delete(t),e.incoming.delete(t)}lookupOrInsertNode(e){let t=this._hashFn(e),n=this._nodes.get(t);return n||(n=new $Ie(t,e),this._nodes.set(t,n)),n}isEmpty(){return this._nodes.size===0}toString(){let e=[];for(let[t,n]of this._nodes)e.push(`${t}\n\t(-> incoming)[${[...n.incoming.keys()].join(`, `)}]\n\t(outgoing ->)[${[...n.outgoing.keys()].join(`,`)}]\n`);return e.join(`
865
865
  `)}findCycleSlow(){for(let[e,t]of this._nodes){let n=new Set([e]),r=this._findCycle(t,n);if(r)return r}}_findCycle(e,t){for(let[n,r]of e.outgoing){if(t.has(n))return[...t,n].join(` -> `);t.add(n);let e=this._findCycle(r,t);if(e)return e;t.delete(n)}}},eLe=!1,V3=class extends Error{constructor(e){super(`cyclic dependency between services`),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: \n${e.toString()}`}},tLe=class e{constructor(e=new yT,t=!1,n,r=eLe){this._services=e,this._strict=t,this._parent=n,this._enableTracing=r,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(fc,this),this._globalGraph=r?n?._globalGraph??new B3(e=>e):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,In(this._children),this._children.clear();for(let e of this._servicesToMaybeDispose)Fn(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw Error(`InstantiationService has been disposed`)}createChild(t,n){this._throwIfDisposed();let r=this,i=new class extends e{dispose(){r._children.delete(i),super.dispose()}}(t,this._strict,this,this._enableTracing);return this._children.add(i),n?.add(i),i}invokeFunction(e,...t){this._throwIfDisposed();let n=H3.traceInvocation(this._enableTracing,e),r=!1;try{return e({get:e=>{if(r)throw yt(`service accessor is only valid during the invocation of its target method`);let t=this._getOrCreateServiceInstance(e,n);if(!t)throw Error(`[invokeFunction] unknown service '${e}'`);return t},getIfExists:e=>{if(r)throw yt(`service accessor is only valid during the invocation of its target method`);return this._getOrCreateServiceInstance(e,n)}},...t)}finally{r=!0,n.stop()}}createInstance(e,...t){this._throwIfDisposed();let n,r;return e instanceof Nd?(n=H3.traceCreation(this._enableTracing,e.ctor),r=this._createInstance(e.ctor,e.staticArguments.concat(t),n)):(n=H3.traceCreation(this._enableTracing,e),r=this._createInstance(e,t,n)),n.stop(),r}_createInstance(e,t=[],n){let r=dc.getServiceDependencies(e).sort((e,t)=>e.index-t.index),i=[];for(let t of r){let r=this._getOrCreateServiceInstance(t.id,n);r||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`,!1),i.push(r)}let a=r.length>0?r[0].index:t.length;if(t.length!==a){console.trace(`[createInstance] First service dependency of ${e.name} at position ${a+1} conflicts with ${t.length} static arguments`);let n=a-t.length;t=n>0?t.concat(Array(n)):t.slice(0,a)}return Reflect.construct(e,t.concat(i))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof Nd)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(e,t);else throw Error(`illegalState - setting UNKNOWN service instance`)}_getServiceInstanceOrDescriptor(e){let 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));let n=this._getServiceInstanceOrDescriptor(e);return n instanceof Nd?this._safeCreateAndCacheServiceInstance(e,n,t.branch(e,!0)):(t.branch(e,!1),n)}_safeCreateAndCacheServiceInstance(e,t,n){if(this._activeInstantiations.has(e))throw Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,n)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,n){let r=new B3(e=>e.id.toString()),i=0,a=[{id:e,desc:t,_trace:n}],o=new Set;for(;a.length;){let t=a.pop();if(!o.has(String(t.id))){if(o.add(String(t.id)),r.lookupOrInsertNode(t),i++>1e3)throw new V3(r);for(let n of dc.getServiceDependencies(t.desc.ctor)){let i=this._getServiceInstanceOrDescriptor(n.id);if(i||this._throwIfStrict(`[createInstance] ${e} depends on ${n.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(t.id),String(n.id)),i instanceof Nd){let e={id:n.id,desc:i,_trace:t._trace.branch(n.id,!0)};r.insertEdge(t,e),a.push(e)}}}}for(;;){let e=r.roots();if(e.length===0){if(!r.isEmpty())throw new V3(r);break}for(let{data:t}of e){if(this._getServiceInstanceOrDescriptor(t.id)instanceof Nd){let e=this._createServiceInstanceWithOwner(t.id,t.desc.ctor,t.desc.staticArguments,t.desc.supportsDelayedInstantiation,t._trace);this._setCreatedServiceInstance(t.id,e)}r.removeNode(t)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,n=[],r,i){if(this._services.get(e)instanceof Nd)return this._createServiceInstance(e,t,n,r,i,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,n,r,i);throw Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(t,n,r=[],i,a,o){if(i){let i=new e(void 0,this._strict,this,this._enableTracing);i._globalGraphImplicitDependency=String(t);let s=new Map,c=new zee(()=>{let e=i._createInstance(n,r,a);for(let[t,n]of s){let r=e[t];if(typeof r==`function`)for(let t of n)t.disposable=r.apply(e,t.listener)}return s.clear(),o.add(e),e});return new Proxy(Object.create(null),{get(e,t){if(!c.isInitialized&&typeof t==`string`&&(t.startsWith(`onDid`)||t.startsWith(`onWill`))){let e=s.get(t);return e||(e=new Hn,s.set(t,e)),(n,r,i)=>{if(c.isInitialized)return c.value[t](n,r,i);{let t={listener:[n,r,i],disposable:void 0},a=e.push(t);return T(()=>{a(),t.disposable?.dispose()})}}}if(t in e)return e[t];let n=c.value,r=n[t];return typeof r==`function`?(r=r.bind(n),e[t]=r,r):r},set(e,t,n){return c.value[t]=n,!0},getPrototypeOf(e){return n.prototype}})}else{let e=this._createInstance(n,r,a);return o.add(e),e}}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw Error(e)}},H3=class e{static{this.all=new Set}static{this._None=new class extends e{constructor(){super(0,null)}stop(){}branch(){return this}}}static traceInvocation(t,n){return t?new e(2,n.name||Error().stack.split(`
@@ -1188,7 +1188,7 @@ ${e.value}
1188
1188
  `+` `.repeat(t)),Array(b9).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array(b9).fill(0).map((e,t)=>`\r
1189
1189
  `+` `.repeat(t)),Array(b9).fill(0).map((e,t)=>`
1190
1190
  `+` `.repeat(t)),Array(b9).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array(b9).fill(0).map((e,t)=>`\r
1191
- `+` `.repeat(t));var jKe;(function(e){e.DEFAULT={allowTrailingComma:!1}})(jKe||={});var MKe=kKe,NKe;(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(NKe||={});var PKe;(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(PKe||={});var FKe;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(FKe||={});function IKe(e){return{getInitialState:()=>new w9(null,null,!1,null),tokenize:(t,n)=>KKe(e,t,n)}}var x9=`delimiter.bracket.json`,S9=`delimiter.array.json`,LKe=`delimiter.colon.json`,RKe=`delimiter.comma.json`,zKe=`keyword.json`,BKe=`keyword.json`,VKe=`string.value.json`,HKe=`number.json`,UKe=`string.key.json`,WKe=`comment.block.json`,GKe=`comment.line.json`,C9=class e{constructor(e,t){this.parent=e,this.type=t}static pop(e){return e?e.parent:null}static push(t,n){return new e(t,n)}static equals(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;for(;e&&t;){if(e===t)return!0;if(e.type!==t.type)return!1;e=e.parent,t=t.parent}return!0}},w9=class e{constructor(e,t,n,r){this._state=e,this.scanError=t,this.lastWasColon=n,this.parents=r}clone(){return new e(this._state,this.scanError,this.lastWasColon,this.parents)}equals(t){return t===this?!0:!t||!(t instanceof e)?!1:this.scanError===t.scanError&&this.lastWasColon===t.lastWasColon&&C9.equals(this.parents,t.parents)}getStateData(){return this._state}setStateData(e){this._state=e}};function KKe(e,t,n,r=0){let i=0,a=!1;switch(n.scanError){case 2:t=`"`+t,i=1;break;case 1:t=`/*`+t,i=2;break}let o=MKe(t),s=n.lastWasColon,c=n.parents,l={tokens:[],endState:n.clone()};for(;;){let e=r+o.getPosition(),u=``,d=o.scan();if(d===17)break;if(e===r+o.getPosition())throw Error(`Scanner did not advance, next 3 characters are: `+t.substr(o.getPosition(),3));switch(a&&(e-=i),a=i>0,d){case 1:c=C9.push(c,0),u=x9,s=!1;break;case 2:c=C9.pop(c),u=x9,s=!1;break;case 3:c=C9.push(c,1),u=S9,s=!1;break;case 4:c=C9.pop(c),u=S9,s=!1;break;case 6:u=LKe,s=!0;break;case 5:u=RKe,s=!1;break;case 8:case 9:u=zKe,s=!1;break;case 7:u=BKe,s=!1;break;case 10:let e=(c?c.type:0)===1;u=s||e?VKe:UKe,s=!1;break;case 11:u=HKe,s=!1;break}switch(d){case 12:u=GKe;break;case 13:u=WKe;break}l.endState=new w9(n.getStateData(),o.getTokenError(),s,c),l.tokens.push({startIndex:e,scopes:u})}return l}var qKe=e({CompletionAdapter:()=>H7,DefinitionAdapter:()=>X7,DiagnosticsAdapter:()=>V7,DocumentColorAdapter:()=>s9,DocumentFormattingEditProvider:()=>i9,DocumentHighlightAdapter:()=>Y7,DocumentLinkAdapter:()=>r9,DocumentRangeFormattingEditProvider:()=>a9,DocumentSymbolAdapter:()=>e9,FoldingRangeAdapter:()=>c9,HoverAdapter:()=>q7,ReferenceAdapter:()=>Q7,RenameAdapter:()=>$7,SelectionRangeAdapter:()=>l9,WorkerManager:()=>g9,fromPosition:()=>U7,fromRange:()=>W7,getWorker:()=>JKe,setupMode:()=>XKe,toRange:()=>G7,toTextEdit:()=>K7}),T9;function JKe(){return new Promise((e,t)=>{if(!T9)return t(`JSON not registered!`);e(T9)})}var YKe=class extends V7{constructor(e,t,n){super(e,t,n.onDidChange),this._disposables.push(W6.onWillDisposeModel(e=>{this._resetSchema(e.uri)})),this._disposables.push(W6.onDidChangeModelLanguage(e=>{this._resetSchema(e.model.uri)}))}_resetSchema(e){this._worker().then(t=>{t.resetSchema(e.toString())})}};function XKe(e){let t=[],n=[],r=new g9(e);t.push(r),T9=(...e)=>r.getLanguageServiceWorker(...e);function i(){let{languageId:t,modeConfiguration:r}=e;D9(n),r.documentFormattingEdits&&n.push(Q.registerDocumentFormattingEditProvider(t,new i9(T9))),r.documentRangeFormattingEdits&&n.push(Q.registerDocumentRangeFormattingEditProvider(t,new a9(T9))),r.completionItems&&n.push(Q.registerCompletionItemProvider(t,new H7(T9,[` `,`:`,`"`]))),r.hovers&&n.push(Q.registerHoverProvider(t,new q7(T9))),r.documentSymbols&&n.push(Q.registerDocumentSymbolProvider(t,new e9(T9))),r.tokens&&n.push(Q.setTokensProvider(t,IKe(!0))),r.colors&&n.push(Q.registerColorProvider(t,new s9(T9))),r.foldingRanges&&n.push(Q.registerFoldingRangeProvider(t,new c9(T9))),r.diagnostics&&n.push(new YKe(t,T9,e)),r.selectionRanges&&n.push(Q.registerSelectionRangeProvider(t,new l9(T9)))}i(),t.push(Q.setLanguageConfiguration(e.languageId,ZKe));let a=e.modeConfiguration;return e.onDidChange(e=>{e.modeConfiguration!==a&&(a=e.modeConfiguration,i())}),t.push(E9(n)),E9(t)}function E9(e){return{dispose:()=>D9(e)}}function D9(e){for(;e.length;)e.pop().dispose()}var ZKe={wordPattern:/(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g,comments:{lineComment:`//`,blockComment:[`/*`,`*/`]},brackets:[[`{`,`}`],[`[`,`]`]],autoClosingPairs:[{open:`{`,close:`}`,notIn:[`string`]},{open:`[`,close:`]`,notIn:[`string`]},{open:`"`,close:`"`,notIn:[`string`]}]},O9=class{constructor(e,t){this._modeId=e,this._defaults=t,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker()),this._updateExtraLibsToken=0,this._extraLibsChangeListener=this._defaults.onDidExtraLibsChange(()=>this._updateExtraLibs())}dispose(){this._configChangeListener.dispose(),this._extraLibsChangeListener.dispose(),this._stopWorker()}_stopWorker(){this._worker&&=(this._worker.dispose(),null),this._client=null}async _updateExtraLibs(){if(!this._worker)return;let e=++this._updateExtraLibsToken,t=await this._worker.getProxy();this._updateExtraLibsToken===e&&t.updateExtraLibs(this._defaults.getExtraLibs())}_getClient(){return this._client||=(async()=>(this._worker=s7({moduleId:`vs/language/typescript/tsWorker`,createWorker:()=>new Worker(new URL(``+new URL(`ts.worker-B6r0Skfj.js`,import.meta.url).href,``+import.meta.url),{type:`module`}),label:this._modeId,keepIdleModels:!0,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs(),customWorkerPath:this._defaults.workerOptions.customWorkerPath,inlayHintsOptions:this._defaults.inlayHintsOptions}}),this._defaults.getEagerModelSync()?await this._worker.withSyncedResources(W6.getModels().filter(e=>e.getLanguageId()===this._modeId).map(e=>e.uri)):await this._worker.getProxy()))(),this._client}async getLanguageServiceWorker(...e){let t=await this._getClient();return this._worker&&await this._worker.withSyncedResources(e),t}},k9={};k9[`lib.d.ts`]=!0,k9[`lib.decorators.d.ts`]=!0,k9[`lib.decorators.legacy.d.ts`]=!0,k9[`lib.dom.asynciterable.d.ts`]=!0,k9[`lib.dom.d.ts`]=!0,k9[`lib.dom.iterable.d.ts`]=!0,k9[`lib.es2015.collection.d.ts`]=!0,k9[`lib.es2015.core.d.ts`]=!0,k9[`lib.es2015.d.ts`]=!0,k9[`lib.es2015.generator.d.ts`]=!0,k9[`lib.es2015.iterable.d.ts`]=!0,k9[`lib.es2015.promise.d.ts`]=!0,k9[`lib.es2015.proxy.d.ts`]=!0,k9[`lib.es2015.reflect.d.ts`]=!0,k9[`lib.es2015.symbol.d.ts`]=!0,k9[`lib.es2015.symbol.wellknown.d.ts`]=!0,k9[`lib.es2016.array.include.d.ts`]=!0,k9[`lib.es2016.d.ts`]=!0,k9[`lib.es2016.full.d.ts`]=!0,k9[`lib.es2016.intl.d.ts`]=!0,k9[`lib.es2017.arraybuffer.d.ts`]=!0,k9[`lib.es2017.d.ts`]=!0,k9[`lib.es2017.date.d.ts`]=!0,k9[`lib.es2017.full.d.ts`]=!0,k9[`lib.es2017.intl.d.ts`]=!0,k9[`lib.es2017.object.d.ts`]=!0,k9[`lib.es2017.sharedmemory.d.ts`]=!0,k9[`lib.es2017.string.d.ts`]=!0,k9[`lib.es2017.typedarrays.d.ts`]=!0,k9[`lib.es2018.asyncgenerator.d.ts`]=!0,k9[`lib.es2018.asynciterable.d.ts`]=!0,k9[`lib.es2018.d.ts`]=!0,k9[`lib.es2018.full.d.ts`]=!0,k9[`lib.es2018.intl.d.ts`]=!0,k9[`lib.es2018.promise.d.ts`]=!0,k9[`lib.es2018.regexp.d.ts`]=!0,k9[`lib.es2019.array.d.ts`]=!0,k9[`lib.es2019.d.ts`]=!0,k9[`lib.es2019.full.d.ts`]=!0,k9[`lib.es2019.intl.d.ts`]=!0,k9[`lib.es2019.object.d.ts`]=!0,k9[`lib.es2019.string.d.ts`]=!0,k9[`lib.es2019.symbol.d.ts`]=!0,k9[`lib.es2020.bigint.d.ts`]=!0,k9[`lib.es2020.d.ts`]=!0,k9[`lib.es2020.date.d.ts`]=!0,k9[`lib.es2020.full.d.ts`]=!0,k9[`lib.es2020.intl.d.ts`]=!0,k9[`lib.es2020.number.d.ts`]=!0,k9[`lib.es2020.promise.d.ts`]=!0,k9[`lib.es2020.sharedmemory.d.ts`]=!0,k9[`lib.es2020.string.d.ts`]=!0,k9[`lib.es2020.symbol.wellknown.d.ts`]=!0,k9[`lib.es2021.d.ts`]=!0,k9[`lib.es2021.full.d.ts`]=!0,k9[`lib.es2021.intl.d.ts`]=!0,k9[`lib.es2021.promise.d.ts`]=!0,k9[`lib.es2021.string.d.ts`]=!0,k9[`lib.es2021.weakref.d.ts`]=!0,k9[`lib.es2022.array.d.ts`]=!0,k9[`lib.es2022.d.ts`]=!0,k9[`lib.es2022.error.d.ts`]=!0,k9[`lib.es2022.full.d.ts`]=!0,k9[`lib.es2022.intl.d.ts`]=!0,k9[`lib.es2022.object.d.ts`]=!0,k9[`lib.es2022.regexp.d.ts`]=!0,k9[`lib.es2022.string.d.ts`]=!0,k9[`lib.es2023.array.d.ts`]=!0,k9[`lib.es2023.collection.d.ts`]=!0,k9[`lib.es2023.d.ts`]=!0,k9[`lib.es2023.full.d.ts`]=!0,k9[`lib.es2023.intl.d.ts`]=!0,k9[`lib.es2024.arraybuffer.d.ts`]=!0,k9[`lib.es2024.collection.d.ts`]=!0,k9[`lib.es2024.d.ts`]=!0,k9[`lib.es2024.full.d.ts`]=!0,k9[`lib.es2024.object.d.ts`]=!0,k9[`lib.es2024.promise.d.ts`]=!0,k9[`lib.es2024.regexp.d.ts`]=!0,k9[`lib.es2024.sharedmemory.d.ts`]=!0,k9[`lib.es2024.string.d.ts`]=!0,k9[`lib.es5.d.ts`]=!0,k9[`lib.es6.d.ts`]=!0,k9[`lib.esnext.array.d.ts`]=!0,k9[`lib.esnext.collection.d.ts`]=!0,k9[`lib.esnext.d.ts`]=!0,k9[`lib.esnext.decorators.d.ts`]=!0,k9[`lib.esnext.disposable.d.ts`]=!0,k9[`lib.esnext.error.d.ts`]=!0,k9[`lib.esnext.float16.d.ts`]=!0,k9[`lib.esnext.full.d.ts`]=!0,k9[`lib.esnext.intl.d.ts`]=!0,k9[`lib.esnext.iterator.d.ts`]=!0,k9[`lib.esnext.promise.d.ts`]=!0,k9[`lib.esnext.sharedmemory.d.ts`]=!0,k9[`lib.scripthost.d.ts`]=!0,k9[`lib.webworker.asynciterable.d.ts`]=!0,k9[`lib.webworker.d.ts`]=!0,k9[`lib.webworker.importscripts.d.ts`]=!0,k9[`lib.webworker.iterable.d.ts`]=!0;function A9(e,t,n=0){if(typeof e==`string`)return e;if(e===void 0)return``;let r=``;if(n){r+=t;for(let e=0;e<n;e++)r+=` `}if(r+=e.messageText,n++,e.next)for(let i of e.next)r+=A9(i,t,n);return r}function j9(e){return e?e.map(e=>e.text).join(``):``}var M9=class{constructor(e){this._worker=e}_textSpanToRange(e,t){let n=e.getPositionAt(t.start),r=e.getPositionAt(t.start+t.length),{lineNumber:i,column:a}=n,{lineNumber:o,column:s}=r;return{startLineNumber:i,startColumn:a,endLineNumber:o,endColumn:s}}},N9=class{constructor(e){this._worker=e,this._libFiles={},this._hasFetchedLibFiles=!1,this._fetchLibFilesPromise=null}isLibFile(e){return e&&e.path.indexOf(`/lib.`)===0?!!k9[e.path.slice(1)]:!1}getOrCreateModel(e){let t=H6.parse(e),n=W6.getModel(t);if(n)return n;if(this.isLibFile(t)&&this._hasFetchedLibFiles)return W6.createModel(this._libFiles[t.path.slice(1)],`typescript`,t);let r=G8.getExtraLibs()[e];return r?W6.createModel(r.content,`typescript`,t):null}_containsLibFile(e){for(let t of e)if(this.isLibFile(t))return!0;return!1}async fetchLibFilesIfNecessary(e){this._containsLibFile(e)&&await this._fetchLibFiles()}_fetchLibFiles(){return this._fetchLibFilesPromise||=this._worker().then(e=>e.getLibFiles()).then(e=>{this._hasFetchedLibFiles=!0,this._libFiles=e}),this._fetchLibFilesPromise}},P9=class extends M9{constructor(e,t,n,r){super(r),this._libFiles=e,this._defaults=t,this._selector=n,this._disposables=[],this._listener=Object.create(null);let i=e=>{if(e.getLanguageId()!==n)return;let t=()=>{let{onlyVisible:t}=this._defaults.getDiagnosticsOptions();t?e.isAttachedToEditor()&&this._doValidate(e):this._doValidate(e)},r,i=e.onDidChangeContent(()=>{clearTimeout(r),r=window.setTimeout(t,500)}),a=e.onDidChangeAttached(()=>{let{onlyVisible:n}=this._defaults.getDiagnosticsOptions();n&&(e.isAttachedToEditor()?t():W6.setModelMarkers(e,this._selector,[]))});this._listener[e.uri.toString()]={dispose(){i.dispose(),a.dispose(),clearTimeout(r)}},t()},a=e=>{W6.setModelMarkers(e,this._selector,[]);let t=e.uri.toString();this._listener[t]&&(this._listener[t].dispose(),delete this._listener[t])};this._disposables.push(W6.onDidCreateModel(e=>i(e))),this._disposables.push(W6.onWillDisposeModel(a)),this._disposables.push(W6.onDidChangeModelLanguage(e=>{a(e.model),i(e.model)})),this._disposables.push({dispose(){for(let e of W6.getModels())a(e)}});let o=()=>{for(let e of W6.getModels())a(e),i(e)};this._disposables.push(this._defaults.onDidChange(o)),this._disposables.push(this._defaults.onDidExtraLibsChange(o)),W6.getModels().forEach(e=>i(e))}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables=[]}async _doValidate(e){let t=await this._worker(e.uri);if(e.isDisposed())return;let n=[],{noSyntaxValidation:r,noSemanticValidation:i,noSuggestionDiagnostics:a}=this._defaults.getDiagnosticsOptions();r||n.push(t.getSyntacticDiagnostics(e.uri.toString())),i||n.push(t.getSemanticDiagnostics(e.uri.toString())),a||n.push(t.getSuggestionDiagnostics(e.uri.toString()));let o=await Promise.all(n);if(!o||e.isDisposed())return;let s=o.reduce((e,t)=>t.concat(e),[]).filter(e=>(this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore||[]).indexOf(e.code)===-1),c=s.map(e=>e.relatedInformation||[]).reduce((e,t)=>t.concat(e),[]).map(e=>e.file?H6.parse(e.file.fileName):null);await this._libFiles.fetchLibFilesIfNecessary(c),!e.isDisposed()&&W6.setModelMarkers(e,this._selector,s.map(t=>this._convertDiagnostics(e,t)))}_convertDiagnostics(e,t){let n=t.start||0,r=t.length||1,{lineNumber:i,column:a}=e.getPositionAt(n),{lineNumber:o,column:s}=e.getPositionAt(n+r),c=[];return t.reportsUnnecessary&&c.push(V6.Unnecessary),t.reportsDeprecated&&c.push(V6.Deprecated),{severity:this._tsDiagnosticCategoryToMarkerSeverity(t.category),startLineNumber:i,startColumn:a,endLineNumber:o,endColumn:s,message:A9(t.messageText,`
1191
+ `+` `.repeat(t));var jKe;(function(e){e.DEFAULT={allowTrailingComma:!1}})(jKe||={});var MKe=kKe,NKe;(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(NKe||={});var PKe;(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(PKe||={});var FKe;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(FKe||={});function IKe(e){return{getInitialState:()=>new w9(null,null,!1,null),tokenize:(t,n)=>KKe(e,t,n)}}var x9=`delimiter.bracket.json`,S9=`delimiter.array.json`,LKe=`delimiter.colon.json`,RKe=`delimiter.comma.json`,zKe=`keyword.json`,BKe=`keyword.json`,VKe=`string.value.json`,HKe=`number.json`,UKe=`string.key.json`,WKe=`comment.block.json`,GKe=`comment.line.json`,C9=class e{constructor(e,t){this.parent=e,this.type=t}static pop(e){return e?e.parent:null}static push(t,n){return new e(t,n)}static equals(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;for(;e&&t;){if(e===t)return!0;if(e.type!==t.type)return!1;e=e.parent,t=t.parent}return!0}},w9=class e{constructor(e,t,n,r){this._state=e,this.scanError=t,this.lastWasColon=n,this.parents=r}clone(){return new e(this._state,this.scanError,this.lastWasColon,this.parents)}equals(t){return t===this?!0:!t||!(t instanceof e)?!1:this.scanError===t.scanError&&this.lastWasColon===t.lastWasColon&&C9.equals(this.parents,t.parents)}getStateData(){return this._state}setStateData(e){this._state=e}};function KKe(e,t,n,r=0){let i=0,a=!1;switch(n.scanError){case 2:t=`"`+t,i=1;break;case 1:t=`/*`+t,i=2;break}let o=MKe(t),s=n.lastWasColon,c=n.parents,l={tokens:[],endState:n.clone()};for(;;){let e=r+o.getPosition(),u=``,d=o.scan();if(d===17)break;if(e===r+o.getPosition())throw Error(`Scanner did not advance, next 3 characters are: `+t.substr(o.getPosition(),3));switch(a&&(e-=i),a=i>0,d){case 1:c=C9.push(c,0),u=x9,s=!1;break;case 2:c=C9.pop(c),u=x9,s=!1;break;case 3:c=C9.push(c,1),u=S9,s=!1;break;case 4:c=C9.pop(c),u=S9,s=!1;break;case 6:u=LKe,s=!0;break;case 5:u=RKe,s=!1;break;case 8:case 9:u=zKe,s=!1;break;case 7:u=BKe,s=!1;break;case 10:let e=(c?c.type:0)===1;u=s||e?VKe:UKe,s=!1;break;case 11:u=HKe,s=!1;break}switch(d){case 12:u=GKe;break;case 13:u=WKe;break}l.endState=new w9(n.getStateData(),o.getTokenError(),s,c),l.tokens.push({startIndex:e,scopes:u})}return l}var qKe=e({CompletionAdapter:()=>H7,DefinitionAdapter:()=>X7,DiagnosticsAdapter:()=>V7,DocumentColorAdapter:()=>s9,DocumentFormattingEditProvider:()=>i9,DocumentHighlightAdapter:()=>Y7,DocumentLinkAdapter:()=>r9,DocumentRangeFormattingEditProvider:()=>a9,DocumentSymbolAdapter:()=>e9,FoldingRangeAdapter:()=>c9,HoverAdapter:()=>q7,ReferenceAdapter:()=>Q7,RenameAdapter:()=>$7,SelectionRangeAdapter:()=>l9,WorkerManager:()=>g9,fromPosition:()=>U7,fromRange:()=>W7,getWorker:()=>JKe,setupMode:()=>XKe,toRange:()=>G7,toTextEdit:()=>K7}),T9;function JKe(){return new Promise((e,t)=>{if(!T9)return t(`JSON not registered!`);e(T9)})}var YKe=class extends V7{constructor(e,t,n){super(e,t,n.onDidChange),this._disposables.push(W6.onWillDisposeModel(e=>{this._resetSchema(e.uri)})),this._disposables.push(W6.onDidChangeModelLanguage(e=>{this._resetSchema(e.model.uri)}))}_resetSchema(e){this._worker().then(t=>{t.resetSchema(e.toString())})}};function XKe(e){let t=[],n=[],r=new g9(e);t.push(r),T9=(...e)=>r.getLanguageServiceWorker(...e);function i(){let{languageId:t,modeConfiguration:r}=e;D9(n),r.documentFormattingEdits&&n.push(Q.registerDocumentFormattingEditProvider(t,new i9(T9))),r.documentRangeFormattingEdits&&n.push(Q.registerDocumentRangeFormattingEditProvider(t,new a9(T9))),r.completionItems&&n.push(Q.registerCompletionItemProvider(t,new H7(T9,[` `,`:`,`"`]))),r.hovers&&n.push(Q.registerHoverProvider(t,new q7(T9))),r.documentSymbols&&n.push(Q.registerDocumentSymbolProvider(t,new e9(T9))),r.tokens&&n.push(Q.setTokensProvider(t,IKe(!0))),r.colors&&n.push(Q.registerColorProvider(t,new s9(T9))),r.foldingRanges&&n.push(Q.registerFoldingRangeProvider(t,new c9(T9))),r.diagnostics&&n.push(new YKe(t,T9,e)),r.selectionRanges&&n.push(Q.registerSelectionRangeProvider(t,new l9(T9)))}i(),t.push(Q.setLanguageConfiguration(e.languageId,ZKe));let a=e.modeConfiguration;return e.onDidChange(e=>{e.modeConfiguration!==a&&(a=e.modeConfiguration,i())}),t.push(E9(n)),E9(t)}function E9(e){return{dispose:()=>D9(e)}}function D9(e){for(;e.length;)e.pop().dispose()}var ZKe={wordPattern:/(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g,comments:{lineComment:`//`,blockComment:[`/*`,`*/`]},brackets:[[`{`,`}`],[`[`,`]`]],autoClosingPairs:[{open:`{`,close:`}`,notIn:[`string`]},{open:`[`,close:`]`,notIn:[`string`]},{open:`"`,close:`"`,notIn:[`string`]}]},O9=class{constructor(e,t){this._modeId=e,this._defaults=t,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker()),this._updateExtraLibsToken=0,this._extraLibsChangeListener=this._defaults.onDidExtraLibsChange(()=>this._updateExtraLibs())}dispose(){this._configChangeListener.dispose(),this._extraLibsChangeListener.dispose(),this._stopWorker()}_stopWorker(){this._worker&&=(this._worker.dispose(),null),this._client=null}async _updateExtraLibs(){if(!this._worker)return;let e=++this._updateExtraLibsToken,t=await this._worker.getProxy();this._updateExtraLibsToken===e&&t.updateExtraLibs(this._defaults.getExtraLibs())}_getClient(){return this._client||=(async()=>(this._worker=s7({moduleId:`vs/language/typescript/tsWorker`,createWorker:()=>new Worker(new URL(``+new URL(`ts.worker-B0J26iPs.js`,import.meta.url).href,``+import.meta.url),{type:`module`}),label:this._modeId,keepIdleModels:!0,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs(),customWorkerPath:this._defaults.workerOptions.customWorkerPath,inlayHintsOptions:this._defaults.inlayHintsOptions}}),this._defaults.getEagerModelSync()?await this._worker.withSyncedResources(W6.getModels().filter(e=>e.getLanguageId()===this._modeId).map(e=>e.uri)):await this._worker.getProxy()))(),this._client}async getLanguageServiceWorker(...e){let t=await this._getClient();return this._worker&&await this._worker.withSyncedResources(e),t}},k9={};k9[`lib.d.ts`]=!0,k9[`lib.decorators.d.ts`]=!0,k9[`lib.decorators.legacy.d.ts`]=!0,k9[`lib.dom.asynciterable.d.ts`]=!0,k9[`lib.dom.d.ts`]=!0,k9[`lib.dom.iterable.d.ts`]=!0,k9[`lib.es2015.collection.d.ts`]=!0,k9[`lib.es2015.core.d.ts`]=!0,k9[`lib.es2015.d.ts`]=!0,k9[`lib.es2015.generator.d.ts`]=!0,k9[`lib.es2015.iterable.d.ts`]=!0,k9[`lib.es2015.promise.d.ts`]=!0,k9[`lib.es2015.proxy.d.ts`]=!0,k9[`lib.es2015.reflect.d.ts`]=!0,k9[`lib.es2015.symbol.d.ts`]=!0,k9[`lib.es2015.symbol.wellknown.d.ts`]=!0,k9[`lib.es2016.array.include.d.ts`]=!0,k9[`lib.es2016.d.ts`]=!0,k9[`lib.es2016.full.d.ts`]=!0,k9[`lib.es2016.intl.d.ts`]=!0,k9[`lib.es2017.arraybuffer.d.ts`]=!0,k9[`lib.es2017.d.ts`]=!0,k9[`lib.es2017.date.d.ts`]=!0,k9[`lib.es2017.full.d.ts`]=!0,k9[`lib.es2017.intl.d.ts`]=!0,k9[`lib.es2017.object.d.ts`]=!0,k9[`lib.es2017.sharedmemory.d.ts`]=!0,k9[`lib.es2017.string.d.ts`]=!0,k9[`lib.es2017.typedarrays.d.ts`]=!0,k9[`lib.es2018.asyncgenerator.d.ts`]=!0,k9[`lib.es2018.asynciterable.d.ts`]=!0,k9[`lib.es2018.d.ts`]=!0,k9[`lib.es2018.full.d.ts`]=!0,k9[`lib.es2018.intl.d.ts`]=!0,k9[`lib.es2018.promise.d.ts`]=!0,k9[`lib.es2018.regexp.d.ts`]=!0,k9[`lib.es2019.array.d.ts`]=!0,k9[`lib.es2019.d.ts`]=!0,k9[`lib.es2019.full.d.ts`]=!0,k9[`lib.es2019.intl.d.ts`]=!0,k9[`lib.es2019.object.d.ts`]=!0,k9[`lib.es2019.string.d.ts`]=!0,k9[`lib.es2019.symbol.d.ts`]=!0,k9[`lib.es2020.bigint.d.ts`]=!0,k9[`lib.es2020.d.ts`]=!0,k9[`lib.es2020.date.d.ts`]=!0,k9[`lib.es2020.full.d.ts`]=!0,k9[`lib.es2020.intl.d.ts`]=!0,k9[`lib.es2020.number.d.ts`]=!0,k9[`lib.es2020.promise.d.ts`]=!0,k9[`lib.es2020.sharedmemory.d.ts`]=!0,k9[`lib.es2020.string.d.ts`]=!0,k9[`lib.es2020.symbol.wellknown.d.ts`]=!0,k9[`lib.es2021.d.ts`]=!0,k9[`lib.es2021.full.d.ts`]=!0,k9[`lib.es2021.intl.d.ts`]=!0,k9[`lib.es2021.promise.d.ts`]=!0,k9[`lib.es2021.string.d.ts`]=!0,k9[`lib.es2021.weakref.d.ts`]=!0,k9[`lib.es2022.array.d.ts`]=!0,k9[`lib.es2022.d.ts`]=!0,k9[`lib.es2022.error.d.ts`]=!0,k9[`lib.es2022.full.d.ts`]=!0,k9[`lib.es2022.intl.d.ts`]=!0,k9[`lib.es2022.object.d.ts`]=!0,k9[`lib.es2022.regexp.d.ts`]=!0,k9[`lib.es2022.string.d.ts`]=!0,k9[`lib.es2023.array.d.ts`]=!0,k9[`lib.es2023.collection.d.ts`]=!0,k9[`lib.es2023.d.ts`]=!0,k9[`lib.es2023.full.d.ts`]=!0,k9[`lib.es2023.intl.d.ts`]=!0,k9[`lib.es2024.arraybuffer.d.ts`]=!0,k9[`lib.es2024.collection.d.ts`]=!0,k9[`lib.es2024.d.ts`]=!0,k9[`lib.es2024.full.d.ts`]=!0,k9[`lib.es2024.object.d.ts`]=!0,k9[`lib.es2024.promise.d.ts`]=!0,k9[`lib.es2024.regexp.d.ts`]=!0,k9[`lib.es2024.sharedmemory.d.ts`]=!0,k9[`lib.es2024.string.d.ts`]=!0,k9[`lib.es5.d.ts`]=!0,k9[`lib.es6.d.ts`]=!0,k9[`lib.esnext.array.d.ts`]=!0,k9[`lib.esnext.collection.d.ts`]=!0,k9[`lib.esnext.d.ts`]=!0,k9[`lib.esnext.decorators.d.ts`]=!0,k9[`lib.esnext.disposable.d.ts`]=!0,k9[`lib.esnext.error.d.ts`]=!0,k9[`lib.esnext.float16.d.ts`]=!0,k9[`lib.esnext.full.d.ts`]=!0,k9[`lib.esnext.intl.d.ts`]=!0,k9[`lib.esnext.iterator.d.ts`]=!0,k9[`lib.esnext.promise.d.ts`]=!0,k9[`lib.esnext.sharedmemory.d.ts`]=!0,k9[`lib.scripthost.d.ts`]=!0,k9[`lib.webworker.asynciterable.d.ts`]=!0,k9[`lib.webworker.d.ts`]=!0,k9[`lib.webworker.importscripts.d.ts`]=!0,k9[`lib.webworker.iterable.d.ts`]=!0;function A9(e,t,n=0){if(typeof e==`string`)return e;if(e===void 0)return``;let r=``;if(n){r+=t;for(let e=0;e<n;e++)r+=` `}if(r+=e.messageText,n++,e.next)for(let i of e.next)r+=A9(i,t,n);return r}function j9(e){return e?e.map(e=>e.text).join(``):``}var M9=class{constructor(e){this._worker=e}_textSpanToRange(e,t){let n=e.getPositionAt(t.start),r=e.getPositionAt(t.start+t.length),{lineNumber:i,column:a}=n,{lineNumber:o,column:s}=r;return{startLineNumber:i,startColumn:a,endLineNumber:o,endColumn:s}}},N9=class{constructor(e){this._worker=e,this._libFiles={},this._hasFetchedLibFiles=!1,this._fetchLibFilesPromise=null}isLibFile(e){return e&&e.path.indexOf(`/lib.`)===0?!!k9[e.path.slice(1)]:!1}getOrCreateModel(e){let t=H6.parse(e),n=W6.getModel(t);if(n)return n;if(this.isLibFile(t)&&this._hasFetchedLibFiles)return W6.createModel(this._libFiles[t.path.slice(1)],`typescript`,t);let r=G8.getExtraLibs()[e];return r?W6.createModel(r.content,`typescript`,t):null}_containsLibFile(e){for(let t of e)if(this.isLibFile(t))return!0;return!1}async fetchLibFilesIfNecessary(e){this._containsLibFile(e)&&await this._fetchLibFiles()}_fetchLibFiles(){return this._fetchLibFilesPromise||=this._worker().then(e=>e.getLibFiles()).then(e=>{this._hasFetchedLibFiles=!0,this._libFiles=e}),this._fetchLibFilesPromise}},P9=class extends M9{constructor(e,t,n,r){super(r),this._libFiles=e,this._defaults=t,this._selector=n,this._disposables=[],this._listener=Object.create(null);let i=e=>{if(e.getLanguageId()!==n)return;let t=()=>{let{onlyVisible:t}=this._defaults.getDiagnosticsOptions();t?e.isAttachedToEditor()&&this._doValidate(e):this._doValidate(e)},r,i=e.onDidChangeContent(()=>{clearTimeout(r),r=window.setTimeout(t,500)}),a=e.onDidChangeAttached(()=>{let{onlyVisible:n}=this._defaults.getDiagnosticsOptions();n&&(e.isAttachedToEditor()?t():W6.setModelMarkers(e,this._selector,[]))});this._listener[e.uri.toString()]={dispose(){i.dispose(),a.dispose(),clearTimeout(r)}},t()},a=e=>{W6.setModelMarkers(e,this._selector,[]);let t=e.uri.toString();this._listener[t]&&(this._listener[t].dispose(),delete this._listener[t])};this._disposables.push(W6.onDidCreateModel(e=>i(e))),this._disposables.push(W6.onWillDisposeModel(a)),this._disposables.push(W6.onDidChangeModelLanguage(e=>{a(e.model),i(e.model)})),this._disposables.push({dispose(){for(let e of W6.getModels())a(e)}});let o=()=>{for(let e of W6.getModels())a(e),i(e)};this._disposables.push(this._defaults.onDidChange(o)),this._disposables.push(this._defaults.onDidExtraLibsChange(o)),W6.getModels().forEach(e=>i(e))}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables=[]}async _doValidate(e){let t=await this._worker(e.uri);if(e.isDisposed())return;let n=[],{noSyntaxValidation:r,noSemanticValidation:i,noSuggestionDiagnostics:a}=this._defaults.getDiagnosticsOptions();r||n.push(t.getSyntacticDiagnostics(e.uri.toString())),i||n.push(t.getSemanticDiagnostics(e.uri.toString())),a||n.push(t.getSuggestionDiagnostics(e.uri.toString()));let o=await Promise.all(n);if(!o||e.isDisposed())return;let s=o.reduce((e,t)=>t.concat(e),[]).filter(e=>(this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore||[]).indexOf(e.code)===-1),c=s.map(e=>e.relatedInformation||[]).reduce((e,t)=>t.concat(e),[]).map(e=>e.file?H6.parse(e.file.fileName):null);await this._libFiles.fetchLibFilesIfNecessary(c),!e.isDisposed()&&W6.setModelMarkers(e,this._selector,s.map(t=>this._convertDiagnostics(e,t)))}_convertDiagnostics(e,t){let n=t.start||0,r=t.length||1,{lineNumber:i,column:a}=e.getPositionAt(n),{lineNumber:o,column:s}=e.getPositionAt(n+r),c=[];return t.reportsUnnecessary&&c.push(V6.Unnecessary),t.reportsDeprecated&&c.push(V6.Deprecated),{severity:this._tsDiagnosticCategoryToMarkerSeverity(t.category),startLineNumber:i,startColumn:a,endLineNumber:o,endColumn:s,message:A9(t.messageText,`
1192
1192
  `),code:t.code.toString(),tags:c,relatedInformation:this._convertRelatedInformation(e,t.relatedInformation)}}_convertRelatedInformation(e,t){if(!t)return[];let n=[];return t.forEach(t=>{let r=e;if(t.file&&(r=this._libFiles.getOrCreateModel(t.file.fileName)),!r)return;let i=t.start||0,a=t.length||1,{lineNumber:o,column:s}=r.getPositionAt(i),{lineNumber:c,column:l}=r.getPositionAt(i+a);n.push({resource:r.uri,startLineNumber:o,startColumn:s,endLineNumber:c,endColumn:l,message:A9(t.messageText,`
1193
1193
  `)})}),n}_tsDiagnosticCategoryToMarkerSeverity(e){switch(e){case 1:return B6.Error;case 3:return B6.Info;case 0:return B6.Warning;case 2:return B6.Hint}return B6.Info}},F9=class e extends M9{get triggerCharacters(){return[`.`]}async provideCompletionItems(t,n,r,i){let a=t.getWordUntilPosition(n),o=new L6(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn),s=t.uri,c=t.getOffsetAt(n),l=await this._worker(s);if(t.isDisposed())return;let u=await l.getCompletionsAtPosition(s.toString(),c);if(!(!u||t.isDisposed()))return{suggestions:u.entries.map(r=>{let i=o;if(r.replacementSpan){let e=t.getPositionAt(r.replacementSpan.start),n=t.getPositionAt(r.replacementSpan.start+r.replacementSpan.length);i=new L6(e.lineNumber,e.column,n.lineNumber,n.column)}let a=[];return r.kindModifiers!==void 0&&r.kindModifiers.indexOf(`deprecated`)!==-1&&a.push(Q.CompletionItemTag.Deprecated),{uri:s,position:n,offset:c,range:i,label:r.name,insertText:r.name,sortText:r.sortText,kind:e.convertKind(r.kind),tags:a}})}}async resolveCompletionItem(t,n){let r=t,i=r.uri,a=r.position,o=r.offset,s=await(await this._worker(i)).getCompletionEntryDetails(i.toString(),o,r.label);return s?{uri:i,position:a,label:s.name,kind:e.convertKind(s.kind),detail:j9(s.displayParts),documentation:{value:e.createDocumentationString(s)}}:r}static convertKind(e){switch(e){case U9.primitiveType:case U9.keyword:return Q.CompletionItemKind.Keyword;case U9.variable:case U9.localVariable:return Q.CompletionItemKind.Variable;case U9.memberVariable:case U9.memberGetAccessor:case U9.memberSetAccessor:return Q.CompletionItemKind.Field;case U9.function:case U9.memberFunction:case U9.constructSignature:case U9.callSignature:case U9.indexSignature:return Q.CompletionItemKind.Function;case U9.enum:return Q.CompletionItemKind.Enum;case U9.module:return Q.CompletionItemKind.Module;case U9.class:return Q.CompletionItemKind.Class;case U9.interface:return Q.CompletionItemKind.Interface;case U9.warning:return Q.CompletionItemKind.File}return Q.CompletionItemKind.Property}static createDocumentationString(e){let t=j9(e.documentation);if(e.tags)for(let n of e.tags)t+=`
1194
1194
 
@@ -1198,4 +1198,4 @@ ${I9(n)}`;return t}};function I9(e){let t=`*@${e.name}*`;if(e.name===`param`&&e.
1198
1198
 
1199
1199
  `+c:``)}]}}},z9=class extends M9{async provideDocumentHighlights(e,t,n){let r=e.uri,i=e.getOffsetAt(t),a=await this._worker(r);if(e.isDisposed())return;let o=await a.getDocumentHighlights(r.toString(),i,[r.toString()]);if(!(!o||e.isDisposed()))return o.flatMap(t=>t.highlightSpans.map(t=>({range:this._textSpanToRange(e,t.textSpan),kind:t.kind===`writtenReference`?Q.DocumentHighlightKind.Write:Q.DocumentHighlightKind.Text})))}},B9=class extends M9{constructor(e,t){super(t),this._libFiles=e}async provideDefinition(e,t,n){let r=e.uri,i=e.getOffsetAt(t),a=await this._worker(r);if(e.isDisposed())return;let o=await a.getDefinitionAtPosition(r.toString(),i);if(!o||e.isDisposed()||(await this._libFiles.fetchLibFilesIfNecessary(o.map(e=>H6.parse(e.fileName))),e.isDisposed()))return;let s=[];for(let e of o){let t=this._libFiles.getOrCreateModel(e.fileName);t&&s.push({uri:t.uri,range:this._textSpanToRange(t,e.textSpan)})}return s}},V9=class extends M9{constructor(e,t){super(t),this._libFiles=e}async provideReferences(e,t,n,r){let i=e.uri,a=e.getOffsetAt(t),o=await this._worker(i);if(e.isDisposed())return;let s=await o.getReferencesAtPosition(i.toString(),a);if(!s||e.isDisposed()||(await this._libFiles.fetchLibFilesIfNecessary(s.map(e=>H6.parse(e.fileName))),e.isDisposed()))return;let c=[];for(let e of s){let t=this._libFiles.getOrCreateModel(e.fileName);t&&c.push({uri:t.uri,range:this._textSpanToRange(t,e.textSpan)})}return c}},H9=class extends M9{async provideDocumentSymbols(e,t){let n=e.uri,r=await this._worker(n);if(e.isDisposed())return;let i=await r.getNavigationTree(n.toString());if(!i||e.isDisposed())return;let a=(t,n)=>({name:t.text,detail:``,kind:W9[t.kind]||Q.SymbolKind.Variable,range:this._textSpanToRange(e,t.spans[0]),selectionRange:this._textSpanToRange(e,t.spans[0]),tags:[],children:t.childItems?.map(e=>a(e,t.text)),containerName:n});return i.childItems?i.childItems.map(e=>a(e)):[]}},U9=class{};U9.unknown=``,U9.keyword=`keyword`,U9.script=`script`,U9.module=`module`,U9.class=`class`,U9.interface=`interface`,U9.type=`type`,U9.enum=`enum`,U9.variable=`var`,U9.localVariable=`local var`,U9.function=`function`,U9.localFunction=`local function`,U9.memberFunction=`method`,U9.memberGetAccessor=`getter`,U9.memberSetAccessor=`setter`,U9.memberVariable=`property`,U9.constructorImplementation=`constructor`,U9.callSignature=`call`,U9.indexSignature=`index`,U9.constructSignature=`construct`,U9.parameter=`parameter`,U9.typeParameter=`type parameter`,U9.primitiveType=`primitive type`,U9.label=`label`,U9.alias=`alias`,U9.const=`const`,U9.let=`let`,U9.warning=`warning`;var W9=Object.create(null);W9[U9.module]=Q.SymbolKind.Module,W9[U9.class]=Q.SymbolKind.Class,W9[U9.enum]=Q.SymbolKind.Enum,W9[U9.interface]=Q.SymbolKind.Interface,W9[U9.memberFunction]=Q.SymbolKind.Method,W9[U9.memberVariable]=Q.SymbolKind.Property,W9[U9.memberGetAccessor]=Q.SymbolKind.Property,W9[U9.memberSetAccessor]=Q.SymbolKind.Property,W9[U9.variable]=Q.SymbolKind.Variable,W9[U9.const]=Q.SymbolKind.Variable,W9[U9.localVariable]=Q.SymbolKind.Variable,W9[U9.variable]=Q.SymbolKind.Variable,W9[U9.function]=Q.SymbolKind.Function,W9[U9.localFunction]=Q.SymbolKind.Function;var G9=class extends M9{static _convertOptions(e){return{ConvertTabsToSpaces:e.insertSpaces,TabSize:e.tabSize,IndentSize:e.tabSize,IndentStyle:2,NewLineCharacter:`
1200
1200
  `,InsertSpaceAfterCommaDelimiter:!0,InsertSpaceAfterSemicolonInForStatements:!0,InsertSpaceBeforeAndAfterBinaryOperators:!0,InsertSpaceAfterKeywordsInControlFlowStatements:!0,InsertSpaceAfterFunctionKeywordForAnonymousFunctions:!0,InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis:!1,InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets:!1,InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces:!1,PlaceOpenBraceOnNewLineForControlBlocks:!1,PlaceOpenBraceOnNewLineForFunctions:!1}}_convertTextChanges(e,t){return{text:t.newText,range:this._textSpanToRange(e,t.span)}}},K9=class extends G9{constructor(){super(...arguments),this.canFormatMultipleRanges=!1}async provideDocumentRangeFormattingEdits(e,t,n,r){let i=e.uri,a=e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn}),o=e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn}),s=await this._worker(i);if(e.isDisposed())return;let c=await s.getFormattingEditsForRange(i.toString(),a,o,G9._convertOptions(n));if(!(!c||e.isDisposed()))return c.map(t=>this._convertTextChanges(e,t))}},q9=class extends G9{get autoFormatTriggerCharacters(){return[`;`,`}`,`
1201
- `]}async provideOnTypeFormattingEdits(e,t,n,r,i){let a=e.uri,o=e.getOffsetAt(t),s=await this._worker(a);if(e.isDisposed())return;let c=await s.getFormattingEditsAfterKeystroke(a.toString(),o,n,G9._convertOptions(r));if(!(!c||e.isDisposed()))return c.map(t=>this._convertTextChanges(e,t))}},J9=class extends G9{async provideCodeActions(e,t,n,r){let i=e.uri,a=e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn}),o=e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn}),s=G9._convertOptions(e.getOptions()),c=n.markers.filter(e=>e.code).map(e=>e.code).map(Number),l=await this._worker(i);if(e.isDisposed())return;let u=await l.getCodeFixesAtPosition(i.toString(),a,o,c,s);return!u||e.isDisposed()?{actions:[],dispose:()=>{}}:{actions:u.filter(e=>e.changes.filter(e=>e.isNewFile).length===0).map(t=>this._tsCodeFixActionToMonacoCodeAction(e,n,t)),dispose:()=>{}}}_tsCodeFixActionToMonacoCodeAction(e,t,n){let r=[];for(let t of n.changes)for(let n of t.textChanges)r.push({resource:e.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(e,n.span),text:n.newText}});return{title:n.description,edit:{edits:r},diagnostics:t.markers,kind:`quickfix`}}},Y9=class extends M9{constructor(e,t){super(t),this._libFiles=e}async provideRenameEdits(e,t,n,r){let i=e.uri,a=i.toString(),o=e.getOffsetAt(t),s=await this._worker(i);if(e.isDisposed())return;let c=await s.getRenameInfo(a,o,{allowRenameOfImportPath:!1});if(c.canRename===!1)return{edits:[],rejectReason:c.localizedErrorMessage};if(c.fileToRename!==void 0)throw Error(`Renaming files is not supported.`);let l=await s.findRenameLocations(a,o,!1,!1,!1);if(!l||e.isDisposed())return;let u=[];for(let e of l){let t=this._libFiles.getOrCreateModel(e.fileName);if(t)u.push({resource:t.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(t,e.textSpan),text:n}});else throw Error(`Unknown file ${e.fileName}.`)}return{edits:u}}},X9=class extends M9{async provideInlayHints(e,t,n){let r=e.uri,i=r.toString(),a=e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn}),o=e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn}),s=await this._worker(r);return e.isDisposed()?null:{hints:(await s.provideInlayHints(i,a,o)).map(t=>({...t,label:t.text,position:e.getPositionAt(t.position),kind:this._convertHintKind(t.kind)})),dispose:()=>{}}}_convertHintKind(e){switch(e){case`Parameter`:return Q.InlayHintKind.Parameter;case`Type`:return Q.InlayHintKind.Type;default:return Q.InlayHintKind.Type}}},QKe=e({Adapter:()=>M9,CodeActionAdaptor:()=>J9,DefinitionAdapter:()=>B9,DiagnosticsAdapter:()=>P9,DocumentHighlightAdapter:()=>z9,FormatAdapter:()=>K9,FormatHelper:()=>G9,FormatOnTypeAdapter:()=>q9,InlayHintsAdapter:()=>X9,Kind:()=>U9,LibFiles:()=>N9,OutlineAdapter:()=>H9,QuickInfoAdapter:()=>R9,ReferenceAdapter:()=>V9,RenameAdapter:()=>Y9,SignatureHelpAdapter:()=>L9,SuggestAdapter:()=>F9,WorkerManager:()=>O9,flattenDiagnosticMessageText:()=>A9,getJavaScriptWorker:()=>tqe,getTypeScriptWorker:()=>nqe,setupJavaScript:()=>eqe,setupTypeScript:()=>$Ke}),Z9,Q9;function $Ke(e){Q9=$9(e,`typescript`)}function eqe(e){Z9=$9(e,`javascript`)}function tqe(){return new Promise((e,t)=>{if(!Z9)return t(`JavaScript not registered!`);e(Z9)})}function nqe(){return new Promise((e,t)=>{if(!Q9)return t(`TypeScript not registered!`);e(Q9)})}function $9(e,t){let n=[],r=new O9(t,e),i=(...e)=>r.getLanguageServiceWorker(...e),a=new N9(i);function o(){let{modeConfiguration:r}=e;rqe(n),r.completionItems&&n.push(Q.registerCompletionItemProvider(t,new F9(i))),r.signatureHelp&&n.push(Q.registerSignatureHelpProvider(t,new L9(i))),r.hovers&&n.push(Q.registerHoverProvider(t,new R9(i))),r.documentHighlights&&n.push(Q.registerDocumentHighlightProvider(t,new z9(i))),r.definitions&&n.push(Q.registerDefinitionProvider(t,new B9(a,i))),r.references&&n.push(Q.registerReferenceProvider(t,new V9(a,i))),r.documentSymbols&&n.push(Q.registerDocumentSymbolProvider(t,new H9(i))),r.rename&&n.push(Q.registerRenameProvider(t,new Y9(a,i))),r.documentRangeFormattingEdits&&n.push(Q.registerDocumentRangeFormattingEditProvider(t,new K9(i))),r.onTypeFormattingEdits&&n.push(Q.registerOnTypeFormattingEditProvider(t,new q9(i))),r.codeActions&&n.push(Q.registerCodeActionProvider(t,new J9(i))),r.inlayHints&&n.push(Q.registerInlayHintsProvider(t,new X9(i))),r.diagnostics&&n.push(new P9(a,e,t,i))}return o(),i}function rqe(e){for(;e.length;)e.pop().dispose()}function iqe(e){return new Worker(``+new URL(`editor.worker-Cn2oRESe.js`,import.meta.url).href,{name:e?.name})}function aqe(e){return new Worker(``+new URL(`css.worker-CvXBzhp8.js`,import.meta.url).href,{name:e?.name})}function oqe(e){return new Worker(``+new URL(`html.worker-BO6WuOEO.js`,import.meta.url).href,{name:e?.name})}function sqe(e){return new Worker(``+new URL(`json.worker-BkJRGcCJ.js`,import.meta.url).href,{name:e?.name})}function cqe(e){return new Worker(``+new URL(`ts.worker-B6r0Skfj.js`,import.meta.url).href,{name:e?.name})}export{iqe as a,aqe as i,sqe as n,pGe as o,oqe as r,i as s,cqe as t};
1201
+ `]}async provideOnTypeFormattingEdits(e,t,n,r,i){let a=e.uri,o=e.getOffsetAt(t),s=await this._worker(a);if(e.isDisposed())return;let c=await s.getFormattingEditsAfterKeystroke(a.toString(),o,n,G9._convertOptions(r));if(!(!c||e.isDisposed()))return c.map(t=>this._convertTextChanges(e,t))}},J9=class extends G9{async provideCodeActions(e,t,n,r){let i=e.uri,a=e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn}),o=e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn}),s=G9._convertOptions(e.getOptions()),c=n.markers.filter(e=>e.code).map(e=>e.code).map(Number),l=await this._worker(i);if(e.isDisposed())return;let u=await l.getCodeFixesAtPosition(i.toString(),a,o,c,s);return!u||e.isDisposed()?{actions:[],dispose:()=>{}}:{actions:u.filter(e=>e.changes.filter(e=>e.isNewFile).length===0).map(t=>this._tsCodeFixActionToMonacoCodeAction(e,n,t)),dispose:()=>{}}}_tsCodeFixActionToMonacoCodeAction(e,t,n){let r=[];for(let t of n.changes)for(let n of t.textChanges)r.push({resource:e.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(e,n.span),text:n.newText}});return{title:n.description,edit:{edits:r},diagnostics:t.markers,kind:`quickfix`}}},Y9=class extends M9{constructor(e,t){super(t),this._libFiles=e}async provideRenameEdits(e,t,n,r){let i=e.uri,a=i.toString(),o=e.getOffsetAt(t),s=await this._worker(i);if(e.isDisposed())return;let c=await s.getRenameInfo(a,o,{allowRenameOfImportPath:!1});if(c.canRename===!1)return{edits:[],rejectReason:c.localizedErrorMessage};if(c.fileToRename!==void 0)throw Error(`Renaming files is not supported.`);let l=await s.findRenameLocations(a,o,!1,!1,!1);if(!l||e.isDisposed())return;let u=[];for(let e of l){let t=this._libFiles.getOrCreateModel(e.fileName);if(t)u.push({resource:t.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(t,e.textSpan),text:n}});else throw Error(`Unknown file ${e.fileName}.`)}return{edits:u}}},X9=class extends M9{async provideInlayHints(e,t,n){let r=e.uri,i=r.toString(),a=e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn}),o=e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn}),s=await this._worker(r);return e.isDisposed()?null:{hints:(await s.provideInlayHints(i,a,o)).map(t=>({...t,label:t.text,position:e.getPositionAt(t.position),kind:this._convertHintKind(t.kind)})),dispose:()=>{}}}_convertHintKind(e){switch(e){case`Parameter`:return Q.InlayHintKind.Parameter;case`Type`:return Q.InlayHintKind.Type;default:return Q.InlayHintKind.Type}}},QKe=e({Adapter:()=>M9,CodeActionAdaptor:()=>J9,DefinitionAdapter:()=>B9,DiagnosticsAdapter:()=>P9,DocumentHighlightAdapter:()=>z9,FormatAdapter:()=>K9,FormatHelper:()=>G9,FormatOnTypeAdapter:()=>q9,InlayHintsAdapter:()=>X9,Kind:()=>U9,LibFiles:()=>N9,OutlineAdapter:()=>H9,QuickInfoAdapter:()=>R9,ReferenceAdapter:()=>V9,RenameAdapter:()=>Y9,SignatureHelpAdapter:()=>L9,SuggestAdapter:()=>F9,WorkerManager:()=>O9,flattenDiagnosticMessageText:()=>A9,getJavaScriptWorker:()=>tqe,getTypeScriptWorker:()=>nqe,setupJavaScript:()=>eqe,setupTypeScript:()=>$Ke}),Z9,Q9;function $Ke(e){Q9=$9(e,`typescript`)}function eqe(e){Z9=$9(e,`javascript`)}function tqe(){return new Promise((e,t)=>{if(!Z9)return t(`JavaScript not registered!`);e(Z9)})}function nqe(){return new Promise((e,t)=>{if(!Q9)return t(`TypeScript not registered!`);e(Q9)})}function $9(e,t){let n=[],r=new O9(t,e),i=(...e)=>r.getLanguageServiceWorker(...e),a=new N9(i);function o(){let{modeConfiguration:r}=e;rqe(n),r.completionItems&&n.push(Q.registerCompletionItemProvider(t,new F9(i))),r.signatureHelp&&n.push(Q.registerSignatureHelpProvider(t,new L9(i))),r.hovers&&n.push(Q.registerHoverProvider(t,new R9(i))),r.documentHighlights&&n.push(Q.registerDocumentHighlightProvider(t,new z9(i))),r.definitions&&n.push(Q.registerDefinitionProvider(t,new B9(a,i))),r.references&&n.push(Q.registerReferenceProvider(t,new V9(a,i))),r.documentSymbols&&n.push(Q.registerDocumentSymbolProvider(t,new H9(i))),r.rename&&n.push(Q.registerRenameProvider(t,new Y9(a,i))),r.documentRangeFormattingEdits&&n.push(Q.registerDocumentRangeFormattingEditProvider(t,new K9(i))),r.onTypeFormattingEdits&&n.push(Q.registerOnTypeFormattingEditProvider(t,new q9(i))),r.codeActions&&n.push(Q.registerCodeActionProvider(t,new J9(i))),r.inlayHints&&n.push(Q.registerInlayHintsProvider(t,new X9(i))),r.diagnostics&&n.push(new P9(a,e,t,i))}return o(),i}function rqe(e){for(;e.length;)e.pop().dispose()}function iqe(e){return new Worker(``+new URL(`editor.worker-Cn2oRESe.js`,import.meta.url).href,{name:e?.name})}function aqe(e){return new Worker(``+new URL(`css.worker-CvXBzhp8.js`,import.meta.url).href,{name:e?.name})}function oqe(e){return new Worker(``+new URL(`html.worker-BO6WuOEO.js`,import.meta.url).href,{name:e?.name})}function sqe(e){return new Worker(``+new URL(`json.worker-BkJRGcCJ.js`,import.meta.url).href,{name:e?.name})}function cqe(e){return new Worker(``+new URL(`ts.worker-B0J26iPs.js`,import.meta.url).href,{name:e?.name})}export{iqe as a,aqe as i,sqe as n,pGe as o,oqe as r,i as s,cqe as t};