',r=[];for(let e=t;e<=i;e++){const i=e-t,o=n[i];0===o.length?r[i]="":r[i]='=this._renderResult.length?"":this._renderResult[i]}}})),define(t[383],i([0,1,164,313]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinesDecorationsOverlay=void 0;class n extends i.DedupOverlay{constructor(e){super(),this._context=e;const t=this._context.configuration.options.get(117);this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options.get(117);return this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){
const t=e.getDecorationsInViewport();let n=[],o=0;for(let e=0,s=t.length;e
',s=[];for(let e=t;e<=i;e++){const i=e-t,r=n[i];let a="";for(let e=0,t=r.length;e';o[i]=r}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}t.MarginViewLineDecorationsOverlay=n})),define(t[385],i([0,1,30,43,316]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewOverlayWidgets=void 0;class o extends n.ViewPart{constructor(e){super(e)
;const t=this._context.configuration.options.get(117);this._widgets={},this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,this._domNode=i.createFastDomNode(document.createElement("div")),n.PartFingerprints.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options.get(117);return this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,!0}addWidget(e){const t=i.createFastDomNode(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),
this.setShouldRender()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference!==t&&(i.preference=t,this.setShouldRender(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.parentNode.removeChild(e),this.setShouldRender()}}_renderWidget(e){const t=e.domNode;if(null!==e.preference)if(0===e.preference)t.setTop(0),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth);else if(1===e.preference){const e=t.domNode.clientHeight;t.setTop(this._editorHeight-e-2*this._horizontalScrollbarHeight),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth)}else 2===e.preference&&(t.setTop(0),t.domNode.style.right="50%");else t.unsetTop()}prepareRender(e){}render(e){this._domNode.setWidth(this._editorWidth);const t=Object.keys(this._widgets);for(let e=0,i=t.length;ethis._context.viewLayout.getVerticalOffsetForLineNumber(e)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(o.get(51)),this._zoneManager.setPixelRatio(o.get(115)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(51)&&(this._zoneManager.setLineHeight(t.get(51)),this._render()),
e.hasChanged(115)&&(this._zoneManager.setPixelRatio(t.get(115)),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)&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){
this._zoneManager.setZones(e),this._render()}_render(){if(0===this._zoneManager.getOuterHeight())return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),n=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,n,e),!0}_renderOneLane(e,t,i,n){let o=0,s=0,r=0;for(const a of t){const t=a.colorId,l=a.from,d=a.to;t!==o?(e.fillRect(0,s,n,r-s),o=t,e.fillStyle=i[o],s=l,r=d):r>=l?r=Math.max(r,d):(e.fillRect(0,s,n,r-s),s=l,r=d)}e.fillRect(0,s,n,r-s)}}t.OverviewRuler=s})),define(t[387],i([0,1,30,12,43,13]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewZones=void 0;const r=()=>{throw new Error("Invalid change accessor")};class a extends o.ViewPart{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(117);this._lineHeight=t.get(51),this._contentWidth=n.contentWidth,this._contentLeft=n.contentLeft,
this.domNode=i.createFastDomNode(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=i.createFastDomNode(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const i of e)t.set(i.id,i);let i=!1;return this._context.model.changeWhitespace(e=>{const n=Object.keys(this._zones);for(let o=0,s=n.length;o{const o={addZone:e=>(t=!0,this._addZone(i,e)),removeZone:e=>{e&&(t=this._removeZone(i,e)||t)},layoutZone:e=>{e&&(t=this._layoutZone(i,e)||t)}};!function(e,t){try{e(t)}catch(e){n.onUnexpectedError(e)}}(e,o),o.addZone=r,o.removeZone=r,o.layoutZone=r}),t}_addZone(e,t){
const n=this._computeWhitespaceProps(t),o={whitespaceId:e.insertWhitespace(n.afterViewLineNumber,this._getZoneOrdinal(t),n.heightInPx,n.minWidthInPx),delegate:t,isVisible:!1,domNode:i.createFastDomNode(t.domNode),marginDomNode:t.marginDomNode?i.createFastDomNode(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,n.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),
i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],n=this._computeWhitespaceProps(i.delegate);return e.changeOneWhitespace(i.whitespaceId,n.afterViewLineNumber,n.heightInPx),this._safeCallOnComputedHeight(i.delegate,n.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){if(this._zones.hasOwnProperty(e)){const t=this._zones[e];return Boolean(t.delegate.suppressMouseDown)}return!1}_heightInPixels(e){return"number"==typeof e.heightInPx?e.heightInPx:"number"==typeof e.heightInLines?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){
return"number"==typeof e.minWidthInPx?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if("function"==typeof e.onComputedHeight)try{e.onComputedHeight(t)}catch(e){n.onUnexpectedError(e)}}_safeCallOnDomNodeTop(e,t){if("function"==typeof e.onDomNodeTop)try{e.onDomNodeTop(t)}catch(e){n.onUnexpectedError(e)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(let e=0,o=t.length;e0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t0&&this._emitMany(t)}this._emitOugoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}t.ViewModelEventDispatcher=o;class s{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}t.ViewModelEventsCollector=s;class r{constructor(e,t,i,n){
this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=n,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}merge(e){return 0!==e.kind?this:new r(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}t.ContentSizeChangedEvent=r;class a{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}merge(e){return 1!==e.kind?this:new a(this.oldHasFocus,e.hasFocus)}}t.FocusChangedEvent=a;class l{constructor(e,t,i,n,o,s,r,a){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=o,this.scrollLeft=s,this.scrollHeight=r,this.scrollTop=a,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,
this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!(this.scrollWidthChanged||this.scrollLeftChanged||this.scrollHeightChanged||this.scrollTopChanged)}merge(e){return 2!==e.kind?this:new l(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}t.ScrollChangedEvent=l;t.ViewZonesChangedEvent=class{constructor(){this.kind=3}isNoOp(){return!1}merge(e){return this}};class d{constructor(e,t,i,n,o,s,r){this.kind=5,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=o,this.reason=s,this.reachedMaxCursorCount=r}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length;if(i!==t.length)return!1;for(let n=0;n=t?0:i.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return n.get(86)?o+=t-n.get(51):o+=this._getHorizontalScrollbarHeight(e,i),o}_updateHeight(){
const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new d(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new r.Viewport(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new r.Viewport(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(e){const t=this._configuration.options,i=t.get(118),n=t.get(36);if(i.isViewportWrapping){const i=t.get(117),o=t.get(56);return e>i.contentWidth+n.typicalHalfwidthCharacterWidth&&o.enabled&&"right"===o.side?e+i.verticalScrollbarWidth:e}{const i=t.get(85)*n.typicalHalfwidthCharacterWidth,o=this._linesLayout.getWhitespaceMinWidth();return Math.max(e+i,o)}}setMaxLineWidth(e){const t=this._scrollable.getScrollDimensions()
;this._scrollable.setScrollDimensions(new d(t.width,this._computeContentWidth(e),t.height,t.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition();let t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t);return{scrollTop:t,scrollTopWithoutViewZones:t-this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i),scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e){return this._linesLayout.getVerticalOffsetForLineNumber(e)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){
const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){
1===t?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}t.ViewLayout=h})),define(t[389],i([0,1,3,20]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MoveCaretCommand=void 0;t.MoveCaretCommand=class{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const n=this._selection.startLineNumber,o=this._selection.startColumn,s=this._selection.endColumn;if((!this._isMovingLeft||1!==o)&&(this._isMovingLeft||s!==e.getLineMaxColumn(n)))if(this._isMovingLeft){const r=new i.Range(n,o-1,n,o),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new i.Range(n,s,n,s),a)}else{const r=new i.Range(n,s,n,s+1),a=e.getValueInRange(r)
;t.addEditOperation(r,null),t.addEditOperation(new i.Range(n,o,n,o),a)}}computeCursorState(e,t){return this._isMovingLeft?new n.Selection(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new n.Selection(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}})),define(t[124],i([0,1,8]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeActionCommandArgs=t.filtersAction=t.mayIncludeActionsOfKind=t.CodeActionKind=void 0;class n{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||""===this.value||i.startsWith(e.value,this.value+n.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new n(this.value+n.sep+e)}}function o(e,t,i){return!!t.contains(e)&&(!i||!t.contains(i))}t.CodeActionKind=n,n.sep=".",n.None=new n("@@none@@"),n.Empty=new n(""),n.QuickFix=new n("quickfix"),
n.Refactor=new n("refactor"),n.Source=new n("source"),n.SourceOrganizeImports=n.Source.append("organizeImports"),n.SourceFixAll=n.Source.append("fixAll"),t.mayIncludeActionsOfKind=function(e,t){return!(e.include&&!e.include.intersects(t))&&((!e.excludes||!e.excludes.some(i=>o(t,i,e.include)))&&!(!e.includeSourceActions&&n.Source.contains(t)))},t.filtersAction=function(e,t){const i=t.kind?new n(t.kind):void 0;return!!(!e.include||i&&e.include.contains(i))&&(!(e.excludes&&i&&e.excludes.some(t=>o(i,t,e.include)))&&(!(!e.includeSourceActions&&i&&n.Source.contains(i))&&!(e.onlyIncludePreferredActions&&!t.isPreferred)))};class s{constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}static fromUser(e,t){return e&&"object"==typeof e?new s(s.getKindFromUser(e,t.kind),s.getApplyFromUser(e,t.apply),s.getPreferredUser(e)):new s(t.kind,t.apply,!1)}static getApplyFromUser(e,t){switch("string"==typeof e.apply?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle"
;default:return t}}static getKindFromUser(e,t){return"string"==typeof e.kind?new n(e.kind):t}static getPreferredUser(e){return"boolean"==typeof e.preferred&&e.preferred}}t.CodeActionCommandArgs=s})),define(t[390],i([0,1,4]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPickerModel=void 0;t.ColorPickerModel=class{constructor(e,t,n){this.presentationIndex=n,this._onColorFlushed=new i.Emitter,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new i.Emitter,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new i.Emitter,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){
this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){for(let e=0;ee.length)return!1;for(let o=0;o=65&&n<=90&&n+32===s||s>=65&&s<=90&&s+32===n))return!1}return!0}_createOperationsForBlockComment(e,t,i,n,s,r){const l=e.startLineNumber,d=e.startColumn,c=e.endLineNumber,h=e.endColumn,u=s.getLineContent(l),g=s.getLineContent(c);let p,m=u.lastIndexOf(t,d-1+t.length),f=g.indexOf(i,h-1-i.length);if(-1!==m&&-1!==f)if(l===c){u.substring(m+t.length,f).indexOf(i)>=0&&(m=-1,f=-1)}else{const e=u.substring(m+t.length),n=g.substring(0,f);(e.indexOf(i)>=0||n.indexOf(i)>=0)&&(m=-1,f=-1)}-1!==m&&-1!==f?(n&&m+t.length0&&32===g.charCodeAt(f-1)&&(i=" "+i,f-=1),p=a._createRemoveBlockCommentOperations(new o.Range(l,m+t.length+1,c,f+1),t,i)):(p=a._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=1===p.length?i:null);for(const e of p)r.addTrackedEditOperation(e.range,e.text)}static _createRemoveBlockCommentOperations(e,t,n){let s=[]
;return o.Range.isEmpty(e)?s.push(i.EditOperation.delete(new o.Range(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+n.length))):(s.push(i.EditOperation.delete(new o.Range(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),s.push(i.EditOperation.delete(new o.Range(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+n.length)))),s}static _createAddBlockCommentOperations(e,t,s,r){let a=[];return o.Range.isEmpty(e)?a.push(i.EditOperation.replace(new o.Range(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+s)):(a.push(i.EditOperation.insert(new n.Position(e.startLineNumber,e.startColumn),t+(r?" ":""))),a.push(i.EditOperation.insert(new n.Position(e.endLineNumber,e.endColumn),(r?" ":"")+s))),a}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,n),s=r.LanguageConfigurationRegistry.getComments(o)
;s&&s.blockCommentStartToken&&s.blockCommentEndToken&&this._createOperationsForBlockComment(this._selection,s.blockCommentStartToken,s.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(2===i.length){const e=i[0],t=i[1];return new s.Selection(e.range.endLineNumber,e.range.endColumn,t.range.startLineNumber,t.range.startColumn)}{const e=i[0].range,t=this._usedEndToken?-this._usedEndToken.length-1:0;return new s.Selection(e.endLineNumber,e.endColumn+t,e.endLineNumber,e.endColumn+t)}}}t.BlockCommentCommand=a})),define(t[391],i([0,1,8,60,13,3,20,42,216]),(function(e,t,i,n,o,s,r,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LineCommentCommand=void 0;class d{constructor(e,t,i,n,o){this._selection=e,this._tabSize=t,this._type=i,this._insertSpace=n,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=o}static _gatherPreflightCommentStrings(e,t,i){e.tokenizeIfCheap(t)
;const n=e.getLanguageIdAtPosition(t,1),o=a.LanguageConfigurationRegistry.getComments(n),s=o?o.lineCommentToken:null;if(!s)return null;let r=[];for(let e=0,n=i-t+1;er?o-1:o}}}t.LineCommentCommand=d})),define(t[392],i([0,1,20,3]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DragAndDropCommand=void 0;t.DragAndDropCommand=class{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){let o=e.getValueInRange(this.selection);this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new n.Range(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),o),
!this.selection.containsPosition(this.targetPosition)||this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition))?this.copy?this.targetSelection=new i.Selection(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn):this.targetPosition.lineNumber>this.selection.endLineNumber?this.targetSelection=new i.Selection(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn):this.targetPosition.lineNumber0){let e=[];for(let t=0;ti.Range.compareRangesUsingStarts(e.range,t.range));let n=[],o=e[0];for(let t=1;t0){let e=[],t=i.caseOps.length,n=0;for(let s=0,r=o.length;s=t){e.push(o.slice(s));break}switch(i.caseOps[n]){case"U":e.push(o[s].toUpperCase());break;case"u":e.push(o[s].toUpperCase()),n++;break;case"L":e.push(o[s].toLowerCase());break;case"l":e.push(o[s].toLowerCase()),n++;break;default:e.push(o[s])}}o=e.join("")}n+=o}return n}static _substitute(e,t){if(null===t)return"";if(0===e)return t[0];let i="";for(;e>0;){if(e=o)break;let s=e.charCodeAt(n);if(36===s){i.emitUnchanged(n-1),i.emitStatic("$",n+1);continue}if(48===s||38===s){i.emitUnchanged(n-1),i.emitMatchIndex(0,n+1,t),t.length=0;continue}if(49<=s&&s<=57){let r=s-48;if(n+1=o)break;let s=e.charCodeAt(n);switch(s){case 92:i.emitUnchanged(n-1),i.emitStatic("\\",n+1);break;case 110:i.emitUnchanged(n-1),i.emitStatic("\n",n+1);break;case 116:i.emitUnchanged(n-1),i.emitStatic("\t",n+1);break;case 117:case 85:case 108:case 76:i.emitUnchanged(n-1),i.emitStatic("",n+1),t.push(String.fromCharCode(s))}}}return i.finalize()}})),define(t[166],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),
t.FoldingRegion=t.FoldingRegions=t.MAX_LINE_NUMBER=t.MAX_FOLDING_REGIONS=void 0,t.MAX_FOLDING_REGIONS=65535,t.MAX_LINE_NUMBER=16777215;const i=4278190080;t.FoldingRegions=class{constructor(e,i,n){if(e.length!==i.length||e.length>t.MAX_FOLDING_REGIONS)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=i,this._collapseStates=new Uint32Array(Math.ceil(e.length/32)),this._types=n,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;let e=[],i=(t,i)=>{let n=e[e.length-1];return this.getStartLineNumber(n)<=t&&this.getEndLineNumber(n)>=i};for(let n=0,o=this._startIndexes.length;nt.MAX_LINE_NUMBER||s>t.MAX_LINE_NUMBER)throw new Error("startLineNumber or endLineNumber must not exceed "+t.MAX_LINE_NUMBER);for(;e.length>0&&!i(o,s);)e.pop();let r=e.length>0?e[e.length-1]:-1;e.push(n),this._startIndexes[n]=o+((255&r)<<24),this._endIndexes[n]=s+((65280&r)<<16)}}}
get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&t.MAX_LINE_NUMBER}getEndLineNumber(e){return this._endIndexes[e]&t.MAX_LINE_NUMBER}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){let t=e/32|0,i=e%32;return 0!=(this._collapseStates[t]&1<>>24)+((this._endIndexes[e]&i)>>>16);return n===t.MAX_FOLDING_REGIONS?-1:n}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(0===i)return-1;for(;t=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);-1!==t;){if(this.contains(t,e))return t
;t=this.getParentIndex(t)}}return-1}toString(){let e=[];for(let t=0;t=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}t.FoldingRegion=n})),define(t[395],i([0,1,4,166]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),
t.setCollapseStateForType=t.setCollapseStateForMatchingLines=t.setCollapseStateAtLevel=t.setCollapseStateUp=t.setCollapseStateLevelsUp=t.setCollapseStateLevelsDown=t.toggleCollapseState=t.FoldingModel=void 0;t.FoldingModel=class{constructor(e,t){this._updateEventEmitter=new i.Emitter,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new n.FoldingRegions(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[],this._isInitialized=!1}get regions(){return this._regions}get textModel(){return this._textModel}get isInitialized(){return this._isInitialized}toggleCollapseState(e){if(!e.length)return;e=e.sort((e,t)=>e.regionIndex-t.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let n=0,o=-1,s=-1;const r=e=>{for(;ns&&(s=e),n++}}
;for(let i of e){let e=i.regionIndex,n=this._editorDecorationIds[e];if(n&&!t[n]){t[n]=!0,r(e);let i=!this._regions.isCollapsed(e);this._regions.setCollapsed(e,i),o=Math.max(o,this._regions.getEndLineNumber(e))}}r(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}update(e,t=[]){let i=[],n=-1,o=(o,s)=>{const r=e.getStartLineNumber(o),a=e.getEndLineNumber(o);s&&((e,i)=>{for(let n of t)if(en&&(n=a)},s=0,r=()=>{for(;s=t))break;o(a,i===t),a++}}l=r()}for(;a0)return e}applyMemento(e){if(!Array.isArray(e))return;let t=[];for(let i of e){let e=this.getRegionAtLine(i.startLineNumber);e&&!e.isCollapsed&&t.push(e)}this.toggleCollapseState(t)}dispose(){this._decorationProvider.deltaDecorations(this._editorDecorationIds,[])}getAllRegionsAtLine(e,t){let i=[];if(this._regions){let n=this._regions.findRange(e),o=1;for(;n>=0;){let e=this._regions.toRegion(n)
;t&&!t(e,o)||i.push(e),o++,n=e.parentIndex}}return i}getRegionAtLine(e){if(this._regions){let t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){let i=[],n=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&2===t.length){const e=[];for(let s=n,r=this._regions.length;s0&&!n.containedBy(e[e.length-1]);)e.pop();e.push(n),t(n,e.length)&&i.push(n)}}else for(let e=n,s=this._regions.length;e1){let s=e.getRegionsInside(i,(e,i)=>e.isCollapsed!==o&&i0)for(let s of n){
let n=e.getRegionAtLine(s);if(n&&(n.isCollapsed!==t&&o.push(n),i>1)){let s=e.getRegionsInside(n,(e,n)=>e.isCollapsed!==t&&ne.isCollapsed!==t&&ne.isCollapsed!==t&&n<=i);o.push(...n)}e.toggleCollapseState(o)},t.setCollapseStateUp=function(e,t,i){let n=[];for(let o of i){let i=e.getAllRegionsAtLine(o,e=>e.isCollapsed!==t);i.length>0&&n.push(i[0])}e.toggleCollapseState(n)},t.setCollapseStateAtLevel=function(e,t,i,n){let o=e.getRegionsInside(null,(e,o)=>o===t&&e.isCollapsed!==i&&!n.some(t=>e.containsLine(t)));e.toggleCollapseState(o)},t.setCollapseStateForMatchingLines=function(e,t,i){let n=e.textModel,o=e.regions,s=[];for(let e=o.length-1;e>=0;e--)if(i!==o.isCollapsed(e)){let i=o.getStartLineNumber(e);t.test(n.getLineContent(i))&&s.push(o.toRegion(e))}e.toggleCollapseState(s)},
t.setCollapseStateForType=function(e,t,i){let n=e.regions,o=[];for(let e=n.length-1;e>=0;e--)i!==n.isCollapsed(e)&&t===n.getType(e)&&o.push(n.toRegion(e));e.toggleCollapseState(o)}})),define(t[396],i([0,1,4,3,19]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HiddenRangeModel=void 0;function s(e,t){let i=o.findFirstInSorted(e,e=>t=0&&e[i].endLineNumber>=t?e[i]:null}t.HiddenRangeModel=class{constructor(e){this._updateEventEmitter=new i.Emitter,this._foldingModel=e,this._foldingModelListener=e.onDidChange(e=>this.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}updateHiddenRanges(){let e=!1,t=[],i=0,o=0,s=Number.MAX_VALUE,r=-1,a=this._foldingModel.regions;for(;i({startLineNumber:e.startLineNumber-1,endLineNumber:e.endLineNumber}))}applyHiddenRanges(e){this._hiddenRanges=e,this._updateEventEmitter.fire(e)}hasRanges(){return this._hiddenRanges.length>0}isHidden(e){return null!==s(this._hiddenRanges,e)}adjustSelections(e){let t=!1,i=this._foldingModel.textModel,n=null,o=e=>(n&&function(e,t){return e>=t.startLineNumber&&e<=t.endLineNumber}(e,n)||(n=s(this._hiddenRanges,e)),n?n.startLineNumber-1:null);for(let n=0,s=e.length;n0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}})),define(t[217],i([0,1,12,166]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sanitizeRanges=t.RangesCollector=t.SyntaxRangeProvider=t.ID_SYNTAX_PROVIDER=void 0;const o=5e3,s={};t.ID_SYNTAX_PROVIDER="syntax";t.SyntaxRangeProvider=class{constructor(e,i,n=o){this.editorModel=e,this.providers=i,this.limit=n,this.id=t.ID_SYNTAX_PROVIDER}compute(e){return function(e,t,n){let o=null,r=e.map((e,r)=>Promise.resolve(e.provideFoldingRanges(t,s,n)).then(e=>{if(!n.isCancellationRequested&&Array.isArray(e)){Array.isArray(o)||(o=[]);let i=t.getLineCount()
;for(let t of e)t.start>0&&t.end>t.start&&t.end<=i&&o.push({start:t.start,end:t.end,rank:r,kind:t.kind})}},i.onUnexpectedExternalError));return Promise.all(r).then(e=>o)}(this.providers,this.editorModel,e).then(e=>{if(e){return a(e,this.limit)}return null})}dispose(){}};class r{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,o){if(e>n.MAX_LINE_NUMBER||t>n.MAX_LINE_NUMBER)return;let s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._nestingLevels[s]=o,this._types[s]=i,this._length++,o<30&&(this._nestingLevelCounts[o]=(this._nestingLevelCounts[o]||0)+1)}toIndentRanges(){if(this._length<=this._foldingRangesLimit){let e=new Uint32Array(this._length),t=new Uint32Array(this._length);for(let i=0;ithis._foldingRangesLimit){t=i;break}e+=n}}let i=new Uint32Array(this._foldingRangesLimit),o=new Uint32Array(this._foldingRangesLimit),s=[];for(let n=0,r=0;n{let i=e.start-t.start;return 0===i&&(i=e.rank-t.rank),i}),n=new r(t),o=void 0,s=[];for(let e of i)if(o){if(e.start>o.start)if(e.end<=o.end)s.push(o),o=e,n.add(e.start,e.end,e.kind&&e.kind.value,s.length);else{if(e.start>o.end){do{o=s.pop()}while(o&&e.start>o.end);o&&s.push(o),o=e}n.add(e.start,e.end,e.kind&&e.kind.value,s.length)}}else o=e,n.add(e.start,e.end,e.kind&&e.kind.value,s.length);return n.toIndentRanges()}t.RangesCollector=r,t.sanitizeRanges=a})),define(t[397],i([0,1,217]),(function(e,t,i){"use strict"
;Object.defineProperty(t,"__esModule",{value:!0}),t.InitializingRangeProvider=t.ID_INIT_PROVIDER=void 0,t.ID_INIT_PROVIDER="init";t.InitializingRangeProvider=class{constructor(e,i,n,o){if(this.editorModel=e,this.id=t.ID_INIT_PROVIDER,i.length){let t=t=>({range:{startLineNumber:t.startLineNumber,startColumn:0,endLineNumber:t.endLineNumber,endColumn:e.getLineLength(t.endLineNumber)},options:{stickiness:1}});this.decorationIds=e.deltaDecorations([],i.map(t)),this.timeout=setTimeout(n,o)}}dispose(){this.decorationIds&&(this.editorModel.deltaDecorations(this.decorationIds,[]),this.decorationIds=void 0),"number"==typeof this.timeout&&(clearTimeout(this.timeout),this.timeout=void 0)}compute(e){let t=[];if(this.decorationIds)for(let e of this.decorationIds){let i=this.editorModel.getDecorationRange(e);i&&t.push({start:i.startLineNumber,end:i.endLineNumber,rank:1})}return Promise.resolve(i.sanitizeRanges(t,Number.MAX_VALUE))}}})),define(t[218],i([0,1,60,3]),(function(e,t,i,n){"use strict"
;Object.defineProperty(t,"__esModule",{value:!0}),t.FormattingEdit=void 0;class o{static _handleEolEdits(e,t){let i=void 0,n=[];for(let e of t)"number"==typeof e.eol&&(i=e.eol),e.range&&"string"==typeof e.text&&n.push(e);return"number"==typeof i&&e.hasModel()&&e.getModel().pushEOL(i),n}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),n=i.validateRange(t.range);return i.getFullModelRange().equalsRange(n)}static execute(e,t,s){s&&e.pushUndoStop();const r=o._handleEolEdits(e,t);1===r.length&&o._isFullModelReplaceEdit(e,r[0])?e.executeEdits("formatEditsCommand",r.map(e=>i.EditOperation.replace(n.Range.lift(e.range),e.text))):e.executeEdits("formatEditsCommand",r.map(e=>i.EditOperation.replaceMove(n.Range.lift(e.range),e.text))),s&&e.pushUndoStop()}}t.FormattingEdit=o})),define(t[219],i([0,1,2,4,16]),(function(e,t,i,n,o){"use strict";function s(e,t){return!!e[t]}Object.defineProperty(t,"__esModule",{value:!0}),
t.ClickLinkGesture=t.ClickLinkOptions=t.ClickLinkKeyboardEvent=t.ClickLinkMouseEvent=void 0;class r{constructor(e,t){this.target=e.target,this.hasTriggerModifier=s(e.event,t.triggerModifier),this.hasSideBySideModifier=s(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}t.ClickLinkMouseEvent=r;class a{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=s(e,t.triggerModifier)}}t.ClickLinkKeyboardEvent=a;class l{constructor(e,t,i,n){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=n}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function d(e){
return"altKey"===e?o.isMacintosh?new l(57,"metaKey",6,"altKey"):new l(5,"ctrlKey",6,"altKey"):o.isMacintosh?new l(6,"altKey",57,"metaKey"):new l(6,"altKey",5,"ctrlKey")}t.ClickLinkOptions=l;class c extends i.Disposable{constructor(e){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new n.Emitter),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new n.Emitter),this.onExecute=this._onExecute.event,this._onCancel=this._register(new n.Emitter),this.onCancel=this._onCancel.event,this._editor=e,this._opts=d(this._editor.getOption(61)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(e=>{if(e.hasChanged(61)){const e=d(this._editor.getOption(61));if(this._opts.equals(e))return;this._opts=e,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),
this._register(this._editor.onMouseMove(e=>this._onEditorMouseMove(new r(e,this._opts)))),this._register(this._editor.onMouseDown(e=>this._onEditorMouseDown(new r(e,this._opts)))),this._register(this._editor.onMouseUp(e=>this._onEditorMouseUp(new r(e,this._opts)))),this._register(this._editor.onKeyDown(e=>this._onEditorKeyDown(new a(e,this._opts)))),this._register(this._editor.onKeyUp(e=>this._onEditorKeyUp(new a(e,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(e=>this._onDidChangeCursorSelection(e))),this._register(this._editor.onDidChangeModel(e=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(e=>{(e.scrollTopChanged||e.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){
this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=e.target.position?e.target.position.lineNumber:0}_onEditorMouseUp(e){const t=e.target.position?e.target.position.lineNumber:0;this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}t.ClickLinkGesture=c})),define(t[220],i([0,1,15,12]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HoverOperation=void 0;t.HoverOperation=class{
constructor(e,t,n,o,s){this._computer=e,this._state=0,this._hoverTime=s,this._firstWaitScheduler=new i.RunOnceScheduler(()=>this._triggerAsyncComputation(),0),this._secondWaitScheduler=new i.RunOnceScheduler(()=>this._triggerSyncComputation(),0),this._loadingMessageScheduler=new i.RunOnceScheduler(()=>this._showLoadingMessage(),0),this._asyncComputationPromise=null,this._asyncComputationPromiseDone=!1,this._completeCallback=t,this._errorCallback=n,this._progressCallback=o}setHoverTime(e){this._hoverTime=e}_firstWaitTime(){return this._hoverTime/2}_secondWaitTime(){return this._hoverTime/2}_loadingMessageTime(){return 3*this._hoverTime}_triggerAsyncComputation(){this._state=2,this._secondWaitScheduler.schedule(this._secondWaitTime()),this._computer.computeAsync?(this._asyncComputationPromiseDone=!1,this._asyncComputationPromise=i.createCancelablePromise(e=>this._computer.computeAsync(e)),this._asyncComputationPromise.then(e=>{this._asyncComputationPromiseDone=!0,this._withAsyncResult(e)
},e=>this._onError(e))):this._asyncComputationPromiseDone=!0}_triggerSyncComputation(){this._computer.computeSync&&this._computer.onResult(this._computer.computeSync(),!0),this._asyncComputationPromiseDone?(this._state=0,this._onComplete(this._computer.getResult())):(this._state=3,this._onProgress(this._computer.getResult()))}_showLoadingMessage(){3===this._state&&this._onProgress(this._computer.getResultWithLoadingMessage())}_withAsyncResult(e){e&&this._computer.onResult(e,!1),3===this._state&&(this._state=0,this._onComplete(this._computer.getResult()))}_onComplete(e){this._completeCallback(e)}_onError(e){this._errorCallback?this._errorCallback(e):n.onUnexpectedError(e)}_onProgress(e){this._progressCallback(e)}start(e){if(0===e)0===this._state&&(this._state=1,this._firstWaitScheduler.schedule(this._firstWaitTime()),this._loadingMessageScheduler.schedule(this._loadingMessageTime()));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),
this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation()}}cancel(){this._loadingMessageScheduler.cancel(),1===this._state&&this._firstWaitScheduler.cancel(),2===this._state&&(this._secondWaitScheduler.cancel(),this._asyncComputationPromise&&(this._asyncComputationPromise.cancel(),this._asyncComputationPromise=null)),3===this._state&&this._asyncComputationPromise&&(this._asyncComputationPromise.cancel(),this._asyncComputationPromise=null),this._state=0}}})),define(t[221],i([0,1,7,54,301]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlyphHoverWidget=t.ContentHoverWidget=void 0;class s extends n.Widget{constructor(e,t,i,n){super(),this._hoverVisibleKey=i,this._keybindingService=n,this.allowEditorOverflow=!0,this._hover=this._register(new o.HoverWidget),this._id=e,this._editor=t,this._isVisible=!1,this._stoleFocus=!1,this.onkeydown(this._hover.containerDomNode,e=>{e.equals(9)&&this.hide()}),
this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(36)&&this.updateFont()})),this._editor.onDidLayoutChange(e=>this.layout()),this.layout(),this._editor.addContentWidget(this),this._showAtPosition=null,this._showAtRange=null,this._stoleFocus=!1}get isVisible(){return this._isVisible}set isVisible(e){this._isVisible=e,i.toggleClass(this._hover.containerDomNode,"hidden",!this._isVisible)}getId(){return this._id}getDomNode(){return this._hover.containerDomNode}showAt(e,t,i){this._showAtPosition=e,this._showAtRange=t,this._hoverVisibleKey.set(!0),this.isVisible=!0,this._editor.layoutContentWidget(this),this._editor.render(),this._stoleFocus=i,i&&this._hover.containerDomNode.focus()}hide(){this.isVisible&&(setTimeout(()=>{this.isVisible||this._hoverVisibleKey.set(!1)},0),this.isVisible=!1,this._editor.layoutContentWidget(this),this._stoleFocus&&this._editor.focus())}getPosition(){return this.isVisible?{position:this._showAtPosition,range:this._showAtRange,preference:[1,2]}:null}dispose(){
this._editor.removeContentWidget(this),super.dispose()}updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(e=>this._editor.applyFontInfo(e))}updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this.updateFont(),this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_renderAction(e,t){const i=this._keybindingService.lookupKeybinding(t.commandId),n=i?i.getLabel():null;return o.renderHoverAction(e,t,n)}layout(){const e=Math.max(this._editor.getLayoutInfo().height/4,250),{fontSize:t,lineHeight:i}=this._editor.getOption(36);this._hover.contentsDomNode.style.fontSize=`${t}px`,this._hover.contentsDomNode.style.lineHeight=`${i}px`,this._hover.contentsDomNode.style.maxHeight=`${e}px`,this._hover.contentsDomNode.style.maxWidth=`${Math.max(.66*this._editor.getLayoutInfo().width,500)}px`}}t.ContentHoverWidget=s;class r extends n.Widget{constructor(e,t){super(),this._id=e,this._editor=t,
this._isVisible=!1,this._domNode=document.createElement("div"),this._domNode.className="monaco-hover hidden",this._domNode.setAttribute("aria-hidden","true"),this._domNode.setAttribute("role","tooltip"),this._showAtLineNumber=-1,this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(36)&&this.updateFont()})),this._editor.addOverlayWidget(this)}get isVisible(){return this._isVisible}set isVisible(e){this._isVisible=e,i.toggleClass(this._domNode,"hidden",!this._isVisible)}getId(){return this._id}getDomNode(){return this._domNode}showAt(e){this._showAtLineNumber=e,this.isVisible||(this.isVisible=!0);const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(this._showAtLineNumber),n=this._editor.getScrollTop(),o=this._editor.getOption(51),s=i-n-(this._domNode.clientHeight-o)/2;this._domNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._domNode.style.top=`${Math.max(Math.round(s),0)}px`}hide(){this.isVisible&&(this.isVisible=!1)}getPosition(){return null}dispose(){
this._editor.removeOverlayWidget(this),super.dispose()}updateFont(){[...Array.prototype.slice.call(this._domNode.getElementsByTagName("code")),...Array.prototype.slice.call(this._domNode.getElementsByClassName("code"))].forEach(e=>this._editor.applyFontInfo(e))}updateContents(e){this._domNode.textContent="",this._domNode.appendChild(e),this.updateFont()}}t.GlyphHoverWidget=r})),define(t[398],i([0,1,20]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InPlaceReplaceCommand=void 0;t.InPlaceReplaceCommand=class{constructor(e,t,i){this._editRange=e,this._originalSelection=t,this._text=i}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range
;return this._originalSelection.isEmpty()?new i.Selection(n.endLineNumber,Math.min(this._originalSelection.positionColumn,n.endColumn),n.endLineNumber,Math.min(this._originalSelection.positionColumn,n.endColumn)):new i.Selection(n.endLineNumber,n.endColumn-this._text.length,n.endLineNumber,n.endColumn)}}})),define(t[222],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateIndent=t.getSpaceCnt=void 0,t.getSpaceCnt=function(e,t){let i=0;for(let n=0;n=s)return null;let r=[];for(let t=n;t<=s;t++)r.push(e.getLineContent(t));let a=r.slice(0);return a.sort(o.getCollator().compare),!0===i&&(a=a.reverse()),{startLineNumber:n,endLineNumber:s,before:r,after:a}}t.SortLinesCommand=o,o._COLLATOR=null})),define(t[223],i([0,1,13,3,69]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BracketSelectionRangeProvider=void 0;class s{provideSelectionRanges(e,t){return r(this,void 0,void 0,(function*(){const i=[];for(const n of t){const t=[];i.push(t);const o=new Map;yield new Promise(t=>s._bracketsRightYield(t,0,e,n,o)),yield new Promise(i=>s._bracketsLeftYield(i,0,e,n,o,t))}return i}))}static _bracketsRightYield(e,t,i,n,r){const a=new Map,l=Date.now();for(;;){if(t>=s._maxRounds){e();break}if(!n){e();break}let d=i.findNextBracket(n);if(!d){e();break}
if(Date.now()-l>s._maxDuration){setTimeout(()=>s._bracketsRightYield(e,t+1,i,n,r));break}const c=d.close[0];if(d.isOpen){let e=a.has(c)?a.get(c):0;a.set(c,e+1)}else{let e=a.has(c)?a.get(c):0;if(e-=1,a.set(c,Math.max(0,e)),e<0){let e=r.get(c);e||(e=new o.LinkedList,r.set(c,e)),e.push(d.range)}}n=d.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,o,r,a){const l=new Map,d=Date.now();for(;;){if(t>=s._maxRounds&&0===r.size){e();break}if(!o){e();break}let c=i.findPrevBracket(o);if(!c){e();break}if(Date.now()-d>s._maxDuration){setTimeout(()=>s._bracketsLeftYield(e,t+1,i,o,r,a));break}const h=c.close[0];if(c.isOpen){let e=l.has(h)?l.get(h):0;if(e-=1,l.set(h,Math.max(0,e)),e<0){let e=r.get(h);if(e){let t=e.shift();0===e.size&&r.delete(h);const o=n.Range.fromPositions(c.range.getEndPosition(),t.getStartPosition()),l=n.Range.fromPositions(c.range.getStartPosition(),t.getEndPosition());a.push({range:o}),a.push({range:l}),s._addBracketLeading(i,l,a)}}}else{let e=l.has(h)?l.get(h):0;l.set(h,e+1)}
o=c.range.getStartPosition()}}static _addBracketLeading(e,t,o){if(t.startLineNumber===t.endLineNumber)return;const s=t.startLineNumber,r=e.getLineFirstNonWhitespaceColumn(s);0!==r&&r!==t.startColumn&&(o.push({range:n.Range.fromPositions(new i.Position(s,r),t.getEndPosition())}),o.push({range:n.Range.fromPositions(new i.Position(s,1),t.getEndPosition())}));const a=s-1;if(a>0){const s=e.getLineFirstNonWhitespaceColumn(a);s===t.startColumn&&s!==e.getLineLastNonWhitespaceColumn(a)&&(o.push({range:n.Range.fromPositions(new i.Position(a,s),t.getEndPosition())}),o.push({range:n.Range.fromPositions(new i.Position(a,1),t.getEndPosition())}))}}}t.BracketSelectionRangeProvider=s,s._maxDuration=30,s._maxRounds=2})),define(t[401],i([0,1,3,8]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WordSelectionRangeProvider=void 0;t.WordSelectionRangeProvider=class{provideSelectionRanges(e,t){const i=[];for(const n of t){const t=[];i.push(t),this._addInWordRanges(t,e,n),
this._addWordRanges(t,e,n),this._addWhitespaceLine(t,e,n),t.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,o){const s=t.getWordAtPosition(o);if(!s)return;let{word:r,startColumn:a}=s,l=o.column-a,d=l,c=l,h=0;for(;d>=0;d--){let e=r.charCodeAt(d);if(d!==l&&(95===e||45===e))break;if(n.isLowerAsciiLetter(e)&&n.isUpperAsciiLetter(h))break;h=e}for(d+=1;c0&&0===t.getLineFirstNonWhitespaceColumn(n.lineNumber)&&0===t.getLineLastNonWhitespaceColumn(n.lineNumber)&&e.push({range:new i.Range(n.lineNumber,1,n.lineNumber,t.getLineMaxColumn(n.lineNumber))})}}})),define(t[125],i([0,1]),(function(e,t){"use strict"
;Object.defineProperty(t,"__esModule",{value:!0}),t.SnippetParser=t.TextmateSnippet=t.Variable=t.FormatString=t.Transform=t.Choice=t.Placeholder=t.TransformableMarker=t.Text=t.Marker=t.Scanner=void 0;class i{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return 95===e||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};let e,t=this.pos,n=0,o=this.value.charCodeAt(t);if("number"==typeof(e=i._table[o]))return this.pos+=1,{type:e,pos:t,len:1};if(i.isDigitCharacter(o)){e=8;do{n+=1,o=this.value.charCodeAt(t+n)}while(i.isDigitCharacter(o));return this.pos+=n,{type:e,pos:t,len:n}}if(i.isVariableCharacter(o)){e=9;do{o=this.value.charCodeAt(t+ ++n)}while(i.isVariableCharacter(o)||i.isDigitCharacter(o));return this.pos+=n,{type:e,pos:t,len:n}}e=10;do{n+=1,o=this.value.charCodeAt(t+n)
}while(!isNaN(o)&&void 0===i._table[o]&&!i.isDigitCharacter(o)&&!i.isVariableCharacter(o));return this.pos+=n,{type:e,pos:t,len:n}}}t.Scanner=i,i._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};class n{constructor(){this._children=[]}appendChild(e){return e instanceof o&&this._children[this._children.length-1]instanceof o?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),o=i.children.slice(0);o.splice(n,1,...t),i._children=o,function e(t,i){for(const n of t)n.parent=i,e(n.children,n)}(t,i)}get children(){return this._children}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof u)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}t.Marker=n;class o extends n{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new o(this.value)}}t.Text=o;class s extends n{}
t.TransformableMarker=s;class r extends s{constructor(e){super(),this.index=e}static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop?-1:e.indext.index?1:0}get isFinalTabstop(){return 0===this.index}get choice(){return 1===this._children.length&&this._children[0]instanceof a?this._children[0]:void 0}clone(){let e=new r(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(e=>e.clone()),e}}t.Placeholder=r;class a extends n{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof o&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){let e=new a;return this.options.forEach(e.appendChild,e),e}}t.Choice=a;class l extends n{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,(function(){return i=!0,
t._replace(Array.prototype.slice.call(arguments,0,-2))}));return!i&&this._children.some(e=>e instanceof d&&Boolean(e.elseValue))&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof d){let n=e[i.index]||"";t+=n=i.resolve(n)}else t+=i.toString();return t}toString(){return""}clone(){let e=new l;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(e=>e.clone()),e}}t.Transform=l;class d extends n{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return"upcase"===this.shorthandName?e?e.toLocaleUpperCase():"":"downcase"===this.shorthandName?e?e.toLocaleLowerCase():"":"capitalize"===this.shorthandName?e?e[0].toLocaleUpperCase()+e.substr(1):"":"pascalcase"===this.shorthandName?e?this._toPascalCase(e):"":Boolean(e)&&"string"==typeof this.ifValue?this.ifValue:Boolean(e)||"string"!=typeof this.elseValue?e||"":this.elseValue}_toPascalCase(e){
const t=e.match(/[a-z]+/gi);return t?t.map((function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})).join(""):e}clone(){return new d(this.index,this.shorthandName,this.ifValue,this.elseValue)}}t.FormatString=d;class c extends s{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),void 0!==t&&(this._children=[new o(t)],!0)}clone(){const e=new c(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(e=>e.clone()),e}}function h(e,t){const i=[...e];for(;i.length>0;){const e=i.shift();if(!t(e))break;i.unshift(...e.children)}}t.Variable=c;class u extends n{get placeholderInfo(){if(!this._placeholders){let e,t=[];this.walk((function(i){return i instanceof r&&(t.push(i),e=!e||e.indexn===e?(i=!0,
!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return h([e],e=>(t+=e.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:i}=e;for(;i;)i instanceof r&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof c&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){let e=new u;return this._children=this.children.map(e=>e.clone()),e}walk(e){h(this.children,e)}}t.TextmateSnippet=u;t.SnippetParser=class{constructor(){this._scanner=new i,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){this._scanner.text(e),this._token=this._scanner.next();const n=new u;for(;this._parse(n););const o=new Map,s=[];let a=0;n.walk(e=>(e instanceof r&&(a+=1,
e.isFinalTabstop?o.set(0,void 0):!o.has(e.index)&&e.children.length>0?o.set(e.index,e.children):s.push(e)),!0));for(const e of s){const t=o.get(e.index);if(t){const i=new r(e.index);i.transform=e.transform;for(const e of t)i.appendChild(e.clone());n.replace(e,[i])}}return i||(i=a>0&&t),!o.has(0)&&i&&n.appendChild(new r(0)),n}_accept(e,t){if(void 0===e||this._token.type===e){let e=!t||this._scanner.tokenText(this._token);return this._token=this._scanner.next(),e}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(14===this._token.type)return!1;if(5===this._token.type){const e=this._scanner.next();if(0!==e.type&&4!==e.type&&5!==e.type)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){
return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return!!(t=this._accept(5,!0))&&(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new o(t)),!0)}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new r(Number(t)):new c(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const n=new r(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new o("${"+t+":")),n.children.forEach(e.appendChild,e),!0}else{if(!(n.index>0&&this._accept(7)))return this._accept(6)?this._parseTransform(n)?(e.appendChild(n),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(n),!0):this._backTo(i);{
const t=new a;for(;;){if(this._parseChoiceElement(t)){if(this._accept(2))continue;if(this._accept(7)&&(n.appendChild(t),this._accept(4)))return e.appendChild(n),!0}return this._backTo(i),!1}}}}_parseChoiceElement(e){const t=this._token,i=[];for(;2!==this._token.type&&7!==this._token.type;){let e;if(!(e=(e=this._accept(5,!0))?this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||e:this._accept(void 0,!0)))return this._backTo(t),!1;i.push(e)}return 0===i.length?(this._backTo(t),!1):(e.appendChild(new o(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const n=new c(t);if(!this._accept(1))return this._accept(6)?this._parseTransform(n)?(e.appendChild(n),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(n),!0):this._backTo(i);for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new o("${"+t+":")),n.children.forEach(e.appendChild,e),!0}}_parseTransform(e){
let t=new l,i="",n="";for(;!this._accept(6);){let e;if(e=this._accept(5,!0))i+=e=this._accept(6,!0)||e;else{if(14===this._token.type)return!1;i+=this._accept(void 0,!0)}}for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(5,!0)||this._accept(6,!0)||e,t.appendChild(new o(e));else if(!this._parseFormatString(t)&&!this._parseAnything(t))return!1}for(;!this._accept(4);){if(14===this._token.type)return!1;n+=this._accept(void 0,!0)}try{t.regexp=new RegExp(i,n)}catch(e){return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);let n=this._accept(8,!0);if(!n)return this._backTo(t),!1;if(!i)return e.appendChild(new d(Number(n))),!0;if(this._accept(4))return e.appendChild(new d(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1;if(this._accept(6)){let i=this._accept(9,!0);return i&&this._accept(4)?(e.appendChild(new d(Number(n),i)),!0):(this._backTo(t),!1)}if(this._accept(11)){let t=this._until(4)
;if(t)return e.appendChild(new d(Number(n),void 0,t,void 0)),!0}else if(this._accept(12)){let t=this._until(4);if(t)return e.appendChild(new d(Number(n),void 0,void 0,t)),!0}else if(this._accept(13)){let t=this._until(1);if(t){let i=this._until(4);if(i)return e.appendChild(new d(Number(n),void 0,t,i)),!0}}else{let t=this._until(4);if(t)return e.appendChild(new d(Number(n),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return 14!==this._token.type&&(e.appendChild(new o(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}}})),define(t[402],i([0,1,64,8]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompletionModel=t.LineContext=void 0;t.LineContext=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};class o{constructor(e,t,i,n,s,r,a){this.clipboardText=a,this._snippetCompareFn=o._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=n,this._options=s,this._refilterKind=1,this._lineContext=i,
"top"===r?this._snippetCompareFn=o._compareCompletionItemsSnippetsUp:"bottom"===r&&(this._snippetCompareFn=o._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){this._lineContext.leadingLineContent===e.leadingLineContent&&this._lineContext.characterCountDelta===e.characterCountDelta||(this._refilterKind=this._lineContext.characterCountDelta2e3?i.fuzzyScore:i.fuzzyScoreGracefulAggressive;for(let d=0;d=u)c.score=i.FuzzyScore.Default;else if("string"==typeof c.completion.filterText){let r=l(o,s,e,c.completion.filterText,c.filterTextLow,0,!1);if(!r)continue
;0===n.compareIgnoreCase(c.completion.filterText,t)?c.score=r:(c.score=i.anyScore(o,s,e,t,c.labelLow,0),c.score[0]=r[0])}else{let i=l(o,s,e,t,c.labelLow,0,!1);if(!i)continue;c.score=i}}switch(c.idx=d,c.distance=this._wordDistance.distance(c.position,c.completion),a.push(c),this._stats.suggestionCount++,c.completion.kind){case 27:this._stats.snippetCount++;break;case 18:this._stats.textCount++}}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=0}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]t.distance?1:e.idxt.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return 1;if(27===t.completion.kind)return-1}return o._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return-1;if(27===t.completion.kind)return 1}
return o._compareCompletionItems(e,t)}}t.CompletionModel=o})),define(t[403],i([0,1,19,2,87]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommitCharacterController=void 0;t.CommitCharacterController=class{constructor(e,t,i){this._disposables=new n.DisposableStore,this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(n=>{if(this._active&&!t.isFrozen()){const t=n.charCodeAt(n.length-1);this._active.acceptCharacters.has(t)&&e.getOption(0)&&i(this._active.item)}}))}_onItem(e){if(!e||!i.isNonEmptyArray(e.item.completion.commitCharacters))return void this.reset();if(this._active&&this._active.item.item===e.item)return;const t=new o.CharacterSet;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){
this._disposables.dispose()}}})),define(t[404],i([0,1,2]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OvertypingCapturer=void 0;class n{constructor(e,t){this._disposables=new i.DisposableStore,this._lastOvertyped=[],this._empty=!0,this._disposables.add(e.onWillType(()=>{if(!this._empty)return;if(!e.hasModel())return;const t=e.getSelections(),i=t.length;let o=!1;for(let e=0;en._maxSelectionLength)return;this._lastOvertyped[e]={value:s.getValueInRange(i),multiline:i.startLineNumber!==i.endLineNumber}}this._empty=!1})),this._disposables.add(t.onDidCancel(e=>{this._empty||(this._empty=!0)}))}getLastOvertypedInfo(e){if(!this._empty&&e>=0&&e=0?r[c]:r[Math.max(0,~c-1)],u=l.length;for(const e of l){if(!n.Range.containsRange(e.range,h))break;u-=1}return u}}}))}}
t.WordDistance=s,s.None=new class extends s{distance(){return 0}}})),define(t[224],i([0,1]),(function(e,t){"use strict";function i(e){return Array.isArray(e)}function n(e){return"string"==typeof e}function o(e){return!e}function s(e,t){return e.ignoreCase&&t?t.toLowerCase():t}Object.defineProperty(t,"__esModule",{value:!0}),t.stateExists=t.findRules=t.substituteMatches=t.createError=t.log=t.sanitize=t.fixCase=t.empty=t.isIAction=t.isString=t.isFuzzyAction=t.isFuzzyActionArr=void 0,t.isFuzzyActionArr=i,t.isFuzzyAction=function(e){return!i(e)},t.isString=n,t.isIAction=function(e){return!n(e)},t.empty=o,t.fixCase=s,t.sanitize=function(e){return e.replace(/[&<>'"_]/g,"-")},t.log=function(e,t){console.log(`${e.languageId}: ${t}`)},t.createError=function(e,t){return new Error(`${e.languageId}: ${t}`)},t.substituteMatches=function(e,t,i,n,r){let a=null;return t.replace(/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g,(function(t,l,d,c,h,u,g,p,m){
return o(d)?o(c)?!o(h)&&h0;){const t=e.tokenizer[i];if(t)return t;const n=i.lastIndexOf(".");i=n<0?null:i.substr(0,n)}return null},t.stateExists=function(e,t){let i=t;for(;i&&i.length>0;){if(e.stateNames[i])return!0;const t=i.lastIndexOf(".");i=t<0?null:i.substr(0,t)}return!1}})),define(t[406],i([0,1,224]),(function(e,t,i){"use strict";function n(e,t){return"boolean"==typeof e?e:t}function o(e,t){return"string"==typeof e?e:t}function s(e,t=!1){t&&(e=e.map((function(e){return e.toLowerCase()})));const i=function(e){const t={};for(const i of e)t[i]=!0;return t}(e);return t?function(e){return void 0!==i[e.toLowerCase()]&&i.hasOwnProperty(e.toLowerCase())}:function(e){return void 0!==i[e]&&i.hasOwnProperty(e)}}function r(e,t){let n=0;for(;t.indexOf("@")>=0&&n<5;)n++,t=t.replace(/@(\w+)/g,(function(n,o){let s=""
;if("string"==typeof e[o])s=e[o];else{if(!(e[o]&&e[o]instanceof RegExp))throw void 0===e[o]?i.createError(e,"language definition does not contain attribute '"+o+"', used at: "+t):i.createError(e,"attribute reference '"+o+"' must be a string, used at: "+t);s=e[o].source}return i.empty(s)?"":"(?:"+s+")"}));let o=(e.ignoreCase?"i":"")+(e.unicode?"u":"");return new RegExp(t,o)}function a(e,t,n,o){let a=-1,l=n,d=n.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);d&&(d[3]&&(a=parseInt(d[3]),d[2]&&(a+=100)),l=d[4]);let c,h="~",u=l;if(l&&0!==l.length?/^\w*$/.test(u)?h="==":(d=l.match(/^(@|!@|~|!~|==|!=)(.*)$/))&&(h=d[1],u=d[2]):(h="!=",u=""),"~"!==h&&"!~"!==h||!/^(\w|\|)*$/.test(u))if("@"===h||"!@"===h){let n=e[u];if(!n)throw i.createError(e,"the @ match target '"+u+"' is not defined, in rule: "+t);if(!function(e,t){if(!t)return!1;if(!Array.isArray(t))return!1;for(const i of t)if(!e(i))return!1;return!0}((function(e){return"string"==typeof e
}),n))throw i.createError(e,"the @ match target '"+u+"' must be an array of strings, in rule: "+t);let o=s(n,e.ignoreCase);c=function(e){return"@"===h?o(e):!o(e)}}else if("~"===h||"!~"===h)if(u.indexOf("$")<0){let t=r(e,"^"+u+"$");c=function(e){return"~"===h?t.test(e):!t.test(e)}}else c=function(t,n,o,s){return r(e,"^"+i.substituteMatches(e,u,n,o,s)+"$").test(t)};else if(u.indexOf("$")<0){let t=i.fixCase(e,u);c=function(e){return"=="===h?e===t:e!==t}}else{let t=i.fixCase(e,u);c=function(n,o,s,r,a){let l=i.substituteMatches(e,t,o,s,r);return"=="===h?n===l:n!==l}}else{let t=s(u.split("|"),e.ignoreCase);c=function(e){return"~"===h?t(e):!t(e)}}return-1===a?{name:n,value:o,test:function(e,t,i,n){return c(e,e,t,i,n)}}:{name:n,value:o,test:function(e,t,i,n){let o=function(e,t,i,n){if(n<0)return e;if(n=100){n-=100;let e=i.split(".");if(e.unshift(i),n0&&"^"===n[0],this.name=this.name+": "+n,this.regex=r(e,"^(?:"+(this.matchOnlyAtLineStart?n.substr(1):n)+")")}setAction(e,t){this.action=function e(t,n,o){if(o){if("string"==typeof o)return o;if(o.token||""===o.token){if("string"!=typeof o.token)throw i.createError(t,"a 'token' attribute must be of type string, in rule: "+n);{let e={token:o.token};if(o.token.indexOf("$")>=0&&(e.tokenSubst=!0),"string"==typeof o.bracket)if("@open"===o.bracket)e.bracket=1;else{if("@close"!==o.bracket)throw i.createError(t,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+n);e.bracket=-1}if(o.next){
if("string"!=typeof o.next)throw i.createError(t,"the next state must be a string value in rule: "+n);{let s=o.next;if(!/^(@pop|@push|@popall)$/.test(s)&&("@"===s[0]&&(s=s.substr(1)),s.indexOf("$")<0&&!i.stateExists(t,i.substituteMatches(t,s,"",[],""))))throw i.createError(t,"the next state '"+o.next+"' is not defined in rule: "+n);e.next=s}}return"number"==typeof o.goBack&&(e.goBack=o.goBack),"string"==typeof o.switchTo&&(e.switchTo=o.switchTo),"string"==typeof o.log&&(e.log=o.log),"string"==typeof o.nextEmbedded&&(e.nextEmbedded=o.nextEmbedded,t.usesEmbedded=!0),e}}if(Array.isArray(o)){let i=[];for(let s=0,r=o.length;s=1&&c.length<=3)if(t.setRegex(r,c[0]),
c.length>=3)if("string"==typeof c[1])t.setAction(r,{token:c[1],next:c[2]});else{if("object"!=typeof c[1])throw i.createError(s,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+e);{const e=c[1];e.next=c[2],t.setAction(r,e)}}else t.setAction(r,c[1]);else{if(!c.regex)throw i.createError(s,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+e);c.name&&"string"==typeof c.name&&(t.name=c.name),c.matchOnlyAtStart&&(t.matchOnlyAtLineStart=n(c.matchOnlyAtLineStart,!1)),t.setRegex(r,c.regex),t.setAction(r,c.action)}o.push(t)}}}if(r.languageId=e,r.ignoreCase=s.ignoreCase,r.unicode=s.unicode,r.noThrow=s.noThrow,r.usesEmbedded=s.usesEmbedded,r.stateNames=t.tokenizer,r.defaultToken=s.defaultToken,!t.tokenizer||"object"!=typeof t.tokenizer)throw i.createError(s,"a language definition must define the 'tokenizer' attribute as an object");s.tokenizer=[];for(let e in t.tokenizer)if(t.tokenizer.hasOwnProperty(e)){
s.start||(s.start=e);const i=t.tokenizer[e];s.tokenizer[e]=new Array,a("tokenizer."+e,s.tokenizer[e],i)}if(s.usesEmbedded=r.usesEmbedded,t.brackets){if(!Array.isArray(t.brackets))throw i.createError(s,"the 'brackets' attribute must be defined as an array")}else t.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];let d=[];for(let e of t.brackets){let t=e;if(t&&Array.isArray(t)&&3===t.length&&(t={token:t[2],open:t[0],close:t[1]}),t.open===t.close)throw i.createError(s,"open and close brackets in a 'brackets' attribute must be different: "+t.open+"\n hint: use the 'bracket' attribute if matching on equal brackets is required.");if("string"!=typeof t.open||"string"!=typeof t.token||"string"!=typeof t.close)throw i.createError(s,"every element in the 'brackets' array must be a '{open,close,token}' object or array");d.push({token:t.token+s.tokenPostfix,
open:i.fixCase(s,t.open),close:i.fixCase(s,t.close)})}return s.brackets=d,s.noThrow=!0,s}})),define(t[407],i([5,6]),(function(e,t){return e.create("vs/base/browser/ui/actionbar/actionViewItems",t)})),define(t[91],i([0,1,16,407,2,47,7,23,58,143,36,196]),(function(e,t,i,n,o,s,r,a,l,d,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionViewItem=t.BaseActionViewItem=void 0;class h extends o.Disposable{constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof s.Action&&this._register(t.onDidChange(e=>{this.element&&this.handleActionChangeEvent(e)}))}handleActionChangeEvent(e){void 0!==e.enabled&&this.updateEnabled(),void 0!==e.checked&&this.updateChecked(),void 0!==e.class&&this.updateClass(),void 0!==e.label&&(this.updateLabel(),this.updateTooltip()),void 0!==e.tooltip&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new s.ActionRunner)),this._actionRunner}set actionRunner(e){this._actionRunner=e}
getAction(){return this._action}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(l.Gesture.addTarget(e));const n=this.options&&this.options.draggable;n&&(e.draggable=!0,c.isFirefox&&this._register(r.addDisposableListener(e,r.EventType.DRAG_START,e=>{var t;return null===(t=e.dataTransfer)||void 0===t?void 0:t.setData(d.DataTransfers.TEXT,this._action.label)}))),this._register(r.addDisposableListener(t,l.EventType.Tap,e=>this.onClick(e))),this._register(r.addDisposableListener(t,r.EventType.MOUSE_DOWN,e=>{n||r.EventHelper.stop(e,!0),this._action.enabled&&0===e.button&&r.addClass(t,"active")})),i.isMacintosh&&this._register(r.addDisposableListener(t,r.EventType.CONTEXT_MENU,e=>{0===e.button&&!0===e.ctrlKey&&this.onClick(e)})),this._register(r.addDisposableListener(t,r.EventType.CLICK,e=>{r.EventHelper.stop(e,!0),this.options&&this.options.isMenu||i.setImmediate(()=>this.onClick(e))})),
this._register(r.addDisposableListener(t,r.EventType.DBLCLICK,e=>{r.EventHelper.stop(e,!0)})),[r.EventType.MOUSE_UP,r.EventType.MOUSE_OUT].forEach(e=>{this._register(r.addDisposableListener(t,e,e=>{r.EventHelper.stop(e),r.removeClass(t,"active")}))})}onClick(e){var t;r.EventHelper.stop(e,!0);const i=a.isUndefinedOrNull(this._context)?(null===(t=this.options)||void 0===t?void 0:t.useEventAsContext)?e:void 0:this._context;this.actionRunner.run(this._action,i)}focus(){this.element&&(this.element.focus(),r.addClass(this.element,"focused"))}blur(){this.element&&(this.element.blur(),r.removeClass(this.element,"focused"))}updateEnabled(){}updateLabel(){}updateTooltip(){}updateClass(){}updateChecked(){}dispose(){this.element&&(r.removeNode(this.element),this.element=void 0),super.dispose()}}t.BaseActionViewItem=h;t.ActionViewItem=class extends h{constructor(e,t,i={}){super(e,t,i),this.options=i,this.options.icon=void 0!==i.icon&&i.icon,this.options.label=void 0===i.label||i.label,this.cssClass=""}render(e){
super.render(e),this.element&&(this.label=r.append(this.element,r.$("a.action-label"))),this.label&&(this._action.id===s.Separator.ID?this.label.setAttribute("role","presentation"):this.options.isMenu?this.label.setAttribute("role","menuitem"):this.label.setAttribute("role","button")),this.options.label&&this.options.keybinding&&this.element&&(r.append(this.element,r.$("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}focus(){super.focus(),this.label&&this.label.focus()}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.getAction().label)}updateTooltip(){let e=null;this.getAction().tooltip?e=this.getAction().tooltip:!this.options.label&&this.getAction().label&&this.options.icon&&(e=this.getAction().label,this.options.keybinding&&(e=n.localize(0,null,e,this.options.keybinding))),e&&this.label&&(this.label.title=e)}updateClass(){
this.cssClass&&this.label&&r.removeClasses(this.label,this.cssClass),this.options.icon?(this.cssClass=this.getAction().class,this.label&&(r.addClass(this.label,"codicon"),this.cssClass&&r.addClasses(this.label,this.cssClass)),this.updateEnabled()):this.label&&r.removeClass(this.label,"codicon")}updateEnabled(){this.getAction().enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),r.removeClass(this.label,"disabled"),this.label.tabIndex=0),this.element&&r.removeClass(this.element,"disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),r.addClass(this.label,"disabled"),r.removeTabIndexAndUpdateFocus(this.label)),this.element&&r.addClass(this.element,"disabled"))}updateChecked(){this.label&&(this.getAction().checked?r.addClass(this.label,"checked"):r.removeClass(this.label,"checked"))}}})),define(t[79],i([0,1,2,47,7,23,53,4,91,196]),(function(e,t,i,n,o,s,r,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionBar=void 0;class d extends i.Disposable{
constructor(e,t={}){var i,s,l;let d,c;switch(super(),this._onDidBlur=this._register(new a.Emitter),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new a.Emitter),this.onDidCancel=this._onDidCancel.event,this._onDidRun=this._register(new a.Emitter),this.onDidRun=this._onDidRun.event,this._onDidBeforeRun=this._register(new a.Emitter),this.onDidBeforeRun=this._onDidBeforeRun.event,this.options=t,this._context=null!==(i=t.context)&&void 0!==i?i:null,this._orientation=null!==(s=this.options.orientation)&&void 0!==s?s:0,this._triggerKeys=null!==(l=this.options.triggerKeys)&&void 0!==l?l:{keys:[3,10],keyDown:!1},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new n.ActionRunner,this._register(this._actionRunner)),this._register(this._actionRunner.onDidRun(e=>this._onDidRun.fire(e))),this._register(this._actionRunner.onDidBeforeRun(e=>this._onDidBeforeRun.fire(e))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),
this.domNode.className="monaco-action-bar",!1!==t.animated&&o.addClass(this.domNode,"animated"),this._orientation){case 0:d=15,c=17;break;case 1:d=17,c=15,this.domNode.className+=" reverse";break;case 2:d=16,c=18,this.domNode.className+=" vertical";break;case 3:d=18,c=16,this.domNode.className+=" vertical reverse"}this._register(o.addDisposableListener(this.domNode,o.EventType.KEY_DOWN,e=>{const t=new r.StandardKeyboardEvent(e);let i=!0;t.equals(d)?i=this.focusPrevious():t.equals(c)?i=this.focusNext():t.equals(9)?this._onDidCancel.fire():this.isTriggerKeyEvent(t)?this._triggerKeys.keyDown&&this.doTrigger(t):i=!1,i&&(t.preventDefault(),t.stopPropagation())})),this._register(o.addDisposableListener(this.domNode,o.EventType.KEY_UP,e=>{const t=new r.StandardKeyboardEvent(e);this.isTriggerKeyEvent(t)?(this._triggerKeys.keyDown||this.doTrigger(t),t.preventDefault(),t.stopPropagation()):(t.equals(2)||t.equals(1026))&&this.updateFocusedItem()})),this.focusTracker=this._register(o.trackFocus(this.domNode)),
this._register(this.focusTracker.onDidBlur(()=>{o.getActiveElement()!==this.domNode&&o.isAncestor(o.getActiveElement(),this.domNode)||(this._onDidBlur.fire(),this.focusedItem=void 0)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.actionsList.setAttribute("role","toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){for(let e=0;et.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){
e&&(this._actionRunner=e,this.viewItems.forEach(t=>t.actionRunner=e))}getContainer(){return this.domNode}push(e,t={}){const i=Array.isArray(e)?e:[e];let n=s.isNumber(t.index)?t.index:null;i.forEach(e=>{const i=document.createElement("li");let s;i.className="action-item",i.setAttribute("role","presentation"),this.options.allowContextMenu||this._register(o.addDisposableListener(i,o.EventType.CONTEXT_MENU,e=>{o.EventHelper.stop(e,!0)})),this.options.actionViewItemProvider&&(s=this.options.actionViewItemProvider(e)),s||(s=new l.ActionViewItem(this.context,e,t)),s.actionRunner=this._actionRunner,s.setActionContext(this.context),s.render(i),null===n||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(i),this.viewItems.push(s)):(this.actionsList.insertBefore(i,this.actionsList.children[n]),this.viewItems.splice(n,0,s),n++)}),this.focusedItem&&this.focus(this.focusedItem)}clear(){i.dispose(this.viewItems),this.viewItems=[],o.clearNode(this.actionsList)}focus(e){let t=!1,i=void 0
;void 0===e?t=!0:"number"==typeof e?i=e:"boolean"==typeof e&&(t=e),t&&void 0===this.focusedItem?(this.focusedItem=-1,this.focusNext()):(void 0!==i&&(this.focusedItem=i),this.updateFocus())}focusNext(){void 0===this.focusedItem&&(this.focusedItem=this.viewItems.length-1);const e=this.focusedItem;let t;do{if(this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=e,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,t=this.viewItems[this.focusedItem]}while(this.focusedItem!==e&&!t.isEnabled());return this.focusedItem!==e||t.isEnabled()||(this.focusedItem=void 0),this.updateFocus(),!0}focusPrevious(){void 0===this.focusedItem&&(this.focusedItem=0);const e=this.focusedItem;let t;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(this.options.preventLoopNavigation)return this.focusedItem=e,!1;this.focusedItem=this.viewItems.length-1}t=this.viewItems[this.focusedItem]}while(this.focusedItem!==e&&!t.isEnabled())
;return this.focusedItem!==e||t.isEnabled()||(this.focusedItem=void 0),this.updateFocus(!0),!0}updateFocus(e,t){void 0===this.focusedItem&&this.actionsList.focus({preventScroll:t});for(let i=0;i{this.element=i.append(e,i.$("a.action-label"));const t=this.options.classNames?r.asArray(this.options.classNames):[];return t.find(e=>"icon"===e)||t.push("codicon"),i.addClasses(this.element,...t),this.element.tabIndex=0,this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this.element.title=this._action.label||"",null},menuAsChild:this.options.menuAsChild};if(Array.isArray(this.menuActionsOrProvider)?t.actions=this.menuActionsOrProvider:t.actionProvider=this.menuActionsOrProvider,this.dropdownMenu=this._register(new s.DropdownMenu(e,t)),this._register(this.dropdownMenu.onDidChangeVisibility(e=>{var t
;null===(t=this.element)||void 0===t||t.setAttribute("aria-expanded",`${e}`),this._onDidChangeVisibility.fire(e)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const e=this;this.dropdownMenu.menuOptions=Object.assign(Object.assign({},this.dropdownMenu.menuOptions),{get anchorAlignment(){return e.options.anchorAlignmentProvider()}})}}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}}t.DropdownMenuActionViewItem=a})),define(t[409],i([5,6]),(function(e,t){return e.create("vs/base/browser/ui/findinput/findInput",t)})),define(t[410],i([5,6]),(function(e,t){return e.create("vs/base/browser/ui/findinput/findInputCheckboxes",t)})),define(t[225],i([0,1,152,410,26]),(function(e,t,i,n,o){"use strict"
;Object.defineProperty(t,"__esModule",{value:!0}),t.RegexCheckbox=t.WholeWordsCheckbox=t.CaseSensitiveCheckbox=void 0;const s=n.localize(0,null),r=n.localize(1,null),a=n.localize(2,null);class l extends i.Checkbox{constructor(e){super({icon:o.Codicon.caseSensitive,title:s+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}t.CaseSensitiveCheckbox=l;class d extends i.Checkbox{constructor(e){super({icon:o.Codicon.wholeWord,title:r+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}t.WholeWordsCheckbox=d;class c extends i.Checkbox{constructor(e){super({icon:o.Codicon.regex,title:a+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,
inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}t.RegexCheckbox=c})),define(t[411],i([5,6]),(function(e,t){return e.create("vs/base/browser/ui/findinput/replaceInput",t)})),define(t[412],i([5,6]),(function(e,t){return e.create("vs/base/browser/ui/inputbox/inputBox",t)})),define(t[167],i([0,1,412,7,148,48,79,4,54,29,37,270,65,57,294]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HistoryInputBox=t.InputBox=void 0;const p=n.$,m={inputBackground:d.Color.fromHex("#3C3C3C"),inputForeground:d.Color.fromHex("#CCCCCC"),inputValidationInfoBorder:d.Color.fromHex("#55AAFF"),inputValidationInfoBackground:d.Color.fromHex("#063B49"),inputValidationWarningBorder:d.Color.fromHex("#B89500"),inputValidationWarningBackground:d.Color.fromHex("#352A05"),inputValidationErrorBorder:d.Color.fromHex("#BE1100"),inputValidationErrorBackground:d.Color.fromHex("#5A1D1D")};class f extends l.Widget{
constructor(e,t,i){super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new a.Emitter),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new a.Emitter),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i||Object.create(null),c.mixin(this.options,m,!1),this.message=null,this.placeholder=this.options.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.inputBackground=this.options.inputBackground,this.inputForeground=this.options.inputForeground,this.inputBorder=this.options.inputBorder,this.inputValidationInfoBorder=this.options.inputValidationInfoBorder,this.inputValidationInfoBackground=this.options.inputValidationInfoBackground,this.inputValidationInfoForeground=this.options.inputValidationInfoForeground,this.inputValidationWarningBorder=this.options.inputValidationWarningBorder,this.inputValidationWarningBackground=this.options.inputValidationWarningBackground,
this.inputValidationWarningForeground=this.options.inputValidationWarningForeground,this.inputValidationErrorBorder=this.options.inputValidationErrorBorder,this.inputValidationErrorBackground=this.options.inputValidationErrorBackground,this.inputValidationErrorForeground=this.options.inputValidationErrorForeground,this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=n.append(e,p(".monaco-inputbox.idle"));let o=this.options.flexibleHeight?"textarea":"input",s=n.append(this.element,p(".wrapper"));if(this.input=n.append(s,p(o+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){
this.maxHeight="number"==typeof this.options.flexibleMaxHeight?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=n.append(s,p("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new u.ScrollableElement(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),n.append(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(e=>this.input.scrollTop=e.scrollTop));const t=a.Event.filter(g.domEvent(document,"selectionchange"),()=>{const e=document.getSelection();return(null==e?void 0:e.anchorNode)===s});this._register(t(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),
this.placeholder&&this.setPlaceHolder(this.placeholder),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this.ignoreGesture(this.input),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new r.ActionBar(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage()}onFocus(){this._showMessage()}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e),this.input.title=e}setAriaLabel(e){this.ariaLabel=e,e?this.input.setAttribute("aria-label",this.ariaLabel):this.input.removeAttribute("aria-label")}getAriaLabel(){return this.ariaLabel}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return"number"==typeof this.cachedHeight?this.cachedHeight:n.getTotalHeight(this.element)}focus(){
this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===this.input}select(e=null){this.input.select(),e&&this.input.setSelectionRange(e.start,e.end)}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}get width(){return n.getTotalWidth(this.input)}set width(e){if(this.options.flexibleHeight&&this.options.flexibleWidth){let t=0;if(this.mirror){t=(parseFloat(this.mirror.style.paddingLeft||"")||0)+(parseFloat(this.mirror.style.paddingRight||"")||0)}this.input.style.width=e-t+"px"}else this.input.style.width=e+"px";this.mirror&&(this.mirror.style.width=e+"px")}set paddingRight(e){this.options.flexibleHeight&&this.options.flexibleWidth?this.input.style.width=`calc(100% - ${e}px)`:this.input.style.paddingRight=e+"px",this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){
if("number"!=typeof this.cachedContentHeight||"number"!=typeof this.cachedHeight||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=i.border?`1px solid ${i.border}`:"",(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null
;return this.validation&&((e=this.validation(this.value))?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),!e}stylesForType(e){switch(e){case 1:return{border:this.inputValidationInfoBorder,background:this.inputValidationInfoBackground,foreground:this.inputValidationInfoForeground};case 2:return{border:this.inputValidationWarningBorder,background:this.inputValidationWarningBackground,foreground:this.inputValidationWarningForeground};default:return{border:this.inputValidationErrorBorder,background:this.inputValidationErrorBackground,foreground:this.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e,t,r=()=>e.style.width=n.getTotalWidth(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,
anchorAlignment:1,render:t=>{if(!this.message)return null;e=n.append(t,p(".monaco-inputbox-container")),r();const i={inline:!0,className:"monaco-inputbox-message"},s=this.message.formatContent?o.renderFormattedText(this.message.content,i):o.renderText(this.message.content,i);s.classList.add(this.classForType(this.message.type));const a=this.stylesForType(this.message.type);return s.style.backgroundColor=a.background?a.background.toString():"",s.style.color=a.foreground?a.foreground.toString():"",s.style.border=a.border?`1px solid ${a.border}`:"",n.append(e,s),null},onHide:()=>{this.state="closed"},layout:r}),t=3===this.message.type?i.localize(0,null,this.message.content):2===this.message.type?i.localize(1,null,this.message.content):i.localize(2,null,this.message.content),s.alert(t),this.state="open"}_hideMessage(){this.contextViewProvider&&("open"===this.state&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),
this.input.classList.toggle("empty",!this.value),"open"===this.state&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,t=10===e.charCodeAt(e.length-1)?" ":"";e+t?this.mirror.textContent=e+t:this.mirror.innerText=" ",this.layout()}style(e){this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,
this.applyStyles()}applyStyles(){const e=this.inputBackground?this.inputBackground.toString():"",t=this.inputForeground?this.inputForeground.toString():"",i=this.inputBorder?this.inputBorder.toString():"";this.element.style.backgroundColor=e,this.element.style.color=t,this.input.style.backgroundColor="inherit",this.input.style.color=t,this.element.style.borderWidth=i?"1px":"",this.element.style.borderStyle=i?"solid":"",this.element.style.borderColor=i}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=n.getTotalHeight(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,n=t.selectionEnd,o=t.value;null!==i&&null!==n&&(this.value=o.substr(0,i)+e+o.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){this._hideMessage(),this.message=null,
this.actionbar&&this.actionbar.dispose(),super.dispose()}}t.InputBox=f;t.HistoryInputBox=class extends f{constructor(e,t,i){super(e,t,i),this.history=new h.HistoryNavigator(i.history,100)}addToHistory(){this.value&&this.value!==this.getCurrentValue()&&this.history.add(this.value)}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),e&&(this.value=e,s.status(this.value))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,s.status(this.value))}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()||this.history.last()}}})),define(t[413],i([0,1,409,7,167,54,4,225,200]),(function(e,t,i,n,o,s,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),
t.FindInput=void 0;const l=i.localize(0,null);class d extends s.Widget{constructor(e,t,i,s){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this._onDidOptionChange=this._register(new r.Emitter),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new r.Emitter),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new r.Emitter),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new r.Emitter),this._onKeyUp=this._register(new r.Emitter),this._onCaseSensitiveKeyDown=this._register(new r.Emitter),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new r.Emitter),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.contextViewProvider=t,this.placeholder=s.placeholder||"",this.validation=s.validation,this.label=s.label||l,this.inputActiveOptionBorder=s.inputActiveOptionBorder,this.inputActiveOptionForeground=s.inputActiveOptionForeground,
this.inputActiveOptionBackground=s.inputActiveOptionBackground,this.inputBackground=s.inputBackground,this.inputForeground=s.inputForeground,this.inputBorder=s.inputBorder,this.inputValidationInfoBorder=s.inputValidationInfoBorder,this.inputValidationInfoBackground=s.inputValidationInfoBackground,this.inputValidationInfoForeground=s.inputValidationInfoForeground,this.inputValidationWarningBorder=s.inputValidationWarningBorder,this.inputValidationWarningBackground=s.inputValidationWarningBackground,this.inputValidationWarningForeground=s.inputValidationWarningForeground,this.inputValidationErrorBorder=s.inputValidationErrorBorder,this.inputValidationErrorBackground=s.inputValidationErrorBackground,this.inputValidationErrorForeground=s.inputValidationErrorForeground;const d=s.appendCaseSensitiveLabel||"",c=s.appendWholeWordsLabel||"",h=s.appendRegexLabel||"",u=s.history||[],g=!!s.flexibleHeight,p=!!s.flexibleWidth,m=s.flexibleMaxHeight;this.domNode=document.createElement("div"),
n.addClass(this.domNode,"monaco-findInput"),this.inputBox=this._register(new o.HistoryInputBox(this.domNode,this.contextViewProvider,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder,history:u,flexibleHeight:g,flexibleWidth:p,flexibleMaxHeight:m})),
this.regex=this._register(new a.RegexCheckbox({appendTitle:h,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.regex.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(e=>{this._onRegexKeyDown.fire(e)})),this.wholeWords=this._register(new a.WholeWordsCheckbox({appendTitle:c,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.wholeWords.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new a.CaseSensitiveCheckbox({appendTitle:d,isChecked:!1,
inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.caseSensitive.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(e=>{this._onCaseSensitiveKeyDown.fire(e)})),this._showOptionButtons&&(this.inputBox.paddingRight=this.caseSensitive.width()+this.wholeWords.width()+this.regex.width());let f=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,e=>{if(e.equals(15)||e.equals(17)||e.equals(9)){let t=f.indexOf(document.activeElement);if(t>=0){let i=-1;e.equals(17)?i=(t+1)%f.length:e.equals(15)&&(i=0===t?f.length-1:t-1),e.equals(9)?f[t].blur():i>=0&&f[i].focus(),n.EventHelper.stop(e,!0)}}});let _=document.createElement("div");_.className="controls",_.style.display=this._showOptionButtons?"block":"none",
_.appendChild(this.caseSensitive.domNode),_.appendChild(this.wholeWords.domNode),_.appendChild(this.regex.domNode),this.domNode.appendChild(_),e&&e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,e=>this._onKeyDown.fire(e)),this.onkeyup(this.inputBox.inputElement,e=>this._onKeyUp.fire(e)),this.oninput(this.inputBox.inputElement,e=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,e=>this._onMouseDown.fire(e))}enable(){n.removeClass(this.domNode,"disabled"),this.inputBox.enable(),this.regex.enable(),this.wholeWords.enable(),this.caseSensitive.enable()}disable(){n.addClass(this.domNode,"disabled"),this.inputBox.disable(),this.regex.disable(),this.wholeWords.disable(),this.caseSensitive.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}style(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,
this.inputActiveOptionForeground=e.inputActiveOptionForeground,this.inputActiveOptionBackground=e.inputActiveOptionBackground,this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()}applyStyles(){if(this.domNode){const e={inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,
inputActiveOptionBackground:this.inputActiveOptionBackground};this.regex.style(e),this.wholeWords.style(e),this.caseSensitive.style(e);const t={inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder};this.inputBox.style(t)}}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){return this.caseSensitive.checked}setCaseSensitive(e){this.caseSensitive.checked=e}
getWholeWords(){return this.wholeWords.checked}setWholeWords(e){this.wholeWords.checked=e}getRegex(){return this.regex.checked}setRegex(e){this.regex.checked=e,this.validate()}focusOnCaseSensitive(){this.caseSensitive.focus()}highlightFindOptions(){n.removeClass(this.domNode,"highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,n.addClass(this.domNode,"highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}clearMessage(){this.inputBox.hideMessage()}}t.FindInput=d})),define(t[414],i([0,1,411,7,167,54,4,152,26,200]),(function(e,t,i,n,o,s,r,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReplaceInput=t.PreserveCaseCheckbox=void 0;const d=i.localize(0,null),c=i.localize(1,null);class h extends a.Checkbox{constructor(e){super({icon:l.Codicon.preserveCase,title:c+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,
inputActiveOptionBackground:e.inputActiveOptionBackground})}}t.PreserveCaseCheckbox=h;class u extends s.Widget{constructor(e,t,i,s){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new r.Emitter),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new r.Emitter),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new r.Emitter),this._onInput=this._register(new r.Emitter),this._onKeyUp=this._register(new r.Emitter),this._onPreserveCaseKeyDown=this._register(new r.Emitter),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=s.placeholder||"",this.validation=s.validation,this.label=s.label||d,this.inputActiveOptionBorder=s.inputActiveOptionBorder,this.inputActiveOptionForeground=s.inputActiveOptionForeground,this.inputActiveOptionBackground=s.inputActiveOptionBackground,this.inputBackground=s.inputBackground,
this.inputForeground=s.inputForeground,this.inputBorder=s.inputBorder,this.inputValidationInfoBorder=s.inputValidationInfoBorder,this.inputValidationInfoBackground=s.inputValidationInfoBackground,this.inputValidationInfoForeground=s.inputValidationInfoForeground,this.inputValidationWarningBorder=s.inputValidationWarningBorder,this.inputValidationWarningBackground=s.inputValidationWarningBackground,this.inputValidationWarningForeground=s.inputValidationWarningForeground,this.inputValidationErrorBorder=s.inputValidationErrorBorder,this.inputValidationErrorBackground=s.inputValidationErrorBackground,this.inputValidationErrorForeground=s.inputValidationErrorForeground;const a=s.history||[],l=!!s.flexibleHeight,c=!!s.flexibleWidth,u=s.flexibleMaxHeight;this.domNode=document.createElement("div"),n.addClass(this.domNode,"monaco-findInput"),this.inputBox=this._register(new o.HistoryInputBox(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{
validation:this.validation},inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder,history:a,flexibleHeight:l,flexibleWidth:c,flexibleMaxHeight:u})),this.preserveCase=this._register(new h({appendTitle:"",isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground
})),this._register(this.preserveCase.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(e=>{this._onPreserveCaseKeyDown.fire(e)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;let g=[this.preserveCase.domNode];this.onkeydown(this.domNode,e=>{if(e.equals(15)||e.equals(17)||e.equals(9)){let t=g.indexOf(document.activeElement);if(t>=0){let i=-1;e.equals(17)?i=(t+1)%g.length:e.equals(15)&&(i=0===t?g.length-1:t-1),e.equals(9)?g[t].blur():i>=0&&g[i].focus(),n.EventHelper.stop(e,!0)}}});let p=document.createElement("div");p.className="controls",p.style.display=this._showOptionButtons?"block":"none",p.appendChild(this.preserveCase.domNode),this.domNode.appendChild(p),e&&e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,e=>this._onKeyDown.fire(e)),this.onkeyup(this.inputBox.inputElement,e=>this._onKeyUp.fire(e)),
this.oninput(this.inputBox.inputElement,e=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,e=>this._onMouseDown.fire(e))}enable(){n.removeClass(this.domNode,"disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){n.addClass(this.domNode,"disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}style(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,this.inputActiveOptionForeground=e.inputActiveOptionForeground,this.inputActiveOptionBackground=e.inputActiveOptionBackground,this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,
this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()}applyStyles(){if(this.domNode){const e={inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground};this.preserveCase.style(e);const t={inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,
inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder};this.inputBox.style(t)}}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){this.inputBox&&this.inputBox.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.inputBox.width=e,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}t.ReplaceInput=u})),define(t[415],i([0,1,7,167,2,53,77,51,119]),(function(e,t,i,n,o,s,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuickInputBox=void 0;const l=i.$;class d extends o.Disposable{constructor(e){super(),this.parent=e,
this.onKeyDown=e=>i.addDisposableListener(this.inputBox.inputElement,i.EventType.KEY_DOWN,t=>{e(new s.StandardKeyboardEvent(t))}),this.onMouseDown=e=>i.addDisposableListener(this.inputBox.inputElement,i.EventType.MOUSE_DOWN,t=>{e(new a.StandardMouseEvent(t))}),this.onDidChange=e=>this.inputBox.onDidChange(e),this.container=i.append(this.parent,l(".quick-input-box")),this.inputBox=this._register(new n.InputBox(this.container,void 0))}get value(){return this.inputBox.value}set value(e){this.inputBox.value=e}select(e=null){this.inputBox.select(e)}isSelectionAtEnd(){return this.inputBox.isSelectionAtEnd()}get placeholder(){return this.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.inputBox.setPlaceHolder(e)}get ariaLabel(){return this.inputBox.getAriaLabel()}set ariaLabel(e){this.inputBox.setAriaLabel(e)}get password(){return"password"===this.inputBox.inputElement.type}set password(e){this.inputBox.inputElement.type=e?"password":"text"}setAttribute(e,t){
this.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===r.default.Ignore?this.inputBox.hideMessage():this.inputBox.showMessage({type:e===r.default.Info?1:e===r.default.Warning?2:3,content:""})}stylesForType(e){return this.inputBox.stylesForType(e===r.default.Info?1:e===r.default.Warning?2:3)}setFocus(){this.inputBox.focus()}layout(){this.inputBox.layout()}style(e){this.inputBox.style(e)}}t.QuickInputBox=d})),define(t[416],i([5,6]),(function(e,t){return e.create("vs/base/browser/ui/keybindingLabel/keybindingLabel",t)})),define(t[417],i([5,6]),(function(e,t){return e.create("vs/base/browser/ui/menu/menu",t)})),define(t[418],i([0,1,417,8,47,79,7,53,15,2,65,197,16,26,91,115,36,51]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m,f,_){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cleanMnemonic=t.Menu=t.Direction=t.MENU_ESCAPED_MNEMONIC_REGEX=t.MENU_MNEMONIC_REGEX=void 0,t.MENU_MNEMONIC_REGEX=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,
t.MENU_ESCAPED_MNEMONIC_REGEX=/(&)?(&)([^\s&])/g;const v=g.registerIcon("menu-selection",g.Codicon.check),C=g.registerIcon("menu-submenu",g.Codicon.chevronRight);var b;!function(e){e[e.Right=0]="Right",e[e.Left=1]="Left"}(b=t.Direction||(t.Direction={}));class S extends s.ActionBar{constructor(e,t,i={}){r.addClass(e,"monaco-menu-container"),e.setAttribute("role","presentation");const n=document.createElement("div");r.addClass(n,"monaco-menu"),n.setAttribute("role","presentation"),super(n,{orientation:2,actionViewItemProvider:e=>this.doGetActionViewItem(e,i,o),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,triggerKeys:{keys:[3,...u.isMacintosh||u.isLinux?[10]:[]],keyDown:!0}}),this.menuElement=n,this.actionsList.setAttribute("role","menu"),this.actionsList.tabIndex=0,this.menuDisposables=this._register(new d.DisposableStore),this.initializeStyleSheet(e),r.addDisposableListener(n,r.EventType.KEY_DOWN,e=>{new a.StandardKeyboardEvent(e).equals(2)&&e.preventDefault()}),
i.enableMnemonics&&this.menuDisposables.add(r.addDisposableListener(n,r.EventType.KEY_DOWN,e=>{const t=e.key.toLocaleLowerCase();if(this.mnemonics.has(t)){r.EventHelper.stop(e,!0);const i=this.mnemonics.get(t);if(1===i.length&&(i[0]instanceof y&&i[0].container&&this.focusItemByElement(i[0].container),i[0].onClick(e)),i.length>1){const e=i.shift();e&&e.container&&(this.focusItemByElement(e.container),i.push(e)),this.mnemonics.set(t,i)}}})),u.isLinux&&this._register(r.addDisposableListener(n,r.EventType.KEY_DOWN,e=>{const t=new a.StandardKeyboardEvent(e);t.equals(14)||t.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),r.EventHelper.stop(e,!0)):(t.equals(13)||t.equals(12))&&(this.focusedItem=0,this.focusPrevious(),r.EventHelper.stop(e,!0))})),this._register(r.addDisposableListener(this.domNode,r.EventType.MOUSE_OUT,e=>{let t=e.relatedTarget;r.isAncestor(t,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),e.stopPropagation())})),
this._register(r.addDisposableListener(this.actionsList,r.EventType.MOUSE_OVER,e=>{let t=e.target;if(t&&r.isAncestor(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(r.hasClass(t,"action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}}));let o={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new c.DomScrollableElement(n,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const s=this.scrollableElement.getDomNode();s.style.position="",this._register(r.addDisposableListener(s,r.EventType.MOUSE_UP,e=>{e.preventDefault()})),n.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter(e=>{var t;return null===(t=i.submenuIds)||void 0===t||!t.has(e.id)||(console.warn(`Found submenu cycle: ${e.id}`),!1)}),this.push(t,{icon:!0,label:!0,isMenu:!0}),
e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(e=>!(e instanceof E)).forEach((e,t,i)=>{e.updatePositionInSet(t+1,i.length)})}initializeStyleSheet(e){r.isInShadowDOM(e)?(this.styleSheet=r.createStyleSheet(e),this.styleSheet.innerHTML=x):(S.globalStyleSheet||(S.globalStyleSheet=r.createStyleSheet(),S.globalStyleSheet.innerHTML=x),this.styleSheet=S.globalStyleSheet)}style(e){const t=this.getContainer(),i=e.foregroundColor?`${e.foregroundColor}`:"",n=e.backgroundColor?`${e.backgroundColor}`:"",o=e.borderColor?`1px solid ${e.borderColor}`:"",s=e.shadowColor?`0 2px 4px ${e.shadowColor}`:"";t.style.border=o,this.domNode.style.color=i,this.domNode.style.backgroundColor=n,t.style.boxShadow=s,this.viewItems&&this.viewItems.forEach(t=>{(t instanceof w||t instanceof E)&&t.style(e)})}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem
;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(r.addDisposableListener(this.element,r.EventType.MOUSE_UP,e=>{if(r.EventHelper.stop(e,!0),f.isFirefox){if(new _.StandardMouseEvent(e).rightButton)return;this.onClick(e)}setTimeout(()=>{this.onClick(e)},0)})),this._register(r.addDisposableListener(this.element,r.EventType.CONTEXT_MENU,e=>{r.EventHelper.stop(e,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,
this.item=r.append(this.element,r.$("a.action-menu-item")),this._action.id===o.Separator.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=r.append(this.item,r.$("span.menu-item-check"+v.cssSelector)),this.check.setAttribute("role","none"),this.label=r.append(this.item,r.$("span.action-label")),this.options.label&&this.options.keybinding&&(r.append(this.item,r.$("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked())}blur(){super.blur(),this.applyStyle()}focus(){super.focus(),this.item&&this.item.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){if(this.label&&this.options.label){r.clearNode(this.label)
;let e=g.stripCodicons(this.getAction().label);if(e){const i=L(e);this.options.enableMnemonics||(e=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const o=t.MENU_MNEMONIC_REGEX.exec(e);if(o){e=n.escape(e),t.MENU_ESCAPED_MNEMONIC_REGEX.lastIndex=0;let i=t.MENU_ESCAPED_MNEMONIC_REGEX.exec(e);for(;i&&i[1];)i=t.MENU_ESCAPED_MNEMONIC_REGEX.exec(e);const s=e=>e.replace(/&&/g,"&");i?this.label.append(n.ltrim(s(e.substr(0,i.index))," "),r.$("u",{"aria-hidden":"true"},i[3]),n.rtrim(s(e.substr(i.index+i[0].length))," ")):this.label.innerText=s(e).trim(),this.item&&this.item.setAttribute("aria-keyshortcuts",(o[1]?o[1]:o[3]).toLocaleLowerCase())}else this.label.innerText=e.replace(/&&/g,"&").trim()}}}updateTooltip(){let e=null;this.getAction().tooltip?e=this.getAction().tooltip:!this.options.label&&this.getAction().label&&this.options.icon&&(e=this.getAction().label,this.options.keybinding&&(e=i.localize(0,null,e,this.options.keybinding))),e&&this.item&&(this.item.title=e)}updateClass(){
this.cssClass&&this.item&&r.removeClasses(this.item,this.cssClass),this.options.icon&&this.label?(this.cssClass=this.getAction().class||"",r.addClass(this.label,"icon"),this.cssClass&&r.addClasses(this.label,this.cssClass),this.updateEnabled()):this.label&&r.removeClass(this.label,"icon")}updateEnabled(){this.getAction().enabled?(this.element&&r.removeClass(this.element,"disabled"),this.item&&(r.removeClass(this.item,"disabled"),this.item.tabIndex=0)):(this.element&&r.addClass(this.element,"disabled"),this.item&&(r.addClass(this.item,"disabled"),r.removeTabIndexAndUpdateFocus(this.item)))}updateChecked(){this.item&&(this.getAction().checked?(r.addClass(this.item,"checked"),this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked","true")):(r.removeClass(this.item,"checked"),this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked","false")))}getMnemonic(){return this.mnemonic}applyStyle(){if(!this.menuStyle)return
;const e=this.element&&r.hasClass(this.element,"focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,n=e&&this.menuStyle.selectionBorderColor?`thin solid ${this.menuStyle.selectionBorderColor}`:"";this.item&&(this.item.style.color=t?t.toString():"",this.item.style.backgroundColor=i?i.toString():""),this.check&&(this.check.style.color=t?t.toString():""),this.container&&(this.container.style.border=n)}style(e){this.menuStyle=e,this.applyStyle()}}class y extends w{constructor(e,t,i,n){super(e,e,n),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new d.DisposableStore),this.mouseOver=!1,this.expandDirection=n&&void 0!==n.expandDirection?n.expandDirection:b.Right,this.showScheduler=new l.RunOnceScheduler(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))
},250),this.hideScheduler=new l.RunOnceScheduler(()=>{this.element&&!r.isAncestor(r.getActiveElement(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(r.addClass(this.item,"monaco-submenu-item"),this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=r.append(this.item,r.$("span.submenu-indicator"+C.cssSelector)),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(r.addDisposableListener(this.element,r.EventType.KEY_UP,e=>{let t=new a.StandardKeyboardEvent(e);(t.equals(17)||t.equals(3))&&(r.EventHelper.stop(e,!0),this.createSubmenu(!0))})),this._register(r.addDisposableListener(this.element,r.EventType.KEY_DOWN,e=>{let t=new a.StandardKeyboardEvent(e);r.getActiveElement()===this.item&&(t.equals(17)||t.equals(3))&&r.EventHelper.stop(e,!0)})),
this._register(r.addDisposableListener(this.element,r.EventType.MOUSE_OVER,e=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(r.addDisposableListener(this.element,r.EventType.MOUSE_LEAVE,e=>{this.mouseOver=!1})),this._register(r.addDisposableListener(this.element,r.EventType.FOCUS_OUT,e=>{this.element&&!r.isAncestor(r.getActiveElement(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!1)})))}onClick(e){r.EventHelper.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch(e){}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,n){const o={top:0,left:0}
;return o.left=h.layout(e.width,t.width,{position:n===b.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left{new a.StandardKeyboardEvent(e).equals(15)&&(r.EventHelper.stop(e,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(r.addDisposableListener(this.submenuContainer,r.EventType.KEY_DOWN,e=>{new a.StandardKeyboardEvent(e).equals(15)&&r.EventHelper.stop(e,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),
this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&(null===(t=this.item)||void 0===t||t.setAttribute("aria-expanded",e))}applyStyle(){if(super.applyStyle(),!this.menuStyle)return;const e=this.element&&r.hasClass(this.element,"focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=e?`${e}`:""),this.parentData.submenu&&this.parentData.submenu.style(this.menuStyle)}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class E extends p.ActionViewItem{style(e){this.label&&(this.label.style.borderBottomColor=e.separatorColor?`${e.separatorColor}`:"")}}function L(e){const i=t.MENU_MNEMONIC_REGEX,n=i.exec(e);if(!n)return e;const o=!n[1];return e.replace(i,o?"$2$3":"").trim()}t.cleanMnemonic=L
;let x=`\n.monaco-menu {\n\tfont-size: 13px;\n\n}\n\n${m.formatRule(v)}\n${m.formatRule(C)}\n\n.monaco-menu .monaco-action-bar {\n\ttext-align: right;\n\toverflow: hidden;\n\twhite-space: nowrap;\n}\n\n.monaco-menu .monaco-action-bar .actions-container {\n\tdisplay: flex;\n\tmargin: 0 auto;\n\tpadding: 0;\n\twidth: 100%;\n\tjustify-content: flex-end;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar.reverse .actions-container {\n\tflex-direction: row-reverse;\n}\n\n.monaco-menu .monaco-action-bar .action-item {\n\tcursor: pointer;\n\tdisplay: inline-block;\n\ttransition: transform 50ms ease;\n\tposition: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled {\n\tcursor: default;\n}\n\n.monaco-menu .monaco-action-bar.animated .action-item.active {\n\ttransform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */\n}\n\n.monaco-menu .monaco-action-bar .action-item .icon,\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar .action-label {\n\tfont-size: 11px;\n\tmargin-right: 4px;\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label,\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {\n\topacity: 0.4;\n}\n\n/* Vertical actions */\n\n.monaco-menu .monaco-action-bar.vertical {\n\ttext-align: left;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tdisplay: block;\n\tborder-bottom: 1px solid #bbb;\n\tpadding-top: 1px;\n\tmargin-left: .8em;\n\tmargin-right: .8em;\n}\n\n.monaco-menu .secondary-actions .monaco-action-bar .action-label {\n\tmargin-left: 6px;\n}\n\n/* Action Items */\n.monaco-menu .monaco-action-bar .action-item.select-container {\n\toverflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n\tflex: 1;\n\tmax-width: 170px;\n\tmin-width: 60px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-right: 10px;\n}\n\n.monaco-menu .monaco-action-bar.vertical {\n\tmargin-left: 0;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tpadding: 0;\n\ttransform: none;\n\tdisplay: flex;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.active {\n\ttransform: none;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\tflex: 1 1 auto;\n\tdisplay: flex;\n\theight: 2em;\n\talign-items: center;\n\tposition: relative;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label {\n\tflex: 1 1 auto;\n\ttext-decoration: none;\n\tpadding: 0 1em;\n\tbackground: none;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .keybinding,\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tdisplay: inline-block;\n\tflex: 2 1 auto;\n\tpadding: 0 1em;\n\ttext-align: right;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {\n\tfont-size: 16px !important;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {\n\tmargin-left: auto;\n\tmargin-right: -20px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {\n\topacity: 0.4;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n\tmargin: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tposition: static;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {\n\tposition: absolute;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tpadding: 0.5em 0 0 0;\n\tmargin-bottom: 0.5em;\n\twidth: 100%;\n\theight: 0px !important;\n\tmargin-left: .8em !important;\n\tmargin-right: .8em !important;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {\n\tpadding: 0.7em 1em 0.1em 1em;\n\tfont-weight: bold;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:hover {\n\tcolor: inherit;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tposition: absolute;\n\tvisibility: hidden;\n\twidth: 1em;\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {\n\tvisibility: visible;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/* Context Menu */\n\n.context-view.monaco-menu-container {\n\toutline: 0;\n\tborder: none;\n\tanimation: fadeIn 0.083s linear;\n}\n\n.context-view.monaco-menu-container :focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {\n\toutline: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tborder: thin solid transparent; /* prevents jumping behaviour on hover or focus */\n}\n\n\n/* High Contrast Theming */\n:host-context(.hc-black) .context-view.monaco-menu-container {\n\tbox-shadow: none;\n}\n\n:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused {\n\tbackground: none;\n}\n\n/* Vertical Action Bar Styles */\n\n.monaco-menu .monaco-action-bar.vertical {\n\tpadding: .5em 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\theight: 1.8em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),\n.monaco-menu .monaco-action-bar.vertical .keybinding {\n\tfont-size: inherit;\n\tpadding: 0 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tfont-size: inherit;\n\twidth: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tfont-size: inherit;\n\tpadding: 0.2em 0 0 0;\n\tmargin-bottom: 0.2em;\n}\n\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tmargin-left: 0;\n\tmargin-right: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tfont-size: 60%;\n\tpadding: 0 1.8em;\n}\n\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n\tmask-size: 10px 10px;\n\t-webkit-mask-size: 10px 10px;\n}\n\n.monaco-menu .action-item {\n\tcursor: default;\n}\n\n/* Arrows */\n.monaco-scrollable-element > .scrollbar > .scra {\n\tcursor: pointer;\n\tfont-size: 11px !important;\n}\n\n.monaco-scrollable-element > .visible {\n\topacity: 1;\n\n\t/* Background rule added for IE9 - to allow clicks on dom node */\n\tbackground:rgba(0,0,0,0);\n\n\ttransition: opacity 100ms linear;\n}\n.monaco-scrollable-element > .invisible {\n\topacity: 0;\n\tpointer-events: none;\n}\n.monaco-scrollable-element > .invisible.fade {\n\ttransition: opacity 800ms linear;\n}\n\n/* Scrollable Content Inset Shadow */\n.monaco-scrollable-element > .shadow {\n\tposition: absolute;\n\tdisplay: none;\n}\n.monaco-scrollable-element > .shadow.top {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 3px;\n\theight: 3px;\n\twidth: 100%;\n\tbox-shadow: #DDD 0 6px 6px -6px inset;\n}\n.monaco-scrollable-element > .shadow.left {\n\tdisplay: block;\n\ttop: 3px;\n\tleft: 0;\n\theight: 100%;\n\twidth: 3px;\n\tbox-shadow: #DDD 6px 0 6px -6px inset;\n}\n.monaco-scrollable-element > .shadow.top-left-corner {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 0;\n\theight: 3px;\n\twidth: 3px;\n}\n.monaco-scrollable-element > .shadow.top.left {\n\tbox-shadow: #DDD 6px 6px 6px -6px inset;\n}\n\n/* ---------- Default Style ---------- */\n\n:host-context(.vs) .monaco-scrollable-element > .scrollbar > .slider {\n\tbackground: rgba(100, 100, 100, .4);\n}\n:host-context(.vs-dark) .monaco-scrollable-element > .scrollbar > .slider {\n\tbackground: rgba(121, 121, 121, .4);\n}\n:host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider {\n\tbackground: rgba(111, 195, 223, .6);\n}\n\n.monaco-scrollable-element > .scrollbar > .slider:hover {\n\tbackground: rgba(100, 100, 100, .7);\n}\n:host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider:hover {\n\tbackground: rgba(111, 195, 223, .8);\n}\n\n.monaco-scrollable-element > .scrollbar > .slider.active {\n\tbackground: rgba(0, 0, 0, .6);\n}\n:host-context(.vs-dark) .monaco-scrollable-element > .scrollbar > .slider.active {\n\tbackground: rgba(191, 191, 191, .4);\n}\n:host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider.active {\n\tbackground: rgba(111, 195, 223, 1);\n}\n\n:host-context(.vs-dark) .monaco-scrollable-element .shadow.top {\n\tbox-shadow: none;\n}\n\n:host-context(.vs-dark) .monaco-scrollable-element .shadow.left {\n\tbox-shadow: #000 6px 0 6px -6px inset;\n}\n\n:host-context(.vs-dark) .monaco-scrollable-element .shadow.top.left {\n\tbox-shadow: #000 6px 6px 6px -6px inset;\n}\n\n:host-context(.hc-black) .monaco-scrollable-element .shadow.top {\n\tbox-shadow: none;\n}\n\n:host-context(.hc-black) .monaco-scrollable-element .shadow.left {\n\tbox-shadow: none;\n}\n\n:host-context(.hc-black) .monaco-scrollable-element .shadow.top.left {\n\tbox-shadow: none;\n}\n`
})),define(t[419],i([5,6]),(function(e,t){return e.create("vs/base/browser/ui/tree/abstractTree",t)})),define(t[168],i([0,1,2,118,7,4,53,95,143,19,154,57,64,145,419,15,16,109,186,192,305]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m,f,_,v,C){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractTree=t.RenderIndentGuides=t.ComposedTreeDelegate=void 0;class b extends c.ElementsDragAndDropData{constructor(e){super(e.elements.map(e=>e.element)),this.data=e}}function S(e){return e instanceof c.ElementsDragAndDropData?new b(e):e}class w{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=i.Disposable.None}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(e=>e.element),t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(S(e),t)}onDragOver(e,t,i,n,o=!0){const s=this.dnd.onDragOver(S(e),t&&t.element,i,n),r=this.autoExpandNode!==t;if(r&&(this.autoExpandDisposable.dispose(),
this.autoExpandNode=t),void 0===t)return s;if(r&&"boolean"!=typeof s&&s.autoExpand&&(this.autoExpandDisposable=m.disposableTimeout(()=>{const e=this.modelProvider(),i=e.getNodeLocation(t);e.isCollapsed(i)&&e.setCollapsed(i,!1),this.autoExpandNode=void 0},500)),"boolean"==typeof s||!s.accept||void 0===s.bubble||s.feedback){if(!o){return{accept:"boolean"==typeof s?s:s.accept,effect:"boolean"==typeof s?void 0:s.effect,feedback:[i]}}return s}if(1===s.bubble){const i=this.modelProvider(),o=i.getNodeLocation(t),s=i.getParentNodeLocation(o),r=i.getNode(s),a=s&&i.getListIndex(s);return this.onDragOver(e,r,a,n,!1)}const a=this.modelProvider(),l=a.getNodeLocation(t),c=a.getListIndex(l),h=a.getListRenderCount(l);return Object.assign(Object.assign({},s),{feedback:d.range(c,c+h)})}drop(e,t,i,n){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(S(e),t&&t.element,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}class y{constructor(e){this.delegate=e}getHeight(e){
return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){this.delegate.setDynamicHeight&&this.delegate.setDynamicHeight(e.element,t)}}var E;t.ComposedTreeDelegate=y,function(e){e.None="none",e.OnHover="onHover",e.Always="always"}(E=t.RenderIndentGuides||(t.RenderIndentGuides={}));class L{constructor(e,t=[]){this._elements=t,this.onDidChange=s.Event.forEach(e,e=>this._elements=e)}get elements(){return this._elements}}class x{constructor(e,t,n,o,r={}){this.renderer=e,this.modelProvider=t,this.activeNodes=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=x.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.renderedIndentGuides=new v.SetMap,this.activeIndentNodes=new Set,this.indentGuidesDisposable=i.Disposable.None,this.disposables=new i.DisposableStore,this.templateId=e.templateId,
this.updateOptions(r),s.Event.map(n,e=>e.node)(this.onDidChangeNodeTwistieState,this,this.disposables),e.onDidChangeTwistieState&&e.onDidChangeTwistieState(this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(void 0!==e.indent&&(this.indent=_.clamp(e.indent,0,40)),void 0!==e.renderIndentGuides){const t=e.renderIndentGuides!==E.None;if(t!==this.shouldRenderIndentGuides&&(this.shouldRenderIndentGuides=t,this.indentGuidesDisposable.dispose(),t)){const e=new i.DisposableStore;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,e),this.indentGuidesDisposable=e,this._onDidChangeActiveNodes(this.activeNodes.elements)}}void 0!==e.hideTwistiesOfChildlessElements&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=o.append(e,o.$(".monaco-tl-row")),n=o.append(t,o.$(".monaco-tl-indent")),s=o.append(t,o.$(".monaco-tl-twistie")),r=o.append(t,o.$(".monaco-tl-contents")),a=this.renderer.renderTemplate(r);return{container:e,indent:n,twistie:s,
indentGuidesDisposable:i.Disposable.None,templateData:a}}renderElement(e,t,i,n){"number"==typeof n&&(this.renderedNodes.set(e,{templateData:i,height:n}),this.renderedElements.set(e.element,e));const o=x.DefaultIndent+(e.depth-1)*this.indent;i.twistie.style.paddingLeft=`${o}px`,i.indent.style.width=`${o+this.indent-16}px`,this.renderTwistie(e,i),"number"==typeof n&&this.renderIndentGuides(e,i),this.renderer.renderElement(e,t,i.templateData,n)}disposeElement(e,t,i,n){i.indentGuidesDisposable.dispose(),this.renderer.disposeElement&&this.renderer.disposeElement(e,t,i.templateData,n),"number"==typeof n&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this.renderTwistie(e,t.templateData),this._onDidChangeActiveNodes(this.activeNodes.elements),
this.renderIndentGuides(e,t.templateData))}renderTwistie(e,t){this.renderer.renderTwistie&&this.renderer.renderTwistie(e.element,t.twistie),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(o.addClasses(t.twistie,C.treeItemExpandedIcon.classNames,"collapsible"),o.toggleClass(t.twistie,"collapsed",e.collapsed)):o.removeClasses(t.twistie,C.treeItemExpandedIcon.classNames,"collapsible","collapsed"),e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded")}renderIndentGuides(e,t){if(o.clearNode(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const n=new i.DisposableStore,s=this.modelProvider();let r=e;for(;;){const e=s.getNodeLocation(r),a=s.getParentNodeLocation(e);if(!a)break;const l=s.getNode(a),d=o.$(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(l)&&o.addClass(d,"active"),
0===t.indent.childElementCount?t.indent.appendChild(d):t.indent.insertBefore(d,t.indent.firstElementChild),this.renderedIndentGuides.add(l,d),n.add(i.toDisposable(()=>this.renderedIndentGuides.delete(l,d))),r=l}t.indentGuidesDisposable=n}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach(e=>{const n=i.getNodeLocation(e);try{const o=i.getParentNodeLocation(n);e.collapsible&&e.children.length>0&&!e.collapsed?t.add(e):o&&t.add(i.getNode(o))}catch(e){}}),this.activeIndentNodes.forEach(e=>{t.has(e)||this.renderedIndentGuides.forEach(e,e=>o.removeClass(e,"active"))}),t.forEach(e=>{this.activeIndentNodes.has(e)||this.renderedIndentGuides.forEach(e,e=>o.addClass(e,"active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),i.dispose(this.disposables)}}x.DefaultIndent=8;class D{constructor(e,t,n){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=n,
this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new i.DisposableStore,e.onWillRefilter(this.reset,this,this.disposables)}get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}set pattern(e){this._pattern=e,this._lowercasePattern=e.toLowerCase()}filter(e,t){if(this._filter){const i=this._filter.filter(e,t);if(this.tree.options.simpleKeyboardNavigation)return i;let n;if(0===(n="boolean"==typeof i?i?1:0:g.isFilterResult(i)?g.getVisibleState(i.visibility):i))return!1}if(this._totalCount++,this.tree.options.simpleKeyboardNavigation||!this._pattern)return this._matchCount++,{data:u.FuzzyScore.Default,visibility:!0};const i=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),n=i&&i.toString();if(void 0===n)return{data:u.FuzzyScore.Default,visibility:!0};const o=u.fuzzyScore(this._pattern,this._lowercasePattern,0,n,n.toLowerCase(),0,!0);return o?(this._matchCount++,{data:o,visibility:!0}):this.tree.options.filterOnType?2:{
data:u.FuzzyScore.Default,visibility:!0}}reset(){this._totalCount=0,this._matchCount=0}dispose(){i.dispose(this.disposables)}}class k{constructor(e,t,n,r,a){this.tree=e,this.view=n,this.filter=r,this.keyboardNavigationDelegate=a,this._enabled=!1,this._pattern="",this._empty=!1,this._onDidChangeEmptyState=new s.Emitter,this.positionClassName="ne",this.automaticKeyboardNavigation=!0,this.triggered=!1,this._onDidChangePattern=new s.Emitter,this.enabledDisposables=new i.DisposableStore,this.disposables=new i.DisposableStore,this.domNode=o.$(`.monaco-list-type-filter.${this.positionClassName}`),this.domNode.draggable=!0,h.domEvent(this.domNode,"dragstart")(this.onDragStart,this,this.disposables),this.messageDomNode=o.append(n.getHTMLElement(),o.$(".monaco-list-type-filter-message")),this.labelDomNode=o.append(this.domNode,o.$("span.label"));const l=o.append(this.domNode,o.$(".controls"));this._filterOnType=!!e.options.filterOnType,this.filterOnTypeDomNode=o.append(l,o.$("input.filter")),
this.filterOnTypeDomNode.type="checkbox",this.filterOnTypeDomNode.checked=this._filterOnType,this.filterOnTypeDomNode.tabIndex=-1,this.updateFilterOnTypeTitleAndIcon(),h.domEvent(this.filterOnTypeDomNode,"input")(this.onDidChangeFilterOnType,this,this.disposables),this.clearDomNode=o.append(l,o.$("button.clear"+C.treeFilterClearIcon.cssSelector)),this.clearDomNode.tabIndex=-1,this.clearDomNode.title=p.localize(0,null),this.keyboardNavigationEventFilter=e.options.keyboardNavigationEventFilter,t.onDidSplice(this.onDidSpliceModel,this,this.disposables),this.updateOptions(e.options)}get enabled(){return this._enabled}get pattern(){return this._pattern}get filterOnType(){return this._filterOnType}updateOptions(e){e.simpleKeyboardNavigation?this.disable():this.enable(),void 0!==e.filterOnType&&(this._filterOnType=!!e.filterOnType,this.filterOnTypeDomNode.checked=this._filterOnType),void 0!==e.automaticKeyboardNavigation&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation),this.tree.refilter(),
this.render(),this.automaticKeyboardNavigation||this.onEventOrInput("")}enable(){if(this._enabled)return;const e=s.Event.chain(h.domEvent(this.view.getHTMLElement(),"keydown")).filter(e=>!n.isInputElement(e.target)||e.target===this.filterOnTypeDomNode).filter(e=>"Dead"!==e.key&&!/^Media/.test(e.key)).map(e=>new r.StandardKeyboardEvent(e)).filter(this.keyboardNavigationEventFilter||(()=>!0)).filter(()=>this.automaticKeyboardNavigation||this.triggered).filter(e=>this.keyboardNavigationDelegate.mightProducePrintableCharacter(e)&&!(18===e.keyCode||16===e.keyCode||15===e.keyCode||17===e.keyCode)||(this.pattern.length>0||this.triggered)&&(9===e.keyCode||1===e.keyCode)&&!e.altKey&&!e.ctrlKey&&!e.metaKey||1===e.keyCode&&(f.isMacintosh?e.altKey&&!e.metaKey:e.ctrlKey)&&!e.shiftKey).forEach(e=>{e.stopPropagation(),e.preventDefault()}).event,t=h.domEvent(this.clearDomNode,"click");s.Event.chain(s.Event.any(e,t)).event(this.onEventOrInput,this,this.enabledDisposables),this.filter.pattern="",this.tree.refilter(),
this.render(),this._enabled=!0,this.triggered=!1}disable(){this._enabled&&(this.domNode.remove(),this.enabledDisposables.clear(),this.tree.refilter(),this.render(),this._enabled=!1,this.triggered=!1)}onEventOrInput(e){"string"==typeof e?this.onInput(e):e instanceof MouseEvent||9===e.keyCode||1===e.keyCode&&(f.isMacintosh?e.altKey:e.ctrlKey)?this.onInput(""):1===e.keyCode?this.onInput(0===this.pattern.length?"":this.pattern.substr(0,this.pattern.length-1)):this.onInput(this.pattern+e.browserEvent.key)}onInput(e){const t=this.view.getHTMLElement();e&&!this.domNode.parentElement?t.append(this.domNode):!e&&this.domNode.parentElement&&(this.domNode.remove(),this.tree.domFocus()),this._pattern=e,this._onDidChangePattern.fire(e),this.filter.pattern=e,this.tree.refilter(),e&&this.tree.focusNext(0,!0,void 0,e=>!u.FuzzyScore.isDefault(e.filterData));const i=this.tree.getFocus();if(i.length>0){const e=i[0];null===this.tree.getRelativeTop(e)&&this.tree.reveal(e,.5)}this.render(),e||(this.triggered=!1)}onDragStart(){
const e=this.view.getHTMLElement(),{left:t}=o.getDomNodePagePosition(e),n=e.clientWidth,s=n/2,r=this.domNode.clientWidth,a=new i.DisposableStore;let d=this.positionClassName;const c=()=>{switch(d){case"nw":this.domNode.style.top="4px",this.domNode.style.left="4px";break;case"ne":this.domNode.style.top="4px",this.domNode.style.left=`${n-r-6}px`}};c(),o.removeClass(this.domNode,d),o.addClass(this.domNode,"dragging"),a.add(i.toDisposable(()=>o.removeClass(this.domNode,"dragging"))),h.domEvent(document,"dragover")(e=>{e.preventDefault();const i=e.screenX-t;e.dataTransfer&&(e.dataTransfer.dropEffect="none"),d=i{this.positionClassName=d,this.domNode.className=`monaco-list-type-filter ${this.positionClassName}`,this.domNode.style.top="",this.domNode.style.left="",i.dispose(a)},null,a),l.StaticDND.CurrentDragAndDropData=new l.DragAndDropData("vscode-ui"),a.add(i.toDisposable(()=>l.StaticDND.CurrentDragAndDropData=void 0))}onDidSpliceModel(){
this._enabled&&0!==this.pattern.length&&(this.tree.refilter(),this.render())}onDidChangeFilterOnType(){this.tree.updateOptions({filterOnType:this.filterOnTypeDomNode.checked}),this.tree.refilter(),this.tree.domFocus(),this.render(),this.updateFilterOnTypeTitleAndIcon()}updateFilterOnTypeTitleAndIcon(){this.filterOnType?(o.removeClasses(this.filterOnTypeDomNode,C.treeFilterOnTypeOffIcon.classNames),o.addClasses(this.filterOnTypeDomNode,C.treeFilterOnTypeOnIcon.classNames),this.filterOnTypeDomNode.title=p.localize(1,null)):(o.removeClasses(this.filterOnTypeDomNode,C.treeFilterOnTypeOnIcon.classNames),o.addClasses(this.filterOnTypeDomNode,C.treeFilterOnTypeOffIcon.classNames),this.filterOnTypeDomNode.title=p.localize(2,null))}render(){const e=this.filter.totalCount>0&&0===this.filter.matchCount;this.pattern&&this.tree.options.filterOnType&&e?(this.messageDomNode.textContent=p.localize(3,null),this._empty=!0):(this.messageDomNode.innerText="",this._empty=!1),o.toggleClass(this.domNode,"no-matches",e),
this.domNode.title=p.localize(4,null,this.filter.matchCount,this.filter.totalCount),this.labelDomNode.textContent=this.pattern.length>16?"…"+this.pattern.substr(this.pattern.length-16):this.pattern,this._onDidChangeEmptyState.fire(this._empty)}shouldAllowFocus(e){return!(this.enabled&&this.pattern&&!this.filterOnType)||(this.filter.totalCount>0&&this.filter.matchCount<=1||!u.FuzzyScore.isDefault(e.filterData))}dispose(){this._enabled&&(this.domNode.remove(),this.enabledDisposables.dispose(),this._enabled=!1,this.triggered=!1),this._onDidChangePattern.dispose(),i.dispose(this.disposables)}}function N(e){let t=a.TreeMouseEventTarget.Unknown;return o.hasParentWithClass(e.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?t=a.TreeMouseEventTarget.Twistie:o.hasParentWithClass(e.browserEvent.target,"monaco-tl-contents","monaco-tl-row")&&(t=a.TreeMouseEventTarget.Element),{browserEvent:e.browserEvent,element:e.element?e.element.element:null,target:t}}function I(e,t){t(e),e.children.forEach(e=>I(e,t))}class M{
constructor(e){this.identityProvider=e,this.nodes=[],this._onDidChange=new s.Emitter,this.onDidChange=this._onDidChange.event}get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}set(e,t){d.equals(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const e=this;this._onDidChange.fire({get elements(){return e.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const e=this.createNodeSet(),i=t=>e.delete(t);return t.forEach(e=>I(e,i)),void this.set([...e.values()])}const i=new Set,n=e=>i.add(this.identityProvider.getId(e.element).toString());t.forEach(e=>I(e,n));const o=new Map,s=e=>o.set(this.identityProvider.getId(e.element).toString(),e);e.forEach(e=>I(e,s));const r=[];for(const e of this.nodes){
const t=this.identityProvider.getId(e.element).toString();if(i.has(t)){const e=o.get(t);e&&r.push(e)}else r.push(e)}this._set(r,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class R extends n.MouseController{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(n.isInputElement(e.browserEvent.target)||n.isMonacoEditor(e.browserEvent.target))return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,s=o.hasClass(i,"monaco-tl-twistie")||o.hasClass(i,"monaco-icon-label")&&o.hasClass(i,"folder-icon")&&e.browserEvent.offsetX<16;let r=!1;if((r="function"==typeof this.tree.expandOnlyOnTwistieClick?this.tree.expandOnlyOnTwistieClick(t.element):!!this.tree.expandOnlyOnTwistieClick)&&!s)return super.onViewPointer(e);if(this.tree.expandOnlyOnDoubleClick&&2!==e.browserEvent.detail&&!s)return super.onViewPointer(e);if(t.collapsible){
const i=this.tree.model,n=i.getNodeLocation(t),o=e.browserEvent.altKey;if(i.setCollapsed(n,void 0,o),r&&s)return}super.onViewPointer(e)}onDoubleClick(e){o.hasClass(e.browserEvent.target,"monaco-tl-twistie")||super.onDoubleClick(e)}}class T extends n.List{constructor(e,t,i,n,o,s,r){super(e,t,i,n,r),this.focusTrait=o,this.selectionTrait=s}createMouseController(e){return new R(this,e.tree)}splice(e,t,i=[]){if(super.splice(e,t,i),0===i.length)return;const n=[],o=[];i.forEach((t,i)=>{this.focusTrait.has(t)&&n.push(e+i),this.selectionTrait.has(t)&&o.push(e+i)}),n.length>0&&super.setFocus(d.distinctES6([...super.getFocus(),...n])),o.length>0&&super.setSelection(d.distinctES6([...super.getSelection(),...o]))}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(e=>this.element(e)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(e=>this.element(e)),t)}}t.AbstractTree=class{constructor(e,t,a,l,d={}){this._options=d,this.eventBufferer=new s.EventBufferer,
this.disposables=new i.DisposableStore,this._onWillRefilter=new s.Emitter,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new s.Emitter;const c=new y(a),h=new s.Relay,u=new s.Relay,g=new L(u.event);this.renderers=l.map(e=>new x(e,()=>this.model,h.event,g,d));for(let e of this.renderers)this.disposables.add(e);let p;var m,f;d.keyboardNavigationLabelProvider&&(p=new D(this,d.keyboardNavigationLabelProvider,d.filter),d=Object.assign(Object.assign({},d),{filter:p}),this.disposables.add(p)),this.focus=new M(d.identityProvider),this.selection=new M(d.identityProvider),this.view=new T(e,t,c,this.renderers,this.focus,this.selection,Object.assign(Object.assign({},(m=()=>this.model,(f=d)&&Object.assign(Object.assign({},f),{identityProvider:f.identityProvider&&{getId:e=>f.identityProvider.getId(e.element)},dnd:f.dnd&&new w(m,f.dnd),multipleSelectionController:f.multipleSelectionController&&{
isSelectionSingleChangeEvent:e=>f.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element})),isSelectionRangeChangeEvent:e=>f.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},accessibilityProvider:f.accessibilityProvider&&Object.assign(Object.assign({},f.accessibilityProvider),{getSetSize(e){const t=m(),i=t.getNodeLocation(e),n=t.getParentNodeLocation(i);return t.getNode(n).visibleChildrenCount},getPosInSet:e=>e.visibleChildIndex+1,isChecked:f.accessibilityProvider&&f.accessibilityProvider.isChecked?e=>f.accessibilityProvider.isChecked(e.element):void 0,getRole:f.accessibilityProvider&&f.accessibilityProvider.getRole?e=>f.accessibilityProvider.getRole(e.element):()=>"treeitem",getAriaLabel:e=>f.accessibilityProvider.getAriaLabel(e.element),getWidgetAriaLabel:()=>f.accessibilityProvider.getWidgetAriaLabel(),
getWidgetRole:f.accessibilityProvider&&f.accessibilityProvider.getWidgetRole?()=>f.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e=>e.depth,getActiveDescendantId:f.accessibilityProvider.getActiveDescendantId&&(e=>f.accessibilityProvider.getActiveDescendantId(e.element))}),keyboardNavigationLabelProvider:f.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},f.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel:e=>f.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}),enableKeyboardNavigation:f.simpleKeyboardNavigation}))),{tree:this})),this.model=this.createModel(e,this.view,d),h.input=this.model.onDidChangeCollapseState;const _=s.Event.forEach(this.model.onDidSplice,e=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(e),this.selection.onDidModelSplice(e)})});if(_(()=>null,null,this.disposables),u.input=s.Event.chain(s.Event.any(_,this.focus.onDidChange,this.selection.onDidChange)).debounce(()=>null,0).map(()=>{const e=new Set
;for(const t of this.focus.getNodes())e.add(t);for(const t of this.selection.getNodes())e.add(t);return[...e.values()]}).event,!1!==d.keyboardSupport){const e=s.Event.chain(this.view.onKeyDown).filter(e=>!n.isInputElement(e.target)).map(e=>new r.StandardKeyboardEvent(e));e.filter(e=>15===e.keyCode).on(this.onLeftArrow,this,this.disposables),e.filter(e=>17===e.keyCode).on(this.onRightArrow,this,this.disposables),e.filter(e=>10===e.keyCode).on(this.onSpace,this,this.disposables)}if(d.keyboardNavigationLabelProvider){const e=d.keyboardNavigationDelegate||n.DefaultKeyboardNavigationDelegate;this.typeFilterController=new k(this,this.model,this.view,p,e),this.focusNavigationFilter=e=>this.typeFilterController.shouldAllowFocus(e),this.disposables.add(this.typeFilterController)}this.styleElement=o.createStyleSheet(this.view.getHTMLElement()),o.toggleClass(this.getHTMLElement(),"always",this._options.renderIndentGuides===E.Always)}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}
get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return s.Event.map(this.view.onMouseDblClick,N)}get onPointer(){return s.Event.map(this.view.onPointer,N)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get expandOnlyOnDoubleClick(){var e;return null!==(e=this._options.expandOnlyOnDoubleClick)&&void 0!==e&&e}get expandOnlyOnTwistieClick(){return void 0!==this._options.expandOnlyOnTwistieClick&&this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}updateOptions(e={}){this._options=Object.assign(Object.assign({},this._options),e);for(const t of this.renderers)t.updateOptions(e);this.view.updateOptions({enableKeyboardNavigation:this._options.simpleKeyboardNavigation,automaticKeyboardNavigation:this._options.automaticKeyboardNavigation,smoothScrolling:this._options.smoothScrolling,horizontalScrolling:this._options.horizontalScrolling}),
this.typeFilterController&&this.typeFilterController.updateOptions(this._options),this._onDidUpdateOptions.fire(this._options),o.toggleClass(this.getHTMLElement(),"always",this._options.renderIndentGuides===E.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}domFocus(){this.view.domFocus()}layout(e,t){this.view.layout(e,t)}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeIndentGuidesStroke.transparent(.4)}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`));const n=i.join("\n");n!==this.styleElement.innerHTML&&(this.styleElement.innerHTML=n),this.view.style(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){
return this.model.setCollapsed(e,!1,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const i=e.map(e=>this.model.getNode(e));this.selection.set(i,t);const n=e.map(e=>this.model.getListIndex(e)).filter(e=>e>-1);this.view.setSelection(n,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const i=e.map(e=>this.model.getNode(e));this.focus.set(i,t);const n=e.map(e=>this.model.getListIndex(e)).filter(e=>e>-1);this.view.setFocus(n,t,!0)}focusNext(e=1,t=!1,i,n=this.focusNavigationFilter){this.view.focusNext(e,t,i,n)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);-1!==i&&this.view.reveal(i,t)}getRelativeTop(e){const t=this.model.getListIndex(e);return-1===t?null:this.view.getRelativeTop(t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation()
;const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const e=this.model.getParentNodeLocation(n);if(!e)return;const t=this.model.getListIndex(e);this.view.reveal(t),this.view.setFocus([t])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some(e=>e.visible))return;const[e]=this.view.getFocus(),t=e+1;this.view.reveal(t),this.view.setFocus([t])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,o)}dispose(){i.dispose(this.disposables),this.view.dispose()}}})),define(t[420],i([0,1,168,146]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataTree=void 0
;class o extends i.AbstractTree{constructor(e,t,i,n,o,s={}){super(e,t,i,n,s),this.user=e,this.dataSource=o,this.identityProvider=s.identityProvider}createModel(e,t,i){return new n.ObjectTreeModel(e,t,i)}}t.DataTree=o})),define(t[226],i([0,1,50,168,146,266,96]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompressibleObjectTree=t.ObjectTree=void 0;class l extends n.AbstractTree{constructor(e,t,i,n,o={}){super(e,t,i,n,o)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}setChildren(e,t=i.Iterable.empty()){this.model.setChildren(e,t)}rerender(e){void 0!==e?this.model.rerender(e):this.view.rerender()}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new o.ObjectTreeModel(e,t,i)}}t.ObjectTree=l;class d{constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}get compressedTreeNodeProvider(){
return this._compressedTreeNodeProvider()}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){const o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);1===o.element.elements.length?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,n)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,n))}disposeElement(e,t,i,n){i.compressedTreeNode?this.renderer.disposeCompressedElements&&this.renderer.disposeCompressedElements(i.compressedTreeNode,t,i.data,n):this.renderer.disposeElement&&this.renderer.disposeElement(e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){this.renderer.renderTwistie&&this.renderer.renderTwistie(e,t)}}a([r.memoize],d.prototype,"compressedTreeNodeProvider",null);t.CompressibleObjectTree=class extends l{constructor(e,t,i,n,o={}){const s=()=>this;super(e,t,i,n.map(e=>new d(s,e)),function(e,t){return t&&Object.assign(Object.assign({},t),{
keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(i){let n;try{n=e().getCompressedTreeNode(i)}catch(e){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i)}return 1===n.element.elements.length?t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i):t.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.element.elements)}}})}(s,o))}setChildren(e,t=i.Iterable.empty()){this.model.setChildren(e,t)}createModel(e,t,i){return new s.CompressibleObjectTreeModel(e,t,i)}updateOptions(e={}){super.updateOptions(e),void 0!==e.compressionEnabled&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}})),define(t[421],i([0,1,168,226,95,2,4,15,50,154,12,7,145,192]),(function(e,t,i,n,o,s,a,l,d,c,h,u,g,p){"use strict";function m(e){return Object.assign(Object.assign({},e),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}
function f(e,t){return!!t.parent&&(t.parent===e||f(e,t.parent))}Object.defineProperty(t,"__esModule",{value:!0}),t.CompressibleAsyncDataTree=t.AsyncDataTree=void 0;class _{constructor(e){this.node=e}get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new _(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}}class v{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderTwistie(e,t){
return e.slow?u.addClasses(t,p.treeItemLoadingIcon.classNames):u.removeClasses(t,p.treeItemLoadingIcon.classNames),!1}disposeElement(e,t,i,n){this.renderer.disposeElement&&this.renderer.disposeElement(this.nodeMapper.map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function C(e){return{browserEvent:e.browserEvent,elements:e.elements.map(e=>e.element)}}function b(e){return{browserEvent:e.browserEvent,element:e.element&&e.element.element,target:e.target}}class S extends c.ElementsDragAndDropData{constructor(e){super(e.elements.map(e=>e.element)),this.data=e}}function w(e){return e instanceof c.ElementsDragAndDropData?new S(e):e}class y{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(e=>e.element),t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(w(e),t)}onDragOver(e,t,i,n,o=!0){
return this.dnd.onDragOver(w(e),t&&t.element,i,n)}drop(e,t,i,n){this.dnd.drop(w(e),t&&t.element,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}function E(e){return e&&Object.assign(Object.assign({},e),{collapseByDefault:!0,identityProvider:e.identityProvider&&{getId:t=>e.identityProvider.getId(t.element)},dnd:e.dnd&&new y(e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent:t=>e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element})),isSelectionRangeChangeEvent:t=>e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},e.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",isChecked:e.accessibilityProvider.isChecked?t=>{var i
;return!!(null===(i=e.accessibilityProvider)||void 0===i?void 0:i.isChecked(t.element))}:void 0,getAriaLabel:t=>e.accessibilityProvider.getAriaLabel(t.element),getWidgetAriaLabel:()=>e.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider.getAriaLevel&&(t=>e.accessibilityProvider.getAriaLevel(t.element)),getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))}),filter:e.filter&&{filter:(t,i)=>e.filter.filter(t.element,i)},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}),sorter:void 0,
expandOnlyOnTwistieClick:void 0===e.expandOnlyOnTwistieClick?void 0:"function"!=typeof e.expandOnlyOnTwistieClick?e.expandOnlyOnTwistieClick:t=>e.expandOnlyOnTwistieClick(t.element),additionalScrollHeight:e.additionalScrollHeight})}function L(e,t){t(e),e.children.forEach(e=>L(e,t))}class x{constructor(e,t,i,n,r,l={}){this.user=e,this.dataSource=r,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new a.Emitter,this._onDidChangeNodeSlowState=new a.Emitter,this.nodeMapper=new o.WeakMapper(e=>new _(e)),this.disposables=new s.DisposableStore,this.identityProvider=l.identityProvider,this.autoExpandSingleChildren=void 0!==l.autoExpandSingleChildren&&l.autoExpandSingleChildren,this.sorter=l.sorter,this.collapseByDefault=l.collapseByDefault,this.tree=this.createTree(e,t,i,n,l),this.root=m({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=Object.assign(Object.assign({},this.root),{id:null})),this.nodes.set(null,this.root),
this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}get onDidChangeFocus(){return a.Event.map(this.tree.onDidChangeFocus,C)}get onDidChangeSelection(){return a.Event.map(this.tree.onDidChangeSelection,C)}get onMouseDblClick(){return a.Event.map(this.tree.onMouseDblClick,b)}get onPointer(){return a.Event.map(this.tree.onPointer,b)}get onDidFocus(){return this.tree.onDidFocus}get onDidDispose(){return this.tree.onDidDispose}createTree(e,t,o,s,r){const a=new i.ComposedTreeDelegate(o),l=s.map(e=>new v(e,this.nodeMapper,this._onDidChangeNodeSlowState.event)),d=E(r)||{};return new n.ObjectTree(e,t,a,l,d)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}setInput(e,t){return r(this,void 0,void 0,(function*(){
this.refreshPromises.forEach(e=>e.cancel()),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&"number"==typeof t.scrollTop&&(this.scrollTop=t.scrollTop)}))}_updateChildren(e=this.root.element,t=!0,i=!1,n){return r(this,void 0,void 0,(function*(){if(void 0===this.root.element)throw new o.TreeError(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield a.Event.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(yield this.refreshAndRenderNode(s,t,n),i)try{this.tree.rerender(s)}catch(e){}}))}rerender(e){if(void 0===e||e===this.root.element)return void this.tree.rerender();const t=this.getDataNode(e);this.tree.rerender(t)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}expand(e,t=!1){return r(this,void 0,void 0,(function*(){
if(void 0===this.root.element)throw new o.TreeError(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield a.Event.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i))return!1;if(i.refreshPromise&&(yield this.root.refreshPromise,yield a.Event.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i))return!1;const n=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(yield this.root.refreshPromise,yield a.Event.toPromise(this._onDidRender.event)),n}))}setSelection(e,t){const i=e.map(e=>this.getDataNode(e));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(e=>e.element)}setFocus(e,t){const i=e.map(e=>this.getDataNode(e));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map(e=>e.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e)
;if(!t)throw new o.TreeError(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,i){return r(this,void 0,void 0,(function*(){yield this.refreshNode(e,t,i),this.render(e,i)}))}refreshNode(e,t,i){return r(this,void 0,void 0,(function*(){let n;return this.subTreeRefreshPromises.forEach((o,s)=>{!n&&function(e,t){return e===t||f(e,t)||f(t,e)}(s,e)&&(n=o.then(()=>this.refreshNode(e,t,i)))}),n||this.doRefreshSubTree(e,t,i)}))}doRefreshSubTree(e,t,i){return r(this,void 0,void 0,(function*(){let n;e.refreshPromise=new Promise(e=>n=e),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const o=yield this.doRefreshNode(e,t,i);e.stale=!1,yield Promise.all(o.map(e=>this.doRefreshSubTree(e,t,i)))}finally{n()}}))}doRefreshNode(e,t,i){return r(this,void 0,void 0,(function*(){let n;if(e.hasChildren=!!this.dataSource.hasChildren(e.element),e.hasChildren){const t=l.timeout(800);t.then(()=>{e.slow=!0,
this._onDidChangeNodeSlowState.fire(e)},e=>null),n=this.doGetChildren(e).finally(()=>t.cancel())}else n=Promise.resolve(d.Iterable.empty());try{const o=yield n;return this.setChildren(e,o,t,i)}catch(t){if(e!==this.root&&this.tree.collapse(e===this.root?null:e),h.isPromiseCanceledError(t))return[];throw t}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}))}doGetChildren(e){let t=this.refreshPromises.get(e);return t||(t=l.createCancelablePromise(()=>r(this,void 0,void 0,(function*(){const t=yield this.dataSource.getChildren(e.element);return this.processChildren(t)}))),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){null!==e.element&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(h.onUnexpectedError))}setChildren(e,t,i,n){const o=[...t];if(0===e.children.length&&0===o.length)return[];const s=new Map,r=new Map
;for(const t of e.children)if(s.set(t.element,t),this.identityProvider){const e=this.tree.isCollapsed(t);r.set(t.id,{node:t,collapsed:e})}const a=[],l=o.map(t=>{const o=!!this.dataSource.hasChildren(t);if(!this.identityProvider){const i=m({element:t,parent:e,hasChildren:o});return o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(i.collapsedByDefault=!1,a.push(i)),i}const l=this.identityProvider.getId(t).toString(),d=r.get(l);if(d){const e=d.node;return s.delete(e.element),this.nodes.delete(e.element),this.nodes.set(t,e),e.element=t,e.hasChildren=o,i?d.collapsed?(e.children.forEach(e=>L(e,e=>this.nodes.delete(e.element))),e.children.splice(0,e.children.length),e.stale=!0):a.push(e):o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(e.collapsedByDefault=!1,a.push(e)),e}const c=m({element:t,parent:e,id:l,hasChildren:o});return n&&n.viewState.focus&&n.viewState.focus.indexOf(l)>-1&&n.focus.push(c),n&&n.viewState.selection&&n.viewState.selection.indexOf(l)>-1&&n.selection.push(c),
n&&n.viewState.expanded&&n.viewState.expanded.indexOf(l)>-1?a.push(c):o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(c.collapsedByDefault=!1,a.push(c)),c});for(const e of s.values())L(e,e=>this.nodes.delete(e.element));for(const e of l)this.nodes.set(e.element,e);return e.children.splice(0,e.children.length,...l),e!==this.root&&this.autoExpandSingleChildren&&1===l.length&&0===a.length&&(l[0].collapsedByDefault=!1,a.push(l[0])),a}render(e,t){const i=e.children.map(e=>this.asTreeElement(e,t));this.tree.setChildren(e===this.root?null:e,i),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return i=!(t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1)&&e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?d.Iterable.map(e.children,e=>this.asTreeElement(e,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){
return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose()}}t.AsyncDataTree=x;class D{constructor(e){this.node=e}get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new D(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}}class k{constructor(e,t,i,n){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){
this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderCompressedElements(e,t,i,n){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?u.addClasses(t,p.treeItemLoadingIcon.classNames):u.removeClasses(t,p.treeItemLoadingIcon.classNames),!1}disposeElement(e,t,i,n){this.renderer.disposeElement&&this.renderer.disposeElement(this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){this.renderer.disposeCompressedElements&&this.renderer.disposeCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=s.dispose(this.disposables)}}t.CompressibleAsyncDataTree=class extends x{constructor(e,t,i,n,s,r,a={}){super(e,t,i,s,r,a),this.compressionDelegate=n,this.compressibleNodeMapper=new o.WeakMapper(e=>new D(e)),this.filter=a.filter}createTree(e,t,o,s,r){
const a=new i.ComposedTreeDelegate(o),l=s.map(e=>new k(e,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),d=function(e){const t=e&&E(e);return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},t.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(e=>e.element))})})}(r)||{};return new n.CompressibleObjectTree(e,t,a,l,d)}asTreeElement(e,t){return Object.assign({incompressible:this.compressionDelegate.isIncompressible(e.element)},super.asTreeElement(e,t))}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t){if(!this.identityProvider)return super.render(e,t);const i=e=>this.identityProvider.getId(e).toString(),n=e=>{const t=new Set;for(const n of e){const e=this.tree.getCompressedTreeNode(n===this.root?null:n);if(e.element)for(const n of e.element.elements)t.add(i(n.element))}
return t},o=n(this.tree.getSelection()),s=n(this.tree.getFocus());super.render(e,t);const r=this.getSelection();let a=!1;const l=this.getFocus();let d=!1;const c=e=>{const t=e.element;if(t)for(let e=0;e{const t=function(e){return"boolean"==typeof e?e?1:0:g.isFilterResult(e)?g.getVisibleState(e.visibility):g.getVisibleState(e)}(this.filter.filter(e,1));if(2===t)throw new Error("Recursive tree visibility not supported in async data compressed trees");return 1===t})),super.processChildren(e)}}})),define(t[422],i([5,6]),(function(e,t){return e.create("vs/base/common/errorMessage",t)})),define(t[423],i([0,1,422,23,19]),(function(e,t,i,n,o){
"use strict";function s(e,t){return t&&(e.stack||e.stacktrace)?i.localize(0,null,a(e),r(e.stack)||r(e.stacktrace)):a(e)}function r(e){return Array.isArray(e)?e.join("\n"):e}function a(e){return"string"==typeof e.code&&"number"==typeof e.errno&&"string"==typeof e.syscall?i.localize(1,null,e.message):e.message||i.localize(2,null)}Object.defineProperty(t,"__esModule",{value:!0}),t.toErrorMessage=void 0,t.toErrorMessage=function e(t=null,r=!1){if(!t)return i.localize(3,null);if(Array.isArray(t)){const n=o.coalesce(t),s=e(n[0],r);return n.length>1?i.localize(4,null,s,n.length):s}if(n.isString(t))return t;if(t.detail){const e=t.detail;if(e.error)return s(e.error,r);if(e.exception)return s(e.exception,r)}return t.stack?s(t,r):t.message?t.message:i.localize(5,null)}})),define(t[424],i([5,6]),(function(e,t){return e.create("vs/base/common/keybindingLabels",t)})),define(t[227],i([0,1,424]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),
t.AriaLabelProvider=t.UILabelProvider=t.ModifierLabelProvider=void 0;class n{constructor(e,t,i=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=i}toLabel(e,t,i){if(0===t.length)return null;const n=[];for(let s=0,r=t.length;s{t.checkbox.offsetParent||e.preventDefault()})),t.checkbox=i.append(n,S("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(i.addStandardDisposableListener(t.checkbox,i.EventType.CHANGE,e=>{t.element.checked=t.checkbox.checked}));const o=i.append(n,S(".quick-input-list-rows")),s=i.append(o,S(".quick-input-list-row")),r=i.append(o,S(".quick-input-list-row"));t.label=new c.IconLabel(s,{supportHighlights:!0,supportDescriptionHighlights:!0,supportCodicons:!0});const a=i.append(s,S(".quick-input-list-entry-keybinding"));t.keybinding=new C.KeybindingLabel(a,p.OS);const l=i.append(r,S(".quick-input-list-label-meta"));return t.detail=new h.HighlightedLabel(l,!0),t.separator=i.append(t.entry,S(".quick-input-list-separator")),
t.actionBar=new m.ActionBar(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,o){o.toDisposeElement=n.dispose(o.toDisposeElement),o.element=e,o.checkbox.checked=e.checked,o.toDisposeElement.push(e.onChecked(e=>o.checkbox.checked=e));const{labelHighlights:s,descriptionHighlights:r,detailHighlights:a}=e,l=Object.create(null);l.matches=s||[],l.descriptionTitle=e.saneDescription,l.descriptionMatches=r||[],l.extraClasses=e.item.iconClasses,l.italic=e.item.italic,l.strikethrough=e.item.strikethrough,o.label.setLabel(e.saneLabel,e.saneDescription,l),o.keybinding.set(e.item.keybinding),o.detail.set(e.saneDetail,a),e.separator&&e.separator.label?(o.separator.textContent=e.separator.label,o.separator.style.display=""):o.separator.style.display="none",e.separator?i.addClass(o.entry,"quick-input-list-separator-border"):i.removeClass(o.entry,"quick-input-list-separator-border"),o.actionBar.clear();const d=e.item.buttons
;d&&d.length?(o.actionBar.push(d.map((t,i)=>{let n=t.iconClass||(t.iconPath?_.getIconClass(t.iconPath):void 0);t.alwaysVisible&&(n=n?`${n} always-visible`:"always-visible");const o=new f.Action(`id-${i}`,"",n,!0,()=>(e.fireButtonTriggered({button:t,item:e.item}),Promise.resolve()));return o.tooltip=t.tooltip||"",o}),{icon:!0,label:!1}),i.addClass(o.entry,"has-actions")):i.removeClass(o.entry,"has-actions")}disposeElement(e,t,i){i.toDisposeElement=n.dispose(i.toDisposeElement)}disposeTemplate(e){e.toDisposeElement=n.dispose(e.toDisposeElement),e.toDisposeTemplate=n.dispose(e.toDisposeTemplate)}}y.ID="listelement";class E{getHeight(e){return e.saneDetail?44:22}getTemplateId(e){return y.ID}}var L;!function(e){e[e.First=1]="First",e[e.Second=2]="Second",e[e.Last=3]="Last",e[e.Next=4]="Next",e[e.Previous=5]="Previous",e[e.NextPage=6]="NextPage",e[e.PreviousPage=7]="PreviousPage"}(L=t.QuickInputListFocus||(t.QuickInputListFocus={}));class x{constructor(e,t,n){this.parent=e,this.inputElements=[],this.elements=[],
this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.sortByLabel=!0,this._onChangedAllVisibleChecked=new r.Emitter,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new r.Emitter,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new r.Emitter,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new r.Emitter,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new r.Emitter,this.onButtonTriggered=this._onButtonTriggered.event,this._onKeyDown=new r.Emitter,this.onKeyDown=this._onKeyDown.event,this._onLeave=new r.Emitter,this.onLeave=this._onLeave.event,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=i.append(this.parent,S(".quick-input-list"));const o=new E,s=new D;this.list=n.createList("QuickInput",this.container,o,[new y],{identityProvider:{
getId:e=>e.saneLabel},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:s}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown(e=>{const t=new d.StandardKeyboardEvent(e);switch(t.keyCode){case 10:this.toggleCheckbox();break;case 31:(p.isMacintosh?e.metaKey:e.ctrlKey)&&this.list.setFocus(g.range(this.list.length));break;case 16:const t=this.list.getFocus();1===t.length&&0===t[0]&&this._onLeave.fire();break;case 18:const i=this.list.getFocus();1===i.length&&i[0]===this.list.length-1&&this._onLeave.fire()}this._onKeyDown.fire(t)})),this.disposables.push(this.list.onMouseDown(e=>{2!==e.browserEvent.button&&e.browserEvent.preventDefault()})),this.disposables.push(i.addDisposableListener(this.container,i.EventType.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()})),this.disposables.push(this.list.onMouseMiddleClick(e=>{this._onLeave.fire()})),this.disposables.push(this.list.onContextMenu(e=>{
"number"==typeof e.index&&(e.browserEvent.preventDefault(),this.list.setSelection([e.index]))})),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return r.Event.map(this.list.onDidChangeFocus,e=>e.elements.map(e=>e.item))}get onDidChangeSelection(){return r.Event.map(this.list.onDidChangeSelection,e=>({items:e.elements.map(e=>e.item),event:e.browserEvent}))}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let i=0,n=e.length;i{
t.hidden||(t.checked=e)})}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=n.dispose(this.elementDisposables);const t=e=>this.fireButtonTriggered(e);this.inputElements=e,this.elements=e.reduce((i,n,s)=>{var r,a,l;if("separator"!==n.type){const d=s&&e[s-1],c=n.label&&n.label.replace(/\r?\n/g," "),h=n.description&&n.description.replace(/\r?\n/g," "),u=n.detail&&n.detail.replace(/\r?\n/g," "),g=n.ariaLabel||[c,h,u].map(e=>e&&o.parseCodicons(e).text).filter(e=>!!e).join(", ");i.push(new w({index:s,item:n,saneLabel:c,saneAriaLabel:g,saneDescription:h,saneDetail:u,labelHighlights:null===(r=n.highlights)||void 0===r?void 0:r.label,descriptionHighlights:null===(a=n.highlights)||void 0===a?void 0:a.description,detailHighlights:null===(l=n.highlights)||void 0===l?void 0:l.detail,checked:!1,separator:d&&"separator"===d.type?d:void 0,fireButtonTriggered:t}))}return i},[]),this.elementDisposables.push(...this.elements),
this.elementDisposables.push(...this.elements.map(e=>e.onChecked(()=>this.fireCheckedEvents()))),this.elementsToIndexes=this.elements.reduce((e,t,i)=>(e.set(t.item,i),e),new Map),this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map(e=>e.item)}setFocusedElements(e){if(this.list.setFocus(e.filter(e=>this.elementsToIndexes.has(e)).map(e=>this.elementsToIndexes.get(e))),e.length>0){const e=this.list.getFocus()[0];"number"==typeof e&&this.list.reveal(e)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter(e=>this.elementsToIndexes.has(e)).map(e=>this.elementsToIndexes.get(e)))}getCheckedElements(){return this.elements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i)
;for(const e of this.elements)e.checked=t.has(e.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===L.Next&&this.list.getFocus()[0]===this.list.length-1&&(e=L.First),e===L.Previous&&0===this.list.getFocus()[0]&&(e=L.Last),e===L.Second&&this.list.length<2&&(e=L.First),e){case L.First:this.list.focusFirst();break;case L.Second:this.list.focusNth(1);break;case L.Last:this.list.focusLast();break;case L.Next:this.list.focusNext();break;case L.Previous:this.list.focusPrevious();break;case L.NextPage:this.list.focusNextPage();break;case L.PreviousPage:this.list.focusPreviousPage()}const t=this.list.getFocus()[0];"number"==typeof t&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}layout(e){this.list.getHTMLElement().style.maxHeight=e?`calc(${44*Math.floor(e/44)}px)`:"",this.list.layout()}filter(e){
if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;(e=e.trim())&&(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail)?this.elements.forEach(t=>{const i=this.matchOnLabel?v.withNullAsUndefined(o.matchesFuzzyCodiconAware(e,o.parseCodicons(t.saneLabel))):void 0,n=this.matchOnDescription?v.withNullAsUndefined(o.matchesFuzzyCodiconAware(e,o.parseCodicons(t.saneDescription||""))):void 0,s=this.matchOnDetail?v.withNullAsUndefined(o.matchesFuzzyCodiconAware(e,o.parseCodicons(t.saneDetail||""))):void 0;i||n||s?(t.labelHighlights=i,t.descriptionHighlights=n,t.detailHighlights=s,t.hidden=!1):(t.labelHighlights=void 0,t.descriptionHighlights=void 0,t.detailHighlights=void 0,t.hidden=!t.item.alwaysShow),t.separator=void 0}):this.elements.forEach(e=>{e.labelHighlights=void 0,e.descriptionHighlights=void 0,e.detailHighlights=void 0,e.hidden=!1;const t=e.index&&this.inputElements[e.index-1];e.separator=t&&"separator"===t.type?t:void 0})
;const t=this.elements.filter(e=>!e.hidden);if(this.sortByLabel&&e){const i=e.toLowerCase();t.sort((e,t)=>(function(e,t,i){const n=e.labelHighlights||[],o=t.labelHighlights||[];if(n.length&&!o.length)return-1;if(!n.length&&o.length)return 1;if(0===n.length&&0===o.length)return 0;return s.compareAnything(e.saneLabel,t.saneLabel,i)})(e,t,i))}return this.elementsToIndexes=t.reduce((e,t,i)=>(e.set(t.item,i),e),new Map),this.list.splice(0,this.list.length,t),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(t.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const i of e)i.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return"none"!==this.container.style.display}dispose(){this.elementDisposables=n.dispose(this.elementDisposables),
this.disposables=n.dispose(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}style(e){this.list.style(e)}}a([u.memoize],x.prototype,"onDidChangeFocus",null),a([u.memoize],x.prototype,"onDidChangeSelection",null),t.QuickInputList=x;class D{getWidgetAriaLabel(){return b.localize(0,null)}getAriaLabel(e){return e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(){return"option"}}})),define(t[429],i([0,1,195,7,25,428,415,53,426,198,298,4,284,2,77,79,47,19,15,202,26,119]),(function(e,t,i,n,o,s,a,l,d,c,h,u,g,p,m,f,_,v,C,b,S){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuickInputController=void 0;const w=n.$,y={iconClass:S.registerIcon("quick-input-back",S.Codicon.arrowLeft).classNames,tooltip:d.localize(0,null),handle:-1}
;class E extends p.Disposable{constructor(e){super(),this.ui=e,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this.onDidTriggerButtonEmitter=this._register(new u.Emitter),this.onDidHideEmitter=this._register(new u.Emitter),this.onDisposeEmitter=this._register(new u.Emitter),this.visibleDisposables=this._register(new p.DisposableStore),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}
get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){this._ignoreFocusOut=e,this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{-1!==this.buttons.indexOf(e)&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this.update())}hide(){this.visible&&this.ui.hide()}didHide(){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire()}update(){if(!this.visible)return;const e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:e||" "===this.ui.title.innerHTML||(this.ui.title.innerText=" ;");const t=this.getDescription();if(this.ui.description.textContent!==t&&(this.ui.description.textContent=t),this.busy&&!this.busyDelay&&(this.busyDelay=new C.TimeoutTimer,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),
!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const e=this.buttons.filter(e=>e===y);this.ui.leftActionBar.push(e.map((e,t)=>{const i=new _.Action(`id-${t}`,"",e.iconClass||b.getIconClass(e.iconPath),!0,()=>r(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)})));return i.tooltip=e.tooltip||"",i}),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const t=this.buttons.filter(e=>e!==y);this.ui.rightActionBar.push(t.map((e,t)=>{const i=new _.Action(`id-${t}`,"",e.iconClass||b.getIconClass(e.iconPath),!0,()=>r(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)})));return i.tooltip=e.tooltip||"",i}),{icon:!0,label:!1})}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey)}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?d.localize(1,null,this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e===m.default.Error){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.paddingBottom="4px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.paddingBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}class L extends E{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new u.Emitter),
this.onDidAcceptEmitter=this._register(new u.Emitter),this.onDidCustomEmitter=this._register(new u.Emitter),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._sortByLabel=!0,this._autoFocusOnList=!0,this._itemActivation=this.ui.isScreenReaderOptimized()?i.ItemActivation.NONE:i.ItemActivation.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new u.Emitter),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new u.Emitter),this.onDidTriggerItemButtonEmitter=this._register(new u.Emitter),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,
this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this._value=e||"",this.update()}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}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 sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=e,this.update()}get 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?i.NO_KEY_MODS:this.ui.keyMods}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get customButton(){return this._customButton}
set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(s.QuickInputListFocus.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{if(e===this.value)return;this._value=e,this.ui.list.filter(this.filterValue(this.ui.inputBox.value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(e)})),this.visibleDisposables.add(this.ui.inputBox.onMouseDown(e=>{this.autoFocusOnList||this.ui.list.clearFocus()})),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown(e=>{switch(e.keyCode){case 18:
this.ui.list.focus(s.QuickInputListFocus.Next),this.canSelectMany&&this.ui.list.domFocus(),n.EventHelper.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(s.QuickInputListFocus.Previous):this.ui.list.focus(s.QuickInputListFocus.Last),this.canSelectMany&&this.ui.list.domFocus(),n.EventHelper.stop(e,!0);break;case 12:this.ui.list.focus(s.QuickInputListFocus.NextPage),this.canSelectMany&&this.ui.list.domFocus(),n.EventHelper.stop(e,!0);break;case 11:this.ui.list.focus(s.QuickInputListFocus.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),n.EventHelper.stop(e,!0);break;case 17:if(!this._canAcceptInBackground)return;if(!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.onDidAcceptEmitter.fire({inBackground:!0}));break;case 14:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(s.QuickInputListFocus.First),n.EventHelper.stop(e,!0));break
;case 13:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(s.QuickInputListFocus.Last),n.EventHelper.stop(e,!0))}})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{!this.canSelectMany&&this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.onDidAcceptEmitter.fire({inBackground:!1})})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this.ui.list.onDidChangeFocus(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&v.equals(e,this._activeItems,(e,t)=>e===t)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{this.canSelectMany?e.length&&this.ui.list.setSelectedElements([]):this.selectedItemsToConfirm!==this._selectedItems&&v.equals(e,this._selectedItems,(e,t)=>e===t)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),
e.length&&this.onDidAcceptEmitter.fire({inBackground:t instanceof MouseEvent&&1===t.button}))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&v.equals(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.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}registerQuickNavigation(){return n.addDisposableListener(this.ui.container,n.EventType.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new l.StandardKeyboardEvent(e),i=t.keyCode;this._quickNavigate.keybindings.some(e=>{const[n,o]=e.getParts();return!o&&(n.shiftKey&&4===i?!(t.ctrlKey||t.altKey||t.metaKey):!(!n.altKey||6!==i)||(!(!n.ctrlKey||5!==i)||!(!n.metaKey||57!==i)))
})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.onDidAcceptEmitter.fire({inBackground:!1})),this._quickNavigate=void 0)})}update(){if(!this.visible)return;let e=!1,t=!1;this._hideInput&&this._items.length>0&&(this.ui.isScreenReaderOptimized()?t=!0:e=!0),n.toggleClass(this.ui.container,"hidden-input",e);const o={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description,checkAll:this.canSelectMany,inputBox:!e,progressBar:!e,visibleCount:!0,count:this.canSelectMany,ok:"default"===this.ok?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};if(this.ui.setVisibilities(o),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||""),t)this.ui.inputBox.ariaLabel="";else{const e=this.ariaLabel||this.placeholder||L.DEFAULT_ARIA_LABEL;this.ui.inputBox.ariaLabel!==e&&(this.ui.inputBox.ariaLabel=e)}if(this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case i.ItemActivation.NONE:this._itemActivation=i.ItemActivation.FIRST;break;case i.ItemActivation.SECOND:this.ui.list.focus(s.QuickInputListFocus.Second),this._itemActivation=i.ItemActivation.FIRST;break
;case i.ItemActivation.LAST:this.ui.list.focus(s.QuickInputListFocus.Last),this._itemActivation=i.ItemActivation.FIRST;break;default:this.trySelectFirst()}this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.validationMessage?(this.ui.message.textContent=this.validationMessage,this.showMessageDecoration(m.default.Error)):(this.ui.message.textContent=null,
this.showMessageDecoration(m.default.Ignore)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",this.ui.setComboboxAccessibility(!0),o.inputBox||this.ui.list.domFocus()}}L.DEFAULT_ARIA_LABEL=d.localize(2,null);class x extends p.Disposable{constructor(e){super(),this.options=e,this.comboboxAccessibility=!1,this.enabled=!0,this.onDidAcceptEmitter=this._register(new u.Emitter),this.onDidCustomEmitter=this._register(new u.Emitter),this.onDidTriggerButtonEmitter=this._register(new u.Emitter),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new u.Emitter),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new u.Emitter),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=e=>{this.keyMods.ctrlCmd=e.ctrlKey||e.metaKey,this.keyMods.alt=e.altKey}
;this._register(n.addDisposableListener(window,n.EventType.KEY_DOWN,e,!0)),this._register(n.addDisposableListener(window,n.EventType.KEY_UP,e,!0)),this._register(n.addDisposableListener(window,n.EventType.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=n.append(this.parentElement,w(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=n.createStyleSheet(e),i=n.append(e,w(".quick-input-titlebar")),o=this._register(new f.ActionBar(i));o.domNode.classList.add("quick-input-left-action-bar");const r=n.append(i,w(".quick-input-title")),u=this._register(new f.ActionBar(i));u.domNode.classList.add("quick-input-right-action-bar");const p=n.append(e,w(".quick-input-description")),m=n.append(e,w(".quick-input-header")),_=n.append(m,w("input.quick-input-check-all"));_.type="checkbox",this._register(n.addStandardDisposableListener(_,n.EventType.CHANGE,e=>{const t=_.checked;T.setAllVisibleChecked(t)})),this._register(n.addDisposableListener(_,n.EventType.CLICK,e=>{
(e.x||e.y)&&b.setFocus()}));const v=n.append(m,w(".quick-input-and-message")),C=n.append(v,w(".quick-input-filter")),b=this._register(new a.QuickInputBox(C));b.setAttribute("aria-describedby",`${this.idPrefix}message`);const S=n.append(C,w(".quick-input-visible-count"));S.setAttribute("aria-live","polite"),S.setAttribute("aria-atomic","true");const y=new c.CountBadge(S,{countFormat:d.localize(3,null)}),E=n.append(C,w(".quick-input-count"));E.setAttribute("aria-live","polite");const x=new c.CountBadge(E,{countFormat:d.localize(4,null)}),D=n.append(m,w(".quick-input-action")),k=new g.Button(D);k.label=d.localize(5,null),this._register(k.onDidClick(e=>{this.onDidAcceptEmitter.fire()}));const N=n.append(m,w(".quick-input-action")),I=new g.Button(N);I.label=d.localize(6,null),this._register(I.onDidClick(e=>{this.onDidCustomEmitter.fire()}));const M=n.append(v,w(`#${this.idPrefix}message.quick-input-message`)),R=new h.ProgressBar(e);n.addClass(R.getContainer(),"quick-input-progress")
;const T=this._register(new s.QuickInputList(e,this.idPrefix+"list",this.options));this._register(T.onChangedAllVisibleChecked(e=>{_.checked=e})),this._register(T.onChangedVisibleCount(e=>{y.setCount(e)})),this._register(T.onChangedCheckedCount(e=>{x.setCount(e)})),this._register(T.onLeave(()=>{setTimeout(()=>{b.setFocus(),this.controller instanceof L&&this.controller.canSelectMany&&T.clearFocus()},0)})),this._register(T.onDidChangeFocus(()=>{this.comboboxAccessibility&&this.getUI().inputBox.setAttribute("aria-activedescendant",this.getUI().list.getActiveDescendant()||"")}));const O=n.trackFocus(e);return this._register(O),this._register(n.addDisposableListener(e,n.EventType.FOCUS,e=>{this.previousFocusElement=e.relatedTarget instanceof HTMLElement?e.relatedTarget:void 0},!0)),this._register(O.onDidBlur(()=>{this.getUI().ignoreFocusOut||this.options.ignoreFocusOut()||this.hide(),this.previousFocusElement=void 0})),this._register(n.addDisposableListener(e,n.EventType.FOCUS,e=>{b.setFocus()})),
this._register(n.addDisposableListener(e,n.EventType.KEY_DOWN,t=>{const i=new l.StandardKeyboardEvent(t);switch(i.keyCode){case 3:n.EventHelper.stop(t,!0),this.onDidAcceptEmitter.fire();break;case 9:n.EventHelper.stop(t,!0),this.hide();break;case 2:if(!i.altKey&&!i.ctrlKey&&!i.metaKey){const o=[".action-label.codicon"];e.classList.contains("show-checkboxes")?o.push("input"):o.push("input[type=text]"),this.getUI().list.isDisplayed()&&o.push(".monaco-list");const s=e.querySelectorAll(o.join(", "));i.shiftKey&&i.target===s[0]?(n.EventHelper.stop(t,!0),s[s.length-1].focus()):i.shiftKey||i.target!==s[s.length-1]||(n.EventHelper.stop(t,!0),s[0].focus())}}})),this.ui={container:e,styleSheet:t,leftActionBar:o,titleBar:i,title:r,description:p,rightActionBar:u,checkAll:_,filterContainer:C,inputBox:b,visibleCountContainer:S,visibleCount:y,countContainer:E,count:x,okContainer:D,ok:k,message:M,customButtonContainer:N,customButton:I,progressBar:R,list:T,onDidAccept:this.onDidAcceptEmitter.event,
onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,isScreenReaderOptimized:()=>this.options.isScreenReaderOptimized(),show:e=>this.show(e),hide:()=>this.hide(),setVisibilities:e=>this.setVisibilities(e),setComboboxAccessibility:e=>this.setComboboxAccessibility(e),setEnabled:e=>this.setEnabled(e),setContextKey:e=>this.options.setContextKey(e)},this.updateStyles(),this.ui}pick(e,t={},i=o.CancellationToken.None){return new Promise((n,o)=>{let s=e=>{s=n,t.onKeyMods&&t.onKeyMods(r.keyMods),n(e)};if(i.isCancellationRequested)return void s(void 0);const r=this.createQuickPick();let a;const l=[r,r.onDidAccept(()=>{if(r.canSelectMany)s(r.selectedItems.slice()),r.hide();else{const e=r.activeItems[0];e&&(s(e),r.hide())}}),r.onDidChangeActive(e=>{const i=e[0];i&&t.onDidFocus&&t.onDidFocus(i)}),r.onDidChangeSelection(e=>{if(!r.canSelectMany){const t=e[0];t&&(s(t),r.hide())}
}),r.onDidTriggerItemButton(e=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},e),{removeItem:()=>{const t=r.items.indexOf(e.item);if(-1!==t){const e=r.items.slice();e.splice(t,1),r.items=e}}}))),r.onDidChangeValue(e=>{!a||e||1===r.activeItems.length&&r.activeItems[0]===a||(r.activeItems=[a])}),i.onCancellationRequested(()=>{r.hide()}),r.onDidHide(()=>{p.dispose(l),s(void 0)})];r.canSelectMany=!!t.canPickMany,r.placeholder=t.placeHolder,r.ignoreFocusOut=!!t.ignoreFocusLost,r.matchOnDescription=!!t.matchOnDescription,r.matchOnDetail=!!t.matchOnDetail,r.matchOnLabel=void 0===t.matchOnLabel||t.matchOnLabel,r.autoFocusOnList=void 0===t.autoFocusOnList||t.autoFocusOnList,r.quickNavigate=t.quickNavigate,r.contextKey=t.contextKey,r.busy=!0,Promise.all([e,t.activeItem]).then(([e,t])=>{a=t,r.busy=!1,r.items=e,r.canSelectMany&&(r.selectedItems=e.filter(e=>"separator"!==e.type&&e.picked)),a&&(r.activeItems=[a])}),r.show(),Promise.resolve(e).then(void 0,e=>{o(e),r.hide()})})}
createQuickPick(){const e=this.getUI();return new L(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const i=this.controller;this.controller=e,i&&i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description.textContent="",t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(m.default.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),t.message.textContent="",t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,this.setComboboxAccessibility(!1),t.inputBox.ariaLabel="";const n=this.options.backKeybindingLabel();y.tooltip=n?d.localize(7,null,n):d.localize(8,null),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description.style.display=e.description?"":"none",
t.checkAll.style.display=e.checkAll?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList[e.checkAll?"add":"remove"]("show-checkboxes"),this.updateLayout()}setComboboxAccessibility(e){if(e!==this.comboboxAccessibility){const t=this.getUI();this.comboboxAccessibility=e,this.comboboxAccessibility?(t.inputBox.setAttribute("role","combobox"),t.inputBox.setAttribute("aria-haspopup","true"),t.inputBox.setAttribute("aria-autocomplete","list"),t.inputBox.setAttribute("aria-activedescendant",t.list.getActiveDescendant()||"")):(t.inputBox.removeAttribute("role"),t.inputBox.removeAttribute("aria-haspopup"),
t.inputBox.removeAttribute("aria-autocomplete"),t.inputBox.removeAttribute("aria-activedescendant"))}}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.getAction().enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.getAction().enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(){var e;const t=this.controller;if(t){const i=!(null===(e=this.ui)||void 0===e?void 0:e.container.contains(document.activeElement));this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",i||(this.previousFocusElement&&this.previousFocusElement.offsetParent?(this.previousFocusElement.focus(),this.previousFocusElement=void 0):this.options.returnFocus()),t.didHide()}}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui){this.ui.container.style.top=`${this.titleBarOffset}px`
;const e=this.ui.container.style,t=Math.min(.62*this.dimension.width,x.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&.4*this.dimension.height)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,contrastBorder:n,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e?e.toString():"",this.ui.container.style.backgroundColor=t?t.toString():"",this.ui.container.style.color=i?i.toString():"",this.ui.container.style.border=n?`1px solid ${n}`:"",this.ui.container.style.boxShadow=o?`0 5px 8px ${o}`:"",this.ui.inputBox.style(this.styles.inputBox),this.ui.count.style(this.styles.countBadge),this.ui.ok.style(this.styles.button),this.ui.customButton.style(this.styles.button),this.ui.progressBar.style(this.styles.progressBar),this.ui.list.style(this.styles.list);const s=[]
;this.styles.list.listInactiveFocusForeground&&(s.push(`.monaco-list .monaco-list-row.focused { color: ${this.styles.list.listInactiveFocusForeground}; }`),s.push(`.monaco-list .monaco-list-row.focused:hover { color: ${this.styles.list.listInactiveFocusForeground}; }`)),this.styles.list.pickerGroupBorder&&s.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.list.pickerGroupBorder}; }`),this.styles.list.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.list.pickerGroupForeground}; }`);const r=s.join("\n");r!==this.ui.styleSheet.innerHTML&&(this.ui.styleSheet.innerHTML=r)}}}t.QuickInputController=x,x.MAX_WIDTH=600})),define(t[430],i([5,6]),(function(e,t){return e.create("vs/editor/browser/controller/coreCommands",t)})),define(t[431],i([5,6]),(function(e,t){return e.create("vs/editor/browser/controller/textAreaHandler",t)})),define(t[432],i([5,6]),(function(e,t){return e.create("vs/editor/browser/editorExtensions",t)})),
define(t[433],i([5,6]),(function(e,t){return e.create("vs/editor/browser/widget/codeEditorWidget",t)})),define(t[434],i([5,6]),(function(e,t){return e.create("vs/editor/browser/widget/diffEditorWidget",t)})),define(t[435],i([5,6]),(function(e,t){return e.create("vs/editor/browser/widget/diffReview",t)})),define(t[436],i([5,6]),(function(e,t){return e.create("vs/editor/browser/widget/inlineDiffMargin",t)})),define(t[437],i([0,1,436,7,47,2,3,26]),(function(e,t,i,n,o,s,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InlineDiffMargin=void 0;class d extends s.Disposable{constructor(e,t,s,d,c,h){super(),this._viewZoneId=e,this._marginDomNode=t,this.editor=s,this.diff=d,this._contextMenuService=c,this._clipboardService=h,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=l.Codicon.lightBulb.classNames+" lightbulb-glyph",this._diffActions.style.position="absolute";const u=s.getOption(51),g=s.getModel().getEOL()
;this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${u}px`,this._diffActions.style.lineHeight=`${u}px`,this._marginDomNode.appendChild(this._diffActions);const p=[];p.push(new o.Action("diff.clipboard.copyDeletedContent",d.originalEndLineNumber>d.modifiedStartLineNumber?i.localize(0,null):i.localize(1,null),void 0,!0,()=>r(this,void 0,void 0,(function*(){yield this._clipboardService.writeText(d.originalContent.join(g)+g)}))));let m=0,f=void 0;d.originalEndLineNumber>d.modifiedStartLineNumber&&(f=new o.Action("diff.clipboard.copyDeletedLineContent",i.localize(2,null,d.originalStartLineNumber),void 0,!0,()=>r(this,void 0,void 0,(function*(){yield this._clipboardService.writeText(d.originalContent[m])}))),p.push(f)),s.getOption(72)||p.push(new o.Action("diff.inline.revertChange",i.localize(3,null),void 0,!0,()=>r(this,void 0,void 0,(function*(){if(0===d.modifiedEndLineNumber){const e=s.getModel().getLineMaxColumn(d.modifiedStartLineNumber)
;s.executeEdits("diffEditor",[{range:new a.Range(d.modifiedStartLineNumber,e,d.modifiedStartLineNumber,e),text:g+d.originalContent.join(g)}])}else{const e=s.getModel().getLineMaxColumn(d.modifiedEndLineNumber);s.executeEdits("diffEditor",[{range:new a.Range(d.modifiedStartLineNumber,1,d.modifiedEndLineNumber,e),text:d.originalContent.join(g)}])}}))));const _=(e,t)=>{this._contextMenuService.showContextMenu({getAnchor:()=>({x:e,y:t}),getActions:()=>(f&&(f.label=i.localize(4,null,d.originalStartLineNumber+m)),p),autoSelectFirstItem:!0})};this._register(n.addStandardDisposableListener(this._diffActions,"mousedown",e=>{const{top:t,height:i}=n.getDomNodePagePosition(this._diffActions);let o=Math.floor(u/3);e.preventDefault(),_(e.posx,t+i+o)})),this._register(s.onMouseMove(e=>{if(8===e.target.type||5===e.target.type){e.target.detail.viewZoneId===this._viewZoneId?(this.visibility=!0,m=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,u)):this.visibility=!1}else this.visibility=!1})),
this._register(s.onMouseDown(e=>{if(e.event.rightButton&&(8===e.target.type||5===e.target.type)){e.target.detail.viewZoneId===this._viewZoneId&&(e.event.preventDefault(),m=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,u),_(e.event.posx,e.event.posy+u))}}))}get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}_updateLightBulbPosition(e,t,i){const{top:o}=n.getDomNodePagePosition(e),s=t-o,r=Math.floor(s/i),a=r*i;return this._diffActions.style.top=`${a}px`,r}}t.InlineDiffMargin=d})),define(t[438],i([5,6]),(function(e,t){return e.create("vs/editor/common/config/commonEditorConfig",t)})),define(t[439],i([5,6]),(function(e,t){return e.create("vs/editor/common/config/editorOptions",t)})),define(t[38],i([0,1,439,16,122]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),
t.EditorOptions=t.editorOptionsRegistry=t.EDITOR_MODEL_DEFAULTS=t.EDITOR_FONT_DEFAULTS=t.filterValidationDecorations=t.EditorLayoutInfoComputer=t.EditorFontLigatures=t.TextEditorCursorStyle=t.ComputeOptionsMemory=t.ValidatedEditorOptions=t.ConfigurationChangedEvent=t.MINIMAP_GUTTER_WIDTH=void 0,t.MINIMAP_GUTTER_WIDTH=8;t.ConfigurationChangedEvent=class{constructor(e){this._values=e}hasChanged(e){return this._values[e]}};t.ValidatedEditorOptions=class{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}};class s{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}t.ComputeOptionsMemory=s;class r{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}compute(e,t,i){return i}}class a{constructor(e,t=null){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0,this.deps=t}validate(e){return this.defaultValue}}class l{constructor(e,t,i,n){
this.id=e,this.name=t,this.defaultValue=i,this.schema=n}validate(e){return void 0===e?this.defaultValue:e}compute(e,t,i){return i}}class d extends l{static boolean(e,t){return void 0===e?t:"false"!==e&&Boolean(e)}constructor(e,t,i,n){void 0!==n&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return d.boolean(e,this.defaultValue)}}class c extends l{constructor(e,t,i,n,o,s){void 0!==s&&(s.type="integer",s.default=i,s.minimum=n,s.maximum=o),super(e,t,i,s),this.minimum=n,this.maximum=o}static clampedInt(e,t,i,n){if(void 0===e)return t;let o=parseInt(e,10);return isNaN(o)?t:(o=Math.max(i,o),0|(o=Math.min(n,o)))}validate(e){return c.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}class h extends l{constructor(e,t,i,n,o){void 0!==o&&(o.type="number",o.default=i),super(e,t,i,o),this.validationFn=n}static clamp(e,t,i){return ei?i:e}static float(e,t){if("number"==typeof e)return e;if(void 0===e)return t;const i=parseFloat(e);return isNaN(i)?t:i}validate(e){
return this.validationFn(h.float(e,this.defaultValue))}}class u extends l{static string(e,t){return"string"!=typeof e?t:e}constructor(e,t,i,n){void 0!==n&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return u.string(e,this.defaultValue)}}class g extends l{constructor(e,t,i,n,o){void 0!==o&&(o.type="string",o.enum=n,o.default=i),super(e,t,i,o),this._allowedValues=n}static stringSet(e,t,i){return"string"!=typeof e?t:-1===i.indexOf(e)?t:e}validate(e){return g.stringSet(e,this.defaultValue,this._allowedValues)}}class p extends r{constructor(e,t,i,n,o,s,r){void 0!==r&&(r.type="string",r.enum=o,r.default=n),super(e,t,i,r),this._allowedValues=o,this._convert=s}validate(e){return"string"!=typeof e?this.defaultValue:-1===this._allowedValues.indexOf(e)?this.defaultValue:this._convert(e)}}var m;!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"
}(m=t.TextEditorCursorStyle||(t.TextEditorCursorStyle={}));class f extends r{constructor(){super(37,"fontLigatures",f.OFF,{anyOf:[{type:"boolean",description:i.localize(16,null)},{type:"string",description:i.localize(17,null)}],description:i.localize(18,null),default:!1})}validate(e){return void 0===e?this.defaultValue:"string"==typeof e?"false"===e?f.OFF:"true"===e?f.ON:e:Boolean(e)?f.ON:f.OFF}}t.EditorFontLigatures=f,f.OFF='"liga" off, "calt" off',f.ON='"liga" on, "calt" on';class _ extends r{constructor(){super(39,"fontWeight",t.EDITOR_FONT_DEFAULTS.fontWeight,{anyOf:[{type:"number",minimum:_.MINIMUM_VALUE,maximum:_.MAXIMUM_VALUE,errorMessage:i.localize(20,null)},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:_.SUGGESTION_VALUES}],default:t.EDITOR_FONT_DEFAULTS.fontWeight,description:i.localize(21,null)})}validate(e){return"normal"===e||"bold"===e?e:String(c.clampedInt(e,t.EDITOR_FONT_DEFAULTS.fontWeight,_.MINIMUM_VALUE,_.MAXIMUM_VALUE))}}
_.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],_.MINIMUM_VALUE=1,_.MAXIMUM_VALUE=1e3;class v extends a{constructor(){super(117,[42,50,31,56,84,52,53,86,106,109,110,2])}compute(e,t,i){return v.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=e.scrollBeyondLastLine?t-1:0,n=(e.viewLineCount+i)/(e.pixelRatio*e.height);return{typicalViewportLineCount:t,extraLinesBeyondLastLine:i,desiredRatio:n,minimapLineCount:Math.floor(e.viewLineCount/n)}}static _computeMinimapLayout(e,i){const n=e.outerWidth,o=e.outerHeight,s=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,
minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(s*o),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:o};const r=i.stableMinimapLayoutInput,a=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,l=e.lineHeight,d=e.typicalHalfwidthCharacterWidth,c=e.scrollBeyondLastLine,h=e.minimap.renderCharacters
;let u=s>=2?Math.round(2*e.minimap.scale):e.minimap.scale;const g=e.minimap.maxColumn,p=e.minimap.size,m=e.minimap.side,f=e.verticalScrollbarWidth,_=e.viewLineCount,C=e.remainingWidth,b=e.isViewportWrapping,S=h?2:3;let w=Math.floor(s*o);const y=w/s;let E=!1,L=!1,x=S*u,D=u/s,k=1;if("fill"===p||"fit"===p){const{typicalViewportLineCount:t,extraLinesBeyondLastLine:n,desiredRatio:r,minimapLineCount:d}=v.computeContainedMinimapLineCount({viewLineCount:_,scrollBeyondLastLine:c,height:o,lineHeight:l,pixelRatio:s});if(_/d>1)E=!0,L=!0,x=1,D=(u=1)/s;else{let o=!1,d=u+1;if("fit"===p){const t=Math.ceil((_+n)*x);b&&a&&C<=i.stableFitRemainingWidth?(o=!0,d=i.stableFitMaxMinimapScale):(o=t>w,b&&o?(i.stableMinimapLayoutInput=e,i.stableFitRemainingWidth=C):(i.stableMinimapLayoutInput=null,i.stableFitRemainingWidth=0))}if("fill"===p||o){E=!0;const e=u;x=Math.min(l*s,Math.max(1,Math.floor(1/r))),(u=Math.min(d,Math.max(1,Math.floor(x/S))))>e&&(k=Math.min(2,u/e)),D=u/s/k,w=Math.ceil(Math.max(t,_+n)*x),
b&&o&&(i.stableFitMaxMinimapScale=u)}}}const N=Math.floor(g*D),I=Math.min(N,Math.max(0,Math.floor((C-f-2)*D/(d+D)))+t.MINIMAP_GUTTER_WIDTH);let M=Math.floor(s*I);const R=M/s;return{renderMinimap:h?1:2,minimapLeft:"left"===m?0:n-I-f,minimapWidth:I,minimapHeightIsEditorHeight:E,minimapIsSampling:L,minimapScale:u,minimapLineHeight:x,minimapCanvasInnerWidth:M=Math.floor(M*k),minimapCanvasInnerHeight:w,minimapCanvasOuterWidth:R,minimapCanvasOuterHeight:y}}static computeLayout(e,t){const i=0|t.outerWidth,n=0|t.outerHeight,o=0|t.lineHeight,r=0|t.lineNumbersDigitCount,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,d=t.pixelRatio,h=t.viewLineCount,u=e.get(106),g=e.get(109),p=e.get(110),m=e.get(2),f=t.isDominatedByLongLines,_=e.get(42),C=0!==e.get(52).renderType,b=e.get(53),S=e.get(86),w=e.get(56),y=e.get(84),E=y.verticalScrollbarSize,L=y.verticalHasArrows,x=y.arrowSize,D=y.horizontalScrollbarSize,k=e.get(50),N=e.get(31);let I;if("string"==typeof k&&/^\d+(\.\d+)?ch$/.test(k)){
const e=parseFloat(k.substr(0,k.length-2));I=c.clampedInt(e*a,0,0,1e3)}else I=c.clampedInt(k,0,0,1e3);N&&(I+=16);let M=0;if(C){const e=Math.max(r,b);M=Math.round(e*l)}let R=0;_&&(R=o);let T=0,O=T+R,A=O+M,P=A+I;const F=i-R-M-I;let W=!1,B=!1,V=-1;2!==m&&(p&&f?(W=!0,B=!0):"on"===u||"bounded"===u?B=!0:"wordWrapColumn"===u&&(V=g));const z=v._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:d,scrollBeyondLastLine:S,minimap:w,verticalScrollbarWidth:E,viewLineCount:h,remainingWidth:F,isViewportWrapping:B},t.memory||new s);0!==z.renderMinimap&&0===z.minimapLeft&&(T+=z.minimapWidth,O+=z.minimapWidth,A+=z.minimapWidth,P+=z.minimapWidth);const H=F-z.minimapWidth,K=Math.max(1,Math.floor((H-E-2)/a)),U=L?x:0;return B&&(V=Math.max(1,K),"bounded"===u&&(V=Math.min(V,g))),{width:i,height:n,glyphMarginLeft:T,glyphMarginWidth:R,lineNumbersLeft:O,lineNumbersWidth:M,decorationsLeft:A,decorationsWidth:I,contentLeft:P,contentWidth:H,minimap:z,viewportColumn:K,
isWordWrapMinified:W,isViewportWrapping:B,wrappingColumn:V,verticalScrollbarWidth:E,horizontalScrollbarHeight:D,overviewRuler:{top:U,width:E,height:n-2*U,right:0}}}}t.EditorLayoutInfoComputer=v;t.filterValidationDecorations=function(e){const t=e.get(79);return"editable"===t?e.get(72):"on"!==t};function C(e,t){if("string"!=typeof e)return t;switch(e){case"hidden":return 2;case"visible":return 3;default:return 1}}function b(e){return t.editorOptionsRegistry[e.id]=e,e}t.EDITOR_FONT_DEFAULTS={fontFamily:n.isMacintosh?"Menlo, Monaco, 'Courier New', monospace":n.isLinux?"'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'":"Consolas, 'Courier New', monospace",fontWeight:"normal",fontSize:n.isMacintosh?12:14,lineHeight:0,letterSpacing:0},t.EDITOR_MODEL_DEFAULTS={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0},t.editorOptionsRegistry=[],t.EditorOptions={acceptSuggestionOnCommitCharacter:b(new d(0,"acceptSuggestionOnCommitCharacter",!0,{
markdownDescription:i.localize(106,null)})),acceptSuggestionOnEnter:b(new g(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",i.localize(107,null),""],markdownDescription:i.localize(108,null)})),accessibilitySupport:b(new class extends r{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[i.localize(0,null),i.localize(1,null),i.localize(2,null)],default:"auto",description:i.localize(3,null)})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return 0===i?e.accessibilitySupport:i}}),accessibilityPageSize:b(new c(3,"accessibilityPageSize",10,1,1073741824,{description:i.localize(109,null)})),ariaLabel:b(new u(4,"ariaLabel",i.localize(110,null))),autoClosingBrackets:b(new g(5,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",i.localize(111,null),i.localize(112,null),""],
description:i.localize(113,null)})),autoClosingOvertype:b(new g(6,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",i.localize(114,null),""],description:i.localize(115,null)})),autoClosingQuotes:b(new g(7,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",i.localize(116,null),i.localize(117,null),""],description:i.localize(118,null)})),autoIndent:b(new p(8,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],(function(e){switch(e){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}),{enumDescriptions:[i.localize(119,null),i.localize(120,null),i.localize(121,null),i.localize(122,null),i.localize(123,null)],description:i.localize(124,null)})),automaticLayout:b(new d(9,"automaticLayout",!1)),autoSurround:b(new g(10,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{
enumDescriptions:[i.localize(125,null),i.localize(126,null),i.localize(127,null),""],description:i.localize(128,null)})),codeLens:b(new d(11,"codeLens",!0,{description:i.localize(129,null)})),colorDecorators:b(new d(12,"colorDecorators",!0,{description:i.localize(130,null)})),columnSelection:b(new d(13,"columnSelection",!1,{description:i.localize(131,null)})),comments:b(new class extends r{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(14,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:i.localize(4,null)},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:i.localize(5,null)}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertSpace:d.boolean(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:d.boolean(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}),contextmenu:b(new d(15,"contextmenu",!0)),
copyWithSyntaxHighlighting:b(new d(16,"copyWithSyntaxHighlighting",!0,{description:i.localize(132,null)})),cursorBlinking:b(new p(17,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],(function(e){switch(e){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}),{description:i.localize(133,null)})),cursorSmoothCaretAnimation:b(new d(18,"cursorSmoothCaretAnimation",!1,{description:i.localize(134,null)})),cursorStyle:b(new p(19,"cursorStyle",m.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],(function(e){switch(e){case"line":return m.Line;case"block":return m.Block;case"underline":return m.Underline;case"line-thin":return m.LineThin;case"block-outline":return m.BlockOutline;case"underline-thin":return m.UnderlineThin}}),{description:i.localize(135,null)})),cursorSurroundingLines:b(new c(20,"cursorSurroundingLines",0,0,1073741824,{description:i.localize(136,null)})),
cursorSurroundingLinesStyle:b(new g(21,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[i.localize(137,null),i.localize(138,null)],description:i.localize(139,null)})),cursorWidth:b(new c(22,"cursorWidth",0,0,1073741824,{markdownDescription:i.localize(140,null)})),disableLayerHinting:b(new d(23,"disableLayerHinting",!1)),disableMonospaceOptimizations:b(new d(24,"disableMonospaceOptimizations",!1)),dragAndDrop:b(new d(25,"dragAndDrop",!0,{description:i.localize(141,null)})),emptySelectionClipboard:b(new class extends d{constructor(){super(26,"emptySelectionClipboard",!0,{description:i.localize(6,null)})}compute(e,t,i){return i&&e.emptySelectionClipboard}}),extraEditorClassName:b(new u(27,"extraEditorClassName","")),fastScrollSensitivity:b(new h(28,"fastScrollSensitivity",5,e=>e<=0?5:e,{markdownDescription:i.localize(142,null)})),find:b(new class extends r{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:!0,autoFindInSelection:"never",globalFindClipboard:!1,
addExtraSpaceOnTop:!0,loop:!0};super(29,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:i.localize(7,null)},"editor.find.seedSearchStringFromSelection":{type:"boolean",default:e.seedSearchStringFromSelection,description:i.localize(8,null)},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[i.localize(9,null),i.localize(10,null),i.localize(11,null)],description:i.localize(12,null)},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:i.localize(13,null),included:n.isMacintosh},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:i.localize(14,null)},"editor.find.loop":{type:"boolean",default:e.loop,description:i.localize(15,null)}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{cursorMoveOnType:d.boolean(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),
seedSearchStringFromSelection:d.boolean(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection),autoFindInSelection:"boolean"==typeof e.autoFindInSelection?e.autoFindInSelection?"always":"never":g.stringSet(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:d.boolean(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:d.boolean(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:d.boolean(t.loop,this.defaultValue.loop)}}}),fixedOverflowWidgets:b(new d(30,"fixedOverflowWidgets",!1)),folding:b(new d(31,"folding",!0,{description:i.localize(143,null)})),foldingStrategy:b(new g(32,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[i.localize(144,null),i.localize(145,null)],description:i.localize(146,null)})),foldingHighlight:b(new d(33,"foldingHighlight",!0,{description:i.localize(147,null)})),unfoldOnClickAfterEndOfLine:b(new d(34,"unfoldOnClickAfterEndOfLine",!1,{
description:i.localize(148,null)})),fontFamily:b(new u(35,"fontFamily",t.EDITOR_FONT_DEFAULTS.fontFamily,{description:i.localize(149,null)})),fontInfo:b(new class extends a{constructor(){super(36)}compute(e,t,i){return e.fontInfo}}),fontLigatures2:b(new f),fontSize:b(new class extends l{constructor(){super(38,"fontSize",t.EDITOR_FONT_DEFAULTS.fontSize,{type:"number",minimum:6,maximum:100,default:t.EDITOR_FONT_DEFAULTS.fontSize,description:i.localize(19,null)})}validate(e){let i=h.float(e,this.defaultValue);return 0===i?t.EDITOR_FONT_DEFAULTS.fontSize:h.clamp(i,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}),fontWeight:b(new _),formatOnPaste:b(new d(40,"formatOnPaste",!1,{description:i.localize(150,null)})),formatOnType:b(new d(41,"formatOnType",!1,{description:i.localize(151,null)})),glyphMargin:b(new d(42,"glyphMargin",!0,{description:i.localize(152,null)})),gotoLocation:b(new class extends r{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",
multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[i.localize(22,null),i.localize(23,null),i.localize(24,null)]};super(43,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:i.localize(25,null)},"editor.gotoLocation.multipleDefinitions":Object.assign({description:i.localize(26,null)},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:i.localize(27,null)},t),"editor.gotoLocation.multipleDeclarations":Object.assign({description:i.localize(28,null)},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:i.localize(29,null)},t),
"editor.gotoLocation.multipleReferences":Object.assign({description:i.localize(30,null)},t),"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,description:i.localize(31,null)},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,description:i.localize(32,null)},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,description:i.localize(33,null)},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,description:i.localize(34,null)},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,description:i.localize(35,null)}})}validate(e){var t,i,n,o,s;if(!e||"object"!=typeof e)return this.defaultValue;const r=e;return{multiple:g.stringSet(r.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),
multipleDefinitions:null!==(t=r.multipleDefinitions)&&void 0!==t?t:g.stringSet(r.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:null!==(i=r.multipleTypeDefinitions)&&void 0!==i?i:g.stringSet(r.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:null!==(n=r.multipleDeclarations)&&void 0!==n?n:g.stringSet(r.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:null!==(o=r.multipleImplementations)&&void 0!==o?o:g.stringSet(r.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:null!==(s=r.multipleReferences)&&void 0!==s?s:g.stringSet(r.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:u.string(r.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:u.string(r.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),
alternativeDeclarationCommand:u.string(r.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:u.string(r.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:u.string(r.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}),hideCursorInOverviewRuler:b(new d(44,"hideCursorInOverviewRuler",!1,{description:i.localize(153,null)})),highlightActiveIndentGuide:b(new d(45,"highlightActiveIndentGuide",!0,{description:i.localize(154,null)})),hover:b(new class extends r{constructor(){const e={enabled:!0,delay:300,sticky:!0};super(46,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:i.localize(36,null)},"editor.hover.delay":{type:"number",default:e.delay,description:i.localize(37,null)},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:i.localize(38,null)}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e
;return{enabled:d.boolean(t.enabled,this.defaultValue.enabled),delay:c.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:d.boolean(t.sticky,this.defaultValue.sticky)}}}),inDiffEditor:b(new d(47,"inDiffEditor",!1)),letterSpacing:b(new h(48,"letterSpacing",t.EDITOR_FONT_DEFAULTS.letterSpacing,e=>h.clamp(e,-5,20),{description:i.localize(155,null)})),lightbulb:b(new class extends r{constructor(){const e={enabled:!0};super(49,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:i.localize(39,null)}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:d.boolean(t.enabled,this.defaultValue.enabled)}}}),lineDecorationsWidth:b(new l(50,"lineDecorationsWidth",10)),lineHeight:b(new class extends c{constructor(){super(51,"lineHeight",t.EDITOR_FONT_DEFAULTS.lineHeight,0,150,{description:i.localize(40,null)})}compute(e,t,i){return e.fontInfo.lineHeight}}),lineNumbers:b(new class extends r{constructor(){super(52,"lineNumbers",{renderType:1,
renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[i.localize(59,null),i.localize(60,null),i.localize(61,null),i.localize(62,null)],default:"on",description:i.localize(63,null)})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return void 0!==e&&("function"==typeof e?(t=4,i=e):t="interval"===e?3:"relative"===e?2:"on"===e?1:0),{renderType:t,renderFn:i}}}),lineNumbersMinChars:b(new c(53,"lineNumbersMinChars",5,1,300)),links:b(new d(54,"links",!0,{description:i.localize(156,null)})),matchBrackets:b(new g(55,"matchBrackets","always",["always","near","never"],{description:i.localize(157,null)})),minimap:b(new class extends r{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",renderCharacters:!0,maxColumn:120,scale:1};super(56,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:i.localize(41,null)},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],
enumDescriptions:[i.localize(42,null),i.localize(43,null),i.localize(44,null)],default:e.size,description:i.localize(45,null)},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:i.localize(46,null)},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:i.localize(47,null)},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:i.localize(48,null)},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:i.localize(49,null)},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:i.localize(50,null)}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:d.boolean(t.enabled,this.defaultValue.enabled),size:g.stringSet(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:g.stringSet(t.side,this.defaultValue.side,["right","left"]),
showSlider:g.stringSet(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:d.boolean(t.renderCharacters,this.defaultValue.renderCharacters),scale:c.clampedInt(t.scale,1,1,3),maxColumn:c.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}),mouseStyle:b(new g(57,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:b(new h(58,"mouseWheelScrollSensitivity",1,e=>0===e?1:e,{markdownDescription:i.localize(158,null)})),mouseWheelZoom:b(new d(59,"mouseWheelZoom",!1,{markdownDescription:i.localize(159,null)})),multiCursorMergeOverlapping:b(new d(60,"multiCursorMergeOverlapping",!0,{description:i.localize(160,null)})),multiCursorModifier:b(new p(61,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],(function(e){return"ctrlCmd"===e?n.isMacintosh?"metaKey":"ctrlKey":"altKey"}),{markdownEnumDescriptions:[i.localize(161,null),i.localize(162,null)],markdownDescription:i.localize(163,null)})),
multiCursorPaste:b(new g(62,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[i.localize(164,null),i.localize(165,null)],markdownDescription:i.localize(166,null)})),occurrencesHighlight:b(new d(63,"occurrencesHighlight",!0,{description:i.localize(167,null)})),overviewRulerBorder:b(new d(64,"overviewRulerBorder",!0,{description:i.localize(168,null)})),overviewRulerLanes:b(new c(65,"overviewRulerLanes",3,0,3)),padding:b(new class extends r{constructor(){super(66,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:i.localize(51,null)},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:i.localize(52,null)}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{top:c.clampedInt(t.top,0,0,1e3),bottom:c.clampedInt(t.bottom,0,0,1e3)}}}),parameterHints:b(new class extends r{constructor(){const e={enabled:!0,cycle:!1};super(67,"parameterHints",e,{"editor.parameterHints.enabled":{
type:"boolean",default:e.enabled,description:i.localize(53,null)},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:i.localize(54,null)}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:d.boolean(t.enabled,this.defaultValue.enabled),cycle:d.boolean(t.cycle,this.defaultValue.cycle)}}}),peekWidgetDefaultFocus:b(new g(68,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[i.localize(169,null),i.localize(170,null)],description:i.localize(171,null)})),definitionLinkOpensInPeek:b(new d(69,"definitionLinkOpensInPeek",!1,{description:i.localize(172,null)})),quickSuggestions:b(new class extends r{constructor(){const e={other:!0,comments:!1,strings:!1};super(70,"quickSuggestions",e,{anyOf:[{type:"boolean"},{type:"object",properties:{strings:{type:"boolean",default:e.strings,description:i.localize(55,null)},comments:{type:"boolean",default:e.comments,description:i.localize(56,null)},other:{type:"boolean",default:e.other,
description:i.localize(57,null)}}}],default:e,description:i.localize(58,null)}),this.defaultValue=e}validate(e){if("boolean"==typeof e)return e;if(e&&"object"==typeof e){const t=e,i={other:d.boolean(t.other,this.defaultValue.other),comments:d.boolean(t.comments,this.defaultValue.comments),strings:d.boolean(t.strings,this.defaultValue.strings)};return!!(i.other&&i.comments&&i.strings)||!!(i.other||i.comments||i.strings)&&i}return this.defaultValue}}),quickSuggestionsDelay:b(new c(71,"quickSuggestionsDelay",10,0,1073741824,{description:i.localize(173,null)})),readOnly:b(new d(72,"readOnly",!1)),renameOnType:b(new d(73,"renameOnType",!1,{description:i.localize(174,null)})),renderControlCharacters:b(new d(74,"renderControlCharacters",!1,{description:i.localize(175,null)})),renderIndentGuides:b(new d(75,"renderIndentGuides",!0,{description:i.localize(176,null)})),renderFinalNewline:b(new d(76,"renderFinalNewline",!0,{description:i.localize(177,null)})),
renderLineHighlight:b(new g(77,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",i.localize(178,null)],description:i.localize(179,null)})),renderLineHighlightOnlyWhenFocus:b(new d(78,"renderLineHighlightOnlyWhenFocus",!1,{description:i.localize(180,null)})),renderValidationDecorations:b(new g(79,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:b(new g(80,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",i.localize(181,null),i.localize(182,null),i.localize(183,null),""],description:i.localize(184,null)})),revealHorizontalRightPadding:b(new c(81,"revealHorizontalRightPadding",30,0,1e3)),roundedSelection:b(new d(82,"roundedSelection",!0,{description:i.localize(185,null)})),rulers:b(new class extends r{constructor(){const e=[],t={type:"number",description:i.localize(64,null)};super(83,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",
description:i.localize(65,null),format:"color-hex"}}}]},default:e,description:i.localize(66,null)})}validate(e){if(Array.isArray(e)){let t=[];for(let i of e)if("number"==typeof i)t.push({column:c.clampedInt(i,0,0,1e4),color:null});else if(i&&"object"==typeof i){const e=i;t.push({column:c.clampedInt(e.column,0,0,1e4),color:e.color})}return t.sort((e,t)=>e.column-t.column),t}return this.defaultValue}}),scrollbar:b(new class extends r{constructor(){super(84,"scrollbar",{vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e,i=c.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=c.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{
arrowSize:c.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:C(t.vertical,this.defaultValue.vertical),horizontal:C(t.horizontal,this.defaultValue.horizontal),useShadows:d.boolean(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:d.boolean(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:d.boolean(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:d.boolean(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:d.boolean(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:c.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:c.clampedInt(t.verticalSliderSize,n,0,1e3)}}}),scrollBeyondLastColumn:b(new c(85,"scrollBeyondLastColumn",5,0,1073741824,{description:i.localize(186,null)})),scrollBeyondLastLine:b(new d(86,"scrollBeyondLastLine",!0,{description:i.localize(187,null)})),
scrollPredominantAxis:b(new d(87,"scrollPredominantAxis",!0,{description:i.localize(188,null)})),selectionClipboard:b(new d(88,"selectionClipboard",!0,{description:i.localize(189,null),included:n.isLinux})),selectionHighlight:b(new d(89,"selectionHighlight",!0,{description:i.localize(190,null)})),selectOnLineNumbers:b(new d(90,"selectOnLineNumbers",!0)),showFoldingControls:b(new g(91,"showFoldingControls","mouseover",["always","mouseover"],{enumDescriptions:[i.localize(191,null),i.localize(192,null)],description:i.localize(193,null)})),showUnused:b(new d(92,"showUnused",!0,{description:i.localize(194,null)})),showDeprecated:b(new d(113,"showDeprecated",!0,{description:i.localize(195,null)})),snippetSuggestions:b(new g(93,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[i.localize(196,null),i.localize(197,null),i.localize(198,null),i.localize(199,null)],description:i.localize(200,null)})),smoothScrolling:b(new d(94,"smoothScrolling",!1,{description:i.localize(201,null)})),
stopRenderingLineAfter:b(new c(95,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:b(new class extends r{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!0,localityBonus:!1,shareSuggestSelections:!1,showIcons:!0,maxVisibleSuggestions:12,showMethods:!0,showFunctions:!0,showConstructors:!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,statusBar:{visible:!1}};super(96,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[i.localize(67,null),i.localize(68,null)],default:e.insertMode,description:i.localize(69,null)},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,
description:i.localize(70,null)},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:i.localize(71,null)},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:i.localize(72,null)},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:i.localize(73,null)},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:i.localize(74,null)},"editor.suggest.maxVisibleSuggestions":{type:"number",default:e.maxVisibleSuggestions,minimum:1,maximum:15,description:i.localize(75,null)},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:i.localize(76,null)},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:i.localize(77,null)},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:i.localize(78,null)},"editor.suggest.showConstructors":{type:"boolean",default:!0,
markdownDescription:i.localize(79,null)},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:i.localize(80,null)},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:i.localize(81,null)},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:i.localize(82,null)},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:i.localize(83,null)},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:i.localize(84,null)},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:i.localize(85,null)},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:i.localize(86,null)},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:i.localize(87,null)},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:i.localize(88,null)},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:i.localize(89,null)},
"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:i.localize(90,null)},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:i.localize(91,null)},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:i.localize(92,null)},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:i.localize(93,null)},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:i.localize(94,null)},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:i.localize(95,null)},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:i.localize(96,null)},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:i.localize(97,null)},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:i.localize(98,null)},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:i.localize(99,null)},"editor.suggest.showFolders":{type:"boolean",
default:!0,markdownDescription:i.localize(100,null)},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:i.localize(101,null)},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:i.localize(102,null)},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:i.localize(103,null)},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:i.localize(104,null)},"editor.suggest.statusBar.visible":{type:"boolean",default:!1,markdownDescription:i.localize(105,null)}})}validate(e){var t;if(!e||"object"!=typeof e)return this.defaultValue;const i=e;return{insertMode:g.stringSet(i.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:d.boolean(i.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:d.boolean(i.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:d.boolean(i.localityBonus,this.defaultValue.localityBonus),
shareSuggestSelections:d.boolean(i.shareSuggestSelections,this.defaultValue.shareSuggestSelections),showIcons:d.boolean(i.showIcons,this.defaultValue.showIcons),maxVisibleSuggestions:c.clampedInt(i.maxVisibleSuggestions,this.defaultValue.maxVisibleSuggestions,1,15),showMethods:d.boolean(i.showMethods,this.defaultValue.showMethods),showFunctions:d.boolean(i.showFunctions,this.defaultValue.showFunctions),showConstructors:d.boolean(i.showConstructors,this.defaultValue.showConstructors),showFields:d.boolean(i.showFields,this.defaultValue.showFields),showVariables:d.boolean(i.showVariables,this.defaultValue.showVariables),showClasses:d.boolean(i.showClasses,this.defaultValue.showClasses),showStructs:d.boolean(i.showStructs,this.defaultValue.showStructs),showInterfaces:d.boolean(i.showInterfaces,this.defaultValue.showInterfaces),showModules:d.boolean(i.showModules,this.defaultValue.showModules),showProperties:d.boolean(i.showProperties,this.defaultValue.showProperties),
showEvents:d.boolean(i.showEvents,this.defaultValue.showEvents),showOperators:d.boolean(i.showOperators,this.defaultValue.showOperators),showUnits:d.boolean(i.showUnits,this.defaultValue.showUnits),showValues:d.boolean(i.showValues,this.defaultValue.showValues),showConstants:d.boolean(i.showConstants,this.defaultValue.showConstants),showEnums:d.boolean(i.showEnums,this.defaultValue.showEnums),showEnumMembers:d.boolean(i.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:d.boolean(i.showKeywords,this.defaultValue.showKeywords),showWords:d.boolean(i.showWords,this.defaultValue.showWords),showColors:d.boolean(i.showColors,this.defaultValue.showColors),showFiles:d.boolean(i.showFiles,this.defaultValue.showFiles),showReferences:d.boolean(i.showReferences,this.defaultValue.showReferences),showFolders:d.boolean(i.showFolders,this.defaultValue.showFolders),showTypeParameters:d.boolean(i.showTypeParameters,this.defaultValue.showTypeParameters),
showSnippets:d.boolean(i.showSnippets,this.defaultValue.showSnippets),showUsers:d.boolean(i.showUsers,this.defaultValue.showUsers),showIssues:d.boolean(i.showIssues,this.defaultValue.showIssues),statusBar:{visible:d.boolean(null===(t=i.statusBar)||void 0===t?void 0:t.visible,!!this.defaultValue.statusBar.visible)}}}}),suggestFontSize:b(new c(97,"suggestFontSize",0,0,1e3,{markdownDescription:i.localize(202,null)})),suggestLineHeight:b(new c(98,"suggestLineHeight",0,0,1e3,{markdownDescription:i.localize(203,null)})),suggestOnTriggerCharacters:b(new d(99,"suggestOnTriggerCharacters",!0,{description:i.localize(204,null)})),suggestSelection:b(new g(100,"suggestSelection","recentlyUsed",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[i.localize(205,null),i.localize(206,null),i.localize(207,null)],description:i.localize(208,null)})),tabCompletion:b(new g(101,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[i.localize(209,null),i.localize(210,null),i.localize(211,null)],
description:i.localize(212,null)})),tabIndex:b(new c(102,"tabIndex",0,-1,1073741824)),unusualLineTerminators:b(new g(103,"unusualLineTerminators","prompt",["off","prompt","auto"],{enumDescriptions:[i.localize(213,null),i.localize(214,null),i.localize(215,null)],description:i.localize(216,null)})),useTabStops:b(new d(104,"useTabStops",!0,{description:i.localize(217,null)})),wordSeparators:b(new u(105,"wordSeparators",o.USUAL_WORD_SEPARATORS,{description:i.localize(218,null)})),wordWrap:b(new g(106,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[i.localize(219,null),i.localize(220,null),i.localize(221,null),i.localize(222,null)],description:i.localize(223,null)})),wordWrapBreakAfterCharacters:b(new u(107,"wordWrapBreakAfterCharacters"," \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:b(new u(108,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),
wordWrapColumn:b(new c(109,"wordWrapColumn",80,1,1073741824,{markdownDescription:i.localize(224,null)})),wordWrapMinified:b(new d(110,"wordWrapMinified",!0)),wrappingIndent:b(new p(111,"wrappingIndent",1,"same",["none","same","indent","deepIndent"],(function(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}}),{enumDescriptions:[i.localize(225,null),i.localize(226,null),i.localize(227,null),i.localize(228,null)],description:i.localize(229,null)})),wrappingStrategy:b(new g(112,"wrappingStrategy","simple",["simple","advanced"],{enumDescriptions:[i.localize(230,null),i.localize(231,null)],description:i.localize(232,null)})),editorClassName:b(new class extends a{constructor(){super(114,[57,27])}compute(e,t,i){const n=["monaco-editor"];return t.get(27)&&n.push(t.get(27)),e.extraEditorClassName&&n.push(e.extraEditorClassName),"default"===t.get(57)?n.push("mouse-default"):"copy"===t.get(57)&&n.push("mouse-copy"),t.get(92)&&n.push("showUnused"),
t.get(113)&&n.push("showDeprecated"),n.join(" ")}}),pixelRatio:b(new class extends a{constructor(){super(115)}compute(e,t,i){return e.pixelRatio}}),tabFocusMode:b(new class extends a{constructor(){super(116,[72])}compute(e,t,i){return!!t.get(72)||e.tabFocusMode}}),layoutInfo:b(new v),wrappingInfo:b(new class extends a{constructor(){super(118,[117])}compute(e,t,i){const n=t.get(117);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}})}})),define(t[440],i([0,1,13,3,70,38]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewModelDecorations=void 0;t.ViewModelDecorations=class{constructor(e,t,i,n,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}
_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let s=this._decorationsCache[t];if(!s){const r=e.range,a=e.options;let l;if(a.isWholeLine){const e=this._coordinatesConverter.convertModelPositionToViewPosition(new i.Position(r.startLineNumber,1)),t=this._coordinatesConverter.convertModelPositionToViewPosition(new i.Position(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber)));l=new n.Range(e.lineNumber,e.column,t.lineNumber,t.column)
}else l=this._coordinatesConverter.convertModelRangeToViewRange(r);s=new o.ViewModelDecoration(l,a),this._decorationsCache[t]=s}return s}getDecorationsViewportData(e){let t=null!==this._cachedModelDecorationsResolver;return(t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange))||(this._cachedModelDecorationsResolver=this._getDecorationsViewportData(e),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}_getDecorationsViewportData(e){const t=this._linesCollection.getDecorationsInRange(e,this.editorId,s.filterValidationDecorations(this.configuration.options)),i=e.startLineNumber,r=e.endLineNumber;let a=[],l=0,d=[];for(let e=i;e<=r;e++)d[e-i]=[];for(let e=0,s=t.length;e0&&(this.changes=r.compressConsecutiveTextChanges(this.changes,t)),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+16*(e?e.length:0)}static _writeSelections(e,t,i){if(a.writeUInt32BE(e,t?t.length:0,i),i+=4,t)for(const n of t)a.writeUInt32BE(e,n.selectionStartLineNumber,i),i+=4,a.writeUInt32BE(e,n.selectionStartColumn,i),i+=4,a.writeUInt32BE(e,n.positionLineNumber,i),i+=4,a.writeUInt32BE(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=a.readUInt32BE(e,t);t+=4;for(let s=0;se.toString()).join(", ")}matchesResource(e){return(s.URI.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof d}append(e,t,i,n,o){this._data instanceof d&&this._data.append(e,t,i,n,o)}close(){this._data instanceof d&&(this._data=this._data.serialize())}undo(){if(s.URI.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof d&&(this._data=this._data.serialize());const e=d.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(s.URI.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof d&&(this._data=this._data.serialize());const e=d.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}}t.SingleModelEditStackElement=c;class h{
constructor(e,t){this.type=1,this.label=e,this._isOpen=!0,this._editStackElementsArr=t.slice(0),this._editStackElementsMap=new Map;for(const e of this._editStackElementsArr){const t=l(e.resource);this._editStackElementsMap.set(t,e)}this._delegate=null}get resources(){return this._editStackElementsArr.map(e=>e.resource)}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=l(e);return this._editStackElementsMap.has(t)}setModel(e){const t=l(s.URI.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=l(e.uri);if(this._editStackElementsMap.has(t)){return this._editStackElementsMap.get(t).canAppend(e)}return!1}append(e,t,i,n,o){const s=l(e.uri);this._editStackElementsMap.get(s).append(e,t,i,n,o)}close(){this._isOpen=!1}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}split(){
return this._editStackElementsArr}}function u(e){return"\n"===e.getEOL()?0:1}function g(e){return!!e&&(e instanceof c||e instanceof h)}t.MultiModelEditStackElement=h,t.isEditStackElement=g;class p{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);g(e)&&e.close()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e){const t=this._undoRedoService.getLastElement(this._model.uri);if(g(t)&&t.canAppend(this._model))return t;const i=new c(this._model,e);return this._undoRedoService.pushElement(i),i}pushEOL(e){const t=this._getOrCreateEditStackElement(null);this._model.setEOL(e),t.append(this._model,[],u(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i){const n=this._getOrCreateEditStackElement(e),o=this._model.applyEdits(t,!0),s=p._computeCursorState(i,o),r=o.map((e,t)=>({index:t,textChange:e.textChange}))
;return r.sort((e,t)=>e.textChange.oldPosition===t.textChange.oldPosition?e.index-t.index:e.textChange.oldPosition-t.textChange.oldPosition),n.append(this._model,r.map(e=>e.textChange),u(this._model),this._model.getAlternativeVersionId(),s),s}static _computeCursorState(e,t){try{return e?e(t):null}catch(e){return n.onUnexpectedError(e),null}}}t.EditStack=p})),define(t[442],i([5,6]),(function(e,t){return e.create("vs/editor/common/modes/modesRegistry",t)})),define(t[443],i([5,6]),(function(e,t){return e.create("vs/editor/common/standaloneStrings",t)})),define(t[61],i([0,1,443]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleServicesNLS=t.ToggleHighContrastNLS=t.StandaloneCodeEditorNLS=t.QuickOutlineNLS=t.QuickCommandNLS=t.QuickHelpNLS=t.GoToLineNLS=t.InspectTokensNLS=t.AccessibilityHelpNLS=void 0,function(e){e.noSelection=i.localize(0,null),e.singleSelectionRange=i.localize(1,null),e.singleSelection=i.localize(2,null),e.multiSelectionRange=i.localize(3,null),
e.multiSelection=i.localize(4,null),e.emergencyConfOn=i.localize(5,null),e.openingDocs=i.localize(6,null),e.readonlyDiffEditor=i.localize(7,null),e.editableDiffEditor=i.localize(8,null),e.readonlyEditor=i.localize(9,null),e.editableEditor=i.localize(10,null),e.changeConfigToOnMac=i.localize(11,null),e.changeConfigToOnWinLinux=i.localize(12,null),e.auto_on=i.localize(13,null),e.auto_off=i.localize(14,null),e.tabFocusModeOnMsg=i.localize(15,null),e.tabFocusModeOnMsgNoKb=i.localize(16,null),e.tabFocusModeOffMsg=i.localize(17,null),e.tabFocusModeOffMsgNoKb=i.localize(18,null),e.openDocMac=i.localize(19,null),e.openDocWinLinux=i.localize(20,null),e.outroMsg=i.localize(21,null),e.showAccessibilityHelpAction=i.localize(22,null)}(t.AccessibilityHelpNLS||(t.AccessibilityHelpNLS={})),function(e){e.inspectTokensAction=i.localize(23,null)}(t.InspectTokensNLS||(t.InspectTokensNLS={})),function(e){e.gotoLineActionLabel=i.localize(24,null)}(t.GoToLineNLS||(t.GoToLineNLS={})),function(e){
e.helpQuickAccessActionLabel=i.localize(25,null)}(t.QuickHelpNLS||(t.QuickHelpNLS={})),function(e){e.quickCommandActionLabel=i.localize(26,null),e.quickCommandHelp=i.localize(27,null)}(t.QuickCommandNLS||(t.QuickCommandNLS={})),function(e){e.quickOutlineActionLabel=i.localize(28,null),e.quickOutlineByCategoryActionLabel=i.localize(29,null)}(t.QuickOutlineNLS||(t.QuickOutlineNLS={})),function(e){e.editorViewAccessibleLabel=i.localize(30,null),e.accessibilityHelpMessage=i.localize(31,null)}(t.StandaloneCodeEditorNLS||(t.StandaloneCodeEditorNLS={})),function(e){e.toggleHighContrast=i.localize(32,null)}(t.ToggleHighContrastNLS||(t.ToggleHighContrastNLS={})),function(e){e.bulkEditServiceSummary=i.localize(33,null)}(t.SimpleServicesNLS||(t.SimpleServicesNLS={}))})),define(t[444],i([5,6]),(function(e,t){return e.create("vs/editor/common/view/editorColorRegistry",t)})),define(t[445],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/anchorSelect/anchorSelect",t)})),define(t[446],i([5,6]),(function(e,t){
return e.create("vs/editor/contrib/bracketMatching/bracketMatching",t)})),define(t[447],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/caretOperations/caretOperations",t)})),define(t[448],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/caretOperations/transpose",t)})),define(t[449],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/clipboard/clipboard",t)})),define(t[450],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/codeAction/codeActionCommands",t)})),define(t[451],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/codeAction/lightBulbWidget",t)})),define(t[452],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/codelens/codelensController",t)})),define(t[453],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/comment/comment",t)})),define(t[454],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/contextmenu/contextmenu",t)})),define(t[455],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/cursorUndo/cursorUndo",t)})),
define(t[456],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/documentSymbols/outlineTree",t)})),define(t[457],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/find/findController",t)})),define(t[458],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/find/findWidget",t)})),define(t[459],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/folding/folding",t)})),define(t[460],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/fontZoom/fontZoom",t)})),define(t[461],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/format/format",t)})),define(t[462],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/format/formatActions",t)})),define(t[463],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/gotoError/gotoError",t)})),define(t[464],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/gotoError/gotoErrorWidget",t)})),define(t[465],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/gotoSymbol/goToCommands",t)})),
define(t[466],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition",t)})),define(t[467],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/gotoSymbol/peek/referencesController",t)})),define(t[468],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/gotoSymbol/peek/referencesTree",t)})),define(t[469],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/gotoSymbol/peek/referencesWidget",t)})),define(t[470],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/gotoSymbol/referencesModel",t)})),define(t[126],i([0,1,470,4,41,2,8,97,3,59,12]),(function(e,t,i,n,o,s,a,l,d,c,h){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReferencesModel=t.FileReferences=t.FilePreview=t.OneReference=void 0;class u{constructor(e,t,i,n,o){this.isProviderFirst=e,this.parent=t,this.uri=i,this._range=n,this._rangeCallback=o,this.id=l.defaultGenerator.nextId()}get range(){return this._range}set range(e){this._range=e,this._rangeCallback(this)}
get ariaMessage(){return i.localize(0,null,o.basename(this.uri),this.range.startLineNumber,this.range.startColumn)}}t.OneReference=u;class g{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:n,startColumn:o,endLineNumber:s,endColumn:r}=e,a=i.getWordUntilPosition({lineNumber:n,column:o-t}),l=new d.Range(n,a.startColumn,n,o),c=new d.Range(s,r,s,1073741824),h=i.getValueInRange(l).replace(/^\s+/,""),u=i.getValueInRange(e);return{value:h+u+i.getValueInRange(c).replace(/\s+$/,""),highlight:{start:h.length,end:h.length+u.length}}}}t.FilePreview=g;class p{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new c.ResourceMap}dispose(){s.dispose(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length
;return 1===e?i.localize(1,null,o.basename(this.uri),this.uri.fsPath):i.localize(2,null,e,o.basename(this.uri),this.uri.fsPath)}resolve(e){return r(this,void 0,void 0,(function*(){if(0!==this._previews.size)return this;for(let t of this.children)if(!this._previews.has(t.uri))try{const i=yield e.createModelReference(t.uri);this._previews.set(t.uri,new g(i))}catch(e){h.onUnexpectedError(e)}return this}))}}t.FileReferences=p;class m{constructor(e,t){this._disposables=new s.DisposableStore,this.groups=[],this.references=[],this._onDidChangeReferenceRange=new n.Emitter,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;let r;e.sort(m._compareReferences);for(let t of e)if(r&&o.extUri.isEqual(r.uri,t.uri,!0)||(r=new p(this,t.uri),this.groups.push(r)),0===r.children.length||0!==m._compareReferences(t,r.children[r.children.length-1])){const e=new u(i===t,r,t.uri,t.targetSelectionRange||t.range,e=>this._onDidChangeReferenceRange.fire(e));this.references.push(e),
r.children.push(e)}}dispose(){s.dispose(this.groups),this._disposables.dispose(),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new m(this._links,this._title)}get title(){return this._title}get isEmpty(){return 0===this.groups.length}get ariaMessage(){return this.isEmpty?i.localize(3,null):1===this.references.length?i.localize(4,null,this.references[0].uri.fsPath):1===this.groups.length?i.localize(5,null,this.references.length,this.groups[0].uri.fsPath):i.localize(6,null,this.references.length,this.groups.length)}nextOrPreviousReference(e,t){let{parent:i}=e,n=i.children.indexOf(e),o=i.children.length,s=i.parent.groups.length;return 1===s||t&&n+10?(n=t?(n+1)%o:(n+o-1)%o,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%s,i.parent.groups[n].children[0]):(n=(n+s-1)%s,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map((i,n)=>({idx:n,prefixLen:a.commonPrefixLength(i.uri.toString(),e.toString()),
offsetDist:100*Math.abs(i.range.startLineNumber-t.lineNumber)+Math.abs(i.range.startColumn-t.column)})).sort((e,t)=>e.prefixLen>t.prefixLen?-1:e.prefixLent.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&d.Range.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return o.extUri.compare(e.uri,t.uri)||d.Range.compareRangesUsingStarts(e.range,t.range)}}t.ReferencesModel=m})),define(t[471],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/gotoSymbol/symbolNavigation",t)})),define(t[472],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/hover/hover",t)})),define(t[473],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/hover/modesContentHover",t)})),define(t[474],i([5,6]),(function(e,t){
return e.create("vs/editor/contrib/inPlaceReplace/inPlaceReplace",t)})),define(t[475],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/indentation/indentation",t)})),define(t[476],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/linesOperations/linesOperations",t)})),define(t[477],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/links/links",t)})),define(t[478],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/message/messageController",t)})),define(t[479],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/multicursor/multicursor",t)})),define(t[480],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/parameterHints/parameterHints",t)})),define(t[481],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/parameterHints/parameterHintsWidget",t)})),define(t[482],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/peekView/peekView",t)})),define(t[483],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/quickAccess/gotoLineQuickAccess",t)
})),define(t[484],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/quickAccess/gotoSymbolQuickAccess",t)})),define(t[485],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/rename/onTypeRename",t)})),define(t[486],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/rename/rename",t)})),define(t[487],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/rename/renameInputField",t)})),define(t[488],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/smartSelect/smartSelect",t)})),define(t[489],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/snippet/snippetVariables",t)})),define(t[490],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/suggest/suggestController",t)})),define(t[491],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/suggest/suggestWidget",t)})),define(t[492],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode",t)})),define(t[493],i([5,6]),(function(e,t){
return e.create("vs/editor/contrib/tokenization/tokenization",t)})),define(t[494],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/unusualLineTerminators/unusualLineTerminators",t)})),define(t[495],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/wordHighlighter/wordHighlighter",t)})),define(t[496],i([5,6]),(function(e,t){return e.create("vs/platform/actions/browser/menuEntryActionViewItem",t)})),define(t[497],i([5,6]),(function(e,t){return e.create("vs/platform/configuration/common/configurationRegistry",t)})),define(t[498],i([5,6]),(function(e,t){return e.create("vs/platform/keybinding/common/abstractKeybindingService",t)})),define(t[499],i([5,6]),(function(e,t){return e.create("vs/platform/list/browser/listService",t)})),define(t[500],i([5,6]),(function(e,t){return e.create("vs/platform/markers/common/markers",t)})),define(t[501],i([5,6]),(function(e,t){return e.create("vs/platform/quickinput/browser/commandsQuickAccess",t)})),define(t[502],i([5,6]),(function(e,t){
return e.create("vs/platform/quickinput/browser/helpQuickAccess",t)})),define(t[503],i([5,6]),(function(e,t){return e.create("vs/platform/theme/common/colorRegistry",t)})),define(t[504],i([5,6]),(function(e,t){return e.create("vs/platform/undoRedo/common/undoRedoService",t)})),define(t[505],i([0,1,7]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserClipboardService=void 0;t.BrowserClipboardService=class{constructor(){this.mapTextToType=new Map,this.findText=""}writeText(e,t){return r(this,void 0,void 0,(function*(){if(t)return void this.mapTextToType.set(t,e);try{return yield navigator.clipboard.writeText(e)}catch(e){console.error(e)}const n=document.activeElement,o=document.body.appendChild(i.$("textarea",{"aria-hidden":!0}));o.style.height="1px",o.style.width="1px",o.style.position="absolute",o.value=e,o.focus(),o.select(),document.execCommand("copy"),n instanceof HTMLElement&&n.focus(),document.body.removeChild(o)}))}readText(e){
return r(this,void 0,void 0,(function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(e){return console.error(e),""}}))}readFindText(){return r(this,void 0,void 0,(function*(){return this.findText}))}writeFindText(e){return r(this,void 0,void 0,(function*(){this.findText=e}))}}})),define(t[506],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InputFocusedContextKey=void 0,t.InputFocusedContextKey="inputFocus"})),define(t[507],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorOpenContext=void 0,function(e){e[e.API=0]="API",e[e.USER=1]="USER"}(t.EditorOpenContext||(t.EditorOpenContext={}))})),define(t[508],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionIdentifier=void 0;t.ExtensionIdentifier=class{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return"string"==typeof e?e.toLowerCase():e._lower}}})),
define(t[229],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileKind=void 0,function(e){e[e.FILE=0]="FILE",e[e.FOLDER=1]="FOLDER",e[e.ROOT_FOLDER=2]="ROOT_FOLDER"}(t.FileKind||(t.FileKind={}))})),define(t[230],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SyncDescriptor=void 0;t.SyncDescriptor=class{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}})),define(t[71],i([0,1,230]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSingletonServiceDescriptors=t.registerSingleton=void 0;const n=[];t.registerSingleton=function(e,t,o){n.push([e,new i.SyncDescriptor(t,[],o)])},t.getSingletonServiceDescriptors=function(){return n}})),define(t[509],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Graph=t.Node=void 0;class i{constructor(e){this.incoming=new Map,this.outgoing=new Map,this.data=e}}t.Node=i;t.Graph=class{
constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(let t of this._nodes.values())0===t.outgoing.size&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),n=this.lookupOrInsertNode(t);i.outgoing.set(this._hashFn(t),n),n.incoming.set(this._hashFn(e),i)}removeNode(e){const 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){const t=this._hashFn(e);let n=this._nodes.get(t);return n||(n=new i(e),this._nodes.set(t,n)),n}isEmpty(){return 0===this._nodes.size}toString(){let e=[];for(let[t,i]of this._nodes)e.push(`${t}, (incoming)[${[...i.incoming.keys()].join(", ")}], (outgoing)[${[...i.outgoing.keys()].join(",")}]`);return e.join("\n")}}})),define(t[10],i([0,1]),(function(e,t){"use strict";var i;function n(e,t,n,o){t[i.DI_TARGET]===t?t[i.DI_DEPENDENCIES].push({id:e,index:n,optional:o}):(t[i.DI_DEPENDENCIES]=[{id:e,index:n,optional:o}],t[i.DI_TARGET]=t)}function o(e){
if(i.serviceIds.has(e))return i.serviceIds.get(e);const t=function(e,i,o){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");n(t,e,o,!1)};return t.toString=()=>e,i.serviceIds.set(e,t),t}Object.defineProperty(t,"__esModule",{value:!0}),t.optional=t.createDecorator=t.IInstantiationService=t._util=void 0,function(e){e.serviceIds=new Map,e.DI_TARGET="$di$target",e.DI_DEPENDENCIES="$di$dependencies",e.getServiceDependencies=function(t){return t[e.DI_DEPENDENCIES]||[]}}(i=t._util||(t._util={})),t.IInstantiationService=o("instantiationService"),t.createDecorator=o,t.optional=function(e){return function(t,i,o){if(3!==arguments.length)throw new Error("@optional-decorator can only be used to decorate a parameter");n(e,t,o,!0)}}})),define(t[127],i([0,1,10,24,23]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceFileEdit=t.ResourceTextEdit=t.ResourceEdit=t.IBulkEditService=void 0,
t.IBulkEditService=i.createDecorator("IWorkspaceEditService");class s{constructor(e){this.metadata=e}static convert(e){return e.edits.map(e=>{if(function(e){return o.isObject(e)&&n.URI.isUri(e.resource)&&o.isObject(e.edit)}(e))return new r(e.resource,e.edit,e.modelVersionId,e.metadata);if(function(e){return o.isObject(e)&&(Boolean(e.newUri)||Boolean(e.oldUri))}(e))return new a(e.oldUri,e.newUri,e.options,e.metadata);throw new Error("Unsupported edit")})}}t.ResourceEdit=s;class r extends s{constructor(e,t,i,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i,this.metadata=n}}t.ResourceTextEdit=r;class a extends s{constructor(e,t,i,n){super(n),this.oldResource=e,this.newResource=t,this.options=i,this.metadata=n}}t.ResourceFileEdit=a})),define(t[27],i([0,1,10]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ICodeEditorService=void 0,t.ICodeEditorService=i.createDecorator("codeEditorService")})),define(t[72],i([0,1,10]),(function(e,t,i){"use strict"
;Object.defineProperty(t,"__esModule",{value:!0}),t.IEditorWorkerService=t.ID_EDITOR_WORKER_SERVICE=void 0,t.ID_EDITOR_WORKER_SERVICE="editorWorkerService",t.IEditorWorkerService=i.createDecorator(t.ID_EDITOR_WORKER_SERVICE)})),define(t[231],i([0,1,10]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IMarkerDecorationsService=void 0,t.IMarkerDecorationsService=i.createDecorator("markerDecorationsService")})),define(t[73],i([0,1,10]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IModeService=void 0,t.IModeService=i.createDecorator("modeService")})),define(t[44],i([0,1,10]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldSynchronizeModel=t.IModelService=void 0,t.IModelService=i.createDecorator("modelService"),t.shouldSynchronizeModel=function(e){return!e.isTooLargeForSyncing()&&!e.isForSimpleWidget}})),define(t[510],i([0,1,4,2,366,44]),(function(e,t,i,n,o,s){"use strict";function r(e){
return"string"!=typeof e&&(Array.isArray(e)?e.every(r):!!e.exclusive)}Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageFeatureRegistry=void 0;class a{constructor(){this._clock=0,this._entries=[],this._onDidChange=new i.Emitter}get onDidChange(){return this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),n.toDisposable(()=>{if(i){let e=this._entries.indexOf(i);e>=0&&(this._entries.splice(e,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(let e of this._entries)e._score>0&&t.push(e.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,e=>t.push(e.provider)),t}orderedGroups(e){const t=[];let i,n;return this._orderedForEach(e,e=>{i&&n===e._score?i.push(e.provider):(n=e._score,i=[e.provider],t.push(i))}),t}
_orderedForEach(e,t){if(e){this._updateScores(e);for(const e of this._entries)e._score>0&&t(e)}}_updateScores(e){let t={uri:e.uri.toString(),language:e.getLanguageIdentifier().language};if(!this._lastCandidate||this._lastCandidate.language!==t.language||this._lastCandidate.uri!==t.uri){this._lastCandidate=t;for(let t of this._entries)if(t._score=o.score(t.selector,e.uri,e.getLanguageIdentifier().language,s.shouldSynchronizeModel(e)),r(t.selector)&&t._score>0){for(let e of this._entries)e._score=0;t._score=1e3;break}this._entries.sort(a._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:e._timet._time?-1:0}}t.LanguageFeatureRegistry=a})),define(t[18],i([0,1,24,3,510,374,26]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),
t.TokenizationRegistry=t.DocumentRangeSemanticTokensProviderRegistry=t.DocumentSemanticTokensProviderRegistry=t.FoldingRangeProviderRegistry=t.SelectionRangeRegistry=t.ColorProviderRegistry=t.LinkProviderRegistry=t.OnTypeFormattingEditProviderRegistry=t.DocumentRangeFormattingEditProviderRegistry=t.DocumentFormattingEditProviderRegistry=t.CodeActionProviderRegistry=t.CodeLensProviderRegistry=t.TypeDefinitionProviderRegistry=t.ImplementationProviderRegistry=t.DeclarationProviderRegistry=t.DefinitionProviderRegistry=t.OnTypeRenameProviderRegistry=t.DocumentHighlightProviderRegistry=t.DocumentSymbolProviderRegistry=t.HoverProviderRegistry=t.SignatureHelpProviderRegistry=t.CompletionProviderRegistry=t.RenameProviderRegistry=t.ReferenceProviderRegistry=t.FoldingRangeKind=t.SymbolKinds=t.isLocationLink=t.DocumentHighlightKind=t.SignatureHelpTriggerKind=t.completionKindFromString=t.completionKindToCssClass=t.TokenMetadata=t.LanguageIdentifier=void 0;t.LanguageIdentifier=class{constructor(e,t){this.language=e,
this.id=t}};t.TokenMetadata=class{static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(1792&e)>>>8}static getFontStyle(e){return(14336&e)>>>11}static getForeground(e){return(8372224&e)>>>14}static getBackground(e){return(4286578688&e)>>>23}static getClassNameFromMetadata(e){let t="mtk"+this.getForeground(e),i=this.getFontStyle(e);return 1&i&&(t+=" mtki"),2&i&&(t+=" mtkb"),4&i&&(t+=" mtku"),t}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),n=this.getFontStyle(e);let o=`color: ${t[i]};`;return 1&n&&(o+="font-style: italic;"),2&n&&(o+="font-weight: bold;"),4&n&&(o+="text-decoration: underline;"),o}},t.completionKindToCssClass=function(){let e=Object.create(null);return e[0]="symbol-method",e[1]="symbol-function",e[2]="symbol-constructor",e[3]="symbol-field",e[4]="symbol-variable",e[5]="symbol-class",e[6]="symbol-struct",e[7]="symbol-interface",e[8]="symbol-module",e[9]="symbol-property",e[10]="symbol-event",e[11]="symbol-operator",e[12]="symbol-unit",e[13]="symbol-value",
e[14]="symbol-constant",e[15]="symbol-enum",e[16]="symbol-enum-member",e[17]="symbol-keyword",e[27]="symbol-snippet",e[18]="symbol-text",e[19]="symbol-color",e[20]="symbol-file",e[21]="symbol-reference",e[22]="symbol-customcolor",e[23]="symbol-folder",e[24]="symbol-type-parameter",e[25]="account",e[26]="issues",function(t){const i=e[t];let n=i&&r.iconRegistry.get(i);return n||(console.info("No codicon found for CompletionItemKind "+t),n=r.Codicon.symbolProperty),n.classNames}}(),t.completionKindFromString=function(){let e=Object.create(null);return e.method=0,e.function=1,e.constructor=2,e.field=3,e.variable=4,e.class=5,e.struct=6,e.interface=7,e.module=8,e.property=9,e.event=10,e.operator=11,e.unit=12,e.value=13,e.constant=14,e.enum=15,e["enum-member"]=16,e.enumMember=16,e.keyword=17,e.snippet=27,e.text=18,e.color=19,e.file=20,e.reference=21,e.customcolor=22,e.folder=23,e["type-parameter"]=24,e.typeParameter=24,e.account=25,e.issue=26,function(t,i){let n=e[t];return void 0!==n||i||(n=9),n}}(),function(e){
e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(t.SignatureHelpTriggerKind||(t.SignatureHelpTriggerKind={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(t.DocumentHighlightKind||(t.DocumentHighlightKind={})),t.isLocationLink=function(e){return e&&i.URI.isUri(e.uri)&&n.Range.isIRange(e.range)&&(n.Range.isIRange(e.originSelectionRange)||n.Range.isIRange(e.targetSelectionRange))},function(e){const t=new Map;t.set("file",0),t.set("module",1),t.set("namespace",2),t.set("package",3),t.set("class",4),t.set("method",5),t.set("property",6),t.set("field",7),t.set("constructor",8),t.set("enum",9),t.set("interface",10),t.set("function",11),t.set("variable",12),t.set("constant",13),t.set("string",14),t.set("number",15),t.set("boolean",16),t.set("array",17),t.set("object",18),t.set("key",19),t.set("null",20),t.set("enum-member",21),t.set("struct",22),t.set("event",23),t.set("operator",24),t.set("type-parameter",25);const i=new Map
;i.set(0,"file"),i.set(1,"module"),i.set(2,"namespace"),i.set(3,"package"),i.set(4,"class"),i.set(5,"method"),i.set(6,"property"),i.set(7,"field"),i.set(8,"constructor"),i.set(9,"enum"),i.set(10,"interface"),i.set(11,"function"),i.set(12,"variable"),i.set(13,"constant"),i.set(14,"string"),i.set(15,"number"),i.set(16,"boolean"),i.set(17,"array"),i.set(18,"object"),i.set(19,"key"),i.set(20,"null"),i.set(21,"enum-member"),i.set(22,"struct"),i.set(23,"event"),i.set(24,"operator"),i.set(25,"type-parameter"),e.fromString=function(e){return t.get(e)},e.toString=function(e){return i.get(e)},e.toCssClassName=function(e,t){const n=i.get(e);let o=n&&r.iconRegistry.get("symbol-"+n);return o||(console.info("No codicon found for SymbolKind "+e),o=r.Codicon.symbolProperty),`${t?"inline":"block"} ${o.classNames}`}}(t.SymbolKinds||(t.SymbolKinds={}));class a{constructor(e){this.value=e}}t.FoldingRangeKind=a,a.Comment=new a("comment"),a.Imports=new a("imports"),a.Region=new a("region"),
t.ReferenceProviderRegistry=new o.LanguageFeatureRegistry,t.RenameProviderRegistry=new o.LanguageFeatureRegistry,t.CompletionProviderRegistry=new o.LanguageFeatureRegistry,t.SignatureHelpProviderRegistry=new o.LanguageFeatureRegistry,t.HoverProviderRegistry=new o.LanguageFeatureRegistry,t.DocumentSymbolProviderRegistry=new o.LanguageFeatureRegistry,t.DocumentHighlightProviderRegistry=new o.LanguageFeatureRegistry,t.OnTypeRenameProviderRegistry=new o.LanguageFeatureRegistry,t.DefinitionProviderRegistry=new o.LanguageFeatureRegistry,t.DeclarationProviderRegistry=new o.LanguageFeatureRegistry,t.ImplementationProviderRegistry=new o.LanguageFeatureRegistry,t.TypeDefinitionProviderRegistry=new o.LanguageFeatureRegistry,t.CodeLensProviderRegistry=new o.LanguageFeatureRegistry,t.CodeActionProviderRegistry=new o.LanguageFeatureRegistry,t.DocumentFormattingEditProviderRegistry=new o.LanguageFeatureRegistry,t.DocumentRangeFormattingEditProviderRegistry=new o.LanguageFeatureRegistry,
t.OnTypeFormattingEditProviderRegistry=new o.LanguageFeatureRegistry,t.LinkProviderRegistry=new o.LanguageFeatureRegistry,t.ColorProviderRegistry=new o.LanguageFeatureRegistry,t.SelectionRangeRegistry=new o.LanguageFeatureRegistry,t.FoldingRangeProviderRegistry=new o.LanguageFeatureRegistry,t.DocumentSemanticTokensProviderRegistry=new o.LanguageFeatureRegistry,t.DocumentRangeSemanticTokensProviderRegistry=new o.LanguageFeatureRegistry,t.TokenizationRegistry=new s.TokenizationRegistryImpl})),define(t[105],i([0,1,18]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SlicedLineTokens=t.LineTokens=void 0;class n{constructor(e,t){this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t}equals(e){return e instanceof n&&this.slicedEquals(e,0,this._tokensCount)}slicedEquals(e,t,i){if(this._text!==e._text)return!1;if(this._tokensCount!==e._tokensCount)return!1;const n=t<<1,o=n+(i<<1);for(let t=n;t0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[1+(e<<1)]}getLanguageId(e){const t=this._tokens[1+(e<<1)];return i.TokenMetadata.getLanguageId(t)}getStandardTokenType(e){const t=this._tokens[1+(e<<1)];return i.TokenMetadata.getTokenType(t)}getForeground(e){const t=this._tokens[1+(e<<1)];return i.TokenMetadata.getForeground(t)}getClassName(e){const t=this._tokens[1+(e<<1)];return i.TokenMetadata.getClassNameFromMetadata(t)}getInlineStyle(e,t){const n=this._tokens[1+(e<<1)];return i.TokenMetadata.getInlineStyleFromMetadata(n,t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return n.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new o(this,e,t,i)}static convertToEndOffset(e,t){const i=(e.length>>>1)-1;for(let t=0;t>>1)-1;for(;it&&(n=o)}return i}}t.LineTokens=n;class o{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let t=this._firstTokenIndex,n=e.getCount();t=i)break;this._tokensCount++}}equals(e){return e instanceof o&&(this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount))}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}
findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}t.SlicedLineTokens=o})),define(t[128],i([0,1,19,105,13,3,18]),(function(e,t,i,n,o,s,r){"use strict";function a(e){let t=0,i=0,n=0,o=0;for(let s=0,r=e.length;s>>0}Object.defineProperty(t,"__esModule",{value:!0}),t.TokensStore=t.TokensStore2=t.MultilineTokens=t.MultilineTokens2=t.LineTokens2=t.SparseEncodedTokens=t.MultilineTokensBuilder=t.countEOL=void 0,t.countEOL=a;const d=new Uint32Array(0).buffer;t.MultilineTokensBuilder=class{constructor(){this.tokens=[]}add(e,t){if(this.tokens.length>0){const i=this.tokens[this.tokens.length-1];if(i.startLineNumber+i.tokens.length-1+1===e)return void i.tokens.push(t)}this.tokens.push(new g(e,[t]))}};class c{
constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){let t=[];for(let i=0;ie)){let o=n;for(;o>t&&this._getDeltaLine(o-1)===e;)o--;let s=n;for(;se||c===e&&u>=t)&&(ce||c===e&&g>=t){if(co?p-=o-i:p=i;else if(u===t&&g===i){if(!(u===n&&p>o)){d=!0;continue}p-=o-i
}else if(uo)){d=!0;continue}p=u===t?(g=i)+(p-o):(g=0)+(p-o)}else if(u>n){if(0===a&&!d){l=r;break}u-=a}else{if(!(u===n&&g>=o))throw new Error("Not possible!");e&&0===u&&(g+=e,p+=e),u-=a,g-=o-i,p-=o-i}const f=4*l;s[f]=u,s[f+1]=g,s[f+2]=p,s[f+3]=m,l++}this._tokenCount=l}acceptInsertText(e,t,i,n,o,s){const r=0===i&&1===n&&(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122),a=this._tokens,l=this._tokenCount;for(let s=0;s0?t.charCodeAt(0):0)}acceptEdit(e,t,i,n,s){this._acceptDeleteRange(e),this._acceptInsertText(new o.Position(e.startLineNumber,e.startColumn),t,i,n,s),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this.startLineNumber,i=e.endLineNumber-this.startLineNumber;if(i<0){const e=i-t;return void(this.startLineNumber-=e)}const n=this.tokens.getMaxDeltaLine();if(!(t>=n+1)){if(t<0&&i>=n+1)return this.startLineNumber=0,void this.tokens.clear();if(t<0){const n=-t;this.startLineNumber-=n,this.tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this.tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,n,o){if(0===t&&0===i)return;const s=e.lineNumber-this.startLineNumber
;s<0?this.startLineNumber+=t:s>=this.tokens.getMaxDeltaLine()+1||this.tokens.acceptInsertText(s,e.column-1,t,i,n,o)}}t.MultilineTokens2=u;class g{constructor(e,t){this.startLineNumber=e,this.tokens=t}}function p(e){return e instanceof Uint32Array?e:new Uint32Array(e)}t.MultilineTokens=g;class m{constructor(){this._pieces=[],this._isComplete=!1}flush(){this._pieces=[],this._isComplete=!1}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let n=e;if(t.length>0){const i=t[0].getRange(),o=t[t.length-1].getRange();if(!i||!o)return e;n=e.plusRange(i).plusRange(o)}let o=null;for(let e=0,t=this._pieces.length;en.endLineNumber){o=o||{index:e};break}if(i.removeTokens(n),i.isEmpty()){this._pieces.splice(e,1),e--,t--;continue}if(i.endLineNumbern.endLineNumber){o=o||{index:e};continue}const[s,r]=i.split(n);s.isEmpty()?o=o||{index:e
}:r.isEmpty()||(this._pieces.splice(e,1,s,r),e++,t++,o=o||{index:e})}return o=o||{index:this._pieces.length},t.length>0&&(this._pieces=i.arrayInsert(this._pieces,o.index,t)),n}isComplete(){return this._isComplete}addSemanticTokens(e,t){const i=this._pieces;if(0===i.length)return t;const o=i[m._findFirstPieceWithLine(i,e)].getLineTokens(e);if(!o)return t;const s=t.getCount(),r=o.getCount();let a=0,l=[],d=0,c=0;const h=(e,t)=>{e!==c&&(c=e,l[d++]=e,l[d++]=t)};for(let e=0;e>>0,d=~l>>>0;for(;at)){for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}n=o-1}}return i}acceptEdit(e,t,i,n,o){for(const s of this._pieces)s.acceptEdit(e,t,i,n,o)}}t.TokensStore2=m;class f{constructor(){this._lineTokens=[],this._len=0}flush(){this._lineTokens=[],this._len=0}getTokens(e,t,i){let o=null;if(t1&&(t=r.TokenMetadata.getLanguageId(n[1])!==e),!t)return d}if(!n||0===n.length){const i=new Uint32Array(2);return i[0]=t,i[1]=l(e),i.buffer}return n[n.length-2]=t,
0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(0===t)return;let n=[];for(let e=0;e=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return
;return void(this._lineTokens[t]=f._delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1))}this._lineTokens[t]=f._deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i=this._len||(0!==t?(this._lineTokens[n]=f._deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=f._insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)):this._lineTokens[n]=f._insert(this._lineTokens[n],e.column-1,i))}static _deleteBeginning(e,t){return null===e||e===d?e:f._delete(e,0,t)}static _deleteEnding(e,t){if(null===e||e===d)return e;const i=p(e),n=i[i.length-2];return f._delete(e,t,n)}static _delete(e,t,i){if(null===e||e===d||t===i)return e;const o=p(e),s=o.length>>>1;if(0===t&&o[o.length-2]===i)return d
;const r=n.LineTokens.findIndexInTokensArray(o,t),a=r>0?o[r-1<<1]:0;if(ic&&(o[l++]=t,o[l++]=o[1+(e<<1)],c=t)}if(l===o.length)return e;let u=new Uint32Array(l);return u.set(o.subarray(0,l),0),u.buffer}static _append(e,t){if(t===d)return e;if(e===d)return t;if(null===e)return e;if(null===t)return null;const i=p(e),n=p(t),o=n.length>>>1;let s=new Uint32Array(i.length+n.length);s.set(i,0);let r=i.length;const a=i[i.length-2];for(let e=0;e>>1;let r=n.LineTokens.findIndexInTokensArray(o,t);if(r>0){o[r-1<<1]===t&&r--}for(let e=r;ee.sortIndex-t.sortIndex)}this._mightContainRTL=o,this._mightContainUnusualLineTerminators=r,this._mightContainNonBasicASCII=c;const _=this._doApplyEdits(u);let v=null;if(t&&m.length>0){m.sort((e,t)=>t.lineNumber-e.lineNumber),v=[];for(let e=0,t=m.length;e0&&m[e-1].lineNumber===t)continue;let i=m[e].oldContent,o=this.getLineContent(t);0!==o.length&&o!==i&&-1===n.firstNonWhitespaceIndex(o)&&v.push(t)}}return this._onDidChangeContent.fire(),new s.ApplyEditsResult(f,_,v)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,n=e[e.length-1].range,s=new o.Range(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let r=i.startLineNumber,l=i.startColumn;const d=[];for(let i=0,n=e.length;i0&&d.push(n.text),r=s.endLineNumber,l=s.endColumn}const c=d.join(""),[h,u,g]=a.countEOL(c);return{sortIndex:0,identifier:e[0].identifier,range:s,rangeOffset:this.getOffsetAt(s.startLineNumber,s.startColumn),rangeLength:this.getValueLengthInRange(s,0),text:c,eolCount:h,firstLineLength:u,lastLineLength:g,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(d._sortOpsDescending);let t=[];for(let i=0;i0){const e=c.eolCount+1;d=1===e?new o.Range(a,l,a,l+c.firstLineLength):new o.Range(a,l,a+e-1,c.lastLineLength+1)}else d=new o.Range(a,l,a,l);i=d.endLineNumber,n=d.endColumn,t.push(d),s=c}return t}static _sortOpsAscending(e,t){let i=o.Range.compareRangesUsingEnds(e.range,t.range);return 0===i?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){let i=o.Range.compareRangesUsingEnds(e.range,t.range);return 0===i?t.sortIndex-e.sortIndex:-i}}t.PieceTreeTextBuffer=d})),define(t[512],i([0,1,8,211,511]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),
t.PieceTreeTextBufferBuilder=t.PieceTreeTextBufferFactory=void 0;class s{constructor(e,t,i,n,o,s,r,a,l){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=o,this._containsRTL=s,this._containsUnusualLineTerminators=r,this._isBasicASCII=a,this._normalizeEOL=l}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return 0===t?1===e?"\n":"\r\n":i>t/2?"\r\n":"\n"}create(e){const t=this._getEOL(e);let i=this._chunks;if(this._normalizeEOL&&("\r\n"===t&&(this._cr>0||this._lf>0)||"\n"===t&&(this._cr>0||this._crlf>0)))for(let e=0,o=i.length;e=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){(t||0!==e.length)&&(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=n.createLineStarts(this._tmpLineStarts,e);this.chunks.push(new n.StringBuffer(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,this.isBasicASCII&&(this.isBasicASCII=t.isBasicASCII),this.isBasicASCII||this.containsRTL||(this.containsRTL=i.containsRTL(e)),this.isBasicASCII||this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=i.containsUnusualLineTerminators(e))}finish(e=!0){
return this._finish(),new s(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(0===this.chunks.length&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;let e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);let t=n.createLineStartsFast(e.buffer);e.lineStarts=t,13===this._previousChar&&this.cr++}}}})),define(t[74],i([0,1,121,18]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nullTokenize2=t.nullTokenize=t.NULL_LANGUAGE_IDENTIFIER=t.NULL_MODE_ID=t.NULL_STATE=void 0;t.NULL_STATE=new class{clone(){return this}equals(e){return this===e}},t.NULL_MODE_ID="vs.editor.nullMode",t.NULL_LANGUAGE_IDENTIFIER=new n.LanguageIdentifier(t.NULL_MODE_ID,0),t.nullTokenize=function(e,t,n,o){return new i.TokenizationResult([new i.Token(o,"",e)],n)},t.nullTokenize2=function(e,n,o,s){let r=new Uint32Array(2);return r[0]=s,r[1]=(16384|e<<0|2<<23)>>>0,
new i.TokenizationResult2(r,null===o?t.NULL_STATE:o)}})),define(t[513],i([0,1,19,12,105,13,18,74,2,111,128,16]),(function(e,t,i,n,o,s,r,a,l,d,c,h){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextModelTokenization=t.TokenizationStateStore=void 0;class u{constructor(){this._beginState=[],this._valid=[],this._len=0,this._invalidLineStartIndex=0}_reset(e){this._beginState=[],this._valid=[],this._len=0,this._invalidLineStartIndex=0,e&&this._setBeginState(0,e)}flush(e){this._reset(e)}get invalidLineStartIndex(){return this._invalidLineStartIndex}_invalidateLine(e){e=this._len;)this._beginState[this._len]=null,this._valid[this._len]=!1,this._len++}_deleteLines(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._beginState.splice(e,t),this._valid.splice(e,t),this._len-=t)}
_insertLines(e,t){if(0===t)return;let n=[],o=[];for(let e=0;e=0;t--)this._invalidateLine(e.startLineNumber+t-1);this._acceptDeleteRange(e),this._acceptInsertText(new s.Position(e.startLineNumber,e.startColumn),t)}_acceptDeleteRange(e){e.startLineNumber-1>=this._len||this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t){
e.lineNumber-1>=this._len||this._insertLines(e.lineNumber,t)}}t.TokenizationStateStore=u;class g extends l.Disposable{constructor(e){super(),this._isDisposed=!1,this._textModel=e,this._tokenizationStateStore=new u,this._tokenizationSupport=null,this._register(r.TokenizationRegistry.onDidChange(e=>{const t=this._textModel.getLanguageIdentifier();-1!==e.changedLanguages.indexOf(t.language)&&(this._resetTokenizationState(),this._textModel.clearTokens())})),this._register(this._textModel.onDidChangeRawContentFast(e=>{e.containsEvent(1)&&this._resetTokenizationState()})),this._register(this._textModel.onDidChangeContentFast(e=>{for(let t=0,i=e.changes.length;t{this._beginBackgroundTokenization()})),this._register(this._textModel.onDidChangeLanguage(()=>{this._resetTokenizationState(),this._textModel.clearTokens()})),
this._resetTokenizationState()}dispose(){this._isDisposed=!0,super.dispose()}_resetTokenizationState(){const[e,t]=function(e){const t=e.getLanguageIdentifier();let i=e.isTooLargeForTokenization()?null:r.TokenizationRegistry.get(t.language),o=null;if(i)try{o=i.getInitialState()}catch(e){n.onUnexpectedError(e),i=null}return[i,o]}(this._textModel);this._tokenizationSupport=e,this._tokenizationStateStore.flush(t),this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&h.setImmediate(()=>{this._isDisposed||this._revalidateTokensNow()})}_revalidateTokensNow(e=this._textModel.getLineCount()){const t=new c.MultilineTokensBuilder,i=d.StopWatch.create(!1);for(;this._hasLinesToTokenize()&&!(i.elapsed()>1);){if(this._tokenizeOneInvalidLine(t)>=e)break}this._beginBackgroundTokenization(),this._textModel.setTokens(t.tokens)}tokenizeViewport(e,t){const i=new c.MultilineTokensBuilder;this._tokenizeViewport(i,e,t),this._textModel.setTokens(i.tokens)}
reset(){this._resetTokenizationState(),this._textModel.clearTokens()}forceTokenization(e){const t=new c.MultilineTokensBuilder;this._updateTokensUntilLine(t,e),this._textModel.setTokens(t.tokens)}isCheapToTokenize(e){if(!this._tokenizationSupport)return!0;const t=this._tokenizationStateStore.invalidLineStartIndex+1;return!(e>t)&&(e0&&e>=1;e--){let t=this._textModel.getLineFirstNonWhitespaceColumn(e);if(0!==t&&t=0;e--){a=p(r,this._tokenizationSupport,o[e],a).endState}for(let n=t;n<=i;n++){
let t=this._textModel.getLineContent(n),i=p(r,this._tokenizationSupport,t,a);e.add(n,i.tokens),this._tokenizationStateStore.setFakeTokens(n-1),a=i.endState}}}function p(e,t,i,s){let r=null;if(t)try{r=t.tokenize2(i,s.clone(),0)}catch(e){n.onUnexpectedError(e)}return r||(r=a.nullTokenize2(e.id,i,s,0)),o.LineTokens.convertToEndOffset(r.tokens,i.length),r}t.TextModelTokenization=g})),define(t[31],i([0,1,12,4,2,8,24,38,13,3,20,52,228,361,362,512,364,158,513,122,42,74,159,160,128,29]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y,E,L){"use strict";function x(e){const t=new m.PieceTreeTextBufferBuilder;return t.acceptChunk(e),t.finish()}function D(e,t){return("string"==typeof e?x(e):e).create(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeContentEmitter=t.DidChangeDecorationsEmitter=t.ModelDecorationOptions=t.ModelDecorationMinimapOptions=t.ModelDecorationOverviewRulerOptions=t.TextModel=t.LONG_LINE_BOUNDARY=t.createTextBuffer=t.createTextBufferFactory=void 0,t.createTextBufferFactory=x,
t.createTextBuffer=D;let k=0;const N=999;t.LONG_LINE_BOUNDARY=1e4;class I{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;let e=[],t=0,i=0;for(;;){let n=this._source.read();if(null===n)return this._eos=!0,0===t?null:e.join("");if(n.length>0&&(e[t++]=n,i+=n.length),i>=65536)return e.join("")}}}const M=()=>{throw new Error("Invalid change accessor")};class R{constructor(){this._searchCanceledBrand=void 0}}function T(e){return e instanceof R?null:e}R.INSTANCE=new R;class O extends o.Disposable{constructor(e,t,i,o=null,a){super(),this._onWillDispose=this._register(new n.Emitter),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new K),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeLanguage=this._register(new n.Emitter),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new n.Emitter),
this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new n.Emitter),this.onDidChangeTokens=this._onDidChangeTokens.event,this._onDidChangeOptions=this._register(new n.Emitter),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new n.Emitter),this.onDidChangeAttached=this._onDidChangeAttached.event,this._eventEmitter=this._register(new U),k++,this.id="$model"+k,this.isForSimpleWidget=t.isForSimpleWidget,this._associatedResource=null==o?r.URI.parse("inmemory://model/"+k):o,this._undoRedoService=a,this._attachedEditorCount=0,this._buffer=D(e,t.defaultEOL),this._options=O.resolveOptions(this._buffer,t);const l=this._buffer.getLineCount(),c=this._buffer.getValueLengthInRange(new d.Range(1,1,l,this._buffer.getLineLength(l)+1),0);t.largeFileOptimizations?this._isTooLargeForTokenization=c>O.LARGE_FILE_SIZE_THRESHOLD||l>O.LARGE_FILE_LINE_COUNT_THRESHOLD:this._isTooLargeForTokenization=!1,
this._isTooLargeForSyncing=c>O.MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this._isDisposing=!1,this._languageIdentifier=i||S.NULL_LANGUAGE_IDENTIFIER,this._languageRegistryListener=b.LanguageConfigurationRegistry.onDidChange(e=>{e.languageIdentifier.id===this._languageIdentifier.id&&this._onDidChangeLanguageConfiguration.fire({})}),this._instanceId=s.singleLetterHash(k),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new A,this._commandManager=new u.EditStack(this,a),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._tokens=new E.TokensStore,this._tokens2=new E.TokensStore2,this._tokenization=new v.TextModelTokenization(this)}static resolveOptions(e,t){if(t.detectIndentation){const i=g.guessIndentation(e,t.tabSize,t.insertSpaces);return new h.TextModelResolvedOptions({tabSize:i.tabSize,indentSize:i.tabSize,insertSpaces:i.insertSpaces,
trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL})}return new h.TextModelResolvedOptions({tabSize:t.tabSize,indentSize:t.indentSize,insertSpaces:t.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL})}onDidChangeRawContentFast(e){return this._eventEmitter.fastEvent(t=>e(t.rawContentChangedEvent))}onDidChangeContentFast(e){return this._eventEmitter.fastEvent(t=>e(t.contentChangedEvent))}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}dispose(){this._isDisposing=!0,this._onWillDispose.fire(),this._languageRegistryListener.dispose(),this._tokenization.dispose(),this._isDisposed=!0,super.dispose(),this._isDisposing=!1}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this._isDisposing||this._eventEmitter.fire(new f.InternalModelContentChangeEvent(e,t))}setValue(e){if(this._assertNotDisposed(),null===e)return;const t=D(e,this._options.defaultEOL);this.setValueFromTextBuffer(t)}
_createContentChanged2(e,t,i,n,o,s,r){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:o,isRedoing:s,isFlush:r}}setValueFromTextBuffer(e){if(this._assertNotDisposed(),null===e)return;const t=this.getFullModelRange(),i=this.getValueLengthInRange(t),n=this.getLineCount(),o=this.getLineMaxColumn(n);this._buffer=e,this._increaseVersionId(),this._tokens.flush(),this._tokens2.flush(),this._decorations=Object.create(null),this._decorationsTree=new A,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new f.ModelRawContentChangedEvent([new f.ModelRawFlush],this._versionId,!1,!1),this._createContentChanged2(new d.Range(1,1,n,o),0,i,this.getValue(),!1,!1,!0))}setEOL(e){this._assertNotDisposed();const t=1===e?"\r\n":"\n";if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._onBeforeEOLChange(),
this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new f.ModelRawContentChangedEvent([new f.ModelRawEOLChanged],this._versionId,!1,!1),this._createContentChanged2(new d.Range(1,1,o,s),0,n,this.getValue(),!1,!1,!1))}_onBeforeEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.search(0,!1,!1,e);this._ensureNodesHaveRanges(t)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,i=0;const n=this._buffer.getLineCount();for(let o=1;o<=n;o++){const n=this._buffer.getLineLength(o);n>=t.LONG_LINE_BOUNDARY?i+=n:e+=n}return i>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed()
;let t=void 0!==e.tabSize?e.tabSize:this._options.tabSize,i=void 0!==e.indentSize?e.indentSize:this._options.indentSize,n=void 0!==e.insertSpaces?e.insertSpaces:this._options.insertSpaces,o=void 0!==e.trimAutoWhitespace?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s=new h.TextModelResolvedOptions({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o});if(this._options.equals(s))return;let r=this._options.createChangeEvent(s);this._options=s,this._onDidChangeOptions.fire(r)}detectIndentation(e,t){this._assertNotDisposed();let i=g.guessIndentation(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}static _normalizeIndentationFromWhitespace(e,t,i){let n=0;for(let i=0;i({range:e.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getOffsetAt(e){this._assertNotDisposed();let t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}
getPositionAt(e){this._assertNotDisposed();let t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueInRange(i,e);return t?this._buffer.getBOM()+n:n}createSnapshot(e=!1){return new I(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+n:n}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}
getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){return this._assertNotDisposed(),this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber")
;return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let o,s;if(i<1)o=1,s=1;else if(i>t)o=t,s=this.getLineMaxColumn(o);else if(o=0|i,n<=1)s=1;else{const e=this.getLineMaxColumn(o);s=n>=e?e:0|n}const r=e.endLineNumber,a=e.endColumn;let l,h;if(r<1)l=1,h=1;else if(r>t)l=t,h=this.getLineMaxColumn(l);else if(l=0|r,a<=1)h=1;else{const e=this.getLineMaxColumn(l);h=a>=e?e:0|a}return i===o&&n===s&&r===l&&a===h&&e instanceof d.Range&&!(e instanceof c.Selection)?e:new d.Range(o,s,l,h)}_isValidPosition(e,t,i){if("number"!=typeof e||"number"!=typeof t)return!1;if(isNaN(e)||isNaN(t))return!1;if(e<1||t<1)return!1;if((0|e)!==e||(0|t)!==t)return!1;if(e>this._buffer.getLineCount())return!1;if(1===t)return!0
;if(t>this.getLineMaxColumn(e))return!1;if(1===i){const i=this._buffer.getLineCharCode(e,t-2);if(s.isHighSurrogate(i))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor("number"!=typeof e||isNaN(e)?1:e),o=Math.floor("number"!=typeof t||isNaN(t)?1:t),r=this._buffer.getLineCount();if(n<1)return new l.Position(1,1);if(n>r)return new l.Position(r,this.getLineMaxColumn(r));if(o<=1)return new l.Position(n,1);const a=this.getLineMaxColumn(n);if(o>=a)return new l.Position(n,a);if(1===i){const e=this._buffer.getLineCharCode(n,o-2);if(s.isHighSurrogate(e))return new l.Position(n,o-1)}return new l.Position(n,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof l.Position&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,n,0))return!1;if(!this._isValidPosition(o,r,0))return!1;if(1===t){
const e=n>1?this._buffer.getLineCharCode(i,n-2):0,t=r>1&&r<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,r-2):0,a=s.isHighSurrogate(e),l=s.isHighSurrogate(t);return!a&&!l}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof d.Range&&!(e instanceof c.Selection)&&this._isValidRange(e,1))return e;const t=this._validatePosition(e.startLineNumber,e.startColumn,0),i=this._validatePosition(e.endLineNumber,e.endColumn,0),n=t.lineNumber,o=t.column,r=i.lineNumber,a=i.column;{const e=o>1?this._buffer.getLineCharCode(n,o-2):0,t=a>1&&a<=this._buffer.getLineLength(r)?this._buffer.getLineCharCode(r,a-2):0,i=s.isHighSurrogate(e),l=s.isHighSurrogate(t);return i||l?n===r&&o===a?new d.Range(n,o-1,r,a-1):i&&l?new d.Range(n,o-1,r,a+1):i?new d.Range(n,o-1,r,a):new d.Range(n,o,r,a+1):new d.Range(n,o,r,a)}}modifyPosition(e,t){this._assertNotDisposed();let i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed()
;const e=this.getLineCount();return new d.Range(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,o,s,r=N){this._assertNotDisposed();let a=null;null!==t&&(Array.isArray(t)||(t=[t]),t.every(e=>d.Range.isIRange(e))&&(a=t.map(e=>this.validateRange(e)))),null===a&&(a=[this.getFullModelRange()]),a=a.sort((e,t)=>e.startLineNumber-t.startLineNumber||e.startColumn-t.startColumn);const l=[];let c;if(l.push(a.reduce((e,t)=>d.Range.areIntersecting(e,t)?e.plusRange(t):(l.push(e),t))),!i&&e.indexOf("\n")<0){const t=new _.SearchParams(e,i,n,o).parseSearchRequest();if(!t)return[];c=e=>this.findMatchesLineByLine(e,t,s,r)}else c=t=>_.TextModelSearch.findMatches(this,new _.SearchParams(e,i,n,o),t,s,r);return l.map(c).reduce((e,t)=>e.concat(t),[])}findNextMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);if(!i&&e.indexOf("\n")<0){const t=new _.SearchParams(e,i,n,o).parseSearchRequest();if(!t)return null
;const a=this.getLineCount();let l=new d.Range(r.lineNumber,r.column,a,this.getLineMaxColumn(a)),c=this.findMatchesLineByLine(l,t,s,1);return _.TextModelSearch.findNextMatch(this,new _.SearchParams(e,i,n,o),r,s),c.length>0?c[0]:(l=new d.Range(1,1,r.lineNumber,this.getLineMaxColumn(r.lineNumber)),(c=this.findMatchesLineByLine(l,t,s,1)).length>0?c[0]:null)}return _.TextModelSearch.findNextMatch(this,new _.SearchParams(e,i,n,o),r,s)}findPreviousMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);return _.TextModelSearch.findPreviousMatch(this,new _.SearchParams(e,i,n,o),r,s)}pushStackElement(){this._commandManager.pushStackElement()}pushEOL(e){if(("\n"===this.getEOL()?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),
this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof h.ValidAnnotatedEditOperation?e:new h.ValidAnnotatedEditOperation(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,n=e.length;i({range:this.validateRange(e.range),text:e.text})),n=!0;if(e)for(let t=0,o=e.length;to.endLineNumber,r=o.startLineNumber>t.endLineNumber
;if(!n&&!r){s=!0;break}}if(!s){n=!1;break}}if(n)for(let e=0,n=this._trimAutoWhitespaceLines.length;et.endLineNumber)&&!(n===t.startLineNumber&&t.startColumn===o&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(0)||n===t.startLineNumber&&1===t.startColumn&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(r.length-1))){s=!1;break}}if(s){const e=new d.Range(n,1,n,o);t.push(new h.ValidAnnotatedEditOperation(null,e,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i)}_applyUndo(e,t,i,n){const o=e.map(e=>{const t=this.getPositionAt(e.newPosition),i=this.getPositionAt(e.newEnd);return{range:new d.Range(t.lineNumber,t.column,i.lineNumber,i.column),text:e.oldText}})
;this._applyUndoRedoEdits(o,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const o=e.map(e=>{const t=this.getPositionAt(e.oldPosition),i=this.getPositionAt(e.oldEnd);return{range:new d.Range(t.lineNumber,t.column,i.lineNumber,i.column),text:e.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,o,s){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(s),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){
const i=this._buffer.getLineCount(),n=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),s=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,0!==s.length){let e=[],t=i;for(let i=0,n=s.length;i0?n.text.charCodeAt(0):0),this._onDidChangeDecorations.fire(),this._decorationsTree.acceptReplace(n.rangeOffset,n.rangeLength,n.text.length,n.forceMoveMarkers);const d=n.range.startLineNumber,c=n.range.endLineNumber,h=c-d,u=r,g=Math.min(h,u),p=u-h;for(let i=g;i>=0;i--){const n=d+i,s=o-t-p+n;e.push(new f.ModelRawLineChanged(n,this.getLineContent(s)))}if(gthis._deltaDecorationsImpl(e,[],[{range:t,options:i}])[0],changeDecoration:(e,t)=>{this._changeDecorationImpl(e,t)},changeDecorationOptions:(e,t)=>{this._changeDecorationOptionsImpl(e,H(t))},removeDecoration:t=>{this._deltaDecorationsImpl(e,[t],[])},
deltaDecorations:(t,i)=>0===t.length&&0===i.length?[]:this._deltaDecorationsImpl(e,t,i)},o=null;try{o=t(n)}catch(e){i.onUnexpectedError(e)}return n.addDecoration=M,n.changeDecoration=M,n.changeDecorationOptions=M,n.removeDecoration=M,n.deltaDecorations=M,o}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),0===e.length&&0===t.length)return[];try{return this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const n=e?this._decorations[e]:null;if(!n)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:z[i]}])[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;const o=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),r=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(n),
n.reset(this.getVersionId(),s,r,o),n.setOptions(z[i]),this._decorationsTree.insert(n),n.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let e=0,i=t.length;ethis.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,n=!1){let o=this.getLineCount(),s=Math.min(o,Math.max(1,e)),r=Math.min(o,Math.max(1,t)),a=this.getLineMaxColumn(r);return this._getDecorationsInRange(new d.Range(s,1,r,a),i,n)}getDecorationsInRange(e,t=0,i=!1){let n=this.validateRange(e)
;return this._getDecorationsInRange(n,t,i)}getOverviewRulerDecorations(e=0,t=!1){const i=this.getVersionId(),n=this._decorationsTree.search(e,t,!0,i);return this._ensureNodesHaveRanges(n)}getAllDecorations(e=0,t=!1){const i=this.getVersionId(),n=this._decorationsTree.search(e,t,!1,i);return this._ensureNodesHaveRanges(n)}_getDecorationsInRange(e,t,i){const n=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),o=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn),s=this.getVersionId(),r=this._decorationsTree.intervalSearch(n,o,t,i,s);return this._ensureNodesHaveRanges(r)}_ensureNodesHaveRanges(e){for(let t=0,i=e.length;t0&&this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!1,ranges:t})}setSemanticTokens(e,t){this._tokens2.set(e,t),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:null!==e,ranges:[{fromLineNumber:1,toLineNumber:this.getLineCount()}]})}hasSemanticTokens(){return this._tokens2.isComplete()}setPartialSemanticTokens(e,t){if(this.hasSemanticTokens())return;const i=this._tokens2.setPartial(e,t);this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}tokenizeViewport(e,t){e=Math.max(1,e),t=Math.min(this._buffer.getLineCount(),t),this._tokenization.tokenizeViewport(e,t)}clearTokens(){this._tokens.flush(),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!0,semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._buffer.getLineCount()}]})}_emitModelTokensChangedEvent(e){
this._isDisposing||this._onDidChangeTokens.fire(e)}resetTokenization(){this._tokenization.reset()}forceTokenization(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");this._tokenization.forceTokenization(e)}isCheapToTokenize(e){return this._tokenization.isCheapToTokenize(e)}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._getLineTokens(e)}_getLineTokens(e){const t=this.getLineContent(e),i=this._tokens.getTokens(this._languageIdentifier.id,e-1,t);return this._tokens2.addSemanticTokens(e,i)}getLanguageIdentifier(){return this._languageIdentifier}getModeId(){return this._languageIdentifier.language}setMode(e){if(this._languageIdentifier.id===e.id)return;let t={oldLanguage:this._languageIdentifier.language,newLanguage:e.language};this._languageIdentifier=e,this._onDidChangeLanguage.fire(t),this._onDidChangeLanguageConfiguration.fire({})}
getLanguageIdAtPosition(e,t){const i=this.validatePosition(new l.Position(e,t)),n=this.getLineTokens(i.lineNumber);return n.getLanguageId(n.findTokenIndexAtOffset(i.column-1))}getWordAtPosition(e){this._assertNotDisposed();const t=this.validatePosition(e),i=this.getLineContent(t.lineNumber),n=this._getLineTokens(t.lineNumber),o=n.findTokenIndexAtOffset(t.column-1),[s,r]=O._findLanguageBoundaries(n,o),a=C.getWordAtText(t.column,b.LanguageConfigurationRegistry.getWordDefinition(n.getLanguageId(o)),i.substring(s,r),s);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a;if(o>0&&s===t.column-1){const[s,r]=O._findLanguageBoundaries(n,o-1),a=C.getWordAtText(t.column,b.LanguageConfigurationRegistry.getWordDefinition(n.getLanguageId(o-1)),i.substring(s,r),s);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a}return null}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let n=0;for(let o=t;o>=0&&e.getLanguageId(o)===i;o--)n=e.getStartOffset(o);let o=e.getLineContent().length
;for(let n=t,s=e.getCount();n=0;e--){const t=i.getEndOffset(e);if(t<=n)break;w.ignoreBracketsInToken(i.getStandardTokenType(e))&&(n=t)}const a=Math.min(o.length,e.column-1+r.maxBracketLength);let l=null;for(;;){const i=y.BracketsUtils.findNextBracketInRange(r.forwardRegex,t,o,n,a);if(!i)break;if(i.startColumn<=e.column&&e.column<=i.endColumn){const e=o.substring(i.startColumn-1,i.endColumn-1).toLowerCase(),t=this._matchFoundBracket(i,r.textIsBracket[e],r.textIsOpenBracket[e],null);if(t){if(t instanceof R)return null;l=t}}n=i.endColumn-1}if(l)return l}if(s>0&&i.getStartOffset(s)===e.column-1){const r=s-1,a=b.LanguageConfigurationRegistry.getBracketsSupport(i.getLanguageId(r));if(a&&!w.ignoreBracketsInToken(i.getStandardTokenType(r))){const s=Math.max(0,e.column-1-a.maxBracketLength);let l=Math.min(o.length,e.column-1+a.maxBracketLength);for(let e=r+1;e=l)break;w.ignoreBracketsInToken(i.getStandardTokenType(e))&&(l=t)}
const d=y.BracketsUtils.findPrevBracketInRange(a.reversedRegex,t,o,s,l);if(d&&d.startColumn<=e.column&&e.column<=d.endColumn){const e=o.substring(d.startColumn-1,d.endColumn-1).toLowerCase(),t=this._matchFoundBracket(d,a.textIsBracket[e],a.textIsOpenBracket[e],null);if(t)return t instanceof R?null:t}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return o?o instanceof R?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const n=e.languageIdentifier.id,o=e.reversedRegex;let s=-1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return R.INSTANCE;const d=y.BracketsUtils.findPrevBracketInRange(o,t,n,a,l);if(!d)break;const c=n.substring(d.startColumn-1,d.endColumn-1).toLowerCase();if(e.isOpen(c)?s++:e.isClose(c)&&s--,0===s)return d;l=d.startColumn-1}return null};for(let e=t.lineNumber;e>=1;e--){const i=this._getLineTokens(e),o=i.getCount(),s=this._buffer.getLineContent(e)
;let r=o-1,l=s.length,d=s.length;e===t.lineNumber&&(r=i.findTokenIndexAtOffset(t.column-1),l=t.column-1,d=t.column-1);let c=!0;for(;r>=0;r--){const t=i.getLanguageId(r)===n&&!w.ignoreBracketsInToken(i.getStandardTokenType(r));if(t)c?l=i.getStartOffset(r):(l=i.getStartOffset(r),d=i.getEndOffset(r));else if(c&&l!==d){const t=a(e,s,l,d);if(t)return t}c=t}if(c&&l!==d){const t=a(e,s,l,d);if(t)return t}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageIdentifier.id,o=e.forwardRegex;let s=1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return R.INSTANCE;const d=y.BracketsUtils.findNextBracketInRange(o,t,n,a,l);if(!d)break;const c=n.substring(d.startColumn-1,d.endColumn-1).toLowerCase();if(e.isOpen(c)?s++:e.isClose(c)&&s--,0===s)return d;a=d.endColumn-1}return null},l=this.getLineCount();for(let e=t.lineNumber;e<=l;e++){const i=this._getLineTokens(e),o=i.getCount(),s=this._buffer.getLineContent(e);let r=0,l=0,d=0;e===t.lineNumber&&(r=i.findTokenIndexAtOffset(t.column-1),l=t.column-1,
d=t.column-1);let c=!0;for(;r=1;e--){const o=this._getLineTokens(e),s=o.getCount(),r=this._buffer.getLineContent(e);let a=s-1,l=r.length,d=r.length;if(e===t.lineNumber){a=o.findTokenIndexAtOffset(t.column-1),l=t.column-1,d=t.column-1;const e=o.getLanguageId(a);i!==e&&(i=e,n=b.LanguageConfigurationRegistry.getBracketsSupport(i))}let c=!0;for(;a>=0;a--){const t=o.getLanguageId(a);if(i!==t){if(n&&c&&l!==d){const t=y.BracketsUtils.findPrevBracketInRange(n.reversedRegex,e,r,l,d);if(t)return this._toFoundBracket(n,t);c=!1}i=t,n=b.LanguageConfigurationRegistry.getBracketsSupport(i)}const s=!!n&&!w.ignoreBracketsInToken(o.getStandardTokenType(a))
;if(s)c?l=o.getStartOffset(a):(l=o.getStartOffset(a),d=o.getEndOffset(a));else if(n&&c&&l!==d){const t=y.BracketsUtils.findPrevBracketInRange(n.reversedRegex,e,r,l,d);if(t)return this._toFoundBracket(n,t)}c=s}if(n&&c&&l!==d){const t=y.BracketsUtils.findPrevBracketInRange(n.reversedRegex,e,r,l,d);if(t)return this._toFoundBracket(n,t)}}return null}findNextBracket(e){const t=this.validatePosition(e),i=this.getLineCount();let n=-1,o=null;for(let e=t.lineNumber;e<=i;e++){const i=this._getLineTokens(e),s=i.getCount(),r=this._buffer.getLineContent(e);let a=0,l=0,d=0;if(e===t.lineNumber){a=i.findTokenIndexAtOffset(t.column-1),l=t.column-1,d=t.column-1;const e=i.getLanguageId(a);n!==e&&(n=e,o=b.LanguageConfigurationRegistry.getBracketsSupport(n))}let c=!0;for(;aDate.now()-e<=t}const n=this.validatePosition(e),o=this.getLineCount(),s=new Map;let r=[];const a=(e,t)=>{if(!s.has(e)){let i=[];for(let e=0,n=t?t.brackets.length:0;e{for(;;){if(i&&++l%100==0&&!i())return R.INSTANCE;const a=y.BracketsUtils.findNextBracketInRange(e.forwardRegex,t,n,o,s);if(!a)break;const d=n.substring(a.startColumn-1,a.endColumn-1).toLowerCase(),c=e.textIsBracket[d];if(c&&(c.isOpen(d)?r[c.index]++:c.isClose(d)&&r[c.index]--,
-1===r[c.index]))return this._matchFoundBracket(a,c,!1,i);o=a.endColumn-1}return null};let c=-1,h=null;for(let e=n.lineNumber;e<=o;e++){const t=this._getLineTokens(e),i=t.getCount(),o=this._buffer.getLineContent(e);let s=0,r=0,l=0;if(e===n.lineNumber){s=t.findTokenIndexAtOffset(n.column-1),r=n.column-1,l=n.column-1;const e=t.getLanguageId(s);c!==e&&a(c=e,h=b.LanguageConfigurationRegistry.getBracketsSupport(c))}let u=!0;for(;sn)throw new Error("Illegal value for lineNumber");const o=b.LanguageConfigurationRegistry.getFoldingRules(this._languageIdentifier.id),s=Boolean(o&&o.offSide);let r=-2,a=-1,l=-2,d=-1;const c=e=>{if(-1!==r&&(-2===r||r>e-1)){r=-1,a=-1;for(let t=e-2;t>=0;t--){let e=this._computeIndentLevel(t);if(e>=0){r=t,a=e;break}}}if(-2===l){l=-1,d=-1;for(let t=e;t=0){l=t,d=e;break}}}};let h=-2,u=-1,g=-2,p=-1;const m=e=>{if(-2===h){h=-1,u=-1;for(let t=e-2;t>=0;t--){let e=this._computeIndentLevel(t);if(e>=0){h=t,u=e;break}}}if(-1!==g&&(-2===g||g=0){g=t,p=e;break}}}};let f=0,_=!0,v=0,C=!0,S=0,w=0;for(let o=0;_||C;o++){const r=e-o,g=e+o;o>1&&(r<1||r1&&(g>n||g>i)&&(C=!1),o>5e4&&(_=!1,C=!1);let b=-1;if(_){const e=this._computeIndentLevel(r-1);e>=0?(l=r-1,d=e,b=Math.ceil(e/this._options.indentSize)):(c(r),b=this._getIndentLevelForWhitespaceLine(s,a,d))}let y=-1;if(C){const e=this._computeIndentLevel(g-1);e>=0?(h=g-1,u=e,y=Math.ceil(e/this._options.indentSize)):(m(g),y=this._getIndentLevelForWhitespaceLine(s,u,p))}if(0!==o){if(1===o){if(g<=n&&y>=0&&w+1===y){_=!1,f=g,v=g,S=y;continue}if(r>=1&&b>=0&&b-1===w){C=!1,f=r,v=r,S=b;continue}if(f=e,v=e,0===(S=w))return{startLineNumber:f,endLineNumber:v,indent:S}}_&&(b>=S?f=r:_=!1),C&&(y>=S?v=g:C=!1)}else w=b}return{startLineNumber:f,endLineNumber:v,indent:S}}getLinesIndentGuides(e,t){this._assertNotDisposed();const i=this.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber")
;const n=b.LanguageConfigurationRegistry.getFoldingRules(this._languageIdentifier.id),o=Boolean(n&&n.offSide);let s=new Array(t-e+1),r=-2,a=-1,l=-2,d=-1;for(let n=e;n<=t;n++){let t=n-e;const c=this._computeIndentLevel(n-1);if(c>=0)r=n-1,a=c,s[t]=Math.ceil(c/this._options.indentSize);else{if(-2===r){r=-1,a=-1;for(let e=n-2;e>=0;e--){let t=this._computeIndentLevel(e);if(t>=0){r=e,a=t;break}}}if(-1!==l&&(-2===l||l=0){l=e,d=t;break}}}s[t]=this._getIndentLevelForWhitespaceLine(o,a,d)}}return s}_getIndentLevelForWhitespaceLine(e,t,i){return-1===t||-1===i?0:t0?this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e:(this._fastEmitter.fire(e),this._slowEmitter.fire(e))}}t.DidChangeContentEmitter=U})),define(t[45],i([0,1,12,8,13,3,20,31,42]),(function(e,t,i,n,o,s,r,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isQuote=t.CursorColumns=t.EditOperationResult=t.CursorState=t.PartialViewCursorState=t.PartialModelCursorState=t.CursorContext=t.SingleCursorState=t.CursorConfiguration=void 0;const d=()=>!0,c=()=>!1,h=e=>" "===e||"\t"===e;function u(e,t,i){
e.has(t)?e.get(t).push(i):e.set(t,[i])}class g{constructor(e,t,i){this._languageIdentifier=e;const n=i.options,o=n.get(117);this.readOnly=n.get(72),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.lineHeight=n.get(51),this.pageSize=Math.max(1,Math.floor(o.height/this.lineHeight)-2),this.useTabStops=n.get(104),this.wordSeparators=n.get(105),this.emptySelectionClipboard=n.get(26),this.copyWithSyntaxHighlighting=n.get(16),this.multiCursorMergeOverlapping=n.get(60),this.multiCursorPaste=n.get(62),this.autoClosingBrackets=n.get(5),this.autoClosingQuotes=n.get(7),this.autoClosingOvertype=n.get(6),this.autoSurround=n.get(10),this.autoIndent=n.get(8),this.autoClosingPairsOpen2=new Map,this.autoClosingPairsClose2=new Map,this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:g._getShouldAutoClose(e,this.autoClosingQuotes),bracket:g._getShouldAutoClose(e,this.autoClosingBrackets)};let s=g._getAutoClosingPairs(e)
;if(s)for(const e of s)u(this.autoClosingPairsOpen2,e.open.charAt(e.open.length-1),e),1===e.close.length&&u(this.autoClosingPairsClose2,e.close,e);let r=g._getSurroundingPairs(e);if(r)for(const e of r)this.surroundingPairs[e.open]=e.close}static shouldRecreate(e){return e.hasChanged(117)||e.hasChanged(105)||e.hasChanged(26)||e.hasChanged(60)||e.hasChanged(62)||e.hasChanged(5)||e.hasChanged(7)||e.hasChanged(6)||e.hasChanged(10)||e.hasChanged(104)||e.hasChanged(51)||e.hasChanged(72)}get electricChars(){if(!this._electricChars){this._electricChars={};let e=g._getElectricCharacters(this._languageIdentifier);if(e)for(const t of e)this._electricChars[t]=!0}return this._electricChars}normalizeIndentation(e){return a.TextModel.normalizeIndentation(e,this.indentSize,this.insertSpaces)}static _getElectricCharacters(e){try{return l.LanguageConfigurationRegistry.getElectricCharacters(e.id)}catch(e){return i.onUnexpectedError(e),null}}static _getAutoClosingPairs(e){try{
return l.LanguageConfigurationRegistry.getAutoClosingPairs(e.id)}catch(e){return i.onUnexpectedError(e),null}}static _getShouldAutoClose(e,t){switch(t){case"beforeWhitespace":return h;case"languageDefined":return g._getLanguageDefinedShouldAutoClose(e);case"always":return d;case"never":return c}}static _getLanguageDefinedShouldAutoClose(e){try{const t=l.LanguageConfigurationRegistry.getAutoCloseBeforeSet(e.id);return e=>-1!==t.indexOf(e)}catch(e){return i.onUnexpectedError(e),c}}static _getSurroundingPairs(e){try{return l.LanguageConfigurationRegistry.getSurroundingPairs(e.id)}catch(e){return i.onUnexpectedError(e),null}}}t.CursorConfiguration=g;class p{constructor(e,t,i,n){this.selectionStart=e,this.selectionStartLeftoverVisibleColumns=t,this.position=i,this.leftoverVisibleColumns=n,this.selection=p._computeSelection(this.selectionStart,this.position)}equals(e){
return this.selectionStartLeftoverVisibleColumns===e.selectionStartLeftoverVisibleColumns&&this.leftoverVisibleColumns===e.leftoverVisibleColumns&&this.position.equals(e.position)&&this.selectionStart.equalsRange(e.selectionStart)}hasSelection(){return!this.selection.isEmpty()||!this.selectionStart.isEmpty()}move(e,t,i,n){return e?new p(this.selectionStart,this.selectionStartLeftoverVisibleColumns,new o.Position(t,i),n):new p(new s.Range(t,i,t,i),n,new o.Position(t,i),n)}static _computeSelection(e,t){let i,n,o,s;return e.isEmpty()?(i=e.startLineNumber,n=e.startColumn,o=t.lineNumber,s=t.column):t.isBeforeOrEqual(e.getStartPosition())?(i=e.endLineNumber,n=e.endColumn,o=t.lineNumber,s=t.column):(i=e.startLineNumber,n=e.startColumn,o=t.lineNumber,s=t.column),new r.Selection(i,n,o,s)}}t.SingleCursorState=p;t.CursorContext=class{constructor(e,t,i){this.model=e,this.coordinatesConverter=t,this.cursorConfig=i}};class m{constructor(e){this.modelState=e,this.viewState=null}}t.PartialModelCursorState=m;class f{
constructor(e){this.modelState=null,this.viewState=e}}t.PartialViewCursorState=f;class _{constructor(e,t){this.modelState=e,this.viewState=t}static fromModelState(e){return new m(e)}static fromViewState(e){return new f(e)}static fromModelSelection(e){const t=e.selectionStartLineNumber,i=e.selectionStartColumn,n=e.positionLineNumber,r=e.positionColumn,a=new p(new s.Range(t,i,t,i),0,new o.Position(n,r),0);return _.fromModelState(a)}static fromModelSelections(e){let t=[];for(let i=0,n=e.length;i=65536?2:1,
9===t)r=v.nextRenderTabStop(r,i);else{let i=n.getGraphemeBreakType(t);for(;a=65536?2:1,i=o}n.isFullWidthCharacter(t)||n.isEmojiImprecise(t)?r+=2:r+=1}}return r}static visibleColumnFromColumn2(e,t,i){return this.visibleColumnFromColumn(t.getLineContent(i.lineNumber),i.column,e.tabSize)}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;const o=e.length;let s=0,r=1,a=0;for(;a=65536?2:1,9===l)d=v.nextRenderTabStop(s,i);else{let t=n.getGraphemeBreakType(l);for(;a=65536?2:1,t=s}d=n.isFullWidthCharacter(l)||n.isEmojiImprecise(l)?s+2:s+1}const c=a+1;if(d>=t){return d-tr?r:o}static nextRenderTabStop(e,t){return e+t-e%t}static nextIndentTabStop(e,t){return e+t-e%t}static prevRenderTabStop(e,t){return e-1-(e-1)%t}static prevIndentTabStop(e,t){return e-1-(e-1)%t}}t.CursorColumns=v,t.isQuote=function(e){return"'"===e||'"'===e||"`"===e}})),define(t[169],i([0,1,8,45,3,20,42]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShiftCommand=t.cachedStringRepeat=void 0;const a=Object.create(null);function l(e,t){a[e]||(a[e]=["",e]);const i=a[e];for(let n=i.length;n<=t;n++)i[n]=i[n-1]+e;return i[t]}t.cachedStringRepeat=l;class d{constructor(e,t){this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}static unshiftIndent(e,t,i,o,s){const r=n.CursorColumns.visibleColumnFromColumn(e,t,i);if(s){const e=l(" ",o);return l(e,n.CursorColumns.prevIndentTabStop(r,o)/o)}
return l("\t",n.CursorColumns.prevRenderTabStop(r,i)/i)}static shiftIndent(e,t,i,o,s){const r=n.CursorColumns.visibleColumnFromColumn(e,t,i);if(s){const e=l(" ",o);return l(e,n.CursorColumns.nextIndentTabStop(r,o)/o)}return l("\t",n.CursorColumns.nextRenderTabStop(r,i)/i)}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const s=this._selection.startLineNumber;let a=this._selection.endLineNumber;1===this._selection.endColumn&&s!==a&&(a-=1);const{tabSize:c,indentSize:h,insertSpaces:u}=this._opts,g=s===a;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(s))&&(this._useLastEditRangeForCursorEndPosition=!0);let l=0,p=0;for(let m=s;m<=a;m++,l=p){p=0;let a,f=e.getLineContent(m),_=i.firstNonWhitespaceIndex(f);if((!this._opts.isUnshift||0!==f.length&&0!==_)&&(g||this._opts.isUnshift||0!==f.length)){if(-1===_&&(_=f.length),m>1){
if(n.CursorColumns.visibleColumnFromColumn(f,_+1,c)%h!=0&&e.isCheapToTokenize(m-1)){let t=r.LanguageConfigurationRegistry.getEnterAction(this._opts.autoIndent,e,new o.Range(m-1,e.getLineMaxColumn(m-1),m-1,e.getLineMaxColumn(m-1)));if(t){if(p=l,t.appendText)for(let e=0,i=t.appendText.length;ea,h=r>l,u=rl)continue;if(_r)continue;if(f1&&n--,
s.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,o){let s=0;const r=Math.min(o.fromViewLineNumber,o.toViewLineNumber),a=Math.max(o.fromViewLineNumber,o.toViewLineNumber);for(let o=r;o<=a;o++){const r=t.getLineMaxColumn(o),a=i.CursorColumns.visibleColumnFromColumn2(e,t,new n.Position(o,r));s=Math.max(s,a)}let l=o.toViewVisualColumn;return le.getLineMinColumn(t)?i-=s.prevCharLength(e.getLineContent(t),i-1):t>1&&(t-=1,i=e.getLineMaxColumn(t)),new n.Position(t,i)}static left(e,t,i,n){const o=a.leftPosition(t,i,n);return new r(o.lineNumber,o.column,0)}static moveLeft(e,t,i,n,o){let s,r;if(i.hasSelection()&&!n)s=i.selection.startLineNumber,r=i.selection.startColumn;else{let n=a.left(e,t,i.position.lineNumber,i.position.column-(o-1));s=n.lineNumber,r=n.column}return i.move(n,s,r,0)}static rightPosition(e,t,i){return ic?(n=c,o=l?t.getLineMaxColumn(n):Math.min(t.getLineMaxColumn(n),o)):o=i.CursorColumns.columnFromVisibleColumn2(e,t,n,d),s=h?0:d-i.CursorColumns.visibleColumnFromColumn(t.getLineContent(n),o,e.tabSize),new r(n,o,s)}static moveDown(e,t,i,n,o){let s,r;i.hasSelection()&&!n?(s=i.selection.endLineNumber,r=i.selection.endColumn):(s=i.position.lineNumber,r=i.position.column);let l=a.down(e,t,s,r,i.leftoverVisibleColumns,o,!0);return i.move(n,l.lineNumber,l.column,l.leftoverVisibleColumns)}static translateDown(e,t,s){
let r=s.selection,l=a.down(e,t,r.selectionStartLineNumber,r.selectionStartColumn,s.selectionStartLeftoverVisibleColumns,1,!1),d=a.down(e,t,r.positionLineNumber,r.positionColumn,s.leftoverVisibleColumns,1,!1);return new i.SingleCursorState(new o.Range(l.lineNumber,l.column,l.lineNumber,l.column),l.leftoverVisibleColumns,new n.Position(d.lineNumber,d.column),d.leftoverVisibleColumns)}static up(e,t,n,o,s,a,l){const d=i.CursorColumns.visibleColumnFromColumn(t.getLineContent(n),o,e.tabSize)+s,c=1===n&&1===o;return(n-=a)<1?(n=1,o=l?t.getLineMinColumn(n):Math.min(t.getLineMaxColumn(n),o)):o=i.CursorColumns.columnFromVisibleColumn2(e,t,n,d),s=c?0:d-i.CursorColumns.visibleColumnFromColumn(t.getLineContent(n),o,e.tabSize),new r(n,o,s)}static moveUp(e,t,i,n,o){let s,r;i.hasSelection()&&!n?(s=i.selection.startLineNumber,r=i.selection.startColumn):(s=i.position.lineNumber,r=i.position.column);let l=a.up(e,t,s,r,i.leftoverVisibleColumns,o,!0);return i.move(n,l.lineNumber,l.column,l.leftoverVisibleColumns)}
static translateUp(e,t,s){let r=s.selection,l=a.up(e,t,r.selectionStartLineNumber,r.selectionStartColumn,s.selectionStartLeftoverVisibleColumns,1,!1),d=a.up(e,t,r.positionLineNumber,r.positionColumn,s.leftoverVisibleColumns,1,!1);return new i.SingleCursorState(new o.Range(l.lineNumber,l.column,l.lineNumber,l.column),l.leftoverVisibleColumns,new n.Position(d.lineNumber,d.column),d.leftoverVisibleColumns)}static moveToBeginningOfLine(e,t,i,n){let o,s=i.position.lineNumber,r=t.getLineMinColumn(s),a=t.getLineFirstNonWhitespaceColumn(s)||r;return o=i.position.column===a?r:a,i.move(n,s,o,0)}static moveToEndOfLine(e,t,i,n,o){let s=i.position.lineNumber,r=t.getLineMaxColumn(s);return i.move(n,s,r,o?1073741824-r:0)}static moveToBeginningOfBuffer(e,t,i,n){return i.move(n,1,1,0)}static moveToEndOfBuffer(e,t,i,n){let o=t.getLineCount(),s=t.getLineMaxColumn(o);return i.move(n,o,s,0)}}t.MoveOperations=a})),define(t[232],i([0,1,8,88,45,170,3]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{
value:!0}),t.DeleteOperations=void 0;t.DeleteOperations=class{static deleteRight(e,t,i,o){let a=[],l=3!==e;for(let e=0,d=o.length;e1){let n=a.getLineContent(e.lineNumber),s=i.firstNonWhitespaceIndex(n),l=-1===s?n.length+1:s+1;if(e.column<=l){let i=o.CursorColumns.visibleColumnFromColumn2(t,a,e),n=o.CursorColumns.prevIndentTabStop(i,t.indentSize),s=o.CursorColumns.columnFromVisibleColumn2(t,a,e.lineNumber,n);u=new r.Range(e.lineNumber,s,e.lineNumber,e.column)}else u=new r.Range(e.lineNumber,e.column-1,e.lineNumber,e.column)}else{let i=s.MoveOperations.left(t,a,e.lineNumber,e.column);u=new r.Range(i.lineNumber,i.column,e.lineNumber,e.column)}}u.isEmpty()?d[e]=null:(u.startLineNumber!==u.endLineNumber&&(c=!0),d[e]=new n.ReplaceCommand(u,""))}return[c,d]}
static cut(e,t,i){let s=[];for(let o=0,a=i.length;o1?(e=c.lineNumber-1,i=t.getLineMaxColumn(c.lineNumber-1),l=c.lineNumber,d=t.getLineMaxColumn(c.lineNumber)):(e=c.lineNumber,i=1,l=c.lineNumber,d=t.getLineMaxColumn(c.lineNumber));let h=new r.Range(e,i,l,d);h.isEmpty()?s[o]=null:s[o]=new n.ReplaceCommand(h,"")}else s[o]=null;else s[o]=new n.ReplaceCommand(a,"")}return new o.EditOperationResult(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}})),define(t[171],i([0,1,12,8,88,169,359,45,99,3,20,102,42]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeWithAutoClosingCommand=t.TypeOperations=void 0;class g{static indent(e,t,i){if(null===t||null===i)return[];let n=[];for(let t=0,o=i.length;t1){let o;for(o=i-1;o>=1;o--){const e=t.getLineContent(o)
;if(n.lastNonWhitespaceIndex(e)>=0)break}if(o<1)return null;const r=t.getLineMaxColumn(o),a=u.LanguageConfigurationRegistry.getEnterAction(e.autoIndent,t,new d.Range(o,r,o,r));a&&(s=a.indentation+a.appendText)}return o&&(o===h.IndentAction.Indent&&(s=g.shiftIndent(e,s)),o===h.IndentAction.Outdent&&(s=g.unshiftIndent(e,s)),s=e.normalizeIndentation(s)),s||null}static _replaceJumpToNextIndent(e,t,i,n){let s="",r=i.getStartPosition();if(e.insertSpaces){let i=a.CursorColumns.visibleColumnFromColumn2(e,t,r),n=e.indentSize,o=n-i%n;for(let e=0;e=4){const r=u.LanguageConfigurationRegistry.getIndentForEnter(e.autoIndent,t,s,{unshiftIndent:t=>g.unshiftIndent(e,t),shiftIndent:t=>g.shiftIndent(e,t),normalizeIndentation:t=>e.normalizeIndentation(t)});if(r){let h=a.CursorColumns.visibleColumnFromColumn2(e,t,s.getEndPosition());const u=s.endColumn;let g="\n";c!==e.normalizeIndentation(r.beforeEnter)&&(g=e.normalizeIndentation(r.beforeEnter)+l.substring(c.length,s.startColumn-1)+"\n",s=new d.Range(s.startLineNumber,1,s.endLineNumber,s.endColumn));const p=t.getLineContent(s.endLineNumber),m=n.firstNonWhitespaceIndex(p);if(s=m>=0?s.setEndPosition(s.endLineNumber,Math.max(s.endColumn,m+1)):s.setEndPosition(s.endLineNumber,t.getLineMaxColumn(s.endLineNumber)),i)return new o.ReplaceCommandWithoutChangingPosition(s,g+e.normalizeIndentation(r.afterEnter),!0);{let t=0;return u<=m+1&&(e.insertSpaces||(h=Math.ceil(h/e.indentSize)),
t=Math.min(h+1-e.normalizeIndentation(r.afterEnter).length-1,0)),new o.ReplaceCommandWithOffsetCursorState(s,g+e.normalizeIndentation(r.afterEnter),0,t,!0)}}}return g._typeCommand(s,"\n"+e.normalizeIndentation(c),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let e=0,n=i.length;eg.shiftIndent(e,t),unshiftIndent:t=>g.unshiftIndent(e,t)});if(null===s)return null;if(s!==e.normalizeIndentation(o)){const o=t.getLineFirstNonWhitespaceColumn(i.startLineNumber)
;return 0===o?g._typeCommand(new d.Range(i.startLineNumber,0,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+n,!1):g._typeCommand(new d.Range(i.startLineNumber,0,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+t.getLineContent(i.startLineNumber).substring(o-1,i.startColumn-1)+n,!1)}return null}static _isAutoClosingOvertype(e,t,i,n,o){if("never"===e.autoClosingOvertype)return!1;if(!e.autoClosingPairsClose2.has(o))return!1;for(let s=0,r=i.length;s2?d.charCodeAt(l.column-2):0)&&c)return!1;if("auto"===e.autoClosingOvertype){let e=!1;for(let t=0,i=n.length;t=0||i.indexOf(t)>=0}static _isBeforeClosingBrace(e,t,i){const n=e.autoClosingPairsClose2.get(i);if(!n)return!1;const o=g._autoClosingPairIsSymmetric(t);for(const e of n){const t=g._autoClosingPairIsSymmetric(e);if(o||!t)return!0}return!1}static _findAutoClosingPairOpen(e,t,i,n){const o=e.autoClosingPairsOpen2.get(n);if(!o)return null;let s=null;for(const e of o)if(null===s||e.open.length>s.open.length){let o=!0;for(const s of i){if(t.getValueInRange(new d.Range(s.lineNumber,s.column-e.open.length+1,s.lineNumber,s.column))+n!==e.open){o=!1;break}}o&&(s=e)}return s}static _isAutoClosingOpenCharType(e,t,n,o,s){const r=a.isQuote(o),d=r?e.autoClosingQuotes:e.autoClosingBrackets;if("never"===d)return null
;const c=this._findAutoClosingPairOpen(e,t,n.map(e=>e.getPosition()),o);if(!c)return null;const h=r?e.shouldAutoCloseBefore.quote:e.shouldAutoCloseBefore.bracket;for(let o=0,a=n.length;op.column-1){const t=m.charAt(p.column-1);if(!g._isBeforeClosingBrace(e,c,t)&&!h(t))return null}if(!t.isCheapToTokenize(p.lineNumber))return null;if(1===c.open.length&&r&&"always"!==d){const t=l.getMapForWordSeparators(e.wordSeparators);if(s&&p.column>1&&0===t.get(m.charCodeAt(p.column-2)))return null;if(!s&&p.column>2&&0===t.get(m.charCodeAt(p.column-3)))return null}t.forceTokenization(p.lineNumber);const f=t.getLineTokens(p.lineNumber);let _=!1;try{_=u.LanguageConfigurationRegistry.shouldAutoClosePair(c,f,s?p.column:p.column-1)}catch(e){i.onUnexpectedError(e)}if(!_)return null}return c}static _runAutoClosingOpenCharType(e,t,i,n,o,s,r){let l=[];for(let e=0,t=n.length;enew o.ReplaceCommand(new d.Range(e.positionLineNumber,e.positionColumn,e.positionLineNumber,e.positionColumn+1),"",!1));return new a.EditOperationResult(1,e,{shouldPushStackElementBefore:!0,
shouldPushStackElementAfter:!1})}const h=this._isAutoClosingOpenCharType(t,i,s,l,!1);return h?this._runAutoClosingOpenCharType(e,t,i,s,l,!1,h):null}static typeWithInterceptors(e,t,i,n,s,r,l){if(!e&&"\n"===l){let e=[];for(let t=0,o=s.length;t=0;o--){let i=e.charCodeAt(o),s=t.get(i);if(0===s){if(2===n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1));n=1}else if(2===s){if(1===n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1));n=2}else if(1===s&&0!==n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1))}return 0!==n?this._createWord(e,n,1,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){let o=e.length;for(let s=n;s=0;o--){let n=e.charCodeAt(o),s=t.get(n);if(1===s)return o+1;if(1===i&&2===s)return o+1;if(2===i&&0===s)return o+1}return 0}static moveWordLeft(e,t,i,n){let o=i.lineNumber,r=i.column;1===r&&o>1&&(o-=1,r=t.getLineMaxColumn(o));let l=a._findPreviousWordOnLine(e,t,new s.Position(o,r));if(0===n)return new s.Position(o,l?l.start+1:1);if(1===n)return l&&2===l.wordType&&l.end-l.start==1&&0===l.nextCharClass&&(l=a._findPreviousWordOnLine(e,t,new s.Position(o,l.start+1))),new s.Position(o,l?l.start+1:1);if(3===n){for(;l&&2===l.wordType;)l=a._findPreviousWordOnLine(e,t,new s.Position(o,l.start+1));return new s.Position(o,l?l.start+1:1)}
return l&&r<=l.end+1&&(l=a._findPreviousWordOnLine(e,t,new s.Position(o,l.start+1))),new s.Position(o,l?l.end+1:1)}static _moveWordPartLeft(e,t){const n=t.lineNumber,o=e.getLineMaxColumn(n);if(1===t.column)return n>1?new s.Position(n-1,e.getLineMaxColumn(n-1)):t;const r=e.getLineContent(n);for(let e=t.column-1;e>1;e--){const t=r.charCodeAt(e-2),a=r.charCodeAt(e-1);if(95===t&&95!==a)return new s.Position(n,e);if(i.isLowerAsciiLetter(t)&&i.isUpperAsciiLetter(a))return new s.Position(n,e);if(i.isUpperAsciiLetter(t)&&i.isUpperAsciiLetter(a)&&e+1=d.start+1&&(d=a._findNextWordOnLine(e,t,new s.Position(o,d.end+1))),r=d?d.start+1:t.getLineMaxColumn(o);return new s.Position(o,r)}static _moveWordPartRight(e,t){const n=t.lineNumber,o=e.getLineMaxColumn(n);if(t.column===o)return n1?c=1:(d--,c=t.getLineMaxColumn(d)):(h&&c<=h.end+1&&(h=a._findPreviousWordOnLine(e,t,new s.Position(d,h.start+1))),h?c=h.end+1:c>1?c=1:(d--,c=t.getLineMaxColumn(d))),new r.Range(d,c,l.lineNumber,l.column)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=a._moveWordPartLeft(e,i);return new r.Range(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){let i=e.length;for(let n=t;n=g.start+1&&(g=a._findNextWordOnLine(e,t,new s.Position(d,g.end+1))),g?c=g.start+1:cBoolean(e))}t.WordPartOperations=class extends a{static deleteWordPartLeft(e,t,i,n){const o=l([a.deleteWordLeft(e,t,i,n,0),a.deleteWordLeft(e,t,i,n,2),a._deleteWordPartLeft(t,i)]);return o.sort(r.Range.compareRangesUsingEnds),o[2]}static deleteWordPartRight(e,t,i,n){const o=l([a.deleteWordRight(e,t,i,n,0),a.deleteWordRight(e,t,i,n,2),a._deleteWordPartRight(t,i)]);return o.sort(r.Range.compareRangesUsingStarts),o[0]}static moveWordPartLeft(e,t,i){
const n=l([a.moveWordLeft(e,t,i,0),a.moveWordLeft(e,t,i,2),a._moveWordPartLeft(t,i)]);return n.sort(s.Position.compare),n[2]}static moveWordPartRight(e,t,i){const n=l([a.moveWordRight(e,t,i,0),a.moveWordRight(e,t,i,2),a._moveWordPartRight(t,i)]);return n.sort(s.Position.compare),n[0]}}})),define(t[233],i([0,1,23,45,170,129,13,3]),(function(e,t,i,n,o,s,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CursorMove=t.CursorMoveCommands=void 0;t.CursorMoveCommands=class{static addCursorDown(e,t,i){let s=[],r=0;for(let a=0,l=t.length;at&&(i=t,o=e.model.getLineMaxColumn(i)),n.CursorState.fromModelState(new n.SingleCursorState(new a.Range(l.lineNumber,1,i,o),0,new r.Position(i,o),0))}
const c=t.modelState.selectionStart.getStartPosition().lineNumber;if(l.lineNumberc){const i=e.getLineCount();let o=d.lineNumber+1,s=1;return o>i&&(o=i,s=e.getLineMaxColumn(o)),n.CursorState.fromViewState(t.viewState.move(t.modelState.hasSelection(),o,s,0))}{const e=t.modelState.selectionStart.getEndPosition();return n.CursorState.fromModelState(t.modelState.move(t.modelState.hasSelection(),e.lineNumber,e.column,0))}}static word(e,t,i,o){const r=e.model.validatePosition(o);return n.CursorState.fromModelState(s.WordOperations.word(e.cursorConfig,e.model,t.modelState,i,r))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new n.CursorState(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,o=t.viewState.position.column;return n.CursorState.fromViewState(new n.SingleCursorState(new a.Range(i,o,i,o),0,new r.Position(i,o),0))}static moveTo(e,t,i,o,s){
const a=e.model.validatePosition(o),l=s?e.coordinatesConverter.validateViewPosition(new r.Position(s.lineNumber,s.column),a):e.coordinatesConverter.convertModelPositionToViewPosition(a);return n.CursorState.fromViewState(t.viewState.move(i,l.lineNumber,l.column,0))}static simpleMove(e,t,i,n,o,s){switch(i){case 0:return 4===s?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,o);case 1:return 4===s?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,o);case 2:return 2===s?this._moveUpByViewLines(e,t,n,o):this._moveUpByModelLines(e,t,n,o);case 3:return 2===s?this._moveDownByViewLines(e,t,n,o):this._moveDownByModelLines(e,t,n,o);case 4:return this._moveToViewMinColumn(e,t,n);case 5:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case 6:return this._moveToViewCenterColumn(e,t,n);case 7:return this._moveToViewMaxColumn(e,t,n);case 8:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,o){
const s=e.getCompletelyVisibleViewRange(),r=e.coordinatesConverter.convertViewRangeToModelRange(s);switch(i){case 9:{const i=this._firstLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 11:{const i=this._lastLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 10:{const i=Math.round((r.startLineNumber+r.endLineNumber)/2),o=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,o)]}case 12:{let i=[];for(let o=0,r=t.length;oi.endLineNumber-1&&(s=i.endLineNumber-1),s1;let a=[];for(let l=0,d=t.length;l1;let a=[];for(let l=0,d=t.length;li){let e=t-i;for(let t=0;t=e+1&&this.lastAddedCursorIndex--,this.secondaryCursors[e].dispose(this.context),this.secondaryCursors.splice(e,1)}_getAll(){let e=[];e[0]=this.primaryCursor;for(let t=0,i=this.secondaryCursors.length;te.selection.startLineNumber===t.selection.startLineNumber?e.selection.startColumn-t.selection.startColumn:e.selection.startLineNumber-t.selection.startLineNumber);for(let n=0;nd&&e.index--;e.splice(d,1),t.splice(l,1),this._removeSecondaryCursor(d-1),n--}}}}})),
define(t[234],i([0,1,12,8,516,45,232,171,3,20,162,2,165]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cursor=t.CursorModelState=void 0;class g{constructor(e,t){this.modelVersionId=e.getVersionId(),this.cursorState=t.getCursorStates()}equals(e){if(!e)return!1;if(this.modelVersionId!==e.modelVersionId)return!1;if(this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t=t.length)return!1;if(!t[i].strictContainsRange(e[i]))return!1}return!0}}class m extends h.Disposable{constructor(e,t,i,n){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new s.CursorContext(this._model,this._coordinatesConverter,n),this._cursors=new o.CursorCollection(this.context),this._hasFocus=!1,this._isHandling=!1,this._isDoingComposition=!1,
this._selectionsWhenCompositionStarted=null,this._columnSelectData=null,this._autoClosedActions=[],this._prevEditOperationType=0}dispose(){this._cursors.dispose(),this._autoClosedActions=h.dispose(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new s.CursorContext(this._model,this._coordinatesConverter,e),this._cursors.updateContext(this.context)}onLineMappingChanged(e){this._knownModelVersionId===this._model.getVersionId()&&this.setStates(e,"viewModel",0,this.getCursorStates())}setHasFocus(e){this._hasFocus=e}_validateAutoClosedActions(){if(this._autoClosedActions.length>0){let e=this._cursors.getSelections();for(let t=0;tm.MAX_CURSOR_COUNT&&(n=n.slice(0,m.MAX_CURSOR_COUNT),o=!0);const s=new g(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,s,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,i,n){const o=this._cursors.getViewPositions();if(o.length>1)this._emitCursorRevealRange(e,t,null,this._cursors.getViewSelections(),0,i,n);else{const s=o[0],r=new l.Range(s.lineNumber,s.column,s.lineNumber,s.column);this._emitCursorRevealRange(e,t,r,null,0,i,n)}}_revealPrimaryCursor(e,t,i,n,o){const s=this._cursors.getViewPositions();if(s.length>1)this._emitCursorRevealRange(e,t,null,this._cursors.getViewSelections(),i,n,o);else{const r=s[0],a=new l.Range(r.lineNumber,r.column,r.lineNumber,r.column);this._emitCursorRevealRange(e,t,a,null,i,n,o)}}_emitCursorRevealRange(e,t,i,n,o,s,r){e.emitViewEvent(new c.ViewRevealRangeRequestEvent(t,i,n,o,s,r))}saveState(){let e=[]
;const t=this._cursors.getSelections();for(let i=0,n=t.length;i0){const i=s.CursorState.fromModelSelections(t.resultingSelection);this.setStates(e,"modelChange",t.isUndoing?5:t.isRedoing?6:2,i)&&this._revealPrimaryCursor(e,"modelChange",0,!0,0)}else{const t=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,s.CursorState.fromModelSelections(t))}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,
fromViewVisualColumn:s.CursorColumns.visibleColumnFromColumn2(this.context.cursorConfig,this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:s.CursorColumns.visibleColumnFromColumn2(this.context.cursorConfig,this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i){this.setStates(e,t,0,s.CursorState.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){let i=[],n=[];for(let o=0,s=e.length;o0&&this._pushAutoClosedAction(i,n),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){e&&0!==e.length||(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,n,o){const s=new g(this._model,this);if(s.equals(n))return!1;const r=this._cursors.getSelections(),a=this._cursors.getViewSelections();if(e.emitViewEvent(new c.ViewCursorStateChangedEvent(a,r)),!n||n.cursorState.length!==s.cursorState.length||s.cursorState.some((e,t)=>!e.modelState.equals(n.cursorState[t].modelState))){const a=n?n.cursorState.map(e=>e.modelState.selection):null,l=n?n.modelVersionId:0
;e.emitOutgoingEvent(new u.CursorStateChangedEvent(a,r,l,s.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;let t=[];for(let i=0,n=e.length;i=0)return null;const o=n.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!o)return null;const s=o[1],r=this.context.cursorConfig.autoClosingPairsClose2.get(s);if(!r||1!==r.length)return null;const a=r[0].open,l=n.text.length-o[2].length-1,d=n.text.lastIndexOf(a,l-1);if(-1===d)return null;t.push([d,l])}return t}executeEdits(e,t,i,n){let o=null;"snippet"===t&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);let s=[],r=[];const a=this._model.pushEditOperations(this.getSelections(),i,e=>{if(o)for(let t=0,i=o.length;t0&&this._pushAutoClosedAction(s,r)}_executeEdit(e,t,n,o=0){if(this.context.cursorConfig.readOnly)return;const s=new g(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(e){i.onUnexpectedError(e)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,n,o,s,!1)&&this._revealPrimaryCursor(t,n,0,!0,0)}setIsDoingComposition(e){this._isDoingComposition=e}startComposition(e){this._selectionsWhenCompositionStarted=this.getSelections().slice(0)}endComposition(e,t){this._executeEdit(()=>{if("keyboard"===t){const e=p.getAllAutoClosedCharacters(this._autoClosedActions);this._executeEditOperation(a.TypeOperations.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this._selectionsWhenCompositionStarted,this.getSelections(),e)),this._selectionsWhenCompositionStarted=null}},e,t)}type(e,t,i){
this._executeEdit(()=>{if("keyboard"===i){const e=t.length;let i=0;for(;i{this._executeEditOperation(a.TypeOperations.replacePreviousChar(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i))},e,n)}paste(e,t,i,n,o){this._executeEdit(()=>{this._executeEditOperation(a.TypeOperations.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{
this._executeEditOperation(r.DeleteOperations.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new s.EditOperationResult(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new s.EditOperationResult(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}t.Cursor=m,m.MAX_CURSOR_COUNT=1e4;class f{static executeCommands(e,t,i){const n={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(n,i);for(let e=0,t=n.trackedRanges.length;e0&&(s[0]._isTracked=!0);let r=e.model.pushEditOperations(e.selectionsBefore,s,i=>{let n=[];for(let t=0;te.identifier.minor-t.identifier.minor;let s=[];for(let i=0;i0?(n[i].sort(o),s[i]=t[i].computeCursorState(e.model,{getInverseEditOperations:()=>n[i],getTrackedSelection:t=>{const i=parseInt(t,10),n=e.model._getTrackedRange(e.trackedRanges[i]);return 0===e.trackedRangesDirection[i]?new d.Selection(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn):new d.Selection(n.endLineNumber,n.endColumn,n.startLineNumber,n.startColumn)}})):s[i]=e.selectionsBefore[i];return s});r||(r=e.selectionsBefore);let a=[]
;for(let e in o)o.hasOwnProperty(e)&&a.push(parseInt(e,10));a.sort((e,t)=>t-e);for(const e of a)r.splice(e,1);return r}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{l.Range.isEmpty(e)&&""===i||o.push({identifier:{major:t,minor:s++},range:e,text:i,forceMoveMarkers:r,isAutoWhitespaceEdit:n.insertsAutoWhitespace})};let a=!1;const c={addEditOperation:r,addTrackedEditOperation:(e,t,i)=>{a=!0,r(e,t,i)},trackSelection:(t,i)=>{const n=d.Selection.liftSelection(t);let o;if(n.isEmpty())if("boolean"==typeof i)o=i?2:3;else{const t=e.model.getLineMaxColumn(n.startLineNumber);o=n.startColumn===t?2:3}else o=1
;const s=e.trackedRanges.length,r=e.model._setTrackedRange(null,n,o);return e.trackedRanges[s]=r,e.trackedRangesDirection[s]=n.getDirection(),s.toString()}};try{n.getEditOperations(e.model,c)}catch(e){return i.onUnexpectedError(e),{operations:[],hadTrackedEditOperation:!1}}return{operations:o,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){(e=e.slice(0)).sort((e,t)=>-l.Range.compareRangesUsingEnds(e.range,t.range));let t={};for(let i=1;i