@opensumi/cli-engine 3.9.1-next-1753350817.0 → 3.9.1-next-1755745798.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33051,7 +33051,7 @@ ${I.alwaysApply?I.content:I.description||I.content}`}).join(`
33051
33051
  `);let f=0;E.forEach((d,y)=>{const{parts:b,currentStyle:A}=(0,p.ansiParser)(d,this.lastStyle);this.lastStyle=A,this.matchOutput(a,b,f||y);const S=b.map(I=>I.content).join(""),D=Math.ceil(S.length/c);f+=Math.max(1,D)})}}getMatcherRules(){const a=this.inlineChatFeatureRegistry.getTerminalActions(),h=[];return a.forEach(u=>{const c=this.inlineChatFeatureRegistry.getTerminalHandler(u.id);Array.isArray(c?.triggerRules)&&c.triggerRules.forEach(E=>{E instanceof m.BaseTerminalDetectionLineMatcher?h.push({matcher:E,action:u}):typeof E=="function"&&Object.getPrototypeOf(E)===m.BaseTerminalDetectionLineMatcher&&h.push({matcher:new E,action:u})})}),h}matchOutput(a,h,u){var c,E;if(this.currentActions)this.currentActions.matcher.match(h)?(c=this.outputRecordMap.get(a))===null||c===void 0||c.push({type:this.currentActions.matcher.type,text:h.map(f=>f.content).join("")}):this.matchedEnd(a,this.currentActions);else{const d=this.getMatcherRules().find(y=>y.matcher.match(h));d&&(this.registerMarker(a,u),(E=this.outputRecordMap.get(a))===null||E===void 0||E.push({type:d.matcher.type,text:h.map(y=>y.content).join("")}),d.matcher.isMultiLine?this.currentActions={action:d.action,matcher:d.matcher}:this.matchedEnd(a,d))}}matchedEnd(a,h){var u,c;const E=this.resolveDelControl((u=this.inputRecordMap.get(a))===null||u===void 0?void 0:u.map(d=>d.text).join(`
33052
33052
  `)),f=(c=this.outputRecordMap.get(a))===null||c===void 0?void 0:c.map(d=>d.text).join(`
33053
33053
  `);this.addDecoration(a,h,E,f),this.report(h.matcher.type,E,f),this.resetState(a)}addDecoration(a,h,u,c){const E=this.terminalController.clients.get(a),f=E?.term,d=this.clientCurrentMarker.get(a);if(f&&c&&d){const y=c?.split(`
