@xano/xanoscript-monaco-editor 0.1.7 → 0.1.9
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/dist/.vite/manifest.json +49 -49
- package/dist/assets/{editor-Q-H44Xk5.js → editor-CTk4XCQG.js} +1 -1
- package/dist/assets/{fileCommands._save-_f7KuzoK.js → fileCommands._save-BslznhnO.js} +3 -3
- package/dist/assets/{iconv-lite-umd-D8Xc-NRZ.js → iconv-lite-umd-vDmZu3o7.js} +1 -1
- package/dist/assets/{index-kz8GV9yO.js → index-B9LREvGB.js} +1 -1
- package/dist/assets/{index-BQHo-Z-Y.js → index-BMTVGxzX.js} +2 -2
- package/dist/assets/{index-fzRRQ7Qh.js → index-Be1WCD4s.js} +1 -1
- package/dist/assets/{index-DcZHpPDm.js → index-BfLChBOe.js} +1 -1
- package/dist/assets/{index-CQIJkuYI.js → index-BpdMCZU7.js} +1 -1
- package/dist/assets/{index-GR_3sv6M.js → index-Ca2GOtQx.js} +2 -2
- package/dist/assets/{index-CLAWxbMR.js → index-CzmSOBI6.js} +1 -1
- package/dist/assets/{index-CHwATtBn.js → index-DqIUrgd9.js} +3 -3
- package/dist/assets/{index-D9lSNsHR.js → index-GPQU4rv1.js} +3 -3
- package/dist/assets/{main-BtCp5aH0.js → main-CuAxLb8K.js} +1 -1
- package/dist/assets/{main-BnV5RNdt.js → main-kYU-Ynn2.js} +1 -1
- package/dist/assets/{tokenClassificationRegistry-BP6RVP9u.js → tokenClassificationRegistry-BA6yuF5K.js} +2 -2
- package/dist/assets/{views-Hn-QKMUh.js → views-Dck1c7fK.js} +2 -2
- package/dist/assets/workbenchThemeService.service-DlXrxy4t.js +1 -0
- package/dist/index.html +1 -1
- package/dist/logic-assistant-script.js +60 -62
- package/dist/worker.js +92 -94
- package/package.json +3 -2
- package/dist/assets/workbenchThemeService.service-CDwCNsAv.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-BMTVGxzX.js","./workbenchThemeService.service-DlXrxy4t.js","./tokenClassificationRegistry-BA6yuF5K.js","./index-BPOe4Pu5.css","./index-DqIUrgd9.js","./index-BfLChBOe.js","./index-CEhqlLL9.css","./index-B9LREvGB.js","./views-Dck1c7fK.js","./fileCommands._save-BslznhnO.js","./fileCommands-BWjklncq.css","./views-CZrb1Sfs.css","./editor-CTk4XCQG.js","./index-Ca2GOtQx.js","./index-gr3ckRyE.css","./index-BpdMCZU7.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var dMe=n=>{throw TypeError(n)};var hMe=(n,e,t)=>e.has(n)||dMe("Cannot "+t);var Al=(n,e,t)=>(hMe(n,e,"read from private field"),t?t.call(n):e.get(n)),Hz=(n,e,t)=>e.has(n)?dMe("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),Vz=(n,e,t,i)=>(hMe(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=t(s);fetch(s.href,r)}})();function y(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r}function v(n,e){return function(t,i){e(t,i,n)}}function zk(n,e,t=n.length-1){const i=ilt(n,e,t);if(i!==-1)return n[i]}function ilt(n,e,t=n.length-1){for(let i=t;i>=0;i--){const s=n[i];if(e(s))return i}return-1}function m2(n,e){const t=_2(n,e);return t===-1?void 0:n[t]}function _2(n,e,t=0,i=n.length){let s=t,r=i;for(;s<r;){const o=Math.floor((s+r)/2);e(n[o])?s=o+1:r=o}return s-1}function nlt(n,e){const t=v2(n,e);return t===n.length?void 0:n[t]}function v2(n,e,t=0,i=n.length){let s=t,r=i;for(;s<r;){const o=Math.floor((s+r)/2);e(n[o])?r=o:s=o+1}return s}const Vie=class Vie{constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(e){if(Vie.assertInvariants){if(this._prevFindLastPredicate){for(const i of this._array)if(this._prevFindLastPredicate(i)&&!e(i))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=e}const t=_2(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=t+1,t===-1?void 0:this._array[t]}};Vie.assertInvariants=!1;let mj=Vie;function dLe(n,e){if(n.length===0)return;let t=n[0];for(let i=1;i<n.length;i++){const s=n[i];e(s,t)>0&&(t=s)}return t}function gze(n,e){if(n.length===0)return;let t=n[0];for(let i=1;i<n.length;i++){const s=n[i];e(s,t)>=0&&(t=s)}return t}function pze(n,e){return dLe(n,(t,i)=>-e(t,i))}function slt(n,e){if(n.length===0)return-1;let t=0;for(let i=1;i<n.length;i++){const s=n[i];e(s,n[t])>0&&(t=i)}return t}function rlt(n,e){for(const t of n){const i=e(t);if(i!==void 0)return i}}let olt=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?wa.isErrorNoTelemetry(e)?new wa(e.message+`
|
|
3
3
|
|
|
4
4
|
`+e.stack):new Error(e.message+`
|
|
@@ -873,7 +873,7 @@ Port number {2} has been used instead.`,t,e.tunnelRemotePort,e.tunnelLocalPort);
|
|
|
873
873
|
`)}append(e){this.info(e)}clear(){const e=this.offset;this.logger.flush(),this.proxy.$update(this.id,dF.Clear,e)}replace(e){const t=this.offset;this.info(e),this.proxy.$update(this.id,dF.Replace,t),this.visible&&this.logger.flush()}show(e,t){this.logger.flush(),this.proxy.$reveal(this.id,!!(typeof e=="boolean"?e:t))}hide(){this.proxy.$close(this.id)}log(e,t){this.offset+=Ye.fromString(t).byteLength,XY(this.logger,e,t),this.visible&&(this.logger.flush(),this.proxy.$update(this.id,dF.Append))}}class mOt extends att{appendLine(e){this.append(e)}}let Zve=class{constructor(e,t,i,s,r,o){this.initData=t,this.extHostFileSystem=i,this.extHostFileSystemInfo=s,this.loggerService=r,this.logService=o,this.extensionLogDirectoryPromise=new Map,this.namePool=1,this.channels=new Map,this.visibleChannelId=null,this.proxy=e.getProxy(Xe.MainThreadOutputService),this.outputsLocation=this.extHostFileSystemInfo.extUri.joinPath(t.logsLocation,`output_logging_${LYe(new Date).replace(/-|:|\.\d+Z$/g,"")}`)}$setVisibleChannel(e){this.visibleChannelId=e;for(const[t,i]of this.channels)i.visible=t===this.visibleChannelId}createOutputChannel(e,t,i){if(e=e.trim(),!e)throw new Error("illegal argument `name`. must not be falsy");const s=typeof t=="object"&&t.log,r=qt(t)?t:void 0;if(qt(r)&&!r.trim())throw new Error("illegal argument `languageId`. must not be empty");let o;const a=this.initData.environment.extensionLogLevel?.find(([d])=>Kn.equals(i.identifier,d))?.[1];a&&(o=$O(a));const l=new ie,c=s?this.doCreateLogOutputChannel(e,o,i,l):this.doCreateOutputChannel(e,r,i,l);return c.then(d=>{this.channels.set(d.id,d),d.visible=d.id===this.visibleChannelId,l.add(ke(()=>this.channels.delete(d.id)))}),s?this.createExtHostLogOutputChannel(e,o??this.logService.getLevel(),c,l):this.createExtHostOutputChannel(e,c,l)}async doCreateOutputChannel(e,t,i,s){this.outputDirectoryPromise||(this.outputDirectoryPromise=this.extHostFileSystem.value.createDirectory(this.outputsLocation).then(()=>this.outputsLocation));const r=await this.outputDirectoryPromise,o=this.extHostFileSystemInfo.extUri.joinPath(r,`${this.namePool++}-${e.replace(/[\\/:\*\?"<>\|]/g,"")}.log`),a=s.add(this.loggerService.createLogger(o,{logLevel:"always",donotRotate:!0,donotUseFormatters:!0,hidden:!0})),l=await this.proxy.$register(e,o,t,i.identifier.value);return s.add(ke(()=>this.loggerService.deregisterLogger(o))),new att(l,e,a,this.proxy,i)}async doCreateLogOutputChannel(e,t,i,s){const r=await this.createExtensionLogDirectory(i),o=e.replace(/[\\/:\*\?"<>\|]/g,""),a=this.extHostFileSystemInfo.extUri.joinPath(r,`${o}.log`),l=`${i.identifier.value}.${o}`,c=s.add(this.loggerService.createLogger(a,{id:l,name:e,logLevel:t,extensionId:i.identifier.value}));return s.add(ke(()=>this.loggerService.deregisterLogger(a))),new mOt(l,e,c,this.proxy,i)}createExtensionLogDirectory(e){let t=this.extensionLogDirectoryPromise.get(e.identifier.value);if(!t){const i=this.extHostFileSystemInfo.extUri.joinPath(this.initData.logsLocation,e.identifier.value);this.extensionLogDirectoryPromise.set(e.identifier.value,t=(async()=>{try{await this.extHostFileSystem.value.createDirectory(i)}catch(s){if(eI(s)!==St.FileExists)throw s}return i})())}return t}createExtHostOutputChannel(e,t,i){const s=()=>{if(i.isDisposed)throw new Error("Channel has been closed")};return t.then(r=>i.add(r)),{get name(){return e},append(r){s(),t.then(o=>o.append(r))},appendLine(r){s(),t.then(o=>o.appendLine(r))},clear(){s(),t.then(r=>r.clear())},replace(r){s(),t.then(o=>o.replace(r))},show(r,o){s(),t.then(a=>a.show(r,o))},hide(){s(),t.then(r=>r.hide())},dispose(){i.dispose()}}}createExtHostLogOutputChannel(e,t,i,s){const r=()=>{if(s.isDisposed)throw new Error("Channel has been closed")},o=s.add(new A);function a(l){t=l,o.fire(l)}return i.then(l=>{l.logLevel!==t&&a(l.logLevel),s.add(l.onDidChangeLogLevel(c=>a(c)))}),{...this.createExtHostOutputChannel(e,i,s),get logLevel(){return t},onDidChangeLogLevel:o.event,trace(l,...c){r(),i.then(d=>d.trace(l,...c))},debug(l,...c){r(),i.then(d=>d.debug(l,...c))},info(l,...c){r(),i.then(d=>d.info(l,...c))},warn(l,...c){r(),i.then(d=>d.warn(l,...c))},error(l,...c){r(),i.then(d=>d.error(l,...c))}}}};Zve=y([v(0,dr),v(1,Yc),v(2,xle),v(3,$H),v(4,Sc),v(5,it)],Zve);const ltt=de("IExtHostOutputService");function vz(n,e){return{id:e,asString:async()=>n,asFile:()=>{},value:typeof n=="string"?n:void 0}}function _Ot(n,e,t,i){const s={id:Tr(),name:n,uri:e,data:t};return{id:i,asString:async()=>"",asFile:()=>s,value:void 0}}class Dle{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return ri.some(this,([i,s])=>s.asFile())&&t.push("files"),ctt(eZ(e),t)}get(e){return this._entries.get(this.toKey(e))?.[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return eZ(e)}}function eZ(n){return n.toLowerCase()}function VHe(n,e){return ctt(eZ(n),e.map(eZ))}function ctt(n,e){if(n==="*/*")return e.length>0;if(e.includes(n))return!0;const t=n.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,s,r]=t;return r==="*"?e.some(o=>o.startsWith(s+"/")):!1}const OE=Object.freeze({create:n=>Xd(n.map(e=>e.toString())).join(`\r
|
|
874
874
|
`),split:n=>n.split(`\r
|
|
875
875
|
`),parse:n=>OE.split(n).filter(e=>!e.startsWith("#"))}),Du=Symbol("unset");class tZ{constructor(){this.root=new Jde,this._size=0}get size(){return this._size}get nodes(){return this.root.children?.values()||ri.empty()}get entries(){return this.root.children?.entries()||ri.empty()}insert(e,t,i){this.opNode(e,s=>s._value=t,i)}mutate(e,t){this.opNode(e,i=>i._value=t(i._value===Du?void 0:i._value))}mutatePath(e,t){this.opNode(e,()=>{},i=>t(i))}delete(e){const t=this.getPathToKey(e);if(!t)return;let i=t.length-1;const s=t[i].node._value;if(s!==Du){for(this._size--,t[i].node._value=Du;i>0;i--){const{node:r,part:o}=t[i];if(r.children?.size||r._value!==Du)break;t[i-1].node.children.delete(o)}return s}}*deleteRecursive(e){const t=this.getPathToKey(e);if(!t)return;const i=t[t.length-1].node;for(let s=t.length-1;s>0;s--){const r=t[s-1];if(r.node.children.delete(t[s].part),r.node.children.size>0||r.node._value!==Du)break}for(const s of UHe(i))s._value!==Du&&(this._size--,yield s._value);i===this.root&&(this.root._value=Du,this.root.children=void 0)}find(e){let t=this.root;for(const i of e){const s=t.children?.get(i);if(!s)return;t=s}return t._value===Du?void 0:t._value}hasKeyOrParent(e){let t=this.root;for(const i of e){const s=t.children?.get(i);if(!s)return!1;if(s._value!==Du)return!0;t=s}return!1}hasKeyOrChildren(e){let t=this.root;for(const i of e){const s=t.children?.get(i);if(!s)return!1;t=s}return!0}hasKey(e){let t=this.root;for(const i of e){const s=t.children?.get(i);if(!s)return!1;t=s}return t._value!==Du}getPathToKey(e){const t=[{part:"",node:this.root}];let i=0;for(const s of e){const r=t[i].node.children?.get(s);if(!r)return;t.push({part:s,node:r}),i++}return t}opNode(e,t,i){let s=this.root;for(const a of e){if(s.children)if(s.children.has(a))s=s.children.get(a);else{const l=new Jde;s.children.set(a,l),s=l}else{const l=new Jde;s.children=new Map([[a,l]]),s=l}i?.(s)}const r=s._value===Du?0:1;t(s);const o=s._value===Du?0:1;this._size+=o-r}*values(){for(const{_value:e}of UHe(this.root))e!==Du&&(yield e)}}function*UHe(n){const e=[n];for(;e.length>0;){const t=e.pop();if(yield t,t.children)for(const i of t.children.values())e.push(i)}}let Jde=class{constructor(){this._value=Du}get value(){return this._value===Du?void 0:this._value}set value(e){this._value=e===void 0?Du:e}};var cm;(function(n){n[n.Explorer=1]="Explorer",n[n.Scm=3]="Scm",n[n.Extensions=5]="Extensions",n[n.Window=10]="Window",n[n.Notification=15]="Notification",n[n.Dialog=20]="Dialog"})(cm||(cm={}));const vOt=Object.freeze({total(){},worked(){},done(){}}),QNe=class QNe{get value(){return this._value}constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}};QNe.None=Object.freeze({report(){}});let ru=QNe,$He=class extends V{constructor(e,t){super(),this.deferred=new ja,t.withProgress(e,i=>(this.reporter=i,this.lastStep&&i.report(this.lastStep),this.deferred.p)),this._register(ke(()=>this.deferred.complete()))}report(e){this.reporter?this.reporter.report(e):this.lastStep=e}};$He=y([v(1,GE)],$He);class Mvi extends V{constructor(e){super(),this.progressIndicator=e,this.currentOperationId=0,this.currentOperationDisposables=this._register(new ie),this.currentProgressTimeout=void 0}start(e){this.stop();const t=++this.currentOperationId,i=new ui;return this.currentProgressTimeout=setTimeout(()=>{t===this.currentOperationId&&(this.currentProgressRunner=this.progressIndicator.show(!0))},e),this.currentOperationDisposables.add(ke(()=>clearTimeout(this.currentProgressTimeout))),this.currentOperationDisposables.add(ke(()=>i.cancel())),this.currentOperationDisposables.add(ke(()=>this.currentProgressRunner?this.currentProgressRunner.done():void 0)),{id:t,token:i.token,stop:()=>this.doStop(t),isCurrent:()=>this.currentOperationId===t}}stop(){this.doStop(this.currentOperationId)}doStop(e){this.currentOperationId===e&&this.currentOperationDisposables.clear()}}var zHe;(function(n){n[n.NotOmitted=0]="NotOmitted",n[n.Partial=1]="Partial",n[n.Full=2]="Full"})(zHe||(zHe={}));var Jve;(function(n){n.icon=Ce.error;function e(r){return{filterUri:r.resource,owner:r.owner,problemMessage:r.message,filterRange:{startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,startColumn:r.startColumn,endColumn:r.endColumn}}}n.fromMarker=e;function t(r){return{id:i(r),name:s(r),icon:n.icon,value:r,kind:"diagnostic",...r}}n.toEntry=t;function i(r){return[r.filterUri,r.owner,r.filterSeverity,r.filterRange?.startLineNumber].join(":")}n.id=i;function s(r){let o;if((function(l){l[l.MaxChars=30]="MaxChars",l[l.MaxSpaceLookback=10]="MaxSpaceLookback"})(o||(o={})),r.problemMessage){if(r.problemMessage.length<o.MaxChars)return r.problemMessage;const l=r.problemMessage.lastIndexOf(" ",o.MaxChars);return l===-1||l+o.MaxSpaceLookback<o.MaxChars?r.problemMessage.substring(0,o.MaxChars)+"…":r.problemMessage.substring(0,l)+"…"}let a=f(5420,"All Problems");return r.filterUri&&(a=f(5421,"Problems in {0}",In(r.filterUri))),a}n.label=s})(Jve||(Jve={}));var qHe;(function(n){function e(t){return N.isUri(t.value)?t.value:awt(t.value)?t.value.uri:void 0}n.toUri=e})(qHe||(qHe={}));function wOt(n){return n.kind==="image"}var GHe;(function(n){n.Instruction="vscode.prompt.instructions.root",n.InstructionReference="vscode.prompt.instructions",n.PromptFile="vscode.prompt.file"})(GHe||(GHe={}));class R_ extends jJe{constructor(){super(...arguments),this._onDidChangeDirty=this._register(new A),this._onDidChangeLabel=this._register(new A),this._onDidChangeCapabilities=this._register(new A),this._onWillDispose=this._register(new A),this.onDidChangeDirty=this._onDidChangeDirty.event,this.onDidChangeLabel=this._onDidChangeLabel.event,this.onDidChangeCapabilities=this._onDidChangeCapabilities.event,this.onWillDispose=this._onWillDispose.event}get editorId(){}get capabilities(){return $n.Readonly}hasCapability(e){return e===$n.None?this.capabilities===$n.None:(this.capabilities&e)!==0}isReadonly(){return this.hasCapability($n.Readonly)}getName(){return`Editor ${this.typeId}`}getDescription(e){}getTitle(e){return this.getName()}getLabelExtraClasses(){return[]}getAriaLabel(){return this.getTitle(Ks.SHORT)}getIcon(){}getTelemetryDescriptor(){return{typeId:this.typeId}}isDirty(){return!1}isModified(){return this.isDirty()}isSaving(){return!1}async resolve(){return null}async save(e,t){return this}async saveAs(e,t){return this}async revert(e,t){}async rename(e,t){}copy(){return this}canMove(e,t){return!0}matches(e){if(th(e))return this===e;const t=e.options?.override;return this.editorId!==t&&t!==void 0&&this.editorId!==void 0?!1:hs(this.resource,Zu.getCanonicalUri(e))}prefersEditorPane(e){return e.at(0)}toUntyped(e){}isDisposed(){return this._store.isDisposed}dispose(){this.isDisposed()||this._onWillDispose.fire(),super.dispose()}}var dM,j0;let AC=(j0=class extends R_{get typeId(){return dM.ID}get capabilities(){let e=this.primary.capabilities;return e&=~$n.CanSplitInGroup,this.secondary.hasCapability($n.RequiresTrust)&&(e|=$n.RequiresTrust),this.secondary.hasCapability($n.Singleton)&&(e|=$n.Singleton),e|=$n.MultipleEditors,e}get resource(){if(this.hasIdenticalSides)return this.primary.resource}constructor(e,t,i,s,r){super(),this.preferredName=e,this.preferredDescription=t,this.secondary=i,this.primary=s,this.editorService=r,this.hasIdenticalSides=this.primary.matches(this.secondary),this.registerListeners()}registerListeners(){this._register(O.once(O.any(this.primary.onWillDispose,this.secondary.onWillDispose))(()=>{this.isDisposed()||this.dispose()})),this._register(this.primary.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this._register(this.primary.onDidChangeCapabilities(()=>this._onDidChangeCapabilities.fire())),this._register(this.secondary.onDidChangeCapabilities(()=>this._onDidChangeCapabilities.fire())),this._register(this.primary.onDidChangeLabel(()=>this._onDidChangeLabel.fire())),this._register(this.secondary.onDidChangeLabel(()=>this._onDidChangeLabel.fire()))}getName(){const e=this.getPreferredName();return e||(this.hasIdenticalSides?this.primary.getName():f(3943,"{0} - {1}",this.secondary.getName(),this.primary.getName()))}getPreferredName(){return this.preferredName}getDescription(e){const t=this.getPreferredDescription();return t||(this.hasIdenticalSides?this.primary.getDescription(e):super.getDescription(e))}getPreferredDescription(){return this.preferredDescription}getTitle(e){let t;this.hasIdenticalSides?t=this.primary.getTitle(e)??this.getName():t=super.getTitle(e);const i=this.getPreferredTitle();return i&&(t=`${i} (${t})`),t}getPreferredTitle(){if(this.preferredName&&this.preferredDescription)return`${this.preferredName} ${this.preferredDescription}`;if(this.preferredName||this.preferredDescription)return this.preferredName??this.preferredDescription}getLabelExtraClasses(){return this.hasIdenticalSides?this.primary.getLabelExtraClasses():super.getLabelExtraClasses()}getAriaLabel(){return this.hasIdenticalSides?this.primary.getAriaLabel():super.getAriaLabel()}getTelemetryDescriptor(){return{...this.primary.getTelemetryDescriptor(),...super.getTelemetryDescriptor()}}isDirty(){return this.primary.isDirty()}isSaving(){return this.primary.isSaving()}async save(e,t){const i=await this.primary.save(e,t);return this.saveResultToEditor(i)}async saveAs(e,t){const i=await this.primary.saveAs(e,t);return this.saveResultToEditor(i)}saveResultToEditor(e){if(!e||!this.hasIdenticalSides)return e;if(this.primary.matches(e))return this;if(e instanceof R_)return new dM(this.preferredName,this.preferredDescription,e,e,this.editorService);if(!Yb(e)&&!E5(e)&&!kD(e)&&!LC(e))return{primary:e,secondary:e,label:this.preferredName,description:this.preferredDescription}}revert(e,t){return this.primary.revert(e,t)}async rename(e,t){if(!this.hasIdenticalSides)return;const i=await this.primary.rename(e,t);if(i){if(th(i.editor))return{editor:new dM(this.preferredName,this.preferredDescription,i.editor,i.editor,this.editorService),options:{...i.options,viewState:jde(this,e,this.editorService)}};if(jS(i.editor))return{editor:{label:this.preferredName,description:this.preferredDescription,primary:i.editor,secondary:i.editor,options:{...i.options,viewState:jde(this,e,this.editorService)}}}}}isReadonly(){return this.primary.isReadonly()}toUntyped(e){const t=this.primary.toUntyped(e),i=this.secondary.toUntyped(e);if(t&&i&&!Yb(t)&&!Yb(i)&&!E5(t)&&!E5(i)&&!kD(t)&&!kD(i)&&!LC(t)&&!LC(i)){const s={label:this.preferredName,description:this.preferredDescription,primary:t,secondary:i};return typeof e?.preserveViewState=="number"&&(s.options={viewState:jde(this,e.preserveViewState,this.editorService)}),s}}matches(e){return this===e?!0:YJe(e)||Yb(e)?!1:e instanceof dM?this.primary.matches(e.primary)&&this.secondary.matches(e.secondary):kD(e)?this.primary.matches(e.primary)&&this.secondary.matches(e.secondary):!1}},dM=j0,j0.ID="workbench.editorinputs.sidebysideEditorInput",j0);AC=dM=y([v(4,ls)],AC);class dtt{canSerialize(e){const t=e;if(t.primary&&t.secondary){const[i,s]=this.getSerializers(t.secondary.typeId,t.primary.typeId);return!!(i?.canSerialize(t.secondary)&&s?.canSerialize(t.primary))}return!1}serialize(e){const t=e;if(t.primary&&t.secondary){const[i,s]=this.getSerializers(t.secondary.typeId,t.primary.typeId);if(s&&i){const r=s.serialize(t.primary),o=i.serialize(t.secondary);if(r&&o){const a={name:t.getPreferredName(),description:t.getPreferredDescription(),primarySerialized:r,secondarySerialized:o,primaryTypeId:t.primary.typeId,secondaryTypeId:t.secondary.typeId};return JSON.stringify(a)}}}}deserialize(e,t){const i=JSON.parse(t),[s,r]=this.getSerializers(i.secondaryTypeId,i.primaryTypeId);if(r&&s){const o=r.deserialize(e,i.primarySerialized),a=s.deserialize(e,i.secondarySerialized);if(o instanceof R_&&a instanceof R_)return this.createEditorInput(e,i.name,i.description,a,o)}}getSerializers(e,t){const i=mt.as(OW.EditorFactory);return[i.getEditorSerializer(e),i.getEditorSerializer(t)]}}class Ovi extends dtt{createEditorInput(e,t,i,s,r){return e.createInstance(AC,t,i,s,r)}}class pN extends V{constructor(){super(...arguments),this._onWillDispose=this._register(new A),this.onWillDispose=this._onWillDispose.event,this.resolved=!1}async resolve(){this.resolved=!0}isResolved(){return this.resolved}isDisposed(){return this._store.isDisposed}dispose(){this._onWillDispose.fire(),super.dispose()}}const KHe="languageDetection",Fvi="automaticlanguagedetection.likelywrong";var ewe,Y0;let bI=(Y0=class extends pN{constructor(e,t,i,s,r){super(),this.modelService=e,this.languageService=t,this.languageDetectionService=i,this.accessibilityService=s,this.textEditorModelHandle=void 0,this.modelDisposeListener=this._register(new hi),this.autoDetectLanguageThrottler=this._register(new qB(ewe.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY)),this._blockLanguageChangeListener=!1,this._languageChangeSource=void 0,r&&this.handleExistingModel(r)}handleExistingModel(e){const t=this.modelService.getModel(e);if(!t)throw new Error(`Document with resource ${e.toString(!0)} does not exist`);this.textEditorModelHandle=e,this.registerModelDisposeListener(t)}registerModelDisposeListener(e){this.modelDisposeListener.value=e.onWillDispose(()=>{this.textEditorModelHandle=void 0,this.dispose()})}get textEditorModel(){return this.textEditorModelHandle?this.modelService.getModel(this.textEditorModelHandle):null}isReadonly(){return!0}get languageChangeSource(){return this._languageChangeSource}get hasLanguageSetExplicitly(){return typeof this._languageChangeSource=="string"}setLanguageId(e,t){this._languageChangeSource="user",this.setLanguageIdInternal(e,t)}setLanguageIdInternal(e,t){if(this.isResolved()&&!(!e||e===this.textEditorModel.getLanguageId())){this._blockLanguageChangeListener=!0;try{this.textEditorModel.setLanguage(this.languageService.createById(e),t)}finally{this._blockLanguageChangeListener=!1}}}installModelListeners(e){const t=this._register(e.onDidChangeLanguage(i=>{i.source===KHe||this._blockLanguageChangeListener||(this._languageChangeSource="api",t.dispose())}))}getLanguageId(){return this.textEditorModel?.getLanguageId()}autoDetectLanguage(){return this.autoDetectLanguageThrottler.trigger(()=>this.doAutoDetectLanguage())}async doAutoDetectLanguage(){if(this.hasLanguageSetExplicitly||!this.textEditorModelHandle||!this.languageDetectionService.isEnabledForLanguage(this.getLanguageId()??cl))return;const e=await this.languageDetectionService.detectLanguage(this.textEditorModelHandle),t=this.getLanguageId();if(e&&e!==t&&!this.isDisposed()){this.setLanguageIdInternal(e,KHe);const i=this.languageService.getLanguageName(e);this.accessibilityService.alert(f(3944,"Language {0} was automatically detected and set as the language mode.",i??e))}}createTextEditorModel(e,t,i){const s=this.getFirstLineText(e),r=this.getOrCreateLanguage(t,this.languageService,i,s);return this.doCreateTextEditorModel(e,r,t)}doCreateTextEditorModel(e,t,i){let s=i&&this.modelService.getModel(i);return s?this.updateTextEditorModel(e,t.languageId):(s=this.modelService.createModel(e,t,i),this.createdEditorModel=!0,this.registerModelDisposeListener(s)),this.textEditorModelHandle=s.uri,s}getFirstLineText(e){const t=e;return typeof t.getFirstLineText=="function"?t.getFirstLineText(qY.FIRST_LINE_DETECTION_LENGTH_LIMIT):e.getLineContent(1).substr(0,qY.FIRST_LINE_DETECTION_LENGTH_LIMIT)}getOrCreateLanguage(e,t,i,s){return!i||i===cl?t.createByFilepathOrFirstLine(e??null,s):t.createById(i)}updateTextEditorModel(e,t,i){this.isResolved()&&(e&&this.modelService.updateModel(this.textEditorModel,e,i),t&&t!==cl&&this.textEditorModel.getLanguageId()!==t&&this.textEditorModel.setLanguage(this.languageService.createById(t)))}createSnapshot(){return this.textEditorModel?this.textEditorModel.createSnapshot(!0):null}isResolved(){return!!this.textEditorModelHandle}dispose(){this.modelDisposeListener.dispose(),this.textEditorModelHandle&&this.createdEditorModel&&this.modelService.destroyModel(this.textEditorModelHandle),this.textEditorModelHandle=void 0,this.createdEditorModel=!1,super.dispose()}},ewe=Y0,Y0.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY=600,Y0);bI=ewe=y([v(0,on),v(1,tn),v(2,J6),v(3,qo)],bI);class htt extends pN{get originalModel(){return this._originalModel}get modifiedModel(){return this._modifiedModel}constructor(e,t){super(),this._originalModel=e,this._modifiedModel=t}async resolve(){await Promise.all([this._originalModel?.resolve(),this._modifiedModel?.resolve()])}isResolved(){return!!(this._originalModel?.isResolved()&&this._modifiedModel?.isResolved())}dispose(){super.dispose()}}class bOt extends htt{get originalModel(){return this._originalModel}get modifiedModel(){return this._modifiedModel}get textDiffEditorModel(){return this._textDiffEditorModel}constructor(e,t){super(e,t),this._textDiffEditorModel=void 0,this._originalModel=e,this._modifiedModel=t,this.updateTextDiffEditorModel()}async resolve(){await super.resolve(),this.updateTextDiffEditorModel()}updateTextDiffEditorModel(){this.originalModel?.isResolved()&&this.modifiedModel?.isResolved()&&(this._textDiffEditorModel?(this._textDiffEditorModel.original=this.originalModel.textEditorModel,this._textDiffEditorModel.modified=this.modifiedModel.textEditorModel):this._textDiffEditorModel={original:this.originalModel.textEditorModel,modified:this.modifiedModel.textEditorModel})}isResolved(){return!!this._textDiffEditorModel}isReadonly(){return!!this.modifiedModel&&this.modifiedModel.isReadonly()}dispose(){this._textDiffEditorModel=void 0,super.dispose()}}function yOt(n,e){const{os:t,tildify:i,relative:s}=e;if(s){const a=SOt(n,s,t);if(typeof a=="string")return a}let r=n.fsPath;if(t===So.Windows&&!as?r=r.replace(/\//g,"\\"):t!==So.Windows&&as&&(r=r.replace(/\\/g,"/")),t!==So.Windows&&i?.userHome){const a=i.userHome.fsPath;let l;n.scheme!==i.userHome.scheme&&n.path[0]===_n.sep&&n.path[1]!==_n.sep?l=i.userHome.with({path:n.path}).fsPath:l=r,r=utt(l,a,t)}return(t===So.Windows?al:_n).normalize(Eb(r,t===So.Windows))}function SOt(n,e,t){const i=t===So.Windows?al:_n,s=t===So.Linux?Gn:aoe,r=e.getWorkspace(),o=r.folders.at(0);if(!o)return;n.scheme!==o.uri.scheme&&n.path[0]===_n.sep&&n.path[1]!==_n.sep&&(n=o.uri.with({path:n.path}));const a=e.getWorkspaceFolder(n);if(!a)return;let l;if(s.isEqual(a.uri,n)?l="":l=s.relativePath(a.uri,n)??"",l&&(l=i.normalize(l)),r.folders.length>1&&!e.noPrefix){const c=a.name?a.name:s.basenameOrAuthority(a.uri);l=l?`${c} • ${l}`:c}return l}function Eb(n,e=as){return vqe(n,e)?n.charAt(0).toUpperCase()+n.slice(1):n}let ehe=Object.create(null);function utt(n,e,t=xl){if(t===So.Windows||!n||!e)return n;let i=ehe.original===e?ehe.normalized:void 0;i||(i=e,as&&(i=X3(i)),i=`${CA(i,_n.sep)}${_n.sep}`,ehe={original:e,normalized:i});let s=n;return as&&(s=X3(s)),(t===So.Linux?s.startsWith(i):toe(s,i))?`~/${s.substr(i.length)}`:n}function COt(n,e){return n.replace(/^~($|\/|\\)/,`${e}$1`)}const jHe="…",PV="\\\\",NV="~";function EOt(n,e=ou){const t=new Array(n.length);let i=!1;for(let s=0;s<n.length;s++){const r=n[s];if(r===""){t[s]=`.${e}`;continue}if(!r){t[s]=r;continue}i=!0;let o="",a=r;a.indexOf(PV)===0?(o=a.substr(0,a.indexOf(PV)+PV.length),a=a.substr(a.indexOf(PV)+PV.length)):a.indexOf(e)===0?(o=a.substr(0,a.indexOf(e)+e.length),a=a.substr(a.indexOf(e)+e.length)):a.indexOf(NV)===0&&(o=a.substr(0,a.indexOf(NV)+NV.length),a=a.substr(a.indexOf(NV)+NV.length));const l=a.split(e);for(let c=1;i&&c<=l.length;c++)for(let d=l.length-c;i&&d>=0;d--){i=!1;let h=l.slice(d,d+c).join(e);for(let u=0;!i&&u<n.length;u++)if(u!==s&&n[u]&&n[u].indexOf(h)>-1){const g=d+c===l.length,p=d>0&&n[u].indexOf(e)>-1?e+h:h,m=n[u].endsWith(p);i=!g||m}if(!i){let u="";(l[0].endsWith(":")||o!=="")&&(d===1&&(d=0,c++,h=l[0]+e+h),d>0&&(u=l[0]+e),u=o+u),d>0&&(u=u+jHe+e),u=u+h,d+c<l.length&&(u=u+e+jHe),t[s]=u}}i&&(t[s]=r)}return t}var Xw;(function(n){n[n.TEXT=0]="TEXT",n[n.VARIABLE=1]="VARIABLE",n[n.SEPARATOR=2]="SEPARATOR"})(Xw||(Xw={}));function xOt(n,e=Object.create(null)){const t=[];let i=!1,s="";for(const r of n)if(r==="$"||i&&r==="{")s&&t.push({value:s,type:Xw.TEXT}),s="",i=!0;else if(r==="}"&&i){const o=e[s];if(typeof o=="string")o.length&&t.push({value:o,type:Xw.VARIABLE});else if(o){const a=t[t.length-1];(!a||a.type!==Xw.SEPARATOR)&&t.push({value:o.label,type:Xw.SEPARATOR})}s="",i=!1}else s+=r;return s&&!i&&t.push({value:s,type:Xw.TEXT}),t.filter((r,o)=>{if(r.type===Xw.SEPARATOR){const a=t[o-1],l=t[o+1];return[a,l].every(c=>c&&(c.type===Xw.VARIABLE||c.type===Xw.TEXT)&&c.value.length>0)}return!0}).map(r=>r.value).join("")}function fx(n,e){return Gt||e?n.replace(/\(&&\w\)|&&/g,"").replace(/&/g,Gt?"&":"&&"):n.replace(/&&|&/g,t=>t==="&"?"&&":"&")}function Wvi(n,e){return n.replace(/\(&&\w\)|&&/g,"")}function DOt(n){return n.replace(/&/g,"&&")}function kOt(n){if(n.endsWith("]")){const e=n.lastIndexOf(" [",n.length-2);if(e!==-1){const t=YHe(n.substring(0,e)),i=n.substring(e);return{name:t.name+i,parentPath:t.parentPath}}}return YHe(n)}function YHe(n){const e=n.indexOf("/")!==-1?_n:al,t=e.basename(n),i=e.dirname(n);return t.length?{name:t,parentPath:i}:{name:i,parentPath:""}}var TK,X0;let oy=(X0=class extends AC{get typeId(){return TK.ID}get editorId(){return this.modified.editorId===this.original.editorId?this.modified.editorId:void 0}get capabilities(){let e=super.capabilities;return this.labels.forceDescription&&(e|=$n.ForceDescription),e}constructor(e,t,i,s,r,o){super(e,t,i,s,o),this.original=i,this.modified=s,this.forceOpenAsBinary=r,this.cachedModel=void 0,this.labels=this.computeLabels()}computeLabels(){let e,t=!1;if(this.preferredName)e=this.preferredName;else{const d=this.original.getName(),h=this.modified.getName();e=f(3942,"{0} ↔ {1}",d,h),t=d===h}let i,s,r;if(this.preferredDescription)i=this.preferredDescription,s=this.preferredDescription,r=this.preferredDescription;else{i=this.computeLabel(this.original.getDescription(Ks.SHORT),this.modified.getDescription(Ks.SHORT)),r=this.computeLabel(this.original.getDescription(Ks.LONG),this.modified.getDescription(Ks.LONG));const d=this.original.getDescription(Ks.MEDIUM),h=this.modified.getDescription(Ks.MEDIUM);if(typeof d=="string"&&typeof h=="string"&&(d||h)){const[u,g]=EOt([d,h]);s=this.computeLabel(u,g)}}let o=this.computeLabel(this.original.getTitle(Ks.SHORT)??this.original.getName(),this.modified.getTitle(Ks.SHORT)??this.modified.getName()," ↔ "),a=this.computeLabel(this.original.getTitle(Ks.MEDIUM)??this.original.getName(),this.modified.getTitle(Ks.MEDIUM)??this.modified.getName()," ↔ "),l=this.computeLabel(this.original.getTitle(Ks.LONG)??this.original.getName(),this.modified.getTitle(Ks.LONG)??this.modified.getName()," ↔ ");const c=this.getPreferredTitle();return c&&(o=`${c} (${o})`,a=`${c} (${a})`,l=`${c} (${l})`),{name:e,shortDescription:i,mediumDescription:s,longDescription:r,forceDescription:t,shortTitle:o,mediumTitle:a,longTitle:l}}computeLabel(e,t,i=" - "){if(!(!e||!t))return e===t?t:`${e}${i}${t}`}getName(){return this.labels.name}getDescription(e=Ks.MEDIUM){switch(e){case Ks.SHORT:return this.labels.shortDescription;case Ks.LONG:return this.labels.longDescription;case Ks.MEDIUM:default:return this.labels.mediumDescription}}getTitle(e){switch(e){case Ks.SHORT:return this.labels.shortTitle;case Ks.LONG:return this.labels.longTitle;default:case Ks.MEDIUM:return this.labels.mediumTitle}}async resolve(){const e=await this.createModel();return this.cachedModel?.dispose(),this.cachedModel=e,this.cachedModel}prefersEditorPane(e){return this.forceOpenAsBinary?e.find(t=>t.typeId===gNt):e.find(t=>t.typeId===fNt)}async createModel(){const[e,t]=await Promise.all([this.original.resolve(),this.modified.resolve()]);return t instanceof bI&&e instanceof bI?new bOt(e,t):new htt(MMe(e)?e:void 0,MMe(t)?t:void 0)}toUntyped(e){const t=super.toUntyped(e);if(t)return{...t,modified:t.primary,original:t.secondary}}matches(e){return this===e?!0:e instanceof TK?this.modified.matches(e.modified)&&this.original.matches(e.original)&&e.forceOpenAsBinary===this.forceOpenAsBinary:Yb(e)?this.modified.matches(e.modified)&&this.original.matches(e.original):!1}dispose(){this.cachedModel&&(this.cachedModel.dispose(),this.cachedModel=void 0),super.dispose()}},TK=X0,X0.ID="workbench.editors.diffEditorInput",X0);oy=TK=y([v(5,ls)],oy);class Bvi extends dtt{createEditorInput(e,t,i,s,r){return e.createInstance(oy,t,i,s,r,void 0)}}var G_;const IOt=new j("workbenchState",void 0,{type:"string",description:f(3866,"The kind of workspace opened in the window, either 'empty' (no workspace), 'folder' (single folder) or 'workspace' (multi-root workspace)")}),TOt=new j("workspaceFolderCount",0,f(3867,"The number of root folders in the workspace")),LOt=new j("openFolderWorkspaceSupport",!0,!0),ROt=new j("enterMultiRootWorkspaceSupport",!0,!0),AOt=new j("emptyWorkspaceSupport",!0,!0),POt=new j("dirtyWorkingCopies",!1,f(3868,"Whether there are any working copies with unsaved changes")),ftt=new j("remoteName","",f(3869,"The name of the remote the window is connected to or an empty string if not connected to any remote")),NOt=new j("virtualWorkspace","",f(3870,"The scheme of the current workspace is from a virtual file system or an empty string.")),gtt=new j("temporaryWorkspace",!1,f(3871,"The scheme of the current workspace is from a temporary file system.")),MOt=new j("hasWebFileSystemAccess",!1,!0),OOt=new j("embedderIdentifier",void 0,f(3872,"The identifier of the embedder according to the product service, if one is defined")),rP=new j("isSandboxWorkspace",!1,!0),kle=new j("isFullscreen",!1,f(3873,"Whether the main window is in fullscreen mode")),Ew=new j("isAuxiliaryWindowFocusedContext",!1,f(3874,"Whether an auxiliary window is focused")),oP=new j("isAuxiliaryWindow",!1,f(3875,"Window is an auxiliary window")),Hvi=new j("activeEditorIsDirty",!1,f(3876,"Whether the active editor has unsaved changes")),Vvi=new j("activeEditorIsNotPreview",!1,f(3877,"Whether the active editor is not in preview mode")),Uvi=new j("activeEditorIsFirstInGroup",!1,f(3878,"Whether the active editor is the first one in its group")),$vi=new j("activeEditorIsLastInGroup",!1,f(3879,"Whether the active editor is the last one in its group")),zvi=new j("activeEditorIsPinned",!1,f(3880,"Whether the active editor is pinned")),qvi=new j("activeEditorIsReadonly",!1,f(3881,"Whether the active editor is read-only")),Gvi=new j("activeCompareEditorCanSwap",!1,f(3882,"Whether the active compare editor can swap sides")),Kvi=new j("activeEditorCanToggleReadonly",!0,f(3883,"Whether the active editor can toggle between being read-only or writeable")),jvi=new j("activeEditorCanRevert",!1,f(3884,"Whether the active editor can revert")),Yvi=new j("activeEditorCanSplitInGroup",!0),FOt=new j("activeEditor",null,{type:"string",description:f(3885,"The identifier of the active editor")}),Xvi=new j("activeEditorAvailableEditorIds","",f(3886,"The available editor identifiers that are usable for the active editor")),Qvi=new j("textCompareEditorVisible",!1,f(3887,"Whether a text compare editor is visible")),Zvi=new j("textCompareEditorActive",!1,f(3888,"Whether a text compare editor is active")),Jvi=new j("sideBySideEditorActive",!1,f(3889,"Whether a side by side editor is active")),ewi=new j("groupEditorsCount",0,f(3890,"The number of opened editor groups")),WOt=new j("activeEditorGroupEmpty",!1,f(3891,"Whether the active editor group is empty")),BOt=new j("activeEditorGroupIndex",0,f(3892,"The index of the active editor group")),HOt=new j("activeEditorGroupLast",!1,f(3893,"Whether the active editor group is the last group")),VOt=new j("activeEditorGroupLocked",!1,f(3894,"Whether the active editor group is locked")),UOt=new j("multipleEditorGroups",!1,f(3895,"Whether there are multiple editor groups opened")),twi=new j("multipleEditorsSelectedInGroup",!1,f(3896,"Whether multiple editors have been selected in an editor group")),iwi=new j("twoEditorsSelectedInGroup",!1,f(3897,"Whether exactly two editors have been selected in an editor group")),nwi=new j("SelectedEditorsInGroupFileOrUntitledResourceContextKey",!0,f(3898,"Whether all selected editors in a group have a file or untitled resource associated")),swi=new j("editorPartMultipleEditorGroups",!1,f(3899,"Whether there are multiple editor groups opened in an editor part")),rwi=new j("editorPartMaximizedEditorGroup",!1,f(3900,"Editor Part has a maximized group")),$Ot=new j("editorIsOpen",!1,f(3901,"Whether an editor is open")),wm=new j("inZenMode",!1,f(3902,"Whether Zen mode is enabled")),zAe=new j("isCenteredLayout",!1,f(3903,"Whether centered layout is enabled for the main editor")),zOt=new j("splitEditorsVertically",!1,f(3904,"Whether editors split vertically")),ptt=new j("mainEditorAreaVisible",!0,f(3905,"Whether the editor area in the main window is visible")),qOt=new j("editorTabsVisible",!0,f(3906,"Whether editor tabs are visible")),hF=new j("sideBarVisible",!1,f(3907,"Whether the sidebar is visible")),owi=new j("sideBarFocus",!1,f(3908,"Whether the sidebar has keyboard focus")),awi=new j("activeViewlet","",f(3909,"The identifier of the active viewlet")),lwi=new j("statusBarFocused",!1,f(3910,"Whether the status bar has keyboard focus")),mtt=new j("titleBarStyle","custom",f(3911,"Style of the window title bar")),GOt=new j("titleBarVisible",!1,f(3912,"Whether the title bar is visible")),cwi=new j("isCompactTitleBar",!1,f(3913,"Title bar is in compact mode")),dwi=new j("bannerFocused",!1,f(3914,"Whether the banner has keyboard focus")),hwi=new j("notificationFocus",!0,f(3915,"Whether a notification has keyboard focus")),uwi=new j("notificationCenterVisible",!1,f(3916,"Whether the notifications center is visible")),fwi=new j("notificationToastsVisible",!1,f(3917,"Whether a notification toast is visible")),gwi=new j("activeAuxiliary","",f(3918,"The identifier of the active auxiliary panel")),pwi=new j("auxiliaryBarFocus",!1,f(3919,"Whether the auxiliary bar has keyboard focus")),d0=new j("auxiliaryBarVisible",!1,f(3920,"Whether the auxiliary bar is visible")),uF=new j("auxiliaryBarMaximized",!1,f(3921,"Whether the auxiliary bar is maximized")),mwi=new j("activePanel","",f(3922,"The identifier of the active panel")),_wi=new j("panelFocus",!1,f(3923,"Whether the panel has keyboard focus")),d1=new j("panelPosition","bottom",f(3924,"The position of the panel, always 'bottom'")),PC=new j("panelAlignment","center",f(3925,"The alignment of the panel, either 'center', 'left', 'right' or 'justify'")),wz=new j("panelVisible",!1,f(3926,"Whether the panel is visible")),_tt=new j("panelMaximized",!1,f(3927,"Whether the panel is maximized")),lw=new j("focusedView","",f(3928,"The identifier of the view that has keyboard focus"));function vwi(n){return`view.${n}.visible`}var Wf;let iZ=(Wf=class{constructor(e,t,i,s){this._contextKeyService=e,this._fileService=t,this._languageService=i,this._modelService=s,this._disposables=new ie,this._schemeKey=G_.Scheme.bindTo(this._contextKeyService),this._filenameKey=G_.Filename.bindTo(this._contextKeyService),this._dirnameKey=G_.Dirname.bindTo(this._contextKeyService),this._pathKey=G_.Path.bindTo(this._contextKeyService),this._langIdKey=G_.LangId.bindTo(this._contextKeyService),this._resourceKey=G_.Resource.bindTo(this._contextKeyService),this._extensionKey=G_.Extension.bindTo(this._contextKeyService),this._hasResource=G_.HasResource.bindTo(this._contextKeyService),this._isFileSystemResource=G_.IsFileSystemResource.bindTo(this._contextKeyService),this._disposables.add(t.onDidChangeFileSystemProviderRegistrations(()=>{const r=this.get();this._isFileSystemResource.set(!!(r&&t.hasProvider(r)))})),this._disposables.add(s.onModelAdded(r=>{hs(r.uri,this.get())&&this._setLangId()})),this._disposables.add(s.onModelLanguageChanged(r=>{hs(r.model.uri,this.get())&&this._setLangId()}))}dispose(){this._disposables.dispose()}_setLangId(){const e=this.get();if(!e){this._langIdKey.set(null);return}const t=this._modelService.getModel(e)?.getLanguageId()??this._languageService.guessLanguageIdByFilepathOrFirstLine(e);this._langIdKey.set(t)}set(e){e=e??void 0,!hs(this._value,e)&&(this._value=e,this._contextKeyService.bufferChangeEvents(()=>{this._resourceKey.set(e?e.toString():null),this._schemeKey.set(e?e.scheme:null),this._filenameKey.set(e?In(e):null),this._dirnameKey.set(e?this.uriToPath(Ka(e)):null),this._pathKey.set(e?this.uriToPath(e):null),this._setLangId(),this._extensionKey.set(e?zB(e):null),this._hasResource.set(!!e),this._isFileSystemResource.set(e?this._fileService.hasProvider(e):!1)}))}uriToPath(e){return e.scheme===ye.file?e.fsPath:e.path}reset(){this._value=void 0,this._contextKeyService.bufferChangeEvents(()=>{this._resourceKey.reset(),this._schemeKey.reset(),this._filenameKey.reset(),this._dirnameKey.reset(),this._pathKey.reset(),this._langIdKey.reset(),this._extensionKey.reset(),this._hasResource.reset(),this._isFileSystemResource.reset()})}get(){return this._value}},G_=Wf,Wf.Scheme=new j("resourceScheme",void 0,{type:"string",description:f(3929,"The scheme of the resource")}),Wf.Filename=new j("resourceFilename",void 0,{type:"string",description:f(3930,"The file name of the resource")}),Wf.Dirname=new j("resourceDirname",void 0,{type:"string",description:f(3931,"The folder name the resource is contained in")}),Wf.Path=new j("resourcePath",void 0,{type:"string",description:f(3932,"The full path of the resource")}),Wf.LangId=new j("resourceLangId",void 0,{type:"string",description:f(3933,"The language identifier of the resource")}),Wf.Resource=new j("resource",void 0,{type:"URI",description:f(3934,"The full value of the resource including scheme and path")}),Wf.Extension=new j("resourceExtname",void 0,{type:"string",description:f(3935,"The extension name of the resource")}),Wf.HasResource=new j("resourceSet",void 0,{type:"boolean",description:f(3936,"Whether a resource is present or not")}),Wf.IsFileSystemResource=new j("isFileSystemResource",void 0,{type:"boolean",description:f(3937,"Whether the resource is backed by a file system provider")}),Wf);iZ=G_=y([v(0,tt),v(1,rn),v(2,tn),v(3,on)],iZ);function wwi(n,e,t){if(!e){n.set("");return}const i=twe(e,t);n.set(i.join(","))}function twe(n,e){if(n.resource?.scheme===ye.untitled&&n.editorId!==nk.id)return[];if(n instanceof oy){const t=twe(n.original,e),i=new Set(twe(n.modified,e));return t.filter(s=>i.has(s))}return n.resource?e.getEditors(n.resource).map(t=>t.id):[]}var iwe;(function(n){n.UseFileStorage="chat.useFileStorage",n.AgentEnabled="chat.agent.enabled",n.Edits2Enabled="chat.edits2.enabled",n.ExtensionToolsEnabled="chat.extensionTools.enabled",n.EditRequests="chat.editRequests",n.EnableMath="chat.math.enabled",n.CheckpointsEnabled="chat.checkpoints.enabled",n.AgentSessionsViewLocation="chat.agentSessionsViewLocation"})(iwe||(iwe={}));var Gv;(function(n){n.Ask="ask",n.Edit="edit",n.Agent="agent"})(Gv||(Gv={}));var dc;(function(n){n.Panel="panel",n.Terminal="terminal",n.Notebook="notebook",n.Editor="editor"})(dc||(dc={}));(function(n){function e(t){switch(t){case"panel":return n.Panel;case"terminal":return n.Terminal;case"notebook":return n.Notebook;case"editor":return n.Editor}return n.Panel}n.fromRaw=e})(dc||(dc={}));var hE;(function(n){n.responseVote=new j("chatSessionResponseVote","",{type:"string",description:f(5354,"When the response has been voted up, is set to 'up'. When voted down, is set to 'down'. Otherwise an empty string.")}),n.responseDetectedAgentCommand=new j("chatSessionResponseDetectedAgentOrCommand",!1,{type:"boolean",description:f(5355,"When the agent or command was automatically detected")}),n.responseSupportsIssueReporting=new j("chatResponseSupportsIssueReporting",!1,{type:"boolean",description:f(5356,"True when the current chat response supports issue reporting.")}),n.responseIsFiltered=new j("chatSessionResponseFiltered",!1,{type:"boolean",description:f(5357,"True when the chat response was filtered out by the server.")}),n.responseHasError=new j("chatSessionResponseError",!1,{type:"boolean",description:f(5358,"True when the chat response resulted in an error.")}),n.requestInProgress=new j("chatSessionRequestInProgress",!1,{type:"boolean",description:f(5359,"True when the current request is still in progress.")}),n.currentlyEditing=new j("chatSessionCurrentlyEditing",!1,{type:"boolean",description:f(5360,"True when the current request is being edited.")}),n.currentlyEditingInput=new j("chatSessionCurrentlyEditingInput",!1,{type:"boolean",description:f(5361,"True when the current request input at the bottom is being edited.")}),n.isRequestPaused=new j("chatRequestIsPaused",!1,{type:"boolean",description:f(5362,"True when the current request is paused.")}),n.canRequestBePaused=new j("chatCanRequestBePaused",!1,{type:"boolean",description:f(5363,"True when the current request can be paused.")}),n.isResponse=new j("chatResponse",!1,{type:"boolean",description:f(5364,"The chat item is a response.")}),n.isRequest=new j("chatRequest",!1,{type:"boolean",description:f(5365,"The chat item is a request")}),n.itemId=new j("chatItemId","",{type:"string",description:f(5366,"The id of the chat item.")}),n.lastItemId=new j("chatLastItemId",[],{type:"string",description:f(5367,"The id of the last chat item.")}),n.editApplied=new j("chatEditApplied",!1,{type:"boolean",description:f(5368,"True when the chat text edits have been applied.")}),n.inputHasText=new j("chatInputHasText",!1,{type:"boolean",description:f(5369,"True when the chat input has text.")}),n.inputHasFocus=new j("chatInputHasFocus",!1,{type:"boolean",description:f(5370,"True when the chat input has focus.")}),n.inChatInput=new j("inChatInput",!1,{type:"boolean",description:f(5371,"True when focus is in the chat input, false otherwise.")}),n.inChatSession=new j("inChat",!1,{type:"boolean",description:f(5372,"True when focus is in the chat widget, false otherwise.")}),n.inChatEditor=new j("inChatEditor",!1,{type:"boolean",description:f(5373,"Whether focus is in a chat editor.")}),n.hasPromptFile=new j("chatPromptFileAttached",!1,{type:"boolean",description:f(5374,"True when the chat has a prompt file attached.")}),n.chatModeKind=new j("chatMode",Gv.Ask,{type:"string",description:f(5375,"The 'kind' of the current chat mode- Agent for custom modes.")}),n.chatToolCount=new j("chatToolCount",0,{type:"number",description:f(5376,"The number of tools available in the current chat mode.")}),n.chatToolGroupingThreshold=new j("chat.toolGroupingThreshold",0,{type:"number",description:f(5377,"The number of tools at which we start doing virtual grouping.")}),n.supported=ne.or(fH.negate(),ftt.notEqualsTo(""),ne.has("config.chat.experimental.serverlessWebEnabled")),n.enabled=new j("chatIsEnabled",!1,{type:"boolean",description:f(5378,"True when chat is enabled because a default chat participant is activated with an implementation.")}),n.lockedToCodingAgent=new j("lockedToCodingAgent",!1,{type:"boolean",description:f(5379,"True when the chat widget is locked to the coding agent session.")}),n.extensionParticipantRegistered=new j("chatPanelExtensionParticipantRegistered",!1,{type:"boolean",description:f(5380,"True when a default chat participant is registered for the panel from an extension.")}),n.panelParticipantRegistered=new j("chatPanelParticipantRegistered",!1,{type:"boolean",description:f(5381,"True when a default chat participant is registered for the panel.")}),n.chatEditingCanUndo=new j("chatEditingCanUndo",!1,{type:"boolean",description:f(5382,"True when it is possible to undo an interaction in the editing panel.")}),n.chatEditingCanRedo=new j("chatEditingCanRedo",!1,{type:"boolean",description:f(5383,"True when it is possible to redo an interaction in the editing panel.")}),n.languageModelsAreUserSelectable=new j("chatModelsAreUserSelectable",!1,{type:"boolean",description:f(5384,"True when the chat model can be selected manually by the user.")}),n.extensionInvalid=new j("chatExtensionInvalid",!1,{type:"boolean",description:f(5385,"True when the installed chat extension is invalid and needs to be updated.")}),n.inputCursorAtTop=new j("chatCursorAtTop",!1),n.inputHasAgent=new j("chatInputHasAgent",!1),n.location=new j("chatLocation",void 0),n.inQuickChat=new j("quickChatHasFocus",!1,{type:"boolean",description:f(5386,"True when the quick chat UI has focus, false otherwise.")}),n.hasFileAttachments=new j("chatHasFileAttachments",!1,{type:"boolean",description:f(5387,"True when the chat has file attachments.")}),n.remoteJobCreating=new j("chatRemoteJobCreating",!1,{type:"boolean",description:f(5388,"True when a remote coding agent job is being created.")}),n.hasRemoteCodingAgent=new j("hasRemoteCodingAgent",!1,f(5389,"Whether any remote coding agent is available")),n.enableRemoteCodingAgentPromptFileOverlay=new j("enableRemoteCodingAgentPromptFileOverlay",!1,f(5390,"Whether the remote coding agent prompt file overlay feature is enabled")),n.skipChatRequestInProgressMessage=new j("chatSkipRequestInProgressMessage",!1,{type:"boolean",description:f(5391,"True when the chat request in progress message should be skipped.")}),n.Setup={hidden:new j("chatSetupHidden",!1,!0),installed:new j("chatSetupInstalled",!1,!0),disabled:new j("chatSetupDisabled",!1,!0),untrusted:new j("chatSetupUntrusted",!1,!0),later:new j("chatSetupLater",!1,!0)},n.Entitlement={signedOut:new j("chatEntitlementSignedOut",!1,!0),canSignUp:new j("chatPlanCanSignUp",!1,!0),free:new j("chatPlanFree",!1,!0),pro:new j("chatPlanPro",!1,!0),proPlus:new j("chatPlanProPlus",!1,!0),business:new j("chatPlanBusiness",!1,!0),enterprise:new j("chatPlanEnterprise",!1,!0)},n.chatQuotaExceeded=new j("chatQuotaExceeded",!1,!0),n.completionsQuotaExceeded=new j("completionsQuotaExceeded",!1,!0),n.Editing={hasToolConfirmation:new j("chatHasToolConfirmation",!1,{type:"boolean",description:f(5392,"True when a tool confirmation is present.")})},n.Tools={toolsCount:new j("toolsCount",0,{type:"number",description:f(5393,"The count of tools available in the chat.")})},n.Modes={hasCustomChatModes:new j("chatHasCustomChatModes",!1,{type:"boolean",description:f(5394,"True when the chat has custom chat modes available.")})},n.panelLocation=new j("chatPanelLocation",void 0,{type:"number",description:f(5395,"The location of the chat panel.")})})(hE||(hE={}));var XHe;(function(n){n.inEditingMode=ne.or(hE.chatModeKind.isEqualTo(Gv.Edit),hE.chatModeKind.isEqualTo(Gv.Agent))})(XHe||(XHe={}));var RS;(function(n){n[n.System=0]="System",n[n.User=1]="User",n[n.Assistant=2]="Assistant"})(RS||(RS={}));var QHe;(function(n){n[n.Assistant=0]="Assistant",n[n.User=1]="User"})(QHe||(QHe={}));var ZHe;(function(n){n.PNG="image/png",n.JPEG="image/jpeg",n.GIF="image/gif",n.WEBP="image/webp",n.BMP="image/bmp"})(ZHe||(ZHe={}));var JHe;(function(n){n.Low="low",n.High="high"})(JHe||(JHe={}));var eVe;(function(n){function e(i){return(typeof i.capabilities?.agentMode>"u"||i.capabilities.agentMode)&&!!i.capabilities?.toolCalling}n.suitableForAgentMode=e;function t(i){return i.modelPickerCategory===void 0?`${i.name} (${i.family})`:i.name}n.asQualifiedName=t})(eVe||(eVe={}));const tVe={type:"object",properties:{vendor:{type:"string",description:f(5429,"A globally unique vendor of language models.")},displayName:{type:"string",description:f(5430,"The display name of the language model vendor.")},managementCommand:{type:"string",description:f(5431,"A command to manage the language model vendor, e.g. 'Manage Copilot models'. This is used in the chat model picker. If not provided, a gear icon is not rendered during vendor selection.")}}},KOt=bp.registerExtensionPoint({extensionPoint:"languageModels",jsonSchema:{description:f(5432,"Contribute language models of a specific vendor."),oneOf:[tVe,{type:"array",items:tVe}]},activationEventsGenerator:(n,e)=>{for(const t of n)e.push(`onLanguageModelChat:${t.vendor}`)}});let iVe=class{constructor(e,t,i,s){this._extensionService=e,this._logService=t,this._storageService=i,this._store=new ie,this._providers=new Map,this._modelCache=new Map,this._vendors=new Map,this._modelPickerUserPreferences={},this._onLanguageModelChange=this._store.add(new A),this.onDidChangeLanguageModels=this._onLanguageModelChange.event,this._hasUserSelectableModels=hE.languageModelsAreUserSelectable.bindTo(s),this._modelPickerUserPreferences=this._storageService.getObject("chatModelPickerPreferences",ze.PROFILE,this._modelPickerUserPreferences),this._store.add(this.onDidChangeLanguageModels(()=>{this._hasUserSelectableModels.set(this._modelCache.size>0&&Array.from(this._modelCache.values()).some(r=>r.isUserSelectable))})),this._store.add(KOt.setHandler(r=>{this._vendors.clear();for(const o of r){if(!Mr(o.description,"chatProvider")){o.collector.error(f(5433,"This contribution point requires the 'chatProvider' proposal."));continue}for(const a of ri.wrap(o.value)){if(this._vendors.has(a.vendor)){o.collector.error(f(5434,"The vendor '{0}' is already registered and cannot be registered twice",a.vendor));continue}if(Qg(a.vendor)){o.collector.error(f(5435,"The vendor field cannot be empty."));continue}if(a.vendor.trim()!==a.vendor){o.collector.error(f(5436,"The vendor field cannot start or end with whitespace."));continue}this._vendors.set(a.vendor,a)}}for(const[o,a]of this._providers)this._vendors.has(o)||this._providers.delete(o)}))}dispose(){this._store.dispose(),this._providers.clear()}updateModelPickerPreference(e,t){const i=this._modelCache.get(e);if(!i){this._logService.warn(`[LM] Cannot update model picker preference for unknown model ${e}`);return}this._modelPickerUserPreferences[e]=t,t===i.isUserSelectable?(delete this._modelPickerUserPreferences[e],this._storageService.store("chatModelPickerPreferences",this._modelPickerUserPreferences,ze.PROFILE,Xi.USER)):i.isUserSelectable!==t&&this._storageService.store("chatModelPickerPreferences",this._modelPickerUserPreferences,ze.PROFILE,Xi.USER),this._onLanguageModelChange.fire(),this._logService.trace(`[LM] Updated model picker preference for ${e} to ${t}`)}getVendors(){return Array.from(this._vendors.values())}getLanguageModelIds(){return Array.from(this._modelCache.keys())}lookupLanguageModel(e){const t=this._modelCache.get(e);return t&&this._modelPickerUserPreferences[e]!==void 0?{...t,isUserSelectable:this._modelPickerUserPreferences[e]}:t}_clearModelCache(e){typeof e=="string"&&(e=[e]);for(const t of e)for(const[i,s]of this._modelCache.entries())s.vendor===t&&this._modelCache.delete(i)}async resolveLanguageModels(e,t){typeof e=="string"&&(e=[e]),this._clearModelCache(e);for(const i of e){const s=this._providers.get(i);if(!s){this._logService.warn(`[LM] No provider registered for vendor ${i}`);continue}try{const r=await s.prepareLanguageModelChat({silent:t},et.None);for(const o of r){if(this._modelCache.has(o.identifier)){this._logService.warn(`[LM] Model ${o.identifier} is already registered. Skipping.`);continue}this._modelCache.set(o.identifier,o.metadata)}this._logService.trace(`[LM] Resolved language models for vendor ${i}`,r)}catch(r){this._logService.error(`[LM] Error resolving language models for vendor ${i}:`,r)}}this._onLanguageModelChange.fire()}async selectLanguageModels(e,t){if(e.vendor)await this._extensionService.activateByEvent(`onLanguageModelChat:${e.vendor}}`),await this.resolveLanguageModels([e.vendor],!t);else{const s=Array.from(this._vendors.keys()),r=s.map(o=>this._extensionService.activateByEvent(`onLanguageModelChat:${o}`));await Promise.all(r),await this.resolveLanguageModels(s,!t)}const i=[];for(const[s,r]of this._modelCache)(e.vendor===void 0||r.vendor===e.vendor)&&(e.family===void 0||r.family===e.family)&&(e.version===void 0||r.version===e.version)&&(e.id===void 0||r.id===e.id)&&i.push(s);return this._logService.trace("[LM] selected language models",e,i),i}registerLanguageModelProvider(e,t){if(this._logService.trace("[LM] registering language model provider",e,t),!this._vendors.has(e))throw new Error(`Chat model provider uses UNKNOWN vendor ${e}.`);if(this._providers.has(e))throw new Error(`Chat model provider for vendor ${e} is already registered.`);return this._providers.set(e,t),this.resolveLanguageModels(e,!0).then(()=>{this._onLanguageModelChange.fire()}),ke(()=>{this._logService.trace("[LM] UNregistered language model provider",e),this._clearModelCache(e),this._providers.delete(e)})}async sendChatRequest(e,t,i,s,r){const o=this._providers.get(this._modelCache.get(e)?.vendor||"");if(!o)throw new Error(`Chat provider for model ${e} is not registered.`);return o.sendChatRequest(e,i,t,s,r)}computeTokenLength(e,t,i){const s=this._modelCache.get(e);if(!s)throw new Error(`Chat model ${e} could not be found.`);const r=this._providers.get(s.vendor);if(!r)throw new Error(`Chat provider for model ${e} is not registered.`);return r.provideTokenCount(e,t,i)}};iVe=y([v(0,Wr),v(1,it),v(2,Ki),v(3,tt)],iVe);var Fp;(function(n){n.Delimiter="\0"})(Fp||(Fp={}));var rv;(function(n){n[n.IsSame=0]="IsSame",n[n.Disconnected=1]="Disconnected",n[n.IsChild=2]="IsChild",n[n.IsParent=3]="IsParent"})(rv||(rv={}));class Rn{static fromExtHostTestItem(e,t,i=e.parent){if(e._isRoot)return new Rn([t]);const s=[e.id];for(let r=i;r&&r.id!==t;r=r.parent)s.push(r.id);return s.push(t),new Rn(s.reverse())}static isRoot(e){return!e.includes(Fp.Delimiter)}static root(e){const t=e.indexOf(Fp.Delimiter);return t===-1?e:e.slice(0,t)}static fromString(e){return new Rn(e.split(Fp.Delimiter))}static join(e,t){return new Rn([...e.path,t])}static split(e){return e.split(Fp.Delimiter)}static joinToString(e,t){return e.toString()+Fp.Delimiter+t}static parentId(e){const t=e.lastIndexOf(Fp.Delimiter);return t===-1?void 0:e.slice(0,t)}static localId(e){const t=e.lastIndexOf(Fp.Delimiter);return t===-1?e:e.slice(t+Fp.Delimiter.length)}static isChild(e,t){return t[e.length]===Fp.Delimiter&&t.startsWith(e)}static compare(e,t){return e===t?rv.IsSame:Rn.isChild(e,t)?rv.IsChild:Rn.isChild(t,e)?rv.IsParent:rv.Disconnected}static getLengthOfCommonPrefix(e,t){if(e===0)return 0;let i=0;for(;i<e-1;){for(let s=1;s<e;s++){const r=t(s-1),o=t(s);if(r.path[i]!==o.path[i])return i}i++}return i}constructor(e,t=e.length){if(this.path=e,this.viewEnd=t,e.length===0||t<1)throw new Error("cannot create test with empty path")}get rootId(){return new Rn(this.path,1)}get parentId(){return this.viewEnd>1?new Rn(this.path,this.viewEnd-1):void 0}get localId(){return this.path[this.viewEnd-1]}get controllerId(){return this.path[0]}get isRoot(){return this.viewEnd===1}*idsFromRoot(){for(let e=1;e<=this.viewEnd;e++)yield new Rn(this.path,e)}*idsToRoot(){for(let e=this.viewEnd;e>0;e--)yield new Rn(this.path,e)}compare(e){if(typeof e=="string")return Rn.compare(this.toString(),e);for(let t=0;t<e.viewEnd&&t<this.viewEnd;t++)if(e.path[t]!==this.path[t])return rv.Disconnected;return e.viewEnd>this.viewEnd?rv.IsChild:e.viewEnd<this.viewEnd?rv.IsParent:rv.IsSame}toJSON(){return this.toString()}toString(){if(!this.stringifed){this.stringifed=this.path[0];for(let e=1;e<this.viewEnd;e++)this.stringifed+=Fp.Delimiter,this.stringifed+=this.path[e]}return this.stringifed}}var ts;(function(n){n[n.Unset=0]="Unset",n[n.Queued=1]="Queued",n[n.Running=2]="Running",n[n.Passed=3]="Passed",n[n.Failed=4]="Failed",n[n.Skipped=5]="Skipped",n[n.Errored=6]="Errored"})(ts||(ts={}));ts.Unset+"",ts.Queued+"",ts.Running+"",ts.Passed+"",ts.Failed+"",ts.Skipped+"",ts.Errored+"";var nVe;(function(n){n[n.Run=1]="Run",n[n.Debug=2]="Debug",n[n.Coverage=3]="Coverage"})(nVe||(nVe={}));var k5;(function(n){n[n.Refresh=2]="Refresh",n[n.CodeRelatedToTest=4]="CodeRelatedToTest",n[n.TestRelatedToCode=8]="TestRelatedToCode"})(k5||(k5={}));var Bc;(function(n){n[n.Run=2]="Run",n[n.Debug=4]="Debug",n[n.Coverage=8]="Coverage",n[n.HasNonDefaultProfile=16]="HasNonDefaultProfile",n[n.HasConfigurable=32]="HasConfigurable",n[n.SupportsContinuousRun=64]="SupportsContinuousRun"})(Bc||(Bc={}));Bc.Run+"",f(11849,"Run"),Bc.Debug+"",f(11850,"Debug"),Bc.Coverage+"",f(11851,"Coverage");Bc.Run,Bc.Debug,Bc.Coverage,Bc.HasNonDefaultProfile,Bc.HasConfigurable,Bc.SupportsContinuousRun;const jOt=n=>"runId"in n;var HW;(function(n){n.serialize=e=>({range:e.range.toJSON(),uri:e.uri.toJSON()}),n.deserialize=(e,t)=>({range:M.lift(t.range),uri:e.asCanonicalUri(N.revive(t.uri))})})(HW||(HW={}));var S_;(function(n){n[n.Error=0]="Error",n[n.Output=1]="Output"})(S_||(S_={}));var nZ;(function(n){n.serialize=e=>({label:e.label,uri:e.uri?.toJSON(),position:e.position?.toJSON()}),n.deserialize=(e,t)=>({label:t.label,uri:t.uri?e.asCanonicalUri(N.revive(t.uri)):void 0,position:t.position?oe.lift(t.position):void 0})})(nZ||(nZ={}));var sZ;(function(n){n.serialize=e=>({message:e.message,type:S_.Error,expected:e.expected,actual:e.actual,contextValue:e.contextValue,location:e.location&&HW.serialize(e.location),stackTrace:e.stackTrace?.map(nZ.serialize)}),n.deserialize=(e,t)=>({message:t.message,type:S_.Error,expected:t.expected,actual:t.actual,contextValue:t.contextValue,location:t.location&&HW.deserialize(e,t.location),stackTrace:t.stackTrace&&t.stackTrace.map(i=>nZ.deserialize(e,i))})})(sZ||(sZ={}));const YOt=(n,e)=>`${e?"s":"e"}${n}`;var rZ;(function(n){n.serialize=e=>({message:e.message,type:S_.Output,offset:e.offset,length:e.length,location:e.location&&HW.serialize(e.location)}),n.deserialize=(e,t)=>({message:t.message,type:S_.Output,offset:t.offset,length:t.length,location:t.location&&HW.deserialize(e,t.location)})})(rZ||(rZ={}));var l8;(function(n){n.serialize=e=>e.type===S_.Error?sZ.serialize(e):rZ.serialize(e),n.deserialize=(e,t)=>t.type===S_.Error?sZ.deserialize(e,t):rZ.deserialize(e,t),n.isDiffable=e=>e.type===S_.Error&&e.actual!==void 0&&e.expected!==void 0})(l8||(l8={}));var I5;(function(n){n.serializeWithoutMessages=e=>({state:e.state,duration:e.duration,messages:[]}),n.serialize=e=>({state:e.state,duration:e.duration,messages:e.messages.map(l8.serialize)}),n.deserialize=(e,t)=>({state:t.state,duration:t.duration,messages:t.messages.map(i=>l8.deserialize(e,i))})})(I5||(I5={}));const vtt="\0",LK=(n,e)=>n+vtt+e,wtt=n=>{const e=n.indexOf(vtt);return{ctrlId:n.slice(0,e),tagId:n.slice(e+1)}};var c8;(function(n){n.serialize=e=>({extId:e.extId,label:e.label,tags:e.tags,busy:e.busy,children:void 0,uri:e.uri?.toJSON(),range:e.range?.toJSON()||null,description:e.description,error:e.error,sortText:e.sortText}),n.deserialize=(e,t)=>({extId:t.extId,label:t.label,tags:t.tags,busy:t.busy,children:void 0,uri:t.uri?e.asCanonicalUri(N.revive(t.uri)):void 0,range:t.range?M.lift(t.range):null,description:t.description,error:t.error,sortText:t.sortText})})(c8||(c8={}));var Pd;(function(n){n[n.NotExpandable=0]="NotExpandable",n[n.Expandable=1]="Expandable",n[n.BusyExpanding=2]="BusyExpanding",n[n.Expanded=3]="Expanded"})(Pd||(Pd={}));var ak;(function(n){n.serialize=e=>({expand:e.expand,item:c8.serialize(e.item)}),n.deserialize=(e,t)=>({controllerId:Rn.root(t.item.extId),expand:t.expand,item:c8.deserialize(e,t.item)})})(ak||(ak={}));var d8;(function(n){n.serialize=e=>{let t;return e.item&&(t={},e.item.label!==void 0&&(t.label=e.item.label),e.item.tags!==void 0&&(t.tags=e.item.tags),e.item.busy!==void 0&&(t.busy=e.item.busy),e.item.uri!==void 0&&(t.uri=e.item.uri?.toJSON()),e.item.range!==void 0&&(t.range=e.item.range?.toJSON()),e.item.description!==void 0&&(t.description=e.item.description),e.item.error!==void 0&&(t.error=e.item.error),e.item.sortText!==void 0&&(t.sortText=e.item.sortText)),{extId:e.extId,expand:e.expand,item:t}},n.deserialize=e=>{let t;return e.item&&(t={},e.item.label!==void 0&&(t.label=e.item.label),e.item.tags!==void 0&&(t.tags=e.item.tags),e.item.busy!==void 0&&(t.busy=e.item.busy),e.item.range!==void 0&&(t.range=e.item.range?M.lift(e.item.range):null),e.item.description!==void 0&&(t.description=e.item.description),e.item.error!==void 0&&(t.error=e.item.error),e.item.sortText!==void 0&&(t.sortText=e.item.sortText)),{extId:e.extId,expand:e.expand,item:t}}})(d8||(d8={}));const nwe=(n,e)=>{e.expand!==void 0&&(n.expand=e.expand),e.item!==void 0&&(n.item=n.item?Object.assign(n.item,e.item):e.item)};var oZ;(function(n){n.serializeWithoutMessages=e=>({...ak.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(I5.serializeWithoutMessages)}),n.serialize=e=>({...ak.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(I5.serialize)}),n.deserialize=(e,t)=>({...ak.deserialize(e,t),ownComputedState:t.ownComputedState,computedState:t.computedState,tasks:t.tasks.map(i=>I5.deserialize(e,i)),retired:!0})})(oZ||(oZ={}));var swe;(function(n){n.empty=()=>({covered:0,total:0}),n.sum=(e,t)=>{e.covered+=t.covered,e.total+=t.total}})(swe||(swe={}));var rwe;(function(n){n.serialize=e=>({id:e.id,statement:e.statement,branch:e.branch,declaration:e.declaration,testIds:e.testIds,uri:e.uri.toJSON()}),n.deserialize=(e,t)=>({id:t.id,statement:t.statement,branch:t.branch,declaration:t.declaration,testIds:t.testIds,uri:e.asCanonicalUri(N.revive(t.uri))}),n.empty=(e,t)=>({id:e,uri:t,statement:swe.empty()})})(rwe||(rwe={}));function qAe(n){return{...n,location:n.location?.toJSON()}}function GAe(n){return n.location=n.location?oe.isIPosition(n.location)?oe.lift(n.location):M.lift(n.location):void 0,n}var h0;(function(n){n[n.Declaration=0]="Declaration",n[n.Statement=1]="Statement",n[n.Branch=2]="Branch"})(h0||(h0={}));var owe;(function(n){n.serialize=e=>e.type===h0.Declaration?lZ.serialize(e):cZ.serialize(e),n.deserialize=e=>e.type===h0.Declaration?lZ.deserialize(e):cZ.deserialize(e)})(owe||(owe={}));var aZ;(function(n){n.serialize=qAe,n.deserialize=GAe})(aZ||(aZ={}));var lZ;(function(n){n.serialize=qAe,n.deserialize=GAe})(lZ||(lZ={}));var cZ;(function(n){n.serialize=e=>({...qAe(e),branches:e.branches?.map(aZ.serialize)}),n.deserialize=e=>({...GAe(e),branches:e.branches?.map(aZ.deserialize)})})(cZ||(cZ={}));var ma;(function(n){n[n.Add=0]="Add",n[n.Update=1]="Update",n[n.DocumentSynced=2]="DocumentSynced",n[n.Remove=3]="Remove",n[n.IncrementPendingExtHosts=4]="IncrementPendingExtHosts",n[n.Retire=5]="Retire",n[n.AddTag=6]="AddTag",n[n.RemoveTag=7]="RemoveTag"})(ma||(ma={}));var VW;(function(n){n.deserialize=(e,t)=>t.op===ma.Add?{op:t.op,item:ak.deserialize(e,t.item)}:t.op===ma.Update?{op:t.op,item:d8.deserialize(t.item)}:t.op===ma.DocumentSynced?{op:t.op,uri:e.asCanonicalUri(N.revive(t.uri)),docv:t.docv}:t,n.serialize=e=>e.op===ma.Add?{op:e.op,item:ak.serialize(e.item)}:e.op===ma.Update?{op:e.op,item:d8.serialize(e.item)}:e})(VW||(VW={}));class XOt{constructor(e){this.uriIdentity=e,this._tags=new Map,this.items=new Map,this.roots=new Set,this.busyControllerCount=0,this.pendingRootCount=0,this.tags=this._tags}apply(e){const t=this.createChangeCollector();for(const i of e)switch(i.op){case ma.Add:this.add(ak.deserialize(this.uriIdentity,i.item),t);break;case ma.Update:this.update(d8.deserialize(i.item),t);break;case ma.Remove:this.remove(i.itemId,t);break;case ma.Retire:this.retireTest(i.itemId);break;case ma.IncrementPendingExtHosts:this.updatePendingRoots(i.amount);break;case ma.AddTag:this._tags.set(i.tag.id,i.tag);break;case ma.RemoveTag:this._tags.delete(i.id);break}t.complete?.()}add(e,t){const i=Rn.parentId(e.item.extId)?.toString();let s;if(!i)s=this.createItem(e),this.roots.add(s),this.items.set(e.item.extId,s);else if(this.items.has(i)){const r=this.items.get(i);r.children.add(e.item.extId),s=this.createItem(e,r),this.items.set(e.item.extId,s)}else{console.error(`Test with unknown parent ID: ${JSON.stringify(e)}`);return}return t.add?.(s),e.expand===Pd.BusyExpanding&&this.busyControllerCount++,s}update(e,t){const i=this.items.get(e.extId);if(i)return e.expand!==void 0&&(i.expand===Pd.BusyExpanding&&this.busyControllerCount--,e.expand===Pd.BusyExpanding&&this.busyControllerCount++),nwe(i,e),t.update?.(i),i}remove(e,t){const i=this.items.get(e);if(!i)return;const s=Rn.parentId(i.item.extId)?.toString();s?this.items.get(s).children.delete(i.item.extId):this.roots.delete(i);const r=[[e]];for(;r.length;)for(const o of r.pop()){const a=this.items.get(o);a&&(r.push(a.children),this.items.delete(o),t.remove?.(a,a!==i),a.expand===Pd.BusyExpanding&&this.busyControllerCount--)}}retireTest(e){}updatePendingRoots(e){this.pendingRootCount+=e}createChangeCollector(){return{}}}var Ud;(function(n){n[n.Upsert=0]="Upsert",n[n.SetTags=1]="SetTags",n[n.UpdateCanResolveChildren=2]="UpdateCanResolveChildren",n[n.RemoveChild=3]="RemoveChild",n[n.SetProp=4]="SetProp",n[n.Bulk=5]="Bulk",n[n.DocumentSynced=6]="DocumentSynced"})(Ud||(Ud={}));const MV=(n,e)=>n===e,QOt={range:(n,e)=>n===e?!0:!n||!e?!1:n.equalsRange(e),busy:MV,label:MV,description:MV,error:MV,sortText:MV,tags:(n,e)=>!(n.length!==e.length||n.some(t=>!e.includes(t)))},ZOt=Object.entries(QOt),JOt=(n,e)=>{let t;for(const[i,s]of ZOt)s(n[i],e[i])||(t?t[i]=e[i]:t={[i]:e[i]});return t};class eFt extends V{get root(){return this.options.root}constructor(e){super(),this.options=e,this.debounceSendDiff=this._register(new pn(()=>this.flushDiff(),200)),this.diffOpEmitter=this._register(new A),this.tree=new Map,this.tags=new Map,this.diff=[],this.onDidGenerateDiff=this.diffOpEmitter.event,this.root.canResolveChildren=!0,this.upsertItem(this.root,void 0)}set resolveHandler(e){this._resolveHandler=e;for(const t of this.tree.values())this.updateExpandability(t)}get resolveHandler(){return this._resolveHandler}collectDiff(){const e=this.diff;return this.diff=[],e}pushDiff(e){switch(e.op){case ma.DocumentSynced:{for(const t of this.diff)if(t.op===ma.DocumentSynced&&t.uri===e.uri){t.docv=e.docv;return}break}case ma.Update:{const t=this.diff[this.diff.length-1];if(t){if(t.op===ma.Update&&t.item.extId===e.item.extId){nwe(t.item,e.item);return}if(t.op===ma.Add&&t.item.item.extId===e.item.extId){nwe(t.item,e.item);return}}break}}this.diff.push(e),this.debounceSendDiff.isScheduled()||this.debounceSendDiff.schedule()}expand(e,t){const i=this.tree.get(e);if(i){if((i.expandLevels===void 0||t>i.expandLevels)&&(i.expandLevels=t),i.expand===Pd.Expandable){const s=this.resolveChildren(i);return s.isOpen()?this.expandChildren(i,t-1):s.wait().then(()=>this.expandChildren(i,t-1))}else if(i.expand===Pd.Expanded)return i.resolveBarrier?.isOpen()===!1?i.resolveBarrier.wait().then(()=>this.expandChildren(i,t-1)):this.expandChildren(i,t-1)}}dispose(){for(const e of this.tree.values())this.options.getApiFor(e.actual).listener=void 0;this.tree.clear(),this.diff=[],super.dispose()}onTestItemEvent(e,t){switch(t.op){case Ud.RemoveChild:this.removeItem(Rn.joinToString(e.fullId,t.id));break;case Ud.Upsert:this.upsertItem(t.item,e);break;case Ud.Bulk:for(const i of t.ops)this.onTestItemEvent(e,i);break;case Ud.SetTags:this.diffTagRefs(t.new,t.old,e.fullId.toString());break;case Ud.UpdateCanResolveChildren:this.updateExpandability(e);break;case Ud.SetProp:this.pushDiff({op:ma.Update,item:{extId:e.fullId.toString(),item:t.update}});break;case Ud.DocumentSynced:this.documentSynced(e.actual.uri);break;default:bA()}}documentSynced(e){e&&this.pushDiff({op:ma.DocumentSynced,uri:e,docv:this.options.getDocumentVersion(e)})}upsertItem(e,t){const i=Rn.fromExtHostTestItem(e,this.root.id,t?.actual),s=this.options.getApiFor(e);s.parent&&s.parent!==t?.actual&&this.options.getChildren(s.parent).delete(e.id);let r=this.tree.get(i.toString());if(!r){r={fullId:i,actual:e,expandLevels:t?.expandLevels?t.expandLevels-1:void 0,expand:Pd.NotExpandable},e.tags.forEach(this.incrementTagRefs,this),this.tree.set(r.fullId.toString(),r),this.setItemParent(e,t),this.pushDiff({op:ma.Add,item:{controllerId:this.options.controllerId,expand:r.expand,item:this.options.toITestItem(e)}}),this.connectItemAndChildren(e,r,t);return}if(r.actual===e){this.connectItem(e,r,t);return}if(r.actual.uri?.toString()!==e.uri?.toString())return this.removeItem(i.toString()),this.upsertItem(e,t);const o=this.options.getChildren(r.actual),a=r.actual,l=JOt(this.options.toITestItem(a),this.options.toITestItem(e));this.options.getApiFor(a).listener=void 0,r.actual=e,r.resolveBarrier=void 0,r.expand=Pd.NotExpandable,l&&(l.hasOwnProperty("tags")&&(this.diffTagRefs(e.tags,a.tags,i.toString()),delete l.tags),this.onTestItemEvent(r,{op:Ud.SetProp,update:l})),this.connectItemAndChildren(e,r,t);for(const[d,h]of o)this.options.getChildren(e).get(h.id)||this.removeItem(Rn.joinToString(i,h.id));const c=r.expandLevels;c!==void 0&&queueMicrotask(()=>{r.expand===Pd.Expandable&&(r.expandLevels=void 0,this.expand(i.toString(),c))}),this.documentSynced(r.actual.uri)}diffTagRefs(e,t,i){const s=new Set(t.map(r=>r.id));for(const r of e)s.delete(r.id)||this.incrementTagRefs(r);this.pushDiff({op:ma.Update,item:{extId:i,item:{tags:e.map(r=>LK(this.options.controllerId,r.id))}}}),s.forEach(this.decrementTagRefs,this)}incrementTagRefs(e){const t=this.tags.get(e.id);t?t.refCount++:(this.tags.set(e.id,{refCount:1}),this.pushDiff({op:ma.AddTag,tag:{id:LK(this.options.controllerId,e.id)}}))}decrementTagRefs(e){const t=this.tags.get(e);t&&!--t.refCount&&(this.tags.delete(e),this.pushDiff({op:ma.RemoveTag,id:LK(this.options.controllerId,e)}))}setItemParent(e,t){this.options.getApiFor(e).parent=t&&t.actual!==this.root?t.actual:void 0}connectItem(e,t,i){this.setItemParent(e,i);const s=this.options.getApiFor(e);s.parent=i?.actual,s.listener=r=>this.onTestItemEvent(t,r),this.updateExpandability(t)}connectItemAndChildren(e,t,i){this.connectItem(e,t,i);for(const[s,r]of this.options.getChildren(e))this.upsertItem(r,t)}updateExpandability(e){let t;this._resolveHandler?e.resolveBarrier?t=e.resolveBarrier.isOpen()?Pd.Expanded:Pd.BusyExpanding:t=e.actual.canResolveChildren?Pd.Expandable:Pd.NotExpandable:t=Pd.NotExpandable,t!==e.expand&&(e.expand=t,this.pushDiff({op:ma.Update,item:{extId:e.fullId.toString(),expand:t}}),t===Pd.Expandable&&e.expandLevels!==void 0&&this.resolveChildren(e))}expandChildren(e,t){if(t<0)return;const i=[];for(const[s,r]of this.options.getChildren(e.actual)){const o=this.expand(Rn.joinToString(e.fullId,r.id),t);my(o)&&i.push(o)}if(i.length)return Promise.all(i).then(()=>{})}resolveChildren(e){if(e.resolveBarrier)return e.resolveBarrier;if(!this._resolveHandler){const r=new Lh;return r.open(),r}e.expand=Pd.BusyExpanding,this.pushExpandStateUpdate(e);const t=e.resolveBarrier=new Lh,i=r=>{console.error(`Unhandled error in resolveHandler of test controller "${this.options.controllerId}"`,r)};let s;try{s=this._resolveHandler(e.actual===this.root?void 0:e.actual)}catch(r){i(r)}return my(s)?s.catch(i).then(()=>{t.open(),this.updateExpandability(e)}):(t.open(),this.updateExpandability(e)),e.resolveBarrier}pushExpandStateUpdate(e){this.pushDiff({op:ma.Update,item:{extId:e.fullId.toString(),expand:e.expand}})}removeItem(e){const t=this.tree.get(e);if(!t)throw new Error("attempting to remove non-existent child");this.pushDiff({op:ma.Remove,itemId:e});const i=[t];for(;i.length;){const s=i.pop();if(s){this.options.getApiFor(s.actual).listener=void 0;for(const r of s.actual.tags)this.decrementTagRefs(r.id);this.tree.delete(s.fullId.toString());for(const[r,o]of this.options.getChildren(s.actual))i.push(this.tree.get(Rn.joinToString(s.fullId,o.id)))}}}flushDiff(){const e=this.collectDiff();e.length&&this.diffOpEmitter.fire(e)}}class tFt extends Error{constructor(e){super(`Attempted to insert a duplicate test item ID ${e}`)}}class dZ extends Error{constructor(e){super(`TestItem with ID "${e}" is invalid. Make sure to create it from the createTestItem method.`)}}class iFt extends Error{constructor(e,t,i){super(`TestItem with ID "${e}" is from controller "${t}" and cannot be added as a child of an item from controller "${i}".`)}}const nFt=(n,e,t)=>{let i=new Map;return{get size(){return i.size},forEach(s,r){for(const o of i.values())s.call(r,o,this)},[Symbol.iterator](){return i.entries()},replace(s){const r=new Map,o=new Set(i.keys()),a={op:Ud.Bulk,ops:[]};for(const l of s){if(!(l instanceof t))throw new dZ(l.id);const c=e(l).controllerId;if(c!==n.controllerId)throw new iFt(l.id,c,n.controllerId);if(r.has(l.id))throw new tFt(l.id);r.set(l.id,l),o.delete(l.id),a.ops.push({op:Ud.Upsert,item:l})}for(const l of o.keys())a.ops.push({op:Ud.RemoveChild,id:l});n.listener?.(a),i=r},add(s){if(!(s instanceof t))throw new dZ(s.id);i.set(s.id,s),n.listener?.({op:Ud.Upsert,item:s})},delete(s){i.delete(s)&&n.listener?.({op:Ud.RemoveChild,id:s})},get(s){return i.get(s)},toJSON(){return Array.from(i.values())}}},btt=new WeakMap,sFt=(n,e)=>{const t={controllerId:e};return btt.set(n,t),t},Ile=n=>{const e=btt.get(n);if(!e)throw new dZ(n?.id||"<unknown>");return e};var Nx;(function(n){n[n.EMBEDDED=1]="EMBEDDED",n[n.LLM_RANKED=2]="LLM_RANKED",n[n.CANCELED=3]="CANCELED"})(Nx||(Nx={}));var $M;(function(n){n.LATEST_PROTOCOL_VERSION="2025-06-18",n.JSONRPC_VERSION="2.0",n.PARSE_ERROR=-32700,n.INVALID_REQUEST=-32600,n.METHOD_NOT_FOUND=-32601,n.INVALID_PARAMS=-32602,n.INTERNAL_ERROR=-32603})($M||($M={}));function rFt(n,e){return Kn.toKey(n)+"/"+e}var sVe;(function(n){n[n.WorkspaceFolder=0]="WorkspaceFolder",n[n.Workspace=100]="Workspace",n[n.User=200]="User",n[n.Extension=300]="Extension",n[n.Filesystem=400]="Filesystem",n[n.RemoteBoost=-50]="RemoteBoost"})(sVe||(sVe={}));var rVe;(function(n){function e(t,i){return t.id===i.id&&t.remoteAuthority===i.remoteAuthority&&t.label===i.label&&t.trustBehavior===i.trustBehavior}n.equals=e})(rVe||(rVe={}));var awe;(function(n){function e(s){return s}n.toSerialized=e;function t(s){return{id:s.id,label:s.label,cacheNonce:s.cacheNonce,launch:UW.fromSerialized(s.launch),variableReplacement:s.variableReplacement?lwe.fromSerialized(s.variableReplacement):void 0}}n.fromSerialized=t;function i(s,r){return s.id===r.id&&s.label===r.label&&En(s.roots,r.roots,(o,a)=>o.toString()===a.toString())&&rr(s.launch,r.launch)&&rr(s.presentation,r.presentation)&&rr(s.variableReplacement,r.variableReplacement)&&rr(s.devMode,r.devMode)}n.equals=i})(awe||(awe={}));var lwe;(function(n){function e(i){return i}n.toSerialized=e;function t(i){return{section:i.section,folder:i.folder?{...i.folder,uri:N.revive(i.folder.uri)}:void 0,target:i.target}}n.fromSerialized=t})(lwe||(lwe={}));var oVe;(function(n){n[n.HasUnknown=0]="HasUnknown",n[n.LoadingUnknown=1]="LoadingUnknown",n[n.AllKnown=2]="AllKnown"})(oVe||(oVe={}));var hZ;(function(n){(function(e){e[e.Trusted=0]="Trusted",e[e.TrustedOnNonce=1]="TrustedOnNonce",e[e.Untrusted=2]="Untrusted",e[e.Unknown=3]="Unknown"})(n.Kind||(n.Kind={}))})(hZ||(hZ={}));var aVe;(function(n){n[n.Unknown=0]="Unknown",n[n.Cached=1]="Cached",n[n.Outdated=2]="Outdated",n[n.RefreshingFromUnknown=3]="RefreshingFromUnknown",n[n.RefreshingFromCached=4]="RefreshingFromCached",n[n.Live=5]="Live"})(aVe||(aVe={}));var yI;(function(n){n[n.Stdio=1]="Stdio",n[n.HTTP=2]="HTTP"})(yI||(yI={}));var UW;(function(n){function e(s){return s}n.toSerialized=e;function t(s){switch(s.type){case yI.HTTP:return{type:s.type,uri:N.revive(s.uri),headers:s.headers};case yI.Stdio:return{type:s.type,cwd:s.cwd,command:s.command,args:s.args,env:s.env,envFile:s.envFile}}}n.fromSerialized=t;async function i(s){const r=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(JSON.stringify(s)));return fLe(Ye.wrap(new Uint8Array(r)))}n.hash=i})(UW||(UW={}));var Gg;(function(n){let e;(function(t){t[t.Stopped=0]="Stopped",t[t.Starting=1]="Starting",t[t.Running=2]="Running",t[t.Error=3]="Error"})(e=n.Kind||(n.Kind={})),n.toString=t=>{switch(t.state){case e.Stopped:return f(8370,"Stopped");case e.Starting:return f(8371,"Starting");case e.Running:return f(8372,"Running");case e.Error:return f(8373,"Error {0}",t.message);default:bA()}},n.toKindString=t=>{switch(t){case e.Stopped:return"stopped";case e.Starting:return"starting";case e.Running:return"running";case e.Error:return"error";default:bA()}},n.canBeStarted=t=>t===e.Error||t===e.Stopped,n.isRunning=t=>!n.canBeStarted(t.state)})(Gg||(Gg={}));var lVe;(function(n){n[n.Installing=0]="Installing",n[n.Installed=1]="Installed",n[n.Uninstalling=2]="Uninstalling",n[n.Uninstalled=3]="Uninstalled"})(lVe||(lVe={}));var cVe;(function(n){n.Readme="readme",n.Manifest="manifest",n.Configuration="configuration"})(cVe||(cVe={}));let dVe=class extends V{constructor(e,t){super(),this.containers=e,this._register(t.onChange(this.update,this))}set mcpServer(e){this.containers.forEach(t=>t.mcpServer=e)}update(e){for(const t of this.containers)e&&t.mcpServer?e.id===t.mcpServer.id&&(t.mcpServer=e):t.update()}};dVe=y([v(1,fJe)],dVe);new j("mcpServersGalleryEnabled",!1);new j("hasInstalledMcpServers",!0);var hVe;(function(n){n.scheme="mcp-resource";const e="dylo78gyp";function t(s,r){return typeof r=="string"&&(r=N.parse(r)),r.with({scheme:n.scheme,authority:fLe(Ye.fromString(s.id)),path:["",r.scheme,r.authority||e].join("/")+r.path})}n.fromServer=t;function i(s){if(typeof s=="string"&&(s=N.parse(s)),s.scheme!==n.scheme)throw new Error(`Invalid MCP resource URI: ${s.toString()}`);const r=s.path.split("/");if(r.length<3)throw new Error(`Invalid MCP resource URI: ${s.toString()}`);const[,o,a,...l]=r,c=new URL(`${o}://${a.toLowerCase()===e?"":a}`);return c.pathname=l.length?"/"+l.join("/"):"",c.search=s.query,c.hash=s.fragment,{definitionId:Klt(s.authority).toString(),resourceURL:c}}n.toServer=i})(hVe||(hVe={}));var uVe;(function(n){n[n.Logging=1]="Logging",n[n.Completions=2]="Completions",n[n.Prompts=4]="Prompts",n[n.PromptsListChanged=8]="PromptsListChanged",n[n.Resources=16]="Resources",n[n.ResourcesSubscribe=32]="ResourcesSubscribe",n[n.ResourcesListChanged=64]="ResourcesListChanged",n[n.Tools=128]="Tools",n[n.ToolsListChanged=256]="ToolsListChanged"})(uVe||(uVe={}));var fVe;(function(n){n.Prefix="mcp_",n[n.MaxPrefixLen=18]="MaxPrefixLen",n[n.MaxLength=64]="MaxLength"})(fVe||(fVe={}));var cw;(function(n){function e(i){const{selectionStartLineNumber:s,selectionStartColumn:r,positionLineNumber:o,positionColumn:a}=i,l=new Ts(s-1,r-1),c=new Ts(o-1,a-1);return new Bv(l,c)}n.to=e;function t(i){const{anchor:s,active:r}=i;return{selectionStartLineNumber:s.line+1,selectionStartColumn:s.character+1,positionLineNumber:r.line+1,positionColumn:r.character+1}}n.from=t})(cw||(cw={}));var ft;(function(n){function e(i){if(!i)return;const{start:s,end:r}=i;return{startLineNumber:s.line+1,startColumn:s.character+1,endLineNumber:r.line+1,endColumn:r.character+1}}n.from=e;function t(i){if(!i)return;const{startLineNumber:s,startColumn:r,endLineNumber:o,endColumn:a}=i;return new Zn(s-1,r-1,o-1,a-1)}n.to=t})(ft||(ft={}));var ay;(function(n){function e(i){return{uri:i.uri,range:ft.from(i.range)}}n.from=e;function t(i){return new cp(N.revive(i.uri),ft.to(i.range))}n.to=t})(ay||(ay={}));var cwe;(function(n){function e(t){switch(t){case ao.Comment:return mC.Comment;case ao.Other:return mC.Other;case ao.RegEx:return mC.RegEx;case ao.String:return mC.String}}n.to=e})(cwe||(cwe={}));var Fr;(function(n){function e(i){return new Ts(i.lineNumber-1,i.column-1)}n.to=e;function t(i){return{lineNumber:i.line+1,column:i.character+1}}n.from=t})(Fr||(Fr={}));var $W;(function(n){function e(s,r,o){return vn(hu(s).map(a=>t(a,r,o)))}n.from=e;function t(s,r,o){if(typeof s=="string")return{$serialized:!0,language:s,isBuiltin:o?.isBuiltin};if(s)return{$serialized:!0,language:s.language,scheme:i(s.scheme,r),pattern:Kg.from(s.pattern)??void 0,exclusive:s.exclusive,notebookType:s.notebookType,isBuiltin:o?.isBuiltin}}function i(s,r){return r&&typeof s=="string"?r.transformOutgoingScheme(s):s}})($W||($W={}));var uZ;(function(n){function e(i){switch(i){case uD.Unnecessary:return i_.Unnecessary;case uD.Deprecated:return i_.Deprecated}}n.from=e;function t(i){switch(i){case i_.Unnecessary:return uD.Unnecessary;case i_.Deprecated:return uD.Deprecated;default:return}}n.to=t})(uZ||(uZ={}));var zW;(function(n){function e(i){let s;return i.code&&(qt(i.code)||Dl(i.code)?s=String(i.code):s={value:String(i.code.value),target:i.code.target}),{...ft.from(i.range),message:i.message,source:i.source,code:s,severity:h8.from(i.severity),relatedInformation:i.relatedInformation&&i.relatedInformation.map(fZ.from),tags:Array.isArray(i.tags)?vn(i.tags.map(uZ.from)):void 0}}n.from=e;function t(i){const s=new e$(ft.to(i),i.message,h8.to(i.severity));return s.source=i.source,s.code=qt(i.code)?i.code:i.code?.value,s.relatedInformation=i.relatedInformation&&i.relatedInformation.map(fZ.to),s.tags=i.tags&&vn(i.tags.map(uZ.to)),s}n.to=t})(zW||(zW={}));var fZ;(function(n){function e(i){return{...ft.from(i.location.range),message:i.message,resource:i.location.uri}}n.from=e;function t(i){return new R2(new cp(i.resource,ft.to(i)),i.message)}n.to=t})(fZ||(fZ={}));var h8;(function(n){function e(i){switch(i){case Fd.Error:return Vs.Error;case Fd.Warning:return Vs.Warning;case Fd.Information:return Vs.Info;case Fd.Hint:return Vs.Hint}return Vs.Error}n.from=e;function t(i){switch(i){case Vs.Info:return Fd.Information;case Vs.Warning:return Fd.Warning;case Vs.Error:return Fd.Error;case Vs.Hint:return Fd.Hint;default:return Fd.Error}}n.to=t})(h8||(h8={}));var pc;(function(n){function e(i){return typeof i=="number"&&i>=H2.One?i-1:i===H2.Beside?wI:rk}n.from=e;function t(i){if(typeof i=="number"&&i>=0)return i+1;throw new Error("invalid 'EditorGroupColumn'")}n.to=t})(pc||(pc={}));function oFt(n){return typeof n.range<"u"}function ytt(n){return n.length===0?!0:!!oFt(n[0])}var Cn;(function(n){function e(a){return a.map(n.from)}n.fromMany=e;function t(a){return a&&typeof a=="object"&&typeof a.language=="string"&&typeof a.value=="string"}function i(a){let l;if(t(a)){const{language:h,value:u}=a;l={value:"```"+h+`
|
|
876
|
-
`+u+"\n```\n"}}else dg.isMarkdownString(a)?l={value:a.value,isTrusted:a.isTrusted,supportThemeIcons:a.supportThemeIcons,supportHtml:a.supportHtml,baseUri:a.baseUri}:typeof a=="string"?l={value:a}:l={value:""};const c=Object.create(null);l.uris=c;const d=({href:h})=>{try{let u=N.parse(h,!0);u=u.with({query:s(u.query,c)}),c[h]=u}catch{}return""};return $o.walkTokens($o.lexer(l.value),h=>{h.type==="link"?d({href:h.href}):h.type==="image"&&typeof h.href=="string"&&d(Eqe(h.href))}),l}n.from=i;function s(a,l){if(!a)return a;let c;try{c=pW(a)}catch{}if(!c)return a;let d=!1;return c=rI(c,h=>{if(N.isUri(h)){const u=`__uri_${Math.random().toString(16).slice(2,8)}`;return l[u]=h,d=!0,u}else return}),d?JSON.stringify(c):a}function r(a){const l=new dg(a.value,a.supportThemeIcons);return l.isTrusted=a.isTrusted,l.supportHtml=a.supportHtml,l.baseUri=a.baseUri?N.from(a.baseUri):void 0,l}n.to=r;function o(a){if(a)return typeof a=="string"?a:n.from(a)}n.fromStrict=o})(Cn||(Cn={}));function aFt(n){return ytt(n)?n.map(e=>({range:ft.from(e.range),hoverMessage:Array.isArray(e.hoverMessage)?Cn.fromMany(e.hoverMessage):e.hoverMessage?Cn.from(e.hoverMessage):void 0,renderOptions:e.renderOptions})):n.map(e=>({range:ft.from(e)}))}function Tle(n){return typeof n>"u"?n:typeof n=="string"?N.file(n):n}var qW;(function(n){function e(t){return typeof t>"u"?t:{contentText:t.contentText,contentIconPath:t.contentIconPath?Tle(t.contentIconPath):void 0,border:t.border,borderColor:t.borderColor,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textDecoration:t.textDecoration,color:t.color,backgroundColor:t.backgroundColor,margin:t.margin,width:t.width,height:t.height}}n.from=e})(qW||(qW={}));var gZ;(function(n){function e(t){return typeof t>"u"?t:{backgroundColor:t.backgroundColor,outline:t.outline,outlineColor:t.outlineColor,outlineStyle:t.outlineStyle,outlineWidth:t.outlineWidth,border:t.border,borderColor:t.borderColor,borderRadius:t.borderRadius,borderSpacing:t.borderSpacing,borderStyle:t.borderStyle,borderWidth:t.borderWidth,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textDecoration:t.textDecoration,cursor:t.cursor,color:t.color,opacity:t.opacity,letterSpacing:t.letterSpacing,gutterIconPath:t.gutterIconPath?Tle(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?qW.from(t.before):void 0,after:t.after?qW.from(t.after):void 0}}n.from=e})(gZ||(gZ={}));var dwe;(function(n){function e(t){if(typeof t>"u")return t;switch(t){case gD.OpenOpen:return yi.AlwaysGrowsWhenTypingAtEdges;case gD.ClosedClosed:return yi.NeverGrowsWhenTypingAtEdges;case gD.OpenClosed:return yi.GrowsOnlyWhenTypingBefore;case gD.ClosedOpen:return yi.GrowsOnlyWhenTypingAfter}}n.from=e})(dwe||(dwe={}));var hwe;(function(n){function e(t){return{isWholeLine:t.isWholeLine,rangeBehavior:t.rangeBehavior?dwe.from(t.rangeBehavior):void 0,overviewRulerLane:t.overviewRulerLane,light:t.light?gZ.from(t.light):void 0,dark:t.dark?gZ.from(t.dark):void 0,backgroundColor:t.backgroundColor,outline:t.outline,outlineColor:t.outlineColor,outlineStyle:t.outlineStyle,outlineWidth:t.outlineWidth,border:t.border,borderColor:t.borderColor,borderRadius:t.borderRadius,borderSpacing:t.borderSpacing,borderStyle:t.borderStyle,borderWidth:t.borderWidth,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textDecoration:t.textDecoration,cursor:t.cursor,color:t.color,opacity:t.opacity,letterSpacing:t.letterSpacing,gutterIconPath:t.gutterIconPath?Tle(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?qW.from(t.before):void 0,after:t.after?qW.from(t.after):void 0}}n.from=e})(hwe||(hwe={}));var Vc;(function(n){function e(i){return{text:i.newText,eol:i.newEol&&jW.from(i.newEol),range:ft.from(i.range)}}n.from=e;function t(i){const s=new EE(ft.to(i.range),i.text);return s.newEol=typeof i.eol>"u"?void 0:jW.to(i.eol),s}n.to=t})(Vc||(Vc={}));var pp;(function(n){function e(i,s){const r={edits:[]};if(i instanceof tI){const o=new b2;for(const a of i._allEntries())a._type===wl.File&&N.isUri(a.to)&&a.from===void 0&&o.add(a.to);for(const a of i._allEntries())if(a._type===wl.File){let l;a.options?.contents&&(ArrayBuffer.isView(a.options.contents)?l={type:"base64",value:PP(Ye.wrap(a.options.contents))}:l={type:"dataTransferItem",id:a.options.contents._itemId}),r.edits.push({oldResource:a.from,newResource:a.to,options:{...a.options,contents:l},metadata:a.metadata})}else a._type===wl.Text?r.edits.push({resource:a.uri,textEdit:Vc.from(a.edit),versionId:o.has(a.uri)?void 0:s?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===wl.Snippet?r.edits.push({resource:a.uri,textEdit:{range:ft.from(a.range),text:a.edit.value,insertAsSnippet:!0,keepWhitespace:a.keepWhitespace},versionId:o.has(a.uri)?void 0:s?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===wl.Cell?r.edits.push({metadata:a.metadata,resource:a.uri,cellEdit:a.edit,notebookVersionId:s?.getNotebookDocumentVersion(a.uri)}):a._type===wl.CellReplace&&r.edits.push({metadata:a.metadata,resource:a.uri,notebookVersionId:s?.getNotebookDocumentVersion(a.uri),cellEdit:{editType:Wv.Replace,index:a.index,count:a.count,cells:a.cells.map(XW.from)}})}return r}n.from=e;function t(i){const s=new tI,r=new Ni;for(const o of i.edits)if(o.textEdit){const a=o,l=N.revive(a.resource),c=ft.to(a.textEdit.range),d=a.textEdit.text,h=a.textEdit.insertAsSnippet;let u;h?u=foe.replace(c,new iI(d)):u=EE.replace(c,d);const g=r.get(l);g?g.push(u):r.set(l,[u])}else s.renameFile(N.revive(o.oldResource),N.revive(o.newResource),o.options);for(const[o,a]of r)s.set(o,a);return s}n.to=t})(pp||(pp={}));var A_;(function(n){const e=Object.create(null);e[Lo.File]=lt.File,e[Lo.Module]=lt.Module,e[Lo.Namespace]=lt.Namespace,e[Lo.Package]=lt.Package,e[Lo.Class]=lt.Class,e[Lo.Method]=lt.Method,e[Lo.Property]=lt.Property,e[Lo.Field]=lt.Field,e[Lo.Constructor]=lt.Constructor,e[Lo.Enum]=lt.Enum,e[Lo.Interface]=lt.Interface,e[Lo.Function]=lt.Function,e[Lo.Variable]=lt.Variable,e[Lo.Constant]=lt.Constant,e[Lo.String]=lt.String,e[Lo.Number]=lt.Number,e[Lo.Boolean]=lt.Boolean,e[Lo.Array]=lt.Array,e[Lo.Object]=lt.Object,e[Lo.Key]=lt.Key,e[Lo.Null]=lt.Null,e[Lo.EnumMember]=lt.EnumMember,e[Lo.Struct]=lt.Struct,e[Lo.Event]=lt.Event,e[Lo.Operator]=lt.Operator,e[Lo.TypeParameter]=lt.TypeParameter;function t(s){return typeof e[s]=="number"?e[s]:lt.Property}n.from=t;function i(s){for(const r in e)if(e[r]===s)return Number(r);return Lo.Property}n.to=i})(A_||(A_={}));var FE;(function(n){function e(i){if(i===P2.Deprecated)return h7.Deprecated}n.from=e;function t(i){if(i===h7.Deprecated)return P2.Deprecated}n.to=t})(FE||(FE={}));var aP;(function(n){function e(i){return{name:i.name,kind:A_.from(i.kind),tags:i.tags&&i.tags.map(FE.from),containerName:i.containerName,location:fg.from(i.location)}}n.from=e;function t(i){const s=new N2(i.name,A_.to(i.kind),i.containerName,fg.to(i.location));return s.tags=i.tags&&i.tags.map(FE.to),s}n.to=t})(aP||(aP={}));var uwe;(function(n){function e(i){const s={name:i.name||"!!MISSING: name!!",detail:i.detail,range:ft.from(i.range),selectionRange:ft.from(i.selectionRange),kind:A_.from(i.kind),tags:i.tags?.map(FE.from)??[]};return i.children&&(s.children=i.children.map(e)),s}n.from=e;function t(i){const s=new M2(i.name,i.detail,A_.to(i.kind),ft.to(i.range),ft.to(i.selectionRange));return Ir(i.tags)&&(s.tags=i.tags.map(FE.to)),i.children&&(s.children=i.children.map(t)),s}n.to=t})(uwe||(uwe={}));var lP;(function(n){function e(i){const s=new goe(A_.to(i.kind),i.name,i.detail||"",N.revive(i.uri),ft.to(i.range),ft.to(i.selectionRange));return s._sessionId=i._sessionId,s._itemId=i._itemId,s}n.to=e;function t(i,s,r){if(s=s??i._sessionId,r=r??i._itemId,s===void 0||r===void 0)throw new Error("invalid item");return{_sessionId:s,_itemId:r,name:i.name,detail:i.detail,kind:A_.from(i.kind),uri:i.uri,range:ft.from(i.range),selectionRange:ft.from(i.selectionRange),tags:i.tags?.map(FE.from)}}n.from=t})(lP||(lP={}));var fwe;(function(n){function e(t){return new ALe(lP.to(t.from),t.fromRanges.map(i=>ft.to(i)))}n.to=e})(fwe||(fwe={}));var gwe;(function(n){function e(t){return new PLe(lP.to(t.to),t.fromRanges.map(i=>ft.to(i)))}n.to=e})(gwe||(gwe={}));var fg;(function(n){function e(i){return{range:i.range&&ft.from(i.range),uri:i.uri}}n.from=e;function t(i){return new cp(N.revive(i.uri),ft.to(i.range))}n.to=t})(fg||(fg={}));var u8;(function(n){function e(i){const s=i,r=i;return{originSelectionRange:s.originSelectionRange?ft.from(s.originSelectionRange):void 0,uri:s.targetUri?s.targetUri:r.uri,range:ft.from(s.targetRange?s.targetRange:r.range),targetSelectionRange:s.targetSelectionRange?ft.from(s.targetSelectionRange):void 0}}n.from=e;function t(i){return{targetUri:N.revive(i.uri),targetRange:ft.to(i.range),targetSelectionRange:i.targetSelectionRange?ft.to(i.targetSelectionRange):void 0,originSelectionRange:i.originSelectionRange?ft.to(i.originSelectionRange):void 0}}n.to=t})(u8||(u8={}));var f8;(function(n){function e(i){return{range:ft.from(i.range),contents:Cn.fromMany(i.contents),canIncreaseVerbosity:i.canIncreaseVerbosity,canDecreaseVerbosity:i.canDecreaseVerbosity}}n.from=e;function t(i){const s=i.contents.map(Cn.to),r=ft.to(i.range),o=i.canIncreaseVerbosity,a=i.canDecreaseVerbosity;return new i$(s,r,o,a)}n.to=t})(f8||(f8={}));var pwe;(function(n){function e(i){return{range:ft.from(i.range),expression:i.expression}}n.from=e;function t(i){return new v$(ft.to(i.range),i.expression)}n.to=t})(pwe||(pwe={}));var pZ;(function(n){function e(i){if(i instanceof w$)return{type:"text",range:ft.from(i.range),text:i.text};if(i instanceof b$)return{type:"variable",range:ft.from(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};if(i instanceof y$)return{type:"expression",range:ft.from(i.range),expression:i.expression};throw new Error("Unknown 'InlineValue' type")}n.from=e;function t(i){switch(i.type){case"text":return{range:ft.to(i.range),text:i.text};case"variable":return{range:ft.to(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};case"expression":return{range:ft.to(i.range),expression:i.expression}}}n.to=t})(pZ||(pZ={}));var mZ;(function(n){function e(i){return{frameId:i.frameId,stoppedLocation:ft.from(i.stoppedLocation)}}n.from=e;function t(i){return new wfe(i.frameId,ft.to(i.stoppedLocation))}n.to=t})(mZ||(mZ={}));var GW;(function(n){function e(i){return{range:ft.from(i.range),kind:i.kind}}n.from=e;function t(i){return new n$(ft.to(i.range),i.kind)}n.to=t})(GW||(GW={}));var mwe;(function(n){function e(i){return{uri:i.uri,highlights:i.highlights.map(GW.from)}}n.from=e;function t(i){return new s$(N.revive(i.uri),i.highlights.map(GW.to))}n.to=t})(mwe||(mwe={}));var _we;(function(n){function e(t){switch(t){case Xu.TriggerCharacter:return L1.TriggerCharacter;case Xu.TriggerForIncompleteCompletions:return L1.TriggerForIncompleteCompletions;case Xu.Invoke:default:return L1.Invoke}}n.to=e})(_we||(_we={}));var vwe;(function(n){function e(t){return{triggerKind:_we.to(t.triggerKind),triggerCharacter:t.triggerCharacter}}n.to=e})(vwe||(vwe={}));var _Z;(function(n){function e(i){if(i===B2.Deprecated)return _W.Deprecated}n.from=e;function t(i){if(i===_W.Deprecated)return B2.Deprecated}n.to=t})(_Z||(_Z={}));var wwe;(function(n){function e(t,i,s){return"icon"in t&&"command"in t?{command:i.toInternal(t.command,s),icon:qZ.fromThemeIcon(t.icon)}:{command:i.toInternal(t,s)}}n.from=e})(wwe||(wwe={}));var vZ;(function(n){const e=new Map([[cn.Method,Pe.Method],[cn.Function,Pe.Function],[cn.Constructor,Pe.Constructor],[cn.Field,Pe.Field],[cn.Variable,Pe.Variable],[cn.Class,Pe.Class],[cn.Interface,Pe.Interface],[cn.Struct,Pe.Struct],[cn.Module,Pe.Module],[cn.Property,Pe.Property],[cn.Unit,Pe.Unit],[cn.Value,Pe.Value],[cn.Constant,Pe.Constant],[cn.Enum,Pe.Enum],[cn.EnumMember,Pe.EnumMember],[cn.Keyword,Pe.Keyword],[cn.Snippet,Pe.Snippet],[cn.Text,Pe.Text],[cn.Color,Pe.Color],[cn.File,Pe.File],[cn.Reference,Pe.Reference],[cn.Folder,Pe.Folder],[cn.Event,Pe.Event],[cn.Operator,Pe.Operator],[cn.TypeParameter,Pe.TypeParameter],[cn.Issue,Pe.Issue],[cn.User,Pe.User]]);function t(r){return e.get(r)??Pe.Property}n.from=t;const i=new Map([[Pe.Method,cn.Method],[Pe.Function,cn.Function],[Pe.Constructor,cn.Constructor],[Pe.Field,cn.Field],[Pe.Variable,cn.Variable],[Pe.Class,cn.Class],[Pe.Interface,cn.Interface],[Pe.Struct,cn.Struct],[Pe.Module,cn.Module],[Pe.Property,cn.Property],[Pe.Unit,cn.Unit],[Pe.Value,cn.Value],[Pe.Constant,cn.Constant],[Pe.Enum,cn.Enum],[Pe.EnumMember,cn.EnumMember],[Pe.Keyword,cn.Keyword],[Pe.Snippet,cn.Snippet],[Pe.Text,cn.Text],[Pe.Color,cn.Color],[Pe.File,cn.File],[Pe.Reference,cn.Reference],[Pe.Folder,cn.Folder],[Pe.Event,cn.Event],[Pe.Operator,cn.Operator],[Pe.TypeParameter,cn.TypeParameter],[Pe.User,cn.User],[Pe.Issue,cn.Issue]]);function s(r){return i.get(r)??cn.Property}n.to=s})(vZ||(vZ={}));var bwe;(function(n){function e(t,i){const s=new l$(t.label);return s.insertText=t.insertText,s.kind=vZ.to(t.kind),s.tags=t.tags?.map(_Z.to),s.detail=t.detail,s.documentation=md(t.documentation)?Cn.to(t.documentation):t.documentation,s.sortText=t.sortText,s.filterText=t.filterText,s.preselect=t.preselect,s.commitCharacters=t.commitCharacters,M.isIRange(t.range)?s.range=ft.to(t.range):typeof t.range=="object"&&(s.range={inserting:ft.to(t.range.insert),replacing:ft.to(t.range.replace)}),s.keepWhitespace=typeof t.insertTextRules>"u"?!1:!!(t.insertTextRules&Jf.KeepWhitespace),typeof t.insertTextRules<"u"&&t.insertTextRules&Jf.InsertAsSnippet?s.insertText=new iI(t.insertText):(s.insertText=t.insertText,s.textEdit=s.range instanceof Zn?new EE(s.range,s.insertText):void 0),t.additionalTextEdits&&t.additionalTextEdits.length>0&&(s.additionalTextEdits=t.additionalTextEdits.map(r=>Vc.to(r))),s.command=i&&t.command?i.fromInternal(t.command):void 0,s}n.to=e})(bwe||(bwe={}));var wZ;(function(n){function e(i){if(typeof i.label!="string"&&!Array.isArray(i.label))throw new TypeError("Invalid label");return{label:i.label,documentation:Cn.fromStrict(i.documentation)}}n.from=e;function t(i){return{label:i.label,documentation:md(i.documentation)?Cn.to(i.documentation):i.documentation}}n.to=t})(wZ||(wZ={}));var bZ;(function(n){function e(i){return{label:i.label,documentation:Cn.fromStrict(i.documentation),parameters:Array.isArray(i.parameters)?i.parameters.map(wZ.from):[],activeParameter:i.activeParameter}}n.from=e;function t(i){return{label:i.label,documentation:md(i.documentation)?Cn.to(i.documentation):i.documentation,parameters:Array.isArray(i.parameters)?i.parameters.map(wZ.to):[],activeParameter:i.activeParameter}}n.to=t})(bZ||(bZ={}));var g8;(function(n){function e(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map(bZ.from):[]}}n.from=e;function t(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map(bZ.to):[]}}n.to=t})(g8||(g8={}));var ywe;(function(n){function e(t,i){const s=new a$(Fr.to(i.position),typeof i.label=="string"?i.label:i.label.map(Swe.to.bind(void 0,t)),i.kind&&yZ.to(i.kind));return s.textEdits=i.textEdits&&i.textEdits.map(Vc.to),s.tooltip=md(i.tooltip)?Cn.to(i.tooltip):i.tooltip,s.paddingLeft=i.paddingLeft,s.paddingRight=i.paddingRight,s}n.to=e})(ywe||(ywe={}));var Swe;(function(n){function e(t,i){const s=new o$(i.label);return s.tooltip=md(i.tooltip)?Cn.to(i.tooltip):i.tooltip,bX.is(i.command)&&(s.command=t.fromInternal(i.command)),i.location&&(s.location=fg.to(i.location)),s}n.to=e})(Swe||(Swe={}));var yZ;(function(n){function e(i){return i}n.from=e;function t(i){return i}n.to=t})(yZ||(yZ={}));var u0;(function(n){function e(i){return{range:ft.from(i.range),url:i.target,tooltip:i.tooltip}}n.from=e;function t(i){let s;if(i.url)try{s=typeof i.url=="string"?N.parse(i.url,!0):N.revive(i.url)}catch{}const r=new d$(ft.to(i.range),s);return r.tooltip=i.tooltip,r}n.to=t})(u0||(u0={}));var SZ;(function(n){function e(i){const s=new u$(i.label);return i.textEdit&&(s.textEdit=Vc.to(i.textEdit)),i.additionalTextEdits&&(s.additionalTextEdits=i.additionalTextEdits.map(r=>Vc.to(r))),s}n.to=e;function t(i){return{label:i.label,textEdit:i.textEdit?Vc.from(i.textEdit):void 0,additionalTextEdits:i.additionalTextEdits?i.additionalTextEdits.map(s=>Vc.from(s)):void 0}}n.from=t})(SZ||(SZ={}));var KW;(function(n){function e(i){return new RA(i[0],i[1],i[2],i[3])}n.to=e;function t(i){return[i.red,i.green,i.blue,i.alpha]}n.from=t})(KW||(KW={}));var Cwe;(function(n){function e(i){return{range:ft.from(i.range)}}n.from=e;function t(i){return new W2(ft.to(i.range))}n.to=t})(Cwe||(Cwe={}));var CZ;(function(n){function e(t){switch(t){case $r.AUTO:return R1.AfterDelay;case $r.EXPLICIT:return R1.Manual;case $r.FOCUS_CHANGE:case $r.WINDOW_CHANGE:return R1.FocusOut}}n.to=e})(CZ||(CZ={}));var fF;(function(n){function e(i){switch(i){case Km.Off:return vr.Off;case Km.Relative:return vr.Relative;case Km.Interval:return vr.Interval;case Km.On:default:return vr.On}}n.from=e;function t(i){switch(i){case vr.Off:return Km.Off;case vr.Relative:return Km.Relative;case vr.Interval:return Km.Interval;case vr.On:default:return Km.On}}n.to=t})(fF||(fF={}));var jW;(function(n){function e(i){if(i===u_.CRLF)return Kd.CRLF;if(i===u_.LF)return Kd.LF}n.from=e;function t(i){if(i===Kd.CRLF)return u_.CRLF;if(i===Kd.LF)return u_.LF}n.to=t})(jW||(jW={}));var EZ;(function(n){function e(t){if(typeof t=="object")return t.viewId;switch(t){case eE.SourceControl:return cm.Scm;case eE.Window:return cm.Window;case eE.Notification:return cm.Notification}throw new Error("Unknown 'ProgressLocation'")}n.from=e})(EZ||(EZ={}));var xZ;(function(n){function e(i){const s={start:i.start+1,end:i.end+1};return i.kind&&(s.kind=DZ.from(i.kind)),s}n.from=e;function t(i){const s={start:i.start-1,end:i.end-1};return i.kind&&(s.kind=DZ.to(i.kind)),s}n.to=t})(xZ||(xZ={}));var DZ;(function(n){function e(i){if(i)switch(i){case pb.Comment:return Kp.Comment;case pb.Imports:return Kp.Imports;case pb.Region:return Kp.Region}}n.from=e;function t(i){if(i)switch(i.value){case Kp.Comment.value:return pb.Comment;case Kp.Imports.value:return pb.Imports;case Kp.Region.value:return pb.Region}}n.to=t})(DZ||(DZ={}));var T5;(function(n){function e(t){if(t)return{pinned:typeof t.preview=="boolean"?!t.preview:void 0,inactive:t.background,preserveFocus:t.preserveFocus,selection:typeof t.selection=="object"?ft.from(t.selection):void 0,override:typeof t.override=="boolean"?nk.id:void 0}}n.from=e})(T5||(T5={}));var Kg;(function(n){function e(r){return r instanceof N1?r.toJSON():typeof r=="string"?r:t(r)||i(r)?new N1(r.baseUri??r.base,r.pattern).toJSON():r}n.from=e;function t(r){const o=r;return o?N.isUri(o.baseUri)&&typeof o.pattern=="string":!1}function i(r){const o=r;return o?typeof o.base=="string"&&typeof o.pattern=="string":!1}function s(r){return typeof r=="string"?r:new N1(N.revive(r.baseUri),r.pattern)}n.to=s})(Kg||(Kg={}));var Ewe;(function(n){function e(t){if(t){if(Array.isArray(t))return t.map(e);if(typeof t=="string")return t;{const i=t;return{language:i.language,scheme:i.scheme,pattern:Kg.from(i.pattern)??void 0,exclusive:i.exclusive,notebookType:i.notebookType}}}else return}n.from=e})(Ewe||(Ewe={}));var ly;(function(n){function e(i){return{start:i.start,end:i.end}}n.from=e;function t(i){return new Tv(i.start,i.end)}n.to=t})(ly||(ly={}));var YW;(function(n){function e(i){return{timing:typeof i.runStartTime=="number"&&typeof i.runEndTime=="number"?{startTime:i.runStartTime,endTime:i.runEndTime}:void 0,executionOrder:i.executionOrder,success:i.lastRunSuccess}}n.to=e;function t(i){return{lastRunSuccess:i.success,runStartTime:i.timing?.startTime,runEndTime:i.timing?.endTime,executionOrder:i.executionOrder}}n.from=t})(YW||(YW={}));var p8;(function(n){function e(i){switch(i){case _D.Markup:return xM.Markup;case _D.Code:default:return xM.Code}}n.from=e;function t(i){switch(i){case xM.Markup:return _D.Markup;case xM.Code:default:return _D.Code}}n.to=t})(p8||(p8={}));var Mx;(function(n){function e(i){const s={metadata:i.metadata??Object.create(null),cells:[]};for(const r of i.cells)J9.validate(r),s.cells.push(XW.from(r));return s}n.from=e;function t(i){const s=new FLe(i.cells.map(XW.to));return qk(i.metadata)||(s.metadata=i.metadata),s}n.to=t})(Mx||(Mx={}));var XW;(function(n){function e(i){return{cellKind:p8.from(i.kind),language:i.languageId,mime:i.mime,source:i.value,metadata:i.metadata,internalMetadata:YW.from(i.executionSummary??{}),outputs:i.outputs?i.outputs.map(SI.from):[]}}n.from=e;function t(i){return new J9(p8.to(i.cellKind),i.source,i.language,i.mime,i.outputs?i.outputs.map(SI.to):void 0,i.metadata,i.internalMetadata?YW.to(i.internalMetadata):void 0)}n.to=t})(XW||(XW={}));var QW;(function(n){function e(i){return{mime:i.mime,valueBytes:Ye.wrap(i.data)}}n.from=e;function t(i){return new WLe(i.valueBytes.buffer,i.mime)}n.to=t})(QW||(QW={}));var SI;(function(n){function e(i){return{outputId:i.id,items:i.items.map(QW.from),metadata:i.metadata}}n.from=e;function t(i){const s=i.items.map(QW.to);return new E$(s,i.outputId,i.metadata)}n.to=t})(SI||(SI={}));var kZ;(function(n){function e(s){return i(s)?{include:Kg.from(s.include)??void 0,exclude:Kg.from(s.exclude)??void 0}:Kg.from(s)??void 0}n.from=e;function t(s){return i(s)?{include:Kg.to(s.include),exclude:Kg.to(s.exclude)}:Kg.to(s)}n.to=t;function i(s){const r=s;return r?!bo(r.include)&&!bo(r.exclude):!1}})(kZ||(kZ={}));var xwe;(function(n){function e(t,i,s){const r=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{alignment:t.alignment===x$.Left?jj.Left:jj.Right,command:i.toInternal(r,s),text:t.text,tooltip:t.tooltip,accessibilityInformation:t.accessibilityInformation,priority:t.priority}}n.from=e})(xwe||(xwe={}));var Dwe;(function(n){function e(t,i,s){const r=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{command:i.toInternal(r,s),label:t.label,description:t.description,detail:t.detail,documentation:t.documentation}}n.from=e})(Dwe||(Dwe={}));var kwe;(function(n){function e(t){return{transientOutputs:t?.transientOutputs??!1,transientCellMetadata:t?.transientCellMetadata??{},transientDocumentMetadata:t?.transientDocumentMetadata??{},cellContentMetadata:t?.cellContentMetadata??{}}}n.from=e})(kwe||(kwe={}));var IZ;(function(n){function e(i){return{uri:i.uri,provides:i.provides}}n.from=e;function t(i){return new BLe(N.revive(i.uri),i.provides)}n.to=t})(IZ||(IZ={}));var ZW;(function(n){function e(i){return{message:Cn.fromStrict(i.message)||"",type:S_.Error,expected:i.expectedOutput,actual:i.actualOutput,contextValue:i.contextValue,location:i.location&&{range:ft.from(i.location.range),uri:i.location.uri},stackTrace:i.stackTrace?.map(s=>({label:s.label,position:s.position&&Fr.from(s.position),uri:s.uri&&N.revive(s.uri).toJSON()}))}}n.from=e;function t(i){const s=new L$(typeof i.message=="string"?i.message:Cn.to(i.message));return s.actualOutput=i.actual,s.expectedOutput=i.expected,s.contextValue=i.contextValue,s.location=i.location?fg.to(i.location):void 0,s}n.to=t})(ZW||(ZW={}));var dw;(function(n){n.namespace=LK,n.denamespace=wtt})(dw||(dw={}));var Iwe;(function(n){function e(t){return{controllerId:t.controllerId,profileId:t.profileId,group:JW.from(t.kind)}}n.from=e})(Iwe||(Iwe={}));var JW;(function(n){const e={[W1.Coverage]:Bc.Coverage,[W1.Debug]:Bc.Debug,[W1.Run]:Bc.Run};function t(i){return e.hasOwnProperty(i)?e[i]:Bc.Run}n.from=t})(JW||(JW={}));var CI;(function(n){function e(i){const s=Ile(i).controllerId;return{extId:Rn.fromExtHostTestItem(i,s).toString(),label:i.label,uri:N.revive(i.uri),busy:i.busy,tags:i.tags.map(r=>dw.namespace(s,r.id)),range:M.lift(ft.from(i.range)),description:i.description||null,sortText:i.sortText||null,error:i.error&&Cn.fromStrict(i.error)||null}}n.from=e;function t(i){return{parent:void 0,error:void 0,id:Rn.fromString(i.extId).localId,label:i.label,uri:N.revive(i.uri),tags:(i.tags||[]).map(s=>{const{tagId:r}=dw.denamespace(s);return new tW(r)}),children:{add:()=>{},delete:()=>{},forEach:()=>{},*[Symbol.iterator](){},get:()=>{},replace:()=>{},size:0},range:ft.to(i.range||void 0),canResolveChildren:!1,busy:i.busy,description:i.description||void 0,sortText:i.sortText||void 0}}n.toPlain=t})(CI||(CI={}));(function(n){function e(i){return{id:i.id}}n.from=e;function t(i){return new tW(i.id)}n.to=t})(dw||(dw={}));var Twe;(function(n){const e=(i,s)=>{const r=i.value;if(!r)return;const o={...CI.toPlain(r.item),parent:s,taskStates:r.tasks.map(a=>({state:a.state,duration:a.duration,messages:a.messages.filter(l=>l.type===S_.Error).map(ZW.to)})),children:[]};if(i.children)for(const a of i.children.values()){const l=e(a,o);l&&o.children.push(l)}return o};function t(i){const s=new tZ;for(const a of i.items)s.insert(Rn.fromString(a.item.extId).path,a);const r=[s.nodes],o=[];for(;r.length;)for(const a of r.pop())a.value?o.push(a):a.children&&r.push(a.children.values());return{completedAt:i.completedAt,results:o.map(a=>e(a)).filter(yo)}}n.to=t})(Twe||(Twe={}));var m8;(function(n){function e(a){return{covered:a.covered,total:a.total}}function t(a){return"line"in a?Fr.from(a):ft.from(a)}function i(a){if(a)return"endLineNumber"in a?ft.to(a):Fr.to(a)}function s(a){if(a.type===h0.Statement){const l=[];if(a.branches)for(const c of a.branches)l.push({executed:c.count,location:i(c.location),label:c.label});return new HLe(a.count,i(a.location),a.branches?.map(c=>new VLe(c.count,i(c.location),c.label)))}else return new ULe(a.name,a.count,i(a.location))}n.to=s;function r(a){if(typeof a.executed=="number"&&a.executed<0)throw new Error(`Invalid coverage count ${a.executed}`);return"branches"in a?{count:a.executed,location:t(a.location),type:h0.Statement,branches:a.branches.length?a.branches.map(l=>({count:l.executed,location:l.location&&t(l.location),label:l.label})):void 0}:{type:h0.Declaration,name:a.name,count:a.executed,location:t(a.location)}}n.fromDetails=r;function o(a,l,c){return XG(c.statementCoverage),XG(c.branchCoverage),XG(c.declarationCoverage),{id:l,uri:c.uri,statement:e(c.statementCoverage),branch:c.branchCoverage&&e(c.branchCoverage),declaration:c.declarationCoverage&&e(c.declarationCoverage),testIds:c instanceof R$&&c.includesTests.length?c.includesTests.map(d=>Rn.fromExtHostTestItem(d,a).toString()):void 0}}n.fromFile=o})(m8||(m8={}));var Lwe;(function(n){function e(t){switch(t){case zd.Invoke:return O2.Invoke;case zd.Auto:return O2.Automatic}}n.to=e})(Lwe||(Lwe={}));var f0;(function(n){function e(i){const s=new moe(A_.to(i.kind),i.name,i.detail||"",N.revive(i.uri),ft.to(i.range),ft.to(i.selectionRange));return s._sessionId=i._sessionId,s._itemId=i._itemId,s}n.to=e;function t(i,s,r){if(s=s??i._sessionId,r=r??i._itemId,s===void 0||r===void 0)throw new Error("invalid item");return{_sessionId:s,_itemId:r,kind:A_.from(i.kind),name:i.name,detail:i.detail??"",uri:i.uri,range:ft.from(i.range),selectionRange:ft.from(i.selectionRange),tags:i.tags?.map(FE.from)}}n.from=t})(f0||(f0={}));var TZ;(function(n){function e(t){if(t)return{value:t.value,tooltip:t.tooltip}}n.from=e})(TZ||(TZ={}));var g0;(function(n){function e(r,o,a){const l=o.fileData;return l?new cut(new dut(l.name,N.revive(l.uri),l.id,C_(()=>a(l.id)))):r===zs.uriList&&o.uriListData?new hY(s(o.uriListData)):new hY(o.asString)}n.to=e;async function t(r,o,a=Tr()){const l=await o.asString();if(r===zs.uriList)return{id:a,asString:l,fileData:void 0,uriListData:i(l)};const c=o.asFile();return{id:a,asString:l,fileData:c?{name:c.name,uri:c.uri,id:c._itemId??c.id}:void 0}}n.from=t;function i(r){return OE.split(r).map(o=>{if(o.startsWith("#"))return o;try{return N.parse(o)}catch{}return o})}function s(r){return OE.create(r.map(o=>typeof o=="string"?o:N.revive(o)))}})(g0||(g0={}));var Ty;(function(n){function e(s,r){const o=s.items.map(([a,l])=>[a,g0.to(a,l,r)]);return new PA(o)}n.toDataTransfer=e;async function t(s){return{items:await Promise.all(Array.from(s,async([o,a])=>[o,await g0.from(o,a)]))}}n.from=t;async function i(s){return{items:await Promise.all(Array.from(s,async([o,a])=>[o,await g0.from(o,a,a.id)]))}}n.fromList=i})(Ty||(Ty={}));var LZ;(function(n){function e(i,s){return{kind:"reply",agentId:i.participant??s?.agentId??"",subCommand:i.command??s?.command,message:i.prompt,title:i.label}}n.from=e;function t(i){return{prompt:i.message,label:i.title,participant:i.agentId,command:i.subCommand}}n.to=t})(LZ||(LZ={}));var eB;(function(n){function e(i){switch(i){case RS.System:return qf.System;case RS.User:return qf.User;case RS.Assistant:return qf.Assistant}}n.to=e;function t(i){switch(i){case qf.System:return RS.System;case qf.User:return RS.User;case qf.Assistant:return RS.Assistant}return RS.User}n.from=t})(eB||(eB={}));var gVe;(function(n){function e(i){const s=i.content.map(a=>{if(a.type==="text")return new Ma(a.value,a.audience);if(a.type==="tool_result"){const l=a.value.map(c=>c.type==="text"?new Ma(c.value,c.audience):new Jv(c.value));return new O$(a.toolCallId,l,a.isError)}else{if(a.type==="image_url")return;if(a.type==="tool_use")return new sI(a.toolCallId,a.name,a.parameters)}}).filter(a=>a!==void 0),r=eB.to(i.role);return new e1e(r,s,i.name)}n.to=e;function t(i){const s=eB.from(i.role),r=i.name;let o=i.content;typeof o=="string"&&(o=[new Ma(o)]);const a=o.map(l=>{if(l instanceof O$)return{type:"tool_result",toolCallId:l.callId,value:vn(l.content.map(c=>c instanceof Ma?{type:"text",value:c.value,audience:c.audience}:c instanceof Jv?{type:"prompt_tsx",value:c.value}:void 0)),isError:l.isError};if(l instanceof sI)return{type:"tool_use",toolCallId:l.callId,name:l.name,parameters:l.input};if(l instanceof Ma)return{type:"text",value:l.value};if(typeof l!="string")throw new Error("Unexpected chat message content type");return{type:"text",value:l}});return{role:s,name:r,content:a}}n.from=t})(gVe||(gVe={}));var RZ;(function(n){function e(i){const s=i.content.map(a=>{if(a.type==="text")return new Ma(a.value,a.audience);if(a.type==="tool_result"){const l=a.value.map(c=>c.type==="text"?new Ma(c.value,c.audience):c.type==="data"?new a_(c.value.data.buffer,c.value.mimeType):new Jv(c.value));return new AY(a.toolCallId,l,a.isError)}else return a.type==="image_url"?new a_(a.value.data.buffer,a.value.mimeType):a.type==="data"?new a_(a.data.buffer,a.mimeType):new sI(a.toolCallId,a.name,a.parameters)}),r=eB.to(i.role);return new t1e(r,s,i.name)}n.to=e;function t(i){const s=eB.from(i.role),r=i.name;let o=i.content;typeof o=="string"&&(o=[new Ma(o)]);const a=o.map(l=>{if(l instanceof AY||l instanceof O$)return{type:"tool_result",toolCallId:l.callId,value:vn(l.content.map(c=>c instanceof Ma?{type:"text",value:c.value,audience:c.audience}:c instanceof Jv?{type:"prompt_tsx",value:c.value}:c instanceof a_?{type:"data",value:{mimeType:c.mimeType,data:Ye.wrap(c.data)},audience:c.audience}:void 0)),isError:l.isError};if(l instanceof a_)return lFt(l)?{type:"image_url",value:{mimeType:l.mimeType,data:Ye.wrap(l.data)}}:{type:"data",mimeType:l.mimeType,data:Ye.wrap(l.data),audience:l.audience};if(l instanceof sI)return{type:"tool_use",toolCallId:l.callId,name:l.name,parameters:l.input};if(l instanceof Ma)return{type:"text",value:l.value};if(typeof l!="string")throw new Error("Unexpected chat message content type llm 2");return{type:"text",value:l}});return{role:s,name:r,content:a}}n.from=t})(RZ||(RZ={}));function lFt(n){switch(n.mimeType){case tC.PNG:case tC.JPEG:case tC.GIF:case tC.WEBP:case tC.BMP:return!0;default:return!1}}var _8;(function(n){function e(i){return{kind:"markdownContent",content:Cn.from(i.value)}}n.from=e;function t(i){return new e6(Cn.to(i.content))}n.to=t})(_8||(_8={}));var AZ;(function(n){function e(i){return{kind:"codeblockUri",uri:i.value,isEdit:i.isEdit}}n.from=e;function t(i){return new n6(N.revive(i.uri),i.isEdit)}n.to=t})(AZ||(AZ={}));var PZ;(function(n){function e(i){return{kind:"markdownVuln",content:Cn.from(i.value),vulnerabilities:i.vulnerabilities}}n.from=e;function t(i){return new nW(Cn.to(i.content),i.vulnerabilities)}n.to=t})(PZ||(PZ={}));var NZ;(function(n){function e(t){return{kind:"confirmation",title:t.title,message:Cn.from(t.message),data:t.data,buttons:t.buttons}}n.from=e})(NZ||(NZ={}));var v8;(function(n){function e(i){const{value:s,baseUri:r}=i;function o(a,l){return a.map(c=>{const d=N.joinPath(l,c.name);return{label:c.name,uri:d,children:c.children&&o(c.children,d)}})}return{kind:"treeData",treeData:{label:In(r),uri:r,children:o(s,r)}}}n.from=e;function t(i){const s=nr(i.treeData);function r(l){return l.map(c=>({name:c.label,children:c.children&&r(c.children)}))}const o=s.uri,a=s.children?r(s.children):[];return new t6(a,o)}n.to=t})(v8||(v8={}));var Rwe;(function(n){function e(i){return{kind:"multiDiffData",multiDiffData:{title:i.title,resources:i.value.map(s=>({originalUri:s.originalUri,modifiedUri:s.modifiedUri,goToFileUri:s.goToFileUri}))}}}n.from=e;function t(i){const s=i.multiDiffData.resources.map(r=>({originalUri:r.originalUri?N.revive(r.originalUri):void 0,modifiedUri:r.modifiedUri?N.revive(r.modifiedUri):void 0,goToFileUri:r.goToFileUri?N.revive(r.goToFileUri):void 0}));return new yoe(s,i.multiDiffData.title)}n.to=t})(Rwe||(Rwe={}));var tB;(function(n){function e(i){const s=o=>N.isUri(o),r=o=>"name"in o;return{kind:"inlineReference",name:i.title,inlineReference:s(i.value)?i.value:r(i.value)?aP.from(i.value):ay.from(i.value)}}n.from=e;function t(i){const s=nr(i);return new sW(N.isUri(s.inlineReference)?s.inlineReference:"location"in s.inlineReference?aP.to(s.inlineReference):ay.to(s.inlineReference),i.name)}n.to=t})(tB||(tB={}));var w8;(function(n){function e(i){return{kind:"progressMessage",content:Cn.from(i.value)}}n.from=e;function t(i){return new Soe(i.content.value)}n.to=t})(w8||(w8={}));var b8;(function(n){function e(i){return{kind:"warning",content:Cn.from(i.value)}}n.from=e;function t(i){return new rW(i.content.value)}n.to=t})(b8||(b8={}));var Awe;(function(n){function e(t){return{kind:"extensions",extensions:t.extensions}}n.from=e})(Awe||(Awe={}));var Pwe;(function(n){function e(t){return{kind:"pullRequest",author:t.author,title:t.title,description:t.description,uri:t.uri,linkTag:t.linkTag}}n.from=e})(Pwe||(Pwe={}));var Nwe;(function(n){function e(i){return{kind:"move",uri:i.uri,range:ft.from(i.range)}}n.from=e;function t(i){return new s6(N.revive(i.uri),ft.to(i.range))}n.to=t})(Nwe||(Nwe={}));var y8;(function(n){function e(i){return{kind:"prepareToolInvocation",toolName:i.toolName}}n.from=e;function t(i){return new aW(i.toolName)}n.to=t})(y8||(y8={}));var Mwe;(function(n){function e(r){return{kind:"toolInvocationSerialized",toolCallId:r.toolCallId,toolId:r.toolName,invocationMessage:r.invocationMessage?Cn.from(r.invocationMessage):r.toolName,originMessage:r.originMessage?Cn.from(r.originMessage):void 0,pastTenseMessage:r.pastTenseMessage?Cn.from(r.pastTenseMessage):void 0,isConfirmed:r.isConfirmed,isComplete:r.isComplete??!0,isError:r.isError??!1,resultDetails:void 0,toolSpecificData:r.toolSpecificData?t(r.toolSpecificData):void 0,presentation:void 0}}n.from=e;function t(r){return"command"in r&&"language"in r?{kind:"terminal",command:r.command,language:r.language}:"commandLine"in r&&"language"in r?{kind:"terminal",commandLine:r.commandLine,language:r.language}:r}function i(r){const o=new xoe(r.toolId||r.toolName,r.toolCallId,r.isError);return r.invocationMessage&&(o.invocationMessage=r.invocationMessage),r.originMessage&&(o.originMessage=r.originMessage),r.pastTenseMessage&&(o.pastTenseMessage=r.pastTenseMessage),r.isConfirmed!==void 0&&(o.isConfirmed=r.isConfirmed),r.isComplete!==void 0&&(o.isComplete=r.isComplete),r.toolSpecificData&&(o.toolSpecificData=s(r.toolSpecificData)),o}n.to=i;function s(r){return r.kind==="terminal"?{command:r.command,language:r.language}:r.kind==="terminal2"?{commandLine:r.commandLine,language:r.language}:r}})(Mwe||(Mwe={}));var MZ;(function(n){function e(t){return{kind:"progressTask",content:Cn.from(t.value)}}n.from=e})(MZ||(MZ={}));var Owe;(function(n){function e(t){return{kind:"progressTaskResult",content:typeof t=="string"?Cn.from(t):void 0}}n.from=e})(Owe||(Owe={}));var S8;(function(n){function e(i,s,r){return{kind:"command",command:s.toInternal(i.value,r)??{command:i.value.command,title:i.value.title}}}n.from=e;function t(i,s){return new i6(s.fromInternal(i.command)??{command:i.command.id,title:i.command.title})}n.to=t})(S8||(S8={}));var OZ;(function(n){function e(i){return{kind:"textEdit",uri:i.uri,edits:i.edits.map(s=>Vc.from(s)),done:i.isDone}}n.from=e;function t(i){const s=new oW(N.revive(i.uri),i.edits.map(r=>Vc.to(r)));return s.isDone=i.done,s}n.to=t})(OZ||(OZ={}));var FZ;(function(n){function e(t){return t.newCellMetadata?{editType:Wv.Metadata,index:t.range.start,metadata:t.newCellMetadata}:t.newNotebookMetadata?{editType:Wv.DocumentMetadata,metadata:t.newNotebookMetadata}:{editType:Wv.Replace,index:t.range.start,count:t.range.end-t.range.start,cells:t.newCells.map(XW.from)}}n.from=e})(FZ||(FZ={}));var WZ;(function(n){function e(t){return{kind:"notebookEdit",uri:t.uri,edits:t.edits.map(FZ.from),done:t.isDone}}n.from=e})(WZ||(WZ={}));var p0;(function(n){function e(i){const s=ot.isThemeIcon(i.iconPath)?i.iconPath:N.isUri(i.iconPath)?{light:N.revive(i.iconPath)}:i.iconPath&&"light"in i.iconPath&&"dark"in i.iconPath&&N.isUri(i.iconPath.light)&&N.isUri(i.iconPath.dark)?{light:N.revive(i.iconPath.light),dark:N.revive(i.iconPath.dark)}:void 0;return typeof i.value=="object"&&"variableName"in i.value?{kind:"reference",reference:{variableName:i.value.variableName,value:N.isUri(i.value.value)||!i.value.value?i.value.value:ay.from(i.value.value)},iconPath:s,options:i.options}:{kind:"reference",reference:N.isUri(i.value)||typeof i.value=="string"?i.value:ay.from(i.value),iconPath:s,options:i.options}}n.from=e;function t(i){const s=nr(i),r=o=>N.isUri(o)?o:ay.to(o);return new tE(typeof s.reference=="string"?s.reference:"variableName"in s.reference?{variableName:s.reference.variableName,value:s.reference.value&&r(s.reference.value)}:r(s.reference))}n.to=t})(p0||(p0={}));var BZ;(function(n){function e(t){return{kind:"codeCitation",value:t.value,license:t.license,snippet:t.snippet}}n.from=e})(BZ||(BZ={}));var C8;(function(n){function e(s,r,o){return s instanceof e6?_8.from(s):s instanceof sW?tB.from(s):s instanceof tE?p0.from(s):s instanceof Soe?w8.from(s):s instanceof t6?v8.from(s):s instanceof yoe?Rwe.from(s):s instanceof i6?S8.from(s,r,o):s instanceof oW?OZ.from(s):s instanceof M$?WZ.from(s):s instanceof nW?PZ.from(s):s instanceof n6?AZ.from(s):s instanceof rW?b8.from(s):s instanceof P$?NZ.from(s):s instanceof N$?BZ.from(s):s instanceof s6?Nwe.from(s):s instanceof Coe?Awe.from(s):s instanceof aW?y8.from(s):s instanceof Eoe?Pwe.from(s):s instanceof xoe?Mwe.from(s):{kind:"markdownContent",content:Cn.from("")}}n.from=e;function t(s,r){switch(s.kind){case"reference":return p0.to(s);case"markdownContent":case"inlineReference":case"progressMessage":case"treeData":case"command":return i(s,r)}}n.to=t;function i(s,r){switch(s.kind){case"markdownContent":return _8.to(s);case"inlineReference":return tB.to(s);case"progressMessage":return;case"treeData":return v8.to(s);case"command":return S8.to(s,r)}}n.toContent=i})(C8||(C8={}));var E8;(function(n){function e(t,i,s,r,o,a,l){const c=[],d=[];for(const u of t.variables.variables)u.kind==="tool"?c.push(u):u.kind==="toolset"?c.push(...u.value):d.push(u);const h={id:t.requestId,prompt:t.message,command:t.command,attempt:t.attempt??0,enableCommandDetection:t.enableCommandDetection??!0,isParticipantDetected:t.isParticipantDetected??!1,references:d.map(u=>VZ.to(u,r,l)).filter(yo),toolReferences:c.map(x8.to),location:HZ.to(t.location),acceptedConfirmationData:t.acceptedConfirmationData,rejectedConfirmationData:t.rejectedConfirmationData,location2:i,toolInvocationToken:Object.freeze({sessionId:t.sessionId}),tools:o,model:s,editedFileEvents:t.editedFileEvents,modeInstructions:t.modeInstructions};return Mr(a,"chatParticipantPrivate")||(delete h.id,delete h.attempt,delete h.enableCommandDetection,delete h.isParticipantDetected,delete h.location,delete h.location2,delete h.editedFileEvents),Mr(a,"chatParticipantAdditions")||(delete h.acceptedConfirmationData,delete h.rejectedConfirmationData,delete h.tools),h}n.to=e})(E8||(E8={}));var Fwe;(function(n){function e(t){return{prompt:t.prompt,files:t.files.map(i=>N.revive(i))}}n.to=e})(Fwe||(Fwe={}));var HZ;(function(n){function e(i){switch(i){case dc.Notebook:return jm.Notebook;case dc.Terminal:return jm.Terminal;case dc.Panel:return jm.Panel;case dc.Editor:return jm.Editor}}n.to=e;function t(i){switch(i){case jm.Notebook:return dc.Notebook;case jm.Terminal:return dc.Terminal;case jm.Panel:return dc.Panel;case jm.Editor:return dc.Editor}}n.from=t})(HZ||(HZ={}));var VZ;(function(n){function e(t,i,s){let r=t.value;if(!r){let o;try{o=JSON.stringify(t)}catch{o=`kind=${t.kind}, id=${t.id}, name=${t.name}`}s.error(`[ChatPromptReference] Ignoring invalid reference in variable: ${o}`);return}if(Oj(r))r=N.revive(r);else if(r&&typeof r=="object"&&"uri"in r&&"range"in r&&Oj(r.uri))r=ay.to(nr(r));else if(wOt(t)){const o=t.references?.[0]?.reference;r=new ZLe(t.mimeType??"image/png",()=>Promise.resolve(new Uint8Array(Object.values(t.value))),o&&N.isUri(o)?o:void 0)}else if(t.kind==="diagnostic"){const o=t.filterSeverity&&h8.to(t.filterSeverity),a=t.filterUri&&N.revive(t.filterUri).toString();r=new JLe(i.map(([l,c])=>t.filterUri&&l.toString()!==a?[l,[]]:[l,c.filter(d=>!(o&&d.severity>o||t.filterRange&&!M.areIntersectingOrTouching(t.filterRange,ft.from(d.range))))]).filter(([,l])=>l.length>0))}return{id:t.id,name:t.name,range:t.range&&[t.range.start,t.range.endExclusive],value:r,modelDescription:t.modelDescription}}n.to=e})(VZ||(VZ={}));var x8;(function(n){function e(t){if(t.value)throw new Error("Invalid tool reference");return{name:t.id,range:t.range&&[t.range.start,t.range.endExclusive]}}n.to=e})(x8||(x8={}));var Wwe;(function(n){function e(t,i,s){return{id:t.id,label:t.label,fullName:t.fullName,icon:t.icon?.id,value:t.values[0].value,insertText:t.insertText,detail:t.detail,documentation:t.documentation,command:i.toInternal(t.command,s)}}n.from=e})(Wwe||(Wwe={}));var gF;(function(n){function e(s){return{errorDetails:s.errorDetails,metadata:i(s.metadata),nextQuestion:s.nextQuestion,details:s.details}}n.to=e;function t(s){return{errorDetails:s.errorDetails,metadata:s.metadata,nextQuestion:s.nextQuestion,details:s.details}}n.from=t;function i(s){return rI(s,r=>{if(r.$mid===Pn.LanguageModelToolResult)return new r6(rI(r.content,i));if(r.$mid===Pn.LanguageModelTextPart)return new Ma(r.value,r.audience);if(r.$mid===Pn.LanguageModelPromptTsxPart)return new Jv(r.value)})}})(gF||(gF={}));var Bwe;(function(n){function e(t,i,s){if(i.action.kind==="vote")return;const r=gF.to(t);if(i.action.kind==="command"){const o=i.action.commandButton.command;return{action:{kind:"command",commandButton:{command:s.fromInternal(o)??{command:o.id,title:o.title}}},result:r}}else return i.action.kind==="followUp"?{action:{kind:"followUp",followup:LZ.to(i.action.followup)},result:r}:i.action.kind==="inlineChat"?{action:{kind:"editor",accepted:i.action.action==="accepted"},result:r}:i.action.kind==="chatEditingSessionAction"?{action:{kind:"chatEditingSessionAction",outcome:new Map([["accepted",lv.Accepted],["rejected",lv.Rejected],["saved",lv.Saved]]).get(i.action.outcome)??lv.Rejected,uri:N.revive(i.action.uri),hasRemainingEdits:i.action.hasRemainingEdits},result:r}:i.action.kind==="chatEditingHunkAction"?{action:{kind:"chatEditingHunkAction",outcome:new Map([["accepted",lv.Accepted],["rejected",lv.Rejected]]).get(i.action.outcome)??lv.Rejected,uri:N.revive(i.action.uri),hasRemainingEdits:i.action.hasRemainingEdits,lineCount:i.action.lineCount},result:r}:{action:i.action,result:r}}n.to=e})(Bwe||(Bwe={}));var UZ;(function(n){function e(t,i,s){return"terminalCommand"in t?{terminalCommand:t.terminalCommand,shouldExecute:t.shouldExecute}:"uri"in t?{uri:t.uri}:i.toInternal(t,s)}n.from=e})(UZ||(UZ={}));var $Z;(function(n){function e(t){return{...t,documentation:Cn.fromStrict(t.documentation)}}n.from=e})($Z||($Z={}));var Hwe;(function(n){function e(t,i){return Array.isArray(t)?{items:t.map(s=>$Z.from(s))}:{items:t.items.map(s=>$Z.from(s)),resourceRequestConfig:t.resourceRequestConfig?Vwe.from(t.resourceRequestConfig,i):void 0}}n.from=e})(Hwe||(Hwe={}));var Vwe;(function(n){function e(t,i){return{...t,pathSeparator:i,cwd:t.cwd}}n.from=e})(Vwe||(Vwe={}));var Uwe;(function(n){function e(t){return{kind:$we.to(t.kind),acceptedLength:t.acceptedLength}}n.to=e})(Uwe||(Uwe={}));var $we;(function(n){function e(t){switch(t){case jD.Word:return fD.Word;case jD.Line:return fD.Line;case jD.Suggest:return fD.Suggest;default:return fD.Unknown}}n.to=e})($we||($we={}));var zwe;(function(n){function e(t,i){if(t.kind===by.Ignored){const s=t.supersededBy?i(t.supersededBy):void 0;return{kind:Zb.Ignored,supersededBy:s,userTypingDisagreed:t.userTypingDisagreed}}else if(t.kind===by.Accepted)return{kind:Zb.Accepted};return{kind:Zb.Rejected}}n.to=e})(zwe||(zwe={}));var qwe;(function(n){function e(t,i){return{id:i,label:t.label,description:t.description,canEdit:t.canEdit,collapsibleState:t.collapsibleState||Tfe.None,contextValue:t.contextValue}}n.from=e})(qwe||(qwe={}));var Gwe;(function(n){function e(t){return t.type==="mcp"?new s1e(t.label,t.serverLabel||t.label,t.instructions):t.type==="extension"?new n1e(t.extensionId.value,t.label):void 0}n.to=e})(Gwe||(Gwe={}));var pVe;(function(n){function e(i){return new r6(i.content.map(s=>s.kind==="text"?new Ma(s.value,s.audience):new Jv(s.value)))}n.to=e;function t(i,s){i.toolResultMessage&&Qe(s,"chatParticipantPrivate");const r=o=>{o.audience&&Qe(s,"languageModelToolResultAudience")};return{content:i.content.map(o=>{if(o instanceof Ma)return r(o),{kind:"text",value:o.value,audience:o.audience};if(o instanceof Jv)return{kind:"promptTsx",value:o.value};throw new Error("Unknown LanguageModelToolResult part type")}),toolResultMessage:Cn.fromStrict(i.toolResultMessage),toolResultDetails:i.toolResultDetails?.map(o=>N.isUri(o)?o:ay.from(o))}}n.from=t})(pVe||(pVe={}));var zZ;(function(n){function e(i){return new i1e(i.content.map(s=>s.kind==="text"?new Ma(s.value,s.audience):s.kind==="data"?new a_(s.value.data.buffer,s.value.mimeType,s.audience):new Jv(s.value)))}n.to=e;function t(i,s){i.toolResultMessage&&Qe(s,"chatParticipantPrivate");const r=c=>{c.audience&&Qe(s,"languageModelToolResultAudience")};let o=!1,a;Array.isArray(i.toolResultDetails)?a=i.toolResultDetails?.map(c=>N.isUri(c)?c:ay.from(c)):i.toolResultDetails2&&(a={output:{type:"data",mimeType:i.toolResultDetails2.mime,value:Ye.wrap(i.toolResultDetails2.value)}},o=!0);const l={content:i.content.map(c=>{if(c instanceof Ma)return r(c),{kind:"text",value:c.value,audience:c.audience};if(c instanceof Jv)return{kind:"promptTsx",value:c.value};if(c instanceof a_)return r(c),o=!0,{kind:"data",value:{mimeType:c.mimeType,data:Ye.wrap(c.data)},audience:c.audience};throw new Error("Unknown LanguageModelToolResult part type")}),toolResultMessage:Cn.fromStrict(i.toolResultMessage),toolResultDetails:a};return o?new ll(l):l}n.from=t})(zZ||(zZ={}));var qZ;(function(n){function e(t){return t}n.fromThemeIcon=e})(qZ||(qZ={}));var Kwe;(function(n){function e(i){return{query:i.query,kind:t(i.kind),settings:i.settings}}n.fromSettingsSearchResult=e;function t(i){switch(i){case Nx.EMBEDDED:return Nx.EMBEDDED;case Nx.LLM_RANKED:return Nx.LLM_RANKED;case Nx.CANCELED:return Nx.CANCELED;default:throw new Error("Unknown AiSettingsSearchResultKind")}}})(Kwe||(Kwe={}));var L5;(function(n){function e(i){return!!i.uri}function t(i){return UW.toSerialized(e(i)?{type:yI.HTTP,uri:i.uri,headers:Object.entries(i.headers)}:{type:yI.Stdio,cwd:i.cwd?.fsPath,args:i.args,command:i.command,env:i.env,envFile:void 0})}n.from=t})(L5||(L5={}));const Lle=de("IURITransformerService");class cFt{constructor(e){e?(this.transformIncoming=e.transformIncoming.bind(e),this.transformOutgoing=e.transformOutgoing.bind(e),this.transformOutgoingURI=e.transformOutgoingURI.bind(e),this.transformOutgoingScheme=e.transformOutgoingScheme.bind(e)):(this.transformIncoming=t=>t,this.transformOutgoing=t=>t,this.transformOutgoingURI=t=>t,this.transformOutgoingScheme=t=>t)}}const Swi="search.exclude",Stt=2e4,Ctt="⟪ ",Ett=" characters skipped ⟫",dFt=(Ctt.length+Ett.length+5)*2;var R5;(function(n){n[n.file=0]="file",n[n.text=1]="text",n[n.aiText=2]="aiText"})(R5||(R5={}));var uE;(function(n){n[n.File=1]="File",n[n.Text=2]="Text",n[n.aiText=3]="aiText"})(uE||(uE={}));function mVe(n){return!!n.rangeLocations&&!!n.previewText}var _Ve;(function(n){n[n.Normal=0]="Normal",n[n.NewSearchStarted=1]="NewSearchStarted"})(_Ve||(_Ve={}));class hFt{constructor(e,t,i,s){this.rangeLocations=[],this.webviewIndex=s;const r=Array.isArray(t)?t:[t];if(i&&i.matchLines===1&&uFt(r)){e=Ect(e,i.matchLines);let o="",a=0,l=0;const c=Math.floor(i.charsPerLine/5);for(const d of r){const h=Math.max(d.startColumn-c,0),u=d.startColumn+i.charsPerLine;if(h>l+c+dFt){const g=Ctt+(h-l)+Ett;o+=g+e.slice(h,u),a+=h-(l+g.length)}else o+=e.slice(l,u);l=u,this.rangeLocations.push({source:d,preview:new fFt(0,d.startColumn-a,d.endColumn-a)})}this.previewText=o}else{const o=Array.isArray(t)?t[0].startLineNumber:t.startLineNumber,a=Nue(t,l=>({preview:new xtt(l.startLineNumber-o,l.startColumn,l.endLineNumber-o,l.endColumn),source:l}));this.rangeLocations=Array.isArray(a)?a:[a],this.previewText=e}}}function uFt(n){const e=n[0].startLineNumber;for(const t of n)if(t.startLineNumber!==e||t.endLineNumber!==e)return!1;return!0}class xtt{constructor(e,t,i,s){this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=s}}class fFt extends xtt{constructor(e,t,i){super(e,t,e,i)}}var vVe;(function(n){n.List="list",n.Tree="tree"})(vVe||(vVe={}));var wVe;(function(n){n.Default="default",n.FileNames="fileNames",n.Type="type",n.Modified="modified",n.CountDescending="countDescending",n.CountAscending="countAscending"})(wVe||(wVe={}));var bVe;(function(n){n.Auto="auto",n.Manual="manual",n.RunOnEmpty="runOnEmpty"})(bVe||(bVe={}));function gFt(n,e=!0){const t=n&&n.files&&n.files.exclude,i=e&&n&&n.search&&n.search.exclude;if(!t&&!i)return;if(!t||!i)return t||i||void 0;let s=Object.create(null);return s=dp(s,Ls(t)),s=dp(s,Ls(i),!0),s}function yVe(n,e){return n.excludePattern&&Bb(n.excludePattern,e)?!1:n.includePattern||n.usingSearchPaths?n.includePattern&&Bb(n.includePattern,e)?!0:n.usingSearchPaths?!!n.folderQueries&&n.folderQueries.some(t=>{const i=t.folder.fsPath;if(Hj(e,i)){const s=j3(i,e);return!t.includePattern||!!Bb(t.includePattern,s)}else return!1}):!1:!0}var SVe;(function(n){n[n.unknownEncoding=1]="unknownEncoding",n[n.regexParseError=2]="regexParseError",n[n.globParseError=3]="globParseError",n[n.invalidLiteral=4]="invalidLiteral",n[n.rgProcessError=5]="rgProcessError",n[n.other=6]="other",n[n.canceled=7]="canceled"})(SVe||(SVe={}));function pF(n,e){const t={...n||{},...e||{}};return Object.keys(t).filter(i=>{const s=t[i];return typeof s=="boolean"&&s})}class Dtt{constructor(e,t){this._parsedIncludeExpression=null,this._excludeExpression=t.excludePattern?.map(s=>({...e.excludePattern||{},...s.pattern||{}}))??[],this._excludeExpression.length===0&&(this._excludeExpression=[e.excludePattern||{}]),this._parsedExcludeExpression=this._excludeExpression.map(s=>_y(s));let i=e.includePattern;t.includePattern&&(i?i={...i,...t.includePattern}:i=t.includePattern),i&&(this._parsedIncludeExpression=_y(i))}_evalParsedExcludeExpression(e,t,i){let s=null;for(const r of this._parsedExcludeExpression){const o=r(e,t,i);if(typeof o=="string"){s=o;break}}return s}matchesExcludesSync(e,t,i){return!!(this._parsedExcludeExpression&&this._evalParsedExcludeExpression(e,t,i))}includedInQuerySync(e,t,i){return!(this._parsedExcludeExpression&&this._evalParsedExcludeExpression(e,t,i)||this._parsedIncludeExpression&&!this._parsedIncludeExpression(e,t,i))}includedInQuery(e,t,i){const s=()=>this._parsedIncludeExpression?!!this._parsedIncludeExpression(e,t,i):!0;return Promise.all(this._parsedExcludeExpression.map(r=>{const o=r(e,t,i);return my(o)?o.then(a=>a?!1:s()):s()})).then(r=>r.some(o=>!!o))}hasSiblingExcludeClauses(){return this._excludeExpression.reduce((e,t)=>pFt(t)||e,!1)}}function pFt(n){for(const e in n)if(typeof n[e]!="boolean")return!0;return!1}function mFt(n){if(!n)return;let e;return t=>(e||(e=(n()||Promise.resolve([])).then(i=>i?ktt(i):{})),e.then(i=>!!i[t]))}function _Ft(n){if(!n)return;let e;return t=>{if(!e){const i=n();e=i?ktt(i):{}}return!!e[t]}}function ktt(n){const e={};for(const t of n)e[t]=!0;return e}function Itt(n){return n.flatMap(e=>e.patterns.map(t=>e.baseUri?{baseUri:e.baseUri,pattern:t}:t))}const jwe={matchLines:100,charsPerLine:1e4},vFt="modulepreload",wFt=function(n,e){return new URL(n,e).href},CVe={},Kv=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){let c=function(d){return Promise.all(d.map(h=>Promise.resolve(h).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");s=c(t.map(d=>{if(d=wFt(d,i),d in CVe)return;CVe[d]=!0;const h=d.endsWith(".css"),u=h?'[rel="stylesheet"]':"";if(i)for(let p=o.length-1;p>=0;p--){const m=o[p];if(m.href===d&&(!h||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${d}"]${u}`))return;const g=document.createElement("link");if(g.rel=h?"stylesheet":vFt,h||(g.as="script"),g.crossOrigin="",g.href=d,l&&g.setAttribute("nonce",l),document.head.appendChild(g),h)return new Promise((p,m)=>{g.addEventListener("load",p),g.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${d}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})},Nc="utf8",cC="utf8bom",cP="utf16be",dP="utf16le",RK=[254,255],Ywe=[255,254],a4=[239,187,191],bFt=512,yFt=512,SFt=512*8,CFt=512*128;var GZ;(function(n){n[n.STREAM_IS_BINARY=1]="STREAM_IS_BINARY"})(GZ||(GZ={}));class EFt extends Error{constructor(e,t){super(e),this.decodeStreamErrorKind=t}}class KAe{static async create(e){let t;if(e!==Nc)t=(await Kv(()=>import("./iconv-lite-umd-D8Xc-NRZ.js").then(s=>s.i),[],import.meta.url).then(s=>s.default??s)).getDecoder(jAe(e));else{const i=new TextDecoder;t={write(s){return i.decode(s,{stream:!0})},end(){return i.decode()}}}return new KAe(t)}constructor(e){this.iconvLiteDecoder=e}write(e){return this.iconvLiteDecoder.write(e)}end(){return this.iconvLiteDecoder.end()}}function Ttt(n,e){const t=e.minBytesRequiredForDetection??e.guessEncoding?SFt:yFt;return new Promise((i,s)=>{const r=UE(h=>h.join("")),o=[];let a=0,l;const c=new ui,d=async()=>{try{const h=await PFt({buffer:Ye.concat(o),bytesRead:a},e.guessEncoding,e.candidateGuessEncodings);if(h.seemsBinary&&e.acceptTextOnly)throw new EFt("Stream is binary but only text is accepted for decoding",GZ.STREAM_IS_BINARY);h.encoding=await e.overwriteEncoding(h.encoding),l=await KAe.create(h.encoding);const u=l.write(Ye.concat(o).buffer);r.write(u),o.length=0,a=0,i({stream:r,detected:h})}catch(h){c.cancel(),r.destroy(),s(h)}};UB(n,{onData:async h=>{l?r.write(l.write(h.buffer)):(o.push(h),a+=h.byteLength,a>=t&&(n.pause(),await d(),setTimeout(()=>n.resume())))},onError:h=>r.error(h),onEnd:async()=>{l||await d(),r.end(l?.end())}},c.token)})}async function Ltt(n,e,t){const s=(await Kv(()=>import("./iconv-lite-umd-D8Xc-NRZ.js").then(a=>a.i),[],import.meta.url).then(a=>a.default??a)).getEncoder(jAe(e),t);let r=!1,o=!1;return{read(){if(o)return null;const a=n.read();if(typeof a!="string"){if(o=!0,!r&&t?.addBOM)switch(e){case Nc:case cC:return Ye.wrap(Uint8Array.from(a4));case cP:return Ye.wrap(Uint8Array.from(RK));case dP:return Ye.wrap(Uint8Array.from(Ywe))}const l=s.end();return l&&l.length>0?(r=!0,Ye.wrap(l)):null}return r=!0,Ye.wrap(s.write(a))}}}async function xFt(n){return(await Kv(()=>import("./iconv-lite-umd-D8Xc-NRZ.js").then(t=>t.i),[],import.meta.url).then(t=>t.default??t)).encodingExists(jAe(n))}function jAe(n){return n===cC||n===null?Nc:n}function DFt(n,e){if(!n||e<RK.length)return null;const t=n.readUInt8(0),i=n.readUInt8(1);if(t===RK[0]&&i===RK[1])return cP;if(t===Ywe[0]&&i===Ywe[1])return dP;if(e<a4.length)return null;const s=n.readUInt8(2);return t===a4[0]&&i===a4[1]&&s===a4[2]?cC:null}const kFt=["ascii","utf-16","utf-32"];async function IFt(n,e){const t=await Kv(()=>import("./index-fzRRQ7Qh.js").then(a=>a.i),[],import.meta.url).then(a=>a.default??a),i=n.slice(0,CFt),s=AFt(i.buffer);e&&(e=vn(e.map(a=>RFt(a))),e.length===0&&(e=void 0));let r;try{r=t.detect(s,e?{detectEncodings:e}:void 0)}catch{return null}if(!r||!r.encoding)return null;const o=r.encoding.toLowerCase();return 0<=kFt.indexOf(o)?null:LFt(r.encoding)}const TFt={ibm866:"cp866",big5:"cp950"};function Rtt(n){return n.replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}function LFt(n){const e=Rtt(n);return TFt[e]||e}function RFt(n){const e=Rtt(n),t=AK[e];return t?t.guessableName:void 0}function AFt(n){let e="";for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);return e}function PFt({buffer:n,bytesRead:e},t,i){let s=DFt(n,e),r=!1;if(s!==cP&&s!==dP&&n){let o=!0,a=!0,l=!1;for(let c=0;c<e&&c<bFt;c++){const d=c%2===1,h=n.readUInt8(c)===0;if(h&&(l=!0),o&&(d&&!h||!d&&h)&&(o=!1),a&&(d&&h||!d&&!h)&&(a=!1),h&&!o&&!a)break}l&&(o?s=dP:a?s=cP:r=!0)}return t&&!r&&!s&&n?IFt(n.slice(0,e),i).then(o=>({seemsBinary:!1,encoding:o})):{seemsBinary:r,encoding:s}}const tD={utf8:{labelLong:"UTF-8",labelShort:"UTF-8",order:1,alias:"utf8bom",guessableName:"UTF-8"},utf8bom:{labelLong:"UTF-8 with BOM",labelShort:"UTF-8 with BOM",encodeOnly:!0,order:2,alias:"utf8"},utf16le:{labelLong:"UTF-16 LE",labelShort:"UTF-16 LE",order:3,guessableName:"UTF-16LE"},utf16be:{labelLong:"UTF-16 BE",labelShort:"UTF-16 BE",order:4,guessableName:"UTF-16BE"},windows1252:{labelLong:"Western (Windows 1252)",labelShort:"Windows 1252",order:5,guessableName:"windows-1252"},iso88591:{labelLong:"Western (ISO 8859-1)",labelShort:"ISO 8859-1",order:6},iso88593:{labelLong:"Western (ISO 8859-3)",labelShort:"ISO 8859-3",order:7},iso885915:{labelLong:"Western (ISO 8859-15)",labelShort:"ISO 8859-15",order:8},macroman:{labelLong:"Western (Mac Roman)",labelShort:"Mac Roman",order:9},cp437:{labelLong:"DOS (CP 437)",labelShort:"CP437",order:10},windows1256:{labelLong:"Arabic (Windows 1256)",labelShort:"Windows 1256",order:11},iso88596:{labelLong:"Arabic (ISO 8859-6)",labelShort:"ISO 8859-6",order:12},windows1257:{labelLong:"Baltic (Windows 1257)",labelShort:"Windows 1257",order:13},iso88594:{labelLong:"Baltic (ISO 8859-4)",labelShort:"ISO 8859-4",order:14},iso885914:{labelLong:"Celtic (ISO 8859-14)",labelShort:"ISO 8859-14",order:15},windows1250:{labelLong:"Central European (Windows 1250)",labelShort:"Windows 1250",order:16,guessableName:"windows-1250"},iso88592:{labelLong:"Central European (ISO 8859-2)",labelShort:"ISO 8859-2",order:17,guessableName:"ISO-8859-2"},cp852:{labelLong:"Central European (CP 852)",labelShort:"CP 852",order:18},windows1251:{labelLong:"Cyrillic (Windows 1251)",labelShort:"Windows 1251",order:19,guessableName:"windows-1251"},cp866:{labelLong:"Cyrillic (CP 866)",labelShort:"CP 866",order:20,guessableName:"IBM866"},cp1125:{labelLong:"Cyrillic (CP 1125)",labelShort:"CP 1125",order:21,guessableName:"IBM1125"},iso88595:{labelLong:"Cyrillic (ISO 8859-5)",labelShort:"ISO 8859-5",order:22,guessableName:"ISO-8859-5"},koi8r:{labelLong:"Cyrillic (KOI8-R)",labelShort:"KOI8-R",order:23,guessableName:"KOI8-R"},koi8u:{labelLong:"Cyrillic (KOI8-U)",labelShort:"KOI8-U",order:24},iso885913:{labelLong:"Estonian (ISO 8859-13)",labelShort:"ISO 8859-13",order:25},windows1253:{labelLong:"Greek (Windows 1253)",labelShort:"Windows 1253",order:26,guessableName:"windows-1253"},iso88597:{labelLong:"Greek (ISO 8859-7)",labelShort:"ISO 8859-7",order:27,guessableName:"ISO-8859-7"},windows1255:{labelLong:"Hebrew (Windows 1255)",labelShort:"Windows 1255",order:28,guessableName:"windows-1255"},iso88598:{labelLong:"Hebrew (ISO 8859-8)",labelShort:"ISO 8859-8",order:29,guessableName:"ISO-8859-8"},iso885910:{labelLong:"Nordic (ISO 8859-10)",labelShort:"ISO 8859-10",order:30},iso885916:{labelLong:"Romanian (ISO 8859-16)",labelShort:"ISO 8859-16",order:31},windows1254:{labelLong:"Turkish (Windows 1254)",labelShort:"Windows 1254",order:32},iso88599:{labelLong:"Turkish (ISO 8859-9)",labelShort:"ISO 8859-9",order:33},windows1258:{labelLong:"Vietnamese (Windows 1258)",labelShort:"Windows 1258",order:34},gbk:{labelLong:"Simplified Chinese (GBK)",labelShort:"GBK",order:35},gb18030:{labelLong:"Simplified Chinese (GB18030)",labelShort:"GB18030",order:36},cp950:{labelLong:"Traditional Chinese (Big5)",labelShort:"Big5",order:37,guessableName:"Big5"},big5hkscs:{labelLong:"Traditional Chinese (Big5-HKSCS)",labelShort:"Big5-HKSCS",order:38},shiftjis:{labelLong:"Japanese (Shift JIS)",labelShort:"Shift JIS",order:39,guessableName:"SHIFT_JIS"},eucjp:{labelLong:"Japanese (EUC-JP)",labelShort:"EUC-JP",order:40,guessableName:"EUC-JP"},euckr:{labelLong:"Korean (EUC-KR)",labelShort:"EUC-KR",order:41,guessableName:"EUC-KR"},windows874:{labelLong:"Thai (Windows 874)",labelShort:"Windows 874",order:42},iso885911:{labelLong:"Latin/Thai (ISO 8859-11)",labelShort:"ISO 8859-11",order:43},koi8ru:{labelLong:"Cyrillic (KOI8-RU)",labelShort:"KOI8-RU",order:44},koi8t:{labelLong:"Tajik (KOI8-T)",labelShort:"KOI8-T",order:45},gb2312:{labelLong:"Simplified Chinese (GB 2312)",labelShort:"GB 2312",order:46,guessableName:"GB2312"},cp865:{labelLong:"Nordic DOS (CP 865)",labelShort:"CP 865",order:47},cp850:{labelLong:"Western European DOS (CP 850)",labelShort:"CP 850",order:48}},AK=(()=>{const n={};for(const e in tD)tD[e].guessableName&&(n[e]=tD[e]);return n})();var KZ;(function(n){n[n.FILE_IS_BINARY=0]="FILE_IS_BINARY"})(KZ||(KZ={}));class NFt extends Ad{static isTextFileOperationError(e){return e instanceof Error&&!bo(e.textFileOperationResult)}constructor(e,t,i){super(e,sn.FILE_OTHER_ERROR),this.textFileOperationResult=t,this.options=i}}var Bf;(function(n){n[n.SAVED=0]="SAVED",n[n.DIRTY=1]="DIRTY",n[n.PENDING_SAVE=2]="PENDING_SAVE",n[n.CONFLICT=3]="CONFLICT",n[n.ORPHAN=4]="ORPHAN",n[n.ERROR=5]="ERROR"})(Bf||(Bf={}));var D8;(function(n){n[n.EDITOR=1]="EDITOR",n[n.REFERENCE=2]="REFERENCE",n[n.OTHER=3]="OTHER"})(D8||(D8={}));var jZ;(function(n){n[n.Encode=0]="Encode",n[n.Decode=1]="Decode"})(jZ||(jZ={}));function Att(n){let e=!1;return{read(){return e?null:(e=!0,n)}}}function MFt(n){if(!(typeof n>"u"))return typeof n=="string"?Ye.fromString(n):{read:()=>{const e=n.read();return typeof e=="string"?Ye.fromString(e):null}}}function k8(n,e,t){return new $B(i=>YAe(i,t)).isEqual(n,e)}function OFt(n,e,t){return k8(n.uri,e.uri,t)?0:fm(n.uri.toString(),e.uri.toString())}function FFt(n,e,t){return n.index!==e.index?n.index<e.index?-1:1:k8(n.uri,e.uri,t)?fm(n.name,e.name):fm(n.uri.toString(),e.uri.toString())}function Ptt(n,e,t,i){const s=n.slice(0).sort((o,a)=>t(o,a,i)),r=e.slice(0).sort((o,a)=>t(o,a,i));return MT(s,r,(o,a)=>t(o,a,i))}function YAe(n,e){const t=e.getCapabilities(n.scheme);return!(t&&t&Fn.PathCaseSensitive)}class mF extends Cje{static toExtHostWorkspace(e,t,i,s){if(!e)return{workspace:null,added:[],removed:[]};const{id:r,name:o,folders:a,configuration:l,transient:c,isUntitled:d}=e,h=[],u=t;t?a.forEach((_,w)=>{const b=N.revive(_.uri),S=mF._findFolder(i||t,b,s);S?(S.name=_.name,S.index=_.index,h.push(S)):h.push({uri:b,name:_.name,index:w})}):h.push(...a.map(({uri:_,name:w,index:b})=>({uri:N.revive(_),name:w,index:b}))),h.sort((_,w)=>_.index<w.index?-1:1);const g=new mF(r,o,h,!!c,l?N.revive(l):null,!!d,_=>YAe(_,s)),{added:p,removed:m}=Ptt(u?u.workspaceFolders:[],g.workspaceFolders,OFt,s);return{workspace:g,added:p,removed:m}}static _findFolder(e,t,i){for(let s=0;s<e.folders.length;s++){const r=e.workspaceFolders[s];if(k8(r.uri,t,i))return r}}constructor(e,t,i,s,r,o,a){super(e,i.map(l=>new Goe(l)),s,r,a),this._name=t,this._isUntitled=o,this._workspaceFolders=[],this._structure=Th.forUris(a,()=>!0),i.forEach(l=>{this._workspaceFolders.push(l),this._structure.set(l.uri,l)})}get name(){return this._name}get isUntitled(){return this._isUntitled}get workspaceFolders(){return this._workspaceFolders.slice(0)}getWorkspaceFolder(e,t){return t&&this._structure.get(e)&&(e=Ka(e)),this._structure.findSubstr(e)}resolveWorkspaceFolder(e){return this._structure.get(e)}}let Xwe=class{constructor(e,t,i,s,r){this._onDidChangeWorkspace=new A,this.onDidChangeWorkspace=this._onDidChangeWorkspace.event,this._onDidGrantWorkspaceTrust=new A,this.onDidGrantWorkspaceTrust=this._onDidGrantWorkspaceTrust.event,this._activeSearchCallbacks=[],this._trusted=!1,this._editSessionIdentityProviders=new Map,this._providerHandlePool=0,this._onWillCreateEditSessionIdentityEvent=new VD,this._canonicalUriProviders=new Map,this._logService=s,this._extHostFileSystemInfo=i,this._uriTransformerService=r,this._requestIdProvider=new vmt,this._barrier=new Lh,this._proxy=e.getProxy(Xe.MainThreadWorkspace),this._messageService=e.getProxy(Xe.MainThreadMessageService);const o=t.workspace;this._confirmedWorkspace=o?new mF(o.id,o.name,[],!!o.transient,o.configuration?N.revive(o.configuration):null,!!o.isUntitled,a=>YAe(a,i)):void 0}$initializeWorkspace(e,t){this._trusted=t,this.$acceptWorkspaceData(e),this._barrier.open()}waitForInitializeCall(){return this._barrier.wait()}get workspace(){return this._actualWorkspace}get name(){return this._actualWorkspace?this._actualWorkspace.name:void 0}get workspaceFile(){if(this._actualWorkspace&&this._actualWorkspace.configuration)return this._actualWorkspace.isUntitled?N.from({scheme:ye.untitled,path:In(Ka(this._actualWorkspace.configuration))}):this._actualWorkspace.configuration}get _actualWorkspace(){return this._unconfirmedWorkspace||this._confirmedWorkspace}getWorkspaceFolders(){if(this._actualWorkspace)return this._actualWorkspace.workspaceFolders.slice(0)}async getWorkspaceFolders2(){if(await this._barrier.wait(),!!this._actualWorkspace)return this._actualWorkspace.workspaceFolders.slice(0)}updateWorkspaceFolders(e,t,i,...s){const r=[];if(Array.isArray(s)&&s.forEach(d=>{N.isUri(d.uri)&&!r.some(h=>k8(h.uri,d.uri,this._extHostFileSystemInfo))&&r.push({uri:d.uri,name:d.name||x2(d.uri)})}),this._unconfirmedWorkspace||[t,i].some(d=>typeof d!="number"||d<0)||i===0&&r.length===0)return!1;const o=this._actualWorkspace?this._actualWorkspace.workspaceFolders:[];if(t+i>o.length)return!1;const a=o.slice(0);a.splice(t,i,...r.map(d=>({uri:d.uri,name:d.name||x2(d.uri),index:void 0})));for(let d=0;d<a.length;d++){const h=a[d];if(a.some((u,g)=>g!==d&&k8(h.uri,u.uri,this._extHostFileSystemInfo)))return!1}a.forEach((d,h)=>d.index=h);const{added:l,removed:c}=Ptt(o,a,FFt,this._extHostFileSystemInfo);if(l.length===0&&c.length===0)return!1;if(this._proxy){const d=e.displayName||e.name;this._proxy.$updateWorkspaceFolders(d,t,i,r).then(void 0,h=>{this._unconfirmedWorkspace=void 0;const u={source:{identifier:e.identifier,label:e.displayName||e.name}};this._messageService.$showMessage(wt.Error,f(2640,"Extension '{0}' failed to update workspace folders: {1}",d,h.toString()),u,[])})}return this.trySetWorkspaceFolders(a),!0}getWorkspaceFolder(e,t){if(this._actualWorkspace)return this._actualWorkspace.getWorkspaceFolder(e,t)}async getWorkspaceFolder2(e,t){if(await this._barrier.wait(),!!this._actualWorkspace)return this._actualWorkspace.getWorkspaceFolder(e,t)}async resolveWorkspaceFolder(e){if(await this._barrier.wait(),!!this._actualWorkspace)return this._actualWorkspace.resolveWorkspaceFolder(e)}getPath(){if(!this._actualWorkspace)return;const{folders:e}=this._actualWorkspace;if(e.length!==0)return e[0].uri.fsPath}getRelativePath(e,t){let i,s="";if(typeof e=="string"?(i=N.file(e),s=e):typeof e<"u"&&(i=e,s=e.fsPath),!i)return s;const r=this.getWorkspaceFolder(i,!0);if(!r)return s;typeof t>"u"&&this._actualWorkspace&&(t=this._actualWorkspace.folders.length>1);let o=MP(r.uri,i);return t&&r.name&&(o=`${r.name}/${o}`),o}trySetWorkspaceFolders(e){this._actualWorkspace&&(this._unconfirmedWorkspace=mF.toExtHostWorkspace({id:this._actualWorkspace.id,name:this._actualWorkspace.name,configuration:this._actualWorkspace.configuration,folders:e,isUntitled:this._actualWorkspace.isUntitled},this._actualWorkspace,void 0,this._extHostFileSystemInfo).workspace||void 0)}$acceptWorkspaceData(e){const{workspace:t,added:i,removed:s}=mF.toExtHostWorkspace(e,this._confirmedWorkspace,this._unconfirmedWorkspace,this._extHostFileSystemInfo);this._confirmedWorkspace=t||void 0,this._unconfirmedWorkspace=void 0,this._onDidChangeWorkspace.fire(Object.freeze({added:i,removed:s}))}findFiles(e,t,i,s,r=et.None){this._logService.trace(`extHostWorkspace#findFiles: fileSearch, extension: ${s.value}, entryPoint: findFiles`);let o="",a=!0;return t===null?a=!1:t!==void 0&&(typeof t=="string"?o=t:o=t.pattern),this._findFilesImpl({type:"include",value:e},{exclude:[o],maxResults:i,useExcludeSettings:a?mb.FilesExclude:mb.None,useIgnoreFiles:{local:!1}},r)}findFiles2(e,t={},i,s=et.None){return this._logService.trace(`extHostWorkspace#findFiles2New: fileSearch, extension: ${i.value}, entryPoint: findFiles2New`),this._findFilesImpl({type:"filePatterns",value:e},t,s)}async _findFilesImpl(e,t,i){if(i.isCancellationRequested)return Promise.resolve([]);const s=e.type==="include"?[e.value]:e.value??[];if(!Array.isArray(s))throw console.error("Invalid file pattern provided",s),new Error(`Invalid file pattern provided ${JSON.stringify(s)}`);const r=s.map(o=>{const a=EVe(t.exclude),l={ignoreSymlinks:typeof t.followSymlinks=="boolean"?!t.followSymlinks:void 0,disregardIgnoreFiles:typeof t.useIgnoreFiles?.local=="boolean"?!t.useIgnoreFiles.local:void 0,disregardGlobalIgnoreFiles:typeof t.useIgnoreFiles?.global=="boolean"?!t.useIgnoreFiles.global:void 0,disregardParentIgnoreFiles:typeof t.useIgnoreFiles?.parent=="boolean"?!t.useIgnoreFiles.parent:void 0,disregardExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings===mb.None,disregardSearchExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings!==mb.SearchAndFilesExclude,maxResults:t.maxResults,excludePattern:a.length>0?a:void 0,_reason:"startFileSearch",shouldGlobSearch:e.type==="include"?void 0:!0},c=PK(Kg.from(o)),d=c?.folder;return e.type==="include"?l.includePattern=c?.pattern:l.filePattern=c?.pattern,{folder:d,options:l}});return this._findFilesBase(r,i)}async _findFilesBase(e,t){return(await Promise.all(e?.map(s=>this._proxy.$startFileSearch(s.folder??null,s.options,t).then(r=>Array.isArray(r)?r.map(o=>N.revive(o)):[]))??[])).flat()}findTextInFiles2(e,t,i,s=et.None){this._logService.trace(`extHostWorkspace#findTextInFiles2: textSearch, extension: ${i.value}, entryPoint: findTextInFiles2`);const r=u=>{if(!t)return{folder:void 0,options:{}};const g=u?PK(Kg.from(u)):void 0,p=t.exclude?EVe(t.exclude):void 0;return{options:{ignoreSymlinks:typeof t.followSymlinks=="boolean"?!t.followSymlinks:void 0,disregardIgnoreFiles:typeof t.useIgnoreFiles=="boolean"?!t.useIgnoreFiles:void 0,disregardGlobalIgnoreFiles:typeof t.useIgnoreFiles?.global=="boolean"?!t.useIgnoreFiles?.global:void 0,disregardParentIgnoreFiles:typeof t.useIgnoreFiles?.parent=="boolean"?!t.useIgnoreFiles?.parent:void 0,disregardExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings===mb.None,disregardSearchExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings!==mb.SearchAndFilesExclude,fileEncoding:t.encoding,maxResults:t.maxResults,previewOptions:t.previewOptions?{matchLines:t.previewOptions?.numMatchLines??100,charsPerLine:t.previewOptions?.charsPerLine??1e4}:void 0,surroundingContext:t.surroundingContext,includePattern:g?.pattern,excludePattern:p},folder:g?.folder}},a=(t?.include?.map(u=>r(u))??[r(void 0)]).filter(u=>!!u),l=new ie,c=l.add(new A),d=this.findTextInFilesBase(e,a,(u,g)=>c.fire({result:u,uri:g}),s);return{results:new eh(async u=>{l.add(c.event(g=>{const p=g.result,m=g.uri;mVe(p)?u.emitOne(new _C(m,p.rangeLocations.map(_=>({previewRange:new Zn(_.preview.startLineNumber,_.preview.startColumn,_.preview.endLineNumber,_.preview.endColumn),sourceRange:new Zn(_.source.startLineNumber,_.source.startColumn,_.source.endLineNumber,_.source.endColumn)})),p.previewText)):u.emitOne(new Doe(m,p.text,p.lineNumber))})),await d}),complete:d.then(u=>(l.dispose(),{limitHit:u?.limitHit??!1}))}}async findTextInFilesBase(e,t,i,s=et.None){const r=this._requestIdProvider.getNext();let o=!1;if(s.onCancellationRequested(a=>{o=!0}),this._activeSearchCallbacks[r]=a=>{if(o)return;const l=N.revive(a.resource);a.results.forEach(c=>{const d=nr(c);i(d,l)})},s.isCancellationRequested)return{};try{const a=await Promise.all(t?.map(l=>this._proxy.$startTextSearch(e,l.folder??null,l.options,r,s)||{})??[]);return delete this._activeSearchCallbacks[r],a.reduce((l,c)=>({limitHit:l?.limitHit||(c?.limitHit??!1),message:[l?.message??[],c?.message??[]].flat()}),{})??{limitHit:!1}}catch(a){throw delete this._activeSearchCallbacks[r],a}}async findTextInFiles(e,t,i,s,r=et.None){this._logService.trace(`extHostWorkspace#findTextInFiles: textSearch, extension: ${s.value}, entryPoint: findTextInFiles`);const o=typeof t.previewOptions>"u"?{matchLines:100,charsPerLine:1e4}:t.previewOptions,a=PK(Kg.from(t.include)),l=typeof t.exclude=="string"?t.exclude:t.exclude?t.exclude.pattern:void 0,c={ignoreSymlinks:typeof t.followSymlinks=="boolean"?!t.followSymlinks:void 0,disregardIgnoreFiles:typeof t.useIgnoreFiles=="boolean"?!t.useIgnoreFiles:void 0,disregardGlobalIgnoreFiles:typeof t.useGlobalIgnoreFiles=="boolean"?!t.useGlobalIgnoreFiles:void 0,disregardParentIgnoreFiles:typeof t.useParentIgnoreFiles=="boolean"?!t.useParentIgnoreFiles:void 0,disregardExcludeSettings:typeof t.useDefaultExcludes=="boolean"?!t.useDefaultExcludes:!0,disregardSearchExcludeSettings:typeof t.useSearchExclude=="boolean"?!t.useSearchExclude:!0,fileEncoding:t.encoding,maxResults:t.maxResults,previewOptions:o,surroundingContext:t.afterContext,includePattern:a?.pattern,excludePattern:l?[{pattern:l}]:void 0},d=(h,u)=>{mVe(h)?i({uri:u,preview:{text:h.previewText,matches:Nue(h.rangeLocations,g=>new Zn(g.preview.startLineNumber,g.preview.startColumn,g.preview.endLineNumber,g.preview.endColumn))},ranges:Nue(h.rangeLocations,g=>new Zn(g.source.startLineNumber,g.source.startColumn,g.source.endLineNumber,g.source.endColumn))}):i({uri:u,text:h.text,lineNumber:h.lineNumber})};return this.findTextInFilesBase(e,[{options:c,folder:a?.folder}],d,r)}$handleTextSearchResult(e,t){this._activeSearchCallbacks[t]?.(e)}async save(e){const t=await this._proxy.$save(e,{saveAs:!1});return N.revive(t)}async saveAs(e){const t=await this._proxy.$save(e,{saveAs:!0});return N.revive(t)}saveAll(e){return this._proxy.$saveAll(e)}resolveProxy(e){return this._proxy.$resolveProxy(e)}lookupAuthorization(e){return this._proxy.$lookupAuthorization(e)}lookupKerberosAuthorization(e){return this._proxy.$lookupKerberosAuthorization(e)}loadCertificates(){return this._proxy.$loadCertificates()}get trusted(){return this._trusted}requestWorkspaceTrust(e){return this._proxy.$requestWorkspaceTrust(e)}$onDidGrantWorkspaceTrust(){this._trusted||(this._trusted=!0,this._onDidGrantWorkspaceTrust.fire())}registerEditSessionIdentityProvider(e,t){if(this._editSessionIdentityProviders.has(e))throw new Error(`A provider has already been registered for scheme ${e}`);this._editSessionIdentityProviders.set(e,t);const i=this._uriTransformerService.transformOutgoingScheme(e),s=this._providerHandlePool++;return this._proxy.$registerEditSessionIdentityProvider(s,i),ke(()=>{this._editSessionIdentityProviders.delete(e),this._proxy.$unregisterEditSessionIdentityProvider(s)})}async $getEditSessionIdentifier(e,t){this._logService.info("Getting edit session identifier for workspaceFolder",e);const i=await this.resolveWorkspaceFolder(N.revive(e));if(!i){this._logService.warn("Unable to resolve workspace folder");return}this._logService.info("Invoking #provideEditSessionIdentity for workspaceFolder",i);const s=this._editSessionIdentityProviders.get(i.uri.scheme);if(this._logService.info(`Provider for scheme ${i.uri.scheme} is defined: `,!!s),!s)return;const r=await s.provideEditSessionIdentity(i,t);if(this._logService.info("Provider returned edit session identifier: ",r),!!r)return r}async $provideEditSessionIdentityMatch(e,t,i,s){this._logService.info("Getting edit session identifier for workspaceFolder",e);const r=await this.resolveWorkspaceFolder(N.revive(e));if(!r){this._logService.warn("Unable to resolve workspace folder");return}this._logService.info("Invoking #provideEditSessionIdentity for workspaceFolder",r);const o=this._editSessionIdentityProviders.get(r.uri.scheme);if(this._logService.info(`Provider for scheme ${r.uri.scheme} is defined: `,!!o),!o)return;const a=await o.provideEditSessionIdentityMatch?.(t,i,s);if(this._logService.info("Provider returned edit session identifier match result: ",a),!!a)return a}getOnWillCreateEditSessionIdentityEvent(e){return(t,i,s)=>{const r=function(a){t.call(i,a)};return r.extension=e,this._onWillCreateEditSessionIdentityEvent.event(r,void 0,s)}}async $onWillCreateEditSessionIdentity(e,t,i){const s=await this.resolveWorkspaceFolder(N.revive(e));if(s===void 0)throw new Error("Unable to resolve workspace folder");await this._onWillCreateEditSessionIdentityEvent.fireAsync({workspaceFolder:s},t,async(r,o)=>{const a=Date.now();await Promise.resolve(r),Date.now()-a>i&&this._logService.warn("SLOW edit session create-participant",o.extension.identifier)}),t.isCancellationRequested}registerCanonicalUriProvider(e,t){if(this._canonicalUriProviders.has(e))throw new Error(`A provider has already been registered for scheme ${e}`);this._canonicalUriProviders.set(e,t);const i=this._uriTransformerService.transformOutgoingScheme(e),s=this._providerHandlePool++;return this._proxy.$registerCanonicalUriProvider(s,i),ke(()=>{this._canonicalUriProviders.delete(e),this._proxy.$unregisterCanonicalUriProvider(s)})}async provideCanonicalUri(e,t,i){const s=this._canonicalUriProviders.get(e.scheme);if(!s)return;const r=await s.provideCanonicalUri?.(N.revive(e),t,i);if(r)return r}async $provideCanonicalUri(e,t,i){return this.provideCanonicalUri(N.revive(e),{targetScheme:t},i)}async decode(e,t){const[i,s]=this.toEncodeDecodeParameters(t),r=await this._proxy.$resolveDecoding(i,s),o=(await Ttt(H9(Ye.wrap(e)),{...r,acceptTextOnly:!0,overwriteEncoding:a=>a===null||a===r.preferredEncoding?Promise.resolve(r.preferredEncoding):this._proxy.$validateDetectedEncoding(i,a,s)})).stream;return Qre(o,a=>a.join(""))}async encode(e,t){const[i,s]=this.toEncodeDecodeParameters(t),{encoding:r,addBOM:o}=await this._proxy.$resolveEncoding(i,s);if(r===Nc&&!o)return Ye.fromString(e).buffer;const a=await Ltt(Att(e),r,{addBOM:o});return Tze(a).buffer}toEncodeDecodeParameters(e){const t=Oj(e?.uri)?e.uri:void 0,i=typeof e?.encoding=="string"?e.encoding:void 0;return[t,i?{encoding:i}:void 0]}};Xwe=y([v(0,dr),v(1,Yc),v(2,$H),v(3,it),v(4,Lle)],Xwe);const rx=de("IExtHostWorkspace");function PK(n){let e,t;if(n)return typeof n=="string"?e=n:(e=n.pattern,t=N.revive(n.baseUri)),{pattern:e,folder:t}}function EVe(n){return(n?.map(e=>{if(typeof e=="string")return e===""?void 0:{pattern:e,uri:void 0};{const t=PK(e);return t?{pattern:t.pattern,uri:t.folder}:void 0}})??[]).filter(e=>!!e)}var l4,Ck;let Qwe=(Ck=class{constructor(e,t){this._logService=t,this._provider=new Map,this._proxy=e.getProxy(Xe.MainThreadDecorations)}registerFileDecorationProvider(e,t){const i=l4._handlePool++;this._provider.set(i,{provider:e,extensionDescription:t}),this._proxy.$registerDecorationProvider(i,t.identifier.value);const s=e.onDidChangeFileDecorations&&e.onDidChangeFileDecorations(r=>{if(!r){this._proxy.$onDidChange(i,null);return}const o=hu(r);if(o.length<=l4._maxEventSize){this._proxy.$onDidChange(i,o);return}this._logService.warn("[Decorations] CAPPING events from decorations provider",t.identifier.value,o.length);const a=o.map(d=>({uri:d,rank:hct(d.path,"/")})),l=W3(a,(d,h)=>d.rank-h.rank||fm(d.uri.path,h.uri.path)),c=[];e:for(const d of l){let h;for(const u of d){const g=UD(u.uri.path);if(h!==g&&(h=g,c.push(u.uri)>=l4._maxEventSize))break e}}this._proxy.$onDidChange(i,c)});return new bs(()=>{s?.dispose(),this._proxy.$unregisterDecorationProvider(i),this._provider.delete(i)})}async $provideDecorations(e,t,i){if(!this._provider.has(e))return Object.create(null);const s=Object.create(null),{provider:r,extensionDescription:o}=this._provider.get(e);return await Promise.all(t.map(async a=>{try{const{uri:l,id:c}=a,d=await Promise.resolve(r.provideFileDecoration(N.revive(l),i));if(!d)return;try{C$.validate(d),d.badge&&typeof d.badge!="string"&&Qe(o,"codiconDecoration"),s[c]=[d.propagate,d.tooltip,d.badge,d.color]}catch(h){this._logService.warn(`INVALID decoration from extension '${o.identifier.value}': ${h}`)}}catch(l){this._logService.error(l)}})),s}},l4=Ck,Ck._handlePool=0,Ck._maxEventSize=250,Ck);Qwe=l4=y([v(0,dr),v(1,it)],Qwe);const Ntt=de("IExtHostDecorations");function Oq(n,e){if(e){const t=e.split(".");let i=n;for(let s=0;i&&s<t.length;s++)i=i[t[s]];return i}}function WFt(n){return n instanceof N}function BFt(n){return n&&n.uri instanceof N&&n.languageId&&typeof n.languageId=="string"}function HFt(n){return n&&!n.uri&&n.languageId&&typeof n.languageId=="string"}function VFt(n){return n&&n.uri instanceof N&&(!n.name||typeof n.name=="string")&&(!n.index||typeof n.index=="number")}function xVe(n){if(WFt(n))return{resource:n};if(BFt(n))return{resource:n.uri,overrideIdentifier:n.languageId};if(HFt(n))return{overrideIdentifier:n.languageId};if(VFt(n))return{resource:n.uri};if(n===null)return{resource:null}}let Zwe=class{constructor(e,t,i){this._proxy=e.getProxy(Xe.MainThreadConfiguration),this._extHostWorkspace=t,this._logService=i,this._barrier=new Lh,this._actual=null}getConfigProvider(){return this._barrier.wait().then(e=>this._actual)}$initializeConfiguration(e){this._actual=new UFt(this._proxy,this._extHostWorkspace,e,this._logService),this._barrier.open()}$acceptConfigurationChanged(e,t){this.getConfigProvider().then(i=>i.$acceptConfigurationChanged(e,t))}};Zwe=y([v(0,dr),v(1,rx),v(2,it)],Zwe);class UFt{constructor(e,t,i,s){this._onDidChangeConfiguration=new A,this._proxy=e,this._logService=s,this._extHostWorkspace=t,this._configuration=z7.parse(i,s),this._configurationScopes=this._toMap(i.configurationScopes)}get onDidChangeConfiguration(){return this._onDidChangeConfiguration&&this._onDidChangeConfiguration.event}$acceptConfigurationChanged(e,t){const i={data:this._configuration.toData(),workspace:this._extHostWorkspace.workspace};this._configuration=z7.parse(e,this._logService),this._configurationScopes=this._toMap(e.configurationScopes),this._onDidChangeConfiguration.fire(this._toConfigurationChangeEvent(t,i))}getConfiguration(e,t,i){const s=xVe(t)||{},r=this._toReadonlyValue(this._configuration.getValue(e,s,this._extHostWorkspace.workspace));e&&this._validateConfigurationAccess(e,s,i?.identifier);function o(l){if(l==null)return null;if(typeof l=="boolean")return l?Wt.USER:Wt.WORKSPACE;switch(l){case P1.Global:return Wt.USER;case P1.Workspace:return Wt.WORKSPACE;case P1.WorkspaceFolder:return Wt.WORKSPACE_FOLDER}}const a={has(l){return typeof Oq(r,l)<"u"},get:(l,c)=>{this._validateConfigurationAccess(e?`${e}.${l}`:l,s,i?.identifier);let d=Oq(r,l);if(typeof d>"u")d=c;else{let h;const u=(g,p)=>{if(zn(g)){let m;const _=()=>{h=h||Ls(r),m=m||Oq(h,p)};return new Proxy(g,{get:(w,b)=>{if(typeof b=="string"&&b.toLowerCase()==="tojson")return _(),()=>m;if(h)return m=m||Oq(h,p),m[b];const S=w[b];return typeof b=="string"?u(S,`${p}.${b}`):S},set:(w,b,S)=>(_(),m&&(m[b]=S),!0),deleteProperty:(w,b)=>(_(),m&&delete m[b],!0),defineProperty:(w,b,S)=>(_(),m&&Object.defineProperty(m,b,S),!0)})}return Array.isArray(g)?Ls(g):g};d=u(d,l)}return d},update:(l,c,d,h)=>{l=e?`${e}.${l}`:l;const u=o(d);return c!==void 0?this._proxy.$updateConfigurationOption(u,l,c,s,h):this._proxy.$removeConfigurationOption(u,l,s,h)},inspect:l=>{l=e?`${e}.${l}`:l;const c=this._configuration.inspect(l,s,this._extHostWorkspace.workspace);if(c)return{key:l,defaultValue:Ls(c.policy?.value??c.default?.value),globalLocalValue:Ls(c.userLocal?.value),globalRemoteValue:Ls(c.userRemote?.value),globalValue:Ls(c.user?.value??c.application?.value),workspaceValue:Ls(c.workspace?.value),workspaceFolderValue:Ls(c.workspaceFolder?.value),defaultLanguageValue:Ls(c.default?.override),globalLocalLanguageValue:Ls(c.userLocal?.override),globalRemoteLanguageValue:Ls(c.userRemote?.override),globalLanguageValue:Ls(c.user?.override??c.application?.override),workspaceLanguageValue:Ls(c.workspace?.override),workspaceFolderLanguageValue:Ls(c.workspaceFolder?.override),languageIds:Ls(c.overrideIdentifiers)}}};return typeof r=="object"&&dp(a,r,!1),Object.freeze(a)}_toReadonlyValue(e){const t=i=>zn(i)?new Proxy(i,{get:(s,r)=>t(s[r]),set:(s,r,o)=>{throw new Error(`TypeError: Cannot assign to read only property '${String(r)}' of object`)},deleteProperty:(s,r)=>{throw new Error(`TypeError: Cannot delete read only property '${String(r)}' of object`)},defineProperty:(s,r)=>{throw new Error(`TypeError: Cannot define property '${String(r)}' for a readonly object`)},setPrototypeOf:s=>{throw new Error("TypeError: Cannot set prototype for a readonly object")},isExtensible:()=>!1,preventExtensions:()=>!0}):i;return t(e)}_validateConfigurationAccess(e,t,i){const s=tg.test(e)?Ct.RESOURCE:this._configurationScopes.get(e),r=i?`[${i.value}] `:"";if(Ct.RESOURCE===s){typeof t?.resource>"u"&&this._logService.warn(`${r}Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '${e}', provide the URI of a resource or 'null' for any resource.`);return}if(Ct.WINDOW===s){t?.resource&&this._logService.warn(`${r}Accessing a window scoped configuration for a resource is not expected. To associate '${e}' to a resource, define its scope to 'resource' in configuration contributions in 'package.json'.`);return}}_toConfigurationChangeEvent(e,t){const i=new bRe(e,t,this._configuration,this._extHostWorkspace.workspace,this._logService);return Object.freeze({affectsConfiguration:(s,r)=>i.affectsConfiguration(s,xVe(r))})}_toMap(e){return e.reduce((t,i)=>(t.set(i[0],i[1]),t),new Map)}}const ox=de("IExtHostConfiguration"),uT=(n,e,t,i)=>{let s=e;return{enumerable:!0,configurable:!1,get(){return s},set(r){if(!t(s,r)){const o=s;s=r,n.listener?.(i(r,o))}}}},qN=(n,e)=>n===e,gx={range:(n,e)=>n===e?!0:!n||!e?!1:n.isEqual(e),label:qN,description:qN,sortText:qN,busy:qN,error:qN,canResolveChildren:qN,tags:(n,e)=>!(n.length!==e.length||n.some(t=>!e.find(i=>t.id===i.id)))},GN=n=>e=>({op:Ud.SetProp,update:n(e)}),$Ft=(n,e)=>({range:(()=>{let t;const i=GN(s=>({range:M.lift(ft.from(s))}));return{enumerable:!0,configurable:!1,get(){return t},set(s){n.listener?.({op:Ud.DocumentSynced}),gx.range(t,s)||(t=s,n.listener?.(i(s)))}}})(),label:uT(n,e,gx.label,GN(t=>({label:t}))),description:uT(n,void 0,gx.description,GN(t=>({description:t}))),sortText:uT(n,void 0,gx.sortText,GN(t=>({sortText:t}))),canResolveChildren:uT(n,!1,gx.canResolveChildren,t=>({op:Ud.UpdateCanResolveChildren,state:t})),busy:uT(n,!1,gx.busy,GN(t=>({busy:t}))),error:uT(n,void 0,gx.error,GN(t=>({error:Cn.fromStrict(t)||null}))),tags:uT(n,[],gx.tags,(t,i)=>({op:Ud.SetTags,new:t.map(dw.from),old:i.map(dw.from)}))}),zFt=n=>{const e=Rn.fromString(n.extId),t=new mN(e.controllerId,e.localId,n.label,N.revive(n.uri)||void 0);return t.range=ft.to(n.range||void 0),t.description=n.description||void 0,t.sortText=n.sortText||void 0,t.tags=n.tags.map(i=>dw.to({id:wtt(i).tagId})),t},DVe=n=>{let e;for(const t of n.tests){const i=zFt(t.item);Ile(i).parent=e,e=i}return e};class mN{constructor(e,t,i,s){if(t.includes(Fp.Delimiter))throw new Error(`Test IDs may not include the ${JSON.stringify(t)} symbol`);const r=sFt(this,e);Object.defineProperties(this,{id:{value:t,enumerable:!0,writable:!1},uri:{value:s,enumerable:!0,writable:!1},parent:{enumerable:!1,get(){return r.parent instanceof XAe?void 0:r.parent}},children:{value:nFt(r,Ile,mN),enumerable:!0,writable:!1},...$Ft(r,i)})}}class XAe extends mN{constructor(e,t){super(e,e,t,void 0),this._isRoot=!0}}class qFt extends eFt{constructor(e,t,i){super({controllerId:e,getDocumentVersion:s=>s&&i.getDocument(s)?.version,getApiFor:Ile,getChildren:s=>s.children,root:new XAe(e,t),toITestItem:CI.from})}}let Jwe=class extends V{constructor(e,t,i){super(),this.initData=t,this._onDidChangeTelemetryEnabled=this._register(new A),this.onDidChangeTelemetryEnabled=this._onDidChangeTelemetryEnabled.event,this._onDidChangeTelemetryConfiguration=this._register(new A),this.onDidChangeTelemetryConfiguration=this._onDidChangeTelemetryConfiguration.event,this._productConfig={usage:!0,error:!0},this._level=$u.NONE,this._inLoggingOnlyMode=!1,this._telemetryLoggers=new Map,this._inLoggingOnlyMode=this.initData.environment.isExtensionTelemetryLoggingOnly;const s=t.remote.isRemote?"remoteExtHostTelemetry":e?"workerExtHostTelemetry":"extHostTelemetry";this._outputLogger=this._register(i.createLogger(s,{name:f(2635,"Extension Telemetry{0}",this._inLoggingOnlyMode?" (Not Sent)":""),hidden:!0,group:Rft}))}getTelemetryConfiguration(){return this._level===$u.USAGE}getTelemetryDetails(){return{isCrashEnabled:this._level>=$u.CRASH,isErrorsEnabled:this._productConfig.error?this._level>=$u.ERROR:!1,isUsageEnabled:this._productConfig.usage?this._level>=$u.USAGE:!1}}instantiateLogger(e,t,i){const s=this.getTelemetryDetails(),r=new Mtt(t,i,e,this._outputLogger,this._inLoggingOnlyMode,this.getBuiltInCommonProperties(e),{isUsageEnabled:s.isUsageEnabled,isErrorsEnabled:s.isErrorsEnabled}),o=this._telemetryLoggers.get(e.identifier.value)??[];return this._telemetryLoggers.set(e.identifier.value,[...o,r]),r.apiTelemetryLogger}$initializeTelemetryLevel(e,t,i){this._level=e,this._productConfig=i??{usage:!0,error:!0}}getBuiltInCommonProperties(e){const t=Object.create(null);switch(t["common.extname"]=`${e.publisher}.${e.name}`,t["common.extversion"]=e.version,t["common.vscodemachineid"]=this.initData.telemetryInfo.machineId,t["common.vscodesessionid"]=this.initData.telemetryInfo.sessionId,t["common.vscodecommithash"]=this.initData.commit,t["common.sqmid"]=this.initData.telemetryInfo.sqmId,t["common.devDeviceId"]=this.initData.telemetryInfo.devDeviceId,t["common.vscodeversion"]=this.initData.version,t["common.vscodereleasedate"]=this.initData.date,t["common.isnewappinstall"]=Ott(this.initData.telemetryInfo.firstSessionDate),t["common.product"]=this.initData.environment.appHost,this.initData.uiKind){case x_.Web:t["common.uikind"]="web";break;case x_.Desktop:t["common.uikind"]="desktop";break;default:t["common.uikind"]="unknown"}return t["common.remotename"]=K9(Nft(this.initData.remote.authority)),t}$onDidChangeTelemetryLevel(e){this._oldTelemetryEnablement=this.getTelemetryConfiguration(),this._level=e;const t=this.getTelemetryDetails();this._telemetryLoggers.forEach((i,s)=>{const r=i.filter(o=>!o.isDisposed);r.length===0?this._telemetryLoggers.delete(s):this._telemetryLoggers.set(s,r)}),this._telemetryLoggers.forEach(i=>{for(const s of i)s.updateTelemetryEnablements(t.isUsageEnabled,t.isErrorsEnabled)}),this._oldTelemetryEnablement!==this.getTelemetryConfiguration()&&this._onDidChangeTelemetryEnabled.fire(this.getTelemetryConfiguration()),this._onDidChangeTelemetryConfiguration.fire(this.getTelemetryDetails())}onExtensionError(e,t){const s=this._telemetryLoggers.get(e.value)?.filter(o=>!o.isDisposed);if(!s)return this._telemetryLoggers.delete(e.value),!1;let r=!1;for(const o of s)o.ignoreUnhandledExtHostErrors||(o.logError(t),r=!0);return r}};Jwe=y([v(1,Yc),v(2,Sc)],Jwe);class Mtt{static validateSender(e){if(typeof e!="object")throw new TypeError("TelemetrySender argument is invalid");if(typeof e.sendEventData!="function")throw new TypeError("TelemetrySender.sendEventData must be a function");if(typeof e.sendErrorData!="function")throw new TypeError("TelemetrySender.sendErrorData must be a function");if(typeof e.flush<"u"&&typeof e.flush!="function")throw new TypeError("TelemetrySender.flush must be a function or undefined")}constructor(e,t,i,s,r,o,a){this._extension=i,this._logger=s,this._inLoggingOnlyMode=r,this._commonProperties=o,this._onDidChangeEnableStates=new A,this.ignoreUnhandledExtHostErrors=t?.ignoreUnhandledErrors??!1,this._ignoreBuiltinCommonProperties=t?.ignoreBuiltInCommonProperties??!1,this._additionalCommonProperties=t?.additionalCommonProperties,this._sender=e,this._telemetryEnablements={isUsageEnabled:a.isUsageEnabled,isErrorsEnabled:a.isErrorsEnabled}}updateTelemetryEnablements(e,t){this._apiObject&&(this._telemetryEnablements={isUsageEnabled:e,isErrorsEnabled:t},this._onDidChangeEnableStates.fire(this._apiObject))}mixInCommonPropsAndCleanData(e){let t="properties"in e?e.properties??{}:e;return t=vOe(t,[]),this._additionalCommonProperties&&(t=dp(t,this._additionalCommonProperties)),this._ignoreBuiltinCommonProperties||(t=dp(t,this._commonProperties)),"properties"in e?e.properties=t:e=t,e}logEvent(e,t){this._sender&&(this._extension.publisher==="vscode"?e=this._extension.name+"/"+e:e=this._extension.identifier.value+"/"+e,t=this.mixInCommonPropsAndCleanData(t||{}),this._inLoggingOnlyMode||this._sender?.sendEventData(e,t),this._logger.trace(e,t))}logUsage(e,t){this._telemetryEnablements.isUsageEnabled&&this.logEvent(e,t)}logError(e,t){if(!(!this._telemetryEnablements.isErrorsEnabled||!this._sender))if(typeof e=="string")this.logEvent(e,t);else{const i={name:e.name,message:e.message,stack:e.stack,cause:e.cause},s=vOe(i,[]),r=new Error(s.message,{cause:s.cause});r.stack=s.stack,r.name=s.name,t=this.mixInCommonPropsAndCleanData(t||{}),this._inLoggingOnlyMode||this._sender.sendErrorData(r,t),this._logger.trace("exception",t)}}get apiTelemetryLogger(){if(!this._apiObject){const e=this,t={logUsage:e.logUsage.bind(e),get isUsageEnabled(){return e._telemetryEnablements.isUsageEnabled},get isErrorsEnabled(){return e._telemetryEnablements.isErrorsEnabled},logError:e.logError.bind(e),dispose:e.dispose.bind(e),onDidChangeEnableStates:e._onDidChangeEnableStates.event.bind(e)};this._apiObject=Object.freeze(t)}return this._apiObject}get isDisposed(){return!this._sender}dispose(){if(this._sender?.flush){let e=this._sender;this._sender=void 0,Promise.resolve(e.flush()).then(e=void 0),this._apiObject=void 0}else this._sender=void 0}}function Ott(n){const e=Date.now()-new Date(n).getTime();return isNaN(e)?!1:e<1e3*60*60*24}const Rle=de("IExtHostTelemetry");let ebe=class{#e;#t;#i;constructor(e,t,i){this._commands=new Map,this._apiCommands=new Map,this.#e=e.getProxy(Xe.MainThreadCommands),this._logService=t,this.#i=i,this.#t=e.getProxy(Xe.MainThreadTelemetry),this.converter=new GFt(this,s=>{const r=this._apiCommands.get(s);return r?.result===dn.Void?r:void 0},t),this._argumentProcessors=[{processArgument(s){return nr(s)}},{processArgument(s){return rI(s,function(r){if(M.isIRange(r))return ft.to(r);if(oe.isIPosition(r))return Fr.to(r);if(M.isIRange(r.range)&&N.isUri(r.uri))return fg.to(r);if(r instanceof Ye)return r.buffer.buffer;if(!Array.isArray(r))return r})}}]}registerArgumentProcessor(e){this._argumentProcessors.push(e)}registerApiCommand(e){const t=this.registerCommand(!1,e.id,async(...i)=>{const s=e.args.map((o,a)=>{if(!o.validate(i[a]))throw new Error(`Invalid argument '${o.name}' when running '${e.id}', received: ${typeof i[a]=="object"?JSON.stringify(i[a],null," "):i[a]} `);return o.convert(i[a])}),r=await this.executeCommand(e.internalId,...s);return e.result.convert(r,i,this.converter)},void 0,{description:e.description,args:e.args,returns:e.result.description});return this._apiCommands.set(e.id,e),new bs(()=>{t.dispose(),this._apiCommands.delete(e.id)})}registerCommand(e,t,i,s,r,o){if(this._logService.trace("ExtHostCommands#registerCommand",t),!t.trim().length)throw new Error("invalid id");if(this._commands.has(t))throw new Error(`command '${t}' already exists`);return this._commands.set(t,{callback:i,thisArg:s,metadata:r,extension:o}),e&&this.#e.$registerCommand(t),new bs(()=>{this._commands.delete(t)&&e&&this.#e.$unregisterCommand(t)})}executeCommand(e,...t){return this._logService.trace("ExtHostCommands#executeCommand",e),this._doExecuteCommand(e,t,!0)}async _doExecuteCommand(e,t,i){if(this._commands.has(e))return this.#e.$fireCommandActivationEvent(e),this._executeContributedCommand(e,t,!1);{let s=!1;const r=rI(t,function(o){if(o instanceof Ts)return Fr.from(o);if(o instanceof Zn)return ft.from(o);if(o instanceof cp)return fg.from(o);if(Tv.isNotebookRange(o))return ly.from(o);if(o instanceof ArrayBuffer)return s=!0,Ye.wrap(new Uint8Array(o));if(o instanceof Uint8Array)return s=!0,Ye.wrap(o);if(o instanceof Ye)return s=!0,o;if(!Array.isArray(o))return o});try{const o=await this.#e.$executeCommand(e,s?new ll(r):r,i);return nr(o)}catch(o){if(o instanceof Error&&o.message==="$executeCommand:retry")return this._doExecuteCommand(e,t,!1);throw o}}}async _executeContributedCommand(e,t,i){const s=this._commands.get(e);if(!s)throw new Error("Unknown command");const{callback:r,thisArg:o,metadata:a}=s;if(a?.args)for(let c=0;c<a.args.length;c++)try{kze(t[c],a.args[c].constraint)}catch{throw new Error(`Running the contributed command: '${e}' failed. Illegal argument '${a.args[c].name}' - ${a.args[c].description}`)}const l=sr.create();try{return await r.apply(o,t)}catch(c){if(e===this.converter.delegatingCommandId){const d=this.converter.getActualCommand(...t);d&&(e=d.command)}if(Xr(c)||this._logService.error(c,e,s.extension?.identifier),!i)throw c;if(s.extension?.identifier){const d=this.#i.onExtensionError(s.extension.identifier,c);this._logService.trace("forwarded error to extension?",d,s.extension?.identifier)}throw new class extends Error{constructor(){super(af(c)),this.id=e,this.source=s.extension?.displayName??s.extension?.name}}}finally{this._reportTelemetry(s,e,l.elapsed())}}_reportTelemetry(e,t,i){e.extension&&(t.startsWith("code.copilot.logStructured")||this.#t.$publicLog2("Extension:ActionExecuted",{extensionId:e.extension.identifier.value,id:new Aoe(t),duration:i}))}$executeContributedCommand(e,...t){this._logService.trace("ExtHostCommands#$executeContributedCommand",e);const i=this._commands.get(e);return i?(t=t.map(s=>this._argumentProcessors.reduce((r,o)=>o.processArgument(r,i.extension),s)),this._executeContributedCommand(e,t,!0)):Promise.reject(new Error(`Contributed command '${e}' does not exist.`))}getCommands(e=!1){return this._logService.trace("ExtHostCommands#getCommands",e),this.#e.$getCommands().then(t=>(e&&(t=t.filter(i=>i[0]!=="_")),t))}$getContributedCommandMetadata(){const e=Object.create(null);for(const[t,i]of this._commands){const{metadata:s}=i;s&&(e[t]=s)}return Promise.resolve(e)}};ebe=y([v(0,dr),v(1,it),v(2,Rle)],ebe);const _N=de("IExtHostCommands");class GFt{constructor(e,t,i){this._commands=e,this._lookupApiCommand=t,this._logService=i,this.delegatingCommandId=`__vsc${Tr()}`,this._cache=new Map,this._cachIdPool=0,this._commands.registerCommand(!0,this.delegatingCommandId,this._executeConvertedCommand,this)}toInternal(e,t){if(!e)return;const i={$ident:void 0,id:e.command,title:e.title,tooltip:e.tooltip};if(!e.command)return i;const s=this._lookupApiCommand(e.command);if(s)i.id=s.internalId,i.arguments=s.args.map((r,o)=>r.convert(e.arguments&&e.arguments[o]));else if(Ir(e.arguments)){const r=`${e.command} /${++this._cachIdPool}`;this._cache.set(r,e),t.add(ke(()=>{this._cache.delete(r),this._logService.trace("CommandsConverter#DISPOSE",r)})),i.$ident=r,i.id=this.delegatingCommandId,i.arguments=[r],this._logService.trace("CommandsConverter#CREATE",e.command,r)}return i}fromInternal(e){return typeof e.$ident=="string"?this._cache.get(e.$ident):{command:e.id,title:e.title,arguments:e.arguments}}getActualCommand(...e){return this._cache.get(e[0])}_executeConvertedCommand(...e){const t=this.getActualCommand(...e);return this._logService.trace("CommandsConverter#EXECUTE",e[0],t?t.command:"MISSING"),t?this._commands.executeCommand(t.command,...t.arguments||[]):Promise.reject(`Actual command not found, wanted to execute ${e[0]}`)}}const el=class el{static Arr(e){return new el(`${e.name}_array`,`Array of ${e.name}, ${e.description}`,t=>Array.isArray(t)&&t.every(i=>e.validate(i)),t=>t.map(i=>e.convert(i)))}constructor(e,t,i,s){this.name=e,this.description=t,this.validate=i,this.convert=s}optional(){return new el(this.name,`(optional) ${this.description}`,e=>e==null||this.validate(e),e=>e===void 0?void 0:e===null?null:this.convert(e))}with(e,t){return new el(e??this.name,t??this.description,this.validate,this.convert)}};el.Uri=new el("uri","Uri of a text document",e=>N.isUri(e),e=>e),el.Position=new el("position","A position in a text document",e=>Ts.isPosition(e),Fr.from),el.Range=new el("range","A range in a text document",e=>Zn.isRange(e),ft.from),el.Selection=new el("selection","A selection in a text document",e=>Bv.isSelection(e),cw.from),el.Number=new el("number","",e=>typeof e=="number",e=>e),el.String=new el("string","",e=>typeof e=="string",e=>e),el.CallHierarchyItem=new el("item","A call hierarchy item",e=>e instanceof goe,lP.from),el.TypeHierarchyItem=new el("item","A type hierarchy item",e=>e instanceof moe,f0.from),el.TestItem=new el("testItem","A VS Code TestItem",e=>e instanceof mN,CI.from),el.TestProfile=new el("testProfile","A VS Code test profile",e=>e instanceof vGe,Iwe.from);let Tt=el;const One=class One{constructor(e,t){this.description=e,this.convert=t}};One.Void=new One("no result",e=>e);let dn=One;class yn{constructor(e,t,i,s,r){this.id=e,this.internalId=t,this.description=i,this.args=s,this.result=r}}const tbe=new Map;function KFt(n,e){e?tbe.set(n,e):tbe.delete(n)}function jFt(n){return tbe.get(n)}class YFt extends uZe{constructor(e,t,i,s,r,o,a,l){super(t,i,s,r),this._proxy=e,this._languageId=o,this._isDirty=a,this._encoding=l,this._isDisposed=!1}dispose(){Hu(!this._isDisposed),this._isDisposed=!0,this._isDirty=!1}equalLines(e){return En(this._lines,e)}get document(){if(!this._document){const e=this;this._document={get uri(){return e._uri},get fileName(){return e._uri.fsPath},get isUntitled(){return e._uri.scheme===ye.untitled},get languageId(){return e._languageId},get version(){return e._versionId},get isClosed(){return e._isDisposed},get isDirty(){return e._isDirty},get encoding(){return e._encoding},save(){return e._save()},getText(t){return t?e._getTextInRange(t):e.getText()},get eol(){return e._eol===`
|
|
876
|
+
`+u+"\n```\n"}}else dg.isMarkdownString(a)?l={value:a.value,isTrusted:a.isTrusted,supportThemeIcons:a.supportThemeIcons,supportHtml:a.supportHtml,baseUri:a.baseUri}:typeof a=="string"?l={value:a}:l={value:""};const c=Object.create(null);l.uris=c;const d=({href:h})=>{try{let u=N.parse(h,!0);u=u.with({query:s(u.query,c)}),c[h]=u}catch{}return""};return $o.walkTokens($o.lexer(l.value),h=>{h.type==="link"?d({href:h.href}):h.type==="image"&&typeof h.href=="string"&&d(Eqe(h.href))}),l}n.from=i;function s(a,l){if(!a)return a;let c;try{c=pW(a)}catch{}if(!c)return a;let d=!1;return c=rI(c,h=>{if(N.isUri(h)){const u=`__uri_${Math.random().toString(16).slice(2,8)}`;return l[u]=h,d=!0,u}else return}),d?JSON.stringify(c):a}function r(a){const l=new dg(a.value,a.supportThemeIcons);return l.isTrusted=a.isTrusted,l.supportHtml=a.supportHtml,l.baseUri=a.baseUri?N.from(a.baseUri):void 0,l}n.to=r;function o(a){if(a)return typeof a=="string"?a:n.from(a)}n.fromStrict=o})(Cn||(Cn={}));function aFt(n){return ytt(n)?n.map(e=>({range:ft.from(e.range),hoverMessage:Array.isArray(e.hoverMessage)?Cn.fromMany(e.hoverMessage):e.hoverMessage?Cn.from(e.hoverMessage):void 0,renderOptions:e.renderOptions})):n.map(e=>({range:ft.from(e)}))}function Tle(n){return typeof n>"u"?n:typeof n=="string"?N.file(n):n}var qW;(function(n){function e(t){return typeof t>"u"?t:{contentText:t.contentText,contentIconPath:t.contentIconPath?Tle(t.contentIconPath):void 0,border:t.border,borderColor:t.borderColor,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textDecoration:t.textDecoration,color:t.color,backgroundColor:t.backgroundColor,margin:t.margin,width:t.width,height:t.height}}n.from=e})(qW||(qW={}));var gZ;(function(n){function e(t){return typeof t>"u"?t:{backgroundColor:t.backgroundColor,outline:t.outline,outlineColor:t.outlineColor,outlineStyle:t.outlineStyle,outlineWidth:t.outlineWidth,border:t.border,borderColor:t.borderColor,borderRadius:t.borderRadius,borderSpacing:t.borderSpacing,borderStyle:t.borderStyle,borderWidth:t.borderWidth,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textDecoration:t.textDecoration,cursor:t.cursor,color:t.color,opacity:t.opacity,letterSpacing:t.letterSpacing,gutterIconPath:t.gutterIconPath?Tle(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?qW.from(t.before):void 0,after:t.after?qW.from(t.after):void 0}}n.from=e})(gZ||(gZ={}));var dwe;(function(n){function e(t){if(typeof t>"u")return t;switch(t){case gD.OpenOpen:return yi.AlwaysGrowsWhenTypingAtEdges;case gD.ClosedClosed:return yi.NeverGrowsWhenTypingAtEdges;case gD.OpenClosed:return yi.GrowsOnlyWhenTypingBefore;case gD.ClosedOpen:return yi.GrowsOnlyWhenTypingAfter}}n.from=e})(dwe||(dwe={}));var hwe;(function(n){function e(t){return{isWholeLine:t.isWholeLine,rangeBehavior:t.rangeBehavior?dwe.from(t.rangeBehavior):void 0,overviewRulerLane:t.overviewRulerLane,light:t.light?gZ.from(t.light):void 0,dark:t.dark?gZ.from(t.dark):void 0,backgroundColor:t.backgroundColor,outline:t.outline,outlineColor:t.outlineColor,outlineStyle:t.outlineStyle,outlineWidth:t.outlineWidth,border:t.border,borderColor:t.borderColor,borderRadius:t.borderRadius,borderSpacing:t.borderSpacing,borderStyle:t.borderStyle,borderWidth:t.borderWidth,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textDecoration:t.textDecoration,cursor:t.cursor,color:t.color,opacity:t.opacity,letterSpacing:t.letterSpacing,gutterIconPath:t.gutterIconPath?Tle(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?qW.from(t.before):void 0,after:t.after?qW.from(t.after):void 0}}n.from=e})(hwe||(hwe={}));var Vc;(function(n){function e(i){return{text:i.newText,eol:i.newEol&&jW.from(i.newEol),range:ft.from(i.range)}}n.from=e;function t(i){const s=new EE(ft.to(i.range),i.text);return s.newEol=typeof i.eol>"u"?void 0:jW.to(i.eol),s}n.to=t})(Vc||(Vc={}));var pp;(function(n){function e(i,s){const r={edits:[]};if(i instanceof tI){const o=new b2;for(const a of i._allEntries())a._type===wl.File&&N.isUri(a.to)&&a.from===void 0&&o.add(a.to);for(const a of i._allEntries())if(a._type===wl.File){let l;a.options?.contents&&(ArrayBuffer.isView(a.options.contents)?l={type:"base64",value:PP(Ye.wrap(a.options.contents))}:l={type:"dataTransferItem",id:a.options.contents._itemId}),r.edits.push({oldResource:a.from,newResource:a.to,options:{...a.options,contents:l},metadata:a.metadata})}else a._type===wl.Text?r.edits.push({resource:a.uri,textEdit:Vc.from(a.edit),versionId:o.has(a.uri)?void 0:s?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===wl.Snippet?r.edits.push({resource:a.uri,textEdit:{range:ft.from(a.range),text:a.edit.value,insertAsSnippet:!0,keepWhitespace:a.keepWhitespace},versionId:o.has(a.uri)?void 0:s?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===wl.Cell?r.edits.push({metadata:a.metadata,resource:a.uri,cellEdit:a.edit,notebookVersionId:s?.getNotebookDocumentVersion(a.uri)}):a._type===wl.CellReplace&&r.edits.push({metadata:a.metadata,resource:a.uri,notebookVersionId:s?.getNotebookDocumentVersion(a.uri),cellEdit:{editType:Wv.Replace,index:a.index,count:a.count,cells:a.cells.map(XW.from)}})}return r}n.from=e;function t(i){const s=new tI,r=new Ni;for(const o of i.edits)if(o.textEdit){const a=o,l=N.revive(a.resource),c=ft.to(a.textEdit.range),d=a.textEdit.text,h=a.textEdit.insertAsSnippet;let u;h?u=foe.replace(c,new iI(d)):u=EE.replace(c,d);const g=r.get(l);g?g.push(u):r.set(l,[u])}else s.renameFile(N.revive(o.oldResource),N.revive(o.newResource),o.options);for(const[o,a]of r)s.set(o,a);return s}n.to=t})(pp||(pp={}));var A_;(function(n){const e=Object.create(null);e[Lo.File]=lt.File,e[Lo.Module]=lt.Module,e[Lo.Namespace]=lt.Namespace,e[Lo.Package]=lt.Package,e[Lo.Class]=lt.Class,e[Lo.Method]=lt.Method,e[Lo.Property]=lt.Property,e[Lo.Field]=lt.Field,e[Lo.Constructor]=lt.Constructor,e[Lo.Enum]=lt.Enum,e[Lo.Interface]=lt.Interface,e[Lo.Function]=lt.Function,e[Lo.Variable]=lt.Variable,e[Lo.Constant]=lt.Constant,e[Lo.String]=lt.String,e[Lo.Number]=lt.Number,e[Lo.Boolean]=lt.Boolean,e[Lo.Array]=lt.Array,e[Lo.Object]=lt.Object,e[Lo.Key]=lt.Key,e[Lo.Null]=lt.Null,e[Lo.EnumMember]=lt.EnumMember,e[Lo.Struct]=lt.Struct,e[Lo.Event]=lt.Event,e[Lo.Operator]=lt.Operator,e[Lo.TypeParameter]=lt.TypeParameter;function t(s){return typeof e[s]=="number"?e[s]:lt.Property}n.from=t;function i(s){for(const r in e)if(e[r]===s)return Number(r);return Lo.Property}n.to=i})(A_||(A_={}));var FE;(function(n){function e(i){if(i===P2.Deprecated)return h7.Deprecated}n.from=e;function t(i){if(i===h7.Deprecated)return P2.Deprecated}n.to=t})(FE||(FE={}));var aP;(function(n){function e(i){return{name:i.name,kind:A_.from(i.kind),tags:i.tags&&i.tags.map(FE.from),containerName:i.containerName,location:fg.from(i.location)}}n.from=e;function t(i){const s=new N2(i.name,A_.to(i.kind),i.containerName,fg.to(i.location));return s.tags=i.tags&&i.tags.map(FE.to),s}n.to=t})(aP||(aP={}));var uwe;(function(n){function e(i){const s={name:i.name||"!!MISSING: name!!",detail:i.detail,range:ft.from(i.range),selectionRange:ft.from(i.selectionRange),kind:A_.from(i.kind),tags:i.tags?.map(FE.from)??[]};return i.children&&(s.children=i.children.map(e)),s}n.from=e;function t(i){const s=new M2(i.name,i.detail,A_.to(i.kind),ft.to(i.range),ft.to(i.selectionRange));return Ir(i.tags)&&(s.tags=i.tags.map(FE.to)),i.children&&(s.children=i.children.map(t)),s}n.to=t})(uwe||(uwe={}));var lP;(function(n){function e(i){const s=new goe(A_.to(i.kind),i.name,i.detail||"",N.revive(i.uri),ft.to(i.range),ft.to(i.selectionRange));return s._sessionId=i._sessionId,s._itemId=i._itemId,s}n.to=e;function t(i,s,r){if(s=s??i._sessionId,r=r??i._itemId,s===void 0||r===void 0)throw new Error("invalid item");return{_sessionId:s,_itemId:r,name:i.name,detail:i.detail,kind:A_.from(i.kind),uri:i.uri,range:ft.from(i.range),selectionRange:ft.from(i.selectionRange),tags:i.tags?.map(FE.from)}}n.from=t})(lP||(lP={}));var fwe;(function(n){function e(t){return new ALe(lP.to(t.from),t.fromRanges.map(i=>ft.to(i)))}n.to=e})(fwe||(fwe={}));var gwe;(function(n){function e(t){return new PLe(lP.to(t.to),t.fromRanges.map(i=>ft.to(i)))}n.to=e})(gwe||(gwe={}));var fg;(function(n){function e(i){return{range:i.range&&ft.from(i.range),uri:i.uri}}n.from=e;function t(i){return new cp(N.revive(i.uri),ft.to(i.range))}n.to=t})(fg||(fg={}));var u8;(function(n){function e(i){const s=i,r=i;return{originSelectionRange:s.originSelectionRange?ft.from(s.originSelectionRange):void 0,uri:s.targetUri?s.targetUri:r.uri,range:ft.from(s.targetRange?s.targetRange:r.range),targetSelectionRange:s.targetSelectionRange?ft.from(s.targetSelectionRange):void 0}}n.from=e;function t(i){return{targetUri:N.revive(i.uri),targetRange:ft.to(i.range),targetSelectionRange:i.targetSelectionRange?ft.to(i.targetSelectionRange):void 0,originSelectionRange:i.originSelectionRange?ft.to(i.originSelectionRange):void 0}}n.to=t})(u8||(u8={}));var f8;(function(n){function e(i){return{range:ft.from(i.range),contents:Cn.fromMany(i.contents),canIncreaseVerbosity:i.canIncreaseVerbosity,canDecreaseVerbosity:i.canDecreaseVerbosity}}n.from=e;function t(i){const s=i.contents.map(Cn.to),r=ft.to(i.range),o=i.canIncreaseVerbosity,a=i.canDecreaseVerbosity;return new i$(s,r,o,a)}n.to=t})(f8||(f8={}));var pwe;(function(n){function e(i){return{range:ft.from(i.range),expression:i.expression}}n.from=e;function t(i){return new v$(ft.to(i.range),i.expression)}n.to=t})(pwe||(pwe={}));var pZ;(function(n){function e(i){if(i instanceof w$)return{type:"text",range:ft.from(i.range),text:i.text};if(i instanceof b$)return{type:"variable",range:ft.from(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};if(i instanceof y$)return{type:"expression",range:ft.from(i.range),expression:i.expression};throw new Error("Unknown 'InlineValue' type")}n.from=e;function t(i){switch(i.type){case"text":return{range:ft.to(i.range),text:i.text};case"variable":return{range:ft.to(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};case"expression":return{range:ft.to(i.range),expression:i.expression}}}n.to=t})(pZ||(pZ={}));var mZ;(function(n){function e(i){return{frameId:i.frameId,stoppedLocation:ft.from(i.stoppedLocation)}}n.from=e;function t(i){return new wfe(i.frameId,ft.to(i.stoppedLocation))}n.to=t})(mZ||(mZ={}));var GW;(function(n){function e(i){return{range:ft.from(i.range),kind:i.kind}}n.from=e;function t(i){return new n$(ft.to(i.range),i.kind)}n.to=t})(GW||(GW={}));var mwe;(function(n){function e(i){return{uri:i.uri,highlights:i.highlights.map(GW.from)}}n.from=e;function t(i){return new s$(N.revive(i.uri),i.highlights.map(GW.to))}n.to=t})(mwe||(mwe={}));var _we;(function(n){function e(t){switch(t){case Xu.TriggerCharacter:return L1.TriggerCharacter;case Xu.TriggerForIncompleteCompletions:return L1.TriggerForIncompleteCompletions;case Xu.Invoke:default:return L1.Invoke}}n.to=e})(_we||(_we={}));var vwe;(function(n){function e(t){return{triggerKind:_we.to(t.triggerKind),triggerCharacter:t.triggerCharacter}}n.to=e})(vwe||(vwe={}));var _Z;(function(n){function e(i){if(i===B2.Deprecated)return _W.Deprecated}n.from=e;function t(i){if(i===_W.Deprecated)return B2.Deprecated}n.to=t})(_Z||(_Z={}));var wwe;(function(n){function e(t,i,s){return"icon"in t&&"command"in t?{command:i.toInternal(t.command,s),icon:qZ.fromThemeIcon(t.icon)}:{command:i.toInternal(t,s)}}n.from=e})(wwe||(wwe={}));var vZ;(function(n){const e=new Map([[cn.Method,Pe.Method],[cn.Function,Pe.Function],[cn.Constructor,Pe.Constructor],[cn.Field,Pe.Field],[cn.Variable,Pe.Variable],[cn.Class,Pe.Class],[cn.Interface,Pe.Interface],[cn.Struct,Pe.Struct],[cn.Module,Pe.Module],[cn.Property,Pe.Property],[cn.Unit,Pe.Unit],[cn.Value,Pe.Value],[cn.Constant,Pe.Constant],[cn.Enum,Pe.Enum],[cn.EnumMember,Pe.EnumMember],[cn.Keyword,Pe.Keyword],[cn.Snippet,Pe.Snippet],[cn.Text,Pe.Text],[cn.Color,Pe.Color],[cn.File,Pe.File],[cn.Reference,Pe.Reference],[cn.Folder,Pe.Folder],[cn.Event,Pe.Event],[cn.Operator,Pe.Operator],[cn.TypeParameter,Pe.TypeParameter],[cn.Issue,Pe.Issue],[cn.User,Pe.User]]);function t(r){return e.get(r)??Pe.Property}n.from=t;const i=new Map([[Pe.Method,cn.Method],[Pe.Function,cn.Function],[Pe.Constructor,cn.Constructor],[Pe.Field,cn.Field],[Pe.Variable,cn.Variable],[Pe.Class,cn.Class],[Pe.Interface,cn.Interface],[Pe.Struct,cn.Struct],[Pe.Module,cn.Module],[Pe.Property,cn.Property],[Pe.Unit,cn.Unit],[Pe.Value,cn.Value],[Pe.Constant,cn.Constant],[Pe.Enum,cn.Enum],[Pe.EnumMember,cn.EnumMember],[Pe.Keyword,cn.Keyword],[Pe.Snippet,cn.Snippet],[Pe.Text,cn.Text],[Pe.Color,cn.Color],[Pe.File,cn.File],[Pe.Reference,cn.Reference],[Pe.Folder,cn.Folder],[Pe.Event,cn.Event],[Pe.Operator,cn.Operator],[Pe.TypeParameter,cn.TypeParameter],[Pe.User,cn.User],[Pe.Issue,cn.Issue]]);function s(r){return i.get(r)??cn.Property}n.to=s})(vZ||(vZ={}));var bwe;(function(n){function e(t,i){const s=new l$(t.label);return s.insertText=t.insertText,s.kind=vZ.to(t.kind),s.tags=t.tags?.map(_Z.to),s.detail=t.detail,s.documentation=md(t.documentation)?Cn.to(t.documentation):t.documentation,s.sortText=t.sortText,s.filterText=t.filterText,s.preselect=t.preselect,s.commitCharacters=t.commitCharacters,M.isIRange(t.range)?s.range=ft.to(t.range):typeof t.range=="object"&&(s.range={inserting:ft.to(t.range.insert),replacing:ft.to(t.range.replace)}),s.keepWhitespace=typeof t.insertTextRules>"u"?!1:!!(t.insertTextRules&Jf.KeepWhitespace),typeof t.insertTextRules<"u"&&t.insertTextRules&Jf.InsertAsSnippet?s.insertText=new iI(t.insertText):(s.insertText=t.insertText,s.textEdit=s.range instanceof Zn?new EE(s.range,s.insertText):void 0),t.additionalTextEdits&&t.additionalTextEdits.length>0&&(s.additionalTextEdits=t.additionalTextEdits.map(r=>Vc.to(r))),s.command=i&&t.command?i.fromInternal(t.command):void 0,s}n.to=e})(bwe||(bwe={}));var wZ;(function(n){function e(i){if(typeof i.label!="string"&&!Array.isArray(i.label))throw new TypeError("Invalid label");return{label:i.label,documentation:Cn.fromStrict(i.documentation)}}n.from=e;function t(i){return{label:i.label,documentation:md(i.documentation)?Cn.to(i.documentation):i.documentation}}n.to=t})(wZ||(wZ={}));var bZ;(function(n){function e(i){return{label:i.label,documentation:Cn.fromStrict(i.documentation),parameters:Array.isArray(i.parameters)?i.parameters.map(wZ.from):[],activeParameter:i.activeParameter}}n.from=e;function t(i){return{label:i.label,documentation:md(i.documentation)?Cn.to(i.documentation):i.documentation,parameters:Array.isArray(i.parameters)?i.parameters.map(wZ.to):[],activeParameter:i.activeParameter}}n.to=t})(bZ||(bZ={}));var g8;(function(n){function e(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map(bZ.from):[]}}n.from=e;function t(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map(bZ.to):[]}}n.to=t})(g8||(g8={}));var ywe;(function(n){function e(t,i){const s=new a$(Fr.to(i.position),typeof i.label=="string"?i.label:i.label.map(Swe.to.bind(void 0,t)),i.kind&&yZ.to(i.kind));return s.textEdits=i.textEdits&&i.textEdits.map(Vc.to),s.tooltip=md(i.tooltip)?Cn.to(i.tooltip):i.tooltip,s.paddingLeft=i.paddingLeft,s.paddingRight=i.paddingRight,s}n.to=e})(ywe||(ywe={}));var Swe;(function(n){function e(t,i){const s=new o$(i.label);return s.tooltip=md(i.tooltip)?Cn.to(i.tooltip):i.tooltip,bX.is(i.command)&&(s.command=t.fromInternal(i.command)),i.location&&(s.location=fg.to(i.location)),s}n.to=e})(Swe||(Swe={}));var yZ;(function(n){function e(i){return i}n.from=e;function t(i){return i}n.to=t})(yZ||(yZ={}));var u0;(function(n){function e(i){return{range:ft.from(i.range),url:i.target,tooltip:i.tooltip}}n.from=e;function t(i){let s;if(i.url)try{s=typeof i.url=="string"?N.parse(i.url,!0):N.revive(i.url)}catch{}const r=new d$(ft.to(i.range),s);return r.tooltip=i.tooltip,r}n.to=t})(u0||(u0={}));var SZ;(function(n){function e(i){const s=new u$(i.label);return i.textEdit&&(s.textEdit=Vc.to(i.textEdit)),i.additionalTextEdits&&(s.additionalTextEdits=i.additionalTextEdits.map(r=>Vc.to(r))),s}n.to=e;function t(i){return{label:i.label,textEdit:i.textEdit?Vc.from(i.textEdit):void 0,additionalTextEdits:i.additionalTextEdits?i.additionalTextEdits.map(s=>Vc.from(s)):void 0}}n.from=t})(SZ||(SZ={}));var KW;(function(n){function e(i){return new RA(i[0],i[1],i[2],i[3])}n.to=e;function t(i){return[i.red,i.green,i.blue,i.alpha]}n.from=t})(KW||(KW={}));var Cwe;(function(n){function e(i){return{range:ft.from(i.range)}}n.from=e;function t(i){return new W2(ft.to(i.range))}n.to=t})(Cwe||(Cwe={}));var CZ;(function(n){function e(t){switch(t){case $r.AUTO:return R1.AfterDelay;case $r.EXPLICIT:return R1.Manual;case $r.FOCUS_CHANGE:case $r.WINDOW_CHANGE:return R1.FocusOut}}n.to=e})(CZ||(CZ={}));var fF;(function(n){function e(i){switch(i){case Km.Off:return vr.Off;case Km.Relative:return vr.Relative;case Km.Interval:return vr.Interval;case Km.On:default:return vr.On}}n.from=e;function t(i){switch(i){case vr.Off:return Km.Off;case vr.Relative:return Km.Relative;case vr.Interval:return Km.Interval;case vr.On:default:return Km.On}}n.to=t})(fF||(fF={}));var jW;(function(n){function e(i){if(i===u_.CRLF)return Kd.CRLF;if(i===u_.LF)return Kd.LF}n.from=e;function t(i){if(i===Kd.CRLF)return u_.CRLF;if(i===Kd.LF)return u_.LF}n.to=t})(jW||(jW={}));var EZ;(function(n){function e(t){if(typeof t=="object")return t.viewId;switch(t){case eE.SourceControl:return cm.Scm;case eE.Window:return cm.Window;case eE.Notification:return cm.Notification}throw new Error("Unknown 'ProgressLocation'")}n.from=e})(EZ||(EZ={}));var xZ;(function(n){function e(i){const s={start:i.start+1,end:i.end+1};return i.kind&&(s.kind=DZ.from(i.kind)),s}n.from=e;function t(i){const s={start:i.start-1,end:i.end-1};return i.kind&&(s.kind=DZ.to(i.kind)),s}n.to=t})(xZ||(xZ={}));var DZ;(function(n){function e(i){if(i)switch(i){case pb.Comment:return Kp.Comment;case pb.Imports:return Kp.Imports;case pb.Region:return Kp.Region}}n.from=e;function t(i){if(i)switch(i.value){case Kp.Comment.value:return pb.Comment;case Kp.Imports.value:return pb.Imports;case Kp.Region.value:return pb.Region}}n.to=t})(DZ||(DZ={}));var T5;(function(n){function e(t){if(t)return{pinned:typeof t.preview=="boolean"?!t.preview:void 0,inactive:t.background,preserveFocus:t.preserveFocus,selection:typeof t.selection=="object"?ft.from(t.selection):void 0,override:typeof t.override=="boolean"?nk.id:void 0}}n.from=e})(T5||(T5={}));var Kg;(function(n){function e(r){return r instanceof N1?r.toJSON():typeof r=="string"?r:t(r)||i(r)?new N1(r.baseUri??r.base,r.pattern).toJSON():r}n.from=e;function t(r){const o=r;return o?N.isUri(o.baseUri)&&typeof o.pattern=="string":!1}function i(r){const o=r;return o?typeof o.base=="string"&&typeof o.pattern=="string":!1}function s(r){return typeof r=="string"?r:new N1(N.revive(r.baseUri),r.pattern)}n.to=s})(Kg||(Kg={}));var Ewe;(function(n){function e(t){if(t){if(Array.isArray(t))return t.map(e);if(typeof t=="string")return t;{const i=t;return{language:i.language,scheme:i.scheme,pattern:Kg.from(i.pattern)??void 0,exclusive:i.exclusive,notebookType:i.notebookType}}}else return}n.from=e})(Ewe||(Ewe={}));var ly;(function(n){function e(i){return{start:i.start,end:i.end}}n.from=e;function t(i){return new Tv(i.start,i.end)}n.to=t})(ly||(ly={}));var YW;(function(n){function e(i){return{timing:typeof i.runStartTime=="number"&&typeof i.runEndTime=="number"?{startTime:i.runStartTime,endTime:i.runEndTime}:void 0,executionOrder:i.executionOrder,success:i.lastRunSuccess}}n.to=e;function t(i){return{lastRunSuccess:i.success,runStartTime:i.timing?.startTime,runEndTime:i.timing?.endTime,executionOrder:i.executionOrder}}n.from=t})(YW||(YW={}));var p8;(function(n){function e(i){switch(i){case _D.Markup:return xM.Markup;case _D.Code:default:return xM.Code}}n.from=e;function t(i){switch(i){case xM.Markup:return _D.Markup;case xM.Code:default:return _D.Code}}n.to=t})(p8||(p8={}));var Mx;(function(n){function e(i){const s={metadata:i.metadata??Object.create(null),cells:[]};for(const r of i.cells)J9.validate(r),s.cells.push(XW.from(r));return s}n.from=e;function t(i){const s=new FLe(i.cells.map(XW.to));return qk(i.metadata)||(s.metadata=i.metadata),s}n.to=t})(Mx||(Mx={}));var XW;(function(n){function e(i){return{cellKind:p8.from(i.kind),language:i.languageId,mime:i.mime,source:i.value,metadata:i.metadata,internalMetadata:YW.from(i.executionSummary??{}),outputs:i.outputs?i.outputs.map(SI.from):[]}}n.from=e;function t(i){return new J9(p8.to(i.cellKind),i.source,i.language,i.mime,i.outputs?i.outputs.map(SI.to):void 0,i.metadata,i.internalMetadata?YW.to(i.internalMetadata):void 0)}n.to=t})(XW||(XW={}));var QW;(function(n){function e(i){return{mime:i.mime,valueBytes:Ye.wrap(i.data)}}n.from=e;function t(i){return new WLe(i.valueBytes.buffer,i.mime)}n.to=t})(QW||(QW={}));var SI;(function(n){function e(i){return{outputId:i.id,items:i.items.map(QW.from),metadata:i.metadata}}n.from=e;function t(i){const s=i.items.map(QW.to);return new E$(s,i.outputId,i.metadata)}n.to=t})(SI||(SI={}));var kZ;(function(n){function e(s){return i(s)?{include:Kg.from(s.include)??void 0,exclude:Kg.from(s.exclude)??void 0}:Kg.from(s)??void 0}n.from=e;function t(s){return i(s)?{include:Kg.to(s.include),exclude:Kg.to(s.exclude)}:Kg.to(s)}n.to=t;function i(s){const r=s;return r?!bo(r.include)&&!bo(r.exclude):!1}})(kZ||(kZ={}));var xwe;(function(n){function e(t,i,s){const r=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{alignment:t.alignment===x$.Left?jj.Left:jj.Right,command:i.toInternal(r,s),text:t.text,tooltip:t.tooltip,accessibilityInformation:t.accessibilityInformation,priority:t.priority}}n.from=e})(xwe||(xwe={}));var Dwe;(function(n){function e(t,i,s){const r=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{command:i.toInternal(r,s),label:t.label,description:t.description,detail:t.detail,documentation:t.documentation}}n.from=e})(Dwe||(Dwe={}));var kwe;(function(n){function e(t){return{transientOutputs:t?.transientOutputs??!1,transientCellMetadata:t?.transientCellMetadata??{},transientDocumentMetadata:t?.transientDocumentMetadata??{},cellContentMetadata:t?.cellContentMetadata??{}}}n.from=e})(kwe||(kwe={}));var IZ;(function(n){function e(i){return{uri:i.uri,provides:i.provides}}n.from=e;function t(i){return new BLe(N.revive(i.uri),i.provides)}n.to=t})(IZ||(IZ={}));var ZW;(function(n){function e(i){return{message:Cn.fromStrict(i.message)||"",type:S_.Error,expected:i.expectedOutput,actual:i.actualOutput,contextValue:i.contextValue,location:i.location&&{range:ft.from(i.location.range),uri:i.location.uri},stackTrace:i.stackTrace?.map(s=>({label:s.label,position:s.position&&Fr.from(s.position),uri:s.uri&&N.revive(s.uri).toJSON()}))}}n.from=e;function t(i){const s=new L$(typeof i.message=="string"?i.message:Cn.to(i.message));return s.actualOutput=i.actual,s.expectedOutput=i.expected,s.contextValue=i.contextValue,s.location=i.location?fg.to(i.location):void 0,s}n.to=t})(ZW||(ZW={}));var dw;(function(n){n.namespace=LK,n.denamespace=wtt})(dw||(dw={}));var Iwe;(function(n){function e(t){return{controllerId:t.controllerId,profileId:t.profileId,group:JW.from(t.kind)}}n.from=e})(Iwe||(Iwe={}));var JW;(function(n){const e={[W1.Coverage]:Bc.Coverage,[W1.Debug]:Bc.Debug,[W1.Run]:Bc.Run};function t(i){return e.hasOwnProperty(i)?e[i]:Bc.Run}n.from=t})(JW||(JW={}));var CI;(function(n){function e(i){const s=Ile(i).controllerId;return{extId:Rn.fromExtHostTestItem(i,s).toString(),label:i.label,uri:N.revive(i.uri),busy:i.busy,tags:i.tags.map(r=>dw.namespace(s,r.id)),range:M.lift(ft.from(i.range)),description:i.description||null,sortText:i.sortText||null,error:i.error&&Cn.fromStrict(i.error)||null}}n.from=e;function t(i){return{parent:void 0,error:void 0,id:Rn.fromString(i.extId).localId,label:i.label,uri:N.revive(i.uri),tags:(i.tags||[]).map(s=>{const{tagId:r}=dw.denamespace(s);return new tW(r)}),children:{add:()=>{},delete:()=>{},forEach:()=>{},*[Symbol.iterator](){},get:()=>{},replace:()=>{},size:0},range:ft.to(i.range||void 0),canResolveChildren:!1,busy:i.busy,description:i.description||void 0,sortText:i.sortText||void 0}}n.toPlain=t})(CI||(CI={}));(function(n){function e(i){return{id:i.id}}n.from=e;function t(i){return new tW(i.id)}n.to=t})(dw||(dw={}));var Twe;(function(n){const e=(i,s)=>{const r=i.value;if(!r)return;const o={...CI.toPlain(r.item),parent:s,taskStates:r.tasks.map(a=>({state:a.state,duration:a.duration,messages:a.messages.filter(l=>l.type===S_.Error).map(ZW.to)})),children:[]};if(i.children)for(const a of i.children.values()){const l=e(a,o);l&&o.children.push(l)}return o};function t(i){const s=new tZ;for(const a of i.items)s.insert(Rn.fromString(a.item.extId).path,a);const r=[s.nodes],o=[];for(;r.length;)for(const a of r.pop())a.value?o.push(a):a.children&&r.push(a.children.values());return{completedAt:i.completedAt,results:o.map(a=>e(a)).filter(yo)}}n.to=t})(Twe||(Twe={}));var m8;(function(n){function e(a){return{covered:a.covered,total:a.total}}function t(a){return"line"in a?Fr.from(a):ft.from(a)}function i(a){if(a)return"endLineNumber"in a?ft.to(a):Fr.to(a)}function s(a){if(a.type===h0.Statement){const l=[];if(a.branches)for(const c of a.branches)l.push({executed:c.count,location:i(c.location),label:c.label});return new HLe(a.count,i(a.location),a.branches?.map(c=>new VLe(c.count,i(c.location),c.label)))}else return new ULe(a.name,a.count,i(a.location))}n.to=s;function r(a){if(typeof a.executed=="number"&&a.executed<0)throw new Error(`Invalid coverage count ${a.executed}`);return"branches"in a?{count:a.executed,location:t(a.location),type:h0.Statement,branches:a.branches.length?a.branches.map(l=>({count:l.executed,location:l.location&&t(l.location),label:l.label})):void 0}:{type:h0.Declaration,name:a.name,count:a.executed,location:t(a.location)}}n.fromDetails=r;function o(a,l,c){return XG(c.statementCoverage),XG(c.branchCoverage),XG(c.declarationCoverage),{id:l,uri:c.uri,statement:e(c.statementCoverage),branch:c.branchCoverage&&e(c.branchCoverage),declaration:c.declarationCoverage&&e(c.declarationCoverage),testIds:c instanceof R$&&c.includesTests.length?c.includesTests.map(d=>Rn.fromExtHostTestItem(d,a).toString()):void 0}}n.fromFile=o})(m8||(m8={}));var Lwe;(function(n){function e(t){switch(t){case zd.Invoke:return O2.Invoke;case zd.Auto:return O2.Automatic}}n.to=e})(Lwe||(Lwe={}));var f0;(function(n){function e(i){const s=new moe(A_.to(i.kind),i.name,i.detail||"",N.revive(i.uri),ft.to(i.range),ft.to(i.selectionRange));return s._sessionId=i._sessionId,s._itemId=i._itemId,s}n.to=e;function t(i,s,r){if(s=s??i._sessionId,r=r??i._itemId,s===void 0||r===void 0)throw new Error("invalid item");return{_sessionId:s,_itemId:r,kind:A_.from(i.kind),name:i.name,detail:i.detail??"",uri:i.uri,range:ft.from(i.range),selectionRange:ft.from(i.selectionRange),tags:i.tags?.map(FE.from)}}n.from=t})(f0||(f0={}));var TZ;(function(n){function e(t){if(t)return{value:t.value,tooltip:t.tooltip}}n.from=e})(TZ||(TZ={}));var g0;(function(n){function e(r,o,a){const l=o.fileData;return l?new cut(new dut(l.name,N.revive(l.uri),l.id,C_(()=>a(l.id)))):r===zs.uriList&&o.uriListData?new hY(s(o.uriListData)):new hY(o.asString)}n.to=e;async function t(r,o,a=Tr()){const l=await o.asString();if(r===zs.uriList)return{id:a,asString:l,fileData:void 0,uriListData:i(l)};const c=o.asFile();return{id:a,asString:l,fileData:c?{name:c.name,uri:c.uri,id:c._itemId??c.id}:void 0}}n.from=t;function i(r){return OE.split(r).map(o=>{if(o.startsWith("#"))return o;try{return N.parse(o)}catch{}return o})}function s(r){return OE.create(r.map(o=>typeof o=="string"?o:N.revive(o)))}})(g0||(g0={}));var Ty;(function(n){function e(s,r){const o=s.items.map(([a,l])=>[a,g0.to(a,l,r)]);return new PA(o)}n.toDataTransfer=e;async function t(s){return{items:await Promise.all(Array.from(s,async([o,a])=>[o,await g0.from(o,a)]))}}n.from=t;async function i(s){return{items:await Promise.all(Array.from(s,async([o,a])=>[o,await g0.from(o,a,a.id)]))}}n.fromList=i})(Ty||(Ty={}));var LZ;(function(n){function e(i,s){return{kind:"reply",agentId:i.participant??s?.agentId??"",subCommand:i.command??s?.command,message:i.prompt,title:i.label}}n.from=e;function t(i){return{prompt:i.message,label:i.title,participant:i.agentId,command:i.subCommand}}n.to=t})(LZ||(LZ={}));var eB;(function(n){function e(i){switch(i){case RS.System:return qf.System;case RS.User:return qf.User;case RS.Assistant:return qf.Assistant}}n.to=e;function t(i){switch(i){case qf.System:return RS.System;case qf.User:return RS.User;case qf.Assistant:return RS.Assistant}return RS.User}n.from=t})(eB||(eB={}));var gVe;(function(n){function e(i){const s=i.content.map(a=>{if(a.type==="text")return new Ma(a.value,a.audience);if(a.type==="tool_result"){const l=a.value.map(c=>c.type==="text"?new Ma(c.value,c.audience):new Jv(c.value));return new O$(a.toolCallId,l,a.isError)}else{if(a.type==="image_url")return;if(a.type==="tool_use")return new sI(a.toolCallId,a.name,a.parameters)}}).filter(a=>a!==void 0),r=eB.to(i.role);return new e1e(r,s,i.name)}n.to=e;function t(i){const s=eB.from(i.role),r=i.name;let o=i.content;typeof o=="string"&&(o=[new Ma(o)]);const a=o.map(l=>{if(l instanceof O$)return{type:"tool_result",toolCallId:l.callId,value:vn(l.content.map(c=>c instanceof Ma?{type:"text",value:c.value,audience:c.audience}:c instanceof Jv?{type:"prompt_tsx",value:c.value}:void 0)),isError:l.isError};if(l instanceof sI)return{type:"tool_use",toolCallId:l.callId,name:l.name,parameters:l.input};if(l instanceof Ma)return{type:"text",value:l.value};if(typeof l!="string")throw new Error("Unexpected chat message content type");return{type:"text",value:l}});return{role:s,name:r,content:a}}n.from=t})(gVe||(gVe={}));var RZ;(function(n){function e(i){const s=i.content.map(a=>{if(a.type==="text")return new Ma(a.value,a.audience);if(a.type==="tool_result"){const l=a.value.map(c=>c.type==="text"?new Ma(c.value,c.audience):c.type==="data"?new a_(c.value.data.buffer,c.value.mimeType):new Jv(c.value));return new AY(a.toolCallId,l,a.isError)}else return a.type==="image_url"?new a_(a.value.data.buffer,a.value.mimeType):a.type==="data"?new a_(a.data.buffer,a.mimeType):new sI(a.toolCallId,a.name,a.parameters)}),r=eB.to(i.role);return new t1e(r,s,i.name)}n.to=e;function t(i){const s=eB.from(i.role),r=i.name;let o=i.content;typeof o=="string"&&(o=[new Ma(o)]);const a=o.map(l=>{if(l instanceof AY||l instanceof O$)return{type:"tool_result",toolCallId:l.callId,value:vn(l.content.map(c=>c instanceof Ma?{type:"text",value:c.value,audience:c.audience}:c instanceof Jv?{type:"prompt_tsx",value:c.value}:c instanceof a_?{type:"data",value:{mimeType:c.mimeType,data:Ye.wrap(c.data)},audience:c.audience}:void 0)),isError:l.isError};if(l instanceof a_)return lFt(l)?{type:"image_url",value:{mimeType:l.mimeType,data:Ye.wrap(l.data)}}:{type:"data",mimeType:l.mimeType,data:Ye.wrap(l.data),audience:l.audience};if(l instanceof sI)return{type:"tool_use",toolCallId:l.callId,name:l.name,parameters:l.input};if(l instanceof Ma)return{type:"text",value:l.value};if(typeof l!="string")throw new Error("Unexpected chat message content type llm 2");return{type:"text",value:l}});return{role:s,name:r,content:a}}n.from=t})(RZ||(RZ={}));function lFt(n){switch(n.mimeType){case tC.PNG:case tC.JPEG:case tC.GIF:case tC.WEBP:case tC.BMP:return!0;default:return!1}}var _8;(function(n){function e(i){return{kind:"markdownContent",content:Cn.from(i.value)}}n.from=e;function t(i){return new e6(Cn.to(i.content))}n.to=t})(_8||(_8={}));var AZ;(function(n){function e(i){return{kind:"codeblockUri",uri:i.value,isEdit:i.isEdit}}n.from=e;function t(i){return new n6(N.revive(i.uri),i.isEdit)}n.to=t})(AZ||(AZ={}));var PZ;(function(n){function e(i){return{kind:"markdownVuln",content:Cn.from(i.value),vulnerabilities:i.vulnerabilities}}n.from=e;function t(i){return new nW(Cn.to(i.content),i.vulnerabilities)}n.to=t})(PZ||(PZ={}));var NZ;(function(n){function e(t){return{kind:"confirmation",title:t.title,message:Cn.from(t.message),data:t.data,buttons:t.buttons}}n.from=e})(NZ||(NZ={}));var v8;(function(n){function e(i){const{value:s,baseUri:r}=i;function o(a,l){return a.map(c=>{const d=N.joinPath(l,c.name);return{label:c.name,uri:d,children:c.children&&o(c.children,d)}})}return{kind:"treeData",treeData:{label:In(r),uri:r,children:o(s,r)}}}n.from=e;function t(i){const s=nr(i.treeData);function r(l){return l.map(c=>({name:c.label,children:c.children&&r(c.children)}))}const o=s.uri,a=s.children?r(s.children):[];return new t6(a,o)}n.to=t})(v8||(v8={}));var Rwe;(function(n){function e(i){return{kind:"multiDiffData",multiDiffData:{title:i.title,resources:i.value.map(s=>({originalUri:s.originalUri,modifiedUri:s.modifiedUri,goToFileUri:s.goToFileUri}))}}}n.from=e;function t(i){const s=i.multiDiffData.resources.map(r=>({originalUri:r.originalUri?N.revive(r.originalUri):void 0,modifiedUri:r.modifiedUri?N.revive(r.modifiedUri):void 0,goToFileUri:r.goToFileUri?N.revive(r.goToFileUri):void 0}));return new yoe(s,i.multiDiffData.title)}n.to=t})(Rwe||(Rwe={}));var tB;(function(n){function e(i){const s=o=>N.isUri(o),r=o=>"name"in o;return{kind:"inlineReference",name:i.title,inlineReference:s(i.value)?i.value:r(i.value)?aP.from(i.value):ay.from(i.value)}}n.from=e;function t(i){const s=nr(i);return new sW(N.isUri(s.inlineReference)?s.inlineReference:"location"in s.inlineReference?aP.to(s.inlineReference):ay.to(s.inlineReference),i.name)}n.to=t})(tB||(tB={}));var w8;(function(n){function e(i){return{kind:"progressMessage",content:Cn.from(i.value)}}n.from=e;function t(i){return new Soe(i.content.value)}n.to=t})(w8||(w8={}));var b8;(function(n){function e(i){return{kind:"warning",content:Cn.from(i.value)}}n.from=e;function t(i){return new rW(i.content.value)}n.to=t})(b8||(b8={}));var Awe;(function(n){function e(t){return{kind:"extensions",extensions:t.extensions}}n.from=e})(Awe||(Awe={}));var Pwe;(function(n){function e(t){return{kind:"pullRequest",author:t.author,title:t.title,description:t.description,uri:t.uri,linkTag:t.linkTag}}n.from=e})(Pwe||(Pwe={}));var Nwe;(function(n){function e(i){return{kind:"move",uri:i.uri,range:ft.from(i.range)}}n.from=e;function t(i){return new s6(N.revive(i.uri),ft.to(i.range))}n.to=t})(Nwe||(Nwe={}));var y8;(function(n){function e(i){return{kind:"prepareToolInvocation",toolName:i.toolName}}n.from=e;function t(i){return new aW(i.toolName)}n.to=t})(y8||(y8={}));var Mwe;(function(n){function e(r){return{kind:"toolInvocationSerialized",toolCallId:r.toolCallId,toolId:r.toolName,invocationMessage:r.invocationMessage?Cn.from(r.invocationMessage):r.toolName,originMessage:r.originMessage?Cn.from(r.originMessage):void 0,pastTenseMessage:r.pastTenseMessage?Cn.from(r.pastTenseMessage):void 0,isConfirmed:r.isConfirmed,isComplete:r.isComplete??!0,isError:r.isError??!1,resultDetails:void 0,toolSpecificData:r.toolSpecificData?t(r.toolSpecificData):void 0,presentation:void 0}}n.from=e;function t(r){return"command"in r&&"language"in r?{kind:"terminal",command:r.command,language:r.language}:"commandLine"in r&&"language"in r?{kind:"terminal",commandLine:r.commandLine,language:r.language}:r}function i(r){const o=new xoe(r.toolId||r.toolName,r.toolCallId,r.isError);return r.invocationMessage&&(o.invocationMessage=r.invocationMessage),r.originMessage&&(o.originMessage=r.originMessage),r.pastTenseMessage&&(o.pastTenseMessage=r.pastTenseMessage),r.isConfirmed!==void 0&&(o.isConfirmed=r.isConfirmed),r.isComplete!==void 0&&(o.isComplete=r.isComplete),r.toolSpecificData&&(o.toolSpecificData=s(r.toolSpecificData)),o}n.to=i;function s(r){return r.kind==="terminal"?{command:r.command,language:r.language}:r.kind==="terminal2"?{commandLine:r.commandLine,language:r.language}:r}})(Mwe||(Mwe={}));var MZ;(function(n){function e(t){return{kind:"progressTask",content:Cn.from(t.value)}}n.from=e})(MZ||(MZ={}));var Owe;(function(n){function e(t){return{kind:"progressTaskResult",content:typeof t=="string"?Cn.from(t):void 0}}n.from=e})(Owe||(Owe={}));var S8;(function(n){function e(i,s,r){return{kind:"command",command:s.toInternal(i.value,r)??{command:i.value.command,title:i.value.title}}}n.from=e;function t(i,s){return new i6(s.fromInternal(i.command)??{command:i.command.id,title:i.command.title})}n.to=t})(S8||(S8={}));var OZ;(function(n){function e(i){return{kind:"textEdit",uri:i.uri,edits:i.edits.map(s=>Vc.from(s)),done:i.isDone}}n.from=e;function t(i){const s=new oW(N.revive(i.uri),i.edits.map(r=>Vc.to(r)));return s.isDone=i.done,s}n.to=t})(OZ||(OZ={}));var FZ;(function(n){function e(t){return t.newCellMetadata?{editType:Wv.Metadata,index:t.range.start,metadata:t.newCellMetadata}:t.newNotebookMetadata?{editType:Wv.DocumentMetadata,metadata:t.newNotebookMetadata}:{editType:Wv.Replace,index:t.range.start,count:t.range.end-t.range.start,cells:t.newCells.map(XW.from)}}n.from=e})(FZ||(FZ={}));var WZ;(function(n){function e(t){return{kind:"notebookEdit",uri:t.uri,edits:t.edits.map(FZ.from),done:t.isDone}}n.from=e})(WZ||(WZ={}));var p0;(function(n){function e(i){const s=ot.isThemeIcon(i.iconPath)?i.iconPath:N.isUri(i.iconPath)?{light:N.revive(i.iconPath)}:i.iconPath&&"light"in i.iconPath&&"dark"in i.iconPath&&N.isUri(i.iconPath.light)&&N.isUri(i.iconPath.dark)?{light:N.revive(i.iconPath.light),dark:N.revive(i.iconPath.dark)}:void 0;return typeof i.value=="object"&&"variableName"in i.value?{kind:"reference",reference:{variableName:i.value.variableName,value:N.isUri(i.value.value)||!i.value.value?i.value.value:ay.from(i.value.value)},iconPath:s,options:i.options}:{kind:"reference",reference:N.isUri(i.value)||typeof i.value=="string"?i.value:ay.from(i.value),iconPath:s,options:i.options}}n.from=e;function t(i){const s=nr(i),r=o=>N.isUri(o)?o:ay.to(o);return new tE(typeof s.reference=="string"?s.reference:"variableName"in s.reference?{variableName:s.reference.variableName,value:s.reference.value&&r(s.reference.value)}:r(s.reference))}n.to=t})(p0||(p0={}));var BZ;(function(n){function e(t){return{kind:"codeCitation",value:t.value,license:t.license,snippet:t.snippet}}n.from=e})(BZ||(BZ={}));var C8;(function(n){function e(s,r,o){return s instanceof e6?_8.from(s):s instanceof sW?tB.from(s):s instanceof tE?p0.from(s):s instanceof Soe?w8.from(s):s instanceof t6?v8.from(s):s instanceof yoe?Rwe.from(s):s instanceof i6?S8.from(s,r,o):s instanceof oW?OZ.from(s):s instanceof M$?WZ.from(s):s instanceof nW?PZ.from(s):s instanceof n6?AZ.from(s):s instanceof rW?b8.from(s):s instanceof P$?NZ.from(s):s instanceof N$?BZ.from(s):s instanceof s6?Nwe.from(s):s instanceof Coe?Awe.from(s):s instanceof aW?y8.from(s):s instanceof Eoe?Pwe.from(s):s instanceof xoe?Mwe.from(s):{kind:"markdownContent",content:Cn.from("")}}n.from=e;function t(s,r){switch(s.kind){case"reference":return p0.to(s);case"markdownContent":case"inlineReference":case"progressMessage":case"treeData":case"command":return i(s,r)}}n.to=t;function i(s,r){switch(s.kind){case"markdownContent":return _8.to(s);case"inlineReference":return tB.to(s);case"progressMessage":return;case"treeData":return v8.to(s);case"command":return S8.to(s,r)}}n.toContent=i})(C8||(C8={}));var E8;(function(n){function e(t,i,s,r,o,a,l){const c=[],d=[];for(const u of t.variables.variables)u.kind==="tool"?c.push(u):u.kind==="toolset"?c.push(...u.value):d.push(u);const h={id:t.requestId,prompt:t.message,command:t.command,attempt:t.attempt??0,enableCommandDetection:t.enableCommandDetection??!0,isParticipantDetected:t.isParticipantDetected??!1,references:d.map(u=>VZ.to(u,r,l)).filter(yo),toolReferences:c.map(x8.to),location:HZ.to(t.location),acceptedConfirmationData:t.acceptedConfirmationData,rejectedConfirmationData:t.rejectedConfirmationData,location2:i,toolInvocationToken:Object.freeze({sessionId:t.sessionId}),tools:o,model:s,editedFileEvents:t.editedFileEvents,modeInstructions:t.modeInstructions};return Mr(a,"chatParticipantPrivate")||(delete h.id,delete h.attempt,delete h.enableCommandDetection,delete h.isParticipantDetected,delete h.location,delete h.location2,delete h.editedFileEvents),Mr(a,"chatParticipantAdditions")||(delete h.acceptedConfirmationData,delete h.rejectedConfirmationData,delete h.tools),h}n.to=e})(E8||(E8={}));var Fwe;(function(n){function e(t){return{prompt:t.prompt,files:t.files.map(i=>N.revive(i))}}n.to=e})(Fwe||(Fwe={}));var HZ;(function(n){function e(i){switch(i){case dc.Notebook:return jm.Notebook;case dc.Terminal:return jm.Terminal;case dc.Panel:return jm.Panel;case dc.Editor:return jm.Editor}}n.to=e;function t(i){switch(i){case jm.Notebook:return dc.Notebook;case jm.Terminal:return dc.Terminal;case jm.Panel:return dc.Panel;case jm.Editor:return dc.Editor}}n.from=t})(HZ||(HZ={}));var VZ;(function(n){function e(t,i,s){let r=t.value;if(!r){let o;try{o=JSON.stringify(t)}catch{o=`kind=${t.kind}, id=${t.id}, name=${t.name}`}s.error(`[ChatPromptReference] Ignoring invalid reference in variable: ${o}`);return}if(Oj(r))r=N.revive(r);else if(r&&typeof r=="object"&&"uri"in r&&"range"in r&&Oj(r.uri))r=ay.to(nr(r));else if(wOt(t)){const o=t.references?.[0]?.reference;r=new ZLe(t.mimeType??"image/png",()=>Promise.resolve(new Uint8Array(Object.values(t.value))),o&&N.isUri(o)?o:void 0)}else if(t.kind==="diagnostic"){const o=t.filterSeverity&&h8.to(t.filterSeverity),a=t.filterUri&&N.revive(t.filterUri).toString();r=new JLe(i.map(([l,c])=>t.filterUri&&l.toString()!==a?[l,[]]:[l,c.filter(d=>!(o&&d.severity>o||t.filterRange&&!M.areIntersectingOrTouching(t.filterRange,ft.from(d.range))))]).filter(([,l])=>l.length>0))}return{id:t.id,name:t.name,range:t.range&&[t.range.start,t.range.endExclusive],value:r,modelDescription:t.modelDescription}}n.to=e})(VZ||(VZ={}));var x8;(function(n){function e(t){if(t.value)throw new Error("Invalid tool reference");return{name:t.id,range:t.range&&[t.range.start,t.range.endExclusive]}}n.to=e})(x8||(x8={}));var Wwe;(function(n){function e(t,i,s){return{id:t.id,label:t.label,fullName:t.fullName,icon:t.icon?.id,value:t.values[0].value,insertText:t.insertText,detail:t.detail,documentation:t.documentation,command:i.toInternal(t.command,s)}}n.from=e})(Wwe||(Wwe={}));var gF;(function(n){function e(s){return{errorDetails:s.errorDetails,metadata:i(s.metadata),nextQuestion:s.nextQuestion,details:s.details}}n.to=e;function t(s){return{errorDetails:s.errorDetails,metadata:s.metadata,nextQuestion:s.nextQuestion,details:s.details}}n.from=t;function i(s){return rI(s,r=>{if(r.$mid===Pn.LanguageModelToolResult)return new r6(rI(r.content,i));if(r.$mid===Pn.LanguageModelTextPart)return new Ma(r.value,r.audience);if(r.$mid===Pn.LanguageModelPromptTsxPart)return new Jv(r.value)})}})(gF||(gF={}));var Bwe;(function(n){function e(t,i,s){if(i.action.kind==="vote")return;const r=gF.to(t);if(i.action.kind==="command"){const o=i.action.commandButton.command;return{action:{kind:"command",commandButton:{command:s.fromInternal(o)??{command:o.id,title:o.title}}},result:r}}else return i.action.kind==="followUp"?{action:{kind:"followUp",followup:LZ.to(i.action.followup)},result:r}:i.action.kind==="inlineChat"?{action:{kind:"editor",accepted:i.action.action==="accepted"},result:r}:i.action.kind==="chatEditingSessionAction"?{action:{kind:"chatEditingSessionAction",outcome:new Map([["accepted",lv.Accepted],["rejected",lv.Rejected],["saved",lv.Saved]]).get(i.action.outcome)??lv.Rejected,uri:N.revive(i.action.uri),hasRemainingEdits:i.action.hasRemainingEdits},result:r}:i.action.kind==="chatEditingHunkAction"?{action:{kind:"chatEditingHunkAction",outcome:new Map([["accepted",lv.Accepted],["rejected",lv.Rejected]]).get(i.action.outcome)??lv.Rejected,uri:N.revive(i.action.uri),hasRemainingEdits:i.action.hasRemainingEdits,lineCount:i.action.lineCount},result:r}:{action:i.action,result:r}}n.to=e})(Bwe||(Bwe={}));var UZ;(function(n){function e(t,i,s){return"terminalCommand"in t?{terminalCommand:t.terminalCommand,shouldExecute:t.shouldExecute}:"uri"in t?{uri:t.uri}:i.toInternal(t,s)}n.from=e})(UZ||(UZ={}));var $Z;(function(n){function e(t){return{...t,documentation:Cn.fromStrict(t.documentation)}}n.from=e})($Z||($Z={}));var Hwe;(function(n){function e(t,i){return Array.isArray(t)?{items:t.map(s=>$Z.from(s))}:{items:t.items.map(s=>$Z.from(s)),resourceRequestConfig:t.resourceRequestConfig?Vwe.from(t.resourceRequestConfig,i):void 0}}n.from=e})(Hwe||(Hwe={}));var Vwe;(function(n){function e(t,i){return{...t,pathSeparator:i,cwd:t.cwd}}n.from=e})(Vwe||(Vwe={}));var Uwe;(function(n){function e(t){return{kind:$we.to(t.kind),acceptedLength:t.acceptedLength}}n.to=e})(Uwe||(Uwe={}));var $we;(function(n){function e(t){switch(t){case jD.Word:return fD.Word;case jD.Line:return fD.Line;case jD.Suggest:return fD.Suggest;default:return fD.Unknown}}n.to=e})($we||($we={}));var zwe;(function(n){function e(t,i){if(t.kind===by.Ignored){const s=t.supersededBy?i(t.supersededBy):void 0;return{kind:Zb.Ignored,supersededBy:s,userTypingDisagreed:t.userTypingDisagreed}}else if(t.kind===by.Accepted)return{kind:Zb.Accepted};return{kind:Zb.Rejected}}n.to=e})(zwe||(zwe={}));var qwe;(function(n){function e(t,i){return{id:i,label:t.label,description:t.description,canEdit:t.canEdit,collapsibleState:t.collapsibleState||Tfe.None,contextValue:t.contextValue}}n.from=e})(qwe||(qwe={}));var Gwe;(function(n){function e(t){return t.type==="mcp"?new s1e(t.label,t.serverLabel||t.label,t.instructions):t.type==="extension"?new n1e(t.extensionId.value,t.label):void 0}n.to=e})(Gwe||(Gwe={}));var pVe;(function(n){function e(i){return new r6(i.content.map(s=>s.kind==="text"?new Ma(s.value,s.audience):new Jv(s.value)))}n.to=e;function t(i,s){i.toolResultMessage&&Qe(s,"chatParticipantPrivate");const r=o=>{o.audience&&Qe(s,"languageModelToolResultAudience")};return{content:i.content.map(o=>{if(o instanceof Ma)return r(o),{kind:"text",value:o.value,audience:o.audience};if(o instanceof Jv)return{kind:"promptTsx",value:o.value};throw new Error("Unknown LanguageModelToolResult part type")}),toolResultMessage:Cn.fromStrict(i.toolResultMessage),toolResultDetails:i.toolResultDetails?.map(o=>N.isUri(o)?o:ay.from(o))}}n.from=t})(pVe||(pVe={}));var zZ;(function(n){function e(i){return new i1e(i.content.map(s=>s.kind==="text"?new Ma(s.value,s.audience):s.kind==="data"?new a_(s.value.data.buffer,s.value.mimeType,s.audience):new Jv(s.value)))}n.to=e;function t(i,s){i.toolResultMessage&&Qe(s,"chatParticipantPrivate");const r=c=>{c.audience&&Qe(s,"languageModelToolResultAudience")};let o=!1,a;Array.isArray(i.toolResultDetails)?a=i.toolResultDetails?.map(c=>N.isUri(c)?c:ay.from(c)):i.toolResultDetails2&&(a={output:{type:"data",mimeType:i.toolResultDetails2.mime,value:Ye.wrap(i.toolResultDetails2.value)}},o=!0);const l={content:i.content.map(c=>{if(c instanceof Ma)return r(c),{kind:"text",value:c.value,audience:c.audience};if(c instanceof Jv)return{kind:"promptTsx",value:c.value};if(c instanceof a_)return r(c),o=!0,{kind:"data",value:{mimeType:c.mimeType,data:Ye.wrap(c.data)},audience:c.audience};throw new Error("Unknown LanguageModelToolResult part type")}),toolResultMessage:Cn.fromStrict(i.toolResultMessage),toolResultDetails:a};return o?new ll(l):l}n.from=t})(zZ||(zZ={}));var qZ;(function(n){function e(t){return t}n.fromThemeIcon=e})(qZ||(qZ={}));var Kwe;(function(n){function e(i){return{query:i.query,kind:t(i.kind),settings:i.settings}}n.fromSettingsSearchResult=e;function t(i){switch(i){case Nx.EMBEDDED:return Nx.EMBEDDED;case Nx.LLM_RANKED:return Nx.LLM_RANKED;case Nx.CANCELED:return Nx.CANCELED;default:throw new Error("Unknown AiSettingsSearchResultKind")}}})(Kwe||(Kwe={}));var L5;(function(n){function e(i){return!!i.uri}function t(i){return UW.toSerialized(e(i)?{type:yI.HTTP,uri:i.uri,headers:Object.entries(i.headers)}:{type:yI.Stdio,cwd:i.cwd?.fsPath,args:i.args,command:i.command,env:i.env,envFile:void 0})}n.from=t})(L5||(L5={}));const Lle=de("IURITransformerService");class cFt{constructor(e){e?(this.transformIncoming=e.transformIncoming.bind(e),this.transformOutgoing=e.transformOutgoing.bind(e),this.transformOutgoingURI=e.transformOutgoingURI.bind(e),this.transformOutgoingScheme=e.transformOutgoingScheme.bind(e)):(this.transformIncoming=t=>t,this.transformOutgoing=t=>t,this.transformOutgoingURI=t=>t,this.transformOutgoingScheme=t=>t)}}const Swi="search.exclude",Stt=2e4,Ctt="⟪ ",Ett=" characters skipped ⟫",dFt=(Ctt.length+Ett.length+5)*2;var R5;(function(n){n[n.file=0]="file",n[n.text=1]="text",n[n.aiText=2]="aiText"})(R5||(R5={}));var uE;(function(n){n[n.File=1]="File",n[n.Text=2]="Text",n[n.aiText=3]="aiText"})(uE||(uE={}));function mVe(n){return!!n.rangeLocations&&!!n.previewText}var _Ve;(function(n){n[n.Normal=0]="Normal",n[n.NewSearchStarted=1]="NewSearchStarted"})(_Ve||(_Ve={}));class hFt{constructor(e,t,i,s){this.rangeLocations=[],this.webviewIndex=s;const r=Array.isArray(t)?t:[t];if(i&&i.matchLines===1&&uFt(r)){e=Ect(e,i.matchLines);let o="",a=0,l=0;const c=Math.floor(i.charsPerLine/5);for(const d of r){const h=Math.max(d.startColumn-c,0),u=d.startColumn+i.charsPerLine;if(h>l+c+dFt){const g=Ctt+(h-l)+Ett;o+=g+e.slice(h,u),a+=h-(l+g.length)}else o+=e.slice(l,u);l=u,this.rangeLocations.push({source:d,preview:new fFt(0,d.startColumn-a,d.endColumn-a)})}this.previewText=o}else{const o=Array.isArray(t)?t[0].startLineNumber:t.startLineNumber,a=Nue(t,l=>({preview:new xtt(l.startLineNumber-o,l.startColumn,l.endLineNumber-o,l.endColumn),source:l}));this.rangeLocations=Array.isArray(a)?a:[a],this.previewText=e}}}function uFt(n){const e=n[0].startLineNumber;for(const t of n)if(t.startLineNumber!==e||t.endLineNumber!==e)return!1;return!0}class xtt{constructor(e,t,i,s){this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=s}}class fFt extends xtt{constructor(e,t,i){super(e,t,e,i)}}var vVe;(function(n){n.List="list",n.Tree="tree"})(vVe||(vVe={}));var wVe;(function(n){n.Default="default",n.FileNames="fileNames",n.Type="type",n.Modified="modified",n.CountDescending="countDescending",n.CountAscending="countAscending"})(wVe||(wVe={}));var bVe;(function(n){n.Auto="auto",n.Manual="manual",n.RunOnEmpty="runOnEmpty"})(bVe||(bVe={}));function gFt(n,e=!0){const t=n&&n.files&&n.files.exclude,i=e&&n&&n.search&&n.search.exclude;if(!t&&!i)return;if(!t||!i)return t||i||void 0;let s=Object.create(null);return s=dp(s,Ls(t)),s=dp(s,Ls(i),!0),s}function yVe(n,e){return n.excludePattern&&Bb(n.excludePattern,e)?!1:n.includePattern||n.usingSearchPaths?n.includePattern&&Bb(n.includePattern,e)?!0:n.usingSearchPaths?!!n.folderQueries&&n.folderQueries.some(t=>{const i=t.folder.fsPath;if(Hj(e,i)){const s=j3(i,e);return!t.includePattern||!!Bb(t.includePattern,s)}else return!1}):!1:!0}var SVe;(function(n){n[n.unknownEncoding=1]="unknownEncoding",n[n.regexParseError=2]="regexParseError",n[n.globParseError=3]="globParseError",n[n.invalidLiteral=4]="invalidLiteral",n[n.rgProcessError=5]="rgProcessError",n[n.other=6]="other",n[n.canceled=7]="canceled"})(SVe||(SVe={}));function pF(n,e){const t={...n||{},...e||{}};return Object.keys(t).filter(i=>{const s=t[i];return typeof s=="boolean"&&s})}class Dtt{constructor(e,t){this._parsedIncludeExpression=null,this._excludeExpression=t.excludePattern?.map(s=>({...e.excludePattern||{},...s.pattern||{}}))??[],this._excludeExpression.length===0&&(this._excludeExpression=[e.excludePattern||{}]),this._parsedExcludeExpression=this._excludeExpression.map(s=>_y(s));let i=e.includePattern;t.includePattern&&(i?i={...i,...t.includePattern}:i=t.includePattern),i&&(this._parsedIncludeExpression=_y(i))}_evalParsedExcludeExpression(e,t,i){let s=null;for(const r of this._parsedExcludeExpression){const o=r(e,t,i);if(typeof o=="string"){s=o;break}}return s}matchesExcludesSync(e,t,i){return!!(this._parsedExcludeExpression&&this._evalParsedExcludeExpression(e,t,i))}includedInQuerySync(e,t,i){return!(this._parsedExcludeExpression&&this._evalParsedExcludeExpression(e,t,i)||this._parsedIncludeExpression&&!this._parsedIncludeExpression(e,t,i))}includedInQuery(e,t,i){const s=()=>this._parsedIncludeExpression?!!this._parsedIncludeExpression(e,t,i):!0;return Promise.all(this._parsedExcludeExpression.map(r=>{const o=r(e,t,i);return my(o)?o.then(a=>a?!1:s()):s()})).then(r=>r.some(o=>!!o))}hasSiblingExcludeClauses(){return this._excludeExpression.reduce((e,t)=>pFt(t)||e,!1)}}function pFt(n){for(const e in n)if(typeof n[e]!="boolean")return!0;return!1}function mFt(n){if(!n)return;let e;return t=>(e||(e=(n()||Promise.resolve([])).then(i=>i?ktt(i):{})),e.then(i=>!!i[t]))}function _Ft(n){if(!n)return;let e;return t=>{if(!e){const i=n();e=i?ktt(i):{}}return!!e[t]}}function ktt(n){const e={};for(const t of n)e[t]=!0;return e}function Itt(n){return n.flatMap(e=>e.patterns.map(t=>e.baseUri?{baseUri:e.baseUri,pattern:t}:t))}const jwe={matchLines:100,charsPerLine:1e4},vFt="modulepreload",wFt=function(n,e){return new URL(n,e).href},CVe={},Kv=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){let c=function(d){return Promise.all(d.map(h=>Promise.resolve(h).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");s=c(t.map(d=>{if(d=wFt(d,i),d in CVe)return;CVe[d]=!0;const h=d.endsWith(".css"),u=h?'[rel="stylesheet"]':"";if(i)for(let p=o.length-1;p>=0;p--){const m=o[p];if(m.href===d&&(!h||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${d}"]${u}`))return;const g=document.createElement("link");if(g.rel=h?"stylesheet":vFt,h||(g.as="script"),g.crossOrigin="",g.href=d,l&&g.setAttribute("nonce",l),document.head.appendChild(g),h)return new Promise((p,m)=>{g.addEventListener("load",p),g.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${d}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})},Nc="utf8",cC="utf8bom",cP="utf16be",dP="utf16le",RK=[254,255],Ywe=[255,254],a4=[239,187,191],bFt=512,yFt=512,SFt=512*8,CFt=512*128;var GZ;(function(n){n[n.STREAM_IS_BINARY=1]="STREAM_IS_BINARY"})(GZ||(GZ={}));class EFt extends Error{constructor(e,t){super(e),this.decodeStreamErrorKind=t}}class KAe{static async create(e){let t;if(e!==Nc)t=(await Kv(()=>import("./iconv-lite-umd-vDmZu3o7.js").then(s=>s.i),[],import.meta.url).then(s=>s.default??s)).getDecoder(jAe(e));else{const i=new TextDecoder;t={write(s){return i.decode(s,{stream:!0})},end(){return i.decode()}}}return new KAe(t)}constructor(e){this.iconvLiteDecoder=e}write(e){return this.iconvLiteDecoder.write(e)}end(){return this.iconvLiteDecoder.end()}}function Ttt(n,e){const t=e.minBytesRequiredForDetection??e.guessEncoding?SFt:yFt;return new Promise((i,s)=>{const r=UE(h=>h.join("")),o=[];let a=0,l;const c=new ui,d=async()=>{try{const h=await PFt({buffer:Ye.concat(o),bytesRead:a},e.guessEncoding,e.candidateGuessEncodings);if(h.seemsBinary&&e.acceptTextOnly)throw new EFt("Stream is binary but only text is accepted for decoding",GZ.STREAM_IS_BINARY);h.encoding=await e.overwriteEncoding(h.encoding),l=await KAe.create(h.encoding);const u=l.write(Ye.concat(o).buffer);r.write(u),o.length=0,a=0,i({stream:r,detected:h})}catch(h){c.cancel(),r.destroy(),s(h)}};UB(n,{onData:async h=>{l?r.write(l.write(h.buffer)):(o.push(h),a+=h.byteLength,a>=t&&(n.pause(),await d(),setTimeout(()=>n.resume())))},onError:h=>r.error(h),onEnd:async()=>{l||await d(),r.end(l?.end())}},c.token)})}async function Ltt(n,e,t){const s=(await Kv(()=>import("./iconv-lite-umd-vDmZu3o7.js").then(a=>a.i),[],import.meta.url).then(a=>a.default??a)).getEncoder(jAe(e),t);let r=!1,o=!1;return{read(){if(o)return null;const a=n.read();if(typeof a!="string"){if(o=!0,!r&&t?.addBOM)switch(e){case Nc:case cC:return Ye.wrap(Uint8Array.from(a4));case cP:return Ye.wrap(Uint8Array.from(RK));case dP:return Ye.wrap(Uint8Array.from(Ywe))}const l=s.end();return l&&l.length>0?(r=!0,Ye.wrap(l)):null}return r=!0,Ye.wrap(s.write(a))}}}async function xFt(n){return(await Kv(()=>import("./iconv-lite-umd-vDmZu3o7.js").then(t=>t.i),[],import.meta.url).then(t=>t.default??t)).encodingExists(jAe(n))}function jAe(n){return n===cC||n===null?Nc:n}function DFt(n,e){if(!n||e<RK.length)return null;const t=n.readUInt8(0),i=n.readUInt8(1);if(t===RK[0]&&i===RK[1])return cP;if(t===Ywe[0]&&i===Ywe[1])return dP;if(e<a4.length)return null;const s=n.readUInt8(2);return t===a4[0]&&i===a4[1]&&s===a4[2]?cC:null}const kFt=["ascii","utf-16","utf-32"];async function IFt(n,e){const t=await Kv(()=>import("./index-Be1WCD4s.js").then(a=>a.i),[],import.meta.url).then(a=>a.default??a),i=n.slice(0,CFt),s=AFt(i.buffer);e&&(e=vn(e.map(a=>RFt(a))),e.length===0&&(e=void 0));let r;try{r=t.detect(s,e?{detectEncodings:e}:void 0)}catch{return null}if(!r||!r.encoding)return null;const o=r.encoding.toLowerCase();return 0<=kFt.indexOf(o)?null:LFt(r.encoding)}const TFt={ibm866:"cp866",big5:"cp950"};function Rtt(n){return n.replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}function LFt(n){const e=Rtt(n);return TFt[e]||e}function RFt(n){const e=Rtt(n),t=AK[e];return t?t.guessableName:void 0}function AFt(n){let e="";for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);return e}function PFt({buffer:n,bytesRead:e},t,i){let s=DFt(n,e),r=!1;if(s!==cP&&s!==dP&&n){let o=!0,a=!0,l=!1;for(let c=0;c<e&&c<bFt;c++){const d=c%2===1,h=n.readUInt8(c)===0;if(h&&(l=!0),o&&(d&&!h||!d&&h)&&(o=!1),a&&(d&&h||!d&&!h)&&(a=!1),h&&!o&&!a)break}l&&(o?s=dP:a?s=cP:r=!0)}return t&&!r&&!s&&n?IFt(n.slice(0,e),i).then(o=>({seemsBinary:!1,encoding:o})):{seemsBinary:r,encoding:s}}const tD={utf8:{labelLong:"UTF-8",labelShort:"UTF-8",order:1,alias:"utf8bom",guessableName:"UTF-8"},utf8bom:{labelLong:"UTF-8 with BOM",labelShort:"UTF-8 with BOM",encodeOnly:!0,order:2,alias:"utf8"},utf16le:{labelLong:"UTF-16 LE",labelShort:"UTF-16 LE",order:3,guessableName:"UTF-16LE"},utf16be:{labelLong:"UTF-16 BE",labelShort:"UTF-16 BE",order:4,guessableName:"UTF-16BE"},windows1252:{labelLong:"Western (Windows 1252)",labelShort:"Windows 1252",order:5,guessableName:"windows-1252"},iso88591:{labelLong:"Western (ISO 8859-1)",labelShort:"ISO 8859-1",order:6},iso88593:{labelLong:"Western (ISO 8859-3)",labelShort:"ISO 8859-3",order:7},iso885915:{labelLong:"Western (ISO 8859-15)",labelShort:"ISO 8859-15",order:8},macroman:{labelLong:"Western (Mac Roman)",labelShort:"Mac Roman",order:9},cp437:{labelLong:"DOS (CP 437)",labelShort:"CP437",order:10},windows1256:{labelLong:"Arabic (Windows 1256)",labelShort:"Windows 1256",order:11},iso88596:{labelLong:"Arabic (ISO 8859-6)",labelShort:"ISO 8859-6",order:12},windows1257:{labelLong:"Baltic (Windows 1257)",labelShort:"Windows 1257",order:13},iso88594:{labelLong:"Baltic (ISO 8859-4)",labelShort:"ISO 8859-4",order:14},iso885914:{labelLong:"Celtic (ISO 8859-14)",labelShort:"ISO 8859-14",order:15},windows1250:{labelLong:"Central European (Windows 1250)",labelShort:"Windows 1250",order:16,guessableName:"windows-1250"},iso88592:{labelLong:"Central European (ISO 8859-2)",labelShort:"ISO 8859-2",order:17,guessableName:"ISO-8859-2"},cp852:{labelLong:"Central European (CP 852)",labelShort:"CP 852",order:18},windows1251:{labelLong:"Cyrillic (Windows 1251)",labelShort:"Windows 1251",order:19,guessableName:"windows-1251"},cp866:{labelLong:"Cyrillic (CP 866)",labelShort:"CP 866",order:20,guessableName:"IBM866"},cp1125:{labelLong:"Cyrillic (CP 1125)",labelShort:"CP 1125",order:21,guessableName:"IBM1125"},iso88595:{labelLong:"Cyrillic (ISO 8859-5)",labelShort:"ISO 8859-5",order:22,guessableName:"ISO-8859-5"},koi8r:{labelLong:"Cyrillic (KOI8-R)",labelShort:"KOI8-R",order:23,guessableName:"KOI8-R"},koi8u:{labelLong:"Cyrillic (KOI8-U)",labelShort:"KOI8-U",order:24},iso885913:{labelLong:"Estonian (ISO 8859-13)",labelShort:"ISO 8859-13",order:25},windows1253:{labelLong:"Greek (Windows 1253)",labelShort:"Windows 1253",order:26,guessableName:"windows-1253"},iso88597:{labelLong:"Greek (ISO 8859-7)",labelShort:"ISO 8859-7",order:27,guessableName:"ISO-8859-7"},windows1255:{labelLong:"Hebrew (Windows 1255)",labelShort:"Windows 1255",order:28,guessableName:"windows-1255"},iso88598:{labelLong:"Hebrew (ISO 8859-8)",labelShort:"ISO 8859-8",order:29,guessableName:"ISO-8859-8"},iso885910:{labelLong:"Nordic (ISO 8859-10)",labelShort:"ISO 8859-10",order:30},iso885916:{labelLong:"Romanian (ISO 8859-16)",labelShort:"ISO 8859-16",order:31},windows1254:{labelLong:"Turkish (Windows 1254)",labelShort:"Windows 1254",order:32},iso88599:{labelLong:"Turkish (ISO 8859-9)",labelShort:"ISO 8859-9",order:33},windows1258:{labelLong:"Vietnamese (Windows 1258)",labelShort:"Windows 1258",order:34},gbk:{labelLong:"Simplified Chinese (GBK)",labelShort:"GBK",order:35},gb18030:{labelLong:"Simplified Chinese (GB18030)",labelShort:"GB18030",order:36},cp950:{labelLong:"Traditional Chinese (Big5)",labelShort:"Big5",order:37,guessableName:"Big5"},big5hkscs:{labelLong:"Traditional Chinese (Big5-HKSCS)",labelShort:"Big5-HKSCS",order:38},shiftjis:{labelLong:"Japanese (Shift JIS)",labelShort:"Shift JIS",order:39,guessableName:"SHIFT_JIS"},eucjp:{labelLong:"Japanese (EUC-JP)",labelShort:"EUC-JP",order:40,guessableName:"EUC-JP"},euckr:{labelLong:"Korean (EUC-KR)",labelShort:"EUC-KR",order:41,guessableName:"EUC-KR"},windows874:{labelLong:"Thai (Windows 874)",labelShort:"Windows 874",order:42},iso885911:{labelLong:"Latin/Thai (ISO 8859-11)",labelShort:"ISO 8859-11",order:43},koi8ru:{labelLong:"Cyrillic (KOI8-RU)",labelShort:"KOI8-RU",order:44},koi8t:{labelLong:"Tajik (KOI8-T)",labelShort:"KOI8-T",order:45},gb2312:{labelLong:"Simplified Chinese (GB 2312)",labelShort:"GB 2312",order:46,guessableName:"GB2312"},cp865:{labelLong:"Nordic DOS (CP 865)",labelShort:"CP 865",order:47},cp850:{labelLong:"Western European DOS (CP 850)",labelShort:"CP 850",order:48}},AK=(()=>{const n={};for(const e in tD)tD[e].guessableName&&(n[e]=tD[e]);return n})();var KZ;(function(n){n[n.FILE_IS_BINARY=0]="FILE_IS_BINARY"})(KZ||(KZ={}));class NFt extends Ad{static isTextFileOperationError(e){return e instanceof Error&&!bo(e.textFileOperationResult)}constructor(e,t,i){super(e,sn.FILE_OTHER_ERROR),this.textFileOperationResult=t,this.options=i}}var Bf;(function(n){n[n.SAVED=0]="SAVED",n[n.DIRTY=1]="DIRTY",n[n.PENDING_SAVE=2]="PENDING_SAVE",n[n.CONFLICT=3]="CONFLICT",n[n.ORPHAN=4]="ORPHAN",n[n.ERROR=5]="ERROR"})(Bf||(Bf={}));var D8;(function(n){n[n.EDITOR=1]="EDITOR",n[n.REFERENCE=2]="REFERENCE",n[n.OTHER=3]="OTHER"})(D8||(D8={}));var jZ;(function(n){n[n.Encode=0]="Encode",n[n.Decode=1]="Decode"})(jZ||(jZ={}));function Att(n){let e=!1;return{read(){return e?null:(e=!0,n)}}}function MFt(n){if(!(typeof n>"u"))return typeof n=="string"?Ye.fromString(n):{read:()=>{const e=n.read();return typeof e=="string"?Ye.fromString(e):null}}}function k8(n,e,t){return new $B(i=>YAe(i,t)).isEqual(n,e)}function OFt(n,e,t){return k8(n.uri,e.uri,t)?0:fm(n.uri.toString(),e.uri.toString())}function FFt(n,e,t){return n.index!==e.index?n.index<e.index?-1:1:k8(n.uri,e.uri,t)?fm(n.name,e.name):fm(n.uri.toString(),e.uri.toString())}function Ptt(n,e,t,i){const s=n.slice(0).sort((o,a)=>t(o,a,i)),r=e.slice(0).sort((o,a)=>t(o,a,i));return MT(s,r,(o,a)=>t(o,a,i))}function YAe(n,e){const t=e.getCapabilities(n.scheme);return!(t&&t&Fn.PathCaseSensitive)}class mF extends Cje{static toExtHostWorkspace(e,t,i,s){if(!e)return{workspace:null,added:[],removed:[]};const{id:r,name:o,folders:a,configuration:l,transient:c,isUntitled:d}=e,h=[],u=t;t?a.forEach((_,w)=>{const b=N.revive(_.uri),S=mF._findFolder(i||t,b,s);S?(S.name=_.name,S.index=_.index,h.push(S)):h.push({uri:b,name:_.name,index:w})}):h.push(...a.map(({uri:_,name:w,index:b})=>({uri:N.revive(_),name:w,index:b}))),h.sort((_,w)=>_.index<w.index?-1:1);const g=new mF(r,o,h,!!c,l?N.revive(l):null,!!d,_=>YAe(_,s)),{added:p,removed:m}=Ptt(u?u.workspaceFolders:[],g.workspaceFolders,OFt,s);return{workspace:g,added:p,removed:m}}static _findFolder(e,t,i){for(let s=0;s<e.folders.length;s++){const r=e.workspaceFolders[s];if(k8(r.uri,t,i))return r}}constructor(e,t,i,s,r,o,a){super(e,i.map(l=>new Goe(l)),s,r,a),this._name=t,this._isUntitled=o,this._workspaceFolders=[],this._structure=Th.forUris(a,()=>!0),i.forEach(l=>{this._workspaceFolders.push(l),this._structure.set(l.uri,l)})}get name(){return this._name}get isUntitled(){return this._isUntitled}get workspaceFolders(){return this._workspaceFolders.slice(0)}getWorkspaceFolder(e,t){return t&&this._structure.get(e)&&(e=Ka(e)),this._structure.findSubstr(e)}resolveWorkspaceFolder(e){return this._structure.get(e)}}let Xwe=class{constructor(e,t,i,s,r){this._onDidChangeWorkspace=new A,this.onDidChangeWorkspace=this._onDidChangeWorkspace.event,this._onDidGrantWorkspaceTrust=new A,this.onDidGrantWorkspaceTrust=this._onDidGrantWorkspaceTrust.event,this._activeSearchCallbacks=[],this._trusted=!1,this._editSessionIdentityProviders=new Map,this._providerHandlePool=0,this._onWillCreateEditSessionIdentityEvent=new VD,this._canonicalUriProviders=new Map,this._logService=s,this._extHostFileSystemInfo=i,this._uriTransformerService=r,this._requestIdProvider=new vmt,this._barrier=new Lh,this._proxy=e.getProxy(Xe.MainThreadWorkspace),this._messageService=e.getProxy(Xe.MainThreadMessageService);const o=t.workspace;this._confirmedWorkspace=o?new mF(o.id,o.name,[],!!o.transient,o.configuration?N.revive(o.configuration):null,!!o.isUntitled,a=>YAe(a,i)):void 0}$initializeWorkspace(e,t){this._trusted=t,this.$acceptWorkspaceData(e),this._barrier.open()}waitForInitializeCall(){return this._barrier.wait()}get workspace(){return this._actualWorkspace}get name(){return this._actualWorkspace?this._actualWorkspace.name:void 0}get workspaceFile(){if(this._actualWorkspace&&this._actualWorkspace.configuration)return this._actualWorkspace.isUntitled?N.from({scheme:ye.untitled,path:In(Ka(this._actualWorkspace.configuration))}):this._actualWorkspace.configuration}get _actualWorkspace(){return this._unconfirmedWorkspace||this._confirmedWorkspace}getWorkspaceFolders(){if(this._actualWorkspace)return this._actualWorkspace.workspaceFolders.slice(0)}async getWorkspaceFolders2(){if(await this._barrier.wait(),!!this._actualWorkspace)return this._actualWorkspace.workspaceFolders.slice(0)}updateWorkspaceFolders(e,t,i,...s){const r=[];if(Array.isArray(s)&&s.forEach(d=>{N.isUri(d.uri)&&!r.some(h=>k8(h.uri,d.uri,this._extHostFileSystemInfo))&&r.push({uri:d.uri,name:d.name||x2(d.uri)})}),this._unconfirmedWorkspace||[t,i].some(d=>typeof d!="number"||d<0)||i===0&&r.length===0)return!1;const o=this._actualWorkspace?this._actualWorkspace.workspaceFolders:[];if(t+i>o.length)return!1;const a=o.slice(0);a.splice(t,i,...r.map(d=>({uri:d.uri,name:d.name||x2(d.uri),index:void 0})));for(let d=0;d<a.length;d++){const h=a[d];if(a.some((u,g)=>g!==d&&k8(h.uri,u.uri,this._extHostFileSystemInfo)))return!1}a.forEach((d,h)=>d.index=h);const{added:l,removed:c}=Ptt(o,a,FFt,this._extHostFileSystemInfo);if(l.length===0&&c.length===0)return!1;if(this._proxy){const d=e.displayName||e.name;this._proxy.$updateWorkspaceFolders(d,t,i,r).then(void 0,h=>{this._unconfirmedWorkspace=void 0;const u={source:{identifier:e.identifier,label:e.displayName||e.name}};this._messageService.$showMessage(wt.Error,f(2640,"Extension '{0}' failed to update workspace folders: {1}",d,h.toString()),u,[])})}return this.trySetWorkspaceFolders(a),!0}getWorkspaceFolder(e,t){if(this._actualWorkspace)return this._actualWorkspace.getWorkspaceFolder(e,t)}async getWorkspaceFolder2(e,t){if(await this._barrier.wait(),!!this._actualWorkspace)return this._actualWorkspace.getWorkspaceFolder(e,t)}async resolveWorkspaceFolder(e){if(await this._barrier.wait(),!!this._actualWorkspace)return this._actualWorkspace.resolveWorkspaceFolder(e)}getPath(){if(!this._actualWorkspace)return;const{folders:e}=this._actualWorkspace;if(e.length!==0)return e[0].uri.fsPath}getRelativePath(e,t){let i,s="";if(typeof e=="string"?(i=N.file(e),s=e):typeof e<"u"&&(i=e,s=e.fsPath),!i)return s;const r=this.getWorkspaceFolder(i,!0);if(!r)return s;typeof t>"u"&&this._actualWorkspace&&(t=this._actualWorkspace.folders.length>1);let o=MP(r.uri,i);return t&&r.name&&(o=`${r.name}/${o}`),o}trySetWorkspaceFolders(e){this._actualWorkspace&&(this._unconfirmedWorkspace=mF.toExtHostWorkspace({id:this._actualWorkspace.id,name:this._actualWorkspace.name,configuration:this._actualWorkspace.configuration,folders:e,isUntitled:this._actualWorkspace.isUntitled},this._actualWorkspace,void 0,this._extHostFileSystemInfo).workspace||void 0)}$acceptWorkspaceData(e){const{workspace:t,added:i,removed:s}=mF.toExtHostWorkspace(e,this._confirmedWorkspace,this._unconfirmedWorkspace,this._extHostFileSystemInfo);this._confirmedWorkspace=t||void 0,this._unconfirmedWorkspace=void 0,this._onDidChangeWorkspace.fire(Object.freeze({added:i,removed:s}))}findFiles(e,t,i,s,r=et.None){this._logService.trace(`extHostWorkspace#findFiles: fileSearch, extension: ${s.value}, entryPoint: findFiles`);let o="",a=!0;return t===null?a=!1:t!==void 0&&(typeof t=="string"?o=t:o=t.pattern),this._findFilesImpl({type:"include",value:e},{exclude:[o],maxResults:i,useExcludeSettings:a?mb.FilesExclude:mb.None,useIgnoreFiles:{local:!1}},r)}findFiles2(e,t={},i,s=et.None){return this._logService.trace(`extHostWorkspace#findFiles2New: fileSearch, extension: ${i.value}, entryPoint: findFiles2New`),this._findFilesImpl({type:"filePatterns",value:e},t,s)}async _findFilesImpl(e,t,i){if(i.isCancellationRequested)return Promise.resolve([]);const s=e.type==="include"?[e.value]:e.value??[];if(!Array.isArray(s))throw console.error("Invalid file pattern provided",s),new Error(`Invalid file pattern provided ${JSON.stringify(s)}`);const r=s.map(o=>{const a=EVe(t.exclude),l={ignoreSymlinks:typeof t.followSymlinks=="boolean"?!t.followSymlinks:void 0,disregardIgnoreFiles:typeof t.useIgnoreFiles?.local=="boolean"?!t.useIgnoreFiles.local:void 0,disregardGlobalIgnoreFiles:typeof t.useIgnoreFiles?.global=="boolean"?!t.useIgnoreFiles.global:void 0,disregardParentIgnoreFiles:typeof t.useIgnoreFiles?.parent=="boolean"?!t.useIgnoreFiles.parent:void 0,disregardExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings===mb.None,disregardSearchExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings!==mb.SearchAndFilesExclude,maxResults:t.maxResults,excludePattern:a.length>0?a:void 0,_reason:"startFileSearch",shouldGlobSearch:e.type==="include"?void 0:!0},c=PK(Kg.from(o)),d=c?.folder;return e.type==="include"?l.includePattern=c?.pattern:l.filePattern=c?.pattern,{folder:d,options:l}});return this._findFilesBase(r,i)}async _findFilesBase(e,t){return(await Promise.all(e?.map(s=>this._proxy.$startFileSearch(s.folder??null,s.options,t).then(r=>Array.isArray(r)?r.map(o=>N.revive(o)):[]))??[])).flat()}findTextInFiles2(e,t,i,s=et.None){this._logService.trace(`extHostWorkspace#findTextInFiles2: textSearch, extension: ${i.value}, entryPoint: findTextInFiles2`);const r=u=>{if(!t)return{folder:void 0,options:{}};const g=u?PK(Kg.from(u)):void 0,p=t.exclude?EVe(t.exclude):void 0;return{options:{ignoreSymlinks:typeof t.followSymlinks=="boolean"?!t.followSymlinks:void 0,disregardIgnoreFiles:typeof t.useIgnoreFiles=="boolean"?!t.useIgnoreFiles:void 0,disregardGlobalIgnoreFiles:typeof t.useIgnoreFiles?.global=="boolean"?!t.useIgnoreFiles?.global:void 0,disregardParentIgnoreFiles:typeof t.useIgnoreFiles?.parent=="boolean"?!t.useIgnoreFiles?.parent:void 0,disregardExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings===mb.None,disregardSearchExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings!==mb.SearchAndFilesExclude,fileEncoding:t.encoding,maxResults:t.maxResults,previewOptions:t.previewOptions?{matchLines:t.previewOptions?.numMatchLines??100,charsPerLine:t.previewOptions?.charsPerLine??1e4}:void 0,surroundingContext:t.surroundingContext,includePattern:g?.pattern,excludePattern:p},folder:g?.folder}},a=(t?.include?.map(u=>r(u))??[r(void 0)]).filter(u=>!!u),l=new ie,c=l.add(new A),d=this.findTextInFilesBase(e,a,(u,g)=>c.fire({result:u,uri:g}),s);return{results:new eh(async u=>{l.add(c.event(g=>{const p=g.result,m=g.uri;mVe(p)?u.emitOne(new _C(m,p.rangeLocations.map(_=>({previewRange:new Zn(_.preview.startLineNumber,_.preview.startColumn,_.preview.endLineNumber,_.preview.endColumn),sourceRange:new Zn(_.source.startLineNumber,_.source.startColumn,_.source.endLineNumber,_.source.endColumn)})),p.previewText)):u.emitOne(new Doe(m,p.text,p.lineNumber))})),await d}),complete:d.then(u=>(l.dispose(),{limitHit:u?.limitHit??!1}))}}async findTextInFilesBase(e,t,i,s=et.None){const r=this._requestIdProvider.getNext();let o=!1;if(s.onCancellationRequested(a=>{o=!0}),this._activeSearchCallbacks[r]=a=>{if(o)return;const l=N.revive(a.resource);a.results.forEach(c=>{const d=nr(c);i(d,l)})},s.isCancellationRequested)return{};try{const a=await Promise.all(t?.map(l=>this._proxy.$startTextSearch(e,l.folder??null,l.options,r,s)||{})??[]);return delete this._activeSearchCallbacks[r],a.reduce((l,c)=>({limitHit:l?.limitHit||(c?.limitHit??!1),message:[l?.message??[],c?.message??[]].flat()}),{})??{limitHit:!1}}catch(a){throw delete this._activeSearchCallbacks[r],a}}async findTextInFiles(e,t,i,s,r=et.None){this._logService.trace(`extHostWorkspace#findTextInFiles: textSearch, extension: ${s.value}, entryPoint: findTextInFiles`);const o=typeof t.previewOptions>"u"?{matchLines:100,charsPerLine:1e4}:t.previewOptions,a=PK(Kg.from(t.include)),l=typeof t.exclude=="string"?t.exclude:t.exclude?t.exclude.pattern:void 0,c={ignoreSymlinks:typeof t.followSymlinks=="boolean"?!t.followSymlinks:void 0,disregardIgnoreFiles:typeof t.useIgnoreFiles=="boolean"?!t.useIgnoreFiles:void 0,disregardGlobalIgnoreFiles:typeof t.useGlobalIgnoreFiles=="boolean"?!t.useGlobalIgnoreFiles:void 0,disregardParentIgnoreFiles:typeof t.useParentIgnoreFiles=="boolean"?!t.useParentIgnoreFiles:void 0,disregardExcludeSettings:typeof t.useDefaultExcludes=="boolean"?!t.useDefaultExcludes:!0,disregardSearchExcludeSettings:typeof t.useSearchExclude=="boolean"?!t.useSearchExclude:!0,fileEncoding:t.encoding,maxResults:t.maxResults,previewOptions:o,surroundingContext:t.afterContext,includePattern:a?.pattern,excludePattern:l?[{pattern:l}]:void 0},d=(h,u)=>{mVe(h)?i({uri:u,preview:{text:h.previewText,matches:Nue(h.rangeLocations,g=>new Zn(g.preview.startLineNumber,g.preview.startColumn,g.preview.endLineNumber,g.preview.endColumn))},ranges:Nue(h.rangeLocations,g=>new Zn(g.source.startLineNumber,g.source.startColumn,g.source.endLineNumber,g.source.endColumn))}):i({uri:u,text:h.text,lineNumber:h.lineNumber})};return this.findTextInFilesBase(e,[{options:c,folder:a?.folder}],d,r)}$handleTextSearchResult(e,t){this._activeSearchCallbacks[t]?.(e)}async save(e){const t=await this._proxy.$save(e,{saveAs:!1});return N.revive(t)}async saveAs(e){const t=await this._proxy.$save(e,{saveAs:!0});return N.revive(t)}saveAll(e){return this._proxy.$saveAll(e)}resolveProxy(e){return this._proxy.$resolveProxy(e)}lookupAuthorization(e){return this._proxy.$lookupAuthorization(e)}lookupKerberosAuthorization(e){return this._proxy.$lookupKerberosAuthorization(e)}loadCertificates(){return this._proxy.$loadCertificates()}get trusted(){return this._trusted}requestWorkspaceTrust(e){return this._proxy.$requestWorkspaceTrust(e)}$onDidGrantWorkspaceTrust(){this._trusted||(this._trusted=!0,this._onDidGrantWorkspaceTrust.fire())}registerEditSessionIdentityProvider(e,t){if(this._editSessionIdentityProviders.has(e))throw new Error(`A provider has already been registered for scheme ${e}`);this._editSessionIdentityProviders.set(e,t);const i=this._uriTransformerService.transformOutgoingScheme(e),s=this._providerHandlePool++;return this._proxy.$registerEditSessionIdentityProvider(s,i),ke(()=>{this._editSessionIdentityProviders.delete(e),this._proxy.$unregisterEditSessionIdentityProvider(s)})}async $getEditSessionIdentifier(e,t){this._logService.info("Getting edit session identifier for workspaceFolder",e);const i=await this.resolveWorkspaceFolder(N.revive(e));if(!i){this._logService.warn("Unable to resolve workspace folder");return}this._logService.info("Invoking #provideEditSessionIdentity for workspaceFolder",i);const s=this._editSessionIdentityProviders.get(i.uri.scheme);if(this._logService.info(`Provider for scheme ${i.uri.scheme} is defined: `,!!s),!s)return;const r=await s.provideEditSessionIdentity(i,t);if(this._logService.info("Provider returned edit session identifier: ",r),!!r)return r}async $provideEditSessionIdentityMatch(e,t,i,s){this._logService.info("Getting edit session identifier for workspaceFolder",e);const r=await this.resolveWorkspaceFolder(N.revive(e));if(!r){this._logService.warn("Unable to resolve workspace folder");return}this._logService.info("Invoking #provideEditSessionIdentity for workspaceFolder",r);const o=this._editSessionIdentityProviders.get(r.uri.scheme);if(this._logService.info(`Provider for scheme ${r.uri.scheme} is defined: `,!!o),!o)return;const a=await o.provideEditSessionIdentityMatch?.(t,i,s);if(this._logService.info("Provider returned edit session identifier match result: ",a),!!a)return a}getOnWillCreateEditSessionIdentityEvent(e){return(t,i,s)=>{const r=function(a){t.call(i,a)};return r.extension=e,this._onWillCreateEditSessionIdentityEvent.event(r,void 0,s)}}async $onWillCreateEditSessionIdentity(e,t,i){const s=await this.resolveWorkspaceFolder(N.revive(e));if(s===void 0)throw new Error("Unable to resolve workspace folder");await this._onWillCreateEditSessionIdentityEvent.fireAsync({workspaceFolder:s},t,async(r,o)=>{const a=Date.now();await Promise.resolve(r),Date.now()-a>i&&this._logService.warn("SLOW edit session create-participant",o.extension.identifier)}),t.isCancellationRequested}registerCanonicalUriProvider(e,t){if(this._canonicalUriProviders.has(e))throw new Error(`A provider has already been registered for scheme ${e}`);this._canonicalUriProviders.set(e,t);const i=this._uriTransformerService.transformOutgoingScheme(e),s=this._providerHandlePool++;return this._proxy.$registerCanonicalUriProvider(s,i),ke(()=>{this._canonicalUriProviders.delete(e),this._proxy.$unregisterCanonicalUriProvider(s)})}async provideCanonicalUri(e,t,i){const s=this._canonicalUriProviders.get(e.scheme);if(!s)return;const r=await s.provideCanonicalUri?.(N.revive(e),t,i);if(r)return r}async $provideCanonicalUri(e,t,i){return this.provideCanonicalUri(N.revive(e),{targetScheme:t},i)}async decode(e,t){const[i,s]=this.toEncodeDecodeParameters(t),r=await this._proxy.$resolveDecoding(i,s),o=(await Ttt(H9(Ye.wrap(e)),{...r,acceptTextOnly:!0,overwriteEncoding:a=>a===null||a===r.preferredEncoding?Promise.resolve(r.preferredEncoding):this._proxy.$validateDetectedEncoding(i,a,s)})).stream;return Qre(o,a=>a.join(""))}async encode(e,t){const[i,s]=this.toEncodeDecodeParameters(t),{encoding:r,addBOM:o}=await this._proxy.$resolveEncoding(i,s);if(r===Nc&&!o)return Ye.fromString(e).buffer;const a=await Ltt(Att(e),r,{addBOM:o});return Tze(a).buffer}toEncodeDecodeParameters(e){const t=Oj(e?.uri)?e.uri:void 0,i=typeof e?.encoding=="string"?e.encoding:void 0;return[t,i?{encoding:i}:void 0]}};Xwe=y([v(0,dr),v(1,Yc),v(2,$H),v(3,it),v(4,Lle)],Xwe);const rx=de("IExtHostWorkspace");function PK(n){let e,t;if(n)return typeof n=="string"?e=n:(e=n.pattern,t=N.revive(n.baseUri)),{pattern:e,folder:t}}function EVe(n){return(n?.map(e=>{if(typeof e=="string")return e===""?void 0:{pattern:e,uri:void 0};{const t=PK(e);return t?{pattern:t.pattern,uri:t.folder}:void 0}})??[]).filter(e=>!!e)}var l4,Ck;let Qwe=(Ck=class{constructor(e,t){this._logService=t,this._provider=new Map,this._proxy=e.getProxy(Xe.MainThreadDecorations)}registerFileDecorationProvider(e,t){const i=l4._handlePool++;this._provider.set(i,{provider:e,extensionDescription:t}),this._proxy.$registerDecorationProvider(i,t.identifier.value);const s=e.onDidChangeFileDecorations&&e.onDidChangeFileDecorations(r=>{if(!r){this._proxy.$onDidChange(i,null);return}const o=hu(r);if(o.length<=l4._maxEventSize){this._proxy.$onDidChange(i,o);return}this._logService.warn("[Decorations] CAPPING events from decorations provider",t.identifier.value,o.length);const a=o.map(d=>({uri:d,rank:hct(d.path,"/")})),l=W3(a,(d,h)=>d.rank-h.rank||fm(d.uri.path,h.uri.path)),c=[];e:for(const d of l){let h;for(const u of d){const g=UD(u.uri.path);if(h!==g&&(h=g,c.push(u.uri)>=l4._maxEventSize))break e}}this._proxy.$onDidChange(i,c)});return new bs(()=>{s?.dispose(),this._proxy.$unregisterDecorationProvider(i),this._provider.delete(i)})}async $provideDecorations(e,t,i){if(!this._provider.has(e))return Object.create(null);const s=Object.create(null),{provider:r,extensionDescription:o}=this._provider.get(e);return await Promise.all(t.map(async a=>{try{const{uri:l,id:c}=a,d=await Promise.resolve(r.provideFileDecoration(N.revive(l),i));if(!d)return;try{C$.validate(d),d.badge&&typeof d.badge!="string"&&Qe(o,"codiconDecoration"),s[c]=[d.propagate,d.tooltip,d.badge,d.color]}catch(h){this._logService.warn(`INVALID decoration from extension '${o.identifier.value}': ${h}`)}}catch(l){this._logService.error(l)}})),s}},l4=Ck,Ck._handlePool=0,Ck._maxEventSize=250,Ck);Qwe=l4=y([v(0,dr),v(1,it)],Qwe);const Ntt=de("IExtHostDecorations");function Oq(n,e){if(e){const t=e.split(".");let i=n;for(let s=0;i&&s<t.length;s++)i=i[t[s]];return i}}function WFt(n){return n instanceof N}function BFt(n){return n&&n.uri instanceof N&&n.languageId&&typeof n.languageId=="string"}function HFt(n){return n&&!n.uri&&n.languageId&&typeof n.languageId=="string"}function VFt(n){return n&&n.uri instanceof N&&(!n.name||typeof n.name=="string")&&(!n.index||typeof n.index=="number")}function xVe(n){if(WFt(n))return{resource:n};if(BFt(n))return{resource:n.uri,overrideIdentifier:n.languageId};if(HFt(n))return{overrideIdentifier:n.languageId};if(VFt(n))return{resource:n.uri};if(n===null)return{resource:null}}let Zwe=class{constructor(e,t,i){this._proxy=e.getProxy(Xe.MainThreadConfiguration),this._extHostWorkspace=t,this._logService=i,this._barrier=new Lh,this._actual=null}getConfigProvider(){return this._barrier.wait().then(e=>this._actual)}$initializeConfiguration(e){this._actual=new UFt(this._proxy,this._extHostWorkspace,e,this._logService),this._barrier.open()}$acceptConfigurationChanged(e,t){this.getConfigProvider().then(i=>i.$acceptConfigurationChanged(e,t))}};Zwe=y([v(0,dr),v(1,rx),v(2,it)],Zwe);class UFt{constructor(e,t,i,s){this._onDidChangeConfiguration=new A,this._proxy=e,this._logService=s,this._extHostWorkspace=t,this._configuration=z7.parse(i,s),this._configurationScopes=this._toMap(i.configurationScopes)}get onDidChangeConfiguration(){return this._onDidChangeConfiguration&&this._onDidChangeConfiguration.event}$acceptConfigurationChanged(e,t){const i={data:this._configuration.toData(),workspace:this._extHostWorkspace.workspace};this._configuration=z7.parse(e,this._logService),this._configurationScopes=this._toMap(e.configurationScopes),this._onDidChangeConfiguration.fire(this._toConfigurationChangeEvent(t,i))}getConfiguration(e,t,i){const s=xVe(t)||{},r=this._toReadonlyValue(this._configuration.getValue(e,s,this._extHostWorkspace.workspace));e&&this._validateConfigurationAccess(e,s,i?.identifier);function o(l){if(l==null)return null;if(typeof l=="boolean")return l?Wt.USER:Wt.WORKSPACE;switch(l){case P1.Global:return Wt.USER;case P1.Workspace:return Wt.WORKSPACE;case P1.WorkspaceFolder:return Wt.WORKSPACE_FOLDER}}const a={has(l){return typeof Oq(r,l)<"u"},get:(l,c)=>{this._validateConfigurationAccess(e?`${e}.${l}`:l,s,i?.identifier);let d=Oq(r,l);if(typeof d>"u")d=c;else{let h;const u=(g,p)=>{if(zn(g)){let m;const _=()=>{h=h||Ls(r),m=m||Oq(h,p)};return new Proxy(g,{get:(w,b)=>{if(typeof b=="string"&&b.toLowerCase()==="tojson")return _(),()=>m;if(h)return m=m||Oq(h,p),m[b];const S=w[b];return typeof b=="string"?u(S,`${p}.${b}`):S},set:(w,b,S)=>(_(),m&&(m[b]=S),!0),deleteProperty:(w,b)=>(_(),m&&delete m[b],!0),defineProperty:(w,b,S)=>(_(),m&&Object.defineProperty(m,b,S),!0)})}return Array.isArray(g)?Ls(g):g};d=u(d,l)}return d},update:(l,c,d,h)=>{l=e?`${e}.${l}`:l;const u=o(d);return c!==void 0?this._proxy.$updateConfigurationOption(u,l,c,s,h):this._proxy.$removeConfigurationOption(u,l,s,h)},inspect:l=>{l=e?`${e}.${l}`:l;const c=this._configuration.inspect(l,s,this._extHostWorkspace.workspace);if(c)return{key:l,defaultValue:Ls(c.policy?.value??c.default?.value),globalLocalValue:Ls(c.userLocal?.value),globalRemoteValue:Ls(c.userRemote?.value),globalValue:Ls(c.user?.value??c.application?.value),workspaceValue:Ls(c.workspace?.value),workspaceFolderValue:Ls(c.workspaceFolder?.value),defaultLanguageValue:Ls(c.default?.override),globalLocalLanguageValue:Ls(c.userLocal?.override),globalRemoteLanguageValue:Ls(c.userRemote?.override),globalLanguageValue:Ls(c.user?.override??c.application?.override),workspaceLanguageValue:Ls(c.workspace?.override),workspaceFolderLanguageValue:Ls(c.workspaceFolder?.override),languageIds:Ls(c.overrideIdentifiers)}}};return typeof r=="object"&&dp(a,r,!1),Object.freeze(a)}_toReadonlyValue(e){const t=i=>zn(i)?new Proxy(i,{get:(s,r)=>t(s[r]),set:(s,r,o)=>{throw new Error(`TypeError: Cannot assign to read only property '${String(r)}' of object`)},deleteProperty:(s,r)=>{throw new Error(`TypeError: Cannot delete read only property '${String(r)}' of object`)},defineProperty:(s,r)=>{throw new Error(`TypeError: Cannot define property '${String(r)}' for a readonly object`)},setPrototypeOf:s=>{throw new Error("TypeError: Cannot set prototype for a readonly object")},isExtensible:()=>!1,preventExtensions:()=>!0}):i;return t(e)}_validateConfigurationAccess(e,t,i){const s=tg.test(e)?Ct.RESOURCE:this._configurationScopes.get(e),r=i?`[${i.value}] `:"";if(Ct.RESOURCE===s){typeof t?.resource>"u"&&this._logService.warn(`${r}Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '${e}', provide the URI of a resource or 'null' for any resource.`);return}if(Ct.WINDOW===s){t?.resource&&this._logService.warn(`${r}Accessing a window scoped configuration for a resource is not expected. To associate '${e}' to a resource, define its scope to 'resource' in configuration contributions in 'package.json'.`);return}}_toConfigurationChangeEvent(e,t){const i=new bRe(e,t,this._configuration,this._extHostWorkspace.workspace,this._logService);return Object.freeze({affectsConfiguration:(s,r)=>i.affectsConfiguration(s,xVe(r))})}_toMap(e){return e.reduce((t,i)=>(t.set(i[0],i[1]),t),new Map)}}const ox=de("IExtHostConfiguration"),uT=(n,e,t,i)=>{let s=e;return{enumerable:!0,configurable:!1,get(){return s},set(r){if(!t(s,r)){const o=s;s=r,n.listener?.(i(r,o))}}}},qN=(n,e)=>n===e,gx={range:(n,e)=>n===e?!0:!n||!e?!1:n.isEqual(e),label:qN,description:qN,sortText:qN,busy:qN,error:qN,canResolveChildren:qN,tags:(n,e)=>!(n.length!==e.length||n.some(t=>!e.find(i=>t.id===i.id)))},GN=n=>e=>({op:Ud.SetProp,update:n(e)}),$Ft=(n,e)=>({range:(()=>{let t;const i=GN(s=>({range:M.lift(ft.from(s))}));return{enumerable:!0,configurable:!1,get(){return t},set(s){n.listener?.({op:Ud.DocumentSynced}),gx.range(t,s)||(t=s,n.listener?.(i(s)))}}})(),label:uT(n,e,gx.label,GN(t=>({label:t}))),description:uT(n,void 0,gx.description,GN(t=>({description:t}))),sortText:uT(n,void 0,gx.sortText,GN(t=>({sortText:t}))),canResolveChildren:uT(n,!1,gx.canResolveChildren,t=>({op:Ud.UpdateCanResolveChildren,state:t})),busy:uT(n,!1,gx.busy,GN(t=>({busy:t}))),error:uT(n,void 0,gx.error,GN(t=>({error:Cn.fromStrict(t)||null}))),tags:uT(n,[],gx.tags,(t,i)=>({op:Ud.SetTags,new:t.map(dw.from),old:i.map(dw.from)}))}),zFt=n=>{const e=Rn.fromString(n.extId),t=new mN(e.controllerId,e.localId,n.label,N.revive(n.uri)||void 0);return t.range=ft.to(n.range||void 0),t.description=n.description||void 0,t.sortText=n.sortText||void 0,t.tags=n.tags.map(i=>dw.to({id:wtt(i).tagId})),t},DVe=n=>{let e;for(const t of n.tests){const i=zFt(t.item);Ile(i).parent=e,e=i}return e};class mN{constructor(e,t,i,s){if(t.includes(Fp.Delimiter))throw new Error(`Test IDs may not include the ${JSON.stringify(t)} symbol`);const r=sFt(this,e);Object.defineProperties(this,{id:{value:t,enumerable:!0,writable:!1},uri:{value:s,enumerable:!0,writable:!1},parent:{enumerable:!1,get(){return r.parent instanceof XAe?void 0:r.parent}},children:{value:nFt(r,Ile,mN),enumerable:!0,writable:!1},...$Ft(r,i)})}}class XAe extends mN{constructor(e,t){super(e,e,t,void 0),this._isRoot=!0}}class qFt extends eFt{constructor(e,t,i){super({controllerId:e,getDocumentVersion:s=>s&&i.getDocument(s)?.version,getApiFor:Ile,getChildren:s=>s.children,root:new XAe(e,t),toITestItem:CI.from})}}let Jwe=class extends V{constructor(e,t,i){super(),this.initData=t,this._onDidChangeTelemetryEnabled=this._register(new A),this.onDidChangeTelemetryEnabled=this._onDidChangeTelemetryEnabled.event,this._onDidChangeTelemetryConfiguration=this._register(new A),this.onDidChangeTelemetryConfiguration=this._onDidChangeTelemetryConfiguration.event,this._productConfig={usage:!0,error:!0},this._level=$u.NONE,this._inLoggingOnlyMode=!1,this._telemetryLoggers=new Map,this._inLoggingOnlyMode=this.initData.environment.isExtensionTelemetryLoggingOnly;const s=t.remote.isRemote?"remoteExtHostTelemetry":e?"workerExtHostTelemetry":"extHostTelemetry";this._outputLogger=this._register(i.createLogger(s,{name:f(2635,"Extension Telemetry{0}",this._inLoggingOnlyMode?" (Not Sent)":""),hidden:!0,group:Rft}))}getTelemetryConfiguration(){return this._level===$u.USAGE}getTelemetryDetails(){return{isCrashEnabled:this._level>=$u.CRASH,isErrorsEnabled:this._productConfig.error?this._level>=$u.ERROR:!1,isUsageEnabled:this._productConfig.usage?this._level>=$u.USAGE:!1}}instantiateLogger(e,t,i){const s=this.getTelemetryDetails(),r=new Mtt(t,i,e,this._outputLogger,this._inLoggingOnlyMode,this.getBuiltInCommonProperties(e),{isUsageEnabled:s.isUsageEnabled,isErrorsEnabled:s.isErrorsEnabled}),o=this._telemetryLoggers.get(e.identifier.value)??[];return this._telemetryLoggers.set(e.identifier.value,[...o,r]),r.apiTelemetryLogger}$initializeTelemetryLevel(e,t,i){this._level=e,this._productConfig=i??{usage:!0,error:!0}}getBuiltInCommonProperties(e){const t=Object.create(null);switch(t["common.extname"]=`${e.publisher}.${e.name}`,t["common.extversion"]=e.version,t["common.vscodemachineid"]=this.initData.telemetryInfo.machineId,t["common.vscodesessionid"]=this.initData.telemetryInfo.sessionId,t["common.vscodecommithash"]=this.initData.commit,t["common.sqmid"]=this.initData.telemetryInfo.sqmId,t["common.devDeviceId"]=this.initData.telemetryInfo.devDeviceId,t["common.vscodeversion"]=this.initData.version,t["common.vscodereleasedate"]=this.initData.date,t["common.isnewappinstall"]=Ott(this.initData.telemetryInfo.firstSessionDate),t["common.product"]=this.initData.environment.appHost,this.initData.uiKind){case x_.Web:t["common.uikind"]="web";break;case x_.Desktop:t["common.uikind"]="desktop";break;default:t["common.uikind"]="unknown"}return t["common.remotename"]=K9(Nft(this.initData.remote.authority)),t}$onDidChangeTelemetryLevel(e){this._oldTelemetryEnablement=this.getTelemetryConfiguration(),this._level=e;const t=this.getTelemetryDetails();this._telemetryLoggers.forEach((i,s)=>{const r=i.filter(o=>!o.isDisposed);r.length===0?this._telemetryLoggers.delete(s):this._telemetryLoggers.set(s,r)}),this._telemetryLoggers.forEach(i=>{for(const s of i)s.updateTelemetryEnablements(t.isUsageEnabled,t.isErrorsEnabled)}),this._oldTelemetryEnablement!==this.getTelemetryConfiguration()&&this._onDidChangeTelemetryEnabled.fire(this.getTelemetryConfiguration()),this._onDidChangeTelemetryConfiguration.fire(this.getTelemetryDetails())}onExtensionError(e,t){const s=this._telemetryLoggers.get(e.value)?.filter(o=>!o.isDisposed);if(!s)return this._telemetryLoggers.delete(e.value),!1;let r=!1;for(const o of s)o.ignoreUnhandledExtHostErrors||(o.logError(t),r=!0);return r}};Jwe=y([v(1,Yc),v(2,Sc)],Jwe);class Mtt{static validateSender(e){if(typeof e!="object")throw new TypeError("TelemetrySender argument is invalid");if(typeof e.sendEventData!="function")throw new TypeError("TelemetrySender.sendEventData must be a function");if(typeof e.sendErrorData!="function")throw new TypeError("TelemetrySender.sendErrorData must be a function");if(typeof e.flush<"u"&&typeof e.flush!="function")throw new TypeError("TelemetrySender.flush must be a function or undefined")}constructor(e,t,i,s,r,o,a){this._extension=i,this._logger=s,this._inLoggingOnlyMode=r,this._commonProperties=o,this._onDidChangeEnableStates=new A,this.ignoreUnhandledExtHostErrors=t?.ignoreUnhandledErrors??!1,this._ignoreBuiltinCommonProperties=t?.ignoreBuiltInCommonProperties??!1,this._additionalCommonProperties=t?.additionalCommonProperties,this._sender=e,this._telemetryEnablements={isUsageEnabled:a.isUsageEnabled,isErrorsEnabled:a.isErrorsEnabled}}updateTelemetryEnablements(e,t){this._apiObject&&(this._telemetryEnablements={isUsageEnabled:e,isErrorsEnabled:t},this._onDidChangeEnableStates.fire(this._apiObject))}mixInCommonPropsAndCleanData(e){let t="properties"in e?e.properties??{}:e;return t=vOe(t,[]),this._additionalCommonProperties&&(t=dp(t,this._additionalCommonProperties)),this._ignoreBuiltinCommonProperties||(t=dp(t,this._commonProperties)),"properties"in e?e.properties=t:e=t,e}logEvent(e,t){this._sender&&(this._extension.publisher==="vscode"?e=this._extension.name+"/"+e:e=this._extension.identifier.value+"/"+e,t=this.mixInCommonPropsAndCleanData(t||{}),this._inLoggingOnlyMode||this._sender?.sendEventData(e,t),this._logger.trace(e,t))}logUsage(e,t){this._telemetryEnablements.isUsageEnabled&&this.logEvent(e,t)}logError(e,t){if(!(!this._telemetryEnablements.isErrorsEnabled||!this._sender))if(typeof e=="string")this.logEvent(e,t);else{const i={name:e.name,message:e.message,stack:e.stack,cause:e.cause},s=vOe(i,[]),r=new Error(s.message,{cause:s.cause});r.stack=s.stack,r.name=s.name,t=this.mixInCommonPropsAndCleanData(t||{}),this._inLoggingOnlyMode||this._sender.sendErrorData(r,t),this._logger.trace("exception",t)}}get apiTelemetryLogger(){if(!this._apiObject){const e=this,t={logUsage:e.logUsage.bind(e),get isUsageEnabled(){return e._telemetryEnablements.isUsageEnabled},get isErrorsEnabled(){return e._telemetryEnablements.isErrorsEnabled},logError:e.logError.bind(e),dispose:e.dispose.bind(e),onDidChangeEnableStates:e._onDidChangeEnableStates.event.bind(e)};this._apiObject=Object.freeze(t)}return this._apiObject}get isDisposed(){return!this._sender}dispose(){if(this._sender?.flush){let e=this._sender;this._sender=void 0,Promise.resolve(e.flush()).then(e=void 0),this._apiObject=void 0}else this._sender=void 0}}function Ott(n){const e=Date.now()-new Date(n).getTime();return isNaN(e)?!1:e<1e3*60*60*24}const Rle=de("IExtHostTelemetry");let ebe=class{#e;#t;#i;constructor(e,t,i){this._commands=new Map,this._apiCommands=new Map,this.#e=e.getProxy(Xe.MainThreadCommands),this._logService=t,this.#i=i,this.#t=e.getProxy(Xe.MainThreadTelemetry),this.converter=new GFt(this,s=>{const r=this._apiCommands.get(s);return r?.result===dn.Void?r:void 0},t),this._argumentProcessors=[{processArgument(s){return nr(s)}},{processArgument(s){return rI(s,function(r){if(M.isIRange(r))return ft.to(r);if(oe.isIPosition(r))return Fr.to(r);if(M.isIRange(r.range)&&N.isUri(r.uri))return fg.to(r);if(r instanceof Ye)return r.buffer.buffer;if(!Array.isArray(r))return r})}}]}registerArgumentProcessor(e){this._argumentProcessors.push(e)}registerApiCommand(e){const t=this.registerCommand(!1,e.id,async(...i)=>{const s=e.args.map((o,a)=>{if(!o.validate(i[a]))throw new Error(`Invalid argument '${o.name}' when running '${e.id}', received: ${typeof i[a]=="object"?JSON.stringify(i[a],null," "):i[a]} `);return o.convert(i[a])}),r=await this.executeCommand(e.internalId,...s);return e.result.convert(r,i,this.converter)},void 0,{description:e.description,args:e.args,returns:e.result.description});return this._apiCommands.set(e.id,e),new bs(()=>{t.dispose(),this._apiCommands.delete(e.id)})}registerCommand(e,t,i,s,r,o){if(this._logService.trace("ExtHostCommands#registerCommand",t),!t.trim().length)throw new Error("invalid id");if(this._commands.has(t))throw new Error(`command '${t}' already exists`);return this._commands.set(t,{callback:i,thisArg:s,metadata:r,extension:o}),e&&this.#e.$registerCommand(t),new bs(()=>{this._commands.delete(t)&&e&&this.#e.$unregisterCommand(t)})}executeCommand(e,...t){return this._logService.trace("ExtHostCommands#executeCommand",e),this._doExecuteCommand(e,t,!0)}async _doExecuteCommand(e,t,i){if(this._commands.has(e))return this.#e.$fireCommandActivationEvent(e),this._executeContributedCommand(e,t,!1);{let s=!1;const r=rI(t,function(o){if(o instanceof Ts)return Fr.from(o);if(o instanceof Zn)return ft.from(o);if(o instanceof cp)return fg.from(o);if(Tv.isNotebookRange(o))return ly.from(o);if(o instanceof ArrayBuffer)return s=!0,Ye.wrap(new Uint8Array(o));if(o instanceof Uint8Array)return s=!0,Ye.wrap(o);if(o instanceof Ye)return s=!0,o;if(!Array.isArray(o))return o});try{const o=await this.#e.$executeCommand(e,s?new ll(r):r,i);return nr(o)}catch(o){if(o instanceof Error&&o.message==="$executeCommand:retry")return this._doExecuteCommand(e,t,!1);throw o}}}async _executeContributedCommand(e,t,i){const s=this._commands.get(e);if(!s)throw new Error("Unknown command");const{callback:r,thisArg:o,metadata:a}=s;if(a?.args)for(let c=0;c<a.args.length;c++)try{kze(t[c],a.args[c].constraint)}catch{throw new Error(`Running the contributed command: '${e}' failed. Illegal argument '${a.args[c].name}' - ${a.args[c].description}`)}const l=sr.create();try{return await r.apply(o,t)}catch(c){if(e===this.converter.delegatingCommandId){const d=this.converter.getActualCommand(...t);d&&(e=d.command)}if(Xr(c)||this._logService.error(c,e,s.extension?.identifier),!i)throw c;if(s.extension?.identifier){const d=this.#i.onExtensionError(s.extension.identifier,c);this._logService.trace("forwarded error to extension?",d,s.extension?.identifier)}throw new class extends Error{constructor(){super(af(c)),this.id=e,this.source=s.extension?.displayName??s.extension?.name}}}finally{this._reportTelemetry(s,e,l.elapsed())}}_reportTelemetry(e,t,i){e.extension&&(t.startsWith("code.copilot.logStructured")||this.#t.$publicLog2("Extension:ActionExecuted",{extensionId:e.extension.identifier.value,id:new Aoe(t),duration:i}))}$executeContributedCommand(e,...t){this._logService.trace("ExtHostCommands#$executeContributedCommand",e);const i=this._commands.get(e);return i?(t=t.map(s=>this._argumentProcessors.reduce((r,o)=>o.processArgument(r,i.extension),s)),this._executeContributedCommand(e,t,!0)):Promise.reject(new Error(`Contributed command '${e}' does not exist.`))}getCommands(e=!1){return this._logService.trace("ExtHostCommands#getCommands",e),this.#e.$getCommands().then(t=>(e&&(t=t.filter(i=>i[0]!=="_")),t))}$getContributedCommandMetadata(){const e=Object.create(null);for(const[t,i]of this._commands){const{metadata:s}=i;s&&(e[t]=s)}return Promise.resolve(e)}};ebe=y([v(0,dr),v(1,it),v(2,Rle)],ebe);const _N=de("IExtHostCommands");class GFt{constructor(e,t,i){this._commands=e,this._lookupApiCommand=t,this._logService=i,this.delegatingCommandId=`__vsc${Tr()}`,this._cache=new Map,this._cachIdPool=0,this._commands.registerCommand(!0,this.delegatingCommandId,this._executeConvertedCommand,this)}toInternal(e,t){if(!e)return;const i={$ident:void 0,id:e.command,title:e.title,tooltip:e.tooltip};if(!e.command)return i;const s=this._lookupApiCommand(e.command);if(s)i.id=s.internalId,i.arguments=s.args.map((r,o)=>r.convert(e.arguments&&e.arguments[o]));else if(Ir(e.arguments)){const r=`${e.command} /${++this._cachIdPool}`;this._cache.set(r,e),t.add(ke(()=>{this._cache.delete(r),this._logService.trace("CommandsConverter#DISPOSE",r)})),i.$ident=r,i.id=this.delegatingCommandId,i.arguments=[r],this._logService.trace("CommandsConverter#CREATE",e.command,r)}return i}fromInternal(e){return typeof e.$ident=="string"?this._cache.get(e.$ident):{command:e.id,title:e.title,arguments:e.arguments}}getActualCommand(...e){return this._cache.get(e[0])}_executeConvertedCommand(...e){const t=this.getActualCommand(...e);return this._logService.trace("CommandsConverter#EXECUTE",e[0],t?t.command:"MISSING"),t?this._commands.executeCommand(t.command,...t.arguments||[]):Promise.reject(`Actual command not found, wanted to execute ${e[0]}`)}}const el=class el{static Arr(e){return new el(`${e.name}_array`,`Array of ${e.name}, ${e.description}`,t=>Array.isArray(t)&&t.every(i=>e.validate(i)),t=>t.map(i=>e.convert(i)))}constructor(e,t,i,s){this.name=e,this.description=t,this.validate=i,this.convert=s}optional(){return new el(this.name,`(optional) ${this.description}`,e=>e==null||this.validate(e),e=>e===void 0?void 0:e===null?null:this.convert(e))}with(e,t){return new el(e??this.name,t??this.description,this.validate,this.convert)}};el.Uri=new el("uri","Uri of a text document",e=>N.isUri(e),e=>e),el.Position=new el("position","A position in a text document",e=>Ts.isPosition(e),Fr.from),el.Range=new el("range","A range in a text document",e=>Zn.isRange(e),ft.from),el.Selection=new el("selection","A selection in a text document",e=>Bv.isSelection(e),cw.from),el.Number=new el("number","",e=>typeof e=="number",e=>e),el.String=new el("string","",e=>typeof e=="string",e=>e),el.CallHierarchyItem=new el("item","A call hierarchy item",e=>e instanceof goe,lP.from),el.TypeHierarchyItem=new el("item","A type hierarchy item",e=>e instanceof moe,f0.from),el.TestItem=new el("testItem","A VS Code TestItem",e=>e instanceof mN,CI.from),el.TestProfile=new el("testProfile","A VS Code test profile",e=>e instanceof vGe,Iwe.from);let Tt=el;const One=class One{constructor(e,t){this.description=e,this.convert=t}};One.Void=new One("no result",e=>e);let dn=One;class yn{constructor(e,t,i,s,r){this.id=e,this.internalId=t,this.description=i,this.args=s,this.result=r}}const tbe=new Map;function KFt(n,e){e?tbe.set(n,e):tbe.delete(n)}function jFt(n){return tbe.get(n)}class YFt extends uZe{constructor(e,t,i,s,r,o,a,l){super(t,i,s,r),this._proxy=e,this._languageId=o,this._isDirty=a,this._encoding=l,this._isDisposed=!1}dispose(){Hu(!this._isDisposed),this._isDisposed=!0,this._isDirty=!1}equalLines(e){return En(this._lines,e)}get document(){if(!this._document){const e=this;this._document={get uri(){return e._uri},get fileName(){return e._uri.fsPath},get isUntitled(){return e._uri.scheme===ye.untitled},get languageId(){return e._languageId},get version(){return e._versionId},get isClosed(){return e._isDisposed},get isDirty(){return e._isDirty},get encoding(){return e._encoding},save(){return e._save()},getText(t){return t?e._getTextInRange(t):e.getText()},get eol(){return e._eol===`
|
|
877
877
|
`?u_.LF:u_.CRLF},get lineCount(){return e._lines.length},lineAt(t){return e._lineAt(t)},offsetAt(t){return e._offsetAt(t)},positionAt(t){return e._positionAt(t)},validateRange(t){return e._validateRange(t)},validatePosition(t){return e._validatePosition(t)},getWordRangeAtPosition(t,i){return e._getWordRangeAtPosition(t,i)},[Symbol.for("debug.description")](){return`TextDocument(${e._uri.toString()})`}}}return Object.freeze(this._document)}_acceptLanguageId(e){Hu(!this._isDisposed),this._languageId=e}_acceptIsDirty(e){Hu(!this._isDisposed),this._isDirty=e}_acceptEncoding(e){Hu(!this._isDisposed),this._encoding=e}_save(){return this._isDisposed?Promise.reject(new Error("Document has been closed")):this._proxy.$trySaveDocument(this._uri)}_getTextInRange(e){const t=this._validateRange(e);if(t.isEmpty)return"";if(t.isSingleLine)return this._lines[t.start.line].substring(t.start.character,t.end.character);const i=this._eol,s=t.start.line,r=t.end.line,o=[];o.push(this._lines[s].substring(t.start.character));for(let a=s+1;a<r;a++)o.push(this._lines[a]);return o.push(this._lines[r].substring(0,t.end.character)),o.join(i)}_lineAt(e){let t;if(e instanceof Ts?t=e.line:typeof e=="number"&&(t=e),typeof t!="number"||t<0||t>=this._lines.length||Math.floor(t)!==t)throw new Error("Illegal value for `line`");return new XFt(t,this._lines[t],t===this._lines.length-1)}_offsetAt(e){return e=this._validatePosition(e),this._ensureLineStarts(),this._lineStarts.getPrefixSum(e.line-1)+e.character}_positionAt(e){e=Math.floor(e),e=Math.max(0,e),this._ensureLineStarts();const t=this._lineStarts.getIndexOf(e),i=this._lines[t.index].length;return new Ts(t.index,Math.min(t.remainder,i))}_validateRange(e){if(!(e instanceof Zn))throw new Error("Invalid argument");const t=this._validatePosition(e.start),i=this._validatePosition(e.end);return t===e.start&&i===e.end?e:new Zn(t.line,t.character,i.line,i.character)}_validatePosition(e){if(!(e instanceof Ts))throw new Error("Invalid argument");if(this._lines.length===0)return e.with(0,0);let{line:t,character:i}=e,s=!1;if(t<0)t=0,i=0,s=!0;else if(t>=this._lines.length)t=this._lines.length-1,i=this._lines[t].length,s=!0;else{const r=this._lines[t].length;i<0?(i=0,s=!0):i>r&&(i=r,s=!0)}return s?new Ts(t,i):e}_getWordRangeAtPosition(e,t){const i=this._validatePosition(e);if(!t)t=jFt(this._languageId);else if(Jre(t))throw new Error(`[getWordRangeAtPosition]: ignoring custom regexp '${t.source}' because it matches the empty string.`);const s=aI(i.character+1,a6(t),this._lines[i.line],0);if(s)return new Zn(i.line,s.startColumn-1,i.line,s.endColumn-1)}}class XFt{constructor(e,t,i){this._line=e,this._text=t,this._isLastLine=i}get lineNumber(){return this._line}get text(){return this._text}get range(){return new Zn(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new Zn(this._line,0,this._line+1,0)}get firstNonWhitespaceCharacterIndex(){return/^(\s*)/.exec(this._text)[1].length}get isEmptyOrWhitespace(){return this.firstNonWhitespaceCharacterIndex===this._text.length}}const Fne=class Fne{constructor(e,t,i){const s=Fne._Keys.nextId();e.$registerTextEditorDecorationType(t.identifier,s,hwe.from(i)),this.value=Object.freeze({key:s,dispose(){e.$removeTextEditorDecorationType(s)}})}};Fne._Keys=new oH("TextEditorDecorationType");let ibe=Fne;class QFt{constructor(e,t){this._collectedEdits=[],this._setEndOfLine=void 0,this._finalized=!1,this._document=e,this._documentVersionId=e.version,this._undoStopBefore=t.undoStopBefore,this._undoStopAfter=t.undoStopAfter}finalize(){return this._finalized=!0,{documentVersionId:this._documentVersionId,edits:this._collectedEdits,setEndOfLine:this._setEndOfLine,undoStopBefore:this._undoStopBefore,undoStopAfter:this._undoStopAfter}}_throwIfFinalized(){if(this._finalized)throw new Error("Edit is only valid while callback runs")}replace(e,t){this._throwIfFinalized();let i=null;if(e instanceof Ts)i=new Zn(e,e);else if(e instanceof Zn)i=e;else throw new Error("Unrecognized location");this._pushEdit(i,t,!1)}insert(e,t){this._throwIfFinalized(),this._pushEdit(new Zn(e,e),t,!0)}delete(e){this._throwIfFinalized();let t=null;if(e instanceof Zn)t=e;else throw new Error("Unrecognized location");this._pushEdit(t,null,!0)}_pushEdit(e,t,i){const s=this._document.validateRange(e);this._collectedEdits.push({range:s,text:t,forceMoveMarkers:i})}setEndOfLine(e){if(this._throwIfFinalized(),e!==u_.LF&&e!==u_.CRLF)throw Gi("endOfLine");this._setEndOfLine=e}}class ZFt{constructor(e,t,i,s){this._proxy=e,this._id=t,this._accept(i),this._logService=s;const r=this;this.value={get tabSize(){return r._tabSize},set tabSize(o){r._setTabSize(o)},get indentSize(){return r._indentSize},set indentSize(o){r._setIndentSize(o)},get insertSpaces(){return r._insertSpaces},set insertSpaces(o){r._setInsertSpaces(o)},get cursorStyle(){return r._cursorStyle},set cursorStyle(o){r._setCursorStyle(o)},get lineNumbers(){return r._lineNumbers},set lineNumbers(o){r._setLineNumbers(o)}}}_accept(e){this._tabSize=e.tabSize,this._indentSize=e.indentSize,this._originalIndentSize=e.originalIndentSize,this._insertSpaces=e.insertSpaces,this._cursorStyle=e.cursorStyle,this._lineNumbers=fF.to(e.lineNumbers)}_validateTabSize(e){if(e==="auto")return"auto";if(typeof e=="number"){const t=Math.floor(e);return t>0?t:null}if(typeof e=="string"){const t=parseInt(e,10);return isNaN(t)?null:t>0?t:null}return null}_setTabSize(e){const t=this._validateTabSize(e);if(t!==null){if(typeof t=="number"){if(this._tabSize===t)return;this._tabSize=t}this._warnOnError("setTabSize",this._proxy.$trySetOptions(this._id,{tabSize:t}))}}_validateIndentSize(e){if(e==="tabSize")return"tabSize";if(typeof e=="number"){const t=Math.floor(e);return t>0?t:null}if(typeof e=="string"){const t=parseInt(e,10);return isNaN(t)?null:t>0?t:null}return null}_setIndentSize(e){const t=this._validateIndentSize(e);if(t!==null){if(typeof t=="number"){if(this._originalIndentSize===t)return;this._indentSize=t,this._originalIndentSize=t}this._warnOnError("setIndentSize",this._proxy.$trySetOptions(this._id,{indentSize:t}))}}_validateInsertSpaces(e){return e==="auto"?"auto":e==="false"?!1:!!e}_setInsertSpaces(e){const t=this._validateInsertSpaces(e);if(typeof t=="boolean"){if(this._insertSpaces===t)return;this._insertSpaces=t}this._warnOnError("setInsertSpaces",this._proxy.$trySetOptions(this._id,{insertSpaces:t}))}_setCursorStyle(e){this._cursorStyle!==e&&(this._cursorStyle=e,this._warnOnError("setCursorStyle",this._proxy.$trySetOptions(this._id,{cursorStyle:e})))}_setLineNumbers(e){this._lineNumbers!==e&&(this._lineNumbers=e,this._warnOnError("setLineNumbers",this._proxy.$trySetOptions(this._id,{lineNumbers:fF.from(e)})))}assign(e){const t={};let i=!1;if(typeof e.tabSize<"u"){const s=this._validateTabSize(e.tabSize);s==="auto"?(i=!0,t.tabSize=s):typeof s=="number"&&this._tabSize!==s&&(this._tabSize=s,i=!0,t.tabSize=s)}if(typeof e.indentSize<"u"){const s=this._validateIndentSize(e.indentSize);s==="tabSize"?(i=!0,t.indentSize=s):typeof s=="number"&&this._originalIndentSize!==s&&(this._indentSize=s,this._originalIndentSize=s,i=!0,t.indentSize=s)}if(typeof e.insertSpaces<"u"){const s=this._validateInsertSpaces(e.insertSpaces);s==="auto"?(i=!0,t.insertSpaces=s):this._insertSpaces!==s&&(this._insertSpaces=s,i=!0,t.insertSpaces=s)}typeof e.cursorStyle<"u"&&this._cursorStyle!==e.cursorStyle&&(this._cursorStyle=e.cursorStyle,i=!0,t.cursorStyle=e.cursorStyle),typeof e.lineNumbers<"u"&&this._lineNumbers!==e.lineNumbers&&(this._lineNumbers=e.lineNumbers,i=!0,t.lineNumbers=fF.from(e.lineNumbers)),i&&this._warnOnError("setOptions",this._proxy.$trySetOptions(this._id,t))}_warnOnError(e,t){t.catch(i=>{this._logService.warn(`ExtHostTextEditorOptions '${e}' failed:'`),this._logService.warn(i)})}}class JFt{constructor(e,t,i,s,r,o,a,l){this.id=e,this._proxy=t,this._logService=i,this._disposed=!1,this._hasDecorationsForKey=new Set,this._selections=r,this._options=new ZFt(this._proxy,this.id,o,i),this._visibleRanges=a,this._viewColumn=l;const c=this;this.value=Object.freeze({get document(){return s.value},set document(d){throw new ZL("document")},get selection(){return c._selections&&c._selections[0]},set selection(d){if(!(d instanceof Bv))throw Gi("selection");c._selections=[d],c._trySetSelection()},get selections(){return c._selections},set selections(d){if(!Array.isArray(d)||d.some(h=>!(h instanceof Bv)))throw Gi("selections");d.length===0&&(d=[new Bv(0,0,0,0)]),c._selections=d,c._trySetSelection()},get visibleRanges(){return c._visibleRanges},set visibleRanges(d){throw new ZL("visibleRanges")},get diffInformation(){return c._diffInformation},get options(){return c._options.value},set options(d){c._disposed||c._options.assign(d)},get viewColumn(){return c._viewColumn},set viewColumn(d){throw new ZL("viewColumn")},edit(d,h={undoStopBefore:!0,undoStopAfter:!0}){if(c._disposed)return Promise.reject(new Error("TextEditor#edit not possible on closed editors"));const u=new QFt(s.value,h);return d(u),c._applyEdit(u)},insertSnippet(d,h,u={undoStopBefore:!0,undoStopAfter:!0}){if(c._disposed)return Promise.reject(new Error("TextEditor#insertSnippet not possible on closed editors"));let g;if(!h||Array.isArray(h)&&h.length===0)g=c._selections.map(p=>ft.from(p));else if(h instanceof Ts){const{lineNumber:p,column:m}=Fr.from(h);g=[{startLineNumber:p,startColumn:m,endLineNumber:p,endColumn:m}]}else if(h instanceof Zn)g=[ft.from(h)];else{g=[];for(const p of h)if(p instanceof Zn)g.push(ft.from(p));else{const{lineNumber:m,column:_}=Fr.from(p);g.push({startLineNumber:m,startColumn:_,endLineNumber:m,endColumn:_})}}return u.keepWhitespace===void 0&&(u.keepWhitespace=!1),t.$tryInsertSnippet(e,s.value.version,d.value,g,u)},setDecorations(d,h){const u=h.length===0;u&&!c._hasDecorationsForKey.has(d.key)||(u?c._hasDecorationsForKey.delete(d.key):c._hasDecorationsForKey.add(d.key),c._runOnProxy(()=>{if(ytt(h))return t.$trySetDecorations(e,d.key,aFt(h));{const g=new Array(4*h.length);for(let p=0,m=h.length;p<m;p++){const _=h[p];g[4*p]=_.start.line+1,g[4*p+1]=_.start.character+1,g[4*p+2]=_.end.line+1,g[4*p+3]=_.end.character+1}return t.$trySetDecorationsFast(e,d.key,g)}}))},revealRange(d,h){c._runOnProxy(()=>t.$tryRevealRange(e,ft.from(d),h||c$.Default))},show(d){t.$tryShowEditor(e,pc.from(d))},hide(){t.$tryHideEditor(e)},[Symbol.for("debug.description")](){return`TextEditor(${this.document.uri.toString()})`}})}dispose(){Hu(!this._disposed),this._disposed=!0}_acceptOptions(e){Hu(!this._disposed),this._options._accept(e)}_acceptVisibleRanges(e){Hu(!this._disposed),this._visibleRanges=e}_acceptViewColumn(e){Hu(!this._disposed),this._viewColumn=e}_acceptSelections(e){Hu(!this._disposed),this._selections=e}_acceptDiffInformation(e){Hu(!this._disposed),this._diffInformation=e}async _trySetSelection(){const e=this._selections.map(cw.from);return await this._runOnProxy(()=>this._proxy.$trySetSelections(this.id,e)),this.value}_applyEdit(e){const t=e.finalize();if(t.edits.length===0&&!t.setEndOfLine)return Promise.resolve(!0);const i=t.edits.map(r=>r.range);i.sort((r,o)=>r.end.line===o.end.line?r.end.character===o.end.character?r.start.line===o.start.line?r.start.character-o.start.character:r.start.line-o.start.line:r.end.character-o.end.character:r.end.line-o.end.line);for(let r=0,o=i.length-1;r<o;r++){const a=i[r].end;if(i[r+1].start.isBefore(a))return Promise.reject(new Error("Overlapping ranges are not allowed!"))}const s=t.edits.map(r=>({range:ft.from(r.range),text:r.text,forceMoveMarkers:r.forceMoveMarkers}));return this._proxy.$tryApplyEdits(this.id,t.documentVersionId,s,{setEndOfLine:typeof t.setEndOfLine=="number"?jW.from(t.setEndOfLine):void 0,undoStopBefore:t.undoStopBefore,undoStopAfter:t.undoStopAfter})}_runOnProxy(e){return this._disposed?(this._logService.warn("TextEditor is closed/disposed"),Promise.resolve(void 0)):e().then(()=>this,t=>(t instanceof Error&&t.name==="DISPOSED"||this._logService.warn(t),null))}}class e2t{constructor(e){this.value=e,this._count=0}ref(){this._count++}unref(){return--this._count===0}}let nbe=class{constructor(e,t){this._extHostRpc=e,this._logService=t,this._activeEditorId=null,this._editors=new Map,this._documents=new Ni,this._onDidAddDocuments=new A,this._onDidRemoveDocuments=new A,this._onDidChangeVisibleTextEditors=new A,this._onDidChangeActiveTextEditor=new A,this.onDidAddDocuments=this._onDidAddDocuments.event,this.onDidRemoveDocuments=this._onDidRemoveDocuments.event,this.onDidChangeVisibleTextEditors=this._onDidChangeVisibleTextEditors.event,this.onDidChangeActiveTextEditor=this._onDidChangeActiveTextEditor.event}$acceptDocumentsAndEditorsDelta(e){this.acceptDocumentsAndEditorsDelta(e)}acceptDocumentsAndEditorsDelta(e){const t=[],i=[],s=[];if(e.removedDocuments)for(const r of e.removedDocuments){const o=N.revive(r),a=this._documents.get(o);a?.unref()&&(this._documents.delete(o),t.push(a.value))}if(e.addedDocuments)for(const r of e.addedDocuments){const o=N.revive(r.uri);let a=this._documents.get(o);if(a&&o.scheme!==ye.vscodeNotebookCell&&o.scheme!==ye.vscodeInteractiveInput)throw new Error(`document '${o} already exists!'`);a||(a=new e2t(new YFt(this._extHostRpc.getProxy(Xe.MainThreadDocuments),o,r.lines,r.EOL,r.versionId,r.languageId,r.isDirty,r.encoding)),this._documents.set(o,a),i.push(a.value)),a.ref()}if(e.removedEditors)for(const r of e.removedEditors){const o=this._editors.get(r);this._editors.delete(r),o&&s.push(o)}if(e.addedEditors)for(const r of e.addedEditors){const o=N.revive(r.documentUri);Hu(this._documents.has(o),`document '${o}' does not exist`),Hu(!this._editors.has(r.id),`editor '${r.id}' already exists!`);const a=this._documents.get(o).value,l=new JFt(r.id,this._extHostRpc.getProxy(Xe.MainThreadTextEditors),this._logService,new Ao(()=>a.document),r.selections.map(cw.to),r.options,r.visibleRanges.map(c=>ft.to(c)),typeof r.editorPosition=="number"?pc.to(r.editorPosition):void 0);this._editors.set(r.id,l)}e.newActiveEditor!==void 0&&(Hu(e.newActiveEditor===null||this._editors.has(e.newActiveEditor),`active editor '${e.newActiveEditor}' does not exist`),this._activeEditorId=e.newActiveEditor),zt(t),zt(s),e.removedDocuments&&this._onDidRemoveDocuments.fire(t),e.addedDocuments&&this._onDidAddDocuments.fire(i),(e.removedEditors||e.addedEditors)&&this._onDidChangeVisibleTextEditors.fire(this.allEditors().map(r=>r.value)),e.newActiveEditor!==void 0&&this._onDidChangeActiveTextEditor.fire(this.activeEditor())}getDocument(e){return this._documents.get(e)?.value}allDocuments(){return ri.map(this._documents.values(),e=>e.value)}getEditor(e){return this._editors.get(e)}activeEditor(e){if(!this._activeEditorId)return;const t=this._editors.get(this._activeEditorId);return e?t:t?.value}allEditors(){return[...this._editors.values()]}};nbe=y([v(0,dr),v(1,it)],nbe);const zH=de("IExtHostDocumentsAndEditors");function Ftt(n){return[...n.entries()]}function t2t(n){return n?[...n.entries()]:[]}function i2t(n){return new Map(n)}function n2t(n){return new Map(n??[])}class Wtt{constructor(e){this._callback=e,this._terminalBufferMap=new Map}dispose(){for(const e of this._terminalBufferMap.values())e.dispose()}startBuffering(e,t,i=5){const s=t(r=>{const o=typeof r=="string"?r:r.data;let a=this._terminalBufferMap.get(e);if(a){a.data.push(o);return}const l=setTimeout(()=>this.flushBuffer(e),i);a={data:[o],timeoutId:l,dispose:()=>{clearTimeout(l),this.flushBuffer(e),s.dispose()}},this._terminalBufferMap.set(e,a)});return s}stopBuffering(e){this._terminalBufferMap.get(e)?.dispose()}flushBuffer(e){const t=this._terminalBufferMap.get(e);t&&(this._terminalBufferMap.delete(e),this._callback(e,t.data.join("")))}}const qH=de("IExtHostTerminalService");class kVe extends V{constructor(e,t,i,s){super(),this._proxy=e,this._id=t,this._creationOptions=i,this._name=s,this._disposed=!1,this._state={isInteractedWith:!1,shell:void 0},this.isOpen=!1,this._onWillDispose=this._register(new A),this.onWillDispose=this._onWillDispose.event,this._creationOptions=Object.freeze(this._creationOptions),this._pidPromise=new Promise(o=>this._pidPromiseComplete=o);const r=this;this.value={get name(){return r._name||""},get processId(){return r._pidPromise},get creationOptions(){return r._creationOptions},get exitStatus(){return r._exitStatus},get state(){return r._state},get selection(){return r._selection},get shellIntegration(){return r.shellIntegration},sendText(o,a=!0){r._checkDisposed(),r._proxy.$sendText(r._id,o,a)},show(o){r._checkDisposed(),r._proxy.$show(r._id,o)},hide(){r._checkDisposed(),r._proxy.$hide(r._id)},dispose(){r._disposed||(r._disposed=!0,r._proxy.$dispose(r._id))},get dimensions(){if(!(r._cols===void 0||r._rows===void 0))return{columns:r._cols,rows:r._rows}}}}dispose(){this._onWillDispose.fire(),super.dispose()}async create(e,t){if(typeof this._id!="string")throw new Error("Terminal has already been created");await this._proxy.$createTerminal(this._id,{name:e.name,shellPath:e.shellPath??void 0,shellArgs:e.shellArgs??void 0,cwd:e.cwd??t?.cwd??void 0,env:e.env??void 0,icon:Btt(e.iconPath)??void 0,color:C2.isThemeColor(e.color)?e.color.id:void 0,initialText:e.message??void 0,strictEnv:e.strictEnv??void 0,hideFromUser:e.hideFromUser??void 0,forceShellIntegration:t?.forceShellIntegration??void 0,isFeatureTerminal:t?.isFeatureTerminal??void 0,isExtensionOwnedTerminal:!0,useShellEnvironment:t?.useShellEnvironment??void 0,location:t?.location||this._serializeParentTerminal(e.location,t?.resolvedExtHostIdentifier),isTransient:e.isTransient??void 0})}async createExtensionTerminal(e,t,i,s,r){if(typeof this._id!="string")throw new Error("Terminal has already been created");if(await this._proxy.$createTerminal(this._id,{name:this._name,isExtensionCustomPtyTerminal:!0,icon:s,color:C2.isThemeColor(r)?r.id:void 0,location:t?.location||this._serializeParentTerminal(e,i),isTransient:!0}),typeof this._id=="string")throw new Error("Terminal creation failed");return this._id}_serializeParentTerminal(e,t){return typeof e=="object"?"parentTerminal"in e&&e.parentTerminal&&t?{parentTerminal:t}:"viewColumn"in e?{viewColumn:pc.from(e.viewColumn),preserveFocus:e.preserveFocus}:void 0:e}_checkDisposed(){if(this._disposed)throw new Error("Terminal has already been disposed")}set name(e){this._name=e}setExitStatus(e,t){this._exitStatus=Object.freeze({code:e,reason:t})}setDimensions(e,t){return e===this._cols&&t===this._rows||e===0||t===0?!1:(this._cols=e,this._rows=t,!0)}setInteractedWith(){return this._state.isInteractedWith?!1:(this._state={...this._state,isInteractedWith:!0},!0)}setShellType(e){return this._state.shell!==e?(this._state={...this._state,shell:e},!0):!1}setSelection(e){this._selection=e}_setProcessId(e){this._pidPromiseComplete?(this._pidPromiseComplete(e),this._pidPromiseComplete=void 0):this._pidPromise.then(t=>{t!==e&&(this._pidPromise=Promise.resolve(e))})}}class the{get onProcessReady(){return this._onProcessReady.event}constructor(e){this._pty=e,this.id=0,this.shouldPersist=!1,this._onProcessData=new A,this.onProcessData=this._onProcessData.event,this._onProcessReady=new A,this._onDidChangeProperty=new A,this.onDidChangeProperty=this._onDidChangeProperty.event,this._onProcessExit=new A,this.onProcessExit=this._onProcessExit.event}refreshProperty(e){throw new Error(`refreshProperty is not suppported in extension owned terminals. property: ${e}`)}updateProperty(e,t){throw new Error(`updateProperty is not suppported in extension owned terminals. property: ${e}, value: ${t}`)}async start(){}shutdown(){this._pty.close()}input(e){this._pty.handleInput?.(e)}sendSignal(e){}resize(e,t){this._pty.setDimensions?.({columns:e,rows:t})}clearBuffer(){}async processBinary(e){}acknowledgeDataEvent(e){}async setUnicodeVersion(e){}getInitialCwd(){return Promise.resolve("")}getCwd(){return Promise.resolve("")}startSendingEvents(e){this._pty.onDidWrite(t=>this._onProcessData.fire(t)),this._pty.onDidClose?.((t=void 0)=>{this._onProcessExit.fire(t===void 0?void 0:t)}),this._pty.onDidOverrideDimensions?.(t=>{t&&this._onDidChangeProperty.fire({type:Vf.OverrideDimensions,value:{cols:t.columns,rows:t.rows}})}),this._pty.onDidChangeName?.(t=>{this._onDidChangeProperty.fire({type:Vf.Title,value:t})}),this._pty.open(e||void 0),e&&this._pty.setDimensions?.(e),this._onProcessReady.fire({pid:-1,cwd:"",windowsPty:void 0})}}let s2t=1,sbe=class extends V{get activeTerminal(){return this._activeTerminal?.value}get terminals(){return this._terminals.map(e=>e.value)}constructor(e,t,i){super(),this._extHostCommands=t,this._terminals=[],this._terminalProcesses=new Map,this._terminalProcessDisposables={},this._extensionTerminalAwaitingStart={},this._getTerminalPromises={},this._environmentVariableCollections=new Map,this._lastQuickFixCommands=this._register(new hi),this._linkProviders=new Set,this._completionProviders=new Map,this._profileProviders=new Map,this._quickFixProviders=new Map,this._terminalLinkCache=new Map,this._terminalLinkCancellationSource=new Map,this._onDidCloseTerminal=new A,this.onDidCloseTerminal=this._onDidCloseTerminal.event,this._onDidOpenTerminal=new A,this.onDidOpenTerminal=this._onDidOpenTerminal.event,this._onDidChangeActiveTerminal=new A,this.onDidChangeActiveTerminal=this._onDidChangeActiveTerminal.event,this._onDidChangeTerminalDimensions=new A,this.onDidChangeTerminalDimensions=this._onDidChangeTerminalDimensions.event,this._onDidChangeTerminalState=new A,this.onDidChangeTerminalState=this._onDidChangeTerminalState.event,this._onDidChangeShell=new A,this.onDidChangeShell=this._onDidChangeShell.event,this._onDidWriteTerminalData=new A({onWillAddFirstListener:()=>this._proxy.$startSendingDataEvents(),onDidRemoveLastListener:()=>this._proxy.$stopSendingDataEvents()}),this.onDidWriteTerminalData=this._onDidWriteTerminalData.event,this._onDidExecuteCommand=new A({onWillAddFirstListener:()=>this._proxy.$startSendingCommandEvents(),onDidRemoveLastListener:()=>this._proxy.$stopSendingCommandEvents()}),this.onDidExecuteTerminalCommand=this._onDidExecuteCommand.event,this._proxy=i.getProxy(Xe.MainThreadTerminalService),this._bufferer=new Wtt(this._proxy.$sendProcessData),this._proxy.$registerProcessSupport(e),this._extHostCommands.registerArgumentProcessor({processArgument:s=>{const r=o=>{const a=o;return this.getTerminalById(a.instanceId)?.value};switch(s?.$mid){case Pn.TerminalContext:return r(s);default:{if(Array.isArray(s))for(let o=0;o<s.length&&s[o].$mid===Pn.TerminalContext;o++)s[o]=r(s[o]);return s}}}}),this._register({dispose:()=>{for(const[s,r]of this._terminalProcesses)r.shutdown(!0)}})}getDefaultShell(e){return(e?this._defaultAutomationProfile:this._defaultProfile)?.path||""}getDefaultShellArgs(e){return(e?this._defaultAutomationProfile:this._defaultProfile)?.args||[]}createExtensionTerminal(e,t){const i=new kVe(this._proxy,Tr(),e,e.name),s=new the(e.pty);return i.createExtensionTerminal(e.location,t,this._serializeParentTerminal(e,t).resolvedExtHostIdentifier,Btt(e.iconPath),o2t(e.color)).then(r=>{const o=this._setupExtHostProcessListeners(r,s);this._terminalProcessDisposables[r]=o}),this._terminals.push(i),i.value}_serializeParentTerminal(e,t){if(t=t||{},e.location&&typeof e.location=="object"&&"parentTerminal"in e.location){const i=e.location.parentTerminal;if(i){const s=this._terminals.find(r=>r.value===i);s&&(t.resolvedExtHostIdentifier=s._id)}}else e.location&&typeof e.location!="object"?t.location=e.location:t.location&&typeof t.location=="object"&&"splitActiveTerminal"in t.location&&(t.location={splitActiveTerminal:!0});return t}attachPtyToTerminal(e,t){if(!this.getTerminalById(e))throw new Error(`Cannot resolve terminal with id ${e} for virtual process`);const s=new the(t),r=this._setupExtHostProcessListeners(e,s);this._terminalProcessDisposables[e]=r}async $acceptActiveTerminalChanged(e){const t=this._activeTerminal;if(e===null){this._activeTerminal=void 0,t!==this._activeTerminal&&this._onDidChangeActiveTerminal.fire(this._activeTerminal);return}const i=this.getTerminalById(e);i&&(this._activeTerminal=i,t!==this._activeTerminal&&this._onDidChangeActiveTerminal.fire(this._activeTerminal.value))}async $acceptTerminalProcessData(e,t){const i=this.getTerminalById(e);i&&this._onDidWriteTerminalData.fire({terminal:i.value,data:t})}async $acceptTerminalDimensions(e,t,i){const s=this.getTerminalById(e);s&&s.setDimensions(t,i)&&this._onDidChangeTerminalDimensions.fire({terminal:s.value,dimensions:s.value.dimensions})}async $acceptDidExecuteCommand(e,t){const i=this.getTerminalById(e);i&&this._onDidExecuteCommand.fire({terminal:i.value,...t})}async $acceptTerminalMaximumDimensions(e,t,i){this._terminalProcesses.get(e)?.resize(t,i)}async $acceptTerminalTitleChange(e,t){const i=this.getTerminalById(e);i&&(i.name=t)}async $acceptTerminalClosed(e,t,i){const s=this._getTerminalObjectIndexById(this._terminals,e);if(s!==null){const r=this._terminals.splice(s,1)[0];r.setExitStatus(t,i),this._onDidCloseTerminal.fire(r.value)}}$acceptTerminalOpened(e,t,i,s){if(t){const a=this._getTerminalObjectIndexById(this._terminals,t);if(a!==null){this._terminals[a]._id=e,this._onDidOpenTerminal.fire(this.terminals[a]),this._terminals[a].isOpen=!0;return}}const r={name:s.name,shellPath:s.executable,shellArgs:s.args,cwd:typeof s.cwd=="string"?s.cwd:N.revive(s.cwd),env:s.env,hideFromUser:s.hideFromUser},o=new kVe(this._proxy,e,r,i);this._terminals.push(o),this._onDidOpenTerminal.fire(o.value),o.isOpen=!0}async $acceptTerminalProcessId(e,t){this.getTerminalById(e)?._setProcessId(t)}async $startExtensionTerminal(e,t){const i=this.getTerminalById(e);if(!i)return{message:f(2636,"Could not find the terminal with id {0} on the extension host",e)};i.isOpen||await new Promise(r=>{const o=this.onDidOpenTerminal(async a=>{a===i.value&&(o.dispose(),r())})});const s=this._terminalProcesses.get(e);s?s.startSendingEvents(t):this._extensionTerminalAwaitingStart[e]={initialDimensions:t}}_setupExtHostProcessListeners(e,t){const i=new ie;i.add(t.onProcessReady(r=>this._proxy.$sendProcessReady(e,r.pid,r.cwd,r.windowsPty))),i.add(t.onDidChangeProperty(r=>this._proxy.$sendProcessProperty(e,r))),this._bufferer.startBuffering(e,t.onProcessData),i.add(t.onProcessExit(r=>this._onProcessExit(e,r))),this._terminalProcesses.set(e,t);const s=this._extensionTerminalAwaitingStart[e];return s&&t instanceof the&&(t.startSendingEvents(s.initialDimensions),delete this._extensionTerminalAwaitingStart[e]),i}$acceptProcessAckDataEvent(e,t){this._terminalProcesses.get(e)?.acknowledgeDataEvent(t)}$acceptProcessInput(e,t){this._terminalProcesses.get(e)?.input(t)}$acceptTerminalInteraction(e){const t=this.getTerminalById(e);t?.setInteractedWith()&&this._onDidChangeTerminalState.fire(t.value)}$acceptTerminalSelection(e,t){this.getTerminalById(e)?.setSelection(t)}$acceptProcessResize(e,t,i){try{this._terminalProcesses.get(e)?.resize(t,i)}catch(s){if(s.code!=="EPIPE"&&s.code!=="ERR_IPC_CHANNEL_CLOSED")throw s}}$acceptProcessShutdown(e,t){this._terminalProcesses.get(e)?.shutdown(t)}$acceptProcessRequestInitialCwd(e){this._terminalProcesses.get(e)?.getInitialCwd().then(t=>this._proxy.$sendProcessProperty(e,{type:Vf.InitialCwd,value:t}))}$acceptProcessRequestCwd(e){this._terminalProcesses.get(e)?.getCwd().then(t=>this._proxy.$sendProcessProperty(e,{type:Vf.Cwd,value:t}))}$acceptProcessRequestLatency(e){return Promise.resolve(e)}registerProfileProvider(e,t,i){if(this._profileProviders.has(t))throw new Error(`Terminal profile provider "${t}" already registered`);return this._profileProviders.set(t,i),this._proxy.$registerProfileProvider(t,e.identifier.value),new bs(()=>{this._profileProviders.delete(t),this._proxy.$unregisterProfileProvider(t)})}registerTerminalCompletionProvider(e,t,...i){if(this._completionProviders.has(t.id))throw new Error(`Terminal completion provider "${t.id}" already registered`);return this._completionProviders.set(t.id,t),this._proxy.$registerCompletionProvider(t.id,e.identifier.value,...i),new bs(()=>{this._completionProviders.delete(t.id),this._proxy.$unregisterCompletionProvider(t.id)})}async $provideTerminalCompletions(e,t){const i=new ui().token;if(i.isCancellationRequested||!this.activeTerminal)return;const s=this._completionProviders.get(e);if(!s)return;const r=await s.provideTerminalCompletions(this.activeTerminal,t,i);if(r==null)return;const o=!as||this.activeTerminal.state?.shell===Ave.GitBash?"/":"\\";return Hwe.from(r,o)}$acceptTerminalShellType(e,t){const i=this.getTerminalById(e);i?.setShellType(t)&&this._onDidChangeTerminalState.fire(i.value)}registerTerminalQuickFixProvider(e,t,i){if(this._quickFixProviders.has(e))throw new Error(`Terminal quick fix provider "${e}" is already registered`);return this._quickFixProviders.set(e,i),this._proxy.$registerQuickFixProvider(e,t),new bs(()=>{this._quickFixProviders.delete(e),this._proxy.$unregisterQuickFixProvider(e)})}async $provideTerminalQuickFixes(e,t){const i=new ui().token;if(i.isCancellationRequested)return;const s=this._quickFixProviders.get(e);if(!s)return;const r=await s.provideTerminalQuickFixes(t,i);if(r===null||Array.isArray(r)&&r.length===0)return;const o=new ie;if(this._lastQuickFixCommands.value=o,!Array.isArray(r))return r?UZ.from(r,this._extHostCommands.converter,o):void 0;const a=[];for(const l of r){const c=UZ.from(l,this._extHostCommands.converter,o);c&&a.push(c)}return a}async $createContributedProfileTerminal(e,t){const i=new ui().token;let s=await this._profileProviders.get(e)?.provideTerminalProfile(i);if(!i.isCancellationRequested){if(s&&!("options"in s)&&(s={options:s}),!s||!("options"in s))throw new Error(`No terminal profile options provided for id "${e}"`);if("pty"in s.options){this.createExtensionTerminal(s.options,t);return}this.createTerminalFromOptions(s.options,t)}}registerLinkProvider(e){return this._linkProviders.add(e),this._linkProviders.size===1&&this._proxy.$startLinkProvider(),new bs(()=>{this._linkProviders.delete(e),this._linkProviders.size===0&&this._proxy.$stopLinkProvider()})}async $provideLinks(e,t){const i=this.getTerminalById(e);if(!i)return[];this._terminalLinkCache.delete(e),this._terminalLinkCancellationSource.get(e)?.dispose(!0);const r=new ui;this._terminalLinkCancellationSource.set(e,r);const o=[],a={terminal:i.value,line:t},l=[];for(const h of this._linkProviders)l.push(El.withAsyncBody(async u=>{r.token.onCancellationRequested(()=>u({provider:h,links:[]}));const g=await h.provideTerminalLinks(a,r.token)||[];r.token.isCancellationRequested||u({provider:h,links:g})}));const c=await Promise.all(l);if(r.token.isCancellationRequested)return[];const d=new Map;for(const h of c)h&&h.links.length>0&&o.push(...h.links.map(u=>{const g={id:s2t++,startIndex:u.startIndex,length:u.length,label:u.tooltip};return d.set(g.id,{provider:h.provider,link:u}),g}));return this._terminalLinkCache.set(e,d),o}$activateLink(e,t){const i=this._terminalLinkCache.get(e)?.get(t);i&&i.provider.handleTerminalLink(i.link)}_onProcessExit(e,t){this._bufferer.stopBuffering(e),this._terminalProcesses.delete(e),delete this._extensionTerminalAwaitingStart[e];const i=this._terminalProcessDisposables[e];i&&(i.dispose(),delete this._terminalProcessDisposables[e]),this._proxy.$sendProcessExit(e,t)}getTerminalById(e){return this._getTerminalObjectById(this._terminals,e)}getTerminalIdByApiObject(e){const t=this._terminals.findIndex(i=>i.value===e);return t>=0?t:null}_getTerminalObjectById(e,t){const i=this._getTerminalObjectIndexById(e,t);return i!==null?e[i]:null}_getTerminalObjectIndexById(e,t){const i=e.findIndex(s=>s._id===t);return i>=0?i:null}getEnvironmentVariableCollection(e){let t=this._environmentVariableCollections.get(e.identifier.value);return t||(t=this._register(new IVe),this._setEnvironmentVariableCollection(e.identifier.value,t)),t.getScopedEnvironmentVariableCollection(void 0)}_syncEnvironmentVariableCollection(e,t){const i=Ftt(t.map),s=t2t(t.descriptionMap);this._proxy.$setEnvironmentVariableCollection(e,t.persistent,i.length===0?void 0:i,s)}$initEnvironmentVariableCollections(e){e.forEach(t=>{const i=t[0],s=this._register(new IVe(t[1]));this._setEnvironmentVariableCollection(i,s)})}$acceptDefaultProfile(e,t){const i=this._defaultProfile;this._defaultProfile=e,this._defaultAutomationProfile=t,i?.path!==e.path&&this._onDidChangeShell.fire(e.path)}_setEnvironmentVariableCollection(e,t){this._environmentVariableCollections.set(e,t),this._register(t.onDidChangeCollection(()=>{this._syncEnvironmentVariableCollection(e,t)}))}};sbe=y([v(1,_N),v(2,dr)],sbe);class IVe extends V{get persistent(){return this._persistent}set persistent(e){this._persistent=e,this._onDidChangeCollection.fire()}get onDidChangeCollection(){return this._onDidChangeCollection&&this._onDidChangeCollection.event}constructor(e){super(),this.map=new Map,this.scopedCollections=new Map,this.descriptionMap=new Map,this._persistent=!0,this._onDidChangeCollection=new A,this.map=new Map(e)}getScopedEnvironmentVariableCollection(e){const t=this.getScopeKey(e);let i=this.scopedCollections.get(t);return i||(i=new r2t(this,e),this.scopedCollections.set(t,i),this._register(i.onDidChangeCollection(()=>this._onDidChangeCollection.fire()))),i}replace(e,t,i,s){this._setIfDiffers(e,{value:t,type:I1.Replace,options:i??{applyAtProcessCreation:!0},scope:s})}append(e,t,i,s){this._setIfDiffers(e,{value:t,type:I1.Append,options:i??{applyAtProcessCreation:!0},scope:s})}prepend(e,t,i,s){this._setIfDiffers(e,{value:t,type:I1.Prepend,options:i??{applyAtProcessCreation:!0},scope:s})}_setIfDiffers(e,t){if(t.options&&t.options.applyAtProcessCreation===!1&&!t.options.applyAtShellIntegration)throw new Error("EnvironmentVariableMutatorOptions must apply at either process creation or shell integration");const i=this.getKey(e,t.scope),s=this.map.get(i),r=t.options?{applyAtProcessCreation:t.options.applyAtProcessCreation??!1,applyAtShellIntegration:t.options.applyAtShellIntegration??!1}:{applyAtProcessCreation:!0};if(!s||s.value!==t.value||s.type!==t.type||s.options?.applyAtProcessCreation!==r.applyAtProcessCreation||s.options?.applyAtShellIntegration!==r.applyAtShellIntegration||s.scope?.workspaceFolder?.index!==t.scope?.workspaceFolder?.index){const o=this.getKey(e,t.scope),a={variable:e,...t,options:r};this.map.set(o,a),this._onDidChangeCollection.fire()}}get(e,t){const i=this.getKey(e,t),s=this.map.get(i);return s?TVe(s):void 0}getKey(e,t){const i=this.getScopeKey(t);return i.length?`${e}:::${i}`:e}getScopeKey(e){return this.getWorkspaceKey(e?.workspaceFolder)??""}getWorkspaceKey(e){return e?e.uri.toString():void 0}getVariableMap(e){const t=new Map;for(const[i,s]of this.map)this.getScopeKey(s.scope)===this.getScopeKey(e)&&t.set(s.variable,TVe(s));return t}delete(e,t){const i=this.getKey(e,t);this.map.delete(i),this._onDidChangeCollection.fire()}clear(e){if(e?.workspaceFolder){for(const[t,i]of this.map)i.scope?.workspaceFolder?.index===e.workspaceFolder.index&&this.map.delete(t);this.clearDescription(e)}else this.map.clear(),this.descriptionMap.clear();this._onDidChangeCollection.fire()}setDescription(e,t){const i=this.getScopeKey(t),s=this.descriptionMap.get(i);if(!s||s.description!==e){let r;typeof e=="string"?r=e:r=e?.value.split(`
|
|
878
878
|
|
|
879
879
|
`)[0];const o={description:r,scope:t};this.descriptionMap.set(i,o),this._onDidChangeCollection.fire()}}getDescription(e){const t=this.getScopeKey(e);return this.descriptionMap.get(t)?.description}clearDescription(e){const t=this.getScopeKey(e);this.descriptionMap.delete(t)}}class r2t{get persistent(){return this.collection.persistent}set persistent(e){this.collection.persistent=e}get onDidChangeCollection(){return this._onDidChangeCollection&&this._onDidChangeCollection.event}constructor(e,t){this.collection=e,this.scope=t,this._onDidChangeCollection=new A}getScoped(e){return this.collection.getScopedEnvironmentVariableCollection(e)}replace(e,t,i){this.collection.replace(e,t,i,this.scope)}append(e,t,i){this.collection.append(e,t,i,this.scope)}prepend(e,t,i){this.collection.prepend(e,t,i,this.scope)}get(e){return this.collection.get(e,this.scope)}forEach(e,t){this.collection.getVariableMap(this.scope).forEach((i,s)=>e.call(t,s,i,this),this.scope)}[Symbol.iterator](){return this.collection.getVariableMap(this.scope).entries()}delete(e){this.collection.delete(e,this.scope),this._onDidChangeCollection.fire(void 0)}clear(){this.collection.clear(this.scope)}set description(e){this.collection.setDescription(e,this.scope)}get description(){return this.collection.getDescription(this.scope)}}let rbe=class extends sbe{constructor(e,t){super(!1,e,t)}createTerminal(e,t,i){throw new JS}createTerminalFromOptions(e,t){throw new JS}};rbe=y([v(0,_N),v(1,dr)],rbe);function Btt(n){if(!(!n||typeof n=="string"))return"id"in n?{id:n.id,color:n.color}:n}function o2t(n){return C2.isThemeColor(n)?n:void 0}function TVe(n){const e={...n};return delete e.scope,e.options=e.options??void 0,delete e.variable,e}const bz=de("IExtHostApiDeprecationService");let obe=class{constructor(e,t){this._extHostLogService=t,this._reportedUsages=new Set,this._telemetryShape=e.getProxy(Xe.MainThreadTelemetry)}report(e,t,i){const s=this.getUsageKey(e,t);this._reportedUsages.has(s)||(this._reportedUsages.add(s),t.isUnderDevelopment&&this._extHostLogService.warn(`[Deprecation Warning] '${e}' is deprecated. ${i}`),this._telemetryShape.$publicLog2("extHostDeprecatedApiUsage",{extensionId:t.identifier.value,apiId:e}))}getUsageKey(e,t){return`${e}-${t.identifier.value}`}};obe=y([v(0,dr),v(1,it)],obe);const a2t={type:"object",additionalProperties:!1,properties:{type:{type:"string",description:f(10738,"The actual task type. Please note that types starting with a '$' are reserved for internal usage.")},required:{type:"array",items:{type:"string"}},properties:{type:"object",description:f(10739,"Additional properties of the task type"),additionalProperties:{$ref:"http://json-schema.org/draft-07/schema#"}},when:{type:"string",markdownDescription:f(10740,"Condition which must be true to enable this type of task. Consider using `shellExecutionSupported`, `processExecutionSupported`, and `customExecutionSupported` as appropriate for this task definition. See the [API documentation](https://code.visualstudio.com/api/extension-guides/task-provider#when-clause) for more information."),default:""}}};var abe;(function(n){function e(t,i,s){if(!t)return;const r=qt(t.type)?t.type:void 0;if(!r||r.length===0){s.error(f(10741,"The task type configuration is missing the required 'taskType' property"));return}const o=[];if(Array.isArray(t.required))for(const a of t.required)qt(a)&&o.push(a);return{extensionId:i.value,taskType:r,required:o,properties:t.properties?Ls(t.properties):{},when:t.when?ne.deserialize(t.when):void 0}}n.from=e})(abe||(abe={}));const l2t=bp.registerExtensionPoint({extensionPoint:"taskDefinitions",activationEventsGenerator:(n,e)=>{for(const t of n)t.type&&e.push(`onTaskType:${t.type}`)},jsonSchema:{description:f(10742,"Contributes task kinds"),type:"array",items:a2t}});class c2t{constructor(){this._onDefinitionsChanged=new A,this.onDefinitionsChanged=this._onDefinitionsChanged.event,this.taskTypes=Object.create(null),this.readyPromise=new Promise((e,t)=>{l2t.setHandler((i,s)=>{this._schema=void 0;try{for(const r of s.removed){const o=r.value;for(const a of o)this.taskTypes&&a.type&&this.taskTypes[a.type]&&delete this.taskTypes[a.type]}for(const r of s.added){const o=r.value;for(const a of o){const l=abe.from(a,r.description.identifier,r.collector);l&&(this.taskTypes[l.taskType]=l)}}(s.removed.length>0||s.added.length>0)&&this._onDefinitionsChanged.fire()}catch{}e(void 0)})})}onReady(){return this.readyPromise}get(e){return this.taskTypes[e]}all(){return Object.keys(this.taskTypes).map(e=>this.taskTypes[e])}getJsonSchema(){if(this._schema===void 0){const e=[];for(const t of this.all()){const i={type:"object",additionalProperties:!1};t.required.length>0&&(i.required=t.required.slice(0)),t.properties!==void 0?i.properties=Ls(t.properties):i.properties=Object.create(null),i.properties.type={type:"string",enum:[t.taskType]},e.push(i)}this._schema={oneOf:e}}return this._schema}}const d2t=new c2t;Si("rerun-task",Ce.refresh,f(10531,"View icon of the rerun task."));const QAe="settings";new j("taskRunning",!1,f(10752,"Whether a task is currently running."));new j("taskTerminalActive",!1,f(10753,"Whether the active terminal is a task terminal."));se(10754,"Tasks");var YZ;(function(n){n[n.Escape=1]="Escape",n[n.Strong=2]="Strong",n[n.Weak=3]="Weak"})(YZ||(YZ={}));const Htt="$customized";(function(n){function e(t){if(!t)return n.Strong;switch(t.toLowerCase()){case"escape":return n.Escape;case"strong":return n.Strong;case"weak":return n.Weak;default:return n.Strong}}n.from=e})(YZ||(YZ={}));var I8;(function(n){n.defaults={cwd:"${workspaceFolder}"}})(I8||(I8={}));var T8;(function(n){n[n.Always=1]="Always",n[n.Silent=2]="Silent",n[n.Never=3]="Never"})(T8||(T8={}));(function(n){function e(t){switch(t.toLowerCase()){case"always":return n.Always;case"silent":return n.Silent;case"never":return n.Never;default:return n.Always}}n.fromString=e})(T8||(T8={}));var L8;(function(n){n[n.Never=1]="Never",n[n.OnProblem=2]="OnProblem",n[n.Always=3]="Always"})(L8||(L8={}));(function(n){function e(t){switch(t.toLowerCase()){case"always":return n.Always;case"never":return n.Never;case"onproblem":return n.OnProblem;default:return n.OnProblem}}n.fromString=e})(L8||(L8={}));var R8;(function(n){n[n.Shared=1]="Shared",n[n.Dedicated=2]="Dedicated",n[n.New=3]="New"})(R8||(R8={}));(function(n){function e(t){switch(t.toLowerCase()){case"shared":return n.Shared;case"dedicated":return n.Dedicated;case"new":return n.New;default:return n.Shared}}n.fromString=e})(R8||(R8={}));var XZ;(function(n){n.defaults={echo:!0,reveal:T8.Always,revealProblems:L8.Never,focus:!1,panel:R8.Shared,showReuseMessage:!0,clear:!1}})(XZ||(XZ={}));var dm;(function(n){n[n.Shell=1]="Shell",n[n.Process=2]="Process",n[n.CustomExecution=3]="CustomExecution"})(dm||(dm={}));(function(n){function e(i){switch(i.toLowerCase()){case"shell":return n.Shell;case"process":return n.Process;case"customExecution":return n.CustomExecution;default:return n.Process}}n.fromString=e;function t(i){switch(i){case n.Shell:return"shell";case n.Process:return"process";case n.CustomExecution:return"customExecution";default:return"process"}}n.toString=t})(dm||(dm={}));var LVe;(function(n){function e(t){return qt(t)?t:t.value}n.value=e})(LVe||(LVe={}));var RVe;(function(n){n.Clean={_id:"clean",isDefault:!1},n.Build={_id:"build",isDefault:!1},n.Rebuild={_id:"rebuild",isDefault:!1},n.Test={_id:"test",isDefault:!1};function e(i){return i===n.Clean._id||i===n.Build._id||i===n.Rebuild._id||i===n.Test._id}n.is=e;function t(i){if(i!==void 0)return qt(i)?e(i)?{_id:i,isDefault:!1}:void 0:i}n.from=t})(RVe||(RVe={}));var iD;(function(n){n[n.Global=1]="Global",n[n.Workspace=2]="Workspace",n[n.Folder=3]="Folder"})(iD||(iD={}));var fE;(function(n){n.Workspace="workspace",n.Extension="extension",n.InMemory="inMemory",n.WorkspaceFile="workspaceFile",n.User="user";function e(t){switch(t){case n.User:return Wt.USER;case n.WorkspaceFile:return Wt.WORKSPACE;default:return Wt.WORKSPACE_FOLDER}}n.toConfigurationTarget=e})(fE||(fE={}));var AVe;(function(n){n.parallel="parallel",n.sequence="sequence"})(AVe||(AVe={}));var lbe;(function(n){n[n.default=1]="default",n[n.folderOpen=2]="folderOpen"})(lbe||(lbe={}));var cbe;(function(n){n.terminateNewest="terminateNewest",n.terminateOldest="terminateOldest",n.prompt="prompt",n.warn="warn",n.silent="silent"})(cbe||(cbe={}));var QZ;(function(n){n.defaults={reevaluateOnRerun:!0,runOn:lbe.default,instanceLimit:1,instancePolicy:cbe.prompt}})(QZ||(QZ={}));class ZAe{constructor(e,t,i,s,r,o){this._label="",this._id=e,t&&(this._label=t),i&&(this.type=i),this.runOptions=s,this.configurationProperties=r,this._source=o}getDefinition(e){}getMapKey(){return this._id}getKey(){}getCommonTaskId(){const e={folder:this.getFolderId(),id:this._id};return JSON.stringify(e)}clone(){return this.fromObject(Object.assign({},this))}getWorkspaceFolder(){}getWorkspaceFileName(){}getTelemetryKind(){return"unknown"}matches(e,t=!1){if(e===void 0)return!1;if(qt(e))return e===this._label||e===this.configurationProperties.identifier||t&&e===this._id;const i=this.getDefinition(!0);return i!==void 0&&i._key===e._key}getQualifiedLabel(){const e=this.getWorkspaceFolder();return e?`${this._label} (${e.name})`:this._label}getTaskExecution(){return{id:this._id,task:this}}addTaskLoadMessages(e){this._taskLoadMessages===void 0&&(this._taskLoadMessages=[]),e&&(this._taskLoadMessages=this._taskLoadMessages.concat(e))}get taskLoadMessages(){return this._taskLoadMessages}}class A5 extends ZAe{constructor(e,t,i,s,r,o,a,l){super(e,i,void 0,a,l,t),this.command={},this._source=t,this.hasDefinedMatchers=o,r&&(this.command=r)}clone(){return new A5(this._id,this._source,this._label,this.type,this.command,this.hasDefinedMatchers,this.runOptions,this.configurationProperties)}customizes(){if(this._source&&this._source.customizes)return this._source.customizes}getDefinition(e=!1){if(e&&this._source.customizes!==void 0)return this._source.customizes;{let t;switch(this.command?this.command.runtime:void 0){case dm.Shell:t="shell";break;case dm.Process:t="process";break;case dm.CustomExecution:t="customExecution";break;case void 0:t="$composite";break;default:throw new Error("Unexpected task runtime")}return{type:t,_key:this._id,id:this._id}}}static is(e){return e instanceof A5}getMapKey(){const e=this._source.config.workspaceFolder;return e?`${e.uri.toString()}|${this._id}|${this.instance}`:`${this._id}|${this.instance}`}getFolderId(){return this._source.kind===fE.User?QAe:this._source.config.workspaceFolder?.uri.toString()}getCommonTaskId(){return this._source.customizes?super.getCommonTaskId():this.getKey()??super.getCommonTaskId()}getKey(){const e=this.getFolderId();if(!e)return;let t=this.configurationProperties.identifier;return this._source.kind!==fE.Workspace&&(t+=this._source.kind),JSON.stringify({type:Htt,folder:e,id:t})}getWorkspaceFolder(){return this._source.config.workspaceFolder}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?In(this._source.config.workspace.configuration):void 0}getTelemetryKind(){return this._source.customizes?"workspace>extension":"workspace"}fromObject(e){return new A5(e._id,e._source,e._label,e.type,e.command,e.hasDefinedMatchers,e.runOptions,e.configurationProperties)}}class P5 extends ZAe{constructor(e,t,i,s,r,o,a){super(e,i,s,o,a,t),this._source=t,this.configures=r}static is(e){return e instanceof P5}fromObject(e){return e}getDefinition(){return this.configures}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?In(this._source.config.workspace.configuration):void 0}getWorkspaceFolder(){return this._source.config.workspaceFolder}getFolderId(){return this._source.kind===fE.User?QAe:this._source.config.workspaceFolder?.uri.toString()}getKey(){const e=this.getFolderId();if(!e)return;let t=this.configurationProperties.identifier;return this._source.kind!==fE.Workspace&&(t+=this._source.kind),JSON.stringify({type:Htt,folder:e,id:t})}}class m0 extends ZAe{constructor(e,t,i,s,r,o,a,l,c){super(e,i,s,l,c,t),this.defines=r,this.hasDefinedMatchers=a,this.command=o,this.icon=c.icon,this.hide=c.hide}clone(){return new m0(this._id,this._source,this._label,this.type,this.defines,this.command,this.hasDefinedMatchers,this.runOptions,this.configurationProperties)}getDefinition(){return this.defines}static is(e){return e instanceof m0}getMapKey(){const e=this._source.workspaceFolder;return e?`${this._source.scope.toString()}|${e.uri.toString()}|${this._id}|${this.instance}`:`${this._source.scope.toString()}|${this._id}|${this.instance}`}getFolderId(){if(this._source.scope===iD.Folder&&this._source.workspaceFolder)return this._source.workspaceFolder.uri.toString()}getKey(){const e={type:"contributed",scope:this._source.scope,id:this._id};return e.folder=this.getFolderId(),JSON.stringify(e)}getWorkspaceFolder(){return this._source.workspaceFolder}getTelemetryKind(){return"extension"}fromObject(e){return new m0(e._id,e._source,e._label,e.type,e.defines,e.command,e.hasDefinedMatchers,e.runOptions,e.configurationProperties)}}var ZZ;(function(n){n[n.Process=1]="Process",n[n.Terminal=2]="Terminal"})(ZZ||(ZZ={}));(function(n){n._default=n.Terminal})(ZZ||(ZZ={}));var PVe;(function(n){n[n.V0_1_0=1]="V0_1_0",n[n.V2_0_0=2]="V2_0_0"})(PVe||(PVe={}));var JZ;(function(n){n.SingleRun="singleRun",n.Background="background"})(JZ||(JZ={}));var Ox;(function(n){n.Changed="changed",n.ProcessStarted="processStarted",n.ProcessEnded="processEnded",n.Terminated="terminated",n.Start="start",n.AcquiredInput="acquiredInput",n.DependsOnStarted="dependsOnStarted",n.Active="active",n.Inactive="inactive",n.End="end",n.ProblemMatcherStarted="problemMatcherStarted",n.ProblemMatcherEnded="problemMatcherEnded",n.ProblemMatcherFoundErrors="problemMatcherFoundErrors"})(Ox||(Ox={}));var NVe;(function(n){n[n.System=0]="System",n[n.User=1]="User",n[n.FolderOpen=2]="FolderOpen",n[n.ConfigurationChange=3]="ConfigurationChange",n[n.Reconnect=4]="Reconnect"})(NVe||(NVe={}));var MVe;(function(n){function e(c){return{taskId:c._id,taskName:c.configurationProperties.name,runType:c.configurationProperties.isBackground?JZ.Background:JZ.SingleRun,group:c.configurationProperties.group,__task:c}}function t(c,d,h){return{...e(c),kind:Ox.Start,terminalId:d,resolvedVariables:h}}n.start=t;function i(c,d,h){return{...e(c),kind:Ox.ProcessStarted,terminalId:d,processId:h}}n.processStarted=i;function s(c,d,h){return{...e(c),kind:Ox.ProcessEnded,terminalId:d,exitCode:h}}n.processEnded=s;function r(c,d,h){return{...e(c),kind:Ox.Terminated,exitReason:h,terminalId:d}}n.terminated=r;function o(c,d,h){return{...e(d),kind:c,terminalId:h}}n.general=o;function a(c,d,h){return{...e(c),kind:Ox.ProblemMatcherEnded,hasErrors:d}}n.problemMatcherEnded=a;function l(){return{kind:Ox.Changed}}n.changed=l})(MVe||(MVe={}));var eJ;(function(n){function e(i){const s=Object.keys(i).sort();let r="";for(const o of s){let a=i[o];a instanceof Object?a=e(a):typeof a=="string"&&(a=a.replace(/,/g,",,")),r+=o+","+a+","}return r}function t(i){const r={_key:e(i),type:i.taskType};return Object.assign(r,i),r}n.create=t})(eJ||(eJ={}));var OVe;(function(n){n.AutoDetect="task.autoDetect",n.SaveBeforeRun="task.saveBeforeRun",n.ShowDecorations="task.showDecorations",n.ProblemMatchersNeverPrompt="task.problemMatchers.neverPrompt",n.SlowProviderWarning="task.slowProviderWarning",n.QuickOpenHistory="task.quickOpen.history",n.QuickOpenDetail="task.quickOpen.detail",n.QuickOpenSkip="task.quickOpen.skip",n.QuickOpenShowAll="task.quickOpen.showAll",n.AllowAutomaticTasks="task.allowAutomaticTasks",n.Reconnection="task.reconnection",n.VerboseLogging="task.verboseLogging"})(OVe||(OVe={}));var FVe;(function(n){n.Tasks="tasks",n.SuppressTaskName="tasks.suppressTaskName",n.Windows="tasks.windows",n.Osx="tasks.osx",n.Linux="tasks.linux",n.ShowOutput="tasks.showOutput",n.IsShellCommand="tasks.isShellCommand",n.ServiceTestSetting="tasks.service.testSetting"})(FVe||(FVe={}));var dbe;(function(n){function e(t,i){const s=d2t.get(t.type);if(s===void 0){const l=Ls(t);return delete l._key,eJ.create(l)}const r=Object.create(null);r.type=s.taskType;const o=new Set;s.required.forEach(l=>o.add(l));const a=s.properties;for(const l of Object.keys(a)){const c=t[l];if(c!=null)r[l]=c;else if(o.has(l)){const d=a[l];if(d.default!==void 0)r[l]=Ls(d.default);else switch(d.type){case"boolean":r[l]=!1;break;case"number":case"integer":r[l]=0;break;case"string":r[l]="";break;default:i.error(f(10755,"Error: the task identifier '{0}' is missing the required property '{1}'. The task identifier will be ignored.",JSON.stringify(t,void 0,0),l));return}}}return eJ.create(r)}n.createTaskIdentifier=e})(dbe||(dbe={}));var tJ;(function(n){function e(i){if(i!=null)return i}n.from=e;function t(i){if(i!=null)return i}n.to=t})(tJ||(tJ={}));var iJ;(function(n){function e(i){if(i!=null)return i}n.from=e;function t(i){if(i!=null)return i}n.to=t})(iJ||(iJ={}));var hbe;(function(n){function e(i){if(i!=null)return i}n.from=e;function t(i){if(i!=null)return i}n.to=t})(hbe||(hbe={}));var N5;(function(n){function e(s){if(s){const r=s;return r&&!!r.process}else return!1}n.is=e;function t(s){if(s==null)return;const r={process:s.process,args:s.args};return s.options&&(r.options=hbe.from(s.options)),r}n.from=t;function i(s){if(s!=null)return new AA(s.process,s.args,s.options)}n.to=i})(N5||(N5={}));var ube;(function(n){function e(i){if(i!=null)return i}n.from=e;function t(i){if(i!=null)return i}n.to=t})(ube||(ube={}));var M5;(function(n){function e(s){if(s){const r=s;return r&&(!!r.commandLine||!!r.command)}else return!1}n.is=e;function t(s){if(s==null)return;const r={};return s.commandLine!==void 0?r.commandLine=s.commandLine:(r.command=s.command,r.args=s.args),s.options&&(r.options=ube.from(s.options)),r}n.from=t;function i(s){if(!(s==null||s.command===void 0&&s.commandLine===void 0))return s.commandLine?new nI(s.commandLine,s.options):new nI(s.command,s.args?s.args:[],s.options)}n.to=i})(M5||(M5={}));var gE;(function(n){function e(s){if(s){const r=s;return r&&r.customExecution==="customExecution"}else return!1}n.is=e;function t(s){return{customExecution:"customExecution"}}n.from=t;function i(s,r){return r.get(s)}n.to=i})(gE||(gE={}));var WVe;(function(n){function e(t,i){let s;return t.scope!==void 0&&typeof t.scope!="number"?s=t.scope.uri:t.scope!==void 0&&typeof t.scope=="number"&&(t.scope===xE.Workspace&&i&&i.workspaceFile?s=i.workspaceFile:s=QAe),{id:t._id,workspaceFolder:s}}n.from=e})(WVe||(WVe={}));var fbe;(function(n){function e(t){if(t!=null)return{_id:t.id,isDefault:t.isDefault}}n.from=e})(fbe||(fbe={}));var ID;(function(n){function e(s,r){if(s==null)return[];const o=[];for(const a of s){const l=t(a,r);l&&o.push(l)}return o}n.fromMany=e;function t(s,r){if(s==null)return;let o;s.execution instanceof AA?o=N5.from(s.execution):s.execution instanceof nI?o=M5.from(s.execution):s.execution&&s.execution instanceof poe&&(o=gE.from(s.execution));const a=tJ.from(s.definition);let l;return s.scope?typeof s.scope=="number"?l=s.scope:l=s.scope.uri:l=xE.Workspace,!a||!l?void 0:{_id:s._id,definition:a,name:s.name,source:{extensionId:r.identifier.value,label:s.source,scope:l},execution:o,isBackground:s.isBackground,group:fbe.from(s.group),presentationOptions:iJ.from(s.presentationOptions),problemMatchers:hu(s.problemMatchers),hasDefinedMatchers:s.hasDefinedMatchers,runOptions:s.runOptions?s.runOptions:{reevaluateOnRerun:!0},detail:s.detail}}n.from=t;async function i(s,r,o){if(s==null)return;let a;N5.is(s.execution)?a=N5.to(s.execution):M5.is(s.execution)?a=M5.to(s.execution):gE.is(s.execution)&&(a=gE.to(s._id,o));const l=tJ.to(s.definition);let c;if(s.source&&(s.source.scope!==void 0?typeof s.source.scope=="number"?c=s.source.scope:c=await r.resolveWorkspaceFolder(N.revive(s.source.scope)):c=xE.Workspace),!l||!c)return;const d=new f$(l,c,s.name,s.source.label,a,s.problemMatchers);return s.isBackground!==void 0&&(d.isBackground=s.isBackground),s.group!==void 0&&(d.group=U2.from(s.group._id),d.group&&s.group.isDefault&&(d.group=new U2(d.group.id,d.group.label),s.group.isDefault===!0&&(d.group.isDefault=s.group.isDefault))),s.presentationOptions&&(d.presentationOptions=iJ.to(s.presentationOptions)),s._id&&(d._id=s._id),s.detail&&(d.detail=s.detail),d}n.to=i})(ID||(ID={}));var gbe;(function(n){function e(i){return i}n.from=e;function t(i){if(i)return Object.assign(Object.create(null),i)}n.to=t})(gbe||(gbe={}));class ihe{#e;constructor(e,t,i){this._id=t,this._task=i,this.#e=e}get task(){return this._task}terminate(){this.#e.terminateTask(this)}fireDidStartProcess(e){}fireDidEndProcess(e){}get terminal(){return this._terminal}set terminal(e){this._terminal=e}}let pbe=class{constructor(e,t,i,s,r,o,a,l){this._onDidExecuteTask=new A,this._onDidTerminateTask=new A,this._onDidTaskProcessStarted=new A,this._onDidTaskProcessEnded=new A,this._onDidStartTaskProblemMatchers=new A,this._onDidEndTaskProblemMatchers=new A,this._proxy=e.getProxy(Xe.MainThreadTask),this._workspaceProvider=i,this._editorService=s,this._configurationService=r,this._terminalService=o,this._handleCounter=0,this._handlers=new Map,this._taskExecutions=new Map,this._taskExecutionPromises=new Map,this._providedCustomExecutions2=new Map,this._notProvidedCustomExecutions=new Set,this._activeCustomExecutions2=new Map,this._logService=a,this._deprecationService=l,this._proxy.$registerSupportedExecutions(!0)}registerTaskProvider(e,t,i){if(!i)return new bs(()=>{});const s=this.nextHandle();return this._handlers.set(s,{type:t,provider:i,extension:e}),this._proxy.$registerTaskProvider(s,t),new bs(()=>{this._handlers.delete(s),this._proxy.$unregisterTaskProvider(s)})}registerTaskSystem(e,t){this._proxy.$registerTaskSystem(e,t)}fetchTasks(e){return this._proxy.$fetchTasks(gbe.from(e)).then(async t=>{const i=[];for(const s of t){const r=await ID.to(s,this._workspaceProvider,this._providedCustomExecutions2);r&&i.push(r)}return i})}get taskExecutions(){const e=[];return this._taskExecutions.forEach(t=>e.push(t)),e}terminateTask(e){if(!(e instanceof ihe))throw new Error("No valid task execution provided");return this._proxy.$terminateTask(e._id)}get onDidStartTask(){return this._onDidExecuteTask.event}async $onDidStartTask(e,t,i){const s=this._providedCustomExecutions2.get(e.id);s&&(this._activeCustomExecutions2.set(e.id,s),this._terminalService.attachPtyToTerminal(t,await s.callback(i))),this._lastStartedTask=e.id;const r=await this.getTaskExecution(e),o=this._terminalService.getTerminalById(t)?.value;r&&(r.terminal=o),this._onDidExecuteTask.fire({execution:r})}get onDidEndTask(){return this._onDidTerminateTask.event}async $OnDidEndTask(e){if(!this._taskExecutionPromises.has(e.id))return;const t=await this.getTaskExecution(e);this._taskExecutionPromises.delete(e.id),this._taskExecutions.delete(e.id),this.customExecutionComplete(e),this._onDidTerminateTask.fire({execution:t})}get onDidStartTaskProcess(){return this._onDidTaskProcessStarted.event}async $onDidStartTaskProcess(e){const t=await this.getTaskExecution(e.id);this._onDidTaskProcessStarted.fire({execution:t,processId:e.processId})}get onDidEndTaskProcess(){return this._onDidTaskProcessEnded.event}async $onDidEndTaskProcess(e){const t=await this.getTaskExecution(e.id);this._onDidTaskProcessEnded.fire({execution:t,exitCode:e.exitCode})}get onDidStartTaskProblemMatchers(){return this._onDidStartTaskProblemMatchers.event}async $onDidStartTaskProblemMatchers(e){let t;try{t=await this.getTaskExecution(e.execution.id)}catch{return}this._onDidStartTaskProblemMatchers.fire({execution:t})}get onDidEndTaskProblemMatchers(){return this._onDidEndTaskProblemMatchers.event}async $onDidEndTaskProblemMatchers(e){let t;try{t=await this.getTaskExecution(e.execution.id)}catch{return}this._onDidEndTaskProblemMatchers.fire({execution:t,hasErrors:e.hasErrors})}$provideTasks(e,t){const i=this._handlers.get(e);if(!i)return Promise.reject(new Error("no handler found"));const s=[],r=Ih(()=>i.provider.provideTasks(et.None)).then(o=>this.provideTasksInternal(t,s,i,o));return new Promise(o=>{r.then(a=>{Promise.all(s).then(()=>{o(a)})})})}async $resolveTask(e,t){const i=this._handlers.get(e);if(!i)return Promise.reject(new Error("no handler found"));if(t.definition.type!==i.type)throw new Error(`Unexpected: Task of type [${t.definition.type}] cannot be resolved by provider of type [${i.type}].`);const s=await ID.to(t,this._workspaceProvider,this._providedCustomExecutions2);if(!s)throw new Error("Unexpected: Task cannot be resolved.");const r=await i.provider.resolveTask(s,et.None);if(!r)return;this.checkDeprecation(r,i);const o=ID.from(r,i.extension);if(!o)throw new Error("Unexpected: Task cannot be resolved.");if(r.definition!==s.definition)throw new Error("Unexpected: The resolved task definition must be the same object as the original task definition. The task definition cannot be changed.");return gE.is(o.execution)&&await this.addCustomExecution(o,r,!0),await this.resolveTaskInternal(o)}nextHandle(){return this._handleCounter++}async addCustomExecution(e,t,i){const s=await this._proxy.$createTaskId(e);!i&&!this._providedCustomExecutions2.has(s)&&(this._notProvidedCustomExecutions.add(s),this._activeCustomExecutions2.set(s,t.execution)),this._providedCustomExecutions2.set(s,t.execution)}async getTaskExecution(e,t){if(typeof e=="string"){const r=this._taskExecutionPromises.get(e);if(!r)throw new wa("Unexpected: The specified task is missing an execution");return r}const i=this._taskExecutionPromises.get(e.id);if(i)return i;let s;return t?s=Promise.resolve(new ihe(this,e.id,t)):s=ID.to(e.task,this._workspaceProvider,this._providedCustomExecutions2).then(r=>{if(!r)throw new wa("Unexpected: Task does not exist.");return new ihe(this,e.id,r)}),this._taskExecutionPromises.set(e.id,s),s.then(r=>(this._taskExecutions.set(e.id,r),r))}checkDeprecation(e,t){e._deprecated&&this._deprecationService.report("Task.constructor",t.extension,"Use the Task constructor that takes a `scope` instead.")}customExecutionComplete(e){this._activeCustomExecutions2.get(e.id)&&this._activeCustomExecutions2.delete(e.id),this._notProvidedCustomExecutions.has(e.id)&&this._lastStartedTask!==e.id&&(this._providedCustomExecutions2.delete(e.id),this._notProvidedCustomExecutions.delete(e.id));const i=this._notProvidedCustomExecutions.values();let s=i.next();for(;!s.done;)!this._activeCustomExecutions2.has(s.value)&&this._lastStartedTask!==s.value&&(this._providedCustomExecutions2.delete(s.value),this._notProvidedCustomExecutions.delete(s.value)),s=i.next()}};pbe=y([v(0,dr),v(1,Yc),v(2,rx),v(3,zH),v(4,ox),v(5,qH),v(6,it),v(7,bz)],pbe);let mbe=class extends pbe{constructor(e,t,i,s,r,o,a,l){super(e,t,i,s,r,o,a,l),this.registerTaskSystem(ye.vscodeRemote,{scheme:ye.vscodeRemote,authority:"",platform:tdt(mc.Web)})}async executeTask(e,t){if(!t.execution)throw new Error("Tasks to execute must include an execution");const i=ID.from(t,e);if(i===void 0)throw new Error("Task is not valid");if(gE.is(i.execution))await this.addCustomExecution(i,t,!1);else throw new JS;const s=await this.getTaskExecution(await this._proxy.$getTaskExecution(i),t);return this._proxy.$executeTask(i).catch(r=>{throw new Error(r)}),s}provideTasksInternal(e,t,i,s){const r=[];if(s)for(const o of s){if(this.checkDeprecation(o,i),!o.definition||!e[o.definition.type]){const l=o.source?o.source:"No task source";this._logService.warn(`The task [${l}, ${o.name}] uses an undefined task type. The task will be ignored in the future.`)}const a=ID.from(o,i.extension);a&&gE.is(a.execution)?(r.push(a),t.push(this.addCustomExecution(a,o,!0))):this._logService.warn("Only custom execution tasks supported.")}return{tasks:r,extension:i.extension}}async resolveTaskInternal(e){if(gE.is(e.execution))return e;this._logService.warn("Only custom execution tasks supported.")}async $resolveVariables(e,t){return{process:void 0,variables:Object.create(null)}}async $jsonTasksSupported(){return!1}async $findExecutable(e,t,i){}};mbe=y([v(0,dr),v(1,Yc),v(2,rx),v(3,zH),v(4,ox),v(5,qH),v(6,it),v(7,bz)],mbe);const Vtt=de("IExtHostTask");class Utt{constructor(){this.pendingRequests=new Map,this.queue=[],this._onError=new A,this._onExit=new A,this.sequence=1}get onError(){return this._onError.event}get onExit(){return this._onExit.event}onMessage(e){this.messageCallback&&this._onError.fire(new Error("attempt to set more than one 'Message' callback")),this.messageCallback=e}onEvent(e){this.eventCallback&&this._onError.fire(new Error("attempt to set more than one 'Event' callback")),this.eventCallback=e}onRequest(e){this.requestCallback&&this._onError.fire(new Error("attempt to set more than one 'Request' callback")),this.requestCallback=e}sendResponse(e){e.seq>0?this._onError.fire(new Error(`attempt to send more than one response for command ${e.command}`)):this.internalSend("response",e)}sendRequest(e,t,i,s){const r={command:e};if(t&&Object.keys(t).length>0&&(r.arguments=t),this.internalSend("request",r),typeof s=="number"){const o=setTimeout(()=>{clearTimeout(o);const a=this.pendingRequests.get(r.seq);if(a){this.pendingRequests.delete(r.seq);const l={type:"response",seq:0,request_seq:r.seq,success:!1,command:e,message:f(6391,"Timeout after {0} ms for '{1}'",s,e)};a(l)}},s)}return i&&this.pendingRequests.set(r.seq,i),r.seq}acceptMessage(e){this.messageCallback?this.messageCallback(e):(this.queue.push(e),this.queue.length===1&&this.processQueue())}needsTaskBoundaryBetween(e,t){return e.type!=="event"||t.type!=="event"}async processQueue(){let e;for(;this.queue.length;){if((!e||this.needsTaskBoundaryBetween(this.queue[0],e))&&await ya(0),e=this.queue.shift(),!e)return;switch(e.type){case"event":this.eventCallback?.(e);break;case"request":this.requestCallback?.(e);break;case"response":{const t=e,i=this.pendingRequests.get(t.request_seq);i&&(this.pendingRequests.delete(t.request_seq),i(t));break}}}}internalSend(e,t){t.type=e,t.seq=this.sequence++,this.sendMessage(t)}async cancelPendingRequests(){if(this.pendingRequests.size===0)return Promise.resolve();const e=new Map;this.pendingRequests.forEach((t,i)=>e.set(i,t)),await ya(500),e.forEach((t,i)=>{t({type:"response",seq:0,request_seq:i,success:!1,command:"canceled",message:"canceled"}),this.pendingRequests.delete(i)})}getPendingRequestIds(){return Array.from(this.pendingRequests.keys())}dispose(){this.queue=[]}}function $tt(n){return n.configuration.request==="attach"&&!ztt(n)&&(!n.parentSession||$tt(n.parentSession))}function ztt(n){let e=n.configuration.type;if(e)return e==="vslsShare"&&(e=n.configuration.adapterProxy.configuration.type),$a(e,"extensionhost")||$a(e,"pwa-extensionhost")?n:n.parentSession?ztt(n.parentSession):void 0}function h2t(n){return n.type&&(n.label||n.program||n.runtime)}const u2t=/^[a-zA-Z][a-zA-Z0-9\+\-\.]+:/;function f2t(n){return!!(n&&n.match(u2t))}function qtt(n){if(typeof n.path=="string"&&!(typeof n.sourceReference=="number"&&n.sourceReference>0)){if(f2t(n.path))return N.parse(n.path);if(DA(n.path))return N.file(n.path)}return n.path}function Gtt(n){if(typeof n.path=="object"){const e=N.revive(n.path);if(e)return e.scheme===ye.file?e.fsPath:e.toString()}return n.path}function Ktt(n,e){const t=e?qtt:Gtt,i=Ls(n);return Ytt(i,(s,r)=>{s&&r&&(r.path=t(r))}),i}function jtt(n,e){const t=e?qtt:Gtt,i=Ls(n);return Ytt(i,(s,r)=>{!s&&r&&(r.path=t(r))}),i}function Ytt(n,e){switch(n.type){case"event":{const t=n;switch(t.event){case"output":e(!1,t.body.source);break;case"loadedSource":e(!1,t.body.source);break;case"breakpoint":e(!1,t.body.breakpoint.source);break}break}case"request":{const t=n;switch(t.command){case"setBreakpoints":e(!0,t.arguments.source);break;case"breakpointLocations":e(!0,t.arguments.source);break;case"source":e(!0,t.arguments.source);break;case"gotoTargets":e(!0,t.arguments.source);break;case"launchVSCode":t.arguments.args.forEach(i=>e(!1,i));break}break}case"response":{const t=n;if(t.success&&t.body)switch(t.command){case"stackTrace":t.body.stackFrames.forEach(i=>e(!1,i.source));break;case"loadedSources":t.body.sources.forEach(i=>e(!1,i));break;case"scopes":t.body.scopes.forEach(i=>e(!1,i.source));break;case"setFunctionBreakpoints":t.body.breakpoints.forEach(i=>e(!1,i.source));break;case"setBreakpoints":t.body.breakpoints.forEach(i=>e(!1,i.source));break;case"disassemble":t.body?.instructions.forEach(s=>e(!1,s.location));break;case"locations":e(!1,t.body?.source);break}break}}}const yz=de("IExtHostEditorTabs");class BVe{constructor(e,t,i){this._activeTabIdGetter=i,this._parentGroup=t,this.acceptDtoUpdate(e)}get apiObject(){if(!this._apiObject){const e=this,t={get isActive(){return e._dto.id===e._activeTabIdGetter()},get label(){return e._dto.label},get input(){return e._input},get isDirty(){return e._dto.isDirty},get isPinned(){return e._dto.isPinned},get isPreview(){return e._dto.isPreview},get group(){return e._parentGroup.apiObject}};this._apiObject=Object.freeze(t)}return this._apiObject}get tabId(){return this._dto.id}acceptDtoUpdate(e){this._dto=e,this._input=this._initInput()}_initInput(){switch(this._dto.input.kind){case pa.TextInput:return new _oe(N.revive(this._dto.input.uri));case pa.TextDiffInput:return new A$(N.revive(this._dto.input.original),N.revive(this._dto.input.modified));case pa.TextMergeInput:return new $Le(N.revive(this._dto.input.base),N.revive(this._dto.input.input1),N.revive(this._dto.input.input2),N.revive(this._dto.input.result));case pa.CustomEditorInput:return new voe(N.revive(this._dto.input.uri),this._dto.input.viewType);case pa.WebviewEditorInput:return new zLe(this._dto.input.viewType);case pa.NotebookInput:return new woe(N.revive(this._dto.input.uri),this._dto.input.notebookType);case pa.NotebookDiffInput:return new boe(N.revive(this._dto.input.original),N.revive(this._dto.input.modified),this._dto.input.notebookType);case pa.TerminalEditorInput:return new qLe;case pa.InteractiveEditorInput:return new GLe(N.revive(this._dto.input.uri),N.revive(this._dto.input.inputBoxUri));case pa.ChatEditorInput:return new KLe;case pa.MultiDiffEditorInput:return new jLe(this._dto.input.diffEditors.map(e=>new A$(N.revive(e.original),N.revive(e.modified))));default:return}}}class g2t{constructor(e,t){this._tabs=[],this._activeTabId="",this._dto=e,this._activeGroupIdGetter=t;for(const i of e.tabs)i.isActive&&(this._activeTabId=i.id),this._tabs.push(new BVe(i,this,()=>this.activeTabId()))}get apiObject(){if(!this._apiObject){const e=this,t={get isActive(){return e._dto.groupId===e._activeGroupIdGetter()},get viewColumn(){return pc.to(e._dto.viewColumn)},get activeTab(){return e._tabs.find(i=>i.tabId===e._activeTabId)?.apiObject},get tabs(){return Object.freeze(e._tabs.map(i=>i.apiObject))}};this._apiObject=Object.freeze(t)}return this._apiObject}get groupId(){return this._dto.groupId}get tabs(){return this._tabs}acceptGroupDtoUpdate(e){this._dto=e}acceptTabOperation(e){if(e.kind===vh.TAB_OPEN){const i=new BVe(e.tabDto,this,()=>this.activeTabId());return this._tabs.splice(e.index,0,i),e.tabDto.isActive&&(this._activeTabId=i.tabId),i}else if(e.kind===vh.TAB_CLOSE){const i=this._tabs.splice(e.index,1)[0];if(!i)throw new Error(`Tab close updated received for index ${e.index} which does not exist`);return i.tabId===this._activeTabId&&(this._activeTabId=""),i}else if(e.kind===vh.TAB_MOVE){if(e.oldIndex===void 0)throw new Error("Invalid old index on move IPC");const i=this._tabs.splice(e.oldIndex,1)[0];if(!i)throw new Error(`Tab move updated received for index ${e.oldIndex} which does not exist`);return this._tabs.splice(e.index,0,i),i}const t=this._tabs.find(i=>i.tabId===e.tabDto.id);if(!t)throw new Error("INVALID tab");return e.tabDto.isActive?this._activeTabId=e.tabDto.id:this._activeTabId===e.tabDto.id&&!e.tabDto.isActive&&(this._activeTabId=""),t.acceptDtoUpdate(e.tabDto),t}activeTabId(){return this._activeTabId}}let _be=class{constructor(e){this._onDidChangeTabs=new A,this._onDidChangeTabGroups=new A,this._extHostTabGroups=[],this._proxy=e.getProxy(Xe.MainThreadEditorTabs)}get tabGroups(){if(!this._apiObject){const e=this,t={onDidChangeTabGroups:e._onDidChangeTabGroups.event,onDidChangeTabs:e._onDidChangeTabs.event,get all(){return Object.freeze(e._extHostTabGroups.map(i=>i.apiObject))},get activeTabGroup(){const i=e._activeGroupId;return qr(e._extHostTabGroups.find(r=>r.groupId===i)?.apiObject)},close:async(i,s)=>{const r=Array.isArray(i)?i:[i];return r.length?p2t(r[0])?this._closeGroups(r,s):this._closeTabs(r,s):!0}};this._apiObject=Object.freeze(t)}return this._apiObject}$acceptEditorTabModel(e){const t=new Set(this._extHostTabGroups.map(c=>c.groupId)),i=new Set(e.map(c=>c.groupId)),s=jre(t,i),r=this._extHostTabGroups.filter(c=>s.removed.includes(c.groupId)).map(c=>c.apiObject),o=[],a=[];this._extHostTabGroups=e.map(c=>{const d=new g2t(c,()=>this._activeGroupId);return s.added.includes(d.groupId)?o.push(d.apiObject):a.push(d.apiObject),d});const l=qr(e.find(c=>c.isActive===!0)?.groupId);l!==void 0&&this._activeGroupId!==l&&(this._activeGroupId=l),this._onDidChangeTabGroups.fire(Object.freeze({opened:o,closed:r,changed:a}))}$acceptTabGroupUpdate(e){const t=this._extHostTabGroups.find(i=>i.groupId===e.groupId);if(!t)throw new Error("Update Group IPC call received before group creation.");t.acceptGroupDtoUpdate(e),e.isActive&&(this._activeGroupId=e.groupId),this._onDidChangeTabGroups.fire(Object.freeze({changed:[t.apiObject],opened:[],closed:[]}))}$acceptTabOperation(e){const t=this._extHostTabGroups.find(s=>s.groupId===e.groupId);if(!t)throw new Error("Update Tabs IPC call received before group creation.");const i=t.acceptTabOperation(e);switch(e.kind){case vh.TAB_OPEN:this._onDidChangeTabs.fire(Object.freeze({opened:[i.apiObject],closed:[],changed:[]}));return;case vh.TAB_CLOSE:this._onDidChangeTabs.fire(Object.freeze({opened:[],closed:[i.apiObject],changed:[]}));return;case vh.TAB_MOVE:case vh.TAB_UPDATE:this._onDidChangeTabs.fire(Object.freeze({opened:[],closed:[],changed:[i.apiObject]}));return}}_findExtHostTabFromApi(e){for(const t of this._extHostTabGroups)for(const i of t.tabs)if(i.apiObject===e)return i}_findExtHostTabGroupFromApi(e){return this._extHostTabGroups.find(t=>t.apiObject===e)}async _closeTabs(e,t){const i=[];for(const s of e){const r=this._findExtHostTabFromApi(s);if(!r)throw new Error("Tab close: Invalid tab not found!");i.push(r.tabId)}return this._proxy.$closeTab(i,t)}async _closeGroups(e,t){const i=[];for(const s of e){const r=this._findExtHostTabGroupFromApi(s);if(!r)throw new Error("Group close: Invalid group not found!");i.push(r.groupId)}return this._proxy.$closeGroup(i,t)}};_be=y([v(0,dr)],_be);function p2t(n){return n.tabs!==void 0}class m2t{constructor(e,t){this.versionId=e,this.removedDueToLooping=t}}class lk extends V{static isHostExtension(e,t,i){if(t.getExtensionDescription(e))return!1;const s=i.getExtensionDescription(e);return s?!!((s.main||s.browser)&&s.api==="none"):!1}constructor(e,t){super(),this._activationEventsReader=e,this._onDidChange=this._register(new A),this.onDidChange=this._onDidChange.event,this._versionId=0,this._extensionDescriptions=t,this._initialize()}_initialize(){this._extensionDescriptions.sort(S2t),this._extensionsMap=new Pa,this._extensionsArr=[],this._activationMap=new Map;for(const e of this._extensionDescriptions){if(this._extensionsMap.has(e.identifier)){console.error("Extension `"+e.identifier.value+"` is already registered");continue}this._extensionsMap.set(e.identifier,e),this._extensionsArr.push(e);const t=this._activationEventsReader.readActivationEvents(e);for(const i of t)this._activationMap.has(i)||this._activationMap.set(i,[]),this._activationMap.get(i).push(e)}}set(e){return this._extensionDescriptions=e,this._initialize(),this._versionId++,this._onDidChange.fire(void 0),{versionId:this._versionId}}deltaExtensions(e,t){this._extensionDescriptions=HVe(this._extensionDescriptions,t),this._extensionDescriptions=this._extensionDescriptions.concat(e);const i=lk._findLoopingExtensions(this._extensionDescriptions);return this._extensionDescriptions=HVe(this._extensionDescriptions,i.map(s=>s.identifier)),this._initialize(),this._versionId++,this._onDidChange.fire(void 0),new m2t(this._versionId,i)}static _findLoopingExtensions(e){const t=new class{constructor(){this._arcs=new Map,this._nodesSet=new Set,this._nodesArr=[]}addNode(a){this._nodesSet.has(a)||(this._nodesSet.add(a),this._nodesArr.push(a))}addArc(a,l){this.addNode(a),this.addNode(l),this._arcs.has(a)?this._arcs.get(a).push(l):this._arcs.set(a,[l])}getArcs(a){return this._arcs.has(a)?this._arcs.get(a):[]}hasOnlyGoodArcs(a,l){const c=t.getArcs(a);for(let d=0;d<c.length;d++)if(!l.has(c[d]))return!1;return!0}getNodes(){return this._nodesArr}},i=new Pa;for(const a of e)if(i.set(a.identifier,a),a.extensionDependencies)for(const l of a.extensionDependencies)t.addArc(Kn.toKey(a.identifier),Kn.toKey(l));const s=new Set;t.getNodes().filter(a=>t.getArcs(a).length===0).forEach(a=>s.add(a));const r=t.getNodes().filter(a=>!s.has(a));let o;do{o=!1;for(let a=0;a<r.length;a++){const l=r[a];t.hasOnlyGoodArcs(l,s)&&(r.splice(a,1),a--,s.add(l),o=!0)}}while(o);return r.map(a=>i.get(a))}containsActivationEvent(e){return this._activationMap.has(e)}containsExtension(e){return this._extensionsMap.has(e)}getExtensionDescriptionsForActivationEvent(e){const t=this._activationMap.get(e);return t?t.slice(0):[]}getAllExtensionDescriptions(){return this._extensionsArr.slice(0)}getSnapshot(){return new _2t(this._versionId,this.getAllExtensionDescriptions())}getExtensionDescription(e){const t=this._extensionsMap.get(e);return t||void 0}getExtensionDescriptionByUUID(e){for(const t of this._extensionsArr)if(t.uuid===e)return t}getExtensionDescriptionByIdOrUUID(e,t){return this.getExtensionDescription(e)??(t?this.getExtensionDescriptionByUUID(t):void 0)}}class _2t{constructor(e,t){this.versionId=e,this.extensions=t}}class v2t{constructor(e){this._lock=new y2t,this._actual=new lk(e,[])}async acquireLock(e){const t=await this._lock.acquire(e);return new w2t(this,t)}deltaExtensions(e,t,i){if(!e.isAcquiredFor(this))throw new Error("Lock is not held");return this._actual.deltaExtensions(t,i)}containsActivationEvent(e){return this._actual.containsActivationEvent(e)}containsExtension(e){return this._actual.containsExtension(e)}getExtensionDescriptionsForActivationEvent(e){return this._actual.getExtensionDescriptionsForActivationEvent(e)}getAllExtensionDescriptions(){return this._actual.getAllExtensionDescriptions()}getSnapshot(){return this._actual.getSnapshot()}getExtensionDescription(e){return this._actual.getExtensionDescription(e)}getExtensionDescriptionByUUID(e){return this._actual.getExtensionDescriptionByUUID(e)}getExtensionDescriptionByIdOrUUID(e,t){return this._actual.getExtensionDescriptionByIdOrUUID(e,t)}}class w2t extends V{constructor(e,t){super(),this._registry=e,this._isDisposed=!1,this._register(t)}isAcquiredFor(e){return!this._isDisposed&&this._registry===e}}class b2t{constructor(e){this.name=e;const t=T2();this.promise=t.promise,this._resolve=t.resolve}resolve(e){this._resolve(e)}}class y2t{constructor(){this._pendingCustomers=[],this._isLocked=!1}async acquire(e){const t=new b2t(e);return this._pendingCustomers.push(t),this._advance(),t.promise}_advance(){if(this._isLocked||this._pendingCustomers.length===0)return;const e=this._pendingCustomers.shift();this._isLocked=!0;let t=!0;const i=setTimeout(()=>{t&&console.warn(`The customer named ${e.name} has been holding on to the lock for 30s. This might be a problem.`)},30*1e3),s=()=>{t&&(clearTimeout(i),t=!1,this._isLocked=!1,this._advance())};e.resolve(ke(s))}}var Fx;(function(n){n[n.Builtin=0]="Builtin",n[n.User=1]="User",n[n.Dev=2]="Dev"})(Fx||(Fx={}));function S2t(n,e){const t=n.isBuiltin?Fx.Builtin:n.isUnderDevelopment?Fx.Dev:Fx.User,i=e.isBuiltin?Fx.Builtin:e.isUnderDevelopment?Fx.Dev:Fx.User;if(t!==i)return t-i;const s=_n.basename(n.extensionLocation.path),r=_n.basename(e.extensionLocation.path);return s<r?-1:s>r?1:0}function HVe(n,e){const t=new c_(e);return n.filter(i=>!t.has(i.identifier))}const Wne=class Wne{constructor(e,t,i,s){this.startup=e,this.codeLoadingTime=t,this.activateCallTime=i,this.activateResolvedTime=s}};Wne.NONE=new Wne(!1,-1,-1,-1);let iB=Wne;class nhe{constructor(e){this._startup=e,this._codeLoadingStart=-1,this._codeLoadingStop=-1,this._activateCallStart=-1,this._activateCallStop=-1,this._activateResolveStart=-1,this._activateResolveStop=-1}_delta(e,t){return e===-1||t===-1?-1:t-e}build(){return new iB(this._startup,this._delta(this._codeLoadingStart,this._codeLoadingStop),this._delta(this._activateCallStart,this._activateCallStop),this._delta(this._activateResolveStart,this._activateResolveStop))}codeLoadingStart(){this._codeLoadingStart=Date.now()}codeLoadingStop(){this._codeLoadingStop=Date.now()}activateCallStart(){this._activateCallStart=Date.now()}activateCallStop(){this._activateCallStop=Date.now()}activateResolveStart(){this._activateResolveStart=Date.now()}activateResolveStop(){this._activateResolveStop=Date.now()}}class Ale{constructor(e,t,i,s,r,o){this.activationFailed=e,this.activationFailedError=t,this.activationTimes=i,this.module=s,this.exports=r,this.disposable=o}}class C2t extends Ale{constructor(e){super(!1,null,e,{activate:void 0,deactivate:void 0},void 0,V.None)}}class E2t extends Ale{constructor(){super(!1,null,iB.NONE,{activate:void 0,deactivate:void 0},void 0,V.None)}}class nJ extends Ale{constructor(e){super(!0,e,iB.NONE,{activate:void 0,deactivate:void 0},void 0,V.None)}}let vbe=class{constructor(e,t,i,s){this._logService=s,this._registry=e,this._globalRegistry=t,this._host=i,this._operations=new Pa,this._alreadyActivatedEvents=Object.create(null)}dispose(){for(const[e,t]of this._operations)t.dispose()}async waitForActivatingExtensions(){const e=[];for(const[t,i]of this._operations)e.push(i.wait());await Promise.all(e)}isActivated(e){const t=this._operations.get(e);return!!(t&&t.value)}getActivatedExtension(e){const t=this._operations.get(e);if(!t||!t.value)throw new Error(`Extension '${e.value}' is not known or not activated`);return t.value}async activateByEvent(e,t){if(this._alreadyActivatedEvents[e])return;const i=this._registry.getExtensionDescriptionsForActivationEvent(e);await this._activateExtensions(i.map(s=>({id:s.identifier,reason:{startup:t,extensionId:s.identifier,activationEvent:e}}))),this._alreadyActivatedEvents[e]=!0}activateById(e,t){const i=this._registry.getExtensionDescription(e);if(!i)throw new Error(`Extension '${e.value}' is not known`);return this._activateExtensions([{id:i.identifier,reason:t}])}async _activateExtensions(e){const t=e.filter(i=>!this.isActivated(i.id)).map(i=>this._handleActivationRequest(i));await Promise.all(t.map(i=>i.wait()))}_handleActivationRequest(e){if(this._operations.has(e.id))return this._operations.get(e.id);if(this._isHostExtension(e.id))return this._createAndSaveOperation(e,null,[],null);const t=this._registry.getExtensionDescription(e.id);if(!t){const r=new Error(`Cannot activate unknown extension '${e.id.value}'`),o=this._createAndSaveOperation(e,null,[],new nJ(r));return this._host.onExtensionActivationError(e.id,r,new THe(e.id.value)),o}const i=[],s=typeof t.extensionDependencies>"u"?[]:t.extensionDependencies;for(const r of s){if(this._isResolvedExtension(r))continue;const o=this._operations.get(r);if(o){i.push(o);continue}if(this._isHostExtension(r)){i.push(this._handleActivationRequest({id:this._globalRegistry.getExtensionDescription(r).identifier,reason:e.reason}));continue}const a=this._registry.getExtensionDescription(r);if(a){if(!a.main&&!a.browser)continue;i.push(this._handleActivationRequest({id:a.identifier,reason:e.reason}));continue}const l=t.displayName||t.identifier.value,c=new Error(`Cannot activate the '${l}' extension because it depends on unknown extension '${r}'`),d=this._createAndSaveOperation(e,t.displayName,[],new nJ(c));return this._host.onExtensionActivationError(t.identifier,c,new THe(r)),d}return this._createAndSaveOperation(e,t.displayName,i,null)}_createAndSaveOperation(e,t,i,s){const r=new wbe(e.id,t,e.reason,i,s,this._host,this._logService);return this._operations.set(e.id,r),r}_isHostExtension(e){return lk.isHostExtension(e,this._registry,this._globalRegistry)}_isResolvedExtension(e){const t=this._globalRegistry.getExtensionDescription(e);return t?!t.main&&!t.browser:!1}};vbe=y([v(3,it)],vbe);let wbe=class{get value(){return this._value}get friendlyName(){return this._displayName||this._id.value}constructor(e,t,i,s,r,o,a){this._id=e,this._displayName=t,this._reason=i,this._deps=s,this._value=r,this._host=o,this._logService=a,this._barrier=new Lh,this._isDisposed=!1,this._initialize()}dispose(){this._isDisposed=!0}wait(){return this._barrier.wait()}async _initialize(){await this._waitForDepsThenActivate(),this._barrier.open()}async _waitForDepsThenActivate(){if(!this._value){for(;this._deps.length>0;){for(let e=0;e<this._deps.length;e++){const t=this._deps[e];if(t.value&&!t.value.activationFailed){this._deps.splice(e,1),e--;continue}if(t.value&&t.value.activationFailed){const i=new Error(`Cannot activate the '${this.friendlyName}' extension because its dependency '${t.friendlyName}' failed to activate`);i.detail=t.value.activationFailedError,this._value=new nJ(i),this._host.onExtensionActivationError(this._id,i,null);return}}this._deps.length>0&&await Promise.race(this._deps.map(e=>e.wait()))}await this._activate()}}async _activate(){try{this._value=await this._host.actualActivateExtension(this._id,this._reason)}catch(e){const t=new Error;if(e&&e.name&&(t.name=e.name),e&&e.message?t.message=`Activating extension '${this._id.value}' failed: ${e.message}.`:t.message=`Activating extension '${this._id.value}' failed: ${e}.`,e&&e.stack&&(t.stack=e.stack),this._value=new nJ(t),this._isDisposed&&Xr(e))return;this._host.onExtensionActivationError(this._id,t,null),this._logService.error(`Activating extension ${this._id.value} failed due to an error:`),this._logService.error(e)}}};wbe=y([v(6,it)],wbe);class Xtt{constructor(e,t){this._logService=t,this._onDidChangeStorage=new A,this.onDidChangeStorage=this._onDidChangeStorage.event,this._proxy=e.getProxy(Xe.MainThreadStorage)}registerExtensionStorageKeysToSync(e,t){this._proxy.$registerExtensionStorageKeysToSync(e,t)}async initializeExtensionStorage(e,t,i){const s=await this._proxy.$initializeExtensionStorage(e,t);let r;return s&&(r=this.safeParseValue(e,t,s)),r||i}setValue(e,t,i){return this._proxy.$setValue(e,t,i)}$acceptValue(e,t,i){const s=this.safeParseValue(e,t,i);s&&this._onDidChangeStorage.fire({shared:e,key:t,value:s})}safeParseValue(e,t,i){try{return JSON.parse(i)}catch(s){this._logService.error(`[extHostStorage] unexpected error parsing storage contents (extensionId: ${t}, global: ${e}): ${s}`)}}}const JAe=de("IExtHostStorage");class Qtt{constructor(e,t,i){this._deferredPromises=new Map,this._id=e,this._shared=t,this._storage=i,this._init=this._storage.initializeExtensionStorage(this._shared,this._id,Object.create(null)).then(s=>(this._value=s,this)),this._storageListener=this._storage.onDidChangeStorage(s=>{s.shared===this._shared&&s.key===this._id&&(this._value=s.value)}),this._scheduler=new pn(()=>{const s=this._deferredPromises;this._deferredPromises=new Map,(async()=>{try{await this._storage.setValue(this._shared,this._id,this._value);for(const r of s.values())r.complete()}catch(r){for(const o of s.values())o.error(r)}})()},0)}keys(){return Object.entries(this._value??{}).filter(([,e])=>e!==void 0).map(([e])=>e)}get whenReady(){return this._init}get(e,t){let i=this._value[e];return typeof i>"u"&&(i=t),i}update(e,t){t!==null&&typeof t=="object"?this._value[e]=JSON.parse(JSON.stringify(t)):this._value[e]=t;const i=this._deferredPromises.get(e);if(i!==void 0)return i.p;const s=new ja;return this._deferredPromises.set(e,s),this._scheduler.isScheduled()||this._scheduler.schedule(),s.p}dispose(){this._storageListener.dispose()}}class x2t extends Qtt{setKeysForSync(e){this._storage.registerExtensionStorageKeysToSync({id:this._id,version:this._extension.version},e)}constructor(e,t){super(e.identifier.value,!0,t),this._extension=e}}const ePe=de("IExtensionStoragePaths");let bbe=class{constructor(e,t,i){this._logService=t,this._extHostFileSystem=i,this._workspace=e.workspace??void 0,this._environment=e.environment,this.whenReady=this._getOrCreateWorkspaceStoragePath().then(s=>this._value=s)}async _getWorkspaceStorageURI(e){return N.joinPath(this._environment.workspaceStorageHome,e)}async _getOrCreateWorkspaceStoragePath(){if(!this._workspace)return Promise.resolve(void 0);const e=this._workspace.id,t=await this._getWorkspaceStorageURI(e);try{return await this._extHostFileSystem.value.stat(t),this._logService.trace("[ExtHostStorage] storage dir already exists",t),t}catch{}try{return this._logService.trace("[ExtHostStorage] creating dir and metadata-file",t),await this._extHostFileSystem.value.createDirectory(t),await this._extHostFileSystem.value.writeFile(N.joinPath(t,"meta.json"),new TextEncoder().encode(JSON.stringify({id:this._workspace.id,configuration:N.revive(this._workspace.configuration)?.toString(),name:this._workspace.name},void 0,2))),t}catch(i){this._logService.error("[ExtHostStorage]",i);return}}workspaceValue(e){if(this._value)return N.joinPath(this._value,e.identifier.value)}globalValue(e){return N.joinPath(this._environment.globalStorageHome,e.identifier.value.toLowerCase())}onWillDeactivateAll(){}};bbe=y([v(0,Yc),v(1,it),v(2,xle)],bbe);class D2t extends qNt{}var sJ;(function(n){function e(i){return{remoteAddress:i.remoteAddress,localAddress:i.localAddress,public:!!i.public,privacy:i.privacy??(i.public?RC.Public:RC.Private),protocol:i.protocol}}n.fromApiTunnel=e;function t(i){return{remoteAddress:{host:i.tunnelRemoteHost,port:i.tunnelRemotePort},localAddress:i.localAddress,public:i.privacy!==RC.ConstantPrivate&&i.privacy!==RC.ConstantPrivate,privacy:i.privacy,protocol:i.protocol}}n.fromServiceTunnel=t})(sJ||(sJ={}));const tPe=de("IExtHostTunnelService");let ybe=class extends V{constructor(e,t,i){super(),this.logService=i,this._showCandidatePort=()=>Promise.resolve(!0),this._extensionTunnels=new Map,this._onDidChangeTunnels=new A,this.onDidChangeTunnels=this._onDidChangeTunnels.event,this._providerHandleCounter=0,this._portAttributesProviders=new Map,this._proxy=e.getProxy(Xe.MainThreadTunnelService)}async openTunnel(e,t){this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) ${e.identifier.value} called openTunnel API for ${t.remoteAddress.host}:${t.remoteAddress.port}.`);const i=await this._proxy.$openTunnel(t,e.displayName);if(i){const s=new D2t(i.remoteAddress,i.localAddress,()=>this._proxy.$closeTunnel(i.remoteAddress));return this._register(s),s}}async getTunnels(){return this._proxy.$getTunnels()}nextPortAttributesProviderHandle(){return this._providerHandleCounter++}registerPortsAttributesProvider(e,t){e.portRange===void 0&&e.commandPattern===void 0&&this.logService.error("PortAttributesProvider must specify either a portRange or a commandPattern");const i=this.nextPortAttributesProviderHandle();return this._portAttributesProviders.set(i,{selector:e,provider:t}),this._proxy.$registerPortsAttributesProvider(e,i),new bs(()=>{this._portAttributesProviders.delete(i),this._proxy.$unregisterPortsAttributesProvider(i)})}async $providePortAttributes(e,t,i,s,r){const o=[];for(const l of e){const c=this._portAttributesProviders.get(l);if(!c)return[];o.push(...await Promise.all(t.map(async d=>{let h;try{h=await c.provider.providePortAttributes({port:d,pid:i,commandLine:s},r)}catch{h=await c.provider.providePortAttributes(d,i,s,r)}return{providedAttributes:h,port:d}})))}const a=o.filter(l=>!!l.providedAttributes);return a.length>0?a.map(l=>({autoForwardAction:l.providedAttributes.autoForwardAction,port:l.port})):[]}async $registerCandidateFinder(e){}registerTunnelProvider(e,t){if(this._forwardPortProvider)throw new Error("A tunnel provider has already been registered. Only the first tunnel provider to be registered will be used.");this._forwardPortProvider=async(s,r)=>await e.provideTunnel(s,r,et.None)??void 0;const i=t.tunnelFeatures?{elevation:!!t.tunnelFeatures?.elevation,privacyOptions:t.tunnelFeatures?.privacyOptions,protocol:t.tunnelFeatures.protocol===void 0?!0:t.tunnelFeatures.protocol}:void 0;return this._proxy.$setTunnelProvider(i,!0),Promise.resolve(ke(()=>{this._forwardPortProvider=void 0,this._proxy.$setTunnelProvider(void 0,!1)}))}async setTunnelFactory(e,t){if(e){e.candidatePortSource!==void 0&&this._proxy.$setCandidatePortSource(e.candidatePortSource),e.showCandidatePort&&(this._showCandidatePort=e.showCandidatePort,this._proxy.$setCandidateFilter());const i=e.tunnelFactory??(t?this.makeManagedTunnelFactory(t):void 0);if(i){this._forwardPortProvider=i;let s=e.tunnelFeatures?.privacyOptions??[];e.tunnelFeatures?.public&&s.length===0&&(s=[{id:"private",label:f(2638,"Private"),themeIcon:"lock"},{id:"public",label:f(2639,"Public"),themeIcon:"eye"}]);const r=e.tunnelFeatures?{elevation:!!e.tunnelFeatures?.elevation,public:!!e.tunnelFeatures?.public,privacyOptions:s,protocol:!0}:void 0;this._proxy.$setTunnelProvider(r,!!e.tunnelFactory)}}else this._forwardPortProvider=void 0;return ke(()=>{this._forwardPortProvider=void 0})}makeManagedTunnelFactory(e){}async $closeTunnel(e,t){if(this._extensionTunnels.has(e.host)){const i=this._extensionTunnels.get(e.host);i.has(e.port)&&(t&&i.get(e.port).disposeListener.dispose(),await i.get(e.port).tunnel.dispose(),i.delete(e.port))}}async $onDidTunnelsChange(){this._onDidChangeTunnels.fire()}async $forwardPort(e,t){if(this._forwardPortProvider)try{this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Getting tunnel from provider.");const i=this._forwardPortProvider(e,t);if(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Got tunnel promise from provider."),i!==void 0){const s=await i;if(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Successfully awaited tunnel from provider."),s===void 0){this.logService.error("ForwardedPorts: (ExtHostTunnelService) Resolved tunnel is undefined");return}this._extensionTunnels.has(e.remoteAddress.host)||this._extensionTunnels.set(e.remoteAddress.host,new Map);const r=this._register(s.onDidDispose(()=>(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Extension fired tunnel's onDidDispose."),this._proxy.$closeTunnel(s.remoteAddress))));return this._extensionTunnels.get(e.remoteAddress.host).set(e.remoteAddress.port,{tunnel:s,disposeListener:r}),sJ.fromApiTunnel(s)}else this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Tunnel is undefined")}catch(i){if(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) tunnel provider error"),i instanceof Error)return i.message}}async $applyCandidateFilter(e){const t=await Promise.all(e.map(s=>this._showCandidatePort(s.host,s.port,s.detail??""))),i=e.filter((s,r)=>t[r]);return this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) filtered from ${e.map(s=>s.port).join(", ")} to ${i.map(s=>s.port).join(", ")}`),i}};ybe=y([v(0,dr),v(1,Yc),v(2,it)],ybe);const Ple="__",Ztt="/.well-known",k2t=`${Ztt}/oauth-authorization-server`,VVe=`${Ztt}/openid-configuration`,I2t=" ";var rJ;(function(n){n.InvalidRequest="invalid_request",n.InvalidClient="invalid_client",n.InvalidGrant="invalid_grant",n.UnauthorizedClient="unauthorized_client",n.UnsupportedGrantType="unsupported_grant_type",n.InvalidScope="invalid_scope"})(rJ||(rJ={}));var UVe;(function(n){n.AuthorizationPending="authorization_pending",n.SlowDown="slow_down",n.AccessDenied="access_denied",n.ExpiredToken="expired_token"})(UVe||(UVe={}));var $Ve;(function(n){n.InvalidRedirectUri="invalid_redirect_uri",n.InvalidClientMetadata="invalid_client_metadata",n.InvalidSoftwareStatement="invalid_software_statement",n.UnapprovedSoftwareStatement="unapproved_software_statement"})($Ve||($Ve={}));function T2t(n){return typeof n!="object"||n===null?!1:n.resource!==void 0}function L2t(n){return typeof n!="object"||n===null?!1:n.issuer!==void 0}function R2t(n){return typeof n!="object"||n===null?!1:n.client_id!==void 0}function zVe(n){if(typeof n!="object"||n===null)return!1;const e=n;return e.access_token!==void 0&&e.token_type!==void 0}function qVe(n){return typeof n!="object"||n===null?!1:n.error!==void 0}function A2t(n){return typeof n!="object"||n===null?!1:n.error!==void 0}function P2t(n){return{issuer:n.toString(),authorization_endpoint:new URL("/authorize",n).toString(),token_endpoint:new URL("/token",n).toString(),registration_endpoint:new URL("/register",n).toString(),response_types_supported:["code","id_token","id_token token"]}}const GVe=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:device_code"],KVe=33418;async function Jtt(n,e,t){if(!n.registration_endpoint)throw new Error("Server does not support dynamic registration");const i=await fetch(n.registration_endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_name:e,client_uri:"https://code.visualstudio.com",grant_types:n.grant_types_supported?n.grant_types_supported.filter(r=>GVe.includes(r)):GVe,response_types:["code"],redirect_uris:["https://insiders.vscode.dev/redirect","https://vscode.dev/redirect","http://localhost","http://127.0.0.1",`http://localhost:${KVe}`,`http://127.0.0.1:${KVe}`],scope:t?.join(I2t),token_endpoint_auth_method:"none",application_type:"native"})});if(!i.ok){const r=await i.text();let o=r;try{const a=JSON.parse(r);A2t(a)&&(o=`${a.error}${a.error_description?`: ${a.error_description}`:""}`)}catch{}throw new Error(`Registration to ${n.registration_endpoint} failed: ${o}`)}const s=await i.json();if(R2t(s))return s;throw new Error(`Invalid authorization dynamic client registration response: ${JSON.stringify(s)}`)}function N2t(n){const e=n.split(" "),t=e[0],i={};return e.length>1&&e.slice(1).join(" ").split(",").forEach(r=>{const[o,a]=r.split("=").map(l=>l.trim().replace(/"/g,""));i[o]=a}),{scheme:t,params:i}}function jVe(n){const e=n.split(".");if(e.length!==3)throw new Error("Invalid JWT token format: token must have three parts separated by dots");const[t,i,s]=e;try{if(typeof JSON.parse(yE(t).toString())!="object")throw new Error("Invalid JWT token format: header is not a JSON object");const o=JSON.parse(yE(i).toString());if(typeof o!="object")throw new Error("Invalid JWT token format: payload is not a JSON object");return o}catch(r){throw r instanceof Error?new Error(`Failed to parse JWT token: ${r.message}`):new Error("Failed to parse JWT token")}}var Sbe,Q0;let Cbe=(Q0=class{getState(){const e=this._state;return{get focused(){return e.focused},get active(){return e.active}}}constructor(e,t){this._onDidChangeWindowState=new A,this.onDidChangeWindowState=this._onDidChangeWindowState.event,this._state=Sbe.InitialState,e.handle&&(this._nativeHandle=yE(e.handle).buffer),this._proxy=t.getProxy(Xe.MainThreadWindow),this._proxy.$getInitialState().then(({isFocused:i,isActive:s})=>{this.onDidChangeWindowProperty("focused",i),this.onDidChangeWindowProperty("active",s)})}get nativeHandle(){return this._nativeHandle}$onDidChangeActiveNativeWindowHandle(e){this._nativeHandle=e?yE(e).buffer:void 0}$onDidChangeWindowFocus(e){this.onDidChangeWindowProperty("focused",e)}$onDidChangeWindowActive(e){this.onDidChangeWindowProperty("active",e)}onDidChangeWindowProperty(e,t){t!==this._state[e]&&(this._state={...this._state,[e]:t},this._onDidChangeWindowState.fire(this._state))}openUri(e,t){let i;if(typeof e=="string"){i=e;try{e=N.parse(e)}catch{return Promise.reject(`Invalid uri - '${e}'`)}}return Qg(e.scheme)?Promise.reject("Invalid scheme - cannot be empty"):e.scheme===ye.command?Promise.reject(`Invalid scheme '${e.scheme}'`):this._proxy.$openUri(e,i,t)}async asExternalUri(e,t){if(Qg(e.scheme))return Promise.reject("Invalid scheme - cannot be empty");const i=await this._proxy.$asExternalUri(e,t);return N.from(i)}},Sbe=Q0,Q0.InitialState={focused:!0,active:!0},Q0);Cbe=Sbe=y([v(0,Yc),v(1,dr)],Cbe);const Nle=de("IExtHostWindow");var Ebe,Z0;let xbe=(Z0=class{constructor(e){this.handles=new c_,this.handlers=new Map,this._proxy=e.getProxy(Xe.MainThreadUrls)}registerUriHandler(e,t){const i=e.identifier;if(this.handles.has(i))throw new Error(`Protocol handler already registered for extension ${i}`);const s=Ebe.HandlePool++;return this.handles.add(i),this.handlers.set(s,t),this._proxy.$registerUriHandler(s,i,e.displayName||e.name),ke(()=>{this.handles.delete(i),this.handlers.delete(s),this._proxy.$unregisterUriHandler(s)})}$handleExternalUri(e,t){const i=this.handlers.get(e);if(!i)return Promise.resolve(void 0);try{i.handleUri(N.revive(t))}catch(s){Rt(s)}return Promise.resolve(void 0)}async createAppUri(e){return N.revive(await this._proxy.$createAppUri(e))}},Ebe=Z0,Z0.HandlePool=0,Z0);xbe=Ebe=y([v(0,dr)],xbe);const Mle=de("IExtHostUrlsService"),Ole=de("IExtHostProgress");let Dbe=class{constructor(e){this._handles=0,this._mapHandleToCancellationSource=new Map,this._proxy=e.getProxy(Xe.MainThreadProgress)}async withProgress(e,t,i){const s=this._handles++,{title:r,location:o,cancellable:a}=t,l={label:e.displayName||e.name,id:e.identifier.value};return this._proxy.$startProgress(s,{location:EZ.from(o),title:r,source:l,cancellable:a},e.isUnderDevelopment?void 0:e.identifier.value).catch(Yr),this._withProgress(s,i,!!a)}async withProgressFromSource(e,t,i){const s=this._handles++,{title:r,location:o,cancellable:a}=t;return this._proxy.$startProgress(s,{location:EZ.from(o),title:r,source:e,cancellable:a},void 0).catch(Yr),this._withProgress(s,i,!!a)}_withProgress(e,t,i){let s;i&&(s=new ui,this._mapHandleToCancellationSource.set(e,s));const r=a=>{this._proxy.$progressEnd(a),this._mapHandleToCancellationSource.delete(a),s?.dispose()};let o;try{o=t(new kbe(this._proxy,e),i&&s?s.token:et.None)}catch(a){throw r(e),a}return o.then(a=>r(e),a=>r(e)),o}$acceptProgressCanceled(e){const t=this._mapHandleToCancellationSource.get(e);t&&(t.cancel(),this._mapHandleToCancellationSource.delete(e))}};Dbe=y([v(0,dr)],Dbe);function M2t(n,e){return n.message=e.message,typeof e.increment=="number"&&(typeof n.increment=="number"?n.increment+=e.increment:n.increment=e.increment),n}class kbe extends ru{constructor(e,t){super(i=>this.throttledReport(i)),this._proxy=e,this._handle=t}throttledReport(e){this._proxy.$progressReport(this._handle,e)}}kbe.__decorator=y([Jxt(100,(n,e)=>M2t(n,e),()=>Object.create(null))],kbe.prototype,"throttledReport",null);const iPe=de("IExtHostAuthentication");let Ibe=class{constructor(e,t,i,s,r,o,a){this._initData=t,this._extHostWindow=i,this._extHostUrls=s,this._extHostProgress=r,this._extHostLoggerService=o,this._logService=a,this._dynamicAuthProviderCtor=Tbe,this._authenticationProviders=new Map,this._providerOperations=new Fqe,this._onDidChangeSessions=new A,this._getSessionTaskSingler=new O2t,this._onDidDynamicAuthProviderTokensChange=new A,this._proxy=e.getProxy(Xe.MainThreadAuthentication)}getExtensionScopedSessionsEvent(e){const t=e.toLowerCase();return O.chain(this._onDidChangeSessions.event,i=>i.filter(s=>!s.extensionIdFilter||s.extensionIdFilter.includes(t)).map(s=>({provider:s.provider})))}async getSession(e,t,i,s={}){const r=Kn.toKey(e.identifier),o=[...i].sort().join(" "),l=Object.keys(s).sort().map(c=>`${c}:${!!s[c]}`).join(", ");return await this._getSessionTaskSingler.getOrCreate(`${r} ${t} ${o} ${l}`,async()=>{await this._proxy.$ensureProvider(t);const c=e.displayName||e.name;return this._proxy.$getSession(t,i,r,c,s)})}async getAccounts(e){return await this._proxy.$ensureProvider(e),await this._proxy.$getAccounts(e)}registerAuthenticationProvider(e,t,i,s){return this._providerOperations.queue(e,async()=>{if(this._authenticationProviders.get(e)){this._logService.error(`An authentication provider with id '${e}' is already registered. The existing provider will not be replaced.`);return}const r=i.onDidChangeSessions(o=>this._proxy.$sendDidChangeSessions(e,o));this._authenticationProviders.set(e,{label:t,provider:i,disposable:r,options:s??{supportsMultipleAccounts:!1}}),await this._proxy.$registerAuthenticationProvider(e,t,s?.supportsMultipleAccounts??!1,s?.supportedAuthorizationServers)}),new bs(()=>{this._providerOperations.queue(e,async()=>{const r=this._authenticationProviders.get(e);r&&(r.disposable?.dispose(),this._authenticationProviders.delete(e),await this._proxy.$unregisterAuthenticationProvider(e))})})}$createSession(e,t,i){return this._providerOperations.queue(e,async()=>{const s=this._authenticationProviders.get(e);if(s)return i.authorizationServer=N.revive(i.authorizationServer),await s.provider.createSession(t,i);throw new Error(`Unable to find authentication provider with handle: ${e}`)})}$removeSession(e,t){return this._providerOperations.queue(e,async()=>{const i=this._authenticationProviders.get(e);if(i)return await i.provider.removeSession(t);throw new Error(`Unable to find authentication provider with handle: ${e}`)})}$getSessions(e,t,i){return this._providerOperations.queue(e,async()=>{const s=this._authenticationProviders.get(e);if(s)return i.authorizationServer=N.revive(i.authorizationServer),await s.provider.getSessions(t,i);throw new Error(`Unable to find authentication provider with handle: ${e}`)})}$onDidChangeAuthenticationSessions(e,t,i){return e.startsWith(Ple)||this._onDidChangeSessions.fire({provider:{id:e,label:t},extensionIdFilter:i}),Promise.resolve()}$onDidUnregisterAuthenticationProvider(e){return this._providerOperations.queue(e,async()=>{const t=this._authenticationProviders.get(e);t&&(t.disposable?.dispose(),this._authenticationProviders.delete(e))})}async $registerDynamicAuthProvider(e,t,i,s,r,o){if(!s){const l=N.revive(e);if(t.registration_endpoint)try{const c=await Jtt(t,this._initData.environment.appName,i?.scopes_supported);s=c.client_id,r=c.client_secret}catch(c){this._logService.warn(`Dynamic registration failed for ${l.toString()}: ${c.message}. Prompting user for client ID and client secret...`)}if(!s){this._logService.info(`Prompting user for client registration details for ${l.toString()}`);const c=await this._proxy.$promptForClientRegistration(l.toString());if(!c)throw new Error("User did not provide client details");s=c.clientId,r=c.clientSecret,this._logService.info(`User provided client registration for ${l.toString()}`),r?this._logService.trace(`User provided client secret for ${l.toString()}`):this._logService.trace(`User did not provide client secret for ${l.toString()}`)}}const a=new this._dynamicAuthProviderCtor(this._extHostWindow,this._extHostUrls,this._initData,this._extHostProgress,this._extHostLoggerService,this._proxy,N.revive(e),t,i,s,r,this._onDidDynamicAuthProviderTokensChange,o||[]);return await this._providerOperations.queue(a.id,async()=>{this._authenticationProviders.set(a.id,{label:a.label,provider:a,disposable:bs.from(a,a.onDidChangeSessions(l=>this._proxy.$sendDidChangeSessions(a.id,l)),a.onDidChangeClientId(()=>this._proxy.$sendDidChangeDynamicProviderInfo({providerId:a.id,clientId:a.clientId,clientSecret:a.clientSecret}))),options:{supportsMultipleAccounts:!1}}),await this._proxy.$registerDynamicAuthenticationProvider(a.id,a.label,a.authorizationServer,a.clientId,a.clientSecret)}),a.id}async $onDidChangeDynamicAuthProviderTokens(e,t,i){this._onDidDynamicAuthProviderTokensChange.fire({authProviderId:e,clientId:t,tokens:i})}};Ibe=y([v(0,dr),v(1,Yc),v(2,Nle),v(3,Mle),v(4,Ole),v(5,Sc),v(6,it)],Ibe);class O2t{constructor(){this._inFlightPromises=new Map}getOrCreate(e,t){const i=this._inFlightPromises.get(e);if(i)return i;const s=t().finally(()=>this._inFlightPromises.delete(e));return this._inFlightPromises.set(e,s),s}}let Tbe=class{constructor(e,t,i,s,r,o,a,l,c,d,h,u,g){this._extHostWindow=e,this._extHostUrls=t,this._initData=i,this._extHostProgress=s,this._proxy=o,this.authorizationServer=a,this._serverMetadata=l,this._resourceMetadata=c,this._clientId=d,this._clientSecret=h,this._onDidChangeSessions=new A,this.onDidChangeSessions=this._onDidChangeSessions.event,this._onDidChangeClientId=new A,this.onDidChangeClientId=this._onDidChangeClientId.event;const p=a.toString(!0);this.id=c?.resource?p+" "+c?.resource:p,this.label=c?.resource_name??this.authorizationServer.authority,this._logger=r.createLogger(this.id,{name:this.label}),this._disposable=new ie,this._disposable.add(this._onDidChangeSessions);const m=O.chain(u.event,_=>_.filter(w=>w.authProviderId===this.id&&w.clientId===d).map(w=>w.tokens));this._tokenStore=this._disposable.add(new F2t({onDidChange:m,set:_=>o.$setSessionsForDynamicAuthProvider(this.id,this.clientId,_)},g,this._logger)),this._disposable.add(this._tokenStore.onDidChangeSessions(_=>this._onDidChangeSessions.fire(_))),this._createFlows=[],l.authorization_endpoint&&this._createFlows.push({label:f(2617,"URL Handler"),handler:(_,w,b)=>this._createWithUrlHandler(_,w,b)})}get clientId(){return this._clientId}get clientSecret(){return this._clientSecret}async getSessions(e,t){if(this._logger.info(`Getting sessions for scopes: ${e?.join(" ")??"all"}`),!e)return this._tokenStore.sessions;const i=[...e].sort(),s=e.join(" ");let r=this._tokenStore.sessions.filter(o=>En([...o.scopes].sort(),i));if(this._logger.info(`Found ${r.length} sessions for scopes: ${s}`),r.length){const o=[],a=[],l=new Map(this._tokenStore.tokens.map(c=>[c.access_token,c]));for(const c of r){const d=l.get(c.accessToken);if(d&&d.expires_in){const h=Date.now(),u=d.expires_in*1e3;if(h>d.created_at+u-300*1e3){if(this._logger.info(`Token for session ${c.id} is about to expire, refreshing...`),a.push(d),!d.refresh_token){this._logger.warn(`No refresh token available for scopes ${c.scopes.join(" ")}. Throwing away token.`);continue}try{const g=await this.exchangeRefreshTokenForToken(d.refresh_token);g.scope!==s&&(this._logger.warn(`Token scopes '${g.scope}' do not match requested scopes '${s}'. Overwriting token with what was requested...`),g.scope=s),this._logger.info(`Successfully created a new token for scopes ${c.scopes.join(" ")}.`),o.push(g)}catch(g){this._logger.error(`Failed to refresh token: ${g}`)}}}}return(o.length||a.length)&&(this._tokenStore.update({added:o,removed:a}),r=this._tokenStore.sessions.filter(c=>En([...c.scopes].sort(),i))),this._logger.info(`Found ${r.length} sessions for scopes: ${s}`),r}return[]}async createSession(e,t){this._logger.info(`Creating session for scopes: ${e.join(" ")}`);let i;for(let r=0;r<this._createFlows.length;r++){const{handler:o}=this._createFlows[r];try{if(i=await this._extHostProgress.withProgressFromSource({label:this.label,id:this.id},{location:eE.Notification,title:f(2618,"Authenticating to '{0}'",this.label),cancellable:!0},(a,l)=>o(e,a,l)),i)break}catch(a){const l=this._createFlows[r+1]?.label;if(!l)break;const c=Xr(a)?f(2619,"Having trouble authenticating to '{0}'? Would you like to try a different way? ({1})",this.label,l):f(2620,"You have not yet finished authenticating to '{0}'. Would you like to try a different way? ({1})",this.label,l);if(!await this._proxy.$showContinueNotification(c))throw new No;this._logger.error(`Failed to create token via flow '${l}': ${a}`)}}if(!i)throw new Error("Failed to create authentication token");i.scope!==e.join(" ")&&(this._logger.warn(`Token scopes '${i.scope}' do not match requested scopes '${e.join(" ")}'. Overwriting token with what was requested...`),i.scope=e.join(" ")),this._tokenStore.update({added:[{...i,created_at:Date.now()}],removed:[]});const s=this._tokenStore.sessions.find(r=>r.accessToken===i.access_token);return this._logger.info(`Created session for scopes: ${i.scope}`),s}async removeSession(e){this._logger.info(`Removing session with id: ${e}`);const t=this._tokenStore.sessions.find(s=>s.id===e);if(!t){this._logger.error(`Session with id ${e} not found`);return}const i=this._tokenStore.tokens.find(s=>s.access_token===t.accessToken);if(!i){this._logger.error(`Failed to retrieve token for removed session: ${t.id}`);return}this._tokenStore.update({added:[],removed:[i]}),this._logger.info(`Removed token for session: ${t.id} with scopes: ${t.scopes.join(" ")}`)}dispose(){this._disposable.dispose()}async _createWithUrlHandler(e,t,i){if(!this._serverMetadata.authorization_endpoint)throw new Error("Authorization Endpoint required");if(!this._serverMetadata.token_endpoint)throw new Error("Token endpoint not available in server metadata");const s=this.generateRandomString(64),r=await this.generateCodeChallenge(s),o=this.generateRandomString(32),a=N.parse(`${this._initData.environment.appUriScheme}://dynamicauthprovider/${this.authorizationServer.authority}/authorize?nonce=${o}`);let l;try{l=await this._extHostUrls.createAppUri(a)}catch(_){throw new Error(`Failed to create external URI: ${_}`)}const c=new URL(this._serverMetadata.authorization_endpoint);c.searchParams.append("client_id",this._clientId),c.searchParams.append("response_type","code"),c.searchParams.append("state",l.toString()),c.searchParams.append("code_challenge",r),c.searchParams.append("code_challenge_method","S256");const d=e.join(" ");d&&c.searchParams.append("scope",d),this._resourceMetadata?.resource&&c.searchParams.append("resource",this._resourceMetadata.resource);const h="https://vscode.dev/redirect";c.searchParams.append("redirect_uri",h);const u=this.waitForAuthorizationCode(a);if(this._logger.info(`Opening authorization URL for scopes: ${d}`),this._logger.trace(`Authorization URL: ${c.toString()}`),!await this._extHostWindow.openUri(c.toString(),{}))throw new No;t.report({message:f(2621,"Complete the authentication in the browser window that has opened.")});let p;try{p=(await HI(u,i)).code}catch(_){throw Xr(_)?(this._logger.info("Authorization code request was cancelled by the user."),_):(this._logger.error(`Failed to receive authorization code: ${_}`),new Error(`Failed to receive authorization code: ${_}`))}return this._logger.info(`Authorization code received for scopes: ${d}`),await this.exchangeCodeForToken(p,s,h)}generateRandomString(e){const t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t).map(i=>i.toString(16).padStart(2,"0")).join("").substring(0,e)}async generateCodeChallenge(e){const i=new TextEncoder().encode(e),s=await crypto.subtle.digest("SHA-256",i);return PP(Ye.wrap(new Uint8Array(s)),!1,!1).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async waitForAuthorizationCode(e){const t=await this._proxy.$waitForUriHandler(e),i=/[?&]code=([^&]+)/.exec(t.query||"");if(!i||i.length<2)throw new Error("Authentication failed: No authorization code received");return{code:i[1]}}async exchangeCodeForToken(e,t,i){if(!this._serverMetadata.token_endpoint)throw new Error("Token endpoint not available in server metadata");const s=new URLSearchParams;s.append("client_id",this._clientId),s.append("grant_type","authorization_code"),s.append("code",e),s.append("redirect_uri",i),s.append("code_verifier",t),this._clientSecret&&s.append("client_secret",this._clientSecret),this._logger.info("Exchanging authorization code for token..."),this._logger.trace(`Url: ${this._serverMetadata.token_endpoint}`),this._logger.trace(`Token request body: ${s.toString()}`);let r;try{r=await fetch(this._serverMetadata.token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:s.toString()})}catch(a){throw this._logger.error(`Failed to exchange authorization code for token: ${a}`),new Error(`Failed to exchange authorization code for token: ${a}`)}if(!r.ok){const a=await r.text();throw new Error(`Token exchange failed: ${r.status} ${r.statusText} - ${a}`)}const o=await r.json();if(zVe(o))return this._logger.info("Successfully exchanged authorization code for token."),o;throw qVe(o)&&o.error===rJ.InvalidClient?(this._logger.warn(`Client ID (${this._clientId}) was invalid, generated a new one.`),await this._generateNewClientId(),new Error("Client ID was invalid, generated a new one. Please try again.")):new Error(`Invalid authorization token response: ${JSON.stringify(o)}`)}async exchangeRefreshTokenForToken(e){if(!this._serverMetadata.token_endpoint)throw new Error("Token endpoint not available in server metadata");const t=new URLSearchParams;t.append("client_id",this._clientId),t.append("grant_type","refresh_token"),t.append("refresh_token",e),this._clientSecret&&t.append("client_secret",this._clientSecret);const s=await(await fetch(this._serverMetadata.token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:t.toString()})).json();if(zVe(s))return{...s,created_at:Date.now()};throw qVe(s)&&s.error===rJ.InvalidClient?(this._logger.warn(`Client ID (${this._clientId}) was invalid, generated a new one.`),await this._generateNewClientId(),new Error("Client ID was invalid, generated a new one. Please try again.")):new Error(`Invalid authorization token response: ${JSON.stringify(s)}`)}async _generateNewClientId(){try{const e=await Jtt(this._serverMetadata,this._initData.environment.appName,this._resourceMetadata?.scopes_supported);this._clientId=e.client_id,this._clientSecret=e.client_secret,this._onDidChangeClientId.fire()}catch(e){this._logger.info(`Dynamic registration failed for ${this.authorizationServer.toString()}: ${e}. Prompting user for client ID and client secret.`);try{const t=await this._proxy.$promptForClientRegistration(this.authorizationServer.toString());if(!t)throw new Error("User did not provide client details");this._clientId=t.clientId,this._clientSecret=t.clientSecret,this._logger.info(`User provided client ID for ${this.authorizationServer.toString()}`),t.clientSecret?this._logger.info(`User provided client secret for ${this.authorizationServer.toString()}`):this._logger.info(`User did not provide client secret for ${this.authorizationServer.toString()} (optional)`),this._onDidChangeClientId.fire()}catch{throw this._logger.error(`Failed to fetch new client ID and user did not provide one: ${e}`),new Error(`Failed to fetch new client ID and user did not provide one: ${e}`)}}}};Tbe=y([v(0,Nle),v(1,Mle),v(2,Yc),v(3,Ole),v(4,Sc)],Tbe);class F2t{constructor(e,t,i){this._persistence=e,this._logger=i,this._onDidChangeSessions=new A,this.onDidChangeSessions=this._onDidChangeSessions.event,this._disposable=new ie,this._tokensObservable=kt("tokens",t),this._sessionsObservable=hc({equalsFn:(s,r)=>En(s,r,(o,a)=>o.accessToken===a.accessToken)},s=>this._tokensObservable.read(s).map(r=>this._getSessionFromToken(r))),this._disposable.add(this._registerChangeEventAutorun()),this._disposable.add(this._persistence.onDidChange(s=>this._tokensObservable.set(s,void 0)))}get tokens(){return this._tokensObservable.get()}get sessions(){return this._sessionsObservable.get()}dispose(){this._disposable.dispose()}update({added:e,removed:t}){this._logger.trace(`Updating tokens: added ${e.length}, removed ${t.length}`);const i=[...this._tokensObservable.get()];for(const s of t){const r=i.findIndex(o=>o.access_token===s.access_token);r!==-1&&i.splice(r,1)}for(const s of e){const r=i.findIndex(o=>o.access_token===s.access_token);r===-1?i.push(s):i[r]=s}(e.length||t.length)&&(this._tokensObservable.set(i,void 0),this._persistence.set(i)),this._logger.trace(`Tokens updated: ${i.length} tokens stored.`)}_registerChangeEventAutorun(){let e=[];return Xt(t=>{this._logger.trace("Checking for session changes...");const i=this._sessionsObservable.read(t);if(e===i){this._logger.trace("No session changes detected.");return}if(!i||i.length===0){this._logger.trace("All sessions removed."),e.length>0&&(this._onDidChangeSessions.fire({added:[],removed:e,changed:[]}),e=[]);return}const s=[],r=[];for(const o of i)e.some(l=>l.accessToken===o.accessToken)||s.push(o);for(const o of e)i.some(l=>l.accessToken===o.accessToken)||r.push(o);(s.length>0||r.length>0)&&(this._logger.trace(`Sessions changed: added ${s.length}, removed ${r.length}`),this._onDidChangeSessions.fire({added:s,removed:r,changed:[]})),e=i})}_getSessionFromToken(e){let t;if(e.id_token)try{t=jVe(e.id_token)}catch{}if(!t)try{t=jVe(e.access_token)}catch{}const i=e.scope?e.scope.split(" "):t?.scope?t.scope.split(" "):[];return{id:Ioe(e.access_token,0).toString(),accessToken:e.access_token,account:{id:t?.sub||"unknown",label:t?.preferred_username||t?.name||t?.email||"MCP"},scopes:i,idToken:e.id_token}}}const W2t={label:f(5437,"Other Models"),order:Number.MAX_SAFE_INTEGER};var Lbe;const nPe=de("IExtHostLanguageModels");class YVe{constructor(e,t){this.option=e,this.stream=new Q3,this.stream=t??new Q3}}class B2t{constructor(){this._responseStreams=new Map,this._defaultStream=new Q3,this._isDone=!1;const e=this;this.apiObject={get stream(){return e._defaultStream.asyncIterable},get text(){return eh.map(e._defaultStream.asyncIterable,t=>{if(t instanceof Ma)return t.value}).coalesce()}}}*_streams(){if(this._responseStreams.size>0)for(const[,e]of this._responseStreams)yield e.stream;else yield this._defaultStream}handleFragment(e){if(this._isDone)return;const t=new Map;for(const i of ri.wrap(e)){let s;i.part.type==="text"?s=new Ma(i.part.value,i.part.audience):i.part.type==="data"?s=new Ma(""):s=new sI(i.part.toolCallId,i.part.name,i.part.parameters);const r=t.get(i.index);r?r.push(s):t.set(i.index,[s])}for(const[i,s]of t){let r=this._responseStreams.get(i);r||(this._responseStreams.size===0?r=new YVe(i,this._defaultStream):r=new YVe(i),this._responseStreams.set(i,r)),r.stream.emitMany(s)}}reject(e){this._isDone=!0;for(const t of this._streams())t.reject(e)}resolve(){this._isDone=!0;for(const e of this._streams())e.resolve()}}var J0;let Rbe=(J0=class{constructor(e,t,i){this._logService=t,this._extHostAuthentication=i,this._onDidChangeModelAccess=new A,this._onDidChangeProviders=new A,this.onDidChangeProviders=this._onDidChangeProviders.event,this._languageModelProviders=new Map,this._localModels=new Map,this._modelAccessList=new Pa,this._pendingRequest=new Map,this._ignoredFileProviders=new Map,this._languageAccessInformationExtensions=new Set,this._proxy=e.getProxy(Xe.MainThreadLanguageModels)}dispose(){this._onDidChangeModelAccess.dispose(),this._onDidChangeProviders.dispose()}registerLanguageModelProvider(e,t,i){this._languageModelProviders.set(t,{extension:e.identifier,extensionName:e.displayName||e.name,provider:i}),this._proxy.$registerLanguageModelProvider(t);let s;return i.onDidChange&&(s=i.onDidChange(()=>{this._proxy.$onLMProviderChange(t)})),ke(()=>{this._languageModelProviders.delete(t),this._clearModelCache(t),s?.dispose(),this._proxy.$unregisterProvider(t)})}_clearModelCache(e){this._localModels.forEach((t,i)=>{t.metadata.vendor===e&&this._localModels.delete(i)})}async $prepareLanguageModelProvider(e,t,i){const s=this._languageModelProviders.get(e);if(!s)return[];this._clearModelCache(e);const r=await s.provider.prepareLanguageModelChat(t,i)??[],o=r.map(a=>{let l;return a.auth&&(l={providerLabel:s.extensionName,accountLabel:typeof a.auth=="object"?a.auth.label:void 0}),{metadata:{extension:s.extension,id:a.id,vendor:e,name:a.name??"",family:a.family??"",cost:a.cost,description:a.description,version:a.version,maxInputTokens:a.maxInputTokens,maxOutputTokens:a.maxOutputTokens,auth:l,isDefault:a.isDefault,isUserSelectable:a.isUserSelectable,modelPickerCategory:a.category??W2t,capabilities:a.capabilities?{vision:a.capabilities.vision,toolCalling:!!a.capabilities.toolCalling,agentMode:!!a.capabilities.toolCalling}:void 0},identifier:`${e}/${a.id}`}});for(let a=0;a<o.length;a++)this._localModels.set(o[a].identifier,{metadata:o[a].metadata,info:r[a]});return o}async $startChatRequest(e,t,i,s,r,o){const a=this._localModels.get(e);if(!a)throw new Error("Model not found");const l=this._languageModelProviders.get(a.metadata.vendor);if(!l)throw new Error(`Language model provider for '${a.metadata.id}' not found.`);const c=[],d=()=>{c.length>0&&(this._proxy.$reportResponsePart(t,c),c.length=0)},h=new pn(d,30),u=m=>{c.push(m)>30?(d(),h.cancel()):h.schedule()},g=new ru(async m=>{if(o.isCancellationRequested){this._logService.warn(`[CHAT](${l.extension.value}) CANNOT send progress because the REQUEST IS CANCELLED`);return}let _;if(m.part instanceof sI?_={type:"tool_use",name:m.part.name,parameters:m.part.input,toolCallId:m.part.callId}:m.part instanceof Ma?_={type:"text",value:m.part.value,audience:m.part.audience}:m.part instanceof a_&&(_={type:"data",value:{mimeType:m.part.mimeType,data:Ye.wrap(m.part.data)},audience:m.part.audience}),!_){this._logService.warn(`[CHAT](${l.extension.value}) UNKNOWN part ${JSON.stringify(m)}`);return}u({index:m.index,part:_})});let p;try{p=l.provider.provideLanguageModelChatResponse(a.info,s.value.map(RZ.to),{...r,modelOptions:r.modelOptions??{},extensionId:Kn.toKey(i)},g,o)}catch(m){throw m}Promise.resolve(p).then(()=>{d(),this._proxy.$reportResponseDone(t,void 0)},m=>{d(),this._proxy.$reportResponseDone(t,uy(m))})}$provideTokenLength(e,t,i){const s=this._localModels.get(e);if(!s)return Promise.resolve(0);const r=this._languageModelProviders.get(s.metadata.vendor);return r?Promise.resolve(r.provider.provideTokenCount(s.info,t,i)):Promise.resolve(0)}async getDefaultLanguageModel(e,t){let i;t&&await this.selectLanguageModels(e,{});for(const[s,r]of this._localModels)if(r.metadata.isDefault){i=s;break}return i?this.getLanguageModelByIdentifier(e,i):this.getDefaultLanguageModel(e,!0)}async getLanguageModelByIdentifier(e,t){const i=this._localModels.get(t);if(!i)return;this._isUsingAuth(e.identifier,i.metadata)&&await this._fakeAuthPopulate(i.metadata);let s;if(!s){const r=this;s={id:i.info.id,vendor:i.metadata.vendor,family:i.info.family,version:i.info.version,name:i.info.name,capabilities:{supportsImageToText:i.metadata.capabilities?.vision??!1,supportsToolCalling:!!i.metadata.capabilities?.toolCalling},maxInputTokens:i.metadata.maxInputTokens,countTokens(o,a){if(!r._localModels.has(t))throw cv.NotFound(t);return r._computeTokenLength(t,o,a??et.None)},sendRequest(o,a,l){if(!r._localModels.has(t))throw cv.NotFound(t);return r._sendChatRequest(e,t,o,a??{},l??et.None)}}}return s}async selectLanguageModels(e,t){const i=await this._proxy.$selectChatModels({...t,extension:e.identifier}),s=[];for(const r of i){const o=await this.getLanguageModelByIdentifier(e,r);o&&s.push(o)}return s}async _sendChatRequest(e,t,i,s,r){const o=this._convertMessages(e,i),a=e.identifier,l=this._localModels.get(t)?.metadata;if(!l||!this._localModels.has(t))throw cv.NotFound(`Language model '${t}' is unknown.`);if(this._isUsingAuth(a,l)&&(!await this._getAuthAccess(e,{identifier:l.extension,displayName:l.auth.providerLabel},s.justification,!1)||!this._modelAccessList.get(a)?.has(l.extension)))throw cv.NoPermissions(`Language model '${t}' cannot be used by '${a.value}'.`);const c=Math.random()*1e6|0,d=new B2t;this._pendingRequest.set(c,{languageModelId:t,res:d});try{await this._proxy.$tryStartChatRequest(a,t,c,new ll(o),s,r)}catch(h){throw this._pendingRequest.delete(c),cv.tryDeserialize(h)??h}return d.apiObject}_convertMessages(e,t){const i=[];for(const s of t)s.role===qf.System&&Qe(e,"languageModelSystem"),i.push(RZ.from(s));return i}async $acceptResponsePart(e,t){const i=this._pendingRequest.get(e);i&&i.res.handleFragment(t)}async $acceptResponseDone(e,t){const i=this._pendingRequest.get(e);i&&(this._pendingRequest.delete(e),t?i.res.reject(cv.tryDeserialize(t)??w2(t)):i.res.resolve())}async _getAuthAccess(e,t,i,s){const r=Ple+t.identifier.value;if(await this._extHostAuthentication.getSession(e,r,[],{silent:!0}))return this.$updateModelAccesslist([{from:e.identifier,to:t.identifier,enabled:!0}]),!0;if(s)return!1;try{const a=i?f(2627,"Justification: {1}",t.displayName,i):void 0;return await this._extHostAuthentication.getSession(e,r,[],{forceNewSession:{detail:a}}),this.$updateModelAccesslist([{from:e.identifier,to:t.identifier,enabled:!0}]),!0}catch{return!1}}_isUsingAuth(e,t){return!!t.auth&&!Kn.equals(t.extension,e)}async _fakeAuthPopulate(e){if(e.auth)for(const t of this._languageAccessInformationExtensions)try{await this._getAuthAccess(t,{identifier:e.extension,displayName:""},void 0,!0)}catch(i){this._logService.error("Fake Auth request failed"),this._logService.error(i)}}async _computeTokenLength(e,t,i){const s=this._localModels.get(e);if(!s)throw cv.NotFound(`Language model '${e}' is unknown.`);return this._languageModelProviders.get(s.metadata.vendor)?.provider.provideTokenCount(s.info,t,i)??0}$updateModelAccesslist(e){const t=new Array;for(const{from:i,to:s,enabled:r}of e){const o=this._modelAccessList.get(i)??new c_;if(o.has(s)!==r){r?o.add(s):o.delete(s),this._modelAccessList.set(i,o);const l={from:i,to:s};t.push(l),this._onDidChangeModelAccess.fire(l)}}}createLanguageModelAccessInformation(e){this._languageAccessInformationExtensions.add(e);const t=O.signal(O.filter(this._onDidChangeModelAccess.event,s=>Kn.equals(s.from,e.identifier))),i=O.signal(this._onDidChangeProviders.event);return{get onDidChange(){return O.any(t,i)},canSendRequest(s){return!0}}}fileIsIgnored(e,t,i=et.None){return Qe(e,"chatParticipantAdditions"),this._proxy.$fileIsIgnored(t,i)}async $isFileIgnored(e,t,i){const s=this._ignoredFileProviders.get(e);if(!s)throw new Error("Unknown LanguageModelIgnoredFileProvider");return await s.provideFileIgnored(N.revive(t),i)??!1}registerIgnoredFileProvider(e,t){Qe(e,"chatParticipantPrivate");const i=Lbe._idPool++;return this._proxy.$registerFileIgnoreProvider(i),this._ignoredFileProviders.set(i,t),ke(()=>{this._proxy.$unregisterFileIgnoreProvider(i),this._ignoredFileProviders.delete(i)})}},Lbe=J0,J0._idPool=1,J0);Rbe=Lbe=y([v(0,dr),v(1,it),v(2,iPe)],Rbe);function H2t(n){return typeof n=="object"&&"uri"in n&&"pattern"in n}let oJ=class{constructor(e,t,i,s,r,o){this.configurationService=e,this.workspaceContextService=t,this.editorGroupsService=i,this.logService=s,this.pathService=r,this.uriIdentityService=o}aiText(e,t,i={}){return{...this.commonQuery(t?.map(e5),i),type:uE.aiText,contentPattern:e}}text(e,t,i={}){e=this.getContentPattern(e,i);const s=this.configurationService.getValue(),r=t&&t.some(a=>!this.configurationService.getValue({resource:a}).search.useRipgrep);return{...this.commonQuery(t?.map(e5),i),type:uE.Text,contentPattern:e,previewOptions:i.previewOptions,maxFileSize:i.maxFileSize,usePCRE2:s.search.usePCRE2||r||!1,surroundingContext:i.surroundingContext,userDisabledExcludesAndIgnoreFiles:i.disregardExcludeSettings&&i.disregardIgnoreFiles}}getContentPattern(e,t){const i=this.configurationService.getValue();e.isRegExp&&(e.pattern=e.pattern.replace(/\r?\n/g,"\\n"));const s={...e,wordSeparators:i.editor.wordSeparators};return this.isCaseSensitive(e,t)&&(s.isCaseSensitive=!0),this.isMultiline(e)&&(s.isMultiline=!0),t.notebookSearchConfig?.includeMarkupInput&&(s.notebookInfo||(s.notebookInfo={}),s.notebookInfo.isInNotebookMarkdownInput=t.notebookSearchConfig.includeMarkupInput),t.notebookSearchConfig?.includeMarkupPreview&&(s.notebookInfo||(s.notebookInfo={}),s.notebookInfo.isInNotebookMarkdownPreview=t.notebookSearchConfig.includeMarkupPreview),t.notebookSearchConfig?.includeCodeInput&&(s.notebookInfo||(s.notebookInfo={}),s.notebookInfo.isInNotebookCellInput=t.notebookSearchConfig.includeCodeInput),t.notebookSearchConfig?.includeOutput&&(s.notebookInfo||(s.notebookInfo={}),s.notebookInfo.isInNotebookCellOutput=t.notebookSearchConfig.includeOutput),s}file(e,t={}){return{...this.commonQuery(e,t),type:uE.File,filePattern:t.filePattern?t.filePattern.trim():t.filePattern,exists:t.exists,sortByScore:t.sortByScore,cacheKey:t.cacheKey,shouldGlobMatchFilePattern:t.shouldGlobSearch}}handleIncludeExclude(e,t){if(!e)return{};if(Array.isArray(e)){if(e=e.filter(i=>i.length>0).map(NK),!e.length)return{}}else e=NK(e);return t?this.parseSearchPaths(e):{pattern:she(...Array.isArray(e)?e:[e])}}commonQuery(e=[],t={}){let i=Array.isArray(t.excludePattern)?t.excludePattern.map(d=>d.pattern).flat():t.excludePattern;i=i?.length===1?i[0]:i;const s=this.handleIncludeExclude(t.includePattern,t.expandPatterns),r=this.handleIncludeExclude(i,t.expandPatterns),o=e.length>1,a=(s.searchPaths&&s.searchPaths.length?s.searchPaths.map(d=>this.getFolderQueryForSearchPath(d,t,r)):e.map(d=>this.getFolderQueryForRoot(d,t,r,o))).filter(d=>!!d),l={_reason:t._reason,folderQueries:a,usingSearchPaths:!!(s.searchPaths&&s.searchPaths.length),extraFileResources:t.extraFileResources,excludePattern:r.pattern,includePattern:s.pattern,onlyOpenEditors:t.onlyOpenEditors,maxResults:t.maxResults,onlyFileScheme:t.onlyFileScheme};if(t.onlyOpenEditors){const d=vn(this.editorGroupsService.groups.flatMap(g=>g.editors.map(p=>p.resource)));this.logService.trace("QueryBuilder#commonQuery - openEditor URIs",JSON.stringify(d));const h=d.filter(g=>yVe(l,g.fsPath)),u=this.commonQueryFromFileList(h);return this.logService.trace("QueryBuilder#commonQuery - openEditor Query",JSON.stringify(u)),{...l,...u}}const c=t.extraFileResources&&t.extraFileResources.filter(d=>yVe(l,d.fsPath));return l.extraFileResources=c&&c.length?c:void 0,l}commonQueryFromFileList(e){const t=[],i=new Ni,s={};let r=!1;return e.forEach(o=>{if(o.scheme===ye.walkThrough)return;if(Sqe(o)){const l=this.workspaceContextService.getWorkspaceFolder(o)?.uri??this.uriIdentityService.extUri.dirname(o);let c=i.get(l);c||(r=!0,c={folder:l,includePattern:{}},t.push(c),i.set(l,c));const d=j3(l.fsPath,o.fsPath);qr(c.includePattern)[d.replace(/\\/g,"/")]=!0}else o.fsPath&&(r=!0,s[o.fsPath]=!0)}),{folderQueries:t,includePattern:s,usingSearchPaths:!0,excludePattern:r?void 0:{"**/*":!0}}}isCaseSensitive(e,t){if(t.isSmartCase){if(e.isRegExp){if(zue(e.pattern,!0))return!0}else if(zue(e.pattern))return!0}return!!e.isCaseSensitive}isMultiline(e){return e.isMultiline||e.isRegExp&&p0e(e.pattern)||e.pattern.indexOf(`
|
|
@@ -1311,4 +1311,4 @@ ${JSON.stringify(X,null,4)}`);const De=X;if(t.string(De.id)||t.number(De.id)){co
|
|
|
1311
1311
|
`))),r0(s)!=="object"&&(console.error(f(5593,"{0}: Invalid format, JSON object expected.",e.toString())),s={}),s}catch(t){return console.error(t),{}}}static _extractValidCommentRule(e,t){const i=t.comments;if(typeof i>"u")return;if(!zn(i)){console.warn(`[${e}]: language configuration: expected \`comments\` to be an object.`);return}let s;if(typeof i.lineComment<"u")if(typeof i.lineComment=="string")s=s||{},s.lineComment=i.lineComment;else if(zn(i.lineComment)){const r=i.lineComment;typeof r.comment=="string"?(s=s||{},s.lineComment={comment:r.comment,noIndent:r.noIndent}):console.warn(`[${e}]: language configuration: expected \`comments.lineComment.comment\` to be a string.`)}else console.warn(`[${e}]: language configuration: expected \`comments.lineComment\` to be a string or an object with comment property.`);return typeof i.blockComment<"u"&&(zU(i.blockComment)?(s=s||{},s.blockComment=i.blockComment):console.warn(`[${e}]: language configuration: expected \`comments.blockComment\` to be an array of two strings.`)),s}static _extractValidBrackets(e,t){const i=t.brackets;if(typeof i>"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`brackets\` to be an array.`);return}let s;for(let r=0,o=i.length;r<o;r++){const a=i[r];if(!zU(a)){console.warn(`[${e}]: language configuration: expected \`brackets[${r}]\` to be an array of two strings.`);continue}s=s||[],s.push(a)}return s}static _extractValidAutoClosingPairs(e,t){const i=t.autoClosingPairs;if(typeof i>"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`autoClosingPairs\` to be an array.`);return}let s;for(let r=0,o=i.length;r<o;r++){const a=i[r];if(Array.isArray(a)){if(!zU(a)){console.warn(`[${e}]: language configuration: expected \`autoClosingPairs[${r}]\` to be an array of two strings or an object.`);continue}s=s||[],s.push({open:a[0],close:a[1]})}else{if(!zn(a)){console.warn(`[${e}]: language configuration: expected \`autoClosingPairs[${r}]\` to be an array of two strings or an object.`);continue}if(typeof a.open!="string"){console.warn(`[${e}]: language configuration: expected \`autoClosingPairs[${r}].open\` to be a string.`);continue}if(typeof a.close!="string"){console.warn(`[${e}]: language configuration: expected \`autoClosingPairs[${r}].close\` to be a string.`);continue}if(typeof a.notIn<"u"&&!Qat(a.notIn)){console.warn(`[${e}]: language configuration: expected \`autoClosingPairs[${r}].notIn\` to be a string array.`);continue}s=s||[],s.push({open:a.open,close:a.close,notIn:a.notIn})}}return s}static _extractValidSurroundingPairs(e,t){const i=t.surroundingPairs;if(typeof i>"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`surroundingPairs\` to be an array.`);return}let s;for(let r=0,o=i.length;r<o;r++){const a=i[r];if(Array.isArray(a)){if(!zU(a)){console.warn(`[${e}]: language configuration: expected \`surroundingPairs[${r}]\` to be an array of two strings or an object.`);continue}s=s||[],s.push({open:a[0],close:a[1]})}else{if(!zn(a)){console.warn(`[${e}]: language configuration: expected \`surroundingPairs[${r}]\` to be an array of two strings or an object.`);continue}if(typeof a.open!="string"){console.warn(`[${e}]: language configuration: expected \`surroundingPairs[${r}].open\` to be a string.`);continue}if(typeof a.close!="string"){console.warn(`[${e}]: language configuration: expected \`surroundingPairs[${r}].close\` to be a string.`);continue}s=s||[],s.push({open:a.open,close:a.close})}}return s}static _extractValidColorizedBracketPairs(e,t){const i=t.colorizedBracketPairs;if(typeof i>"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`colorizedBracketPairs\` to be an array.`);return}const s=[];for(let r=0,o=i.length;r<o;r++){const a=i[r];if(!zU(a)){console.warn(`[${e}]: language configuration: expected \`colorizedBracketPairs[${r}]\` to be an array of two strings.`);continue}s.push([a[0],a[1]])}return s}static _extractValidOnEnterRules(e,t){const i=t.onEnterRules;if(typeof i>"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`onEnterRules\` to be an array.`);return}let s;for(let r=0,o=i.length;r<o;r++){const a=i[r];if(!zn(a)){console.warn(`[${e}]: language configuration: expected \`onEnterRules[${r}]\` to be an object.`);continue}if(!zn(a.action)){console.warn(`[${e}]: language configuration: expected \`onEnterRules[${r}].action\` to be an object.`);continue}let l;if(a.action.indent==="none")l=Po.None;else if(a.action.indent==="indent")l=Po.Indent;else if(a.action.indent==="indentOutdent")l=Po.IndentOutdent;else if(a.action.indent==="outdent")l=Po.Outdent;else{console.warn(`[${e}]: language configuration: expected \`onEnterRules[${r}].action.indent\` to be 'none', 'indent', 'indentOutdent' or 'outdent'.`);continue}const c={indentAction:l};a.action.appendText&&(typeof a.action.appendText=="string"?c.appendText=a.action.appendText:console.warn(`[${e}]: language configuration: expected \`onEnterRules[${r}].action.appendText\` to be undefined or a string.`)),a.action.removeText&&(typeof a.action.removeText=="number"?c.removeText=a.action.removeText:console.warn(`[${e}]: language configuration: expected \`onEnterRules[${r}].action.removeText\` to be undefined or a number.`));const d=this._parseRegex(e,`onEnterRules[${r}].beforeText`,a.beforeText);if(!d)continue;const h={beforeText:d,action:c};if(a.afterText){const u=this._parseRegex(e,`onEnterRules[${r}].afterText`,a.afterText);u&&(h.afterText=u)}if(a.previousLineText){const u=this._parseRegex(e,`onEnterRules[${r}].previousLineText`,a.previousLineText);u&&(h.previousLineText=u)}s=s||[],s.push(h)}return s}static extractValidConfig(e,t){const i=this._extractValidCommentRule(e,t),s=this._extractValidBrackets(e,t),r=this._extractValidAutoClosingPairs(e,t),o=this._extractValidSurroundingPairs(e,t),a=this._extractValidColorizedBracketPairs(e,t),l=typeof t.autoCloseBefore=="string"?t.autoCloseBefore:void 0,c=t.wordPattern?this._parseRegex(e,"wordPattern",t.wordPattern):void 0,d=t.indentationRules?this._mapIndentationRules(e,t.indentationRules):void 0;let h;if(t.folding){const p=t.folding.markers,m=p&&p.start?this._parseRegex(e,"folding.markers.start",p.start):void 0,_=p&&p.end?this._parseRegex(e,"folding.markers.end",p.end):void 0,w=m&&_?{start:m,end:_}:void 0;h={offSide:t.folding.offSide,markers:w}}const u=this._extractValidOnEnterRules(e,t);return{comments:i,brackets:s,wordPattern:c,indentationRules:d,onEnterRules:u,autoClosingPairs:r,surroundingPairs:o,colorizedBracketPairs:a,autoCloseBefore:l,folding:h,__electricCharacterSupport:void 0}}_handleConfig(e,t){const i=rLe.extractValidConfig(e,t);this._languageConfigurationService.register(e,i,50)}static _parseRegex(e,t,i){if(typeof i=="string")try{return new RegExp(i,"")}catch(s){console.warn(`[${e}]: Invalid regular expression in \`${t}\`: `,s);return}if(zn(i)){if(typeof i.pattern!="string"){console.warn(`[${e}]: language configuration: expected \`${t}.pattern\` to be a string.`);return}if(typeof i.flags<"u"&&typeof i.flags!="string"){console.warn(`[${e}]: language configuration: expected \`${t}.flags\` to be a string.`);return}try{return new RegExp(i.pattern,i.flags)}catch(s){console.warn(`[${e}]: Invalid regular expression in \`${t}\`: `,s);return}}console.warn(`[${e}]: language configuration: expected \`${t}\` to be a string or an object.`)}static _mapIndentationRules(e,t){const i=this._parseRegex(e,"indentationRules.increaseIndentPattern",t.increaseIndentPattern);if(!i)return;const s=this._parseRegex(e,"indentationRules.decreaseIndentPattern",t.decreaseIndentPattern);if(!s)return;const r={increaseIndentPattern:i,decreaseIndentPattern:s};return t.indentNextLinePattern&&(r.indentNextLinePattern=this._parseRegex(e,"indentationRules.indentNextLinePattern",t.indentNextLinePattern)),t.unIndentedLinePattern&&(r.unIndentedLinePattern=this._parseRegex(e,"indentationRules.unIndentedLinePattern",t.unIndentedLinePattern)),r}};oLe=rLe=y([v(0,tn),v(1,Tae),v(2,Wr),v(3,wr)],oLe);const yci="vscode://schemas/language-configuration",Sci={allowComments:!0,allowTrailingCommas:!0,default:{comments:{blockComment:["/*","*/"],lineComment:"//"},brackets:[["(",")"],["[","]"],["{","}"]],autoClosingPairs:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[["(",")"],["[","]"],["{","}"]]},definitions:{openBracket:{type:"string",description:f(5594,"The opening bracket character or string sequence.")},closeBracket:{type:"string",description:f(5595,"The closing bracket character or string sequence.")},bracketPair:{type:"array",items:[{$ref:"#/definitions/openBracket"},{$ref:"#/definitions/closeBracket"}]}},properties:{comments:{default:{blockComment:["/*","*/"],lineComment:{comment:"//",noIndent:!1}},description:f(5596,"Defines the comment symbols"),type:"object",properties:{blockComment:{type:"array",description:f(5597,"Defines how block comments are marked."),items:[{type:"string",description:f(5598,"The character sequence that starts a block comment.")},{type:"string",description:f(5599,"The character sequence that ends a block comment.")}]},lineComment:{type:"object",description:f(5600,"Configuration for line comments."),properties:{comment:{type:"string",description:f(5601,"The character sequence that starts a line comment.")},noIndent:{type:"boolean",description:f(5602,"Whether the comment token should not be indented and placed at the first column. Defaults to false."),default:!1}},required:["comment"],additionalProperties:!1}}},brackets:{default:[["(",")"],["[","]"],["{","}"]],markdownDescription:f(5603,"Defines the bracket symbols that increase or decrease the indentation. When bracket pair colorization is enabled and {0} is not defined, this also defines the bracket pairs that are colorized by their nesting level.","`colorizedBracketPairs`"),type:"array",items:{$ref:"#/definitions/bracketPair"}},colorizedBracketPairs:{default:[["(",")"],["[","]"],["{","}"]],markdownDescription:f(5604,"Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled. Any brackets included here that are not included in {0} will be automatically included in {0}.","`brackets`"),type:"array",items:{$ref:"#/definitions/bracketPair"}},autoClosingPairs:{default:[["(",")"],["[","]"],["{","}"]],description:f(5605,"Defines the bracket pairs. When a opening bracket is entered, the closing bracket is inserted automatically."),type:"array",items:{oneOf:[{$ref:"#/definitions/bracketPair"},{type:"object",properties:{open:{$ref:"#/definitions/openBracket"},close:{$ref:"#/definitions/closeBracket"},notIn:{type:"array",description:f(5606,"Defines a list of scopes where the auto pairs are disabled."),items:{enum:["string","comment"]}}}}]}},autoCloseBefore:{default:`;:.,=}])>
|
|
1312
1312
|
`,description:f(5607,"Defines what characters must be after the cursor in order for bracket or quote autoclosing to occur when using the 'languageDefined' autoclosing setting. This is typically the set of characters which can not start an expression."),type:"string"},surroundingPairs:{default:[["(",")"],["[","]"],["{","}"]],description:f(5608,"Defines the bracket pairs that can be used to surround a selected string."),type:"array",items:{oneOf:[{$ref:"#/definitions/bracketPair"},{type:"object",properties:{open:{$ref:"#/definitions/openBracket"},close:{$ref:"#/definitions/closeBracket"}}}]}},wordPattern:{default:"",description:f(5609,"Defines what is considered to be a word in the programming language."),type:["string","object"],properties:{pattern:{type:"string",description:f(5610,"The RegExp pattern used to match words."),default:""},flags:{type:"string",description:f(5611,"The RegExp flags used to match words."),default:"g",pattern:"^([gimuy]+)$",patternErrorMessage:f(5612,"Must match the pattern `/^([gimuy]+)$/`.")}}},indentationRules:{default:{increaseIndentPattern:"",decreaseIndentPattern:""},description:f(5613,"The language's indentation settings."),type:"object",properties:{increaseIndentPattern:{type:["string","object"],description:f(5614,"If a line matches this pattern, then all the lines after it should be indented once (until another rule matches)."),properties:{pattern:{type:"string",description:f(5615,"The RegExp pattern for increaseIndentPattern."),default:""},flags:{type:"string",description:f(5616,"The RegExp flags for increaseIndentPattern."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:f(5617,"Must match the pattern `/^([gimuy]+)$/`.")}}},decreaseIndentPattern:{type:["string","object"],description:f(5618,"If a line matches this pattern, then all the lines after it should be unindented once (until another rule matches)."),properties:{pattern:{type:"string",description:f(5619,"The RegExp pattern for decreaseIndentPattern."),default:""},flags:{type:"string",description:f(5620,"The RegExp flags for decreaseIndentPattern."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:f(5621,"Must match the pattern `/^([gimuy]+)$/`.")}}},indentNextLinePattern:{type:["string","object"],description:f(5622,"If a line matches this pattern, then **only the next line** after it should be indented once."),properties:{pattern:{type:"string",description:f(5623,"The RegExp pattern for indentNextLinePattern."),default:""},flags:{type:"string",description:f(5624,"The RegExp flags for indentNextLinePattern."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:f(5625,"Must match the pattern `/^([gimuy]+)$/`.")}}},unIndentedLinePattern:{type:["string","object"],description:f(5626,"If a line matches this pattern, then its indentation should not be changed and it should not be evaluated against the other rules."),properties:{pattern:{type:"string",description:f(5627,"The RegExp pattern for unIndentedLinePattern."),default:""},flags:{type:"string",description:f(5628,"The RegExp flags for unIndentedLinePattern."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:f(5629,"Must match the pattern `/^([gimuy]+)$/`.")}}}}},folding:{type:"object",description:f(5630,"The language's folding settings."),properties:{offSide:{type:"boolean",description:f(5631,"A language adheres to the off-side rule if blocks in that language are expressed by their indentation. If set, empty lines belong to the subsequent block.")},markers:{type:"object",description:f(5632,"Language specific folding markers such as '#region' and '#endregion'. The start and end regexes will be tested against the contents of all lines and must be designed efficiently"),properties:{start:{type:"string",description:f(5633,"The RegExp pattern for the start marker. The regexp must start with '^'.")},end:{type:"string",description:f(5634,"The RegExp pattern for the end marker. The regexp must start with '^'.")}}}}},onEnterRules:{type:"array",description:f(5635,"The language's rules to be evaluated when pressing Enter."),items:{type:"object",description:f(5635,"The language's rules to be evaluated when pressing Enter."),required:["beforeText","action"],properties:{beforeText:{type:["string","object"],description:f(5636,"This rule will only execute if the text before the cursor matches this regular expression."),properties:{pattern:{type:"string",description:f(5637,"The RegExp pattern for beforeText."),default:""},flags:{type:"string",description:f(5638,"The RegExp flags for beforeText."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:f(5639,"Must match the pattern `/^([gimuy]+)$/`.")}}},afterText:{type:["string","object"],description:f(5640,"This rule will only execute if the text after the cursor matches this regular expression."),properties:{pattern:{type:"string",description:f(5641,"The RegExp pattern for afterText."),default:""},flags:{type:"string",description:f(5642,"The RegExp flags for afterText."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:f(5643,"Must match the pattern `/^([gimuy]+)$/`.")}}},previousLineText:{type:["string","object"],description:f(5644,"This rule will only execute if the text above the line matches this regular expression."),properties:{pattern:{type:"string",description:f(5645,"The RegExp pattern for previousLineText."),default:""},flags:{type:"string",description:f(5646,"The RegExp flags for previousLineText."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:f(5647,"Must match the pattern `/^([gimuy]+)$/`.")}}},action:{type:["string","object"],description:f(5648,"The action to execute."),required:["indent"],default:{indent:"indent"},properties:{indent:{type:"string",description:f(5649,"Describe what to do with the indentation"),default:"indent",enum:["none","indent","indentOutdent","outdent"],markdownEnumDescriptions:[f(5650,"Insert new line and copy the previous line's indentation."),f(5651,"Insert new line and indent once (relative to the previous line's indentation)."),f(5652,`Insert two new lines:
|
|
1313
1313
|
- the first one indented which will hold the cursor
|
|
1314
|
-
- the second one at the same indentation level`),f(5653,"Insert new line and outdent once (relative to the previous line's indentation).")]},appendText:{type:"string",description:f(5654,"Describes text to be appended after the new line and after the indentation."),default:""},removeText:{type:"number",description:f(5655,"Describes the number of characters to remove from the new line's indentation."),default:0}}}}}}}},Cci=mt.as(UI.JSONContribution);Cci.registerSchema(yci,Sci);var p2;let Hie=(p2=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(oLe)}},p2.ID="workbench.contrib.languageConfigurationExtensionPoint",p2);Hie=y([v(0,Oe)],Hie);sg(Hie.ID,Hie,Ul.BlockStartup);function Eci(){return{...vPe(),[tn.toString()]:new Ji(oEe,[],!1),[Kae.toString()]:new Ji(bci,[],!0)}}function xci(n){return!!n.textEditorModel}let aLe=class extends V{constructor(e,t,i){super(),this._modelService=e,this._textModelService=t,this._undoRedoService=i,this._register(this._modelService.onModelRemoved(s=>{const r=this._undoRedoService.getElements(s.uri);if(!(r.past.length===0&&r.future.length===0)){for(const o of r.past)o instanceof jge&&o.setDelegate(this);for(const o of r.future)o instanceof jge&&o.setDelegate(this)}}))}prepareUndoRedo(e){const t=e.getMissingModels();if(t.length===0)return V.None;const i=t.map(async s=>{try{return await this._textModelService.createModelReference(s)}catch{return V.None}});return Promise.all(i).then(s=>({dispose:()=>zt(s)}))}};aLe=y([v(0,on),v(1,hr),v(2,GI)],aLe);let lLe=class extends klt{constructor(e,t,i,s){super(),this.instantiationService=e,this.textFileService=t,this.fileService=i,this.modelService=s,this.providers=new Map,this.modelsToDispose=new Set}createReferencedObject(e){return this.doCreateReferencedObject(e)}async doCreateReferencedObject(e,t){this.modelsToDispose.delete(e);const i=N.parse(e);if(i.scheme===ye.inMemory){if(!this.modelService.getModel(i))throw new Error(`Unable to resolve inMemory resource ${e}`);const r=this.instantiationService.createInstance(V8,i);if(this.ensureResolvedModel(r,e))return r}if(i.scheme===ye.untitled){const s=await this.textFileService.untitled.resolve({untitledResource:i});if(this.ensureResolvedModel(s,e))return s}if(this.fileService.hasProvider(i)){const s=await this.textFileService.files.resolve(i,{reason:D8.REFERENCE});if(this.ensureResolvedModel(s,e))return s}if(this.providers.has(i.scheme)){await this.resolveTextModelContent(e);const s=this.instantiationService.createInstance(V8,i);if(this.ensureResolvedModel(s,e))return s}if(!t)return await this.fileService.activateProvider(i.scheme),this.doCreateReferencedObject(e,!0);throw new Error(`Unable to resolve resource ${e}`)}ensureResolvedModel(e,t){if(xci(e))return!0;throw new Error(`Unable to resolve resource ${t}`)}destroyReferencedObject(e,t){N.parse(e).scheme!==ye.inMemory&&(this.modelsToDispose.add(e),(async()=>{try{const s=await t;if(!this.modelsToDispose.has(e)||(s instanceof TJ?await this.textFileService.files.canDispose(s):s instanceof IJ&&await this.textFileService.untitled.canDispose(s),!this.modelsToDispose.has(e)))return;s.dispose()}catch{}finally{this.modelsToDispose.delete(e)}})())}registerTextModelContentProvider(e,t){let i=this.providers.get(e);return i||(i=[],this.providers.set(e,i)),i.unshift(t),ke(()=>{const s=this.providers.get(e);if(!s)return;const r=s.indexOf(t);r!==-1&&(s.splice(r,1),s.length===0&&this.providers.delete(e))})}hasTextModelContentProvider(e){return this.providers.get(e)!==void 0}async resolveTextModelContent(e){const t=N.parse(e),i=this.providers.get(t.scheme)||[];for(const s of i){const r=await s.provideTextContent(t);if(r)return r}throw new Error(`Unable to resolve text model content for resource ${e}`)}};lLe=y([v(0,Oe),v(1,Qa),v(2,rn),v(3,on)],lLe);let cLe=class extends V{get resourceModelCollection(){return this._resourceModelCollection||(this._resourceModelCollection=this.instantiationService.createInstance(lLe)),this._resourceModelCollection}get asyncModelCollection(){return this._asyncModelCollection||(this._asyncModelCollection=new Ilt(this.resourceModelCollection)),this._asyncModelCollection}constructor(e,t,i,s,r){super(),this.instantiationService=e,this.fileService=t,this.undoRedoService=i,this.modelService=s,this.uriIdentityService=r,this._resourceModelCollection=void 0,this._asyncModelCollection=void 0,this._register(new aLe(this.modelService,this,this.undoRedoService))}async createModelReference(e){return e=this.uriIdentityService.asCanonicalUri(e),await this.asyncModelCollection.acquire(e.toString())}registerTextModelContentProvider(e,t){return this.resourceModelCollection.registerTextModelContentProvider(e,t)}canHandleResource(e){return this.fileService.hasProvider(e)||e.scheme===ye.untitled||e.scheme===ye.inMemory?!0:this.resourceModelCollection.hasTextModelContentProvider(e.scheme)}};cLe=y([v(0,Oe),v(1,rn),v(2,GI),v(3,on),v(4,or)],cLe);function Dci(){return{[hr.toString()]:new Ji(cLe,[],!0)}}const Zat=n=>{const e=Jat(),t=(i,s)=>{n.logger?.info(`getWorker: moduleId: ${i} label: ${s}`);const r=n.workerLoaders?.[s]??void 0;if(r===void 0)throw new Error(`Unimplemented worker ${s} (${i})`);return r()};e.getWorker=n.getWorkerOverride??t},Jat=()=>{const n=self;n.MonacoEnvironment===void 0&&(n.MonacoEnvironment={});const e=n.MonacoEnvironment;return e.vscodeApiInitialised===void 0&&(e.vscodeApiInitialised=!1),e.vscodeInitialising===void 0&&(e.vscodeInitialising=!1),e},kci=async()=>({...wci(),...Eci(),...bli(),...Dci()}),Ici=(n,e)=>{for(const t of Object.keys(n))e?.debug(`Loading service: ${t}`)},x0=(n,e)=>{if(e!==void 0)for(const[t,i]of Object.entries(e))n[t]=i},Tci=async(n,e)=>{const t=Jat();return typeof e?.monacoWorkerFactory=="function"?e.monacoWorkerFactory(e.logger):Zat({logger:e?.logger}),(t.vscodeInitialising??!1)||(t.vscodeApiInitialised??!1?e?.logger?.debug("Initialization of vscode services can only performed once!"):(t.vscodeInitialising=!0,e?.logger?.debug(`Initializing vscode services. Caller: ${e.caller??"unknown"}`),n.userConfiguration?.json!==void 0&&await _ci(n.userConfiguration.json),await Lci(n,e),n.viewsConfig?.htmlAugmentationInstructions?.(e?.htmlContainer),await n.viewsConfig?.viewsInitFunc?.(),e?.logger?.debug("Initialization of vscode services completed successfully."),t.vscodeApiInitialised=!0,t.vscodeInitialising=!1)),t.vscodeApiInitialised},Lci=async(n,e)=>{const t=await kci();x0(t,n.serviceOverrides),await Rci(n.enableExtHostWorker===!0,t),Ici(t,e?.logger),(e?.performServiceConsistencyChecks===void 0||typeof e.performServiceConsistencyChecks=="function"&&e.performServiceConsistencyChecks())&&(n.viewsConfig?.viewServiceType==="ViewsService"||n.viewsConfig?.viewServiceType==="WorkspaceService"?await M8e(t,e?.htmlContainer,n.workspaceConfig,n.envOptions):await M8e(t,void 0,n.workspaceConfig,n.envOptions)),_j(i=>{e?.logger?.createErrorAndLog("Unexpected error",i)})},Rci=async(n,e)=>{if(n){const t=new Mli(new URL(""+new URL("extensionHost.worker-otoVBpHF.js",import.meta.url).href,import.meta.url),{type:"module"}),i={url:t.url.toString(),options:t.options};x0(e,{...mrt(i)})}},Aci=async(n,e)=>{const t=e.vscodeApiConfig,i=t.serviceOverrides??{};return await Pci(n,i),await Nci(i,t.viewsConfig),Mci(t),Oci(t,e.logLevel),Fci(t,e.semanticHighlighting),t.serviceOverrides=i,t},Pci=async(n,e)=>{if(n==="extended"){const t=(await Kv(async()=>{const{default:s}=await import("./index-BQHo-Z-Y.js");return{default:s}},__vite__mapDeps([0,1,2,3]),import.meta.url)).default,i=(await Kv(async()=>{const{default:s}=await import("./index-CHwATtBn.js");return{default:s}},__vite__mapDeps([4,2,1]),import.meta.url)).default;x0(e,{...t(),...i()})}else{const t=(await Kv(async()=>{const{default:i}=await import("./index-DcZHpPDm.js");return{default:i}},__vite__mapDeps([5,6]),import.meta.url)).default;x0(e,{...t()})}},Nci=async(n,e)=>{if(e?.viewServiceType==="ViewsService"){const t=(await Kv(async()=>{const{default:i}=await import("./index-kz8GV9yO.js");return{default:i}},__vite__mapDeps([7,8,9,10,1,11,12]),import.meta.url)).default;x0(n,{...t(e.openEditorFunc??uze)})}else if(e?.viewServiceType==="WorkspaceService"){const t=(await Kv(async()=>{const{default:i}=await import("./index-GR_3sv6M.js");return{default:i}},__vite__mapDeps([13,8,9,10,1,11,14]),import.meta.url)).default;x0(n,{...t()})}else{const t=(await Kv(async()=>{const{default:i}=await import("./index-CQIJkuYI.js");return{default:i}},__vite__mapDeps([15,9,10,12]),import.meta.url)).default;x0(n,{...t(e?.openEditorFunc??uze)})}},Mci=n=>{n.workspaceConfig===void 0&&(n.workspaceConfig={workspaceProvider:{trusted:!0,workspace:{workspaceUri:hNe.file("/workspace.code-workspace")},async open(){return window.open(window.location.href),!0}}})},Oci=(n,e)=>{const t=n.workspaceConfig.developmentOptions?.logLevel;if(t===void 0){const i={...n.workspaceConfig.developmentOptions};i.logLevel=e,n.workspaceConfig.developmentOptions=Object.assign({},i)}else if(t!==e)throw new Error(`You have configured mismatching logLevels: ${e} (wrapperConfig) ${t} (workspaceConfig.developmentOptions)`)},Fci=(n,e)=>{if(e??!1){const t={...n.workspaceConfig.configurationDefaults};t["editor.semanticHighlighting.enabled"]=!0,n.workspaceConfig.configurationDefaults=Object.assign({},t)}},uze=async(n,e,t)=>{console.log("Received open editor call with parameters: ",n,e,t)},Wci=n=>{const e=Object.keys(n??{}).includes("themeService"),t=Object.keys(n??{}).includes("textMateTokenizationFeature"),i=Object.keys(n??{}).includes("markersService"),s=Object.keys(n??{}).includes("viewsService");if(e&&!t)throw new Error('"theme" service requires "textmate" service. Please add it to the "userServices".');if(i&&!s)throw new Error('"markers" service requires "views" service. Please add it to the "userServices".');return!0};class Bci{id;editorApp;extensionRegisterResults=new Map;disposableStore=new ie;languageClientWrappers=new Map;wrapperConfig;logger=new yli;initAwait;initResolve;startingAwait;startingResolve;disposingAwait;disposingResolve;async init(e){this.isInitializing()&&await this.getInitializingAwait();const t=e.editorAppConfig;if((t?.useDiffEditor??!1)&&!t?.codeResources?.original)throw new Error(`Use diff editor was used without a valid config. code: ${t?.codeResources?.modified} codeOriginal: ${t?.codeResources?.original}`);const i=e.vscodeApiConfig?.viewsConfig?.viewServiceType??"EditorService";if(e.$type==="classic"&&(i==="ViewsService"||i==="WorkspaceService"))throw new Error(`View Service Type "${i}" cannot be used with classic configuration.`);if(e.automaticallyDispose??!0)await this.dispose();else if(this.wrapperConfig!==void 0)throw new Error("You configured the wrapper to not automatically dispose on init, but did not dispose manually. Please call dispose first if you want to re-start.");try{this.markInitializing(),this.id=e.id??Math.floor(Math.random()*1000001).toString(),this.logger.setLevel(e.logLevel??Pt.Off),e.vscodeApiConfig?.vscodeApiInitPerformExternally!==!0&&(e.vscodeApiConfig=await Aci(e.$type,{vscodeApiConfig:e.vscodeApiConfig??{},logLevel:this.logger.getLevel(),semanticHighlighting:e.editorAppConfig?.editorOptions?.["semanticHighlighting.enabled"]===!0}),await Tci(e.vscodeApiConfig,{monacoWorkerFactory:e.editorAppConfig?.monacoWorkerFactory,htmlContainer:e.htmlContainer,caller:`monaco-editor (${this.id})`,performServiceConsistencyChecks:Wci,logger:this.logger})),this.wrapperConfig=e,(this.wrapperConfig.languageClientConfigs?.automaticallyInit??!0)&&this.initLanguageClients(),await this.initExtensions(),this.editorApp=new Goi(this.wrapperConfig.$type,this.id,this.wrapperConfig.editorAppConfig,this.logger),await this.editorApp.init()}catch(s){throw s}finally{this.markInitialized()}}initLanguageClients(){const e=Object.entries(this.wrapperConfig?.languageClientConfigs?.configs??{});if(e.length>0)for(const[t,i]of e){const s=new Nli({languageClientConfig:i,logger:this.logger});this.languageClientWrappers.set(t,s)}}async initExtensions(){const e=this.wrapperConfig?.vscodeApiConfig;this.wrapperConfig?.$type==="extended"&&(e?.loadThemes===void 0||e.loadThemes===!0)&&await Kv(()=>import("./index-CLAWxbMR.js"),[],import.meta.url);const t=this.wrapperConfig?.extensions;if(this.wrapperConfig?.extensions){const i=[],s=[];kUt().forEach(r=>{s.push(r.identifier.id)});for(const r of t??[])if(!s.includes(`${r.config.publisher}.${r.config.name}`)){const o=r.config,a=TUt(o,An.LocalProcess);if(this.extensionRegisterResults.set(o.name,a),r.filesOrContents&&Object.hasOwn(a,"registerFileUrl"))for(const l of r.filesOrContents)this.disposableStore.add(a.registerFileUrl(l[0],Koi(l[1])));i.push(a.whenReady())}await Promise.all(i)}}markInitializing(){this.initAwait=new Promise(e=>{this.initResolve=e})}markInitialized(){this.initResolve(),this.initAwait=void 0}isInitializing(){return this.initAwait!==void 0}getInitializingAwait(){return this.initAwait}getWrapperConfig(){return this.wrapperConfig}getExtensionRegisterResult(e){return this.extensionRegisterResults.get(e)}async initAndStart(e){await this.init(e),await this.start()}async start(e){if(this.isStarting()&&await this.getStartingAwait(),this.wrapperConfig===void 0)throw new Error("No init was performed. Please call init() before start()");this.markStarting();try{const t=this.wrapperConfig.vscodeApiConfig?.viewsConfig?.viewServiceType;if(t==="EditorService"||t===void 0){this.logger.info(`Starting monaco-editor (${this.id})`);const i=e===void 0?this.wrapperConfig.htmlContainer:e;if(i===void 0)throw new Error("No html container provided. Unable to start monaco-editor.");await this.editorApp?.createEditors(i)}else this.logger.info("No EditorService configured. monaco-editor will not be started.");(this.wrapperConfig.languageClientConfigs?.automaticallyStart??!0)&&await this.startLanguageClients()}catch(t){throw t}finally{this.markStarted()}}async startLanguageClients(){const e=[];for(const t of this.languageClientWrappers.values())e.push(t.start());return Promise.all(e)}markStarting(){this.startingAwait=new Promise(e=>{this.startingResolve=e})}markStarted(){this.startingResolve(),this.startingAwait=void 0}isStarting(){return this.startingAwait!==void 0}getStartingAwait(){return this.startingAwait}isStarted(){if(!(this.editorApp?.haveEditor()??!1))return!1;for(const e of this.languageClientWrappers.values())if(e.haveLanguageClient()&&!e.isStarted())return!1;return!0}haveLanguageClients(){return this.languageClientWrappers.size>0}getEditorApp(){return this.editorApp}getEditor(){return this.editorApp?.getEditor()}getDiffEditor(){return this.editorApp?.getDiffEditor()}getLanguageClientWrapper(e){return this.languageClientWrappers.get(e)}getLanguageClient(e){return this.languageClientWrappers.get(e)?.getLanguageClient()}getTextModels(){return this.editorApp?.getTextModels()}getWorker(e){return this.languageClientWrappers.get(e)?.getWorker()}getLogger(){return this.logger}async updateCodeResources(e){return this.editorApp?.updateCodeResources(e)}registerTextChangedCallback(e){this.editorApp?.registerOnTextChangedCallbacks(e)}reportStatus(){const e=[];return e.push("Wrapper status:"),e.push(`Editor: ${this.editorApp?.getEditor()?.getId()}`),e.push(`DiffEditor: ${this.editorApp?.getDiffEditor()?.getId()}`),e}async dispose(){this.isDisposing()&&await this.getDisposingAwait(),this.markDisposing(),await this.editorApp?.dispose(),this.editorApp=void 0,this.extensionRegisterResults.forEach(e=>e.dispose()),this.disposableStore.dispose(),this.disposableStore=new ie;try{(this.wrapperConfig?.languageClientConfigs?.automaticallyDispose??!0)&&await this.disposeLanguageClients()}catch(e){throw e}finally{this.languageClientWrappers.clear(),this.wrapperConfig=void 0,this.markDisposed()}}async disposeLanguageClients(){const e=this.wrapperConfig?.languageClientConfigs?.automaticallyDisposeWorkers??!1,t=[];for(const i of this.languageClientWrappers.values())i.haveLanguageClient()&&t.push(i.disposeLanguageClient(e));return Promise.all(t)}markDisposing(){this.disposingAwait=new Promise(e=>{this.disposingResolve=e})}markDisposed(){this.disposingResolve(),this.disposingAwait=void 0}isDisposing(){return this.disposingAwait!==void 0}getDisposingAwait(){return this.disposingAwait}updateLayout(){this.editorApp?.updateLayout()}}const Hci=()=>({TextEditorWorker:()=>new Worker(new URL(""+new URL("editor.worker-CIbPC0uE.js",import.meta.url).href,import.meta.url),{type:"module"}),TextMateWorker:()=>new Worker(new URL(""+new URL("worker-4ckq56fZ.js",import.meta.url).href,import.meta.url),{type:"module"}),OutputLinkDetectionWorker:void 0,LanguageDetectionWorker:void 0,NotebookEditorWorker:void 0,LocalFileSearchWorker:void 0}),Vci=n=>{Zat({workerLoaders:Hci(),logger:n})};var fze=Wat();function Uci(n,e){let t=null;return(...i)=>{t&&clearTimeout(t),t=setTimeout(()=>{n(...i),t=null},e)}}class $ci{MonacoEditorLanguageClientWrapper;constructor(e){this.MonacoEditorLanguageClientWrapper=e}createWrapper(){return new this.MonacoEditorLanguageClientWrapper}}class zci{wrapper;pendingMessages=[];theme="";contentChangeSubscribed=!1;wrapperInitialized=!1;dependencies;wrapperFactory;allowedOrigin="*";highlightName=!1;messageHandler;contentChangeDisposable;keyDownDisposable;INITIAL_RETRY_DELAY=50;MAX_RETRY_DELAY=1e3;MAX_RETRIES=20;MAX_PENDING_MESSAGES=100;CONTENT_CHANGE_DEBOUNCE_MS=300;constructor(e,t){this.dependencies=e,this.wrapperFactory=t||new $ci(e.MonacoEditorLanguageClientWrapper);let i=window.location.hash.slice(1);i&&(this.allowedOrigin=new URL(decodeURIComponent(i)).origin)}retryWithBackoff(e,t){let i=this.INITIAL_RETRY_DELAY,s=0;const r=()=>{if(!e()){if(s>=this.MAX_RETRIES){console.error("Max retries exceeded"),t?.();return}s++,i=Math.min(i*2,this.MAX_RETRY_DELAY),this.dependencies.setTimeout(r,i)}};r()}getWorkerScriptUrl(){return new this.dependencies.URL("../worker.js",this.dependencies.importMetaUrl)}getWrapper(){return this.wrapper}getPendingMessages(){return[...this.pendingMessages]}getTheme(){return this.theme}isContentChangeSubscribed(){return this.contentChangeSubscribed}isWrapperInitialized(){return this.wrapperInitialized}isValidTheme(e){return["xanoscript-dark","xanoscript-light"].includes(e)}applyCodeUpdate(e){const t=this.wrapper?.getEditor();t&&(t.setValue(e),this.highlightName&&requestAnimationFrame(()=>this.highlightSecondWord()))}applyTheme(e){this.isValidTheme(e)&&(this.theme=e,Xg.setTheme(e))}tryDequeueMessages(){const e=this.wrapper?.getEditor();if(!e&&this.pendingMessages.length>0){this.retryWithBackoff(()=>this.wrapper?.getEditor()?(this.tryDequeueMessages(),!0):!1);return}if(!e||this.pendingMessages.length===0)return;let t,i,s=!1;for(const r of this.pendingMessages)r.data?.code!==void 0&&r.data?.code!==null&&(t=r.data.code),r.data?.theme!==void 0&&this.isValidTheme(r.data.theme)&&(i=r.data.theme),r.data?.highlightName&&(s=!0);s&&(this.highlightName=!0),i!==void 0&&this.applyTheme(i),t!==void 0&&this.applyCodeUpdate(t),this.pendingMessages=[]}subscribeToEditorContentChanges(){const e=this.wrapper?.getEditor();if(!e&&!this.contentChangeSubscribed){this.retryWithBackoff(()=>this.wrapper?.getEditor()?(this.subscribeToEditorContentChanges(),!0):!1);return}if(!e||this.contentChangeSubscribed)return;const t=Uci(()=>{const i=e.getValue();this.postMessage({code:i})},this.CONTENT_CHANGE_DEBOUNCE_MS);this.contentChangeDisposable=e.onDidChangeModelContent(t),e.focus(),this.contentChangeSubscribed=!0}async handleMessage(e){if(e.origin!==this.allowedOrigin&&this.allowedOrigin!=="*")return;const t=e.data?.theme;if(t&&!this.wrapperInitialized){this.isValidTheme(t)&&(this.theme=t),this.wrapperInitialized=!0,await this.initializeEditor();return}if(!this.wrapper?.getEditor()){this.pendingMessages.length>=this.MAX_PENDING_MESSAGES&&this.pendingMessages.shift(),this.pendingMessages.push(e);return}t&&this.applyTheme(t),e.data?.highlightName&&(this.highlightName=!0);const s=e.data?.code;s!=null&&this.applyCodeUpdate(s)}setWrapperFactory(e){this.wrapperFactory=e}setWrapper(e){this.wrapper=e}async initializeEditor(){try{const e=new this.dependencies.Worker(this.getWorkerScriptUrl(),{type:"module",name:"XanoScript Language Server Worker"}),t=new this.dependencies.BrowserMessageReader(e),i=new this.dependencies.BrowserMessageWriter(e),s={configs:{xanoscript:{clientOptions:{documentSelector:["xanoscript"]},connection:{options:{$type:"WorkerConfig",url:this.getWorkerScriptUrl(),type:"module"},messageTransports:{reader:t,writer:i}}}}};this.wrapper=this.wrapperFactory.createWrapper();const r={$type:"classic",htmlContainer:this.dependencies.document.getElementById("monaco-editor"),editorAppConfig:{codeResources:{modified:{uri:"/workspace/example.xs",text:""}},monacoWorkerFactory:this.dependencies.configureDefaultWorkerFactory,languageDef:{languageExtensionConfig:{id:"xanoscript",extensions:[".xs"],aliases:["XanoScript","xanoscript"],mimetypes:["text/xanoscript"]},theme:this.theme==="xanoscript-dark"?this.dependencies.darkTheme:this.dependencies.lightTheme},editorOptions:{language:"xanoscript","semanticHighlighting.enabled":!0,wordBasedSuggestions:"currentDocument",theme:this.theme,tabSize:2,insertSpaces:!0}},languageClientConfigs:s};await this.wrapper.initAndStart(r),Xg.defineTheme(this.dependencies.darkTheme.name,this.dependencies.darkTheme.data),Xg.defineTheme(this.dependencies.lightTheme.name,this.dependencies.lightTheme.data),this.keyDownDisposable=this.wrapper.getEditor().onKeyDown(o=>{o.metaKey&&o.code==="KeyS"?this.postMessage({command:"save"}):o.metaKey&&o.code==="KeyK"&&this.postMessage({command:"search"})}),this.wrapper.getEditor().getModel().updateOptions({tabSize:2}),this.tryDequeueMessages(),this.subscribeToEditorContentChanges(),this.postMessage({status:"ready"})}catch(e){if(String(e)?.startsWith("Error: Unable to figure out browser width and height"))return;throw console.error(e),e}}initialize(){this.messageHandler&&this.dependencies.window.removeEventListener("message",this.messageHandler),this.messageHandler=e=>{this.handleMessage(e).catch(console.error)},this.dependencies.window.addEventListener("message",this.messageHandler)}reset(){this.messageHandler&&(this.dependencies.window.removeEventListener("message",this.messageHandler),this.messageHandler=void 0),this.contentChangeDisposable?.dispose(),this.contentChangeDisposable=void 0,this.keyDownDisposable?.dispose(),this.keyDownDisposable=void 0,this.wrapper=void 0,this.pendingMessages=[],this.theme="",this.contentChangeSubscribed=!1,this.wrapperInitialized=!1,this.highlightName=!1}postMessage(e){this.dependencies.window.parent.postMessage(e,this.allowedOrigin)}highlightSecondWord(){const e=this.wrapper?.getEditor(),t=e?.getModel();if(!t)return;const i=t.getLineContent(1),s=i.trim().split(/\s+/);if(s.length<2)return;const r=s[1],o=i.indexOf(r)+1,a=new iZt(1,o,1,o+r.length);e.setSelection(a),e.focus()}}const elt=[{token:"bracket",foreground:"ffd700"},{token:"operator.openingCurly",foreground:"da70d6"},{token:"operator.closingCurly",foreground:"da70d6"},{token:"operator.openingSquare",foreground:"7a0528"},{token:"operator.closingSquare",foreground:"7a0528"},{token:"operator.openingParenthesis",foreground:"87ceeb"},{token:"operator.closingParenthesis",foreground:"87ceeb"},{token:"comment",foreground:"6a9955",fontStyle:"italic"},{token:"regexp",foreground:"d16969"},{token:"macro",foreground:"c586c0"},{token:"tripleMacro",foreground:"c586c0"}],qci=[{token:"keyword",foreground:"f390f6"},{token:"variable",foreground:"9cdcfe"},{token:"property",foreground:"9cdcfe"},{token:"method",foreground:"9cdcfe"},{token:"namespace",foreground:"9cdcfe"},{token:"function",foreground:"f9fe9c"},{token:"singleString",foreground:"ce9178",fontStyle:"italic"},{token:"doubleString",foreground:"ce9178",fontStyle:"italic"},{token:"tripleString",foreground:"ce9178",fontStyle:"italic"},{token:"operator",foreground:"d4d4d4"},{token:"punctuation",foreground:"d4d4d4"},{token:"enumMember",foreground:"bfe7aa"},{token:"number",foreground:"bfe7aa"},{token:"boolean",foreground:"569cd6"}],Gci=[{token:"keyword",foreground:"8a338d",fontStyle:"bold"},{token:"variable",foreground:"2d779fff"},{token:"property",foreground:"2d779fff"},{token:"namespace",foreground:"2d779fff"},{token:"method",foreground:"2d779fff"},{token:"function",foreground:"b46f00",fontStyle:"bold"},{token:"singleString",foreground:"a31515",fontStyle:"italic"},{token:"doubleString",foreground:"a31515",fontStyle:"italic"},{token:"tripleString",foreground:"a31515",fontStyle:"italic"},{token:"operator",foreground:"000000"},{token:"punctuation",foreground:"000000"},{token:"enumMember",foreground:"37ae6f"},{token:"number",foreground:"37ae6f"},{token:"boolean",foreground:"000000"}],Kci={"editor.foreground":"#24292e","editor.background":"#ffffff","editor.selectionBackground":"#bedbe0ff","editor.inactiveSelectionBackground":"#e0e0e0","editor.lineHighlightBackground":"#e0e0e0","editorCursor.foreground":"#24292e","editorWhitespace.foreground":"#959da5","editorIndentGuide.background":"#959da5","editorIndentGuide.activeBackground":"#24292e","editor.selectionHighlightBorder":"#e0e0e0"},jci={name:"xanoscript-dark",data:{base:"vs-dark",inherit:!0,rules:[...elt,...qci],colors:{}}},Yci={name:"xanoscript-light",data:{base:"vs",inherit:!0,rules:[...elt,...Gci],colors:Kci}},Xci={window:globalThis.window,document:globalThis.document,Worker:globalThis.Worker,setTimeout:globalThis.setTimeout,URL:globalThis.URL,importMetaUrl:import.meta.url,MonacoEditorLanguageClientWrapper:Bci,BrowserMessageReader:fze.BrowserMessageReader,BrowserMessageWriter:fze.BrowserMessageWriter,configureDefaultWorkerFactory:Vci,lightTheme:Yci,darkTheme:jci},Qci=new zci(Xci);Qci.initialize();export{k as $,En as A,sRt as B,epe as C,V as D,A as E,ef as F,mn as G,_di as H,Tae as I,zn as J,py as K,Jt as L,gn as M,me as N,it as O,cm as P,GE as Q,M as R,sr as S,$g as T,N as U,ur as V,Oe as W,sg as X,Ul as Y,_t as Z,Kv as _,zoe as a,Jpi as a$,ye as a0,lMt as a1,Et as a2,Me as a3,ui as a4,Sa as a5,RNe as a6,kl as a7,Ie as a8,be as a9,Mgt as aA,mfi as aB,oYe as aC,dgi as aD,iae as aE,d0e as aF,k6 as aG,I6 as aH,mt as aI,vgt as aJ,ze as aK,Xi as aL,nu as aM,TM as aN,Hfe as aO,Jo as aP,m1e as aQ,zB as aR,qv as aS,RJ as aT,r0 as aU,Ka as aV,UI as aW,dRt as aX,cRt as aY,tmi as aZ,nmi as a_,ho as aa,Er as ab,qc as ac,Ds as ad,xn as ae,_i as af,Je as ag,spe as ah,Y as ai,It as aj,se as ak,Ji as al,vPe as am,jbi as an,sh as ao,_s as ap,Kt as aq,qt as ar,H3 as as,Kr as at,wd as au,yC as av,eKe as aw,b1e as ax,Rv as ay,OOe as az,RSt as b,qB as b$,emi as b0,Df as b1,Dde as b2,Mh as b3,bS as b4,uWe as b5,Mgi as b6,Ogi as b7,m4 as b8,Sq as b9,rn as bA,fr as bB,cet as bC,Qae as bD,Si as bE,Ce as bF,ORe as bG,U6 as bH,Jn as bI,j6 as bJ,Lr as bK,Ge as bL,Dt as bM,fo as bN,Le as bO,Ci as bP,$ as bQ,CH as bR,qE as bS,nQ as bT,Jb as bU,oi as bV,$a as bW,ls as bX,wt as bY,Te as bZ,Li as b_,YGe as ba,WE as bb,Or as bc,ca as bd,Wt as be,ks as bf,Ct as bg,yBe as bh,ot as bi,LRe as bj,imi as bk,xZe as bl,lht as bm,gfi as bn,fRt as bo,pn as bp,p1e as bq,Dqe as br,hs as bs,ir as bt,KGe as bu,Nt as bv,cqe as bw,Wr as bx,Ki as by,U_ as bz,Xt as c,xWe as c$,Xr as c0,Nn as c1,F_ as c2,bje as c3,u7 as c4,WWe as c5,$We as c6,y5 as c7,eD as c8,c6 as c9,yxe as cA,dd as cB,RD as cC,OJ as cD,dC as cE,R_ as cF,lQ as cG,rH as cH,TGe as cI,tp as cJ,Ape as cK,Cgi as cL,af as cM,gZe as cN,ds as cO,oDt as cP,sdi as cQ,O as cR,Qr as cS,uwi as cT,hwi as cU,pw as cV,gg as cW,fc as cX,ne as cY,fwi as cZ,gm as c_,oF as ca,aF as cb,Qsi as cc,Cd as cd,zit as ce,mw as cf,oh as cg,Xa as ch,jn as ci,rh as cj,xi as ck,qa as cl,NC as cm,Hs as cn,l0 as co,gi as cp,El as cq,vn as cr,Yde as cs,jS as ct,ss as cu,nE as cv,x5 as cw,bIe as cx,$n as cy,YQ as cz,ie as d,uNt as d$,Tn as d0,pu as d1,ql as d2,t0 as d3,us as d4,fs as d5,MQ as d6,eQe as d7,zt as d8,Ir as d9,D_i as dA,I_i as dB,sPt as dC,tt as dD,$l as dE,tP as dF,Pae as dG,Ddi as dH,uo as dI,Vv as dJ,Ifi as dK,Kc as dL,Dr as dM,k_i as dN,ah as dO,j as dP,Da as dQ,cfi as dR,jf as dS,Q$ as dT,fp as dU,is as dV,ja as dW,lgi as dX,KJe as dY,dMt as dZ,dNt as d_,ue as da,Zi as db,Ne as dc,zl as dd,qpi as de,iQ as df,bi as dg,Wn as dh,Gl as di,Bs as dj,Vmt as dk,Jr as dl,na as dm,Zt as dn,Oo as dp,Nq as dq,jc as dr,dt as ds,rdi as dt,M1e as du,Egi as dv,g1e as dw,un as dx,qr as dy,eH as dz,y1t as e,rp as e$,kh as e0,nme as e1,rg as e2,$c as e3,rQ as e4,fKe as e5,as as e6,ia as e7,G0e as e8,i0 as e9,da as eA,Yvt as eB,Ao as eC,Kgi as eD,ym as eE,Oy as eF,srt as eG,og as eH,_j as eI,cdi as eJ,ofe as eK,Q7 as eL,Ga as eM,qb as eN,cpe as eO,CD as eP,S7 as eQ,_wt as eR,Gpi as eS,f6 as eT,fu as eU,lI as eV,Rz as eW,ya as eX,i1 as eY,j8 as eZ,y0 as e_,qbi as ea,Bmt as eb,Foe as ec,Ggi as ed,T_i as ee,L_i as ef,qn as eg,os as eh,Fmt as ei,Jsi as ej,nmt as ek,Vit as el,lg as em,II as en,zbi as eo,kfi as ep,EKe as eq,oy as er,XOe as es,$bi as et,vv as eu,Gt as ev,q0e as ew,zq as ex,BA as ey,hn as ez,y as f,Lmi as f$,KP as f0,Yp as f1,pm as f2,K8 as f3,wy as f4,vIe as f5,_Ie as f6,cwi as f7,mtt as f8,_v as f9,Nmi as fA,QZe as fB,jb as fC,x_i as fD,ea as fE,wc as fF,cQe as fG,wIe as fH,_We as fI,xa as fJ,rUt as fK,lwi as fL,NAt as fM,Wc as fN,ud as fO,Pmi as fP,md as fQ,Rmi as fR,Ami as fS,Wdt as fT,Cbt as fU,smi as fV,rmi as fW,ey as fX,XA as fY,yje as fZ,$fi as f_,kle as fa,GOt as fb,HDi as fc,Qfe as fd,qgi as fe,bfi as ff,hi as fg,mae as fh,v8e as fi,pI as fj,fIe as fk,p6 as fl,T6 as fm,pdi as fn,sQe as fo,IC as fp,Ro as fq,T8e as fr,tr as fs,I8e as ft,BSe as fu,tm as fv,Uc as fw,RP as fx,E_i as fy,lHe as fz,v as g,u_i as g$,Gc as g0,cE as g1,h_i as g2,mie as g3,o_i as g4,a_i as g5,ik as g6,r_i as g7,d_i as g8,FAt as g9,U6t as gA,Nyi as gB,sge as gC,C3t as gD,E3t as gE,ky as gF,Iv as gG,jee as gH,mIe as gI,O7 as gJ,VRe as gK,aHe as gL,gwi as gM,pwi as gN,C_i as gO,Kw as gP,$Re as gQ,YZe as gR,b_i as gS,g_i as gT,vH as gU,_H as gV,m_i as gW,f_i as gX,t8 as gY,J7 as gZ,__i as g_,c_i as ga,Mt as gb,l_i as gc,Xs as gd,adi as ge,qRe as gf,Mr as gg,ri as gh,aut as gi,Kn as gj,MW as gk,afi as gl,Hve as gm,yy as gn,dwi as go,q8 as gp,kZe as gq,cf as gr,lUt as gs,wp as gt,Kbi as gu,jmt as gv,wfi as gw,Pyi as gx,b4t as gy,R3e as gz,Ue as h,ICi as h$,rQe as h0,m_ as h1,gk as h2,lV as h3,llt as h4,xW as h5,Cfi as h6,Em as h7,L8e as h8,sn as h9,ret as hA,cee as hB,h3t as hC,pme as hD,_fi as hE,Pwt as hF,wI as hG,TWe as hH,OA as hI,q9 as hJ,Awt as hK,bZe as hL,j3 as hM,In as hN,_n as hO,_y as hP,Sd as hQ,Ugi as hR,Zu as hS,Bl as hT,co as hU,ba as hV,rk as hW,Gn as hX,Oge as hY,fX as hZ,B6t as h_,$_i as ha,zj as hb,Sy as hc,GO as hd,hdi as he,nki as hf,hHe as hg,uHe as hh,OW as hi,Mvi as hj,dX as hk,YE as hl,On as hm,uMe as hn,pH as ho,xl as hp,JXe as hq,W as hr,xt as hs,Co as ht,Dfi as hu,xfi as hv,idi as hw,Wj as hx,Zf as hy,Ike as hz,tn as i,Vvi as i$,wee as i0,EEi as i1,NXe as i2,fw as i3,Zr as i4,rPt as i5,M6 as i6,on as i7,jQ as i8,Not as i9,Rct as iA,Qvi as iB,Zvi as iC,Gvi as iD,te as iE,$ve as iF,qae as iG,FW as iH,M_i as iI,W_ as iJ,Xae as iK,SE as iL,qJ as iM,WOt as iN,UOt as iO,CHe as iP,efe as iQ,JJe as iR,H_i as iS,VOt as iT,zvi as iU,Cy as iV,Yvi as iW,Jvi as iX,AC as iY,Dl as iZ,iZ as i_,nie as ia,r8e as ib,Vpi as ic,PDi as id,MD as ie,y1 as ig,Ls as ih,bHe as ii,Fv as ij,zY as ik,yHe as il,$D as im,fNt as io,hw as ip,bOt as iq,XJe as ir,SNt as is,Ht as it,Pce as iu,Wb as iv,B_i as iw,k2 as ix,KZ as iy,th as iz,Dn as j,MAt as j$,Uvi as j0,$vi as j1,Xvi as j2,xEi as j3,ip as j4,TEi as j5,xHe as j6,wwi as j7,Voe as j8,Ks as j9,Hmi as jA,x2 as jB,Wve as jC,Umi as jD,Bve as jE,$mi as jF,zmi as jG,GQ as jH,rHe as jI,Gmi as jJ,Kmi as jK,Vmi as jL,Wmt as jM,n4e as jN,DEi as jO,A$e as jP,t0e as jQ,vp as jR,iHe as jS,Wmi as jT,nHe as jU,Bmi as jV,sHe as jW,qmi as jX,Xmi as jY,zZe as jZ,Mmi as j_,ONt as ja,P8e as jb,mH as jc,zp as jd,pg as je,KE as jf,xg as jg,$r as jh,EHe as ji,rwi as jj,swi as jk,hF as jl,d0 as jm,nk as jn,Ew as jo,FOt as jp,al as jq,WKe as jr,rr as js,ult as jt,U_i as ju,UM as jv,Ot as jw,xj as jx,EOt as jy,Qmi as jz,eK as k,Tri as k$,Omi as k0,T3e as k1,iP as k2,Fmi as k3,xdi as k4,g4t as k5,a5e as k6,uCi as k7,Hvi as k8,ewi as k9,i_i as kA,Kk as kB,P_i as kC,A_i as kD,Xd as kE,Mi as kF,qZe as kG,jmi as kH,oP as kI,CKe as kJ,Qv as kK,zgi as kL,Tr as kM,mwi as kN,_wi as kO,p_i as kP,jZe as kQ,e8 as kR,w_i as kS,v_i as kT,MB as kU,sri as kV,awi as kW,owi as kX,S_i as kY,zRe as kZ,yIe as k_,twi as ka,iwi as kb,nwi as kc,qvi as kd,jvi as ke,Kvi as kf,pr as kg,N_i as kh,gw as ki,Lyi as kj,Tyi as kk,Aoe as kl,Rpi as km,sk as kn,J$ as ko,Ymi as kp,Jmi as kq,Zmi as kr,Fn as ks,or as kt,$Pe as ku,h$t as kv,gB as kw,rTt as kx,t_i as ky,e_i as kz,UCi as l,EI as l$,JP as l0,rmt as l1,bKe as l2,vb as l3,vy as l4,G4 as l5,hlt as l6,Qg as l7,odt as l8,JLt as l9,Gf as lA,Vt as lB,oe as lC,XQe as lD,Fh as lE,qe as lF,RSe as lG,zCe as lH,Xh as lI,$1 as lJ,v1e as lK,ys as lL,M7 as lM,Yu as lN,JB as lO,Kl as lP,XLt as lQ,Ah as lR,yi as lS,Vo as lT,kyt as lU,Tyt as lV,put as lW,ylt as lX,mbi as lY,$Zt as lZ,_bi as l_,v_ as la,nH as lb,q4 as lc,yfi as ld,Sfi as le,XXe as lf,Z4 as lg,EQ as lh,So as li,pe as lj,psi as lk,R1e as ll,zi as lm,QXe as ln,Dm as lo,iAt as lp,flt as lq,smt as lr,Lme as ls,e1t as lt,pae as lu,ege as lv,WNt as lw,ydi as lx,bdi as ly,zZt as lz,ar as m,kt as m$,NHt as m0,tdi as m1,bo as m2,Sc as m3,Iye as m4,g_ as m5,REi as m6,gf as m7,kD as m8,QUe as m9,Gje as mA,Kje as mB,wF as mC,Ph as mD,kE as mE,Ext as mF,zNt as mG,Zv as mH,wdi as mI,zs as mJ,Ad as mK,Zk as mL,ou as mM,Rdt as mN,jJt as mO,ASe as mP,rf as mQ,iM as mR,JJt as mS,eei as mT,Bd as mU,Hoe as mV,Gp as mW,gei as mX,zu as mY,W7e as mZ,zSi as m_,vNt as ma,Yb as mb,fHt as mc,cbi as md,dbi as me,LC as mf,E5 as mg,W_i as mh,Vqe as mi,Ni as mj,IJ as mk,N8e as ml,K4 as mm,dSe as mn,gFt as mo,sht as mp,Swi as mq,F_i as mr,tfe as ms,_Nt as mt,kN as mu,Pt as mv,he as mw,ce as mx,C_ as my,xI as mz,Y1e as n,GI as n$,nbi as n0,T2 as n1,Bj as n2,uBt as n3,mmt as n4,GSi as n5,iye as n6,C1 as n7,Fy as n8,Aae as n9,Hd as nA,ymt as nB,OGe as nC,ok as nD,Nfi as nE,Pfi as nF,PKe as nG,Fft as nH,Efi as nI,jgi as nJ,$gi as nK,Lfi as nL,Xmt as nM,Rfi as nN,Lh as nO,cgi as nP,DKe as nQ,Mfi as nR,agi as nS,$f as nT,vfi as nU,$ge as nV,lw as nW,vwi as nX,Mc as nY,_w as nZ,Qa as n_,qo as na,gX as nb,$Si as nc,qSi as nd,$ae as ne,et as nf,fTt as ng,mQe as nh,NQ as ni,Hgi as nj,Wvi as nk,T0t as nl,vZe as nm,Vgi as nn,z0e as no,ig as np,ru as nq,soe as nr,nri as ns,sAe as nt,vbi as nu,xVt as nv,uX as nw,Afi as nx,IKe as ny,gdi as nz,DPe as o,uLt as o$,bYe as o0,jge as o1,aE as o2,P_ as o3,Ys as o4,yd as o5,hr as o6,Eae as o7,ol as o8,I as o9,hQe as oA,nw as oB,UIt as oC,c1 as oD,zS as oE,BQe as oF,lQe as oG,epi as oH,Tnt as oI,fi as oJ,uf as oK,lf as oL,oee as oM,q5e as oN,Rnt as oO,vae as oP,tRe as oQ,iLt as oR,LQe as oS,lRe as oT,hLt as oU,PQe as oV,Il as oW,GIt as oX,dQ as oY,cpi as oZ,cRe as o_,NX as oa,b2 as ob,n0 as oc,vF as od,A4e as oe,vw as of,Oqe as og,b0e as oh,yj as oi,hI as oj,cl as ok,jA as ol,ek as om,fm as on,YCe as oo,act as op,V3 as oq,QP as or,h7 as os,wX as ot,ree as ou,z5e as ov,aQ as ow,gQe as ox,fQe as oy,uQe as oz,bp as p,K5 as p$,ku as p0,wae as p1,rRe as p2,DQe as p3,xh as p4,Vg as p5,AQe as p6,dLt as p7,fLt as p8,lLt as p9,Dv as pA,BHe as pB,Vu as pC,s8 as pD,r8 as pE,XNt as pF,c0 as pG,dJe as pH,wf as pI,fdi as pJ,wH as pK,Yat as pL,YRe as pM,mg as pN,Px as pO,Y_i as pP,Z_i as pQ,jNt as pR,OHe as pS,J_i as pT,evi as pU,sMt as pV,FHe as pW,MHe as pX,dE as pY,OJe as pZ,aee as p_,cLt as pa,JPt as pb,vhe as pc,aje as pd,ffi as pe,ufi as pf,i4e as pg,T3t as ph,Hke as pi,G9 as pj,RE as pk,Iy as pl,SC as pm,Tfi as pn,Znt as po,lme as pp,Dle as pq,jae as pr,WHe as ps,Op as pt,Q_i as pu,kWe as pv,Nf as pw,YNt as px,y_i as py,RC as pz,f as q,Bu as q$,D3e as q0,y4t as q1,c_ as q2,Aki as q3,ifi as q4,gI as q5,qY as q6,bI as q7,l5e as q8,gNt as q9,Uj as qA,uet as qB,cMt as qC,Sz as qD,oht as qE,Ovi as qF,Bvi as qG,D7e as qH,gH as qI,Dw as qJ,iV as qK,wm as qL,Jke as qM,tIe as qN,Qke as qO,eIe as qP,iIe as qQ,Zke as qR,sIe as qS,nIe as qT,rIe as qU,aIe as qV,qOt as qW,zOt as qX,lIe as qY,Lpi as qZ,ygi as q_,O_ as qa,J6 as qb,E6 as qc,sCi as qd,Fvi as qe,ILe as qf,yW as qg,zDe as qh,$De as qi,qDe as qj,GDe as qk,VDe as ql,UDe as qm,YDe as qn,Qk as qo,hX as qp,yt as qq,tD as qr,Nh as qs,TX as qt,Vs as qu,dpe as qv,odi as qw,Kd as qx,jZ as qy,gPe as qz,TUt as r,Ol as r$,Y6 as r0,b0 as r1,ez as r2,jRe as r3,u5e as r4,Nnt as r5,xFe as r6,e3t as r7,qsi as r8,t3t as r9,um as rA,BI as rB,_E as rC,Wyi as rD,Fa as rE,I4t as rF,T4t as rG,Uyi as rH,sm as rI,Fe as rJ,Ooe as rK,x1e as rL,D1e as rM,w1e as rN,k1e as rO,I1e as rP,bpt as rQ,Kfe as rR,nKe as rS,z4 as rT,dKe as rU,up as rV,hc as rW,l6 as rX,dB as rY,$yi as rZ,$ze as r_,w0t as ra,Kae as rb,udi as rc,$fe as rd,zfe as re,ju as rf,iu as rg,Hn as rh,hd as ri,Hyi as rj,sE as rk,BE as rl,m9 as rm,Re as rn,tf as ro,_c as rp,Vyi as rq,R4t as rr,yo as rs,u1 as rt,Jft as ru,zk as rv,Z$ as rw,Hr as rx,Rd as ry,Wa as rz,_ee as s,SHe as s$,Kyi as s0,Gyi as s1,jyi as s2,Yyi as s3,Xyi as s4,Jyi as s5,Zyi as s6,Qyi as s7,m5e as s8,N4t as s9,Fxi as sA,Rpe as sB,DA as sC,z1 as sD,pfi as sE,pKe as sF,bUt as sG,OZe as sH,eN as sI,die as sJ,ZJe as sK,f5e as sL,ywt as sM,zve as sN,Fit as sO,kdi as sP,x as sQ,Vn as sR,SP as sS,G_i as sT,cte as sU,JQe as sV,O_i as sW,s_i as sX,n_i as sY,V_i as sZ,yNt as s_,QSe as sa,ldi as sb,yte as sc,bte as sd,sSi as se,v5e as sf,Ye as sg,pW as sh,WP as si,bl as sj,pJt as sk,mJt as sl,Zhe as sm,bbt as sn,_B as so,Wgi as sp,Bgi as sq,kI as sr,Nki as ss,Mki as st,eci as su,QJe as sv,yPt as sw,Bf as sx,Pki as sy,nze as sz,ke as t,q_i as t0,wlt as t1,jh as t2,Fdt as t3,p7 as t4,sv as t5,z_i as t6,jde as t7,pN as t8,IL as t9,D8 as ta,v0e as tb,ci as tc,eze as td,toe as te,CA as tf,vdi as tg,sze as th,Wxi as ti,Bxi as tj,Oxi as tk,Hxi as tl,Vxi as tm,Uxi as tn,Mxi as to,Cki as tp,nh as u,hwt as v,Na as w,mi as x,ao as y,Rt as z};
|
|
1314
|
+
- the second one at the same indentation level`),f(5653,"Insert new line and outdent once (relative to the previous line's indentation).")]},appendText:{type:"string",description:f(5654,"Describes text to be appended after the new line and after the indentation."),default:""},removeText:{type:"number",description:f(5655,"Describes the number of characters to remove from the new line's indentation."),default:0}}}}}}}},Cci=mt.as(UI.JSONContribution);Cci.registerSchema(yci,Sci);var p2;let Hie=(p2=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(oLe)}},p2.ID="workbench.contrib.languageConfigurationExtensionPoint",p2);Hie=y([v(0,Oe)],Hie);sg(Hie.ID,Hie,Ul.BlockStartup);function Eci(){return{...vPe(),[tn.toString()]:new Ji(oEe,[],!1),[Kae.toString()]:new Ji(bci,[],!0)}}function xci(n){return!!n.textEditorModel}let aLe=class extends V{constructor(e,t,i){super(),this._modelService=e,this._textModelService=t,this._undoRedoService=i,this._register(this._modelService.onModelRemoved(s=>{const r=this._undoRedoService.getElements(s.uri);if(!(r.past.length===0&&r.future.length===0)){for(const o of r.past)o instanceof jge&&o.setDelegate(this);for(const o of r.future)o instanceof jge&&o.setDelegate(this)}}))}prepareUndoRedo(e){const t=e.getMissingModels();if(t.length===0)return V.None;const i=t.map(async s=>{try{return await this._textModelService.createModelReference(s)}catch{return V.None}});return Promise.all(i).then(s=>({dispose:()=>zt(s)}))}};aLe=y([v(0,on),v(1,hr),v(2,GI)],aLe);let lLe=class extends klt{constructor(e,t,i,s){super(),this.instantiationService=e,this.textFileService=t,this.fileService=i,this.modelService=s,this.providers=new Map,this.modelsToDispose=new Set}createReferencedObject(e){return this.doCreateReferencedObject(e)}async doCreateReferencedObject(e,t){this.modelsToDispose.delete(e);const i=N.parse(e);if(i.scheme===ye.inMemory){if(!this.modelService.getModel(i))throw new Error(`Unable to resolve inMemory resource ${e}`);const r=this.instantiationService.createInstance(V8,i);if(this.ensureResolvedModel(r,e))return r}if(i.scheme===ye.untitled){const s=await this.textFileService.untitled.resolve({untitledResource:i});if(this.ensureResolvedModel(s,e))return s}if(this.fileService.hasProvider(i)){const s=await this.textFileService.files.resolve(i,{reason:D8.REFERENCE});if(this.ensureResolvedModel(s,e))return s}if(this.providers.has(i.scheme)){await this.resolveTextModelContent(e);const s=this.instantiationService.createInstance(V8,i);if(this.ensureResolvedModel(s,e))return s}if(!t)return await this.fileService.activateProvider(i.scheme),this.doCreateReferencedObject(e,!0);throw new Error(`Unable to resolve resource ${e}`)}ensureResolvedModel(e,t){if(xci(e))return!0;throw new Error(`Unable to resolve resource ${t}`)}destroyReferencedObject(e,t){N.parse(e).scheme!==ye.inMemory&&(this.modelsToDispose.add(e),(async()=>{try{const s=await t;if(!this.modelsToDispose.has(e)||(s instanceof TJ?await this.textFileService.files.canDispose(s):s instanceof IJ&&await this.textFileService.untitled.canDispose(s),!this.modelsToDispose.has(e)))return;s.dispose()}catch{}finally{this.modelsToDispose.delete(e)}})())}registerTextModelContentProvider(e,t){let i=this.providers.get(e);return i||(i=[],this.providers.set(e,i)),i.unshift(t),ke(()=>{const s=this.providers.get(e);if(!s)return;const r=s.indexOf(t);r!==-1&&(s.splice(r,1),s.length===0&&this.providers.delete(e))})}hasTextModelContentProvider(e){return this.providers.get(e)!==void 0}async resolveTextModelContent(e){const t=N.parse(e),i=this.providers.get(t.scheme)||[];for(const s of i){const r=await s.provideTextContent(t);if(r)return r}throw new Error(`Unable to resolve text model content for resource ${e}`)}};lLe=y([v(0,Oe),v(1,Qa),v(2,rn),v(3,on)],lLe);let cLe=class extends V{get resourceModelCollection(){return this._resourceModelCollection||(this._resourceModelCollection=this.instantiationService.createInstance(lLe)),this._resourceModelCollection}get asyncModelCollection(){return this._asyncModelCollection||(this._asyncModelCollection=new Ilt(this.resourceModelCollection)),this._asyncModelCollection}constructor(e,t,i,s,r){super(),this.instantiationService=e,this.fileService=t,this.undoRedoService=i,this.modelService=s,this.uriIdentityService=r,this._resourceModelCollection=void 0,this._asyncModelCollection=void 0,this._register(new aLe(this.modelService,this,this.undoRedoService))}async createModelReference(e){return e=this.uriIdentityService.asCanonicalUri(e),await this.asyncModelCollection.acquire(e.toString())}registerTextModelContentProvider(e,t){return this.resourceModelCollection.registerTextModelContentProvider(e,t)}canHandleResource(e){return this.fileService.hasProvider(e)||e.scheme===ye.untitled||e.scheme===ye.inMemory?!0:this.resourceModelCollection.hasTextModelContentProvider(e.scheme)}};cLe=y([v(0,Oe),v(1,rn),v(2,GI),v(3,on),v(4,or)],cLe);function Dci(){return{[hr.toString()]:new Ji(cLe,[],!0)}}const Zat=n=>{const e=Jat(),t=(i,s)=>{n.logger?.info(`getWorker: moduleId: ${i} label: ${s}`);const r=n.workerLoaders?.[s]??void 0;if(r===void 0)throw new Error(`Unimplemented worker ${s} (${i})`);return r()};e.getWorker=n.getWorkerOverride??t},Jat=()=>{const n=self;n.MonacoEnvironment===void 0&&(n.MonacoEnvironment={});const e=n.MonacoEnvironment;return e.vscodeApiInitialised===void 0&&(e.vscodeApiInitialised=!1),e.vscodeInitialising===void 0&&(e.vscodeInitialising=!1),e},kci=async()=>({...wci(),...Eci(),...bli(),...Dci()}),Ici=(n,e)=>{for(const t of Object.keys(n))e?.debug(`Loading service: ${t}`)},x0=(n,e)=>{if(e!==void 0)for(const[t,i]of Object.entries(e))n[t]=i},Tci=async(n,e)=>{const t=Jat();return typeof e?.monacoWorkerFactory=="function"?e.monacoWorkerFactory(e.logger):Zat({logger:e?.logger}),(t.vscodeInitialising??!1)||(t.vscodeApiInitialised??!1?e?.logger?.debug("Initialization of vscode services can only performed once!"):(t.vscodeInitialising=!0,e?.logger?.debug(`Initializing vscode services. Caller: ${e.caller??"unknown"}`),n.userConfiguration?.json!==void 0&&await _ci(n.userConfiguration.json),await Lci(n,e),n.viewsConfig?.htmlAugmentationInstructions?.(e?.htmlContainer),await n.viewsConfig?.viewsInitFunc?.(),e?.logger?.debug("Initialization of vscode services completed successfully."),t.vscodeApiInitialised=!0,t.vscodeInitialising=!1)),t.vscodeApiInitialised},Lci=async(n,e)=>{const t=await kci();x0(t,n.serviceOverrides),await Rci(n.enableExtHostWorker===!0,t),Ici(t,e?.logger),(e?.performServiceConsistencyChecks===void 0||typeof e.performServiceConsistencyChecks=="function"&&e.performServiceConsistencyChecks())&&(n.viewsConfig?.viewServiceType==="ViewsService"||n.viewsConfig?.viewServiceType==="WorkspaceService"?await M8e(t,e?.htmlContainer,n.workspaceConfig,n.envOptions):await M8e(t,void 0,n.workspaceConfig,n.envOptions)),_j(i=>{e?.logger?.createErrorAndLog("Unexpected error",i)})},Rci=async(n,e)=>{if(n){const t=new Mli(new URL(""+new URL("extensionHost.worker-otoVBpHF.js",import.meta.url).href,import.meta.url),{type:"module"}),i={url:t.url.toString(),options:t.options};x0(e,{...mrt(i)})}},Aci=async(n,e)=>{const t=e.vscodeApiConfig,i=t.serviceOverrides??{};return await Pci(n,i),await Nci(i,t.viewsConfig),Mci(t),Oci(t,e.logLevel),Fci(t,e.semanticHighlighting),t.serviceOverrides=i,t},Pci=async(n,e)=>{if(n==="extended"){const t=(await Kv(async()=>{const{default:s}=await import("./index-BMTVGxzX.js");return{default:s}},__vite__mapDeps([0,1,2,3]),import.meta.url)).default,i=(await Kv(async()=>{const{default:s}=await import("./index-DqIUrgd9.js");return{default:s}},__vite__mapDeps([4,2,1]),import.meta.url)).default;x0(e,{...t(),...i()})}else{const t=(await Kv(async()=>{const{default:i}=await import("./index-BfLChBOe.js");return{default:i}},__vite__mapDeps([5,6]),import.meta.url)).default;x0(e,{...t()})}},Nci=async(n,e)=>{if(e?.viewServiceType==="ViewsService"){const t=(await Kv(async()=>{const{default:i}=await import("./index-B9LREvGB.js");return{default:i}},__vite__mapDeps([7,8,9,10,1,11,12]),import.meta.url)).default;x0(n,{...t(e.openEditorFunc??uze)})}else if(e?.viewServiceType==="WorkspaceService"){const t=(await Kv(async()=>{const{default:i}=await import("./index-Ca2GOtQx.js");return{default:i}},__vite__mapDeps([13,8,9,10,1,11,14]),import.meta.url)).default;x0(n,{...t()})}else{const t=(await Kv(async()=>{const{default:i}=await import("./index-BpdMCZU7.js");return{default:i}},__vite__mapDeps([15,9,10,12]),import.meta.url)).default;x0(n,{...t(e?.openEditorFunc??uze)})}},Mci=n=>{n.workspaceConfig===void 0&&(n.workspaceConfig={workspaceProvider:{trusted:!0,workspace:{workspaceUri:hNe.file("/workspace.code-workspace")},async open(){return window.open(window.location.href),!0}}})},Oci=(n,e)=>{const t=n.workspaceConfig.developmentOptions?.logLevel;if(t===void 0){const i={...n.workspaceConfig.developmentOptions};i.logLevel=e,n.workspaceConfig.developmentOptions=Object.assign({},i)}else if(t!==e)throw new Error(`You have configured mismatching logLevels: ${e} (wrapperConfig) ${t} (workspaceConfig.developmentOptions)`)},Fci=(n,e)=>{if(e??!1){const t={...n.workspaceConfig.configurationDefaults};t["editor.semanticHighlighting.enabled"]=!0,n.workspaceConfig.configurationDefaults=Object.assign({},t)}},uze=async(n,e,t)=>{console.log("Received open editor call with parameters: ",n,e,t)},Wci=n=>{const e=Object.keys(n??{}).includes("themeService"),t=Object.keys(n??{}).includes("textMateTokenizationFeature"),i=Object.keys(n??{}).includes("markersService"),s=Object.keys(n??{}).includes("viewsService");if(e&&!t)throw new Error('"theme" service requires "textmate" service. Please add it to the "userServices".');if(i&&!s)throw new Error('"markers" service requires "views" service. Please add it to the "userServices".');return!0};class Bci{id;editorApp;extensionRegisterResults=new Map;disposableStore=new ie;languageClientWrappers=new Map;wrapperConfig;logger=new yli;initAwait;initResolve;startingAwait;startingResolve;disposingAwait;disposingResolve;async init(e){this.isInitializing()&&await this.getInitializingAwait();const t=e.editorAppConfig;if((t?.useDiffEditor??!1)&&!t?.codeResources?.original)throw new Error(`Use diff editor was used without a valid config. code: ${t?.codeResources?.modified} codeOriginal: ${t?.codeResources?.original}`);const i=e.vscodeApiConfig?.viewsConfig?.viewServiceType??"EditorService";if(e.$type==="classic"&&(i==="ViewsService"||i==="WorkspaceService"))throw new Error(`View Service Type "${i}" cannot be used with classic configuration.`);if(e.automaticallyDispose??!0)await this.dispose();else if(this.wrapperConfig!==void 0)throw new Error("You configured the wrapper to not automatically dispose on init, but did not dispose manually. Please call dispose first if you want to re-start.");try{this.markInitializing(),this.id=e.id??Math.floor(Math.random()*1000001).toString(),this.logger.setLevel(e.logLevel??Pt.Off),e.vscodeApiConfig?.vscodeApiInitPerformExternally!==!0&&(e.vscodeApiConfig=await Aci(e.$type,{vscodeApiConfig:e.vscodeApiConfig??{},logLevel:this.logger.getLevel(),semanticHighlighting:e.editorAppConfig?.editorOptions?.["semanticHighlighting.enabled"]===!0}),await Tci(e.vscodeApiConfig,{monacoWorkerFactory:e.editorAppConfig?.monacoWorkerFactory,htmlContainer:e.htmlContainer,caller:`monaco-editor (${this.id})`,performServiceConsistencyChecks:Wci,logger:this.logger})),this.wrapperConfig=e,(this.wrapperConfig.languageClientConfigs?.automaticallyInit??!0)&&this.initLanguageClients(),await this.initExtensions(),this.editorApp=new Goi(this.wrapperConfig.$type,this.id,this.wrapperConfig.editorAppConfig,this.logger),await this.editorApp.init()}catch(s){throw s}finally{this.markInitialized()}}initLanguageClients(){const e=Object.entries(this.wrapperConfig?.languageClientConfigs?.configs??{});if(e.length>0)for(const[t,i]of e){const s=new Nli({languageClientConfig:i,logger:this.logger});this.languageClientWrappers.set(t,s)}}async initExtensions(){const e=this.wrapperConfig?.vscodeApiConfig;this.wrapperConfig?.$type==="extended"&&(e?.loadThemes===void 0||e.loadThemes===!0)&&await Kv(()=>import("./index-CzmSOBI6.js"),[],import.meta.url);const t=this.wrapperConfig?.extensions;if(this.wrapperConfig?.extensions){const i=[],s=[];kUt().forEach(r=>{s.push(r.identifier.id)});for(const r of t??[])if(!s.includes(`${r.config.publisher}.${r.config.name}`)){const o=r.config,a=TUt(o,An.LocalProcess);if(this.extensionRegisterResults.set(o.name,a),r.filesOrContents&&Object.hasOwn(a,"registerFileUrl"))for(const l of r.filesOrContents)this.disposableStore.add(a.registerFileUrl(l[0],Koi(l[1])));i.push(a.whenReady())}await Promise.all(i)}}markInitializing(){this.initAwait=new Promise(e=>{this.initResolve=e})}markInitialized(){this.initResolve(),this.initAwait=void 0}isInitializing(){return this.initAwait!==void 0}getInitializingAwait(){return this.initAwait}getWrapperConfig(){return this.wrapperConfig}getExtensionRegisterResult(e){return this.extensionRegisterResults.get(e)}async initAndStart(e){await this.init(e),await this.start()}async start(e){if(this.isStarting()&&await this.getStartingAwait(),this.wrapperConfig===void 0)throw new Error("No init was performed. Please call init() before start()");this.markStarting();try{const t=this.wrapperConfig.vscodeApiConfig?.viewsConfig?.viewServiceType;if(t==="EditorService"||t===void 0){this.logger.info(`Starting monaco-editor (${this.id})`);const i=e===void 0?this.wrapperConfig.htmlContainer:e;if(i===void 0)throw new Error("No html container provided. Unable to start monaco-editor.");await this.editorApp?.createEditors(i)}else this.logger.info("No EditorService configured. monaco-editor will not be started.");(this.wrapperConfig.languageClientConfigs?.automaticallyStart??!0)&&await this.startLanguageClients()}catch(t){throw t}finally{this.markStarted()}}async startLanguageClients(){const e=[];for(const t of this.languageClientWrappers.values())e.push(t.start());return Promise.all(e)}markStarting(){this.startingAwait=new Promise(e=>{this.startingResolve=e})}markStarted(){this.startingResolve(),this.startingAwait=void 0}isStarting(){return this.startingAwait!==void 0}getStartingAwait(){return this.startingAwait}isStarted(){if(!(this.editorApp?.haveEditor()??!1))return!1;for(const e of this.languageClientWrappers.values())if(e.haveLanguageClient()&&!e.isStarted())return!1;return!0}haveLanguageClients(){return this.languageClientWrappers.size>0}getEditorApp(){return this.editorApp}getEditor(){return this.editorApp?.getEditor()}getDiffEditor(){return this.editorApp?.getDiffEditor()}getLanguageClientWrapper(e){return this.languageClientWrappers.get(e)}getLanguageClient(e){return this.languageClientWrappers.get(e)?.getLanguageClient()}getTextModels(){return this.editorApp?.getTextModels()}getWorker(e){return this.languageClientWrappers.get(e)?.getWorker()}getLogger(){return this.logger}async updateCodeResources(e){return this.editorApp?.updateCodeResources(e)}registerTextChangedCallback(e){this.editorApp?.registerOnTextChangedCallbacks(e)}reportStatus(){const e=[];return e.push("Wrapper status:"),e.push(`Editor: ${this.editorApp?.getEditor()?.getId()}`),e.push(`DiffEditor: ${this.editorApp?.getDiffEditor()?.getId()}`),e}async dispose(){this.isDisposing()&&await this.getDisposingAwait(),this.markDisposing(),await this.editorApp?.dispose(),this.editorApp=void 0,this.extensionRegisterResults.forEach(e=>e.dispose()),this.disposableStore.dispose(),this.disposableStore=new ie;try{(this.wrapperConfig?.languageClientConfigs?.automaticallyDispose??!0)&&await this.disposeLanguageClients()}catch(e){throw e}finally{this.languageClientWrappers.clear(),this.wrapperConfig=void 0,this.markDisposed()}}async disposeLanguageClients(){const e=this.wrapperConfig?.languageClientConfigs?.automaticallyDisposeWorkers??!1,t=[];for(const i of this.languageClientWrappers.values())i.haveLanguageClient()&&t.push(i.disposeLanguageClient(e));return Promise.all(t)}markDisposing(){this.disposingAwait=new Promise(e=>{this.disposingResolve=e})}markDisposed(){this.disposingResolve(),this.disposingAwait=void 0}isDisposing(){return this.disposingAwait!==void 0}getDisposingAwait(){return this.disposingAwait}updateLayout(){this.editorApp?.updateLayout()}}const Hci=()=>({TextEditorWorker:()=>new Worker(new URL(""+new URL("editor.worker-CIbPC0uE.js",import.meta.url).href,import.meta.url),{type:"module"}),TextMateWorker:()=>new Worker(new URL(""+new URL("worker-4ckq56fZ.js",import.meta.url).href,import.meta.url),{type:"module"}),OutputLinkDetectionWorker:void 0,LanguageDetectionWorker:void 0,NotebookEditorWorker:void 0,LocalFileSearchWorker:void 0}),Vci=n=>{Zat({workerLoaders:Hci(),logger:n})};var fze=Wat();function Uci(n,e){let t=null;return(...i)=>{t&&clearTimeout(t),t=setTimeout(()=>{n(...i),t=null},e)}}class $ci{MonacoEditorLanguageClientWrapper;constructor(e){this.MonacoEditorLanguageClientWrapper=e}createWrapper(){return new this.MonacoEditorLanguageClientWrapper}}class zci{wrapper;pendingMessages=[];theme="";contentChangeSubscribed=!1;wrapperInitialized=!1;dependencies;wrapperFactory;allowedOrigin="*";highlightName=!1;messageHandler;contentChangeDisposable;keyDownDisposable;INITIAL_RETRY_DELAY=50;MAX_RETRY_DELAY=1e3;MAX_RETRIES=20;MAX_PENDING_MESSAGES=100;CONTENT_CHANGE_DEBOUNCE_MS=300;constructor(e,t){this.dependencies=e,this.wrapperFactory=t||new $ci(e.MonacoEditorLanguageClientWrapper);let i=window.location.hash.slice(1);i&&(this.allowedOrigin=new URL(decodeURIComponent(i)).origin)}retryWithBackoff(e,t){let i=this.INITIAL_RETRY_DELAY,s=0;const r=()=>{if(!e()){if(s>=this.MAX_RETRIES){console.error("Max retries exceeded"),t?.();return}s++,i=Math.min(i*2,this.MAX_RETRY_DELAY),this.dependencies.setTimeout(r,i)}};r()}getWorkerScriptUrl(){return new this.dependencies.URL("../worker.js",this.dependencies.importMetaUrl)}getWrapper(){return this.wrapper}getPendingMessages(){return[...this.pendingMessages]}getTheme(){return this.theme}isContentChangeSubscribed(){return this.contentChangeSubscribed}isWrapperInitialized(){return this.wrapperInitialized}isValidTheme(e){return["xanoscript-dark","xanoscript-light"].includes(e)}applyCodeUpdate(e){const t=this.wrapper?.getEditor();t&&(t.setValue(e),this.highlightName&&requestAnimationFrame(()=>this.highlightSecondWord()))}applyTheme(e){this.isValidTheme(e)&&(this.theme=e,Xg.setTheme(e))}tryDequeueMessages(){const e=this.wrapper?.getEditor();if(!e&&this.pendingMessages.length>0){this.retryWithBackoff(()=>this.wrapper?.getEditor()?(this.tryDequeueMessages(),!0):!1);return}if(!e||this.pendingMessages.length===0)return;let t,i,s=!1;for(const r of this.pendingMessages)r.data?.code!==void 0&&r.data?.code!==null&&(t=r.data.code),r.data?.theme!==void 0&&this.isValidTheme(r.data.theme)&&(i=r.data.theme),r.data?.highlightName&&(s=!0);s&&(this.highlightName=!0),i!==void 0&&this.applyTheme(i),t!==void 0&&this.applyCodeUpdate(t),this.pendingMessages=[]}subscribeToEditorContentChanges(){const e=this.wrapper?.getEditor();if(!e&&!this.contentChangeSubscribed){this.retryWithBackoff(()=>this.wrapper?.getEditor()?(this.subscribeToEditorContentChanges(),!0):!1);return}if(!e||this.contentChangeSubscribed)return;const t=Uci(()=>{const i=e.getValue();this.postMessage({code:i})},this.CONTENT_CHANGE_DEBOUNCE_MS);this.contentChangeDisposable=e.onDidChangeModelContent(t),e.focus(),this.contentChangeSubscribed=!0}async handleMessage(e){if(e.origin!==this.allowedOrigin&&this.allowedOrigin!=="*")return;const t=e.data?.theme;if(t&&!this.wrapperInitialized){this.isValidTheme(t)&&(this.theme=t),this.wrapperInitialized=!0,await this.initializeEditor();return}if(!this.wrapper?.getEditor()){this.pendingMessages.length>=this.MAX_PENDING_MESSAGES&&this.pendingMessages.shift(),this.pendingMessages.push(e);return}t&&this.applyTheme(t),e.data?.highlightName&&(this.highlightName=!0);const s=e.data?.code;s!=null&&this.applyCodeUpdate(s)}setWrapperFactory(e){this.wrapperFactory=e}setWrapper(e){this.wrapper=e}async initializeEditor(){try{const e=new this.dependencies.Worker(this.getWorkerScriptUrl(),{type:"module",name:"XanoScript Language Server Worker"}),t=new this.dependencies.BrowserMessageReader(e),i=new this.dependencies.BrowserMessageWriter(e),s={configs:{xanoscript:{clientOptions:{documentSelector:["xanoscript"]},connection:{options:{$type:"WorkerConfig",url:this.getWorkerScriptUrl(),type:"module"},messageTransports:{reader:t,writer:i}}}}};this.wrapper=this.wrapperFactory.createWrapper();const r={$type:"classic",htmlContainer:this.dependencies.document.getElementById("monaco-editor"),editorAppConfig:{codeResources:{modified:{uri:"/workspace/example.xs",text:""}},monacoWorkerFactory:this.dependencies.configureDefaultWorkerFactory,languageDef:{languageExtensionConfig:{id:"xanoscript",extensions:[".xs"],aliases:["XanoScript","xanoscript"],mimetypes:["text/xanoscript"]},theme:this.theme==="xanoscript-dark"?this.dependencies.darkTheme:this.dependencies.lightTheme},editorOptions:{language:"xanoscript","semanticHighlighting.enabled":!0,wordBasedSuggestions:"currentDocument",theme:this.theme,tabSize:2,insertSpaces:!0}},languageClientConfigs:s};await this.wrapper.initAndStart(r),Xg.defineTheme(this.dependencies.darkTheme.name,this.dependencies.darkTheme.data),Xg.defineTheme(this.dependencies.lightTheme.name,this.dependencies.lightTheme.data),this.keyDownDisposable=this.wrapper.getEditor().onKeyDown(o=>{o.metaKey&&o.code==="KeyS"?this.postMessage({command:"save"}):o.metaKey&&o.code==="KeyK"&&this.postMessage({command:"search"})}),this.wrapper.getEditor().getModel().updateOptions({tabSize:2}),this.tryDequeueMessages(),this.subscribeToEditorContentChanges(),this.postMessage({status:"ready"})}catch(e){if(String(e)?.startsWith("Error: Unable to figure out browser width and height"))return;throw console.error(e),e}}initialize(){this.messageHandler&&this.dependencies.window.removeEventListener("message",this.messageHandler),this.messageHandler=e=>{this.handleMessage(e).catch(console.error)},this.dependencies.window.addEventListener("message",this.messageHandler)}reset(){this.messageHandler&&(this.dependencies.window.removeEventListener("message",this.messageHandler),this.messageHandler=void 0),this.contentChangeDisposable?.dispose(),this.contentChangeDisposable=void 0,this.keyDownDisposable?.dispose(),this.keyDownDisposable=void 0,this.wrapper=void 0,this.pendingMessages=[],this.theme="",this.contentChangeSubscribed=!1,this.wrapperInitialized=!1,this.highlightName=!1}postMessage(e){this.dependencies.window.parent.postMessage(e,this.allowedOrigin)}highlightSecondWord(){const e=this.wrapper?.getEditor(),t=e?.getModel();if(!t)return;const i=t.getLineContent(1),s=i.trim().split(/\s+/);if(s.length<2)return;const r=s[1],o=i.indexOf(r)+1,a=new iZt(1,o,1,o+r.length);e.setSelection(a),e.focus()}}const elt=[{token:"bracket",foreground:"ffd700"},{token:"operator.openingCurly",foreground:"da70d6"},{token:"operator.closingCurly",foreground:"da70d6"},{token:"operator.openingSquare",foreground:"7a0528"},{token:"operator.closingSquare",foreground:"7a0528"},{token:"operator.openingParenthesis",foreground:"87ceeb"},{token:"operator.closingParenthesis",foreground:"87ceeb"},{token:"comment",foreground:"6a9955",fontStyle:"italic"},{token:"regexp",foreground:"d16969"},{token:"macro",foreground:"c586c0"},{token:"tripleMacro",foreground:"c586c0"}],qci=[{token:"keyword",foreground:"f390f6"},{token:"variable",foreground:"9cdcfe"},{token:"property",foreground:"9cdcfe"},{token:"method",foreground:"9cdcfe"},{token:"namespace",foreground:"9cdcfe"},{token:"function",foreground:"f9fe9c"},{token:"singleString",foreground:"ce9178",fontStyle:"italic"},{token:"doubleString",foreground:"ce9178",fontStyle:"italic"},{token:"tripleString",foreground:"ce9178",fontStyle:"italic"},{token:"operator",foreground:"d4d4d4"},{token:"punctuation",foreground:"d4d4d4"},{token:"enumMember",foreground:"bfe7aa"},{token:"number",foreground:"bfe7aa"},{token:"boolean",foreground:"569cd6"}],Gci=[{token:"keyword",foreground:"8a338d",fontStyle:"bold"},{token:"variable",foreground:"2d779fff"},{token:"property",foreground:"2d779fff"},{token:"namespace",foreground:"2d779fff"},{token:"method",foreground:"2d779fff"},{token:"function",foreground:"b46f00",fontStyle:"bold"},{token:"singleString",foreground:"a31515",fontStyle:"italic"},{token:"doubleString",foreground:"a31515",fontStyle:"italic"},{token:"tripleString",foreground:"a31515",fontStyle:"italic"},{token:"operator",foreground:"000000"},{token:"punctuation",foreground:"000000"},{token:"enumMember",foreground:"37ae6f"},{token:"number",foreground:"37ae6f"},{token:"boolean",foreground:"000000"}],Kci={"editor.foreground":"#24292e","editor.background":"#ffffff","editor.selectionBackground":"#bedbe0ff","editor.inactiveSelectionBackground":"#e0e0e0","editor.lineHighlightBackground":"#e0e0e0","editorCursor.foreground":"#24292e","editorWhitespace.foreground":"#959da5","editorIndentGuide.background":"#959da5","editorIndentGuide.activeBackground":"#24292e","editor.selectionHighlightBorder":"#e0e0e0"},jci={name:"xanoscript-dark",data:{base:"vs-dark",inherit:!0,rules:[...elt,...qci],colors:{}}},Yci={name:"xanoscript-light",data:{base:"vs",inherit:!0,rules:[...elt,...Gci],colors:Kci}},Xci={window:globalThis.window,document:globalThis.document,Worker:globalThis.Worker,setTimeout:globalThis.setTimeout,URL:globalThis.URL,importMetaUrl:import.meta.url,MonacoEditorLanguageClientWrapper:Bci,BrowserMessageReader:fze.BrowserMessageReader,BrowserMessageWriter:fze.BrowserMessageWriter,configureDefaultWorkerFactory:Vci,lightTheme:Yci,darkTheme:jci},Qci=new zci(Xci);Qci.initialize();export{k as $,En as A,sRt as B,epe as C,V as D,A as E,ef as F,mn as G,_di as H,Tae as I,zn as J,py as K,Jt as L,gn as M,me as N,it as O,cm as P,GE as Q,M as R,sr as S,$g as T,N as U,ur as V,Oe as W,sg as X,Ul as Y,_t as Z,Kv as _,zoe as a,Jpi as a$,ye as a0,lMt as a1,Et as a2,Me as a3,ui as a4,Sa as a5,RNe as a6,kl as a7,be as a8,ho as a9,Mgt as aA,mfi as aB,oYe as aC,dgi as aD,iae as aE,d0e as aF,k6 as aG,I6 as aH,vgt as aI,ze as aJ,Xi as aK,nu as aL,TM as aM,Hfe as aN,Jo as aO,mt as aP,m1e as aQ,zB as aR,qv as aS,RJ as aT,r0 as aU,Ka as aV,UI as aW,dRt as aX,cRt as aY,tmi as aZ,nmi as a_,Er as aa,qc as ab,Ds as ac,xn as ad,_i as ae,Je as af,spe as ag,Y as ah,Ie as ai,It as aj,se as ak,Ji as al,vPe as am,jbi as an,sh as ao,_s as ap,Kt as aq,qt as ar,H3 as as,Kr as at,wd as au,yC as av,eKe as aw,b1e as ax,Rv as ay,OOe as az,RSt as b,qB as b$,emi as b0,Df as b1,Dde as b2,Mh as b3,bS as b4,uWe as b5,Mgi as b6,Ogi as b7,m4 as b8,Sq as b9,rn as bA,fr as bB,cet as bC,Qae as bD,Si as bE,Ce as bF,ORe as bG,U6 as bH,Jn as bI,j6 as bJ,Lr as bK,Ge as bL,Dt as bM,Le as bN,Ci as bO,fo as bP,$ as bQ,CH as bR,qE as bS,nQ as bT,Jb as bU,oi as bV,$a as bW,ls as bX,wt as bY,Te as bZ,Li as b_,YGe as ba,WE as bb,Or as bc,ca as bd,Wt as be,ks as bf,Ct as bg,yBe as bh,ot as bi,imi as bj,LRe as bk,xZe as bl,lht as bm,gfi as bn,fRt as bo,pn as bp,p1e as bq,Dqe as br,hs as bs,ir as bt,KGe as bu,Nt as bv,cqe as bw,Wr as bx,Ki as by,U_ as bz,Xt as c,xWe as c$,Xr as c0,Nn as c1,F_ as c2,u7 as c3,bje as c4,WWe as c5,$We as c6,y5 as c7,eD as c8,c6 as c9,dd as cA,rH as cB,R_ as cC,$n as cD,YQ as cE,RD as cF,lQ as cG,yxe as cH,TGe as cI,tp as cJ,Ape as cK,Cgi as cL,af as cM,gZe as cN,ds as cO,oDt as cP,sdi as cQ,O as cR,Qr as cS,uwi as cT,hwi as cU,pw as cV,gg as cW,fc as cX,ne as cY,fwi as cZ,gm as c_,oF as ca,aF as cb,Cd as cc,Qsi as cd,zit as ce,mw as cf,oh as cg,Xa as ch,jn as ci,rh as cj,xi as ck,qa as cl,NC as cm,Hs as cn,l0 as co,gi as cp,El as cq,vn as cr,Yde as cs,jS as ct,ss as cu,nE as cv,x5 as cw,OJ as cx,dC as cy,bIe as cz,ie as d,uNt as d$,Tn as d0,pu as d1,ql as d2,t0 as d3,us as d4,fs as d5,MQ as d6,eQe as d7,zt as d8,Ir as d9,D_i as dA,I_i as dB,sPt as dC,tt as dD,$l as dE,tP as dF,Pae as dG,Ddi as dH,uo as dI,Vv as dJ,Ifi as dK,Kc as dL,Dr as dM,k_i as dN,ah as dO,j as dP,Da as dQ,cfi as dR,jf as dS,Q$ as dT,fp as dU,is as dV,ja as dW,lgi as dX,KJe as dY,dMt as dZ,dNt as d_,ue as da,Zi as db,Ne as dc,zl as dd,qpi as de,iQ as df,bi as dg,Wn as dh,Gl as di,Bs as dj,Vmt as dk,Jr as dl,na as dm,Zt as dn,Oo as dp,Nq as dq,jc as dr,dt as ds,rdi as dt,M1e as du,Egi as dv,g1e as dw,un as dx,qr as dy,eH as dz,y1t as e,rp as e$,kh as e0,nme as e1,rg as e2,$c as e3,rQ as e4,fKe as e5,as as e6,ia as e7,G0e as e8,i0 as e9,da as eA,Yvt as eB,Ao as eC,Kgi as eD,ym as eE,Oy as eF,srt as eG,og as eH,_j as eI,cdi as eJ,Q7 as eK,Ga as eL,qb as eM,cpe as eN,CD as eO,S7 as eP,_wt as eQ,Gpi as eR,f6 as eS,fu as eT,lI as eU,Rz as eV,ya as eW,i1 as eX,ofe as eY,j8 as eZ,y0 as e_,qbi as ea,Bmt as eb,Foe as ec,Ggi as ed,T_i as ee,L_i as ef,qn as eg,os as eh,Fmt as ei,Jsi as ej,nmt as ek,Vit as el,lg as em,II as en,zbi as eo,kfi as ep,EKe as eq,oy as er,XOe as es,$bi as et,vv as eu,Gt as ev,q0e as ew,zq as ex,BA as ey,hn as ez,y as f,Lmi as f$,KP as f0,Yp as f1,pm as f2,K8 as f3,wy as f4,vIe as f5,_Ie as f6,cwi as f7,mtt as f8,_v as f9,Nmi as fA,QZe as fB,jb as fC,x_i as fD,ea as fE,wc as fF,cQe as fG,wIe as fH,_We as fI,xa as fJ,rUt as fK,lwi as fL,NAt as fM,Wc as fN,ud as fO,Pmi as fP,md as fQ,Rmi as fR,Ami as fS,Wdt as fT,Cbt as fU,smi as fV,rmi as fW,ey as fX,XA as fY,yje as fZ,$fi as f_,kle as fa,GOt as fb,HDi as fc,Qfe as fd,qgi as fe,bfi as ff,hi as fg,mae as fh,v8e as fi,pI as fj,fIe as fk,p6 as fl,T6 as fm,pdi as fn,sQe as fo,IC as fp,Ro as fq,T8e as fr,tr as fs,I8e as ft,BSe as fu,tm as fv,Uc as fw,RP as fx,E_i as fy,lHe as fz,v as g,u_i as g$,Gc as g0,cE as g1,h_i as g2,mie as g3,o_i as g4,a_i as g5,ik as g6,r_i as g7,d_i as g8,FAt as g9,U6t as gA,Nyi as gB,sge as gC,C3t as gD,E3t as gE,ky as gF,Iv as gG,jee as gH,mIe as gI,O7 as gJ,VRe as gK,aHe as gL,gwi as gM,pwi as gN,C_i as gO,Kw as gP,$Re as gQ,YZe as gR,b_i as gS,g_i as gT,vH as gU,_H as gV,m_i as gW,f_i as gX,t8 as gY,J7 as gZ,__i as g_,c_i as ga,Mt as gb,l_i as gc,Xs as gd,adi as ge,qRe as gf,Mr as gg,ri as gh,aut as gi,Kn as gj,MW as gk,afi as gl,Hve as gm,yy as gn,dwi as go,q8 as gp,kZe as gq,cf as gr,lUt as gs,wp as gt,Kbi as gu,jmt as gv,wfi as gw,Pyi as gx,b4t as gy,R3e as gz,Ue as h,ICi as h$,rQe as h0,m_ as h1,gk as h2,lV as h3,llt as h4,xW as h5,Cfi as h6,Em as h7,L8e as h8,sn as h9,ret as hA,cee as hB,h3t as hC,pme as hD,_fi as hE,Pwt as hF,wI as hG,TWe as hH,OA as hI,q9 as hJ,Awt as hK,bZe as hL,j3 as hM,In as hN,_n as hO,_y as hP,Sd as hQ,Ugi as hR,Zu as hS,Bl as hT,co as hU,ba as hV,rk as hW,Gn as hX,Oge as hY,fX as hZ,B6t as h_,$_i as ha,zj as hb,Sy as hc,GO as hd,hdi as he,nki as hf,hHe as hg,uHe as hh,OW as hi,Mvi as hj,dX as hk,YE as hl,On as hm,uMe as hn,pH as ho,xl as hp,JXe as hq,W as hr,xt as hs,Co as ht,Dfi as hu,xfi as hv,idi as hw,Wj as hx,Zf as hy,Ike as hz,tn as i,Vvi as i$,EEi as i0,NXe as i1,wee as i2,fw as i3,Zr as i4,rPt as i5,M6 as i6,on as i7,jQ as i8,Not as i9,Rct as iA,Qvi as iB,Zvi as iC,Gvi as iD,te as iE,$ve as iF,qae as iG,FW as iH,M_i as iI,W_ as iJ,Xae as iK,SE as iL,qJ as iM,WOt as iN,UOt as iO,CHe as iP,efe as iQ,JJe as iR,H_i as iS,VOt as iT,zvi as iU,Cy as iV,Yvi as iW,Jvi as iX,AC as iY,Dl as iZ,iZ as i_,nie as ia,r8e as ib,Vpi as ic,PDi as id,y1 as ie,MD as ig,Ls as ih,bHe as ii,Fv as ij,zY as ik,yHe as il,$D as im,fNt as io,hw as ip,bOt as iq,XJe as ir,SNt as is,Ht as it,Pce as iu,Wb as iv,B_i as iw,k2 as ix,KZ as iy,th as iz,Dn as j,MAt as j$,Uvi as j0,$vi as j1,Xvi as j2,xEi as j3,ip as j4,TEi as j5,xHe as j6,wwi as j7,Voe as j8,Ks as j9,Hmi as jA,x2 as jB,Wve as jC,Umi as jD,Bve as jE,$mi as jF,zmi as jG,GQ as jH,rHe as jI,Gmi as jJ,Kmi as jK,Vmi as jL,Wmt as jM,n4e as jN,DEi as jO,A$e as jP,t0e as jQ,vp as jR,iHe as jS,Wmi as jT,nHe as jU,Bmi as jV,sHe as jW,qmi as jX,Xmi as jY,zZe as jZ,Mmi as j_,ONt as ja,P8e as jb,mH as jc,zp as jd,pg as je,KE as jf,xg as jg,$r as jh,EHe as ji,rwi as jj,swi as jk,hF as jl,d0 as jm,nk as jn,Ew as jo,FOt as jp,al as jq,WKe as jr,rr as js,ult as jt,U_i as ju,UM as jv,Ot as jw,xj as jx,EOt as jy,Qmi as jz,eK as k,Tri as k$,Omi as k0,T3e as k1,iP as k2,Fmi as k3,xdi as k4,g4t as k5,a5e as k6,uCi as k7,Hvi as k8,ewi as k9,i_i as kA,Kk as kB,P_i as kC,A_i as kD,Xd as kE,Mi as kF,qZe as kG,jmi as kH,oP as kI,CKe as kJ,zgi as kK,Qv as kL,Tr as kM,mwi as kN,_wi as kO,p_i as kP,jZe as kQ,e8 as kR,w_i as kS,v_i as kT,MB as kU,sri as kV,awi as kW,owi as kX,S_i as kY,zRe as kZ,yIe as k_,twi as ka,iwi as kb,nwi as kc,qvi as kd,jvi as ke,Kvi as kf,pr as kg,N_i as kh,gw as ki,Lyi as kj,Tyi as kk,Aoe as kl,Rpi as km,sk as kn,J$ as ko,Ymi as kp,Jmi as kq,Zmi as kr,Fn as ks,or as kt,$Pe as ku,h$t as kv,gB as kw,rTt as kx,t_i as ky,e_i as kz,UCi as l,EI as l$,JP as l0,rmt as l1,bKe as l2,vb as l3,vy as l4,G4 as l5,hlt as l6,Qg as l7,odt as l8,JLt as l9,Gf as lA,Vt as lB,oe as lC,XQe as lD,Fh as lE,qe as lF,RSe as lG,Xh as lH,zCe as lI,$1 as lJ,v1e as lK,ys as lL,M7 as lM,Yu as lN,JB as lO,Kl as lP,XLt as lQ,Ah as lR,yi as lS,Vo as lT,kyt as lU,Tyt as lV,put as lW,ylt as lX,mbi as lY,$Zt as lZ,_bi as l_,v_ as la,nH as lb,q4 as lc,yfi as ld,Sfi as le,XXe as lf,Z4 as lg,EQ as lh,So as li,pe as lj,psi as lk,R1e as ll,zi as lm,QXe as ln,Dm as lo,iAt as lp,flt as lq,smt as lr,Lme as ls,e1t as lt,pae as lu,ege as lv,WNt as lw,ydi as lx,bdi as ly,zZt as lz,ar as m,kt as m$,NHt as m0,tdi as m1,bo as m2,Sc as m3,Iye as m4,g_ as m5,REi as m6,gf as m7,kD as m8,QUe as m9,Gje as mA,Kje as mB,wF as mC,Ph as mD,kE as mE,Ext as mF,zNt as mG,Zv as mH,zs as mI,wdi as mJ,Ad as mK,Zk as mL,ou as mM,Rdt as mN,jJt as mO,ASe as mP,rf as mQ,iM as mR,JJt as mS,eei as mT,Bd as mU,Hoe as mV,Gp as mW,gei as mX,zu as mY,W7e as mZ,zSi as m_,vNt as ma,Yb as mb,fHt as mc,cbi as md,dbi as me,LC as mf,E5 as mg,W_i as mh,Vqe as mi,Ni as mj,IJ as mk,N8e as ml,K4 as mm,dSe as mn,gFt as mo,sht as mp,Swi as mq,F_i as mr,tfe as ms,_Nt as mt,kN as mu,Pt as mv,he as mw,ce as mx,C_ as my,xI as mz,Y1e as n,GI as n$,nbi as n0,T2 as n1,Bj as n2,uBt as n3,mmt as n4,GSi as n5,iye as n6,C1 as n7,Fy as n8,Aae as n9,Hd as nA,ymt as nB,OGe as nC,ok as nD,Nfi as nE,Pfi as nF,PKe as nG,Fft as nH,Efi as nI,jgi as nJ,$gi as nK,Lfi as nL,Xmt as nM,Rfi as nN,Lh as nO,cgi as nP,DKe as nQ,Mfi as nR,agi as nS,$f as nT,vfi as nU,$ge as nV,lw as nW,vwi as nX,Mc as nY,_w as nZ,Qa as n_,qo as na,gX as nb,$Si as nc,qSi as nd,$ae as ne,et as nf,fTt as ng,mQe as nh,NQ as ni,Hgi as nj,Wvi as nk,T0t as nl,vZe as nm,Vgi as nn,z0e as no,ig as np,ru as nq,soe as nr,nri as ns,sAe as nt,vbi as nu,xVt as nv,uX as nw,Afi as nx,IKe as ny,gdi as nz,DPe as o,uLt as o$,bYe as o0,jge as o1,aE as o2,P_ as o3,Ys as o4,yd as o5,hr as o6,Eae as o7,ol as o8,I as o9,hQe as oA,nw as oB,UIt as oC,c1 as oD,zS as oE,BQe as oF,lQe as oG,epi as oH,Tnt as oI,fi as oJ,uf as oK,lf as oL,oee as oM,q5e as oN,Rnt as oO,vae as oP,tRe as oQ,iLt as oR,LQe as oS,lRe as oT,hLt as oU,PQe as oV,Il as oW,GIt as oX,dQ as oY,cpi as oZ,cRe as o_,NX as oa,b2 as ob,n0 as oc,vF as od,A4e as oe,vw as of,Oqe as og,b0e as oh,yj as oi,hI as oj,cl as ok,jA as ol,ek as om,fm as on,YCe as oo,act as op,V3 as oq,QP as or,h7 as os,wX as ot,ree as ou,z5e as ov,aQ as ow,gQe as ox,fQe as oy,uQe as oz,bp as p,K5 as p$,ku as p0,wae as p1,rRe as p2,DQe as p3,xh as p4,Vg as p5,AQe as p6,dLt as p7,fLt as p8,lLt as p9,Dv as pA,BHe as pB,Vu as pC,s8 as pD,r8 as pE,XNt as pF,c0 as pG,dJe as pH,wf as pI,fdi as pJ,wH as pK,Yat as pL,YRe as pM,mg as pN,Px as pO,Y_i as pP,Z_i as pQ,jNt as pR,OHe as pS,J_i as pT,evi as pU,sMt as pV,FHe as pW,MHe as pX,dE as pY,OJe as pZ,aee as p_,cLt as pa,JPt as pb,vhe as pc,aje as pd,ffi as pe,ufi as pf,i4e as pg,T3t as ph,Hke as pi,G9 as pj,RE as pk,Iy as pl,SC as pm,Tfi as pn,Znt as po,lme as pp,Dle as pq,jae as pr,WHe as ps,Op as pt,Q_i as pu,kWe as pv,Nf as pw,YNt as px,y_i as py,RC as pz,_ee as q,Bu as q$,D3e as q0,y4t as q1,c_ as q2,Aki as q3,ifi as q4,gI as q5,qY as q6,bI as q7,l5e as q8,gNt as q9,Uj as qA,uet as qB,cMt as qC,Sz as qD,oht as qE,Ovi as qF,Bvi as qG,D7e as qH,gH as qI,Dw as qJ,iV as qK,wm as qL,Jke as qM,tIe as qN,Qke as qO,eIe as qP,iIe as qQ,Zke as qR,sIe as qS,nIe as qT,rIe as qU,aIe as qV,qOt as qW,zOt as qX,lIe as qY,Lpi as qZ,ygi as q_,O_ as qa,J6 as qb,E6 as qc,sCi as qd,Fvi as qe,ILe as qf,yW as qg,zDe as qh,$De as qi,qDe as qj,GDe as qk,VDe as ql,UDe as qm,YDe as qn,Qk as qo,hX as qp,yt as qq,tD as qr,Nh as qs,TX as qt,Vs as qu,dpe as qv,odi as qw,Kd as qx,jZ as qy,gPe as qz,TUt as r,Ol as r$,Y6 as r0,b0 as r1,ez as r2,jRe as r3,u5e as r4,Nnt as r5,xFe as r6,e3t as r7,qsi as r8,t3t as r9,um as rA,BI as rB,_E as rC,Wyi as rD,Fa as rE,I4t as rF,T4t as rG,Uyi as rH,sm as rI,Fe as rJ,Ooe as rK,x1e as rL,D1e as rM,w1e as rN,k1e as rO,I1e as rP,bpt as rQ,Kfe as rR,nKe as rS,z4 as rT,dKe as rU,up as rV,hc as rW,l6 as rX,dB as rY,$yi as rZ,$ze as r_,w0t as ra,Kae as rb,udi as rc,$fe as rd,zfe as re,ju as rf,iu as rg,Hn as rh,hd as ri,Hyi as rj,sE as rk,BE as rl,m9 as rm,Re as rn,tf as ro,_c as rp,Vyi as rq,R4t as rr,yo as rs,u1 as rt,Jft as ru,zk as rv,Z$ as rw,Hr as rx,Rd as ry,Wa as rz,f as s,SHe as s$,Kyi as s0,Gyi as s1,jyi as s2,Yyi as s3,Xyi as s4,Jyi as s5,Zyi as s6,Qyi as s7,m5e as s8,N4t as s9,Fxi as sA,Rpe as sB,DA as sC,z1 as sD,pfi as sE,pKe as sF,bUt as sG,OZe as sH,eN as sI,die as sJ,ZJe as sK,f5e as sL,ywt as sM,zve as sN,Fit as sO,kdi as sP,x as sQ,Vn as sR,SP as sS,G_i as sT,cte as sU,JQe as sV,O_i as sW,s_i as sX,n_i as sY,V_i as sZ,yNt as s_,QSe as sa,ldi as sb,yte as sc,bte as sd,sSi as se,v5e as sf,Ye as sg,pW as sh,WP as si,bl as sj,pJt as sk,mJt as sl,Zhe as sm,bbt as sn,_B as so,Wgi as sp,Bgi as sq,kI as sr,Nki as ss,Mki as st,eci as su,QJe as sv,yPt as sw,Bf as sx,Pki as sy,nze as sz,ke as t,q_i as t0,wlt as t1,jh as t2,Fdt as t3,p7 as t4,sv as t5,z_i as t6,jde as t7,pN as t8,IL as t9,D8 as ta,v0e as tb,ci as tc,eze as td,toe as te,CA as tf,vdi as tg,sze as th,Wxi as ti,Bxi as tj,Oxi as tk,Hxi as tl,Vxi as tm,Uxi as tn,Mxi as to,Cki as tp,nh as u,hwt as v,Na as w,mi as x,ao as y,Rt as z};
|