se.options),ie=le.map(se=>se.column-1)):(J=null,ie=null),x[D]=new cd(ie,J,W,V,A)}return document.body.removeChild(f),x}function sU(n,e,t,i,s,o){if(o!==0){const d=String(o);s.appendString('');const r=n.length;let a=e,l=0;const c=[],u=[];let h=0");for(let d=0;d"),c[d]=l,u[d]=a;const f=h;h=d+1"),c[n.length]=l,u[n.length]=a,s.appendString("
"),[c,u]}function oU(n,e,t,i){if(t.length<=1)return null;const s=Array.prototype.slice.call(e.children,0),o=[];try{zv(n,s,i,0,null,t.length-1,null,o)}catch(r){return console.log(r),null}return o.length===0?null:(o.push(t.length),o)}function zv(n,e,t,i,s,o,r,a){if(i===o||(s=s||c1(n,e,t[i],t[i+1]),r=r||c1(n,e,t[o],t[o+1]),Math.abs(s[0].top-r[0].top)<=.1))return;if(i+1===o){a.push(o);return}const l=i+(o-i)/2|0,c=c1(n,e,t[l],t[l+1]);zv(n,e,t,i,s,l,c,a),zv(n,e,t,l,c,o,r,a)}function c1(n,e,t,i){return n.setStart(e[t/16384|0].firstChild,t%16384),n.setEnd(e[i/16384|0].firstChild,i%16384),n.getClientRects()}class rU extends Q{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new fw),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const s of t){if(this._pending.has(s.id)){St(new Error(`Cannot have two contributions with the same id ${s.id}`));continue}this._pending.set(s.id,s)}this._instantiateSome(0),this._register(ta(()=>{this._instantiateSome(1)})),this._register(ta(()=>{this._instantiateSome(2)})),this._register(ta(()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)typeof i.saveViewState=="function"&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)typeof i.restoreViewState=="function"&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){this._register(ta(()=>{this._instantiateSome(1)},50))}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const i of t)this._instantiateById(i.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const i=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,i),typeof i.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){St(i)}}}}var aU=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Qo=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},lU=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(u){try{c(i.next(u))}catch(h){r(h)}}function l(u){try{c(i.throw(u))}catch(h){r(h)}}function c(u){u.done?o(u.value):s(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Ja;let cU=0,uU=class{constructor(e,t,i,s,o,r){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=s,this.listenersToRemove=o,this.attachedView=r}dispose(){Yt(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}},Jd=Ja=class extends Q{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,i,s,o,r,a,l,c,u,h,d){var f;super(),this.languageConfigurationService=h,this._deliveryQueue=rP(),this._contributions=this._register(new rU),this._onDidDispose=this._register(new B),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new zi(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new MD({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new MD({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new zi(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new zi(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new zi(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new zi(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new zi(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new zi(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new zi(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new zi(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new zi(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new zi(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new zi(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new zi(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new zi(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new zi(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new zi(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new zi(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new zi(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),o.willCreateCodeEditor();const g=Object.assign({},t);this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++cU,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,g,u)),this._register(this._configuration.onDidChange(v=>{this._onDidChangeConfiguration.fire(v);const _=this._configuration.options;if(v.hasChanged(143)){const C=_.get(143);this._onDidLayoutChange.fire(C)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=o,this._commandService=r,this._themeService=l,this._register(new hU(this,this._contextKeyService)),this._register(new dU(this,this._contextKeyService,d)),this._instantiationService=s.createChild(new N0([Ct,this._contextKeyService])),this._modelData=null,this._focusTracker=new fU(e),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let m;Array.isArray(i.contributions)?m=i.contributions:m=tu.getEditorContributions(),this._contributions.initialize(this,m,this._instantiationService);for(const v of tu.getEditorActions()){if(this._actions.has(v.id)){St(new Error(`Cannot have two actions with the same id ${v.id}`));continue}const _=new KT(v.id,v.label,v.alias,(f=v.precondition)!==null&&f!==void 0?f:void 0,()=>this._instantiationService.invokeFunction(C=>Promise.resolve(v.runEditorCommand(C,this,null))),this._contextKeyService);this._actions.set(_.id,_)}const b=()=>!this._configuration.options.get(90)&&this._configuration.options.get(36).enabled;this._register(new y7(this._domElement,{onDragEnter:()=>{},onDragOver:v=>{if(!b())return;const _=this.getTargetAtClientPoint(v.clientX,v.clientY);_!=null&&_.position&&this.showDropIndicatorAt(_.position)},onDrop:v=>lU(this,void 0,void 0,function*(){if(!b()||(this.removeDropIndicator(),!v.dataTransfer))return;const _=this.getTargetAtClientPoint(v.clientX,v.clientY);_!=null&&_.position&&this._onDropIntoEditor.fire({position:_.position,event:v})}),onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;(t=this._modelData)===null||t===void 0||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i){return new _v(e,t,this._domElement,i)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return jw.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?Ft.getWordAtPosition(this._modelData.model,this._configuration.options.get(129),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let i=0;return e&&e.lineEnding&&e.lineEnding===`
`?i=1:e&&e.lineEnding&&e.lineEnding===`\r
`&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){const t=e;if(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;const i=this.hasTextFocus(),s=this._detachModel();this._attachModel(t),i&&this.hasModel()&&this.focus();const o={oldModelUrl:s?s.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(o),this._postDetachModelCleanup(s),this._contributions.onAfterModelAttached()}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,s){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,s)}getTopForLineNumber(e,t=!1){return this._modelData?Ja._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?Ja._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,s=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,s)}getBottomForLineNumber(e,t=!1){return this._modelData?Ja._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var i;(i=this._modelData)===null||i===void 0||i.viewModel.setHiddenAreas(e.map(s=>P.lift(s)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return ni.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!z.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,s){if(!this._modelData)return;if(!P.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,r,t,s)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new P(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,s){if(!z.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new P(e.lineNumber,e.column,e.lineNumber,e.column),t,i,s)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=qe.isISelection(e),s=P.isIRange(e);if(!i&&!s)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(s){const o={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(o,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new qe(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,s){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new P(e,1,t,1),i,!1,s)}revealRange(e,t=0,i=!1,s=!0){this._revealRange(e,i?1:0,s,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,s){if(!P.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(P.lift(e),t,i,s)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let s=0,o=e.length;s0&&this._modelData.viewModel.restoreCursorState(i):this._modelData.viewModel.restoreCursorState([i]),this._contributions.restoreViewState(t.contributionsState||{});const s=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(s)}}handleInitialized(){var e;(e=this._getViewModel())===null||e===void 0||e.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){switch(i=i||{},t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const o=i;this._type(e,o.text||"");return}case"replacePreviousChar":{const o=i;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case"compositionType":{const o=i;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case"paste":{const o=i;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null);return}case"cut":this._cut(e);return}const s=this.getAction(t);if(s){Promise.resolve(s.run(i)).then(void 0,St);return}this._modelData&&(this._triggerEditorCommand(e,t,i)||this._triggerCommand(t,i))}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,i,s,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,s,o,e)}_paste(e,t,i,s,o){if(!this._modelData||t.length===0)return;const r=this._modelData.viewModel,a=r.getSelection().getStartPosition();r.paste(t,i,s,e);const l=r.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({range:new P(a.lineNumber,a.column,l.lineNumber,l.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const s=tu.getEditorCommand(t);return s?(i=i||{},i.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(s.runEditorCommand(o,this,i)).then(void 0,St)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(90)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(90)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(90))return!1;let s;return i?Array.isArray(i)?s=()=>i:s=i:s=()=>null,this._modelData.viewModel.executeEdits(e,t,s),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new gU(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,Nm(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,Nm(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?e.length===0&&t.length===0?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){!this._modelData||e.length===0||this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(143)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarPointerDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e){this._configuration.observeContainer(e),this.render()}focus(){!this._modelData||!this._modelData.hasRealView||this._modelData.view.focus()}hasTextFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id."),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(i)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(i)}}addGlyphMarginWidget(e){const t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(i)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,t)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),i=this._configuration.options,s=i.get(143),o=Ja._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),r=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+s.glyphMarginWidth+s.lineNumbersWidth+s.decorationsWidth-this.getScrollLeft();return{top:o,left:r,height:i.get(66)}}getOffsetForColumn(e,t){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,t)}render(e=!1){!this._modelData||!this._modelData.hasRealView||this._modelData.view.render(!0,e)}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){Gi(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const i=e.onBeforeAttached(),s=new Gz(this._id,this._configuration,e,wy.create(),Cy.create(this._configuration.options),a=>rs(a),this.languageConfigurationService,this._themeService,i);t.push(e.onWillDispose(()=>this.setModel(null))),t.push(s.onEvent(a=>{switch(a.kind){case 0:this._onDidContentSizeChange.fire(a);break;case 1:this._editorTextFocus.setValue(a.hasFocus);break;case 2:this._onDidScrollChange.fire(a);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(a.reachedMaxCursorCount){const h=this.getOption(79),d=p("cursors.maximum","The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",h);this._notificationService.prompt(Xz.Warning,d,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:p("goToSetting","Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const l=[];for(let h=0,d=a.selections.length;h{this._paste("keyboard",o,r,a,l)},type:o=>{this._type("keyboard",o)},compositionType:(o,r,a,l)=>{this._compositionType("keyboard",o,r,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(o,r,a,l)=>{const c={text:o,pasteOnNewLine:r,multicursorText:a,mode:l};this._commandService.executeCommand("paste",c)},type:o=>{const r={text:o};this._commandService.executeCommand("type",r)},compositionType:(o,r,a,l)=>{if(a||l){const c={text:o,replacePrevCharCnt:r,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",c)}else{const c={text:o,replaceCharCnt:r};this._commandService.executeCommand("replacePreviousChar",c)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new I0(e.coordinatesConverter);return i.onKeyDown=o=>this._onKeyDown.fire(o),i.onKeyUp=o=>this._onKeyUp.fire(o),i.onContextMenu=o=>this._onContextMenu.fire(o),i.onMouseMove=o=>this._onMouseMove.fire(o),i.onMouseLeave=o=>this._onMouseLeave.fire(o),i.onMouseDown=o=>this._onMouseDown.fire(o),i.onMouseUp=o=>this._onMouseUp.fire(o),i.onMouseDrag=o=>this._onMouseDrag.fire(o),i.onMouseDrop=o=>this._onMouseDrop.fire(o),i.onMouseDropCanceled=o=>this._onMouseDropCanceled.fire(o),i.onMouseWheel=o=>this._onMouseWheel.fire(o),[new Ev(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e==null||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new P(e.lineNumber,e.column,e.lineNumber,e.column),options:Ja.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};Jd.dropIntoEditorDecorationOptions=Jt.register({description:"workbench-dnd-target",className:"dnd-target"});Jd=Ja=aU([Qo(3,zt),Qo(4,oi),Qo(5,Ts),Qo(6,Ct),Qo(7,so),Qo(8,oo),Qo(9,eh),Qo(10,$o),Qo(11,gt)],Jd);class MD extends Q{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new B(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new B(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,this._value===2?this._onDidChangeToTrue.fire():this._value===1&&this._onDidChangeToFalse.fire())}}class zi extends B{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class hU extends Q{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=ce.editorSimpleInput.bindTo(t),this._editorFocus=ce.focus.bindTo(t),this._textInputFocus=ce.textInputFocus.bindTo(t),this._editorTextFocus=ce.editorTextFocus.bindTo(t),this._tabMovesFocus=ce.tabMovesFocus.bindTo(t),this._editorReadonly=ce.readOnly.bindTo(t),this._inDiffEditor=ce.inDiffEditor.bindTo(t),this._editorColumnSelection=ce.columnSelection.bindTo(t),this._hasMultipleSelections=ce.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=ce.hasNonEmptySelection.bindTo(t),this._canUndo=ce.canUndo.bindTo(t),this._canRedo=ce.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(Qm.onDidChangeTabFocus(i=>this._tabMovesFocus.set(i))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(Qm.getTabFocusMode()),this._editorReadonly.set(e.get(90)),this._inDiffEditor.set(e.get(61)),this._editorColumnSelection.set(e.get(22))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(t=>!t.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class dU extends Q{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=ce.languageId.bindTo(t),this._hasCompletionItemProvider=ce.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=ce.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=ce.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=ce.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=ce.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=ce.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=ce.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=ce.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=ce.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=ce.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=ce.hasReferenceProvider.bindTo(t),this._hasRenameProvider=ce.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=ce.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=ce.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=ce.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=ce.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=ce.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=ce.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=ce.isInWalkThroughSnippet.bindTo(t);const s=()=>this._update();this._register(e.onDidChangeModel(s)),this._register(e.onDidChangeModelLanguage(s)),this._register(i.completionProvider.onDidChange(s)),this._register(i.codeActionProvider.onDidChange(s)),this._register(i.codeLensProvider.onDidChange(s)),this._register(i.definitionProvider.onDidChange(s)),this._register(i.declarationProvider.onDidChange(s)),this._register(i.implementationProvider.onDidChange(s)),this._register(i.typeDefinitionProvider.onDidChange(s)),this._register(i.hoverProvider.onDidChange(s)),this._register(i.documentHighlightProvider.onDidChange(s)),this._register(i.documentSymbolProvider.onDidChange(s)),this._register(i.referenceProvider.onDidChange(s)),this._register(i.renameProvider.onDidChange(s)),this._register(i.documentFormattingEditProvider.onDidChange(s)),this._register(i.documentRangeFormattingEditProvider.onDidChange(s)),this._register(i.signatureHelpProvider.onDidChange(s)),this._register(i.inlayHintsProvider.onDidChange(s)),s()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInWalkThrough.reset()})}_update(){const e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInWalkThrough.set(e.uri.scheme===Ve.walkThroughSnippet)})}}class fU extends Q{constructor(e){super(),this._onChange=this._register(new B),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(d0(e)),this._register(this._domFocusTracker.onDidFocus(()=>{this._hasFocus=!0,this._onChange.fire(void 0)})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasFocus=!1,this._onChange.fire(void 0)}))}hasFocus(){return this._hasFocus}}class gU{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations(s=>{this._isChangingDecorations||e.call(t,s)},i)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const s=e.getDecorationRange(i);s&&t.push(s)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){this._decorationIds.length!==0&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}}const mU=encodeURIComponent("");function u1(n){return mU+encodeURIComponent(n.toString())+pU}const _U=encodeURIComponent('');function vU(n){return _U+encodeURIComponent(n.toString())+bU}Fa((n,e)=>{const t=n.getColor(mr);t&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${u1(t)}") repeat-x bottom left; }`);const i=n.getColor(Jn);i&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${u1(i)}") repeat-x bottom left; }`);const s=n.getColor(es);s&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${u1(s)}") repeat-x bottom left; }`);const o=n.getColor(ZF);o&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${vU(o)}") no-repeat bottom left; }`);const r=n.getColor(ZB);r&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${r.rgba.a}; }`)});var CU=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},wU=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},yU=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(u){try{c(i.next(u))}catch(h){r(h)}}function l(u){try{c(i.throw(u))}catch(h){r(h)}}function c(u){u.done?o(u.value):s(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let Uv=class extends Q{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new B),this._onCodeEditorAdd=this._register(new B),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new B),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new B),this._onDiffEditorAdd=this._register(new B),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new B),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new wn,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(i=>i.removeDecorationsByType(e))))}setModelProperty(e,t,i){const s=e.toString();let o;this._modelProperties.has(s)?o=this._modelProperties.get(s):(o=new Map,this._modelProperties.set(s,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}openCodeEditor(e,t,i){return yU(this,void 0,void 0,function*(){for(const s of this._codeEditorOpenHandlers){const o=yield s(e,t,i);if(o!==null)return o}return null})}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return ze(t)}};Uv=CU([wU(0,so)],Uv);var SU=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},RD=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},LU=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(u){try{c(i.next(u))}catch(h){r(h)}}function l(u){try{c(i.throw(u))}catch(h){r(h)}}function c(u){u.done?o(u.value):s(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let _p=class extends Uv{constructor(e,t){super(t),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler((i,s,o)=>LU(this,void 0,void 0,function*(){return s?this.doOpenEditor(s,i):null})))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const o=t.resource.scheme;if(o===Ve.http||o===Ve.https)return CI(t.resource.toString()),e}return null}const s=t.options?t.options.selection:null;if(s)if(typeof s.endLineNumber=="number"&&typeof s.endColumn=="number")e.setSelection(s),e.revealRangeInCenter(s,1);else{const o={lineNumber:s.startLineNumber,column:s.startColumn};e.setPosition(o),e.revealPositionInCenter(o,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};_p=SU([RD(0,Ct),RD(1,so)],_p);et(oi,_p,0);const ih=Ke("layoutService");var gN=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},mN=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let bp=class{get dimension(){return this._dimension||(this._dimension=mI(window.document.body)),this._dimension}get hasContainer(){return!1}get container(){throw new Error("ILayoutService.container is not available in the standalone editor!")}focus(){var e;(e=this._codeEditorService.getFocusedCodeEditor())===null||e===void 0||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayout=ae.None,this.offset={top:0,quickPickTop:0}}};bp=gN([mN(0,oi)],bp);let $v=class extends bp{get hasContainer(){return!1}get container(){return this._container}constructor(e,t){super(t),this._container=e}};$v=gN([mN(1,oi)],$v);et(ih,bp,1);const pN=Ke("dialogService");var kU=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},OD=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Tg=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(u){try{c(i.next(u))}catch(h){r(h)}}function l(u){try{c(i.throw(u))}catch(h){r(h)}}function c(u){u.done?o(u.value):s(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function Ng(n){return n.scheme===Ve.file?n.fsPath:n.path}let _N=0;class Ag{constructor(e,t,i,s,o,r,a){this.id=++_N,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=s,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class PD{constructor(e,t){this.resourceLabel=e,this.reason=t}}class FD{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,s]of this.elements)(s.reason===0?e:t).push(s.resourceLabel);const i=[];return e.length>0&&i.push(p({key:"externalRemoval",comment:["{0} is a list of filenames"]},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(p({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join(`
`)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class DU{constructor(e,t,i,s,o,r,a){this.id=++_N,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=s,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new FD),this.removedResources.has(t)||this.removedResources.set(t,new PD(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new FD),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new PD(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class bN{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(`
`)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,s=this._past.length;i=0;i--)t.push(this._future[i].id);return new lN(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,s=0,o=-1;for(let a=0,l=this._past.length;a=t||c.id!==e.elements[s])&&(i=!1,o=0),!i&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let r=-1;for(let a=this._future.length-1;a>=0;a--,s++){const l=this._future[a];i&&(s>=t||l.id!==e.elements[s])&&(i=!1,r=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}o!==-1&&(this._past=this._past.slice(0,o)),r!==-1&&(this._future=this._future.slice(r+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class h1{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;tt.sourceOrder)&&(t=r,i=s)}return[t,i]}canUndo(e){if(e instanceof yo){const[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){St(e);for(const i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,s,o){const r=this._acquireLocks(i);let a;try{a=t()}catch(l){return r(),s.dispose(),this._onError(l,e)}return a?a.then(()=>(r(),s.dispose(),o()),l=>(r(),s.dispose(),this._onError(l,e))):(r(),s.dispose(),o())}_invokeWorkspacePrepare(e){return Tg(this,void 0,void 0,function*(){if(typeof e.actual.prepareUndoRedo>"u")return Q.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?Q.None:t})}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(Q.None);const i=e.actual.prepareUndoRedo();return i?eP(i)?t(i):i.then(s=>t(s)):t(Q.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||vN);return new h1(t)}_tryToSplitAndUndo(e,t,i,s){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(s),new Mg(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(s),new Mg}_checkWorkspaceUndo(e,t,i,s){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,p({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(s&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,p({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const a of i.editStacks)a.getClosestPastElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,p({key:"cannotWorkspaceUndoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndUndo(e,t,null,p({key:"cannotWorkspaceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,p({key:"cannotWorkspaceUndoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const s=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,s,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,s,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const s=t.getSecondClosestPastElement();if(s&&s.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}_confirmAndExecuteWorkspaceUndo(e,t,i,s){return Tg(this,void 0,void 0,function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let a;(function(u){u[u.All=0]="All",u[u.This=1]="This",u[u.Cancel=2]="Cancel"})(a||(a={}));const{result:l}=yield this._dialogService.prompt({type:Xt.Info,message:p("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:p({key:"ok",comment:["{0} denotes a number that is > 1, && denotes a mnemonic"]},"&&Undo in {0} Files",i.editStacks.length),run:()=>a.All},{label:p({key:"nok",comment:["&& denotes a mnemonic"]},"Undo this &&File"),run:()=>a.This}],cancelButton:{run:()=>a.Cancel}});if(l===a.Cancel)return;if(l===a.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const c=this._checkWorkspaceUndo(e,t,i,!1);if(c)return c.returnValue;s=!0}let o;try{o=yield this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const r=this._checkWorkspaceUndo(e,t,i,!0);if(r)return o.dispose(),r.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,o,()=>this._continueUndoInGroup(t.groupId,s))})}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const s=p({key:"cannotResourceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(s);return}return this._invokeResourcePrepare(t,s=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new h1([e]),s,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestPastElement();r&&r.groupId===e&&(!t||r.groupOrder>t.groupOrder)&&(t=r,i=s)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);if(i)return this._undo(i,0,t)}undo(e){if(e instanceof yo){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const s=this._editStacks.get(e),o=s.getClosestPastElement();if(!o)return;if(o.groupId){const[a,l]=this._findClosestUndoElementInGroup(o.groupId);if(o!==a&&l)return this._undo(l,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return o.type===1?this._workspaceUndo(e,o,i):this._resourceUndo(s,o,i)}finally{}}_confirmAndContinueUndo(e,t,i){return Tg(this,void 0,void 0,function*(){if((yield this._dialogService.confirm({message:p("confirmDifferentSource","Would you like to undo '{0}'?",i.label),primaryButton:p({key:"confirmDifferentSource.yes",comment:["&& denotes a mnemonic"]},"&&Yes"),cancelButton:p("confirmDifferentSource.no","No")})).confirmed)return this._undo(e,t,!0)})}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.sourceId===e&&(!t||r.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,p({key:"cannotWorkspaceRedoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,p({key:"cannotWorkspaceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,p({key:"cannotWorkspaceRedoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),s=this._checkWorkspaceRedo(e,t,i,!1);return s?s.returnValue:this._executeWorkspaceRedo(e,t,i)}_executeWorkspaceRedo(e,t,i){return Tg(this,void 0,void 0,function*(){let s;try{s=yield this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return s.dispose(),o.returnValue;for(const r of i.editStacks)r.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,s,()=>this._continueRedoInGroup(t.groupId))})}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const i=p({key:"cannotResourceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(i);return}return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new h1([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.groupId===e&&(!t||r.groupOrderSy(n,t))}function EU(n){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(n.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},n=n.with({fragment:""})),{selection:e,uri:n}}var IU=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},WD=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const TU=Ke("ILanguageFeatureDebounceService");var vp;(function(n){const e=new WeakMap;let t=0;function i(s){let o=e.get(s);return o===void 0&&(o=++t,e.set(s,o)),o}n.of=i})(vp||(vp={}));class NU{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class AU{constructor(e,t,i,s,o,r){this._logService=e,this._name=t,this._registry=i,this._default=s,this._min=o,this._max=r,this._cache=new Uw(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,i)=>Ww(vp.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?Mn(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let s=this._cache.get(i);s||(s=new xU(6),this._cache.set(i,s));const o=Mn(s.update(t),this._min,this._max);return Sy(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new CN;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return Mn(e,this._min,this._max)}}let Kv=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){var s,o,r;const a=(s=i==null?void 0:i.min)!==null&&s!==void 0?s:50,l=(o=i==null?void 0:i.max)!==null&&o!==void 0?o:Math.pow(a,2),c=(r=i==null?void 0:i.key)!==null&&r!==void 0?r:void 0,u=`${vp.of(e)},${a}${c?","+c:""}`;let h=this._data.get(u);return h||(this._isDev?h=new AU(this._logService,t,e,this._overallAverage()|0||a*1.5,a,l):(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),h=new NU(a*1.5)),this._data.set(u,h)),h}_overallAverage(){const e=new CN;for(const t of this._data.values())e.update(t.default());return e.value}};Kv=IU([WD(0,Oa),WD(1,wN)],Kv);et(TU,Kv,1);var MU=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},d1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let qv=class{constructor(e,t,i,s){this._legend=e,this._themeService=t,this._languageService=i,this._logService=s,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new or}getMetadata(e,t,i){const s=this._languageService.languageIdCodec.encodeLanguageId(i),o=this._hashTable.get(e,t,s);let r;if(o)r=o.metadata,this._logService.getLevel()===Di.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${Cn.getForeground(r)}, fontStyle ${Cn.getFontStyle(r).toString(2)}`);else{let a=this._legend.tokenTypes[e];const l=[];if(a){let c=t;for(let h=0;c>0&&h>1;c>0&&this._logService.getLevel()===Di.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),l.push("not-in-legend"));const u=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,i);if(typeof u>"u")r=2147483647;else{if(r=0,typeof u.italic<"u"){const h=(u.italic?1:0)<<11;r|=h|1}if(typeof u.bold<"u"){const h=(u.bold?2:0)<<11;r|=h|2}if(typeof u.underline<"u"){const h=(u.underline?4:0)<<11;r|=h|4}if(typeof u.strikethrough<"u"){const h=(u.strikethrough?8:0)<<11;r|=h|8}if(u.foreground){const h=u.foreground<<15;r|=h|16}r===0&&(r=2147483647)}}else this._logService.getLevel()===Di.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),r=2147483647,a="not-in-legend";this._hashTable.add(e,t,s,r),this._logService.getLevel()===Di.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${l.join(" ")}): foreground ${Cn.getForeground(r)}, fontStyle ${Cn.getFontStyle(r).toString(2)}`)}return r}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,console.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,s,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,console.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${s} is outside the previous data (length ${o}).`))}};qv=MU([d1(1,so),d1(2,wi),d1(3,Oa)],qv);class RU{constructor(e,t,i,s){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=s,this.next=null}}class or{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=or._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=or._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},f1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Gv=class extends Q{constructor(e,t,i){super(),this._themeService=e,this._logService=t,this._languageService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new qv(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};Gv=PU([f1(0,so),f1(1,Oa),f1(2,wi)],Gv);et(OU,Gv,1);var VD=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(u){try{c(i.next(u))}catch(h){r(h)}}function l(u){try{c(i.throw(u))}catch(h){r(h)}}function c(u){u.done?o(u.value):s(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const Rg="**",HD="/",hm="[/\\\\]",dm="[^/\\\\]",FU=/\//g;function zD(n,e){switch(n){case 0:return"";case 1:return`${dm}*?`;default:return`(?:${hm}|${dm}+${hm}${e?`|${hm}${dm}+`:""})*?`}}function UD(n,e){if(!n)return[];const t=[];let i=!1,s=!1,o="";for(const r of n){switch(r){case e:if(!i&&!s){t.push(o),o="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":s=!0;break;case"]":s=!1;break}o+=r}return o&&t.push(o),t}function yN(n){if(!n)return"";let e="";const t=UD(n,HD);if(t.every(i=>i===Rg))e=".*";else{let i=!1;t.forEach((s,o)=>{if(s===Rg){if(i)return;e+=zD(2,o===t.length-1)}else{let r=!1,a="",l=!1,c="";for(const u of s){if(u!=="}"&&r){a+=u;continue}if(l&&(u!=="]"||!c)){let h;u==="-"?h=u:(u==="^"||u==="!")&&!c?h="^":u===HD?h="":h=kr(u),c+=h;continue}switch(u){case"{":r=!0;continue;case"[":l=!0;continue;case"}":{const d=`(?:${UD(a,",").map(f=>yN(f)).join("|")})`;e+=d,r=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=dm;continue;case"*":e+=zD(1);continue;default:e+=kr(u)}}oLy(a,e)).filter(a=>a!==Oo),n),i=t.length;if(!i)return Oo;if(i===1)return t[0];const s=function(a,l){for(let c=0,u=t.length;c!!a.allBasenames);o&&(s.allBasenames=o.allBasenames);const r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(s.allPaths=r),s}function qD(n,e,t){const i=ma===Kt.sep,s=i?n:n.replace(FU,ma),o=ma+s,r=Kt.sep+n;let a;return t?a=function(l,c){return typeof l=="string"&&(l===s||l.endsWith(o)||!i&&(l===n||l.endsWith(r)))?e:null}:a=function(l,c){return typeof l=="string"&&(l===s||!i&&l===n)?e:null},a.allPaths=[(t?"*/":"./")+n],a}function qU(n){try{const e=new RegExp(`^${yN(n)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?n:null}}catch{return Oo}}function GU(n,e,t){return!n||typeof e!="string"?!1:SN(n)(e,void 0,t)}function SN(n,e={}){if(!n)return jD;if(typeof n=="string"||YU(n)){const t=Ly(n,e);if(t===Oo)return jD;const i=function(s,o){return!!t(s,o)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return ZU(n,e)}function YU(n){const e=n;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function ZU(n,e){const t=LN(Object.getOwnPropertyNames(n).map(a=>QU(a,n[a],e)).filter(a=>a!==Oo)),i=t.length;if(!i)return Oo;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(u,h){let d;for(let f=0,g=t.length;fVD(this,void 0,void 0,function*(){for(const f of d){const g=yield f;if(typeof g=="string")return g}return null}))():null},l=t.find(u=>!!u.allBasenames);l&&(a.allBasenames=l.allBasenames);const c=t.reduce((u,h)=>h.allPaths?u.concat(h.allPaths):u,[]);return c.length&&(a.allPaths=c),a}const s=function(a,l,c){let u,h;for(let d=0,f=t.length;dVD(this,void 0,void 0,function*(){for(const d of h){const f=yield d;if(typeof f=="string")return f}return null}))():null},o=t.find(a=>!!a.allBasenames);o&&(s.allBasenames=o.allBasenames);const r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(s.allPaths=r),s}function QU(n,e,t){if(e===!1)return Oo;const i=Ly(n,t);if(i===Oo)return Oo;if(typeof e=="boolean")return i;if(e){const s=e.when;if(typeof s=="string"){const o=(r,a,l,c)=>{if(!c||!i(r,a))return null;const u=s.replace("$(basename)",()=>l),h=c(u);return Qb(h)?h.then(d=>d?n:null):h?n:null};return o.requiresSiblings=!0,o}}return i}function LN(n,e){const t=n.filter(a=>!!a.basenames);if(t.length<2)return n;const i=t.reduce((a,l)=>{const c=l.basenames;return c?a.concat(c):a},[]);let s;if(e){s=[];for(let a=0,l=i.length;a{const c=l.patterns;return c?a.concat(c):a},[]);const o=function(a,l){if(typeof a!="string")return null;if(!l){let u;for(u=a.length;u>0;u--){const h=a.charCodeAt(u-1);if(h===47||h===92)break}l=a.substr(u)}const c=i.indexOf(l);return c!==-1?s[c]:null};o.basenames=i,o.patterns=s,o.allBasenames=i;const r=n.filter(a=>!a.basenames);return r.push(o),r}function kN(n,e,t,i,s,o){if(Array.isArray(n)){let r=0;for(const a of n){const l=kN(a,e,t,i,s,o);if(l===10)return l;l>r&&(r=l)}return r}else{if(typeof n=="string")return i?n==="*"?5:n===t?10:0:0;if(n){const{language:r,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:u}=n;if(!i&&!c)return 0;u&&s&&(e=s);let h=0;if(l)if(l===e.scheme)h=10;else if(l==="*")h=5;else return 0;if(r)if(r===t)h=10;else if(r==="*")h=Math.max(h,5);else return 0;if(u)if(u===o)h=10;else if(u==="*"&&o!==void 0)h=Math.max(h,5);else return 0;if(a){let d;if(typeof a=="string"?d=a:d=Object.assign(Object.assign({},a),{base:PE(a.base)}),d===e.fsPath||GU(d,e.fsPath))h=10;else return 0}return h}else return 0}}function DN(n){return typeof n=="string"?!1:Array.isArray(n)?n.every(DN):!!n.exclusive}class GD{constructor(e,t,i,s){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=s}equals(e){var t,i;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&((t=this.notebookUri)===null||t===void 0?void 0:t.toString())===((i=e.notebookUri)===null||i===void 0?void 0:i.toString())}}class xt{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new B,this.onDidChange=this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),ze(()=>{if(i){const s=this._entries.indexOf(i);s>=0&&(this._entries.splice(s,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,i=>t.push(i.provider)),t}orderedGroups(e){const t=[];let i,s;return this._orderedForEach(e,o=>{i&&s===o._score?i.push(o.provider):(s=o._score,i=[o.provider],t.push(i))}),t}_orderedForEach(e,t){this._updateScores(e);for(const i of this._entries)i._score>0&&t(i)}_updateScores(e){var t,i;const s=(t=this._notebookInfoResolver)===null||t===void 0?void 0:t.call(this,e.uri),o=s?new GD(e.uri,e.getLanguageId(),s.uri,s.type):new GD(e.uri,e.getLanguageId(),void 0,void 0);if(!(!((i=this._lastCandidate)===null||i===void 0)&&i.equals(o))){this._lastCandidate=o;for(const r of this._entries)if(r._score=kN(r.selector,o.uri,o.languageId,H3(e),o.notebookUri,o.notebookType),DN(r.selector)&&r._score>0){for(const a of this._entries)a._score=0;r._score=1e3;break}this._entries.sort(xt._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:Uh(e.selector)&&!Uh(t.selector)?1:!Uh(e.selector)&&Uh(t.selector)?-1:e._timet._time?-1:0}}function Uh(n){return typeof n=="string"?!1:Array.isArray(n)?n.some(Uh):!!n.isBuiltin}class XU{constructor(){this.referenceProvider=new xt(this._score.bind(this)),this.renameProvider=new xt(this._score.bind(this)),this.codeActionProvider=new xt(this._score.bind(this)),this.definitionProvider=new xt(this._score.bind(this)),this.typeDefinitionProvider=new xt(this._score.bind(this)),this.declarationProvider=new xt(this._score.bind(this)),this.implementationProvider=new xt(this._score.bind(this)),this.documentSymbolProvider=new xt(this._score.bind(this)),this.inlayHintsProvider=new xt(this._score.bind(this)),this.colorProvider=new xt(this._score.bind(this)),this.codeLensProvider=new xt(this._score.bind(this)),this.documentFormattingEditProvider=new xt(this._score.bind(this)),this.documentRangeFormattingEditProvider=new xt(this._score.bind(this)),this.onTypeFormattingEditProvider=new xt(this._score.bind(this)),this.signatureHelpProvider=new xt(this._score.bind(this)),this.hoverProvider=new xt(this._score.bind(this)),this.documentHighlightProvider=new xt(this._score.bind(this)),this.selectionRangeProvider=new xt(this._score.bind(this)),this.foldingRangeProvider=new xt(this._score.bind(this)),this.linkProvider=new xt(this._score.bind(this)),this.inlineCompletionsProvider=new xt(this._score.bind(this)),this.completionProvider=new xt(this._score.bind(this)),this.linkedEditingRangeProvider=new xt(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new xt(this._score.bind(this)),this.documentSemanticTokensProvider=new xt(this._score.bind(this)),this.documentOnDropEditProvider=new xt(this._score.bind(this)),this.documentPasteEditProvider=new xt(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)===null||t===void 0?void 0:t.call(this,e)}}et(gt,XU,1);const JU=Ke("IWorkspaceEditService");class ky{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(kl.is(t))return kl.lift(t);if(gu.is(t))return gu.lift(t);throw new Error("Unsupported edit")})}}class kl extends ky{static is(e){return e instanceof kl?!0:Xs(e)&&Ue.isUri(e.resource)&&Xs(e.textEdit)}static lift(e){return e instanceof kl?e:new kl(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,s){super(s),this.resource=e,this.textEdit=t,this.versionId=i}}class gu extends ky{static is(e){return e instanceof gu?!0:Xs(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof gu?e:new gu(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},s){super(s),this.oldResource=e,this.newResource=t,this.options=i}}const Ui={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0},e$=Object.freeze({id:"editor",order:5,type:"object",title:p("editorConfigurationTitle","Editor"),scope:5}),Cp=Object.assign(Object.assign({},e$),{properties:{"editor.tabSize":{type:"number",default:Mi.tabSize,minimum:1,markdownDescription:p("tabSize","The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:p("indentSize",'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:Mi.insertSpaces,markdownDescription:p("insertSpaces","Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:Mi.detectIndentation,markdownDescription:p("detectIndentation","Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:Mi.trimAutoWhitespace,description:p("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Mi.largeFileOptimizations,description:p("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:p("wordBasedSuggestions","Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[p("wordBasedSuggestionsMode.currentDocument","Only suggest words from the active document."),p("wordBasedSuggestionsMode.matchingDocuments","Suggest words from all open documents of the same language."),p("wordBasedSuggestionsMode.allDocuments","Suggest words from all open documents.")],description:p("wordBasedSuggestionsMode","Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[p("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),p("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),p("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:p("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:p("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:p("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:p("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:p("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:p("editor.experimental.asyncTokenizationVerification","Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:p("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:p("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:p("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:p("schema.colorizedBracketPairs","Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:p("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:p("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:Ui.maxComputationTime,description:p("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:Ui.maxFileSize,description:p("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:Ui.renderSideBySide,description:p("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:Ui.renderSideBySideInlineBreakpoint,description:p("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:Ui.useInlineViewWhenSpaceIsLimited,description:p("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:Ui.renderMarginRevertIcon,description:p("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:Ui.ignoreTrimWhitespace,description:p("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:Ui.renderIndicators,description:p("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:Ui.diffCodeLens,description:p("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:Ui.diffWordWrap,markdownEnumDescriptions:[p("wordWrap.off","Lines will never wrap."),p("wordWrap.on","Lines will wrap at the viewport width."),p("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:Ui.diffAlgorithm,markdownEnumDescriptions:[p("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),p("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:Ui.hideUnchangedRegions.enabled,markdownDescription:p("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:Ui.hideUnchangedRegions.revealLineCount,markdownDescription:p("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:Ui.hideUnchangedRegions.minimumLineCount,markdownDescription:p("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:Ui.hideUnchangedRegions.contextLineCount,markdownDescription:p("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:Ui.experimental.showMoves,markdownDescription:p("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:Ui.experimental.showEmptyDecorations,description:p("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}});function t$(n){return typeof n.type<"u"||typeof n.anyOf<"u"}for(const n of Ic){const e=n.schema;if(typeof e<"u")if(t$(e))Cp.properties[`editor.${n.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(Cp.properties[t]=e[t])}let Og=null;function xN(){return Og===null&&(Og=Object.create(null),Object.keys(Cp.properties).forEach(n=>{Og[n]=!0})),Og}function i$(n){return xN()[`editor.${n}`]||!1}function n$(n){return xN()[`diffEditor.${n}`]||!1}const s$=Ci.as(Gl.Configuration);s$.registerConfiguration(Cp);class o${static insert(e,t){return{range:new P(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}function m1(n){return Object.isFrozen(n)?n:K5(n)}class Ai{constructor(e={},t=[],i=[],s){this._contents=e,this._keys=t,this._overrides=i,this.raw=s,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(!((e=this.raw)===null||e===void 0)&&e.length){const t=this.raw.map(i=>{if(i instanceof Ai)return i;const s=new r$("");return s.parseRaw(i),s.configurationModel});this._rawConfiguration=t.reduce((i,s)=>s===i?s:i.merge(s),t[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?ML(this.contents,e):this.contents}inspect(e,t){const i=this.rawConfiguration.getValue(e),s=t?this.rawConfiguration.getOverrideValue(e,t):void 0,o=t?this.rawConfiguration.override(t).getValue(e):i;return{value:i,override:s,merged:o}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?ML(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var t,i;const s=zr(this.contents),o=zr(this.overrides),r=[...this.keys],a=!((t=this.raw)===null||t===void 0)&&t.length?[...this.raw]:[this];for(const l of e)if(a.push(...!((i=l.raw)===null||i===void 0)&&i.length?l.raw:[l]),!l.isEmpty()){this.mergeContents(s,l.contents);for(const c of l.overrides){const[u]=o.filter(h=>Fi(h.identifiers,c.identifiers));u?(this.mergeContents(u.contents,c.contents),u.keys.push(...c.keys),u.keys=El(u.keys)):o.push(zr(c))}for(const c of l.keys)r.indexOf(c)===-1&&r.push(c)}return new Ai(s,r,o,a.every(l=>l instanceof Ai)?void 0:a)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const i={};for(const s of El([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[s];const r=t[s];r&&(typeof o=="object"&&typeof r=="object"?(o=zr(o),this.mergeContents(o,r)):o=r),i[s]=o}return new Ai(i,this.keys,this.overrides)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&Xs(e[i])&&Xs(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=zr(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const s=o=>{o&&(i?this.mergeContents(i,o):i=zr(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&s(o.contents);return s(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),n3(this.contents,e),Ea.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>Fi(i.identifiers,Hm(e))),1))}updateValue(e,t,i){OI(this.contents,e,t,s=>console.error(s)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),Ea.test(e)&&this.overrides.push({identifiers:Hm(e),keys:Object.keys(this.contents[e]),contents:tv(this.contents[e],s=>console.error(s))})}}class r${constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new Ai}parseRaw(e,t){this._raw=e;const{contents:i,keys:s,overrides:o,restricted:r,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new Ai(i,s,o,a?[e]:void 0),this._restrictedConfigurations=r||[]}doParseRaw(e,t){const i=Ci.as(Gl.Configuration).getConfigurationProperties(),s=this.filter(e,i,!0,t);e=s.raw;const o=tv(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`)),r=Object.keys(e),a=this.toOverrides(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`));return{contents:o,keys:r,overrides:a,restricted:s.restricted,hasExcludedProperties:s.hasExcludedProperties}}filter(e,t,i,s){var o,r,a;let l=!1;if(!(s!=null&&s.scopes)&&!(s!=null&&s.skipRestricted)&&!(!((o=s==null?void 0:s.exclude)===null||o===void 0)&&o.length))return{raw:e,restricted:[],hasExcludedProperties:l};const c={},u=[];for(const h in e)if(Ea.test(h)&&i){const d=this.filter(e[h],t,!1,s);c[h]=d.raw,l=l||d.hasExcludedProperties,u.push(...d.restricted)}else{const d=t[h],f=d?typeof d.scope<"u"?d.scope:3:void 0;d!=null&&d.restricted&&u.push(h),!(!((r=s.exclude)===null||r===void 0)&&r.includes(h))&&(!((a=s.include)===null||a===void 0)&&a.includes(h)||(f===void 0||s.scopes===void 0||s.scopes.includes(f))&&!(s.skipRestricted&&(d!=null&&d.restricted)))?c[h]=e[h]:l=!0}return{raw:c,restricted:u,hasExcludedProperties:l}}toOverrides(e,t){const i=[];for(const s of Object.keys(e))if(Ea.test(s)){const o={};for(const r in e[s])o[r]=e[s][r];i.push({identifiers:Hm(s),keys:Object.keys(o),contents:tv(o,t)})}return i}}class a${constructor(e,t,i,s,o,r,a,l,c,u,h,d,f){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=s,this.defaultConfiguration=o,this.policyConfiguration=r,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=u,this.workspaceConfiguration=h,this.folderConfigurationModel=d,this.memoryConfigurationModel=f}inspect(e,t,i){const s=e.inspect(t,i);return{get value(){return m1(s.value)},get override(){return m1(s.override)},get merged(){return m1(s.merged)}}}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.inspect(this.userConfiguration,this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.userInspectValue.value!==void 0||this.userInspectValue.override!==void 0?{value:this.userInspectValue.value,override:this.userInspectValue.override}:void 0}}class A0{constructor(e,t,i,s,o=new Ai,r=new Ai,a=new qi,l=new Ai,c=new qi){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=s,this._remoteUserConfiguration=o,this._workspaceConfiguration=r,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new qi,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let s;i.resource?(s=this._memoryConfigurationByResource.get(i.resource),s||(s=new Ai,this._memoryConfigurationByResource.set(i.resource,s))):s=this._memoryConfiguration,t===void 0?s.removeValue(e):s.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const s=this.getConsolidatedConfigurationModel(e,t,i),o=this.getFolderConfigurationModelForResource(t.resource,i),r=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of s.overrides)for(const c of l.identifiers)s.getOverrideValue(e,c)!==void 0&&a.add(c);return new a$(e,t,s.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,o||void 0,r)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let s=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(s=s.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(s=s.merge(this._policyConfiguration)),s}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const s=t.getFolder(e);s&&(i=this.getFolderConsolidatedConfiguration(s.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),s=this._folderConfigurations.get(e);s?(t=i.merge(s),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:s,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:s,keys:o}]),e},[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),i=this.parseConfigurationModel(e.policy),s=this.parseConfigurationModel(e.application),o=this.parseConfigurationModel(e.user),r=this.parseConfigurationModel(e.workspace),a=e.folders.reduce((l,c)=>(l.set(Ue.revive(c[0]),this.parseConfigurationModel(c[1])),l),new qi);return new A0(t,i,s,o,new Ai,r,a,new Ai,new qi)}static parseConfigurationModel(e){return new Ai(e.contents,e.keys,e.overrides)}}class l${constructor(e,t,i,s){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=s,this._marker=`
`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const o of e.keys)this.affectedKeys.add(o);for(const[,o]of e.overrides)for(const r of o)this.affectedKeys.add(r);this._affectsConfigStr=this._marker;for(const o of this.affectedKeys)this._affectsConfigStr+=o+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=A0.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var i;const s=this._marker+e,o=this._affectsConfigStr.indexOf(s);if(o<0)return!1;const r=o+s.length;if(r>=this._affectsConfigStr.length)return!1;const a=this._affectsConfigStr.charCodeAt(r);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(i=this.previous)===null||i===void 0?void 0:i.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!Vn(l,c)}return!0}}const wp={kind:0},c$={kind:1};function u$(n,e,t){return{kind:2,commandId:n,commandArgs:e,isBubble:t}}class hd{constructor(e,t,i){var s;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const o of e){const r=o.command;r&&r.charAt(0)!=="-"&&this._defaultBoundCommands.set(r,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=hd.handleRemovals([].concat(e).concat(t));for(let o=0,r=this._keybindings.length;o"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.command===t.command)continue;let r=!0;for(let a=1;a"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,s=t.length;i"u"||i.length===0)return null;if(i.length===1)return i[0];for(let s=i.length-1;s>=0;s--){const o=i[s];if(t.contextMatchesRules(o.when))return o}return i[i.length-1]}resolve(e,t,i){const s=[...t,i];this._log(`| Resolving ${s}`);const o=this._map.get(s[0]);if(o===void 0)return this._log("\\ No keybinding entries."),wp;let r=null;if(s.length<2)r=o;else{r=[];for(let l=0,c=o.length;lu.chords.length)continue;let h=!0;for(let d=1;d=0;i--){const s=t[i];if(hd._contextMatchesRules(e,s.when))return s}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function YD(n){return n?`${n.serialize()}`:"no when condition"}function ZD(n){return n.extensionId?n.isBuiltinExtension?`built-in extension ${n.extensionId}`:`user extension ${n.extensionId}`:n.isDefault?"built-in":"user"}const h$=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class d$ extends Q{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:ae.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,s,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=s,this._logService=o,this._onDidUpdateKeybindings=this._register(new B),this._currentChords=[],this._currentChordChecker=new If,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=jc.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new ql,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),wp;const[s]=i.getDispatchChords();if(s===null)return this._log("\\ Keyboard event cannot be dispatched"),wp;const o=this._contextKeyService.getContext(t),r=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(o,r,s)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw dw("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(p("first.chord","({0}) was pressed. Waiting for second key of chord...",t));break;default:{const i=this._currentChords.map(({label:s})=>s).join(", ");this._currentChordStatusMessage=this._notificationService.status(p("next.chord","({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),Jh.enabled&&Jh.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],Jh.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[s]=i.getSingleModifierDispatchChords();if(s)return this._ignoreSingleModifiers.has(s)?(this._log(`+ Ignoring single modifier ${s} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=jc.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=jc.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${s}.`),this._currentSingleModifier=s,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):s===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${s} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new jc(o),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){var s;let o=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let r=null,a=null;if(i){const[h]=e.getSingleModifierDispatchChords();r=h,a=h?[h]:[]}else[r]=e.getDispatchChords(),a=this._currentChords.map(({keypress:h})=>h);if(r===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),o;const l=this._contextKeyService.getContext(t),c=e.getLabel(),u=this._getResolver().resolve(l,a,r);switch(u.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",c,"[ No matching keybinding ]"),this.inChordMode){const h=this._currentChords.map(({label:d})=>d).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${h}, ${c}".`),this._notificationService.status(p("missing.chord","The key combination ({0}, {1}) is not a command.",h,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}return o}case 1:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),o=!0,this._expectAnotherChord(r,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),o;case 2:{if(this._logService.trace("KeybindingService#dispatch",c,`[ Will dispatch command ${u.commandId} ]`),u.commandId===null||u.commandId===""){if(this.inChordMode){const h=this._currentChords.map(({label:d})=>d).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${h}, ${c}".`),this._notificationService.status(p("missing.chord","The key combination ({0}, {1}) is not a command.",h,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}}else this.inChordMode&&this._leaveChordMode(),u.isBubble||(o=!0),this._log(`+ Invoking command ${u.commandId}.`),typeof u.commandArgs>"u"?this._commandService.executeCommand(u.commandId).then(void 0,h=>this._notificationService.warn(h)):this._commandService.executeCommand(u.commandId,u.commandArgs).then(void 0,h=>this._notificationService.warn(h)),h$.test(u.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:u.commandId,from:"keybinding",detail:(s=e.getUserSettingsLabel())!==null&&s!==void 0?s:void 0});return o}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class jc{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}jc.EMPTY=new jc(null);class QD{constructor(e,t,i,s,o,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?Yv(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=Yv(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=s,this.isDefault=o,this.extensionId=r,this.isBuiltinExtension=a}}function Yv(n){const e=[];for(let t=0,i=n.length;tthis._getLabel(e))}getAriaLabel(){return f$.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:g$.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return m$.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new v9(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class ef extends _${constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return rr.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":rr.toString(e.keyCode)}_getElectronAccelerator(e){return rr.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=rr.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return ef.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=rr.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=_w[e];if(t!==-1)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof Al)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new Al(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=Yv(e.chords.map(s=>this._toKeyCodeChord(s)));return i.length>0?[new ef(i,t)]:[]}}const b$=Ke("labelService"),v$=Ke("progressService"),xy=Ke("editorProgressService");class C${constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;t--,this._valueLen--){const i=this._value.charCodeAt(t);if(!(i===47||this._splitOnBackslash&&i===92))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new dd(new S$(e,t))}static forStrings(){return new dd(new C$)}static forConfigKeys(){return new dd(new w$)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let s;this._root||(this._root=new Pg,this._root.segment=i.value());const o=[];for(s=this._root;;){const a=i.cmp(s.segment);if(a>0)s.left||(s.left=new Pg,s.left.segment=i.value()),o.push([-1,s]),s=s.left;else if(a<0)s.right||(s.right=new Pg,s.right.segment=i.value()),o.push([1,s]),s=s.right;else if(i.hasNext())i.next(),s.mid||(s.mid=new Pg,s.mid.segment=i.value()),o.push([0,s]),s=s.mid;else break}const r=s.value;s.value=t,s.key=e;for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const u=o[a][0],h=o[a+1][0];if(u===1&&h===1)o[a][1]=l.rotateLeft();else if(u===-1&&h===-1)o[a][1]=l.rotateRight();else if(u===1&&h===-1)l.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=l.rotateLeft();else if(u===-1&&h===1)l.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return r}get(e){var t;return(t=this._getNode(e))===null||t===void 0?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const s=t.cmp(i.segment);if(s>0)i=i.left;else if(s<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){const t=this._getNode(e);return!((t==null?void 0:t.value)===void 0&&(t==null?void 0:t.mid)===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var i;const s=this._iter.reset(e),o=[];let r=this._root;for(;r;){const a=s.cmp(r.segment);if(a>0)o.push([-1,r]),r=r.left;else if(a<0)o.push([1,r]),r=r.right;else if(s.hasNext())s.next(),o.push([0,r]),r=r.mid;else break}if(r){if(t?(r.left=void 0,r.mid=void 0,r.right=void 0,r.height=1):(r.key=void 0,r.value=void 0),!r.mid&&!r.value)if(r.left&&r.right){const a=this._min(r.right);if(a.key){const{key:l,value:c,segment:u}=a;this._delete(a.key,!1),r.key=l,r.value=c,r.segment=u}}else{const a=(i=r.left)!==null&&i!==void 0?i:r.right;if(o.length>0){const[l,c]=o[o.length-1];switch(l){case-1:c.left=a;break;case 0:c.mid=a;break;case 1:c.right=a;break}}else this._root=a}for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c>1?(l.right.balanceFactor()>=0||(l.right=l.right.rotateRight()),o[a][1]=l.rotateLeft()):c<-1&&(l.left.balanceFactor()<=0||(l.left=l.left.rotateLeft()),o[a][1]=l.rotateRight()),a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i=this._root,s;for(;i;){const o=t.cmp(i.segment);if(o>0)i=i.left;else if(o<0)i=i.right;else if(t.hasNext())t.next(),s=i.value||s,i=i.mid;else break}return i&&i.value||s}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let s=this._root;for(;s;){const o=i.cmp(s.segment);if(o>0)s=s.left;else if(o<0)s=s.right;else if(i.hasNext())i.next(),s=s.mid;else return s.mid?this._entries(s.mid):t?s.value:void 0}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value&&t.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const L$=Ke("contextService");class k${constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const D$="code-workspace";p("codeWorkspace","Code Workspace");const x$="4064f6ec-cb38-4ad0-af64-ee6467e63c82";var XD;(function(n){n.inspectTokensAction=p("inspectTokens","Developer: Inspect Tokens")})(XD||(XD={}));var JD;(function(n){n.gotoLineActionLabel=p("gotoLineActionLabel","Go to Line/Column...")})(JD||(JD={}));var ex;(function(n){n.helpQuickAccessActionLabel=p("helpQuickAccess","Show all Quick Access Providers")})(ex||(ex={}));var tx;(function(n){n.quickCommandActionLabel=p("quickCommandActionLabel","Command Palette"),n.quickCommandHelp=p("quickCommandActionHelp","Show And Run Commands")})(tx||(tx={}));var ix;(function(n){n.quickOutlineActionLabel=p("quickOutlineActionLabel","Go to Symbol..."),n.quickOutlineByCategoryActionLabel=p("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(ix||(ix={}));var yp;(function(n){n.editorViewAccessibleLabel=p("editorViewAccessibleLabel","Editor content"),n.accessibilityHelpMessage=p("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(yp||(yp={}));var nx;(function(n){n.toggleHighContrast=p("toggleHighContrast","Toggle High Contrast Theme")})(nx||(nx={}));var Zv;(function(n){n.bulkEditServiceSummary=p("bulkEditServiceSummary","Made {0} edits in {1} files")})(Zv||(Zv={}));const E$=Ke("workspaceTrustManagementService"),Bf=Ke("contextViewService"),nh=Ke("contextMenuService");var Ni;(function(n){function e(o,r){if(o.start>=r.end||r.start>=o.end)return{start:0,end:0};const a=Math.max(o.start,r.start),l=Math.min(o.end,r.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}n.intersect=e;function t(o){return o.end-o.start<=0}n.isEmpty=t;function i(o,r){return!t(e(o,r))}n.intersects=i;function s(o,r){const a=[],l={start:o.start,end:Math.min(r.start,o.end)},c={start:Math.max(r.end,o.start),end:o.end};return t(l)||a.push(l),t(c)||a.push(c),a}n.relativeComplement=s})(Ni||(Ni={}));function I$(n){const e=n;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var la;(function(n){n[n.AVOID=0]="AVOID",n[n.ALIGN=1]="ALIGN"})(la||(la={}));function Kc(n,e,t){const i=t.mode===la.ALIGN?t.offset:t.offset+t.size,s=t.mode===la.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=n-i?i:e<=s?s-e:Math.max(n-e,0):e<=s?s-e:e<=n-i?i:0}class Uu extends Q{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=Q.None,this.toDisposeOnSetContainer=Q.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=ye(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,SL(this.view),this.setContainer(e,t),this._register(ze(()=>this.setContainer(null,1)))}setContainer(e,t){var i;if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,(i=this.shadowRootHostElement)===null||i===void 0||i.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e){if(this.container=e,this.useFixedPosition=t!==1,this.useShadowDOM=t===3,this.useShadowDOM){this.shadowRootHostElement=ye(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=T$,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(ye("slot"))}else this.container.appendChild(this.view);const s=new Se;Uu.BUBBLE_UP_EVENTS.forEach(o=>{s.add(Ii(this.container,o,r=>{this.onDOMEvent(r,!1)}))}),Uu.BUBBLE_DOWN_EVENTS.forEach(o=>{s.add(Ii(this.container,o,r=>{this.onDOMEvent(r,!0)},!0))}),this.toDisposeOnSetContainer=s}}show(e){var t,i;this.isVisible()&&this.hide(),eo(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2575",this.view.style.position=this.useFixedPosition?"fixed":"absolute",vI(this.view),this.toDisposeOnClean=e.render(this.view)||Q.None,this.delegate=e,this.doLayout(),(i=(t=this.delegate).focus)===null||i===void 0||i.call(t)}getViewElement(){return this.view}layout(){if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(Il&&nI.pointerEvents)){this.hide();return}this.delegate.layout&&this.delegate.layout(),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(Ow(e)){const h=ws(e),d=u7(e);t={top:h.top*d,left:h.left*d,width:h.width*d,height:h.height*d}}else I$(e)?t={top:e.y,left:e.x,width:e.width||1,height:e.height||2}:t={top:e.posy,left:e.posx,width:2,height:2};const i=Rw(this.view),s=Yb(this.view),o=this.delegate.anchorPosition||0,r=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0;let l,c;if(a===0){const h={offset:t.top-window.pageYOffset,size:t.height,position:o===0?0:1},d={offset:t.left,size:t.width,position:r===0?0:1,mode:la.ALIGN};l=Kc(window.innerHeight,s,h)+window.pageYOffset,Ni.intersects({start:l,end:l+s},{start:h.offset,end:h.offset+h.size})&&(d.mode=la.AVOID),c=Kc(window.innerWidth,i,d)}else{const h={offset:t.left,size:t.width,position:r===0?0:1},d={offset:t.top,size:t.height,position:o===0?0:1,mode:la.ALIGN};c=Kc(window.innerWidth,i,h),Ni.intersects({start:c,end:c+i},{start:h.offset,end:h.offset+h.size})&&(d.mode=la.AVOID),l=Kc(window.innerHeight,s,d)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===0?"bottom":"top"),this.view.classList.add(r===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const u=ws(this.container);this.view.style.top=`${l-(this.useFixedPosition?ws(this.view).top:u.top)}px`,this.view.style.left=`${c-(this.useFixedPosition?ws(this.view).left:u.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t!=null&&t.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),SL(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!Oi(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}Uu.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];Uu.BUBBLE_DOWN_EVENTS=["click"];const T$=`
:host {
all: initial; /* 1st rule so subsequent properties are reset. */
}
.codicon[class*='codicon-'] {
font: normal normal normal 16px/1 codicon;
display: inline-block;
text-decoration: none;
text-rendering: auto;
text-align: center;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
:host {
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;
}
:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }
:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }
:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }
:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }
:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }
:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }
:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }
:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }
:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }
:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }
:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }
:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; }
:host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; }
:host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }
`;var N$=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},A$=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Qv=class extends Q{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=Q.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new Uu(this.container,1)),this.layout(),this._register(e.onDidLayout(()=>this.layout()))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,i){t?(t!==this.container||this.shadowRoot!==i)&&(this.container=t,this.setContainer(t,i?3:2)):this.layoutService.hasContainer&&this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.shadowRoot=i,this.contextView.show(e);const s=ze(()=>{this.currentViewDisposable===s&&this.hideContextView()});return this.currentViewDisposable=s,s}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};Qv=N$([A$(0,ih)],Qv);let $u=[],Ey=[],EN=[];function Fg(n,e=!1){M$(n,!1,e)}function M$(n,e,t){const i=R$(n,e);$u.push(i),i.userConfigured?EN.push(i):Ey.push(i),t&&!i.userConfigured&&$u.forEach(s=>{s.mime===i.mime||s.userConfigured||(i.extension&&s.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&s.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&s.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&s.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function R$(n,e){return{id:n.id,mime:n.mime,filename:n.filename,extension:n.extension,filepattern:n.filepattern,firstline:n.firstline,userConfigured:e,filenameLowercase:n.filename?n.filename.toLowerCase():void 0,extensionLowercase:n.extension?n.extension.toLowerCase():void 0,filepatternLowercase:n.filepattern?SN(n.filepattern.toLowerCase()):void 0,filepatternOnPath:n.filepattern?n.filepattern.indexOf(Kt.sep)>=0:!1}}function O$(){$u=$u.filter(n=>n.userConfigured),Ey=[]}function P$(n,e){return F$(n,e).map(t=>t.id)}function F$(n,e){let t;if(n)switch(n.scheme){case Ve.file:t=n.fsPath;break;case Ve.data:{t=hp.parseMetaData(n).get(hp.META_DATA_LABEL);break}case Ve.vscodeNotebookCell:t=void 0;break;default:t=n.path}if(!t)return[{id:"unknown",mime:cr.unknown}];t=t.toLowerCase();const i=FE(t),s=sx(t,i,EN);if(s)return[s,{id:Zs,mime:cr.text}];const o=sx(t,i,Ey);if(o)return[o,{id:Zs,mime:cr.text}];if(e){const r=B$(e);if(r)return[r,{id:Zs,mime:cr.text}]}return[{id:"unknown",mime:cr.unknown}]}function sx(n,e,t){var i;let s,o,r;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){s=l;break}if(l.filepattern&&(!o||l.filepattern.length>o.filepattern.length)){const c=l.filepatternOnPath?n:e;!((i=l.filepatternLowercase)===null||i===void 0)&&i.call(l,c)&&(o=l)}l.extension&&(!r||l.extension.length>r.extension.length)&&e.endsWith(l.extensionLowercase)&&(r=l)}if(s)return s;if(o)return o;if(r)return r}function B$(n){if(Dw(n)&&(n=n.substr(1)),n.length>0)for(let e=$u.length-1;e>=0;e--){const t=$u[e];if(!t.firstline)continue;const i=n.match(t.firstline);if(i&&i.length>0)return t}}const Bg=Object.prototype.hasOwnProperty,ox="vs.editor.nullLanguage";class W${constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(ox,0),this._register(Zs,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||ox}}class tf extends Q{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,tf.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new W$,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(Au.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){tf.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},O$();const e=[].concat(Au.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const i=this._languages[t];i.name&&(this._nameMap[i.name]=i.identifier),i.aliases.forEach(s=>{this._lowercaseNameMap[s.toLowerCase()]=i.identifier}),i.mimetypes.forEach(s=>{this._mimeTypesMap[s]=i.identifier})}),Ci.as(Gl.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;Bg.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let s=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),s=t.mimetypes[0]),s||(s=`text/x-${i}`,e.mimetypes.push(s)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const a of t.extensions)Fg({id:i,mime:s,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)Fg({id:i,mime:s,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)Fg({id:i,mime:s,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const l=new RegExp(a);VP(l)||Fg({id:i,mime:s,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(i);let o=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?o=[null]:o=t.aliases),o!==null)for(const a of o)!a||a.length===0||e.aliases.push(a);const r=o!==null&&o.length>0;if(!(r&&o[0]===null)){const a=(r?o[0]:null)||i;(r||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?Bg.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return Bg.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&Bg.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:P$(e,t)}}tf.instanceCount=0;class nf extends Q{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new B),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new B),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new B({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,nf.instanceCount++,this._registry=this._register(new tf(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){nf.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){const i=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return fE(i,null)}createById(e){return new rx(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new rx(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=Zs),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),jt.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}nf.instanceCount=0;class rx{constructor(e,t){this._onDidChangeLanguages=e,this._selector=t,this._listener=null,this._emitter=null,this.languageId=this._selector()}_dispose(){this._listener&&(this._listener.dispose(),this._listener=null),this._emitter&&(this._emitter.dispose(),this._emitter=null)}get onDidChange(){return this._listener||(this._listener=this._onDidChangeLanguages(()=>this._evaluate())),this._emitter||(this._emitter=new B({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const t=this._selector();t!==this.languageId&&(this.languageId=t,(e=this._emitter)===null||e===void 0||e.fire(this.languageId))}}const IN={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:cr.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};function TN(...n){return function(e,t){for(let i=0,s=n.length;i0?[{start:0,end:e.length}]:[]:null}function V$(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t===-1?null:[{start:t,end:t+n.length}]}function H$(n,e){return Xv(n.toLowerCase(),e.toLowerCase(),0,0)}function Xv(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]===e[i]){let s=null;return(s=Xv(n,e,t+1,i+1))?MN({start:i,end:i+1},s):null}return Xv(n,e,t,i+1)}function Iy(n){return 97<=n&&n<=122}function R0(n){return 65<=n&&n<=90}function Ty(n){return 48<=n&&n<=57}function z$(n){return n===32||n===9||n===10||n===13}const U$=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(n=>U$.add(n.charCodeAt(0)));function AN(n){return Iy(n)||R0(n)||Ty(n)}function MN(n,e){return e.length===0?e=[n]:n.end===e[0].start?e[0].start=n.start:e.unshift(n),e}function RN(n,e){for(let t=e;t0&&!AN(n.charCodeAt(t-1)))return t}return n.length}function Jv(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]!==e[i].toLowerCase())return null;{let s=null,o=i+1;for(s=Jv(n,e,t+1,i+1);!s&&(o=RN(e,o)).6}function K$(n){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:s}=n;return t>.2&&e<.8&&i>.6&&s<.2}function q$(n){let e=0,t=0,i=0,s=0;for(let o=0;o60)return null;const t=$$(e);if(!K$(t)){if(!j$(t))return null;e=e.toLowerCase()}let i=null,s=0;for(n=n.toLowerCase();s"u")return[];const e=[],t=n[1];for(let i=n.length-1;i>1;i--){const s=n[i]+t,o=e[e.length-1];o&&o.end===s?o.end=s+1:e.push({start:s,end:s+1})}return e}const ca=128;function Ny(){const n=[],e=[];for(let t=0;t<=ca;t++)e[t]=0;for(let t=0;t<=ca;t++)n.push(e.slice(0));return n}function PN(n){const e=[];for(let t=0;t<=n;t++)e[t]=0;return e}const FN=PN(2*ca),eC=PN(2*ca),Xo=Ny(),qa=Ny(),Wg=Ny();function Vg(n,e){if(e<0||e>=n.length)return!1;const t=n.codePointAt(e);switch(t){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!kw(t)}}function cx(n,e){if(e<0||e>=n.length)return!1;switch(n.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function fm(n,e,t){return e[n]!==t[n]}function X$(n,e,t,i,s,o,r=!1){for(;eca?ca:n.length,l=i.length>ca?ca:i.length;if(t>=a||o>=l||a-t>l-o||!X$(e,t,a,s,o,l,!0))return;J$(a,l,t,o,e,s);let c=1,u=1,h=t,d=o;const f=[!1];for(c=1,h=t;h_,D=x?qa[c][u-1]+(Xo[c][u-1]>0?-5:0):0,R=d>_+1&&Xo[c][u-1]>0,W=R?qa[c][u-2]+(Xo[c][u-2]>0?-5:0):0;if(R&&(!x||W>=D)&&(!k||W>=L))qa[c][u]=W,Wg[c][u]=3,Xo[c][u]=0;else if(x&&(!k||D>=L))qa[c][u]=D,Wg[c][u]=2,Xo[c][u]=0;else if(k)qa[c][u]=L,Wg[c][u]=1,Xo[c][u]=Xo[c-1][u-1]+1;else throw new Error("not possible")}}if(!f[0]&&!r.firstMatchCanBeWeak)return;c--,u--;const g=[qa[c][u],o];let m=0,b=0;for(;c>=1;){let _=u;do{const C=Wg[c][_];if(C===3)_=_-2;else if(C===2)_=_-1;else break}while(_>=1);m>1&&e[t+c-1]===s[o+u-1]&&!fm(_+o-1,i,s)&&m+1>Xo[c][_]&&(_=u),_===u?m++:m=1,b||(b=_),c--,u=_-1,g.push(u)}l===a&&r.boostFullMatch&&(g[0]+=2);const v=b-a;return g[0]-=v,g}function J$(n,e,t,i,s,o){let r=n-1,a=e-1;for(;r>=t&&a>=i;)s[r]===o[a]&&(eC[r]=a,r--),a--}function ej(n,e,t,i,s,o,r,a,l,c,u){if(e[t]!==o[r])return Number.MIN_SAFE_INTEGER;let h=1,d=!1;return r===t-i?h=n[t]===s[r]?7:5:fm(r,s,o)&&(r===0||!fm(r-1,s,o))?(h=n[t]===s[r]?7:5,d=!0):Vg(o,r)&&(r===0||!Vg(o,r-1))?h=5:(Vg(o,r-1)||cx(o,r-1))&&(h=5,d=!0),h>1&&t===i&&(u[0]=!0),d||(d=fm(r,s,o)||Vg(o,r-1)||cx(o,r-1)),t===i?r>l&&(h-=d?3:5):c?h+=d?2:0:h+=d?0:1,r+1===a&&(h-=d?3:5),h}const tj="$(",Ay=new RegExp(`\\$\\(${Ye.iconNameExpression}(?:${Ye.iconModifierExpression})?\\)`,"g"),ij=new RegExp(`(\\\\)?${Ay.source}`,"g");function nj(n){return n.replace(ij,(e,t)=>t?e:`\\${e}`)}const sj=new RegExp(`\\\\${Ay.source}`,"g");function oj(n){return n.replace(sj,e=>`\\${e}`)}const rj=new RegExp(`(\\s)?(\\\\)?${Ay.source}(\\s)?`,"g");function VN(n){return n.indexOf(tj)===-1?n:n.replace(rj,(e,t,i,s)=>i?e:t||s||"")}function aj(n){return n?n.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const p1=new RegExp(`\\$\\(${Ye.iconNameCharacter}+\\)`,"g");function $h(n){p1.lastIndex=0;let e="";const t=[];let i=0;for(;;){const s=p1.lastIndex,o=p1.exec(n),r=n.substring(s,o==null?void 0:o.index);if(r.length>0){e+=r;for(let a=0;a" ".repeat(s.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\
`:`
`),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+=`
`,this.value+=t,this.value+="\n```\n",this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(kr(t),"g");return e.replace(i,(s,o)=>e.charAt(o-1)!=="\\"?`\\${s}`:s)}}function gm(n){return n instanceof My?!0:n&&typeof n=="object"?typeof n.value=="string"&&(typeof n.isTrusted=="boolean"||typeof n.isTrusted=="object"||n.isTrusted===void 0)&&(typeof n.supportThemeIcons=="boolean"||n.supportThemeIcons===void 0):!1}function lj(n,e){return n===e?!0:!n||!e?!1:n.value===e.value&&n.isTrusted===e.isTrusted&&n.supportThemeIcons===e.supportThemeIcons&&n.supportHtml===e.supportHtml&&(n.baseUri===e.baseUri||!!n.baseUri&&!!e.baseUri&&aH(Ue.from(n.baseUri),Ue.from(e.baseUri)))}function cj(n){return n.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function Hg(n){return n.replace(/"/g,""")}function b1(n){return n&&n.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function uj(n){const e=[],t=n.split("|").map(s=>s.trim());n=t[0];const i=t[1];if(i){const s=/height=(\d+)/.exec(i),o=/width=(\d+)/.exec(i),r=s?s[1]:"",a=o?o[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(r));l&&e.push(`width="${a}"`),c&&e.push(`height="${r}"`)}return{href:n,dimensions:e}}var tC=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(u){try{c(i.next(u))}catch(h){r(h)}}function l(u){try{c(i.throw(u))}catch(h){r(h)}}function c(u){u.done?o(u.value):s(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function hj(n,e){Ln(e)?n.title=VN(e):e!=null&&e.markdownNotSupportedFallback?n.title=e.markdownNotSupportedFallback:n.removeAttribute("title")}class dj{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t,i){var s;return tC(this,void 0,void 0,function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let o;if(e===void 0||Ln(e)||e instanceof HTMLElement)o=e;else if(!Em(e.markdown))o=(s=e.markdown)!==null&&s!==void 0?s:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(p("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new Ma;const r=this._cancellationTokenSource.token;if(o=yield e.markdown(r),o===void 0&&(o=e.markdownNotSupportedFallback),this.isDisposed||r.isCancellationRequested)return}this.show(o,t,i)})}show(e,t,i){const s=this._hoverWidget;if(this.hasContent(e)){const o=Object.assign({content:e,target:this.target,showPointer:this.hoverDelegate.placement==="element",hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!s},i);this._hoverWidget=this.hoverDelegate.showHover(o,t)}s==null||s.dispose()}hasContent(e){return e?gm(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}}function HN(n,e,t,i){let s,o;const r=(h,d)=>{var f;const g=o!==void 0;h&&(o==null||o.dispose(),o=void 0),d&&(s==null||s.dispose(),s=void 0),g&&((f=n.onDidHideHover)===null||f===void 0||f.call(n))},a=(h,d,f)=>new ql(()=>tC(this,void 0,void 0,function*(){(!o||o.isDisposed)&&(o=new dj(n,f||e,h>0),yield o.update(t,d,i))}),h),l=()=>{if(s)return;const h=new Se,d=m=>r(!1,m.fromElement===e);h.add(q(e,oe.MOUSE_LEAVE,d,!0));const f=()=>r(!0,!0);h.add(q(e,oe.MOUSE_DOWN,f,!0));const g={targetElements:[e],dispose:()=>{}};if(n.placement===void 0||n.placement==="mouse"){const m=b=>{g.x=b.x+10,b.target instanceof HTMLElement&&b.target.classList.contains("action-label")&&r(!0,!0)};h.add(q(e,oe.MOUSE_MOVE,m,!0))}h.add(a(n.delay,!1,g)),s=h},c=q(e,oe.MOUSE_OVER,l,!0);return{show:h=>{r(!1,!0),a(0,h)},hide:()=>{r(!0,!0)},update:(h,d)=>tC(this,void 0,void 0,function*(){t=h,yield o==null?void 0:o.update(t,void 0,d)}),dispose:()=>{c.dispose(),r(!0,!0)}}}function fj(n,e={}){const t=Ry(e);return t.textContent=n,t}function gj(n,e={}){const t=Ry(e);return zN(t,pj(n,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function Ry(n){const e=n.inline?"span":"div",t=document.createElement(e);return n.className&&(t.className=n.className),t}class mj{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function zN(n,e,t,i){let s;if(e.type===2)s=document.createTextNode(e.content||"");else if(e.type===3)s=document.createElement("b");else if(e.type===4)s=document.createElement("i");else if(e.type===7&&i)s=document.createElement("code");else if(e.type===5&&t){const o=document.createElement("a");t.disposables.add(Ii(o,"click",r=>{t.callback(String(e.index),r)})),s=o}else e.type===8?s=document.createElement("br"):e.type===1&&(s=n);s&&n!==s&&n.appendChild(s),s&&Array.isArray(e.children)&&e.children.forEach(o=>{zN(s,o,t,i)})}function pj(n,e){const t={type:1,children:[]};let i=0,s=t;const o=[],r=new mj(n);for(;!r.eos();){let a=r.next();const l=a==="\\"&&iC(r.peek(),e)!==0;if(l&&(a=r.next()),!l&&_j(a,e)&&a===r.peek()){r.advance(),s.type===2&&(s=o.pop());const c=iC(a,e);if(s.type===c||s.type===5&&c===6)s=o.pop();else{const u={type:c,children:[]};c===5&&(u.index=i,i++),s.children.push(u),o.push(s),s=u}}else if(a===`
`)s.type===2&&(s=o.pop()),s.children.push({type:8});else if(s.type!==2){const c={type:2,content:a};s.children.push(c),o.push(s),s=c}else s.content+=a}return s.type===2&&(s=o.pop()),t}function _j(n,e){return iC(n,e)!==0}function iC(n,e){switch(n){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const bj=new RegExp(`(\\\\)?\\$\\((${Ye.iconNameExpression}(?:${Ye.iconModifierExpression})?)\\)`,"g");function Dl(n){const e=new Array;let t,i=0,s=0;for(;(t=bj.exec(n))!==null;){s=t.index||0,iG.length)&&($=G.length);for(var U=0,E=new Array($);U<$;U++)E[U]=G[U];return E}function r(G,$){var U=typeof Symbol<"u"&&G[Symbol.iterator]||G["@@iterator"];if(U)return(U=U.call(G)).next.bind(U);if(Array.isArray(G)||(U=s(G))||$&&G&&typeof G.length=="number"){U&&(G=U);var E=0;return function(){return E>=G.length?{done:!0}:{done:!1,value:G[E++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults=a();function l(G){e.defaults=G}var c=/[&<>"']/,u=/[&<>"']/g,h=/[<>"']|&(?!#?\w+;)/,d=/[<>"']|&(?!#?\w+;)/g,f={"&":"&","<":"<",">":">",'"':""","'":"'"},g=function($){return f[$]};function m(G,$){if($){if(c.test(G))return G.replace(u,g)}else if(h.test(G))return G.replace(d,g);return G}var b=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function v(G){return G.replace(b,function($,U){return U=U.toLowerCase(),U==="colon"?":":U.charAt(0)==="#"?U.charAt(1)==="x"?String.fromCharCode(parseInt(U.substring(2),16)):String.fromCharCode(+U.substring(1)):""})}var _=/(^|[^\[])\^/g;function C(G,$){G=typeof G=="string"?G:G.source,$=$||"";var U={replace:function(I,F){return F=F.source||F,F=F.replace(_,"$1"),G=G.replace(I,F),U},getRegex:function(){return new RegExp(G,$)}};return U}var w=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(G,$,U){if(G){var E;try{E=decodeURIComponent(v(U)).replace(w,"").toLowerCase()}catch{return null}if(E.indexOf("javascript:")===0||E.indexOf("vbscript:")===0||E.indexOf("data:")===0)return null}$&&!S.test(U)&&(U=W($,U));try{U=encodeURI(U).replace(/%25/g,"%")}catch{return null}return U}var L={},x=/^[^:]+:\/*[^/]*$/,D=/^([^:]+:)[\s\S]*$/,R=/^([^:]+:\/*[^/]*)[\s\S]*$/;function W(G,$){L[" "+G]||(x.test(G)?L[" "+G]=G+"/":L[" "+G]=V(G,"/",!0)),G=L[" "+G];var U=G.indexOf(":")===-1;return $.substring(0,2)==="//"?U?$:G.replace(D,"$1")+$:$.charAt(0)==="/"?U?$:G.replace(R,"$1")+$:G+$}var M={exec:function(){}};function A(G){for(var $=1,U,E;$=0&&Y[ge]==="\\";)ee=!ee;return ee?"|":" |"}),E=U.split(/ \|/),I=0;if(E[0].trim()||E.shift(),E.length>0&&!E[E.length-1].trim()&&E.pop(),E.length>$)E.splice($);else for(;E.length<$;)E.push("");for(;I