33054
- `).length;this.terminalDecorations.addZoneDecoration(f,d,y,{operationList:[h.action],onClickItem:()=>{const b=this.inlineChatFeatureRegistry.getTerminalHandler(h.action.id);b&&b.execute(c,u||"",h.matcher)}})}}resolveDelControl(a=""){const h=a.split("");let u=0;for(;u<h.length;)if(h[u].charCodeAt(0)===127){const c=Math.max(u-1,0);h.splice(c,1),u=c}else u++;return h.join("")}report(a,h,u){}registerMarker(a,h){const u=this.terminalController.clients.get(a);if(u){const c=u.term.registerMarker(h);this.clientCurrentMarker.set(a,c),this.disposables.push(c)}}handleClientInput(a,h){const u=h.toString(),c=this.inputRecordMap.get(a);/[\r\n]/.test(u)?(this.isTyping=!1,c?.push({text:this.inputCache})):(this.inputCache+=u,this.isTyping=!0)}};t.AITerminalService=s,n.__decorate([(0,r.Autowired)(l.ITerminalController),n.__metadata("design:type",Object)],s.prototype,"terminalController",void 0),n.__decorate([(0,r.Autowired)(v.AITerminalDecorationService),n.__metadata("design:type",v.AITerminalDecorationService)],s.prototype,"terminalDecorations",void 0),n.__decorate([(0,r.Autowired)(o.InlineChatFeatureRegistryToken),n.__metadata("design:type",_.InlineChatFeatureRegistry)],s.prototype,"inlineChatFeatureRegistry",void 0),t.AITerminalService=s=n.__decorate([(0,r.Injectable)()],s)},32113:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AITerminalPrompt=t.KeyboardSelectableList=void 0;const n=e(85608),r=n.__importDefault(e(12784)),o=n.__importStar(e(14041)),l=e(41869),_=e(81878),v=e(89195),m=n.__importDefault(e(58274)),p=g=>{const{items:a,handleSuggestionClick:h,noListen:u=!1,controller:c}=g,[E,f]=(0,o.useState)(-1),d=y=>{switch(y.key){case"ArrowUp":f(b=>Math.max(b-1,0));break;case"ArrowDown":f(b=>Math.min(b+1,a.length-1));break;case"Enter":a[E]&&h(a[E].command);break;default:break}};return(0,o.useEffect)(()=>{if(!u)return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}},[a,E]),(0,o.useEffect)(()=>{if(!c)return;const y=c.event(b=>{b==="ArrowUp"&&f(A=>Math.max(A-1,0)),(b==="ArrowDown"||b==="Tab")&&f(A=>Math.min(A+1,a.length-1)),b==="Enter"&&a[E]&&h(a[E].command)});return()=>{y.dispose()}},[c,E,a]),(0,o.useEffect)(()=>{f(0)},[a]),o.default.createElement("div",{className:m.default.suggestions},a.map((y,b)=>o.default.createElement("div",{key:b,className:m.default.suggestionItem,style:{backgroundColor:b===E?"var(--selection-background)":""},onClick:()=>h(y.command)},o.default.createElement("div",{className:m.default.suggestionItemContainer},o.default.createElement("div",{className:m.default.suggestionDesc},y.description),o.default.createElement("div",{className:m.default.suggestionCmd},y.command)))))};t.KeyboardSelectableList=p;const s=g=>{const{onEscTriggered:a,onSuggestionClick:h,getAICommandSuggestions:u,cancelAIRequst:c}=g,[E,f]=(0,o.useState)(""),[d,y]=(0,o.useState)([]),[b,A]=(0,o.useState)(!1),[S,D]=(0,o.useState)((0,l.localize)("terminal.ai.escClose")),I=(0,o.useRef)(null),w=(0,o.useCallback)(async x=>{A(!0),D((0,l.localize)("terminal.ai.requesting")),u(x,()=>{A(!1),D((0,l.localize)("terminal.ai.selectHint"))},()=>{A(!0),D((0,l.localize)("terminal.ai.thinking"))},k=>{y([...k].reverse())})},[d]),T=(0,o.useCallback)((0,r.default)(x=>{w(x)},1e3),[]);(0,o.useEffect)(()=>{const x=k=>{(k.key==="Escape"||k.keyCode===27)&&a()};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}},[]),(0,o.useEffect)(()=>{const x=k=>{I.current&&!I.current.contains(k.target)&&a()};return document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x)}},[a]);const R=x=>{const k=x.target.value;f(k),k.length>0&&!k.includes("'")&&T(k),k.length===0&&(y([]),D((0,l.localize)("terminal.ai.escClose")),c&&c())},M=(0,o.useCallback)(()=>{w(E)},[E]),O=x=>{h(x)};return o.default.createElement("div",{className:m.default.container,ref:I},o.default.createElement("div",{className:m.default.header},o.default.createElement("div",{style:{flex:"1"}},(0,l.localize)("terminal.ai.headerHint")),o.default.createElement("div",null,o.default.createElement(v.EnhanceIcon,{className:(0,_.getIcon)("close1"),onClick:()=>{a()}}))),o.default.createElement("div",{style:{position:"relative",marginLeft:"-14px"}},d.length>0&&o.default.createElement(t.KeyboardSelectableList,{items:d,handleSuggestionClick:O})),o.default.createElement("div",{className:m.default.inputContainer},o.default.createElement(_.Input,{type:"text",value:E,onKeyDown:x=>{(x.key==="ArrowUp"||x.key==="ArrowDown")&&x.preventDefault()},onChange:R,onPressEnter:()=>M(),placeholder:(0,l.localize)("terminal.ai.inputHint"),className:m.default.input,autoFocus:!0}),b?o.default.createElement("div",{className:m.default.ai_loading},o.default.createElement("div",{className:m.default.loader}),o.default.createElement("div",{className:m.default.loader}),o.default.createElement("div",{className:m.default.loader})):o.default.createElement(v.EnhanceIcon,{wrapperClassName:m.default.send_icon,className:(0,_.getIcon)("send-solid"),onClick:()=>{T(E)}})),o.default.createElement("div",{className:m.default.statusContainer},S))};t.AITerminalPrompt=s},39273:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalInlineWidgetForDetection=t.TerminalInlineWidgetForSelection=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(89195),l=n.__importDefault(e(57410)),_=({actions:m,onClickItem:p})=>r.default.createElement("div",{className:l.default.terminal_inline_chat},r.default.createElement(o.AIAction,{operationList:m,onClickItem:p}));t.TerminalInlineWidgetForSelection=_;const v=({actions:m,onClickItem:p})=>{const[s,g]=(0,r.useState)(!1);return r.default.createElement("div",{onMouseOver:a=>{g(!0),a.currentTarget.style.backgroundColor="rgba(255, 0, 0, 0.1)"},onMouseOut:a=>{g(!1),a.currentTarget.style.backgroundColor=""},style:{width:"100%",height:"100%"}},r.default.createElement("div",{className:l.default.terminal_inline_chat,style:{display:s?"block":"none"}},r.default.createElement(o.AIAction,{operationList:m,onClickItem:p})))};t.TerminalInlineWidgetForDetection=v},96415:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AITerminalDecorationService=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(25873),l=e(76003),_=e(43718),v=e(6487),m=e(2281),p=e(39273);let s=class extends _.Disposable{constructor(){super(...arguments),this.decorationList=[],this.decorationRootMap=new Map}active(){this.disposables.push(this.terminalController.onDidOpenTerminal(({id:a})=>this.doSelectionDecoration(a)))}addZoneDecoration(a,h,u,c){const E=a.registerDecoration({marker:h,width:a.cols,height:u});if(!E){console.error("Failed to create decoration for line",h);return}let f;E.onRender(d=>{f||(f=(0,o.createRoot)(d)),f.render(r.default.createElement(p.TerminalInlineWidgetForDetection,{actions:c.operationList,onClickItem:()=>{c.onClickItem()}}))}),E.onDispose(()=>{f&&f.unmount()})}doSelectionDecoration(a){const h=this.terminalController.clients.get(a),u=h?.term;u&&this.addDispose(u.onSelectionChange(()=>{const c=this.decorationList.pop();c&&(0,_.runWhenIdle)(()=>{c?.dispose()});const E=u.getSelectionPosition(),f=u.getSelection().trim();if(E&&f.length>0){const d=E.end.y,y=E.start.y,b=u.buffer.active.cursorY+u.buffer.active.baseY,A=y-b,S=d-y+1,D=u.registerMarker(A);if(D){const I=u.registerDecoration({marker:D,width:u.cols,height:S});if(I){let w;I.onRender(T=>{w||(w=(0,o.createRoot)(T));const M=this.inlineChatFeatureRegistry.getTerminalActions().filter(O=>{var x;return((x=this.inlineChatFeatureRegistry.getTerminalHandler(O.id))===null||x===void 0?void 0:x.triggerRules)==="selection"});w.render(r.default.createElement(p.TerminalInlineWidgetForSelection,{actions:M,onClickItem:O=>{const x=this.inlineChatFeatureRegistry.getTerminalHandler(O);x&&x.execute(f,"")}}))}),I.onDispose(()=>{w&&w.unmount()}),this.decorationList.push(I)}}}}))}};t.AITerminalDecorationService=s,n.__decorate([(0,l.Autowired)(v.ITerminalController),n.__metadata("design:type",Object)],s.prototype,"terminalController",void 0),n.__decorate([(0,l.Autowired)(_.InlineChatFeatureRegistryToken),n.__metadata("design:type",m.InlineChatFeatureRegistry)],s.prototype,"inlineChatFeatureRegistry",void 0),t.AITerminalDecorationService=s=n.__decorate([(0,l.Injectable)()],s)},4397:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseTerminalDetectionLineMatcher=t.MatcherType=void 0;var e;(function(r){r[r.base=0]="base",r[r.npm=1]="npm",r[r.typescript=2]="typescript",r[r.node=3]="node",r[r.shell=4]="shell",r[r.java=5]="java"})(e||(t.MatcherType=e={}));class n{constructor(){this.type=e.base,this.isMultiLine=!1,this.isMatched=!1,this.maxSpaceLine=0,this.currentSpaceLine=0}match(o){return this.doMatch(o)?(this.isMatched=!0,this.currentSpaceLine=0,!0):this.isMultiLine&&this.isMatched&&this.currentSpaceLine<this.maxSpaceLine?(this.currentSpaceLine++,!0):(this.isMatched=!1,!1)}}t.BaseTerminalDetectionLineMatcher=n},28358:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JavaMatcher=t.ShellMatcher=t.NPMMatcher=t.TSCMatcher=t.NodeMatcher=void 0,e(85608).__exportStar(e(4397),t);var r=e(12636);Object.defineProperty(t,"NodeMatcher",{enumerable:!0,get:function(){return r.NodeMatcher}});var o=e(41084);Object.defineProperty(t,"TSCMatcher",{enumerable:!0,get:function(){return o.TSCMatcher}});var l=e(97323);Object.defineProperty(t,"NPMMatcher",{enumerable:!0,get:function(){return l.NPMMatcher}});var _=e(29640);Object.defineProperty(t,"ShellMatcher",{enumerable:!0,get:function(){return _.ShellMatcher}});var v=e(82036);Object.defineProperty(t,"JavaMatcher",{enumerable:!0,get:function(){return v.JavaMatcher}})},82036:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JavaMatcher=void 0;const n=e(4397);class r extends n.BaseTerminalDetectionLineMatcher{constructor(){super(...arguments),this.type=n.MatcherType.java,this.isMultiLine=!0}doMatch(l){return this.isErrorStack(l)||this.isCasuseByError(l)||this.isExceptionError(l)}isErrorStack(l){return this.isMatched&&!!l.find(_=>/^\s+at\s/i.test(_.content))}isCasuseByError(l){return!!l.find(_=>/caused\sby:/i.test(_.content))}isExceptionError(l){return!!l.find(_=>/\w+Exception:/i.test(_.content))}}t.JavaMatcher=r},12636:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeMatcher=void 0;const n=e(60772),r=e(4397);class o extends r.BaseTerminalDetectionLineMatcher{constructor(){super(...arguments),this.type=r.MatcherType.node,this.isMultiLine=!0,this.maxSpaceLine=1}doMatch(_){return this.isSingleLineError(_)||this.isMultiPartError(_)}isSingleLineError(_){return _.length===1&&(0,n.isRedColor)(_[0])&&(this.isMatched||!this.isExcludeContent(_[0].content))}isMultiPartError(_){return _.length>1&&!_.some(v=>!(0,n.isRedColor)(v))}isExcludeContent(_){return _.length<20||/mfsu/i.test(_)||/\s-\s/.test(_)}}t.NodeMatcher=o},97323:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NPMMatcher=void 0;const n=e(60772),r=e(4397);class o extends r.BaseTerminalDetectionLineMatcher{constructor(){super(...arguments),this.type=r.MatcherType.npm,this.isMultiLine=!0,this.maxSpaceLine=1}doMatch(_){return!!_.find(v=>/ERR/.test(v.content)&&(0,n.isRedColor)(v))}}t.NPMMatcher=o},29640:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShellMatcher=void 0;const n=e(4397);class r extends n.BaseTerminalDetectionLineMatcher{constructor(){super(...arguments),this.type=n.MatcherType.shell,this.isMultiLine=!1}doMatch(l){return!!l.find(_=>/command\snot\sfound/.test(_.content))}}t.ShellMatcher=r},41084:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TSCMatcher=void 0;const n=e(60772),r=e(4397);class o extends r.BaseTerminalDetectionLineMatcher{constructor(){super(...arguments),this.type=r.MatcherType.typescript,this.isMultiLine=!0}doMatch(_){let v=!1,m=!1,p=!1;return _.forEach(s=>{/error/i.test(s.content)&&(0,n.isRedColor)(s)&&(v=!0),/TS\d+/.test(s.content)&&(m=!0),/Error:/i.test(s.content)&&(p=!0)}),v||m||p||this.isErrorStack(_)}isErrorStack(_){return this.isMatched&&!!_.find(v=>/^\s+at\s/i.test(v.content))}}t.TSCMatcher=o},14717:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PS1TerminalService=void 0;const n=e(85608),r=n.__importDefault(e(124)),o=n.__importDefault(e(14041)),l=e(25873),_=e(76003),v=e(41869),m=e(43718),p=e(6487),s=e(93062),g=e(32113),a=e(95121);var h;(function(c){c.PromptStarted="PS",c.PromptEnded="PE",c.CurrentWorkingDirectory="CWD"})(h||(h={}));let u=class extends m.Disposable{constructor(){super(...arguments),this.cancelToken=new m.CancellationTokenSource}active(){this.initContainer(),this.disposables.push(this.terminalController.onDidOpenTerminal(({id:E})=>this.listenTerminalEvent(E)))}listenTerminalEvent(E){const f=this.terminalController.clients.get(E);f&&setTimeout(()=>{this.listenPromptState(f.term)},0)}initContainer(){this.popupContainer=document.createElement("div"),document.body.appendChild(this.popupContainer)}listenPromptState(E){E.parser.registerOscHandler(6973,f=>{const d=f.indexOf(";");switch(d===-1?f:f.substring(0,d)){case h.PromptEnded:this.handlePromptEnd(E);break;default:return!1}return!1})}handlePromptEnd(E){this.promptEndMarker&&this.promptEndMarker.dispose(),this.promptEndDecoration&&this.promptEndDecoration.dispose(),this.promptEndMarker=E.registerMarker(0);const f=E.buffer.active.cursorX;this.onDataDisposable&&this.onDataDisposable.dispose();const d=E.registerDecoration({marker:this.promptEndMarker,width:E.cols,height:1,x:f+2,layer:"top"});d?.onRender(y=>{y.innerText=(0,v.localize)("terminal.ai.inputSharpToGetHint"),y.style.opacity="0.3"}),this.onDataDisposable=E.onData(y=>{var b;const A=E.buffer.active,S=A.cursorX,D=A.cursorY;d?.dispose(),y==="#"&&D+A.baseY===((b=this.promptEndMarker)===null||b===void 0?void 0:b.line)&&(S===f||S===f+1)&&this.showAICommandPopup(E,f)})}showAICommandPopup(E,f){var d,y,b;if(!this.promptEndMarker)return;this.promptEndDecoration=E.registerDecoration({marker:this.promptEndMarker,width:1,height:1,backgroundColor:"#2472C8",x:f,layer:"top"});const A=E._addonManager._addons.find(D=>{var I;return!!(!((I=D?.instance)===null||I===void 0)&&I.connection)}),S=(d=A?.instance)===null||d===void 0?void 0:d.connection;if(!S){console.error((0,v.localize)("terminal.ai.cannotGetTerminalConnection"));return}(y=this.promptEndDecoration)===null||y===void 0||y.onRender(D=>{const I=D.clientWidth;this.promptEndReactRoot&&this.promptEndReactRoot.unmount(),this.promptEndReactRoot=(0,l.createRoot)(this.popupContainer),this.promptEndReactRoot.render(o.default.createElement(g.AITerminalPrompt,{onEscTriggered:()=>{setTimeout(()=>{var w;S.sendData("\b"),(w=this.promptEndDecoration)===null||w===void 0||w.dispose()},0)},onSuggestionClick:w=>{setTimeout(()=>{var T;S.sendData("\b"),S.sendData(w),(T=this.promptEndDecoration)===null||T===void 0||T.dispose()},0)},getAICommandSuggestions:this.getAICommandSuggestions.bind(this),cancelAIRequst:this.stopAIStreamRequest.bind(this)})),(0,r.default)(this.popupContainer,D,{points:["bl","bl"],offset:[-I-6,0],targetOffset:[0,0],overflow:{adjustX:!1,adjustY:!1}})}),(b=this.promptEndDecoration)===null||b===void 0||b.onDispose(()=>{this.stopAIStreamRequest(),this.promptEndReactRoot&&this.promptEndReactRoot.unmount(),E.focus()})}async stopAIStreamRequest(){this.cancelToken.cancel(),this.cancelToken=new m.CancellationTokenSource}async getAICommandSuggestions(E,f,d,y){await this.stopAIStreamRequest();const b=this.aiReporter.start(m.AIServiceType.TerminalAICommand,{message:E}),A=await this.terminalFeatureRegistry.readableCommandSuggestions(E,this.cancelToken.token),S=[];(0,s.listenReadable)(A,{onData:D=>{S.push(D),y(S)},onEnd:()=>{f(),this.aiReporter.end(b,{message:E,success:!0,actionSource:m.ActionSourceEnum.Terminal})}})}};t.PS1TerminalService=u,n.__decorate([(0,_.Autowired)(p.ITerminalController),n.__metadata("design:type",Object)],u.prototype,"terminalController",void 0),n.__decorate([(0,_.Autowired)(m.TerminalRegistryToken),n.__metadata("design:type",a.TerminalFeatureRegistry)],u.prototype,"terminalFeatureRegistry",void 0),n.__decorate([(0,_.Autowired)(m.IAIReporter),n.__metadata("design:type",Object)],u.prototype,"aiReporter",void 0),t.PS1TerminalService=u=n.__decorate([(0,_.Injectable)()],u)},28505:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalAIContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(63439),v=e(96415),m=e(14717),p=e(95121);let s=class{onDidStart(){this.aiNativeConfigService.capabilities.supportsTerminalDetection&&(this.aiTerminalService.active(),this.aiTerminalDecorationService.active()),this.aiNativeConfigService.capabilities.supportsTerminalCommandSuggest&&this.terminalFeatureRegistry.hasProvider()&&this.ps1TerminalService.active()}};t.TerminalAIContribution=s,n.__decorate([(0,r.Autowired)(_.AITerminalService),n.__metadata("design:type",_.AITerminalService)],s.prototype,"aiTerminalService",void 0),n.__decorate([(0,r.Autowired)(v.AITerminalDecorationService),n.__metadata("design:type",v.AITerminalDecorationService)],s.prototype,"aiTerminalDecorationService",void 0),n.__decorate([(0,r.Autowired)(m.PS1TerminalService),n.__metadata("design:type",m.PS1TerminalService)],s.prototype,"ps1TerminalService",void 0),n.__decorate([(0,r.Autowired)(o.AINativeConfigService),n.__metadata("design:type",o.AINativeConfigService)],s.prototype,"aiNativeConfigService",void 0),n.__decorate([(0,r.Autowired)(l.TerminalRegistryToken),n.__metadata("design:type",p.TerminalFeatureRegistry)],s.prototype,"terminalFeatureRegistry",void 0),t.TerminalAIContribution=s=n.__decorate([(0,o.Domain)(o.ClientAppContribution)],s)},95121:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalFeatureRegistry=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(93062),_=e(77633);let v=class extends o.Disposable{constructor(){super(...arguments),this.providerMap=new Set}hasProvider(){return this.providerMap.size>0}registerCommandSuggestionsProvider(p){this.providerMap.add(p)}async readableCommandSuggestions(p,s){const g=Array.from(this.providerMap),a=[],h=[];for await(const c of g){const E=await c(p,s);if((0,l.isReadableStream)(E)){a.push(E);continue}h.push(...E)}const u=_.TerminalSuggestionReadableStream.create();return h.forEach(u.emitData.bind(u)),a.length===0?queueMicrotask(()=>{u.end()}):(0,l.listenGroupReadable)(a,{onData:u.emitData.bind(u),onEnd:u.end.bind(u)}),u}};t.TerminalFeatureRegistry=v,t.TerminalFeatureRegistry=v=n.__decorate([(0,r.Injectable)()],v)},60772:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorCode=t.StyleCode=void 0,t.ansiParser=m,t.isRedColor=p;const r=e(85608).__importDefault(e(91371)),o={color:0,isSpecialColor:!1,isRgbColor:!1,is256Color:!1,bgColor:0,isSpecialBg:!1,isRgbBg:!1,is256Bg:!1,bold:!1,underline:!1};var l;(function(s){s[s.RESET=0]="RESET",s[s.BOLD=1]="BOLD",s[s.UNDERLINE=4]="UNDERLINE",s[s.RESET_BOLD=22]="RESET_BOLD",s[s.RESET_UNDERLINE=24]="RESET_UNDERLINE"})(l||(t.StyleCode=l={}));var _;(function(s){s[s.MODE_RGB=2]="MODE_RGB",s[s.MODE_256=5]="MODE_256",s[s.BLACK=30]="BLACK",s[s.RED=31]="RED",s[s.GREEN=32]="GREEN",s[s.YELLOW=33]="YELLOW",s[s.BLUE=34]="BLUE",s[s.MAGENTA=35]="MAGENTA",s[s.CYAN=36]="CYAN",s[s.WHITE=37]="WHITE",s[s.SPECIAL_COLOR_MODE=38]="SPECIAL_COLOR_MODE",s[s.RESET_COLOR=39]="RESET_COLOR",s[s.BLACK_BG=40]="BLACK_BG",s[s.RED_BG=41]="RED_BG",s[s.GREEN_BG=42]="GREEN_BG",s[s.YELLOW_BG=43]="YELLOW_BG",s[s.BLUE_BG=44]="BLUE_BG",s[s.MAGENTA_BG=45]="MAGENTA_BG",s[s.CYAN_BG=46]="CYAN_BG",s[s.WHITE_BG=47]="WHITE_BG",s[s.SPECIAL_BG_MODE=48]="SPECIAL_BG_MODE",s[s.RESET_BG=49]="RESET_BG",s[s.BLACK_BRIGHT=90]="BLACK_BRIGHT",s[s.RED_BRIGHT=91]="RED_BRIGHT",s[s.GREEN_BRIGHT=92]="GREEN_BRIGHT",s[s.YELLOW_BRIGHT=93]="YELLOW_BRIGHT",s[s.BLUE_BRIGHT=94]="BLUE_BRIGHT",s[s.MAGENTA_BRIGHT=95]="MAGENTA_BRIGHT",s[s.CYAN_BRIGHT=96]="CYAN_BRIGHT",s[s.WHITE_BRIGHT=97]="WHITE_BRIGHT",s[s.BLACK_HIGH_INTENSITY=100]="BLACK_HIGH_INTENSITY",s[s.RED_HIGH_INTENSITY=101]="RED_HIGH_INTENSITY",s[s.GREEN_HIGH_INTENSITY=102]="GREEN_HIGH_INTENSITY",s[s.BLUE_HIGH_INTENSITY=104]="BLUE_HIGH_INTENSITY",s[s.MAGENTA_HIGH_INTENSITY=105]="MAGENTA_HIGH_INTENSITY",s[s.CYAN_HIGH_INTENSITY=106]="CYAN_HIGH_INTENSITY",s[s.WHITE_HIGH_INTENSITY=107]="WHITE_HIGH_INTENSITY"})(_||(t.ColorCode=_={}));function v(s,g,a){g.isSpecialColor||g.isSpecialBg?a===_.SPECIAL_COLOR_MODE?g.color=s:g.bgColor=s:s>=30&&s<=37||s>=90&&s<=97?g.color=s:(s>=40&&s<=47||s>=100&&s<=107)&&(g.bgColor=s)}function m(s,g){const a=(0,r.default)(),h=[];let u,c=0;const E={...g||o};for(;u=a.exec(s);){const d=s.slice(c,u.index);d&&h.push({content:d,...E});const y=u[0].slice(2,-1).split(";").map(Number);if(y.length)for(let b=0;b<y.length;b++){const A=y[b],S=y[b-1];switch(A){case l.RESET:Object.assign(E,o);break;case l.BOLD:E.bold=!0;break;case l.UNDERLINE:E.underline=!0;break;case l.RESET_BOLD:E.bold=!1;break;case l.RESET_UNDERLINE:E.underline=!1;break;case _.RESET_COLOR:E.color=0;break;case _.RESET_BG:E.bgColor=0;break;case _.SPECIAL_COLOR_MODE:E.isSpecialColor=!0;break;case _.SPECIAL_BG_MODE:E.isSpecialBg=!0;break;case _.MODE_RGB:S===_.SPECIAL_COLOR_MODE?E.isRgbColor=!0:E.isRgbBg=!0;break;case _.MODE_256:S===_.SPECIAL_COLOR_MODE?E.is256Color=!0:E.is256Bg=!0;break;default:v(A,E,y[b-2])}}c=u.index+u[0].length}const f=s.slice(c);return f&&h.push({content:f,...E}),{parts:h,currentStyle:E}}function p(s){const{color:g,isSpecialColor:a,is256Color:h}=s;return a?h?g===1||g===9||g>=160&&g<=196:g===255:g===_.RED||g===_.RED_BRIGHT}},32004:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AINativeModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(91825),v=e(19413),m=e(46044),p=e(64811),s=e(73307),g=e(32016),a=e(96366),h=e(74055),u=e(84543),c=e(61282),E=e(51081),f=e(29770),d=e(11735),y=e(59347),b=e(70394),A=e(19957),S=e(63536),D=e(72713),I=e(57232),w=e(99301),T=e(74292),R=e(35363),M=e(44298),O=e(33588),x=e(2204),k=e(2994),F=e(28505),L=e(95121),N=e(85679),U=e(73974),W=e(27397),j=e(5297),Q=e(33108),G=e(33368),Z=e(55003),$=e(45331),V=e(79502),H=e(7228),K=e(90977),Y=e(80173),X=e(30645),re=e(82078),oe=e(39855),he=e(82248),me=e(36977),q=e(42232),be=e(3841),ge=e(92819),te=e(23750),fe=e(77633),Oe=e(2281),Pe=e(31031),Me=e(15989);let Be=class extends o.BrowserModule{constructor(){super(),this.contributionProvider=[fe.AINativeCoreContribution,fe.MCPServerContribution],this.providers=[g.AINativeBrowserContribution,R.InterfaceNavigationContribution,F.TerminalAIContribution,M.MergeConflictContribution,D.AICodeActionContribution,be.AINativePreferencesContribution,w.IntelligentCompletionsContribution,j.MCPConfigContribution,W.MCPConfigCommandContribution,Z.MCPPreferencesContribution,he.ListDirTool,me.ReadFileTool,K.EditFileTool,H.CreateNewFileWithTextTool,re.GetOpenEditorFileDiagnosticsTool,Y.FileSearchTool,oe.GrepSearchTool,X.GetDiagnosticsByPathTool,q.RunTerminalCommandTool,A.LlmContextContribution,ge.RulesContribution,{token:m.LLMContextServiceToken,useClass:S.LLMContextServiceImpl},{token:fe.TokenMCPServerRegistry,useClass:V.MCPServerRegistry},{token:v.TokenMCPServerProxyService,useClass:$.MCPServerProxyService},{token:o.InlineChatFeatureRegistryToken,useClass:Oe.InlineChatFeatureRegistry},{token:o.ChatFeatureRegistryToken,useClass:d.ChatFeatureRegistry},{token:o.ChatRenderRegistryToken,useClass:b.ChatRenderRegistry},{token:o.ResolveConflictRegistryToken,useClass:O.ResolveConflictRegistry},{token:l.IntelligentCompletionsRegistryToken,useClass:T.IntelligentCompletionsRegistry},{token:o.IAIInlineChatService,useClass:Pe.InlineChatService},{token:v.IChatManagerService,useClass:c.ChatManagerService},{token:v.IChatAgentService,useClass:h.ChatAgentService},{token:o.ChatAgentViewServiceToken,useClass:u.ChatAgentViewService},{token:v.IChatInternalService,useClass:y.ChatInternalService},{token:v.ChatProxyServiceToken,useClass:E.ChatProxyService},{token:o.ChatServiceToken,useClass:f.ChatService},{token:o.RenameCandidatesProviderRegistryToken,useClass:k.RenameCandidatesProviderRegistry},{token:l.ProblemFixRegistryToken,useClass:x.ProblemFixProviderRegistry},{token:l.TerminalRegistryToken,useClass:L.TerminalFeatureRegistry},{token:N.LanguageParserService,useClass:N.LanguageParserService},{token:v.IAIInlineCompletionsProvider,useClass:I.AIInlineCompletionsProvider},{token:s.ChatAgentPromptProvider,useClass:s.DefaultChatAgentPromptProvider},{token:v.InlineDiffServiceToken,useClass:Me.InlineDiffService},{token:U.BaseApplyService,useClass:a.ApplyService},{token:l.MCPConfigServiceToken,useClass:Q.MCPConfigService},{token:l.RulesServiceToken,useClass:te.RulesService},{token:_.FolderFilePreferenceProvider,useClass:G.MCPFolderPreferenceProvider,dropdownForTag:!0,tag:"mcp"}],this.backServices=[{servicePath:o.AIBackSerivcePath,token:o.AIBackSerivceToken,clientToken:v.ChatProxyServiceToken},{servicePath:p.MCPServerManagerPath,token:p.MCPServerManager},{clientToken:v.TokenMCPServerProxyService,servicePath:v.SumiMCPServerProxyServicePath}],this.aiNativeConfig.setAINativeModuleLoaded(!0)}};t.AINativeModule=Be,n.__decorate([(0,r.Autowired)(o.AINativeConfigService),n.__metadata("design:type",o.AINativeConfigService)],Be.prototype,"aiNativeConfig",void 0),t.AINativeModule=Be=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],Be)},3073:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageParser=t.DEFAULT_MIN_BLOCK_COUNT=void 0;const n=e(85608),r=n.__importDefault(e(13833)),o=e(76003),l=e(70392),_=e(69820),v=e(53374),m=e(22486),p=e(67045);t.DEFAULT_MIN_BLOCK_COUNT=20;let s=class{constructor(a){this.language=a,this.parserLoaded=new l.Deferred,this.lruCache=new l.LRUCache(500),this.initializeParser()}ready(){return this.parserLoaded.promise}getParser(){return this.parser}async initializeParser(){this.parser=await this.wasmModuleManager.initParser();const a=await this.wasmModuleManager.loadLanguage(this.language),h=await r.default.Language.load(new Uint8Array(a));this.parser.setLanguage(h),this.parserLoaded.resolve()}findContainingCodeBlockWithPosition(a,h){return a.startIndex<=h&&a.endIndex>=h&&this.languageFacts.isCodeBlock(this.language,a.type)?a:a.parent?this.findContainingCodeBlockWithPosition(a.parent,h):null}findFunctionCodeBlock(a,h){return a.startIndex<=h&&a.endIndex>=h&&this.languageFacts.isFunctionCodeBlock(this.language,a.type)?a:a.parent?this.findFunctionCodeBlock(a.parent,h):null}async parseAST(a){const h=`${a.id}@${a.getVersionId()}`,u=this.lruCache.get(h);if(u)return u;await this.parserLoaded.promise;const c=a.getValue(),E=this.parser.parse(c);if(E){const f=E.rootNode;return this.lruCache.set(h,f),f}}async getSyntaxNodeAsPosition(a,h){const u=await this.parseAST(a);return u?u.namedDescendantForIndex(h):null}async findCodeBlockWithoutSyntaxError(a,h){await this.parserLoaded.promise;const u=this.parser.parse(a);if(u){const c=u.rootNode,E={row:h.startLineNumber-1,column:h.startColumn},f=c.namedDescendantForPosition(E);let d=f.parent;if(!d)return{range:(0,v.toMonacoRange)(f),type:f.type,infoCategory:"other"};for(;d&&!d.hasError;)d=d.parent;return d?{range:(0,v.toMonacoRange)(d),type:d.type,infoCategory:"other"}:{range:h,type:f.type,infoCategory:"other"}}return null}async provideCodeBlockInfo(a,h){const u=a.getOffsetAt(h),c=await this.getSyntaxNodeAsPosition(a,u);if(!c)return null;const E=this.findFunctionCodeBlock(c,u);if(E)return this.languageFacts.provideFunctionInfo(this.language,E);const f=this.findContainingCodeBlockWithPosition(c,u);return f?{infoCategory:"other",range:{startLineNumber:f.startPosition.row+1,startColumn:0,endLineNumber:f.endPosition.row+1,endColumn:1/0},type:f.type}:null}async provideCodeBlockInfoInRange(a,h){const u=await this.parseAST(a);if(u){const c={row:h.startLineNumber-1,column:h.startColumn-1},E={row:h.endLineNumber,column:h.endColumn},f=this.languageFacts.getCodeBlockTypes(this.language);if(!f||f.size===0)return null;const d=u.descendantsOfType(Array.from(f),c,E);if(d&&d.length>0){const y=d[0];return{infoCategory:"other",range:(0,v.toMonacoRange)(y),type:y.type}}}return null}async trimSuffixSyntaxErrors(a,h=t.DEFAULT_MIN_BLOCK_COUNT){var u;await this.parserLoaded.promise;const c=(u=this.parser)===null||u===void 0?void 0:u.parse(a),E=c?.rootNode;if(!E)return a;const{namedChildren:f}=E;if(!E.hasError||f.length<=h)return this.trimToLastCompleteBlock(E,!0);let d=null,y=null;for(let I=f.length-1;I>=h;I--){const w=f[I];if(w.hasError&&I!==0)d=w;else if(d){y=w;break}}y||(y=f[h-1]);const A=a.split(`
33054
+ `).length;this.terminalDecorations.addZoneDecoration(f,d,y,{operationList:[h.action],onClickItem:()=>{const b=this.inlineChatFeatureRegistry.getTerminalHandler(h.action.id);b&&b.execute(c,u||"",h.matcher)}})}}resolveDelControl(a=""){const h=a.split("");let u=0;for(;u<h.length;)if(h[u].charCodeAt(0)===127){const c=Math.max(u-1,0);h.splice(c,1),u=c}else u++;return h.join("")}report(a,h,u){}registerMarker(a,h){const u=this.terminalController.clients.get(a);if(u){const c=u.term.registerMarker(h);this.clientCurrentMarker.set(a,c),this.disposables.push(c)}}handleClientInput(a,h){const u=h.toString(),c=this.inputRecordMap.get(a);/[\r\n]/.test(u)?(this.isTyping=!1,c?.push({text:this.inputCache})):(this.inputCache+=u,this.isTyping=!0)}};t.AITerminalService=s,n.__decorate([(0,r.Autowired)(l.ITerminalController),n.__metadata("design:type",Object)],s.prototype,"terminalController",void 0),n.__decorate([(0,r.Autowired)(v.AITerminalDecorationService),n.__metadata("design:type",v.AITerminalDecorationService)],s.prototype,"terminalDecorations",void 0),n.__decorate([(0,r.Autowired)(o.InlineChatFeatureRegistryToken),n.__metadata("design:type",_.InlineChatFeatureRegistry)],s.prototype,"inlineChatFeatureRegistry",void 0),t.AITerminalService=s=n.__decorate([(0,r.Injectable)()],s)},32113:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AITerminalPrompt=t.KeyboardSelectableList=void 0;const n=e(85608),r=n.__importDefault(e(12784)),o=n.__importStar(e(14041)),l=e(41869),_=e(81878),v=e(89195),m=n.__importDefault(e(58274)),p=g=>{const{items:a,handleSuggestionClick:h,noListen:u=!1,controller:c}=g,[E,f]=(0,o.useState)(-1),d=y=>{switch(y.key){case"ArrowUp":f(b=>Math.max(b-1,0));break;case"ArrowDown":f(b=>Math.min(b+1,a.length-1));break;case"Enter":a[E]&&h(a[E].command);break;default:break}};return(0,o.useEffect)(()=>{if(!u)return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}},[a,E]),(0,o.useEffect)(()=>{if(!c)return;const y=c.event(b=>{b==="ArrowUp"&&f(A=>Math.max(A-1,0)),(b==="ArrowDown"||b==="Tab")&&f(A=>Math.min(A+1,a.length-1)),b==="Enter"&&a[E]&&h(a[E].command)});return()=>{y.dispose()}},[c,E,a]),(0,o.useEffect)(()=>{f(0)},[a]),o.default.createElement("div",{className:m.default.suggestions},a.map((y,b)=>o.default.createElement("div",{key:b,className:m.default.suggestionItem,style:{backgroundColor:b===E?"var(--selection-background)":""},onClick:()=>h(y.command)},o.default.createElement("div",{className:m.default.suggestionItemContainer},o.default.createElement("div",{className:m.default.suggestionDesc},y.description),o.default.createElement("div",{className:m.default.suggestionCmd},y.command)))))};t.KeyboardSelectableList=p;const s=g=>{const{onEscTriggered:a,onSuggestionClick:h,getAICommandSuggestions:u,cancelAIRequst:c}=g,[E,f]=(0,o.useState)(""),[d,y]=(0,o.useState)([]),[b,A]=(0,o.useState)(!1),[S,D]=(0,o.useState)((0,l.localize)("terminal.ai.escClose")),I=(0,o.useRef)(null),w=(0,o.useCallback)(async x=>{A(!0),D((0,l.localize)("terminal.ai.requesting")),u(x,()=>{A(!1),D((0,l.localize)("terminal.ai.selectHint"))},()=>{A(!0),D((0,l.localize)("terminal.ai.thinking"))},k=>{y([...k].reverse())})},[d]),T=(0,o.useCallback)((0,r.default)(x=>{w(x)},1e3),[]);(0,o.useEffect)(()=>{const x=k=>{(k.key==="Escape"||k.keyCode===27)&&a()};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}},[]),(0,o.useEffect)(()=>{const x=k=>{I.current&&!I.current.contains(k.target)&&a()};return document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x)}},[a]);const R=x=>{const k=x.target.value;f(k),k.length>0&&!k.includes("'")&&T(k),k.length===0&&(y([]),D((0,l.localize)("terminal.ai.escClose")),c&&c())},M=(0,o.useCallback)(()=>{w(E)},[E]),O=x=>{h(x)};return o.default.createElement("div",{className:m.default.container,ref:I},o.default.createElement("div",{className:m.default.header},o.default.createElement("div",{style:{flex:"1"}},(0,l.localize)("terminal.ai.headerHint")),o.default.createElement("div",null,o.default.createElement(v.EnhanceIcon,{className:(0,_.getIcon)("close1"),onClick:()=>{a()}}))),o.default.createElement("div",{style:{position:"relative",marginLeft:"-14px"}},d.length>0&&o.default.createElement(t.KeyboardSelectableList,{items:d,handleSuggestionClick:O})),o.default.createElement("div",{className:m.default.inputContainer},o.default.createElement(_.Input,{type:"text",value:E,onKeyDown:x=>{(x.key==="ArrowUp"||x.key==="ArrowDown")&&x.preventDefault()},onChange:R,onPressEnter:()=>M(),placeholder:(0,l.localize)("terminal.ai.inputHint"),className:m.default.input,autoFocus:!0}),b?o.default.createElement("div",{className:m.default.ai_loading},o.default.createElement("div",{className:m.default.loader}),o.default.createElement("div",{className:m.default.loader}),o.default.createElement("div",{className:m.default.loader})):o.default.createElement(v.EnhanceIcon,{wrapperClassName:m.default.send_icon,className:(0,_.getIcon)("send-solid"),onClick:()=>{T(E)}})),o.default.createElement("div",{className:m.default.statusContainer},S))};t.AITerminalPrompt=s},39273:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalInlineWidgetForDetection=t.TerminalInlineWidgetForSelection=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(89195),l=n.__importDefault(e(57410)),_=({actions:m,onClickItem:p})=>r.default.createElement("div",{className:l.default.terminal_inline_chat},r.default.createElement(o.AIAction,{operationList:m,onClickItem:p}));t.TerminalInlineWidgetForSelection=_;const v=({actions:m,onClickItem:p})=>{const[s,g]=(0,r.useState)(!1);return r.default.createElement("div",{onMouseOver:a=>{g(!0),a.currentTarget.style.backgroundColor="rgba(255, 0, 0, 0.1)"},onMouseOut:a=>{g(!1),a.currentTarget.style.backgroundColor=""},style:{width:"100%",height:"100%"}},r.default.createElement("div",{className:l.default.terminal_inline_chat,style:{display:s?"block":"none"}},r.default.createElement(o.AIAction,{operationList:m,onClickItem:p})))};t.TerminalInlineWidgetForDetection=v},96415:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AITerminalDecorationService=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(25873),l=e(76003),_=e(43718),v=e(6487),m=e(2281),p=e(39273);let s=class extends _.Disposable{constructor(){super(...arguments),this.decorationList=[],this.decorationRootMap=new Map}active(){this.disposables.push(this.terminalController.onDidOpenTerminal(({id:a})=>this.doSelectionDecoration(a)))}addZoneDecoration(a,h,u,c){const E=a.registerDecoration({marker:h,width:a.cols,height:u});if(!E){console.error("Failed to create decoration for line",h);return}let f;E.onRender(d=>{f||(f=(0,o.createRoot)(d)),f.render(r.default.createElement(p.TerminalInlineWidgetForDetection,{actions:c.operationList,onClickItem:()=>{c.onClickItem()}}))}),E.onDispose(()=>{f&&f.unmount()})}doSelectionDecoration(a){const h=this.terminalController.clients.get(a),u=h?.term;u&&this.addDispose(u.onSelectionChange(()=>{const c=this.decorationList.pop();c&&(0,_.runWhenIdle)(()=>{c?.dispose()});const E=u.getSelectionPosition(),f=u.getSelection().trim();if(E&&f.length>0){const d=E.end.y,y=E.start.y,b=u.buffer.active.cursorY+u.buffer.active.baseY,A=y-b,S=d-y+1,D=u.registerMarker(A);if(D){const I=u.registerDecoration({marker:D,width:u.cols,height:S});if(I){let w;I.onRender(T=>{w||(w=(0,o.createRoot)(T));const M=this.inlineChatFeatureRegistry.getTerminalActions().filter(O=>{var x;return((x=this.inlineChatFeatureRegistry.getTerminalHandler(O.id))===null||x===void 0?void 0:x.triggerRules)==="selection"});w.render(r.default.createElement(p.TerminalInlineWidgetForSelection,{actions:M,onClickItem:O=>{const x=this.inlineChatFeatureRegistry.getTerminalHandler(O);x&&x.execute(f,"")}}))}),I.onDispose(()=>{w&&w.unmount()}),this.decorationList.push(I)}}}}))}};t.AITerminalDecorationService=s,n.__decorate([(0,l.Autowired)(v.ITerminalController),n.__metadata("design:type",Object)],s.prototype,"terminalController",void 0),n.__decorate([(0,l.Autowired)(_.InlineChatFeatureRegistryToken),n.__metadata("design:type",m.InlineChatFeatureRegistry)],s.prototype,"inlineChatFeatureRegistry",void 0),t.AITerminalDecorationService=s=n.__decorate([(0,l.Injectable)()],s)},4397:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseTerminalDetectionLineMatcher=t.MatcherType=void 0;var e;(function(r){r[r.base=0]="base",r[r.npm=1]="npm",r[r.typescript=2]="typescript",r[r.node=3]="node",r[r.shell=4]="shell",r[r.java=5]="java"})(e||(t.MatcherType=e={}));class n{constructor(){this.type=e.base,this.isMultiLine=!1,this.isMatched=!1,this.maxSpaceLine=0,this.currentSpaceLine=0}match(o){return this.doMatch(o)?(this.isMatched=!0,this.currentSpaceLine=0,!0):this.isMultiLine&&this.isMatched&&this.currentSpaceLine<this.maxSpaceLine?(this.currentSpaceLine++,!0):(this.isMatched=!1,!1)}}t.BaseTerminalDetectionLineMatcher=n},28358:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JavaMatcher=t.ShellMatcher=t.NPMMatcher=t.TSCMatcher=t.NodeMatcher=void 0,e(85608).__exportStar(e(4397),t);var r=e(12636);Object.defineProperty(t,"NodeMatcher",{enumerable:!0,get:function(){return r.NodeMatcher}});var o=e(41084);Object.defineProperty(t,"TSCMatcher",{enumerable:!0,get:function(){return o.TSCMatcher}});var l=e(97323);Object.defineProperty(t,"NPMMatcher",{enumerable:!0,get:function(){return l.NPMMatcher}});var _=e(29640);Object.defineProperty(t,"ShellMatcher",{enumerable:!0,get:function(){return _.ShellMatcher}});var v=e(82036);Object.defineProperty(t,"JavaMatcher",{enumerable:!0,get:function(){return v.JavaMatcher}})},82036:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JavaMatcher=void 0;const n=e(4397);class r extends n.BaseTerminalDetectionLineMatcher{constructor(){super(...arguments),this.type=n.MatcherType.java,this.isMultiLine=!0}doMatch(l){return this.isErrorStack(l)||this.isCasuseByError(l)||this.isExceptionError(l)}isErrorStack(l){return this.isMatched&&!!l.find(_=>/^\s+at\s/i.test(_.content))}isCasuseByError(l){return!!l.find(_=>/caused\sby:/i.test(_.content))}isExceptionError(l){return!!l.find(_=>/\w+Exception:/i.test(_.content))}}t.JavaMatcher=r},12636:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeMatcher=void 0;const n=e(60772),r=e(4397);class o extends r.BaseTerminalDetectionLineMatcher{constructor(){super(...arguments),this.type=r.MatcherType.node,this.isMultiLine=!0,this.maxSpaceLine=1}doMatch(_){return this.isSingleLineError(_)||this.isMultiPartError(_)}isSingleLineError(_){return _.length===1&&(0,n.isRedColor)(_[0])&&(this.isMatched||!this.isExcludeContent(_[0].content))}isMultiPartError(_){return _.length>1&&!_.some(v=>!(0,n.isRedColor)(v))}isExcludeContent(_){return _.length<20||/mfsu/i.test(_)||/\s-\s/.test(_)}}t.NodeMatcher=o},97323:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NPMMatcher=void 0;const n=e(60772),r=e(4397);class o extends r.BaseTerminalDetectionLineMatcher{constructor(){super(...arguments),this.type=r.MatcherType.npm,this.isMultiLine=!0,this.maxSpaceLine=1}doMatch(_){return!!_.find(v=>/ERR/.test(v.content)&&(0,n.isRedColor)(v))}}t.NPMMatcher=o},29640:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShellMatcher=void 0;const n=e(4397);class r extends n.BaseTerminalDetectionLineMatcher{constructor(){super(...arguments),this.type=n.MatcherType.shell,this.isMultiLine=!1}doMatch(l){return!!l.find(_=>/command\snot\sfound/.test(_.content))}}t.ShellMatcher=r},41084:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TSCMatcher=void 0;const n=e(60772),r=e(4397);class o extends r.BaseTerminalDetectionLineMatcher{constructor(){super(...arguments),this.type=r.MatcherType.typescript,this.isMultiLine=!0}doMatch(_){let v=!1,m=!1,p=!1;return _.forEach(s=>{/error/i.test(s.content)&&(0,n.isRedColor)(s)&&(v=!0),/TS\d+/.test(s.content)&&(m=!0),/Error:/i.test(s.content)&&(p=!0)}),v||m||p||this.isErrorStack(_)}isErrorStack(_){return this.isMatched&&!!_.find(v=>/^\s+at\s/i.test(v.content))}}t.TSCMatcher=o},14717:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PS1TerminalService=void 0;const n=e(85608),r=n.__importDefault(e(124)),o=n.__importDefault(e(14041)),l=e(25873),_=e(76003),v=e(41869),m=e(43718),p=e(6487),s=e(93062),g=e(32113),a=e(95121);var h;(function(c){c.PromptStarted="PS",c.PromptEnded="PE",c.CurrentWorkingDirectory="CWD"})(h||(h={}));let u=class extends m.Disposable{constructor(){super(...arguments),this.cancelToken=new m.CancellationTokenSource}active(){this.initContainer(),this.disposables.push(this.terminalController.onDidOpenTerminal(({id:E})=>this.listenTerminalEvent(E)))}listenTerminalEvent(E){const f=this.terminalController.clients.get(E);f&&setTimeout(()=>{this.listenPromptState(f.term)},0)}initContainer(){this.popupContainer=document.createElement("div"),document.body.appendChild(this.popupContainer)}listenPromptState(E){E.parser.registerOscHandler(6973,f=>{const d=f.indexOf(";");switch(d===-1?f:f.substring(0,d)){case h.PromptEnded:this.handlePromptEnd(E);break;default:return!1}return!1})}handlePromptEnd(E){this.promptEndMarker&&this.promptEndMarker.dispose(),this.promptEndDecoration&&this.promptEndDecoration.dispose(),this.promptEndMarker=E.registerMarker(0);const f=E.buffer.active.cursorX;this.onDataDisposable&&this.onDataDisposable.dispose();const d=E.registerDecoration({marker:this.promptEndMarker,width:E.cols,height:1,x:f+2,layer:"top"});d?.onRender(y=>{y.innerText=(0,v.localize)("terminal.ai.inputSharpToGetHint"),y.style.opacity="0.3"}),this.onDataDisposable=E.onData(y=>{var b;const A=E.buffer.active,S=A.cursorX,D=A.cursorY;d?.dispose(),y==="#"&&D+A.baseY===((b=this.promptEndMarker)===null||b===void 0?void 0:b.line)&&(S===f||S===f+1)&&this.showAICommandPopup(E,f)})}showAICommandPopup(E,f){var d,y,b;if(!this.promptEndMarker)return;this.promptEndDecoration=E.registerDecoration({marker:this.promptEndMarker,width:1,height:1,backgroundColor:"#2472C8",x:f,layer:"top"});const A=E._addonManager._addons.find(D=>{var I;return!!(!((I=D?.instance)===null||I===void 0)&&I.connection)}),S=(d=A?.instance)===null||d===void 0?void 0:d.connection;if(!S){console.error((0,v.localize)("terminal.ai.cannotGetTerminalConnection"));return}(y=this.promptEndDecoration)===null||y===void 0||y.onRender(D=>{const I=D.clientWidth;this.promptEndReactRoot&&this.promptEndReactRoot.unmount(),this.promptEndReactRoot=(0,l.createRoot)(this.popupContainer),this.promptEndReactRoot.render(o.default.createElement(g.AITerminalPrompt,{onEscTriggered:()=>{setTimeout(()=>{var w;S.sendData("\b"),(w=this.promptEndDecoration)===null||w===void 0||w.dispose()},0)},onSuggestionClick:w=>{setTimeout(()=>{var T;S.sendData("\b"),S.sendData(w),(T=this.promptEndDecoration)===null||T===void 0||T.dispose()},0)},getAICommandSuggestions:this.getAICommandSuggestions.bind(this),cancelAIRequst:this.stopAIStreamRequest.bind(this)})),(0,r.default)(this.popupContainer,D,{points:["bl","bl"],offset:[-I-6,0],targetOffset:[0,0],overflow:{adjustX:!1,adjustY:!1}})}),(b=this.promptEndDecoration)===null||b===void 0||b.onDispose(()=>{this.stopAIStreamRequest(),this.promptEndReactRoot&&this.promptEndReactRoot.unmount(),E.focus()})}async stopAIStreamRequest(){this.cancelToken.cancel(),this.cancelToken=new m.CancellationTokenSource}async getAICommandSuggestions(E,f,d,y){await this.stopAIStreamRequest();const b=this.aiReporter.start(m.AIServiceType.TerminalAICommand,{message:E}),A=await this.terminalFeatureRegistry.readableCommandSuggestions(E,this.cancelToken.token),S=[];(0,s.listenReadable)(A,{onData:D=>{S.push(D),y(S)},onEnd:()=>{f(),this.aiReporter.end(b,{message:E,success:!0,actionSource:m.ActionSourceEnum.Terminal})}})}};t.PS1TerminalService=u,n.__decorate([(0,_.Autowired)(p.ITerminalController),n.__metadata("design:type",Object)],u.prototype,"terminalController",void 0),n.__decorate([(0,_.Autowired)(m.TerminalRegistryToken),n.__metadata("design:type",a.TerminalFeatureRegistry)],u.prototype,"terminalFeatureRegistry",void 0),n.__decorate([(0,_.Autowired)(m.IAIReporter),n.__metadata("design:type",Object)],u.prototype,"aiReporter",void 0),t.PS1TerminalService=u=n.__decorate([(0,_.Injectable)()],u)},28505:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalAIContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(63439),v=e(96415),m=e(14717),p=e(95121);let s=class{onDidStart(){this.aiNativeConfigService.capabilities.supportsTerminalDetection&&(this.aiTerminalService.active(),this.aiTerminalDecorationService.active()),this.aiNativeConfigService.capabilities.supportsTerminalCommandSuggest&&this.terminalFeatureRegistry.hasProvider()&&this.ps1TerminalService.active()}};t.TerminalAIContribution=s,n.__decorate([(0,r.Autowired)(_.AITerminalService),n.__metadata("design:type",_.AITerminalService)],s.prototype,"aiTerminalService",void 0),n.__decorate([(0,r.Autowired)(v.AITerminalDecorationService),n.__metadata("design:type",v.AITerminalDecorationService)],s.prototype,"aiTerminalDecorationService",void 0),n.__decorate([(0,r.Autowired)(m.PS1TerminalService),n.__metadata("design:type",m.PS1TerminalService)],s.prototype,"ps1TerminalService",void 0),n.__decorate([(0,r.Autowired)(o.AINativeConfigService),n.__metadata("design:type",o.AINativeConfigService)],s.prototype,"aiNativeConfigService",void 0),n.__decorate([(0,r.Autowired)(l.TerminalRegistryToken),n.__metadata("design:type",p.TerminalFeatureRegistry)],s.prototype,"terminalFeatureRegistry",void 0),t.TerminalAIContribution=s=n.__decorate([(0,o.Domain)(o.ClientAppContribution)],s)},95121:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalFeatureRegistry=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(93062),_=e(77633);let v=class extends o.Disposable{constructor(){super(...arguments),this.providerMap=new Set}hasProvider(){return this.providerMap.size>0}registerCommandSuggestionsProvider(p){this.providerMap.add(p)}async readableCommandSuggestions(p,s){const g=Array.from(this.providerMap),a=[],h=[];for await(const c of g){const E=await c(p,s);if((0,l.isReadableStream)(E)){a.push(E);continue}h.push(...E)}const u=_.TerminalSuggestionReadableStream.create();return h.forEach(u.emitData.bind(u)),a.length===0?queueMicrotask(()=>{u.end()}):(0,l.listenGroupReadable)(a,{onData:u.emitData.bind(u),onEnd:u.end.bind(u)}),u}};t.TerminalFeatureRegistry=v,t.TerminalFeatureRegistry=v=n.__decorate([(0,r.Injectable)()],v)},60772:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorCode=t.StyleCode=void 0,t.ansiParser=m,t.isRedColor=p;const r=e(85608).__importDefault(e(91371)),o={color:0,isSpecialColor:!1,isRgbColor:!1,is256Color:!1,bgColor:0,isSpecialBg:!1,isRgbBg:!1,is256Bg:!1,bold:!1,underline:!1};var l;(function(s){s[s.RESET=0]="RESET",s[s.BOLD=1]="BOLD",s[s.UNDERLINE=4]="UNDERLINE",s[s.RESET_BOLD=22]="RESET_BOLD",s[s.RESET_UNDERLINE=24]="RESET_UNDERLINE"})(l||(t.StyleCode=l={}));var _;(function(s){s[s.MODE_RGB=2]="MODE_RGB",s[s.MODE_256=5]="MODE_256",s[s.BLACK=30]="BLACK",s[s.RED=31]="RED",s[s.GREEN=32]="GREEN",s[s.YELLOW=33]="YELLOW",s[s.BLUE=34]="BLUE",s[s.MAGENTA=35]="MAGENTA",s[s.CYAN=36]="CYAN",s[s.WHITE=37]="WHITE",s[s.SPECIAL_COLOR_MODE=38]="SPECIAL_COLOR_MODE",s[s.RESET_COLOR=39]="RESET_COLOR",s[s.BLACK_BG=40]="BLACK_BG",s[s.RED_BG=41]="RED_BG",s[s.GREEN_BG=42]="GREEN_BG",s[s.YELLOW_BG=43]="YELLOW_BG",s[s.BLUE_BG=44]="BLUE_BG",s[s.MAGENTA_BG=45]="MAGENTA_BG",s[s.CYAN_BG=46]="CYAN_BG",s[s.WHITE_BG=47]="WHITE_BG",s[s.SPECIAL_BG_MODE=48]="SPECIAL_BG_MODE",s[s.RESET_BG=49]="RESET_BG",s[s.BLACK_BRIGHT=90]="BLACK_BRIGHT",s[s.RED_BRIGHT=91]="RED_BRIGHT",s[s.GREEN_BRIGHT=92]="GREEN_BRIGHT",s[s.YELLOW_BRIGHT=93]="YELLOW_BRIGHT",s[s.BLUE_BRIGHT=94]="BLUE_BRIGHT",s[s.MAGENTA_BRIGHT=95]="MAGENTA_BRIGHT",s[s.CYAN_BRIGHT=96]="CYAN_BRIGHT",s[s.WHITE_BRIGHT=97]="WHITE_BRIGHT",s[s.BLACK_HIGH_INTENSITY=100]="BLACK_HIGH_INTENSITY",s[s.RED_HIGH_INTENSITY=101]="RED_HIGH_INTENSITY",s[s.GREEN_HIGH_INTENSITY=102]="GREEN_HIGH_INTENSITY",s[s.BLUE_HIGH_INTENSITY=104]="BLUE_HIGH_INTENSITY",s[s.MAGENTA_HIGH_INTENSITY=105]="MAGENTA_HIGH_INTENSITY",s[s.CYAN_HIGH_INTENSITY=106]="CYAN_HIGH_INTENSITY",s[s.WHITE_HIGH_INTENSITY=107]="WHITE_HIGH_INTENSITY"})(_||(t.ColorCode=_={}));function v(s,g,a){g.isSpecialColor||g.isSpecialBg?a===_.SPECIAL_COLOR_MODE?g.color=s:g.bgColor=s:s>=30&&s<=37||s>=90&&s<=97?g.color=s:(s>=40&&s<=47||s>=100&&s<=107)&&(g.bgColor=s)}function m(s,g){const a=(0,r.default)(),h=[];let u,c=0;const E={...g||o};for(;u=a.exec(s);){const d=s.slice(c,u.index);d&&h.push({content:d,...E});const y=u[0].slice(2,-1).split(";").map(Number);if(y.length)for(let b=0;b<y.length;b++){const A=y[b],S=y[b-1];switch(A){case l.RESET:Object.assign(E,o);break;case l.BOLD:E.bold=!0;break;case l.UNDERLINE:E.underline=!0;break;case l.RESET_BOLD:E.bold=!1;break;case l.RESET_UNDERLINE:E.underline=!1;break;case _.RESET_COLOR:E.color=0;break;case _.RESET_BG:E.bgColor=0;break;case _.SPECIAL_COLOR_MODE:E.isSpecialColor=!0;break;case _.SPECIAL_BG_MODE:E.isSpecialBg=!0;break;case _.MODE_RGB:S===_.SPECIAL_COLOR_MODE?E.isRgbColor=!0:E.isRgbBg=!0;break;case _.MODE_256:S===_.SPECIAL_COLOR_MODE?E.is256Color=!0:E.is256Bg=!0;break;default:v(A,E,y[b-2])}}c=u.index+u[0].length}const f=s.slice(c);return f&&h.push({content:f,...E}),{parts:h,currentStyle:E}}function p(s){const{color:g,isSpecialColor:a,is256Color:h}=s;return a?h?g===1||g===9||g>=160&&g<=196:g===255:g===_.RED||g===_.RED_BRIGHT}},32004:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AINativeModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(91825),v=e(19413),m=e(46044),p=e(64811),s=e(73307),g=e(32016),a=e(96366),h=e(74055),u=e(84543),c=e(61282),E=e(51081),f=e(29770),d=e(11735),y=e(59347),b=e(70394),A=e(19957),S=e(63536),D=e(72713),I=e(57232),w=e(99301),T=e(74292),R=e(35363),M=e(44298),O=e(33588),x=e(2204),k=e(2994),F=e(28505),L=e(95121),N=e(85679),U=e(73974),W=e(27397),j=e(5297),Q=e(33108),G=e(33368),Z=e(55003),$=e(45331),V=e(79502),H=e(7228),K=e(90977),Y=e(80173),X=e(30645),re=e(39855),oe=e(82248),he=e(36977),me=e(42232),q=e(3841),be=e(92819),ge=e(23750),te=e(77633),fe=e(2281),Oe=e(31031),Pe=e(15989);let Me=class extends o.BrowserModule{constructor(){super(),this.contributionProvider=[te.AINativeCoreContribution,te.MCPServerContribution],this.providers=[g.AINativeBrowserContribution,R.InterfaceNavigationContribution,F.TerminalAIContribution,M.MergeConflictContribution,D.AICodeActionContribution,q.AINativePreferencesContribution,w.IntelligentCompletionsContribution,j.MCPConfigContribution,W.MCPConfigCommandContribution,Z.MCPPreferencesContribution,oe.ListDirTool,he.ReadFileTool,K.EditFileTool,H.CreateNewFileWithTextTool,Y.FileSearchTool,re.GrepSearchTool,X.GetDiagnosticsTool,me.RunTerminalCommandTool,A.LlmContextContribution,be.RulesContribution,{token:m.LLMContextServiceToken,useClass:S.LLMContextServiceImpl},{token:te.TokenMCPServerRegistry,useClass:V.MCPServerRegistry},{token:v.TokenMCPServerProxyService,useClass:$.MCPServerProxyService},{token:o.InlineChatFeatureRegistryToken,useClass:fe.InlineChatFeatureRegistry},{token:o.ChatFeatureRegistryToken,useClass:d.ChatFeatureRegistry},{token:o.ChatRenderRegistryToken,useClass:b.ChatRenderRegistry},{token:o.ResolveConflictRegistryToken,useClass:O.ResolveConflictRegistry},{token:l.IntelligentCompletionsRegistryToken,useClass:T.IntelligentCompletionsRegistry},{token:o.IAIInlineChatService,useClass:Oe.InlineChatService},{token:v.IChatManagerService,useClass:c.ChatManagerService},{token:v.IChatAgentService,useClass:h.ChatAgentService},{token:o.ChatAgentViewServiceToken,useClass:u.ChatAgentViewService},{token:v.IChatInternalService,useClass:y.ChatInternalService},{token:v.ChatProxyServiceToken,useClass:E.ChatProxyService},{token:o.ChatServiceToken,useClass:f.ChatService},{token:o.RenameCandidatesProviderRegistryToken,useClass:k.RenameCandidatesProviderRegistry},{token:l.ProblemFixRegistryToken,useClass:x.ProblemFixProviderRegistry},{token:l.TerminalRegistryToken,useClass:L.TerminalFeatureRegistry},{token:N.LanguageParserService,useClass:N.LanguageParserService},{token:v.IAIInlineCompletionsProvider,useClass:I.AIInlineCompletionsProvider},{token:s.ChatAgentPromptProvider,useClass:s.DefaultChatAgentPromptProvider},{token:v.InlineDiffServiceToken,useClass:Pe.InlineDiffService},{token:U.BaseApplyService,useClass:a.ApplyService},{token:l.MCPConfigServiceToken,useClass:Q.MCPConfigService},{token:l.RulesServiceToken,useClass:ge.RulesService},{token:_.FolderFilePreferenceProvider,useClass:G.MCPFolderPreferenceProvider,dropdownForTag:!0,tag:"mcp"}],this.backServices=[{servicePath:o.AIBackSerivcePath,token:o.AIBackSerivceToken,clientToken:v.ChatProxyServiceToken},{servicePath:p.MCPServerManagerPath,token:p.MCPServerManager},{clientToken:v.TokenMCPServerProxyService,servicePath:v.SumiMCPServerProxyServicePath}],this.aiNativeConfig.setAINativeModuleLoaded(!0)}};t.AINativeModule=Me,n.__decorate([(0,r.Autowired)(o.AINativeConfigService),n.__metadata("design:type",o.AINativeConfigService)],Me.prototype,"aiNativeConfig",void 0),t.AINativeModule=Me=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],Me)},3073:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageParser=t.DEFAULT_MIN_BLOCK_COUNT=void 0;const n=e(85608),r=n.__importDefault(e(13833)),o=e(76003),l=e(70392),_=e(69820),v=e(53374),m=e(22486),p=e(67045);t.DEFAULT_MIN_BLOCK_COUNT=20;let s=class{constructor(a){this.language=a,this.parserLoaded=new l.Deferred,this.lruCache=new l.LRUCache(500),this.initializeParser()}ready(){return this.parserLoaded.promise}getParser(){return this.parser}async initializeParser(){this.parser=await this.wasmModuleManager.initParser();const a=await this.wasmModuleManager.loadLanguage(this.language),h=await r.default.Language.load(new Uint8Array(a));this.parser.setLanguage(h),this.parserLoaded.resolve()}findContainingCodeBlockWithPosition(a,h){return a.startIndex<=h&&a.endIndex>=h&&this.languageFacts.isCodeBlock(this.language,a.type)?a:a.parent?this.findContainingCodeBlockWithPosition(a.parent,h):null}findFunctionCodeBlock(a,h){return a.startIndex<=h&&a.endIndex>=h&&this.languageFacts.isFunctionCodeBlock(this.language,a.type)?a:a.parent?this.findFunctionCodeBlock(a.parent,h):null}async parseAST(a){const h=`${a.id}@${a.getVersionId()}`,u=this.lruCache.get(h);if(u)return u;await this.parserLoaded.promise;const c=a.getValue(),E=this.parser.parse(c);if(E){const f=E.rootNode;return this.lruCache.set(h,f),f}}async getSyntaxNodeAsPosition(a,h){const u=await this.parseAST(a);return u?u.namedDescendantForIndex(h):null}async findCodeBlockWithoutSyntaxError(a,h){await this.parserLoaded.promise;const u=this.parser.parse(a);if(u){const c=u.rootNode,E={row:h.startLineNumber-1,column:h.startColumn},f=c.namedDescendantForPosition(E);let d=f.parent;if(!d)return{range:(0,v.toMonacoRange)(f),type:f.type,infoCategory:"other"};for(;d&&!d.hasError;)d=d.parent;return d?{range:(0,v.toMonacoRange)(d),type:d.type,infoCategory:"other"}:{range:h,type:f.type,infoCategory:"other"}}return null}async provideCodeBlockInfo(a,h){const u=a.getOffsetAt(h),c=await this.getSyntaxNodeAsPosition(a,u);if(!c)return null;const E=this.findFunctionCodeBlock(c,u);if(E)return this.languageFacts.provideFunctionInfo(this.language,E);const f=this.findContainingCodeBlockWithPosition(c,u);return f?{infoCategory:"other",range:{startLineNumber:f.startPosition.row+1,startColumn:0,endLineNumber:f.endPosition.row+1,endColumn:1/0},type:f.type}:null}async provideCodeBlockInfoInRange(a,h){const u=await this.parseAST(a);if(u){const c={row:h.startLineNumber-1,column:h.startColumn-1},E={row:h.endLineNumber,column:h.endColumn},f=this.languageFacts.getCodeBlockTypes(this.language);if(!f||f.size===0)return null;const d=u.descendantsOfType(Array.from(f),c,E);if(d&&d.length>0){const y=d[0];return{infoCategory:"other",range:(0,v.toMonacoRange)(y),type:y.type}}}return null}async trimSuffixSyntaxErrors(a,h=t.DEFAULT_MIN_BLOCK_COUNT){var u;await this.parserLoaded.promise;const c=(u=this.parser)===null||u===void 0?void 0:u.parse(a),E=c?.rootNode;if(!E)return a;const{namedChildren:f}=E;if(!E.hasError||f.length<=h)return this.trimToLastCompleteBlock(E,!0);let d=null,y=null;for(let I=f.length-1;I>=h;I--){const w=f[I];if(w.hasError&&I!==0)d=w;else if(d){y=w;break}}y||(y=f[h-1]);const A=a.split(`
33055
33055
  `).slice(0,y.endPosition.row+1),S=A[A.length-1].slice(0,y.endPosition.column);return`${A.length>1?`${A.slice(0,-1).join(`
33056
33056
  `)}
33057
33057
  `:""}${S}`}async trimPrefixSyntaxErrors(a,h=t.DEFAULT_MIN_BLOCK_COUNT){var u;await this.parserLoaded.promise;const c=(u=this.parser)===null||u===void 0?void 0:u.parse(a),E=c?.rootNode;if(!E)return a;const{namedChildren:f}=E;if(!E.hasError||f.length<=h)return this.trimToLastCompleteBlock(E);let d=null,y=null;for(let I=0;I<f.length-h;I++){const w=f[I];if(w.hasError&&I!==f.length-1)d=w;else if(d){y=w;break}}y||(y=f[f.length-h]);const A=a.split(`
