@opensumi/cli-engine 3.8.3-next-1747658811.0 → 3.9.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.
- package/lib/browser/browser.js +2 -2
- package/package.json +10 -10
package/lib/browser/browser.js
CHANGED
|
@@ -32352,7 +32352,7 @@ ${(0,o.formatLocalize)("terminal.integrated.exitedWithCode",h)}`),!((u=this.pres
|
|
|
32352
32352
|
`)}warn(d){this._validationStatus.state=2,this._outputChannel.append(d+`
|
|
32353
32353
|
`)}error(d){this._validationStatus.state=3,this._outputChannel.append(d+`
|
|
32354
32354
|
`)}fatal(d){this._validationStatus.state=4,this._outputChannel.append(d+`
|
|
32355
|
-
`)}get status(){return this._validationStatus}}let h=class extends o.Disposable{constructor(){super(),this._onDidStateChange=new a.Emitter,this.onDidStateChange=this._onDidStateChange.event,this._onDidRegisterTaskProvider=new a.Emitter,this.onDidRegisterTaskProvider=this._onDidRegisterTaskProvider.event,this.providerHandler=0,this.runningTasks=new Map,this.toQuickOpenItem=d=>{var E;return new o.QuickOpenItem({label:d._label||"",detail:d instanceof _.ContributedTask?`${d.command.name||""} ${d.command.args?(E=d.command.args)===null||E===void 0?void 0:E.join(" "):""}`:void 0,run:f=>f===o.Mode.OPEN?(this.runTask(d),!0):!1})},this.providers=new Map,this.providerTypes=new Map,this.addDispose([this.taskSystem.onDidStateChange(d=>this._onDidStateChange.fire(d)),this.taskSystem.onDidBackgroundTaskBegin(d=>this._onDidStateChange.fire(d)),this.taskSystem.onDidBackgroundTaskEnded(d=>this._onDidStateChange.fire(d)),this.taskSystem.onDidProblemMatched(d=>this._onDidStateChange.fire(d))])}get outputChannel(){return this._outputChannel||(this._outputChannel=this.outputService.getChannel((0,o.localize)("task.outputchannel.name"))),this._outputChannel}get workspaceFolders(){return this._workspaceFolders||this.tryGetWorkspaceFolders(),this._workspaceFolders}tryGetWorkspaceFolders(){this._workspaceFolders=this.workspaceService.tryGetRoots().map(d=>o.Uri.parse(d.uri))}async runTaskCommand(){const d=await this.getGroupedTasks(),E=await this.getWorkspaceTasks(d),[f,c]=this.combineQuickItems(d,E);this.quickOpenService.open({onType:(y,b)=>b([...f,...c])},{placeholder:(0,o.formatLocalize)("TaskService.pickRunTask")})}run(d){return this.runTask(d)}async attach(d,E){if(this.runningTasks.has(d))return;const[,,,f]=d.split(",");if(f)if(this.providerTypes.has(f)){const c=await this.getTask(this.workspaceFolders[0],d);c&&(this.taskSystem.attach(c,E),this.runningTasks.set(d,c))}else{const c=this._onDidRegisterTaskProvider.event(async y=>{if(y===f){const b=await this.getTask(this.workspaceFolders[0],d);b&&(this.taskSystem.attach(b,E),this.runningTasks.set(d,b),c.dispose())}})}}async terminateTask(d){const E=this.taskSystem.getActiveTasks();for(const f of E)f._id===d&&await this.taskSystem.terminate(f)}getTask(d,E,f=!1){const c=(0,o.isString)(E)?E:this.taskDefinitionRegistry.createTaskIdentifier(E,console);return c===void 0?Promise.resolve(void 0):this.getWorkspaceGroupedTasks(d).then(y=>{if(!y)return Promise.resolve(void 0);const b=y.get(d.toString());if(!b)return Promise.resolve(void 0);for(const A of b)if(A.matches(c,f)||A._id===E||A._label===E)return A})}async runTask(d){const E=await this.taskSystem.run(d);return E.promise.then(f=>{this.runningTasks.has(d._id)&&this.runningTasks.delete(d._id),this.outputChannel.appendLine(`Task ${d._label} done, exit code ${f.exitCode}`)}),this.runningTasks.set(d._id,d),Promise.resolve(E.promise)}async tasks(d){var E;const f=await this.getWorkspaceGroupedTasks(),c=[];for(const y of f.values())for(const b of y)d&&d.type&&((E=b.getDefinition())===null||E===void 0?void 0:E.type)===d.type&&c.push(b);return c}async getWorkspaceGroupedTasks(d=this.workspaceFolders[0]){const E=await this.getGroupedTasks(),f=await this.getWorkspaceTasks(E),c=[];for(const A of E)A.tasks&&A.tasks.length>0&&c.push(...A.tasks);const y=f?.get(d.toString());y&&y.set&&c.push(...y.set.tasks);const b=new Map;return b.set(d.toString(),c),b}async getGroupedTasks(){const d={};for(const f of this.taskDefinitionRegistry.all())d[f.taskType]=!0;d.shell=!0,d.process=!0;const E=[];for(const[,f]of this.providers){const c=await f.provideTasks(d);E.push(c)}return E}toQuickOpenGroupItem(d,E,f){return new o.QuickOpenItem({groupLabel:d?(0,o.formatLocalize)("task.contribute"):void 0,run:E,showBorder:d,label:f,value:{type:f,grouped:!0},iconClass:(0,o.getIcon)("folder")})}combineQuickItems(d,E){var f,c;const y=[],b=[];let A=!0;for(const S of d){const D=w=>w===o.Mode.OPEN?(this.quickOpenService.open({onType:(T,R)=>S.tasks.length===0?R([new o.QuickOpenItem({value:"none",label:(0,o.formatLocalize)("task.cannotFindTask",S.type),run:P=>P===o.Mode.OPEN})]):R(S.tasks.map(this.toQuickOpenItem))}),!1):!0,I=this.toQuickOpenGroupItem(A,D,S.type);y.push(I),A=!1}if(E){for(const S of E.values())if(!((f=S.configurations)===null||f===void 0)&&f.byIdentifier&&Object.keys((c=S.configurations)===null||c===void 0?void 0:c.byIdentifier).forEach(D=>{var I;const w=(I=S.configurations)===null||I===void 0?void 0:I.byIdentifier[D];b.push(this.toQuickOpenItem(w))}),S.set&&S.set.tasks.length>0)for(const D of S.set.tasks)b.push(this.toQuickOpenItem(D))}return[b,y]}async getWorkspaceTasks(d){return this.updateWorkspaceTasks(d)}updateWorkspaceTasks(d){return this.workspaceFolders.length===0?Promise.resolve(new Map):this.workspaceFolders.length===1?this.computeWorkspaceFolderTasks(this.workspaceFolders[0],d).then(E=>{const f=new Map;return f.set(this.workspaceFolders[0].toString(),E),f}):Promise.resolve(void 0)}computeWorkspaceFolderTasks(d,E){return new Promise(async f=>{const c=this.preferences.get("tasks"),y=new Map;for(const b of E)for(const A of b.tasks)_.ContributedTask.is(A)&&y.set(A.defines._key,A);if(c&&c.tasks){let b;const A=[];let S=!1;const D=new l(this.outputChannel),I=(0,g.parse)({uri:d,name:d.path,index:0},a.platform,c,D,this.taskDefinitionRegistry,this.problemMatcher,this.problemPattern);if(I.validationStatus.isOK()||(S=!0,this.showOutput()),I.configured&&I.configured.length>0){b={byIdentifier:Object.create(null)};for(const w of I.configured)b.byIdentifier[w.configures._key]=w}A.push(...I.custom),b&&b.byIdentifier&&Object.keys(b.byIdentifier).forEach(w=>{if(y.has(w)){const T=(0,g.createCustomTask)(y.get(w),b.byIdentifier[w]);b.byIdentifier[w]=T}}),f({workspaceFolder:{uri:d,name:d.path,index:0},set:{tasks:A},configurations:b,hasErrors:S})}else f({workspaceFolder:{uri:d,name:d.path,index:0},set:{tasks:[]},configurations:{byIdentifier:{}},hasErrors:!1})})}showOutput(){this.outputChannel.appendLine("There are task errors. See the output for details.")}rerunLastTask(){return this.taskSystem.rerun()}registerTaskProvider(d,E){const f=this.providerHandler+=1;return this.providers.set(f,d),this.providerTypes.set(E,f),this._onDidRegisterTaskProvider.fire(E),{dispose:()=>{this.providers.delete(f),this.providerTypes.delete(E)}}}};t.TaskService=h,n.__decorate([(0,r.Autowired)(p.OutputService),n.__metadata("design:type",p.OutputService)],h.prototype,"outputService",void 0),n.__decorate([(0,r.Autowired)(v.IWorkspaceService),n.__metadata("design:type",Object)],h.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(o.QuickOpenService),n.__metadata("design:type",Object)],h.prototype,"quickOpenService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],h.prototype,"preferences",void 0),n.__decorate([(0,r.Autowired)(m.ITaskSystem),n.__metadata("design:type",Object)],h.prototype,"taskSystem",void 0),n.__decorate([(0,r.Autowired)(a.ITaskDefinitionRegistry),n.__metadata("design:type",Object)],h.prototype,"taskDefinitionRegistry",void 0),n.__decorate([(0,r.Autowired)(a.IProblemMatcherRegistry),n.__metadata("design:type",Object)],h.prototype,"problemMatcher",void 0),n.__decorate([(0,r.Autowired)(a.IProblemPatternRegistry),n.__metadata("design:type",Object)],h.prototype,"problemPattern",void 0),t.TaskService=h=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],h)},66893:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalTaskSystem=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(80907),p=e(1041),v=e(12968),m=e(95268),{deepClone:_}=o.objects,{Path:s}=o.path;let g=class extends o.Disposable{constructor(){super(...arguments),this.executorId=0,this.activeTaskExecutors=new Map,this._onDidStateChange=new o.Emitter,this._onDidBackgroundTaskBegin=new o.Emitter,this._onDidBackgroundTaskEnded=new o.Emitter,this._onDidProblemMatched=new o.Emitter,this.taskExecutors=[],this.onDidStateChange=this._onDidStateChange.event,this.onDidBackgroundTaskBegin=this._onDidBackgroundTaskBegin.event,this.onDidBackgroundTaskEnded=this._onDidBackgroundTaskEnded.event,this.onDidProblemMatched=this._onDidProblemMatched.event}run(h){return this.currentTask=h,this.executeTask(h)}attach(h,u){return this.currentTask=h,this.attachTask(h,u)}async buildShellConfig(h){let u="";const d=h.name,E=h.args,f=[],c=[];if(d&&(typeof d=="string"?u=d:u=d.value),f.push(u),E)for(const y of E)typeof y=="string"?f.push(y):f.push(y.value);for(const y of f)y.indexOf(s.separator)>-1?c.push(await this.resolveVariables(y.split(s.separator))):c.push(await this.resolveVariable(y));return{args:["-c",`${c.join(" ")}`]}}findAvailableExecutor(){return this.taskExecutors.find(h=>h.taskStatus===m.TaskStatus.PROCESS_EXITED)}async createTaskExecutor(h,u){const d=await this.resolveMatchers(h.configurationProperties.problemMatchers),E=new v.ProblemCollector(d),f=this.injector.get(m.TerminalTaskExecutor,[h,u,E,this.executorId]);return this.executorId+=1,this.taskExecutors.push(f),this.addDispose(f.onDidTerminalWidgetRemove(()=>{this.taskExecutors=this.taskExecutors.filter(c=>c.executorId!==f.executorId)})),f}async attachTask(h,u){const E=(await this.createTaskExecutor(h,u.launchConfig)).attach(u);return this.lastTask=h,{task:h,kind:1,promise:E}}async executeTask(h){var u,d,E;const f=h.command&&h.command.runtime===p.RuntimeType.CustomExecution,c=await this.resolveMatchers(h.configurationProperties.problemMatchers),y=new v.ProblemCollector(c),{args:b}=await this.buildShellConfig(h.command),A={name:this.createTerminalName(h),args:b,isExtensionOwnedTerminal:f,env:((u=h.command.options)===null||u===void 0?void 0:u.env)||{},cwd:!((d=h.command.options)===null||d===void 0)&&d.cwd?await this.resolveVariable((E=h.command.options)===null||E===void 0?void 0:E.cwd):await this.resolveVariable("${workspaceFolder}"),disablePreserveHistory:!0};let S=this.findAvailableExecutor(),D=!1;S?(D=!0,S.updateProblemCollector(y),S.updateLaunchConfig(A),S.reset()):S=await this.createTaskExecutor(h,A),D?this._onDidStateChange.fire(p.TaskEvent.create("start",h,S.terminalId)):this.addDispose(S.onDidTerminalCreated(T=>{this._onDidStateChange.fire(p.TaskEvent.create("start",h,T))})),D||(this.addDispose(S.onDidTaskProcessExit(T=>{this._onDidStateChange.fire(p.TaskEvent.create("processEnded",h,T)),this._onDidStateChange.fire(p.TaskEvent.create("end",h))})),this.addDispose(S.onDidBackgroundTaskBegin(()=>this._onDidBackgroundTaskBegin.fire(p.TaskEvent.create("backgroundTaskBegin",h)))),this.addDispose(S.onDidBackgroundTaskEnd(()=>this._onDidBackgroundTaskEnded.fire(p.TaskEvent.create("backgroundTaskEnded",h)))),this.addDispose(S.onDidProblemMatched(T=>this._onDidProblemMatched.fire(p.TaskEvent.create("problemMatched",h,T)))));const I=S.execute(h,D),w=h.getMapKey();return this.activeTaskExecutors.set(w,{promise:Promise.resolve(I),task:h,executor:S}),this._onDidStateChange.fire(p.TaskEvent.create("active",h)),await S.processReady.promise,this._onDidStateChange.fire(p.TaskEvent.create("processStarted",h,S.processId)),this.lastTask=h,{task:h,kind:1,promise:I}}createTerminalName(h){return(0,o.formatLocalize)("TerminalTaskSystem.terminalName",h.getQualifiedLabel()||h.configurationProperties.name)}async resolveVariables(h){const u=[];for(const d of h)u.push(await this.resolveVariable(d));return u.join(s.separator)}async resolveVariable(h){if((0,o.isString)(h))return await this.variableResolver.resolve(h);if(h!==void 0)return{value:await this.variableResolver.resolve(h.value),quoting:h.quoting};throw new Error("Should never try to resolve undefined.")}async resolveMatchers(h){if(h==null||h.length===0)return[];const u=[];for(const d of h){let E;if((0,o.isString)(d)?d[0].startsWith("$")?E=this.problemMatcher.get(d.substring(1)):E=this.problemMatcher.get(d):E=d,!E)continue;const f=E.filePrefix!==void 0;if(!f)u.push(E);else{const c=_(E);f&&(c.filePrefix=await this.resolveVariable(c.filePrefix)),u.push(c)}}return u}getActiveTasks(){return Array.from(this.activeTaskExecutors.values()).map(h=>h.task)}async terminate(h){const u=h.getMapKey(),d=this.activeTaskExecutors.get(u);if(!d)return Promise.resolve({task:void 0,success:!0});const{success:E}=await d.executor.terminate();return this.activeTaskExecutors.delete(u),{task:h,success:E}}async rerun(){return this.lastTask&&await this.executeTask(this.lastTask)}isActive(){throw new Error("Method not implemented.")}isActiveSync(){throw new Error("Method not implemented.")}getBusyTasks(){throw new Error("Method not implemented.")}canAutoTerminate(){throw new Error("Method not implemented.")}terminateAll(){throw new Error("Method not implemented.")}revealTask(h){throw new Error("Method not implemented.")}customExecutionComplete(h,u){throw new Error("Method not implemented.")}};t.TerminalTaskSystem=g,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],g.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(o.IProblemMatcherRegistry),n.__metadata("design:type",Object)],g.prototype,"problemMatcher",void 0),n.__decorate([(0,r.Autowired)(a.IVariableResolverService),n.__metadata("design:type",Object)],g.prototype,"variableResolver",void 0),t.TerminalTaskSystem=g=n.__decorate([(0,r.Injectable)()],g)},93950:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITaskSystem=t.ITaskExecutor=t.ITaskService=void 0,t.ITaskService=Symbol("ITaskService"),t.ITaskExecutor=Symbol("ITaskExecutor"),t.ITaskSystem=Symbol("ITaskSystem")},1041:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskEvent=t.TaskSorter=t.ExecutionEngine=t.InMemoryTask=t.ContributedTask=t.ConfiguringTask=t.CustomTask=t.CommonTask=t.RunOptions=t.RunOnOptions=t.TaskSourceKind=t.TaskGroup=t.CommandString=t.RuntimeType=t.PresentationOptions=t.PanelKind=t.RevealProblemKind=t.RevealKind=t.CommandOptions=t.CUSTOMIZED_TASK_TYPE=t.ShellQuoting=t.TASK_RUNNING_STATE=void 0;const n=e(40191),r=e(43718),{basename:o}=r.path;t.TASK_RUNNING_STATE=new n.RawContextKey("taskRunning",!1);var a;(function(w){w[w.Escape=1]="Escape",w[w.Strong=2]="Strong",w[w.Weak=3]="Weak"})(a||(t.ShellQuoting=a={})),t.CUSTOMIZED_TASK_TYPE="$customized",function(w){function T(R){if(!R)return w.Strong;switch(R.toLowerCase()){case"escape":return w.Escape;case"strong":return w.Strong;case"weak":return w.Weak;default:return w.Strong}}w.from=T}(a||(t.ShellQuoting=a={}));var p;(function(w){w.defaults={cwd:"${workspaceFolder}"}})(p||(t.CommandOptions=p={}));var v;(function(w){w[w.Always=1]="Always",w[w.Silent=2]="Silent",w[w.Never=3]="Never"})(v||(t.RevealKind=v={})),function(w){function T(R){switch(R.toLowerCase()){case"always":return w.Always;case"silent":return w.Silent;case"never":return w.Never;default:return w.Always}}w.fromString=T}(v||(t.RevealKind=v={}));var m;(function(w){w[w.Never=1]="Never",w[w.OnProblem=2]="OnProblem",w[w.Always=3]="Always"})(m||(t.RevealProblemKind=m={})),function(w){function T(R){switch(R.toLowerCase()){case"always":return w.Always;case"never":return w.Never;case"onproblem":return w.OnProblem;default:return w.OnProblem}}w.fromString=T}(m||(t.RevealProblemKind=m={}));var _;(function(w){w[w.Shared=1]="Shared",w[w.Dedicated=2]="Dedicated",w[w.New=3]="New"})(_||(t.PanelKind=_={})),function(w){function T(R){switch(R.toLowerCase()){case"shared":return w.Shared;case"dedicated":return w.Dedicated;case"new":return w.New;default:return w.Shared}}w.fromString=T}(_||(t.PanelKind=_={}));var s;(function(w){w.defaults={echo:!0,reveal:v.Always,revealProblems:m.Never,focus:!1,panel:_.Shared,showReuseMessage:!0,clear:!1}})(s||(t.PresentationOptions=s={}));var g;(function(w){w[w.Shell=1]="Shell",w[w.Process=2]="Process",w[w.CustomExecution=3]="CustomExecution",w[w.CustomExecution2=4]="CustomExecution2"})(g||(t.RuntimeType=g={})),function(w){function T(R){switch(R.toLowerCase()){case"shell":return w.Shell;case"process":return w.Process;case"customExecution":return w.CustomExecution;default:return w.Process}}w.fromString=T}(g||(t.RuntimeType=g={}));var l;(function(w){function T(R){return(0,r.isString)(R)?R:R.value}w.value=T})(l||(t.CommandString=l={}));var h;(function(w){w.Clean={_id:"clean",isDefault:!1},w.Build={_id:"build",isDefault:!1},w.Rebuild={_id:"rebuild",isDefault:!1},w.Test={_id:"test",isDefault:!1};function T(P){return P===w.Clean._id||P===w.Build._id||P===w.Rebuild._id||P===w.Test._id}w.is=T;function R(P){if(P!==void 0)return(0,r.isString)(P)?T(P)?{_id:P,isDefault:!1}:void 0:P}w.from=R})(h||(t.TaskGroup=h={}));var u;(function(w){w.Workspace="workspace",w.Extension="extension",w.InMemory="inMemory",w.WorkspaceFile="workspaceFile",w.User="user"})(u||(t.TaskSourceKind=u={}));var d;(function(w){w[w.default=1]="default",w[w.folderOpen=2]="folderOpen"})(d||(t.RunOnOptions=d={}));var E;(function(w){w.defaults={reevaluateOnRerun:!0,runOn:d.default}})(E||(t.RunOptions=E={}));class f{constructor(T,R,P,O,M,k){this._label="",this._id=T,R&&(this._label=R),P&&(this.type=P),this.runOptions=O,this.configurationProperties=M,this._source=k}getDefinition(T){}getMapKey(){return this._id}getRecentlyUsedKey(){}clone(){return this.fromObject(Object.assign({},this))}getWorkspaceFolder(){}getWorkspaceFileName(){}getTelemetryKind(){return"unknown"}matches(T,R=!1){if(T===void 0)return!1;if((0,r.isString)(T))return T===this._label||T===this.configurationProperties.identifier||R&&T===this._id;const P=this.getDefinition(!0);return P!==void 0&&P._key===T._key}getQualifiedLabel(){const T=this.getWorkspaceFolder();return T?`${this._label} (${T.name})`:this._label}getTaskExecution(){return{id:this._id,task:this}}addTaskLoadMessages(T){this._taskLoadMessages===void 0&&(this._taskLoadMessages=[]),T&&(this._taskLoadMessages=this._taskLoadMessages.concat(T))}get taskLoadMessages(){return this._taskLoadMessages}}t.CommonTask=f;class c extends f{constructor(T,R,P,O,M,k,F,L){super(T,P,void 0,F,L,R),this.command={},this._source=R,this.hasDefinedMatchers=k,M&&(this.command=M)}customizes(){if(this._source&&this._source.customizes)return this._source.customizes}getDefinition(T=!1){if(T&&this._source.customizes!==void 0)return this._source.customizes;{let R;switch(this.command?this.command.runtime:void 0){case g.Shell:R="shell";break;case g.Process:R="process";break;case g.CustomExecution:R="customExecution";break;case void 0:R="$composite";break;default:throw new Error("Unexpected task runtime")}return{type:R,_key:this._id,id:this._id}}}static is(T){return T instanceof c}getMapKey(){const T=this._source.config.workspaceFolder;return T?`${T.uri.toString()}|${this._id}`:this._id}getRecentlyUsedKey(){const T=this._source.config.workspaceFolder;if(!T)return;let R=this.configurationProperties.identifier;this._source.kind!==u.Workspace&&(R+=this._source.kind);const P={type:t.CUSTOMIZED_TASK_TYPE,folder:T.uri.toString(),id:R};return JSON.stringify(P)}getWorkspaceFolder(){return this._source.config.workspaceFolder}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?o(this._source.config.workspace.configuration.toString()):void 0}getTelemetryKind(){return this._source.customizes?"workspace>extension":"workspace"}fromObject(T){return new c(T._id,T._source,T._label,T.type,T.command,T.hasDefinedMatchers,T.runOptions,T.configurationProperties)}}t.CustomTask=c;class y extends f{constructor(T,R,P,O,M,k,F){super(T,P,O,k,F,R),this._source=R,this.configures=M}static is(T){return T instanceof y}fromObject(T){return T}getDefinition(){return this.configures}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?o(this._source.config.workspace.configuration.toString()):void 0}}t.ConfiguringTask=y;class b extends f{constructor(T,R,P,O,M,k,F,L,B){super(T,P,O,L,B,R),this.defines=M,this.hasDefinedMatchers=F,this.command=k}getDefinition(){return this.defines}static is(T){return T instanceof b}getMapKey(){const T=this._source.workspaceFolder;return T?`${this._source.scope.toString()}|${T.uri.toString()}|${this._id}`:`${this._source.scope.toString()}|${this._id}`}getRecentlyUsedKey(){const T={type:"contributed",scope:this._source.scope,id:this._id};return this._source.scope===3&&this._source.workspaceFolder&&(T.folder=this._source.workspaceFolder.uri.toString()),JSON.stringify(T)}getWorkspaceFolder(){return this._source.workspaceFolder}getTelemetryKind(){return"extension"}fromObject(T){return new b(T._id,T._source,T._label,T.type,T.defines,T.command,T.hasDefinedMatchers,T.runOptions,T.configurationProperties)}}t.ContributedTask=b;class A extends f{constructor(T,R,P,O,M,k){super(T,P,O,M,k,R),this._source=R}static is(T){return T instanceof A}getTelemetryKind(){return"composite"}fromObject(T){return new A(T._id,T._source,T._label,T.type,T.runOptions,T.configurationProperties)}}t.InMemoryTask=A;var S;(function(w){w[w.Process=1]="Process",w[w.Terminal=2]="Terminal"})(S||(t.ExecutionEngine=S={})),function(w){w._default=w.Terminal}(S||(t.ExecutionEngine=S={}));class D{constructor(T){this._order=new Map;for(let R=0;R<T.length;R++)this._order.set(T[R].uri.toString(),R)}compare(T,R){const P=T.getWorkspaceFolder(),O=R.getWorkspaceFolder();if(P&&O){let M=this._order.get(P.uri.toString());M=M===void 0?0:M+1;let k=this._order.get(O.uri.toString());return k=k===void 0?0:k+1,M===k?T._label.localeCompare(R._label):M-k}else return!P&&O?-1:P&&!O?1:0}}t.TaskSorter=D;var I;(function(w){function T(R,P,O){if(P){const M={kind:R,taskId:P._id,taskName:P.configurationProperties.name,runType:P.configurationProperties.isBackground?"background":"singleRun",group:P.configurationProperties.group,processId:void 0,exitCode:void 0,terminalId:void 0,__task:P};return R==="start"?M.terminalId=O:R==="processStarted"?M.processId=O:R==="processEnded"?M.exitCode=O:R==="problemMatched"&&(M.problems=O),Object.freeze(M)}else return Object.freeze({kind:"changed"})}w.create=T})(I||(t.TaskEvent=I={}))},90305:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608),r=n.__importDefault(e(14041)),o=n.__importDefault(e(75655));let a=0,p=null;t.default=v=>{const{start:m,stop:_,self:s,left:g,right:l,wholeWidth:h,last:u}=v,d=c=>{a=c.clientX,p=s,m()},E=c=>{if(!a)return!1;const y=c.clientX,b=(y-a)/h*100;a=y,b<0?(s&&s.increase(b),l&&l.increase(-b)):p&&p===g&&(s&&s.increase(-b),g&&g.increase(b))},f=c=>{a=0,p=null,s.resize(),g&&g.resize(),l&&l.resize(),_()};return r.default.createElement("div",{className:o.default.resizeDelegetContainer,onMouseUp:f,onMouseMove:E},!u&&r.default.createElement("div",{className:o.default.resizeDelegateBar,onMouseDown:d,onMouseUp:f}))}},92699:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResizeDirection=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),a=e(41869),p=e(7473),v=n.__importDefault(e(90305)),m=n.__importDefault(e(75655));var _;(function(l){l[l.vertical=0]="vertical",l[l.horizontal=1]="horizontal"})(_||(t.ResizeDirection=_={}));const s=({index:l,widget:h,wholeWidth:u,setEvent:d,self:E,left:f,right:c,last:y})=>{const b=(0,a.useAutorun)(h.shadowDynamic);return o.default.createElement("div",{key:`resize-item-${l}`,style:{width:`${b}%`},className:m.default.resizeHandler},o.default.createElement(v.default,{wholeWidth:u,start:()=>d(!0),stop:()=>d(!1),self:E,left:f,right:c,last:y}))},g=({widget:l,dynamic:h,draw:u,handleRemoveWidget:d,widgetsLength:E})=>{const f=(0,a.useAutorun)(h);return o.default.createElement("div",{key:l.id,style:{width:`${f}%`},className:m.default.resizeItem},u(l),E>1&&o.default.createElement("div",{className:(0,r.default)(m.default.closeBtn,(0,a.getIcon)("close")),onClick:()=>{d(l.id)}}))};t.default=l=>{const{group:h,shadow:u}=l,d=(0,a.useAutorun)(h.widgets),[E,f]=o.default.useState(!1),[c,y]=o.default.useState(1/0),b=(0,a.useInjectable)(p.ITerminalGroupViewService),A=o.default.useRef(null);o.default.useEffect(()=>{A.current&&A.current.clientHeight!==c&&y(A.current.clientWidth)});const S=o.default.useCallback(D=>{b.removeWidget(D)},[]);return o.default.createElement("div",{className:m.default.resizeWrapper,ref:A},o.default.createElement("div",{style:{pointerEvents:E?"all":"none"},className:m.default.resizeDelegate},d&&d.map((D,I)=>{const w=I-1>-1?d[I-1]:null,T=d[I],R=I+1<d.length?d[I+1]:null;return o.default.createElement(s,{key:I,index:I,widget:D,wholeWidth:c,setEvent:f,self:T,left:w,right:R,last:I===d.length-1})})),o.default.createElement("div",{style:{pointerEvents:E?"none":"all"},className:m.default.resizePanel},d&&d.map(D=>o.default.createElement(g,{key:D.id,widget:D,dynamic:u?D.dynamic:D.shadowDynamic,draw:l.draw,handleRemoveWidget:S,widgetsLength:d.length}))))}},70483:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalSearch=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),a=e(97267),p=e(41869),v=e(26405),m=n.__importDefault(e(50587));t.TerminalSearch=o.default.memo(_=>{const s=(0,p.useInjectable)(v.ITerminalSearchService),[g,l]=o.default.useState(s.UIState),[h,u]=o.default.useState(null),[d,E]=o.default.useState(s.text||""),f=o.default.useRef(null);o.default.useEffect(()=>{const T=s.onVisibleChange(R=>{R&&f.current&&(f.current.focus(),f.current.value.length>0&&f.current.setSelectionRange(0,f.current.value.length))});return()=>T.dispose()},[s]),o.default.useEffect(()=>{if(!s.onResultChange)return;const T=s.onResultChange(R=>{u(R)});return()=>T.dispose()},[s]);const c=o.default.useCallback(T=>{s.text=T.target.value,s.search(),E(T.target.value)},[s]),y=o.default.useCallback(T=>{T.key==="Enter"&&s.search(),T.key==="Escape"&&(s.close(),s.clear())},[s]),b=o.default.useCallback(()=>{s.updateUIState({isMatchCase:!g.isMatchCase}),l(s.UIState)},[s,g]),A=o.default.useCallback(()=>{s.updateUIState({isUseRegexp:!g.isUseRegexp}),l(s.UIState)},[s,g]),S=o.default.useCallback(()=>{s.updateUIState({isWholeWord:!g.isWholeWord}),l(s.UIState)},[s,g]),D=o.default.useCallback(()=>{s.searchNext()},[s]),I=o.default.useCallback(()=>{s.searchPrevious()},[s]),w=o.default.useCallback(()=>{s.close()},[s]);return o.default.createElement("div",{className:m.default.terminalSearch},o.default.createElement(a.ValidateInput,{className:m.default.searchField,autoFocus:!0,id:"search-input-field",title:(0,p.localize)("search.input.placeholder"),type:"text",value:d,placeholder:(0,p.localize)("common.find"),onKeyDown:y,onChange:c,ref:f,validateMessage:void 0,addonAfter:[o.default.createElement("span",{key:(0,p.localize)("search.caseDescription"),className:(0,r.default)((0,p.getIcon)("ab"),m.default["match-case"],m.default.optionBtn,{[m.default.select]:g.isMatchCase}),title:(0,p.localize)("search.caseDescription"),onClick:b}),o.default.createElement("span",{key:(0,p.localize)("search.wordsDescription"),className:(0,r.default)((0,p.getIcon)("abl"),m.default["whole-word"],m.default.optionBtn,{[m.default.select]:g.isWholeWord}),title:(0,p.localize)("search.wordsDescription"),onClick:S}),o.default.createElement("span",{key:(0,p.localize)("search.regexDescription"),className:(0,r.default)((0,p.getIcon)("regex"),m.default["use-regexp"],m.default.optionBtn,{[m.default.select]:g.isUseRegexp}),title:(0,p.localize)("search.regexDescription"),onClick:A})]}),o.default.createElement("div",{className:m.default.searchResult},h?`${h.resultIndex+1}/${h.resultCount}`:"0/0"),o.default.createElement("div",{className:(0,r.default)(m.default.panelBtn,(0,p.getIcon)("up")),onClick:I}),o.default.createElement("div",{className:(0,r.default)(m.default.panelBtn,(0,p.getIcon)("down")),onClick:D}),o.default.createElement("div",{className:(0,r.default)(m.default.panelBtn,(0,p.getIcon)("close")),onClick:w}))})},65586:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.renderAddItem=t.renderInfoItem=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(12784)),a=n.__importStar(e(14041)),p=e(80564),v=e(41869),m=e(89897),_=e(1149),s=e(7443),g=e(26405),l=n.__importDefault(e(99886)),h=d=>{var E,f,c,y;const b=(0,v.useInjectable)(s.IconService),A=(0,o.default)(()=>d.onClick&&d.onClick(),20),S=(0,o.default)(()=>d.onClose&&d.onClose(),20),D=(0,v.useDesignStyles)(l.default.item_container,"item_container"),I=(0,v.useDesignStyles)(l.default.tab_item_selected,"tab_item_selected"),w=(0,v.useDesignStyles)(l.default.item_info_name,"item_info_name"),T=(0,v.useDesignStyles)(l.default.tab_close_icon,"tab_close_icon"),R=(0,v.useInjectable)(_.LayoutViewSizeConfig),P=(0,a.useRef)(null),{group:O}=d;if(!O)return null;const{options:M,id:k}=O,F=(0,v.useAutorun)(O.editable),L=(0,v.useAutorun)(O.snapshot),B=(0,a.useCallback)(Z=>{Z.key==="Enter"&&d.onInputEnter&&k&&d.onInputEnter(k,Z.target.value)},[k,d.onInputEnter]);(0,a.useEffect)(()=>{var Z;d.selected&&((Z=P.current)===null||Z===void 0||Z.scrollIntoView())},[P,d.selected]);let U;M?.icon&&(!((E=M.icon)===null||E===void 0)&&E.id?U=b.fromString(`$(${(f=M.icon)===null||f===void 0?void 0:f.id})`):M.icon instanceof v.URI?U=b.fromIcon(M?.icon.toString()):(!((c=M.icon)===null||c===void 0)&&c.light||!((y=M?.icon)===null||y===void 0)&&y.dark)&&(U=d.theme==="light"?b.fromIcon(M.icon.light.toString()):b.fromIcon(M.icon.dark.toString())));const W=(0,a.useCallback)(Z=>{var $;($=d.onDragStart)===null||$===void 0||$.call(d,Z)},[d.onDragStart]),j=(0,a.useCallback)(Z=>{Z.preventDefault(),P.current&&P.current.classList.add("on-drag-over")},[P]),Q=(0,a.useCallback)(()=>{P.current&&P.current.classList.remove("on-drag-over")},[P]),G=(0,a.useCallback)(Z=>{var $;P.current&&P.current.classList.remove("on-drag-over"),($=d.onDrop)===null||$===void 0||$.call(d,Z)},[P,d.onDrop]);return a.default.createElement("div",{draggable:d.draggable,onDragStart:W,onDragOver:j,onDragLeave:Q,onDrop:G,ref:P,className:(0,r.default)({[D]:!0,[I]:!!d.selected}),style:{height:R.panelTitleBarHeight},onClick:()=>A(),onContextMenu:Z=>d.onContextMenu&&d.onContextMenu(Z)},F?a.default.createElement("input",{autoFocus:!0,ref:Z=>Z&&Z.select(),className:l.default.item_info_input,defaultValue:L,onClick:Z=>Z.stopPropagation(),onBlur:()=>d.onInputBlur&&O.id&&d.onInputBlur(O.id),onKeyDown:Z=>B(Z)}):a.default.createElement("div",{id:O.id,className:w,title:L},L!==""?a.default.createElement(a.default.Fragment,null,a.default.createElement(p.Icon,{iconClass:U||(0,v.getIcon)(L?.toLowerCase()||"terminal")||(0,v.getIcon)("terminal"),style:{marginRight:4,color:"inherit",fontSize:14}}),a.default.createElement("span",{className:l.default.item_title},L)):a.default.createElement(m.Loading,null)),F?a.default.createElement("div",null):a.default.createElement("div",{className:(0,r.default)([(0,v.getIcon)("close"),T]),onClick:Z=>{Z.stopPropagation(),S()}}))};t.renderInfoItem=h;const u=d=>{const E=(0,o.default)(()=>d.onClick&&d.onClick(),20),f=d.getKeybinding&&d.getKeybinding(v.TERMINAL_COMMANDS.ADD.id),c=f?`${(0,v.localize)("terminal.new")}(${f})`:(0,v.localize)("terminal.new"),y=(0,v.useDesignStyles)(l.default.tab_item_wrapper,"tab_item_wrapper");return a.default.createElement("div",{className:y},a.default.createElement("div",{title:c,className:(0,r.default)({[(0,v.getIcon)("plus")]:!0,[l.default.item_add]:!0}),onClick:()=>E()}),a.default.createElement("div",{title:(0,v.localize)("terminal.new.type"),className:(0,r.default)({[(0,v.getIcon)("down")]:!0,[l.default.item_more]:!0}),onClick:d.onDropdown}))};t.renderAddItem=u,t.default=d=>{switch(d.type||g.ItemType.info){case g.ItemType.info:return(0,a.createElement)(d.provider.infoItemRender,d);case g.ItemType.add:return(0,a.createElement)(d.provider.addItemRender,d);default:return null}}},17632:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),a=e(41869),p=e(52416),v=e(26405),m=e(88023),_=n.__importDefault(e(65586)),s=n.__importDefault(e(99886));t.default=()=>{const g=(0,a.useInjectable)(v.ITerminalGroupViewService),l=(0,a.useInjectable)(v.ITerminalRenderProvider),h=(0,a.useInjectable)(m.TerminalContextMenuService),u=(0,a.useInjectable)(p.IThemeService),d=(0,a.useInjectable)(a.KeybindingRegistry),E=(0,r.useRef)(),[f,c]=(0,r.useState)("dark"),y=(0,a.useDesignStyles)(s.default.tab_contents,"tab_contents"),b=(0,a.useDesignStyles)(s.default.tabs,"tabs"),A=(0,a.useAutorun)(g.groups),S=(0,a.useAutorun)(g.currentGroup),D=(0,r.useCallback)(()=>(u.getCurrentTheme().then(w=>{c(w.type)}),u.onThemeChange(w=>{c(w.type)})),[f,u]);(0,r.useEffect)(()=>{const w=D();return()=>{w.dispose()}},[]);const I=(0,r.useMemo)(()=>A.filter(Boolean),[A]);return r.default.createElement("div",{className:s.default.view_container},r.default.createElement("div",{className:b},r.default.createElement(o.Scrollbars,{forwardedRef:w=>w?E.current=w.ref:null},r.default.createElement("div",{className:y},I.map((w,T)=>r.default.createElement(_.default,{draggable:!0,onDragStart:R=>{R.dataTransfer.setData("groupIndex",String(T))},onDrop:R=>{if(R.preventDefault(),R.dataTransfer.getData("groupIndex")){const P=R.dataTransfer.getData("groupIndex");g.swapGroup(Number(P),T),g.selectGroup(T)}},key:w.id,group:w,selected:S&&S.id===w.id,onInputBlur:()=>w.unedit(),onInputEnter:(R,P)=>w.rename(P),onClick:()=>g.selectGroup(T),onClose:()=>g.removeGroup(T),onContextMenu:R=>h.onTabContextMenu(R,T),provider:l,theme:f})),r.default.createElement("div",{className:s.default.button},r.default.createElement(_.default,{type:v.ItemType.add,onClick:()=>{const w=g.createGroup(),T=g.getGroup(w);g.createWidget(T),g.selectGroup(w)},getKeybinding:w=>{const T=d.getKeybindingsForCommand(w);return Array.isArray(T)&&T[0]&&d.acceleratorFor(T[0],"")[0]||""},onDropdown:w=>h.onDropDownContextMenu(w),provider:l,theme:f}))))))}},7066:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalVariable=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(43718),a=e(94620),p=n.__importDefault(e(74599));function v(_,s){_.forEach((g,l)=>{g.forEach(h=>{s.add((0,a.mutatorTypeLabel)(h.type,h.value,l))})})}const m=({diff:_})=>{const s=r.default.useMemo(()=>{const l=new Set;return _?.added&&_?.added.size>0&&v(_.added,l),_?.changed&&_.changed.size>0&&v(_.changed,l),Array.from(l.values())},[_]),g=r.default.useMemo(()=>{if(!_?.removed||_?.removed.size===0)return[];const l=new Set;return v(_.removed,l),Array.from(l.values())},[_]);return r.default.createElement("div",{className:p.default.variable_container},s.length>0&&r.default.createElement(r.default.Fragment,null,r.default.createElement("h3",null,(0,o.localize)("terminal.environment.changes")),s.map((l,h)=>r.default.createElement("p",{key:l+h,className:p.default.variable_change},l))),g.length>0&&r.default.createElement(r.default.Fragment,null,r.default.createElement("h3",null,(0,o.localize)("terminal.environment.removal")),g.map((l,h)=>r.default.createElement("p",{key:l+h,className:p.default.variable_change},l))))};t.TerminalVariable=m},48139:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608),r=n.__importDefault(e(12784)),o=n.__importDefault(e(14041)),a=e(41869),p=e(26405),v=n.__importStar(e(92699)),m=e(70483),_=n.__importDefault(e(73567)),s=n.__importDefault(e(76970));e(86650),t.default=()=>{const g=(0,a.useInjectable)(p.ITerminalController),l=(0,a.useInjectable)(p.ITerminalSearchService),h=(0,a.useInjectable)(p.ITerminalErrorService),u=(0,a.useInjectable)(p.ITerminalNetwork),d=o.default.useRef(null),E=(0,a.useInjectable)(p.ITerminalGroupViewService),f=(0,a.useAutorun)(E.currentGroupId),c=(0,a.useAutorun)(E.currentGroupIndex),y=(0,a.useAutorun)(E.groups),[b,A]=o.default.useState(g.themeBackground);(0,a.useEventEffect)(g.onThemeBackgroundChange,P=>{A(P)});const[S,D]=o.default.useState(h.errors),I=(0,r.default)(()=>{D(h.errors)},a.FRAME_THREE);(0,a.useEventEffect)(h.onErrorsChange,I);const w=o.default.useCallback((P,O)=>{const M=g.findClientFromWidgetId(P.id);let k;return M?k=u.shouldReconnect(M.id)?void 0:S.get(M.id):k=S.get(P.id),o.default.createElement(s.default,{show:c===O,error:k,widget:P})},[c,g,S,u,E]),[T,R]=o.default.useState(l.isVisible);return(0,a.useEventEffect)(l.onVisibleChange,P=>{R(P)}),o.default.useEffect(()=>{d.current&&(g.initContextKey(d.current),g.viewReady.resolve())},[d.current]),o.default.createElement("div",{ref:d,className:_.default.terminalWrapper,style:{backgroundColor:b},"data-group-current":f},T&&o.default.createElement(m.TerminalSearch,null),y.map((P,O)=>{if(P.activated.get())return o.default.createElement("div",{"data-group-rendered":P.activated.get(),key:`terminal-${P.id}`,style:{display:c===O?"block":"none"},className:_.default.group,onFocus:g.focus.bind(g),onBlur:g.blur.bind(g),onContextMenu:g.onContextMenu.bind(g)},o.default.createElement(v.default,{shadow:!1,useFlex:!1,direction:v.ResizeDirection.horizontal,group:P,draw:M=>w(M,O)}))}))}},76970:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),a=e(26405),p=n.__importDefault(e(73567));function v(m,_,s){const g=()=>{s.removeWidget(m.id)},l=()=>{_.fix(m.id)};return m?.type===a.ETerminalErrorType.CREATE_FAIL?r.default.createElement("div",{className:p.default.terminalCover},r.default.createElement("div",null,(0,o.localize)("terminal.can.not.create"),": ",m.message),r.default.createElement("div",null,r.default.createElement("a",{onClick:g},(0,o.localize)("terminal.stop")),(0,o.localize)("terminal.or"),r.default.createElement("a",{onClick:l},(0,o.localize)("terminal.try.recreate")))):m.stopped?r.default.createElement("div",{className:p.default.terminalCover},r.default.createElement("div",null,(0,o.localize)("terminal.disconnected")),r.default.createElement("div",null,(0,o.localize)("terminal.can.not.reconnect"),r.default.createElement("a",{onClick:l},(0,o.localize)("terminal.try.reconnect")))):r.default.createElement("div",{className:p.default.terminalCover},r.default.createElement("div",null,(0,o.localize)("terminal.disconnected")),r.default.createElement("div",null,r.default.createElement("a",{onClick:g},(0,o.localize)("terminal.stop")),(0,o.localize)("terminal.or"),r.default.createElement("a",{onClick:l},(0,o.localize)("terminal.try.reconnect"))))}t.default=({widget:m,error:_,show:s})=>{const g=r.default.useRef(null),l=(0,o.useInjectable)(a.ITerminalErrorService),h=(0,o.useInjectable)(a.ITerminalGroupViewService);r.default.useEffect(()=>{if(g.current&&m.element)g.current.appendChild(m.element);else if(g.current&&!m.element){const d=document.createElement("div");g.current.appendChild(d),d.className=p.default.terminalContent,m.element=d}},[]),r.default.useEffect(()=>{m.show=s},[s]),r.default.useEffect(()=>{m.error=!!_},[_]);const u=()=>{h.selectWidget(m.id)};return r.default.createElement("div",{className:p.default.terminalContainer},_?v(_,l,h):null,r.default.createElement("div",{"data-term-id":m.id,style:{display:_?"none":"block"},className:p.default.terminalContentWrapper,onFocus:u,ref:g}))}},21623:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(71852),t),n.__exportStar(e(43397),t),n.__exportStar(e(7082),t),n.__exportStar(e(11476),t),n.__exportStar(e(63341),t),n.__exportStar(e(96051),t),n.__exportStar(e(79404),t)},71852:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalCommandContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(63067),p=e(26405),v=e(48520),m=e(35628),_=e(94620);let s=class{onReconnect(){this.terminalController.reconnect()}onDisposeSideEffects(){}setDefaultTerminalType(l){this.preference.update("terminal.type",l)}registerCommands(l){l.registerCommand({...o.TERMINAL_COMMANDS.OPEN_SEARCH,iconClass:(0,o.getIcon)("search")},{execute:()=>{if(this.search.isVisible){this.search.close();return}this.search.open()}}),l.registerCommand({...o.TERMINAL_COMMANDS.SPLIT,iconClass:(0,o.getIcon)("embed")},{execute:()=>{const h=this.view.currentGroup.get();if(!h)return;const u=this.view.createWidget(h);this.view.selectWidget(u.id)}}),l.registerCommand(o.TERMINAL_COMMANDS.CLEAR,{execute:()=>{this.view.clear()}}),l.registerCommand(o.TERMINAL_COMMANDS.ADD,{execute:async()=>{await this.terminalController.createTerminalWithWidget({}),this.terminalController.showTerminalPanel()}}),l.registerCommand(o.TERMINAL_COMMANDS.TOGGLE_TERMINAL,{execute:()=>{this.terminalController.toggleTerminalPanel()}}),l.registerCommand(o.TERMINAL_COMMANDS.SEARCH_NEXT,{execute:()=>{this.search.isVisible?this.search.search():this.search.open()}}),l.registerCommand({...o.TERMINAL_COMMANDS.REMOVE,iconClass:(0,o.getIcon)("delete")},{execute:async()=>{const h=this.view.currentWidgetId.get();h&&this.view.removeWidget(h)}}),l.registerCommand(o.TERMINAL_COMMANDS.OPEN_WITH_PATH,{execute:async h=>{h&&(await this.terminalApi.createTerminal({cwd:h.codeUri.fsPath})).show()}}),l.registerCommand(o.TERMINAL_COMMANDS.TAB_RENAME,{execute:async(h,u)=>{const d=this.view.getGroup(u);d&&d.edit()}}),l.registerCommand({...o.TERMINAL_COMMANDS.SELECT_ALL_CONTENT},{execute:()=>{const h=this.view.currentWidgetId.get(),u=this.terminalController.findClientFromWidgetId(h);u&&u.selectAll()}}),l.registerCommand({...o.TERMINAL_COMMANDS.CLEAR_CONTENT,iconClass:(0,o.getIcon)("clear")},{execute:()=>{const h=this.view.currentWidgetId.get(),u=this.terminalController.findClientFromWidgetId(h);u&&u.clear()}}),l.registerCommand({...o.TERMINAL_COMMANDS.CLEAR_ALL_CONTENT},{execute:()=>{this.terminalController.clearAllGroups()}}),l.registerCommand(o.TERMINAL_COMMANDS.SELECT_ZSH,{execute:async()=>{this.setDefaultTerminalType("zsh")}}),l.registerCommand(o.TERMINAL_COMMANDS.SELECT_BASH,{execute:async()=>{this.setDefaultTerminalType("bash")}}),l.registerCommand(o.TERMINAL_COMMANDS.SELECT_SH,{execute:async()=>{this.setDefaultTerminalType("sh")}}),l.registerCommand(o.TERMINAL_COMMANDS.SELECT_POWERSHELL,{execute:async()=>{this.setDefaultTerminalType("powershell")}}),l.registerCommand(o.TERMINAL_COMMANDS.SELECT_CMD,{execute:async()=>{this.setDefaultTerminalType("cmd")}}),l.registerCommand(o.TERMINAL_COMMANDS.MORE_SETTINGS,{execute:async()=>{this.commands.executeCommand(o.COMMON_COMMANDS.OPEN_PREFERENCES.id,"terminal")}}),l.registerCommand(o.TERMINAL_COMMANDS.COPY,{execute:async()=>{const h=this.view.currentWidgetId.get(),u=this.terminalController.findClientFromWidgetId(h);u&&await this.clipboardService.writeText(u.getSelection())}}),l.registerCommand(o.TERMINAL_COMMANDS.PASTE,{execute:async()=>{const h=this.view.currentWidgetId.get(),u=this.terminalController.findClientFromWidgetId(h);u&&u.paste(await this.clipboardService.readText())}}),l.registerCommand(o.TERMINAL_COMMANDS.SELECT_ALL,{execute:()=>{const h=this.view.currentWidgetId.get(),u=this.terminalController.findClientFromWidgetId(h);u&&u.selectAll()}}),l.registerCommand(o.TERMINAL_COMMANDS.RE_LAUNCH,{execute:()=>{const h=this.view.groups.get();for(const u of h)u.widgets.get().forEach(E=>{const f=this.terminalController.findClientFromWidgetId(E.id);f&&f.reset()})}}),l.registerCommand(o.COMMON_COMMANDS.ENVIRONMENT_VARIABLE,{execute:async()=>await this.terminalEnvironmentService.getProcessEnv()}),l.registerCommand(o.TERMINAL_COMMANDS.FOCUS_NEXT_TERMINAL,{execute:()=>{const h=this.view.currentGroup.get();if(h&&h.widgets.get().length<=1)return;const u=this.getNextOrPrevTerminalClient("next");u?.focus()}}),l.registerCommand(o.TERMINAL_COMMANDS.FOCUS_PREVIOUS_TERMINAL,{execute:()=>{const h=this.view.currentGroup.get();if(h&&h.widgets.get().length<=1)return;const u=this.getNextOrPrevTerminalClient("prev");u?.focus()}}),l.registerCommand(o.TERMINAL_COMMANDS.KILL_PROCESS,{execute:async()=>{const h=this.view.currentWidgetId.get(),u=this.terminalController.findClientFromWidgetId(h);if(u){const d=u.getSelection();d&&d.length>0?await this.clipboardService.writeText(u.getSelection()):await this.terminalApi.sendText(h,"")}}})}getNextOrPrevTerminalClient(l){const h=this.view.currentGroup.get();if(!h)return;const u=h.widgets.get(),d=u.findIndex(c=>c.id===this.view.currentWidgetId.get());let E;l==="next"?E=d===u.length-1?0:d+1:E=d===0?u.length-1:d-1;const f=u[E];return this.terminalController.findClientFromWidgetId(f.id)}};t.TerminalCommandContribution=s,n.__decorate([(0,r.Autowired)(p.ITerminalController),n.__metadata("design:type",Object)],s.prototype,"terminalController",void 0),n.__decorate([(0,r.Autowired)(_.EnvironmentVariableServiceToken),n.__metadata("design:type",v.TerminalEnvironmentService)],s.prototype,"terminalEnvironmentService",void 0),n.__decorate([(0,r.Autowired)(p.ITerminalGroupViewService),n.__metadata("design:type",Object)],s.prototype,"view",void 0),n.__decorate([(0,r.Autowired)(p.ITerminalSearchService),n.__metadata("design:type",Object)],s.prototype,"search",void 0),n.__decorate([(0,r.Autowired)(p.ITerminalRestore),n.__metadata("design:type",Object)],s.prototype,"store",void 0),n.__decorate([(0,r.Autowired)(p.ITerminalApiService),n.__metadata("design:type",Object)],s.prototype,"terminalApi",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],s.prototype,"preference",void 0),n.__decorate([(0,r.Autowired)(o.IPreferenceSettingsService),n.__metadata("design:type",Object)],s.prototype,"settingService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],s.prototype,"commands",void 0),n.__decorate([(0,r.Autowired)(a.IMainLayoutService),n.__metadata("design:type",Object)],s.prototype,"mainlayoutService",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],s.prototype,"config",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",m.TerminalKeyBoardInputService)],s.prototype,"terminalInput",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],s.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(o.IClipboardService),n.__metadata("design:type",Object)],s.prototype,"clipboardService",void 0),t.TerminalCommandContribution=s=n.__decorate([(0,o.Domain)(o.CommandContribution,o.ClientAppContribution)],s)},63341:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalKeybindingContribution=void 0;const n=e(85608),r=e(41869),o=e(66e3),a=e(40191),p=e(43718);let v=class{registerKeybindings(_){_.registerKeybinding({command:r.TERMINAL_COMMANDS.OPEN_SEARCH.id,keybinding:"ctrlcmd+f",when:o.IsTerminalFocused.raw}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.CLEAR_CONTENT.id,keybinding:"ctrlcmd+k",when:o.IsTerminalFocused.raw}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.SEARCH_NEXT.id,keybinding:"ctrlcmd+g",when:o.IsTerminalFocused.raw}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.COPY.id,keybinding:p.isWindows?"ctrlcmd+shift+c":"ctrlcmd+c",when:a.RawContextKey.and(o.IsTerminalFocused.raw,"locationProtocol != http")}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.KILL_PROCESS.id,keybinding:"ctrlcmd+c",when:a.RawContextKey.and(o.IsTerminalFocused.raw,"locationProtocol != http","isWindows")}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.PASTE.id,keybinding:p.isWindows?"ctrlcmd+shift+v":"ctrlcmd+v",when:a.RawContextKey.and(o.IsTerminalFocused.raw,"locationProtocol != http")}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.SELECT_ALL.id,keybinding:"ctrlcmd+a",when:o.IsTerminalFocused.raw}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.SPLIT.id,keybinding:"ctrlcmd+\\",when:o.IsTerminalFocused.raw}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.ADD.id,keybinding:"ctrl+shift+`"}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.FOCUS_NEXT_TERMINAL.id,keybinding:"ctrlcmd+alt+right",when:o.IsTerminalFocused.raw}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.FOCUS_NEXT_TERMINAL.id,keybinding:"ctrlcmd+alt+down",when:o.IsTerminalFocused.raw}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.FOCUS_PREVIOUS_TERMINAL.id,keybinding:"ctrlcmd+alt+left",when:o.IsTerminalFocused.raw}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.FOCUS_PREVIOUS_TERMINAL.id,keybinding:"ctrlcmd+alt+up",when:o.IsTerminalFocused.raw}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.TOGGLE_TERMINAL.id,keybinding:"ctrl+`"})}};t.TerminalKeybindingContribution=v,t.TerminalKeybindingContribution=v=n.__decorate([(0,p.Domain)(r.KeybindingContribution)],v)},43397:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalLifeCycleContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(63067),p=e(26405),v=e(94620),m=e(43395),_=e(35628);let s=class{initialize(){(0,m.registerTerminalColors)()}onStart(){this.terminalInput.listen(),this.environmentService.initEnvironmentVariableCollections()}onDidRender(){this.store.restore().then(()=>{this.terminalController.firstInitialize()})}onStop(){this.terminalController.disposeTerminalClients({isTaskExecutor:!0}),this.store.save()}};t.TerminalLifeCycleContribution=s,n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",_.TerminalKeyBoardInputService)],s.prototype,"terminalInput",void 0),n.__decorate([(0,r.Autowired)(p.ITerminalController),n.__metadata("design:type",Object)],s.prototype,"terminalController",void 0),n.__decorate([(0,r.Autowired)(p.ITerminalRestore),n.__metadata("design:type",Object)],s.prototype,"store",void 0),n.__decorate([(0,r.Autowired)(v.EnvironmentVariableServiceToken),n.__metadata("design:type",Object)],s.prototype,"environmentService",void 0),t.TerminalLifeCycleContribution=s=n.__decorate([(0,o.Domain)(o.ClientAppContribution,a.MainLayoutContribution)],s)},7082:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalMenuContribution=t.more2=t.more1Sub=t.more1=t.group=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(30144),p=e(93899),v=e(43718),m=e(26405);t.group="panel_menu",t.more1="more_1",t.more1Sub="more_1_sub",t.more2="more_2";let _=class{registerMenus(g){g.registerMenuItem(p.MenuId.TerminalTabContext,{command:{id:o.TERMINAL_COMMANDS.TAB_RENAME.id,label:(0,o.localize)("terminal.menu.rename")},order:1,group:t.group}),g.registerMenuItem(p.MenuId.TerminalTabContext,{command:{id:o.TERMINAL_COMMANDS.SPLIT.id,label:(0,o.localize)("terminal.menu.split")},order:2,group:t.group}),g.registerMenuItem(p.MenuId.TerminalTabContext,{command:{id:o.TERMINAL_COMMANDS.REMOVE.id,label:(0,o.localize)("terminal.menu.stopGroup")},order:3,group:t.group}),g.registerMenuItem(p.MenuId.TerminalInstanceContext,{command:o.TERMINAL_COMMANDS.COPY,group:"1_modify"}),g.registerMenuItem(p.MenuId.TerminalInstanceContext,{command:o.TERMINAL_COMMANDS.PASTE,group:"1_modify"}),g.registerMenuItem(p.MenuId.TerminalInstanceContext,{command:o.TERMINAL_COMMANDS.SELECT_ALL,group:"1_modify"}),g.registerMenuItem(p.MenuId.TerminalInstanceContext,{command:o.TERMINAL_COMMANDS.CLEAR_CONTENT,group:"1_modify"});const l=(0,o.getSlotLocation)("@opensumi/ide-terminal-next",this.config.layoutConfig),h=(0,o.getTabbarCtxKey)(l),u=(0,p.getTabbarCommonMenuId)(l),d=`${h} == ${a.TERMINAL_CONTAINER_ID}`;g.registerMenuItem(u,{command:o.TERMINAL_COMMANDS.CLEAR,order:1,group:t.more1,when:d}),g.registerMenuItem(u,{command:o.TERMINAL_COMMANDS.CLEAR_ALL_CONTENT,order:1,group:t.more1,when:d}),g.registerMenuItem(u,{label:(0,o.localize)("terminal.menu.selectType"),submenu:p.MenuId.TerminalDefaultTypeMenu,order:1,group:t.more2,when:d}),v.isWindows?g.registerMenuItems(p.MenuId.TerminalDefaultTypeMenu,[{command:o.TERMINAL_COMMANDS.SELECT_CMD,order:1,group:t.more1Sub,toggledWhen:"config.terminal.type == cmd",when:d},{command:o.TERMINAL_COMMANDS.SELECT_POWERSHELL,order:2,group:t.more1Sub,toggledWhen:"config.terminal.type == powershell",when:d}]):g.registerMenuItems(p.MenuId.TerminalDefaultTypeMenu,[{command:o.TERMINAL_COMMANDS.SELECT_ZSH,order:1,group:t.more1Sub,toggledWhen:"config.terminal.type == zsh",when:d},{command:o.TERMINAL_COMMANDS.SELECT_BASH,order:2,group:t.more1Sub,toggledWhen:"config.terminal.type == bash",when:d},{command:o.TERMINAL_COMMANDS.SELECT_SH,order:3,group:t.more1Sub,toggledWhen:"config.terminal.type == sh",when:d}]),g.registerMenuItem(u,{command:o.TERMINAL_COMMANDS.MORE_SETTINGS,order:1,group:t.more2,when:d})}};t.TerminalMenuContribution=_,n.__decorate([(0,r.Autowired)(m.ITerminalController),n.__metadata("design:type",Object)],_.prototype,"terminalController",void 0),n.__decorate([(0,r.Autowired)(m.ITerminalGroupViewService),n.__metadata("design:type",Object)],_.prototype,"view",void 0),n.__decorate([(0,r.Autowired)(m.ITerminalSearchService),n.__metadata("design:type",Object)],_.prototype,"search",void 0),n.__decorate([(0,r.Autowired)(o.IPreferenceSettingsService),n.__metadata("design:type",Object)],_.prototype,"settingService",void 0),n.__decorate([(0,r.Autowired)(v.CommandService),n.__metadata("design:type",Object)],_.prototype,"commands",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],_.prototype,"config",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],_.prototype,"preference",void 0),t.TerminalMenuContribution=_=n.__decorate([(0,v.Domain)(p.MenuContribution)],_)},96051:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalNetworkContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(43718),p=e(26405);let v=class extends a.WithEventBus{onStart(){this.network.bindErrors()}handleBrowserConnectionOpen(_){this.network.setStatus(p.TerminalNetworkStatus.CONNECTED)}handleBrowserConnectionClose(_){this.network.setStatus(p.TerminalNetworkStatus.DISCONNECTED)}};t.TerminalNetworkContribution=v,n.__decorate([(0,r.Autowired)(p.ITerminalNetwork),n.__metadata("design:type",Object)],v.prototype,"network",void 0),n.__decorate([(0,r.Autowired)(p.ITerminalInternalService),n.__metadata("design:type",Object)],v.prototype,"service",void 0),n.__decorate([(0,a.OnEvent)(a.BrowserConnectionOpenEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[a.BrowserConnectionOpenEvent]),n.__metadata("design:returntype",void 0)],v.prototype,"handleBrowserConnectionOpen",null),n.__decorate([(0,a.OnEvent)(a.BrowserConnectionCloseEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[a.BrowserConnectionCloseEvent]),n.__metadata("design:returntype",void 0)],v.prototype,"handleBrowserConnectionClose",null),t.TerminalNetworkContribution=v=n.__decorate([(0,o.Domain)(o.ClientAppContribution)],v)},79404:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalPreferenceContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(43718),p=e(26405),v=e(3276),m=e(91815);let _=class{constructor(){this.schema=v.terminalPreferenceSchema;const g=["git-bash","powershell","cmd","default"],{properties:{["terminal.type"]:l}}={...v.terminalPreferenceSchema};this.ptyTerminal.getOS().then(h=>{h===a.OperatingSystem.Windows&&this.preferenceSchemaProvider.setSchema({properties:{"terminal.type":{...l,enum:g}}},!0)})}};t.TerminalPreferenceContribution=_,n.__decorate([(0,r.Autowired)(p.ITerminalService),n.__metadata("design:type",m.NodePtyTerminalService)],_.prototype,"ptyTerminal",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceSchemaProvider),n.__metadata("design:type",o.PreferenceSchemaProvider)],_.prototype,"preferenceSchemaProvider",void 0),t.TerminalPreferenceContribution=_=n.__decorate([(0,a.Domain)(o.PreferenceContribution),n.__metadata("design:paramtypes",[])],_)},11476:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalRenderContribution=void 0;const r=e(85608),o=e(41869),a=e(30144),p=r.__importDefault(e(17632)),v=r.__importDefault(e(48139));let m=n=class{registerToolbarItems(s){s.registerItem({id:o.TERMINAL_COMMANDS.OPEN_SEARCH.id,command:o.TERMINAL_COMMANDS.OPEN_SEARCH.id,viewId:n.viewId,tooltip:(0,o.localize)("terminal.search")}),s.registerItem({id:o.TERMINAL_COMMANDS.CLEAR_CONTENT.id,command:o.TERMINAL_COMMANDS.CLEAR_CONTENT.id,viewId:n.viewId,tooltip:(0,o.localize)("terminal.menu.clearCurrentContent")}),s.registerItem({id:o.TERMINAL_COMMANDS.SPLIT.id,command:o.TERMINAL_COMMANDS.SPLIT.id,viewId:n.viewId,tooltip:(0,o.localize)("terminal.split")}),s.registerItem({id:o.TERMINAL_COMMANDS.REMOVE.id,command:o.TERMINAL_COMMANDS.REMOVE.id,viewId:n.viewId,tooltip:(0,o.localize)("terminal.remove")})}registerComponent(s){s.register("@opensumi/ide-terminal-next",{component:v.default,id:n.viewId},{title:(0,o.localize)("terminal.name"),priority:1,activateKeyBinding:"ctrl+`",containerId:n.viewId,titleComponent:p.default,draggable:!0,hideLocationTab:["right"]})}};t.TerminalRenderContribution=m,m.viewId=a.TERMINAL_CONTAINER_ID,t.TerminalRenderContribution=m=n=r.__decorate([(0,o.Domain)(o.ComponentContribution,o.TabBarToolbarContribution)],m)},17236:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalNextModule=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(26405),p=e(94620),v=e(3276),m=e(21623),_=e(98944),s=e(69061),g=e(7734),l=e(48520),h=e(102),u=e(53891),d=e(82022),E=e(12642),f=e(13663),c=e(89570),y=e(94486),b=e(46666),A=e(70406),S=e(12894),D=e(91815),I=e(29041),w=e(68611);let T=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[m.TerminalLifeCycleContribution,m.TerminalRenderContribution,m.TerminalCommandContribution,m.TerminalMenuContribution,m.TerminalKeybindingContribution,m.TerminalNetworkContribution,m.TerminalPreferenceContribution,{token:a.ITerminalApiService,useClass:_.TerminalApiService},{token:a.ITerminalController,useClass:g.TerminalController},{token:a.ITerminalTheme,useClass:I.TerminalTheme},{token:a.ITerminalSearchService,useClass:S.TerminalSearchService},{token:a.ITerminalHoverManagerService,useClass:u.TerminalHoverManagerService},{token:a.ITerminalGroupViewService,useClass:w.TerminalGroupViewService},{token:a.ITerminalErrorService,useClass:h.TerminalErrorService},{token:a.ITerminalService,useClass:D.NodePtyTerminalService},{token:a.ITerminalInternalService,useClass:d.TerminalInternalService},{token:a.ITerminalRestore,useClass:A.TerminalRestore},{token:v.ITerminalPreference,useClass:f.TerminalPreference},{token:a.ITerminalRenderProvider,useClass:b.TerminalRenderProvider},{token:a.ITerminalClientFactory2,useFactory:s.createTerminalClientFactory2},{token:a.ITerminalNetwork,useClass:E.TerminalNetworkService},{token:p.EnvironmentVariableServiceToken,useClass:l.TerminalEnvironmentService},{token:a.ITerminalProfileService,useClass:c.TerminalProfileService},{token:a.ITerminalProfileInternalService,useClass:y.TerminalProfileInternalService}],this.backServices=[{servicePath:a.ITerminalServicePath,clientToken:a.ITerminalService},{servicePath:a.ITerminalProcessPath,clientToken:p.EnvironmentVariableServiceToken}]}};t.TerminalNextModule=T,t.TerminalNextModule=T=n.__decorate([(0,r.Injectable)()],T)},67245:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalBaseLinkProvider=void 0;class e{async provideLinks(r,o){var a;(a=this._activeLinks)===null||a===void 0||a.forEach(p=>p.dispose),this._activeLinks=await this._provideLinks(r),o(this._activeLinks)}}t.TerminalBaseLinkProvider=e},52826:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalExternalLinkProviderAdapter=void 0;const n=e(85608),r=e(76003),o=e(67245),a=e(28247),p=e(97144);let v=class extends o.TerminalBaseLinkProvider{constructor(_,s,g,l,h){super(),this._xterm=_,this._instance=s,this._externalLinkProvider=g,this._wrapLinkHandler=l,this._tooltipCallback=h}async _provideLinks(_){var s,g;let l=_-1,h=l;const u=[this._xterm.buffer.active.getLine(l)];for(;l>=0&&(!((s=this._xterm.buffer.active.getLine(l))===null||s===void 0)&&s.isWrapped);)u.unshift(this._xterm.buffer.active.getLine(l-1)),l--;for(;h<this._xterm.buffer.active.length&&(!((g=this._xterm.buffer.active.getLine(h+1))===null||g===void 0)&&g.isWrapped);)u.push(this._xterm.buffer.active.getLine(h+1)),h++;const d=(0,a.getXtermLineContent)(this._xterm.buffer.active,l,h,this._xterm.cols);if(d.trim().length===0)return[];const E=await this._externalLinkProvider.provideLinks(this._instance,d);return E?E.map(f=>{const c=(0,a.convertLinkRangeToBuffer)(u,this._xterm.cols,{startColumn:f.startIndex+1,startLineNumber:1,endColumn:f.startIndex+f.length+1,endLineNumber:1},l),y=d.substr(f.startIndex,f.length)||"",b=this._wrapLinkHandler((S,D)=>f.activate(D)),A=(S,D,I,w)=>this._tooltipCallback(S,D,I,w);return this.injector.get(p.TerminalLink,[this._xterm,c,y,this._xterm.buffer.active.viewportY,b,A,!0,f.label])}):[]}};t.TerminalExternalLinkProviderAdapter=v,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],v.prototype,"injector",void 0),t.TerminalExternalLinkProviderAdapter=v=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Function,Object,Object,Function,Function])],v)},28247:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertLinkRangeToBuffer=e,t.convertBufferRangeToViewport=n,t.getXtermLineContent=r,t.positionIsInRange=o;function e(a,p,v,m){const _={start:{x:v.startColumn,y:v.startLineNumber+m},end:{x:v.endColumn-1,y:v.endLineNumber+m}};let s=0;const g=Math.ceil(v.startColumn/p);for(let u=0;u<Math.min(g);u++){const d=Math.min(p,v.startColumn-u*p);let E=0;const f=a[u];if(!f)break;for(let c=0;c<Math.min(p,d+E);c++){const y=f.getCell(c);y.getWidth()===2&&E++;const A=y.getChars();A.length>1&&(E-=A.length-1)}s+=E}let l=0;const h=Math.ceil(v.endColumn/p);for(let u=Math.max(0,g-1);u<h;u++){const d=u===g-1?(v.startColumn+s)%p:0,E=Math.min(p,v.endColumn+s-u*p),f=u===g-1?s:0;let c=0;const y=a[u];if(!y)break;for(let b=d;b<Math.min(p,E+c+f);b++){const A=y.getCell(b);A.getWidth()===2&&c++,b===p-1&&A.getChars()===""&&c++}l+=c}for(_.start.x+=s,_.end.x+=s+l;_.start.x>p;)_.start.x-=p,_.start.y++;for(;_.end.x>p;)_.end.x-=p,_.end.y++;return _}function n(a,p){return{start:{x:a.start.x-1,y:a.start.y-p-1},end:{x:a.end.x-1,y:a.end.y-p-1}}}function r(a,p,v,m){let _="";for(let s=p;s<=v;s++){const g=a.getLine(s);g&&(_+=g.translateToString(!0,0,m))}return _}function o(a,p){return!(a.y<p.start.y||a.y>p.end.y||a.y===p.start.y&&a.x<p.start.x||a.y===p.end.y&&a.x>p.end.x)}},29970:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalLinkManager=void 0;const n=e(85608),r=e(87083),o=e(76003),a=e(41869),p=e(43718),v=e(23418),m=e(14951),_=e(26405),s=e(69061),g=e(52826),l=e(11192),h=e(73481),u=e(67251),{posix:d,win32:E}=p.path;let f=class extends p.Disposable{constructor(y,b){super(),this._xterm=y,this._client=b,this._standardLinkProviders=[],this._standardLinkProvidersDisposables=new p.DisposableCollection;const A=this._wrapLinkHandler((w,T)=>this._handleProtocolLink(T)),S=this.injector.get(l.TerminalProtocolLinkProvider,[this._xterm,A,this._tooltipCallback.bind(this)]);this._standardLinkProviders.push(S);const D=this._wrapLinkHandler((w,T)=>this._handleLocalLink(T));this._wrappedTextLinkActivateCallback=D;const I=this.injector.get(h.TerminalValidatedLocalLinkProvider,[this._xterm,this._client,D,this._wrapLinkHandler.bind(this),this._tooltipCallback.bind(this),async(w,T)=>T(await this._resolvePath(w))]);this._standardLinkProviders.push(I),this.addTerminalWordLinkProvider(),this._registerStandardLinkProviders()}set processCwd(y){this._processCwd=y}addTerminalWordLinkProvider(){const y=this.injector.get(u.TerminalWordLinkProvider,[this._xterm,async(b,A)=>A(await this._resolvePath(b)),this._wrappedTextLinkActivateCallback]);this._standardLinkProviders.push(y)}async getTerminalCwd(){return await this.terminalService.getCwd(this._client.id)||this._processCwd}_registerStandardLinkProviders(){this._standardLinkProvidersDisposables.dispose(),this._standardLinkProvidersDisposables=new p.DisposableCollection;for(const y of this._standardLinkProviders)this._standardLinkProvidersDisposables.push(this._xterm.registerLinkProvider(y))}_tooltipCallback(y,b,A,S){const D=this._xterm._core,I={width:D._renderService.dimensions.css.cell.width,height:D._renderService.dimensions.css.cell.height},w={width:this._xterm.cols,height:this._xterm.rows},T=D.element.getBoundingClientRect();return this._showHover({viewportRange:b,cellDimensions:I,terminalDimensions:w,boundingClientRect:T,modifierDownCallback:A,modifierUpCallback:S},this._getLinkHoverString(y.text,y.label),R=>y.activate(void 0,R),y)}_showHover(y,b,A,S){const D=this._hoverManager.showHover(y,b,A);return S?.onInvalidated(()=>D.dispose()),p.Disposable.create(()=>D.dispose())}registerExternalLinkProvider(y,b){const A=this.injector.get(g.TerminalExternalLinkProviderAdapter,[this._xterm,y,b,this._wrapLinkHandler.bind(this),this._tooltipCallback.bind(this)]),S=this._xterm.registerLinkProvider(A);return this._registerStandardLinkProviders(),S}_wrapLinkHandler(y){return async(b,A)=>{b?.preventDefault(),!(b&&!this._isLinkActivationModifierDown(b))&&y(b,A)}}get _localLinkRegex(){const y=this._client.os===p.OperatingSystem.Windows?h.winLocalLinkClause:h.unixLocalLinkClause;return new RegExp(`${y}(${h.lineAndColumnClause})`)}async _handleLocalLink(y){const b=await this._resolvePath(y);if(!b)return;const A=this.extractLineColumnInfo(y),S={startLineNumber:A.lineNumber,endLineNumber:A.lineNumber,startColumn:A.columnNumber,endColumn:A.columnNumber};await this._editorService.open(b.uri,{range:S})}_handleHypertextLink(y){this._openerService.open(y)}async _handleProtocolLink(y){const b=p.URI.parse(y);if(b.scheme===p.Schemes.file){const A=p.FileUri.fsPath(b);this._handleLocalLink(this._client.os!==p.OperatingSystem.Windows&&p.isWindows?A.replace(/\\/g,d.sep):A);return}this._handleHypertextLink(y)}_isLinkActivationModifierDown(y){return p.isOSX?y.metaKey:y.ctrlKey}get osPath(){return this._client.os===p.OperatingSystem.Windows?E:d}_getLinkHoverString(y,b){const A=this.preferenceService.get("editor.multiCursorModifier");let S="";A==="ctrlCmd"?p.isMacintosh?S=(0,p.localize)("terminalLinkHandler.followLinkAlt.mac","option + click"):S=(0,p.localize)("terminalLinkHandler.followLinkAlt","alt + click"):p.isMacintosh?S=(0,p.localize)("terminalLinkHandler.followLinkCmd","cmd + click"):S=(0,p.localize)("terminalLinkHandler.followLinkCtrl","ctrl + click");const D=(0,p.localize)("followLink","Follow link");return b=b||D,`${b} (${S})`}async _getUserHomeDir(){const y=await this._fileSystem.getCurrentUserHome();if(!y)throw new Error("Unable to get user home directory");return await this._fileSystem.getFsPath(y.uri)}_getUserHomeDirOnce(){return this._getHomeDirPromise||(this._getHomeDirPromise=this._getUserHomeDir()),this._getHomeDirPromise}async _preprocessPath(y){if(y.charAt(0)==="~"){const b=await this._getUserHomeDirOnce();if(!b)return null;y=this.osPath.join(b,y.substring(1))}else if(y.charAt(0)!=="/"&&y.charAt(0)!=="~"){const b=await this.getTerminalCwd();if(this._client.os===p.OperatingSystem.Windows)if(!y.match("^"+h.winDrivePrefix)&&!y.startsWith("\\\\?\\")){if(!b)return null;y=this.osPath.join(b,y)}else y=y.replace(/^\\\\\?\\/,"");else{if(!b)return null;y=this.osPath.join(b,y)}}return y=this.osPath.normalize(y),y}async _resolvePath(y){const b=await this._preprocessPath(y);if(b)try{const A=p.URI.file(b),S=await this._fileService.getFileStat(A.toString());if(S)return{uri:A,isDirectory:S.isDirectory}}catch{return}}extractLineColumnInfo(y){const b=this._localLinkRegex.exec(y),A={lineNumber:1,columnNumber:1};if(!b)return A;const S=this._client.os===p.OperatingSystem.Windows?h.winLineAndColumnMatchIndex:h.unixLineAndColumnMatchIndex;for(let D=0;D<h.lineAndColumnClause.length;D++){const I=S+h.lineAndColumnClauseGroupCount*D,w=b[I];if(w){A.lineNumber=parseInt(w,10);const T=b[I+2];T&&(A.columnNumber=parseInt(T,10));break}}return A}extractLinkUrl(y){const b=this._localLinkRegex.exec(y);return b?b[1]:null}};t.TerminalLinkManager=f,n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],f.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(_.ITerminalService),n.__metadata("design:type",Object)],f.prototype,"terminalService",void 0),n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",v.WorkbenchEditorService)],f.prototype,"_editorService",void 0),n.__decorate([(0,o.Autowired)(a.IOpenerService),n.__metadata("design:type",Object)],f.prototype,"_openerService",void 0),n.__decorate([(0,o.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],f.prototype,"_fileService",void 0),n.__decorate([(0,o.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],f.prototype,"_fileSystem",void 0),n.__decorate([(0,o.Autowired)(a.PreferenceService),n.__metadata("design:type",Object)],f.prototype,"preferenceService",void 0),n.__decorate([(0,o.Autowired)(_.ITerminalHoverManagerService),n.__metadata("design:type",Object)],f.prototype,"_hoverManager",void 0),t.TerminalLinkManager=f=n.__decorate([(0,o.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[r.Terminal,s.TerminalClient])],f)},97144:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalLink=t.FOLDER_NOT_IN_WORKSPACE_LABEL=t.FOLDER_IN_WORKSPACE_LABEL=t.OPEN_FILE_LABEL=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(43718),p=e(28247),v=500;t.OPEN_FILE_LABEL=(0,a.localize)("terminal.openFile","Open file in editor"),t.FOLDER_IN_WORKSPACE_LABEL=(0,a.localize)("terminal.focusFolder","Focus folder in explorer"),t.FOLDER_NOT_IN_WORKSPACE_LABEL=(0,a.localize)("terminal.openFolder","Open folder in new window");let m=class extends a.Disposable{get onInvalidated(){return this._onInvalidated.event}constructor(s,g,l,h,u,d,E,f){super(),this._xterm=s,this.range=g,this.text=l,this._viewportY=h,this._activateCallback=u,this._tooltipCallback=d,this._isHighConfidenceLink=E,this.label=f,this._onInvalidated=new a.Emitter,this.decorations={pointerCursor:!1,underline:this._isHighConfidenceLink}}dispose(){var s,g,l;super.dispose(),(s=this._hoverListeners)===null||s===void 0||s.dispose(),this._hoverListeners=void 0,(g=this._tooltipScheduler)===null||g===void 0||g.dispose(),this._tooltipScheduler=void 0,(l=this._tooltipDisposable)===null||l===void 0||l.dispose(),this._tooltipDisposable=void 0}activate(s,g){this._activateCallback(s,g)}hover(s,g){this._hoverListeners=new a.DisposableCollection,this._hoverListeners.push((0,o.addDisposableListener)(document,"keydown",h=>{!h.repeat&&this._isModifierDown(h)&&this._enableDecorations()})),this._hoverListeners.push((0,o.addDisposableListener)(document,"keyup",h=>{!h.repeat&&!this._isModifierDown(h)&&this._disableDecorations()})),this._hoverListeners.push(this._xterm.onRender(h=>{const u=this.range.start.y-this._viewportY;u>=h.start&&u<=h.end&&this._onInvalidated.fire()})),this._isHighConfidenceLink&&(this._tooltipScheduler=new a.RunOnceScheduler(()=>{var h,u;this._tooltipDisposable=(h=this._tooltipCallback)===null||h===void 0?void 0:h.call(this,this,(0,p.convertBufferRangeToViewport)(this.range,this._viewportY),this._isHighConfidenceLink?()=>this._enableDecorations():void 0,this._isHighConfidenceLink?()=>this._disableDecorations():void 0),(u=this._tooltipScheduler)===null||u===void 0||u.dispose(),this._tooltipScheduler=void 0},this.preferenceService.get("editor.hover.delay")||v),this._tooltipScheduler.schedule());const l={x:s.pageX,y:s.pageY};this._hoverListeners.push((0,o.addDisposableListener)(document,"mousemove",h=>{var u;this._isModifierDown(h)?this._enableDecorations():this._disableDecorations(),(Math.abs(h.pageX-l.x)>window.devicePixelRatio*2||Math.abs(h.pageY-l.y)>window.devicePixelRatio*2)&&(l.x=h.pageX,l.y=h.pageY,(u=this._tooltipScheduler)===null||u===void 0||u.schedule())}))}leave(){var s,g,l;(s=this._hoverListeners)===null||s===void 0||s.dispose(),this._hoverListeners=void 0,(g=this._tooltipScheduler)===null||g===void 0||g.dispose(),this._tooltipScheduler=void 0,(l=this._tooltipDisposable)===null||l===void 0||l.dispose(),this._tooltipDisposable=void 0}_enableDecorations(){this.decorations.pointerCursor||(this.decorations.pointerCursor=!0),this.decorations.underline||(this.decorations.underline=!0)}_disableDecorations(){this.decorations.pointerCursor&&(this.decorations.pointerCursor=!1),this.decorations.underline!==this._isHighConfidenceLink&&(this.decorations.underline=this._isHighConfidenceLink)}_isModifierDown(s){return a.isOSX?s.metaKey:s.ctrlKey}};t.TerminalLink=m,n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],m.prototype,"preferenceService",void 0),t.TerminalLink=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Function,Object,String,Number,Function,Function,Boolean,Object])],m)},11192:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalProtocolLinkProvider=void 0;const n=e(85608),r=e(76003),o=e(26405),a=e(67245),p=e(28247),v=e(97144);let m=class extends a.TerminalBaseLinkProvider{constructor(g,l,h){super(),this._xterm=g,this._activateCallback=l,this._tooltipCallback=h}_provideLinks(g){var l,h;let u=g-1,d=u;const E=[this._xterm.buffer.active.getLine(u)];for(;u>=0&&(!((l=this._xterm.buffer.active.getLine(u))===null||l===void 0)&&l.isWrapped);)E.unshift(this._xterm.buffer.active.getLine(u-1)),u--;for(;d<this._xterm.buffer.active.length&&(!((h=this._xterm.buffer.active.getLine(d+1))===null||h===void 0)&&h.isWrapped);)E.push(this._xterm.buffer.active.getLine(d+1)),d++;return this._linkComputerTarget=new _(this._xterm,u,d),o.LinkComputer.computeLinks(this._linkComputerTarget).map(c=>{var y;const b=(0,p.convertLinkRangeToBuffer)(E,this._xterm.cols,c.range,u),A=(S,D,I,w)=>this._tooltipCallback(S,D,I,w);return this.injector.get(v.TerminalLink,[this._xterm,b,((y=c.url)===null||y===void 0?void 0:y.toString())||"",this._xterm.buffer.active.viewportY,this._activateCallback,A,!0,void 0])})}};t.TerminalProtocolLinkProvider=m,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],m.prototype,"injector",void 0),t.TerminalProtocolLinkProvider=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Function,Function,Function])],m);class _{constructor(g,l,h){this._xterm=g,this._lineStart=l,this._lineEnd=h}getLineCount(){return 1}getLineContent(){return(0,p.getXtermLineContent)(this._xterm.buffer.active,this._lineStart,this._lineEnd,this._xterm.cols)}}},73481:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalValidatedLocalLinkProvider=t.lineAndColumnClauseGroupCount=t.unixLineAndColumnMatchIndex=t.winLineAndColumnMatchIndex=t.lineAndColumnClause=t.winLocalLinkClause=t.winDrivePrefix=t.unixLocalLinkClause=void 0;const n=e(85608),r=e(76003),o=e(11050),a=e(66894),p=e(43718),v=e(97408),m=e(67245),_=e(28247),s=e(97144),g="(\\.\\.?|\\~)",l="\\/",h="[^\\0\\s!`&*()\\[\\]'\":;\\\\]";t.unixLocalLinkClause="(("+g+"|("+h+")+)?("+l+"("+h+")+)+)",t.winDrivePrefix="(?:\\\\\\\\\\?\\\\)?[a-zA-Z]:";const u="("+t.winDrivePrefix+"|\\.\\.?|\\~)",d="(\\\\|\\/)",E="[^\\0<>\\?\\|\\/\\s!`&*()\\[\\]'\":;]";t.winLocalLinkClause="(("+u+"|("+E+")+)?("+d+"("+E+")+)+)",t.lineAndColumnClause=[`((\\S*)['"], line ((\\d+)( column (\\d+))?))`,`((\\S*)['"],((\\d+)(:(\\d+))?))`,"((\\S*) on line ((\\d+)(, column (\\d+))?))","((\\S*):line ((\\d+)(, column (\\d+))?))","(([^\\s\\(\\)]*)(\\s?[\\(\\[](\\d+)(,\\s?(\\d+))?)[\\)\\]])",`(([^:\\s\\(\\)<>'"\\[\\]]*)(:(\\d+))?(:(\\d+))?)`].join("|").replace(/ /g,"[\xA0 ]"),t.winLineAndColumnMatchIndex=12,t.unixLineAndColumnMatchIndex=11,t.lineAndColumnClauseGroupCount=6;const f=2e3;let c=class extends m.TerminalBaseLinkProvider{constructor(b,A,S,D,I,w){super(),this._xterm=b,this._client=A,this._activateFileCallback=S,this._wrapLinkHandler=D,this._tooltipCallback=I,this._validationCallback=w}async _provideLinks(b){var A,S;const D=[];let I=b-1,w=I;const T=[this._xterm.buffer.active.getLine(I)];for(;I>=0&&(!((A=this._xterm.buffer.active.getLine(I))===null||A===void 0)&&A.isWrapped);)T.unshift(this._xterm.buffer.active.getLine(I-1)),I--;for(;w<this._xterm.buffer.active.length&&(!((S=this._xterm.buffer.active.getLine(w+1))===null||S===void 0)&&S.isWrapped);)T.push(this._xterm.buffer.active.getLine(w+1)),w++;const R=(0,_.getXtermLineContent)(this._xterm.buffer.active,I,w,this._xterm.cols);if(R.length>f)return[];const P=new RegExp(this._localLinkRegex,"g");let O,M=-1;for(;(O=P.exec(R))!==null;){let k=O[0];if(!k||(M=R.indexOf(k,M+1),P.lastIndex=M+k.length,M<0))break;((R.startsWith("--- a/")||R.startsWith("+++ b/"))&&M===4||R.startsWith("diff --git")&&(k.startsWith("a/")||k.startsWith("b/")))&&(k=k.substring(2),M+=2);const F=await this.detectLocalLink(k,T,I,M,1);F.length>0&&D.push(...F)}return D}async detectLocalLink(b,A,S,D,I){const w=[],T=await new Promise(R=>{this._validationCallback(b,async P=>{if(P){const O=P.isDirectory?await this._isDirectoryInsideWorkspace(P.uri)?s.FOLDER_IN_WORKSPACE_LABEL:s.FOLDER_NOT_IN_WORKSPACE_LABEL:s.OPEN_FILE_LABEL,M=this._wrapLinkHandler((L,B)=>{P.isDirectory?this._handleLocalFolderLink(P.uri):this._activateFileCallback(L,B)}),k=(0,_.convertLinkRangeToBuffer)(A,this._xterm.cols,{startColumn:D+1,startLineNumber:1,endColumn:D+b.length+I,endLineNumber:1},S),F=(L,B,U,W)=>this._tooltipCallback(L,B,U,W);R(this.injector.get(s.TerminalLink,[this._xterm,k,b,this._xterm.buffer.active.viewportY,M,F,!0,O]))}else R(void 0)})});return T&&w.push(T),w}get _localLinkRegex(){const b=this._client.os===p.OperatingSystem.Windows?t.winLocalLinkClause:t.unixLocalLinkClause;return new RegExp(`${b}(${t.lineAndColumnClause})`)}async _handleLocalFolderLink(b){if(await this._isDirectoryInsideWorkspace(b)){await this.commandService.executeCommand("revealInExplorer",b);return}this.appConfig.isElectronRenderer&&this.windowService.openWorkspace(b,{newWindow:!0})}async _isDirectoryInsideWorkspace(b){const A=await this.workspaceService.roots;for(const S of A)if(p.URI.parse(S.uri).isEqualOrParent(b))return!0;return!1}};t.TerminalValidatedLocalLinkProvider=c,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],c.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(a.IWindowService),n.__metadata("design:type",Object)],c.prototype,"windowService",void 0),n.__decorate([(0,r.Autowired)(p.CommandService),n.__metadata("design:type",Object)],c.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(v.IWorkspaceService),n.__metadata("design:type",Object)],c.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],c.prototype,"appConfig",void 0),t.TerminalValidatedLocalLinkProvider=c=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Function,Function,Function,Function,Function,Function])],c)},67251:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalWordLinkProvider=t.USUAL_WORD_SEPARATORS=void 0;const n=e(85608),r=e(87083),o=e(76003),a=e(74404),p=e(11050),v=e(66894),m=e(43718),_=e(92323),s=e(97408),g=e(70845),l=e(67245),h=e(28247),u=e(97144);t.USUAL_WORD_SEPARATORS=" ()[]{}',\"`\u2500\u2018\u2019\u201C\u201D|";let d=class extends l.TerminalBaseLinkProvider{constructor(f,c,y){super(),this._xterm=f,this._validationCallback=c,this._activateFileCallback=y,this._refreshSeparatorCodes()}_refreshSeparatorCodes(){let f="";for(let c=57520;c<=57535;c++)f+=String.fromCharCode(c);this._separatorRegex=new RegExp(`[${(0,g.escapeRegExpCharacters)(t.USUAL_WORD_SEPARATORS)}${f}]`,"g")}_provideLinks(f){const c=[],y=f-1,b=y,A=[this._xterm.buffer.active.getLine(y)],S=(0,h.getXtermLineContent)(this._xterm.buffer.active,y,b,this._xterm.cols);if(S===""||S.length>1024)return[];const D=this._parseWords(S);for(const I of D){if(I.text==="")continue;I.text.length>0&&I.text.charAt(I.text.length-1)===":"&&(I.text=I.text.slice(0,-1),I.endIndex--);const w=(0,h.convertLinkRangeToBuffer)(A,this._xterm.cols,{startColumn:I.startIndex+1,startLineNumber:1,endColumn:I.endIndex+1,endLineNumber:1},y),T=(R,P)=>{this._validationCallback(P,async O=>{if(O)O.isDirectory?this._handleLocalFolderLink(O.uri):this._activateFileCallback(R,P);else{const M=this.appConfig.openWordLinkWithPaletteOnTerminal;((0,m.isUndefined)(M)||M)&&this.quickOpenService.open(P)}})};c.push(this.injector.get(u.TerminalLink,[this._xterm,w,I.text,this._xterm.buffer.active.viewportY,T,void 0,!0,I.text]))}return c}async _handleLocalFolderLink(f){if(await this._isDirectoryInsideWorkspace(f)){await this.commandService.executeCommand("revealInExplorer",f);return}this.appConfig.isElectronRenderer&&this.windowService.openWorkspace(f,{newWindow:!0})}_parseWords(f){const c=[],y=f.split(this._separatorRegex);let b=0;for(let A=0;A<y.length;A++)c.push({text:y[A],startIndex:b,endIndex:b+y[A].length}),b+=y[A].length+1;return c}async _isDirectoryInsideWorkspace(f){const c=await this.workspaceService.roots;for(const y of c)if(m.URI.parse(y.uri).isEqualOrParent(f))return!0;return!1}};t.TerminalWordLinkProvider=d,n.__decorate([(0,o.Autowired)(p.AppConfig),n.__metadata("design:type",Object)],d.prototype,"appConfig",void 0),n.__decorate([(0,o.Autowired)(_.CommandService),n.__metadata("design:type",Object)],d.prototype,"commandService",void 0),n.__decorate([(0,o.Autowired)(v.IWindowService),n.__metadata("design:type",Object)],d.prototype,"windowService",void 0),n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],d.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(s.IWorkspaceService),n.__metadata("design:type",Object)],d.prototype,"workspaceService",void 0),n.__decorate([(0,o.Autowired)(a.PrefixQuickOpenService),n.__metadata("design:type",Object)],d.prototype,"quickOpenService",void 0),t.TerminalWordLinkProvider=d=n.__decorate([(0,o.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[r.Terminal,Function,Function])],d)},62810:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_COL=t.DEFAULT_ROW=t.AttachAddon=void 0;const n=e(43718);class r extends n.Disposable{constructor(){super(...arguments),this._onData=new n.Emitter,this.onData=this._onData.event,this._onExit=new n.Emitter,this.onExit=this._onExit.event,this._onTime=new n.Emitter,this.onTime=this._onTime.event,this._lastInputTime=0,this._onBeforeProcessData=new n.Emitter,this.onBeforeProcessData=this._onBeforeProcessData.event}setConnection(a){this._disposeConnection&&(this._disposeConnection.dispose(),this._disposeConnection=null),this.connection=a,a&&(this._disposeConnection=new n.Disposable(a.onData(p=>{let v=p;if(typeof p=="string"){const m={data:p};this._onBeforeProcessData.fire(m),m.data!==void 0&&(v=m.data)}if(this._onData.fire(v),this._terminal.write(typeof v=="string"?v:new Uint8Array(v,0,v.byteLength)),this._lastInputTime){const m=Date.now()-this._lastInputTime;this._lastInputTime=0,this._onTime.fire(m)}})),a.onExit&&this._disposeConnection.addDispose(a.onExit(p=>{this._onExit.fire(p)})))}async activate(a){this._terminal=a,this.addDispose(n.Disposable.create(()=>{var p;return(p=this._disposeConnection)===null||p===void 0?void 0:p.dispose()})),this.addDispose(a.onData(p=>this._sendData(p))),this.addDispose(a.onBinary(p=>this._sendBinary(p)))}_sendData(a){!this.connection||this.connection.readonly||(this._timeResponse(),this.connection.sendData(a))}_sendBinary(a){if(!this.connection||this.connection.readonly)return;const p=new Uint8Array(a.length);for(let v=0;v<a.length;++v)p[v]=a.charCodeAt(v)&255;this._timeResponse(),this.connection.sendData(p)}_timeResponse(){this._lastInputTime=Date.now()}}t.AttachAddon=r,t.DEFAULT_ROW=80,t.DEFAULT_COL=24},98944:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalApiService=void 0;const n=e(85608),r=n.__importDefault(e(56005)),o=e(76003),a=e(43718),p=e(28423),v=e(26405);let m=class{constructor(){this._onDidOpenTerminal=new a.Emitter,this._onDidCloseTerminal=new a.Emitter,this._onDidTerminalTitleChange=new a.Emitter,this._onDidChangeActiveTerminal=new a.Emitter,this.onDidOpenTerminal=this._onDidOpenTerminal.event,this.onDidCloseTerminal=this._onDidCloseTerminal.event,this.onDidTerminalTitleChange=this._onDidTerminalTitleChange.event,this.onDidChangeActiveTerminal=this._onDidChangeActiveTerminal.event,this.controller.onDidOpenTerminal(s=>{this._onDidOpenTerminal.fire(s)}),this.controller.onDidCloseTerminal(s=>{this._onDidCloseTerminal.fire(s)}),this.controller.onDidTerminalTitleChange(s=>{this._onDidTerminalTitleChange.fire(s)}),this.controller.onDidChangeActiveTerminal(s=>{this._onDidChangeActiveTerminal.fire(s)})}get terminals(){return Array.from(this.controller.clients.values()).map(s=>({id:s.id,name:s.name,isActive:this.view.currentWidgetId.get()===s.id}))}async createTerminal(s,g){const l=await this.controller.createTerminalWithWidgetByTerminalOptions({terminalOptions:s,id:g}),h={get id(){return l.id},get name(){return l.name},get processId(){return l.pid},show:(u=!0)=>{const d=l.widget;this.view.selectWidget(d.id),this.controller.showTerminalPanel(),u||setTimeout(()=>l.focus())},hide:()=>{this.controller.hideTerminalPanel()},dispose:()=>{this.view.removeWidget(l.widget.id),this.controller.clients.delete(l.id)}};return await l.attached.promise,h.show(),h}async getProcessId(s){const g=this.controller.clients.get(s);if(g)return g.pid}async getDefaultShellPath(){const s=await this.terminalProfileInternalService.resolveDefaultProfile();return s?.path||"/bin/bash"}sendText(s,g,l=!0){this.service.sendText(s,`${g}${l?"\r":""}`)}showTerm(s,g=!0){const l=this.controller.clients.get(s);if(!l)return;const h=l.widget;this.view.selectWidget(h.id),this.controller.showTerminalPanel(),g||setTimeout(()=>l.focus())}hideTerm(s){this.controller.clients.get(s)&&this.controller.hideTerminalPanel()}removeTerm(s){const g=this.controller.clients.get(s);g&&(this.view.removeWidget(g.widget.id),this.controller.clients.delete(s))}createWidget(s,g){const l=s,h=this.view.createGroup(),u=this.view.getGroup(h),d=this.view.createWidget(u,l,!1,!0);return(0,p.transaction)(E=>{d.name.set((0,r.default)(s),E)}),this.view.selectWidget(l),d.onRender(()=>{g(d.element)}),d}scheduleReconnection(){return this.network.scheduleReconnection()}};t.TerminalApiService=m,n.__decorate([(0,o.Autowired)(v.ITerminalController),n.__metadata("design:type",Object)],m.prototype,"controller",void 0),n.__decorate([(0,o.Autowired)(v.ITerminalGroupViewService),n.__metadata("design:type",Object)],m.prototype,"view",void 0),n.__decorate([(0,o.Autowired)(v.ITerminalInternalService),n.__metadata("design:type",Object)],m.prototype,"service",void 0),n.__decorate([(0,o.Autowired)(v.ITerminalNetwork),n.__metadata("design:type",Object)],m.prototype,"network",void 0),n.__decorate([(0,o.Autowired)(v.ITerminalProfileInternalService),n.__metadata("design:type",Object)],m.prototype,"terminalProfileInternalService",void 0),t.TerminalApiService=m=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],m)},69061:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.createTerminalClientFactory2=t.TerminalClientFactory=t.TerminalClient=void 0;const r=e(85608),o=e(76003),a=e(41869),p=e(67889),v=e(43718),m=e(23418),_=e(42933),s=e(28423),g=e(72665),l=e(88913),h=e(10560),u=e(26405),d=e(94620),E=e(3276),f=e(29970),c=e(62810),y=e(90853),b=e(35628),A=e(70845),S=e(41685);let D=n=class extends v.Disposable{constructor(){super(),this.isTaskExecutor=!1,this._ready=!1,this._hasOutput=!1,this._areLinksReady=!1,this._onInput=new v.Emitter,this.onInput=this._onInput.event,this._onOutput=new v.Emitter,this.onOutput=this._onOutput.event,this._onExit=new v.Emitter,this.onExit=this._onExit.event,this._onTitleChange=new v.Emitter,this.onTitleChange=this._onTitleChange.event,this._onLinksReady=new v.Emitter,this.onLinksReady=this._onLinksReady.event,this._onResponseTime=new v.Emitter,this.onResponseTime=this._onResponseTime.event,this._onNameChangeEmitter=new v.Emitter,this.onNameChange=this._onNameChangeEmitter.event,this._name="",this.init()}async init(){this.xterm=this.injector.get(S.XTerm,[{xtermOptions:{theme:this.theme.terminalTheme,...this.internalService.getOptions(),...this.terminalPreference.toJSON()}}]),this.addDispose(this.xterm),this.addDispose(this.internalService.onError(R=>{var P;this.messageService.error(R.message),!((P=R.launchConfig)===null||P===void 0)&&P.executable?this.updateTerminalName({name:"error: "+R.launchConfig.executable}):this.updateTerminalName({name:"error"})})),this.addDispose(this.internalService.onProcessChange(R=>{R.sessionId===this.id&&(0,s.transaction)(P=>{this.widget.processName.set(R.processName,P)})}))}onWidgetShow(){this._show&&(this._show.resolve(),this._show=null),this._layout()}async setupWidget(R){this._widget=R,this._prepare(),this.addDispose(v.Disposable.create(()=>{n.WORKSPACE_PATH_CACHED.delete(R.group.id)})),this.addDispose(this.terminalPreference.onChange(async({name:P,value:O})=>{!R.show&&!this._show&&(this._show=new v.Deferred),this._show&&await this._show.promise,this._setOption(P,O),this.xterm.updatePreferences({[P]:O})})),R.show?this.onWidgetShow():this.addDispose(R.onShow(P=>{P&&this.onWidgetShow()})),this.addDispose(R.onError(P=>{var O;P||((O=this._error)===null||O===void 0||O.resolve(),this._layout())})),this.addDispose(R.onResize(async()=>{this._debounceResize()}))}async init2(R,P){var O,M,k,F;if(this._uid=P?.id||R.id,this.setupWidget(R),!P||Object.keys(P).length===0){const U=await this.terminalProfileInternalService.resolveDefaultProfile();P={id:this._uid,config:U}}if(!P.cwd){const W=R.group.widgets.get();if(W.length>1&&W[0]){const j=await this.internalService.getCwd(W[0].id);j&&(P.cwd=j)}}await this._checkWorkspace();const L=(k=(O=P.cwd)!==null&&O!==void 0?O:(M=P?.config)===null||M===void 0?void 0:M.cwd)!==null&&k!==void 0?k:this._workspacePath,B=this.controller.convertProfileToLaunchConfig(P.config,L);this._launchConfig=B,this._launchConfig.__fromTerminalOptions&&(this._terminalOptions=this._launchConfig.__fromTerminalOptions),this.name=B.name||"",B.initialText&&this.xterm.raw.writeln(B.initialText),B.env||(B.env={}),(F=this.environmentService.mergedCollection)===null||F===void 0||F.applyToProcessEnvironment(B.env,this.applicationService.backendOS,this.variableResolver.resolve.bind(this.variableResolver)),this.addDispose(this.environmentService.onDidChangeCollections(U=>{U.applyToProcessEnvironment(B.env,this.applicationService.backendOS,this.variableResolver.resolve.bind(this.variableResolver))})),this._attachXterm(),this._attachAfterRender()}get name(){return this._name}set name(R){this._name!==R&&(this._name=R,this._onNameChangeEmitter.fire(R))}get term(){return this.xterm.raw}get pid(){return this.internalService.getProcessId(this.id)}get launchConfig(){return this._launchConfig}get createOptions(){}get container(){return this.xterm.container}get id(){return this._uid}get widget(){return this._widget}get ready(){return this._ready}get attached(){return this._attached}get firstOutput(){return this._firstStdout}get show(){return this._show}get areLinksReady(){return this._areLinksReady}get os(){return this._os}_prepareAddons(){this._attachAddon=new c.AttachAddon;const R=this._attachAddon.onBeforeProcessData;if(this.preferenceService.get("terminal.integrated.localEchoEnabled")){const P=this.preferenceService.get("terminal.integrated.localEchoExcludePrograms",A.DEFAULT_LOCAL_ECHO_EXCLUDE),O=new A.TypeAheadAddon(R,{localEchoExcludePrograms:Array.isArray(P)?P:A.DEFAULT_LOCAL_ECHO_EXCLUDE,localEchoLatencyThreshold:this.preferenceService.get("terminal.integrated.localEchoLatencyThreshold",30),localEchoStyle:this.preferenceService.get("terminal.integrated.localEchoStyle","dim")},this.preferenceService.onPreferenceChanged);this.addDispose(O),this.xterm.raw.loadAddon(O)}this.addDispose([this._attachAddon,this._attachAddon.onData(P=>{this._onOutput.fire({id:this.id,data:P})}),this._attachAddon.onExit(P=>{var O,M;this.logger.warn(`${this.id} ${this.name} exit with ${P}`),P!==0&&this.messageService.error(`terminal ${this.name}(${(M=(O=this._attachAddon.connection)===null||O===void 0?void 0:O.ptyInstance)===null||M===void 0?void 0:M.shellPath}) exited with non-zero code ${P}`),this._onExit.fire({id:this.id,code:P})}),this._attachAddon.onTime(P=>{this._onResponseTime.fire(P),this.reporter.performance(v.REPORT_NAME.TERMINAL_MEASURE,{duration:P,msg:"terminal.response"})})]),this.xterm.raw.loadAddon(this._attachAddon)}_xtermEvents(){this.addDispose(this.xterm.raw.onResize(R=>{this._hasOutput&&this._doResize()}))}_attachXterm(){this._prepareAddons(),this._xtermEvents(),this._linkManager=this.injector.get(f.TerminalLinkManager,[this.xterm.raw,this]),this._linkManager.processCwd=this._workspacePath,this.addDispose(this._linkManager),this._areLinksReady=!0,this._onLinksReady.fire(this)}_doResize(){this.internalService.resize(this.id,this.xterm.raw.cols,this.xterm.raw.rows)}_prepare(){var R,P,O,M,k;(R=this._attached)===null||R===void 0||R.reject("TerminalClient is Re-initialization"),(P=this._firstStdout)===null||P===void 0||P.reject("TerminalClient is Re-initialization"),(O=this._error)===null||O===void 0||O.reject("TerminalClient is Re-initialization"),(M=this._show)===null||M===void 0||M.reject("TerminalClient is Re-initialization"),this._ready=!1,this._hasOutput=!1,this._attached=new v.Deferred,this._show=new v.Deferred,this._error=new v.Deferred,this._firstStdout=new v.Deferred,(k=this._attachAddon)===null||k===void 0||k.setConnection(void 0),this.internalService.getOS().then(L=>{this._os=L});const{dispose:F}=this.onOutput(()=>{F(),this._hasOutput=!0,this._firstStdout.resolve()})}_attachAfterRender(){queueMicrotask(()=>{var R;this._layout(),this.attach(),this.focus(),this.widget.show||(R=this._show)===null||R===void 0||R.promise.then(async()=>{this._show=new v.Deferred})})}async _pickWorkspace(){var R;if(this.workspace.isMultiRootWorkspaceOpened&&!this._widget.recovery){const P=this.workspace.tryGetRoots();return await this.quickPick.show(P.map(M=>new v.URI(M.uri).codeUri.fsPath),{placeholder:(0,a.localize)("terminal.selectCWDForNewTerminal")})}else return this.workspace.workspace?new v.URI((R=this.workspace.workspace)===null||R===void 0?void 0:R.uri).codeUri.fsPath:void 0}async _checkWorkspace(){const R=this._widget;if(n.WORKSPACE_PATH_CACHED.has(R.group.id))this._workspacePath=n.WORKSPACE_PATH_CACHED.get(R.group.id);else{const P=await this._pickWorkspace();P&&(this._workspacePath=P,n.WORKSPACE_PATH_CACHED.set(R.group.id,this._workspacePath))}}async checkHealthy(){return await this.internalService.check([this.id])}displayUnHealthyMessage(){const R=this.term,P=R.options.theme,O=(k,F,L)=>{const B=" ",U=k.split(`
|
|
32355
|
+
`)}get status(){return this._validationStatus}}let h=class extends o.Disposable{constructor(){super(),this._onDidStateChange=new a.Emitter,this.onDidStateChange=this._onDidStateChange.event,this._onDidRegisterTaskProvider=new a.Emitter,this.onDidRegisterTaskProvider=this._onDidRegisterTaskProvider.event,this.providerHandler=0,this.runningTasks=new Map,this.toQuickOpenItem=d=>{var E;return new o.QuickOpenItem({label:d._label||"",detail:d instanceof _.ContributedTask?`${d.command.name||""} ${d.command.args?(E=d.command.args)===null||E===void 0?void 0:E.join(" "):""}`:void 0,run:f=>f===o.Mode.OPEN?(this.runTask(d),!0):!1})},this.providers=new Map,this.providerTypes=new Map,this.addDispose([this.taskSystem.onDidStateChange(d=>this._onDidStateChange.fire(d)),this.taskSystem.onDidBackgroundTaskBegin(d=>this._onDidStateChange.fire(d)),this.taskSystem.onDidBackgroundTaskEnded(d=>this._onDidStateChange.fire(d)),this.taskSystem.onDidProblemMatched(d=>this._onDidStateChange.fire(d))])}get outputChannel(){return this._outputChannel||(this._outputChannel=this.outputService.getChannel((0,o.localize)("task.outputchannel.name"))),this._outputChannel}get workspaceFolders(){return this._workspaceFolders||this.tryGetWorkspaceFolders(),this._workspaceFolders}tryGetWorkspaceFolders(){this._workspaceFolders=this.workspaceService.tryGetRoots().map(d=>o.Uri.parse(d.uri))}async runTaskCommand(){const d=await this.getGroupedTasks(),E=await this.getWorkspaceTasks(d),[f,c]=this.combineQuickItems(d,E);this.quickOpenService.open({onType:(y,b)=>b([...f,...c])},{placeholder:(0,o.formatLocalize)("TaskService.pickRunTask")})}run(d){return this.runTask(d)}async attach(d,E){if(this.runningTasks.has(d))return;const[,,,f]=d.split(",");if(f)if(this.providerTypes.has(f)){const c=await this.getTask(this.workspaceFolders[0],d);c&&(this.taskSystem.attach(c,E),this.runningTasks.set(d,c))}else{const c=this._onDidRegisterTaskProvider.event(async y=>{if(y===f){const b=await this.getTask(this.workspaceFolders[0],d);b&&(this.taskSystem.attach(b,E),this.runningTasks.set(d,b),c.dispose())}})}}async terminateTask(d){const E=this.taskSystem.getActiveTasks();for(const f of E)f._id===d&&await this.taskSystem.terminate(f)}getTask(d,E,f=!1){const c=(0,o.isString)(E)?E:this.taskDefinitionRegistry.createTaskIdentifier(E,console);return c===void 0?Promise.resolve(void 0):this.getWorkspaceGroupedTasks(d).then(y=>{if(!y)return Promise.resolve(void 0);const b=y.get(d.toString());if(!b)return Promise.resolve(void 0);for(const A of b)if(A.matches(c,f)||A._id===E||A._label===E)return A})}async runTask(d){const E=await this.taskSystem.run(d);return E.promise.then(f=>{this.runningTasks.has(d._id)&&this.runningTasks.delete(d._id),this.outputChannel.appendLine(`Task ${d._label} done, exit code ${f.exitCode}`)}),this.runningTasks.set(d._id,d),Promise.resolve(E.promise)}async tasks(d){var E;const f=await this.getWorkspaceGroupedTasks(),c=[];for(const y of f.values())for(const b of y)d&&d.type&&((E=b.getDefinition())===null||E===void 0?void 0:E.type)===d.type&&c.push(b);return c}async getWorkspaceGroupedTasks(d=this.workspaceFolders[0]){const E=await this.getGroupedTasks(),f=await this.getWorkspaceTasks(E),c=[];for(const A of E)A.tasks&&A.tasks.length>0&&c.push(...A.tasks);const y=f?.get(d.toString());y&&y.set&&c.push(...y.set.tasks);const b=new Map;return b.set(d.toString(),c),b}async getGroupedTasks(){const d={};for(const f of this.taskDefinitionRegistry.all())d[f.taskType]=!0;d.shell=!0,d.process=!0;const E=[];for(const[,f]of this.providers){const c=await f.provideTasks(d);E.push(c)}return E}toQuickOpenGroupItem(d,E,f){return new o.QuickOpenItem({groupLabel:d?(0,o.formatLocalize)("task.contribute"):void 0,run:E,showBorder:d,label:f,value:{type:f,grouped:!0},iconClass:(0,o.getIcon)("folder")})}combineQuickItems(d,E){var f,c;const y=[],b=[];let A=!0;for(const S of d){const D=w=>w===o.Mode.OPEN?(this.quickOpenService.open({onType:(T,R)=>S.tasks.length===0?R([new o.QuickOpenItem({value:"none",label:(0,o.formatLocalize)("task.cannotFindTask",S.type),run:P=>P===o.Mode.OPEN})]):R(S.tasks.map(this.toQuickOpenItem))}),!1):!0,I=this.toQuickOpenGroupItem(A,D,S.type);y.push(I),A=!1}if(E){for(const S of E.values())if(!((f=S.configurations)===null||f===void 0)&&f.byIdentifier&&Object.keys((c=S.configurations)===null||c===void 0?void 0:c.byIdentifier).forEach(D=>{var I;const w=(I=S.configurations)===null||I===void 0?void 0:I.byIdentifier[D];b.push(this.toQuickOpenItem(w))}),S.set&&S.set.tasks.length>0)for(const D of S.set.tasks)b.push(this.toQuickOpenItem(D))}return[b,y]}async getWorkspaceTasks(d){return this.updateWorkspaceTasks(d)}updateWorkspaceTasks(d){return this.workspaceFolders.length===0?Promise.resolve(new Map):this.workspaceFolders.length===1?this.computeWorkspaceFolderTasks(this.workspaceFolders[0],d).then(E=>{const f=new Map;return f.set(this.workspaceFolders[0].toString(),E),f}):Promise.resolve(void 0)}computeWorkspaceFolderTasks(d,E){return new Promise(async f=>{const c=this.preferences.get("tasks"),y=new Map;for(const b of E)for(const A of b.tasks)_.ContributedTask.is(A)&&y.set(A.defines._key,A);if(c&&c.tasks){let b;const A=[];let S=!1;const D=new l(this.outputChannel),I=(0,g.parse)({uri:d,name:d.path,index:0},a.platform,c,D,this.taskDefinitionRegistry,this.problemMatcher,this.problemPattern);if(I.validationStatus.isOK()||(S=!0,this.showOutput()),I.configured&&I.configured.length>0){b={byIdentifier:Object.create(null)};for(const w of I.configured)b.byIdentifier[w.configures._key]=w}A.push(...I.custom),b&&b.byIdentifier&&Object.keys(b.byIdentifier).forEach(w=>{if(y.has(w)){const T=(0,g.createCustomTask)(y.get(w),b.byIdentifier[w]);b.byIdentifier[w]=T}}),f({workspaceFolder:{uri:d,name:d.path,index:0},set:{tasks:A},configurations:b,hasErrors:S})}else f({workspaceFolder:{uri:d,name:d.path,index:0},set:{tasks:[]},configurations:{byIdentifier:{}},hasErrors:!1})})}showOutput(){this.outputChannel.appendLine("There are task errors. See the output for details.")}rerunLastTask(){return this.taskSystem.rerun()}registerTaskProvider(d,E){const f=this.providerHandler+=1;return this.providers.set(f,d),this.providerTypes.set(E,f),this._onDidRegisterTaskProvider.fire(E),{dispose:()=>{this.providers.delete(f),this.providerTypes.delete(E)}}}};t.TaskService=h,n.__decorate([(0,r.Autowired)(p.OutputService),n.__metadata("design:type",p.OutputService)],h.prototype,"outputService",void 0),n.__decorate([(0,r.Autowired)(v.IWorkspaceService),n.__metadata("design:type",Object)],h.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(o.QuickOpenService),n.__metadata("design:type",Object)],h.prototype,"quickOpenService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],h.prototype,"preferences",void 0),n.__decorate([(0,r.Autowired)(m.ITaskSystem),n.__metadata("design:type",Object)],h.prototype,"taskSystem",void 0),n.__decorate([(0,r.Autowired)(a.ITaskDefinitionRegistry),n.__metadata("design:type",Object)],h.prototype,"taskDefinitionRegistry",void 0),n.__decorate([(0,r.Autowired)(a.IProblemMatcherRegistry),n.__metadata("design:type",Object)],h.prototype,"problemMatcher",void 0),n.__decorate([(0,r.Autowired)(a.IProblemPatternRegistry),n.__metadata("design:type",Object)],h.prototype,"problemPattern",void 0),t.TaskService=h=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],h)},66893:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalTaskSystem=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(80907),p=e(1041),v=e(12968),m=e(95268),{deepClone:_}=o.objects,{Path:s}=o.path;let g=class extends o.Disposable{constructor(){super(...arguments),this.executorId=0,this.activeTaskExecutors=new Map,this._onDidStateChange=new o.Emitter,this._onDidBackgroundTaskBegin=new o.Emitter,this._onDidBackgroundTaskEnded=new o.Emitter,this._onDidProblemMatched=new o.Emitter,this.taskExecutors=[],this.onDidStateChange=this._onDidStateChange.event,this.onDidBackgroundTaskBegin=this._onDidBackgroundTaskBegin.event,this.onDidBackgroundTaskEnded=this._onDidBackgroundTaskEnded.event,this.onDidProblemMatched=this._onDidProblemMatched.event}run(h){return this.currentTask=h,this.executeTask(h)}attach(h,u){return this.currentTask=h,this.attachTask(h,u)}async buildShellConfig(h){let u="";const d=h.name,E=h.args,f=[],c=[];if(d&&(typeof d=="string"?u=d:u=d.value),f.push(u),E)for(const y of E)typeof y=="string"?f.push(y):f.push(y.value);for(const y of f)y.indexOf(s.separator)>-1?c.push(await this.resolveVariables(y.split(s.separator))):c.push(await this.resolveVariable(y));return{args:["-c",`${c.join(" ")}`]}}findAvailableExecutor(){return this.taskExecutors.find(h=>h.taskStatus===m.TaskStatus.PROCESS_EXITED)}async createTaskExecutor(h,u){const d=await this.resolveMatchers(h.configurationProperties.problemMatchers),E=new v.ProblemCollector(d),f=this.injector.get(m.TerminalTaskExecutor,[h,u,E,this.executorId]);return this.executorId+=1,this.taskExecutors.push(f),this.addDispose(f.onDidTerminalWidgetRemove(()=>{this.taskExecutors=this.taskExecutors.filter(c=>c.executorId!==f.executorId)})),f}async attachTask(h,u){const E=(await this.createTaskExecutor(h,u.launchConfig)).attach(u);return this.lastTask=h,{task:h,kind:1,promise:E}}async executeTask(h){var u,d,E;const f=h.command&&h.command.runtime===p.RuntimeType.CustomExecution,c=await this.resolveMatchers(h.configurationProperties.problemMatchers),y=new v.ProblemCollector(c),{args:b}=await this.buildShellConfig(h.command),A={name:this.createTerminalName(h),args:b,isExtensionOwnedTerminal:f,env:((u=h.command.options)===null||u===void 0?void 0:u.env)||{},cwd:!((d=h.command.options)===null||d===void 0)&&d.cwd?await this.resolveVariable((E=h.command.options)===null||E===void 0?void 0:E.cwd):await this.resolveVariable("${workspaceFolder}"),disablePreserveHistory:!0};let S=this.findAvailableExecutor(),D=!1;S?(D=!0,S.updateProblemCollector(y),S.updateLaunchConfig(A),S.reset()):S=await this.createTaskExecutor(h,A),D?this._onDidStateChange.fire(p.TaskEvent.create("start",h,S.terminalId)):this.addDispose(S.onDidTerminalCreated(T=>{this._onDidStateChange.fire(p.TaskEvent.create("start",h,T))})),D||(this.addDispose(S.onDidTaskProcessExit(T=>{this._onDidStateChange.fire(p.TaskEvent.create("processEnded",h,T)),this._onDidStateChange.fire(p.TaskEvent.create("end",h))})),this.addDispose(S.onDidBackgroundTaskBegin(()=>this._onDidBackgroundTaskBegin.fire(p.TaskEvent.create("backgroundTaskBegin",h)))),this.addDispose(S.onDidBackgroundTaskEnd(()=>this._onDidBackgroundTaskEnded.fire(p.TaskEvent.create("backgroundTaskEnded",h)))),this.addDispose(S.onDidProblemMatched(T=>this._onDidProblemMatched.fire(p.TaskEvent.create("problemMatched",h,T)))));const I=S.execute(h,D),w=h.getMapKey();return this.activeTaskExecutors.set(w,{promise:Promise.resolve(I),task:h,executor:S}),this._onDidStateChange.fire(p.TaskEvent.create("active",h)),await S.processReady.promise,this._onDidStateChange.fire(p.TaskEvent.create("processStarted",h,S.processId)),this.lastTask=h,{task:h,kind:1,promise:I}}createTerminalName(h){return(0,o.formatLocalize)("TerminalTaskSystem.terminalName",h.getQualifiedLabel()||h.configurationProperties.name)}async resolveVariables(h){const u=[];for(const d of h)u.push(await this.resolveVariable(d));return u.join(s.separator)}async resolveVariable(h){if((0,o.isString)(h))return await this.variableResolver.resolve(h);if(h!==void 0)return{value:await this.variableResolver.resolve(h.value),quoting:h.quoting};throw new Error("Should never try to resolve undefined.")}async resolveMatchers(h){if(h==null||h.length===0)return[];const u=[];for(const d of h){let E;if((0,o.isString)(d)?d[0].startsWith("$")?E=this.problemMatcher.get(d.substring(1)):E=this.problemMatcher.get(d):E=d,!E)continue;const f=E.filePrefix!==void 0;if(!f)u.push(E);else{const c=_(E);f&&(c.filePrefix=await this.resolveVariable(c.filePrefix)),u.push(c)}}return u}getActiveTasks(){return Array.from(this.activeTaskExecutors.values()).map(h=>h.task)}async terminate(h){const u=h.getMapKey(),d=this.activeTaskExecutors.get(u);if(!d)return Promise.resolve({task:void 0,success:!0});const{success:E}=await d.executor.terminate();return this.activeTaskExecutors.delete(u),{task:h,success:E}}async rerun(){return this.lastTask&&await this.executeTask(this.lastTask)}isActive(){throw new Error("Method not implemented.")}isActiveSync(){throw new Error("Method not implemented.")}getBusyTasks(){throw new Error("Method not implemented.")}canAutoTerminate(){throw new Error("Method not implemented.")}terminateAll(){throw new Error("Method not implemented.")}revealTask(h){throw new Error("Method not implemented.")}customExecutionComplete(h,u){throw new Error("Method not implemented.")}};t.TerminalTaskSystem=g,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],g.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(o.IProblemMatcherRegistry),n.__metadata("design:type",Object)],g.prototype,"problemMatcher",void 0),n.__decorate([(0,r.Autowired)(a.IVariableResolverService),n.__metadata("design:type",Object)],g.prototype,"variableResolver",void 0),t.TerminalTaskSystem=g=n.__decorate([(0,r.Injectable)()],g)},93950:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITaskSystem=t.ITaskExecutor=t.ITaskService=void 0,t.ITaskService=Symbol("ITaskService"),t.ITaskExecutor=Symbol("ITaskExecutor"),t.ITaskSystem=Symbol("ITaskSystem")},1041:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskEvent=t.TaskSorter=t.ExecutionEngine=t.InMemoryTask=t.ContributedTask=t.ConfiguringTask=t.CustomTask=t.CommonTask=t.RunOptions=t.RunOnOptions=t.TaskSourceKind=t.TaskGroup=t.CommandString=t.RuntimeType=t.PresentationOptions=t.PanelKind=t.RevealProblemKind=t.RevealKind=t.CommandOptions=t.CUSTOMIZED_TASK_TYPE=t.ShellQuoting=t.TASK_RUNNING_STATE=void 0;const n=e(40191),r=e(43718),{basename:o}=r.path;t.TASK_RUNNING_STATE=new n.RawContextKey("taskRunning",!1);var a;(function(w){w[w.Escape=1]="Escape",w[w.Strong=2]="Strong",w[w.Weak=3]="Weak"})(a||(t.ShellQuoting=a={})),t.CUSTOMIZED_TASK_TYPE="$customized",function(w){function T(R){if(!R)return w.Strong;switch(R.toLowerCase()){case"escape":return w.Escape;case"strong":return w.Strong;case"weak":return w.Weak;default:return w.Strong}}w.from=T}(a||(t.ShellQuoting=a={}));var p;(function(w){w.defaults={cwd:"${workspaceFolder}"}})(p||(t.CommandOptions=p={}));var v;(function(w){w[w.Always=1]="Always",w[w.Silent=2]="Silent",w[w.Never=3]="Never"})(v||(t.RevealKind=v={})),function(w){function T(R){switch(R.toLowerCase()){case"always":return w.Always;case"silent":return w.Silent;case"never":return w.Never;default:return w.Always}}w.fromString=T}(v||(t.RevealKind=v={}));var m;(function(w){w[w.Never=1]="Never",w[w.OnProblem=2]="OnProblem",w[w.Always=3]="Always"})(m||(t.RevealProblemKind=m={})),function(w){function T(R){switch(R.toLowerCase()){case"always":return w.Always;case"never":return w.Never;case"onproblem":return w.OnProblem;default:return w.OnProblem}}w.fromString=T}(m||(t.RevealProblemKind=m={}));var _;(function(w){w[w.Shared=1]="Shared",w[w.Dedicated=2]="Dedicated",w[w.New=3]="New"})(_||(t.PanelKind=_={})),function(w){function T(R){switch(R.toLowerCase()){case"shared":return w.Shared;case"dedicated":return w.Dedicated;case"new":return w.New;default:return w.Shared}}w.fromString=T}(_||(t.PanelKind=_={}));var s;(function(w){w.defaults={echo:!0,reveal:v.Always,revealProblems:m.Never,focus:!1,panel:_.Shared,showReuseMessage:!0,clear:!1}})(s||(t.PresentationOptions=s={}));var g;(function(w){w[w.Shell=1]="Shell",w[w.Process=2]="Process",w[w.CustomExecution=3]="CustomExecution",w[w.CustomExecution2=4]="CustomExecution2"})(g||(t.RuntimeType=g={})),function(w){function T(R){switch(R.toLowerCase()){case"shell":return w.Shell;case"process":return w.Process;case"customExecution":return w.CustomExecution;default:return w.Process}}w.fromString=T}(g||(t.RuntimeType=g={}));var l;(function(w){function T(R){return(0,r.isString)(R)?R:R.value}w.value=T})(l||(t.CommandString=l={}));var h;(function(w){w.Clean={_id:"clean",isDefault:!1},w.Build={_id:"build",isDefault:!1},w.Rebuild={_id:"rebuild",isDefault:!1},w.Test={_id:"test",isDefault:!1};function T(P){return P===w.Clean._id||P===w.Build._id||P===w.Rebuild._id||P===w.Test._id}w.is=T;function R(P){if(P!==void 0)return(0,r.isString)(P)?T(P)?{_id:P,isDefault:!1}:void 0:P}w.from=R})(h||(t.TaskGroup=h={}));var u;(function(w){w.Workspace="workspace",w.Extension="extension",w.InMemory="inMemory",w.WorkspaceFile="workspaceFile",w.User="user"})(u||(t.TaskSourceKind=u={}));var d;(function(w){w[w.default=1]="default",w[w.folderOpen=2]="folderOpen"})(d||(t.RunOnOptions=d={}));var E;(function(w){w.defaults={reevaluateOnRerun:!0,runOn:d.default}})(E||(t.RunOptions=E={}));class f{constructor(T,R,P,O,M,k){this._label="",this._id=T,R&&(this._label=R),P&&(this.type=P),this.runOptions=O,this.configurationProperties=M,this._source=k}getDefinition(T){}getMapKey(){return this._id}getRecentlyUsedKey(){}clone(){return this.fromObject(Object.assign({},this))}getWorkspaceFolder(){}getWorkspaceFileName(){}getTelemetryKind(){return"unknown"}matches(T,R=!1){if(T===void 0)return!1;if((0,r.isString)(T))return T===this._label||T===this.configurationProperties.identifier||R&&T===this._id;const P=this.getDefinition(!0);return P!==void 0&&P._key===T._key}getQualifiedLabel(){const T=this.getWorkspaceFolder();return T?`${this._label} (${T.name})`:this._label}getTaskExecution(){return{id:this._id,task:this}}addTaskLoadMessages(T){this._taskLoadMessages===void 0&&(this._taskLoadMessages=[]),T&&(this._taskLoadMessages=this._taskLoadMessages.concat(T))}get taskLoadMessages(){return this._taskLoadMessages}}t.CommonTask=f;class c extends f{constructor(T,R,P,O,M,k,F,L){super(T,P,void 0,F,L,R),this.command={},this._source=R,this.hasDefinedMatchers=k,M&&(this.command=M)}customizes(){if(this._source&&this._source.customizes)return this._source.customizes}getDefinition(T=!1){if(T&&this._source.customizes!==void 0)return this._source.customizes;{let R;switch(this.command?this.command.runtime:void 0){case g.Shell:R="shell";break;case g.Process:R="process";break;case g.CustomExecution:R="customExecution";break;case void 0:R="$composite";break;default:throw new Error("Unexpected task runtime")}return{type:R,_key:this._id,id:this._id}}}static is(T){return T instanceof c}getMapKey(){const T=this._source.config.workspaceFolder;return T?`${T.uri.toString()}|${this._id}`:this._id}getRecentlyUsedKey(){const T=this._source.config.workspaceFolder;if(!T)return;let R=this.configurationProperties.identifier;this._source.kind!==u.Workspace&&(R+=this._source.kind);const P={type:t.CUSTOMIZED_TASK_TYPE,folder:T.uri.toString(),id:R};return JSON.stringify(P)}getWorkspaceFolder(){return this._source.config.workspaceFolder}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?o(this._source.config.workspace.configuration.toString()):void 0}getTelemetryKind(){return this._source.customizes?"workspace>extension":"workspace"}fromObject(T){return new c(T._id,T._source,T._label,T.type,T.command,T.hasDefinedMatchers,T.runOptions,T.configurationProperties)}}t.CustomTask=c;class y extends f{constructor(T,R,P,O,M,k,F){super(T,P,O,k,F,R),this._source=R,this.configures=M}static is(T){return T instanceof y}fromObject(T){return T}getDefinition(){return this.configures}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?o(this._source.config.workspace.configuration.toString()):void 0}}t.ConfiguringTask=y;class b extends f{constructor(T,R,P,O,M,k,F,L,B){super(T,P,O,L,B,R),this.defines=M,this.hasDefinedMatchers=F,this.command=k}getDefinition(){return this.defines}static is(T){return T instanceof b}getMapKey(){const T=this._source.workspaceFolder;return T?`${this._source.scope.toString()}|${T.uri.toString()}|${this._id}`:`${this._source.scope.toString()}|${this._id}`}getRecentlyUsedKey(){const T={type:"contributed",scope:this._source.scope,id:this._id};return this._source.scope===3&&this._source.workspaceFolder&&(T.folder=this._source.workspaceFolder.uri.toString()),JSON.stringify(T)}getWorkspaceFolder(){return this._source.workspaceFolder}getTelemetryKind(){return"extension"}fromObject(T){return new b(T._id,T._source,T._label,T.type,T.defines,T.command,T.hasDefinedMatchers,T.runOptions,T.configurationProperties)}}t.ContributedTask=b;class A extends f{constructor(T,R,P,O,M,k){super(T,P,O,M,k,R),this._source=R}static is(T){return T instanceof A}getTelemetryKind(){return"composite"}fromObject(T){return new A(T._id,T._source,T._label,T.type,T.runOptions,T.configurationProperties)}}t.InMemoryTask=A;var S;(function(w){w[w.Process=1]="Process",w[w.Terminal=2]="Terminal"})(S||(t.ExecutionEngine=S={})),function(w){w._default=w.Terminal}(S||(t.ExecutionEngine=S={}));class D{constructor(T){this._order=new Map;for(let R=0;R<T.length;R++)this._order.set(T[R].uri.toString(),R)}compare(T,R){const P=T.getWorkspaceFolder(),O=R.getWorkspaceFolder();if(P&&O){let M=this._order.get(P.uri.toString());M=M===void 0?0:M+1;let k=this._order.get(O.uri.toString());return k=k===void 0?0:k+1,M===k?T._label.localeCompare(R._label):M-k}else return!P&&O?-1:P&&!O?1:0}}t.TaskSorter=D;var I;(function(w){function T(R,P,O){if(P){const M={kind:R,taskId:P._id,taskName:P.configurationProperties.name,runType:P.configurationProperties.isBackground?"background":"singleRun",group:P.configurationProperties.group,processId:void 0,exitCode:void 0,terminalId:void 0,__task:P};return R==="start"?M.terminalId=O:R==="processStarted"?M.processId=O:R==="processEnded"?M.exitCode=O:R==="problemMatched"&&(M.problems=O),Object.freeze(M)}else return Object.freeze({kind:"changed"})}w.create=T})(I||(t.TaskEvent=I={}))},90305:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608),r=n.__importDefault(e(14041)),o=n.__importDefault(e(75655));let a=0,p=null;t.default=v=>{const{start:m,stop:_,self:s,left:g,right:l,wholeWidth:h,last:u}=v,d=c=>{a=c.clientX,p=s,m()},E=c=>{if(!a)return!1;const y=c.clientX,b=(y-a)/h*100;a=y,b<0?(s&&s.increase(b),l&&l.increase(-b)):p&&p===g&&(s&&s.increase(-b),g&&g.increase(b))},f=c=>{a=0,p=null,s.resize(),g&&g.resize(),l&&l.resize(),_()};return r.default.createElement("div",{className:o.default.resizeDelegetContainer,onMouseUp:f,onMouseMove:E},!u&&r.default.createElement("div",{className:o.default.resizeDelegateBar,onMouseDown:d,onMouseUp:f}))}},92699:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResizeDirection=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),a=e(41869),p=e(7473),v=n.__importDefault(e(90305)),m=n.__importDefault(e(75655));var _;(function(l){l[l.vertical=0]="vertical",l[l.horizontal=1]="horizontal"})(_||(t.ResizeDirection=_={}));const s=({index:l,widget:h,wholeWidth:u,setEvent:d,self:E,left:f,right:c,last:y})=>{const b=(0,a.useAutorun)(h.shadowDynamic);return o.default.createElement("div",{key:`resize-item-${l}`,style:{width:`${b}%`},className:m.default.resizeHandler},o.default.createElement(v.default,{wholeWidth:u,start:()=>d(!0),stop:()=>d(!1),self:E,left:f,right:c,last:y}))},g=({widget:l,dynamic:h,draw:u,handleRemoveWidget:d,widgetsLength:E})=>{const f=(0,a.useAutorun)(h);return o.default.createElement("div",{key:l.id,style:{width:`${f}%`},className:m.default.resizeItem},u(l),E>1&&o.default.createElement("div",{className:(0,r.default)(m.default.closeBtn,(0,a.getIcon)("close")),onClick:()=>{d(l.id)}}))};t.default=l=>{const{group:h,shadow:u}=l,d=(0,a.useAutorun)(h.widgets),[E,f]=o.default.useState(!1),[c,y]=o.default.useState(1/0),b=(0,a.useInjectable)(p.ITerminalGroupViewService),A=o.default.useRef(null);o.default.useEffect(()=>{A.current&&A.current.clientHeight!==c&&y(A.current.clientWidth)});const S=o.default.useCallback(D=>{b.removeWidget(D)},[]);return o.default.createElement("div",{className:m.default.resizeWrapper,ref:A},o.default.createElement("div",{style:{pointerEvents:E?"all":"none"},className:m.default.resizeDelegate},d&&d.map((D,I)=>{const w=I-1>-1?d[I-1]:null,T=d[I],R=I+1<d.length?d[I+1]:null;return o.default.createElement(s,{key:I,index:I,widget:D,wholeWidth:c,setEvent:f,self:T,left:w,right:R,last:I===d.length-1})})),o.default.createElement("div",{style:{pointerEvents:E?"none":"all"},className:m.default.resizePanel},d&&d.map(D=>o.default.createElement(g,{key:D.id,widget:D,dynamic:u?D.dynamic:D.shadowDynamic,draw:l.draw,handleRemoveWidget:S,widgetsLength:d.length}))))}},70483:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalSearch=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),a=e(97267),p=e(41869),v=e(26405),m=n.__importDefault(e(50587));t.TerminalSearch=o.default.memo(_=>{const s=(0,p.useInjectable)(v.ITerminalSearchService),[g,l]=o.default.useState(s.UIState),[h,u]=o.default.useState(null),[d,E]=o.default.useState(s.text||""),f=o.default.useRef(null);o.default.useEffect(()=>{const T=s.onVisibleChange(R=>{R&&f.current&&(f.current.focus(),f.current.value.length>0&&f.current.setSelectionRange(0,f.current.value.length))});return()=>T.dispose()},[s]),o.default.useEffect(()=>{if(!s.onResultChange)return;const T=s.onResultChange(R=>{u(R)});return()=>T.dispose()},[s]);const c=o.default.useCallback(T=>{s.text=T.target.value,s.search(),E(T.target.value)},[s]),y=o.default.useCallback(T=>{T.key==="Enter"&&s.search(),T.key==="Escape"&&(s.close(),s.clear())},[s]),b=o.default.useCallback(()=>{s.updateUIState({isMatchCase:!g.isMatchCase}),l(s.UIState)},[s,g]),A=o.default.useCallback(()=>{s.updateUIState({isUseRegexp:!g.isUseRegexp}),l(s.UIState)},[s,g]),S=o.default.useCallback(()=>{s.updateUIState({isWholeWord:!g.isWholeWord}),l(s.UIState)},[s,g]),D=o.default.useCallback(()=>{s.searchNext()},[s]),I=o.default.useCallback(()=>{s.searchPrevious()},[s]),w=o.default.useCallback(()=>{s.close()},[s]);return o.default.createElement("div",{className:m.default.terminalSearch},o.default.createElement(a.ValidateInput,{className:m.default.searchField,autoFocus:!0,id:"search-input-field",title:(0,p.localize)("search.input.placeholder"),type:"text",value:d,placeholder:(0,p.localize)("common.find"),onKeyDown:y,onChange:c,ref:f,validateMessage:void 0,addonAfter:[o.default.createElement("span",{key:(0,p.localize)("search.caseDescription"),className:(0,r.default)((0,p.getIcon)("ab"),m.default["match-case"],m.default.optionBtn,{[m.default.select]:g.isMatchCase}),title:(0,p.localize)("search.caseDescription"),onClick:b}),o.default.createElement("span",{key:(0,p.localize)("search.wordsDescription"),className:(0,r.default)((0,p.getIcon)("abl"),m.default["whole-word"],m.default.optionBtn,{[m.default.select]:g.isWholeWord}),title:(0,p.localize)("search.wordsDescription"),onClick:S}),o.default.createElement("span",{key:(0,p.localize)("search.regexDescription"),className:(0,r.default)((0,p.getIcon)("regex"),m.default["use-regexp"],m.default.optionBtn,{[m.default.select]:g.isUseRegexp}),title:(0,p.localize)("search.regexDescription"),onClick:A})]}),o.default.createElement("div",{className:m.default.searchResult},h?`${h.resultIndex+1}/${h.resultCount}`:"0/0"),o.default.createElement("div",{className:(0,r.default)(m.default.panelBtn,(0,p.getIcon)("up")),onClick:I}),o.default.createElement("div",{className:(0,r.default)(m.default.panelBtn,(0,p.getIcon)("down")),onClick:D}),o.default.createElement("div",{className:(0,r.default)(m.default.panelBtn,(0,p.getIcon)("close")),onClick:w}))})},65586:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.renderAddItem=t.renderInfoItem=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(12784)),a=n.__importStar(e(14041)),p=e(80564),v=e(41869),m=e(89897),_=e(1149),s=e(7443),g=e(26405),l=n.__importDefault(e(99886)),h=d=>{var E,f,c,y;const b=(0,v.useInjectable)(s.IconService),A=(0,o.default)(()=>d.onClick&&d.onClick(),20),S=(0,o.default)(()=>d.onClose&&d.onClose(),20),D=(0,v.useDesignStyles)(l.default.item_container,"item_container"),I=(0,v.useDesignStyles)(l.default.tab_item_selected,"tab_item_selected"),w=(0,v.useDesignStyles)(l.default.item_info_name,"item_info_name"),T=(0,v.useDesignStyles)(l.default.tab_close_icon,"tab_close_icon"),R=(0,v.useInjectable)(_.LayoutViewSizeConfig),P=(0,a.useRef)(null),{group:O}=d;if(!O)return null;const{options:M,id:k}=O,F=(0,v.useAutorun)(O.editable),L=(0,v.useAutorun)(O.snapshot),B=(0,a.useCallback)(Z=>{Z.key==="Enter"&&d.onInputEnter&&k&&d.onInputEnter(k,Z.target.value)},[k,d.onInputEnter]);(0,a.useEffect)(()=>{var Z;d.selected&&((Z=P.current)===null||Z===void 0||Z.scrollIntoView())},[P,d.selected]);let U;M?.icon&&(!((E=M.icon)===null||E===void 0)&&E.id?U=b.fromString(`$(${(f=M.icon)===null||f===void 0?void 0:f.id})`):M.icon instanceof v.URI?U=b.fromIcon(M?.icon.toString()):(!((c=M.icon)===null||c===void 0)&&c.light||!((y=M?.icon)===null||y===void 0)&&y.dark)&&(U=d.theme==="light"?b.fromIcon(M.icon.light.toString()):b.fromIcon(M.icon.dark.toString())));const W=(0,a.useCallback)(Z=>{var $;($=d.onDragStart)===null||$===void 0||$.call(d,Z)},[d.onDragStart]),j=(0,a.useCallback)(Z=>{Z.preventDefault(),P.current&&P.current.classList.add("on-drag-over")},[P]),Q=(0,a.useCallback)(()=>{P.current&&P.current.classList.remove("on-drag-over")},[P]),G=(0,a.useCallback)(Z=>{var $;P.current&&P.current.classList.remove("on-drag-over"),($=d.onDrop)===null||$===void 0||$.call(d,Z)},[P,d.onDrop]);return a.default.createElement("div",{draggable:d.draggable,onDragStart:W,onDragOver:j,onDragLeave:Q,onDrop:G,ref:P,className:(0,r.default)({[D]:!0,[I]:!!d.selected}),style:{height:R.panelTitleBarHeight},onClick:()=>A(),onContextMenu:Z=>d.onContextMenu&&d.onContextMenu(Z)},F?a.default.createElement("input",{autoFocus:!0,ref:Z=>Z&&Z.select(),className:l.default.item_info_input,defaultValue:L,onClick:Z=>Z.stopPropagation(),onBlur:()=>d.onInputBlur&&O.id&&d.onInputBlur(O.id),onKeyDown:Z=>B(Z)}):a.default.createElement("div",{id:O.id,className:w,title:L},L!==""?a.default.createElement(a.default.Fragment,null,a.default.createElement(p.Icon,{iconClass:U||(0,v.getIcon)(L?.toLowerCase()||"terminal")||(0,v.getIcon)("terminal"),style:{marginRight:4,color:"inherit",fontSize:14}}),a.default.createElement("span",{className:l.default.item_title},L)):a.default.createElement(m.Loading,null)),F?a.default.createElement("div",null):a.default.createElement("div",{className:(0,r.default)([(0,v.getIcon)("close"),T]),onClick:Z=>{Z.stopPropagation(),S()}}))};t.renderInfoItem=h;const u=d=>{const E=(0,o.default)(()=>d.onClick&&d.onClick(),20),f=d.getKeybinding&&d.getKeybinding(v.TERMINAL_COMMANDS.ADD.id),c=f?`${(0,v.localize)("terminal.new")}(${f})`:(0,v.localize)("terminal.new"),y=(0,v.useDesignStyles)(l.default.tab_item_wrapper,"tab_item_wrapper");return a.default.createElement("div",{className:y},a.default.createElement("div",{title:c,className:(0,r.default)({[(0,v.getIcon)("plus")]:!0,[l.default.item_add]:!0}),onClick:()=>E()}),a.default.createElement("div",{title:(0,v.localize)("terminal.new.type"),className:(0,r.default)({[(0,v.getIcon)("down")]:!0,[l.default.item_more]:!0}),onClick:d.onDropdown}))};t.renderAddItem=u,t.default=d=>{switch(d.type||g.ItemType.info){case g.ItemType.info:return(0,a.createElement)(d.provider.infoItemRender,d);case g.ItemType.add:return(0,a.createElement)(d.provider.addItemRender,d);default:return null}}},17632:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),a=e(41869),p=e(52416),v=e(26405),m=e(88023),_=n.__importDefault(e(65586)),s=n.__importDefault(e(99886));t.default=()=>{const g=(0,a.useInjectable)(v.ITerminalGroupViewService),l=(0,a.useInjectable)(v.ITerminalRenderProvider),h=(0,a.useInjectable)(m.TerminalContextMenuService),u=(0,a.useInjectable)(p.IThemeService),d=(0,a.useInjectable)(a.KeybindingRegistry),E=(0,r.useRef)(),[f,c]=(0,r.useState)("dark"),y=(0,a.useDesignStyles)(s.default.tab_contents,"tab_contents"),b=(0,a.useDesignStyles)(s.default.tabs,"tabs"),A=(0,a.useAutorun)(g.groups),S=(0,a.useAutorun)(g.currentGroup),D=(0,r.useCallback)(()=>(u.getCurrentTheme().then(w=>{c(w.type)}),u.onThemeChange(w=>{c(w.type)})),[f,u]);(0,r.useEffect)(()=>{const w=D();return()=>{w.dispose()}},[]);const I=(0,r.useMemo)(()=>A.filter(Boolean),[A]);return r.default.createElement("div",{className:s.default.view_container},r.default.createElement("div",{className:b},r.default.createElement(o.Scrollbars,{forwardedRef:w=>w?E.current=w.ref:null},r.default.createElement("div",{className:y},I.map((w,T)=>r.default.createElement(_.default,{draggable:!0,onDragStart:R=>{R.dataTransfer.setData("groupIndex",String(T))},onDrop:R=>{if(R.preventDefault(),R.dataTransfer.getData("groupIndex")){const P=R.dataTransfer.getData("groupIndex");g.swapGroup(Number(P),T),g.selectGroup(T)}},key:w.id,group:w,selected:S&&S.id===w.id,onInputBlur:()=>w.unedit(),onInputEnter:(R,P)=>w.rename(P),onClick:()=>g.selectGroup(T),onClose:()=>g.removeGroup(T),onContextMenu:R=>h.onTabContextMenu(R,T),provider:l,theme:f})),r.default.createElement("div",{className:s.default.button},r.default.createElement(_.default,{type:v.ItemType.add,onClick:()=>{const w=g.createGroup(),T=g.getGroup(w);g.createWidget(T),g.selectGroup(w)},getKeybinding:w=>{const T=d.getKeybindingsForCommand(w);return Array.isArray(T)&&T[0]&&d.acceleratorFor(T[0],"")[0]||""},onDropdown:w=>h.onDropDownContextMenu(w),provider:l,theme:f}))))))}},7066:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalVariable=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(43718),a=e(94620),p=n.__importDefault(e(74599));function v(_,s){_.forEach((g,l)=>{g.forEach(h=>{s.add((0,a.mutatorTypeLabel)(h.type,h.value,l))})})}const m=({diff:_})=>{const s=r.default.useMemo(()=>{const l=new Set;return _?.added&&_?.added.size>0&&v(_.added,l),_?.changed&&_.changed.size>0&&v(_.changed,l),Array.from(l.values())},[_]),g=r.default.useMemo(()=>{if(!_?.removed||_?.removed.size===0)return[];const l=new Set;return v(_.removed,l),Array.from(l.values())},[_]);return r.default.createElement("div",{className:p.default.variable_container},s.length>0&&r.default.createElement(r.default.Fragment,null,r.default.createElement("h3",null,(0,o.localize)("terminal.environment.changes")),s.map((l,h)=>r.default.createElement("p",{key:l+h,className:p.default.variable_change},l))),g.length>0&&r.default.createElement(r.default.Fragment,null,r.default.createElement("h3",null,(0,o.localize)("terminal.environment.removal")),g.map((l,h)=>r.default.createElement("p",{key:l+h,className:p.default.variable_change},l))))};t.TerminalVariable=m},48139:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608),r=n.__importDefault(e(12784)),o=n.__importDefault(e(14041)),a=e(41869),p=e(26405),v=n.__importStar(e(92699)),m=e(70483),_=n.__importDefault(e(73567)),s=n.__importDefault(e(76970));e(86650),t.default=()=>{const g=(0,a.useInjectable)(p.ITerminalController),l=(0,a.useInjectable)(p.ITerminalSearchService),h=(0,a.useInjectable)(p.ITerminalErrorService),u=(0,a.useInjectable)(p.ITerminalNetwork),d=o.default.useRef(null),E=(0,a.useInjectable)(p.ITerminalGroupViewService),f=(0,a.useAutorun)(E.currentGroupId),c=(0,a.useAutorun)(E.currentGroupIndex),y=(0,a.useAutorun)(E.groups),[b,A]=o.default.useState(g.themeBackground);(0,a.useEventEffect)(g.onThemeBackgroundChange,P=>{A(P)});const[S,D]=o.default.useState(h.errors),I=(0,r.default)(()=>{D(h.errors)},a.FRAME_THREE);(0,a.useEventEffect)(h.onErrorsChange,I);const w=o.default.useCallback((P,O)=>{const M=g.findClientFromWidgetId(P.id);let k;return M?k=u.shouldReconnect(M.id)?void 0:S.get(M.id):k=S.get(P.id),o.default.createElement(s.default,{show:c===O,error:k,widget:P})},[c,g,S,u,E]),[T,R]=o.default.useState(l.isVisible);return(0,a.useEventEffect)(l.onVisibleChange,P=>{R(P)}),o.default.useEffect(()=>{d.current&&(g.initContextKey(d.current),g.viewReady.resolve())},[d.current]),o.default.createElement("div",{ref:d,className:_.default.terminalWrapper,style:{backgroundColor:b},"data-group-current":f},T&&o.default.createElement(m.TerminalSearch,null),y.map((P,O)=>{if(P.activated.get())return o.default.createElement("div",{"data-group-rendered":P.activated.get(),key:`terminal-${P.id}`,style:{display:c===O?"block":"none"},className:_.default.group,onFocus:g.focus.bind(g),onBlur:g.blur.bind(g),onContextMenu:g.onContextMenu.bind(g)},o.default.createElement(v.default,{shadow:!1,useFlex:!1,direction:v.ResizeDirection.horizontal,group:P,draw:M=>w(M,O)}))}))}},76970:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),a=e(26405),p=n.__importDefault(e(73567));function v(m,_,s){const g=()=>{s.removeWidget(m.id)},l=()=>{_.fix(m.id)};return m?.type===a.ETerminalErrorType.CREATE_FAIL?r.default.createElement("div",{className:p.default.terminalCover},r.default.createElement("div",null,(0,o.localize)("terminal.can.not.create"),": ",m.message),r.default.createElement("div",null,r.default.createElement("a",{onClick:g},(0,o.localize)("terminal.stop")),(0,o.localize)("terminal.or"),r.default.createElement("a",{onClick:l},(0,o.localize)("terminal.try.recreate")))):m.stopped?r.default.createElement("div",{className:p.default.terminalCover},r.default.createElement("div",null,(0,o.localize)("terminal.disconnected")),r.default.createElement("div",null,(0,o.localize)("terminal.can.not.reconnect"),r.default.createElement("a",{onClick:l},(0,o.localize)("terminal.try.reconnect")))):r.default.createElement("div",{className:p.default.terminalCover},r.default.createElement("div",null,(0,o.localize)("terminal.disconnected")),r.default.createElement("div",null,r.default.createElement("a",{onClick:g},(0,o.localize)("terminal.stop")),(0,o.localize)("terminal.or"),r.default.createElement("a",{onClick:l},(0,o.localize)("terminal.try.reconnect"))))}t.default=({widget:m,error:_,show:s})=>{const g=r.default.useRef(null),l=(0,o.useInjectable)(a.ITerminalErrorService),h=(0,o.useInjectable)(a.ITerminalGroupViewService);r.default.useEffect(()=>{if(g.current&&m.element)g.current.appendChild(m.element);else if(g.current&&!m.element){const d=document.createElement("div");g.current.appendChild(d),d.className=p.default.terminalContent,m.element=d}},[]),r.default.useEffect(()=>{m.show=s},[s]),r.default.useEffect(()=>{m.error=!!_},[_]);const u=()=>{h.selectWidget(m.id)};return r.default.createElement("div",{className:p.default.terminalContainer},_?v(_,l,h):null,r.default.createElement("div",{"data-term-id":m.id,style:{display:_?"none":"block"},className:p.default.terminalContentWrapper,onFocus:u,ref:g}))}},21623:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(71852),t),n.__exportStar(e(43397),t),n.__exportStar(e(7082),t),n.__exportStar(e(11476),t),n.__exportStar(e(63341),t),n.__exportStar(e(96051),t),n.__exportStar(e(79404),t)},71852:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalCommandContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(63067),p=e(26405),v=e(48520),m=e(35628),_=e(94620);let s=class{onReconnect(){this.terminalController.reconnect()}onDisposeSideEffects(){}setDefaultTerminalType(l){this.preference.update("terminal.type",l)}registerCommands(l){l.registerCommand({...o.TERMINAL_COMMANDS.OPEN_SEARCH,iconClass:(0,o.getIcon)("search")},{execute:()=>{if(this.search.isVisible){this.search.close();return}this.search.open()}}),l.registerCommand({...o.TERMINAL_COMMANDS.SPLIT,iconClass:(0,o.getIcon)("embed")},{execute:()=>{const h=this.view.currentGroup.get();if(!h)return;const u=this.view.createWidget(h);this.view.selectWidget(u.id)}}),l.registerCommand(o.TERMINAL_COMMANDS.CLEAR,{execute:()=>{this.view.clear()}}),l.registerCommand(o.TERMINAL_COMMANDS.ADD,{execute:async()=>{await this.terminalController.createTerminalWithWidget({}),this.terminalController.showTerminalPanel()}}),l.registerCommand(o.TERMINAL_COMMANDS.TOGGLE_TERMINAL,{execute:()=>{this.terminalController.toggleTerminalPanel()}}),l.registerCommand(o.TERMINAL_COMMANDS.SEARCH_NEXT,{execute:()=>{this.search.isVisible?this.search.search():this.search.open()}}),l.registerCommand({...o.TERMINAL_COMMANDS.REMOVE,iconClass:(0,o.getIcon)("delete")},{execute:async()=>{const h=this.view.currentWidgetId.get();h&&this.view.removeWidget(h)}}),l.registerCommand(o.TERMINAL_COMMANDS.OPEN_WITH_PATH,{execute:async h=>{h&&(await this.terminalApi.createTerminal({cwd:h.codeUri.fsPath})).show()}}),l.registerCommand(o.TERMINAL_COMMANDS.TAB_RENAME,{execute:async(h,u)=>{const d=this.view.getGroup(u);d&&d.edit()}}),l.registerCommand({...o.TERMINAL_COMMANDS.SELECT_ALL_CONTENT},{execute:()=>{const h=this.view.currentWidgetId.get(),u=this.terminalController.findClientFromWidgetId(h);u&&u.selectAll()}}),l.registerCommand({...o.TERMINAL_COMMANDS.CLEAR_CONTENT,iconClass:(0,o.getIcon)("clear")},{execute:()=>{const h=this.view.currentWidgetId.get(),u=this.terminalController.findClientFromWidgetId(h);u&&u.clear()}}),l.registerCommand({...o.TERMINAL_COMMANDS.CLEAR_ALL_CONTENT},{execute:()=>{this.terminalController.clearAllGroups()}}),l.registerCommand(o.TERMINAL_COMMANDS.SELECT_ZSH,{execute:async()=>{this.setDefaultTerminalType("zsh")}}),l.registerCommand(o.TERMINAL_COMMANDS.SELECT_BASH,{execute:async()=>{this.setDefaultTerminalType("bash")}}),l.registerCommand(o.TERMINAL_COMMANDS.SELECT_SH,{execute:async()=>{this.setDefaultTerminalType("sh")}}),l.registerCommand(o.TERMINAL_COMMANDS.SELECT_POWERSHELL,{execute:async()=>{this.setDefaultTerminalType("powershell")}}),l.registerCommand(o.TERMINAL_COMMANDS.SELECT_CMD,{execute:async()=>{this.setDefaultTerminalType("cmd")}}),l.registerCommand(o.TERMINAL_COMMANDS.MORE_SETTINGS,{execute:async()=>{this.commands.executeCommand(o.COMMON_COMMANDS.OPEN_PREFERENCES.id,"terminal")}}),l.registerCommand(o.TERMINAL_COMMANDS.COPY,{execute:async()=>{const h=this.view.currentWidgetId.get(),u=this.terminalController.findClientFromWidgetId(h);u&&await this.clipboardService.writeText(u.getSelection())}}),l.registerCommand(o.TERMINAL_COMMANDS.PASTE,{execute:async()=>{const h=this.view.currentWidgetId.get(),u=this.terminalController.findClientFromWidgetId(h);u&&u.paste(await this.clipboardService.readText())}}),l.registerCommand(o.TERMINAL_COMMANDS.SELECT_ALL,{execute:()=>{const h=this.view.currentWidgetId.get(),u=this.terminalController.findClientFromWidgetId(h);u&&u.selectAll()}}),l.registerCommand(o.TERMINAL_COMMANDS.RE_LAUNCH,{execute:()=>{const h=this.view.groups.get();for(const u of h)u.widgets.get().forEach(E=>{const f=this.terminalController.findClientFromWidgetId(E.id);f&&f.reset()})}}),l.registerCommand(o.COMMON_COMMANDS.ENVIRONMENT_VARIABLE,{execute:async()=>await this.terminalEnvironmentService.getProcessEnv()}),l.registerCommand(o.TERMINAL_COMMANDS.FOCUS_NEXT_TERMINAL,{execute:()=>{const h=this.view.currentGroup.get();if(h&&h.widgets.get().length<=1)return;const u=this.getNextOrPrevTerminalClient("next");u?.focus()}}),l.registerCommand(o.TERMINAL_COMMANDS.FOCUS_PREVIOUS_TERMINAL,{execute:()=>{const h=this.view.currentGroup.get();if(h&&h.widgets.get().length<=1)return;const u=this.getNextOrPrevTerminalClient("prev");u?.focus()}}),l.registerCommand(o.TERMINAL_COMMANDS.KILL_PROCESS,{execute:async()=>{const h=this.view.currentWidgetId.get(),u=this.terminalController.findClientFromWidgetId(h);if(u){const d=u.getSelection();d&&d.length>0?await this.clipboardService.writeText(u.getSelection()):await this.terminalApi.sendText(h,"")}}})}getNextOrPrevTerminalClient(l){const h=this.view.currentGroup.get();if(!h)return;const u=h.widgets.get(),d=u.findIndex(c=>c.id===this.view.currentWidgetId.get());let E;l==="next"?E=d===u.length-1?0:d+1:E=d===0?u.length-1:d-1;const f=u[E];return this.terminalController.findClientFromWidgetId(f.id)}};t.TerminalCommandContribution=s,n.__decorate([(0,r.Autowired)(p.ITerminalController),n.__metadata("design:type",Object)],s.prototype,"terminalController",void 0),n.__decorate([(0,r.Autowired)(_.EnvironmentVariableServiceToken),n.__metadata("design:type",v.TerminalEnvironmentService)],s.prototype,"terminalEnvironmentService",void 0),n.__decorate([(0,r.Autowired)(p.ITerminalGroupViewService),n.__metadata("design:type",Object)],s.prototype,"view",void 0),n.__decorate([(0,r.Autowired)(p.ITerminalSearchService),n.__metadata("design:type",Object)],s.prototype,"search",void 0),n.__decorate([(0,r.Autowired)(p.ITerminalRestore),n.__metadata("design:type",Object)],s.prototype,"store",void 0),n.__decorate([(0,r.Autowired)(p.ITerminalApiService),n.__metadata("design:type",Object)],s.prototype,"terminalApi",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],s.prototype,"preference",void 0),n.__decorate([(0,r.Autowired)(o.IPreferenceSettingsService),n.__metadata("design:type",Object)],s.prototype,"settingService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],s.prototype,"commands",void 0),n.__decorate([(0,r.Autowired)(a.IMainLayoutService),n.__metadata("design:type",Object)],s.prototype,"mainlayoutService",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],s.prototype,"config",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",m.TerminalKeyBoardInputService)],s.prototype,"terminalInput",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],s.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(o.IClipboardService),n.__metadata("design:type",Object)],s.prototype,"clipboardService",void 0),t.TerminalCommandContribution=s=n.__decorate([(0,o.Domain)(o.CommandContribution,o.ClientAppContribution)],s)},63341:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalKeybindingContribution=void 0;const n=e(85608),r=e(41869),o=e(66e3),a=e(40191),p=e(43718);let v=class{registerKeybindings(_){_.registerKeybinding({command:r.TERMINAL_COMMANDS.OPEN_SEARCH.id,keybinding:"ctrlcmd+f",when:o.IsTerminalFocused.raw}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.CLEAR_CONTENT.id,keybinding:"ctrlcmd+k",when:o.IsTerminalFocused.raw}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.SEARCH_NEXT.id,keybinding:"ctrlcmd+g",when:o.IsTerminalFocused.raw}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.COPY.id,keybinding:p.isWindows?"ctrlcmd+shift+c":"ctrlcmd+c",when:a.RawContextKey.and(o.IsTerminalFocused.raw,"locationProtocol != http")}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.KILL_PROCESS.id,keybinding:"ctrlcmd+c",when:a.RawContextKey.and(o.IsTerminalFocused.raw,"locationProtocol != http","isWindows")}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.PASTE.id,keybinding:p.isWindows?"ctrlcmd+shift+v":"ctrlcmd+v",when:a.RawContextKey.and(o.IsTerminalFocused.raw,"locationProtocol != http")}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.SELECT_ALL.id,keybinding:"ctrlcmd+a",when:o.IsTerminalFocused.raw}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.SPLIT.id,keybinding:"ctrlcmd+\\",when:o.IsTerminalFocused.raw}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.ADD.id,keybinding:"ctrl+shift+`"}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.FOCUS_NEXT_TERMINAL.id,keybinding:"ctrlcmd+alt+right",when:o.IsTerminalFocused.raw}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.FOCUS_NEXT_TERMINAL.id,keybinding:"ctrlcmd+alt+down",when:o.IsTerminalFocused.raw}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.FOCUS_PREVIOUS_TERMINAL.id,keybinding:"ctrlcmd+alt+left",when:o.IsTerminalFocused.raw}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.FOCUS_PREVIOUS_TERMINAL.id,keybinding:"ctrlcmd+alt+up",when:o.IsTerminalFocused.raw}),_.registerKeybinding({command:r.TERMINAL_COMMANDS.TOGGLE_TERMINAL.id,keybinding:"ctrl+`"})}};t.TerminalKeybindingContribution=v,t.TerminalKeybindingContribution=v=n.__decorate([(0,p.Domain)(r.KeybindingContribution)],v)},43397:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalLifeCycleContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(63067),p=e(26405),v=e(94620),m=e(43395),_=e(35628);let s=class{initialize(){(0,m.registerTerminalColors)()}onStart(){this.terminalInput.listen(),this.environmentService.initEnvironmentVariableCollections()}onDidRender(){this.store.restore().then(()=>{this.terminalController.firstInitialize()})}onStop(){this.terminalController.disposeTerminalClients({isTaskExecutor:!0}),this.store.save()}};t.TerminalLifeCycleContribution=s,n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",_.TerminalKeyBoardInputService)],s.prototype,"terminalInput",void 0),n.__decorate([(0,r.Autowired)(p.ITerminalController),n.__metadata("design:type",Object)],s.prototype,"terminalController",void 0),n.__decorate([(0,r.Autowired)(p.ITerminalRestore),n.__metadata("design:type",Object)],s.prototype,"store",void 0),n.__decorate([(0,r.Autowired)(v.EnvironmentVariableServiceToken),n.__metadata("design:type",Object)],s.prototype,"environmentService",void 0),t.TerminalLifeCycleContribution=s=n.__decorate([(0,o.Domain)(o.ClientAppContribution,a.MainLayoutContribution)],s)},7082:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalMenuContribution=t.more2=t.more1Sub=t.more1=t.group=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(30144),p=e(93899),v=e(43718),m=e(26405);t.group="panel_menu",t.more1="more_1",t.more1Sub="more_1_sub",t.more2="more_2";let _=class{registerMenus(g){g.registerMenuItem(p.MenuId.TerminalTabContext,{command:{id:o.TERMINAL_COMMANDS.TAB_RENAME.id,label:(0,o.localize)("terminal.menu.rename")},order:1,group:t.group}),g.registerMenuItem(p.MenuId.TerminalTabContext,{command:{id:o.TERMINAL_COMMANDS.SPLIT.id,label:(0,o.localize)("terminal.menu.split")},order:2,group:t.group}),g.registerMenuItem(p.MenuId.TerminalTabContext,{command:{id:o.TERMINAL_COMMANDS.REMOVE.id,label:(0,o.localize)("terminal.menu.stopGroup")},order:3,group:t.group}),g.registerMenuItem(p.MenuId.TerminalInstanceContext,{command:o.TERMINAL_COMMANDS.COPY,group:"1_modify"}),g.registerMenuItem(p.MenuId.TerminalInstanceContext,{command:o.TERMINAL_COMMANDS.PASTE,group:"1_modify"}),g.registerMenuItem(p.MenuId.TerminalInstanceContext,{command:o.TERMINAL_COMMANDS.SELECT_ALL,group:"1_modify"}),g.registerMenuItem(p.MenuId.TerminalInstanceContext,{command:o.TERMINAL_COMMANDS.CLEAR_CONTENT,group:"1_modify"});const l=(0,o.getSlotLocation)("@opensumi/ide-terminal-next",this.config.layoutConfig),h=(0,o.getTabbarCtxKey)(l),u=(0,p.getTabbarCommonMenuId)(l),d=`${h} == ${a.TERMINAL_CONTAINER_ID}`;g.registerMenuItem(u,{command:o.TERMINAL_COMMANDS.CLEAR,order:1,group:t.more1,when:d}),g.registerMenuItem(u,{command:o.TERMINAL_COMMANDS.CLEAR_ALL_CONTENT,order:1,group:t.more1,when:d}),g.registerMenuItem(u,{label:(0,o.localize)("terminal.menu.selectType"),submenu:p.MenuId.TerminalDefaultTypeMenu,order:1,group:t.more2,when:d}),v.isWindows?g.registerMenuItems(p.MenuId.TerminalDefaultTypeMenu,[{command:o.TERMINAL_COMMANDS.SELECT_CMD,order:1,group:t.more1Sub,toggledWhen:"config.terminal.type == cmd",when:d},{command:o.TERMINAL_COMMANDS.SELECT_POWERSHELL,order:2,group:t.more1Sub,toggledWhen:"config.terminal.type == powershell",when:d}]):g.registerMenuItems(p.MenuId.TerminalDefaultTypeMenu,[{command:o.TERMINAL_COMMANDS.SELECT_ZSH,order:1,group:t.more1Sub,toggledWhen:"config.terminal.type == zsh",when:d},{command:o.TERMINAL_COMMANDS.SELECT_BASH,order:2,group:t.more1Sub,toggledWhen:"config.terminal.type == bash",when:d},{command:o.TERMINAL_COMMANDS.SELECT_SH,order:3,group:t.more1Sub,toggledWhen:"config.terminal.type == sh",when:d}]),g.registerMenuItem(u,{command:o.TERMINAL_COMMANDS.MORE_SETTINGS,order:1,group:t.more2,when:d})}};t.TerminalMenuContribution=_,n.__decorate([(0,r.Autowired)(m.ITerminalController),n.__metadata("design:type",Object)],_.prototype,"terminalController",void 0),n.__decorate([(0,r.Autowired)(m.ITerminalGroupViewService),n.__metadata("design:type",Object)],_.prototype,"view",void 0),n.__decorate([(0,r.Autowired)(m.ITerminalSearchService),n.__metadata("design:type",Object)],_.prototype,"search",void 0),n.__decorate([(0,r.Autowired)(o.IPreferenceSettingsService),n.__metadata("design:type",Object)],_.prototype,"settingService",void 0),n.__decorate([(0,r.Autowired)(v.CommandService),n.__metadata("design:type",Object)],_.prototype,"commands",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],_.prototype,"config",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],_.prototype,"preference",void 0),t.TerminalMenuContribution=_=n.__decorate([(0,v.Domain)(p.MenuContribution)],_)},96051:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalNetworkContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(43718),p=e(26405);let v=class extends a.WithEventBus{onStart(){this.network.bindErrors()}handleBrowserConnectionOpen(_){this.network.setStatus(p.TerminalNetworkStatus.CONNECTED)}handleBrowserConnectionClose(_){this.network.setStatus(p.TerminalNetworkStatus.DISCONNECTED)}};t.TerminalNetworkContribution=v,n.__decorate([(0,r.Autowired)(p.ITerminalNetwork),n.__metadata("design:type",Object)],v.prototype,"network",void 0),n.__decorate([(0,r.Autowired)(p.ITerminalInternalService),n.__metadata("design:type",Object)],v.prototype,"service",void 0),n.__decorate([(0,a.OnEvent)(a.BrowserConnectionOpenEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[a.BrowserConnectionOpenEvent]),n.__metadata("design:returntype",void 0)],v.prototype,"handleBrowserConnectionOpen",null),n.__decorate([(0,a.OnEvent)(a.BrowserConnectionCloseEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[a.BrowserConnectionCloseEvent]),n.__metadata("design:returntype",void 0)],v.prototype,"handleBrowserConnectionClose",null),t.TerminalNetworkContribution=v=n.__decorate([(0,o.Domain)(o.ClientAppContribution)],v)},79404:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalPreferenceContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(43718),p=e(26405),v=e(3276),m=e(91815);let _=class{constructor(){this.schema=v.terminalPreferenceSchema;const g=["git-bash","powershell","cmd","default"],{properties:{["terminal.type"]:l}}={...v.terminalPreferenceSchema};this.ptyTerminal.getOS().then(h=>{h===a.OperatingSystem.Windows&&this.preferenceSchemaProvider.setSchema({properties:{"terminal.type":{...l,enum:g}}},!0)})}};t.TerminalPreferenceContribution=_,n.__decorate([(0,r.Autowired)(p.ITerminalService),n.__metadata("design:type",m.NodePtyTerminalService)],_.prototype,"ptyTerminal",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceSchemaProvider),n.__metadata("design:type",o.PreferenceSchemaProvider)],_.prototype,"preferenceSchemaProvider",void 0),t.TerminalPreferenceContribution=_=n.__decorate([(0,a.Domain)(o.PreferenceContribution),n.__metadata("design:paramtypes",[])],_)},11476:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalRenderContribution=void 0;const r=e(85608),o=e(41869),a=e(30144),p=r.__importDefault(e(17632)),v=r.__importDefault(e(48139));let m=n=class{registerToolbarItems(s){s.registerItem({id:o.TERMINAL_COMMANDS.OPEN_SEARCH.id,command:o.TERMINAL_COMMANDS.OPEN_SEARCH.id,viewId:n.viewId,tooltip:(0,o.localize)("terminal.search")}),s.registerItem({id:o.TERMINAL_COMMANDS.CLEAR_CONTENT.id,command:o.TERMINAL_COMMANDS.CLEAR_CONTENT.id,viewId:n.viewId,tooltip:(0,o.localize)("terminal.menu.clearCurrentContent")}),s.registerItem({id:o.TERMINAL_COMMANDS.SPLIT.id,command:o.TERMINAL_COMMANDS.SPLIT.id,viewId:n.viewId,tooltip:(0,o.localize)("terminal.split")}),s.registerItem({id:o.TERMINAL_COMMANDS.REMOVE.id,command:o.TERMINAL_COMMANDS.REMOVE.id,viewId:n.viewId,tooltip:(0,o.localize)("terminal.remove")})}registerComponent(s){s.register("@opensumi/ide-terminal-next",{component:v.default,id:n.viewId},{title:(0,o.localize)("terminal.name"),priority:1,activateKeyBinding:"ctrl+`",containerId:n.viewId,titleComponent:p.default,draggable:!0,hideLocationTab:["right"]})}};t.TerminalRenderContribution=m,m.viewId=a.TERMINAL_CONTAINER_ID,t.TerminalRenderContribution=m=n=r.__decorate([(0,o.Domain)(o.ComponentContribution,o.TabBarToolbarContribution)],m)},17236:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalNextModule=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(26405),p=e(94620),v=e(3276),m=e(21623),_=e(98944),s=e(69061),g=e(7734),l=e(48520),h=e(102),u=e(53891),d=e(82022),E=e(12642),f=e(13663),c=e(89570),y=e(94486),b=e(46666),A=e(70406),S=e(12894),D=e(91815),I=e(29041),w=e(68611);let T=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[m.TerminalLifeCycleContribution,m.TerminalRenderContribution,m.TerminalCommandContribution,m.TerminalMenuContribution,m.TerminalKeybindingContribution,m.TerminalNetworkContribution,m.TerminalPreferenceContribution,{token:a.ITerminalApiService,useClass:_.TerminalApiService},{token:a.ITerminalController,useClass:g.TerminalController},{token:a.ITerminalTheme,useClass:I.TerminalTheme},{token:a.ITerminalSearchService,useClass:S.TerminalSearchService},{token:a.ITerminalHoverManagerService,useClass:u.TerminalHoverManagerService},{token:a.ITerminalGroupViewService,useClass:w.TerminalGroupViewService},{token:a.ITerminalErrorService,useClass:h.TerminalErrorService},{token:a.ITerminalService,useClass:D.NodePtyTerminalService},{token:a.ITerminalInternalService,useClass:d.TerminalInternalService},{token:a.ITerminalRestore,useClass:A.TerminalRestore},{token:v.ITerminalPreference,useClass:f.TerminalPreference},{token:a.ITerminalRenderProvider,useClass:b.TerminalRenderProvider},{token:a.ITerminalClientFactory2,useFactory:s.createTerminalClientFactory2},{token:a.ITerminalNetwork,useClass:E.TerminalNetworkService},{token:p.EnvironmentVariableServiceToken,useClass:l.TerminalEnvironmentService},{token:a.ITerminalProfileService,useClass:c.TerminalProfileService},{token:a.ITerminalProfileInternalService,useClass:y.TerminalProfileInternalService}],this.backServices=[{servicePath:a.ITerminalServicePath,clientToken:a.ITerminalService},{servicePath:a.ITerminalProcessPath,clientToken:p.EnvironmentVariableServiceToken}]}};t.TerminalNextModule=T,t.TerminalNextModule=T=n.__decorate([(0,r.Injectable)()],T)},67245:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalBaseLinkProvider=void 0;class e{async provideLinks(r,o){var a;(a=this._activeLinks)===null||a===void 0||a.forEach(p=>p.dispose),this._activeLinks=await this._provideLinks(r),o(this._activeLinks)}}t.TerminalBaseLinkProvider=e},52826:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalExternalLinkProviderAdapter=void 0;const n=e(85608),r=e(76003),o=e(67245),a=e(28247),p=e(97144);let v=class extends o.TerminalBaseLinkProvider{constructor(_,s,g,l,h){super(),this._xterm=_,this._instance=s,this._externalLinkProvider=g,this._wrapLinkHandler=l,this._tooltipCallback=h}async _provideLinks(_){var s,g;let l=_-1,h=l;const u=[this._xterm.buffer.active.getLine(l)];for(;l>=0&&(!((s=this._xterm.buffer.active.getLine(l))===null||s===void 0)&&s.isWrapped);)u.unshift(this._xterm.buffer.active.getLine(l-1)),l--;for(;h<this._xterm.buffer.active.length&&(!((g=this._xterm.buffer.active.getLine(h+1))===null||g===void 0)&&g.isWrapped);)u.push(this._xterm.buffer.active.getLine(h+1)),h++;const d=(0,a.getXtermLineContent)(this._xterm.buffer.active,l,h,this._xterm.cols);if(d.trim().length===0)return[];const E=await this._externalLinkProvider.provideLinks(this._instance,d);return E?E.map(f=>{const c=(0,a.convertLinkRangeToBuffer)(u,this._xterm.cols,{startColumn:f.startIndex+1,startLineNumber:1,endColumn:f.startIndex+f.length+1,endLineNumber:1},l),y=d.substr(f.startIndex,f.length)||"",b=this._wrapLinkHandler((S,D)=>f.activate(D)),A=(S,D,I,w)=>this._tooltipCallback(S,D,I,w);return this.injector.get(p.TerminalLink,[this._xterm,c,y,this._xterm.buffer.active.viewportY,b,A,!0,f.label])}):[]}};t.TerminalExternalLinkProviderAdapter=v,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],v.prototype,"injector",void 0),t.TerminalExternalLinkProviderAdapter=v=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Function,Object,Object,Function,Function])],v)},28247:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertLinkRangeToBuffer=e,t.convertBufferRangeToViewport=n,t.getXtermLineContent=r,t.positionIsInRange=o;function e(a,p,v,m){const _={start:{x:v.startColumn,y:v.startLineNumber+m},end:{x:v.endColumn-1,y:v.endLineNumber+m}};let s=0;const g=Math.ceil(v.startColumn/p);for(let u=0;u<Math.min(g);u++){const d=Math.min(p,v.startColumn-u*p);let E=0;const f=a[u];if(!f)break;for(let c=0;c<Math.min(p,d+E);c++){const y=f.getCell(c);y.getWidth()===2&&E++;const A=y.getChars();A.length>1&&(E-=A.length-1)}s+=E}let l=0;const h=Math.ceil(v.endColumn/p);for(let u=Math.max(0,g-1);u<h;u++){const d=u===g-1?(v.startColumn+s)%p:0,E=Math.min(p,v.endColumn+s-u*p),f=u===g-1?s:0;let c=0;const y=a[u];if(!y)break;for(let b=d;b<Math.min(p,E+c+f);b++){const A=y.getCell(b);A.getWidth()===2&&c++,b===p-1&&A.getChars()===""&&c++}l+=c}for(_.start.x+=s,_.end.x+=s+l;_.start.x>p;)_.start.x-=p,_.start.y++;for(;_.end.x>p;)_.end.x-=p,_.end.y++;return _}function n(a,p){return{start:{x:a.start.x-1,y:a.start.y-p-1},end:{x:a.end.x-1,y:a.end.y-p-1}}}function r(a,p,v,m){let _="";for(let s=p;s<=v;s++){const g=a.getLine(s);g&&(_+=g.translateToString(!0,0,m))}return _}function o(a,p){return!(a.y<p.start.y||a.y>p.end.y||a.y===p.start.y&&a.x<p.start.x||a.y===p.end.y&&a.x>p.end.x)}},29970:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalLinkManager=void 0;const n=e(85608),r=e(87083),o=e(76003),a=e(41869),p=e(43718),v=e(23418),m=e(14951),_=e(26405),s=e(59926),g=e(69061),l=e(52826),h=e(11192),u=e(73481),d=e(67251),{posix:E,win32:f}=p.path;let c=class extends p.Disposable{constructor(b,A){super(),this._xterm=b,this._client=A,this._standardLinkProviders=[],this._standardLinkProvidersDisposables=new p.DisposableCollection;const S=this._wrapLinkHandler((T,R)=>this._handleProtocolLink(R)),D=this.injector.get(h.TerminalProtocolLinkProvider,[this._xterm,S,this._tooltipCallback.bind(this)]);this._standardLinkProviders.push(D);const I=this._wrapLinkHandler((T,R)=>this._handleLocalLink(R));this._wrappedTextLinkActivateCallback=I;const w=this.injector.get(u.TerminalValidatedLocalLinkProvider,[this._xterm,this._client,I,this._wrapLinkHandler.bind(this),this._tooltipCallback.bind(this),async(T,R)=>R(await this._resolvePath(T))]);this._standardLinkProviders.push(w),this.addTerminalWordLinkProvider(),this._registerStandardLinkProviders()}set processCwd(b){this._processCwd=b}addTerminalWordLinkProvider(){const b=this.injector.get(d.TerminalWordLinkProvider,[this._xterm,async(A,S)=>S(await this._resolvePath(A)),this._wrappedTextLinkActivateCallback]);this._standardLinkProviders.push(b)}async getTerminalCwd(){return await this.terminalService.getCwd(this._client.id)||this._processCwd}_registerStandardLinkProviders(){this._standardLinkProvidersDisposables.dispose(),this._standardLinkProvidersDisposables=new p.DisposableCollection;for(const b of this._standardLinkProviders)this._standardLinkProvidersDisposables.push(this._xterm.registerLinkProvider(b))}_tooltipCallback(b,A,S,D){const I=this._xterm._core,w={width:I._renderService.dimensions.css.cell.width,height:I._renderService.dimensions.css.cell.height},T={width:this._xterm.cols,height:this._xterm.rows},R=I.element.getBoundingClientRect();return this._showHover({viewportRange:A,cellDimensions:w,terminalDimensions:T,boundingClientRect:R,modifierDownCallback:S,modifierUpCallback:D},this._getLinkHoverString(b.text,b.label),P=>b.activate(void 0,P),b)}_showHover(b,A,S,D){const I=this._hoverManager.showHover(b,A,S);return D?.onInvalidated(()=>I.dispose()),p.Disposable.create(()=>I.dispose())}registerExternalLinkProvider(b,A){const S=this.injector.get(l.TerminalExternalLinkProviderAdapter,[this._xterm,b,A,this._wrapLinkHandler.bind(this),this._tooltipCallback.bind(this)]),D=this._xterm.registerLinkProvider(S);return this._registerStandardLinkProviders(),D}_wrapLinkHandler(b){return async(A,S)=>{A?.preventDefault(),!(A&&!this._isLinkActivationModifierDown(A))&&b(A,S)}}get _localLinkRegex(){const b=this._client.os===p.OperatingSystem.Windows?s.winLocalLinkClause:s.unixLocalLinkClause;return new RegExp(`${b}(${(0,s.getLineAndColumnClause)()})`)}async _handleLocalLink(b){const A=this.extractLineColumnInfo(b),S=await this._resolvePath(A.filePath);if(!S)return;const D={startLineNumber:A.lineNumber,endLineNumber:A.lineNumber,startColumn:A.columnNumber,endColumn:A.columnNumber};await this._editorService.open(S.uri,{range:D,focus:!0})}_handleHypertextLink(b){this._openerService.open(b)}async _handleProtocolLink(b){const A=p.URI.parse(b);if(A.scheme===p.Schemes.file){const S=p.FileUri.fsPath(A);this._handleLocalLink(this._client.os!==p.OperatingSystem.Windows&&p.isWindows?S.replace(/\\/g,E.sep):S);return}this._handleHypertextLink(b)}_isLinkActivationModifierDown(b){return p.isOSX?b.metaKey:b.ctrlKey}get osPath(){return this._client.os===p.OperatingSystem.Windows?f:E}_getLinkHoverString(b,A){const S=this.preferenceService.get("editor.multiCursorModifier");let D="";S==="ctrlCmd"?p.isMacintosh?D=(0,p.localize)("terminalLinkHandler.followLinkAlt.mac","option + click"):D=(0,p.localize)("terminalLinkHandler.followLinkAlt","alt + click"):p.isMacintosh?D=(0,p.localize)("terminalLinkHandler.followLinkCmd","cmd + click"):D=(0,p.localize)("terminalLinkHandler.followLinkCtrl","ctrl + click");const I=(0,p.localize)("followLink","Follow link");return A=A||I,`${A} (${D})`}async _getUserHomeDir(){const b=await this._fileSystem.getCurrentUserHome();if(!b)throw new Error("Unable to get user home directory");return await this._fileSystem.getFsPath(b.uri)}_getUserHomeDirOnce(){return this._getHomeDirPromise||(this._getHomeDirPromise=this._getUserHomeDir()),this._getHomeDirPromise}async _preprocessPath(b){if(b.charAt(0)==="~"){const A=await this._getUserHomeDirOnce();if(!A)return null;b=this.osPath.join(A,b.substring(1))}else if(b.charAt(0)!=="/"&&b.charAt(0)!=="~"){const A=await this.getTerminalCwd();if(this._client.os===p.OperatingSystem.Windows)if(!b.match("^"+s.winDrivePrefix)&&!b.startsWith("\\\\?\\")){if(!A)return null;b=this.osPath.join(A,b)}else b=b.replace(/^\\\\\?\\/,"");else{if(!A)return null;b=this.osPath.join(A,b)}}return b=this.osPath.normalize(b),b}async _resolvePath(b){const A=await this._preprocessPath(b);if(A)try{const S=p.URI.file(A),D=await this._fileService.getFileStat(S.toString());if(D)return{uri:S,isDirectory:D.isDirectory}}catch{return}}_extractLineInfoFromMatch(b){return(0,s.extractLineInfoFromMatch)(b)}extractLineColumnInfo(b){var A,S,D;const I=this._localLinkRegex.exec(b),w={lineNumber:1,columnNumber:1,filePath:b};if(!I)return w;const T=this._extractLineInfoFromMatch(I);return{filePath:(A=T.filePath)!==null&&A!==void 0?A:b,lineNumber:(S=T.line)!==null&&S!==void 0?S:1,columnNumber:(D=T.column)!==null&&D!==void 0?D:1}}extractLinkUrl(b){const A=this._localLinkRegex.exec(b);return A?A[1]:null}};t.TerminalLinkManager=c,n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],c.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(_.ITerminalService),n.__metadata("design:type",Object)],c.prototype,"terminalService",void 0),n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",v.WorkbenchEditorService)],c.prototype,"_editorService",void 0),n.__decorate([(0,o.Autowired)(a.IOpenerService),n.__metadata("design:type",Object)],c.prototype,"_openerService",void 0),n.__decorate([(0,o.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],c.prototype,"_fileService",void 0),n.__decorate([(0,o.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],c.prototype,"_fileSystem",void 0),n.__decorate([(0,o.Autowired)(a.PreferenceService),n.__metadata("design:type",Object)],c.prototype,"preferenceService",void 0),n.__decorate([(0,o.Autowired)(_.ITerminalHoverManagerService),n.__metadata("design:type",Object)],c.prototype,"_hoverManager",void 0),t.TerminalLinkManager=c=n.__decorate([(0,o.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[r.Terminal,g.TerminalClient])],c)},97144:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalLink=t.FOLDER_NOT_IN_WORKSPACE_LABEL=t.FOLDER_IN_WORKSPACE_LABEL=t.OPEN_FILE_LABEL=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(43718),p=e(28247),v=500;t.OPEN_FILE_LABEL=(0,a.localize)("terminal.openFile","Open file in editor"),t.FOLDER_IN_WORKSPACE_LABEL=(0,a.localize)("terminal.focusFolder","Focus folder in explorer"),t.FOLDER_NOT_IN_WORKSPACE_LABEL=(0,a.localize)("terminal.openFolder","Open folder in new window");let m=class extends a.Disposable{get onInvalidated(){return this._onInvalidated.event}constructor(s,g,l,h,u,d,E,f,c){super(),this._xterm=s,this.range=g,this.text=l,this._viewportY=h,this._activateCallback=u,this._tooltipCallback=d,this._isHighConfidenceLink=E,this.label=f,this._lineInfo=c,this._onInvalidated=new a.Emitter,this.decorations={pointerCursor:!1,underline:this._isHighConfidenceLink}}dispose(){var s,g,l;super.dispose(),(s=this._hoverListeners)===null||s===void 0||s.dispose(),this._hoverListeners=void 0,(g=this._tooltipScheduler)===null||g===void 0||g.dispose(),this._tooltipScheduler=void 0,(l=this._tooltipDisposable)===null||l===void 0||l.dispose(),this._tooltipDisposable=void 0}activate(s,g){this._activateCallback(s,g,this._lineInfo)}hover(s,g){this._hoverListeners=new a.DisposableCollection,this._hoverListeners.push((0,o.addDisposableListener)(document,"keydown",h=>{!h.repeat&&this._isModifierDown(h)&&this._enableDecorations()})),this._hoverListeners.push((0,o.addDisposableListener)(document,"keyup",h=>{!h.repeat&&!this._isModifierDown(h)&&this._disableDecorations()})),this._hoverListeners.push(this._xterm.onRender(h=>{const u=this.range.start.y-this._viewportY;u>=h.start&&u<=h.end&&this._onInvalidated.fire()})),this._isHighConfidenceLink&&(this._tooltipScheduler=new a.RunOnceScheduler(()=>{var h,u;this._tooltipDisposable=(h=this._tooltipCallback)===null||h===void 0?void 0:h.call(this,this,(0,p.convertBufferRangeToViewport)(this.range,this._viewportY),this._isHighConfidenceLink?()=>this._enableDecorations():void 0,this._isHighConfidenceLink?()=>this._disableDecorations():void 0),(u=this._tooltipScheduler)===null||u===void 0||u.dispose(),this._tooltipScheduler=void 0},this.preferenceService.get("editor.hover.delay")||v),this._tooltipScheduler.schedule());const l={x:s.pageX,y:s.pageY};this._hoverListeners.push((0,o.addDisposableListener)(document,"mousemove",h=>{var u;this._isModifierDown(h)?this._enableDecorations():this._disableDecorations(),(Math.abs(h.pageX-l.x)>window.devicePixelRatio*2||Math.abs(h.pageY-l.y)>window.devicePixelRatio*2)&&(l.x=h.pageX,l.y=h.pageY,(u=this._tooltipScheduler)===null||u===void 0||u.schedule())}))}leave(){var s,g,l;(s=this._hoverListeners)===null||s===void 0||s.dispose(),this._hoverListeners=void 0,(g=this._tooltipScheduler)===null||g===void 0||g.dispose(),this._tooltipScheduler=void 0,(l=this._tooltipDisposable)===null||l===void 0||l.dispose(),this._tooltipDisposable=void 0}_enableDecorations(){this.decorations.pointerCursor||(this.decorations.pointerCursor=!0),this.decorations.underline||(this.decorations.underline=!0)}_disableDecorations(){this.decorations.pointerCursor&&(this.decorations.pointerCursor=!1),this.decorations.underline!==this._isHighConfidenceLink&&(this.decorations.underline=this._isHighConfidenceLink)}_isModifierDown(s){return a.isOSX?s.metaKey:s.ctrlKey}};t.TerminalLink=m,n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],m.prototype,"preferenceService",void 0),t.TerminalLink=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Function,Object,String,Number,Function,Function,Boolean,Object,Object])],m)},11192:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalProtocolLinkProvider=void 0;const n=e(85608),r=e(76003),o=e(26405),a=e(67245),p=e(28247),v=e(97144);let m=class extends a.TerminalBaseLinkProvider{constructor(g,l,h){super(),this._xterm=g,this._activateCallback=l,this._tooltipCallback=h}_provideLinks(g){var l,h;let u=g-1,d=u;const E=[this._xterm.buffer.active.getLine(u)];for(;u>=0&&(!((l=this._xterm.buffer.active.getLine(u))===null||l===void 0)&&l.isWrapped);)E.unshift(this._xterm.buffer.active.getLine(u-1)),u--;for(;d<this._xterm.buffer.active.length&&(!((h=this._xterm.buffer.active.getLine(d+1))===null||h===void 0)&&h.isWrapped);)E.push(this._xterm.buffer.active.getLine(d+1)),d++;return this._linkComputerTarget=new _(this._xterm,u,d),o.LinkComputer.computeLinks(this._linkComputerTarget).map(c=>{var y;const b=(0,p.convertLinkRangeToBuffer)(E,this._xterm.cols,c.range,u),A=(S,D,I,w)=>this._tooltipCallback(S,D,I,w);return this.injector.get(v.TerminalLink,[this._xterm,b,((y=c.url)===null||y===void 0?void 0:y.toString())||"",this._xterm.buffer.active.viewportY,this._activateCallback,A,!0,void 0])})}};t.TerminalProtocolLinkProvider=m,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],m.prototype,"injector",void 0),t.TerminalProtocolLinkProvider=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Function,Function,Function])],m);class _{constructor(g,l,h){this._xterm=g,this._lineStart=l,this._lineEnd=h}getLineCount(){return 1}getLineContent(){return(0,p.getXtermLineContent)(this._xterm.buffer.active,this._lineStart,this._lineEnd,this._xterm.cols)}}},73481:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalValidatedLocalLinkProvider=void 0;const n=e(85608),r=e(76003),o=e(11050),a=e(66894),p=e(43718),v=e(97408),m=e(59926),_=e(67245),s=e(28247),g=e(97144);let l=class extends _.TerminalBaseLinkProvider{constructor(u,d,E,f,c,y){super(),this._xterm=u,this._client=d,this._activateFileCallback=E,this._wrapLinkHandler=f,this._tooltipCallback=c,this._validationCallback=y}async _provideLinks(u){var d,E;const f=[];let c=u-1,y=c;const b=[this._xterm.buffer.active.getLine(c)];for(;c>=0&&(!((d=this._xterm.buffer.active.getLine(c))===null||d===void 0)&&d.isWrapped);)b.unshift(this._xterm.buffer.active.getLine(c-1)),c--;for(;y<this._xterm.buffer.active.length&&(!((E=this._xterm.buffer.active.getLine(y+1))===null||E===void 0)&&E.isWrapped);)b.push(this._xterm.buffer.active.getLine(y+1)),y++;const A=(0,s.getXtermLineContent)(this._xterm.buffer.active,c,y,this._xterm.cols);if(A.length>m.MAX_LENGTH)return[];const S=new RegExp(this._localLinkRegex,"g");let D,I=-1;for(;(D=S.exec(A))!==null;){let w=D[0];if(!w||(I=A.indexOf(w,I+1),S.lastIndex=I+w.length,I<0))break;((A.startsWith("--- a/")||A.startsWith("+++ b/"))&&I===4||A.startsWith("diff --git")&&(w.startsWith("a/")||w.startsWith("b/")))&&(w=w.substring(2),I+=2);const T=this._extractLineInfoFromMatch(D),R=await this.detectLocalLink(w,b,c,I,1,T);R.length>0&&f.push(...R)}return f}_extractLineInfoFromMatch(u){return(0,m.extractLineInfoFromMatch)(u)}get _localLinkRegex(){const u=this._client.os===p.OperatingSystem.Windows?m.winLocalLinkClause:m.unixLocalLinkClause;return new RegExp(`(${u})(${(0,m.getLineAndColumnClause)()})?`)}async detectLocalLink(u,d,E,f,c,y){const b=[],A=await new Promise(S=>{var D;const I=((D=u.match(this._localLinkRegex))===null||D===void 0?void 0:D[1])||u,w=I.startsWith("file://")?p.FileUri.fsPath(p.URI.parse(I)):I;this._validationCallback(w,async T=>{if(T){const R=T.isDirectory?await this._isDirectoryInsideWorkspace(T.uri)?g.FOLDER_IN_WORKSPACE_LABEL:g.FOLDER_NOT_IN_WORKSPACE_LABEL:g.OPEN_FILE_LABEL,P=this._wrapLinkHandler((k,F)=>{T.isDirectory?this._handleLocalFolderLink(T.uri):this._activateFileCallback(k,F)}),O=(0,s.convertLinkRangeToBuffer)(d,this._xterm.cols,{startColumn:f+1,startLineNumber:1,endColumn:f+u.length+c,endLineNumber:1},E),M=(k,F,L,B)=>this._tooltipCallback(k,F,L,B);S(this.injector.get(g.TerminalLink,[this._xterm,O,u,this._xterm.buffer.active.viewportY,P,M,!0,R,y]))}else S(void 0)})});return A&&b.push(A),b}async _handleLocalFolderLink(u){if(await this._isDirectoryInsideWorkspace(u)){await this.commandService.executeCommand("revealInExplorer",u);return}this.appConfig.isElectronRenderer&&this.windowService.openWorkspace(u,{newWindow:!0})}async _isDirectoryInsideWorkspace(u){const d=await this.workspaceService.roots;for(const E of d)if(p.URI.parse(E.uri).isEqualOrParent(u))return!0;return!1}};t.TerminalValidatedLocalLinkProvider=l,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],l.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(a.IWindowService),n.__metadata("design:type",Object)],l.prototype,"windowService",void 0),n.__decorate([(0,r.Autowired)(p.CommandService),n.__metadata("design:type",Object)],l.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(v.IWorkspaceService),n.__metadata("design:type",Object)],l.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],l.prototype,"appConfig",void 0),t.TerminalValidatedLocalLinkProvider=l=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Function,Function,Function,Function,Function,Function])],l)},67251:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalWordLinkProvider=t.USUAL_WORD_SEPARATORS=void 0;const n=e(85608),r=e(87083),o=e(76003),a=e(74404),p=e(11050),v=e(66894),m=e(43718),_=e(92323),s=e(97408),g=e(70845),l=e(67245),h=e(28247),u=e(97144);t.USUAL_WORD_SEPARATORS=" ()[]{}',\"`\u2500\u2018\u2019\u201C\u201D|";let d=class extends l.TerminalBaseLinkProvider{constructor(f,c,y){super(),this._xterm=f,this._validationCallback=c,this._activateFileCallback=y,this._refreshSeparatorCodes()}_refreshSeparatorCodes(){let f="";for(let c=57520;c<=57535;c++)f+=String.fromCharCode(c);this._separatorRegex=new RegExp(`[${(0,g.escapeRegExpCharacters)(t.USUAL_WORD_SEPARATORS)}${f}]`,"g")}_provideLinks(f){const c=[],y=f-1,b=y,A=[this._xterm.buffer.active.getLine(y)],S=(0,h.getXtermLineContent)(this._xterm.buffer.active,y,b,this._xterm.cols);if(S===""||S.length>1024)return[];const D=this._parseWords(S);for(const I of D){if(I.text==="")continue;I.text.length>0&&I.text.charAt(I.text.length-1)===":"&&(I.text=I.text.slice(0,-1),I.endIndex--);const w=(0,h.convertLinkRangeToBuffer)(A,this._xterm.cols,{startColumn:I.startIndex+1,startLineNumber:1,endColumn:I.endIndex+1,endLineNumber:1},y),T=(R,P)=>{this._validationCallback(P,async O=>{if(O)O.isDirectory?this._handleLocalFolderLink(O.uri):this._activateFileCallback(R,P);else{const M=this.appConfig.openWordLinkWithPaletteOnTerminal;((0,m.isUndefined)(M)||M)&&this.quickOpenService.open(P)}})};c.push(this.injector.get(u.TerminalLink,[this._xterm,w,I.text,this._xterm.buffer.active.viewportY,T,void 0,!0,I.text]))}return c}async _handleLocalFolderLink(f){if(await this._isDirectoryInsideWorkspace(f)){await this.commandService.executeCommand("revealInExplorer",f);return}this.appConfig.isElectronRenderer&&this.windowService.openWorkspace(f,{newWindow:!0})}_parseWords(f){const c=[],y=f.split(this._separatorRegex);let b=0;for(let A=0;A<y.length;A++)c.push({text:y[A],startIndex:b,endIndex:b+y[A].length}),b+=y[A].length+1;return c}async _isDirectoryInsideWorkspace(f){const c=await this.workspaceService.roots;for(const y of c)if(m.URI.parse(y.uri).isEqualOrParent(f))return!0;return!1}};t.TerminalWordLinkProvider=d,n.__decorate([(0,o.Autowired)(p.AppConfig),n.__metadata("design:type",Object)],d.prototype,"appConfig",void 0),n.__decorate([(0,o.Autowired)(_.CommandService),n.__metadata("design:type",Object)],d.prototype,"commandService",void 0),n.__decorate([(0,o.Autowired)(v.IWindowService),n.__metadata("design:type",Object)],d.prototype,"windowService",void 0),n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],d.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(s.IWorkspaceService),n.__metadata("design:type",Object)],d.prototype,"workspaceService",void 0),n.__decorate([(0,o.Autowired)(a.PrefixQuickOpenService),n.__metadata("design:type",Object)],d.prototype,"quickOpenService",void 0),t.TerminalWordLinkProvider=d=n.__decorate([(0,o.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[r.Terminal,Function,Function])],d)},62810:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_COL=t.DEFAULT_ROW=t.AttachAddon=void 0;const n=e(43718);class r extends n.Disposable{constructor(){super(...arguments),this._onData=new n.Emitter,this.onData=this._onData.event,this._onExit=new n.Emitter,this.onExit=this._onExit.event,this._onTime=new n.Emitter,this.onTime=this._onTime.event,this._lastInputTime=0,this._onBeforeProcessData=new n.Emitter,this.onBeforeProcessData=this._onBeforeProcessData.event}setConnection(a){this._disposeConnection&&(this._disposeConnection.dispose(),this._disposeConnection=null),this.connection=a,a&&(this._disposeConnection=new n.Disposable(a.onData(p=>{let v=p;if(typeof p=="string"){const m={data:p};this._onBeforeProcessData.fire(m),m.data!==void 0&&(v=m.data)}if(this._onData.fire(v),this._terminal.write(typeof v=="string"?v:new Uint8Array(v,0,v.byteLength)),this._lastInputTime){const m=Date.now()-this._lastInputTime;this._lastInputTime=0,this._onTime.fire(m)}})),a.onExit&&this._disposeConnection.addDispose(a.onExit(p=>{this._onExit.fire(p)})))}async activate(a){this._terminal=a,this.addDispose(n.Disposable.create(()=>{var p;return(p=this._disposeConnection)===null||p===void 0?void 0:p.dispose()})),this.addDispose(a.onData(p=>this._sendData(p))),this.addDispose(a.onBinary(p=>this._sendBinary(p)))}_sendData(a){!this.connection||this.connection.readonly||(this._timeResponse(),this.connection.sendData(a))}_sendBinary(a){if(!this.connection||this.connection.readonly)return;const p=new Uint8Array(a.length);for(let v=0;v<a.length;++v)p[v]=a.charCodeAt(v)&255;this._timeResponse(),this.connection.sendData(p)}_timeResponse(){this._lastInputTime=Date.now()}}t.AttachAddon=r,t.DEFAULT_ROW=80,t.DEFAULT_COL=24},98944:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalApiService=void 0;const n=e(85608),r=n.__importDefault(e(56005)),o=e(76003),a=e(43718),p=e(28423),v=e(26405);let m=class{constructor(){this._onDidOpenTerminal=new a.Emitter,this._onDidCloseTerminal=new a.Emitter,this._onDidTerminalTitleChange=new a.Emitter,this._onDidChangeActiveTerminal=new a.Emitter,this.onDidOpenTerminal=this._onDidOpenTerminal.event,this.onDidCloseTerminal=this._onDidCloseTerminal.event,this.onDidTerminalTitleChange=this._onDidTerminalTitleChange.event,this.onDidChangeActiveTerminal=this._onDidChangeActiveTerminal.event,this.controller.onDidOpenTerminal(s=>{this._onDidOpenTerminal.fire(s)}),this.controller.onDidCloseTerminal(s=>{this._onDidCloseTerminal.fire(s)}),this.controller.onDidTerminalTitleChange(s=>{this._onDidTerminalTitleChange.fire(s)}),this.controller.onDidChangeActiveTerminal(s=>{this._onDidChangeActiveTerminal.fire(s)})}get terminals(){return Array.from(this.controller.clients.values()).map(s=>({id:s.id,name:s.name,isActive:this.view.currentWidgetId.get()===s.id}))}async createTerminal(s,g){const l=await this.controller.createTerminalWithWidgetByTerminalOptions({terminalOptions:s,id:g}),h={get id(){return l.id},get name(){return l.name},get processId(){return l.pid},show:(u=!0)=>{const d=l.widget;this.view.selectWidget(d.id),this.controller.showTerminalPanel(),u||setTimeout(()=>l.focus())},hide:()=>{this.controller.hideTerminalPanel()},dispose:()=>{this.view.removeWidget(l.widget.id),this.controller.clients.delete(l.id)}};return await l.attached.promise,h.show(),h}async getProcessId(s){const g=this.controller.clients.get(s);if(g)return g.pid}async getDefaultShellPath(){const s=await this.terminalProfileInternalService.resolveDefaultProfile();return s?.path||"/bin/bash"}sendText(s,g,l=!0){this.service.sendText(s,`${g}${l?"\r":""}`)}showTerm(s,g=!0){const l=this.controller.clients.get(s);if(!l)return;const h=l.widget;this.view.selectWidget(h.id),this.controller.showTerminalPanel(),g||setTimeout(()=>l.focus())}hideTerm(s){this.controller.clients.get(s)&&this.controller.hideTerminalPanel()}removeTerm(s){const g=this.controller.clients.get(s);g&&(this.view.removeWidget(g.widget.id),this.controller.clients.delete(s))}createWidget(s,g){const l=s,h=this.view.createGroup(),u=this.view.getGroup(h),d=this.view.createWidget(u,l,!1,!0);return(0,p.transaction)(E=>{d.name.set((0,r.default)(s),E)}),this.view.selectWidget(l),d.onRender(()=>{g(d.element)}),d}scheduleReconnection(){return this.network.scheduleReconnection()}};t.TerminalApiService=m,n.__decorate([(0,o.Autowired)(v.ITerminalController),n.__metadata("design:type",Object)],m.prototype,"controller",void 0),n.__decorate([(0,o.Autowired)(v.ITerminalGroupViewService),n.__metadata("design:type",Object)],m.prototype,"view",void 0),n.__decorate([(0,o.Autowired)(v.ITerminalInternalService),n.__metadata("design:type",Object)],m.prototype,"service",void 0),n.__decorate([(0,o.Autowired)(v.ITerminalNetwork),n.__metadata("design:type",Object)],m.prototype,"network",void 0),n.__decorate([(0,o.Autowired)(v.ITerminalProfileInternalService),n.__metadata("design:type",Object)],m.prototype,"terminalProfileInternalService",void 0),t.TerminalApiService=m=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],m)},69061:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.createTerminalClientFactory2=t.TerminalClientFactory=t.TerminalClient=void 0;const r=e(85608),o=e(76003),a=e(41869),p=e(67889),v=e(43718),m=e(23418),_=e(42933),s=e(28423),g=e(72665),l=e(88913),h=e(10560),u=e(26405),d=e(94620),E=e(3276),f=e(29970),c=e(62810),y=e(90853),b=e(35628),A=e(70845),S=e(41685);let D=n=class extends v.Disposable{constructor(){super(),this.isTaskExecutor=!1,this._ready=!1,this._hasOutput=!1,this._areLinksReady=!1,this._onInput=new v.Emitter,this.onInput=this._onInput.event,this._onOutput=new v.Emitter,this.onOutput=this._onOutput.event,this._onExit=new v.Emitter,this.onExit=this._onExit.event,this._onTitleChange=new v.Emitter,this.onTitleChange=this._onTitleChange.event,this._onLinksReady=new v.Emitter,this.onLinksReady=this._onLinksReady.event,this._onResponseTime=new v.Emitter,this.onResponseTime=this._onResponseTime.event,this._onNameChangeEmitter=new v.Emitter,this.onNameChange=this._onNameChangeEmitter.event,this._name="",this.init()}async init(){this.xterm=this.injector.get(S.XTerm,[{xtermOptions:{theme:this.theme.terminalTheme,...this.internalService.getOptions(),...this.terminalPreference.toJSON()}}]),this.addDispose(this.xterm),this.addDispose(this.internalService.onError(R=>{var P;this.messageService.error(R.message),!((P=R.launchConfig)===null||P===void 0)&&P.executable?this.updateTerminalName({name:"error: "+R.launchConfig.executable}):this.updateTerminalName({name:"error"})})),this.addDispose(this.internalService.onProcessChange(R=>{R.sessionId===this.id&&(0,s.transaction)(P=>{this.widget.processName.set(R.processName,P)})}))}onWidgetShow(){this._show&&(this._show.resolve(),this._show=null),this._layout()}async setupWidget(R){this._widget=R,this._prepare(),this.addDispose(v.Disposable.create(()=>{n.WORKSPACE_PATH_CACHED.delete(R.group.id)})),this.addDispose(this.terminalPreference.onChange(async({name:P,value:O})=>{!R.show&&!this._show&&(this._show=new v.Deferred),this._show&&await this._show.promise,this._setOption(P,O),this.xterm.updatePreferences({[P]:O})})),R.show?this.onWidgetShow():this.addDispose(R.onShow(P=>{P&&this.onWidgetShow()})),this.addDispose(R.onError(P=>{var O;P||((O=this._error)===null||O===void 0||O.resolve(),this._layout())})),this.addDispose(R.onResize(async()=>{this._debounceResize()}))}async init2(R,P){var O,M,k,F;if(this._uid=P?.id||R.id,this.setupWidget(R),!P||Object.keys(P).length===0){const U=await this.terminalProfileInternalService.resolveDefaultProfile();P={id:this._uid,config:U}}if(!P.cwd){const W=R.group.widgets.get();if(W.length>1&&W[0]){const j=await this.internalService.getCwd(W[0].id);j&&(P.cwd=j)}}await this._checkWorkspace();const L=(k=(O=P.cwd)!==null&&O!==void 0?O:(M=P?.config)===null||M===void 0?void 0:M.cwd)!==null&&k!==void 0?k:this._workspacePath,B=this.controller.convertProfileToLaunchConfig(P.config,L);this._launchConfig=B,this._launchConfig.__fromTerminalOptions&&(this._terminalOptions=this._launchConfig.__fromTerminalOptions),this.name=B.name||"",B.initialText&&this.xterm.raw.writeln(B.initialText),B.env||(B.env={}),(F=this.environmentService.mergedCollection)===null||F===void 0||F.applyToProcessEnvironment(B.env,this.applicationService.backendOS,this.variableResolver.resolve.bind(this.variableResolver)),this.addDispose(this.environmentService.onDidChangeCollections(U=>{U.applyToProcessEnvironment(B.env,this.applicationService.backendOS,this.variableResolver.resolve.bind(this.variableResolver))})),this._attachXterm(),this._attachAfterRender()}get name(){return this._name}set name(R){this._name!==R&&(this._name=R,this._onNameChangeEmitter.fire(R))}get term(){return this.xterm.raw}get pid(){return this.internalService.getProcessId(this.id)}get launchConfig(){return this._launchConfig}get createOptions(){}get container(){return this.xterm.container}get id(){return this._uid}get widget(){return this._widget}get ready(){return this._ready}get attached(){return this._attached}get firstOutput(){return this._firstStdout}get show(){return this._show}get areLinksReady(){return this._areLinksReady}get os(){return this._os}_prepareAddons(){this._attachAddon=new c.AttachAddon;const R=this._attachAddon.onBeforeProcessData;if(this.preferenceService.get("terminal.integrated.localEchoEnabled")){const P=this.preferenceService.get("terminal.integrated.localEchoExcludePrograms",A.DEFAULT_LOCAL_ECHO_EXCLUDE),O=new A.TypeAheadAddon(R,{localEchoExcludePrograms:Array.isArray(P)?P:A.DEFAULT_LOCAL_ECHO_EXCLUDE,localEchoLatencyThreshold:this.preferenceService.get("terminal.integrated.localEchoLatencyThreshold",30),localEchoStyle:this.preferenceService.get("terminal.integrated.localEchoStyle","dim")},this.preferenceService.onPreferenceChanged);this.addDispose(O),this.xterm.raw.loadAddon(O)}this.addDispose([this._attachAddon,this._attachAddon.onData(P=>{this._onOutput.fire({id:this.id,data:P})}),this._attachAddon.onExit(P=>{var O,M;this.logger.warn(`${this.id} ${this.name} exit with ${P}`),P!==0&&this.messageService.error(`terminal ${this.name}(${(M=(O=this._attachAddon.connection)===null||O===void 0?void 0:O.ptyInstance)===null||M===void 0?void 0:M.shellPath}) exited with non-zero code ${P}`),this._onExit.fire({id:this.id,code:P})}),this._attachAddon.onTime(P=>{this._onResponseTime.fire(P),this.reporter.performance(v.REPORT_NAME.TERMINAL_MEASURE,{duration:P,msg:"terminal.response"})})]),this.xterm.raw.loadAddon(this._attachAddon)}_xtermEvents(){this.addDispose(this.xterm.raw.onResize(R=>{this._hasOutput&&this._doResize()}))}_attachXterm(){this._prepareAddons(),this._xtermEvents(),this._linkManager=this.injector.get(f.TerminalLinkManager,[this.xterm.raw,this]),this._linkManager.processCwd=this._workspacePath,this.addDispose(this._linkManager),this._areLinksReady=!0,this._onLinksReady.fire(this)}_doResize(){this.internalService.resize(this.id,this.xterm.raw.cols,this.xterm.raw.rows)}_prepare(){var R,P,O,M,k;(R=this._attached)===null||R===void 0||R.reject("TerminalClient is Re-initialization"),(P=this._firstStdout)===null||P===void 0||P.reject("TerminalClient is Re-initialization"),(O=this._error)===null||O===void 0||O.reject("TerminalClient is Re-initialization"),(M=this._show)===null||M===void 0||M.reject("TerminalClient is Re-initialization"),this._ready=!1,this._hasOutput=!1,this._attached=new v.Deferred,this._show=new v.Deferred,this._error=new v.Deferred,this._firstStdout=new v.Deferred,(k=this._attachAddon)===null||k===void 0||k.setConnection(void 0),this.internalService.getOS().then(L=>{this._os=L});const{dispose:F}=this.onOutput(()=>{F(),this._hasOutput=!0,this._firstStdout.resolve()})}_attachAfterRender(){queueMicrotask(()=>{var R;this._layout(),this.attach(),this.focus(),this.widget.show||(R=this._show)===null||R===void 0||R.promise.then(async()=>{this._show=new v.Deferred})})}async _pickWorkspace(){var R;if(this.workspace.isMultiRootWorkspaceOpened&&!this._widget.recovery){const P=this.workspace.tryGetRoots();return await this.quickPick.show(P.map(M=>new v.URI(M.uri).codeUri.fsPath),{placeholder:(0,a.localize)("terminal.selectCWDForNewTerminal")})}else return this.workspace.workspace?new v.URI((R=this.workspace.workspace)===null||R===void 0?void 0:R.uri).codeUri.fsPath:void 0}async _checkWorkspace(){const R=this._widget;if(n.WORKSPACE_PATH_CACHED.has(R.group.id))this._workspacePath=n.WORKSPACE_PATH_CACHED.get(R.group.id);else{const P=await this._pickWorkspace();P&&(this._workspacePath=P,n.WORKSPACE_PATH_CACHED.set(R.group.id,this._workspacePath))}}async checkHealthy(){return await this.internalService.check([this.id])}displayUnHealthyMessage(){const R=this.term,P=R.options.theme,O=(k,F,L)=>{const B=" ",U=k.split(`
|
|
32356
32356
|
`).map(j=>B+j+B).join(`
|
|
32357
32357
|
`),W=`\x1B[48;2;${M(F)};38;2;${M(L)}m${U}\x1B[0m`;R.writeln(`
|
|
32358
32358
|
`),R.writeln(`
|
|
@@ -32363,7 +32363,7 @@ ${(0,o.formatLocalize)("terminal.integrated.exitedWithCode",h)}`),!((u=this.pres
|
|
|
32363
32363
|
`)+"\n```"),onClick:()=>this.onDidClickStatusBarEntry(b)})}notifyCollectionUpdates(){this._onDidChangeCollections.fire(this.mergedCollection),this.updateStatusBarMessage()}updateCollections(){(0,o.default)(this.persistCollections.bind(this),100)(),this.previousMergedCollection=this.mergedCollection,this.mergedCollection=this.resolveMergedCollection(),(0,r.default)(this.notifyCollectionUpdates.bind(this),1e3)()}persistCollections(){const y=[];this.collections.forEach((A,S)=>{A.persistent&&y.push({extensionIdentifier:S,collection:(0,h.serializeEnvironmentVariableCollection)(this.collections.get(S).map)})});const b=JSON.stringify(y);this.storageService.setData(t.ENVIRONMENT_VARIABLE_COLLECTIONS_KEY,b)}};t.TerminalEnvironmentService=f,n.__decorate([(0,p.Autowired)(g.IWorkspaceStorageService),n.__metadata("design:type",Object)],f.prototype,"storageService",void 0),n.__decorate([(0,p.Autowired)(s.IStatusBarService),n.__metadata("design:type",Object)],f.prototype,"statusbarService",void 0),n.__decorate([(0,p.Autowired)(l.ITerminalProcessPath),n.__metadata("design:type",Object)],f.prototype,"terminalProcessService",void 0),n.__decorate([(0,p.Autowired)(_.IDialogService),n.__metadata("design:type",Object)],f.prototype,"dialogService",void 0),n.__decorate([(0,p.Autowired)(m.CommandService),n.__metadata("design:type",Object)],f.prototype,"commandService",void 0),n.__decorate([(0,p.Autowired)(m.ILogger),n.__metadata("design:type",Object)],f.prototype,"logger",void 0),t.TerminalEnvironmentService=f=n.__decorate([(0,p.Injectable)()],f)},102:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalErrorService=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(26405);let p=class{constructor(){this.errors=new Map,this._onErrorsChangeEmitter=new o.Emitter,this.onErrorsChange=this._onErrorsChangeEmitter.event,this.service.onError(m=>{this.errors.set(m.id,m),this._onErrorsChangeEmitter.fire()}),this.service.onExit(m=>{try{this.view.getWidget(m.sessionId).reuse||this.view.removeWidget(m.sessionId)}catch{}}),this.controller.onDidCloseTerminal(m=>{this.errors.delete(m.id),this._onErrorsChangeEmitter.fire()})}async fix(m){const _=this.controller.findClientFromWidgetId(m);if(_)return await 0,this.errors.delete(m),this._onErrorsChangeEmitter.fire(),_.reset(),_.attached.promise}};t.TerminalErrorService=p,n.__decorate([(0,r.Autowired)(a.ITerminalService),n.__metadata("design:type",Object)],p.prototype,"service",void 0),n.__decorate([(0,r.Autowired)(a.ITerminalController),n.__metadata("design:type",Object)],p.prototype,"controller",void 0),n.__decorate([(0,r.Autowired)(a.ITerminalGroupViewService),n.__metadata("design:type",Object)],p.prototype,"view",void 0),t.TerminalErrorService=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p)},90853:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalProcessExtHostProxy=void 0;const n=e(43718);class r extends n.Disposable{get onProcessReady(){return this._onProcessReady.event}get onProcessOverrideDimensions(){return this._onProcessOverrideDimensions.event}constructor(a,p,v,m){super(),this.terminalId=a,this._cols=p,this._rows=v,this.controller=m,this._onProcessData=this.registerDispose(new n.Emitter),this.onProcessData=this._onProcessData.event,this._onProcessExit=this.registerDispose(new n.Emitter),this.onProcessExit=this._onProcessExit.event,this._onProcessReady=this.registerDispose(new n.Emitter),this._onProcessTitleChanged=this.registerDispose(new n.Emitter),this.onProcessTitleChanged=this._onProcessTitleChanged.event,this._onProcessOverrideDimensions=this.registerDispose(new n.Emitter),this._onStart=this.registerDispose(new n.Emitter),this.onStart=this._onStart.event,this._onInput=this.registerDispose(new n.Emitter),this.onInput=this._onInput.event,this._onResize=this.registerDispose(new n.Emitter),this.onResize=this._onResize.event,this._onShutdown=this.registerDispose(new n.Emitter),this.onShutdown=this._onShutdown.event,this._onRequestInitialCwd=this.registerDispose(new n.Emitter),this.onRequestInitialCwd=this._onRequestInitialCwd.event,this._onRequestCwd=this.registerDispose(new n.Emitter),this.onRequestCwd=this._onRequestCwd.event,this._onRequestLatency=this.registerDispose(new n.Emitter),this.onRequestLatency=this._onRequestLatency.event,this._pendingInitialCwdRequests=[],this._pendingCwdRequests=[],this._pendingLatencyRequests=[]}emitData(a){this._onProcessData.fire(a)}emitTitle(a){this._onProcessTitleChanged.fire(a)}emitReady(a,p){this._onProcessReady.fire({pid:a,cwd:p})}emitExit(a){this._onProcessExit.fire(a),this.dispose()}emitOverrideDimensions(a){this._onProcessOverrideDimensions.fire(a)}emitInitialCwd(a){for(;this._pendingInitialCwdRequests.length>0;)this._pendingInitialCwdRequests.pop()(a)}emitCwd(a){for(;this._pendingCwdRequests.length>0;)this._pendingCwdRequests.pop()(a)}emitLatency(a){for(;this._pendingLatencyRequests.length>0;)this._pendingLatencyRequests.pop()(a)}async start(){return this.controller.requestStartExtensionTerminal(this,this._cols,this._rows)}shutdown(a){this._onShutdown.fire(a)}input(a){this._onInput.fire(a)}resize(a,p){this._onResize.fire({cols:a,rows:p})}getInitialCwd(){return new Promise(a=>{this._onRequestInitialCwd.fire(),this._pendingInitialCwdRequests.push(a)})}getCwd(){return new Promise(a=>{this._onRequestCwd.fire(),this._pendingCwdRequests.push(a)})}getLatency(){return new Promise(a=>{this._onRequestLatency.fire(),this._pendingLatencyRequests.push(a)})}}t.TerminalProcessExtHostProxy=r},53891:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalHoverManagerService=void 0;const n=e(85608),r=e(76003),o=e(43718),a=20,p=5;let v=class{appendTerminalHoverOverlay(){let _=document.querySelector("#terminal-link-hover-overlay");_||(_=document.createElement("div"),_.id="terminal-link-hover-overlay",document.body.appendChild(_));const s=document.createElement("div");s.classList.add("terminal-hover-overlay"),_.appendChild(s),this.hoverOverlay=s}appendTerminalHoverContainer(){var _;this.hoverWidget=document.createElement("div"),this.hoverWidget.style.display="none",this.hoverWidget.style.position="fixed",this.hoverWidget.style.color="var(--editorWidget-foreground)",this.hoverWidget.style.backgroundColor="var(--editorWidget-background)",this.hoverWidget.style.borderColor="var(--editorWidget-border)",this.hoverWidget.style.borderWidth="0.5px",this.hoverWidget.style.borderStyle="solid",this.hoverWidget.style.padding="5px",this.hoverWidget.style.top="-500px",this.hoverWidget.style.left="-500px",this.hoverWidget.style.zIndex="10",this.hoverWidget.classList.add("hover-container"),this.hoverOverlay||this.appendTerminalHoverOverlay(),(_=this.hoverOverlay)===null||_===void 0||_.appendChild(this.hoverWidget)}setHoverOverlay(_){this.hoverOverlay=_}showHover(_,s,g){this.hoverWidget||this.appendTerminalHoverContainer();const l=_.viewportRange,h=_.cellDimensions,u=_.boundingClientRect;return this.hoverWidget&&(this.hoverWidget.textContent=s,this.hoverWidget.style.display="inline"),requestAnimationFrame(()=>{if(this.hoverWidget){this.hoverWidget.style.top=`${(l.start.y-1)*h.height+u.y-a}px`;let d=l.start.x*h.width+u.x+p;d+this.hoverWidget.clientWidth>u.x+u.width&&(d=u.x+u.width-this.hoverWidget.clientWidth-p),this.hoverWidget.style.left=`${d}px`}}),o.Disposable.create(()=>this.dispose())}hideHover(){this.hoverWidget&&this.dispose()}dispose(){var _;(_=this.hoverWidget)===null||_===void 0||_.remove(),this.hoverWidget=void 0}};t.TerminalHoverManagerService=v,t.TerminalHoverManagerService=v=n.__decorate([(0,r.Injectable)()],v)},35628:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalKeyBoardInputService=void 0;const n=e(85608),r=e(76003),o=e(43718);let a=class{constructor(){this._isCommandOrCtrl=!1}get isCommandOrCtrl(){return this._isCommandOrCtrl}listen(){const v=o.isMacintosh?"Meta":"Control";document.addEventListener("keydown",m=>{m.key===v&&(this._isCommandOrCtrl=!0)}),document.addEventListener("keyup",m=>{m.key===v&&(this._isCommandOrCtrl=!1)})}};t.TerminalKeyBoardInputService=a,t.TerminalKeyBoardInputService=a=n.__decorate([(0,r.Injectable)()],a)},82022:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalInternalService=void 0;const n=e(85608),r=e(76003),o=e(26405);let a=class{constructor(){this._processExtHostProxies=new Map}generateSessionId(){return this.service.generateSessionId?this.service.generateSessionId():(0,o.generateSessionId)()}getOptions(){return this.service.getOptions?this.service.getOptions():{}}check(v){return this.service.check?this.service.check(v):Promise.resolve(!0)}_getExtHostProxy(v){return this._processExtHostProxies.get(v)}async sendText(v,m){const _=this._getExtHostProxy(v);return _?_.emitData(m):this.service.sendText(v,m)}async resize(v,m,_){const s=this._getExtHostProxy(v);return s?s.resize(m,_):this.service.resize(v,m,_)}disposeById(v){const m=this._getExtHostProxy(v);return m?(this._processExtHostProxies.delete(v),m.dispose()):this.service.disposeById(v)}async getProcessId(v){return this._getExtHostProxy(v)?-1:this.service.getProcessId(v)}onError(v){return this.service.onError(v)}onExit(v){return this.service.onExit(v)}onProcessChange(v){return this.service.onProcessChange(v)}async getOS(){return await this.service.getOS()}async getProfiles(v){return await this.service.getProfiles(v)}async getDefaultSystemShell(){return await this.service.getDefaultSystemShell()}async getCodePlatformKey(){return await this.service.getCodePlatformKey()}async attachByLaunchConfig(v,m,_,s,g){if(s.customPtyImplementation){const l=s.customPtyImplementation(v,m,_);return l.start(),l.onProcessExit(()=>{this._processExtHostProxies.delete(v)}),this._processExtHostProxies.set(v,l),{name:s.name||"ExtensionTerminal-"+v,readonly:!1,onData:l.onProcessData.bind(l),sendData:l.input.bind(l),onExit:l.onProcessExit.bind(l)}}return await this.service.attachByLaunchConfig(v,m,_,s,g)}async getCwd(v){return await this.service.getCwd(v)}};t.TerminalInternalService=a,n.__decorate([(0,r.Autowired)(o.ITerminalService),n.__metadata("design:type",Object)],a.prototype,"service",void 0),n.__decorate([(0,r.Autowired)(o.ITerminalController),n.__metadata("design:type",Object)],a.prototype,"controller",void 0),t.TerminalInternalService=a=n.__decorate([(0,r.Injectable)()],a)},12642:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalNetworkService=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(26405);let p=class extends o.Disposable{constructor(){super(),this._onConnect=new o.Emitter,this.onConnect=this._onConnect.event,this._onDisconnect=new o.Emitter,this.onDisconnect=this._onDisconnect.event,this._status=a.TerminalNetworkStatus.DISCONNECTED,this._resetRetryTimers=new Map,this._reconnectInfo=new Map,this.controller.onDidCloseTerminal(m=>{this._resetRetryTimers.delete(m.id),this._reconnectInfo.delete(m.id)}),this.onDispose(()=>{this._timer&&clearTimeout(this._timer)})}get status(){return this._status}setStatus(m){this._status=m,m===a.TerminalNetworkStatus.CONNECTED?(this._onConnect.fire(),this.scheduleReconnection()):this._onDisconnect.fire()}bindErrors(){this.service.onError(this.handleError.bind(this))}handleError(m){m.shouldReconnect==null&&(m.shouldReconnect=!0);const _=m.id,s=this.getReconnectInfo(_);s.times&&(s.nextRetry=Date.now()+2e3),this._reconnectInfo.set(_,s),this.scheduleReconnection()}reconnect(){if(this._status===a.TerminalNetworkStatus.DISCONNECTED)return;const m=Date.now();let _=Number.POSITIVE_INFINITY;for(const s of this.errorService.errors.keys()){if(!this.shouldReconnect(s))continue;const{nextRetry:g}=this.getReconnectInfo(s);g>m?_=Math.min(_,g-m):this.reconnectClient(s)}_<Number.POSITIVE_INFINITY&&this.scheduleReconnection(_)}async reconnectClient(m){this.countRetry(m);const _=this.errorService.fix(m);return _.then(()=>{this.resetRetryLater(m)}),_}getReconnectInfo(m){return this._reconnectInfo.get(m)||{times:0,nextRetry:0}}countRetry(m){const _=this._resetRetryTimers.get(m);_&&(clearTimeout(_),this._resetRetryTimers.delete(m));const s=this.getReconnectInfo(m);s.times+=1,this._reconnectInfo.set(m,s)}resetRetryLater(m){const _=window.setTimeout(()=>{this._reconnectInfo.delete(m),this._resetRetryTimers.delete(m)},8e3);this._resetRetryTimers.set(m,_)}scheduleReconnection(m=200){this._timer||(this._timer=window.setTimeout(()=>{this._timer=void 0,this.reconnect()},m))}shouldReconnect(m){const _=this.errorService.errors.get(m);return _?.shouldReconnect?this.getReconnectInfo(m).times<3:!1}};t.TerminalNetworkService=p,n.__decorate([(0,r.Autowired)(a.ITerminalErrorService),n.__metadata("design:type",Object)],p.prototype,"errorService",void 0),n.__decorate([(0,r.Autowired)(a.ITerminalInternalService),n.__metadata("design:type",Object)],p.prototype,"service",void 0),n.__decorate([(0,r.Autowired)(a.ITerminalController),n.__metadata("design:type",Object)],p.prototype,"controller",void 0),t.TerminalNetworkService=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p)},13663:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalPreference=void 0;const r=e(85608),o=r.__importDefault(e(16735)),a=e(76003),p=e(41869),v=e(43718),m=e(3276);let _=n=class{_prefToOption(g){return g.startsWith("terminal.integrated.")?g.replace("terminal.integrated.",""):g.replace("terminal.","")}_optionToPref(g){return`terminal.${g}`}_valid(g,l){return this.toValidOption(g,l)||n.defaultOptions[g]}constructor(){this._onChange=new v.Emitter,this.onChange=this._onChange.event,this.service.onPreferenceChanged(({preferenceName:g,newValue:l,oldValue:h})=>{const u=this._prefToOption(g);l!==h&&m.SupportedOptionsName[u]&&this._onChange.fire({name:u,value:this._valid(u,l)})})}getCodeCompatibleOption(){const g={copyOnSelection:this.service.get("terminal.integrated.copyOnSelection"),cursorBlink:this.service.get("terminal.integrated.cursorBlinking"),fontSize:this.service.get("terminal.integrated.fontSize"),scrollback:this.service.get("terminal.integrated.scrollback"),fontFamily:this.service.get("terminal.integrated.fontFamily")||this.service.get("editor.fontFamily"),fontWeight:this.service.get("terminal.integrated.fontWeight"),fontWeightBold:this.service.get("terminal.integrated.fontWeightBold"),cursorStyle:this.service.get("terminal.integrated.cursorStyle")==="line"?"bar":this.service.get("terminal.integrated.cursorStyle"),cursorWidth:this.service.get("terminal.integrated.cursorWidth"),lineHeight:this.service.get("terminal.integrated.lineHeight"),letterSpacing:this.service.get("terminal.integrated.letterSpacing"),fastScrollSensitivity:this.service.get("terminal.integrated.fastScrollSensitivity")};return(0,o.default)(g,l=>l!==void 0)}get(g){const l=this.service.get(this._optionToPref(g),n.defaultOptions[g]);return this._valid(g,l)}getOrUndefined(g){return this.service.get(this._optionToPref(g))}toValidOption(g,l){switch(g){case m.SupportedOptionsName.fontSize:return l>5?l:5;case m.SupportedOptionsName.cursorStyle:return l==="line"?"bar":l;default:return l}}getOptions(){const g={};return Object.entries(m.SupportedOptionsName).forEach(([l])=>{if(!l)return;const h=this.getOrUndefined(l);h&&(g[l]=h)}),g}toJSON(){return{...n.defaultOptions,...this.getCodeCompatibleOption(),...this.getOptions()}}};t.TerminalPreference=_,_.defaultOptions={allowTransparency:!1,macOptionIsMeta:!1,cursorBlink:!1,scrollback:2500,tabStopWidth:8,fontSize:12,customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,scrollSensitivity:1,overviewRulerWidth:10,copyOnSelection:!1,fontWeightBold:"bold",fontFamily:"Menlo, Monaco, 'Courier New', monospace",cursorStyle:"block"},r.__decorate([(0,a.Autowired)(p.PreferenceService),r.__metadata("design:type",Object)],_.prototype,"service",void 0),t.TerminalPreference=_=n=r.__decorate([(0,a.Injectable)(),r.__metadata("design:paramtypes",[])],_)},94486:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalProfileInternalService=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(26405),p="Generated Profile";let v=class{async resolveTerminalTypeProfile(){var _,s;const g=this.preferenceService.get("terminal.type");if(!g||g==="default")return;let l=g;const h=[],u=await this.terminalService.getCodePlatformKey();await this.terminalService.getOS()===o.OperatingSystem.Windows?l=(_=await this.serviceClientRPC.$resolveWindowsShellPath(g))!==null&&_!==void 0?_:l:l=(s=await this.serviceClientRPC.$resolveUnixShellPath(g))!==null&&s!==void 0?s:l;const E=this.preferenceService.get(`terminal.integrated.shellArgs.${u}`,[]);return h.push(...E),{profileName:"terminal.type",path:l,args:h,icon:void 0,isDefault:!1}}async resolveDefaultProfile(_){const s=await this.resolveTerminalTypeProfile();if(s)return s;await this.profileService.profilesReady;let g=await this.resolveRealDefaultProfile();return g||(g=await this._resolvedFallbackDefaultProfile(_)),g}async resolveRealDefaultProfile(){await this.profileService.profilesReady;const _=this.profileService.getDefaultProfileName();if(_)return this.profileService.availableProfiles.find(s=>s.profileName===_)}async _resolvedFallbackDefaultProfile(_){var s;const g=await this.terminalService.getDefaultSystemShell();let l;return((s=_?.os)!==null&&s!==void 0?s:await this.terminalService.getOS())===o.OperatingSystem.Macintosh&&o.path.parse(g).name.match(/(zsh|bash)/)?l=["--login"]:l=[],{profileName:p,path:g,args:l,isDefault:!1}}};t.TerminalProfileInternalService=v,n.__decorate([(0,r.Autowired)(a.ITerminalProfileService),n.__metadata("design:type",Object)],v.prototype,"profileService",void 0),n.__decorate([(0,r.Autowired)(a.ITerminalService),n.__metadata("design:type",Object)],v.prototype,"terminalService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],v.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(a.ITerminalServicePath),n.__metadata("design:type",Object)],v.prototype,"serviceClientRPC",void 0),t.TerminalProfileInternalService=v=n.__decorate([(0,r.Injectable)()],v)},89570:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalProfileService=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(43718),p=e(26405),{equals:v}=a.arrays;let m=class extends a.WithEventBus{get onTerminalProfileResolved(){return this.onTerminalProfileResolvedEmitter.event}get onDidChangeDefaultShell(){return this.onDidChangeDefaultShellEmitter.event}get profilesReady(){return this._profilesReadyBarrier.wait().then(()=>{})}get onDidChangeAvailableProfiles(){return this._onDidChangeAvailableProfiles.event}constructor(){super(),this.onTerminalProfileResolvedEmitter=new a.Emitter,this.onDidChangeDefaultShellEmitter=new a.Emitter,this._onDidChangeAvailableProfiles=new a.Emitter,this._profileProviders=new Map,this._contributedProfiles=[],this._rawContributedProfileMap=new Map,this._profilesReadyBarrier=new a.AutoOpenBarrier(5e3),this.refreshAvailableProfiles(),this.setupPreferenceListener()}get availableProfiles(){return this._availableProfiles||[]}get contributedProfiles(){return this._contributedProfiles||[]}setupPreferenceListener(){this.preferenceService.onPreferenceChanged(h=>{h.preferenceName==="terminal.type"&&this.onDidChangeDefaultShellEmitter.fire(h.newValue)})}getDefaultProfileName(){return this.preferenceService.get(`terminal.integrated.defaultProfile.${this.terminalService.getCodePlatformKey()}`)}refreshAvailableProfiles(){this._refreshAvailableProfilesNow()}getContributedProfileProvider(h,u){const d=this._profileProviders.get(h);return d?.get(u)}async createContributedTerminalProfile(h,u,d){await this.onTerminalProfileResolvedEmitter.fireAndAwait(u);const E=this.getContributedProfileProvider(h,u);if(!E){this.logger.error(`No terminal profile provider registered for id "${u}"`);return}try{await E.createContributedTerminalProfile(d)}catch(f){this.logger.error("create contributed terminal profile error:",f.message)}}registerTerminalProfileProvider(h,u,d){let E=this._profileProviders.get(h);return E||(E=new Map,this._profileProviders.set(h,E)),E.set(u,d),a.Disposable.create(()=>this._profileProviders.delete(u))}async _detectProfiles(h=!0){return await this.terminalService.getProfiles(h)}async _updateContributedProfiles(){const h=await this.terminalService.getCodePlatformKey(),u=[],d=this.preferenceService.get("terminal.integrated.profiles."+h,{});for(const[c,y]of Object.entries(d))y===null&&u.push(c);const E=Array.from(this.rawContributedProfiles.filter(c=>!u.includes(c.title))),f=!v(E,this._contributedProfiles,s);return this._contributedProfiles=E,f}async _refreshAvailableProfilesNow(){const h=await this._detectProfiles(!0),u=!v(h,this._availableProfiles,_),d=await this._updateContributedProfiles();(u||d)&&(this._availableProfiles=h,this._profilesReadyBarrier.open(),this._onDidChangeAvailableProfiles.fire(this._availableProfiles))}async getContributedDefaultProfile(h){if(h&&!h.extHostTerminalId&&!("executable"in h)){const u=await this.terminalService.getCodePlatformKey(),d=this.preferenceService.get(`terminal.integrated.defaultProfile.${u}`);return this.contributedProfiles.find(f=>f.title===d)}}async saveContributedProfile(h){const u=await this.terminalService.getCodePlatformKey(),d=await this.preferenceService.get(`terminal.integrated.profiles.${u}`);if(typeof d=="object"){const E={extensionIdentifier:h.extensionIdentifier,icon:h.options.icon,id:h.id,title:h.title,color:h.options.color};d[h.title]=E}await this.preferenceService.set(`terminal.integrated.profiles.${u}`,d,a.PreferenceScope.User)}get rawContributedProfiles(){return Array.from(this._rawContributedProfileMap.values())}addContributedProfile(h,u){var d;const E=((d=u?.profiles)===null||d===void 0?void 0:d.filter(f=>g(f)).map(f=>({...f,extensionIdentifier:h})))||[];for(const f of E)this._rawContributedProfileMap.set(f.id,f);this.refreshAvailableProfiles()}removeContributedProfile(h){const u=this.rawContributedProfiles;for(const d of u)d.extensionIdentifier===h&&this._rawContributedProfileMap.delete(d.id)}};t.TerminalProfileService=m,n.__decorate([(0,r.Autowired)(p.ITerminalService),n.__metadata("design:type",Object)],m.prototype,"terminalService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],m.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(a.ILogger),n.__metadata("design:type",Object)],m.prototype,"logger",void 0),n.__decorate([(0,a.throttle)(2e3),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],m.prototype,"refreshAvailableProfiles",null),t.TerminalProfileService=m=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],m);function _(l,h){return l.profileName===h.profileName&&(0,p.terminalProfileArgsMatch)(l.args,h.args)&&l.color===h.color&&l.isAutoDetected===h.isAutoDetected&&l.isDefault===h.isDefault&&l.overrideName===h.overrideName&&l.path===h.path}function s(l,h){return l.extensionIdentifier===h.extensionIdentifier&&l.color===h.color&&l.icon===h.icon&&l.id===h.id&&l.title===h.title}function g(l){return!l.icon||typeof l.icon=="string"||a.URI.isUri(l.icon)||"light"in l.icon&&"dark"in l.icon&&a.URI.isUri(l.icon.light)&&a.URI.isUri(l.icon.dark)}},46666:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalRenderProvider=void 0;const n=e(85608),r=e(76003),o=e(65586);let a=class{get infoItemRender(){return o.renderInfoItem}get addItemRender(){return o.renderAddItem}};t.TerminalRenderProvider=a,t.TerminalRenderProvider=a=n.__decorate([(0,r.Injectable)()],a)},70406:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalRestore=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(26405),p="OPENSUMI_TERMINAL_RESTORE";let v=class extends o.Disposable{get storageKey(){return p}save(){const _=this.controller.toJSON(),s=this.storageKey;this.scopedBrowserStorageService.setData(s,_)}restore(){const _=this.storageKey,s=this.scopedBrowserStorageService.getData(_);if(s)try{return this.controller.recovery(s)}catch{}return Promise.resolve()}};t.TerminalRestore=v,n.__decorate([(0,r.Autowired)(a.ITerminalController),n.__metadata("design:type",Object)],v.prototype,"controller",void 0),n.__decorate([(0,r.Autowired)(a.ITerminalInternalService),n.__metadata("design:type",Object)],v.prototype,"service",void 0),n.__decorate([(0,r.Autowired)(o.ScopedBrowserStorageService),n.__metadata("design:type",o.ScopedBrowserStorageService)],v.prototype,"scopedBrowserStorageService",void 0),t.TerminalRestore=v=n.__decorate([(0,r.Injectable)()],v)},12894:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalSearchService=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(26405);let p=class{constructor(){this._isVisible=!1,this.UIState={isMatchCase:!1,isUseRegexp:!1,isWholeWord:!1},this._onVisibleChange=new o.Emitter,this.onVisibleChange=this._onVisibleChange.event,this.text=""}get isVisible(){return this._isVisible}set isVisible(m){this._isVisible=m,this._onVisibleChange.fire(m)}get client(){return this.controller.findClientFromWidgetId(this.terminalView.currentWidget.get().id)}open(){this.isVisible=!0}get onResultChange(){var m;return(m=this.client)===null||m===void 0?void 0:m.onSearchResultsChange}close(){var m;(m=this.client)===null||m===void 0||m.closeSearch(),this.isVisible=!1}clear(){var m;(m=this.client)===null||m===void 0||m.closeSearch(),this.text=""}search(){var m;(m=this.client)===null||m===void 0||m.findNext(this.text,{wholeWord:this.UIState.isWholeWord,regex:this.UIState.isUseRegexp,caseSensitive:this.UIState.isMatchCase})}searchPrevious(){var m;(m=this.client)===null||m===void 0||m.findPrevious(this.text,{wholeWord:this.UIState.isWholeWord,regex:this.UIState.isUseRegexp,caseSensitive:this.UIState.isMatchCase})}searchNext(){var m;(m=this.client)===null||m===void 0||m.findNext(this.text,{wholeWord:this.UIState.isWholeWord,regex:this.UIState.isUseRegexp,caseSensitive:this.UIState.isMatchCase})}updateUIState(m){this.UIState={...this.UIState,...m},this.search()}};t.TerminalSearchService=p,n.__decorate([(0,r.Autowired)(a.ITerminalController),n.__metadata("design:type",Object)],p.prototype,"controller",void 0),n.__decorate([(0,r.Autowired)(a.ITerminalGroupViewService),n.__metadata("design:type",Object)],p.prototype,"terminalView",void 0),n.__decorate([(0,o.debounce)(150),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],p.prototype,"search",null),n.__decorate([(0,o.debounce)(150),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],p.prototype,"searchPrevious",null),n.__decorate([(0,o.debounce)(150),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],p.prototype,"searchNext",null),t.TerminalSearchService=p=n.__decorate([(0,r.Injectable)()],p)},91815:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.NodePtyTerminalService=void 0;const r=e(85608),o=e(76003),a=e(41869),p=e(43718),v=e(26405);let m=n=class extends p.Disposable{constructor(){super(...arguments),this._onError=this.registerDispose(new p.Emitter),this.onError=this._onError.event,this._onExit=this.registerDispose(new p.Emitter),this.onExit=this._onExit.event,this._onProcessChange=this.registerDispose(new p.Emitter),this.onProcessChange=this._onProcessChange.event,this._onDataDispatcher=this.registerDispose(new p.Dispatcher),this._onExitDispatcher=this.registerDispose(new p.Dispatcher),this._createCustomWebSocket=(s,g)=>({name:g.name,readonly:!1,onData:l=>this._onDataDispatcher.on(s)(l),onExit:l=>this._onExitDispatcher.on(s)(h=>{l(h.code)}),sendData:l=>{this.sendText(s,l)},ptyInstance:g})}generateSessionId(){return this.applicationService.clientId+v.TERMINAL_ID_SEPARATOR+(0,v.generateSessionId)()}async check(s){return await this.serviceClientRPC.ensureTerminal(s)}async attachByLaunchConfig(s,g,l,h,u){h.executable||(h.executable=await this.getDefaultSystemShell()),this.logger.log(`attach terminal ${s} with launchConfig `,h);const d=await this.serviceClientRPC.create2(s,g,l,h);if(d&&(d.pid||d.name))return this.logger.log(`${s} attach success, pid: ${d.pid}, name: ${d.name}`),this._createCustomWebSocket(s,d);this.logger.error(`${s} cannot create ptyInstance`,d)}_sendMessage(s,g,l){const h=l||n.countId++;this.serviceClientRPC.onMessage(s,JSON.stringify({id:h,...g}))}async sendText(s,g){this._sendMessage(s,{data:g})}async resize(s,g,l){this._sendMessage(s,{method:"resize",params:{cols:g,rows:l}})}async getCodePlatformKey(){return await this.serviceClientRPC.getCodePlatformKey()}disposeById(s){this.serviceClientRPC.disposeById(s)}async getProcessId(s){return this.serviceClientRPC.getProcessId(s)}onMessage(s,g){this._onDataDispatcher.dispatch(s,g)}closeClient(s,g,l){this.logger.log(`${s} was closed, error:`,g),(0,v.isTerminalError)(g)?this._onError.fire(g):typeof g=="number"?(this._onExitDispatcher.dispatch(s,{code:g,signal:l}),this._onExit.fire({sessionId:s,code:g,signal:l})):g&&(this._onExitDispatcher.dispatch(s,{code:g.code,signal:g.signal}),this._onExit.fire({sessionId:s,code:g.code,signal:g.signal}))}$processChange(s,g){this._onProcessChange.fire({sessionId:s,processName:g})}async getOS(){return this.backendOs?this.backendOs:this.backendOs=this.serviceClientRPC.getOS()}async getProfiles(s){const g=await this.getCodePlatformKey(),l=this.preferenceService.get(`terminal.integrated.profiles.${g}`,{});return await this.serviceClientRPC.detectAvailableProfiles({autoDetect:s,preference:l})}async getCwd(s){try{return await this.serviceClientRPC.getCwd(s)}catch{return}}async getDefaultSystemShell(){return await this.serviceClientRPC.getDefaultSystemShell(await this.getOS())}};t.NodePtyTerminalService=m,m.countId=1,r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],m.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(p.ILogger),r.__metadata("design:type",Object)],m.prototype,"logger",void 0),r.__decorate([(0,o.Autowired)(v.ITerminalServicePath),r.__metadata("design:type",Object)],m.prototype,"serviceClientRPC",void 0),r.__decorate([(0,o.Autowired)(a.PreferenceService),r.__metadata("design:type",Object)],m.prototype,"preferenceService",void 0),r.__decorate([(0,o.Autowired)(p.IApplicationService),r.__metadata("design:type",Object)],m.prototype,"applicationService",void 0),t.NodePtyTerminalService=m=n=r.__decorate([(0,o.Injectable)()],m)},29041:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalTheme=void 0;const n=e(85608),r=e(76003),o=e(9132),a=e(48611),p=n.__importStar(e(43395));let v=class extends o.Themable{get terminalTheme(){var _,s,g,l,h,u,d,E,f,c,y,b,A,S,D,I;const w=this.getColorSync(p.TERMINAL_BACKGROUND_COLOR),T=this.getColorSync(p.TERMINAL_FOREGROUND_COLOR),R=this.getColorSync(p.TERMINAL_SELECTION_BACKGROUND_COLOR),P=this.getColorSync(p.TERMINAL_CURSOR_FOREGROUND_COLOR)||T,O=this.getColorSync(p.TERMINAL_CURSOR_BACKGROUND_COLOR)||w,M=this.getColorSync(p.TERMINAL_SELECTION_BACKGROUND_COLOR),k=this.getColorSync(p.TERMINAL_INACTIVE_SELECTION_BACKGROUND_COLOR),F=this.getColorSync(p.TERMINAL_SELECTION_FOREGROUND_COLOR)||void 0,L=p.ansiColorIdentifiers;if(!(w&&T&&R&&P&&O))throw new Error("terminal color undefined");return{background:a.Color.Format.CSS.formatHexA(w),foreground:a.Color.Format.CSS.formatHexA(T),cursor:a.Color.Format.CSS.formatHexA(P),cursorAccent:a.Color.Format.CSS.formatHexA(O),selectionBackground:M?.toString(),selectionInactiveBackground:k?.toString(),selectionForeground:F?.toString(),black:(_=this.getColorSync(L[0]))===null||_===void 0?void 0:_.toString(),red:(s=this.getColorSync(L[1]))===null||s===void 0?void 0:s.toString(),green:(g=this.getColorSync(L[2]))===null||g===void 0?void 0:g.toString(),yellow:(l=this.getColorSync(L[3]))===null||l===void 0?void 0:l.toString(),blue:(h=this.getColorSync(L[4]))===null||h===void 0?void 0:h.toString(),magenta:(u=this.getColorSync(L[5]))===null||u===void 0?void 0:u.toString(),cyan:(d=this.getColorSync(L[6]))===null||d===void 0?void 0:d.toString(),white:(E=this.getColorSync(L[7]))===null||E===void 0?void 0:E.toString(),brightBlack:(f=this.getColorSync(L[8]))===null||f===void 0?void 0:f.toString(),brightRed:(c=this.getColorSync(L[9]))===null||c===void 0?void 0:c.toString(),brightGreen:(y=this.getColorSync(L[10]))===null||y===void 0?void 0:y.toString(),brightYellow:(b=this.getColorSync(L[11]))===null||b===void 0?void 0:b.toString(),brightBlue:(A=this.getColorSync(L[12]))===null||A===void 0?void 0:A.toString(),brightMagenta:(S=this.getColorSync(L[13]))===null||S===void 0?void 0:S.toString(),brightCyan:(D=this.getColorSync(L[14]))===null||D===void 0?void 0:D.toString(),brightWhite:(I=this.getColorSync(L[15]))===null||I===void 0?void 0:I.toString()}}};t.TerminalTheme=v,t.TerminalTheme=v=n.__decorate([(0,r.Injectable)()],v)},70845:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeAheadAddon=t.PredictionTimeline=t.PredictionStats=t.isTenativeCharacterPrediction=t.DEFAULT_LOCAL_ECHO_EXCLUDE=void 0,t.escapeRegExpCharacters=a;const n=e(85608),r=e(43718),o=e(4636);t.DEFAULT_LOCAL_ECHO_EXCLUDE=["vim","vi","nano","tmux"];function a(Y){return Y.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}const p="\x1B",v=`${p}[`,m=`${v}?25h`,_=`${v}?25l`,s=`${v}X`,g=`${v}K`,l=/^\x1b\[[0-9;]*m/,h=/^\x1b\[?([0-9]*)(;[35])?O?([DC])/,u=/[^a-z0-9]/i,d=24,E=1e3*60*5,f=5,c=.3,y=.5,b=/^(\x1b\[(\??25[hl]|\??[0-9;]+n))+/,A=Y=>Y._core,S=Y=>{},D=!1,I=(...Y)=>{D&&console.log(Y)};class w{get x(){return this._x}get y(){return this._y}get baseY(){return this._baseY}get coordinate(){return{x:this._x,y:this._y,baseY:this._baseY}}constructor(X,oe,ie){this.rows=X,this.cols=oe,this._buffer=ie,this._x=0,this._y=1,this._baseY=1,this._x=ie.cursorX,this._y=ie.cursorY,this._baseY=ie.baseY}getLine(){return this._buffer.getLine(this._y+this._baseY)}getCell(X){var oe;return(oe=this.getLine())===null||oe===void 0?void 0:oe.getCell(this._x,X)}moveTo(X){return this._x=X.x,this._y=X.y+X.baseY-this._baseY,this.moveInstruction()}clone(){const X=new w(this.rows,this.cols,this._buffer);return X.moveTo(this),X}move(X,oe){return this._x=X,this._y=oe,this.moveInstruction()}shift(X=0,oe=0){return this._x+=X,this._y+=oe,this.moveInstruction()}moveInstruction(){return this._y>=this.rows?(this._baseY+=this._y-(this.rows-1),this._y=this.rows-1):this._y<0&&(this._baseY-=this._y,this._y=0),`${v}${this._y+1};${this._x+1}H`}}const T=(Y,X,oe)=>{let ie=!1;oe<0&&X.shift(-1);let he;for(;X.x>=0;){if(he=X.getCell(he),!he?.getCode())return;const me=he.getChars();if(u.test(me)){if(ie)break}else ie=!0;X.shift(oe)}oe<0&&X.shift(1)};class R{get remaining(){return this._input.length-this.index}get eof(){return this.index===this._input.length}get rest(){return this._input.slice(this.index)}constructor(X){this._input=X,this.index=0}eatChar(X){if(this._input[this.index]===X)return this.index++,X}eatStr(X){if(this._input.slice(this.index,X.length)===X)return this.index+=X.length,X}eatGradually(X){const oe=this.index;for(let ie=0;ie<X.length;ie++){if(ie>0&&this.eof)return 2;if(!this.eatChar(X[ie]))return this.index=oe,1}return 0}eatRe(X){const oe=X.exec(this._input.slice(this.index));if(oe)return this.index+=oe[0].length,oe}eatCharCode(X=0,oe=X+1){const ie=this._input.charCodeAt(this.index);if(!(ie<X||ie>=oe))return this.index++,ie}}class P{constructor(){this.clearAfterTimeout=!1}apply(){return""}rollback(){return""}rollForwards(){return""}matches(){return 1}}class O{constructor(X){this.inner=X}apply(X,oe){return this._appliedCursor=oe.clone(),this.inner.apply(X,this._appliedCursor),""}rollback(X){return this.inner.rollback(X.clone()),""}rollForwards(X,oe){return this._appliedCursor&&X.moveTo(this._appliedCursor),oe}matches(X){return this.inner.matches(X)}}const M=Y=>Y instanceof O&&Y.inner instanceof k;t.isTenativeCharacterPrediction=M;class k{constructor(X,oe){this._style=X,this._char=oe,this.affectsStyle=!0}apply(X,oe){const ie=oe.getCell();return this.appliedAt=ie?{pos:oe.coordinate,oldAttributes:G(ie),oldChar:ie.getChars()}:{pos:oe.coordinate,oldAttributes:"",oldChar:""},oe.shift(1),this._style.apply+this._char+this._style.undo}rollback(X){if(!this.appliedAt)return"";const{oldAttributes:oe,oldChar:ie,pos:he}=this.appliedAt;return X.moveTo(he)+(ie?`${oe}${ie}${X.moveTo(he)}`:s)}rollForwards(X,oe){return this.appliedAt?X.clone().moveTo(this.appliedAt.pos)+oe:""}matches(X,oe){const ie=X.index;for(;X.eatRe(l););if(X.eof)return 2;if(X.eatChar(this._char))return 0;if(oe instanceof k){const he=X.eatGradually(`\b${oe._char}${this._char}`);if(he!==1)return he}return X.index=ie,1}}class F{constructor(X){this._terminal=X}apply(X,oe){var ie;const he=!(!((ie=oe.getLine())===null||ie===void 0)&&ie.translateToString(void 0,oe.x).trim()),me=oe.coordinate,q=oe.shift(-1),Ee=oe.getCell();return this._appliedAt=Ee?{isLastChar:he,pos:me,oldAttributes:G(Ee),oldChar:Ee.getChars()}:{isLastChar:he,pos:me,oldAttributes:"",oldChar:""},q+s}rollback(X){if(!this._appliedAt)return"";const{oldAttributes:oe,oldChar:ie,pos:he}=this._appliedAt;return ie?oe+ie+X.moveTo(he)+G(A(this._terminal)._inputHandler._curAttrData):X.moveTo(he)+s}rollForwards(){return""}matches(X){var oe;if(!((oe=this._appliedAt)===null||oe===void 0)&&oe.isLastChar){const ie=X.eatGradually(`\b${v}K`);if(ie!==1)return ie;const he=X.eatGradually("\b \b");if(he!==1)return he}return 1}}class L{apply(X,oe){return this._prevPosition=oe.coordinate,oe.move(0,oe.y+1),`\r
|
|
32364
32364
|
`}rollback(X){return this._prevPosition?X.moveTo(this._prevPosition):""}rollForwards(){return""}matches(X){return X.eatGradually(`\r
|
|
32365
32365
|
`)}}class B extends L{apply(X,oe){return this._prevPosition=oe.coordinate,oe.move(0,oe.y+1)," \r"}matches(X){const oe=X.eatGradually(" \r");return oe!==1?X.eatGradually(g)===2?2:oe:X.eatGradually(`\r
|
|
32366
|
-
`)}}class U{constructor(X,oe,ie){this._direction=X,this._moveByWords=oe,this._amount=ie}apply(X,oe){const ie=oe.x,he=oe.getCell(),me=he?G(he):"",{_amount:q,_direction:Ee,_moveByWords:ue}=this,te=Ee==="D"?-1:1,fe=oe.clone();if(ue)for(let Ie=0;Ie<q;Ie++)T(X,fe,te);else fe.shift(te*q);return this._applied={amount:Math.abs(oe.x-fe.x),prevPosition:ie,prevAttrs:me,rollForward:oe.moveTo(fe)},this._applied.rollForward}rollback(X){return this._applied?X.move(this._applied.prevPosition,X.y)+this._applied.prevAttrs:""}rollForwards(){return""}matches(X){if(!this._applied)return 1;const oe=this._direction,{amount:ie,rollForward:he}=this._applied;if(X.eatStr(`${v}${oe}`.repeat(ie))||oe==="D"&&X.eatStr("\b".repeat(ie)))return 0;if(he){const me=X.eatGradually(he);if(me!==1)return me}return X.eatGradually(`${v}${ie}${oe}`)}}class W extends r.Disposable{get accuracy(){let X=0;for(const[,oe]of this._stats)oe&&X++;return X/(this._stats.length||1)}get sampleSize(){return this._stats.length}get latency(){const X=this._stats.filter(([,oe])=>oe).map(([oe])=>oe).sort();return{count:X.length,min:X[0],median:X[Math.floor(X.length/2)],max:X[X.length-1]}}get maxLatency(){let X=-1/0;for(const[oe,ie]of this._stats)ie&&(X=Math.max(oe,X));return X}constructor(X){super(),this._stats=[],this._index=0,this._addedAtTime=new WeakMap,this._changeEmitter=new r.Emitter,this.onChange=this._changeEmitter.event,this.addDispose(X.onPredictionAdded(oe=>this._addedAtTime.set(oe,Date.now()))),this.addDispose(X.onPredictionSucceeded(this._pushStat.bind(this,!0))),this.addDispose(X.onPredictionFailed(this._pushStat.bind(this,!1)))}_pushStat(X,oe){const ie=this._addedAtTime.get(oe);this._stats[this._index]=[Date.now()-ie,X],this._index=(this._index+1)%d,this._changeEmitter.fire()}}t.PredictionStats=W;class j{get _currentGenerationPredictions(){return this._expected.filter(({gen:X})=>X===this._expected[0].gen).map(({p:X})=>X)}get isShowingPredictions(){return this._showPredictions}get length(){return this._expected.length}constructor(X,oe){this.terminal=X,this._style=oe,this._expected=[],this._currentGen=0,this._showPredictions=!1,this._addedEmitter=new r.Emitter,this.onPredictionAdded=this._addedEmitter.event,this._failedEmitter=new r.Emitter,this.onPredictionFailed=this._failedEmitter.event,this._succeededEmitter=new r.Emitter,this.onPredictionSucceeded=this._succeededEmitter.event}setShowPredictions(X){if(X===this._showPredictions)return;I("set predictions:",X),this._showPredictions=X;const oe=this._getActiveBuffer();if(!oe)return;const ie=this._currentGenerationPredictions;X?(this.clearCursor(),this._style.expectIncomingStyle(ie.reduce((he,me)=>me.affectsStyle?he+1:he,0)),this.terminal.write(ie.map(he=>he.apply(oe,this.physicalCursor(oe))).join(""))):this.terminal.write(ie.reverse().map(he=>he.rollback(this.physicalCursor(oe))).join(""))}undoAllPredictions(){const X=this._getActiveBuffer();this._showPredictions&&X&&this.terminal.write(this._currentGenerationPredictions.reverse().map(oe=>oe.rollback(this.physicalCursor(X))).join("")),this._expected=[]}beforeServerInput(X){var oe;const ie=X;if(this._inputBuffer&&(X=this._inputBuffer+X,this._inputBuffer=void 0),!this._expected.length)return this._clearPredictionState(),X;const he=this._getActiveBuffer();if(!he)return this._clearPredictionState(),X;let me="";const q=new R(X),Ee=this._expected[0].gen,ue=()=>{const te=q.eatRe(b);te&&(me+=te[0])};e:for(;this._expected.length&&q.remaining>0;){ue();const{p:te,gen:fe}=this._expected[0],Ie=this.physicalCursor(he),Me=q.index;switch(te.matches(q,this._lookBehind)){case 0:{const Be=X.slice(Me,q.index);fe===Ee?me+=(oe=te.rollForwards)===null||oe===void 0?void 0:oe.call(te,Ie,Be):(te.apply(he,this.physicalCursor(he)),me+=Be),this._succeededEmitter.fire(te),this._lookBehind=te,this._expected.shift();break}case 2:this._inputBuffer=X.slice(Me),q.index=X.length;break e;case 1:{const Be=this._expected.filter(Pe=>Pe.gen===Ee).reverse();me+=Be.map(({p:Pe})=>Pe.rollback(this.physicalCursor(he))).join(""),Be.some(Pe=>Pe.p.affectsStyle)&&(me+=G(A(this.terminal)._inputHandler._curAttrData)),this._clearPredictionState(),this._failedEmitter.fire(te);break e}}}if(ue(),q.eof||(me+=q.rest,this._clearPredictionState()),this._expected.length&&Ee!==this._expected[0].gen)for(const{p:te,gen:fe}of this._expected){if(fe!==this._expected[0].gen)break;te.affectsStyle&&this._style.expectIncomingStyle(),me+=te.apply(he,this.physicalCursor(he))}return this._showPredictions?(me.length===0||me===X||(this._physicalCursor&&(me+=this._physicalCursor.moveInstruction()),me=_+me+m),me):ie}_clearPredictionState(){this._expected=[],this.clearCursor(),this._lookBehind=void 0}addPrediction(X,oe){if(I("prediction type: \x1B[36m%s\x1B[0m",oe.constructor.name),this._expected.push({gen:this._currentGen,p:oe}),this._addedEmitter.fire(oe),this._currentGen!==this._expected[0].gen)return oe.apply(X,this.tentativeCursor(X)),!1;const ie=oe.apply(X,this.physicalCursor(X));return this._tenativeCursor=void 0,this._showPredictions&&ie&&(oe.affectsStyle&&this._style.expectIncomingStyle(),I("predict:",JSON.stringify(ie)),I("prediction type: \x1B[36m%s\x1B[0m",oe.constructor.name),this.terminal.write(ie)),!0}addBoundary(X,oe){let ie=!1;return X&&oe&&(ie=this.addPrediction(X,new O(oe)),oe.apply(X,this.tentativeCursor(X))),this._currentGen++,ie}peekEnd(){var X;return(X=this._expected[this._expected.length-1])===null||X===void 0?void 0:X.p}peekStart(){var X;return(X=this._expected[0])===null||X===void 0?void 0:X.p}physicalCursor(X){return this._physicalCursor||(this._showPredictions&&S(this.terminal),this._physicalCursor=new w(this.terminal.rows,this.terminal.cols,X)),this._physicalCursor}tentativeCursor(X){return this._tenativeCursor||(this._tenativeCursor=this.physicalCursor(X).clone()),this._tenativeCursor}clearCursor(){this._physicalCursor=void 0,this._tenativeCursor=void 0}_getActiveBuffer(){const X=this.terminal.buffer.active;return X.type==="normal"?X:void 0}}t.PredictionTimeline=j;const Q=Y=>{if(Y.isAttributeDefault())return[0];const X=[];return Y.isBold()&&X.push(1),Y.isDim()&&X.push(2),Y.isItalic()&&X.push(3),Y.isUnderline()&&X.push(4),Y.isBlink()&&X.push(5),Y.isInverse()&&X.push(7),Y.isInvisible()&&X.push(8),Y.isFgRGB()&&X.push(38,2,Y.getFgColor()>>>24,Y.getFgColor()>>>16&255,Y.getFgColor()&255),Y.isFgPalette()&&X.push(38,5,Y.getFgColor()),Y.isFgDefault()&&X.push(39),Y.isBgRGB()&&X.push(48,2,Y.getBgColor()>>>24,Y.getBgColor()>>>16&255,Y.getBgColor()&255),Y.isBgPalette()&&X.push(48,5,Y.getBgColor()),Y.isBgDefault()&&X.push(49),X},G=Y=>`${v}${Q(Y).join(";")}m`,Z=(Y,X,oe)=>{if(Y.length-X>oe.length)return!1;for(let ie=0;ie<oe.length;ie++,X++)if(oe[X]!==Y[X])return!1;return!0},$=(Y,X)=>{const oe=[0,0,-1,0,0,0];let ie=0,he=0;do{const me=Y[X+he];if(oe[he+ie]=typeof me=="number"?me:me[0],typeof me!="number"){let q=0;do oe[1]===5&&(ie=1),oe[he+q+1+ie]=me[q];while(++q<me.length&&q+he+1+ie<oe.length);break}if(oe[1]===5&&he+ie>=2||oe[1]===2&&he+ie>=5)break;oe[1]&&(ie=1)}while(++he+X<Y.length&&he+ie<oe.length);return he};class V{static _compileArgs(X){return`${v}${X.join(";")}m`}constructor(X,oe){this._terminal=oe,this._expectedIncomingStyles=0,this.onUpdate(X)}expectIncomingStyle(X=1){this._expectedIncomingStyles+=X*2}startTracking(){this._expectedIncomingStyles=0,this._onDidWriteSGR(Q(A(this._terminal)._inputHandler._curAttrData)),this._csiHandler=this._terminal.parser.registerCsiHandler({final:"m"},X=>(this._onDidWriteSGR(X),!1))}debounceStopTracking(){this._stopTracking()}dispose(){this._stopTracking()}_stopTracking(){var X;(X=this._csiHandler)===null||X===void 0||X.dispose(),this._csiHandler=void 0}_onDidWriteSGR(X){const oe=this._undoArgs;for(let ie=0;ie<X.length;){const he=X[ie],me=typeof he=="number"?he:he[0];if(this._expectedIncomingStyles){if(Z(X,ie,this._undoArgs)){this._expectedIncomingStyles--,ie+=this._undoArgs.length;continue}if(Z(X,ie,this._applyArgs)){this._expectedIncomingStyles--,ie+=this._applyArgs.length;continue}}const q=me===38||me===48||me===58?$(X,ie):1;switch(this._applyArgs[0]){case 1:me===2?this._undoArgs=[22,2]:(me===22||me===0)&&(this._undoArgs=[22]);break;case 2:me===1?this._undoArgs=[22,1]:(me===22||me===0)&&(this._undoArgs=[22]);break;case 38:me===0||me===39||me===100?this._undoArgs=[39]:(me>=30&&me<=38||me>=90&&me<=97)&&(this._undoArgs=X.slice(ie,ie+q));break;default:me===this._applyArgs[0]?this._undoArgs=this._applyArgs:me===0&&(this._undoArgs=this._originalUndoArgs)}ie+=q}oe!==this._undoArgs&&(this.undo=V._compileArgs(this._undoArgs))}onUpdate(X){const{applyArgs:oe,undoArgs:ie}=this._getArgs(X);this._applyArgs=oe,this._undoArgs=this._originalUndoArgs=ie,this.apply=V._compileArgs(this._applyArgs),this.undo=V._compileArgs(this._undoArgs)}_getArgs(X){switch(X){case"bold":return{applyArgs:[1],undoArgs:[22]};case"dim":return{applyArgs:[2],undoArgs:[22]};case"italic":return{applyArgs:[3],undoArgs:[23]};case"underlined":return{applyArgs:[4],undoArgs:[24]};case"inverted":return{applyArgs:[7],undoArgs:[27]};default:{let oe;try{oe=o.Color.fromHex(X)}catch{oe=new o.Color(new o.RGBA(255,0,0,1))}const{r:ie,g:he,b:me}=oe.rgba;return{applyArgs:[38,2,ie,he,me],undoArgs:[39]}}}}}n.__decorate([(0,r.debounce)(2e3),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],V.prototype,"debounceStopTracking",null);const H=(Y=t.DEFAULT_LOCAL_ECHO_EXCLUDE)=>new RegExp(`\\b(${Y.map(a).join("|")})\\b`,"i");class K extends r.Disposable{constructor(X,oe,ie){super(),this.onBeforeProcessData=X,this._config=oe,this.onDidTerminalPreferenceChange=ie,this._terminalTitle="",this.disposableCollection=new r.DisposableCollection,this._excludeProgramRe=H(this._config.localEchoExcludePrograms),this.addDispose(this.onDidTerminalPreferenceChange(he=>{var me;switch(he.preferenceName){case"terminal.integrated.localEchoLatencyThreshold":{he.newValue&&he.newValue!==this._config.localEchoLatencyThreshold&&(this._config.localEchoLatencyThreshold=he.newValue);break}case"terminal.integrated.localEchoExcludePrograms":{he.newValue&&he.newValue!==this._config.localEchoExcludePrograms&&(this._config.localEchoExcludePrograms=he.newValue,this._excludeProgramRe=H(this._config.localEchoExcludePrograms));break}case"terminal.integrated.localEchoStyle":{he.newValue!==this._config.localEchoStyle&&(this._config.localEchoStyle=he.newValue,(me=this._typeAheadStyle)===null||me===void 0||me.onUpdate(this._config.localEchoStyle));break}default:break}}))}_register(X){if(X===this)throw new Error("Cannot register a disposable on itself!");return this.disposableCollection.push(X),X}activate(X){I("#DEBUG1# activate terminal type ahead addon");const oe=this._typeAheadStyle=this._register(new V(this._config.localEchoStyle,X)),ie=this._timeline=new j(X,this._typeAheadStyle),he=this.stats=new W(this._timeline);ie.setShowPredictions(this._config.localEchoLatencyThreshold===0),this._register(X.onData(q=>this._onUserData(q))),this._register(X.onTitleChange(q=>{this._terminalTitle=q,this._reevaluatePredictorState(he,ie)})),this._register(X.onResize(()=>{ie.setShowPredictions(!1),ie.clearCursor(),this._reevaluatePredictorState(he,ie)})),this._register(this._timeline.onPredictionSucceeded(q=>{var Ee;((Ee=this._lastRow)===null||Ee===void 0?void 0:Ee.charState)===1&&(0,t.isTenativeCharacterPrediction)(q)&&q.inner.appliedAt&&q.inner.appliedAt.pos.y+q.inner.appliedAt.pos.baseY===this._lastRow.y&&(this._lastRow.charState=2)})),this.onBeforeProcessData(q=>this._onBeforeProcessData(q));let me;this._register(he.onChange(()=>{me||(me=setTimeout(()=>{this._sendLatencyStats(he),me=void 0},E)),ie.length===0&&oe.debounceStopTracking(),this._reevaluatePredictorState(he,ie)}))}reset(){this._lastRow=void 0}_deferClearingPredictions(){var X,oe;if(!(!this.stats||!this._timeline)){if((X=this._clearPredictionDebounce)===null||X===void 0||X.dispose(),this._timeline.length===0||((oe=this._timeline.peekStart())===null||oe===void 0?void 0:oe.clearAfterTimeout)===!1){this._clearPredictionDebounce=void 0;return}this._clearPredictionDebounce=(0,r.disposableTimeout)(()=>{var ie,he;(ie=this._timeline)===null||ie===void 0||ie.undoAllPredictions(),((he=this._lastRow)===null||he===void 0?void 0:he.charState)===1&&(this._lastRow.charState=0)},Math.max(500,this.stats.maxLatency*3/2))}}_reevaluatePredictorState(X,oe){this._reevaluatePredictorStateNow(X,oe)}_reevaluatePredictorStateNow(X,oe){if(this._excludeProgramRe.test(this._terminalTitle))oe.setShowPredictions(!1);else if(this._config.localEchoLatencyThreshold<0)oe.setShowPredictions(!1);else if(this._config.localEchoLatencyThreshold===0)oe.setShowPredictions(!0);else if(X.sampleSize>f&&X.accuracy>c){const ie=X.latency.median;ie>=this._config.localEchoLatencyThreshold?oe.setShowPredictions(!0):ie<this._config.localEchoLatencyThreshold/y&&oe.setShowPredictions(!1)}}_sendLatencyStats(X){console.log("terminalLatencyStats",{...X.latency,predictionAccuracy:X.accuracy})}_onUserData(X){var oe,ie,he,me;if(((oe=this._timeline)===null||oe===void 0?void 0:oe.terminal.buffer.active.type)!=="normal")return;I("user data:",JSON.stringify({data:X}));const q=this._timeline.terminal,Ee=q.buffer.active;if(Ee.cursorX===1&&Ee.cursorY===q.rows-1&&((he=(ie=Ee.getLine(Ee.cursorY+Ee.baseY))===null||ie===void 0?void 0:ie.getCell(0))===null||he===void 0?void 0:he.getChars())===":")return;const ue=Ee.baseY+Ee.cursorY;ue!==((me=this._lastRow)===null||me===void 0?void 0:me.y)?this._lastRow={y:ue,startingX:Ee.cursorX,endingX:Ee.cursorX,charState:0}:(this._lastRow.startingX=Math.min(this._lastRow.startingX,Ee.cursorX),this._lastRow.endingX=Math.max(this._lastRow.endingX,this._timeline.physicalCursor(Ee).x));const te=Me=>this._timeline.tentativeCursor(Ee).x<=this._lastRow.startingX?this._timeline.addBoundary(Ee,Me):this._timeline.addPrediction(Ee,Me),fe=Me=>this._timeline.tentativeCursor(Ee).x>=this._lastRow.endingX-1?this._timeline.addBoundary(Ee,Me):this._timeline.addPrediction(Ee,Me),Ie=new R(X);for(;Ie.remaining>0;){if(Ie.eatCharCode(127)){const Be=this._timeline.peekEnd();Be&&Be instanceof k&&this._timeline.addBoundary(),this._timeline.isShowingPredictions&&S(this._timeline.terminal),this._timeline.tentativeCursor(Ee).x<=this._lastRow.startingX?this._timeline.addBoundary(Ee,new F(this._timeline.terminal)):(this._lastRow.endingX--,this._timeline.addPrediction(Ee,new F(this._timeline.terminal)));continue}if(Ie.eatCharCode(32,126)){const Be=X[Ie.index-1],Pe=new k(this._typeAheadStyle,Be);this._lastRow.charState===0?(this._timeline.addBoundary(Ee,Pe),this._lastRow.charState=1):this._timeline.addPrediction(Ee,Pe),this._timeline.tentativeCursor(Ee).x>=q.cols&&this._timeline.addBoundary(Ee,new B);continue}const Me=Ie.eatRe(h);if(Me){const Be=Me[3],Pe=new U(Be,!!Me[2],Number(Me[1])||1);Be==="D"?te(Pe):fe(Pe);continue}if(Ie.eatStr(`${p}f`)){fe(new U("C",!0,1));continue}if(Ie.eatStr(`${p}b`)){te(new U("D",!0,1));continue}if(Ie.eatChar("\r")&&Ee.cursorY<q.rows-1){this._timeline.addPrediction(Ee,new L);continue}this._timeline.addBoundary(Ee,new P);break}this._timeline.length===1&&(this._deferClearingPredictions(),this._typeAheadStyle.startTracking())}_onBeforeProcessData(X){this._timeline&&(I("incoming data:",JSON.stringify(X.data)),X.data=this._timeline.beforeServerInput(X.data),I("emitted data:",JSON.stringify(X.data)),this._deferClearingPredictions())}}t.TypeAheadAddon=K,n.__decorate([(0,r.debounce)(100),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[W,j]),n.__metadata("design:returntype",void 0)],K.prototype,"_reevaluatePredictorState",null)},4636:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Color=t.HSVA=t.HSLA=t.RGBA=void 0;function e(p,v){const m=Math.pow(10,v);return Math.round(p*m)/m}class n{constructor(v,m,_,s=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,v))|0,this.g=Math.min(255,Math.max(0,m))|0,this.b=Math.min(255,Math.max(0,_))|0,this.a=e(Math.max(Math.min(1,s),0),3)}static equals(v,m){return v.r===m.r&&v.g===m.g&&v.b===m.b&&v.a===m.a}}t.RGBA=n;class r{constructor(v,m,_,s){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,v),0)|0,this.s=e(Math.max(Math.min(1,m),0),3),this.l=e(Math.max(Math.min(1,_),0),3),this.a=e(Math.max(Math.min(1,s),0),3)}static equals(v,m){return v.h===m.h&&v.s===m.s&&v.l===m.l&&v.a===m.a}static fromRGBA(v){const m=v.r/255,_=v.g/255,s=v.b/255,g=v.a,l=Math.max(m,_,s),h=Math.min(m,_,s);let u=0,d=0;const E=(h+l)/2,f=l-h;if(f>0){switch(d=Math.min(E<=.5?f/(2*E):f/(2-2*E),1),l){case m:u=(_-s)/f+(_<s?6:0);break;case _:u=(s-m)/f+2;break;case s:u=(m-_)/f+4;break}u*=60,u=Math.round(u)}return new r(u,d,E,g)}static _hue2rgb(v,m,_){return _<0&&(_+=1),_>1&&(_-=1),_<.16666666666666666?v+(m-v)*6*_:_<.5?m:_<.6666666666666666?v+(m-v)*(.6666666666666666-_)*6:v}static toRGBA(v){const m=v.h/360,{s:_,l:s,a:g}=v;let l,h,u;if(_===0)l=h=u=s;else{const d=s<.5?s*(1+_):s+_-s*_,E=2*s-d;l=r._hue2rgb(E,d,m+.3333333333333333),h=r._hue2rgb(E,d,m),u=r._hue2rgb(E,d,m-.3333333333333333)}return new n(Math.round(l*255),Math.round(h*255),Math.round(u*255),g)}}t.HSLA=r;class o{constructor(v,m,_,s){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,v),0)|0,this.s=e(Math.max(Math.min(1,m),0),3),this.v=e(Math.max(Math.min(1,_),0),3),this.a=e(Math.max(Math.min(1,s),0),3)}static equals(v,m){return v.h===m.h&&v.s===m.s&&v.v===m.v&&v.a===m.a}static fromRGBA(v){const m=v.r/255,_=v.g/255,s=v.b/255,g=Math.max(m,_,s),l=Math.min(m,_,s),h=g-l,u=g===0?0:h/g;let d;return h===0?d=0:g===m?d=((_-s)/h%6+6)%6:g===_?d=(s-m)/h+2:d=(m-_)/h+4,new o(Math.round(d*60),u,g,v.a)}static toRGBA(v){const{h:m,s:_,v:s,a:g}=v,l=s*_,h=l*(1-Math.abs(m/60%2-1)),u=s-l;let[d,E,f]=[0,0,0];return m<60?(d=l,E=h):m<120?(d=h,E=l):m<180?(E=l,f=h):m<240?(E=h,f=l):m<300?(d=h,f=l):m<=360&&(d=l,f=h),d=Math.round((d+u)*255),E=Math.round((E+u)*255),f=Math.round((f+u)*255),new n(d,E,f,g)}}t.HSVA=o;class a{static fromHex(v){return a.Format.CSS.parseHex(v)||a.red}get hsla(){return this._hsla?this._hsla:r.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:o.fromRGBA(this.rgba)}constructor(v){if(v)if(v instanceof n)this.rgba=v;else if(v instanceof r)this._hsla=v,this.rgba=r.toRGBA(v);else if(v instanceof o)this._hsva=v,this.rgba=o.toRGBA(v);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(v){return!!v&&n.equals(this.rgba,v.rgba)&&r.equals(this.hsla,v.hsla)&&o.equals(this.hsva,v.hsva)}getRelativeLuminance(){const v=a._relativeLuminanceForComponent(this.rgba.r),m=a._relativeLuminanceForComponent(this.rgba.g),_=a._relativeLuminanceForComponent(this.rgba.b),s=.2126*v+.7152*m+.0722*_;return e(s,4)}static _relativeLuminanceForComponent(v){const m=v/255;return m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4)}getContrastRatio(v){const m=this.getRelativeLuminance(),_=v.getRelativeLuminance();return m>_?(m+.05)/(_+.05):(_+.05)/(m+.05)}isDarker(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3<128}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(v){const m=this.getRelativeLuminance(),_=v.getRelativeLuminance();return m>_}isDarkerThan(v){const m=this.getRelativeLuminance(),_=v.getRelativeLuminance();return m<_}lighten(v){return new a(new r(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*v,this.hsla.a))}darken(v){return new a(new r(this.hsla.h,this.hsla.s,this.hsla.l-this.hsla.l*v,this.hsla.a))}transparent(v){const{r:m,g:_,b:s,a:g}=this.rgba;return new a(new n(m,_,s,g*v))}isTransparent(){return this.rgba.a===0}isOpaque(){return this.rgba.a===1}opposite(){return new a(new n(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}blend(v){const m=v.rgba,_=this.rgba.a,s=m.a,g=_+s*(1-_);if(g<1e-6)return a.transparent;const l=this.rgba.r*_/g+m.r*s*(1-_)/g,h=this.rgba.g*_/g+m.g*s*(1-_)/g,u=this.rgba.b*_/g+m.b*s*(1-_)/g;return new a(new n(l,h,u,g))}makeOpaque(v){if(this.isOpaque()||v.rgba.a!==1)return this;const{r:m,g:_,b:s,a:g}=this.rgba;return new a(new n(v.rgba.r-g*(v.rgba.r-m),v.rgba.g-g*(v.rgba.g-_),v.rgba.b-g*(v.rgba.b-s),1))}flatten(...v){const m=v.reduceRight((_,s)=>a._flatten(s,_));return a._flatten(this,m)}static _flatten(v,m){const _=1-v.rgba.a;return new a(new n(_*m.rgba.r+v.rgba.a*v.rgba.r,_*m.rgba.g+v.rgba.a*v.rgba.g,_*m.rgba.b+v.rgba.a*v.rgba.b))}toString(){return this._toString||(this._toString=a.Format.CSS.format(this)),this._toString}static getLighterColor(v,m,_){if(v.isLighterThan(m))return v;_=_||.5;const s=v.getRelativeLuminance(),g=m.getRelativeLuminance();return _=_*(g-s)/g,v.lighten(_)}static getDarkerColor(v,m,_){if(v.isDarkerThan(m))return v;_=_||.5;const s=v.getRelativeLuminance(),g=m.getRelativeLuminance();return _=_*(s-g)/s,v.darken(_)}}t.Color=a,a.white=new a(new n(255,255,255,1)),a.black=new a(new n(0,0,0,1)),a.red=new a(new n(255,0,0,1)),a.blue=new a(new n(0,0,255,1)),a.green=new a(new n(0,255,0,1)),a.cyan=new a(new n(0,255,255,1)),a.lightgrey=new a(new n(211,211,211,1)),a.transparent=new a(new n(0,0,0,0)),function(p){let v;(function(m){let _;(function(s){function g(A){return A.rgba.a===1?`rgb(${A.rgba.r}, ${A.rgba.g}, ${A.rgba.b})`:p.Format.CSS.formatRGBA(A)}s.formatRGB=g;function l(A){return`rgba(${A.rgba.r}, ${A.rgba.g}, ${A.rgba.b}, ${+A.rgba.a.toFixed(2)})`}s.formatRGBA=l;function h(A){return A.hsla.a===1?`hsl(${A.hsla.h}, ${(A.hsla.s*100).toFixed(2)}%, ${(A.hsla.l*100).toFixed(2)}%)`:p.Format.CSS.formatHSLA(A)}s.formatHSL=h;function u(A){return`hsla(${A.hsla.h}, ${(A.hsla.s*100).toFixed(2)}%, ${(A.hsla.l*100).toFixed(2)}%, ${A.hsla.a.toFixed(2)})`}s.formatHSLA=u;function d(A){const S=A.toString(16);return S.length!==2?"0"+S:S}function E(A){return`#${d(A.rgba.r)}${d(A.rgba.g)}${d(A.rgba.b)}`}s.formatHex=E;function f(A,S=!1){return S&&A.rgba.a===1?p.Format.CSS.formatHex(A):`#${d(A.rgba.r)}${d(A.rgba.g)}${d(A.rgba.b)}${d(Math.round(A.rgba.a*255))}`}s.formatHexA=f;function c(A){return A.isOpaque()?p.Format.CSS.formatHex(A):p.Format.CSS.formatRGBA(A)}s.format=c;function y(A){const S=A.length;if(S===0||A.charCodeAt(0)!==35)return null;if(S===7){const D=16*b(A.charCodeAt(1))+b(A.charCodeAt(2)),I=16*b(A.charCodeAt(3))+b(A.charCodeAt(4)),w=16*b(A.charCodeAt(5))+b(A.charCodeAt(6));return new p(new n(D,I,w,1))}if(S===9){const D=16*b(A.charCodeAt(1))+b(A.charCodeAt(2)),I=16*b(A.charCodeAt(3))+b(A.charCodeAt(4)),w=16*b(A.charCodeAt(5))+b(A.charCodeAt(6)),T=16*b(A.charCodeAt(7))+b(A.charCodeAt(8));return new p(new n(D,I,w,T/255))}if(S===4){const D=b(A.charCodeAt(1)),I=b(A.charCodeAt(2)),w=b(A.charCodeAt(3));return new p(new n(16*D+D,16*I+I,16*w+w))}if(S===5){const D=b(A.charCodeAt(1)),I=b(A.charCodeAt(2)),w=b(A.charCodeAt(3)),T=b(A.charCodeAt(4));return new p(new n(16*D+D,16*I+I,16*w+w,(16*T+T)/255))}return null}s.parseHex=y;function b(A){switch(A){case 48:return 0;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case 97:return 10;case 65:return 10;case 98:return 11;case 66:return 11;case 99:return 12;case 67:return 12;case 100:return 13;case 68:return 13;case 101:return 14;case 69:return 14;case 102:return 15;case 70:return 15}return 0}})(_=m.CSS||(m.CSS={}))})(v=p.Format||(p.Format={}))}(a||(t.Color=a={}))},68611:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalGroupViewService=t.WidgetGroup=t.Widget=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(28423),p=e(26405);class v extends o.Disposable{constructor(g,l=!1,h=!1){super(),this.id=g,this.reuse=l,this.recovery=h,this.dynamic=(0,a.observableValue)(this,0),this.shadowDynamic=(0,a.observableValue)(this,0),this.name=(0,a.observableValue)(this,""),this.processName=(0,a.observableValue)(this,""),this._onRender=new o.Emitter,this._onResize=new o.Emitter,this._onShow=new o.Emitter,this._onError=new o.Emitter,this.onRender=this._onRender.event,this.onResize=this._onResize.event,this.onShow=this._onShow.event,this.onError=this._onError.event}get group(){return this._group}set group(g){this._group=g,g.addWidget(this)}get element(){return this._element}set element(g){this._element||(this._element=g,this._onRender.fire())}get show(){return this._show}set show(g){this._show=g,this._onShow.fire(g)}get error(){return this._error}set error(g){this._error=g,this._onError.fire(g)}resize(g){(0,a.transaction)(l=>{const h=g||this.shadowDynamic.get();this.dynamic.set(h,l),this.shadowDynamic.set(h,l)}),this._onResize.fire()}increase(g){(0,a.transaction)(l=>{const h=this.shadowDynamic.get();this.shadowDynamic.set(h+g,l)}),this._onResize.fire()}rename(g){(0,a.transaction)(l=>{this.name.set(g,l)})}}t.Widget=v;class m extends o.Disposable{constructor(g,l){super(),this.widgets=(0,a.observableValue)(this,[]),this.editable=(0,a.observableValue)(this,!1),this.activated=(0,a.observableValue)(this,!1),this.name=(0,a.observableValue)(this,""),this.currentId=(0,a.observableValue)(this,""),this.widgetsMap=new Map,this.current=(0,a.derived)(this,h=>{const u=this.currentId.read(h);return this.widgetsMap.get(u)}),this.snapshot=(0,a.derived)(this,h=>{const u=this.current.read(h);return this.name.read(h)||u?.name.read(h)||u?.processName.read(h)||""}),this._id=g||(0,p.userActionViewUuid)(),this._options=l||{},this._activated=!1}get id(){return this._id}get options(){return this._options}get length(){return this.widgets.get().length}get first(){return this.widgets.get()[0]}get last(){return this.widgets.get()[this.length-1]}addWidget(g){(0,a.transaction)(l=>{const h=this.widgets.get();this.widgets.set([...h,g],l)}),this.widgetsMap.set(g.id,g),this.currentId.get()||(0,a.transaction)(l=>{this.currentId.set(g.id,l)}),this._averageLayout()}findWidget(g){return this.widgets.get().findIndex(l=>l.id===g.id)}selectWidget(g){(0,a.transaction)(l=>{this.currentId.set(g.id,l)})}removeWidgetByIndex(g){const l=this.widgets.get(),h=l.splice(g,1);return this.widgetsMap.delete(h[0].id),(0,a.transaction)(u=>{this.widgets.set(l.filter(d=>d!==h[0]),u)}),this._averageLayout(),this.last&&this.selectWidget(this.last),h[0]}edit(){(0,a.transaction)(g=>{this.editable.set(!0,g)})}unedit(){(0,a.transaction)(g=>{this.editable.set(!1,g)})}rename(g){(0,a.transaction)(l=>{this.name.set(g,l),this.editable.set(!1,l)})}_isLast(g){return g.id===this.widgets.get()[this.widgets.get().length-1].id}_averageLayout(){const g=Math.round(m.whole/this.widgets.get().length*m.float)/m.float;this.widgets.get().forEach(l=>{this._isLast(l)?l.resize(m.whole-g*(this.widgets.get().length-1)):l.resize(g)})}}t.WidgetGroup=m,m.whole=100,m.float=1e3;let _=class{constructor(){this._widgets=new Map,this.groups=(0,a.observableValue)(this,[]),this.currentGroupIndex=(0,a.observableValue)(this,-1),this.currentGroupId=(0,a.observableValue)(this,""),this._onWidgetCreated=new o.Emitter,this._onWidgetSelected=new o.Emitter,this._onWidgetDisposed=new o.Emitter,this._onWidgetEmpty=new o.Emitter,this.currentGroup=(0,a.derived)(this,g=>{const l=this.groups.read(g),h=this.currentGroupIndex.read(g);return l[h]}),this.currentWidget=(0,a.derived)(this,g=>{const l=this.currentGroup.read(g);return l&&this.getWidget(l.currentId.read(g))}),this.currentWidgetId=(0,a.derived)(this,g=>{const l=this.currentGroup.read(g);return l&&l.currentId.read(g)}),this.onWidgetCreated=this._onWidgetCreated.event,this.onWidgetSelected=this._onWidgetSelected.event,this.onWidgetDisposed=this._onWidgetDisposed.event,this.onWidgetEmpty=this._onWidgetEmpty.event}getGroup(g){if(g>this.groups.get().length-1)throw new Error("out of groups length");return this.groups.get()[g]}swapGroup(g,l){const h=this.groups.get();if(g===-1||l===-1)return;const u=[...h],d=u[g];u[g]=u[l],u[l]=d,(0,a.transaction)(E=>{this.groups.set(u,E)})}_doSelectGroup(g){const l=this.getGroup(g);(0,a.transaction)(u=>{this.currentGroupIndex.set(g,u),this.currentGroupId.set(l.id,u),l.activated.set(!0,u)}),!l.current&&l.first&&l.selectWidget(l.first);const h=l.current.get();h&&(this._onWidgetSelected.fire(h),this.resize())}selectGroup(g){this._doSelectGroup(g)}_doCreateGroup(g,l){const h=new m(g,l);return(0,a.transaction)(u=>{const d=this.groups.get();this.groups.set([...d,h],u)}),this.groups.get().length-1}createGroup(g){const l=this._doCreateGroup(void 0,g);return this.getGroup(l),l}_checkIfEmpty(g){if(this.empty())this._onWidgetEmpty.fire();else{const l=this.currentGroupIndex.get();g===l&&this._doSelectGroup(this.groups.get().length-1),g<l&&this._doSelectGroup(l-1)}}_doRemoveGroup(g){const l=this.groups.get(),[h]=l.splice(g,1);h&&(h.widgets.get().forEach(u=>{this._widgets.delete(u.id),u.dispose(),this._onWidgetDisposed.fire(u)}),h.dispose(),(0,a.transaction)(u=>{this.groups.set(l.filter(d=>d.id!==h.id),u)})),this._checkIfEmpty(g)}removeGroup(g){this._doRemoveGroup(g)}getWidget(g){const l=this._widgets.get(g);if(!l)throw new Error("not find this widget");return l}selectWidget(g){const l=this.getWidget(g),h=l.group,u=this.groups.get().findIndex(d=>d.id===h.id);h.selectWidget(l),this.selectGroup(u)}createWidget(g,l,h,u=!1,d=!1){const E=new v(l||this.service.generateSessionId(),h,d);return this._widgets.set(E.id,E),E.group=g,u||this._onWidgetCreated.fire(E),E}_checkIfGroupEmpty(g){this.getGroup(g).length===0&&this._doRemoveGroup(g)}removeWidget(g){const l=this.getWidget(g),h=l.group,u=this.groups.get().findIndex(f=>h.id===f.id),d=h.findWidget(l);h.removeWidgetByIndex(d),this._widgets.delete(g),l.dispose(),this._onWidgetDisposed.fire(l),this._checkIfGroupEmpty(u);const E=h.current.get();E&&this._onWidgetSelected.fire(E)}resize(){const g=this.currentGroup.get();g&&g.widgets.get().forEach(l=>{l.resize()})}empty(){return this._widgets.size===0}clear(){(0,a.transaction)(g=>{this.groups.set([],g)}),this._widgets.clear(),this._onWidgetEmpty.fire()}};t.TerminalGroupViewService=_,n.__decorate([(0,r.Autowired)(p.ITerminalInternalService),n.__metadata("design:type",Object)],_.prototype,"service",void 0),t.TerminalGroupViewService=_=n.__decorate([(0,r.Injectable)()],_)},41685:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XTerm=void 0;const n=e(85608),r=e(95643),o=e(98239),a=e(87083),p=e(76003),v=e(41869),m=e(67889),_=e(43718),s=e(75124),g=e(9132),l=e(68179),h=e(42912),u=e(25655),d=n.__importDefault(e(73567)),E=e(43395);let f=class extends _.Disposable{constructor(y){super(),this.options=y,this.container=document.createElement("div"),this.container.className=d.default.terminalInstance,this.xtermOptions=y.xtermOptions,this.raw=new a.Terminal({allowProposedApi:!0,...this.xtermOptions}),this._prepareAddons(),this.raw.onSelectionChange(this.onSelectionChange.bind(this))}async enableCanvasRenderer(){try{this._canvasAddon||(this._canvasAddon=new(await e.e(359).then(e.t.bind(e,67359,23))).CanvasAddon),this.addDispose(this._canvasAddon),this.raw.loadAddon(this._canvasAddon),this._webglAddon&&(this._webglAddon.dispose(),this._webglAddon=void 0)}catch{}}async enableWebglRenderer(){try{this._webglAddon||(this._webglAddon=new(await e.e(151).then(e.t.bind(e,42151,23))).WebglAddon),this.addDispose(this._webglAddon),this.addDispose(this._webglAddon.onContextLoss(()=>{this.raw.options.rendererType="dom"})),this.raw.loadAddon(this._webglAddon),this._canvasAddon&&(this._canvasAddon.dispose(),this._canvasAddon=void 0)}catch{await this.enableCanvasRenderer()}}async _prepareAddons(){this._searchAddon=new o.SearchAddon,this._fitAddon=new r.FitAddon,this.addDispose([this._searchAddon,this._fitAddon]),this.raw.loadAddon(this._searchAddon),this.raw.loadAddon(this._fitAddon)}updateTheme(y){y&&(this.raw.options.theme=y,this.xtermOptions={...this.xtermOptions,theme:y})}updatePreferences(y){this.xtermOptions={...this.xtermOptions,...y}}getFindColors(){const y=this.themeService.getCurrentThemeSync(),b=y.getColor(E.TERMINAL_BACKGROUND_COLOR)||y.getColor(l.PANEL_BACKGROUND),A=y.getColor(E.TERMINAL_FIND_MATCH_BACKGROUND_COLOR),S=y.getColor(E.TERMINAL_FIND_MATCH_BORDER_COLOR),D=y.getColor(E.TERMINAL_OVERVIEW_RULER_CURSOR_FOREGROUND_COLOR),I=y.getColor(E.TERMINAL_FIND_MATCH_HIGHLIGHT_BACKGROUND_COLOR),w=y.getColor(E.TERMINAL_FIND_MATCH_HIGHLIGHT_BORDER_COLOR),T=y.getColor(E.TERMINAL_OVERVIEW_RULER_FIND_MATCH_FOREGROUND_COLOR);return{activeMatchBackground:A?.toString(),activeMatchBorder:S?.toString()||"transparent",activeMatchColorOverviewRuler:D?.toString()||"transparent",matchBackground:b?I?.blend(b).toString():void 0,matchBorder:w?.toString()||"transparent",matchOverviewRuler:T?.toString()||"transparent"}}findNext(y,b={}){const A={decorations:this.getFindColors(),...b};return this._searchAddon.findNext(y,A)}findPrevious(y,b={}){const A={decorations:this.getFindColors(),...b};return this._searchAddon.findPrevious(y,A)}get onSearchResultsChange(){return this._searchAddon.onDidChangeResults}closeSearch(){this._searchAddon.clearDecorations()}open(){this.raw.open(this.container);const y=this.preferenceService.get("terminal.integrated.xtermRenderType",u.RenderType.WebGL);y===u.RenderType.WebGL?this.enableWebglRenderer():y===u.RenderType.Canvas&&this.enableCanvasRenderer()}fit(){this._fitAddon.fit()}async onSelectionChange(){var y;!((y=this.xtermOptions)===null||y===void 0)&&y.copyOnSelection&&this.raw.hasSelection()&&await this.copySelection()}async copySelection(){this.raw.hasSelection()?await this.clipboardService.writeText(this.raw.getSelection()):this.messageService.warning("The terminal has no selection to copy")}dispose(){this.raw.dispose(),this.container.remove()}};t.XTerm=f,n.__decorate([(0,p.Autowired)(p.INJECTOR_TOKEN),n.__metadata("design:type",p.Injector)],f.prototype,"injector",void 0),n.__decorate([(0,p.Autowired)(s.MessageService),n.__metadata("design:type",s.MessageService)],f.prototype,"messageService",void 0),n.__decorate([(0,p.Autowired)(v.IClipboardService),n.__metadata("design:type",Object)],f.prototype,"clipboardService",void 0),n.__decorate([(0,p.Autowired)(h.IThemeService),n.__metadata("design:type",g.WorkbenchThemeService)],f.prototype,"themeService",void 0),n.__decorate([(0,p.Autowired)(m.PreferenceService),n.__metadata("design:type",Object)],f.prototype,"preferenceService",void 0),t.XTerm=f=n.__decorate([(0,p.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object])],f)},78453:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITerminalApiService=void 0,t.ITerminalApiService=Symbol("ITerminalApiService")},68830:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TERMINAL_ID_SEPARATOR=t.ITerminalClientFactory2=void 0,t.ITerminalClientFactory2=Symbol("ITerminalClientFactory2"),t.TERMINAL_ID_SEPARATOR="|"},7473:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITerminalHoverManagerService=t.ITerminalGroupViewService=t.ITerminalSearchService=t.ITerminalController=void 0,t.ITerminalController=Symbol("ITerminalController"),t.ITerminalSearchService=Symbol("ITerminalSearchService"),t.ITerminalGroupViewService=Symbol("ITerminalGroupViewService"),t.ITerminalHoverManagerService=Symbol("ITerminalHoverManagerService")},94620:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EnvironmentVariableMutatorType=t.EnvironmentVariableServiceToken=void 0,t.mutatorTypeLabel=e,t.serializeEnvironmentVariableCollection=r,t.deserializeEnvironmentVariableCollection=o,t.EnvironmentVariableServiceToken=Symbol("EnvironmentVariableServiceToken");function e(a,p,v){switch(a){case n.Prepend:return`${v}=${p}\${env:${v}}`;case n.Append:return`${v}=\${env:${v}}${p}`;default:return`${v}=${p}`}}var n;(function(a){a[a.Replace=1]="Replace",a[a.Append=2]="Append",a[a.Prepend=3]="Prepend"})(n||(t.EnvironmentVariableMutatorType=n={}));function r(a){return[...a.entries()]}function o(a){return new Map(a)}},12404:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MergedEnvironmentVariableCollection=void 0;const n=e(43718),r=e(94620);class o{constructor(m){this.map=new Map,m.forEach((_,s)=>{const g=_.map.entries();let l=g.next();for(;!l.done;){const h=l.value[0];let u=this.map.get(h);if(u||(u=[],this.map.set(h,u)),u.length>0&&u[0].type===r.EnvironmentVariableMutatorType.Replace){l=g.next();continue}const d=l.value[1];u.unshift({extensionIdentifier:s,value:d.value,type:d.type,options:d.options}),l=g.next()}})}async applyToProcessEnvironment(m,_,s){let g;_===n.OperatingSystem.Windows&&(g={},Object.keys(m).forEach(l=>g[l.toLowerCase()]=l)),this.map.forEach((l,h)=>{const u=_===n.OperatingSystem.Windows&&g[h.toLowerCase()]||h;l.forEach(async d=>{var E,f;if(!((f=(E=d.options)===null||E===void 0?void 0:E.applyAtProcessCreation)!==null&&f!==void 0)||f){const c=s?await s(d.value):d.value;switch(d.type){case r.EnvironmentVariableMutatorType.Append:m[u]=(m[u]||"")+c;break;case r.EnvironmentVariableMutatorType.Prepend:m[u]=c+(m[u]||"");break;case r.EnvironmentVariableMutatorType.Replace:m[u]=c;break}}})})}diff(m){const _=new Map,s=new Map,g=new Map;if(m.map.forEach((l,h)=>{const u=this.map.get(h),d=a(l,u);d&&_.set(h,d)}),this.map.forEach((l,h)=>{const u=m.map.get(h),d=a(l,u);d&&g.set(h,d)}),this.map.forEach((l,h)=>{const u=m.map.get(h),d=p(l,u);d&&s.set(h,d)}),!(_.size===0&&s.size===0&&g.size===0))return{added:_,changed:s,removed:g}}}t.MergedEnvironmentVariableCollection=o;function a(v,m){if(!m)return v;const _=new Set;m.forEach(g=>_.add(g.extensionIdentifier));const s=[];return v.forEach(g=>{_.has(g.extensionIdentifier)||s.push(g)}),s.length===0?void 0:s}function p(v,m){if(!m)return;const _=new Map;m.forEach(g=>_.set(g.extensionIdentifier,g));const s=[];return v.forEach(g=>{const l=_.get(g.extensionIdentifier);l&&(g.type!==l.type||g.value!==l.value)&&s.push(l)}),s.length===0?void 0:s}},19599:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITerminalErrorService=t.ETerminalErrorType=void 0,t.isTerminalError=n;var e;(function(r){r[r.CREATE_FAIL=0]="CREATE_FAIL"})(e||(t.ETerminalErrorType=e={}));function n(r){return r.message!==void 0}t.ITerminalErrorService=Symbol("ITerminalErrorService")},84876:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalLocation=t.TerminalDataBufferer=void 0;class e{constructor(o){this._callback=o,this._terminalBufferMap=new Map}dispose(){for(const o of this._terminalBufferMap.values())o.dispose()}startBuffering(o,a,p=5){let v;return v=a(m=>{const _=typeof m=="string"?m:m.data;let s=this._terminalBufferMap.get(o);if(s){s.data.push(_);return}const g=setTimeout(()=>this._flushBuffer(o),p);s={data:[_],timeoutId:g,dispose:()=>{clearTimeout(g),this._flushBuffer(o),v.dispose()}},this._terminalBufferMap.set(o,s)}),v}stopBuffering(o){const a=this._terminalBufferMap.get(o);a&&a.dispose()}_flushBuffer(o){const a=this._terminalBufferMap.get(o);a&&(this._terminalBufferMap.delete(o),this._callback(o,a.data.join("")))}}t.TerminalDataBufferer=e;var n;(function(r){r[r.Panel=1]="Panel",r[r.Editor=2]="Editor"})(n||(t.TerminalLocation=n={}))},26405:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(7473),t),n.__exportStar(e(59381),t),n.__exportStar(e(18171),t),n.__exportStar(e(19599),t),n.__exportStar(e(30354),t),n.__exportStar(e(38022),t),n.__exportStar(e(68830),t),n.__exportStar(e(78453),t),n.__exportStar(e(30076),t),n.__exportStar(e(16992),t),n.__exportStar(e(2853),t),n.__exportStar(e(84876),t),n.__exportStar(e(27155),t),n.__exportStar(e(15432),t),n.__exportStar(e(85504),t),n.__exportStar(e(38352),t)},15432:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinkComputer=t.StateMachine=t.Uint8Matrix=void 0,t.computeLinks=s;const n=e(43718);class r{constructor(l,h,u){const d=new Uint8Array(l*h);for(let E=0,f=l*h;E<f;E++)d[E]=u;this._data=d,this.rows=l,this.cols=h}get(l,h){return this._data[l*this.cols+h]}set(l,h,u){this._data[l*this.cols+h]=u}}t.Uint8Matrix=r;class o{constructor(l){let h=0,u=0;for(let E=0,f=l.length;E<f;E++){const[c,y,b]=l[E];y>h&&(h=y),c>u&&(u=c),b>u&&(u=b)}h++,u++;const d=new r(u,h,0);for(let E=0,f=l.length;E<f;E++){const[c,y,b]=l[E];d.set(c,y,b)}this._states=d,this._maxCharCode=h}nextState(l,h){return h<0||h>=this._maxCharCode?0:this._states.get(l,h)}}t.StateMachine=o;let a=null;function p(){return a===null&&(a=new o([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),a}let v=null;function m(){if(v===null){v=new n.CharacterClassifier(0);const g=` <>'"\u3001\u3002\uFF61\uFF64\uFF0C\uFF0E\uFF1A\uFF1B\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\uFF08\uFF3B\uFF5B\uFF62\uFF63\uFF5D\uFF3D\uFF09\u3015\u3011\u300F\u300D\u300B\u3009\u201D\u2019\uFF40\uFF5E\u2026`;for(let h=0;h<g.length;h++)v.set(g.charCodeAt(h),1);const l=".,;";for(let h=0;h<l.length;h++)v.set(l.charCodeAt(h),2)}return v}class _{static _createLink(l,h,u,d,E){let f=E-1;do{const c=h.charCodeAt(f);if(l.get(c)!==2)break;f--}while(f>d);if(d>0){const c=h.charCodeAt(d-1),y=h.charCodeAt(f);(c===40&&y===41||c===91&&y===93||c===123&&y===125)&&f--}return{range:{startLineNumber:u,startColumn:d+1,endLineNumber:u,endColumn:f+2},url:h.substring(d,f+1)}}static computeLinks(l,h=p()){const u=m(),d=[];for(let E=1,f=l.getLineCount();E<=f;E++){const c=l.getLineContent(E),y=c.length;let b=0,A=0,S=0,D=1,I=!1,w=!1,T=!1,R=!1;for(;b<y;){let P=!1;const O=c.charCodeAt(b);if(D===13){let M;switch(O){case 40:I=!0,M=0;break;case 41:M=I?0:1;break;case 91:T=!0,w=!0,M=0;break;case 93:T=!1,M=w?0:1;break;case 123:R=!0,M=0;break;case 125:M=R?0:1;break;case 39:M=S===34||S===96?0:1;break;case 34:M=S===39||S===96?0:1;break;case 96:M=S===39||S===34?0:1;break;case 42:M=S===42?1:0;break;case 124:M=S===124?1:0;break;case 32:M=T?0:1;break;default:M=u.get(O)}M===1&&(d.push(_._createLink(u,c,E,A,b)),P=!0)}else if(D===12){let M;O===91?(w=!0,M=0):M=u.get(O),M===1?P=!0:D=13}else D=h.nextState(D,O),D===0&&(P=!0);P&&(D=1,I=!1,w=!1,R=!1,A=b+1,S=O),b++}D===13&&d.push(_._createLink(u,c,E,A,y))}return d}}t.LinkComputer=_;function s(g){return!g||typeof g.getLineCount!="function"||typeof g.getLineContent!="function"?[]:_.computeLinks(g)}},27155:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalNetworkStatus=t.ITerminalNetwork=void 0,t.ITerminalNetwork=Symbol("ITerminalNetwork");var e;(function(n){n[n.DISCONNECTED=0]="DISCONNECTED",n[n.CONNECTED=1]="CONNECTED"})(e||(t.TerminalNetworkStatus=e={}))},3276:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.terminalPreferenceSchema=t.TerminalCursorStyle=t.SupportedOptionsName=t.ITerminalPreference=void 0;const n=e(43718),r=e(25655);t.ITerminalPreference=Symbol("ITerminalPreference"),t.SupportedOptionsName={type:"type",fontFamily:"fontFamily",fontSize:"fontSize",fontWeight:"fontWeight",lineHeight:"lineHeight",cursorBlink:"cursorBlink",scrollback:"scrollback",copyOnSelection:"copyOnSelection",cursorStyle:"cursorStyle"},t.TerminalCursorStyle={BLOCK:"block",LINE:"line",UNDERLINE:"underline"};const o=(0,n.localize)("terminal.integrated.shell.linux.deprecation","This is deprecated, the new recommended way to configure your default shell is by creating a terminal profile in {0} and setting its profile name as the default in {1}. This will currently take priority over the new profiles settings but that will change in the future.","`#terminal.integrated.profiles.linux#`"),a=(0,n.localize)("terminal.integrated.shell.osx.deprecation","This is deprecated, the new recommended way to configure your default shell is by creating a terminal profile in {0} and setting its profile name as the default in {1}. This will currently take priority over the new profiles settings but that will change in the future.","`#terminal.integrated.profiles.osx#`"),p=(0,n.localize)("terminal.integrated.shell.windows.deprecation","This is deprecated, the new recommended way to configure your default shell is by creating a terminal profile in {0} and setting its profile name as the default in {1}. This will currently take priority over the new profiles settings but that will change in the future.","`#terminal.integrated.profiles.windows#`");t.terminalPreferenceSchema={type:"object",properties:{"terminal.type":{type:"string",enum:["zsh","bash","sh","default"],default:"default",description:"%preference.terminal.typeDesc%"},"terminal.fontFamily":{type:"string"},"terminal.fontSize":{type:"number",default:12},"terminal.fontWeight":{type:"string",enum:["normal","bold"],default:400},"terminal.lineHeight":{type:"number",default:1},"terminal.cursorBlink":{type:"boolean",default:!1},"terminal.scrollback":{type:"number",default:1e3},"terminal.integrated.shellArgs.linux":{type:"array",default:[],description:"%preference.terminal.integrated.shellArgs.linuxDesc%",markdownDeprecationMessage:o},"terminal.integrated.shellArgs.osx":{type:"array",default:[],markdownDeprecationMessage:a},"terminal.integrated.shellArgs.windows":{type:"array",default:[],markdownDeprecationMessage:p},"terminal.integrated.profiles.windows":{restricted:!0,markdownDescription:(0,n.localize)("terminal.integrated.profiles.windows",'The Windows profiles to present when creating a new terminal via the terminal dropdown. Use the `path` property to automatically detect the shell\'s location. Or set the {1} property manually with an optional `args`.\n\nSet an existing profile to `null` to hide the profile from the list, for example: `"Ubuntu-20.04 (WSL)": null`.'),type:"object",default:{}},"terminal.integrated.profiles.osx":{restricted:!0,markdownDescription:(0,n.localize)("terminal.integrated.profile.osx",'The macOS profiles to present when creating a new terminal via the terminal dropdown. Set the `path` property manually with an optional `args`.\n\nSet an existing profile to `null` to hide the profile from the list, for example: `"bash": null`.'),type:"object",default:{bash:{path:"bash",args:["-l"]},zsh:{path:"zsh",args:["-l"]},fish:{path:"fish",args:["-l"]},tmux:{path:"tmux"},pwsh:{path:"pwsh"}}},"terminal.integrated.profiles.linux":{restricted:!0,markdownDescription:(0,n.localize)("terminal.integrated.profile.linux",'The Linux profiles to present when creating a new terminal via the terminal dropdown. Set the `path` property manually with an optional `args`.\n\nSet an existing profile to `null` to hide the profile from the list, for example: `"bash": null`.'),type:"object",default:{bash:{path:"bash",icon:"terminal-bash"},zsh:{path:"zsh"},fish:{path:"fish"},tmux:{path:"tmux",icon:"terminal-tmux"},pwsh:{path:"pwsh",icon:"terminal-powershell"}}},"terminal.integrated.defaultProfile.linux":{restricted:!0,markdownDescription:(0,n.localize)("terminal.integrated.defaultProfile.linux","The default profile used on Linux. This setting will currently be ignored if either {0} or {1} are set."),type:["string","null"],default:null},"terminal.integrated.defaultProfile.osx":{restricted:!0,markdownDescription:(0,n.localize)("terminal.integrated.defaultProfile.osx","The default profile used on macOS. This setting will currently be ignored if either {0} or {1} are set."),type:["string","null"],default:null},"terminal.integrated.defaultProfile.windows":{restricted:!0,markdownDescription:(0,n.localize)("terminal.integrated.defaultProfile.windows","The default profile used on Windows. This setting will currently be ignored if either {0} or {1} are set."),type:["string","null"],default:null},"terminal.integrated.copyOnSelection":{type:"boolean",description:"%preference.terminal.integrated.copyOnSelectionDesc%",default:!1},"terminal.integrated.localEchoEnabled":{type:"boolean",description:"%preference.terminal.integrated.localEchoDesc%",default:!0},"terminal.integrated.localEchoLatencyThreshold":{type:"number",description:"%preference.terminal.integrated.localEchoLatencyThresholdDesc%",default:30},"terminal.integrated.localEchoExcludePrograms":{type:"array",description:"%preference.terminal.integrated.localEchoExcludeProgramsDesc%",default:["vim","vi","nano","tmux"]},"terminal.integrated.localEchoStyle":{type:"string",description:"%preference.terminal.integrated.localEchoStyleDesc%",enum:["bold","dim","italic","underlined","inverted"],default:"dim"},"terminal.integrated.cursorStyle":{type:"string",description:"%preference.terminal.integrated.cursorStyleDesc%",enum:[t.TerminalCursorStyle.BLOCK,t.TerminalCursorStyle.LINE,t.TerminalCursorStyle.UNDERLINE],default:t.TerminalCursorStyle.BLOCK},"terminal.integrated.xtermRenderType":{type:"string",description:"%preference.terminal.integrated.xtermRenderTypeDesc%",enum:[r.RenderType.WebGL,r.RenderType.Canvas,r.RenderType.Dom],default:r.RenderType.WebGL},"terminal.integrated.enablePersistentSessions":{type:"boolean",description:"%preference.terminal.integrated.enablePersistentSessionDesc%",default:!0}}}},38352:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},85504:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITerminalProfileInternalService=t.ITerminalProfileService=void 0,t.terminalProfileArgsMatch=e,t.ITerminalProfileService=Symbol("ITerminalProfileService"),t.ITerminalProfileInternalService=Symbol("ITerminalProfileInternalService");function e(n,r){if(!n&&!r)return!0;if(typeof n=="string"&&typeof r=="string")return n===r;if(Array.isArray(n)&&Array.isArray(r)){if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++)if(n[o]!==r[o])return!1;return!0}return!1}},30354:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IPtyService=t.IExternalTerminalService=t.ITerminalServiceClient=t.ITerminalProcessService=t.ITerminalNodeService=t.PTY_SERVICE_PROXY_SERVER_PORT=t.PTY_SERVICE_PROXY_CALLBACK_PROTOCOL=t.PTY_SERVICE_PROXY_PROTOCOL=t.ITerminalProcessPath=t.ITerminalServicePath=void 0,t.asTerminalIcon=e,t.ITerminalServicePath="ITerminalServicePath",t.ITerminalProcessPath="ITerminalProcessPath",t.PTY_SERVICE_PROXY_PROTOCOL="PTY_SERVICE_PROXY_PROTOCOL",t.PTY_SERVICE_PROXY_CALLBACK_PROTOCOL="PTY_SERVICE_PROXY_CALLBACK_PROTOCOL",t.PTY_SERVICE_PROXY_SERVER_PORT=10111,t.ITerminalNodeService=Symbol("ITerminalNodeService"),t.ITerminalProcessService=Symbol("ITerminalProcessService"),t.ITerminalServiceClient=Symbol("ITerminalServiceClient"),t.IExternalTerminalService=Symbol("IExternalTerminalService");function e(n){if(!(!n||typeof n=="string"))return"id"in n?{id:n.id,color:n.color}:n}t.IPtyService=Symbol("IPtyService")},2853:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITerminalRenderProvider=t.ItemType=void 0;var e;(function(n){n[n.info=0]="info",n[n.add=1]="add"})(e||(t.ItemType=e={})),t.ITerminalRenderProvider=Symbol("TerminalRenderProvider")},59381:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},18171:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITerminalRestore=void 0,t.ITerminalRestore=Symbol("ITerminalRestore")},38022:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITerminalInternalService=t.ITerminalService=void 0,t.ITerminalService=Symbol("ITerminalService"),t.ITerminalInternalService=Symbol("ITerminalInternalService")},30076:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITerminalTheme=void 0,t.ITerminalTheme=Symbol("ITerminalTheme")},16992:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateSessionId=t.apiActionViewUuid=t.userActionViewUuid=void 0;const n=e(43718);let r=0;function o(){return r++}const a=()=>`UI_View_${(0,n.uuid)()}${o()}`;t.userActionViewUuid=a;const p=()=>`API_View_${(0,n.uuid)()}${o()}`;t.apiActionViewUuid=p;const v=()=>(0,n.uuid)();t.generateSessionId=v},25655:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RenderType=void 0;var e;(function(n){n.Canvas="canvas",n.WebGL="webgl",n.Dom="dom"})(e||(t.RenderType=e={}))},6487:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(26405),t)},92297:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestingExplorerTree=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(91416),a=e(41869),p=e(52416),v=e(72383),m=e(85941),_=e(95381),s=e(16558),g=e(97581),l=n.__importDefault(e(30272)),h=()=>{const u=(0,a.useInjectable)(s.TestTreeViewModelToken),d=(0,a.useInjectable)(v.TestServiceToken),E=(0,a.useInjectable)(a.CommandService),f=(0,a.useInjectable)(p.IIconService),[c,y]=(0,r.useState)([]),b=r.default.useCallback(w=>(0,g.getIconWithColor)(w.state),[]),A=r.default.useCallback(w=>({label:w.label,renderLabel:(0,a.transformLabelWithCodicon)(w.label,{verticalAlign:"middle",marginRight:"4px",marginLeft:"4px"},f.fromString.bind(f)),icon:"",get iconClassName(){return b(w)},expandable:w.test.expand!==0,rawItem:w,sortText:w.sortText,get children(){if(w.test.expand===1||w.children){const T=u.getTestTreeItem(w.test.item.extId);return Array.from((0,a.map)(T?.children||[],A))}return null}}),[]);(0,r.useEffect)(()=>a.Event.debounce(u.onUpdate,()=>{},500)(()=>{for(const T of u.roots)if(T.depth===0&&T.children.size>0){let R=[];for(const P of T.children)R.push(A(P));R=R.sort((P,O)=>(P.sortText||P.label).localeCompare(O.sortText||O.label)),y(R)}}).dispose,[u]),(0,r.useEffect)(()=>{var w;if(u.treeHandlerApi){const T=u.treeHandlerApi.getModel();((w=T.root.children)===null||w===void 0?void 0:w.length)===0&&T.root.refresh()}},[c]);const S=r.default.useCallback(w=>w?w.children&&w.children.length>0?w.children:[]:null,[]),D=r.default.useCallback((w,T)=>{const{rawItem:R}=w.raw;switch(T.command){case m.RuntTestCommand.id:d.runTests({tests:R.tests,group:2});break;case m.DebugTestCommand.id:d.runTests({tests:R.tests,group:4});break;case m.GoToTestCommand.id:E.executeCommand(m.GoToTestCommand.id,R.test.item.extId);break}},[]),I=w=>{u.setTreeHandlerApi(w)};return r.default.createElement("div",{className:"monaco-workbench monaco-component"},c.length>0&&r.default.createElement(o.BasicRecycleTree,{treeData:c,onReady:I,itemClassname:l.default.item_label,height:900,resolveChildren:S,inlineMenus:_.TestingExplorerInlineMenus,inlineMenuActuator:D}))};t.TestingExplorerTree=h},76028:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestingView=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(41869),a=e(25918),p=e(1149),v=e(93899),m=e(91527),_=e(92297),s=n.__importDefault(e(30272)),g=()=>{const l=(0,o.useInjectable)(v.AbstractContextMenuService),h=(0,o.useInjectable)(o.ViewContextKeyRegistry),u=(0,o.useInjectable)(p.LayoutViewSizeConfig),[d,E]=(0,r.useState)();return(0,r.useEffect)(()=>{const f=l.createMenu({id:v.MenuId.ViewTitle,contextKeyService:h.getContextKeyService("workbench.view.testing")});E(f)},[]),r.default.createElement("div",{className:s.default.testing_container},r.default.createElement(m.TitleBar,{title:(0,o.localize)("test.title"),height:u.panelTitleBarHeight,menubar:d?r.default.createElement(a.InlineMenuBar,{menus:d}):null}),r.default.createElement(_.TestingExplorerTree,null))};t.TestingView=g},97581:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getIconWithColor=t.testingRefreshTests=t.testingRunAllIcon=t.testingRunIcon=t.testingStatesToIcons=t.testStatesToIconColors=t.defaultIconColor=void 0;const n=e(41869);t.defaultIconColor="testing_icon_iconPassed",t.testStatesToIconColors={6:"testing_icon_iconFailed",4:"testing_icon_iconErrored",3:t.defaultIconColor,1:"testing_icon_iconQueued",0:"testing_icon_iconUnset",5:"testing_icon_iconUnset"},t.testingStatesToIcons=new Map([[6,(0,n.getExternalIcon)("issues")],[4,(0,n.getExternalIcon)("error")],[3,(0,n.getExternalIcon)("pass")],[1,(0,n.getExternalIcon)("history")],[2,(0,n.getExternalIcon)("loading")+" kt-icon-loading"],[5,(0,n.getExternalIcon)("debug-step-over")],[0,(0,n.getExternalIcon)("circle-outline")]]),t.testingRunIcon=(0,n.getExternalIcon)("run"),t.testingRunAllIcon=(0,n.getExternalIcon)("run-all"),t.testingRefreshTests=(0,n.getExternalIcon)("refresh");const r=o=>`${t.testingStatesToIcons.get(o)} ${t.testStatesToIconColors[o]}`||"";t.getIconWithColor=r},26874:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestingModule=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(72383),p=e(20215),v=e(48385),m=e(57879),_=e(16558),s=e(43122),g=e(89872),l=e(80162),h=e(66724),u=e(4836),d=e(86457),E=e(76388);e(8758),e(11009),e(61164);let f=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[E.TestingContribution,{token:a.TestServiceToken,useClass:d.TestServiceImpl},{token:_.TestTreeViewModelToken,useClass:h.TestTreeViewModelImpl},{token:p.TestProfileServiceToken,useClass:l.TestProfileServiceImpl},{token:v.TestResultServiceToken,useClass:u.TestResultServiceImpl},{token:m.TestingPeekOpenerServiceToken,useClass:g.TestingPeekOpenerServiceImpl},{token:a.TestPeekMessageToken,useClass:s.TestingPeekMessageServiceImpl}]}};t.TestingModule=f,t.TestingModule=f=n.__decorate([(0,r.Injectable)()],f)},23993:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestMessageContainer=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=n.__importDefault(e(43144)),a=e(41869),p=e(43718),v=e(57517),m=e(93374),_=e(72383),s=n.__importDefault(e(30272));var g;(function(y){y[y.DIFF=0]="DIFF",y[y.PLANTTEXT=1]="PLANTTEXT",y[y.MARKDOWN=2]="MARKDOWN"})(g||(g={}));const h={...{scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!1},fixedOverflowWidgets:!0,readOnly:!0,minimap:{enabled:!1}},enableSplitViewResizing:!0,renderOverviewRuler:!1,ignoreTrimWhitespace:!1,renderSideBySide:!0},u=y=>y?y.messages[y.messageIndex]:{message:"",actual:"",expected:""},d=({root:y,children:b})=>o.default.createPortal(b,y),E=y=>{const b=(0,a.useInjectable)(a.IOpenerService),A=(0,r.useRef)(null),[S,D]=(0,r.useState)(""),[I,w]=(0,r.useState)(null),T=R=>{R&&R.scheme===p.Schemes.command&&b.open(R)};return r.default.useEffect(()=>{if(A.current){const{dto:R}=y;let P=A.current.shadowRoot;P||(P=A.current.attachShadow({mode:"open"})),I||w(P);const O=u(R).message,M=O?O.value.replace(/\t/g,""):"";D(M)}},[y.dto]),r.default.createElement("div",{ref:A,className:s.default.preview_markdown},I&&r.default.createElement(d,{root:I},r.default.createElement(m.Markdown,{content:S,onLinkClick:T})))},f=r.default.memo(y=>{const{dto:b}=y,A=(0,a.useInjectable)(v.IEditorDocumentModelService),S=(0,a.useInjectable)(v.EditorCollectionService),D=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!b)return;let I;const{expectedUri:w,actualUri:T}=b;return Promise.all([A.createModelReference(w),A.createModelReference(T)]).then(R=>{const[P,O]=R,{actual:M,expected:k}=u(b);I=S.createDiffEditor(D.current,{...(0,v.getSimpleEditorOptions)(),...h});const F=P.instance.getMonacoModel(),L=O.instance.getMonacoModel();F.setValue(k),L.setValue(M),I.compare(P,O),I.originalEditor.monacoEditor.setModel(F),I.modifiedEditor.monacoEditor.setModel(L)}),()=>{I&&I.dispose()}},[]),r.default.createElement("div",{ref:D,style:{height:"inherit"}})}),c=()=>{const y=(0,a.useInjectable)(_.TestPeekMessageToken),[b,A]=(0,r.useState)(),[S,D]=(0,r.useState)();(0,r.useEffect)(()=>{const w=new p.Disposable;return w.addDispose(y.onDidReveal(async T=>{D(T);const R=u(T);T.isDiffable?A(g.DIFF):T.isDiffable||typeof R.message=="string"?A(g.PLANTTEXT):A(g.MARKDOWN)})),()=>{w.dispose()}},[]);const I=r.default.useCallback(()=>{if(!S)return null;if(b===g.DIFF)return r.default.createElement(f,{dto:S});if(b===g.MARKDOWN)return r.default.createElement(E,{dto:S});{const w=u(S).message;return r.default.createElement("div",{className:s.default.preview_text},typeof w=="string"?w:w.value)}},[S]);return r.default.createElement("div",{className:s.default.test_output_peek_message_container,style:{height:"100%"}},I())};t.TestMessageContainer=c},1031:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestOutputPeekContribution=t.TestDto=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(43718),p=e(44781),v=e(48385),m=e(57879),_=e(92597),s=e(65482),g=e(4836),l=e(33429),h=e(89872),u=e(33218);class d{get isDiffable(){const c=this.messages[this.messageIndex];return c.type===0&&(0,_.isDiffable)(c)}constructor(c,y,b,A){var S;this.resultId=c,this.taskIndex=b,this.messageIndex=A,this.test=y.item,this.messages=y.tasks[b].messages,this.messageIndex=A;const D={messageIndex:A,resultId:c,taskIndex:b,testExtId:y.item.extId};this.expectedUri=(0,l.buildTestUri)({...D,type:2}),this.actualUri=(0,l.buildTestUri)({...D,type:1}),this.messageUri=(0,l.buildTestUri)({...D,type:0});const I=this.messages[this.messageIndex];this.revealLocation=(S=I.location)!==null&&S!==void 0?S:y.item.uri&&y.item.range?{uri:y.item.uri,range:p.Range.lift(y.item.range)}:void 0}}t.TestDto=d;let E=class{constructor(c){this.editor=c,this.disposer=new a.Disposable,this.peekView=new a.MutableDisposable,this.testContextKey=this.injector.get(s.TestContextKey,[this.editor.monacoEditor._contextKeyService])}allMessages(c){const y=[];for(const b of c)for(const A of b.tests)for(let S=0;S<A.tasks.length;S++)for(let D=0;D<A.tasks[S].messages.length;D++)y.push({result:b,test:A,taskIndex:S,messageIndex:D});return y}contribute(){return this.disposer.addDispose(this.editor.monacoEditor.onDidChangeModel(c=>{var y;((y=c.newModelUrl)===null||y===void 0?void 0:y.scheme)===o.Schemes.file&&this.testingPeekOpenerService.setPeekContrib(c.newModelUrl,this)})),this.disposer.addDispose(a.Disposable.create(()=>{this.editor.currentUri&&this.testingPeekOpenerService.delPeekContrib(this.editor.currentUri)})),this.disposer}toggle(c){var y;((y=this.currentPeekUri)===null||y===void 0?void 0:y.toString())===c.toString()?this.peekView.clear():this.show(c)}openCurrentInEditor(){var c;const y=(c=this.peekView.value)===null||c===void 0?void 0:c.current;y&&(y.isDiffable?this.commandService.executeCommand(o.EDITOR_COMMANDS.API_OPEN_DIFF_EDITOR_COMMAND_ID,y.expectedUri,y.actualUri,"Expected <-> Actual"):this.commandService.executeCommand(o.EDITOR_COMMANDS.OPEN_RESOURCE.id,y.messageUri,{preview:!1,focus:!0}))}removePeek(){var c;(c=this.peekView.value)===null||c===void 0||c.hide(),this.peekView.clear()}async show(c){const y=this.testResultService.retrieveTest(c);y&&(this.peekView.value||(this.peekView.value=this.injector.get(u.TestingOutputPeek,[this.editor.monacoEditor,this.contextKeyService]),this.disposer.addDispose(this.peekView.value.onDidClose(()=>{this.testContextKey.contextTestingIsPeekVisible.set(!1),this.currentPeekUri=void 0,this.peekView.value=void 0})),this.testContextKey.contextTestingIsPeekVisible.set(!0),this.peekView.value.create()),this.peekView.value.setModel(y),this.currentPeekUri=c)}async openAndShow(c){var y;const b=this.testResultService.retrieveTest(c);if(!b)return;if(!b.revealLocation||b.revealLocation.uri.toString()===((y=this.editor.currentUri)===null||y===void 0?void 0:y.toString()))return this.show(c);const A=this.testingPeekOpenerService.peekControllerMap.get(c.toString());A&&(this.removePeek(),await this.commandService.executeCommand(o.EDITOR_COMMANDS.OPEN_RESOURCE.id,a.URI.parse(c.toString()),{preview:!0,focus:!0}),A.show(c))}next(){var c;const y=(c=this.peekView.value)===null||c===void 0?void 0:c.current;if(!y)return;let b=!1;const A=this.allMessages(this.testResultService.results);for(const{messageIndex:S,taskIndex:D,result:I,test:w}of A)if(b){this.openAndShow((0,l.buildTestUri)({type:0,messageIndex:S,taskIndex:D,resultId:I.id,testExtId:w.item.extId}));return}else y.test.extId===w.item.extId&&y.messageIndex===S&&y.taskIndex===D&&y.resultId===I.id&&(b=!0)}previous(){var c;const y=(c=this.peekView.value)===null||c===void 0?void 0:c.current;if(!y)return;let b;const A=this.allMessages(this.testResultService.results);for(const S of A){if(y.test.extId===S.test.item.extId&&y.messageIndex===S.messageIndex&&y.taskIndex===S.taskIndex&&y.resultId===S.result.id){if(!b)return;this.openAndShow((0,l.buildTestUri)({type:0,messageIndex:b.messageIndex,taskIndex:b.taskIndex,resultId:b.result.id,testExtId:b.test.item.extId}));return}b=S}}};t.TestOutputPeekContribution=E,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],E.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(v.TestResultServiceToken),n.__metadata("design:type",g.TestResultServiceImpl)],E.prototype,"testResultService",void 0),n.__decorate([(0,r.Autowired)(m.TestingPeekOpenerServiceToken),n.__metadata("design:type",h.TestingPeekOpenerServiceImpl)],E.prototype,"testingPeekOpenerService",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],E.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(a.CommandService),n.__metadata("design:type",Object)],E.prototype,"commandService",void 0),t.TestOutputPeekContribution=E=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[Object])],E)},43122:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestingPeekMessageServiceImpl=void 0;const n=e(85608),r=e(76003),o=e(43718);let a=class extends o.Disposable{constructor(){super(...arguments),this._didReveal=new o.Emitter,this._visibilityChange=new o.Emitter,this.onDidReveal=this._didReveal.event,this.onVisibilityChange=this._visibilityChange.event}};t.TestingPeekMessageServiceImpl=a,t.TestingPeekMessageServiceImpl=a=n.__decorate([(0,r.Injectable)()],a)},89872:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestingPeekOpenerServiceImpl=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(54414),p=e(48385),v=e(33429),m=e(4836),_=(g,l)=>{for(let h=0;h<g.tasks.length;h++){const u=g.tasks[h];for(let d=0;d<u.messages.length;d++){const E=l(u,u.messages[d],d,h);if(E!==void 0)return E}}};let s=class extends o.Disposable{constructor(){super(...arguments),this.peekControllerMap=new Map}get currentUri(){var l;return(l=this.editorService.currentEditor)===null||l===void 0?void 0:l.currentUri}async showPeekFromUri(l,h){const u=this.editorService.currentEditor;this.lastUri=l;const d=(0,v.buildTestUri)(this.lastUri),E=this.peekControllerMap.get(u?.currentUri.toString());return E?.show(d),!0}getAnyCandidateMessage(){const l=new Set;for(const h of this.testResultService.results)for(const u of h.tests){if(l.has(u.item.extId))continue;l.add(u.item.extId);const d=_(u,(E,f,c,y)=>f.location&&{type:0,testExtId:u.item.extId,resultId:h.id,taskIndex:y,messageIndex:c,documentUri:f.location.uri});if(d)return d}}setPeekContrib(l,h){const u=l.toString();return this.peekControllerMap.has(u)||this.peekControllerMap.set(u,h),this}delPeekContrib(l){const h=l.toString();return this.peekControllerMap.delete(h),this}tryPeekFirstError(l,h,u){throw new Error("Method not implemented.")}async open(){let l;return l||(l=this.getAnyCandidateMessage()),l?this.showPeekFromUri(l):!1}closeAllPeeks(){for(const l of this.peekControllerMap.values())l.removePeek()}};t.TestingPeekOpenerServiceImpl=s,n.__decorate([(0,r.Autowired)(a.WorkbenchEditorService),n.__metadata("design:type",a.WorkbenchEditorService)],s.prototype,"editorService",void 0),n.__decorate([(0,r.Autowired)(p.TestResultServiceToken),n.__metadata("design:type",m.TestResultServiceImpl)],s.prototype,"testResultService",void 0),t.TestingPeekOpenerServiceImpl=s=n.__decorate([(0,r.Injectable)()],s)},33218:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestingOutputPeek=t.TestResultPanel=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=n.__importDefault(e(43144)),a=n.__importDefault(e(25873)),p=e(76003),v=e(41869),m=e(81878),_=e(25918),s=e(93899),g=e(48327),l=e(55666),h=e(72383),u=e(92597),d=e(23993),E=e(43122),f=e(3700);e(11009);const c=({viewState:b})=>r.default.createElement(m.SplitPanel,{overflow:"hidden",id:"testing-message-horizontal",flex:1,style:{height:"100%"}},r.default.createElement(d.TestMessageContainer,null),r.default.createElement(f.TestTreeContainer,{viewState:b}));t.TestResultPanel=c;let y=class extends g.PeekViewWidget{constructor(A,S){super(A,{isResizeable:!0}),this.editor=A,this.contextKeyService=S}_fillBody(A){this.setCssClass("testing-output-peek-container"),a.default.createRoot(A).render(r.default.createElement(v.ConfigProvider,{value:this.configContext},r.default.createElement(m.SplitPanel,{overflow:"hidden",id:"testing-message-horizontal",flex:1},r.default.createElement(d.TestMessageContainer,null),r.default.createElement(f.TestTreeContainer,null))))}async _fillActionBarOptions(A){const S=this.menuService.createMenu(s.MenuId.TestPeekTitleContext,this.contextKeyService);return new Promise(D=>{var I;a.default.createRoot(A).render(r.default.createElement(v.ConfigProvider,{value:this.configContext},r.default.createElement(_.InlineActionBar,{menus:S,type:"icon",context:[(I=this.editor.getModel())===null||I===void 0?void 0:I.uri.toString()]}))),D()})}applyClass(){}applyStyle(){}async showInPlace(A){const S=A.messages[A.messageIndex];this.setTitle((0,u.firstLine)(typeof S.message=="string"?S.message:(0,l.renderMarkdown)(S.message).element.outerText),A.test.label),setTimeout(()=>{this.testingPeekMessageService._didReveal.fire(A),this.testingPeekMessageService._visibilityChange.fire(!0)})}hide(){super.dispose(),this._bodyElement&&o.default.unmountComponentAtNode(this._bodyElement)}setModel(A){const S=A.messages[A.messageIndex],D=this.current;return S.type!==0||!A.revealLocation&&!D?Promise.resolve():(this.current=A,A.revealLocation?(this.show(A.revealLocation.range,(0,u.hintMessagePeekHeight)(S)),this.editor.focus(),this.showInPlace(A)):this.showInPlace(A))}};t.TestingOutputPeek=y,n.__decorate([(0,p.Autowired)(h.TestPeekMessageToken),n.__metadata("design:type",E.TestingPeekMessageServiceImpl)],y.prototype,"testingPeekMessageService",void 0),n.__decorate([(0,p.Autowired)(s.AbstractMenuService),n.__metadata("design:type",s.AbstractMenuService)],y.prototype,"menuService",void 0),n.__decorate([(0,p.Autowired)(v.AppConfig),n.__metadata("design:type",Object)],y.prototype,"configContext",void 0),t.TestingOutputPeek=y=n.__decorate([(0,p.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object])],y)},3700:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestTreeContainer=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),a=e(97267),p=e(41869),v=e(43718),m=e(42912),_=e(41682),s=e(72383),g=e(48385),l=e(92597),h=e(33429),u=n.__importDefault(e(30272)),d=e(97581),E=e(1031);var f;(function(y){y.RESULT="result",y.TEST="test",y.TASK="task",y.MESSAGE="message"})(f||(f={}));const c=({viewState:y})=>{const b=(0,p.useInjectable)(g.TestResultServiceToken),A=(0,p.useInjectable)(s.TestPeekMessageToken),S=(0,p.useInjectable)(m.IIconService),[D,I]=(0,o.useState)([]);(0,o.useEffect)(()=>{const k=new v.Disposable;k.addDispose(A.onDidReveal(B=>{}));const F=b.results.map(B=>M(B));I(F);const L=b.onResultsChanged(B=>{const U=b.results.map(W=>M(W));I(U)});return k.addDispose(L),b.onTestChanged(B=>{const U=b.results.map(W=>M(W));I(U)}),k.dispose.bind(k)},[]);const w=o.default.useCallback(k=>k?k.children&&k.children.length>0?k.children:[]:null,[]),T=o.default.useCallback(k=>{const F=k.completedAt===void 0?2:(0,g.maxCountPriority)(k.counts);return(0,d.getIconWithColor)(F)},[]),R=o.default.useCallback((k,F,L)=>_.Iterable.map(F.tasks[0].messages,(B,U)=>{const{message:W,location:j}=F.tasks[L].messages[U],Q=(0,h.buildTestUri)({type:0,messageIndex:U,resultId:k.id,taskIndex:L,testExtId:F.item.extId}),G=new E.TestDto(k.id,F,L,U),Z=()=>{if(typeof W=="string")return(0,l.firstLine)(W);const $={type:f.MESSAGE,context:Q,label:(0,l.firstLine)(W.value),id:Q.toString(),icon:"",notExpandable:!1,location:j,rawItem:{...B,dto:G}};return(0,l.parseMarkdownText)(W.value).then(V=>{$.label=(0,l.firstLine)(V)}).catch(()=>{}),$.label};return{type:f.MESSAGE,context:Q,label:Z(),id:Q.toString(),icon:"",notExpandable:!1,location:j,rawItem:{...B,dto:G}}}),[]),P=o.default.useCallback((k,F)=>{const L=_.Iterable.filter(F.tasks,B=>B.messages.length>0);return _.Iterable.map(L,(B,U)=>{var W;const j=k.tasks[U];return{type:f.TASK,context:String(U),label:(W=j.name)!==null&&W!==void 0?W:(0,v.localize)("test.task.unnamed"),id:`${k.id}/${F.item.extId}/${U}`,icon:"",task:j,notExpandable:!1,rawItem:B,get children(){return Array.from(R(k,F,U))}}})},[]),O=o.default.useCallback(k=>{const F=_.Iterable.filter(k.tests,L=>L.tasks.some(B=>B.messages.length>0||B.state>=2));return _.Iterable.map(F,L=>{let B="";for(const Z of(0,g.resultItemParents)(k,L))Z!==L&&(B=B?Z.item.label+" \u203A "+B:Z.item.label);B=(0,p.transformLabelWithCodicon)(B,{},S.fromString.bind(S));const U=(0,p.transformLabelWithCodicon)(L.item.label,{verticalAlign:"middle",marginRight:"4px"},S.fromString.bind(S)),Q=L.tasks.filter(Z=>Z.messages.length>0).length>1?Array.from(P(k,L)):Array.from(R(k,L,0)),G=Q.length>0;return{type:f.TEST,context:L.item.extId,id:`${k.id}/${L.item.extId}`,renderLabel:U,label:L.item.label,icon:"",get iconClassName(){return(0,d.getIconWithColor)(L.computedState)},notExpandable:!1,expandable:G,description:"",rawItem:L,get children(){return Q}}})},[]),M=o.default.useCallback(k=>{const F={messages:[{location:void 0,message:{value:k.getOutput(),uris:{},isTrusted:!0,supportThemeIcons:!0},type:0}],messageIndex:0};return{type:f.RESULT,context:k.id,id:k.id,label:k.name,icon:"",get iconClassName(){return T(k)},expandable:!0,rawItem:{...k,dto:F},get children(){return Array.from(O(k))}}},[]);return o.default.createElement("div",{className:(0,r.default)(u.default.test_output_peek_tree,"monaco-editor")},o.default.createElement(a.BasicRecycleTree,{treeData:D,height:y?.height||500,resolveChildren:w,onClick:(k,F)=>{if(!F)return;const B=F.raw.rawItem;B.dto&&A._didReveal.fire(B.dto)}}))};t.TestTreeContainer=c},65482:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestContextKey=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(12288);let p=class{constructor(m){this._contextKeyService=this.globalContextKeyService.createScoped(m),this.contextTestingIsPeekVisible=a.TestingIsPeekVisible.bind(this.contextKeyScoped)}get contextKeyScoped(){return this._contextKeyService}};t.TestContextKey=p,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],p.prototype,"globalContextKeyService",void 0),t.TestContextKey=p=n.__decorate([(0,r.Injectable)(),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[Object])],p)},17482:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestDecorationsContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(93899),p=e(43718),v=n.__importStar(e(20868)),m=e(90684),_=e(19582),s=e(31324),g=e(72383),l=e(57879),h=e(33429),u=e(61090),d=e(48385),E=e(92597),f=e(97581),c=e(89872),y=e(4836),b=e(86457),{removeAnsiEscapeCodes:A}=p.strings,S="--testMessageDecorationFontFamily",D=(k,F)=>{var L;return((L=F.location)===null||L===void 0?void 0:L.uri.toString())===k.toString()},I=k=>({startLineNumber:k.startLineNumber,endLineNumber:k.startLineNumber,startColumn:0,endColumn:1}),w=(k,F)=>{var L,B;const U=(L=k[0])===null||L===void 0?void 0:L.item.range;if(!U)throw new Error("Test decorations can only be created for tests with a range");let W=0;const j=[];let Q,G=!1;for(let K=0;K<k.length;K++){const Y=k[K],X=F[K],oe=(B=X?.computedState)!==null&&B!==void 0?B:0;j.push((0,u.labelForTestInState)(Y.item.label,oe)),W=(0,E.maxPriority)(W,oe),G=G||!!X?.retired,!Q&&X?.tasks.some(ie=>ie.messages.length)&&(Q=Y.item.extId)}const Z=k.length>1||k[0].children.size>0,$=W===0?Z?f.testingRunAllIcon:f.testingRunIcon:f.testingStatesToIcons.get(W),V=W===0?f.defaultIconColor:f.testStatesToIconColors[W];let H=`${$} ${V} testing-run-glyph`;return G&&(H+=" retired"),{range:I(U),options:{description:"run-test-decoration",isWholeLine:!0,glyphMarginClassName:H,stickiness:v.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}};class T extends p.Disposable{get line(){return this.editorDecoration.range.startLineNumber}constructor(F,L){super(),this.editorDecoration=F,this.editor=L,this.id=""}click(F){var L;return((L=F.target.position)===null||L===void 0?void 0:L.lineNumber)!==this.line||F.target.type!==_.MouseTargetType.GUTTER_GLYPH_MARGIN?!1:F.event.rightButton?(this.showContextMenu(F),!0):(this.defaultRun(),!0)}getContextMenuActions(F){return this.menuService.createMenu(a.MenuId.TestingGlyphMarginContext,this.contextKeyService)}showContextMenu(F){const L=this.getContextMenuActions(F),B=(0,a.generateMergedCtxMenu)({menus:L});L.dispose(),setTimeout(()=>{this.ctxMenuRenderer.show({anchor:F.event.browserEvent,menuNodes:B,args:this.getContextMenuArgs()})})}getGutterLabel(){}}n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],T.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(a.AbstractMenuService),n.__metadata("design:type",a.AbstractMenuService)],T.prototype,"menuService",void 0),n.__decorate([(0,r.Autowired)(a.ICtxMenuRenderer),n.__metadata("design:type",a.ICtxMenuRenderer)],T.prototype,"ctxMenuRenderer",void 0);class R extends T{constructor(F,L){super(w(F.map(B=>B.test),F.map(B=>B.resultItem)),L),this.tests=F}merge(F,L){return this.tests.push({test:F,resultItem:L}),this.editorDecoration=w(this.tests.map(B=>B.test),this.tests.map(B=>B.resultItem)),this}getContextMenuArgs(){return this.tests.map(F=>F.test.item.extId)}defaultRun(){return this.testService.runTests({tests:this.tests.map(({test:F})=>F),group:2})}defaultDebug(){return this.testService.runTests({tests:this.tests.map(({test:F})=>F),group:4})}}n.__decorate([(0,r.Autowired)(g.TestServiceToken),n.__metadata("design:type",b.TestServiceImpl)],R.prototype,"testService",void 0);let P=class extends T{constructor(F,L,B){super(w([F],[B]),L),this.test=F,this.resultItem=B}merge(F,L){return this.injector.get(R,[[{test:this.test,resultItem:this.resultItem},{test:F,resultItem:L}],this.editor])}getContextMenuArgs(){return[this.test.item.extId]}defaultRun(){return this.testService.runTests({tests:[this.test],group:2})}defaultDebug(){return this.testService.runTests({tests:[this.test],group:4})}};n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],P.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(g.TestServiceToken),n.__metadata("design:type",b.TestServiceImpl)],P.prototype,"testService",void 0),P=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object,Object])],P);let O=class{get monacoEditor(){return this.editor.monacoEditor}constructor(F,L,B,U){this.testMessage=F,this.messageUri=L,this.location=B,this.editor=U,this.decorationId=`testmessage-${(0,p.uuid)()}`,this.id="",this.codeEditorService=this.overrideServicesRegistry.getRegisteredService(o.ServiceNames.CODE_EDITOR_SERVICE);const W=F.type,j=typeof F.message=="string"?A(F.message):(0,E.parseMarkdownText)(typeof F.message=="object"&&"value"in F.message?F.message.value:String(F.message)).then(Z=>Z).catch(()=>typeof F.message=="object"&&"value"in F.message?F.message.value:String(F.message)),Q=typeof j=="string"?j:typeof F.message=="object"&&"value"in F.message?F.message.value:String(F.message);this.codeEditorService.registerDecorationType("test-message-decoration",this.decorationId,{after:{contentText:Q,color:`${u.testMessageSeverityColors[W]}`,fontSize:`${this.monacoEditor.getOption(s.EditorOption.fontSize)}px`,fontFamily:`var(${S})`,padding:"0px 12px 0px 24px"}},void 0,this.monacoEditor);const G=this.codeEditorService.resolveDecorationOptions(this.decorationId,!0);G.hoverMessage=typeof j=="string"?new m.MarkdownString().appendText(j):typeof F.message=="object"&&"value"in F.message?F.message:new m.MarkdownString().appendText(String(F.message)),G.afterContentClassName=`${G.afterContentClassName} testing-inline-message-content`,G.zIndex=10,G.className=`testing-inline-message-margin testing-inline-message-severity-${W}`,G.isWholeLine=!0,G.stickiness=v.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,G.collapseOnReplaceEdit=!0,this.editorDecoration={range:I(B.range),options:G}}click(F){var L,B;if(F.event.rightButton||!this.messageUri)return!1;if(!((L=F.target.element)===null||L===void 0)&&L.className.includes(this.decorationId)){const U=this.testingPeekOpenerService.peekControllerMap.get((B=this.editor.currentUri)===null||B===void 0?void 0:B.toString());U&&U.toggle(this.messageUri)}return!1}dispose(){this.codeEditorService.removeDecorationType(this.decorationId)}};n.__decorate([(0,r.Autowired)(o.MonacoOverrideServiceRegistry),n.__metadata("design:type",o.MonacoOverrideServiceRegistry)],O.prototype,"overrideServicesRegistry",void 0),n.__decorate([(0,r.Autowired)(l.TestingPeekOpenerServiceToken),n.__metadata("design:type",c.TestingPeekOpenerServiceImpl)],O.prototype,"testingPeekOpenerService",void 0),O=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object,Object,Object])],O);let M=class{get currentUri(){return this.editor.currentUri}constructor(F){this.editor=F,this.disposer=new p.Disposable,this.invalidatedMessages=new WeakSet,this.lastDecorations=[]}contribute(){return this.setDecorations(this.currentUri),this.disposer.addDispose(this.editor.monacoEditor.onDidChangeModel(F=>{this.setDecorations(F.newModelUrl||void 0)})),this.disposer.addDispose(this.editor.monacoEditor.onDidChangeModelContent(F=>{if(!this.currentUri)return;let L=!1;for(const B of F.changes)for(const U of this.lastDecorations)U instanceof O&&U.location.range.startLineNumber>=B.range.startLineNumber&&U.location.range.endLineNumber<=B.range.endLineNumber&&(this.invalidatedMessages.add(U.testMessage),L=!0);L&&this.setDecorations(this.currentUri)})),this.disposer.addDispose(this.editor.monacoEditor.onContextMenu(F=>(F.event.preventDefault(),F.event.stopPropagation(),!1))),this.disposer.addDispose(this.editor.monacoEditor.onMouseDown(F=>{for(const L of this.lastDecorations)if(L.click(F)){F.event.stopPropagation();return}})),this.disposer.addDispose(this.testResultService.onTestChanged(({item:F})=>{this.currentUri&&F.item.uri&&F.item.uri.toString()===this.currentUri.toString()&&this.setDecorations(this.currentUri)})),this.disposer.addDispose(o.Event.any(this.testResultService.onResultsChanged,this.testService.onDidProcessDiff)(()=>this.setDecorations(this.currentUri))),this.disposer}setDecorations(F){if(!F){this.clearDecorations();return}this.editor.monacoEditor.changeDecorations(L=>{var B;const U=[];for(const j of this.testService.collection.all){if(!j.item.range||((B=j.item.uri)===null||B===void 0?void 0:B.toString())!==F.toString())continue;const Q=this.testResultService.getStateById(j.item.extId),G=j.item.range.startLineNumber,Z=Q?.[1],$=U.findIndex(V=>V instanceof T&&V.line===G);$!==-1?U[$]=U[$].merge(j,Z):U.push(this.injector.get(P,[j,this.editor.monacoEditor,Q?.[1]]))}const W=this.testResultService.results[0];if(W instanceof d.TestResultImpl)for(const j of W.tests)for(let Q=0;Q<j.tasks.length;Q++){const G=j.tasks[Q];for(let Z=0;Z<G.messages.length;Z++){const $=G.messages[Z];if(!this.invalidatedMessages.has($)&&D(F,$)){const V=$.type===1?void 0:(0,h.buildTestUri)({type:1,messageIndex:Z,taskIndex:Q,resultId:W.id,testExtId:j.item.extId});U.push(this.injector.get(O,[$,V,$.location,this.editor]))}}}L.deltaDecorations(this.lastDecorations.map(j=>j.id),U.map(j=>j.editorDecoration)).forEach((j,Q)=>U[Q].id=j),this.lastDecorations=U})}clearDecorations(){this.lastDecorations.length&&this.editor.monacoEditor.changeDecorations(F=>{for(const L of this.lastDecorations)F.removeDecoration(L.id);this.lastDecorations=[]})}};t.TestDecorationsContribution=M,n.__decorate([(0,r.Autowired)(g.TestServiceToken),n.__metadata("design:type",b.TestServiceImpl)],M.prototype,"testService",void 0),n.__decorate([(0,r.Autowired)(d.TestResultServiceToken),n.__metadata("design:type",y.TestResultServiceImpl)],M.prototype,"testResultService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],M.prototype,"injector",void 0),t.TestDecorationsContribution=M=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[Object])],M)},80162:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestProfileServiceImpl=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(20215);let p=class extends o.Disposable{constructor(){super(...arguments),this.testProfiles=new Map}removeProfile(m,_){const s=this.testProfiles.get(m);if(s)if(_){const g=s.profiles.findIndex(l=>l.profileId!==_);g>=0&&s.profiles.splice(g,1)}else this.testProfiles.delete(m)}addProfile(m,_){let s=this.testProfiles.get(_.controllerId);s?(s.profiles.push(_),s.profiles.sort(a.sorter)):(s={profiles:[_],controller:m},this.testProfiles.set(_.controllerId,s))}getBaseDefaultsProfile(m){const _=[];for(const{profiles:s}of this.testProfiles.values()){const g=s.find(l=>l.group===m);g&&_.push(g)}return _}getControllerProfiles(m){const _=this.testProfiles.get(m);return _?_.profiles:[]}};t.TestProfileServiceImpl=p,t.TestProfileServiceImpl=p=n.__decorate([(0,r.Injectable)()],p)},66724:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestTreeViewModelImpl=t.TestTreeItem=void 0;const n=e(85608),r=e(76003),o=e(97267),a=e(41869),p=e(41682),v=e(72383),m=e(82423),_=e(48385),s=e(68755),g=e(4836),l={getOwnState:d=>d instanceof h?d.ownState:0,getCurrentComputedState:d=>d.state,setComputedState:(d,E)=>d.state=E,getCurrentComputedDuration:d=>d.duration,getOwnDuration:d=>d instanceof h?d.ownDuration:void 0,setComputedDuration:(d,E)=>d.duration=E,getChildren:d=>p.Iterable.filter(d.children.values(),E=>E instanceof h),*getParents(d){for(let E=d.parent;E;E=E.parent)yield E}};class h{constructor(E,f){this.test=E,this.parent=f,this.children=new Set,this.state=0,this.ownState=0,this.depth=this.parent?this.parent.depth+1:0,this.update=c=>{(0,s.applyTestItemUpdate)(this.test,c)},this.retired=!1}get label(){return this.test.item.label}get sortText(){return this.test.item.sortText}get tests(){return[this.test]}}t.TestTreeItem=h;let u=class extends a.Disposable{constructor(){super(),this.items=new Map,this.updateEmitter=new a.Emitter,this.onUpdate=this.updateEmitter.event,this.addDispose(this.testService.onDidProcessDiff(E=>this.applyDiff(E)));for(const E of this.testService.collection.all)this.didUpdateItem(this.createItem(E))}get roots(){const E=(0,a.map)(this.testService.collection.rootItems,f=>this.items.get(f.item.extId));return(0,a.filter)(E,a.isDefined)}getRevealDepth(E){return E.depth===0?0:void 0}createItem(E){const f=E.parent?this.items.get(E.parent):void 0;return new h(E,f)}findTestTreeItemByExtId(E){if(!this.treeHandlerApi||!E)return;const f=this.treeHandlerApi.getModel();if(!f)return;const c=f.root.flattenedBranch.find(b=>f.root.getTreeNodeById(b).raw.rawItem.test.item.extId===E);return f.root.getTreeNodeById(c)}didUnStoreItem(E,f){const c=f.parent;return c?.children.delete(f),E.delete(f.test.item.extId),c instanceof h&&(0,m.refreshComputedState)(l,c),f.children}async didUpdateItem(E){var f,c;(f=E.parent)===null||f===void 0||f.children.add(E),this.items.set(E.test.item.extId,E);const y=this.getRevealDepth(E);y!==void 0&&await this.expandElement(E,y);const b=(c=this.testResultService.getStateById(E.test.item.extId))===null||c===void 0?void 0:c[1];b&&(E.retired=b.retired,E.ownState=b.computedState,E.ownDuration=b.ownDuration,(0,m.refreshComputedState)(l,E))}async applyDiff(E){var f;for(const c of E)switch(c[0]){case 0:{const y=this.createItem(c[1]);await this.didUpdateItem(y);const b=this.findTestTreeItemByExtId((f=y.parent)===null||f===void 0?void 0:f.test.item.extId);b&&b.refresh();break}case 1:{const y=c[1],b=this.items.get(y.extId);if(!b)break;b.update(y);break}case 2:{const y=this.items.get(c[1]);if(!y)break;const b=this.findTestTreeItemByExtId(y.test.item.extId);b&&b.parent.unlinkItem(b);const A=[[y]];for(;A.length;)for(const S of A.pop())S instanceof h&&A.push(this.didUnStoreItem(this.items,S));break}}E.length!==0&&this.updateEmitter.fire()}listenTreeHandlerEvent(){if(this.treeHandlerApi){const E=this.treeHandlerApi.getModel();this.addDispose(E.root.watcher.on(o.TreeNodeEvent.DidChangeExpansionState,async f=>{if(f.expanded){const c=f.raw;if(c.rawItem.test.expand===0)return;await this.expandElement(c.rawItem,c.rawItem.depth),await f.refresh()}})),this.addDispose(this.testResultService.onTestChanged(({item:f})=>{if(f.ownComputedState===0){const b=this.testResultService.getStateById(f.item.extId);b&&(f=b[1])}const c=this.items.get(f.item.extId);if(!c)return;c.retired=f.retired,c.ownState=f.ownComputedState,c.ownDuration=f.ownDuration;const y=c.children.size?void 0:f.computedState;(0,m.refreshComputedState)(l,c,y),E.dispatchChange(),this.revealTreeById(f.item.extId,!1,!1),this.updateEmitter.fire()})),this.addDispose(this.testResultService.onResultsChanged(f=>{var c,y;if("removed"in f){for(const b of[...this.items.values()].sort((A,S)=>S.depth-A.depth)){const A=(c=this.testResultService.getStateById(b.test.item.extId))===null||c===void 0?void 0:c[1];b.ownDuration=A?.ownDuration,(0,m.refreshComputedState)(l,b,(y=A?.ownComputedState)!==null&&y!==void 0?y:0)}E.dispatchChange(),this.updateEmitter.fire()}}))}}revealTreeById(E,f=!0,c=!0){}getTestItem(E){return this.testService.collection.getNodeById(E)}getTestTreeItem(E){return this.items.get(E)}expandElement(E,f){return!(E instanceof h)||E.test.expand===0?Promise.resolve():this.testService.collection.expand(E.test.item.extId,f)}initTreeModel(){return Promise.resolve()}setTreeHandlerApi(E){this.treeHandlerApi=E,this.listenTreeHandlerEvent()}};t.TestTreeViewModelImpl=u,n.__decorate([(0,r.Autowired)(v.TestServiceToken),n.__metadata("design:type",Object)],u.prototype,"testService",void 0),n.__decorate([(0,r.Autowired)(_.TestResultServiceToken),n.__metadata("design:type",g.TestResultServiceImpl)],u.prototype,"testResultService",void 0),t.TestTreeViewModelImpl=u=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],u)},4836:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestResultServiceImpl=t.isRunningTests=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(12288),p=e(20215),v=e(48385),m=e(33429),_=e(1031),{findFirstInSorted:s}=o.arrays,g=h=>h.results.length>0&&h.results[0].completedAt===void 0;t.isRunningTests=g;let l=class{get results(){return this._results}constructor(){this.changeResultEmitter=new o.Emitter,this.testChangeEmitter=new o.Emitter,this._results=[],this.onResultsChanged=this.changeResultEmitter.event,this.onTestChanged=this.testChangeEmitter.event,this.hasAnyResults=a.TestingHasAnyResults.bind(this.contextKeyService),this.isRunning=a.TestingIsRunning.bind(this.contextKeyService)}onComplete(u){this.resort(),this.updateIsRunning(),this.changeResultEmitter.fire({completed:u})}resort(){this.results.sort((u,d)=>{var E,f;return((E=d.completedAt)!==null&&E!==void 0?E:Number.MAX_SAFE_INTEGER)-((f=u.completedAt)!==null&&f!==void 0?f:Number.MAX_SAFE_INTEGER)})}updateIsRunning(){this.isRunning.set((0,t.isRunningTests)(this))}retrieveTest(u){var d;const E=(0,m.parseTestUri)(u);if(!E)return;const{resultId:f,testExtId:c,taskIndex:y,messageIndex:b}=E,A=(d=this.getResult(E.resultId))===null||d===void 0?void 0:d.getStateById(c);if(!(!A||!A.tasks[E.taskIndex]))return new _.TestDto(f,A,y,b)}createTestResult(u){if("targets"in u){const c=(0,o.uuid)(),y=new v.TestResultImpl(c,u);return this.addTestResult(y),y}let d;u.profile&&(d=this.testProfiles.getControllerProfiles(u.controllerId).find(y=>y.profileId===u.profile.id));const E={targets:[],exclude:u.exclude,isAutoRun:!1};d&&E.targets.push({profileGroup:d.group,profileId:d.profileId,controllerId:u.controllerId,testIds:u.include});const f=new v.TestResultImpl(u.id,E);return this.addTestResult(f),f}getResult(u){return this.results.find(d=>d.id===u)}addTestResult(u){if(u.completedAt===void 0)this.results.unshift(u);else{const d=s(this.results,E=>E.completedAt!==void 0&&E.completedAt<=u.completedAt);this.results.splice(d,0,u)}if(this.hasAnyResults.set(!0),u instanceof v.TestResultImpl)u.onComplete(()=>this.onComplete(u)),u.onChange(this.testChangeEmitter.fire,this.testChangeEmitter),this.isRunning.set(!0),this.changeResultEmitter.fire({started:u});else{this.changeResultEmitter.fire({inserted:u});for(const d of u.tests)for(const E of this.results)if(E===u){this.testChangeEmitter.fire({item:d,result:u,reason:2});break}else if(E.getStateById(d.item.extId)!==void 0)break}return u}getStateById(u){for(const d of this.results){const E=d.getStateById(u);if(E&&E.computedState!==0)return[d,E]}}clear(){const u=[],d=[];for(const E of this.results)E.completedAt!==void 0?d.push(E):u.push(E);this._results=u,u.length===0&&this.hasAnyResults.set(!1),this.changeResultEmitter.fire({removed:d})}};t.TestResultServiceImpl=l,n.__decorate([(0,r.Autowired)(p.TestProfileServiceToken),n.__metadata("design:type",Object)],l.prototype,"testProfiles",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],l.prototype,"contextKeyService",void 0),t.TestResultServiceImpl=l=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],l)},86457:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestServiceImpl=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(53736),p=e(12288),v=e(63067),m=e(72383),_=e(20215),s=e(48385),g=e(68755),l=e(95381),h=e(76028);let u=class extends o.Disposable{constructor(){super(),this.controllers=new Map,this.processDiffEmitter=new o.Emitter,this.viewId="",this.collection=new g.MainThreadTestCollection(this.expandTest.bind(this)),this.onDidProcessDiff=this.processDiffEmitter.event,this.controllerCount=p.TestingServiceProviderCount.bind(this.contextKeyService),this.canRefreshTests=p.TestingCanRefreshTests.bind(this.contextKeyService)}getTestController(E){return this.controllers.get(E)}async refreshTests(E){var f;const c=new o.CancellationTokenSource;try{E?await((f=this.controllers.get(E))===null||f===void 0?void 0:f.refreshTests(c.token)):await Promise.all([...this.controllers.values()].map(y=>y.refreshTests(c.token)))}finally{c.dispose(!0)}}registerTestingExplorerView(){return this.mainlayoutService.collectViewComponent,this.mainlayoutService.collectTabbarComponent([{id:l.TestingContainerId}],{iconClass:(0,o.getIcon)("test"),title:(0,o.localize)("test.title"),priority:1,containerId:"workbench.view.testing",component:h.TestingView,activateKeyBinding:"ctrlcmd+shift+t"},o.SlotLocation.left)}registerTestController(E,f){this.controllers.set(E,f),this.controllerCount.set(this.controllers.size),this.updateCanRefresh(),this.controllers.size>0&&!this.viewId&&(this.viewId=this.registerTestingExplorerView());const c=new o.Disposable;return c.addDispose(o.Disposable.create(()=>{const y=[];for(const b of this.collection.rootItems)b.controllerId===E&&y.push([2,b.item.extId]);this.publishDiff(E,y),this.controllers.delete(E)&&(this.controllerCount.set(this.controllers.size),this.updateCanRefresh(),this.controllers.size===0&&this.viewId&&this.mainlayoutService.disposeContainer(this.viewId))})),c.addDispose(f.canRefresh.onDidChange(this.updateCanRefresh,this)),c}updateCanRefresh(){this.canRefreshTests.set(Array.from(this.controllers.values()).some(E=>E.canRefresh))}async expandTest(E,f){var c;await((c=this.controllers.get(m.TestId.fromString(E).controllerId))===null||c===void 0?void 0:c.expandTest(E,f))}publishDiff(E,f){this.collection.apply(f),this.processDiffEmitter.fire(f)}runTests(E,f=o.CancellationToken.None){var c;const y={targets:[],exclude:(c=E.exclude)===null||c===void 0?void 0:c.map(A=>A.item.extId),isAutoRun:E.isAutoRun},b=this.testProfiles.getBaseDefaultsProfile(E.group);for(const A of b){const S=E.tests.filter(D=>(0,_.canUseProfileWithTest)(A,D)).map(D=>D.item.extId);y.targets.push({testIds:S,profileGroup:A.group,profileId:A.profileId,controllerId:A.controllerId})}return this.runResolvedTests(y,f)}async runResolvedTests(E,f){E.exclude||(E.exclude=[]);const c=this.resultService.createTestResult(E);try{const y=new o.CancellationTokenSource(f),b=E.targets.map(A=>{var S;return(S=this.controllers.get(A.controllerId))===null||S===void 0?void 0:S.runTests({runId:c.id,excludeExtIds:E.exclude.filter(D=>!A.testIds.includes(D)),profileId:A.profileId,controllerId:A.controllerId,testIds:A.testIds},y.token).catch(()=>{})});return await Promise.all(b),c}finally{c.markComplete()}}};t.TestServiceImpl=u,n.__decorate([(0,r.Autowired)(v.IMainLayoutService),n.__metadata("design:type",Object)],u.prototype,"mainlayoutService",void 0),n.__decorate([(0,r.Autowired)(s.TestResultServiceToken),n.__metadata("design:type",Object)],u.prototype,"resultService",void 0),n.__decorate([(0,r.Autowired)(_.TestProfileServiceToken),n.__metadata("design:type",Object)],u.prototype,"testProfiles",void 0),n.__decorate([(0,r.Autowired)(a.IContextKeyService),n.__metadata("design:type",Object)],u.prototype,"contextKeyService",void 0),t.TestServiceImpl=u=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],u)},76388:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestingContribution=t.TestingOutputPeekDocumentProvider=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(30144),p=e(12288),v=e(93899),m=e(43718),_=e(57517),s=e(14951),g=e(63067),l=e(93835),h=e(81001),u=e(72383),d=e(85941),E=e(48385),f=e(57879),c=e(16558),y=e(33429),b=e(1031),A=e(89872),S=e(33218),D=e(17482),I=e(4836),w=e(86457);let T=class{constructor(){this._onDidChangeContent=new m.Emitter,this.onDidChangeContent=this._onDidChangeContent.event}provideEditorDocumentModelContent(O,M){const k=this.testResultService.retrieveTest(O);if(!k)return"";const F=k.messages[k.messageIndex];if(k.isDiffable||typeof F.message=="string")return"";const L=F.message;return L?L.value.replace(/\t/g,""):""}isReadonly(O){return!0}handlesScheme(O){return O===y.TEST_DATA_SCHEME}};t.TestingOutputPeekDocumentProvider=T,n.__decorate([(0,r.Autowired)(E.TestResultServiceToken),n.__metadata("design:type",I.TestResultServiceImpl)],T.prototype,"testResultService",void 0),t.TestingOutputPeekDocumentProvider=T=n.__decorate([(0,r.Injectable)()],T);let R=class{initialize(){this.testTreeViewModel.initTreeModel()}registerTestResultPanel(){if(this.layoutService.getTabbarHandler(a.TEST_RESULT_CONTAINER_ID))return;const O=this.layoutService.collectTabbarComponent([{id:a.TEST_RESULT_CONTAINER_ID,component:S.TestResultPanel}],{containerId:a.TEST_RESULT_CONTAINER_ID,title:(0,o.localize)("test.results"),hidden:!1},"bottom"),M=this.layoutService.getTabbarHandler(O);M?.activate()}onDidStart(){this.testResultService.onResultsChanged(()=>{this.registerTestResultPanel()}),this.testResultService.onTestChanged(()=>{this.registerTestResultPanel()})}registerCommands(O){O.registerCommand(d.RuntTestCommand,{execute:async F=>{const L=this.testTreeViewModel.getTestItem(F);L&&await this.testService.runTests({group:2,tests:[L]})}}),O.registerCommand(d.DebugTestCommand,{execute:async F=>{const L=this.testTreeViewModel.getTestItem(F);L&&await this.testService.runTests({group:4,tests:[L]})}}),O.registerCommand(d.GoToTestCommand,{execute:async F=>{const L=this.testTreeViewModel.getTestItem(F);if(!L)return;const{range:B,uri:U}=L.item;if(!U)return;const W=await this.filesystem.getFileStat(U.toString());if(W){if(W.type===o.FileType.Directory){this.commandService.executeCommand("revealInExplorer",U);return}W.type===o.FileType.File&&this.commandService.executeCommand(o.EDITOR_COMMANDS.OPEN_RESOURCE.id,o.URI.parse(U.toString()),{range:B,focus:!0})}},isVisible:()=>!1}),O.registerCommand(d.PeekTestError,{execute:async F=>{this.testingPeekOpenerService.open()},isVisible:()=>!1}),O.registerCommand(d.ClosePeekTest,{execute:async F=>{var L,B;if(F=F??((B=(L=this.editorService.currentEditor)===null||L===void 0?void 0:L.currentUri)===null||B===void 0?void 0:B.toString()),!F)return;const U=this.testingPeekOpenerService.peekControllerMap.get(F);U&&U.removePeek()},isVisible:()=>!1}),O.registerCommand(d.TestingRunCurrentFile,{execute:async()=>{M(2)}}),O.registerCommand(d.TestingDebugCurrentFile,{execute:async()=>{M(4)}});const M=F=>{var L;const B=this.editorService.currentEditor,U=B?.monacoEditor,W=U?.getPosition(),j=U?.getModel();if(!W||!j||!("uri"in j))return;const Q=j.uri.toString();for(const G of this.testService.collection.all)((L=G.item.uri)===null||L===void 0?void 0:L.toString())===Q&&this.testService.runTests({tests:[G],group:F})};O.registerCommand(d.GoToPreviousMessage,{execute:async F=>{var L,B;if(F=F??((B=(L=this.editorService.currentEditor)===null||L===void 0?void 0:L.currentUri)===null||B===void 0?void 0:B.toString()),!F)return;const U=this.testingPeekOpenerService.peekControllerMap.get(F);U&&U.previous()}}),O.registerCommand(d.GoToNextMessage,{execute:async F=>{var L,B;if(F=F??((B=(L=this.editorService.currentEditor)===null||L===void 0?void 0:L.currentUri)===null||B===void 0?void 0:B.toString()),!F)return;const U=this.testingPeekOpenerService.peekControllerMap.get(F);U&&U.next()}}),O.registerCommand(d.ClearTestResults,{execute:async F=>{this.testResultService.clear(),this.commandService.executeCommand(d.ClosePeekTest.id,F)}}),O.registerCommand(d.OpenMessageInEditor,{execute:async F=>{var L,B;if(F=F??((B=(L=this.editorService.currentEditor)===null||L===void 0?void 0:L.currentUri)===null||B===void 0?void 0:B.toString()),!F)return;const U=this.testingPeekOpenerService.peekControllerMap.get(F);U&&U.openCurrentInEditor()}});const k=async F=>{const L=[...this.testService.collection.rootItems];L.length&&await this.testService.runTests({tests:L,group:F})};O.registerCommand(d.RefreshTestsCommand,{execute:async()=>{await this.testService.refreshTests()}}),O.registerCommand(d.RuntAllTestCommand,{execute:async()=>{await k(2)}}),O.registerCommand(d.DebugAllTestCommand,{execute:async()=>{await k(4)}})}registerKeybindings(O){O.registerKeybinding({command:d.ClosePeekTest.id,keybinding:"esc",when:p.TestingIsPeekVisible.equalsTo(!0)})}registerMenus(O){O.registerMenuItem(v.MenuId.TestingGlyphMarginContext,{command:d.RuntTestCommand.id,group:"1_has_decoration",order:1}),O.registerMenuItem(v.MenuId.TestingGlyphMarginContext,{command:d.DebugTestCommand.id,group:"1_has_decoration",order:2}),O.registerMenuItem(v.MenuId.TestPeekTitleContext,{command:d.GoToPreviousMessage.id,iconClass:d.GoToPreviousMessage.iconClass,group:"navigation",order:5}),O.registerMenuItem(v.MenuId.TestPeekTitleContext,{command:d.GoToNextMessage.id,iconClass:d.GoToNextMessage.iconClass,group:"navigation",order:6}),O.registerMenuItem(v.MenuId.TestPeekTitleContext,{command:d.ClearTestResults.id,iconClass:d.ClearTestResults.iconClass,group:"navigation",order:7}),O.registerMenuItem(v.MenuId.TestPeekTitleContext,{command:d.OpenMessageInEditor.id,iconClass:d.OpenMessageInEditor.iconClass,group:"navigation",order:9})}registerToolbarItems(O){O.registerItem({id:d.RefreshTestsCommand.id,command:d.RefreshTestsCommand.id,viewId:"workbench.view.testing",when:p.TestingCanRefreshTests.equalsTo(!0)}),O.registerItem({id:d.RuntAllTestCommand.id,command:d.RuntAllTestCommand.id,viewId:"workbench.view.testing"}),O.registerItem({id:d.DebugAllTestCommand.id,command:d.DebugAllTestCommand.id,viewId:"workbench.view.testing"}),O.registerItem({id:d.ClearTestResults.id,command:d.ClearTestResults.id,viewId:"workbench.view.testing"})}registerEditorFeature(O){O.registerEditorFeatureContribution({contribute:M=>this.injector.get(D.TestDecorationsContribution,[M]).contribute()}),O.registerEditorFeatureContribution({contribute:M=>this.injector.get(b.TestOutputPeekContribution,[M]).contribute()})}registerEditorDocumentModelContentProvider(O){O.registerEditorDocumentModelContentProvider(this.testingOutputPeekDocumentProvider)}registerEditorComponent(O){O.registerEditorComponent({uid:l.MARKDOWN_EDITOR_COMPONENT_ID,component:h.MarkdownEditorComponent,scheme:y.TEST_DATA_SCHEME}),O.registerEditorComponentResolver(y.TEST_DATA_SCHEME,(M,k)=>{k.push({type:_.EditorOpenType.component,componentId:l.MARKDOWN_EDITOR_COMPONENT_ID,weight:10})})}registerResource(O){O.registerResourceProvider({scheme:y.TEST_DATA_SCHEME,provideResource:async M=>({uri:M,icon:(0,o.getIcon)("file-text"),name:`Preview ${M.displayName}`})})}};t.TestingContribution=R,n.__decorate([(0,r.Autowired)(c.TestTreeViewModelToken),n.__metadata("design:type",Object)],R.prototype,"testTreeViewModel",void 0),n.__decorate([(0,r.Autowired)(s.IFileServiceClient),n.__metadata("design:type",Object)],R.prototype,"filesystem",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],R.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],R.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(f.TestingPeekOpenerServiceToken),n.__metadata("design:type",A.TestingPeekOpenerServiceImpl)],R.prototype,"testingPeekOpenerService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",T)],R.prototype,"testingOutputPeekDocumentProvider",void 0),n.__decorate([(0,r.Autowired)(_.WorkbenchEditorService),n.__metadata("design:type",_.WorkbenchEditorService)],R.prototype,"editorService",void 0),n.__decorate([(0,r.Autowired)(u.TestServiceToken),n.__metadata("design:type",w.TestServiceImpl)],R.prototype,"testService",void 0),n.__decorate([(0,r.Autowired)(E.TestResultServiceToken),n.__metadata("design:type",I.TestResultServiceImpl)],R.prototype,"testResultService",void 0),n.__decorate([(0,r.Autowired)(g.IMainLayoutService),n.__metadata("design:type",Object)],R.prototype,"layoutService",void 0),t.TestingContribution=R=n.__decorate([(0,r.Injectable)(),(0,o.Domain)(o.ClientAppContribution,o.CommandContribution,_.BrowserEditorContribution,v.MenuContribution,o.KeybindingContribution,o.TabBarToolbarContribution)],R)},85941:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RefreshTestsCommand=t.DebugAllTestCommand=t.RuntAllTestCommand=t.OpenMessageInEditor=t.ClearTestResults=t.GoToNextMessage=t.GoToPreviousMessage=t.ClosePeekTest=t.PeekTestError=t.TestingDebugCurrentFile=t.TestingRunCurrentFile=t.GoToTestCommand=t.DebugTestCommand=t.RuntTestCommand=void 0;const n=e(41869);t.RuntTestCommand={id:"testing.run.test",label:"Run Test"},t.DebugTestCommand={id:"testing.debug.test",label:"Debug Test"},t.GoToTestCommand={id:"testing.goto.test",label:"Go To Test"},t.TestingRunCurrentFile={id:"testing.runCurrentFile",label:"Run Tests in Current File"},t.TestingDebugCurrentFile={id:"testing.debugCurrentFile",label:"Debug Tests in Current File"},t.PeekTestError={id:"testing.peek.test.error",label:"Peek Output"},t.ClosePeekTest={id:"testing.peek.test.close",label:"Close Peek Output"},t.GoToPreviousMessage={id:"testing.goToPreviousMessage",label:"Go to Previous Test Failure",iconClass:(0,n.getIcon)("arrowup")},t.GoToNextMessage={id:"testing.goToNextMessage",label:"Go to Next Test Failure",iconClass:(0,n.getIcon)("arrowdown")},t.ClearTestResults={id:"testing.clearTestResults",label:"Clear All Results",iconClass:(0,n.getExternalIcon)("clear-all")},t.OpenMessageInEditor={id:"testing.openMessageInEditor",label:"Open in Editor",iconClass:(0,n.getExternalIcon)("link-external")},t.RuntAllTestCommand={id:"testing.runAll",label:"Run All Test",iconClass:(0,n.getExternalIcon)("run-all")},t.DebugAllTestCommand={id:"testing.debugAll",label:"Debug All Test",iconClass:(0,n.getIcon)("debug-alt-small")},t.RefreshTestsCommand={id:"testing.refresshTests",label:"Refresh Tests",iconClass:(0,n.getIcon)("refresh")}},61090:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testMessageSeverityColors=t.testConfigurationGroupNames=t.labelForTestInState=t.testStateNames=void 0;const n=e(43718);t.testStateNames={6:(0,n.localize)("testState.errored","Errored"),4:(0,n.localize)("testState.failed","Failed"),3:(0,n.localize)("testState.passed","Passed"),1:(0,n.localize)("testState.queued","Queued"),2:(0,n.localize)("testState.running","Running"),5:(0,n.localize)("testState.skipped","Skipped"),0:(0,n.localize)("testState.unset","Not yet run")};const r=(o,a)=>'label then the unit tests state, for example "Addition Tests (Running)"';t.labelForTestInState=r,t.testConfigurationGroupNames={4:(0,n.localize)("testGroup.debug","Debug"),2:(0,n.localize)("testGroup.run","Run"),8:(0,n.localize)("testGroup.coverage","Coverage")},t.testMessageSeverityColors={0:"#F14C4C",1:"#33333380"}},82423:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refreshComputedState=t.getComputedDuration=t.getComputedState=t.isDurationAccessor=void 0;const n=e(41682),r=e(92597),o=m=>"getOwnDuration"in m;t.isDurationAccessor=o;const a=(m,_,s=!1)=>{var g;let l=m.getCurrentComputedState(_);if(l===void 0||s){l=(g=m.getOwnState(_))!==null&&g!==void 0?g:0;for(const h of m.getChildren(_))l=(0,r.maxPriority)(l,(0,t.getComputedState)(m,h));m.setComputedState(_,l)}return l};t.getComputedState=a;const p=(m,_,s=!1)=>{let g=m.getCurrentComputedDuration(_);if(g===void 0||s){const l=m.getOwnDuration(_);if(l!==void 0)g=l;else{g=void 0;for(const h of m.getChildren(_)){const u=(0,t.getComputedDuration)(m,h);u!==void 0&&(g=(g||0)+u)}}m.setComputedDuration(_,g)}return g};t.getComputedDuration=p;const v=(m,_,s)=>{const g=m.getCurrentComputedState(_),l=r.statePriority[g],h=s??(0,t.getComputedState)(m,_,!0),u=r.statePriority[h],d=new Set;if(u!==l){if(m.setComputedState(_,h),d.add(_),u>l)for(const E of m.getParents(_)){const f=m.getCurrentComputedState(E);if(f!==void 0&&r.statePriority[f]>=u)break;m.setComputedState(E,h),d.add(E)}else if(u<l)for(const E of m.getParents(_)){const f=m.getCurrentComputedState(E);if(f===void 0||r.statePriority[f]>l)break;m.setComputedState(E,(0,t.getComputedState)(m,E,!0)),d.add(E)}}if((0,t.isDurationAccessor)(m))for(const E of n.Iterable.concat(n.Iterable.single(_),m.getParents(_))){const f=m.getCurrentComputedDuration(E),c=(0,t.getComputedDuration)(m,E,!0);if(f===c)break;m.setComputedDuration(E,c),d.add(E)}return d};t.refreshComputedState=v},72383:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestPeekMessageToken=t.TestDecorationsToken=t.TestServiceToken=void 0,e(85608).__exportStar(e(87902),t),t.TestServiceToken=Symbol("TestService"),t.TestDecorationsToken=Symbol("TestDecorationsToken"),t.TestPeekMessageToken=Symbol("TestPeekMessageToken")},30005:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableValue=void 0;const n=e(43718);class r extends n.Disposable{get value(){return this._value}set value(a){a!==this._value&&(this._value=a,this.changeEmitter.fire(a))}constructor(a){super(),this._value=a,this.changeEmitter=this.registerDispose(new n.Emitter),this.onDidChange=this.changeEmitter.event}}t.ObservableValue=r},20215:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestProfileServiceToken=t.canUseProfileWithTest=t.sorter=void 0;const n=e(48465),r=(a,p)=>a.isDefault!==p.isDefault?a.isDefault?-1:1:a.label.localeCompare(p.label);t.sorter=r;const o=(a,p)=>a.controllerId===p.controllerId&&(n.TestId.isRoot(p.item.extId)||!a.tag||p.item.tags.includes(a.tag));t.canUseProfileWithTest=o,t.TestProfileServiceToken=Symbol("TestProfileService")},48385:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestResultImpl=t.resultItemParents=t.maxCountPriority=t.TestResultServiceToken=t.makeEmptyCounts=void 0;const n=e(43718),r=e(82423),o=e(92597),a=()=>{const s={};for(const g of o.statesInOrder)s[g]=0;return s};t.makeEmptyCounts=a,t.TestResultServiceToken=Symbol("TestResultService");const p=(s,g,l)=>({parent:l,controllerId:s,expand:0,item:{...g},children:[],tasks:[],ownComputedState:0,computedState:0,retired:!1}),v=s=>{for(const g of o.statesInOrder)if(s[g]>0)return g;return 0};t.maxCountPriority=v;const m=function*(s,g){let l=g;for(;l;)yield l,l=l.parent?s.getStateById(l.parent):void 0};t.resultItemParents=m;class _{get completedAt(){return this._completedAt}get tests(){return this.testById.values()}constructor(g,l){this.id=g,this.request=l,this.completeEmitter=new n.Emitter,this.changeEmitter=new n.Emitter,this.testById=new Map,this.name=(0,n.formatLocalize)("test.result.runFinished",new Date().toLocaleString()),this.tasks=[],this.onChange=this.changeEmitter.event,this.onComplete=this.completeEmitter.event,this.counts=(0,t.makeEmptyCounts)(),this.outputs=[],this.computedStateAccessor={getOwnState:h=>h.ownComputedState,getCurrentComputedState:h=>h.computedState,setComputedState:(h,u)=>h.computedState=u,getChildren:h=>h.children,getParents:h=>{const{testById:u}=this;return function*(){for(let d=h.parent;d;){const E=u.get(d);if(!E)break;yield E,d=E.parent}}()}}}setAllToState(g,l,h){const u=this.mustGetTaskIndex(l);for(const d of this.testById.values())h(d.tasks[u],d)&&this.fireUpdateAndRefresh(d,u,g)}addTestToRun(g,l,h){var u;const d=p(g,l,h);return this.testById.set(l.extId,d),this.counts[0]++,h&&((u=this.testById.get(h))===null||u===void 0||u.children.push(d)),this.tasks.length&&this.tasks.forEach(()=>{d.tasks.push({duration:void 0,messages:[],state:1})}),d}mustGetTaskIndex(g){const l=this.tasks.findIndex(h=>h.id===g);if(l===-1)throw new Error(`Unknown task ${g} in updateState`);return l}fireUpdateAndRefresh(g,l,h){const u=g.ownComputedState;g.tasks[l].state=h;const d=(0,o.maxPriority)(...g.tasks.map(E=>E.state));d!==u&&(g.ownComputedState=d,this.counts[u]--,this.counts[d]++,(0,r.refreshComputedState)(this.computedStateAccessor,g).forEach(E=>this.changeEmitter.fire(E===g?{item:g,result:this,reason:3,previous:u}:{item:E,result:this,reason:2})))}getStateById(g){return this.testById.get(g)}getOutput(){return this.outputs.join("")}toJSON(){throw new Error("Method not implemented.")}updateState(g,l,h,u){const d=this.testById.get(g);if(!d)return;const E=this.mustGetTaskIndex(l);u!==void 0&&(d.tasks[E].duration=u,d.ownDuration=Math.max(d.ownDuration||0,u)),this.fireUpdateAndRefresh(d,E,h)}appendMessage(g,l,h){const u=this.testById.get(g);u&&(u.tasks[this.mustGetTaskIndex(l)].messages.push(h),this.changeEmitter.fire({item:u,result:this,reason:3,previous:u.ownComputedState}))}appendOutput(g,l,h,u){this.outputs.push(g)}addTestChainToRun(g,l){let h=this.testById.get(l[0].extId);h||(h=this.addTestToRun(g,l[0],null));for(let u=1;u<l.length;u++)h=this.addTestToRun(g,l[u],h.item.extId);for(let u=0;u<this.tasks.length;u++)this.fireUpdateAndRefresh(h,u,1)}addTask(g){const l=this.tasks.length;this.tasks.push({...g,coverage:void 0,otherMessages:[]});for(const h of this.tests)h.tasks.push({duration:void 0,messages:[],state:0}),this.fireUpdateAndRefresh(h,l,1)}markTaskComplete(g){this.tasks[this.mustGetTaskIndex(g)].running=!1,this.setAllToState(0,g,l=>l.state===1||l.state===2)}markComplete(){if(this._completedAt!==void 0)throw new Error("cannot complete a test result multiple times");for(const g of this.tasks)g.running&&this.markTaskComplete(g.id);this._completedAt=Date.now(),this.completeEmitter.fire()}}t.TestResultImpl=_},68755:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadTestCollection=t.AbstractIncrementalTestCollection=t.IncrementalChangeCollector=t.applyTestItemUpdate=t.testRunProfileBitsetList=void 0;const n=e(43718);t.testRunProfileBitsetList=[2,4,8,16];const r=(v,m)=>{m.expand!==void 0&&(v.expand=m.expand),m.item!==void 0&&(v.item=v.item?Object.assign(v.item,m.item):m.item)};t.applyTestItemUpdate=r;class o{add(m){}update(m){}remove(m,_){}complete(){}}t.IncrementalChangeCollector=o;class a{constructor(){this._tags=new Map,this.items=new Map,this.roots=new Set,this.busyControllerCount=0,this.pendingRootCount=0,this.tags=this._tags}apply(m){const _=this.createChangeCollector();for(const s of m)switch(s[0]){case 0:{const g=s[1];if(g.parent){if(this.items.has(g.parent)){const l=this.items.get(g.parent);l.children.add(g.item.extId);const h=this.createItem(g,l);this.items.set(g.item.extId,h),_.add(h)}}else{const l=this.createItem(g);this.roots.add(l),this.items.set(g.item.extId,l),_.add(l)}g.expand===2&&this.busyControllerCount++;break}case 1:{const g=s[1],l=this.items.get(g.extId);if(!l)break;g.expand!==void 0&&(l.expand===2&&this.busyControllerCount--,g.expand===2&&this.busyControllerCount++),(0,t.applyTestItemUpdate)(l,g),_.update(l);break}case 2:{const g=this.items.get(s[1]);if(!g)break;g.parent?this.items.get(g.parent).children.delete(g.item.extId):this.roots.delete(g);const l=[[s[1]]];for(;l.length;)for(const h of l.pop()){const u=this.items.get(h);u&&(l.push(u.children),this.items.delete(h),_.remove(u,u!==g),u.expand===2&&this.busyControllerCount--)}break}case 4:this.retireTest(s[1]);break;case 3:this.updatePendingRoots(s[1]);break;case 5:this._tags.set(s[1].id,s[1]);break;case 6:this._tags.delete(s[1]);break}_.complete()}retireTest(m){}updatePendingRoots(m){this.pendingRootCount+=m}createChangeCollector(){return new o}}t.AbstractIncrementalTestCollection=a;class p extends a{get busyProviders(){return this.busyControllerCount}get rootItems(){return this.roots}get all(){return this.getIterator()}get rootIds(){return(0,n.map)(this.roots.values(),m=>m.item.extId)}constructor(m){super(),this.expandActual=m,this.busyProvidersChangeEmitter=new n.Emitter,this.retireTestEmitter=new n.Emitter,this.expandPromises=new WeakMap,this.onBusyProvidersChange=this.busyProvidersChangeEmitter.event,this.onDidRetireTest=this.retireTestEmitter.event}expand(m,_){const s=this.items.get(m);if(!s)return Promise.resolve();const g=this.expandPromises.get(s);if(g&&g.pendingLvl>=_)return g.prom;const l=this.expandActual(s.item.extId,_),h={doneLvl:g?g.doneLvl:-1,pendingLvl:_,prom:l};return this.expandPromises.set(s,h),l.then(()=>{h.doneLvl=_})}getNodeById(m){return this.items.get(m)}getReviverDiff(){const m=[[3,this.pendingRootCount]],_=[this.rootIds];for(;_.length;)for(const s of _.pop()){const g=this.items.get(s);m.push([0,{controllerId:g.controllerId,expand:g.expand,item:g.item,parent:g.parent}]),_.push(g.children)}return m}apply(m){const _=this.busyControllerCount;super.apply(m),_!==this.busyControllerCount&&this.busyProvidersChangeEmitter.fire(this.busyControllerCount)}clear(){const m=[];for(const _ of this.roots)m.push([2,_.item.extId]);return this.roots.clear(),this.items.clear(),m}createItem(m){return{...m,children:new Set}}retireTest(m){this.retireTestEmitter.fire(m)}*getIterator(){const m=[this.rootIds];for(;m.length;)for(const _ of m.pop()){const s=this.getNodeById(_);yield s,m.push(s.children)}}}t.MainThreadTestCollection=p},87902:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestId=void 0;class e{static fromExtHostTestItem(r,o,a=r.parent){if(r.id===o)return new e([o]);const p=[r.id];for(let v=a;v&&v.id!==o;v=v.parent)p.push(v.id);return p.push(o),new e(p.reverse())}static isRoot(r){return!r.includes("\0")}static fromString(r){return new e(r.split("\0"))}static join(r,o){return new e([...r.path,o])}static joinToString(r,o){return r.toString()+"\0"+o}static compare(r,o){return r===o?0:o.startsWith(r+"\0")?2:r.startsWith(o+"\0")?3:1}constructor(r,o=r.length){if(this.path=r,this.viewEnd=o,r.length===0||o<1)throw new Error("cannot create test with empty path")}get parentId(){return this.viewEnd>1?new e(this.path,this.viewEnd-1):this}get localId(){return this.path[this.viewEnd-1]}get controllerId(){return this.path[0]}get isRoot(){return this.viewEnd===1}*idsFromRoot(){for(let r=1;r<=this.viewEnd;r++)yield new e(this.path,r)}compare(r){if(typeof r=="string")return e.compare(this.toString(),r);for(let o=0;o<r.viewEnd&&o<this.viewEnd;o++)if(r.path[o]!==this.path[o])return 1;return r.viewEnd>this.viewEnd?2:r.viewEnd<this.viewEnd?3:0}toJSON(){return this.toString()}toString(){if(!this.stringifed){this.stringifed=this.path[0];for(let r=1;r<this.viewEnd;r++)this.stringifed+="\0",this.stringifed+=this.path[r]}return this.stringifed}}t.TestId=e},95381:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestingExplorerInlineMenus=t.TestingContainerId=t.TestingViewId=void 0;const n=e(97267),r=e(85941);t.TestingViewId="@opensumi/ide-testing",t.TestingContainerId="testing",t.TestingExplorerInlineMenus=[{icon:"start",title:"Run Test",command:r.RuntTestCommand.id,position:n.IBasicInlineMenuPosition.TREE_CONTAINER},{icon:"debug-alt-small",title:"Debug Test",command:r.DebugTestCommand.id,position:n.IBasicInlineMenuPosition.TREE_CONTAINER},{icon:"openfile",title:"Go To Test",command:r.GoToTestCommand.id,position:n.IBasicInlineMenuPosition.TREE_CONTAINER}]},57879:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestingPeekOpenerServiceToken=void 0,t.TestingPeekOpenerServiceToken=Symbol("TestingPeekOpenerService")},92597:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hintMessagePeekHeight=t.isDiffable=t.parseMarkdownText=t.firstLine=t.isRunningState=t.statesInOrder=t.maxPriority=t.cmpPriority=t.stateNodes=t.isStateWithResult=t.isFailedState=t.statePriority=void 0;const n=e(84605),r=e(43718),{count:o}=r.strings;t.statePriority={2:6,6:5,4:4,1:3,3:2,0:1,5:0};const a=E=>E===6||E===4;t.isFailedState=a;const p=E=>E===6||E===4||E===3;t.isStateWithResult=p,t.stateNodes=Object.entries(t.statePriority).reduce((E,[f,c])=>{const y=Number(f);return E[y]={statusNode:!0,state:y,priority:c},E},{});const v=(E,f)=>t.statePriority[f]-t.statePriority[E];t.cmpPriority=v;const m=(...E)=>{switch(E.length){case 0:return 0;case 1:return E[0];case 2:return t.statePriority[E[0]]>t.statePriority[E[1]]?E[0]:E[1];default:{let f=E[0];for(let c=1;c<E.length;c++)t.statePriority[f]<t.statePriority[E[c]]&&(f=E[c]);return f}}};t.maxPriority=m,t.statesInOrder=Object.keys(t.statePriority).map(E=>Number(E)).sort(t.cmpPriority);const _=E=>E===1||E===2;t.isRunningState=_;const s=E=>{const f=E.indexOf(`
|
|
32366
|
+
`)}}class U{constructor(X,oe,ie){this._direction=X,this._moveByWords=oe,this._amount=ie}apply(X,oe){const ie=oe.x,he=oe.getCell(),me=he?G(he):"",{_amount:q,_direction:Ee,_moveByWords:ue}=this,te=Ee==="D"?-1:1,fe=oe.clone();if(ue)for(let Ie=0;Ie<q;Ie++)T(X,fe,te);else fe.shift(te*q);return this._applied={amount:Math.abs(oe.x-fe.x),prevPosition:ie,prevAttrs:me,rollForward:oe.moveTo(fe)},this._applied.rollForward}rollback(X){return this._applied?X.move(this._applied.prevPosition,X.y)+this._applied.prevAttrs:""}rollForwards(){return""}matches(X){if(!this._applied)return 1;const oe=this._direction,{amount:ie,rollForward:he}=this._applied;if(X.eatStr(`${v}${oe}`.repeat(ie))||oe==="D"&&X.eatStr("\b".repeat(ie)))return 0;if(he){const me=X.eatGradually(he);if(me!==1)return me}return X.eatGradually(`${v}${ie}${oe}`)}}class W extends r.Disposable{get accuracy(){let X=0;for(const[,oe]of this._stats)oe&&X++;return X/(this._stats.length||1)}get sampleSize(){return this._stats.length}get latency(){const X=this._stats.filter(([,oe])=>oe).map(([oe])=>oe).sort();return{count:X.length,min:X[0],median:X[Math.floor(X.length/2)],max:X[X.length-1]}}get maxLatency(){let X=-1/0;for(const[oe,ie]of this._stats)ie&&(X=Math.max(oe,X));return X}constructor(X){super(),this._stats=[],this._index=0,this._addedAtTime=new WeakMap,this._changeEmitter=new r.Emitter,this.onChange=this._changeEmitter.event,this.addDispose(X.onPredictionAdded(oe=>this._addedAtTime.set(oe,Date.now()))),this.addDispose(X.onPredictionSucceeded(this._pushStat.bind(this,!0))),this.addDispose(X.onPredictionFailed(this._pushStat.bind(this,!1)))}_pushStat(X,oe){const ie=this._addedAtTime.get(oe);this._stats[this._index]=[Date.now()-ie,X],this._index=(this._index+1)%d,this._changeEmitter.fire()}}t.PredictionStats=W;class j{get _currentGenerationPredictions(){return this._expected.filter(({gen:X})=>X===this._expected[0].gen).map(({p:X})=>X)}get isShowingPredictions(){return this._showPredictions}get length(){return this._expected.length}constructor(X,oe){this.terminal=X,this._style=oe,this._expected=[],this._currentGen=0,this._showPredictions=!1,this._addedEmitter=new r.Emitter,this.onPredictionAdded=this._addedEmitter.event,this._failedEmitter=new r.Emitter,this.onPredictionFailed=this._failedEmitter.event,this._succeededEmitter=new r.Emitter,this.onPredictionSucceeded=this._succeededEmitter.event}setShowPredictions(X){if(X===this._showPredictions)return;I("set predictions:",X),this._showPredictions=X;const oe=this._getActiveBuffer();if(!oe)return;const ie=this._currentGenerationPredictions;X?(this.clearCursor(),this._style.expectIncomingStyle(ie.reduce((he,me)=>me.affectsStyle?he+1:he,0)),this.terminal.write(ie.map(he=>he.apply(oe,this.physicalCursor(oe))).join(""))):this.terminal.write(ie.reverse().map(he=>he.rollback(this.physicalCursor(oe))).join(""))}undoAllPredictions(){const X=this._getActiveBuffer();this._showPredictions&&X&&this.terminal.write(this._currentGenerationPredictions.reverse().map(oe=>oe.rollback(this.physicalCursor(X))).join("")),this._expected=[]}beforeServerInput(X){var oe;const ie=X;if(this._inputBuffer&&(X=this._inputBuffer+X,this._inputBuffer=void 0),!this._expected.length)return this._clearPredictionState(),X;const he=this._getActiveBuffer();if(!he)return this._clearPredictionState(),X;let me="";const q=new R(X),Ee=this._expected[0].gen,ue=()=>{const te=q.eatRe(b);te&&(me+=te[0])};e:for(;this._expected.length&&q.remaining>0;){ue();const{p:te,gen:fe}=this._expected[0],Ie=this.physicalCursor(he),Me=q.index;switch(te.matches(q,this._lookBehind)){case 0:{const Be=X.slice(Me,q.index);fe===Ee?me+=(oe=te.rollForwards)===null||oe===void 0?void 0:oe.call(te,Ie,Be):(te.apply(he,this.physicalCursor(he)),me+=Be),this._succeededEmitter.fire(te),this._lookBehind=te,this._expected.shift();break}case 2:this._inputBuffer=X.slice(Me),q.index=X.length;break e;case 1:{const Be=this._expected.filter(Pe=>Pe.gen===Ee).reverse();me+=Be.map(({p:Pe})=>Pe.rollback(this.physicalCursor(he))).join(""),Be.some(Pe=>Pe.p.affectsStyle)&&(me+=G(A(this.terminal)._inputHandler._curAttrData)),this._clearPredictionState(),this._failedEmitter.fire(te);break e}}}if(ue(),q.eof||(me+=q.rest,this._clearPredictionState()),this._expected.length&&Ee!==this._expected[0].gen)for(const{p:te,gen:fe}of this._expected){if(fe!==this._expected[0].gen)break;te.affectsStyle&&this._style.expectIncomingStyle(),me+=te.apply(he,this.physicalCursor(he))}return this._showPredictions?(me.length===0||me===X||(this._physicalCursor&&(me+=this._physicalCursor.moveInstruction()),me=_+me+m),me):ie}_clearPredictionState(){this._expected=[],this.clearCursor(),this._lookBehind=void 0}addPrediction(X,oe){if(I("prediction type: \x1B[36m%s\x1B[0m",oe.constructor.name),this._expected.push({gen:this._currentGen,p:oe}),this._addedEmitter.fire(oe),this._currentGen!==this._expected[0].gen)return oe.apply(X,this.tentativeCursor(X)),!1;const ie=oe.apply(X,this.physicalCursor(X));return this._tenativeCursor=void 0,this._showPredictions&&ie&&(oe.affectsStyle&&this._style.expectIncomingStyle(),I("predict:",JSON.stringify(ie)),I("prediction type: \x1B[36m%s\x1B[0m",oe.constructor.name),this.terminal.write(ie)),!0}addBoundary(X,oe){let ie=!1;return X&&oe&&(ie=this.addPrediction(X,new O(oe)),oe.apply(X,this.tentativeCursor(X))),this._currentGen++,ie}peekEnd(){var X;return(X=this._expected[this._expected.length-1])===null||X===void 0?void 0:X.p}peekStart(){var X;return(X=this._expected[0])===null||X===void 0?void 0:X.p}physicalCursor(X){return this._physicalCursor||(this._showPredictions&&S(this.terminal),this._physicalCursor=new w(this.terminal.rows,this.terminal.cols,X)),this._physicalCursor}tentativeCursor(X){return this._tenativeCursor||(this._tenativeCursor=this.physicalCursor(X).clone()),this._tenativeCursor}clearCursor(){this._physicalCursor=void 0,this._tenativeCursor=void 0}_getActiveBuffer(){const X=this.terminal.buffer.active;return X.type==="normal"?X:void 0}}t.PredictionTimeline=j;const Q=Y=>{if(Y.isAttributeDefault())return[0];const X=[];return Y.isBold()&&X.push(1),Y.isDim()&&X.push(2),Y.isItalic()&&X.push(3),Y.isUnderline()&&X.push(4),Y.isBlink()&&X.push(5),Y.isInverse()&&X.push(7),Y.isInvisible()&&X.push(8),Y.isFgRGB()&&X.push(38,2,Y.getFgColor()>>>24,Y.getFgColor()>>>16&255,Y.getFgColor()&255),Y.isFgPalette()&&X.push(38,5,Y.getFgColor()),Y.isFgDefault()&&X.push(39),Y.isBgRGB()&&X.push(48,2,Y.getBgColor()>>>24,Y.getBgColor()>>>16&255,Y.getBgColor()&255),Y.isBgPalette()&&X.push(48,5,Y.getBgColor()),Y.isBgDefault()&&X.push(49),X},G=Y=>`${v}${Q(Y).join(";")}m`,Z=(Y,X,oe)=>{if(Y.length-X>oe.length)return!1;for(let ie=0;ie<oe.length;ie++,X++)if(oe[X]!==Y[X])return!1;return!0},$=(Y,X)=>{const oe=[0,0,-1,0,0,0];let ie=0,he=0;do{const me=Y[X+he];if(oe[he+ie]=typeof me=="number"?me:me[0],typeof me!="number"){let q=0;do oe[1]===5&&(ie=1),oe[he+q+1+ie]=me[q];while(++q<me.length&&q+he+1+ie<oe.length);break}if(oe[1]===5&&he+ie>=2||oe[1]===2&&he+ie>=5)break;oe[1]&&(ie=1)}while(++he+X<Y.length&&he+ie<oe.length);return he};class V{static _compileArgs(X){return`${v}${X.join(";")}m`}constructor(X,oe){this._terminal=oe,this._expectedIncomingStyles=0,this.onUpdate(X)}expectIncomingStyle(X=1){this._expectedIncomingStyles+=X*2}startTracking(){this._expectedIncomingStyles=0,this._onDidWriteSGR(Q(A(this._terminal)._inputHandler._curAttrData)),this._csiHandler=this._terminal.parser.registerCsiHandler({final:"m"},X=>(this._onDidWriteSGR(X),!1))}debounceStopTracking(){this._stopTracking()}dispose(){this._stopTracking()}_stopTracking(){var X;(X=this._csiHandler)===null||X===void 0||X.dispose(),this._csiHandler=void 0}_onDidWriteSGR(X){const oe=this._undoArgs;for(let ie=0;ie<X.length;){const he=X[ie],me=typeof he=="number"?he:he[0];if(this._expectedIncomingStyles){if(Z(X,ie,this._undoArgs)){this._expectedIncomingStyles--,ie+=this._undoArgs.length;continue}if(Z(X,ie,this._applyArgs)){this._expectedIncomingStyles--,ie+=this._applyArgs.length;continue}}const q=me===38||me===48||me===58?$(X,ie):1;switch(this._applyArgs[0]){case 1:me===2?this._undoArgs=[22,2]:(me===22||me===0)&&(this._undoArgs=[22]);break;case 2:me===1?this._undoArgs=[22,1]:(me===22||me===0)&&(this._undoArgs=[22]);break;case 38:me===0||me===39||me===100?this._undoArgs=[39]:(me>=30&&me<=38||me>=90&&me<=97)&&(this._undoArgs=X.slice(ie,ie+q));break;default:me===this._applyArgs[0]?this._undoArgs=this._applyArgs:me===0&&(this._undoArgs=this._originalUndoArgs)}ie+=q}oe!==this._undoArgs&&(this.undo=V._compileArgs(this._undoArgs))}onUpdate(X){const{applyArgs:oe,undoArgs:ie}=this._getArgs(X);this._applyArgs=oe,this._undoArgs=this._originalUndoArgs=ie,this.apply=V._compileArgs(this._applyArgs),this.undo=V._compileArgs(this._undoArgs)}_getArgs(X){switch(X){case"bold":return{applyArgs:[1],undoArgs:[22]};case"dim":return{applyArgs:[2],undoArgs:[22]};case"italic":return{applyArgs:[3],undoArgs:[23]};case"underlined":return{applyArgs:[4],undoArgs:[24]};case"inverted":return{applyArgs:[7],undoArgs:[27]};default:{let oe;try{oe=o.Color.fromHex(X)}catch{oe=new o.Color(new o.RGBA(255,0,0,1))}const{r:ie,g:he,b:me}=oe.rgba;return{applyArgs:[38,2,ie,he,me],undoArgs:[39]}}}}}n.__decorate([(0,r.debounce)(2e3),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],V.prototype,"debounceStopTracking",null);const H=(Y=t.DEFAULT_LOCAL_ECHO_EXCLUDE)=>new RegExp(`\\b(${Y.map(a).join("|")})\\b`,"i");class K extends r.Disposable{constructor(X,oe,ie){super(),this.onBeforeProcessData=X,this._config=oe,this.onDidTerminalPreferenceChange=ie,this._terminalTitle="",this.disposableCollection=new r.DisposableCollection,this._excludeProgramRe=H(this._config.localEchoExcludePrograms),this.addDispose(this.onDidTerminalPreferenceChange(he=>{var me;switch(he.preferenceName){case"terminal.integrated.localEchoLatencyThreshold":{he.newValue&&he.newValue!==this._config.localEchoLatencyThreshold&&(this._config.localEchoLatencyThreshold=he.newValue);break}case"terminal.integrated.localEchoExcludePrograms":{he.newValue&&he.newValue!==this._config.localEchoExcludePrograms&&(this._config.localEchoExcludePrograms=he.newValue,this._excludeProgramRe=H(this._config.localEchoExcludePrograms));break}case"terminal.integrated.localEchoStyle":{he.newValue!==this._config.localEchoStyle&&(this._config.localEchoStyle=he.newValue,(me=this._typeAheadStyle)===null||me===void 0||me.onUpdate(this._config.localEchoStyle));break}default:break}}))}_register(X){if(X===this)throw new Error("Cannot register a disposable on itself!");return this.disposableCollection.push(X),X}activate(X){I("#DEBUG1# activate terminal type ahead addon");const oe=this._typeAheadStyle=this._register(new V(this._config.localEchoStyle,X)),ie=this._timeline=new j(X,this._typeAheadStyle),he=this.stats=new W(this._timeline);ie.setShowPredictions(this._config.localEchoLatencyThreshold===0),this._register(X.onData(q=>this._onUserData(q))),this._register(X.onTitleChange(q=>{this._terminalTitle=q,this._reevaluatePredictorState(he,ie)})),this._register(X.onResize(()=>{ie.setShowPredictions(!1),ie.clearCursor(),this._reevaluatePredictorState(he,ie)})),this._register(this._timeline.onPredictionSucceeded(q=>{var Ee;((Ee=this._lastRow)===null||Ee===void 0?void 0:Ee.charState)===1&&(0,t.isTenativeCharacterPrediction)(q)&&q.inner.appliedAt&&q.inner.appliedAt.pos.y+q.inner.appliedAt.pos.baseY===this._lastRow.y&&(this._lastRow.charState=2)})),this.onBeforeProcessData(q=>this._onBeforeProcessData(q));let me;this._register(he.onChange(()=>{me||(me=setTimeout(()=>{this._sendLatencyStats(he),me=void 0},E)),ie.length===0&&oe.debounceStopTracking(),this._reevaluatePredictorState(he,ie)}))}reset(){this._lastRow=void 0}_deferClearingPredictions(){var X,oe;if(!(!this.stats||!this._timeline)){if((X=this._clearPredictionDebounce)===null||X===void 0||X.dispose(),this._timeline.length===0||((oe=this._timeline.peekStart())===null||oe===void 0?void 0:oe.clearAfterTimeout)===!1){this._clearPredictionDebounce=void 0;return}this._clearPredictionDebounce=(0,r.disposableTimeout)(()=>{var ie,he;(ie=this._timeline)===null||ie===void 0||ie.undoAllPredictions(),((he=this._lastRow)===null||he===void 0?void 0:he.charState)===1&&(this._lastRow.charState=0)},Math.max(500,this.stats.maxLatency*3/2))}}_reevaluatePredictorState(X,oe){this._reevaluatePredictorStateNow(X,oe)}_reevaluatePredictorStateNow(X,oe){if(this._excludeProgramRe.test(this._terminalTitle))oe.setShowPredictions(!1);else if(this._config.localEchoLatencyThreshold<0)oe.setShowPredictions(!1);else if(this._config.localEchoLatencyThreshold===0)oe.setShowPredictions(!0);else if(X.sampleSize>f&&X.accuracy>c){const ie=X.latency.median;ie>=this._config.localEchoLatencyThreshold?oe.setShowPredictions(!0):ie<this._config.localEchoLatencyThreshold/y&&oe.setShowPredictions(!1)}}_sendLatencyStats(X){console.log("terminalLatencyStats",{...X.latency,predictionAccuracy:X.accuracy})}_onUserData(X){var oe,ie,he,me;if(((oe=this._timeline)===null||oe===void 0?void 0:oe.terminal.buffer.active.type)!=="normal")return;I("user data:",JSON.stringify({data:X}));const q=this._timeline.terminal,Ee=q.buffer.active;if(Ee.cursorX===1&&Ee.cursorY===q.rows-1&&((he=(ie=Ee.getLine(Ee.cursorY+Ee.baseY))===null||ie===void 0?void 0:ie.getCell(0))===null||he===void 0?void 0:he.getChars())===":")return;const ue=Ee.baseY+Ee.cursorY;ue!==((me=this._lastRow)===null||me===void 0?void 0:me.y)?this._lastRow={y:ue,startingX:Ee.cursorX,endingX:Ee.cursorX,charState:0}:(this._lastRow.startingX=Math.min(this._lastRow.startingX,Ee.cursorX),this._lastRow.endingX=Math.max(this._lastRow.endingX,this._timeline.physicalCursor(Ee).x));const te=Me=>this._timeline.tentativeCursor(Ee).x<=this._lastRow.startingX?this._timeline.addBoundary(Ee,Me):this._timeline.addPrediction(Ee,Me),fe=Me=>this._timeline.tentativeCursor(Ee).x>=this._lastRow.endingX-1?this._timeline.addBoundary(Ee,Me):this._timeline.addPrediction(Ee,Me),Ie=new R(X);for(;Ie.remaining>0;){if(Ie.eatCharCode(127)){const Be=this._timeline.peekEnd();Be&&Be instanceof k&&this._timeline.addBoundary(),this._timeline.isShowingPredictions&&S(this._timeline.terminal),this._timeline.tentativeCursor(Ee).x<=this._lastRow.startingX?this._timeline.addBoundary(Ee,new F(this._timeline.terminal)):(this._lastRow.endingX--,this._timeline.addPrediction(Ee,new F(this._timeline.terminal)));continue}if(Ie.eatCharCode(32,126)){const Be=X[Ie.index-1],Pe=new k(this._typeAheadStyle,Be);this._lastRow.charState===0?(this._timeline.addBoundary(Ee,Pe),this._lastRow.charState=1):this._timeline.addPrediction(Ee,Pe),this._timeline.tentativeCursor(Ee).x>=q.cols&&this._timeline.addBoundary(Ee,new B);continue}const Me=Ie.eatRe(h);if(Me){const Be=Me[3],Pe=new U(Be,!!Me[2],Number(Me[1])||1);Be==="D"?te(Pe):fe(Pe);continue}if(Ie.eatStr(`${p}f`)){fe(new U("C",!0,1));continue}if(Ie.eatStr(`${p}b`)){te(new U("D",!0,1));continue}if(Ie.eatChar("\r")&&Ee.cursorY<q.rows-1){this._timeline.addPrediction(Ee,new L);continue}this._timeline.addBoundary(Ee,new P);break}this._timeline.length===1&&(this._deferClearingPredictions(),this._typeAheadStyle.startTracking())}_onBeforeProcessData(X){this._timeline&&(I("incoming data:",JSON.stringify(X.data)),X.data=this._timeline.beforeServerInput(X.data),I("emitted data:",JSON.stringify(X.data)),this._deferClearingPredictions())}}t.TypeAheadAddon=K,n.__decorate([(0,r.debounce)(100),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[W,j]),n.__metadata("design:returntype",void 0)],K.prototype,"_reevaluatePredictorState",null)},4636:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Color=t.HSVA=t.HSLA=t.RGBA=void 0;function e(p,v){const m=Math.pow(10,v);return Math.round(p*m)/m}class n{constructor(v,m,_,s=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,v))|0,this.g=Math.min(255,Math.max(0,m))|0,this.b=Math.min(255,Math.max(0,_))|0,this.a=e(Math.max(Math.min(1,s),0),3)}static equals(v,m){return v.r===m.r&&v.g===m.g&&v.b===m.b&&v.a===m.a}}t.RGBA=n;class r{constructor(v,m,_,s){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,v),0)|0,this.s=e(Math.max(Math.min(1,m),0),3),this.l=e(Math.max(Math.min(1,_),0),3),this.a=e(Math.max(Math.min(1,s),0),3)}static equals(v,m){return v.h===m.h&&v.s===m.s&&v.l===m.l&&v.a===m.a}static fromRGBA(v){const m=v.r/255,_=v.g/255,s=v.b/255,g=v.a,l=Math.max(m,_,s),h=Math.min(m,_,s);let u=0,d=0;const E=(h+l)/2,f=l-h;if(f>0){switch(d=Math.min(E<=.5?f/(2*E):f/(2-2*E),1),l){case m:u=(_-s)/f+(_<s?6:0);break;case _:u=(s-m)/f+2;break;case s:u=(m-_)/f+4;break}u*=60,u=Math.round(u)}return new r(u,d,E,g)}static _hue2rgb(v,m,_){return _<0&&(_+=1),_>1&&(_-=1),_<.16666666666666666?v+(m-v)*6*_:_<.5?m:_<.6666666666666666?v+(m-v)*(.6666666666666666-_)*6:v}static toRGBA(v){const m=v.h/360,{s:_,l:s,a:g}=v;let l,h,u;if(_===0)l=h=u=s;else{const d=s<.5?s*(1+_):s+_-s*_,E=2*s-d;l=r._hue2rgb(E,d,m+.3333333333333333),h=r._hue2rgb(E,d,m),u=r._hue2rgb(E,d,m-.3333333333333333)}return new n(Math.round(l*255),Math.round(h*255),Math.round(u*255),g)}}t.HSLA=r;class o{constructor(v,m,_,s){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,v),0)|0,this.s=e(Math.max(Math.min(1,m),0),3),this.v=e(Math.max(Math.min(1,_),0),3),this.a=e(Math.max(Math.min(1,s),0),3)}static equals(v,m){return v.h===m.h&&v.s===m.s&&v.v===m.v&&v.a===m.a}static fromRGBA(v){const m=v.r/255,_=v.g/255,s=v.b/255,g=Math.max(m,_,s),l=Math.min(m,_,s),h=g-l,u=g===0?0:h/g;let d;return h===0?d=0:g===m?d=((_-s)/h%6+6)%6:g===_?d=(s-m)/h+2:d=(m-_)/h+4,new o(Math.round(d*60),u,g,v.a)}static toRGBA(v){const{h:m,s:_,v:s,a:g}=v,l=s*_,h=l*(1-Math.abs(m/60%2-1)),u=s-l;let[d,E,f]=[0,0,0];return m<60?(d=l,E=h):m<120?(d=h,E=l):m<180?(E=l,f=h):m<240?(E=h,f=l):m<300?(d=h,f=l):m<=360&&(d=l,f=h),d=Math.round((d+u)*255),E=Math.round((E+u)*255),f=Math.round((f+u)*255),new n(d,E,f,g)}}t.HSVA=o;class a{static fromHex(v){return a.Format.CSS.parseHex(v)||a.red}get hsla(){return this._hsla?this._hsla:r.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:o.fromRGBA(this.rgba)}constructor(v){if(v)if(v instanceof n)this.rgba=v;else if(v instanceof r)this._hsla=v,this.rgba=r.toRGBA(v);else if(v instanceof o)this._hsva=v,this.rgba=o.toRGBA(v);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(v){return!!v&&n.equals(this.rgba,v.rgba)&&r.equals(this.hsla,v.hsla)&&o.equals(this.hsva,v.hsva)}getRelativeLuminance(){const v=a._relativeLuminanceForComponent(this.rgba.r),m=a._relativeLuminanceForComponent(this.rgba.g),_=a._relativeLuminanceForComponent(this.rgba.b),s=.2126*v+.7152*m+.0722*_;return e(s,4)}static _relativeLuminanceForComponent(v){const m=v/255;return m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4)}getContrastRatio(v){const m=this.getRelativeLuminance(),_=v.getRelativeLuminance();return m>_?(m+.05)/(_+.05):(_+.05)/(m+.05)}isDarker(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3<128}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(v){const m=this.getRelativeLuminance(),_=v.getRelativeLuminance();return m>_}isDarkerThan(v){const m=this.getRelativeLuminance(),_=v.getRelativeLuminance();return m<_}lighten(v){return new a(new r(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*v,this.hsla.a))}darken(v){return new a(new r(this.hsla.h,this.hsla.s,this.hsla.l-this.hsla.l*v,this.hsla.a))}transparent(v){const{r:m,g:_,b:s,a:g}=this.rgba;return new a(new n(m,_,s,g*v))}isTransparent(){return this.rgba.a===0}isOpaque(){return this.rgba.a===1}opposite(){return new a(new n(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}blend(v){const m=v.rgba,_=this.rgba.a,s=m.a,g=_+s*(1-_);if(g<1e-6)return a.transparent;const l=this.rgba.r*_/g+m.r*s*(1-_)/g,h=this.rgba.g*_/g+m.g*s*(1-_)/g,u=this.rgba.b*_/g+m.b*s*(1-_)/g;return new a(new n(l,h,u,g))}makeOpaque(v){if(this.isOpaque()||v.rgba.a!==1)return this;const{r:m,g:_,b:s,a:g}=this.rgba;return new a(new n(v.rgba.r-g*(v.rgba.r-m),v.rgba.g-g*(v.rgba.g-_),v.rgba.b-g*(v.rgba.b-s),1))}flatten(...v){const m=v.reduceRight((_,s)=>a._flatten(s,_));return a._flatten(this,m)}static _flatten(v,m){const _=1-v.rgba.a;return new a(new n(_*m.rgba.r+v.rgba.a*v.rgba.r,_*m.rgba.g+v.rgba.a*v.rgba.g,_*m.rgba.b+v.rgba.a*v.rgba.b))}toString(){return this._toString||(this._toString=a.Format.CSS.format(this)),this._toString}static getLighterColor(v,m,_){if(v.isLighterThan(m))return v;_=_||.5;const s=v.getRelativeLuminance(),g=m.getRelativeLuminance();return _=_*(g-s)/g,v.lighten(_)}static getDarkerColor(v,m,_){if(v.isDarkerThan(m))return v;_=_||.5;const s=v.getRelativeLuminance(),g=m.getRelativeLuminance();return _=_*(s-g)/s,v.darken(_)}}t.Color=a,a.white=new a(new n(255,255,255,1)),a.black=new a(new n(0,0,0,1)),a.red=new a(new n(255,0,0,1)),a.blue=new a(new n(0,0,255,1)),a.green=new a(new n(0,255,0,1)),a.cyan=new a(new n(0,255,255,1)),a.lightgrey=new a(new n(211,211,211,1)),a.transparent=new a(new n(0,0,0,0)),function(p){let v;(function(m){let _;(function(s){function g(A){return A.rgba.a===1?`rgb(${A.rgba.r}, ${A.rgba.g}, ${A.rgba.b})`:p.Format.CSS.formatRGBA(A)}s.formatRGB=g;function l(A){return`rgba(${A.rgba.r}, ${A.rgba.g}, ${A.rgba.b}, ${+A.rgba.a.toFixed(2)})`}s.formatRGBA=l;function h(A){return A.hsla.a===1?`hsl(${A.hsla.h}, ${(A.hsla.s*100).toFixed(2)}%, ${(A.hsla.l*100).toFixed(2)}%)`:p.Format.CSS.formatHSLA(A)}s.formatHSL=h;function u(A){return`hsla(${A.hsla.h}, ${(A.hsla.s*100).toFixed(2)}%, ${(A.hsla.l*100).toFixed(2)}%, ${A.hsla.a.toFixed(2)})`}s.formatHSLA=u;function d(A){const S=A.toString(16);return S.length!==2?"0"+S:S}function E(A){return`#${d(A.rgba.r)}${d(A.rgba.g)}${d(A.rgba.b)}`}s.formatHex=E;function f(A,S=!1){return S&&A.rgba.a===1?p.Format.CSS.formatHex(A):`#${d(A.rgba.r)}${d(A.rgba.g)}${d(A.rgba.b)}${d(Math.round(A.rgba.a*255))}`}s.formatHexA=f;function c(A){return A.isOpaque()?p.Format.CSS.formatHex(A):p.Format.CSS.formatRGBA(A)}s.format=c;function y(A){const S=A.length;if(S===0||A.charCodeAt(0)!==35)return null;if(S===7){const D=16*b(A.charCodeAt(1))+b(A.charCodeAt(2)),I=16*b(A.charCodeAt(3))+b(A.charCodeAt(4)),w=16*b(A.charCodeAt(5))+b(A.charCodeAt(6));return new p(new n(D,I,w,1))}if(S===9){const D=16*b(A.charCodeAt(1))+b(A.charCodeAt(2)),I=16*b(A.charCodeAt(3))+b(A.charCodeAt(4)),w=16*b(A.charCodeAt(5))+b(A.charCodeAt(6)),T=16*b(A.charCodeAt(7))+b(A.charCodeAt(8));return new p(new n(D,I,w,T/255))}if(S===4){const D=b(A.charCodeAt(1)),I=b(A.charCodeAt(2)),w=b(A.charCodeAt(3));return new p(new n(16*D+D,16*I+I,16*w+w))}if(S===5){const D=b(A.charCodeAt(1)),I=b(A.charCodeAt(2)),w=b(A.charCodeAt(3)),T=b(A.charCodeAt(4));return new p(new n(16*D+D,16*I+I,16*w+w,(16*T+T)/255))}return null}s.parseHex=y;function b(A){switch(A){case 48:return 0;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case 97:return 10;case 65:return 10;case 98:return 11;case 66:return 11;case 99:return 12;case 67:return 12;case 100:return 13;case 68:return 13;case 101:return 14;case 69:return 14;case 102:return 15;case 70:return 15}return 0}})(_=m.CSS||(m.CSS={}))})(v=p.Format||(p.Format={}))}(a||(t.Color=a={}))},68611:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalGroupViewService=t.WidgetGroup=t.Widget=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(28423),p=e(26405);class v extends o.Disposable{constructor(g,l=!1,h=!1){super(),this.id=g,this.reuse=l,this.recovery=h,this.dynamic=(0,a.observableValue)(this,0),this.shadowDynamic=(0,a.observableValue)(this,0),this.name=(0,a.observableValue)(this,""),this.processName=(0,a.observableValue)(this,""),this._onRender=new o.Emitter,this._onResize=new o.Emitter,this._onShow=new o.Emitter,this._onError=new o.Emitter,this.onRender=this._onRender.event,this.onResize=this._onResize.event,this.onShow=this._onShow.event,this.onError=this._onError.event}get group(){return this._group}set group(g){this._group=g,g.addWidget(this)}get element(){return this._element}set element(g){this._element||(this._element=g,this._onRender.fire())}get show(){return this._show}set show(g){this._show=g,this._onShow.fire(g)}get error(){return this._error}set error(g){this._error=g,this._onError.fire(g)}resize(g){(0,a.transaction)(l=>{const h=g||this.shadowDynamic.get();this.dynamic.set(h,l),this.shadowDynamic.set(h,l)}),this._onResize.fire()}increase(g){(0,a.transaction)(l=>{const h=this.shadowDynamic.get();this.shadowDynamic.set(h+g,l)}),this._onResize.fire()}rename(g){(0,a.transaction)(l=>{this.name.set(g,l)})}}t.Widget=v;class m extends o.Disposable{constructor(g,l){super(),this.widgets=(0,a.observableValue)(this,[]),this.editable=(0,a.observableValue)(this,!1),this.activated=(0,a.observableValue)(this,!1),this.name=(0,a.observableValue)(this,""),this.currentId=(0,a.observableValue)(this,""),this.widgetsMap=new Map,this.current=(0,a.derived)(this,h=>{const u=this.currentId.read(h);return this.widgetsMap.get(u)}),this.snapshot=(0,a.derived)(this,h=>{const u=this.current.read(h);return this.name.read(h)||u?.name.read(h)||u?.processName.read(h)||""}),this._id=g||(0,p.userActionViewUuid)(),this._options=l||{},this._activated=!1}get id(){return this._id}get options(){return this._options}get length(){return this.widgets.get().length}get first(){return this.widgets.get()[0]}get last(){return this.widgets.get()[this.length-1]}addWidget(g){(0,a.transaction)(l=>{const h=this.widgets.get();this.widgets.set([...h,g],l)}),this.widgetsMap.set(g.id,g),this.currentId.get()||(0,a.transaction)(l=>{this.currentId.set(g.id,l)}),this._averageLayout()}findWidget(g){return this.widgets.get().findIndex(l=>l.id===g.id)}selectWidget(g){(0,a.transaction)(l=>{this.currentId.set(g.id,l)})}removeWidgetByIndex(g){const l=this.widgets.get(),h=l.splice(g,1);return this.widgetsMap.delete(h[0].id),(0,a.transaction)(u=>{this.widgets.set(l.filter(d=>d!==h[0]),u)}),this._averageLayout(),this.last&&this.selectWidget(this.last),h[0]}edit(){(0,a.transaction)(g=>{this.editable.set(!0,g)})}unedit(){(0,a.transaction)(g=>{this.editable.set(!1,g)})}rename(g){(0,a.transaction)(l=>{this.name.set(g,l),this.editable.set(!1,l)})}_isLast(g){return g.id===this.widgets.get()[this.widgets.get().length-1].id}_averageLayout(){const g=Math.round(m.whole/this.widgets.get().length*m.float)/m.float;this.widgets.get().forEach(l=>{this._isLast(l)?l.resize(m.whole-g*(this.widgets.get().length-1)):l.resize(g)})}}t.WidgetGroup=m,m.whole=100,m.float=1e3;let _=class{constructor(){this._widgets=new Map,this.groups=(0,a.observableValue)(this,[]),this.currentGroupIndex=(0,a.observableValue)(this,-1),this.currentGroupId=(0,a.observableValue)(this,""),this._onWidgetCreated=new o.Emitter,this._onWidgetSelected=new o.Emitter,this._onWidgetDisposed=new o.Emitter,this._onWidgetEmpty=new o.Emitter,this.currentGroup=(0,a.derived)(this,g=>{const l=this.groups.read(g),h=this.currentGroupIndex.read(g);return l[h]}),this.currentWidget=(0,a.derived)(this,g=>{const l=this.currentGroup.read(g);return l&&this.getWidget(l.currentId.read(g))}),this.currentWidgetId=(0,a.derived)(this,g=>{const l=this.currentGroup.read(g);return l&&l.currentId.read(g)}),this.onWidgetCreated=this._onWidgetCreated.event,this.onWidgetSelected=this._onWidgetSelected.event,this.onWidgetDisposed=this._onWidgetDisposed.event,this.onWidgetEmpty=this._onWidgetEmpty.event}getGroup(g){if(g>this.groups.get().length-1)throw new Error("out of groups length");return this.groups.get()[g]}swapGroup(g,l){const h=this.groups.get();if(g===-1||l===-1)return;const u=[...h],d=u[g];u[g]=u[l],u[l]=d,(0,a.transaction)(E=>{this.groups.set(u,E)})}_doSelectGroup(g){const l=this.getGroup(g);(0,a.transaction)(u=>{this.currentGroupIndex.set(g,u),this.currentGroupId.set(l.id,u),l.activated.set(!0,u)}),!l.current&&l.first&&l.selectWidget(l.first);const h=l.current.get();h&&(this._onWidgetSelected.fire(h),this.resize())}selectGroup(g){this._doSelectGroup(g)}_doCreateGroup(g,l){const h=new m(g,l);return(0,a.transaction)(u=>{const d=this.groups.get();this.groups.set([...d,h],u)}),this.groups.get().length-1}createGroup(g){const l=this._doCreateGroup(void 0,g);return this.getGroup(l),l}_checkIfEmpty(g){if(this.empty())this._onWidgetEmpty.fire();else{const l=this.currentGroupIndex.get();g===l&&this._doSelectGroup(this.groups.get().length-1),g<l&&this._doSelectGroup(l-1)}}_doRemoveGroup(g){const l=this.groups.get(),[h]=l.splice(g,1);h&&(h.widgets.get().forEach(u=>{this._widgets.delete(u.id),u.dispose(),this._onWidgetDisposed.fire(u)}),h.dispose(),(0,a.transaction)(u=>{this.groups.set(l.filter(d=>d.id!==h.id),u)})),this._checkIfEmpty(g)}removeGroup(g){this._doRemoveGroup(g)}getWidget(g){const l=this._widgets.get(g);if(!l)throw new Error("not find this widget");return l}selectWidget(g){const l=this.getWidget(g),h=l.group,u=this.groups.get().findIndex(d=>d.id===h.id);h.selectWidget(l),this.selectGroup(u)}createWidget(g,l,h,u=!1,d=!1){const E=new v(l||this.service.generateSessionId(),h,d);return this._widgets.set(E.id,E),E.group=g,u||this._onWidgetCreated.fire(E),E}_checkIfGroupEmpty(g){this.getGroup(g).length===0&&this._doRemoveGroup(g)}removeWidget(g){const l=this.getWidget(g),h=l.group,u=this.groups.get().findIndex(f=>h.id===f.id),d=h.findWidget(l);h.removeWidgetByIndex(d),this._widgets.delete(g),l.dispose(),this._onWidgetDisposed.fire(l),this._checkIfGroupEmpty(u);const E=h.current.get();E&&this._onWidgetSelected.fire(E)}resize(){const g=this.currentGroup.get();g&&g.widgets.get().forEach(l=>{l.resize()})}empty(){return this._widgets.size===0}clear(){(0,a.transaction)(g=>{this.groups.set([],g)}),this._widgets.clear(),this._onWidgetEmpty.fire()}};t.TerminalGroupViewService=_,n.__decorate([(0,r.Autowired)(p.ITerminalInternalService),n.__metadata("design:type",Object)],_.prototype,"service",void 0),t.TerminalGroupViewService=_=n.__decorate([(0,r.Injectable)()],_)},41685:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XTerm=void 0;const n=e(85608),r=e(95643),o=e(98239),a=e(87083),p=e(76003),v=e(41869),m=e(67889),_=e(43718),s=e(75124),g=e(9132),l=e(68179),h=e(42912),u=e(25655),d=n.__importDefault(e(73567)),E=e(43395);let f=class extends _.Disposable{constructor(y){super(),this.options=y,this.container=document.createElement("div"),this.container.className=d.default.terminalInstance,this.xtermOptions=y.xtermOptions,this.raw=new a.Terminal({allowProposedApi:!0,...this.xtermOptions}),this._prepareAddons(),this.raw.onSelectionChange(this.onSelectionChange.bind(this))}async enableCanvasRenderer(){try{this._canvasAddon||(this._canvasAddon=new(await e.e(359).then(e.t.bind(e,67359,23))).CanvasAddon),this.addDispose(this._canvasAddon),this.raw.loadAddon(this._canvasAddon),this._webglAddon&&(this._webglAddon.dispose(),this._webglAddon=void 0)}catch{}}async enableWebglRenderer(){try{this._webglAddon||(this._webglAddon=new(await e.e(151).then(e.t.bind(e,42151,23))).WebglAddon),this.addDispose(this._webglAddon),this.addDispose(this._webglAddon.onContextLoss(()=>{this.raw.options.rendererType="dom"})),this.raw.loadAddon(this._webglAddon),this._canvasAddon&&(this._canvasAddon.dispose(),this._canvasAddon=void 0)}catch{await this.enableCanvasRenderer()}}async _prepareAddons(){this._searchAddon=new o.SearchAddon,this._fitAddon=new r.FitAddon,this.addDispose([this._searchAddon,this._fitAddon]),this.raw.loadAddon(this._searchAddon),this.raw.loadAddon(this._fitAddon)}updateTheme(y){y&&(this.raw.options.theme=y,this.xtermOptions={...this.xtermOptions,theme:y})}updatePreferences(y){this.xtermOptions={...this.xtermOptions,...y}}getFindColors(){const y=this.themeService.getCurrentThemeSync(),b=y.getColor(E.TERMINAL_BACKGROUND_COLOR)||y.getColor(l.PANEL_BACKGROUND),A=y.getColor(E.TERMINAL_FIND_MATCH_BACKGROUND_COLOR),S=y.getColor(E.TERMINAL_FIND_MATCH_BORDER_COLOR),D=y.getColor(E.TERMINAL_OVERVIEW_RULER_CURSOR_FOREGROUND_COLOR),I=y.getColor(E.TERMINAL_FIND_MATCH_HIGHLIGHT_BACKGROUND_COLOR),w=y.getColor(E.TERMINAL_FIND_MATCH_HIGHLIGHT_BORDER_COLOR),T=y.getColor(E.TERMINAL_OVERVIEW_RULER_FIND_MATCH_FOREGROUND_COLOR);return{activeMatchBackground:A?.toString(),activeMatchBorder:S?.toString()||"transparent",activeMatchColorOverviewRuler:D?.toString()||"transparent",matchBackground:b?I?.blend(b).toString():void 0,matchBorder:w?.toString()||"transparent",matchOverviewRuler:T?.toString()||"transparent"}}findNext(y,b={}){const A={decorations:this.getFindColors(),...b};return this._searchAddon.findNext(y,A)}findPrevious(y,b={}){const A={decorations:this.getFindColors(),...b};return this._searchAddon.findPrevious(y,A)}get onSearchResultsChange(){return this._searchAddon.onDidChangeResults}closeSearch(){this._searchAddon.clearDecorations()}open(){this.raw.open(this.container);const y=this.preferenceService.get("terminal.integrated.xtermRenderType",u.RenderType.WebGL);y===u.RenderType.WebGL?this.enableWebglRenderer():y===u.RenderType.Canvas&&this.enableCanvasRenderer()}fit(){this._fitAddon.fit()}async onSelectionChange(){var y;!((y=this.xtermOptions)===null||y===void 0)&&y.copyOnSelection&&this.raw.hasSelection()&&await this.copySelection()}async copySelection(){this.raw.hasSelection()?await this.clipboardService.writeText(this.raw.getSelection()):this.messageService.warning("The terminal has no selection to copy")}dispose(){this.raw.dispose(),this.container.remove()}};t.XTerm=f,n.__decorate([(0,p.Autowired)(p.INJECTOR_TOKEN),n.__metadata("design:type",p.Injector)],f.prototype,"injector",void 0),n.__decorate([(0,p.Autowired)(s.MessageService),n.__metadata("design:type",s.MessageService)],f.prototype,"messageService",void 0),n.__decorate([(0,p.Autowired)(v.IClipboardService),n.__metadata("design:type",Object)],f.prototype,"clipboardService",void 0),n.__decorate([(0,p.Autowired)(h.IThemeService),n.__metadata("design:type",g.WorkbenchThemeService)],f.prototype,"themeService",void 0),n.__decorate([(0,p.Autowired)(m.PreferenceService),n.__metadata("design:type",Object)],f.prototype,"preferenceService",void 0),t.XTerm=f=n.__decorate([(0,p.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object])],f)},78453:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITerminalApiService=void 0,t.ITerminalApiService=Symbol("ITerminalApiService")},68830:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TERMINAL_ID_SEPARATOR=t.ITerminalClientFactory2=void 0,t.ITerminalClientFactory2=Symbol("ITerminalClientFactory2"),t.TERMINAL_ID_SEPARATOR="|"},7473:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITerminalHoverManagerService=t.ITerminalGroupViewService=t.ITerminalSearchService=t.ITerminalController=void 0,t.ITerminalController=Symbol("ITerminalController"),t.ITerminalSearchService=Symbol("ITerminalSearchService"),t.ITerminalGroupViewService=Symbol("ITerminalGroupViewService"),t.ITerminalHoverManagerService=Symbol("ITerminalHoverManagerService")},94620:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EnvironmentVariableMutatorType=t.EnvironmentVariableServiceToken=void 0,t.mutatorTypeLabel=e,t.serializeEnvironmentVariableCollection=r,t.deserializeEnvironmentVariableCollection=o,t.EnvironmentVariableServiceToken=Symbol("EnvironmentVariableServiceToken");function e(a,p,v){switch(a){case n.Prepend:return`${v}=${p}\${env:${v}}`;case n.Append:return`${v}=\${env:${v}}${p}`;default:return`${v}=${p}`}}var n;(function(a){a[a.Replace=1]="Replace",a[a.Append=2]="Append",a[a.Prepend=3]="Prepend"})(n||(t.EnvironmentVariableMutatorType=n={}));function r(a){return[...a.entries()]}function o(a){return new Map(a)}},12404:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MergedEnvironmentVariableCollection=void 0;const n=e(43718),r=e(94620);class o{constructor(m){this.map=new Map,m.forEach((_,s)=>{const g=_.map.entries();let l=g.next();for(;!l.done;){const h=l.value[0];let u=this.map.get(h);if(u||(u=[],this.map.set(h,u)),u.length>0&&u[0].type===r.EnvironmentVariableMutatorType.Replace){l=g.next();continue}const d=l.value[1];u.unshift({extensionIdentifier:s,value:d.value,type:d.type,options:d.options}),l=g.next()}})}async applyToProcessEnvironment(m,_,s){let g;_===n.OperatingSystem.Windows&&(g={},Object.keys(m).forEach(l=>g[l.toLowerCase()]=l)),this.map.forEach((l,h)=>{const u=_===n.OperatingSystem.Windows&&g[h.toLowerCase()]||h;l.forEach(async d=>{var E,f;if(!((f=(E=d.options)===null||E===void 0?void 0:E.applyAtProcessCreation)!==null&&f!==void 0)||f){const c=s?await s(d.value):d.value;switch(d.type){case r.EnvironmentVariableMutatorType.Append:m[u]=(m[u]||"")+c;break;case r.EnvironmentVariableMutatorType.Prepend:m[u]=c+(m[u]||"");break;case r.EnvironmentVariableMutatorType.Replace:m[u]=c;break}}})})}diff(m){const _=new Map,s=new Map,g=new Map;if(m.map.forEach((l,h)=>{const u=this.map.get(h),d=a(l,u);d&&_.set(h,d)}),this.map.forEach((l,h)=>{const u=m.map.get(h),d=a(l,u);d&&g.set(h,d)}),this.map.forEach((l,h)=>{const u=m.map.get(h),d=p(l,u);d&&s.set(h,d)}),!(_.size===0&&s.size===0&&g.size===0))return{added:_,changed:s,removed:g}}}t.MergedEnvironmentVariableCollection=o;function a(v,m){if(!m)return v;const _=new Set;m.forEach(g=>_.add(g.extensionIdentifier));const s=[];return v.forEach(g=>{_.has(g.extensionIdentifier)||s.push(g)}),s.length===0?void 0:s}function p(v,m){if(!m)return;const _=new Map;m.forEach(g=>_.set(g.extensionIdentifier,g));const s=[];return v.forEach(g=>{const l=_.get(g.extensionIdentifier);l&&(g.type!==l.type||g.value!==l.value)&&s.push(l)}),s.length===0?void 0:s}},19599:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITerminalErrorService=t.ETerminalErrorType=void 0,t.isTerminalError=n;var e;(function(r){r[r.CREATE_FAIL=0]="CREATE_FAIL"})(e||(t.ETerminalErrorType=e={}));function n(r){return r.message!==void 0}t.ITerminalErrorService=Symbol("ITerminalErrorService")},84876:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalLocation=t.TerminalDataBufferer=void 0;class e{constructor(o){this._callback=o,this._terminalBufferMap=new Map}dispose(){for(const o of this._terminalBufferMap.values())o.dispose()}startBuffering(o,a,p=5){let v;return v=a(m=>{const _=typeof m=="string"?m:m.data;let s=this._terminalBufferMap.get(o);if(s){s.data.push(_);return}const g=setTimeout(()=>this._flushBuffer(o),p);s={data:[_],timeoutId:g,dispose:()=>{clearTimeout(g),this._flushBuffer(o),v.dispose()}},this._terminalBufferMap.set(o,s)}),v}stopBuffering(o){const a=this._terminalBufferMap.get(o);a&&a.dispose()}_flushBuffer(o){const a=this._terminalBufferMap.get(o);a&&(this._terminalBufferMap.delete(o),this._callback(o,a.data.join("")))}}t.TerminalDataBufferer=e;var n;(function(r){r[r.Panel=1]="Panel",r[r.Editor=2]="Editor"})(n||(t.TerminalLocation=n={}))},26405:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(7473),t),n.__exportStar(e(59381),t),n.__exportStar(e(18171),t),n.__exportStar(e(19599),t),n.__exportStar(e(30354),t),n.__exportStar(e(38022),t),n.__exportStar(e(68830),t),n.__exportStar(e(78453),t),n.__exportStar(e(30076),t),n.__exportStar(e(16992),t),n.__exportStar(e(2853),t),n.__exportStar(e(84876),t),n.__exportStar(e(27155),t),n.__exportStar(e(15432),t),n.__exportStar(e(85504),t),n.__exportStar(e(38352),t)},15432:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinkComputer=t.StateMachine=t.Uint8Matrix=void 0,t.computeLinks=s;const n=e(43718);class r{constructor(l,h,u){const d=new Uint8Array(l*h);for(let E=0,f=l*h;E<f;E++)d[E]=u;this._data=d,this.rows=l,this.cols=h}get(l,h){return this._data[l*this.cols+h]}set(l,h,u){this._data[l*this.cols+h]=u}}t.Uint8Matrix=r;class o{constructor(l){let h=0,u=0;for(let E=0,f=l.length;E<f;E++){const[c,y,b]=l[E];y>h&&(h=y),c>u&&(u=c),b>u&&(u=b)}h++,u++;const d=new r(u,h,0);for(let E=0,f=l.length;E<f;E++){const[c,y,b]=l[E];d.set(c,y,b)}this._states=d,this._maxCharCode=h}nextState(l,h){return h<0||h>=this._maxCharCode?0:this._states.get(l,h)}}t.StateMachine=o;let a=null;function p(){return a===null&&(a=new o([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),a}let v=null;function m(){if(v===null){v=new n.CharacterClassifier(0);const g=` <>'"\u3001\u3002\uFF61\uFF64\uFF0C\uFF0E\uFF1A\uFF1B\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\uFF08\uFF3B\uFF5B\uFF62\uFF63\uFF5D\uFF3D\uFF09\u3015\u3011\u300F\u300D\u300B\u3009\u201D\u2019\uFF40\uFF5E\u2026`;for(let h=0;h<g.length;h++)v.set(g.charCodeAt(h),1);const l=".,;";for(let h=0;h<l.length;h++)v.set(l.charCodeAt(h),2)}return v}class _{static _createLink(l,h,u,d,E){let f=E-1;do{const c=h.charCodeAt(f);if(l.get(c)!==2)break;f--}while(f>d);if(d>0){const c=h.charCodeAt(d-1),y=h.charCodeAt(f);(c===40&&y===41||c===91&&y===93||c===123&&y===125)&&f--}return{range:{startLineNumber:u,startColumn:d+1,endLineNumber:u,endColumn:f+2},url:h.substring(d,f+1)}}static computeLinks(l,h=p()){const u=m(),d=[];for(let E=1,f=l.getLineCount();E<=f;E++){const c=l.getLineContent(E),y=c.length;let b=0,A=0,S=0,D=1,I=!1,w=!1,T=!1,R=!1;for(;b<y;){let P=!1;const O=c.charCodeAt(b);if(D===13){let M;switch(O){case 40:I=!0,M=0;break;case 41:M=I?0:1;break;case 91:T=!0,w=!0,M=0;break;case 93:T=!1,M=w?0:1;break;case 123:R=!0,M=0;break;case 125:M=R?0:1;break;case 39:M=S===34||S===96?0:1;break;case 34:M=S===39||S===96?0:1;break;case 96:M=S===39||S===34?0:1;break;case 42:M=S===42?1:0;break;case 124:M=S===124?1:0;break;case 32:M=T?0:1;break;default:M=u.get(O)}M===1&&(d.push(_._createLink(u,c,E,A,b)),P=!0)}else if(D===12){let M;O===91?(w=!0,M=0):M=u.get(O),M===1?P=!0:D=13}else D=h.nextState(D,O),D===0&&(P=!0);P&&(D=1,I=!1,w=!1,R=!1,A=b+1,S=O),b++}D===13&&d.push(_._createLink(u,c,E,A,y))}return d}}t.LinkComputer=_;function s(g){return!g||typeof g.getLineCount!="function"||typeof g.getLineContent!="function"?[]:_.computeLinks(g)}},27155:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalNetworkStatus=t.ITerminalNetwork=void 0,t.ITerminalNetwork=Symbol("ITerminalNetwork");var e;(function(n){n[n.DISCONNECTED=0]="DISCONNECTED",n[n.CONNECTED=1]="CONNECTED"})(e||(t.TerminalNetworkStatus=e={}))},3276:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.terminalPreferenceSchema=t.TerminalCursorStyle=t.SupportedOptionsName=t.ITerminalPreference=void 0;const n=e(43718),r=e(25655);t.ITerminalPreference=Symbol("ITerminalPreference"),t.SupportedOptionsName={type:"type",fontFamily:"fontFamily",fontSize:"fontSize",fontWeight:"fontWeight",lineHeight:"lineHeight",cursorBlink:"cursorBlink",scrollback:"scrollback",copyOnSelection:"copyOnSelection",cursorStyle:"cursorStyle"},t.TerminalCursorStyle={BLOCK:"block",LINE:"line",UNDERLINE:"underline"};const o=(0,n.localize)("terminal.integrated.shell.linux.deprecation","This is deprecated, the new recommended way to configure your default shell is by creating a terminal profile in {0} and setting its profile name as the default in {1}. This will currently take priority over the new profiles settings but that will change in the future.","`#terminal.integrated.profiles.linux#`"),a=(0,n.localize)("terminal.integrated.shell.osx.deprecation","This is deprecated, the new recommended way to configure your default shell is by creating a terminal profile in {0} and setting its profile name as the default in {1}. This will currently take priority over the new profiles settings but that will change in the future.","`#terminal.integrated.profiles.osx#`"),p=(0,n.localize)("terminal.integrated.shell.windows.deprecation","This is deprecated, the new recommended way to configure your default shell is by creating a terminal profile in {0} and setting its profile name as the default in {1}. This will currently take priority over the new profiles settings but that will change in the future.","`#terminal.integrated.profiles.windows#`");t.terminalPreferenceSchema={type:"object",properties:{"terminal.type":{type:"string",enum:["zsh","bash","sh","default"],default:"default",description:"%preference.terminal.typeDesc%"},"terminal.fontFamily":{type:"string"},"terminal.fontSize":{type:"number",default:12},"terminal.fontWeight":{type:"string",enum:["normal","bold"],default:400},"terminal.lineHeight":{type:"number",default:1},"terminal.cursorBlink":{type:"boolean",default:!1},"terminal.scrollback":{type:"number",default:1e3},"terminal.integrated.shellArgs.linux":{type:"array",default:[],description:"%preference.terminal.integrated.shellArgs.linuxDesc%",markdownDeprecationMessage:o},"terminal.integrated.shellArgs.osx":{type:"array",default:[],markdownDeprecationMessage:a},"terminal.integrated.shellArgs.windows":{type:"array",default:[],markdownDeprecationMessage:p},"terminal.integrated.profiles.windows":{restricted:!0,markdownDescription:(0,n.localize)("terminal.integrated.profiles.windows",'The Windows profiles to present when creating a new terminal via the terminal dropdown. Use the `path` property to automatically detect the shell\'s location. Or set the {1} property manually with an optional `args`.\n\nSet an existing profile to `null` to hide the profile from the list, for example: `"Ubuntu-20.04 (WSL)": null`.'),type:"object",default:{}},"terminal.integrated.profiles.osx":{restricted:!0,markdownDescription:(0,n.localize)("terminal.integrated.profile.osx",'The macOS profiles to present when creating a new terminal via the terminal dropdown. Set the `path` property manually with an optional `args`.\n\nSet an existing profile to `null` to hide the profile from the list, for example: `"bash": null`.'),type:"object",default:{bash:{path:"bash",args:["-l"]},zsh:{path:"zsh",args:["-l"]},fish:{path:"fish",args:["-l"]},tmux:{path:"tmux"},pwsh:{path:"pwsh"}}},"terminal.integrated.profiles.linux":{restricted:!0,markdownDescription:(0,n.localize)("terminal.integrated.profile.linux",'The Linux profiles to present when creating a new terminal via the terminal dropdown. Set the `path` property manually with an optional `args`.\n\nSet an existing profile to `null` to hide the profile from the list, for example: `"bash": null`.'),type:"object",default:{bash:{path:"bash",icon:"terminal-bash"},zsh:{path:"zsh"},fish:{path:"fish"},tmux:{path:"tmux",icon:"terminal-tmux"},pwsh:{path:"pwsh",icon:"terminal-powershell"}}},"terminal.integrated.defaultProfile.linux":{restricted:!0,markdownDescription:(0,n.localize)("terminal.integrated.defaultProfile.linux","The default profile used on Linux. This setting will currently be ignored if either {0} or {1} are set."),type:["string","null"],default:null},"terminal.integrated.defaultProfile.osx":{restricted:!0,markdownDescription:(0,n.localize)("terminal.integrated.defaultProfile.osx","The default profile used on macOS. This setting will currently be ignored if either {0} or {1} are set."),type:["string","null"],default:null},"terminal.integrated.defaultProfile.windows":{restricted:!0,markdownDescription:(0,n.localize)("terminal.integrated.defaultProfile.windows","The default profile used on Windows. This setting will currently be ignored if either {0} or {1} are set."),type:["string","null"],default:null},"terminal.integrated.copyOnSelection":{type:"boolean",description:"%preference.terminal.integrated.copyOnSelectionDesc%",default:!1},"terminal.integrated.localEchoEnabled":{type:"boolean",description:"%preference.terminal.integrated.localEchoDesc%",default:!0},"terminal.integrated.localEchoLatencyThreshold":{type:"number",description:"%preference.terminal.integrated.localEchoLatencyThresholdDesc%",default:30},"terminal.integrated.localEchoExcludePrograms":{type:"array",description:"%preference.terminal.integrated.localEchoExcludeProgramsDesc%",default:["vim","vi","nano","tmux"]},"terminal.integrated.localEchoStyle":{type:"string",description:"%preference.terminal.integrated.localEchoStyleDesc%",enum:["bold","dim","italic","underlined","inverted"],default:"dim"},"terminal.integrated.cursorStyle":{type:"string",description:"%preference.terminal.integrated.cursorStyleDesc%",enum:[t.TerminalCursorStyle.BLOCK,t.TerminalCursorStyle.LINE,t.TerminalCursorStyle.UNDERLINE],default:t.TerminalCursorStyle.BLOCK},"terminal.integrated.xtermRenderType":{type:"string",description:"%preference.terminal.integrated.xtermRenderTypeDesc%",enum:[r.RenderType.WebGL,r.RenderType.Canvas,r.RenderType.Dom],default:r.RenderType.WebGL},"terminal.integrated.enablePersistentSessions":{type:"boolean",description:"%preference.terminal.integrated.enablePersistentSessionDesc%",default:!0}}}},38352:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},85504:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITerminalProfileInternalService=t.ITerminalProfileService=void 0,t.terminalProfileArgsMatch=e,t.ITerminalProfileService=Symbol("ITerminalProfileService"),t.ITerminalProfileInternalService=Symbol("ITerminalProfileInternalService");function e(n,r){if(!n&&!r)return!0;if(typeof n=="string"&&typeof r=="string")return n===r;if(Array.isArray(n)&&Array.isArray(r)){if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++)if(n[o]!==r[o])return!1;return!0}return!1}},30354:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IPtyService=t.IExternalTerminalService=t.ITerminalServiceClient=t.ITerminalProcessService=t.ITerminalNodeService=t.PTY_SERVICE_PROXY_SERVER_PORT=t.PTY_SERVICE_PROXY_CALLBACK_PROTOCOL=t.PTY_SERVICE_PROXY_PROTOCOL=t.ITerminalProcessPath=t.ITerminalServicePath=void 0,t.asTerminalIcon=e,t.ITerminalServicePath="ITerminalServicePath",t.ITerminalProcessPath="ITerminalProcessPath",t.PTY_SERVICE_PROXY_PROTOCOL="PTY_SERVICE_PROXY_PROTOCOL",t.PTY_SERVICE_PROXY_CALLBACK_PROTOCOL="PTY_SERVICE_PROXY_CALLBACK_PROTOCOL",t.PTY_SERVICE_PROXY_SERVER_PORT=10111,t.ITerminalNodeService=Symbol("ITerminalNodeService"),t.ITerminalProcessService=Symbol("ITerminalProcessService"),t.ITerminalServiceClient=Symbol("ITerminalServiceClient"),t.IExternalTerminalService=Symbol("IExternalTerminalService");function e(n){if(!(!n||typeof n=="string"))return"id"in n?{id:n.id,color:n.color}:n}t.IPtyService=Symbol("IPtyService")},2853:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITerminalRenderProvider=t.ItemType=void 0;var e;(function(n){n[n.info=0]="info",n[n.add=1]="add"})(e||(t.ItemType=e={})),t.ITerminalRenderProvider=Symbol("TerminalRenderProvider")},59381:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},18171:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITerminalRestore=void 0,t.ITerminalRestore=Symbol("ITerminalRestore")},38022:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITerminalInternalService=t.ITerminalService=void 0,t.ITerminalService=Symbol("ITerminalService"),t.ITerminalInternalService=Symbol("ITerminalInternalService")},59926:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_LENGTH=t.lineAndColumnClauseGroupCount=t.unixLineAndColumnMatchIndex=t.winLineAndColumnMatchIndex=t.winLocalLinkClause=t.unixLocalLinkClause=t.winExcludedPathCharactersClause=t.winPathSeparatorClause=t.winPathPrefix=t.winDrivePrefix=t.excludedPathCharactersClause=t.pathSeparatorClause=t.pathPrefix=void 0,t.getLineAndColumnClause=r,t.extractLineInfoFromMatch=o;class e{constructor(){this.ri=0,this.ci=0,this.rei=0,this.cei=0}r(){return`(?<row${this.ri++}>\\d+)`}c(){return`(?<col${this.ci++}>\\d+)`}re(){return`(?<rowEnd${this.rei++}>\\d+)`}ce(){return`(?<colEnd${this.cei++}>\\d+)`}}t.pathPrefix="(\\.\\.?|\\~)",t.pathSeparatorClause="\\/",t.excludedPathCharactersClause="[^\\0\\s!`&*()\\[\\]'\":;\\\\]",t.winDrivePrefix="(?:\\\\\\\\\\?\\\\)?[a-zA-Z]:",t.winPathPrefix="("+t.winDrivePrefix+"|\\.\\.?|\\~)",t.winPathSeparatorClause="(\\\\|\\/)",t.winExcludedPathCharactersClause="[^\\0<>\\?\\|\\/\\s!`&*()\\[\\]'\":;]",t.unixLocalLinkClause="(("+t.pathPrefix+"|("+t.excludedPathCharactersClause+")+)?("+t.pathSeparatorClause+"("+t.excludedPathCharactersClause+")+)+)",t.winLocalLinkClause="(("+t.winPathPrefix+"|("+t.winExcludedPathCharactersClause+")+)?("+t.winPathSeparatorClause+"("+t.winExcludedPathCharactersClause+")+)+)";const n="";function r(){const a=new e;return[`(?::|#| |['"],|, )${a.r()}([:.]${a.c()}(?:-(?:${a.re()}\\.)?${a.ce()})?)?`+n,`['"]?(?:,? |: ?| on )lines? ${a.r()}(?:-${a.re()})?(?:,? (?:col(?:umn)?|characters?) ${a.c()}(?:-${a.ce()})?)?`+n,`:? ?[\\[\\(]${a.r()}(?:(?:, ?|:)${a.c()})?[\\]\\)]`+n].join("|").replace(/ /g,"[\xA0 ]")}t.winLineAndColumnMatchIndex=12,t.unixLineAndColumnMatchIndex=11,t.lineAndColumnClauseGroupCount=6,t.MAX_LENGTH=2e3;function o(a){const p={};if(a[1]&&(p.filePath=a[1]),a.groups)for(const[v,m]of Object.entries(a.groups))m&&(v.startsWith("row")?v.replace("row","")==="End"?p.endLine=parseInt(m,10):p.line=parseInt(m,10):v.startsWith("col")&&(v.replace("col","")==="End"?p.endColumn=parseInt(m,10):p.column=parseInt(m,10)));return p}},30076:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITerminalTheme=void 0,t.ITerminalTheme=Symbol("ITerminalTheme")},16992:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateSessionId=t.apiActionViewUuid=t.userActionViewUuid=void 0;const n=e(43718);let r=0;function o(){return r++}const a=()=>`UI_View_${(0,n.uuid)()}${o()}`;t.userActionViewUuid=a;const p=()=>`API_View_${(0,n.uuid)()}${o()}`;t.apiActionViewUuid=p;const v=()=>(0,n.uuid)();t.generateSessionId=v},25655:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RenderType=void 0;var e;(function(n){n.Canvas="canvas",n.WebGL="webgl",n.Dom="dom"})(e||(t.RenderType=e={}))},6487:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(26405),t)},92297:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestingExplorerTree=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(91416),a=e(41869),p=e(52416),v=e(72383),m=e(85941),_=e(95381),s=e(16558),g=e(97581),l=n.__importDefault(e(30272)),h=()=>{const u=(0,a.useInjectable)(s.TestTreeViewModelToken),d=(0,a.useInjectable)(v.TestServiceToken),E=(0,a.useInjectable)(a.CommandService),f=(0,a.useInjectable)(p.IIconService),[c,y]=(0,r.useState)([]),b=r.default.useCallback(w=>(0,g.getIconWithColor)(w.state),[]),A=r.default.useCallback(w=>({label:w.label,renderLabel:(0,a.transformLabelWithCodicon)(w.label,{verticalAlign:"middle",marginRight:"4px",marginLeft:"4px"},f.fromString.bind(f)),icon:"",get iconClassName(){return b(w)},expandable:w.test.expand!==0,rawItem:w,sortText:w.sortText,get children(){if(w.test.expand===1||w.children){const T=u.getTestTreeItem(w.test.item.extId);return Array.from((0,a.map)(T?.children||[],A))}return null}}),[]);(0,r.useEffect)(()=>a.Event.debounce(u.onUpdate,()=>{},500)(()=>{for(const T of u.roots)if(T.depth===0&&T.children.size>0){let R=[];for(const P of T.children)R.push(A(P));R=R.sort((P,O)=>(P.sortText||P.label).localeCompare(O.sortText||O.label)),y(R)}}).dispose,[u]),(0,r.useEffect)(()=>{var w;if(u.treeHandlerApi){const T=u.treeHandlerApi.getModel();((w=T.root.children)===null||w===void 0?void 0:w.length)===0&&T.root.refresh()}},[c]);const S=r.default.useCallback(w=>w?w.children&&w.children.length>0?w.children:[]:null,[]),D=r.default.useCallback((w,T)=>{const{rawItem:R}=w.raw;switch(T.command){case m.RuntTestCommand.id:d.runTests({tests:R.tests,group:2});break;case m.DebugTestCommand.id:d.runTests({tests:R.tests,group:4});break;case m.GoToTestCommand.id:E.executeCommand(m.GoToTestCommand.id,R.test.item.extId);break}},[]),I=w=>{u.setTreeHandlerApi(w)};return r.default.createElement("div",{className:"monaco-workbench monaco-component"},c.length>0&&r.default.createElement(o.BasicRecycleTree,{treeData:c,onReady:I,itemClassname:l.default.item_label,height:900,resolveChildren:S,inlineMenus:_.TestingExplorerInlineMenus,inlineMenuActuator:D}))};t.TestingExplorerTree=h},76028:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestingView=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(41869),a=e(25918),p=e(1149),v=e(93899),m=e(91527),_=e(92297),s=n.__importDefault(e(30272)),g=()=>{const l=(0,o.useInjectable)(v.AbstractContextMenuService),h=(0,o.useInjectable)(o.ViewContextKeyRegistry),u=(0,o.useInjectable)(p.LayoutViewSizeConfig),[d,E]=(0,r.useState)();return(0,r.useEffect)(()=>{const f=l.createMenu({id:v.MenuId.ViewTitle,contextKeyService:h.getContextKeyService("workbench.view.testing")});E(f)},[]),r.default.createElement("div",{className:s.default.testing_container},r.default.createElement(m.TitleBar,{title:(0,o.localize)("test.title"),height:u.panelTitleBarHeight,menubar:d?r.default.createElement(a.InlineMenuBar,{menus:d}):null}),r.default.createElement(_.TestingExplorerTree,null))};t.TestingView=g},97581:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getIconWithColor=t.testingRefreshTests=t.testingRunAllIcon=t.testingRunIcon=t.testingStatesToIcons=t.testStatesToIconColors=t.defaultIconColor=void 0;const n=e(41869);t.defaultIconColor="testing_icon_iconPassed",t.testStatesToIconColors={6:"testing_icon_iconFailed",4:"testing_icon_iconErrored",3:t.defaultIconColor,1:"testing_icon_iconQueued",0:"testing_icon_iconUnset",5:"testing_icon_iconUnset"},t.testingStatesToIcons=new Map([[6,(0,n.getExternalIcon)("issues")],[4,(0,n.getExternalIcon)("error")],[3,(0,n.getExternalIcon)("pass")],[1,(0,n.getExternalIcon)("history")],[2,(0,n.getExternalIcon)("loading")+" kt-icon-loading"],[5,(0,n.getExternalIcon)("debug-step-over")],[0,(0,n.getExternalIcon)("circle-outline")]]),t.testingRunIcon=(0,n.getExternalIcon)("run"),t.testingRunAllIcon=(0,n.getExternalIcon)("run-all"),t.testingRefreshTests=(0,n.getExternalIcon)("refresh");const r=o=>`${t.testingStatesToIcons.get(o)} ${t.testStatesToIconColors[o]}`||"";t.getIconWithColor=r},26874:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestingModule=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(72383),p=e(20215),v=e(48385),m=e(57879),_=e(16558),s=e(43122),g=e(89872),l=e(80162),h=e(66724),u=e(4836),d=e(86457),E=e(76388);e(8758),e(11009),e(61164);let f=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[E.TestingContribution,{token:a.TestServiceToken,useClass:d.TestServiceImpl},{token:_.TestTreeViewModelToken,useClass:h.TestTreeViewModelImpl},{token:p.TestProfileServiceToken,useClass:l.TestProfileServiceImpl},{token:v.TestResultServiceToken,useClass:u.TestResultServiceImpl},{token:m.TestingPeekOpenerServiceToken,useClass:g.TestingPeekOpenerServiceImpl},{token:a.TestPeekMessageToken,useClass:s.TestingPeekMessageServiceImpl}]}};t.TestingModule=f,t.TestingModule=f=n.__decorate([(0,r.Injectable)()],f)},23993:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestMessageContainer=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=n.__importDefault(e(43144)),a=e(41869),p=e(43718),v=e(57517),m=e(93374),_=e(72383),s=n.__importDefault(e(30272));var g;(function(y){y[y.DIFF=0]="DIFF",y[y.PLANTTEXT=1]="PLANTTEXT",y[y.MARKDOWN=2]="MARKDOWN"})(g||(g={}));const h={...{scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!1},fixedOverflowWidgets:!0,readOnly:!0,minimap:{enabled:!1}},enableSplitViewResizing:!0,renderOverviewRuler:!1,ignoreTrimWhitespace:!1,renderSideBySide:!0},u=y=>y?y.messages[y.messageIndex]:{message:"",actual:"",expected:""},d=({root:y,children:b})=>o.default.createPortal(b,y),E=y=>{const b=(0,a.useInjectable)(a.IOpenerService),A=(0,r.useRef)(null),[S,D]=(0,r.useState)(""),[I,w]=(0,r.useState)(null),T=R=>{R&&R.scheme===p.Schemes.command&&b.open(R)};return r.default.useEffect(()=>{if(A.current){const{dto:R}=y;let P=A.current.shadowRoot;P||(P=A.current.attachShadow({mode:"open"})),I||w(P);const O=u(R).message,M=O?O.value.replace(/\t/g,""):"";D(M)}},[y.dto]),r.default.createElement("div",{ref:A,className:s.default.preview_markdown},I&&r.default.createElement(d,{root:I},r.default.createElement(m.Markdown,{content:S,onLinkClick:T})))},f=r.default.memo(y=>{const{dto:b}=y,A=(0,a.useInjectable)(v.IEditorDocumentModelService),S=(0,a.useInjectable)(v.EditorCollectionService),D=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!b)return;let I;const{expectedUri:w,actualUri:T}=b;return Promise.all([A.createModelReference(w),A.createModelReference(T)]).then(R=>{const[P,O]=R,{actual:M,expected:k}=u(b);I=S.createDiffEditor(D.current,{...(0,v.getSimpleEditorOptions)(),...h});const F=P.instance.getMonacoModel(),L=O.instance.getMonacoModel();F.setValue(k),L.setValue(M),I.compare(P,O),I.originalEditor.monacoEditor.setModel(F),I.modifiedEditor.monacoEditor.setModel(L)}),()=>{I&&I.dispose()}},[]),r.default.createElement("div",{ref:D,style:{height:"inherit"}})}),c=()=>{const y=(0,a.useInjectable)(_.TestPeekMessageToken),[b,A]=(0,r.useState)(),[S,D]=(0,r.useState)();(0,r.useEffect)(()=>{const w=new p.Disposable;return w.addDispose(y.onDidReveal(async T=>{D(T);const R=u(T);T.isDiffable?A(g.DIFF):T.isDiffable||typeof R.message=="string"?A(g.PLANTTEXT):A(g.MARKDOWN)})),()=>{w.dispose()}},[]);const I=r.default.useCallback(()=>{if(!S)return null;if(b===g.DIFF)return r.default.createElement(f,{dto:S});if(b===g.MARKDOWN)return r.default.createElement(E,{dto:S});{const w=u(S).message;return r.default.createElement("div",{className:s.default.preview_text},typeof w=="string"?w:w.value)}},[S]);return r.default.createElement("div",{className:s.default.test_output_peek_message_container,style:{height:"100%"}},I())};t.TestMessageContainer=c},1031:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestOutputPeekContribution=t.TestDto=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(43718),p=e(44781),v=e(48385),m=e(57879),_=e(92597),s=e(65482),g=e(4836),l=e(33429),h=e(89872),u=e(33218);class d{get isDiffable(){const c=this.messages[this.messageIndex];return c.type===0&&(0,_.isDiffable)(c)}constructor(c,y,b,A){var S;this.resultId=c,this.taskIndex=b,this.messageIndex=A,this.test=y.item,this.messages=y.tasks[b].messages,this.messageIndex=A;const D={messageIndex:A,resultId:c,taskIndex:b,testExtId:y.item.extId};this.expectedUri=(0,l.buildTestUri)({...D,type:2}),this.actualUri=(0,l.buildTestUri)({...D,type:1}),this.messageUri=(0,l.buildTestUri)({...D,type:0});const I=this.messages[this.messageIndex];this.revealLocation=(S=I.location)!==null&&S!==void 0?S:y.item.uri&&y.item.range?{uri:y.item.uri,range:p.Range.lift(y.item.range)}:void 0}}t.TestDto=d;let E=class{constructor(c){this.editor=c,this.disposer=new a.Disposable,this.peekView=new a.MutableDisposable,this.testContextKey=this.injector.get(s.TestContextKey,[this.editor.monacoEditor._contextKeyService])}allMessages(c){const y=[];for(const b of c)for(const A of b.tests)for(let S=0;S<A.tasks.length;S++)for(let D=0;D<A.tasks[S].messages.length;D++)y.push({result:b,test:A,taskIndex:S,messageIndex:D});return y}contribute(){return this.disposer.addDispose(this.editor.monacoEditor.onDidChangeModel(c=>{var y;((y=c.newModelUrl)===null||y===void 0?void 0:y.scheme)===o.Schemes.file&&this.testingPeekOpenerService.setPeekContrib(c.newModelUrl,this)})),this.disposer.addDispose(a.Disposable.create(()=>{this.editor.currentUri&&this.testingPeekOpenerService.delPeekContrib(this.editor.currentUri)})),this.disposer}toggle(c){var y;((y=this.currentPeekUri)===null||y===void 0?void 0:y.toString())===c.toString()?this.peekView.clear():this.show(c)}openCurrentInEditor(){var c;const y=(c=this.peekView.value)===null||c===void 0?void 0:c.current;y&&(y.isDiffable?this.commandService.executeCommand(o.EDITOR_COMMANDS.API_OPEN_DIFF_EDITOR_COMMAND_ID,y.expectedUri,y.actualUri,"Expected <-> Actual"):this.commandService.executeCommand(o.EDITOR_COMMANDS.OPEN_RESOURCE.id,y.messageUri,{preview:!1,focus:!0}))}removePeek(){var c;(c=this.peekView.value)===null||c===void 0||c.hide(),this.peekView.clear()}async show(c){const y=this.testResultService.retrieveTest(c);y&&(this.peekView.value||(this.peekView.value=this.injector.get(u.TestingOutputPeek,[this.editor.monacoEditor,this.contextKeyService]),this.disposer.addDispose(this.peekView.value.onDidClose(()=>{this.testContextKey.contextTestingIsPeekVisible.set(!1),this.currentPeekUri=void 0,this.peekView.value=void 0})),this.testContextKey.contextTestingIsPeekVisible.set(!0),this.peekView.value.create()),this.peekView.value.setModel(y),this.currentPeekUri=c)}async openAndShow(c){var y;const b=this.testResultService.retrieveTest(c);if(!b)return;if(!b.revealLocation||b.revealLocation.uri.toString()===((y=this.editor.currentUri)===null||y===void 0?void 0:y.toString()))return this.show(c);const A=this.testingPeekOpenerService.peekControllerMap.get(c.toString());A&&(this.removePeek(),await this.commandService.executeCommand(o.EDITOR_COMMANDS.OPEN_RESOURCE.id,a.URI.parse(c.toString()),{preview:!0,focus:!0}),A.show(c))}next(){var c;const y=(c=this.peekView.value)===null||c===void 0?void 0:c.current;if(!y)return;let b=!1;const A=this.allMessages(this.testResultService.results);for(const{messageIndex:S,taskIndex:D,result:I,test:w}of A)if(b){this.openAndShow((0,l.buildTestUri)({type:0,messageIndex:S,taskIndex:D,resultId:I.id,testExtId:w.item.extId}));return}else y.test.extId===w.item.extId&&y.messageIndex===S&&y.taskIndex===D&&y.resultId===I.id&&(b=!0)}previous(){var c;const y=(c=this.peekView.value)===null||c===void 0?void 0:c.current;if(!y)return;let b;const A=this.allMessages(this.testResultService.results);for(const S of A){if(y.test.extId===S.test.item.extId&&y.messageIndex===S.messageIndex&&y.taskIndex===S.taskIndex&&y.resultId===S.result.id){if(!b)return;this.openAndShow((0,l.buildTestUri)({type:0,messageIndex:b.messageIndex,taskIndex:b.taskIndex,resultId:b.result.id,testExtId:b.test.item.extId}));return}b=S}}};t.TestOutputPeekContribution=E,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],E.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(v.TestResultServiceToken),n.__metadata("design:type",g.TestResultServiceImpl)],E.prototype,"testResultService",void 0),n.__decorate([(0,r.Autowired)(m.TestingPeekOpenerServiceToken),n.__metadata("design:type",h.TestingPeekOpenerServiceImpl)],E.prototype,"testingPeekOpenerService",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],E.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(a.CommandService),n.__metadata("design:type",Object)],E.prototype,"commandService",void 0),t.TestOutputPeekContribution=E=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[Object])],E)},43122:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestingPeekMessageServiceImpl=void 0;const n=e(85608),r=e(76003),o=e(43718);let a=class extends o.Disposable{constructor(){super(...arguments),this._didReveal=new o.Emitter,this._visibilityChange=new o.Emitter,this.onDidReveal=this._didReveal.event,this.onVisibilityChange=this._visibilityChange.event}};t.TestingPeekMessageServiceImpl=a,t.TestingPeekMessageServiceImpl=a=n.__decorate([(0,r.Injectable)()],a)},89872:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestingPeekOpenerServiceImpl=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(54414),p=e(48385),v=e(33429),m=e(4836),_=(g,l)=>{for(let h=0;h<g.tasks.length;h++){const u=g.tasks[h];for(let d=0;d<u.messages.length;d++){const E=l(u,u.messages[d],d,h);if(E!==void 0)return E}}};let s=class extends o.Disposable{constructor(){super(...arguments),this.peekControllerMap=new Map}get currentUri(){var l;return(l=this.editorService.currentEditor)===null||l===void 0?void 0:l.currentUri}async showPeekFromUri(l,h){const u=this.editorService.currentEditor;this.lastUri=l;const d=(0,v.buildTestUri)(this.lastUri),E=this.peekControllerMap.get(u?.currentUri.toString());return E?.show(d),!0}getAnyCandidateMessage(){const l=new Set;for(const h of this.testResultService.results)for(const u of h.tests){if(l.has(u.item.extId))continue;l.add(u.item.extId);const d=_(u,(E,f,c,y)=>f.location&&{type:0,testExtId:u.item.extId,resultId:h.id,taskIndex:y,messageIndex:c,documentUri:f.location.uri});if(d)return d}}setPeekContrib(l,h){const u=l.toString();return this.peekControllerMap.has(u)||this.peekControllerMap.set(u,h),this}delPeekContrib(l){const h=l.toString();return this.peekControllerMap.delete(h),this}tryPeekFirstError(l,h,u){throw new Error("Method not implemented.")}async open(){let l;return l||(l=this.getAnyCandidateMessage()),l?this.showPeekFromUri(l):!1}closeAllPeeks(){for(const l of this.peekControllerMap.values())l.removePeek()}};t.TestingPeekOpenerServiceImpl=s,n.__decorate([(0,r.Autowired)(a.WorkbenchEditorService),n.__metadata("design:type",a.WorkbenchEditorService)],s.prototype,"editorService",void 0),n.__decorate([(0,r.Autowired)(p.TestResultServiceToken),n.__metadata("design:type",m.TestResultServiceImpl)],s.prototype,"testResultService",void 0),t.TestingPeekOpenerServiceImpl=s=n.__decorate([(0,r.Injectable)()],s)},33218:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestingOutputPeek=t.TestResultPanel=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=n.__importDefault(e(43144)),a=n.__importDefault(e(25873)),p=e(76003),v=e(41869),m=e(81878),_=e(25918),s=e(93899),g=e(48327),l=e(55666),h=e(72383),u=e(92597),d=e(23993),E=e(43122),f=e(3700);e(11009);const c=({viewState:b})=>r.default.createElement(m.SplitPanel,{overflow:"hidden",id:"testing-message-horizontal",flex:1,style:{height:"100%"}},r.default.createElement(d.TestMessageContainer,null),r.default.createElement(f.TestTreeContainer,{viewState:b}));t.TestResultPanel=c;let y=class extends g.PeekViewWidget{constructor(A,S){super(A,{isResizeable:!0}),this.editor=A,this.contextKeyService=S}_fillBody(A){this.setCssClass("testing-output-peek-container"),a.default.createRoot(A).render(r.default.createElement(v.ConfigProvider,{value:this.configContext},r.default.createElement(m.SplitPanel,{overflow:"hidden",id:"testing-message-horizontal",flex:1},r.default.createElement(d.TestMessageContainer,null),r.default.createElement(f.TestTreeContainer,null))))}async _fillActionBarOptions(A){const S=this.menuService.createMenu(s.MenuId.TestPeekTitleContext,this.contextKeyService);return new Promise(D=>{var I;a.default.createRoot(A).render(r.default.createElement(v.ConfigProvider,{value:this.configContext},r.default.createElement(_.InlineActionBar,{menus:S,type:"icon",context:[(I=this.editor.getModel())===null||I===void 0?void 0:I.uri.toString()]}))),D()})}applyClass(){}applyStyle(){}async showInPlace(A){const S=A.messages[A.messageIndex];this.setTitle((0,u.firstLine)(typeof S.message=="string"?S.message:(0,l.renderMarkdown)(S.message).element.outerText),A.test.label),setTimeout(()=>{this.testingPeekMessageService._didReveal.fire(A),this.testingPeekMessageService._visibilityChange.fire(!0)})}hide(){super.dispose(),this._bodyElement&&o.default.unmountComponentAtNode(this._bodyElement)}setModel(A){const S=A.messages[A.messageIndex],D=this.current;return S.type!==0||!A.revealLocation&&!D?Promise.resolve():(this.current=A,A.revealLocation?(this.show(A.revealLocation.range,(0,u.hintMessagePeekHeight)(S)),this.editor.focus(),this.showInPlace(A)):this.showInPlace(A))}};t.TestingOutputPeek=y,n.__decorate([(0,p.Autowired)(h.TestPeekMessageToken),n.__metadata("design:type",E.TestingPeekMessageServiceImpl)],y.prototype,"testingPeekMessageService",void 0),n.__decorate([(0,p.Autowired)(s.AbstractMenuService),n.__metadata("design:type",s.AbstractMenuService)],y.prototype,"menuService",void 0),n.__decorate([(0,p.Autowired)(v.AppConfig),n.__metadata("design:type",Object)],y.prototype,"configContext",void 0),t.TestingOutputPeek=y=n.__decorate([(0,p.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object])],y)},3700:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestTreeContainer=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),a=e(97267),p=e(41869),v=e(43718),m=e(42912),_=e(41682),s=e(72383),g=e(48385),l=e(92597),h=e(33429),u=n.__importDefault(e(30272)),d=e(97581),E=e(1031);var f;(function(y){y.RESULT="result",y.TEST="test",y.TASK="task",y.MESSAGE="message"})(f||(f={}));const c=({viewState:y})=>{const b=(0,p.useInjectable)(g.TestResultServiceToken),A=(0,p.useInjectable)(s.TestPeekMessageToken),S=(0,p.useInjectable)(m.IIconService),[D,I]=(0,o.useState)([]);(0,o.useEffect)(()=>{const k=new v.Disposable;k.addDispose(A.onDidReveal(B=>{}));const F=b.results.map(B=>M(B));I(F);const L=b.onResultsChanged(B=>{const U=b.results.map(W=>M(W));I(U)});return k.addDispose(L),b.onTestChanged(B=>{const U=b.results.map(W=>M(W));I(U)}),k.dispose.bind(k)},[]);const w=o.default.useCallback(k=>k?k.children&&k.children.length>0?k.children:[]:null,[]),T=o.default.useCallback(k=>{const F=k.completedAt===void 0?2:(0,g.maxCountPriority)(k.counts);return(0,d.getIconWithColor)(F)},[]),R=o.default.useCallback((k,F,L)=>_.Iterable.map(F.tasks[0].messages,(B,U)=>{const{message:W,location:j}=F.tasks[L].messages[U],Q=(0,h.buildTestUri)({type:0,messageIndex:U,resultId:k.id,taskIndex:L,testExtId:F.item.extId}),G=new E.TestDto(k.id,F,L,U),Z=()=>{if(typeof W=="string")return(0,l.firstLine)(W);const $={type:f.MESSAGE,context:Q,label:(0,l.firstLine)(W.value),id:Q.toString(),icon:"",notExpandable:!1,location:j,rawItem:{...B,dto:G}};return(0,l.parseMarkdownText)(W.value).then(V=>{$.label=(0,l.firstLine)(V)}).catch(()=>{}),$.label};return{type:f.MESSAGE,context:Q,label:Z(),id:Q.toString(),icon:"",notExpandable:!1,location:j,rawItem:{...B,dto:G}}}),[]),P=o.default.useCallback((k,F)=>{const L=_.Iterable.filter(F.tasks,B=>B.messages.length>0);return _.Iterable.map(L,(B,U)=>{var W;const j=k.tasks[U];return{type:f.TASK,context:String(U),label:(W=j.name)!==null&&W!==void 0?W:(0,v.localize)("test.task.unnamed"),id:`${k.id}/${F.item.extId}/${U}`,icon:"",task:j,notExpandable:!1,rawItem:B,get children(){return Array.from(R(k,F,U))}}})},[]),O=o.default.useCallback(k=>{const F=_.Iterable.filter(k.tests,L=>L.tasks.some(B=>B.messages.length>0||B.state>=2));return _.Iterable.map(F,L=>{let B="";for(const Z of(0,g.resultItemParents)(k,L))Z!==L&&(B=B?Z.item.label+" \u203A "+B:Z.item.label);B=(0,p.transformLabelWithCodicon)(B,{},S.fromString.bind(S));const U=(0,p.transformLabelWithCodicon)(L.item.label,{verticalAlign:"middle",marginRight:"4px"},S.fromString.bind(S)),Q=L.tasks.filter(Z=>Z.messages.length>0).length>1?Array.from(P(k,L)):Array.from(R(k,L,0)),G=Q.length>0;return{type:f.TEST,context:L.item.extId,id:`${k.id}/${L.item.extId}`,renderLabel:U,label:L.item.label,icon:"",get iconClassName(){return(0,d.getIconWithColor)(L.computedState)},notExpandable:!1,expandable:G,description:"",rawItem:L,get children(){return Q}}})},[]),M=o.default.useCallback(k=>{const F={messages:[{location:void 0,message:{value:k.getOutput(),uris:{},isTrusted:!0,supportThemeIcons:!0},type:0}],messageIndex:0};return{type:f.RESULT,context:k.id,id:k.id,label:k.name,icon:"",get iconClassName(){return T(k)},expandable:!0,rawItem:{...k,dto:F},get children(){return Array.from(O(k))}}},[]);return o.default.createElement("div",{className:(0,r.default)(u.default.test_output_peek_tree,"monaco-editor")},o.default.createElement(a.BasicRecycleTree,{treeData:D,height:y?.height||500,resolveChildren:w,onClick:(k,F)=>{if(!F)return;const B=F.raw.rawItem;B.dto&&A._didReveal.fire(B.dto)}}))};t.TestTreeContainer=c},65482:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestContextKey=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(12288);let p=class{constructor(m){this._contextKeyService=this.globalContextKeyService.createScoped(m),this.contextTestingIsPeekVisible=a.TestingIsPeekVisible.bind(this.contextKeyScoped)}get contextKeyScoped(){return this._contextKeyService}};t.TestContextKey=p,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],p.prototype,"globalContextKeyService",void 0),t.TestContextKey=p=n.__decorate([(0,r.Injectable)(),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[Object])],p)},17482:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestDecorationsContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(93899),p=e(43718),v=n.__importStar(e(20868)),m=e(90684),_=e(19582),s=e(31324),g=e(72383),l=e(57879),h=e(33429),u=e(61090),d=e(48385),E=e(92597),f=e(97581),c=e(89872),y=e(4836),b=e(86457),{removeAnsiEscapeCodes:A}=p.strings,S="--testMessageDecorationFontFamily",D=(k,F)=>{var L;return((L=F.location)===null||L===void 0?void 0:L.uri.toString())===k.toString()},I=k=>({startLineNumber:k.startLineNumber,endLineNumber:k.startLineNumber,startColumn:0,endColumn:1}),w=(k,F)=>{var L,B;const U=(L=k[0])===null||L===void 0?void 0:L.item.range;if(!U)throw new Error("Test decorations can only be created for tests with a range");let W=0;const j=[];let Q,G=!1;for(let K=0;K<k.length;K++){const Y=k[K],X=F[K],oe=(B=X?.computedState)!==null&&B!==void 0?B:0;j.push((0,u.labelForTestInState)(Y.item.label,oe)),W=(0,E.maxPriority)(W,oe),G=G||!!X?.retired,!Q&&X?.tasks.some(ie=>ie.messages.length)&&(Q=Y.item.extId)}const Z=k.length>1||k[0].children.size>0,$=W===0?Z?f.testingRunAllIcon:f.testingRunIcon:f.testingStatesToIcons.get(W),V=W===0?f.defaultIconColor:f.testStatesToIconColors[W];let H=`${$} ${V} testing-run-glyph`;return G&&(H+=" retired"),{range:I(U),options:{description:"run-test-decoration",isWholeLine:!0,glyphMarginClassName:H,stickiness:v.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}};class T extends p.Disposable{get line(){return this.editorDecoration.range.startLineNumber}constructor(F,L){super(),this.editorDecoration=F,this.editor=L,this.id=""}click(F){var L;return((L=F.target.position)===null||L===void 0?void 0:L.lineNumber)!==this.line||F.target.type!==_.MouseTargetType.GUTTER_GLYPH_MARGIN?!1:F.event.rightButton?(this.showContextMenu(F),!0):(this.defaultRun(),!0)}getContextMenuActions(F){return this.menuService.createMenu(a.MenuId.TestingGlyphMarginContext,this.contextKeyService)}showContextMenu(F){const L=this.getContextMenuActions(F),B=(0,a.generateMergedCtxMenu)({menus:L});L.dispose(),setTimeout(()=>{this.ctxMenuRenderer.show({anchor:F.event.browserEvent,menuNodes:B,args:this.getContextMenuArgs()})})}getGutterLabel(){}}n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],T.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(a.AbstractMenuService),n.__metadata("design:type",a.AbstractMenuService)],T.prototype,"menuService",void 0),n.__decorate([(0,r.Autowired)(a.ICtxMenuRenderer),n.__metadata("design:type",a.ICtxMenuRenderer)],T.prototype,"ctxMenuRenderer",void 0);class R extends T{constructor(F,L){super(w(F.map(B=>B.test),F.map(B=>B.resultItem)),L),this.tests=F}merge(F,L){return this.tests.push({test:F,resultItem:L}),this.editorDecoration=w(this.tests.map(B=>B.test),this.tests.map(B=>B.resultItem)),this}getContextMenuArgs(){return this.tests.map(F=>F.test.item.extId)}defaultRun(){return this.testService.runTests({tests:this.tests.map(({test:F})=>F),group:2})}defaultDebug(){return this.testService.runTests({tests:this.tests.map(({test:F})=>F),group:4})}}n.__decorate([(0,r.Autowired)(g.TestServiceToken),n.__metadata("design:type",b.TestServiceImpl)],R.prototype,"testService",void 0);let P=class extends T{constructor(F,L,B){super(w([F],[B]),L),this.test=F,this.resultItem=B}merge(F,L){return this.injector.get(R,[[{test:this.test,resultItem:this.resultItem},{test:F,resultItem:L}],this.editor])}getContextMenuArgs(){return[this.test.item.extId]}defaultRun(){return this.testService.runTests({tests:[this.test],group:2})}defaultDebug(){return this.testService.runTests({tests:[this.test],group:4})}};n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],P.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(g.TestServiceToken),n.__metadata("design:type",b.TestServiceImpl)],P.prototype,"testService",void 0),P=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object,Object])],P);let O=class{get monacoEditor(){return this.editor.monacoEditor}constructor(F,L,B,U){this.testMessage=F,this.messageUri=L,this.location=B,this.editor=U,this.decorationId=`testmessage-${(0,p.uuid)()}`,this.id="",this.codeEditorService=this.overrideServicesRegistry.getRegisteredService(o.ServiceNames.CODE_EDITOR_SERVICE);const W=F.type,j=typeof F.message=="string"?A(F.message):(0,E.parseMarkdownText)(typeof F.message=="object"&&"value"in F.message?F.message.value:String(F.message)).then(Z=>Z).catch(()=>typeof F.message=="object"&&"value"in F.message?F.message.value:String(F.message)),Q=typeof j=="string"?j:typeof F.message=="object"&&"value"in F.message?F.message.value:String(F.message);this.codeEditorService.registerDecorationType("test-message-decoration",this.decorationId,{after:{contentText:Q,color:`${u.testMessageSeverityColors[W]}`,fontSize:`${this.monacoEditor.getOption(s.EditorOption.fontSize)}px`,fontFamily:`var(${S})`,padding:"0px 12px 0px 24px"}},void 0,this.monacoEditor);const G=this.codeEditorService.resolveDecorationOptions(this.decorationId,!0);G.hoverMessage=typeof j=="string"?new m.MarkdownString().appendText(j):typeof F.message=="object"&&"value"in F.message?F.message:new m.MarkdownString().appendText(String(F.message)),G.afterContentClassName=`${G.afterContentClassName} testing-inline-message-content`,G.zIndex=10,G.className=`testing-inline-message-margin testing-inline-message-severity-${W}`,G.isWholeLine=!0,G.stickiness=v.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,G.collapseOnReplaceEdit=!0,this.editorDecoration={range:I(B.range),options:G}}click(F){var L,B;if(F.event.rightButton||!this.messageUri)return!1;if(!((L=F.target.element)===null||L===void 0)&&L.className.includes(this.decorationId)){const U=this.testingPeekOpenerService.peekControllerMap.get((B=this.editor.currentUri)===null||B===void 0?void 0:B.toString());U&&U.toggle(this.messageUri)}return!1}dispose(){this.codeEditorService.removeDecorationType(this.decorationId)}};n.__decorate([(0,r.Autowired)(o.MonacoOverrideServiceRegistry),n.__metadata("design:type",o.MonacoOverrideServiceRegistry)],O.prototype,"overrideServicesRegistry",void 0),n.__decorate([(0,r.Autowired)(l.TestingPeekOpenerServiceToken),n.__metadata("design:type",c.TestingPeekOpenerServiceImpl)],O.prototype,"testingPeekOpenerService",void 0),O=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object,Object,Object])],O);let M=class{get currentUri(){return this.editor.currentUri}constructor(F){this.editor=F,this.disposer=new p.Disposable,this.invalidatedMessages=new WeakSet,this.lastDecorations=[]}contribute(){return this.setDecorations(this.currentUri),this.disposer.addDispose(this.editor.monacoEditor.onDidChangeModel(F=>{this.setDecorations(F.newModelUrl||void 0)})),this.disposer.addDispose(this.editor.monacoEditor.onDidChangeModelContent(F=>{if(!this.currentUri)return;let L=!1;for(const B of F.changes)for(const U of this.lastDecorations)U instanceof O&&U.location.range.startLineNumber>=B.range.startLineNumber&&U.location.range.endLineNumber<=B.range.endLineNumber&&(this.invalidatedMessages.add(U.testMessage),L=!0);L&&this.setDecorations(this.currentUri)})),this.disposer.addDispose(this.editor.monacoEditor.onContextMenu(F=>(F.event.preventDefault(),F.event.stopPropagation(),!1))),this.disposer.addDispose(this.editor.monacoEditor.onMouseDown(F=>{for(const L of this.lastDecorations)if(L.click(F)){F.event.stopPropagation();return}})),this.disposer.addDispose(this.testResultService.onTestChanged(({item:F})=>{this.currentUri&&F.item.uri&&F.item.uri.toString()===this.currentUri.toString()&&this.setDecorations(this.currentUri)})),this.disposer.addDispose(o.Event.any(this.testResultService.onResultsChanged,this.testService.onDidProcessDiff)(()=>this.setDecorations(this.currentUri))),this.disposer}setDecorations(F){if(!F){this.clearDecorations();return}this.editor.monacoEditor.changeDecorations(L=>{var B;const U=[];for(const j of this.testService.collection.all){if(!j.item.range||((B=j.item.uri)===null||B===void 0?void 0:B.toString())!==F.toString())continue;const Q=this.testResultService.getStateById(j.item.extId),G=j.item.range.startLineNumber,Z=Q?.[1],$=U.findIndex(V=>V instanceof T&&V.line===G);$!==-1?U[$]=U[$].merge(j,Z):U.push(this.injector.get(P,[j,this.editor.monacoEditor,Q?.[1]]))}const W=this.testResultService.results[0];if(W instanceof d.TestResultImpl)for(const j of W.tests)for(let Q=0;Q<j.tasks.length;Q++){const G=j.tasks[Q];for(let Z=0;Z<G.messages.length;Z++){const $=G.messages[Z];if(!this.invalidatedMessages.has($)&&D(F,$)){const V=$.type===1?void 0:(0,h.buildTestUri)({type:1,messageIndex:Z,taskIndex:Q,resultId:W.id,testExtId:j.item.extId});U.push(this.injector.get(O,[$,V,$.location,this.editor]))}}}L.deltaDecorations(this.lastDecorations.map(j=>j.id),U.map(j=>j.editorDecoration)).forEach((j,Q)=>U[Q].id=j),this.lastDecorations=U})}clearDecorations(){this.lastDecorations.length&&this.editor.monacoEditor.changeDecorations(F=>{for(const L of this.lastDecorations)F.removeDecoration(L.id);this.lastDecorations=[]})}};t.TestDecorationsContribution=M,n.__decorate([(0,r.Autowired)(g.TestServiceToken),n.__metadata("design:type",b.TestServiceImpl)],M.prototype,"testService",void 0),n.__decorate([(0,r.Autowired)(d.TestResultServiceToken),n.__metadata("design:type",y.TestResultServiceImpl)],M.prototype,"testResultService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],M.prototype,"injector",void 0),t.TestDecorationsContribution=M=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[Object])],M)},80162:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestProfileServiceImpl=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(20215);let p=class extends o.Disposable{constructor(){super(...arguments),this.testProfiles=new Map}removeProfile(m,_){const s=this.testProfiles.get(m);if(s)if(_){const g=s.profiles.findIndex(l=>l.profileId!==_);g>=0&&s.profiles.splice(g,1)}else this.testProfiles.delete(m)}addProfile(m,_){let s=this.testProfiles.get(_.controllerId);s?(s.profiles.push(_),s.profiles.sort(a.sorter)):(s={profiles:[_],controller:m},this.testProfiles.set(_.controllerId,s))}getBaseDefaultsProfile(m){const _=[];for(const{profiles:s}of this.testProfiles.values()){const g=s.find(l=>l.group===m);g&&_.push(g)}return _}getControllerProfiles(m){const _=this.testProfiles.get(m);return _?_.profiles:[]}};t.TestProfileServiceImpl=p,t.TestProfileServiceImpl=p=n.__decorate([(0,r.Injectable)()],p)},66724:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestTreeViewModelImpl=t.TestTreeItem=void 0;const n=e(85608),r=e(76003),o=e(97267),a=e(41869),p=e(41682),v=e(72383),m=e(82423),_=e(48385),s=e(68755),g=e(4836),l={getOwnState:d=>d instanceof h?d.ownState:0,getCurrentComputedState:d=>d.state,setComputedState:(d,E)=>d.state=E,getCurrentComputedDuration:d=>d.duration,getOwnDuration:d=>d instanceof h?d.ownDuration:void 0,setComputedDuration:(d,E)=>d.duration=E,getChildren:d=>p.Iterable.filter(d.children.values(),E=>E instanceof h),*getParents(d){for(let E=d.parent;E;E=E.parent)yield E}};class h{constructor(E,f){this.test=E,this.parent=f,this.children=new Set,this.state=0,this.ownState=0,this.depth=this.parent?this.parent.depth+1:0,this.update=c=>{(0,s.applyTestItemUpdate)(this.test,c)},this.retired=!1}get label(){return this.test.item.label}get sortText(){return this.test.item.sortText}get tests(){return[this.test]}}t.TestTreeItem=h;let u=class extends a.Disposable{constructor(){super(),this.items=new Map,this.updateEmitter=new a.Emitter,this.onUpdate=this.updateEmitter.event,this.addDispose(this.testService.onDidProcessDiff(E=>this.applyDiff(E)));for(const E of this.testService.collection.all)this.didUpdateItem(this.createItem(E))}get roots(){const E=(0,a.map)(this.testService.collection.rootItems,f=>this.items.get(f.item.extId));return(0,a.filter)(E,a.isDefined)}getRevealDepth(E){return E.depth===0?0:void 0}createItem(E){const f=E.parent?this.items.get(E.parent):void 0;return new h(E,f)}findTestTreeItemByExtId(E){if(!this.treeHandlerApi||!E)return;const f=this.treeHandlerApi.getModel();if(!f)return;const c=f.root.flattenedBranch.find(b=>f.root.getTreeNodeById(b).raw.rawItem.test.item.extId===E);return f.root.getTreeNodeById(c)}didUnStoreItem(E,f){const c=f.parent;return c?.children.delete(f),E.delete(f.test.item.extId),c instanceof h&&(0,m.refreshComputedState)(l,c),f.children}async didUpdateItem(E){var f,c;(f=E.parent)===null||f===void 0||f.children.add(E),this.items.set(E.test.item.extId,E);const y=this.getRevealDepth(E);y!==void 0&&await this.expandElement(E,y);const b=(c=this.testResultService.getStateById(E.test.item.extId))===null||c===void 0?void 0:c[1];b&&(E.retired=b.retired,E.ownState=b.computedState,E.ownDuration=b.ownDuration,(0,m.refreshComputedState)(l,E))}async applyDiff(E){var f;for(const c of E)switch(c[0]){case 0:{const y=this.createItem(c[1]);await this.didUpdateItem(y);const b=this.findTestTreeItemByExtId((f=y.parent)===null||f===void 0?void 0:f.test.item.extId);b&&b.refresh();break}case 1:{const y=c[1],b=this.items.get(y.extId);if(!b)break;b.update(y);break}case 2:{const y=this.items.get(c[1]);if(!y)break;const b=this.findTestTreeItemByExtId(y.test.item.extId);b&&b.parent.unlinkItem(b);const A=[[y]];for(;A.length;)for(const S of A.pop())S instanceof h&&A.push(this.didUnStoreItem(this.items,S));break}}E.length!==0&&this.updateEmitter.fire()}listenTreeHandlerEvent(){if(this.treeHandlerApi){const E=this.treeHandlerApi.getModel();this.addDispose(E.root.watcher.on(o.TreeNodeEvent.DidChangeExpansionState,async f=>{if(f.expanded){const c=f.raw;if(c.rawItem.test.expand===0)return;await this.expandElement(c.rawItem,c.rawItem.depth),await f.refresh()}})),this.addDispose(this.testResultService.onTestChanged(({item:f})=>{if(f.ownComputedState===0){const b=this.testResultService.getStateById(f.item.extId);b&&(f=b[1])}const c=this.items.get(f.item.extId);if(!c)return;c.retired=f.retired,c.ownState=f.ownComputedState,c.ownDuration=f.ownDuration;const y=c.children.size?void 0:f.computedState;(0,m.refreshComputedState)(l,c,y),E.dispatchChange(),this.revealTreeById(f.item.extId,!1,!1),this.updateEmitter.fire()})),this.addDispose(this.testResultService.onResultsChanged(f=>{var c,y;if("removed"in f){for(const b of[...this.items.values()].sort((A,S)=>S.depth-A.depth)){const A=(c=this.testResultService.getStateById(b.test.item.extId))===null||c===void 0?void 0:c[1];b.ownDuration=A?.ownDuration,(0,m.refreshComputedState)(l,b,(y=A?.ownComputedState)!==null&&y!==void 0?y:0)}E.dispatchChange(),this.updateEmitter.fire()}}))}}revealTreeById(E,f=!0,c=!0){}getTestItem(E){return this.testService.collection.getNodeById(E)}getTestTreeItem(E){return this.items.get(E)}expandElement(E,f){return!(E instanceof h)||E.test.expand===0?Promise.resolve():this.testService.collection.expand(E.test.item.extId,f)}initTreeModel(){return Promise.resolve()}setTreeHandlerApi(E){this.treeHandlerApi=E,this.listenTreeHandlerEvent()}};t.TestTreeViewModelImpl=u,n.__decorate([(0,r.Autowired)(v.TestServiceToken),n.__metadata("design:type",Object)],u.prototype,"testService",void 0),n.__decorate([(0,r.Autowired)(_.TestResultServiceToken),n.__metadata("design:type",g.TestResultServiceImpl)],u.prototype,"testResultService",void 0),t.TestTreeViewModelImpl=u=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],u)},4836:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestResultServiceImpl=t.isRunningTests=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(12288),p=e(20215),v=e(48385),m=e(33429),_=e(1031),{findFirstInSorted:s}=o.arrays,g=h=>h.results.length>0&&h.results[0].completedAt===void 0;t.isRunningTests=g;let l=class{get results(){return this._results}constructor(){this.changeResultEmitter=new o.Emitter,this.testChangeEmitter=new o.Emitter,this._results=[],this.onResultsChanged=this.changeResultEmitter.event,this.onTestChanged=this.testChangeEmitter.event,this.hasAnyResults=a.TestingHasAnyResults.bind(this.contextKeyService),this.isRunning=a.TestingIsRunning.bind(this.contextKeyService)}onComplete(u){this.resort(),this.updateIsRunning(),this.changeResultEmitter.fire({completed:u})}resort(){this.results.sort((u,d)=>{var E,f;return((E=d.completedAt)!==null&&E!==void 0?E:Number.MAX_SAFE_INTEGER)-((f=u.completedAt)!==null&&f!==void 0?f:Number.MAX_SAFE_INTEGER)})}updateIsRunning(){this.isRunning.set((0,t.isRunningTests)(this))}retrieveTest(u){var d;const E=(0,m.parseTestUri)(u);if(!E)return;const{resultId:f,testExtId:c,taskIndex:y,messageIndex:b}=E,A=(d=this.getResult(E.resultId))===null||d===void 0?void 0:d.getStateById(c);if(!(!A||!A.tasks[E.taskIndex]))return new _.TestDto(f,A,y,b)}createTestResult(u){if("targets"in u){const c=(0,o.uuid)(),y=new v.TestResultImpl(c,u);return this.addTestResult(y),y}let d;u.profile&&(d=this.testProfiles.getControllerProfiles(u.controllerId).find(y=>y.profileId===u.profile.id));const E={targets:[],exclude:u.exclude,isAutoRun:!1};d&&E.targets.push({profileGroup:d.group,profileId:d.profileId,controllerId:u.controllerId,testIds:u.include});const f=new v.TestResultImpl(u.id,E);return this.addTestResult(f),f}getResult(u){return this.results.find(d=>d.id===u)}addTestResult(u){if(u.completedAt===void 0)this.results.unshift(u);else{const d=s(this.results,E=>E.completedAt!==void 0&&E.completedAt<=u.completedAt);this.results.splice(d,0,u)}if(this.hasAnyResults.set(!0),u instanceof v.TestResultImpl)u.onComplete(()=>this.onComplete(u)),u.onChange(this.testChangeEmitter.fire,this.testChangeEmitter),this.isRunning.set(!0),this.changeResultEmitter.fire({started:u});else{this.changeResultEmitter.fire({inserted:u});for(const d of u.tests)for(const E of this.results)if(E===u){this.testChangeEmitter.fire({item:d,result:u,reason:2});break}else if(E.getStateById(d.item.extId)!==void 0)break}return u}getStateById(u){for(const d of this.results){const E=d.getStateById(u);if(E&&E.computedState!==0)return[d,E]}}clear(){const u=[],d=[];for(const E of this.results)E.completedAt!==void 0?d.push(E):u.push(E);this._results=u,u.length===0&&this.hasAnyResults.set(!1),this.changeResultEmitter.fire({removed:d})}};t.TestResultServiceImpl=l,n.__decorate([(0,r.Autowired)(p.TestProfileServiceToken),n.__metadata("design:type",Object)],l.prototype,"testProfiles",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],l.prototype,"contextKeyService",void 0),t.TestResultServiceImpl=l=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],l)},86457:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestServiceImpl=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(53736),p=e(12288),v=e(63067),m=e(72383),_=e(20215),s=e(48385),g=e(68755),l=e(95381),h=e(76028);let u=class extends o.Disposable{constructor(){super(),this.controllers=new Map,this.processDiffEmitter=new o.Emitter,this.viewId="",this.collection=new g.MainThreadTestCollection(this.expandTest.bind(this)),this.onDidProcessDiff=this.processDiffEmitter.event,this.controllerCount=p.TestingServiceProviderCount.bind(this.contextKeyService),this.canRefreshTests=p.TestingCanRefreshTests.bind(this.contextKeyService)}getTestController(E){return this.controllers.get(E)}async refreshTests(E){var f;const c=new o.CancellationTokenSource;try{E?await((f=this.controllers.get(E))===null||f===void 0?void 0:f.refreshTests(c.token)):await Promise.all([...this.controllers.values()].map(y=>y.refreshTests(c.token)))}finally{c.dispose(!0)}}registerTestingExplorerView(){return this.mainlayoutService.collectViewComponent,this.mainlayoutService.collectTabbarComponent([{id:l.TestingContainerId}],{iconClass:(0,o.getIcon)("test"),title:(0,o.localize)("test.title"),priority:1,containerId:"workbench.view.testing",component:h.TestingView,activateKeyBinding:"ctrlcmd+shift+t"},o.SlotLocation.left)}registerTestController(E,f){this.controllers.set(E,f),this.controllerCount.set(this.controllers.size),this.updateCanRefresh(),this.controllers.size>0&&!this.viewId&&(this.viewId=this.registerTestingExplorerView());const c=new o.Disposable;return c.addDispose(o.Disposable.create(()=>{const y=[];for(const b of this.collection.rootItems)b.controllerId===E&&y.push([2,b.item.extId]);this.publishDiff(E,y),this.controllers.delete(E)&&(this.controllerCount.set(this.controllers.size),this.updateCanRefresh(),this.controllers.size===0&&this.viewId&&this.mainlayoutService.disposeContainer(this.viewId))})),c.addDispose(f.canRefresh.onDidChange(this.updateCanRefresh,this)),c}updateCanRefresh(){this.canRefreshTests.set(Array.from(this.controllers.values()).some(E=>E.canRefresh))}async expandTest(E,f){var c;await((c=this.controllers.get(m.TestId.fromString(E).controllerId))===null||c===void 0?void 0:c.expandTest(E,f))}publishDiff(E,f){this.collection.apply(f),this.processDiffEmitter.fire(f)}runTests(E,f=o.CancellationToken.None){var c;const y={targets:[],exclude:(c=E.exclude)===null||c===void 0?void 0:c.map(A=>A.item.extId),isAutoRun:E.isAutoRun},b=this.testProfiles.getBaseDefaultsProfile(E.group);for(const A of b){const S=E.tests.filter(D=>(0,_.canUseProfileWithTest)(A,D)).map(D=>D.item.extId);y.targets.push({testIds:S,profileGroup:A.group,profileId:A.profileId,controllerId:A.controllerId})}return this.runResolvedTests(y,f)}async runResolvedTests(E,f){E.exclude||(E.exclude=[]);const c=this.resultService.createTestResult(E);try{const y=new o.CancellationTokenSource(f),b=E.targets.map(A=>{var S;return(S=this.controllers.get(A.controllerId))===null||S===void 0?void 0:S.runTests({runId:c.id,excludeExtIds:E.exclude.filter(D=>!A.testIds.includes(D)),profileId:A.profileId,controllerId:A.controllerId,testIds:A.testIds},y.token).catch(()=>{})});return await Promise.all(b),c}finally{c.markComplete()}}};t.TestServiceImpl=u,n.__decorate([(0,r.Autowired)(v.IMainLayoutService),n.__metadata("design:type",Object)],u.prototype,"mainlayoutService",void 0),n.__decorate([(0,r.Autowired)(s.TestResultServiceToken),n.__metadata("design:type",Object)],u.prototype,"resultService",void 0),n.__decorate([(0,r.Autowired)(_.TestProfileServiceToken),n.__metadata("design:type",Object)],u.prototype,"testProfiles",void 0),n.__decorate([(0,r.Autowired)(a.IContextKeyService),n.__metadata("design:type",Object)],u.prototype,"contextKeyService",void 0),t.TestServiceImpl=u=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],u)},76388:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestingContribution=t.TestingOutputPeekDocumentProvider=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(30144),p=e(12288),v=e(93899),m=e(43718),_=e(57517),s=e(14951),g=e(63067),l=e(93835),h=e(81001),u=e(72383),d=e(85941),E=e(48385),f=e(57879),c=e(16558),y=e(33429),b=e(1031),A=e(89872),S=e(33218),D=e(17482),I=e(4836),w=e(86457);let T=class{constructor(){this._onDidChangeContent=new m.Emitter,this.onDidChangeContent=this._onDidChangeContent.event}provideEditorDocumentModelContent(O,M){const k=this.testResultService.retrieveTest(O);if(!k)return"";const F=k.messages[k.messageIndex];if(k.isDiffable||typeof F.message=="string")return"";const L=F.message;return L?L.value.replace(/\t/g,""):""}isReadonly(O){return!0}handlesScheme(O){return O===y.TEST_DATA_SCHEME}};t.TestingOutputPeekDocumentProvider=T,n.__decorate([(0,r.Autowired)(E.TestResultServiceToken),n.__metadata("design:type",I.TestResultServiceImpl)],T.prototype,"testResultService",void 0),t.TestingOutputPeekDocumentProvider=T=n.__decorate([(0,r.Injectable)()],T);let R=class{initialize(){this.testTreeViewModel.initTreeModel()}registerTestResultPanel(){if(this.layoutService.getTabbarHandler(a.TEST_RESULT_CONTAINER_ID))return;const O=this.layoutService.collectTabbarComponent([{id:a.TEST_RESULT_CONTAINER_ID,component:S.TestResultPanel}],{containerId:a.TEST_RESULT_CONTAINER_ID,title:(0,o.localize)("test.results"),hidden:!1},"bottom"),M=this.layoutService.getTabbarHandler(O);M?.activate()}onDidStart(){this.testResultService.onResultsChanged(()=>{this.registerTestResultPanel()}),this.testResultService.onTestChanged(()=>{this.registerTestResultPanel()})}registerCommands(O){O.registerCommand(d.RuntTestCommand,{execute:async F=>{const L=this.testTreeViewModel.getTestItem(F);L&&await this.testService.runTests({group:2,tests:[L]})}}),O.registerCommand(d.DebugTestCommand,{execute:async F=>{const L=this.testTreeViewModel.getTestItem(F);L&&await this.testService.runTests({group:4,tests:[L]})}}),O.registerCommand(d.GoToTestCommand,{execute:async F=>{const L=this.testTreeViewModel.getTestItem(F);if(!L)return;const{range:B,uri:U}=L.item;if(!U)return;const W=await this.filesystem.getFileStat(U.toString());if(W){if(W.type===o.FileType.Directory){this.commandService.executeCommand("revealInExplorer",U);return}W.type===o.FileType.File&&this.commandService.executeCommand(o.EDITOR_COMMANDS.OPEN_RESOURCE.id,o.URI.parse(U.toString()),{range:B,focus:!0})}},isVisible:()=>!1}),O.registerCommand(d.PeekTestError,{execute:async F=>{this.testingPeekOpenerService.open()},isVisible:()=>!1}),O.registerCommand(d.ClosePeekTest,{execute:async F=>{var L,B;if(F=F??((B=(L=this.editorService.currentEditor)===null||L===void 0?void 0:L.currentUri)===null||B===void 0?void 0:B.toString()),!F)return;const U=this.testingPeekOpenerService.peekControllerMap.get(F);U&&U.removePeek()},isVisible:()=>!1}),O.registerCommand(d.TestingRunCurrentFile,{execute:async()=>{M(2)}}),O.registerCommand(d.TestingDebugCurrentFile,{execute:async()=>{M(4)}});const M=F=>{var L;const B=this.editorService.currentEditor,U=B?.monacoEditor,W=U?.getPosition(),j=U?.getModel();if(!W||!j||!("uri"in j))return;const Q=j.uri.toString();for(const G of this.testService.collection.all)((L=G.item.uri)===null||L===void 0?void 0:L.toString())===Q&&this.testService.runTests({tests:[G],group:F})};O.registerCommand(d.GoToPreviousMessage,{execute:async F=>{var L,B;if(F=F??((B=(L=this.editorService.currentEditor)===null||L===void 0?void 0:L.currentUri)===null||B===void 0?void 0:B.toString()),!F)return;const U=this.testingPeekOpenerService.peekControllerMap.get(F);U&&U.previous()}}),O.registerCommand(d.GoToNextMessage,{execute:async F=>{var L,B;if(F=F??((B=(L=this.editorService.currentEditor)===null||L===void 0?void 0:L.currentUri)===null||B===void 0?void 0:B.toString()),!F)return;const U=this.testingPeekOpenerService.peekControllerMap.get(F);U&&U.next()}}),O.registerCommand(d.ClearTestResults,{execute:async F=>{this.testResultService.clear(),this.commandService.executeCommand(d.ClosePeekTest.id,F)}}),O.registerCommand(d.OpenMessageInEditor,{execute:async F=>{var L,B;if(F=F??((B=(L=this.editorService.currentEditor)===null||L===void 0?void 0:L.currentUri)===null||B===void 0?void 0:B.toString()),!F)return;const U=this.testingPeekOpenerService.peekControllerMap.get(F);U&&U.openCurrentInEditor()}});const k=async F=>{const L=[...this.testService.collection.rootItems];L.length&&await this.testService.runTests({tests:L,group:F})};O.registerCommand(d.RefreshTestsCommand,{execute:async()=>{await this.testService.refreshTests()}}),O.registerCommand(d.RuntAllTestCommand,{execute:async()=>{await k(2)}}),O.registerCommand(d.DebugAllTestCommand,{execute:async()=>{await k(4)}})}registerKeybindings(O){O.registerKeybinding({command:d.ClosePeekTest.id,keybinding:"esc",when:p.TestingIsPeekVisible.equalsTo(!0)})}registerMenus(O){O.registerMenuItem(v.MenuId.TestingGlyphMarginContext,{command:d.RuntTestCommand.id,group:"1_has_decoration",order:1}),O.registerMenuItem(v.MenuId.TestingGlyphMarginContext,{command:d.DebugTestCommand.id,group:"1_has_decoration",order:2}),O.registerMenuItem(v.MenuId.TestPeekTitleContext,{command:d.GoToPreviousMessage.id,iconClass:d.GoToPreviousMessage.iconClass,group:"navigation",order:5}),O.registerMenuItem(v.MenuId.TestPeekTitleContext,{command:d.GoToNextMessage.id,iconClass:d.GoToNextMessage.iconClass,group:"navigation",order:6}),O.registerMenuItem(v.MenuId.TestPeekTitleContext,{command:d.ClearTestResults.id,iconClass:d.ClearTestResults.iconClass,group:"navigation",order:7}),O.registerMenuItem(v.MenuId.TestPeekTitleContext,{command:d.OpenMessageInEditor.id,iconClass:d.OpenMessageInEditor.iconClass,group:"navigation",order:9})}registerToolbarItems(O){O.registerItem({id:d.RefreshTestsCommand.id,command:d.RefreshTestsCommand.id,viewId:"workbench.view.testing",when:p.TestingCanRefreshTests.equalsTo(!0)}),O.registerItem({id:d.RuntAllTestCommand.id,command:d.RuntAllTestCommand.id,viewId:"workbench.view.testing"}),O.registerItem({id:d.DebugAllTestCommand.id,command:d.DebugAllTestCommand.id,viewId:"workbench.view.testing"}),O.registerItem({id:d.ClearTestResults.id,command:d.ClearTestResults.id,viewId:"workbench.view.testing"})}registerEditorFeature(O){O.registerEditorFeatureContribution({contribute:M=>this.injector.get(D.TestDecorationsContribution,[M]).contribute()}),O.registerEditorFeatureContribution({contribute:M=>this.injector.get(b.TestOutputPeekContribution,[M]).contribute()})}registerEditorDocumentModelContentProvider(O){O.registerEditorDocumentModelContentProvider(this.testingOutputPeekDocumentProvider)}registerEditorComponent(O){O.registerEditorComponent({uid:l.MARKDOWN_EDITOR_COMPONENT_ID,component:h.MarkdownEditorComponent,scheme:y.TEST_DATA_SCHEME}),O.registerEditorComponentResolver(y.TEST_DATA_SCHEME,(M,k)=>{k.push({type:_.EditorOpenType.component,componentId:l.MARKDOWN_EDITOR_COMPONENT_ID,weight:10})})}registerResource(O){O.registerResourceProvider({scheme:y.TEST_DATA_SCHEME,provideResource:async M=>({uri:M,icon:(0,o.getIcon)("file-text"),name:`Preview ${M.displayName}`})})}};t.TestingContribution=R,n.__decorate([(0,r.Autowired)(c.TestTreeViewModelToken),n.__metadata("design:type",Object)],R.prototype,"testTreeViewModel",void 0),n.__decorate([(0,r.Autowired)(s.IFileServiceClient),n.__metadata("design:type",Object)],R.prototype,"filesystem",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],R.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],R.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(f.TestingPeekOpenerServiceToken),n.__metadata("design:type",A.TestingPeekOpenerServiceImpl)],R.prototype,"testingPeekOpenerService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",T)],R.prototype,"testingOutputPeekDocumentProvider",void 0),n.__decorate([(0,r.Autowired)(_.WorkbenchEditorService),n.__metadata("design:type",_.WorkbenchEditorService)],R.prototype,"editorService",void 0),n.__decorate([(0,r.Autowired)(u.TestServiceToken),n.__metadata("design:type",w.TestServiceImpl)],R.prototype,"testService",void 0),n.__decorate([(0,r.Autowired)(E.TestResultServiceToken),n.__metadata("design:type",I.TestResultServiceImpl)],R.prototype,"testResultService",void 0),n.__decorate([(0,r.Autowired)(g.IMainLayoutService),n.__metadata("design:type",Object)],R.prototype,"layoutService",void 0),t.TestingContribution=R=n.__decorate([(0,r.Injectable)(),(0,o.Domain)(o.ClientAppContribution,o.CommandContribution,_.BrowserEditorContribution,v.MenuContribution,o.KeybindingContribution,o.TabBarToolbarContribution)],R)},85941:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RefreshTestsCommand=t.DebugAllTestCommand=t.RuntAllTestCommand=t.OpenMessageInEditor=t.ClearTestResults=t.GoToNextMessage=t.GoToPreviousMessage=t.ClosePeekTest=t.PeekTestError=t.TestingDebugCurrentFile=t.TestingRunCurrentFile=t.GoToTestCommand=t.DebugTestCommand=t.RuntTestCommand=void 0;const n=e(41869);t.RuntTestCommand={id:"testing.run.test",label:"Run Test"},t.DebugTestCommand={id:"testing.debug.test",label:"Debug Test"},t.GoToTestCommand={id:"testing.goto.test",label:"Go To Test"},t.TestingRunCurrentFile={id:"testing.runCurrentFile",label:"Run Tests in Current File"},t.TestingDebugCurrentFile={id:"testing.debugCurrentFile",label:"Debug Tests in Current File"},t.PeekTestError={id:"testing.peek.test.error",label:"Peek Output"},t.ClosePeekTest={id:"testing.peek.test.close",label:"Close Peek Output"},t.GoToPreviousMessage={id:"testing.goToPreviousMessage",label:"Go to Previous Test Failure",iconClass:(0,n.getIcon)("arrowup")},t.GoToNextMessage={id:"testing.goToNextMessage",label:"Go to Next Test Failure",iconClass:(0,n.getIcon)("arrowdown")},t.ClearTestResults={id:"testing.clearTestResults",label:"Clear All Results",iconClass:(0,n.getExternalIcon)("clear-all")},t.OpenMessageInEditor={id:"testing.openMessageInEditor",label:"Open in Editor",iconClass:(0,n.getExternalIcon)("link-external")},t.RuntAllTestCommand={id:"testing.runAll",label:"Run All Test",iconClass:(0,n.getExternalIcon)("run-all")},t.DebugAllTestCommand={id:"testing.debugAll",label:"Debug All Test",iconClass:(0,n.getIcon)("debug-alt-small")},t.RefreshTestsCommand={id:"testing.refresshTests",label:"Refresh Tests",iconClass:(0,n.getIcon)("refresh")}},61090:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testMessageSeverityColors=t.testConfigurationGroupNames=t.labelForTestInState=t.testStateNames=void 0;const n=e(43718);t.testStateNames={6:(0,n.localize)("testState.errored","Errored"),4:(0,n.localize)("testState.failed","Failed"),3:(0,n.localize)("testState.passed","Passed"),1:(0,n.localize)("testState.queued","Queued"),2:(0,n.localize)("testState.running","Running"),5:(0,n.localize)("testState.skipped","Skipped"),0:(0,n.localize)("testState.unset","Not yet run")};const r=(o,a)=>'label then the unit tests state, for example "Addition Tests (Running)"';t.labelForTestInState=r,t.testConfigurationGroupNames={4:(0,n.localize)("testGroup.debug","Debug"),2:(0,n.localize)("testGroup.run","Run"),8:(0,n.localize)("testGroup.coverage","Coverage")},t.testMessageSeverityColors={0:"#F14C4C",1:"#33333380"}},82423:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refreshComputedState=t.getComputedDuration=t.getComputedState=t.isDurationAccessor=void 0;const n=e(41682),r=e(92597),o=m=>"getOwnDuration"in m;t.isDurationAccessor=o;const a=(m,_,s=!1)=>{var g;let l=m.getCurrentComputedState(_);if(l===void 0||s){l=(g=m.getOwnState(_))!==null&&g!==void 0?g:0;for(const h of m.getChildren(_))l=(0,r.maxPriority)(l,(0,t.getComputedState)(m,h));m.setComputedState(_,l)}return l};t.getComputedState=a;const p=(m,_,s=!1)=>{let g=m.getCurrentComputedDuration(_);if(g===void 0||s){const l=m.getOwnDuration(_);if(l!==void 0)g=l;else{g=void 0;for(const h of m.getChildren(_)){const u=(0,t.getComputedDuration)(m,h);u!==void 0&&(g=(g||0)+u)}}m.setComputedDuration(_,g)}return g};t.getComputedDuration=p;const v=(m,_,s)=>{const g=m.getCurrentComputedState(_),l=r.statePriority[g],h=s??(0,t.getComputedState)(m,_,!0),u=r.statePriority[h],d=new Set;if(u!==l){if(m.setComputedState(_,h),d.add(_),u>l)for(const E of m.getParents(_)){const f=m.getCurrentComputedState(E);if(f!==void 0&&r.statePriority[f]>=u)break;m.setComputedState(E,h),d.add(E)}else if(u<l)for(const E of m.getParents(_)){const f=m.getCurrentComputedState(E);if(f===void 0||r.statePriority[f]>l)break;m.setComputedState(E,(0,t.getComputedState)(m,E,!0)),d.add(E)}}if((0,t.isDurationAccessor)(m))for(const E of n.Iterable.concat(n.Iterable.single(_),m.getParents(_))){const f=m.getCurrentComputedDuration(E),c=(0,t.getComputedDuration)(m,E,!0);if(f===c)break;m.setComputedDuration(E,c),d.add(E)}return d};t.refreshComputedState=v},72383:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestPeekMessageToken=t.TestDecorationsToken=t.TestServiceToken=void 0,e(85608).__exportStar(e(87902),t),t.TestServiceToken=Symbol("TestService"),t.TestDecorationsToken=Symbol("TestDecorationsToken"),t.TestPeekMessageToken=Symbol("TestPeekMessageToken")},30005:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableValue=void 0;const n=e(43718);class r extends n.Disposable{get value(){return this._value}set value(a){a!==this._value&&(this._value=a,this.changeEmitter.fire(a))}constructor(a){super(),this._value=a,this.changeEmitter=this.registerDispose(new n.Emitter),this.onDidChange=this.changeEmitter.event}}t.ObservableValue=r},20215:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestProfileServiceToken=t.canUseProfileWithTest=t.sorter=void 0;const n=e(48465),r=(a,p)=>a.isDefault!==p.isDefault?a.isDefault?-1:1:a.label.localeCompare(p.label);t.sorter=r;const o=(a,p)=>a.controllerId===p.controllerId&&(n.TestId.isRoot(p.item.extId)||!a.tag||p.item.tags.includes(a.tag));t.canUseProfileWithTest=o,t.TestProfileServiceToken=Symbol("TestProfileService")},48385:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestResultImpl=t.resultItemParents=t.maxCountPriority=t.TestResultServiceToken=t.makeEmptyCounts=void 0;const n=e(43718),r=e(82423),o=e(92597),a=()=>{const s={};for(const g of o.statesInOrder)s[g]=0;return s};t.makeEmptyCounts=a,t.TestResultServiceToken=Symbol("TestResultService");const p=(s,g,l)=>({parent:l,controllerId:s,expand:0,item:{...g},children:[],tasks:[],ownComputedState:0,computedState:0,retired:!1}),v=s=>{for(const g of o.statesInOrder)if(s[g]>0)return g;return 0};t.maxCountPriority=v;const m=function*(s,g){let l=g;for(;l;)yield l,l=l.parent?s.getStateById(l.parent):void 0};t.resultItemParents=m;class _{get completedAt(){return this._completedAt}get tests(){return this.testById.values()}constructor(g,l){this.id=g,this.request=l,this.completeEmitter=new n.Emitter,this.changeEmitter=new n.Emitter,this.testById=new Map,this.name=(0,n.formatLocalize)("test.result.runFinished",new Date().toLocaleString()),this.tasks=[],this.onChange=this.changeEmitter.event,this.onComplete=this.completeEmitter.event,this.counts=(0,t.makeEmptyCounts)(),this.outputs=[],this.computedStateAccessor={getOwnState:h=>h.ownComputedState,getCurrentComputedState:h=>h.computedState,setComputedState:(h,u)=>h.computedState=u,getChildren:h=>h.children,getParents:h=>{const{testById:u}=this;return function*(){for(let d=h.parent;d;){const E=u.get(d);if(!E)break;yield E,d=E.parent}}()}}}setAllToState(g,l,h){const u=this.mustGetTaskIndex(l);for(const d of this.testById.values())h(d.tasks[u],d)&&this.fireUpdateAndRefresh(d,u,g)}addTestToRun(g,l,h){var u;const d=p(g,l,h);return this.testById.set(l.extId,d),this.counts[0]++,h&&((u=this.testById.get(h))===null||u===void 0||u.children.push(d)),this.tasks.length&&this.tasks.forEach(()=>{d.tasks.push({duration:void 0,messages:[],state:1})}),d}mustGetTaskIndex(g){const l=this.tasks.findIndex(h=>h.id===g);if(l===-1)throw new Error(`Unknown task ${g} in updateState`);return l}fireUpdateAndRefresh(g,l,h){const u=g.ownComputedState;g.tasks[l].state=h;const d=(0,o.maxPriority)(...g.tasks.map(E=>E.state));d!==u&&(g.ownComputedState=d,this.counts[u]--,this.counts[d]++,(0,r.refreshComputedState)(this.computedStateAccessor,g).forEach(E=>this.changeEmitter.fire(E===g?{item:g,result:this,reason:3,previous:u}:{item:E,result:this,reason:2})))}getStateById(g){return this.testById.get(g)}getOutput(){return this.outputs.join("")}toJSON(){throw new Error("Method not implemented.")}updateState(g,l,h,u){const d=this.testById.get(g);if(!d)return;const E=this.mustGetTaskIndex(l);u!==void 0&&(d.tasks[E].duration=u,d.ownDuration=Math.max(d.ownDuration||0,u)),this.fireUpdateAndRefresh(d,E,h)}appendMessage(g,l,h){const u=this.testById.get(g);u&&(u.tasks[this.mustGetTaskIndex(l)].messages.push(h),this.changeEmitter.fire({item:u,result:this,reason:3,previous:u.ownComputedState}))}appendOutput(g,l,h,u){this.outputs.push(g)}addTestChainToRun(g,l){let h=this.testById.get(l[0].extId);h||(h=this.addTestToRun(g,l[0],null));for(let u=1;u<l.length;u++)h=this.addTestToRun(g,l[u],h.item.extId);for(let u=0;u<this.tasks.length;u++)this.fireUpdateAndRefresh(h,u,1)}addTask(g){const l=this.tasks.length;this.tasks.push({...g,coverage:void 0,otherMessages:[]});for(const h of this.tests)h.tasks.push({duration:void 0,messages:[],state:0}),this.fireUpdateAndRefresh(h,l,1)}markTaskComplete(g){this.tasks[this.mustGetTaskIndex(g)].running=!1,this.setAllToState(0,g,l=>l.state===1||l.state===2)}markComplete(){if(this._completedAt!==void 0)throw new Error("cannot complete a test result multiple times");for(const g of this.tasks)g.running&&this.markTaskComplete(g.id);this._completedAt=Date.now(),this.completeEmitter.fire()}}t.TestResultImpl=_},68755:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadTestCollection=t.AbstractIncrementalTestCollection=t.IncrementalChangeCollector=t.applyTestItemUpdate=t.testRunProfileBitsetList=void 0;const n=e(43718);t.testRunProfileBitsetList=[2,4,8,16];const r=(v,m)=>{m.expand!==void 0&&(v.expand=m.expand),m.item!==void 0&&(v.item=v.item?Object.assign(v.item,m.item):m.item)};t.applyTestItemUpdate=r;class o{add(m){}update(m){}remove(m,_){}complete(){}}t.IncrementalChangeCollector=o;class a{constructor(){this._tags=new Map,this.items=new Map,this.roots=new Set,this.busyControllerCount=0,this.pendingRootCount=0,this.tags=this._tags}apply(m){const _=this.createChangeCollector();for(const s of m)switch(s[0]){case 0:{const g=s[1];if(g.parent){if(this.items.has(g.parent)){const l=this.items.get(g.parent);l.children.add(g.item.extId);const h=this.createItem(g,l);this.items.set(g.item.extId,h),_.add(h)}}else{const l=this.createItem(g);this.roots.add(l),this.items.set(g.item.extId,l),_.add(l)}g.expand===2&&this.busyControllerCount++;break}case 1:{const g=s[1],l=this.items.get(g.extId);if(!l)break;g.expand!==void 0&&(l.expand===2&&this.busyControllerCount--,g.expand===2&&this.busyControllerCount++),(0,t.applyTestItemUpdate)(l,g),_.update(l);break}case 2:{const g=this.items.get(s[1]);if(!g)break;g.parent?this.items.get(g.parent).children.delete(g.item.extId):this.roots.delete(g);const l=[[s[1]]];for(;l.length;)for(const h of l.pop()){const u=this.items.get(h);u&&(l.push(u.children),this.items.delete(h),_.remove(u,u!==g),u.expand===2&&this.busyControllerCount--)}break}case 4:this.retireTest(s[1]);break;case 3:this.updatePendingRoots(s[1]);break;case 5:this._tags.set(s[1].id,s[1]);break;case 6:this._tags.delete(s[1]);break}_.complete()}retireTest(m){}updatePendingRoots(m){this.pendingRootCount+=m}createChangeCollector(){return new o}}t.AbstractIncrementalTestCollection=a;class p extends a{get busyProviders(){return this.busyControllerCount}get rootItems(){return this.roots}get all(){return this.getIterator()}get rootIds(){return(0,n.map)(this.roots.values(),m=>m.item.extId)}constructor(m){super(),this.expandActual=m,this.busyProvidersChangeEmitter=new n.Emitter,this.retireTestEmitter=new n.Emitter,this.expandPromises=new WeakMap,this.onBusyProvidersChange=this.busyProvidersChangeEmitter.event,this.onDidRetireTest=this.retireTestEmitter.event}expand(m,_){const s=this.items.get(m);if(!s)return Promise.resolve();const g=this.expandPromises.get(s);if(g&&g.pendingLvl>=_)return g.prom;const l=this.expandActual(s.item.extId,_),h={doneLvl:g?g.doneLvl:-1,pendingLvl:_,prom:l};return this.expandPromises.set(s,h),l.then(()=>{h.doneLvl=_})}getNodeById(m){return this.items.get(m)}getReviverDiff(){const m=[[3,this.pendingRootCount]],_=[this.rootIds];for(;_.length;)for(const s of _.pop()){const g=this.items.get(s);m.push([0,{controllerId:g.controllerId,expand:g.expand,item:g.item,parent:g.parent}]),_.push(g.children)}return m}apply(m){const _=this.busyControllerCount;super.apply(m),_!==this.busyControllerCount&&this.busyProvidersChangeEmitter.fire(this.busyControllerCount)}clear(){const m=[];for(const _ of this.roots)m.push([2,_.item.extId]);return this.roots.clear(),this.items.clear(),m}createItem(m){return{...m,children:new Set}}retireTest(m){this.retireTestEmitter.fire(m)}*getIterator(){const m=[this.rootIds];for(;m.length;)for(const _ of m.pop()){const s=this.getNodeById(_);yield s,m.push(s.children)}}}t.MainThreadTestCollection=p},87902:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestId=void 0;class e{static fromExtHostTestItem(r,o,a=r.parent){if(r.id===o)return new e([o]);const p=[r.id];for(let v=a;v&&v.id!==o;v=v.parent)p.push(v.id);return p.push(o),new e(p.reverse())}static isRoot(r){return!r.includes("\0")}static fromString(r){return new e(r.split("\0"))}static join(r,o){return new e([...r.path,o])}static joinToString(r,o){return r.toString()+"\0"+o}static compare(r,o){return r===o?0:o.startsWith(r+"\0")?2:r.startsWith(o+"\0")?3:1}constructor(r,o=r.length){if(this.path=r,this.viewEnd=o,r.length===0||o<1)throw new Error("cannot create test with empty path")}get parentId(){return this.viewEnd>1?new e(this.path,this.viewEnd-1):this}get localId(){return this.path[this.viewEnd-1]}get controllerId(){return this.path[0]}get isRoot(){return this.viewEnd===1}*idsFromRoot(){for(let r=1;r<=this.viewEnd;r++)yield new e(this.path,r)}compare(r){if(typeof r=="string")return e.compare(this.toString(),r);for(let o=0;o<r.viewEnd&&o<this.viewEnd;o++)if(r.path[o]!==this.path[o])return 1;return r.viewEnd>this.viewEnd?2:r.viewEnd<this.viewEnd?3:0}toJSON(){return this.toString()}toString(){if(!this.stringifed){this.stringifed=this.path[0];for(let r=1;r<this.viewEnd;r++)this.stringifed+="\0",this.stringifed+=this.path[r]}return this.stringifed}}t.TestId=e},95381:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestingExplorerInlineMenus=t.TestingContainerId=t.TestingViewId=void 0;const n=e(97267),r=e(85941);t.TestingViewId="@opensumi/ide-testing",t.TestingContainerId="testing",t.TestingExplorerInlineMenus=[{icon:"start",title:"Run Test",command:r.RuntTestCommand.id,position:n.IBasicInlineMenuPosition.TREE_CONTAINER},{icon:"debug-alt-small",title:"Debug Test",command:r.DebugTestCommand.id,position:n.IBasicInlineMenuPosition.TREE_CONTAINER},{icon:"openfile",title:"Go To Test",command:r.GoToTestCommand.id,position:n.IBasicInlineMenuPosition.TREE_CONTAINER}]},57879:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestingPeekOpenerServiceToken=void 0,t.TestingPeekOpenerServiceToken=Symbol("TestingPeekOpenerService")},92597:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hintMessagePeekHeight=t.isDiffable=t.parseMarkdownText=t.firstLine=t.isRunningState=t.statesInOrder=t.maxPriority=t.cmpPriority=t.stateNodes=t.isStateWithResult=t.isFailedState=t.statePriority=void 0;const n=e(84605),r=e(43718),{count:o}=r.strings;t.statePriority={2:6,6:5,4:4,1:3,3:2,0:1,5:0};const a=E=>E===6||E===4;t.isFailedState=a;const p=E=>E===6||E===4||E===3;t.isStateWithResult=p,t.stateNodes=Object.entries(t.statePriority).reduce((E,[f,c])=>{const y=Number(f);return E[y]={statusNode:!0,state:y,priority:c},E},{});const v=(E,f)=>t.statePriority[f]-t.statePriority[E];t.cmpPriority=v;const m=(...E)=>{switch(E.length){case 0:return 0;case 1:return E[0];case 2:return t.statePriority[E[0]]>t.statePriority[E[1]]?E[0]:E[1];default:{let f=E[0];for(let c=1;c<E.length;c++)t.statePriority[f]<t.statePriority[E[c]]&&(f=E[c]);return f}}};t.maxPriority=m,t.statesInOrder=Object.keys(t.statePriority).map(E=>Number(E)).sort(t.cmpPriority);const _=E=>E===1||E===2;t.isRunningState=_;const s=E=>{const f=E.indexOf(`
|
|
32367
32367
|
`);return f===-1?E:E.slice(0,f)};t.firstLine=s;const g=new DOMParser,l=async E=>{const f=(0,n.parseMarkdown)(E),c=typeof f=="string"?f:await f;return g.parseFromString(c||"","text/html").documentElement.outerText};t.parseMarkdownText=l;const h=E=>E.actual!==void 0&&E.expected!==void 0;t.isDiffable=h;const u=E=>Math.min(Math.max(o(E||"",`
|
|
32368
32368
|
`)+3,8),20),d=E=>(0,t.isDiffable)(E)?Math.max(u(E.actual),u(E.expected)):u(typeof E.message=="string"?E.message:E.message.value);t.hintMessagePeekHeight=d},33429:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildTestUri=t.parseTestUri=t.TEST_DATA_SCHEME=void 0;const n=e(43718);t.TEST_DATA_SCHEME="opensumi-test-data";const r=a=>{const p=a.authority,[v,...m]=a.path.toString().slice(1).split("/");if(m[0]==="message"){const _=Number(m[1]),s=Number(m[2]),g=m[3],l=a.query;if(p==="results")switch(g){case"TestFailureMessage":return{resultId:v,taskIndex:_,testExtId:l,messageIndex:s,type:0};case"ActualOutput":return{resultId:v,taskIndex:_,testExtId:l,messageIndex:s,type:1};case"ExpectedOutput":return{resultId:v,taskIndex:_,testExtId:l,messageIndex:s,type:2}}}};t.parseTestUri=r;const o=a=>{const p={scheme:t.TEST_DATA_SCHEME,authority:"results"},v=(m,..._)=>n.URI.from({...p,query:a.testExtId,path:["",m,"message",..._].join("/")});switch(a.type){case 1:return v(a.resultId,a.taskIndex,a.messageIndex,"ActualOutput");case 2:return v(a.resultId,a.taskIndex,a.messageIndex,"ExpectedOutput");case 0:return v(a.resultId,a.taskIndex,a.messageIndex,"TestFailureMessage");default:throw new Error("Invalid test uri")}};t.buildTestUri=o},16558:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestTreeViewModelToken=void 0,t.TestTreeViewModelToken=Symbol("TestTreeViewModel")},48465:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(72383),t)},81286:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={themeSettings:[{scope:["meta.embedded","source.groovy.embedded"],settings:{foreground:"#D4D4D4"}},{scope:"emphasis",settings:{fontStyle:"italic"}},{scope:"strong",settings:{fontStyle:"bold"}},{scope:"header",settings:{foreground:"#000080"}},{scope:"comment",settings:{foreground:"#6A9955"}},{scope:"constant.language",settings:{foreground:"#569cd6"}},{scope:["constant.numeric","variable.other.enummember","keyword.operator.plus.exponent","keyword.operator.minus.exponent"],settings:{foreground:"#b5cea8"}},{scope:"constant.regexp",settings:{foreground:"#646695"}},{scope:"entity.name.tag",settings:{foreground:"#569cd6"}},{scope:"entity.name.tag.css",settings:{foreground:"#d7ba7d"}},{scope:"entity.other.attribute-name",settings:{foreground:"#9cdcfe"}},{scope:["entity.other.attribute-name.class.css","entity.other.attribute-name.class.mixin.css","entity.other.attribute-name.id.css","entity.other.attribute-name.parent-selector.css","entity.other.attribute-name.pseudo-class.css","entity.other.attribute-name.pseudo-element.css","source.css.less entity.other.attribute-name.id","entity.other.attribute-name.scss"],settings:{foreground:"#d7ba7d"}},{scope:"invalid",settings:{foreground:"#f44747"}},{scope:"markup.underline",settings:{fontStyle:"underline"}},{scope:"markup.bold",settings:{fontStyle:"bold",foreground:"#569cd6"}},{scope:"markup.heading",settings:{fontStyle:"bold",foreground:"#569cd6"}},{scope:"markup.italic",settings:{fontStyle:"italic"}},{scope:"markup.inserted",settings:{foreground:"#b5cea8"}},{scope:"markup.deleted",settings:{foreground:"#ce9178"}},{scope:"markup.changed",settings:{foreground:"#569cd6"}},{scope:"punctuation.definition.quote.begin.markdown",settings:{foreground:"#6A9955"}},{scope:"punctuation.definition.list.begin.markdown",settings:{foreground:"#6796e6"}},{scope:"markup.inline.raw",settings:{foreground:"#ce9178"}},{name:"brackets of XML/HTML tags",scope:"punctuation.definition.tag",settings:{foreground:"#808080"}},{scope:["meta.preprocessor","entity.name.function.preprocessor"],settings:{foreground:"#569cd6"}},{scope:"meta.preprocessor.string",settings:{foreground:"#ce9178"}},{scope:"meta.preprocessor.numeric",settings:{foreground:"#b5cea8"}},{scope:"meta.structure.dictionary.key.python",settings:{foreground:"#9cdcfe"}},{scope:"meta.diff.header",settings:{foreground:"#569cd6"}},{scope:"storage",settings:{foreground:"#569cd6"}},{scope:"storage.type",settings:{foreground:"#569cd6"}},{scope:["storage.modifier","keyword.operator.noexcept"],settings:{foreground:"#569cd6"}},{scope:["string","meta.embedded.assembly"],settings:{foreground:"#ce9178"}},{scope:"string.tag",settings:{foreground:"#ce9178"}},{scope:"string.value",settings:{foreground:"#ce9178"}},{scope:"string.regexp",settings:{foreground:"#d16969"}},{name:"String interpolation",scope:["punctuation.definition.template-expression.begin","punctuation.definition.template-expression.end","punctuation.section.embedded"],settings:{foreground:"#569cd6"}},{name:"Reset JavaScript string interpolation expression",scope:["meta.template.expression"],settings:{foreground:"#d4d4d4"}},{scope:["support.type.vendored.property-name","support.type.property-name","variable.css","variable.scss","variable.other.less","source.coffee.embedded"],settings:{foreground:"#9cdcfe"}},{scope:"keyword",settings:{foreground:"#569cd6"}},{scope:"keyword.control",settings:{foreground:"#569cd6"}},{scope:"keyword.operator",settings:{foreground:"#d4d4d4"}},{scope:["keyword.operator.new","keyword.operator.expression","keyword.operator.cast","keyword.operator.sizeof","keyword.operator.alignof","keyword.operator.typeid","keyword.operator.alignas","keyword.operator.instanceof","keyword.operator.logical.python","keyword.operator.wordlike"],settings:{foreground:"#569cd6"}},{scope:"keyword.other.unit",settings:{foreground:"#b5cea8"}},{scope:["punctuation.section.embedded.begin.php","punctuation.section.embedded.end.php"],settings:{foreground:"#569cd6"}},{scope:"support.function.git-rebase",settings:{foreground:"#9cdcfe"}},{scope:"constant.sha.git-rebase",settings:{foreground:"#b5cea8"}},{name:"coloring of the Java import and package identifiers",scope:["storage.modifier.import.java","variable.language.wildcard.java","storage.modifier.package.java"],settings:{foreground:"#d4d4d4"}},{name:"this.self",scope:"variable.language",settings:{foreground:"#569cd6"}},{name:"Function declarations",scope:["entity.name.function","support.function","support.constant.handlebars","source.powershell variable.other.member","entity.name.operator.custom-literal"],settings:{foreground:"#DCDCAA"}},{name:"Types declaration and references",scope:["meta.return-type","support.class","support.type","entity.name.type","entity.name.namespace","entity.other.attribute","entity.name.scope-resolution","entity.name.class","storage.type.numeric.go","storage.type.byte.go","storage.type.boolean.go","storage.type.string.go","storage.type.uintptr.go","storage.type.error.go","storage.type.rune.go","storage.type.cs","storage.type.generic.cs","storage.type.modifier.cs","storage.type.variable.cs","storage.type.annotation.java","storage.type.generic.java","storage.type.java","storage.type.object.array.java","storage.type.primitive.array.java","storage.type.primitive.java","storage.type.token.java","storage.type.groovy","storage.type.annotation.groovy","storage.type.parameters.groovy","storage.type.generic.groovy","storage.type.object.array.groovy","storage.type.primitive.array.groovy","storage.type.primitive.groovy"],settings:{foreground:"#4EC9B0"}},{name:"Types declaration and references, TS grammar specific",scope:["meta.type.cast.expr","meta.type.new.expr","support.constant.math","support.constant.dom","support.constant.json","entity.other.inherited-class"],settings:{foreground:"#4EC9B0"}},{name:"Control flow / Special keywords",scope:["keyword.control","source.cpp keyword.operator.new","keyword.operator.delete","keyword.other.using","keyword.other.operator","entity.name.operator"],settings:{foreground:"#C586C0"}},{name:"Variable and parameter name",scope:["variable","meta.definition.variable.name","support.variable","entity.name.variable","constant.other.placeholder"],settings:{foreground:"#9CDCFE"}},{name:"Constants and enums",scope:["variable.other.constant","variable.other.enummember"],settings:{foreground:"#4FC1FF"}},{name:"Object keys, TS grammar specific",scope:["meta.object-literal.key"],settings:{foreground:"#9CDCFE"}},{name:"CSS property value",scope:["support.constant.property-value","support.constant.font-name","support.constant.media-type","support.constant.media","constant.other.color.rgb-value","constant.other.rgb-value","support.constant.color"],settings:{foreground:"#CE9178"}},{name:"Regular expression groups",scope:["punctuation.definition.group.regexp","punctuation.definition.group.assertion.regexp","punctuation.definition.character-class.regexp","punctuation.character.set.begin.regexp","punctuation.character.set.end.regexp","keyword.operator.negation.regexp","support.other.parenthesis.regexp"],settings:{foreground:"#CE9178"}},{scope:["constant.character.character-class.regexp","constant.other.character-class.set.regexp","constant.other.character-class.regexp","constant.character.set.regexp"],settings:{foreground:"#d16969"}},{scope:["keyword.operator.or.regexp","keyword.control.anchor.regexp"],settings:{foreground:"#DCDCAA"}},{scope:"keyword.operator.quantifier.regexp",settings:{foreground:"#d7ba7d"}},{scope:"constant.character",settings:{foreground:"#569cd6"}},{scope:"constant.character.escape",settings:{foreground:"#d7ba7d"}},{scope:"entity.name.label",settings:{foreground:"#C8C8C8"}}],colors:{"editor.background":"#1e1e1eff","editor.foreground":"#d4d4d4ff","editor.inactiveSelectionBackground":"#3a3d41ff","editorIndentGuide.background":"#404040ff","editorIndentGuide.activeBackground":"#707070ff","editor.selectionHighlightBackground":"#add6ff26","list.dropBackground":"#383b3dff","activityBarBadge.background":"#007accff","sideBarTitle.foreground":"#bbbbbbff","input.placeholderForeground":"#a6a6a6ff","settings.textInputBackground":"#292929ff","settings.numberInputBackground":"#292929ff","menu.background":"#252526ff","menu.foreground":"#ccccccff","statusBarItem.remoteForeground":"#ffffffff","statusBarItem.remoteBackground":"#16825dff"},encodedTokensColors:[],rules:[],base:"vs-dark",inherit:!0,hasDefaultTokens:!1,id:"Default Dark+",name:"Dark+ (default dark)"}},28987:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IconThemeData=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(40827),p=e(14951);let v=class{async load(g){const l=await this.fileServiceClient.readFile(g.toString());let h={};try{h=(0,o.parseWithComments)(l.content.toString())}catch{(0,o.getDebugLogger)().log((0,o.formatLocalize)("error.cannotparseicontheme",g.codeUri.fsPath))}const u=m(g,h,this.staticResourceService);return this.hasFileIcons=u.hasFileIcons,this.hasFolderIcons=u.hasFolderIcons,this.hidesExplorerArrows=u.hidesExplorerArrows,this.styleSheetContent=u.content,u.content}};t.IconThemeData=v,n.__decorate([(0,r.Autowired)(p.IFileServiceClient),n.__metadata("design:type",Object)],v.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",a.StaticResourceService)],v.prototype,"staticResourceService",void 0),t.IconThemeData=v=n.__decorate([(0,r.Injectable)({multiple:!0})],v);function m(s,g,l){const h={content:"",hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!!g.hidesExplorerArrows};if(!g.iconDefinitions)return h;const u={};function d(y){const b=s.path.dir.join(y.replace(/^\.\//,"")),A=s.withPath(b);return s.scheme==="https"?A.toString():l.resolveStaticResource(A)}function E(y,b){function A(S,D){if(D){let I=u[D];I||(I=u[D]=[]),I.push(S)}}if(y){let S=".show-file-icons";b&&(S=b+" "+S),y.folder&&(A(`${S} .folder-icon::before`,y.folder),h.hasFolderIcons=!0),y.folderExpanded&&(A(`${S} .folder-icon.expanded::before`,y.folderExpanded),h.hasFolderIcons=!0);const D=y.rootFolder||y.folder,I=y.rootFolderExpanded||y.folderExpanded;D&&(A(`${S} .rootfolder-icon::before`,D),h.hasFolderIcons=!0),I&&(A(`${S} .rootfolder-icon.expanded::before`,I),h.hasFolderIcons=!0),y.file&&(A(`${S} .file-icon::before`,y.file),h.hasFileIcons=!0);const w=y.folderNames;if(w)for(const M in w)A(`${S} .${_(M.toLowerCase())}-name-folder-icon.folder-icon::before`,w[M]),h.hasFolderIcons=!0;const T=y.folderNamesExpanded;if(T)for(const M in T)A(`${S} .${_(M.toLowerCase())}-name-folder-icon.folder-icon.expanded::before`,T[M]),h.hasFolderIcons=!0;const R=y.languageIds;if(R){!R.jsonc&&R.json&&(R.jsonc=R.json);for(const M in R)A(`${S} .${_(M)}-lang-file-icon.file-icon::before`,R[M]),h.hasFileIcons=!0}const P=y.fileExtensions;if(P)for(const M in P){const k=[],F=M.toLowerCase().split(".");if(F.length){for(let L=0;L<F.length;L++)k.push(`.${_(F.slice(L).join("."))}-ext-file-icon`);k.push(".ext-file-icon")}A(`${S} ${k.join("")}.file-icon::before`,P[M]),h.hasFileIcons=!0}const O=y.fileNames;if(O)for(let M in O){const k=[];M=M.toLowerCase(),k.push(`.${_(M)}-name-file-icon`);const F=M.split(".");if(F.length){for(let L=1;L<F.length;L++)k.push(`.${_(F.slice(L).join("."))}-ext-file-icon`);k.push(".ext-file-icon")}A(`${S} ${k.join("")}.file-icon::before`,O[M]),h.hasFileIcons=!0}}}if(E(g),E(g.light,".vs"),E(g.highContrast,".hc-black"),E(g.highContrast,".hc-light"),!h.hasFileIcons&&!h.hasFolderIcons)return h;const f=[],c=g.fonts;Array.isArray(c)&&(c.forEach(y=>{const b=y.src.map(A=>`url('${d(A.path)}') format('${A.format}')`).join(", ");f.push(`@font-face { src: ${b}; font-family: '${y.id}'; font-weight: ${y.weight}; font-style: ${y.style}; }`)}),f.push(`.show-file-icons .file-icon::before, .show-file-icons .folder-icon::before, .show-file-icons .rootfolder-icon::before { font-family: '${c[0].id}'; font-size: ${c[0].size||"150%"}}`));for(const y in u){const b=u[y],A=g.iconDefinitions[y];if(A&&(A.iconPath&&f.push(`${b.join(", ")} { content: ' '; background-image: url("${d(A.iconPath)}"); }`),A.fontCharacter||A.fontColor)){let S="";A.fontColor&&(S+=` color: ${A.fontColor};`),A.fontCharacter&&(S+=` content: '${A.fontCharacter}';`),A.fontSize&&(S+=` font-size: ${A.fontSize};`),A.fontId&&(S+=` font-family: ${A.fontId};`),f.push(`${b.join(", ")} { ${S} }`)}}return h.content=f.join(`
|
|
32369
32369
|
`),h}function _(s){return s=s.replace(/[\x09\x0a\x0c\x0d\x20]/g,"/"),window.CSS.escape(s)}},15774:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IconThemeStore=void 0;const n=e(85608),r=e(76003),o=e(87420),a=e(28987);let p=class{constructor(){this.iconThemeMap=new Map}async getIconTheme(m,_){if(!m||!_)return;const s=(0,o.getThemeId)(m),g=this.iconThemeMap.get(s);if(g)return g;const l=await this.initIconTheme(m,_);return this.iconThemeMap.set(s,l),l}async initIconTheme(m,_){const s=m.path.replace(/^\.\//,""),g=_.resolve(s),l=this.injector.get(a.IconThemeData);return await l.load(g),l}};t.IconThemeStore=p,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],p.prototype,"injector",void 0),t.IconThemeStore=p=n.__decorate([(0,r.Injectable)()],p)},53667:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IconService=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(40827),p=e(87420),v=e(15774);e(46555);let m=class extends o.WithEventBus{getPath(s,g){if(g.startsWith("./")){const l=new o.URI(s).resolve(g.replace(/^\.\//,""));return l.scheme?l:o.URI.file(l.toString())}else{if(/^http(s)?/.test(g))return new o.URI(g);if(s){const l=new o.URI(s).resolve(g);return l.scheme?l:o.URI.file(l.toString())}else return/^file:\/\//.test(g)?new o.URI(g):o.URI.file(g)}}constructor(){super(),this.iconThemeLoaded=new o.Deferred,this.themeChangeEmitter=new o.Emitter,this.onThemeChange=this.themeChangeEmitter.event,this.iconThemes=new Map,this.iconContributionRegistry=new Map,this.iconMap=new Map,this._regexFromString=/^\$\(([a-z.]+\/)?([a-z-]+)(~[a-z]+)?\)$/i,this.styleSheetCollection="",this.appendStyleCounter=0,this.listen()}listen(){this.addDispose(this.preferenceService.onSpecificPreferenceChange(o.GeneralSettingsId.Icon,async s=>{this.iconContributionRegistry.has(s.newValue)&&await this.applyTheme(s.newValue)}))}doAppend(s){if(s){const g=s?.textContent+this.styleSheetCollection;s.textContent=g}this.styleSheetCollection="",this.appendStylesTimer=void 0,this.appendStyleCounter=0,clearTimeout(this.appendStylesTimer)}appendStyleSheet(s,g=!1){let l=document.getElementById("plugin-icons");if(l||(l=document.createElement("style"),l.id="plugin-icons",document.getElementsByTagName("head")[0].appendChild(l)),!g){l.append(s);return}this.styleSheetCollection+=`\r
|