@@ -33111,7 +33111,7 @@ ${u.applyResult.diagnosticInfos.map(c=>`Line ${c.startLineNumber}: ${c.message.s
33111
33111
  Please fix the linter errors if it is clear how to (or you can easily figure out how to). Do not make uneducated guesses. And do not loop more than 3 times on fixing linter errors on the same file.`:""}`:u.status==="cancelled"?"User cancelled the edit.":"The apply model made no changes to the file."}]}}};t.EditFileTool=s,n.__decorate([(0,o.Autowired)(m.EditFileHandler),n.__metadata("design:type",m.EditFileHandler)],s.prototype,"editFileHandler",void 0),t.EditFileTool=s=n.__decorate([(0,l.Domain)(_.MCPServerContribution)],s)},80173:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSearchTool=void 0;const n=e(85608),r=e(75995),o=e(76003),l=e(79240),_=e(43718),v=e(87863),m=e(84660),p=e(51500),s=e(19413),g=e(59347),a=e(77633),h=e(95292),u=r.z.object({query:r.z.string().describe("Fuzzy filename to search for"),explanation:r.z.string().describe("One sentence explanation as to why this tool is being used, and how it contributes to the goal.")}),c=10;let E=class{registerMCPServer(d){d.registerMCPTool(this.getToolDefinition()),d.registerToolComponent("file_search",h.FileSearchToolComponent)}getToolDefinition(){return{name:"file_search",label:"Search Files",order:6,description:"Fast file search based on fuzzy matching against file path. Use if you know part of the file path but don't know where it's located exactly. Response will be capped to 10 results. Make your query more specific if need to filter results further.",inputSchema:u,handler:this.handler.bind(this)}}async handler(d,y){var b;if(!d.query)throw new Error("No fileSearch parameters provided. Need to give a query.");const A=this.workspaceService.tryGetRoots();if(!A||A.length===0)throw new Error("Cannot determine project directory");const S=this.normalizeQuery(d.query),D=await this.fileSearchService.find(S,{rootUris:[new _.URI(A[0].uri).codeUri.fsPath],excludePatterns:Object.keys(v.defaultFilesWatcherExcludes),limit:100,useGitIgnore:!0,noIgnoreParent:!0,fuzzyMatch:!0}),I=D.slice(0,c).map(R=>({uri:_.URI.parse(R).codeUri.fsPath,isDirectory:!1})),w=this.chatInternalService.sessionModel.history.getMessages(),T=(b=w[w.length-1])===null||b===void 0?void 0:b.id;return T&&this.chatInternalService.sessionModel.history.setMessageAdditional(T,{[d.toolCallId]:{files:I}}),y.appendLine(`Found ${I.length} files matching "${d.query}"`),{content:[{type:"text",text:`${I.map(R=>R.uri).join(`
33112
33112
  `)}
33113
33113
  ${D.length>c?`
33114
- Found ${D.length} files matching "${d.query}", only return the first ${c} results`:""}`}]}}normalizeQuery(d){const y=d.trim().replace(/\s/g,"");return(0,l.getValidateInput)(y)}};t.FileSearchTool=E,n.__decorate([(0,o.Autowired)(p.IWorkspaceService),n.__metadata("design:type",Object)],E.prototype,"workspaceService",void 0),n.__decorate([(0,o.Autowired)(m.FileSearchServicePath),n.__metadata("design:type",Object)],E.prototype,"fileSearchService",void 0),n.__decorate([(0,o.Autowired)(s.IChatInternalService),n.__metadata("design:type",g.ChatInternalService)],E.prototype,"chatInternalService",void 0),t.FileSearchTool=E=n.__decorate([(0,_.Domain)(a.MCPServerContribution)],E)},30645:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetDiagnosticsByPathTool=void 0;const n=e(85608),r=n.__importStar(e(64756)),o=e(75995),l=e(76003),_=e(43718),v=e(51500),m=e(26592),p=e(34835),s=e(77633),g=o.z.object({filePathInProject:o.z.string().describe("The relative path to the file to get diagnostics for")});let a=class{registerMCPServer(u){u.registerMCPTool(this.getToolDefinition())}getToolDefinition(){return{name:"get_diagnostics_by_path",label:"Get Diagnostics By Path",order:9,description:`Retrieves diagnostic information (errors, warnings, etc.) from a specific file in the project. Use this tool to get information about problems in any project file. IMPORTANT: This tool should be called after any code generation or modification operations to verify and fix potential issues. Requires a filePathInProject parameter specifying the target file path relative to project root. Returns a JSON-formatted list of diagnostics, where each entry contains: - path: The file path where the diagnostic was found - line: The line number (1-based) of the diagnostic - severity: The severity level ("error", "warning", "information", or "hint") - message: The diagnostic message Returns an empty list ([]) if no diagnostics are found or the file doesn't exist. Best Practice: Always check diagnostics after code generation to ensure code quality and fix any issues immediately. Use this tool in combination with get_open_in_editor_file_diagnostics to verify all affected files after code changes. Diagnostic Severity Handling Guidelines: - "error": Must be fixed immediately as they indicate critical issues that will prevent code from working correctly. - "warning": For user code, preserve unless the warning indicates a clear improvement opportunity. For generated code, optimize to remove warnings. - "information"/"hint": For user code, preserve as they might reflect intentional patterns. For generated code, optimize if it improves code quality without changing functionality.`,inputSchema:g,handler:this.handler.bind(this)}}async handler(u,c){try{const E=this.workspaceService.tryGetRoots();if(!E||E.length===0)return c.appendLine("Error: Cannot determine project directory"),{content:[{type:"text",text:"[]"}],isError:!0};const f=_.URI.parse(E[0].uri),d=r.join(f.codeUri.fsPath,u.filePathInProject),y=m.URI.file(d),b=r.relative(f.codeUri.fsPath,d);if(b.startsWith("..")||r.isAbsolute(b))return c.appendLine("Error: File is outside of project scope"),{content:[{type:"text",text:"[]"}],isError:!0};const S=this.markerService.read({resource:y}).map(I=>({path:u.filePathInProject,line:I.startLineNumber,severity:this.getSeverityString(I.severity),message:I.message})),D=JSON.stringify(S,null,2);return c.appendLine(`Found ${S.length} diagnostics in ${u.filePathInProject}`),{content:[{type:"text",text:D}]}}catch(E){return c.appendLine(`Error getting diagnostics: ${E}`),{content:[{type:"text",text:"[]"}],isError:!0}}}getSeverityString(u){switch(u){case p.MarkerSeverity.Error:return"error";case p.MarkerSeverity.Warning:return"warning";case p.MarkerSeverity.Info:return"information";case p.MarkerSeverity.Hint:return"hint";default:return"unknown"}}};t.GetDiagnosticsByPathTool=a,n.__decorate([(0,l.Autowired)(v.IWorkspaceService),n.__metadata("design:type",Object)],a.prototype,"workspaceService",void 0),n.__decorate([(0,l.Autowired)(p.IMarkerService),n.__metadata("design:type",Object)],a.prototype,"markerService",void 0),t.GetDiagnosticsByPathTool=a=n.__decorate([(0,_.Domain)(s.MCPServerContribution)],a)},82078:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetOpenEditorFileDiagnosticsTool=void 0;const n=e(85608),r=n.__importStar(e(64756)),o=e(75995),l=e(76003),_=e(43718),v=e(54414),m=e(51500),p=e(26592),s=e(34835),g=e(77633),a=o.z.object({});let h=class{registerMCPServer(c){c.registerMCPTool(this.getToolDefinition())}getToolDefinition(){return{name:"get_open_in_editor_file_diagnostics",label:"Get Current Editor Diagnostics",order:8,description:'Retrieves diagnostic information (errors, warnings, etc.) from the currently active file in VS Code editor. Use this tool to get information about problems in your current file. IMPORTANT: This tool should be called after any code generation or modification operations to verify and fix potential issues. Returns a JSON-formatted list of diagnostics, where each entry contains: - path: The file path where the diagnostic was found - line: The line number (1-based) of the diagnostic - severity: The severity level ("error", "warning", "information", or "hint") - message: The diagnostic message Returns an empty list ([]) if no diagnostics are found or no file is open. Best Practice: Always check diagnostics after code generation to ensure code quality and fix any issues immediately. Diagnostic Severity Handling Guidelines: - "error": Must be fixed immediately as they indicate critical issues that will prevent code from working correctly. - "warning": For user code, preserve unless the warning indicates a clear improvement opportunity. For generated code, optimize to remove warnings. - "information"/"hint": For user code, preserve as they might reflect intentional patterns. For generated code, optimize if it improves code quality without changing functionality.',inputSchema:a,handler:this.handler.bind(this)}}async handler(c,E){try{const f=this.editorService.currentEditor;if(!f||!f.currentUri)return E.appendLine("Error: No active text editor found"),{content:[{type:"text",text:"[]"}],isError:!0};const d=this.workspaceService.tryGetRoots();if(!d||d.length===0)return E.appendLine("Error: Cannot determine project directory"),{content:[{type:"text",text:"[]"}],isError:!0};const y=p.URI.parse(f.currentUri.toString()),b=this.markerService.read({resource:y}),A=_.URI.parse(d[0].uri),S=r.relative(A.codeUri.fsPath,f.currentUri.codeUri.fsPath),D=b.map(w=>({path:S,line:w.startLineNumber,severity:this.getSeverityString(w.severity),message:w.message})),I=JSON.stringify(D,null,2);return E.appendLine(`Found ${D.length} diagnostics in current file`),{content:[{type:"text",text:I}]}}catch(f){return E.appendLine(`Error getting diagnostics: ${f}`),{content:[{type:"text",text:"[]"}],isError:!0}}}getSeverityString(c){switch(c){case s.MarkerSeverity.Error:return"error";case s.MarkerSeverity.Warning:return"warning";case s.MarkerSeverity.Info:return"information";case s.MarkerSeverity.Hint:return"hint";default:return"unknown"}}};t.GetOpenEditorFileDiagnosticsTool=h,n.__decorate([(0,l.Autowired)(v.WorkbenchEditorService),n.__metadata("design:type",v.WorkbenchEditorService)],h.prototype,"editorService",void 0),n.__decorate([(0,l.Autowired)(m.IWorkspaceService),n.__metadata("design:type",Object)],h.prototype,"workspaceService",void 0),n.__decorate([(0,l.Autowired)(s.IMarkerService),n.__metadata("design:type",Object)],h.prototype,"markerService",void 0),t.GetOpenEditorFileDiagnosticsTool=h=n.__decorate([(0,_.Domain)(g.MCPServerContribution)],h)},39855:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GrepSearchTool=void 0;const n=e(85608),r=e(75995),o=e(76003),l=e(43718),_=e(13439),v=e(51495),m=e(51500),p=e(19413),s=e(59347),g=e(77633),a=e(95292),h=r.z.object({query:r.z.string().describe("The regex pattern to search for"),case_sensitive:r.z.boolean().optional().describe("Whether the search should be case sensitive"),include_pattern:r.z.string().optional().describe('Glob pattern for files to include (e.g. "*.ts" for TypeScript files)'),exclude_pattern:r.z.string().optional().describe("Glob pattern for files to exclude"),explanation:r.z.string().optional().describe("One sentence explanation as to why this tool is being used, and how it contributes to the goal.")}).transform(E=>({query:E.query,caseSensitive:E.case_sensitive,includePattern:E.include_pattern,excludePattern:E.exclude_pattern,explanation:E.explanation})),u=50;let c=class{registerMCPServer(f){f.registerMCPTool(this.getToolDefinition()),f.registerToolComponent("grep_search",a.GrepSearchToolComponent)}getToolDefinition(){return{name:"grep_search",label:"Search Contents",order:4,description:`Fast text-based regex search that finds exact pattern matches within files or directories, utilizing the ripgrep command for efficient searching.
33114
+ Found ${D.length} files matching "${d.query}", only return the first ${c} results`:""}`}]}}normalizeQuery(d){const y=d.trim().replace(/\s/g,"");return(0,l.getValidateInput)(y)}};t.FileSearchTool=E,n.__decorate([(0,o.Autowired)(p.IWorkspaceService),n.__metadata("design:type",Object)],E.prototype,"workspaceService",void 0),n.__decorate([(0,o.Autowired)(m.FileSearchServicePath),n.__metadata("design:type",Object)],E.prototype,"fileSearchService",void 0),n.__decorate([(0,o.Autowired)(s.IChatInternalService),n.__metadata("design:type",g.ChatInternalService)],E.prototype,"chatInternalService",void 0),t.FileSearchTool=E=n.__decorate([(0,_.Domain)(a.MCPServerContribution)],E)},30645:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetDiagnosticsTool=void 0;const n=e(85608),r=e(75995),o=e(76003),l=e(43718),_=e(57517),v=e(14951),m=e(55126),p=e(51500),s=e(77633),g=r.z.object({filePathInProject:r.z.string().describe("The relative path to the file to get diagnostics for")});let a=class{registerMCPServer(u){u.registerMCPTool(this.getToolDefinition())}getToolDefinition(){return{name:"get_diagnostics_by_path",label:"Get Diagnostics By Path",order:9,description:`Retrieves diagnostic information (errors, warnings, etc.) from a specific file in the project. Use this tool to get information about problems in any project file. IMPORTANT: This tool should be called after any code generation or modification operations to verify and fix potential issues. Requires a filePathInProject parameter specifying the target file path relative to project root. Returns a JSON-formatted list of diagnostics, where each entry contains: - path: The file path where the diagnostic was found - line: The line number (1-based) of the diagnostic - severity: The severity level ("error", "warning", "information", or "hint") - message: The diagnostic message Returns an empty list ([]) if no diagnostics are found or the file doesn't exist. Best Practice: Always check diagnostics after code generation to ensure code quality and fix any issues immediately. Use this tool in combination with get_open_in_editor_file_diagnostics to verify all affected files after code changes. Diagnostic Severity Handling Guidelines: - "error": Must be fixed immediately as they indicate critical issues that will prevent code from working correctly. - "warning": For user code, preserve unless the warning indicates a clear improvement opportunity. For generated code, optimize to remove warnings. - "information"/"hint": For user code, preserve as they might reflect intentional patterns. For generated code, optimize if it improves code quality without changing functionality.`,inputSchema:g,handler:this.handler.bind(this)}}async checkFilePath(u,c){const E=this.workspaceService.tryGetRoots();if(!E||E.length===0)throw c.appendLine("Error: Cannot determine project directory"),new Error("Cannot determine project directory");if(u.startsWith("..")||u.startsWith("/"))throw c.appendLine("Error: File is outside of project scope"),new Error("File is outside of project scope");const f=l.URI.parse(E[0].uri),d=l.URI.file(l.path.join(f.codeUri.fsPath,u));if(!await this.fileServiceClient.access(d.toString()))throw c.appendLine(`Error: File does not exist: ${d.toString()}`),new Error("File does not exist");return d}async ensureModelCreated(u){if(!this.modelService.getAllModels().some(E=>E.uri.isEqual(u))){const E=new l.Deferred;this.markerService.getManager().onMarkerChanged(f=>{f.some(d=>d===u.toString())&&E.resolve()}),await this.modelService.createModelReference(u),await new Promise(f=>setTimeout(f,4e3)).then(()=>{E.resolve()}),await E.promise}}async handler(u,c){try{const E=await this.checkFilePath(u.filePathInProject,c);await this.ensureModelCreated(E);const d=this.markerService.getManager().getMarkers({resource:E.toString()}).map(b=>({path:u.filePathInProject,line:b.startLineNumber,severity:this.getSeverityString(b.severity),message:b.message})),y=JSON.stringify(d,null,2);return c.appendLine(`Found ${d.length} diagnostics in ${u.filePathInProject}`),{content:[{type:"text",text:y}]}}catch(E){return c.appendLine(`Error getting diagnostics: ${E}`),{content:[{type:"text",text:"[]"}],isError:!0}}}getSeverityString(u){switch(u){case l.MarkerSeverity.Error:return"error";case l.MarkerSeverity.Warning:return"warning";case l.MarkerSeverity.Info:return"information";case l.MarkerSeverity.Hint:return"hint";default:return"unknown"}}};t.GetDiagnosticsTool=a,n.__decorate([(0,o.Autowired)(p.IWorkspaceService),n.__metadata("design:type",Object)],a.prototype,"workspaceService",void 0),n.__decorate([(0,o.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],a.prototype,"fileServiceClient",void 0),n.__decorate([(0,o.Autowired)(_.IEditorDocumentModelService),n.__metadata("design:type",Object)],a.prototype,"modelService",void 0),n.__decorate([(0,o.Autowired)(m.IMarkerService),n.__metadata("design:type",Object)],a.prototype,"markerService",void 0),t.GetDiagnosticsTool=a=n.__decorate([(0,l.Domain)(s.MCPServerContribution)],a)},39855:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GrepSearchTool=void 0;const n=e(85608),r=e(75995),o=e(76003),l=e(43718),_=e(13439),v=e(51495),m=e(51500),p=e(19413),s=e(59347),g=e(77633),a=e(95292),h=r.z.object({query:r.z.string().describe("The regex pattern to search for"),case_sensitive:r.z.boolean().optional().describe("Whether the search should be case sensitive"),include_pattern:r.z.string().optional().describe('Glob pattern for files to include (e.g. "*.ts" for TypeScript files)'),exclude_pattern:r.z.string().optional().describe("Glob pattern for files to exclude"),explanation:r.z.string().optional().describe("One sentence explanation as to why this tool is being used, and how it contributes to the goal.")}).transform(E=>({query:E.query,caseSensitive:E.case_sensitive,includePattern:E.include_pattern,excludePattern:E.exclude_pattern,explanation:E.explanation})),u=50;let c=class{registerMCPServer(f){f.registerMCPTool(this.getToolDefinition()),f.registerToolComponent("grep_search",a.GrepSearchToolComponent)}getToolDefinition(){return{name:"grep_search",label:"Search Contents",order:4,description:`Fast text-based regex search that finds exact pattern matches within files or directories, utilizing the ripgrep command for efficient searching.
33115
33115
  Results will be formatted in the style of ripgrep and can be configured to include line numbers and content.
33116
33116
  To avoid overwhelming output, the results are capped at 50 matches.
33117
33117
  Use the include or exclude patterns to filter the search scope by file type or specific paths.
@@ -33895,7 +33895,7 @@ blockquote {
33895
33895
  ${u.message||u}`),{ariaSummary:u.message,isApplied:!1,success:!1}}try{const{workspaceEdit:u,totalEdits:c,totalFiles:E}=this.convertWorkspaceEdit(h);return await this.workspaceEditService.apply(u),{ariaSummary:this.getAriaSummary(c,E),isApplied:!0,success:!0}}catch(u){const c=`Error applying workspace edits: ${u.toString()}`;return this.logger.error(c),{ariaSummary:c,isApplied:!1,success:!1}}}hasPreviewHandler(){return!!this._previewHandler}setPreviewHandler(g){this._previewHandler=g;const a=()=>{this._previewHandler===g&&(this._previewHandler=void 0)};return{dispose(){a()}}}convertWorkspaceEdit(g){const a={edits:[]};let h=0,u=0;for(const c of g)if(c.resource){const E=c,f={resource:o.URI.from(E.resource),textEdit:E.textEdit,options:{dirtyIfInEditor:!0}};a.edits.push(f),h+=1}else{const E=c,{oldResource:f,newResource:d,options:y={}}=E,b={oldResource:f?o.URI.from(f):void 0,newResource:d?o.URI.from(d):void 0,options:y};a.edits.push(b),u+=1}return{workspaceEdit:a,totalEdits:h,totalFiles:u}}};t.MonacoBulkEditService=p,n.__decorate([(0,r.Autowired)(_.IWorkspaceEditService),n.__metadata("design:type",Object)],p.prototype,"workspaceEditService",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],p.prototype,"logger",void 0),t.MonacoBulkEditService=p=n.__decorate([(0,r.Injectable)()],p)},7284:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceEditContribution=t.WorkspaceEditModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(36005),_=e(56794),v=e(57236),m=e(74195),p=e(17341),s="refactor-preview.clear.edits",g="refactor-preview.apply.edits";let a=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:l.IWorkspaceEditService,useClass:m.WorkspaceEditServiceImpl},{token:l.IWorkspaceFileService,useClass:p.WorkspaceFileService},{token:v.IRefactorPreviewService,useClass:v.RefactorPreviewServiceImpl},{token:l.IBulkEditServiceShape,useClass:_.MonacoBulkEditService},h]}};t.WorkspaceEditModule=a,t.WorkspaceEditModule=a=n.__decorate([(0,r.Injectable)()],a);let h=class{async previewEdit(c,E){try{return await this.refactorPreviewService.previewEdits(c)}catch(f){return f&&this.logger.error(`Preview textEdit error:
33896
33896
  ${f.message}`),c}}registerOverrideService(c){c.registerOverrideService(o.ServiceNames.BULK_EDIT_SERVICE,this.bulkEditService),this.bulkEditService.setPreviewHandler(this.previewEdit.bind(this))}registerToolbarItems(c){c.registerItem({id:s,viewId:v.PreviewViewId,command:s,tooltip:(0,o.localize)("refactor-preview.title.clear")}),c.registerItem({id:g,viewId:v.PreviewViewId,command:g,tooltip:(0,o.localize)("refactor-preview.title.apply")})}registerCommands(c){c.registerCommand({id:s,iconClass:(0,o.getIcon)("clear")},{execute:()=>{this.refactorPreviewService.clearAllEdits()}}),c.registerCommand({id:g,iconClass:(0,o.getIcon)("check")},{execute:()=>{this.refactorPreviewService.applyEdits()}})}};t.WorkspaceEditContribution=h,n.__decorate([(0,r.Autowired)(l.IBulkEditServiceShape),n.__metadata("design:type",Object)],h.prototype,"bulkEditService",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],h.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(v.IRefactorPreviewService),n.__metadata("design:type",Object)],h.prototype,"refactorPreviewService",void 0),t.WorkspaceEditContribution=h=n.__decorate([(0,o.Domain)(o.MonacoContribution,o.TabBarToolbarContribution,o.CommandContribution)],h)},20453:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RefactorPreview=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(7273),l=e(34128),_=e(41869),v=e(48560),m=e(63214),p=e(43718),s=e(33783),g=e(96689),a=n.__importStar(e(20868)),h=e(57236),u=n.__importDefault(e(74230)),c=e(91869);function E(D,I){const w=I.getLineContent(D.startLineNumber),T=I.getValueInRange(D),R=new a.Range(D.startLineNumber,0,D.startLineNumber,D.startColumn),M=new a.Range(D.endLineNumber,D.startColumn+T.length,D.endLineNumber,w.length+1),O=I.getValueInRange(R),x=I.getValueInRange(M);return{leftPad:O,rightPad:x,base:T}}const f=D=>{const w=(0,v.useInjectable)(m.LabelService).getIcon(p.URI.from(D.uri));return r.default.createElement("span",{className:`file-icon ${w}`})},d=({data:D})=>{const I=D.edit,w=(0,_.useAutorun)(D.isChecked),T=(0,v.useInjectable)(g.IEditorDocumentModelService),R=(0,v.useInjectable)(h.IRefactorPreviewService),M=()=>{const O=T.getModelReference(p.URI.from(I.resource));if(!O)return r.default.createElement("div",{className:u.default.refactor_preview_node_wrapper},I.textEdit.text);const x=O.instance.getMonacoModel(),{leftPad:k,base:F,rightPad:L}=E(I.textEdit.range,x);return O.dispose(),r.default.createElement("div",{className:u.default.refactor_preview_node_wrapper},k,r.default.createElement("span",{className:u.default.refactor_preview_node_base},F),r.default.createElement("span",{className:u.default.refactor_preview_node_new},I.textEdit.text),L)};return r.default.createElement("div",{className:u.default.resource_node,"data-workspace-edit-type":"text"},r.default.createElement(o.CheckBox,{checked:w,onChange:O=>{R.filterEdit(D,O.target.checked)}}),r.default.createElement(f,{uri:I.resource}),M(),r.default.createElement("span",{className:u.default.resource_node_path},I.resource.path))};function y(D){if(D.newResource&&D.oldResource)return{uri:D.newResource,desc:(0,s.localize)("refactor-preview.file.move")};if(D.newResource&&!D.oldResource)return{uri:D.newResource,desc:(0,s.localize)("refactor-preview.file.create")};if(!D.newResource&&D.oldResource)return{uri:D.oldResource,desc:(0,s.localize)("refactor-preview.file.delete")}}const b=({data:D})=>{const I=D.edit,w=(0,_.useAutorun)(D.isChecked),T=(0,v.useInjectable)(h.IRefactorPreviewService),R=y(I);if(R===void 0)return null;const M=p.path.basename(R.uri.fsPath),O=p.path.dirname(R.uri.fsPath);return r.default.createElement("div",{className:u.default.resource_node,"data-workspace-edit-type":"file"},r.default.createElement(o.CheckBox,{checked:w,onChange:x=>{T.filterEdit(D,x.target.checked)}}),r.default.createElement(f,{uri:R.uri}),r.default.createElement("span",{className:u.default.refactor_preview_node_wrapper},M),r.default.createElement("span",{className:u.default.resource_node_path},O," (",R.desc,")"))},A=({data:D,...I})=>(0,c.isResourceFileEdit)(D)?r.default.createElement(b,{data:D,...I}):r.default.createElement(d,{data:D,...I}),S=({viewState:D})=>{const I=(0,v.useInjectable)(h.IRefactorPreviewService),w=(0,_.useAutorun)(I.edits);return r.default.createElement("div",null,w.length>0&&r.default.createElement(l.RecycleList,{itemHeight:23,width:D.width,height:D.height,data:w,template:A}))};t.RefactorPreview=S},57236:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RefactorPreviewServiceImpl=t.WorkspaceEditModel=t.IRefactorPreviewService=t.PreviewViewId=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(76003),l=e(43718),_=e(63067),v=e(28423),m=e(72665),p=e(20453);t.PreviewViewId="RefactorPreview",t.IRefactorPreviewService=Symbol("IRefactorPreviewService");class s{constructor(h){this.raw=h,this.isChecked=(0,v.observableValue)(this,!0)}get edit(){return this.raw}}t.WorkspaceEditModel=s;let g=class{constructor(){this.edits=(0,v.observableValue)(this,[])}clear(){this.togglePreviewView(!1),this.previewDeferred=null,(0,v.transaction)(h=>{this.edits.set([],h)})}registerRefactorPreviewView(){this.mainLayout.getTabbarHandler(t.PreviewViewId)||this.mainLayout.collectTabbarComponent([{component:p.RefactorPreview,id:t.PreviewViewId}],{title:(0,l.localize)("refactor-preview.title","REFACTOR PREVIEW"),containerId:t.PreviewViewId,hidden:!0},"bottom")}togglePreviewView(h){const u=this.mainLayout.getTabbarHandler(t.PreviewViewId);h?(u?.show(),u?.activate()):(u?.hide(),u?.deactivate())}async previewEdits(h){return this.registerRefactorPreviewView(),this.previewDeferred&&await this.dialogService.open({message:r.default.createElement("div",null,(0,l.localize)("refactor-preview.overlay.title"),r.default.createElement("p",null,(0,l.localize)("refactor-preview.overlay.detail"))),type:l.MessageType.Warning,buttons:[(0,l.localize)("refactor-preview.overlay.cancel"),(0,l.localize)("refactor-preview.overlay.continue")]})===(0,l.localize)("refactor-preview.overlay.cancel")?[]:(this.togglePreviewView(!0),(0,v.transaction)(u=>{this.edits.set(h.map(c=>new s(c)),u)}),this.previewDeferred=new l.Deferred,this.previewDeferred.promise)}filterEdit(h,u){(0,v.transaction)(c=>{h.isChecked.set(u,c)})}applyEdits(){if(!this.previewDeferred)return;const h=this.edits.get().filter(u=>u.isChecked.get());this.previewDeferred.resolve(h.map(u=>u.edit)),this.clear()}clearAllEdits(){this.previewDeferred&&(this.previewDeferred.resolve([]),this.clear())}};t.RefactorPreviewServiceImpl=g,n.__decorate([(0,o.Autowired)(_.IMainLayoutService),n.__metadata("design:type",Object)],g.prototype,"mainLayout",void 0),n.__decorate([(0,o.Autowired)(m.IDialogService),n.__metadata("design:type",Object)],g.prototype,"dialogService",void 0),n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],g.prototype,"injector",void 0),t.RefactorPreviewServiceImpl=g=n.__decorate([(0,o.Injectable)()],g)},91869:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isResourceFileEdit=o,t.isResourceTextEdit=l;const n=e(43718),r=e(20868);function o(_){return(0,n.isObject)(_)&&(!!_.newResource||!!_.oldResource)}function l(_){return(0,n.isObject)(_)&&r.Uri.isUri(_.resource)&&(0,n.isObject)(_.textEdit)}},74195:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceFileEdit=t.ResourceTextEditTask=t.BulkEdit=t.WorkspaceEditServiceImpl=void 0,t.isResourceFileEdit=c;const n=e(85608),r=e(76003),o=e(41869),l=e(54414),_=e(57517),v=e(42933),m=e(68475),p=e(44781),s=e(36005);let g=class{constructor(){this.editStack=[]}async apply(d){const y=new a;d.edits.forEach(b=>{y.add(b)}),await y.apply(this.documentModelService,this.editorService,this.workspaceFileService,this.eventBus),this.editStack.push(y)}revertTopFileEdit(){throw new Error("Method not implemented.")}};t.WorkspaceEditServiceImpl=g,n.__decorate([(0,r.Autowired)(_.IEditorDocumentModelService),n.__metadata("design:type",Object)],g.prototype,"documentModelService",void 0),n.__decorate([(0,r.Autowired)(s.IWorkspaceFileService),n.__metadata("design:type",Object)],g.prototype,"workspaceFileService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",l.WorkbenchEditorService)],g.prototype,"editorService",void 0),n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],g.prototype,"eventBus",void 0),t.WorkspaceEditServiceImpl=g=n.__decorate([(0,r.Injectable)()],g);class a{constructor(){this.edits=[]}async apply(d,y,b,A){for(const S of this.edits)S instanceof u?await S.apply(d,y,b,A):await S.apply(d,y)}add(d){if(c(d))this.edits.push(new u(d));else{const y=this.edits[this.edits.length-1],b=d;if(y&&!c(y)&&y.resource.toString()===b.resource.toString()){let A=!1;if(y.versionId?b.versionId?A=b.versionId===y.versionId:A=!0:b.versionId||(A=!0),A){y.addEdit(d);return}}this.edits.push(new h(d))}}revert(d){}}t.BulkEdit=a;class h{constructor(d){this.options={},this.resource=d.resource,this.versionId=d.versionId,this.options=d.options||{},this.edits=[d]}addEdit(d){this.edits.push(d)}async apply(d,y){const b=await d.createModelReference(this.resource,"bulk-edit"),A=b.instance,S=A.getMonacoModel();if(this.versionId&&S.getVersionId()!==this.versionId)throw new Error("Unable to perform changes due to inconsistent document versions");const D=[];let I;for(const T of this.edits)T.textEdit.eol&&!(0,o.isUndefined)(T.textEdit.eol)&&(I=T.textEdit.eol),D.push({forceMoveMarkers:!1,range:p.Range.lift(T.textEdit.range),text:T.textEdit.text});D.length>0&&(S.pushStackElement(),S.pushEditOperations(null,D,()=>null),S.pushStackElement()),I&&!(0,o.isUndefined)(I)&&(S.pushStackElement(),A.eol=I===m.EndOfLineSequence.CRLF?`\r
33897
33897
  `:`
33898
- `,S.pushStackElement()),await this.editorOperation(y)&&A.save(),b.dispose()}async editorOperation(d){if(this.options.openDirtyInEditor){for(const y of d.editorGroups)if(y.resources.findIndex(b=>E(b,this.resource))!==-1)return!1;return d.open(this.resource,{backend:!0}),!1}else if(this.options.dirtyIfInEditor){for(const y of d.editorGroups)if(y.resources.findIndex(b=>E(b,this.resource))!==-1)return!1}return!0}async revert(){}}t.ResourceTextEditTask=h;class u{constructor(d){this.options={},this.oldResource=d.oldResource,this.newResource=d.newResource,this.options=d.options}async notifyEditor(d,y){if(this.oldResource&&this.newResource){const b=[],A=new Set;return d.editorGroups.forEach(S=>{S.resources.forEach(D=>{this.oldResource.isEqualOrParent(D.uri)&&A.add(D.uri.toString())})}),A.forEach(S=>{const D=new o.URI(S),I=S.substr(this.oldResource.toString().length),w=new o.URI(this.newResource.toString()+I);b.push(this.notifyOnResource(D,w,d,y))}),Promise.all(b)}}async notifyOnResource(d,y,b,A){const S=A.getModelReference(d,"bulk-file-move");let D,I;if(S&&S.instance.dirty&&(D=S.instance.getText(),I=S.instance.eol,await S.instance.revert(!0)),S&&S.dispose(),await Promise.all([b.editorGroups.map(async w=>{const T=w.resources.findIndex(R=>R.uri.isEqual(d));T!==-1&&(0,o.runWhenIdle)(async()=>{await w.open(y,{index:T,backend:!(w.currentResource&&w.currentResource.uri.isEqual(d)),preview:w.previewURI?w.previewURI.isEqual(d):!1}),await w.close(d)})})]),D){const w=await A.createModelReference(y,"bulk-file-move");w.instance.updateContent(D,I),w.dispose()}}async apply(d,y,b,A){const S=this.options||{};if(this.newResource&&this.oldResource)S.copy?await b.copy([{source:this.oldResource.codeUri,target:this.newResource.codeUri}],S):(await b.move([{source:this.oldResource.codeUri,target:this.newResource.codeUri}],S),await this.notifyEditor(y,d),A.fire(new s.WorkspaceEditDidRenameFileEvent({oldUri:this.oldResource,newUri:this.newResource}))),S.showInEditor&&y.open(this.newResource);else if(!this.newResource&&this.oldResource)try{await b.delete([this.oldResource],{useTrash:!(o.isWindows&&this.oldResource.path.name==="node_modules")}),await y.close(this.oldResource,!0),A.fire(new s.WorkspaceEditDidDeleteFileEvent({oldUri:this.oldResource}))}catch(D){if(!(v.FileSystemError.FileNotFound.is(D)&&S.ignoreIfNotExists))throw D}else if(this.newResource&&!this.oldResource){try{S.isDirectory?await b.createFolder(this.newResource):await b.create(this.newResource,S.content||"",{overwrite:S.overwrite})}catch(D){if(!(v.FileSystemError.FileExists.is(D)&&S.ignoreIfExists))throw D}!S.isDirectory&&S.showInEditor&&y.open(this.newResource)}}async revert(){}}t.ResourceFileEdit=u;function c(f){return!!f.newResource||!!f.oldResource}function E(f,d){var y,b;return(0,_.isDiffResource)(f)?((y=f.metadata)===null||y===void 0?void 0:y.modified.isEqual(d))||((b=f.metadata)===null||b===void 0?void 0:b.original.isEqual(d)):f.uri.isEqual(d)}},17341:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceFileService=t.WorkspaceFileOperationParticipant=void 0;const n=e(85608),r=e(76003),o=e(68969),l=e(43718),_=e(14951),v=e(26199);let m=class extends l.Disposable{constructor(){super(...arguments),this.participants=[]}registerParticipant(g){return this.participants.push(g),{dispose:()=>{const a=this.participants.findIndex(h=>h===g);this.participants.splice(a,1)}}}async participate(g,a){const h=new l.CancellationTokenSource;for(const u of this.participants){if(h.token.isCancellationRequested)break;try{await u.participate(g,a,void 0,v.FILE_OPERATION_TIMEOUT,h.token)}catch(c){(0,l.getDebugLogger)().error(c)}}}dispose(){this.participants.splice(0,this.participants.length)}};t.WorkspaceFileOperationParticipant=m,n.__decorate([(0,r.Autowired)(o.IProgressService),n.__metadata("design:type",Object)],m.prototype,"progressService",void 0),t.WorkspaceFileOperationParticipant=m=n.__decorate([(0,r.Injectable)()],m);let p=class{constructor(){this.correlationIds=0,this._onWillRunWorkspaceFileOperation=new l.AsyncEmitter,this.onWillRunWorkspaceFileOperation=this._onWillRunWorkspaceFileOperation.event,this._onDidFailWorkspaceFileOperation=new l.AsyncEmitter,this.onDidFailWorkspaceFileOperation=this._onDidFailWorkspaceFileOperation.event,this._onDidRunWorkspaceFileOperation=new l.AsyncEmitter,this.onDidRunWorkspaceFileOperation=this._onDidRunWorkspaceFileOperation.event}create(g,a,h){return this.doCreate(g,!0,a,h)}createFolder(g){return this.doCreate(g,!1)}move(g,a){return this.doMoveOrCopy(g,!0,a)}copy(g,a){return this.doMoveOrCopy(g,!1,a)}async delete(g,a){const h=g.map(c=>({target:c.codeUri}));await this.runOperationParticipant(h,1);const u={correlationId:this.correlationIds++,operation:1,files:h};await this._onWillRunWorkspaceFileOperation.fireAsync(u,l.CancellationToken.None);try{for(const c of g)await this.fileService.delete(c.toString(),{moveToTrash:a?.useTrash})}catch(c){throw await this._onDidFailWorkspaceFileOperation.fireAsync(u,l.CancellationToken.None),c}await this._onDidRunWorkspaceFileOperation.fireAsync(u,l.CancellationToken.None)}registerFileOperationParticipant(g){return this.fileOperationParticipants.registerParticipant(g)}runOperationParticipant(g,a){return this.fileOperationParticipants.participate(g,a)}async doMoveOrCopy(g,a,h){const u=h?.overwrite,c=[];await this.runOperationParticipant(g,a?2:3);const E={correlationId:this.correlationIds++,operation:a?2:3,files:g};await this._onWillRunWorkspaceFileOperation.fireAsync(E,l.CancellationToken.None);try{for(const{source:f,target:d}of g)a?c.push(await this.fileService.move(f.toString(),d.toString(),{overwrite:u})):c.push(await this.fileService.copy(f.toString(),d.toString(),{overwrite:u}))}catch(f){throw await this._onDidFailWorkspaceFileOperation.fireAsync(E,l.CancellationToken.None),f}return await this._onDidRunWorkspaceFileOperation.fireAsync(E,l.CancellationToken.None),c}async doCreate(g,a,h,u){await this.runOperationParticipant([{target:g.codeUri}],0);const c={correlationId:this.correlationIds++,operation:0,files:[{target:g.codeUri}]};await this._onWillRunWorkspaceFileOperation.fireAsync(c,l.CancellationToken.None);let E;try{a?E=await this.fileService.createFile(g.toString(),{overwrite:u?.overwrite,content:h}):E=await this.fileService.createFolder(g.toString())}catch(f){throw await this._onDidFailWorkspaceFileOperation.fireAsync(c,l.CancellationToken.None),f}return await this._onDidRunWorkspaceFileOperation.fireAsync(c,l.CancellationToken.None),E}};t.WorkspaceFileService=p,n.__decorate([(0,r.Autowired)(_.IFileServiceClient),n.__metadata("design:type",Object)],p.prototype,"fileService",void 0),n.__decorate([(0,r.Autowired)(m),n.__metadata("design:type",m)],p.prototype,"fileOperationParticipants",void 0),t.WorkspaceFileService=p=n.__decorate([(0,r.Injectable)()],p)},36005:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceEditDidDeleteFileEvent=t.WorkspaceEditDidRenameFileEvent=t.FILE_OPERATION_TIMEOUT=t.IBulkEditServiceShape=t.IWorkspaceFileService=t.IWorkspaceEditService=void 0;const n=e(43718);t.IWorkspaceEditService=Symbol("IWorkspaceEditService"),t.IWorkspaceFileService=Symbol("IWorkspaceFileService"),t.IBulkEditServiceShape=Symbol("IBulkEditServiceShape"),t.FILE_OPERATION_TIMEOUT=5e3;class r extends n.BasicEvent{}t.WorkspaceEditDidRenameFileEvent=r;class o extends n.BasicEvent{}t.WorkspaceEditDidDeleteFileEvent=o},26199:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(36005),t),n.__exportStar(e(7284),t)},41103:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceModule=void 0;const n=e(85608),r=e(41869),o=e(10560),l=e(28929),_=e(32505),v=e(99652),m=e(91600),p=e(68810),s=e(48955);let g=class extends r.BrowserModule{constructor(){super(...arguments),this.providers=[{token:o.IWorkspaceService,useClass:v.WorkspaceService},{token:o.IWorkspaceStorageService,useClass:m.WorkspaceStorageService},l.WorkspaceContribution,p.WorkspaceVariableContribution],this.preferences=_.injectWorkspacePreferences}};t.WorkspaceModule=g,t.WorkspaceModule=g=n.__decorate([(0,r.Domain)(s.name)],g)},68905:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceContextKey=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(66e3);let _=class{constructor(m){m=m||this.globalContextKeyService,this.workbenchStateContextKey=l.WorkbenchState.bind(m),this.workspaceFolderCountContextKey=l.WorkspaceFolderCount.bind(m),this.workspaceTrustedContextKey=l.WorkspaceTrusted.bind(m),this.virtualWorkspaceContextKey=l.VirtualWorkspace.bind(m)}};t.WorkspaceContextKey=_,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],_.prototype,"globalContextKeyService",void 0),t.WorkspaceContextKey=_=n.__decorate([(0,r.Injectable)(),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[Object])],_)},28929:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(72665),_=e(10560),v=e(68905),m=e(32505),p=e(99652);let s=class{constructor(){this.schema=m.workspacePreferenceSchema}async initWorkspaceContextKeys(){await this.workspaceService.whenReady;const a=()=>{const h=this.workspaceService.tryGetRoots();this.workspaceContextKey.workbenchStateContextKey.set(h.length>1?"workspace":"folder"),this.workspaceContextKey.workspaceFolderCountContextKey.set(h.length)};a(),this.workspaceService.onWorkspaceLocationChanged(a)}async onStart(){this.initWorkspaceContextKeys()}registerCommands(a){a.registerCommand(o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER,{execute:async()=>{const h=await this.windowDialogService.showOpenDialog({canSelectFiles:!1,canSelectFolders:!0,canSelectMany:!1});h&&h.length>0&&await this.workspaceService.addRoot(h[0])}}),a.registerCommand(o.WORKSPACE_COMMANDS.SAVE_WORKSPACE_AS_FILE,{execute:async()=>{if(!this.workspaceService.isMultiRootWorkspaceOpened)return;const h=await this.windowDialogService.showSaveDialog({saveLabel:(0,o.localize)("workspace.saveWorkspaceAsFile"),showNameInput:!0,defaultFileName:`workspace.${_.DEFAULT_WORKSPACE_SUFFIX_NAME}`});h&&await this.workspaceService.save(h)}}),a.registerCommand(o.WORKSPACE_COMMANDS.REMOVE_WORKSPACE_FOLDER,{execute:async(h,u)=>{if(!u.length||!this.workspaceService.isMultiRootWorkspaceOpened)return;const c=await this.workspaceService.roots,E=u.filter(f=>c.find(d=>d.uri===f.toString()));E.length>0&&await this.workspaceService.removeRoots(E)}})}onFileServiceReady(){this.workspaceService.init()}};t.WorkspaceContribution=s,n.__decorate([(0,r.Autowired)(_.IWorkspaceService),n.__metadata("design:type",p.WorkspaceService)],s.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(o.CommandRegistry),n.__metadata("design:type",Object)],s.prototype,"commandRegistry",void 0),n.__decorate([(0,r.Autowired)(v.WorkspaceContextKey),n.__metadata("design:type",v.WorkspaceContextKey)],s.prototype,"workspaceContextKey",void 0),n.__decorate([(0,r.Autowired)(l.IWindowDialogService),n.__metadata("design:type",Object)],s.prototype,"windowDialogService",void 0),t.WorkspaceContribution=s=n.__decorate([(0,o.Domain)(o.ClientAppContribution,o.PreferenceContribution,o.FsProviderContribution,o.CommandContribution)],s)},84435:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceData=void 0;const n=e(43718),r={type:"object",properties:{folders:{description:"Root folders in the workspace",type:"array",items:{type:"object",properties:{path:{type:"string"}},required:["path"]}},settings:{description:"Workspace preferences",type:"object"}},required:["folders"]};var o;(function(l){let _;function v(g){if(!_){const a=e(82174);_=new a().compile(r)}return!!_(g)}l.is=v;function m(g,a){let h=[];g.length>0&&(typeof g[0]!="string"?h=g.map(c=>c.uri):h=g);const u={folders:h.map(c=>({path:c}))};return a&&(u.settings=a),u}l.buildWorkspaceData=m;function p(g,a){const h=[],u=new n.URI(a?a.uri:"").withScheme(n.Schemes.file);for(const{path:c}of g.folders){const E=new n.URI(c).withScheme(n.Schemes.file);if(u.parent.isEqualOrParent(E))if(u.parent.isEqual(E))h.push(".");else{const f=u.parent.relative(E);h.push(f.toString()||".")}else h.push(E.toString())}return m(h,g.settings)}l.transformToRelative=p;function s(g,a){if(a){const h=[];for(const u of g.folders){const c=u.path;/^.+:\//.test(c)?h.push(c):c==="."?h.push(new n.URI(a.uri).parent.toString()):h.push(new n.URI(a.uri).parent.resolve(c).toString())}return Object.assign(g,m(h,g.settings))}return g}l.transformToAbsolute=s})(o||(t.WorkspaceData=o={}))},32505:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspacePreferences=t.workspacePreferenceSchema=void 0,t.createWorkspacePreferencesProvider=r,t.injectWorkspacePreferences=o;const n=e(41869);t.workspacePreferenceSchema={type:"object",properties:{"workspace.preserveWindow":{description:"Enable opening workspaces in current window",type:"boolean",default:!1},"workspace.supportMultiRootWorkspace":{description:"Enable multi-root workspace support",type:"boolean",default:!1}}},t.WorkspacePreferences=Symbol("WorkspacePreferences");function r(l){return{token:t.WorkspacePreferences,useFactory:()=>{const _=l.get(n.PreferenceService);return(0,n.createPreferenceProxy)(_,t.workspacePreferenceSchema)}}}function o(l){l.addProviders(r(l))}},99652:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceService=void 0;const n=e(85608),r=n.__importStar(e(23304)),o=e(76003),l=e(41869),_=e(43718),v=e(87863),m=e(14951),p=e(42933),s=e(10560),g=e(84435),a=e(32505),{Path:h}=l.path;let u=class{constructor(){this._roots=[],this.deferredRoots=new l.Deferred,this._whenReady=new l.Deferred,this.toDisposableCollection=new l.DisposableCollection,this.workspaceToName={},this.onWorkspaceChangeEmitter=new l.Emitter,this.onWorkspaceFileExcludeChangeEmitter=new l.Emitter,this.onWorkspaceLocationChangedEmitter=new l.Emitter,this.toDisposeOnWorkspace=new l.DisposableCollection,this.rootWatchers=new Map}get workspaceSuffixName(){return this.appConfig.workspaceSuffixName||s.DEFAULT_WORKSPACE_SUFFIX_NAME}init(){this.doInit()}async initFileServiceExclude(){await this.setFileServiceExcludes()}get whenReady(){return this._whenReady.promise}async doInit(){this.applicationName=this.appConfig.appName;const E=this.getDefaultWorkspacePath();if(this.listenPreference(),E){const f=await this.toFileStat(E);await this.setWorkspace(f),this.toDisposableCollection.push(this.fileServiceClient.onFilesChanged(d=>{this._workspace&&p.FileChangeEvent.isAffected(d,new _.URI(this._workspace.uri))&&this.updateWorkspace()}))}else this.deferredRoots.resolve([]);this._whenReady.resolve()}getTemporaryWorkspaceFileUri(E){return E.resolve(this.appConfig.storageDirName||s.WORKSPACE_USER_STORAGE_FOLDER_NAME).resolve(`${s.UNTITLED_WORKSPACE}.${this.workspaceSuffixName}`).withScheme(_.Schemes.file)}listenPreference(){const E="files.watcherExclude",f="files.exclude",d="workspace.supportMultiRootWorkspace";this.toDisposableCollection.push(this.preferenceService.onPreferenceChanged(y=>{y.preferenceName===E?this.fileServiceClient.setWatchFileExcludes(this.getFlattenExcludes(E)):y.preferenceName===f?this.fileServiceClient.setFilesExcludes(this.getFlattenExcludes(f),this._roots.map(b=>b.uri)).then(()=>{this.onWorkspaceFileExcludeChangeEmitter.fire()}):y.preferenceName===d&&this.updateWorkspace()}))}async setFileServiceExcludes(){const E="files.watcherExclude",f="files.exclude";await this.preferenceService.ready,await this.fileServiceClient.setWatchFileExcludes(this.getFlattenExcludes(E)),await this.fileServiceClient.setFilesExcludes(this.getFlattenExcludes(f),this._roots.map(d=>d.uri)),this.onWorkspaceFileExcludeChangeEmitter.fire()}getFlattenExcludes(E){let f=[];const d=this.preferenceService.get(E);return d&&(f=(0,v.flattenExcludes)(d)),f}getDefaultWorkspacePath(){if(this.appConfig.workspaceDir){let E;try{E=new URL(_.URI.file(this.appConfig.workspaceDir).codeUri.fsPath).toString()}catch{E=_.URI.file(this.appConfig.workspaceDir).toString()}return E}else return}get roots(){return this.deferredRoots.promise}tryGetRoots(){return this._roots}get workspace(){return this._workspace}get onWorkspaceChanged(){return this.onWorkspaceChangeEmitter.event}get onWorkspaceFileExcludeChanged(){return this.onWorkspaceFileExcludeChangeEmitter.event}get onWorkspaceLocationChanged(){return this.onWorkspaceLocationChangedEmitter.event}async setWorkspace(E){if(!m.FileStat.equals(this._workspace,E)){if(this.toDisposeOnWorkspace.dispose(),this._workspace=E,this._workspace){const f=new _.URI(this._workspace.uri);this.fileServiceClient.watchFileChanges(f).then(d=>{this.toDisposeOnWorkspace.push(d)})}this.updateTitle(),await this.updateWorkspace()}}async updateWorkspace(){var E;this._workspace&&(this.toFileStat(this._workspace.uri).then(f=>this._workspace=f),this.setMostRecentlyUsedWorkspace(this._workspace.uri)),await this.updateRoots(),!((E=this._workspace)===null||E===void 0)&&E.isDirectory||this.watchRoots()}async updateRoots(){const E=await this.computeRoots();let f=!1;if(E.length!==this._roots.length||E.length===0)f=!0;else for(const d of E)if(!this._roots.some(y=>y.uri===d.uri)){f=!0;break}f&&(this._roots=E,this.deferredRoots.resolve(this._roots),this.deferredRoots=new l.Deferred,this.deferredRoots.resolve(this._roots),this.onWorkspaceChangeEmitter.fire(this._roots),this.setFileServiceExcludes())}async computeRoots(){const E=[];if(this._workspace){if(this._workspace.isDirectory)return[this._workspace];const f=await this.getWorkspaceDataFromFile();if(f)for(let{path:d}of f.folders){d==="."&&(d=new _.URI(this._workspace.uri).parent.toString());const y=await this.toValidRoot(d);y?E.push(y):E.push({uri:d,lastModification:Date.now(),isDirectory:!0})}}return E}async getWorkspaceDataFromFile(){if(this._workspace&&await this.fileServiceClient.access(this._workspace.uri)){if(this._workspace.isDirectory)return{folders:[{path:this._workspace.uri}]};const{content:E}=await this.fileServiceClient.resolveContent(this._workspace.uri),f=r.stripComments(E),d=r.parse(f);if(d&&g.WorkspaceData.is(d)){const y=await this.fileServiceClient.getFileStat(this._workspace.uri);return g.WorkspaceData.transformToAbsolute(d,y)}this.logger.error(`Unable to retrieve workspace data from the file: '${this._workspace.uri}'. Please check if the file is corrupted.`)}}formatTitle(E){const f=this.applicationName;let d=E?`${E} \u2014 ${f}`:f;return this.appConfig.extensionDevelopmentHost&&(d=`[${(0,_.localize)("workspace.development.title")}] ${d}`),d}updateTitle(){if(!this.appConfig.allowSetDocumentTitleFollowWorkspaceDir)return;let E;if(this._workspace){const d=new _.URI(this._workspace.uri).displayName;!this._workspace.isDirectory&&d.endsWith(`.${this.workspaceSuffixName}`)?E=(0,_.formatLocalize)("file.workspace.defaultWorkspaceTip",d.slice(0,d.lastIndexOf("."))):E=d}document.title=this.formatTitle(E)}async getMostRecentlyUsedWorkspace(){return await this.getGlobalRecentStorage(),(await this.recentGlobalStorage.get("RECENT_WORKSPACES")||[])[0]}async setMostRecentlyUsedWorkspace(E){await this.getGlobalRecentStorage();const f=await this.recentGlobalStorage.get("RECENT_WORKSPACES")||[];f.unshift(E),await this.recentGlobalStorage.set("RECENT_WORKSPACES",Array.from(new Set(f)))}async getMostRecentlyUsedWorkspaces(){return await this.getGlobalRecentStorage(),await this.recentGlobalStorage.get("RECENT_WORKSPACES")||[]}async getMostRecentlyUsedCommands(){return await this.getGlobalRecentStorage(),await this.recentGlobalStorage.get("RECENT_COMMANDS")||[]}async setMostRecentlyUsedCommand(E){await this.getGlobalRecentStorage();const f=await this.recentGlobalStorage.get("RECENT_COMMANDS")||[],d=f.indexOf(E);d>0&&f.splice(d,1),f.unshift(E),await this.recentGlobalStorage.set("RECENT_COMMANDS",f)}async getGlobalRecentStorage(){return this.recentGlobalStorage=this.recentGlobalStorage||await this.storageProvider(_.STORAGE_NAMESPACE.GLOBAL_RECENT_DATA),await this.recentGlobalStorage.whenReady,this.recentGlobalStorage}get opened(){return!!this._workspace}get isMultiRootWorkspaceOpened(){return!!this.workspace&&!this.workspace.isDirectory}get isMultiRootWorkspaceEnabled(){return this.opened&&this.preferences["workspace.supportMultiRootWorkspace"]}async open(E,f){await this.doOpen(E,f)}async doOpen(E,f){const d=E.toString(),y=await this.toFileStat(d);if(y){await this.roots;const{preserveWindow:b}={preserveWindow:this.preferences["workspace.preserveWindow"]||!this.opened,...f};b&&(this._workspace=y),this.openWindow(y,{preserveWindow:b});return}throw new Error("Invalid workspace root URI. Expected an existing directory location.")}async addRoot(E){await this.spliceRoots(this._roots.length,0,{},E)}async removeRoots(E){if(!this.opened)throw new Error("Folder cannot be removed as there is no active folder in the current workspace.");if(this._workspace){const f=await this.getWorkspaceDataFromFile();this._workspace=await this.writeWorkspaceFile(this._workspace,g.WorkspaceData.buildWorkspaceData(this._roots.filter(d=>E.findIndex(y=>y.toString()===d.uri)<0),f.settings))}}async spliceRoots(E,f=0,d={},...y){if(!this._workspace)throw new Error("There is not active workspace");const b=new Set,A=this._roots.map(T=>(b.add(T.uri),T.uri)),S=[];for(const T of Object.keys(d))this.workspaceToName[new _.URI(T).toString()]=d[T];for(const T of y){const R=T.toString();b.has(R)||(b.add(R),S.push(R))}const D=A.splice(E,f||0,...S);if(!D.length&&!S.length)return[];if(this._workspace.isDirectory){const T=await this.getUntitledWorkspace();T&&await this.save(T)}const I=await this.getWorkspaceDataFromFile(),w=g.WorkspaceData.buildWorkspaceData(A,I&&I.settings);return await this.writeWorkspaceFile(this._workspace,w),D.map(T=>new _.URI(T))}getWorkspaceName(E){return this.workspaceToName[E.toString()]||this.workspaceToName[E.toString()+h.separator]||E.displayName}async getUntitledWorkspace(){const E=await this.fileServiceClient.getCurrentUserHome();return E&&this.getTemporaryWorkspaceFileUri(new _.URI(E.uri))}async writeWorkspaceFile(E,f){if(E){const d=JSON.stringify(g.WorkspaceData.transformToRelative(f,E)),y=r.format(d,void 0,{tabSize:2,insertSpaces:!0,eol:""}),b=r.applyEdits(d,y),A=await this.fileServiceClient.setContent(E,b);return A||void 0}}async close(){this._workspace=void 0,this._roots.length=0,this.reloadWindow()}async toValidRoot(E){const f=await this.toFileStat(E);if(f&&f.isDirectory)return f}async toFileStat(E){if(!E)return;let f=E.toString();try{f.endsWith("/")&&(f=f.slice(0,-1));const d=await this.fileServiceClient.getFileStat(f);return d||void 0}catch{return}}openWindow(E,f){const d=new _.URI(E.uri).path.toString();if(this.shouldPreserveWindow(f))this.reloadWindow();else try{this.openNewWindow(d)}catch(y){this._workspace=E,this.logger.error(y.toString())}}reloadWindow(){this.clientApp.fireOnReload(!0)}openNewWindow(E){const f=new URL(window.location.href);f.hash=E,this.windowService.openNewWindow(f.toString())}shouldPreserveWindow(E){return E!==void 0&&!!E.preserveWindow}async containsSome(E){if(await this.roots,this.opened)for(const f of this._roots){const d=new _.URI(f.uri);for(const y of E){const b=d.resolve(y).toString(),A=await this.fileServiceClient.access(b);if(A)return A}}return!1}get saved(){return!!this._workspace&&!this._workspace.isDirectory}async save(E){const f=E instanceof _.URI?E.toString():E.uri;await this.fileServiceClient.access(f)||await this.fileServiceClient.createFile(f);const d={folders:[],settings:{}};if(!this.saved)for(const b of Object.keys(this.schemaProvider.getCombinedSchema().properties)){if(this.schemaProvider.isValidInScope(b,l.PreferenceScope.Folder))continue;const A=this.preferenceService.inspect(b);A&&A.workspaceValue&&(d.settings[b]=A.workspaceValue)}let y=await this.toFileStat(f);Object.assign(d,await this.getWorkspaceDataFromFile()),y=await this.writeWorkspaceFile(y,g.WorkspaceData.buildWorkspaceData(this._roots,d?d.settings:void 0)),await this.setWorkspace(y),this.onWorkspaceLocationChangedEmitter.fire(y)}async watchRoots(){const E=new Set(this._roots.map(f=>f.uri));for(const[f,d]of this.rootWatchers.entries())E.has(f)||d.dispose();for(const f of this._roots)this.watchRoot(f)}async watchRoot(E){const f=E.uri;if(this.rootWatchers.has(f))return;const d=this.fileServiceClient.watchFileChanges(new _.URI(E.uri));this.rootWatchers.set(f,l.Disposable.create(()=>{d.then(y=>y.dispose()),this.rootWatchers.delete(f)}))}getWorkspaceRootUri(E){if(!E||E.scheme!==_.Schemes.file){const d=this.tryGetRoots()[0];return d?new _.URI(d.uri):void 0}const f=[];for(const d of this.tryGetRoots()){const y=new _.URI(d.uri);y&&y.isEqualOrParent(E)&&f.push(y)}return f.sort((d,y)=>y.toString().length-d.toString().length)[0]}async asRelativePath(E,f){let d,y;if(typeof E=="string"?d=E:typeof E<"u"&&(d=E.codeUri.fsPath),!d)return{path:d,root:y};const b=await this.roots;if(f&&this.isMultiRootWorkspaceOpened){const A=await this.workspace;A&&b.push(A)}for(const A of b){const S=new _.URI(A.uri).codeUri.fsPath;if(d&&d.indexOf(S)>=0){y=S,d===S&&(d=""),S.slice(-1)===h.nativeSeparator?d=d.replace(S,""):d=d.replace(S+h.nativeSeparator,"");break}}return{path:decodeURI(d),root:y}}dispose(){this.toDisposableCollection.dispose()}};t.WorkspaceService=u,n.__decorate([(0,o.Autowired)(p.IFileServiceClient),n.__metadata("design:type",Object)],u.prototype,"fileServiceClient",void 0),n.__decorate([(0,o.Autowired)(l.IWindowService),n.__metadata("design:type",Object)],u.prototype,"windowService",void 0),n.__decorate([(0,o.Autowired)(l.ILogger),n.__metadata("design:type",Object)],u.prototype,"logger",void 0),n.__decorate([(0,o.Autowired)(a.WorkspacePreferences),n.__metadata("design:type",Object)],u.prototype,"preferences",void 0),n.__decorate([(0,o.Autowired)(l.PreferenceService),n.__metadata("design:type",Object)],u.prototype,"preferenceService",void 0),n.__decorate([(0,o.Autowired)(l.PreferenceSchemaProvider),n.__metadata("design:type",l.PreferenceSchemaProvider)],u.prototype,"schemaProvider",void 0),n.__decorate([(0,o.Autowired)(l.AppConfig),n.__metadata("design:type",Object)],u.prototype,"appConfig",void 0),n.__decorate([(0,o.Autowired)(_.StorageProvider),n.__metadata("design:type",Function)],u.prototype,"storageProvider",void 0),n.__decorate([(0,o.Autowired)(l.IClientApp),n.__metadata("design:type",Object)],u.prototype,"clientApp",void 0),t.WorkspaceService=u=n.__decorate([(0,o.Injectable)()],u)},91600:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceStorageService=void 0;const n=e(85608),r=e(76003),o=e(26542),l=e(10560);let _=class{constructor(){this.init()}init(){this.initialized=this.workspaceService.roots.then(()=>{this.updatePrefix(),this.workspaceService.onWorkspaceLocationChanged(()=>this.updatePrefix())})}async setData(m,p){this.prefix||await this.initialized;const s=this.prefixWorkspaceURI(m);return this.globalStorageService.setData(s,p)}async getData(m,p){await this.initialized;const s=this.prefixWorkspaceURI(m);return this.globalStorageService.getData(s,p)}async removeData(m){await this.initialized;const p=this.prefixWorkspaceURI(m);return this.globalStorageService.removeData(p)}prefixWorkspaceURI(m){return`${this.prefix}:${m}`}getPrefix(m){return m?m.uri:"_global_"}updatePrefix(){this.prefix=this.getPrefix(this.workspaceService.workspace)}};t.WorkspaceStorageService=_,n.__decorate([(0,r.Autowired)(o.GlobalBrowserStorageService),n.__metadata("design:type",o.GlobalBrowserStorageService)],_.prototype,"globalStorageService",void 0),n.__decorate([(0,r.Autowired)(l.IWorkspaceService),n.__metadata("design:type",Object)],_.prototype,"workspaceService",void 0),t.WorkspaceStorageService=_=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],_)},68810:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceVariableContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(10560);let _=class{registerVariables(m){m.registerVariable({name:"workspaceRoot",description:"The path of the workspace root folder",resolve:p=>{const s=this.getWorkspaceRootUri(p);return s&&s.path.toString()}}),m.registerVariable({name:"workspaceFolder",description:"The path of the workspace root folder",resolve:p=>{const s=this.getWorkspaceRootUri(p);return s&&s.codeUri.fsPath.toString()}}),m.registerVariable({name:"workspaceFolderBasename",description:"The name of the workspace root folder",resolve:p=>{const s=this.getWorkspaceRootUri(p);return s&&s.displayName}}),m.registerVariable({name:"cwd",description:"The path of the current working directory",resolve:p=>{const s=this.getWorkspaceRootUri(p);return s&&s.codeUri.fsPath.toString()||""}}),m.registerVariable({name:"file",description:"The path of the currently opened file",resolve:async()=>{const p=await this.getResourceUri();return p&&p.codeUri.fsPath.toString()}}),m.registerVariable({name:"fileBasename",description:"The basename of the currently opened file",resolve:async()=>{const p=await this.getResourceUri();return p&&p.path.base}}),m.registerVariable({name:"fileBasenameNoExtension",description:"The currently opened file's name without extension",resolve:async()=>{const p=await this.getResourceUri();return p&&p.path.name}}),m.registerVariable({name:"fileDirname",description:"The name of the currently opened file's directory",resolve:async()=>{const p=await this.getResourceUri();return p&&p.path.dir.toString()}}),m.registerVariable({name:"fileExtname",description:"The extension of the currently opened file",resolve:async()=>{const p=await this.getResourceUri();return p&&p.path.ext}}),m.registerVariable({name:"relativeFile",description:"The currently opened file's path relative to the workspace root",resolve:async()=>{const p=await this.getResourceUri();return p&&this.getWorkspaceRelativePath(p)}}),m.registerVariable({name:"env",resolve:async()=>await this.commandService.executeCommand(o.COMMON_COMMANDS.ENVIRONMENT_VARIABLE.id)})}getWorkspaceRootUri(m){return this.workspaceService.getWorkspaceRootUri(m)}async getResourceUri(){const m=await this.commandService.executeCommand(o.EDITOR_COMMANDS.GET_CURRENT_RESOURCE.id);if(m)return m.uri}getWorkspaceRelativePath(m){const p=this.getWorkspaceRootUri(m),s=p&&p.path.relative(m.path);return s&&s.toString()}};t.WorkspaceVariableContribution=_,n.__decorate([(0,r.Autowired)(l.IWorkspaceService),n.__metadata("design:type",Object)],_.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],_.prototype,"commandService",void 0),t.WorkspaceVariableContribution=_=n.__decorate([(0,o.Domain)(o.VariableContribution)],_)},21141:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UNTITLED_WORKSPACE=t.WORKSPACE_RECENT_DATA_FILE=t.WORKSPACE_USER_STORAGE_FOLDER_NAME=t.DEFAULT_WORKSPACE_SUFFIX_NAME=void 0,t.DEFAULT_WORKSPACE_SUFFIX_NAME="sumi-workspace",t.WORKSPACE_USER_STORAGE_FOLDER_NAME=".sumi",t.WORKSPACE_RECENT_DATA_FILE="recentdata.json",t.UNTITLED_WORKSPACE="Untitled"},10560:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(21141),t),n.__exportStar(e(97408),t)},97408:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IWorkspaceStorageService=t.IWorkspaceService=void 0,t.IWorkspaceService=Symbol("IWorkspaceService"),t.IWorkspaceStorageService=Symbol("IWorkspaceStorageService")},51500:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(10560),t)},6795:P=>{"use strict";P.exports="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20standalone%3D%22no%22%3F%3E%3C%21DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20t%3D%221577347211912%22%20class%3D%22icon%22%20viewBox%3D%220%200%201024%201024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20p-id%3D%228639%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22200%22%20height%3D%22200%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cpath%20d%3D%22M550%20192a8%208%200%200%201%208%208v232.325l201.2-116.162a8%208%200%200%201%2010.928%202.928l38%2065.818a8%208%200%200%201-2.928%2010.928L604%20512l201.2%20116.163a8%208%200%200%201%203.056%2010.697l-0.128%200.231-38%2065.818a8%208%200%200%201-10.928%202.928L558%20591.674V824a8%208%200%200%201-8%208h-76a8%208%200%200%201-8-8V591.674L264.8%20707.837a8%208%200%200%201-10.928-2.928l-38-65.818a8%208%200%200%201%202.928-10.928L420%20511.999%20218.8%20395.837a8%208%200%200%201-3.056-10.697l0.128-0.231%2038-65.818a8%208%200%200%201%2010.928-2.928L466%20432.325V200a8%208%200%200%201%208-8h76z%22%20p-id%3D%228640%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E"},57369:P=>{"use strict";P.exports="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20standalone%3D%22no%22%3F%3E%3C%21DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20t%3D%221577347219862%22%20class%3D%22icon%22%20viewBox%3D%220%200%201024%201024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20p-id%3D%228759%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22200%22%20height%3D%22200%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cpath%20d%3D%22M350.938%20158c2.003%200%204.005%200.802%205.507%202.205l117.456%20112.452h408.477c17.724%200%2032.043%2014.333%2032.043%2032.072L914.42%20384h-72.095v-39.18H444.963L325.204%20230.161h-188.75v529.676L448%20759.837V832H96.4c-17.546%200-31.755-14.047-32.038-31.54l-0.004-0.532V190.072C64.358%20172.332%2078.677%20158%2096.4%20158z%22%20p-id%3D%228760%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M771.991%20416a8%208%200%200%201%208%208v161.646l139.99-80.823a8%208%200%200%201%2010.928%202.928l28%2048.498a8%208%200%200%201-2.928%2010.928l-139.992%2080.822%20139.992%2080.824a8%208%200%200%201%203.056%2010.697l-0.128%200.231-28%2048.498a8%208%200%200%201-10.697%203.056l-0.231-0.128-139.99-80.824V872a8%208%200%200%201-8%208h-56a8%208%200%200%201-8-8V710.353l-139.99%2080.824a8%208%200%200%201-10.928-2.928l-28-48.498a8%208%200%200%201%202.928-10.928L671.991%20648l-139.99-80.822a8%208%200%200%201-3.056-10.697l0.128-0.231%2028-48.498a8%208%200%200%201%2010.698-3.056l0.23%200.128%20139.99%2080.823V424a8%208%200%200%201%208-8h56z%22%20p-id%3D%228761%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E"},5303:P=>{"use strict";P.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4="},61986:(P,t,e)=>{"use strict";P.exports=e.p+"images/loading-dark.svg"},34397:(P,t,e)=>{"use strict";P.exports=e.p+"images/loading-hc.svg"},52113:(P,t,e)=>{"use strict";P.exports=e.p+"images/loading.svg"},70831:(P,t,e)=>{"use strict";P.exports=e.p+"images/background-logo-icon.svg"},19905:(P,t,e)=>{"use strict";P.exports=e.p+"images/loading-dark.svg"},93618:(P,t,e)=>{"use strict";P.exports=e.p+"images/loading-hc.svg"},62556:(P,t,e)=>{"use strict";P.exports=e.p+"images/loading.svg"},36480:(P,t,e)=>{"use strict";P.exports=e.p+"images/boolean-dark.svg"},59376:(P,t,e)=>{"use strict";P.exports=e.p+"images/boolean-light.svg"},63695:(P,t,e)=>{"use strict";P.exports=e.p+"images/class-dark.svg"},55028:(P,t,e)=>{"use strict";P.exports=e.p+"images/class-light.svg"},50678:(P,t,e)=>{"use strict";P.exports=e.p+"images/constant-dark.svg"},11238:(P,t,e)=>{"use strict";P.exports=e.p+"images/constant-light.svg"},42100:(P,t,e)=>{"use strict";P.exports=e.p+"images/enumerator-dark.svg"},88814:(P,t,e)=>{"use strict";P.exports=e.p+"images/enumerator-item-dark.svg"},47150:(P,t,e)=>{"use strict";P.exports=e.p+"images/enumerator-item-light.svg"},71644:(P,t,e)=>{"use strict";P.exports=e.p+"images/enumerator-light.svg"},87136:(P,t,e)=>{"use strict";P.exports=e.p+"images/event-dark.svg"},92016:(P,t,e)=>{"use strict";P.exports=e.p+"images/event-light.svg"},74820:(P,t,e)=>{"use strict";P.exports=e.p+"images/field-dark.svg"},36364:(P,t,e)=>{"use strict";P.exports=e.p+"images/field-light.svg"},28327:(P,t,e)=>{"use strict";P.exports=e.p+"images/file-dark.svg"},15868:(P,t,e)=>{"use strict";P.exports=e.p+"images/file-light.svg"},85887:(P,t,e)=>{"use strict";P.exports=e.p+"images/indexer-dark.svg"},84029:(P,t,e)=>{"use strict";P.exports=e.p+"images/indexer-light.svg"},44687:(P,t,e)=>{"use strict";P.exports=e.p+"images/interface-dark.svg"},89581:(P,t,e)=>{"use strict";P.exports=e.p+"images/interface-light.svg"},29731:(P,t,e)=>{"use strict";P.exports=e.p+"images/keyword-dark.svg"},88457:(P,t,e)=>{"use strict";P.exports=e.p+"images/keyword-light.svg"},41199:(P,t,e)=>{"use strict";P.exports=e.p+"images/method-dark.svg"},83930:(P,t,e)=>{"use strict";P.exports=e.p+"images/method-light.svg"},60131:(P,t,e)=>{"use strict";P.exports=e.p+"images/namespace-dark.svg"},51593:(P,t,e)=>{"use strict";P.exports=e.p+"images/namespace-light.svg"},79507:(P,t,e)=>{"use strict";P.exports=e.p+"images/numeric-dark.svg"},32025:(P,t,e)=>{"use strict";P.exports=e.p+"images/numeric-light.svg"},58541:(P,t,e)=>{"use strict";P.exports=e.p+"images/operator-dark.svg"},30146:(P,t,e)=>{"use strict";P.exports=e.p+"images/operator-light.svg"},94439:(P,t,e)=>{"use strict";P.exports=e.p+"images/property-dark.svg"},71637:(P,t,e)=>{"use strict";P.exports=e.p+"images/property-light.svg"},30077:(P,t,e)=>{"use strict";P.exports=e.p+"images/snippet-dark.svg"},41355:(P,t,e)=>{"use strict";P.exports=e.p+"images/snippet-light.svg"},21851:(P,t,e)=>{"use strict";P.exports=e.p+"images/string-dark.svg"},37969:(P,t,e)=>{"use strict";P.exports=e.p+"images/string-light.svg"},14845:(P,t,e)=>{"use strict";P.exports=e.p+"images/structure-dark.svg"},84747:(P,t,e)=>{"use strict";P.exports=e.p+"images/structure-light.svg"},47680:(P,t,e)=>{"use strict";P.exports=e.p+"images/template-dark.svg"},61360:(P,t,e)=>{"use strict";P.exports=e.p+"images/template-light.svg"},96766:(P,t,e)=>{"use strict";P.exports=e.p+"images/variable-dark.svg"},48798:(P,t,e)=>{"use strict";P.exports=e.p+"images/variable-light.svg"},40194:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint-conditional-disabled.svg"},4887:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint-conditional-unverified.svg"},2437:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint-conditional.svg"},13395:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint-disabled.svg"},35596:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint-hint.svg"},576:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint-log-disabled.svg"},75461:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint-log-unverified.svg"},57823:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint-log.svg"},96340:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint-unsupported.svg"},63754:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint-unverified.svg"},31562:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint.svg"},7030:(P,t,e)=>{"use strict";P.exports=e.p+"images/current-and-breakpoint.svg"},57394:(P,t,e)=>{"use strict";P.exports=e.p+"images/current-arrow.svg"},27144:(P,t,e)=>{"use strict";P.exports=e.p+"images/stackframe-and-breakpoint.svg"},57152:(P,t,e)=>{"use strict";P.exports=e.p+"images/stackframe-arrow.svg"},52151:(P,t,e)=>{"use strict";P.exports=e.p+"images/logo.svg"},11514:(P,t,e)=>{"use strict";P.exports=e.p+"fd3be59fe5f76327c48f.png"},3188:(P,t,e)=>{"use strict";P.exports=e.p+"f86e6127667de32bbd4f.png"},82840:()=>{},3431:()=>{},83078:()=>{},84142:()=>{},64756:()=>{},49156:()=>{},66442:P=>{function t(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,o=new Array(n);r<n;r++)o[r]=e[r];return o}P.exports=t,P.exports.__esModule=!0,P.exports.default=P.exports},3634:P=>{function t(e){if(Array.isArray(e))return e}P.exports=t,P.exports.__esModule=!0,P.exports.default=P.exports},58212:(P,t,e)=>{var n=e(56347);function r(o,l,_){return l=n(l),l in o?Object.defineProperty(o,l,{value:_,enumerable:!0,configurable:!0,writable:!0}):o[l]=_,o}P.exports=r,P.exports.__esModule=!0,P.exports.default=P.exports},4293:P=>{function t(e){return e&&e.__esModule?e:{default:e}}P.exports=t,P.exports.__esModule=!0,P.exports.default=P.exports},96525:P=>{function t(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var o,l,_,v,m=[],p=!0,s=!1;try{if(_=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;p=!1}else for(;!(p=(o=_.call(r)).done)&&(m.push(o.value),m.length!==n);p=!0);}catch(g){s=!0,l=g}finally{try{if(!p&&r.return!=null&&(v=r.return(),Object(v)!==v))return}finally{if(s)throw l}}return m}}P.exports=t,P.exports.__esModule=!0,P.exports.default=P.exports},5523:P=>{function t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
33898
+ `,S.pushStackElement()),await this.editorOperation(y)&&A.save(),b.dispose()}async editorOperation(d){if(this.options.openDirtyInEditor){for(const y of d.editorGroups)if(y.resources.findIndex(b=>E(b,this.resource))!==-1)return!1;return d.open(this.resource,{backend:!0}),!1}else if(this.options.dirtyIfInEditor){for(const y of d.editorGroups)if(y.resources.findIndex(b=>E(b,this.resource))!==-1)return!1}return!0}async revert(){}}t.ResourceTextEditTask=h;class u{constructor(d){this.options={},this.oldResource=d.oldResource,this.newResource=d.newResource,this.options=d.options}async notifyEditor(d,y){if(this.oldResource&&this.newResource){const b=[],A=new Set;return d.editorGroups.forEach(S=>{S.resources.forEach(D=>{this.oldResource.isEqualOrParent(D.uri)&&A.add(D.uri.toString())})}),A.forEach(S=>{const D=new o.URI(S),I=S.substr(this.oldResource.toString().length),w=new o.URI(this.newResource.toString()+I);b.push(this.notifyOnResource(D,w,d,y))}),Promise.all(b)}}async notifyOnResource(d,y,b,A){const S=A.getModelReference(d,"bulk-file-move");let D,I;if(S&&S.instance.dirty&&(D=S.instance.getText(),I=S.instance.eol,await S.instance.revert(!0)),S&&S.dispose(),await Promise.all([b.editorGroups.map(async w=>{const T=w.resources.findIndex(R=>R.uri.isEqual(d));T!==-1&&(0,o.runWhenIdle)(async()=>{await w.open(y,{index:T,backend:!(w.currentResource&&w.currentResource.uri.isEqual(d)),preview:w.previewURI?w.previewURI.isEqual(d):!1}),await w.close(d)})})]),D){const w=await A.createModelReference(y,"bulk-file-move");w.instance.updateContent(D,I),w.dispose()}}async apply(d,y,b,A){const S=this.options||{};if(this.newResource&&this.oldResource)S.copy?await b.copy([{source:this.oldResource.codeUri,target:this.newResource.codeUri}],S):(await b.move([{source:this.oldResource.codeUri,target:this.newResource.codeUri}],S),await this.notifyEditor(y,d),A.fire(new s.WorkspaceEditDidRenameFileEvent({oldUri:this.oldResource,newUri:this.newResource}))),S.showInEditor&&y.open(this.newResource);else if(!this.newResource&&this.oldResource)try{await b.delete([this.oldResource],{useTrash:!(o.isWindows&&this.oldResource.path.name==="node_modules")}),await y.close(this.oldResource,!0),A.fire(new s.WorkspaceEditDidDeleteFileEvent({oldUri:this.oldResource}))}catch(D){if(!(v.FileSystemError.FileNotFound.is(D)&&S.ignoreIfNotExists))throw D}else if(this.newResource&&!this.oldResource){try{S.isDirectory?await b.createFolder(this.newResource):await b.create(this.newResource,S.content||"",{overwrite:S.overwrite})}catch(D){if(!(v.FileSystemError.FileExists.is(D)&&S.ignoreIfExists))throw D}!S.isDirectory&&S.showInEditor&&y.open(this.newResource)}}async revert(){}}t.ResourceFileEdit=u;function c(f){return!!f.newResource||!!f.oldResource}function E(f,d){var y,b;return(0,_.isDiffResource)(f)?((y=f.metadata)===null||y===void 0?void 0:y.modified.isEqual(d))||((b=f.metadata)===null||b===void 0?void 0:b.original.isEqual(d)):f.uri.isEqual(d)}},17341:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceFileService=t.WorkspaceFileOperationParticipant=void 0;const n=e(85608),r=e(76003),o=e(68969),l=e(43718),_=e(14951),v=e(26199);let m=class extends l.Disposable{constructor(){super(...arguments),this.participants=[]}registerParticipant(g){return this.participants.push(g),{dispose:()=>{const a=this.participants.findIndex(h=>h===g);this.participants.splice(a,1)}}}async participate(g,a){const h=new l.CancellationTokenSource;for(const u of this.participants){if(h.token.isCancellationRequested)break;try{await u.participate(g,a,void 0,v.FILE_OPERATION_TIMEOUT,h.token)}catch(c){(0,l.getDebugLogger)().error(c)}}}dispose(){this.participants.splice(0,this.participants.length)}};t.WorkspaceFileOperationParticipant=m,n.__decorate([(0,r.Autowired)(o.IProgressService),n.__metadata("design:type",Object)],m.prototype,"progressService",void 0),t.WorkspaceFileOperationParticipant=m=n.__decorate([(0,r.Injectable)()],m);let p=class{constructor(){this.correlationIds=0,this._onWillRunWorkspaceFileOperation=new l.AsyncEmitter,this.onWillRunWorkspaceFileOperation=this._onWillRunWorkspaceFileOperation.event,this._onDidFailWorkspaceFileOperation=new l.AsyncEmitter,this.onDidFailWorkspaceFileOperation=this._onDidFailWorkspaceFileOperation.event,this._onDidRunWorkspaceFileOperation=new l.AsyncEmitter,this.onDidRunWorkspaceFileOperation=this._onDidRunWorkspaceFileOperation.event}create(g,a,h){return this.doCreate(g,!0,a,h)}createFolder(g){return this.doCreate(g,!1)}move(g,a){return this.doMoveOrCopy(g,!0,a)}copy(g,a){return this.doMoveOrCopy(g,!1,a)}async delete(g,a){const h=g.map(c=>({target:c.codeUri}));await this.runOperationParticipant(h,1);const u={correlationId:this.correlationIds++,operation:1,files:h};await this._onWillRunWorkspaceFileOperation.fireAsync(u,l.CancellationToken.None);try{for(const c of g)await this.fileService.delete(c.toString(),{moveToTrash:a?.useTrash})}catch(c){throw await this._onDidFailWorkspaceFileOperation.fireAsync(u,l.CancellationToken.None),c}await this._onDidRunWorkspaceFileOperation.fireAsync(u,l.CancellationToken.None)}registerFileOperationParticipant(g){return this.fileOperationParticipants.registerParticipant(g)}runOperationParticipant(g,a){return this.fileOperationParticipants.participate(g,a)}async doMoveOrCopy(g,a,h){const u=h?.overwrite,c=[];await this.runOperationParticipant(g,a?2:3);const E={correlationId:this.correlationIds++,operation:a?2:3,files:g};await this._onWillRunWorkspaceFileOperation.fireAsync(E,l.CancellationToken.None);try{for(const{source:f,target:d}of g)a?c.push(await this.fileService.move(f.toString(),d.toString(),{overwrite:u})):c.push(await this.fileService.copy(f.toString(),d.toString(),{overwrite:u}))}catch(f){throw await this._onDidFailWorkspaceFileOperation.fireAsync(E,l.CancellationToken.None),f}return await this._onDidRunWorkspaceFileOperation.fireAsync(E,l.CancellationToken.None),c}async doCreate(g,a,h,u){await this.runOperationParticipant([{target:g.codeUri}],0);const c={correlationId:this.correlationIds++,operation:0,files:[{target:g.codeUri}]};await this._onWillRunWorkspaceFileOperation.fireAsync(c,l.CancellationToken.None);let E;try{a?E=await this.fileService.createFile(g.toString(),{overwrite:u?.overwrite,content:h}):E=await this.fileService.createFolder(g.toString())}catch(f){throw await this._onDidFailWorkspaceFileOperation.fireAsync(c,l.CancellationToken.None),f}return await this._onDidRunWorkspaceFileOperation.fireAsync(c,l.CancellationToken.None),E}};t.WorkspaceFileService=p,n.__decorate([(0,r.Autowired)(_.IFileServiceClient),n.__metadata("design:type",Object)],p.prototype,"fileService",void 0),n.__decorate([(0,r.Autowired)(m),n.__metadata("design:type",m)],p.prototype,"fileOperationParticipants",void 0),t.WorkspaceFileService=p=n.__decorate([(0,r.Injectable)()],p)},36005:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceEditDidDeleteFileEvent=t.WorkspaceEditDidRenameFileEvent=t.FILE_OPERATION_TIMEOUT=t.IBulkEditServiceShape=t.IWorkspaceFileService=t.IWorkspaceEditService=void 0;const n=e(43718);t.IWorkspaceEditService=Symbol("IWorkspaceEditService"),t.IWorkspaceFileService=Symbol("IWorkspaceFileService"),t.IBulkEditServiceShape=Symbol("IBulkEditServiceShape"),t.FILE_OPERATION_TIMEOUT=5e3;class r extends n.BasicEvent{}t.WorkspaceEditDidRenameFileEvent=r;class o extends n.BasicEvent{}t.WorkspaceEditDidDeleteFileEvent=o},26199:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(36005),t),n.__exportStar(e(7284),t)},41103:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceModule=void 0;const n=e(85608),r=e(41869),o=e(10560),l=e(28929),_=e(32505),v=e(99652),m=e(91600),p=e(68810),s=e(48955);let g=class extends r.BrowserModule{constructor(){super(...arguments),this.providers=[{token:o.IWorkspaceService,useClass:v.WorkspaceService},{token:o.IWorkspaceStorageService,useClass:m.WorkspaceStorageService},l.WorkspaceContribution,p.WorkspaceVariableContribution],this.preferences=_.injectWorkspacePreferences}};t.WorkspaceModule=g,t.WorkspaceModule=g=n.__decorate([(0,r.Domain)(s.name)],g)},68905:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceContextKey=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(66e3);let _=class{constructor(m){m=m||this.globalContextKeyService,this.workbenchStateContextKey=l.WorkbenchState.bind(m),this.workspaceFolderCountContextKey=l.WorkspaceFolderCount.bind(m),this.workspaceTrustedContextKey=l.WorkspaceTrusted.bind(m),this.virtualWorkspaceContextKey=l.VirtualWorkspace.bind(m)}};t.WorkspaceContextKey=_,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],_.prototype,"globalContextKeyService",void 0),t.WorkspaceContextKey=_=n.__decorate([(0,r.Injectable)(),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[Object])],_)},28929:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(72665),_=e(10560),v=e(68905),m=e(32505),p=e(99652);let s=class{constructor(){this.schema=m.workspacePreferenceSchema}async initWorkspaceContextKeys(){await this.workspaceService.whenReady;const a=()=>{const h=this.workspaceService.tryGetRoots();this.workspaceContextKey.workbenchStateContextKey.set(h.length>1?"workspace":"folder"),this.workspaceContextKey.workspaceFolderCountContextKey.set(h.length)};a(),this.workspaceService.onWorkspaceLocationChanged(a)}async onStart(){this.initWorkspaceContextKeys()}registerCommands(a){a.registerCommand(o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER,{execute:async()=>{const h=await this.windowDialogService.showOpenDialog({canSelectFiles:!1,canSelectFolders:!0,canSelectMany:!1});h&&h.length>0&&await this.workspaceService.addRoot(h[0])}}),a.registerCommand(o.WORKSPACE_COMMANDS.SAVE_WORKSPACE_AS_FILE,{execute:async()=>{if(!this.workspaceService.isMultiRootWorkspaceOpened)return;const h=await this.windowDialogService.showSaveDialog({saveLabel:(0,o.localize)("workspace.saveWorkspaceAsFile"),showNameInput:!0,defaultFileName:`workspace.${_.DEFAULT_WORKSPACE_SUFFIX_NAME}`});h&&await this.workspaceService.save(h)}}),a.registerCommand(o.WORKSPACE_COMMANDS.REMOVE_WORKSPACE_FOLDER,{execute:async(h,u)=>{if(!u.length||!this.workspaceService.isMultiRootWorkspaceOpened)return;const c=await this.workspaceService.roots,E=u.filter(f=>c.find(d=>d.uri===f.toString()));E.length>0&&await this.workspaceService.removeRoots(E)}})}onFileServiceReady(){this.workspaceService.init()}};t.WorkspaceContribution=s,n.__decorate([(0,r.Autowired)(_.IWorkspaceService),n.__metadata("design:type",p.WorkspaceService)],s.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(o.CommandRegistry),n.__metadata("design:type",Object)],s.prototype,"commandRegistry",void 0),n.__decorate([(0,r.Autowired)(v.WorkspaceContextKey),n.__metadata("design:type",v.WorkspaceContextKey)],s.prototype,"workspaceContextKey",void 0),n.__decorate([(0,r.Autowired)(l.IWindowDialogService),n.__metadata("design:type",Object)],s.prototype,"windowDialogService",void 0),t.WorkspaceContribution=s=n.__decorate([(0,o.Domain)(o.ClientAppContribution,o.PreferenceContribution,o.FsProviderContribution,o.CommandContribution)],s)},84435:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceData=void 0;const n=e(43718),r={type:"object",properties:{folders:{description:"Root folders in the workspace",type:"array",items:{type:"object",properties:{path:{type:"string"}},required:["path"]}},settings:{description:"Workspace preferences",type:"object"}},required:["folders"]};var o;(function(l){let _;function v(g){if(!_){const a=e(82174);_=new a().compile(r)}return!!_(g)}l.is=v;function m(g,a){let h=[];g.length>0&&(typeof g[0]!="string"?h=g.map(c=>c.uri):h=g);const u={folders:h.map(c=>({path:c}))};return a&&(u.settings=a),u}l.buildWorkspaceData=m;function p(g,a){const h=[],u=new n.URI(a?a.uri:"").withScheme(n.Schemes.file);for(const{path:c}of g.folders){const E=new n.URI(c).withScheme(n.Schemes.file);if(u.parent.isEqualOrParent(E))if(u.parent.isEqual(E))h.push(".");else{const f=u.parent.relative(E);h.push(f.toString()||".")}else h.push(E.toString())}return m(h,g.settings)}l.transformToRelative=p;function s(g,a){if(a){const h=[];for(const u of g.folders){const c=u.path;/^.+:\//.test(c)?h.push(c):c==="."?h.push(new n.URI(a.uri).parent.toString()):h.push(new n.URI(a.uri).parent.resolve(c).toString())}return Object.assign(g,m(h,g.settings))}return g}l.transformToAbsolute=s})(o||(t.WorkspaceData=o={}))},32505:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspacePreferences=t.workspacePreferenceSchema=void 0,t.createWorkspacePreferencesProvider=r,t.injectWorkspacePreferences=o;const n=e(41869);t.workspacePreferenceSchema={type:"object",properties:{"workspace.preserveWindow":{description:"Enable opening workspaces in current window",type:"boolean",default:!1},"workspace.supportMultiRootWorkspace":{description:"Enable multi-root workspace support",type:"boolean",default:!1}}},t.WorkspacePreferences=Symbol("WorkspacePreferences");function r(l){return{token:t.WorkspacePreferences,useFactory:()=>{const _=l.get(n.PreferenceService);return(0,n.createPreferenceProxy)(_,t.workspacePreferenceSchema)}}}function o(l){l.addProviders(r(l))}},99652:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceService=void 0;const n=e(85608),r=n.__importStar(e(23304)),o=e(76003),l=e(41869),_=e(43718),v=e(87863),m=e(14951),p=e(42933),s=e(10560),g=e(84435),a=e(32505),{Path:h}=l.path;let u=class{constructor(){this._roots=[],this.deferredRoots=new l.Deferred,this._whenReady=new l.Deferred,this.toDisposableCollection=new l.DisposableCollection,this.workspaceToName={},this.onWorkspaceChangeEmitter=new l.Emitter,this.onWorkspaceFileExcludeChangeEmitter=new l.Emitter,this.onWorkspaceLocationChangedEmitter=new l.Emitter,this.toDisposeOnWorkspace=new l.DisposableCollection,this.rootWatchers=new Map}get workspaceSuffixName(){return this.appConfig.workspaceSuffixName||s.DEFAULT_WORKSPACE_SUFFIX_NAME}init(){this.doInit()}async initFileServiceExclude(){await this.setFileServiceExcludes()}get whenReady(){return this._whenReady.promise}async doInit(){this.applicationName=this.appConfig.appName;const E=this.getDefaultWorkspacePath();if(this.listenPreference(),E){const f=await this.toFileStat(E);await this.setWorkspace(f),this.toDisposableCollection.push(this.fileServiceClient.onFilesChanged(d=>{this._workspace&&p.FileChangeEvent.isAffected(d,new _.URI(this._workspace.uri))&&this.updateWorkspace()}))}else this.deferredRoots.resolve([]);this._whenReady.resolve()}getTemporaryWorkspaceFileUri(E){return E.resolve(this.appConfig.storageDirName||s.WORKSPACE_USER_STORAGE_FOLDER_NAME).resolve(`${s.UNTITLED_WORKSPACE}.${this.workspaceSuffixName}`).withScheme(_.Schemes.file)}listenPreference(){const E="files.watcherExclude",f="files.exclude",d="workspace.supportMultiRootWorkspace";this.toDisposableCollection.push(this.preferenceService.onPreferenceChanged(y=>{y.preferenceName===E?this.fileServiceClient.setWatchFileExcludes(this.getFlattenExcludes(E)):y.preferenceName===f?this.fileServiceClient.setFilesExcludes(this.getFlattenExcludes(f),this._roots.map(b=>b.uri)).then(()=>{this.onWorkspaceFileExcludeChangeEmitter.fire()}):y.preferenceName===d&&this.updateWorkspace()}))}async setFileServiceExcludes(){const E="files.watcherExclude",f="files.exclude";await this.preferenceService.ready,await this.fileServiceClient.setWatchFileExcludes(this.getFlattenExcludes(E)),await this.fileServiceClient.setFilesExcludes(this.getFlattenExcludes(f),this._roots.map(d=>d.uri)),this.onWorkspaceFileExcludeChangeEmitter.fire()}getFlattenExcludes(E){let f=[];const d=this.preferenceService.get(E);return d&&(f=(0,v.flattenExcludes)(d)),f}getDefaultWorkspacePath(){if(this.appConfig.workspaceDir){let E;try{E=new URL(_.URI.file(this.appConfig.workspaceDir).codeUri.fsPath).toString()}catch{E=_.URI.file(this.appConfig.workspaceDir).toString()}return E}else return}get roots(){return this.deferredRoots.promise}tryGetRoots(){return this._roots}get workspace(){return this._workspace}get onWorkspaceChanged(){return this.onWorkspaceChangeEmitter.event}get onWorkspaceFileExcludeChanged(){return this.onWorkspaceFileExcludeChangeEmitter.event}get onWorkspaceLocationChanged(){return this.onWorkspaceLocationChangedEmitter.event}async setWorkspace(E){if(!m.FileStat.equals(this._workspace,E)){if(this.toDisposeOnWorkspace.dispose(),this._workspace=E,this._workspace){const f=new _.URI(this._workspace.uri);this.fileServiceClient.watchFileChanges(f).then(d=>{this.toDisposeOnWorkspace.push(d)})}this.updateTitle(),await this.updateWorkspace()}}async updateWorkspace(){var E;this._workspace&&(this.toFileStat(this._workspace.uri).then(f=>this._workspace=f),this.setMostRecentlyUsedWorkspace(this._workspace.uri)),await this.updateRoots(),!((E=this._workspace)===null||E===void 0)&&E.isDirectory||this.watchRoots()}async updateRoots(){const E=await this.computeRoots();let f=!1;if(E.length!==this._roots.length||E.length===0)f=!0;else for(const d of E)if(!this._roots.some(y=>y.uri===d.uri)){f=!0;break}f&&(this._roots=E,this.deferredRoots.resolve(this._roots),this.deferredRoots=new l.Deferred,this.deferredRoots.resolve(this._roots),this.onWorkspaceChangeEmitter.fire(this._roots),this.setFileServiceExcludes())}async computeRoots(){const E=[];if(this._workspace){if(this._workspace.isDirectory)return[this._workspace];const f=await this.getWorkspaceDataFromFile();if(f)for(let{path:d}of f.folders){d==="."&&(d=new _.URI(this._workspace.uri).parent.toString());const y=await this.toValidRoot(d);y?E.push(y):E.push({uri:d,lastModification:Date.now(),isDirectory:!0})}}return E}async getWorkspaceDataFromFile(){if(this._workspace&&await this.fileServiceClient.access(this._workspace.uri)){if(this._workspace.isDirectory)return{folders:[{path:this._workspace.uri}]};const{content:E}=await this.fileServiceClient.resolveContent(this._workspace.uri),f=r.stripComments(E),d=r.parse(f);if(d&&g.WorkspaceData.is(d)){const y=await this.fileServiceClient.getFileStat(this._workspace.uri);return g.WorkspaceData.transformToAbsolute(d,y)}this.logger.error(`Unable to retrieve workspace data from the file: '${this._workspace.uri}'. Please check if the file is corrupted.`)}}formatTitle(E){const f=this.applicationName;let d=E?`${E} \u2014 ${f}`:f;return this.appConfig.extensionDevelopmentHost&&(d=`[${(0,_.localize)("workspace.development.title")}] ${d}`),d}updateTitle(){if(!this.appConfig.allowSetDocumentTitleFollowWorkspaceDir)return;let E;if(this._workspace){const d=new _.URI(this._workspace.uri).displayName;!this._workspace.isDirectory&&d.endsWith(`.${this.workspaceSuffixName}`)?E=(0,_.formatLocalize)("file.workspace.defaultWorkspaceTip",d.slice(0,d.lastIndexOf("."))):E=d}document.title=this.formatTitle(E)}async getMostRecentlyUsedWorkspace(){return await this.getGlobalRecentStorage(),(await this.recentGlobalStorage.get("RECENT_WORKSPACES")||[])[0]}async setMostRecentlyUsedWorkspace(E){await this.getGlobalRecentStorage();const f=await this.recentGlobalStorage.get("RECENT_WORKSPACES")||[];f.unshift(E),await this.recentGlobalStorage.set("RECENT_WORKSPACES",Array.from(new Set(f)))}async getMostRecentlyUsedWorkspaces(){return await this.getGlobalRecentStorage(),await this.recentGlobalStorage.get("RECENT_WORKSPACES")||[]}async getMostRecentlyUsedCommands(){return await this.getGlobalRecentStorage(),await this.recentGlobalStorage.get("RECENT_COMMANDS")||[]}async setMostRecentlyUsedCommand(E){await this.getGlobalRecentStorage();const f=await this.recentGlobalStorage.get("RECENT_COMMANDS")||[],d=f.indexOf(E);d>0&&f.splice(d,1),f.unshift(E),await this.recentGlobalStorage.set("RECENT_COMMANDS",f)}async getGlobalRecentStorage(){return this.recentGlobalStorage=this.recentGlobalStorage||await this.storageProvider(_.STORAGE_NAMESPACE.GLOBAL_RECENT_DATA),await this.recentGlobalStorage.whenReady,this.recentGlobalStorage}get opened(){return!!this._workspace}get isMultiRootWorkspaceOpened(){return!!this.workspace&&!this.workspace.isDirectory}get isMultiRootWorkspaceEnabled(){return this.opened&&this.preferences["workspace.supportMultiRootWorkspace"]}async open(E,f){await this.doOpen(E,f)}async doOpen(E,f){const d=E.toString(),y=await this.toFileStat(d);if(y){await this.roots;const{preserveWindow:b}={preserveWindow:this.preferences["workspace.preserveWindow"]||!this.opened,...f};b&&(this._workspace=y),this.openWindow(y,{preserveWindow:b});return}throw new Error("Invalid workspace root URI. Expected an existing directory location.")}async addRoot(E){await this.spliceRoots(this._roots.length,0,{},E)}async removeRoots(E){if(!this.opened)throw new Error("Folder cannot be removed as there is no active folder in the current workspace.");if(this._workspace){const f=await this.getWorkspaceDataFromFile();this._workspace=await this.writeWorkspaceFile(this._workspace,g.WorkspaceData.buildWorkspaceData(this._roots.filter(d=>E.findIndex(y=>y.toString()===d.uri)<0),f.settings))}}async spliceRoots(E,f=0,d={},...y){if(!this._workspace)throw new Error("There is not active workspace");const b=new Set,A=this._roots.map(T=>(b.add(T.uri),T.uri)),S=[];for(const T of Object.keys(d))this.workspaceToName[new _.URI(T).toString()]=d[T];for(const T of y){const R=T.toString();b.has(R)||(b.add(R),S.push(R))}const D=A.splice(E,f||0,...S);if(!D.length&&!S.length)return[];if(this._workspace.isDirectory){const T=await this.getUntitledWorkspace();T&&await this.save(T)}const I=await this.getWorkspaceDataFromFile(),w=g.WorkspaceData.buildWorkspaceData(A,I&&I.settings);return await this.writeWorkspaceFile(this._workspace,w),D.map(T=>new _.URI(T))}getWorkspaceName(E){return this.workspaceToName[E.toString()]||this.workspaceToName[E.toString()+h.separator]||E.displayName}async getUntitledWorkspace(){const E=await this.fileServiceClient.getCurrentUserHome();return E&&this.getTemporaryWorkspaceFileUri(new _.URI(E.uri))}async writeWorkspaceFile(E,f){if(E){const d=JSON.stringify(g.WorkspaceData.transformToRelative(f,E)),y=r.format(d,void 0,{tabSize:2,insertSpaces:!0,eol:""}),b=r.applyEdits(d,y),A=await this.fileServiceClient.setContent(E,b);return A||void 0}}async close(){this._workspace=void 0,this._roots.length=0,this.reloadWindow()}async toValidRoot(E){const f=await this.toFileStat(E);if(f&&f.isDirectory)return f}async toFileStat(E){if(!E)return;let f=E.toString();try{f.endsWith("/")&&(f=f.slice(0,-1));const d=await this.fileServiceClient.getFileStat(f);return d||void 0}catch{return}}openWindow(E,f){const d=new _.URI(E.uri).path.toString();if(this.shouldPreserveWindow(f))this.reloadWindow();else try{this.openNewWindow(d)}catch(y){this._workspace=E,this.logger.error(y.toString())}}reloadWindow(){this.clientApp.fireOnReload(!0)}openNewWindow(E){const f=new URL(window.location.href);f.hash=E,this.windowService.openNewWindow(f.toString())}shouldPreserveWindow(E){return E!==void 0&&!!E.preserveWindow}async containsSome(E){if(await this.roots,this.opened)for(const f of this._roots){const d=new _.URI(f.uri);for(const y of E){const b=d.resolve(y).toString(),A=await this.fileServiceClient.access(b);if(A)return A}}return!1}get saved(){return!!this._workspace&&!this._workspace.isDirectory}async save(E){const f=E instanceof _.URI?E.toString():E.uri;await this.fileServiceClient.access(f)||await this.fileServiceClient.createFile(f);const d={folders:[],settings:{}};if(!this.saved)for(const b of Object.keys(this.schemaProvider.getCombinedSchema().properties)){if(this.schemaProvider.isValidInScope(b,l.PreferenceScope.Folder))continue;const A=this.preferenceService.inspect(b);A&&A.workspaceValue&&(d.settings[b]=A.workspaceValue)}let y=await this.toFileStat(f);Object.assign(d,await this.getWorkspaceDataFromFile()),y=await this.writeWorkspaceFile(y,g.WorkspaceData.buildWorkspaceData(this._roots,d?d.settings:void 0)),await this.setWorkspace(y),this.onWorkspaceLocationChangedEmitter.fire(y)}async watchRoots(){const E=new Set(this._roots.map(f=>f.uri));for(const[f,d]of this.rootWatchers.entries())E.has(f)||d.dispose();for(const f of this._roots)this.watchRoot(f)}async watchRoot(E){const f=E.uri;if(this.rootWatchers.has(f))return;const d=this.fileServiceClient.watchFileChanges(new _.URI(E.uri));this.rootWatchers.set(f,l.Disposable.create(()=>{d.then(y=>y.dispose()),this.rootWatchers.delete(f)}))}getWorkspaceRootUri(E){if(!E||E.scheme!==_.Schemes.file){const d=this.tryGetRoots()[0];return d?new _.URI(d.uri):void 0}const f=[];for(const d of this.tryGetRoots()){const y=new _.URI(d.uri);y&&y.isEqualOrParent(E)&&f.push(y)}return f.sort((d,y)=>y.toString().length-d.toString().length)[0]}async asRelativePath(E,f){let d,y;if(typeof E=="string"?d=E:typeof E<"u"&&(d=E.codeUri.fsPath),!d)return{path:d,root:y};const b=await this.roots;if(f&&this.isMultiRootWorkspaceOpened){const A=await this.workspace;A&&b.push(A)}for(const A of b){const S=new _.URI(A.uri).codeUri.fsPath;if(d&&d.indexOf(S)>=0){y=S,d===S&&(d=""),S.slice(-1)===h.nativeSeparator?d=d.replace(S,""):d=d.replace(S+h.nativeSeparator,"");break}}return{path:decodeURI(d),root:y}}dispose(){this.toDisposableCollection.dispose()}};t.WorkspaceService=u,n.__decorate([(0,o.Autowired)(p.IFileServiceClient),n.__metadata("design:type",Object)],u.prototype,"fileServiceClient",void 0),n.__decorate([(0,o.Autowired)(l.IWindowService),n.__metadata("design:type",Object)],u.prototype,"windowService",void 0),n.__decorate([(0,o.Autowired)(l.ILogger),n.__metadata("design:type",Object)],u.prototype,"logger",void 0),n.__decorate([(0,o.Autowired)(a.WorkspacePreferences),n.__metadata("design:type",Object)],u.prototype,"preferences",void 0),n.__decorate([(0,o.Autowired)(l.PreferenceService),n.__metadata("design:type",Object)],u.prototype,"preferenceService",void 0),n.__decorate([(0,o.Autowired)(l.PreferenceSchemaProvider),n.__metadata("design:type",l.PreferenceSchemaProvider)],u.prototype,"schemaProvider",void 0),n.__decorate([(0,o.Autowired)(l.AppConfig),n.__metadata("design:type",Object)],u.prototype,"appConfig",void 0),n.__decorate([(0,o.Autowired)(_.StorageProvider),n.__metadata("design:type",Function)],u.prototype,"storageProvider",void 0),n.__decorate([(0,o.Autowired)(l.IClientApp),n.__metadata("design:type",Object)],u.prototype,"clientApp",void 0),t.WorkspaceService=u=n.__decorate([(0,o.Injectable)()],u)},91600:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceStorageService=void 0;const n=e(85608),r=e(76003),o=e(26542),l=e(10560);let _=class{constructor(){this.init()}init(){this.initialized=this.workspaceService.roots.then(()=>{this.updatePrefix(),this.workspaceService.onWorkspaceLocationChanged(()=>this.updatePrefix())})}async setData(m,p){this.prefix||await this.initialized;const s=this.prefixWorkspaceURI(m);return this.globalStorageService.setData(s,p)}async getData(m,p){await this.initialized;const s=this.prefixWorkspaceURI(m);return this.globalStorageService.getData(s,p)}async removeData(m){await this.initialized;const p=this.prefixWorkspaceURI(m);return this.globalStorageService.removeData(p)}prefixWorkspaceURI(m){return`${this.prefix}:${m}`}getPrefix(m){return m?m.uri:"_global_"}updatePrefix(){this.prefix=this.getPrefix(this.workspaceService.workspace)}};t.WorkspaceStorageService=_,n.__decorate([(0,r.Autowired)(o.GlobalBrowserStorageService),n.__metadata("design:type",o.GlobalBrowserStorageService)],_.prototype,"globalStorageService",void 0),n.__decorate([(0,r.Autowired)(l.IWorkspaceService),n.__metadata("design:type",Object)],_.prototype,"workspaceService",void 0),t.WorkspaceStorageService=_=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],_)},68810:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceVariableContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(10560);let _=class{registerVariables(m){m.registerVariable({name:"workspaceRoot",description:"The path of the workspace root folder",resolve:p=>{const s=this.getWorkspaceRootUri(p);return s&&s.path.toString()}}),m.registerVariable({name:"workspaceFolder",description:"The path of the workspace root folder",resolve:p=>{const s=this.getWorkspaceRootUri(p);return s&&s.codeUri.fsPath.toString()}}),m.registerVariable({name:"workspaceFolderBasename",description:"The name of the workspace root folder",resolve:p=>{const s=this.getWorkspaceRootUri(p);return s&&s.displayName}}),m.registerVariable({name:"cwd",description:"The path of the current working directory",resolve:p=>{const s=this.getWorkspaceRootUri(p);return s&&s.codeUri.fsPath.toString()||""}}),m.registerVariable({name:"file",description:"The path of the currently opened file",resolve:async()=>{const p=await this.getResourceUri();return p&&p.codeUri.fsPath.toString()}}),m.registerVariable({name:"fileBasename",description:"The basename of the currently opened file",resolve:async()=>{const p=await this.getResourceUri();return p&&p.path.base}}),m.registerVariable({name:"fileBasenameNoExtension",description:"The currently opened file's name without extension",resolve:async()=>{const p=await this.getResourceUri();return p&&p.path.name}}),m.registerVariable({name:"fileDirname",description:"The name of the currently opened file's directory",resolve:async()=>{const p=await this.getResourceUri();return p&&p.path.dir.toString()}}),m.registerVariable({name:"fileExtname",description:"The extension of the currently opened file",resolve:async()=>{const p=await this.getResourceUri();return p&&p.path.ext}}),m.registerVariable({name:"relativeFile",description:"The currently opened file's path relative to the workspace root",resolve:async()=>{const p=await this.getResourceUri();return p&&this.getWorkspaceRelativePath(p)}}),m.registerVariable({name:"env",resolve:async()=>await this.commandService.executeCommand(o.COMMON_COMMANDS.ENVIRONMENT_VARIABLE.id)})}getWorkspaceRootUri(m){return this.workspaceService.getWorkspaceRootUri(m)}async getResourceUri(){const m=await this.commandService.executeCommand(o.EDITOR_COMMANDS.GET_CURRENT_RESOURCE.id);if(m)return m.uri}getWorkspaceRelativePath(m){const p=this.getWorkspaceRootUri(m),s=p&&p.path.relative(m.path);return s&&s.toString()}};t.WorkspaceVariableContribution=_,n.__decorate([(0,r.Autowired)(l.IWorkspaceService),n.__metadata("design:type",Object)],_.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],_.prototype,"commandService",void 0),t.WorkspaceVariableContribution=_=n.__decorate([(0,o.Domain)(o.VariableContribution)],_)},21141:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UNTITLED_WORKSPACE=t.WORKSPACE_RECENT_DATA_FILE=t.WORKSPACE_USER_STORAGE_FOLDER_NAME=t.DEFAULT_WORKSPACE_SUFFIX_NAME=void 0,t.DEFAULT_WORKSPACE_SUFFIX_NAME="sumi-workspace",t.WORKSPACE_USER_STORAGE_FOLDER_NAME=".sumi",t.WORKSPACE_RECENT_DATA_FILE="recentdata.json",t.UNTITLED_WORKSPACE="Untitled"},10560:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(21141),t),n.__exportStar(e(97408),t)},97408:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IWorkspaceStorageService=t.IWorkspaceService=void 0,t.IWorkspaceService=Symbol("IWorkspaceService"),t.IWorkspaceStorageService=Symbol("IWorkspaceStorageService")},51500:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(10560),t)},6795:P=>{"use strict";P.exports="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20standalone%3D%22no%22%3F%3E%3C%21DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20t%3D%221577347211912%22%20class%3D%22icon%22%20viewBox%3D%220%200%201024%201024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20p-id%3D%228639%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22200%22%20height%3D%22200%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cpath%20d%3D%22M550%20192a8%208%200%200%201%208%208v232.325l201.2-116.162a8%208%200%200%201%2010.928%202.928l38%2065.818a8%208%200%200%201-2.928%2010.928L604%20512l201.2%20116.163a8%208%200%200%201%203.056%2010.697l-0.128%200.231-38%2065.818a8%208%200%200%201-10.928%202.928L558%20591.674V824a8%208%200%200%201-8%208h-76a8%208%200%200%201-8-8V591.674L264.8%20707.837a8%208%200%200%201-10.928-2.928l-38-65.818a8%208%200%200%201%202.928-10.928L420%20511.999%20218.8%20395.837a8%208%200%200%201-3.056-10.697l0.128-0.231%2038-65.818a8%208%200%200%201%2010.928-2.928L466%20432.325V200a8%208%200%200%201%208-8h76z%22%20p-id%3D%228640%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E"},57369:P=>{"use strict";P.exports="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20standalone%3D%22no%22%3F%3E%3C%21DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20t%3D%221577347219862%22%20class%3D%22icon%22%20viewBox%3D%220%200%201024%201024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20p-id%3D%228759%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22200%22%20height%3D%22200%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cpath%20d%3D%22M350.938%20158c2.003%200%204.005%200.802%205.507%202.205l117.456%20112.452h408.477c17.724%200%2032.043%2014.333%2032.043%2032.072L914.42%20384h-72.095v-39.18H444.963L325.204%20230.161h-188.75v529.676L448%20759.837V832H96.4c-17.546%200-31.755-14.047-32.038-31.54l-0.004-0.532V190.072C64.358%20172.332%2078.677%20158%2096.4%20158z%22%20p-id%3D%228760%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M771.991%20416a8%208%200%200%201%208%208v161.646l139.99-80.823a8%208%200%200%201%2010.928%202.928l28%2048.498a8%208%200%200%201-2.928%2010.928l-139.992%2080.822%20139.992%2080.824a8%208%200%200%201%203.056%2010.697l-0.128%200.231-28%2048.498a8%208%200%200%201-10.697%203.056l-0.231-0.128-139.99-80.824V872a8%208%200%200%201-8%208h-56a8%208%200%200%201-8-8V710.353l-139.99%2080.824a8%208%200%200%201-10.928-2.928l-28-48.498a8%208%200%200%201%202.928-10.928L671.991%20648l-139.99-80.822a8%208%200%200%201-3.056-10.697l0.128-0.231%2028-48.498a8%208%200%200%201%2010.698-3.056l0.23%200.128%20139.99%2080.823V424a8%208%200%200%201%208-8h56z%22%20p-id%3D%228761%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E"},5303:P=>{"use strict";P.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4="},61986:(P,t,e)=>{"use strict";P.exports=e.p+"images/loading-dark.svg"},34397:(P,t,e)=>{"use strict";P.exports=e.p+"images/loading-hc.svg"},52113:(P,t,e)=>{"use strict";P.exports=e.p+"images/loading.svg"},70831:(P,t,e)=>{"use strict";P.exports=e.p+"images/background-logo-icon.svg"},19905:(P,t,e)=>{"use strict";P.exports=e.p+"images/loading-dark.svg"},93618:(P,t,e)=>{"use strict";P.exports=e.p+"images/loading-hc.svg"},62556:(P,t,e)=>{"use strict";P.exports=e.p+"images/loading.svg"},36480:(P,t,e)=>{"use strict";P.exports=e.p+"images/boolean-dark.svg"},59376:(P,t,e)=>{"use strict";P.exports=e.p+"images/boolean-light.svg"},63695:(P,t,e)=>{"use strict";P.exports=e.p+"images/class-dark.svg"},55028:(P,t,e)=>{"use strict";P.exports=e.p+"images/class-light.svg"},50678:(P,t,e)=>{"use strict";P.exports=e.p+"images/constant-dark.svg"},11238:(P,t,e)=>{"use strict";P.exports=e.p+"images/constant-light.svg"},42100:(P,t,e)=>{"use strict";P.exports=e.p+"images/enumerator-dark.svg"},88814:(P,t,e)=>{"use strict";P.exports=e.p+"images/enumerator-item-dark.svg"},47150:(P,t,e)=>{"use strict";P.exports=e.p+"images/enumerator-item-light.svg"},71644:(P,t,e)=>{"use strict";P.exports=e.p+"images/enumerator-light.svg"},87136:(P,t,e)=>{"use strict";P.exports=e.p+"images/event-dark.svg"},92016:(P,t,e)=>{"use strict";P.exports=e.p+"images/event-light.svg"},74820:(P,t,e)=>{"use strict";P.exports=e.p+"images/field-dark.svg"},36364:(P,t,e)=>{"use strict";P.exports=e.p+"images/field-light.svg"},28327:(P,t,e)=>{"use strict";P.exports=e.p+"images/file-dark.svg"},15868:(P,t,e)=>{"use strict";P.exports=e.p+"images/file-light.svg"},85887:(P,t,e)=>{"use strict";P.exports=e.p+"images/indexer-dark.svg"},84029:(P,t,e)=>{"use strict";P.exports=e.p+"images/indexer-light.svg"},44687:(P,t,e)=>{"use strict";P.exports=e.p+"images/interface-dark.svg"},89581:(P,t,e)=>{"use strict";P.exports=e.p+"images/interface-light.svg"},29731:(P,t,e)=>{"use strict";P.exports=e.p+"images/keyword-dark.svg"},88457:(P,t,e)=>{"use strict";P.exports=e.p+"images/keyword-light.svg"},41199:(P,t,e)=>{"use strict";P.exports=e.p+"images/method-dark.svg"},83930:(P,t,e)=>{"use strict";P.exports=e.p+"images/method-light.svg"},60131:(P,t,e)=>{"use strict";P.exports=e.p+"images/namespace-dark.svg"},51593:(P,t,e)=>{"use strict";P.exports=e.p+"images/namespace-light.svg"},79507:(P,t,e)=>{"use strict";P.exports=e.p+"images/numeric-dark.svg"},32025:(P,t,e)=>{"use strict";P.exports=e.p+"images/numeric-light.svg"},58541:(P,t,e)=>{"use strict";P.exports=e.p+"images/operator-dark.svg"},30146:(P,t,e)=>{"use strict";P.exports=e.p+"images/operator-light.svg"},94439:(P,t,e)=>{"use strict";P.exports=e.p+"images/property-dark.svg"},71637:(P,t,e)=>{"use strict";P.exports=e.p+"images/property-light.svg"},30077:(P,t,e)=>{"use strict";P.exports=e.p+"images/snippet-dark.svg"},41355:(P,t,e)=>{"use strict";P.exports=e.p+"images/snippet-light.svg"},21851:(P,t,e)=>{"use strict";P.exports=e.p+"images/string-dark.svg"},37969:(P,t,e)=>{"use strict";P.exports=e.p+"images/string-light.svg"},14845:(P,t,e)=>{"use strict";P.exports=e.p+"images/structure-dark.svg"},84747:(P,t,e)=>{"use strict";P.exports=e.p+"images/structure-light.svg"},47680:(P,t,e)=>{"use strict";P.exports=e.p+"images/template-dark.svg"},61360:(P,t,e)=>{"use strict";P.exports=e.p+"images/template-light.svg"},96766:(P,t,e)=>{"use strict";P.exports=e.p+"images/variable-dark.svg"},48798:(P,t,e)=>{"use strict";P.exports=e.p+"images/variable-light.svg"},40194:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint-conditional-disabled.svg"},4887:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint-conditional-unverified.svg"},2437:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint-conditional.svg"},13395:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint-disabled.svg"},35596:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint-hint.svg"},576:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint-log-disabled.svg"},75461:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint-log-unverified.svg"},57823:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint-log.svg"},96340:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint-unsupported.svg"},63754:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint-unverified.svg"},31562:(P,t,e)=>{"use strict";P.exports=e.p+"images/breakpoint.svg"},7030:(P,t,e)=>{"use strict";P.exports=e.p+"images/current-and-breakpoint.svg"},57394:(P,t,e)=>{"use strict";P.exports=e.p+"images/current-arrow.svg"},27144:(P,t,e)=>{"use strict";P.exports=e.p+"images/stackframe-and-breakpoint.svg"},57152:(P,t,e)=>{"use strict";P.exports=e.p+"images/stackframe-arrow.svg"},52151:(P,t,e)=>{"use strict";P.exports=e.p+"images/logo.svg"},11514:(P,t,e)=>{"use strict";P.exports=e.p+"fd3be59fe5f76327c48f.png"},3188:(P,t,e)=>{"use strict";P.exports=e.p+"f86e6127667de32bbd4f.png"},82840:()=>{},3431:()=>{},83078:()=>{},84142:()=>{},49156:()=>{},66442:P=>{function t(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,o=new Array(n);r<n;r++)o[r]=e[r];return o}P.exports=t,P.exports.__esModule=!0,P.exports.default=P.exports},3634:P=>{function t(e){if(Array.isArray(e))return e}P.exports=t,P.exports.__esModule=!0,P.exports.default=P.exports},58212:(P,t,e)=>{var n=e(56347);function r(o,l,_){return l=n(l),l in o?Object.defineProperty(o,l,{value:_,enumerable:!0,configurable:!0,writable:!0}):o[l]=_,o}P.exports=r,P.exports.__esModule=!0,P.exports.default=P.exports},4293:P=>{function t(e){return e&&e.__esModule?e:{default:e}}P.exports=t,P.exports.__esModule=!0,P.exports.default=P.exports},96525:P=>{function t(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var o,l,_,v,m=[],p=!0,s=!1;try{if(_=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;p=!1}else for(;!(p=(o=_.call(r)).done)&&(m.push(o.value),m.length!==n);p=!0);}catch(g){s=!0,l=g}finally{try{if(!p&&r.return!=null&&(v=r.return(),Object(v)!==v))return}finally{if(s)throw l}}return m}}P.exports=t,P.exports.__esModule=!0,P.exports.default=P.exports},5523:P=>{function t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
33899
33899
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}P.exports=t,P.exports.__esModule=!0,P.exports.default=P.exports},41506:(P,t,e)=>{var n=e(58212);function r(l,_){var v=Object.keys(l);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(l);_&&(m=m.filter(function(p){return Object.getOwnPropertyDescriptor(l,p).enumerable})),v.push.apply(v,m)}return v}function o(l){for(var _=1;_<arguments.length;_++){var v=arguments[_]!=null?arguments[_]:{};_%2?r(Object(v),!0).forEach(function(m){n(l,m,v[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(v)):r(Object(v)).forEach(function(m){Object.defineProperty(l,m,Object.getOwnPropertyDescriptor(v,m))})}return l}P.exports=o,P.exports.__esModule=!0,P.exports.default=P.exports},67996:(P,t,e)=>{var n=e(51112);function r(o,l){if(o==null)return{};var _=n(o,l),v,m;if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(o);for(m=0;m<p.length;m++)v=p[m],!(l.indexOf(v)>=0)&&Object.prototype.propertyIsEnumerable.call(o,v)&&(_[v]=o[v])}return _}P.exports=r,P.exports.__esModule=!0,P.exports.default=P.exports},51112:P=>{function t(e,n){if(e==null)return{};var r={},o=Object.keys(e),l,_;for(_=0;_<o.length;_++)l=o[_],!(n.indexOf(l)>=0)&&(r[l]=e[l]);return r}P.exports=t,P.exports.__esModule=!0,P.exports.default=P.exports},68832:(P,t,e)=>{var n=e(3634),r=e(96525),o=e(78243),l=e(5523);function _(v,m){return n(v)||r(v,m)||o(v,m)||l()}P.exports=_,P.exports.__esModule=!0,P.exports.default=P.exports},23878:(P,t,e)=>{var n=e(14319).default;function r(o,l){if(n(o)!="object"||!o)return o;var _=o[Symbol.toPrimitive];if(_!==void 0){var v=_.call(o,l||"default");if(n(v)!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(o)}P.exports=r,P.exports.__esModule=!0,P.exports.default=P.exports},56347:(P,t,e)=>{var n=e(14319).default,r=e(23878);function o(l){var _=r(l,"string");return n(_)=="symbol"?_:String(_)}P.exports=o,P.exports.__esModule=!0,P.exports.default=P.exports},14319:P=>{function t(e){"@babel/helpers - typeof";return P.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},P.exports.__esModule=!0,P.exports.default=P.exports,t(e)}P.exports=t,P.exports.__esModule=!0,P.exports.default=P.exports},78243:(P,t,e)=>{var n=e(66442);function r(o,l){if(o){if(typeof o=="string")return n(o,l);var _=Object.prototype.toString.call(o).slice(8,-1);if(_==="Object"&&o.constructor&&(_=o.constructor.name),_==="Map"||_==="Set")return Array.from(o);if(_==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(_))return n(o,l)}}P.exports=r,P.exports.__esModule=!0,P.exports.default=P.exports},14834:(P,t,e)=>{"use strict";var n=e(69501),r=typeof globalThis>"u"?e.g:globalThis;P.exports=function(){for(var l=[],_=0;_<n.length;_++)typeof r[n[_]]=="function"&&(l[l.length]=n[_]);return l}},53373:(P,t)=>{var e,n;/*!
33900
33900
  Copyright (c) 2018 Jed Watson.
33901
33901
  Licensed under the MIT License (MIT), see
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensumi/cli-engine",
3
- "version": "3.9.1-next-1753350817.0",
3
+ "version": "3.9.1-next-1755745798.0",
4
4
  "description": "Integration engine runtime for opensumi-cli and opensumi extension",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -26,14 +26,14 @@
26
26
  "dependencies": {
27
27
  "@koa/cors": "^5.0.0",
28
28
  "@opensumi/di": "^1.8.0",
29
- "@opensumi/ide-core-browser": "3.9.1-next-1753350817.0",
30
- "@opensumi/ide-core-common": "3.9.1-next-1753350817.0",
31
- "@opensumi/ide-core-node": "3.9.1-next-1753350817.0",
32
- "@opensumi/ide-express-file-server": "3.9.1-next-1753350817.0",
33
- "@opensumi/ide-extension": "3.9.1-next-1753350817.0",
34
- "@opensumi/ide-i18n": "3.9.1-next-1753350817.0",
35
- "@opensumi/ide-main-layout": "3.9.1-next-1753350817.0",
36
- "@opensumi/ide-startup": "3.9.1-next-1753350817.0",
29
+ "@opensumi/ide-core-browser": "3.9.1-next-1755745798.0",
30
+ "@opensumi/ide-core-common": "3.9.1-next-1755745798.0",
31
+ "@opensumi/ide-core-node": "3.9.1-next-1755745798.0",
32
+ "@opensumi/ide-express-file-server": "3.9.1-next-1755745798.0",
33
+ "@opensumi/ide-extension": "3.9.1-next-1755745798.0",
34
+ "@opensumi/ide-i18n": "3.9.1-next-1755745798.0",
35
+ "@opensumi/ide-main-layout": "3.9.1-next-1755745798.0",
36
+ "@opensumi/ide-startup": "3.9.1-next-1755745798.0",
37
37
  "chalk": "^4.1.2",
38
38
  "ejs": "^3.1.7",
39
39
  "ip": "^1.1.8",
@@ -72,5 +72,5 @@
72
72
  "webpack": "^5.90.0",
73
73
  "webpack-cli": "^5.1.4"
74
74
  },
75
- "gitHead": "8fbbea3371716bd8697f9e5e75e3e8cb6c99d259"
75
+ "gitHead": "3656dd7227b2d2f0f313acfcd5438ec448bf1e6d"
76
76
  }